* {
    box-sizing: border-box;
}

:root {
    --brand-gradient: linear-gradient(90deg, #3478c8 0%, #6ab7f3 52%, #3478c8 100%);
    --app-sticky-head-height: 112px;
}

body {
    margin: 0;
    background: #eeeeee;
    color: #222222;
    font-family: "Lucida Grande", Verdana, Arial, sans-serif;
    font-size: 12px;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell,
.login-shell {
    min-height: 100vh;
    background: #eeeeee;
}

.brand-header,
.brand-footer {
    min-height: 40px;
    display: flex;
    align-items: center;
    background: var(--brand-gradient);
    border-bottom: 1px solid #8dbde3;
}

.brand-title {
    padding: 0 min(260px, 52vw) 0 16px;
    font-weight: 700;
    color: #111111;
}

.build-number {
    font-size: 11px;
    font-weight: 600;
}

.app-sticky-head {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flow-root;
    background: #eeeeee;
}

.brand-footer {
    margin-top: 18px;
    padding-left: 18px;
    border-top: 1px solid #c2d2de;
    border-bottom: 0;
}

.logout-form {
    position: absolute;
    top: 7px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.logged-in-user {
    display: inline-flex;
    align-items: center;
    max-width: min(20ch, calc(100vw - 78px));
    height: 26px;
    padding: 0 6px;
    overflow: hidden;
    color: #12324f;
    font-weight: 700;
    line-height: 26px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form button {
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    line-height: 1;
}

.logout-form img {
    display: block;
    width: 18px;
    height: 18px;
}

.manager-form {
    margin: 0;
}

.toolbar-band,
.path-band,
.content-band,
.message {
    margin: 8px 18px;
}

.toolbar-band {
    padding: 6px 0;
    background: #eeeeee;
    border-bottom: 4px solid;
    border-image: var(--brand-gradient) 1;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.smallbutton,
.button {
    min-height: 26px;
    padding: 3px 9px;
    border: 1px solid #666666;
    border-radius: 4px;
    background: #ffffff;
    color: #555555;
}

.smallbutton:hover:not(:disabled),
.button:hover:not(:disabled) {
    background: #cccccc;
    color: #000000;
}

.button-primary {
    border-color: #2c5d8f;
    background: #eeeeff;
    color: #003366;
}

.button-danger {
    border-color: #bb3333;
    color: #8c1f1f;
}

.button-light {
    border-color: #9aa8b4;
}

button:disabled {
    cursor: default;
    opacity: 0.45;
}

.path-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.size-button {
    margin-left: auto;
}

.path-label {
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.addrnav,
.addrna2 {
    border: 1px solid #aaaaff;
    border-radius: 3px;
    background: #eeeeff;
    color: #000055;
    padding: 2px 6px;
    white-space: nowrap;
}

.addrnav:hover {
    background: #aacccc;
}

.addrna2 {
    cursor: default;
}

.message {
    padding: 8px 10px;
    border-radius: 4px;
}

.message-error {
    border: 1px solid #ff0000;
    background: #f8e8d8;
    color: #cc0000;
}

.message-success {
    border: 1px solid #58a05c;
    background: #e5f4df;
    color: #1f6b24;
}

.message-warning {
    border: 1px solid #d7a900;
    background: #fff6c8;
    color: #765800;
}

.message-info {
    border: 1px solid #aaaaff;
    background: #eeeeff;
    color: #003366;
}

.login-message-detail {
    display: inline-block;
    margin-top: 3px;
    font-size: 11px;
}

.file-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    background: #dddddd;
    border: 1px solid #bbd2e0;
}

.file-table th {
    padding: 4px 5px;
    text-align: center;
    white-space: nowrap;
    font-weight: 700;
}

.file-table:not(.picker-table) thead th {
    position: sticky;
    top: var(--app-sticky-head-height);
    z-index: 70;
    background: #dddddd;
}

.file-table td {
    padding: 3px 5px;
    background: #eeeeee;
    vertical-align: middle;
    white-space: nowrap;
}

.file-table tr:hover td {
    background: #ddddaa;
    color: #000000;
}

.file-table tr.is-selected td {
    background: #bbbbbb;
}

.select-col {
    width: 36px;
    text-align: center;
}

.icon-col,
.sort-col {
    width: 24px;
    text-align: center;
}

.icon-col img,
.sort-button img {
    width: 16px;
    height: 16px;
}

.sort-button {
    border: 0;
    background: transparent;
    padding: 0;
}

.table-link,
.link-button {
    border: 0;
    background: transparent;
    color: #0000dd;
    padding: 0;
    text-align: left;
}

.table-link {
    color: #903333;
    font-weight: 700;
}

.link-button:hover {
    text-decoration: underline;
}

.file-table td.name-cell {
    padding: 0;
}

.name-link {
    display: block;
    width: 100%;
    padding: 3px 5px;
    box-sizing: border-box;
}

.cellblk {
    font-family: Consolas, "Courier New", monospace;
}

.cellred {
    color: #ff0000;
    font-family: Consolas, "Courier New", monospace;
}

.celllnk,
.link {
    color: #903333;
    font-family: Consolas, "Courier New", monospace;
}

.size-cell {
    text-align: right;
}

.action-panel {
    max-width: 980px;
    margin: 14px auto;
    padding: 14px;
    border: 1px solid #bbd2e0;
    border-radius: 6px;
    background: #f8f8f8;
}

.action-panel h2,
.folder-picker h3 {
    margin: 0 0 12px;
    color: #003366;
    font-size: 15px;
}

.selection-list {
    width: 100%;
    max-height: 170px;
    margin-bottom: 10px;
    border: 1px solid #aaaaff;
    border-radius: 4px;
    background: #ddddff;
    resize: none;
    overflow-y: auto;
    font-family: Consolas, "Courier New", monospace;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.inline-field,
.file-input,
.login-form label {
    display: grid;
    gap: 4px;
    margin-bottom: 9px;
}

.inline-field {
    grid-template-columns: 130px minmax(220px, 1fr);
    align-items: center;
}

.inline-field input,
.login-form input,
.code-editor {
    border: 1px solid #9aa8b4;
    border-radius: 4px;
    background: #ffffff;
    padding: 5px 7px;
}

.file-input-control {
    width: 100%;
    min-height: 34px;
    border: 1px solid #9aa8b4;
    border-radius: 4px;
    background: #ffffff;
    padding: 4px 7px;
}

.file-input-control::file-selector-button {
    min-height: 26px;
    margin-right: 8px;
    padding: 3px 9px;
    border: 1px solid #666666;
    border-radius: 4px;
    background: #ffffff;
    color: #555555;
    font: inherit;
    cursor: pointer;
}

.file-input-control:hover::file-selector-button {
    background: #cccccc;
    color: #000000;
}

.hint {
    color: #003366;
    font-size: 11px;
}

.upload-size-error {
    margin: 8px 0 0;
}

.upload-limit-hint {
    margin-top: -4px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
}

.permission-grid fieldset {
    min-width: 0;
    padding: 8px 10px 10px;
    border: 1px solid #bbd2e0;
    border-radius: 5px;
    background: #eeeeee;
}

.permission-role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 12px;
}

.permission-role {
    min-width: 0;
}

.permission-role h3 {
    margin: 0 0 5px;
    color: #000000;
    font-size: 12px;
    font-weight: normal;
}

.permission-grid .permission-choice {
    display: flex;
    gap: 5px;
    align-items: center;
    margin: 3px 0;
    white-space: nowrap;
}

.permission-role select {
    width: 48px;
    min-height: 28px;
    margin-top: 5px;
}

.permission-selection {
    display: grid;
    gap: 4px;
    margin-top: 12px;
}

.permission-selection-list {
    min-height: 78px;
    margin-bottom: 0;
    overflow: auto;
    resize: vertical;
    line-height: 1.45;
}

.check-line {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-top: 10px;
}

.folder-picker {
    margin-top: 14px;
}

.picker-path {
    margin-bottom: 8px;
    color: #003366;
}

.picker-table td {
    white-space: nowrap;
}

.editor-panel {
    max-width: none;
}

.code-editor {
    width: 100%;
    min-height: 430px;
    overflow: auto;
    resize: vertical;
    background: #fdfdff;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.45;
}

.login-shell {
    display: flex;
    flex-direction: column;
}

.login-panel {
    width: min(420px, calc(100% - 36px));
    margin: 56px auto 0;
    padding: 20px;
    border: 1px solid #bbd2e0;
    border-radius: 6px;
    background: #f8f8f8;
}

.login-panel h1 {
    margin: 0 0 16px;
    color: #003366;
    font-size: 18px;
}

.login-form {
    display: grid;
    gap: 10px;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    visibility: hidden;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 1000;
}

.modal.is-visible {
    visibility: visible;
    opacity: 1;
}

.modal-dialog {
    min-width: 220px;
    padding: 18px 22px;
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    text-align: center;
    font-size: 18px;
}

@media (max-width: 760px) {
    .brand-title {
        width: auto;
        padding-left: 12px;
        text-align: left;
    }

    .toolbar-band,
    .path-band,
    .content-band,
    .message {
        margin-left: 10px;
        margin-right: 10px;
    }

    .inline-field,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .file-table {
        display: block;
        overflow-x: auto;
    }
}
