@font-face {
    font-display: swap;
    font-family: "Atkinson Hyperlegible";
    font-style: normal;
    font-weight: 400;
    src: url("fonts/atkinson-hyperlegible-400.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: "Atkinson Hyperlegible";
    font-style: normal;
    font-weight: 700;
    src: url("fonts/atkinson-hyperlegible-700.ttf") format("truetype");
}

:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --bg-accent: #eaf3f1;
    --panel: #ffffff;
    --panel-soft: #f9fbfd;
    --text: #1f2a37;
    --muted: #667085;
    --line: #d7dee8;
    --line-strong: #bcc8d8;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #e8f0ff;
    --teal: #0f9f8f;
    --danger: #b42318;
    --danger-soft: #fff1f0;
    --ok: #067647;
    --ok-soft: #ecfdf3;
    --warn-bg: #fff7df;
    --warn-text: #8a5a00;
    --input-bg: #ffffff;
    --button-text: #ffffff;
    --shadow: 0 8px 22px rgba(31, 42, 55, .07);
    --radius: 7px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(234, 243, 241, .72), rgba(245, 247, 251, 0) 240px),
        var(--bg);
    color: var(--text);
    font-family: "Atkinson Hyperlegible", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

code,
pre,
.file-meta {
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.brand span {
    color: var(--teal);
}

.icon {
    display: inline-block;
    flex: 0 0 auto;
    height: 1em;
    vertical-align: -0.15em;
    width: 1em;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.nav a {
    align-items: center;
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
    padding: 5px 9px;
}

.nav a:hover {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}

.nav a[aria-current="page"] {
    color: var(--accent);
    font-weight: 700;
}

.page {
    margin: 0 auto;
    max-width: 1120px;
    padding: 28px 20px 48px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.stack {
    display: grid;
    gap: 16px;
}

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.action-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: block;
    min-height: 104px;
    padding: 18px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.action-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    text-decoration: none;
    transform: translateY(-1px);
}

.action-card strong {
    align-items: center;
    color: var(--text);
    display: flex;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 6px;
}

.action-card .icon {
    color: var(--teal);
    height: 18px;
    width: 18px;
}

.action-card span,
.muted {
    color: var(--muted);
}

h1,
h2 {
    line-height: 1.18;
    margin: 0 0 10px;
}

h1 {
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: 0;
}

h2 {
    font-size: 19px;
}

p {
    margin: 0 0 12px;
}

.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.public-header {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.file-workspace {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.file-browser-panel {
    min-height: 460px;
    padding: 0;
}

.file-browser-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 18px 20px 14px;
}

.file-browser-head h2 {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 7px;
}

.file-browser-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.file-browser-meta {
    align-items: center;
    background: var(--panel-soft);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    justify-content: space-between;
    padding: 8px 20px;
}

.file-browser-panel .file-list {
    padding: 12px;
}

.empty-state {
    display: grid;
    min-height: 220px;
    place-items: center;
    text-align: center;
}

.side-tools {
    display: grid;
    gap: 12px;
}

.tool-panel {
    background: rgba(255, 255, 255, .74);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px;
}

.tool-panel h2 {
    align-items: center;
    display: flex;
    font-size: 16px;
    gap: 7px;
    margin-bottom: 10px;
}

.tool-panel .stack {
    gap: 11px;
}

.quota-card {
    background: rgba(255, 255, 255, .74);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    max-width: 360px;
    padding: 15px;
}

.quota-card-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.quota-card h2 {
    align-items: center;
    display: flex;
    font-size: 16px;
    gap: 7px;
    margin: 0;
}

.quota-card p,
.quota-compact p {
    font-size: 13px;
    margin-bottom: 7px;
}

.button,
button {
    align-items: center;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--button-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
}

.button .icon,
button .icon {
    height: 15px;
    width: 15px;
}

.button:hover,
button:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--button-text);
    text-decoration: none;
}

.button.secondary,
button.secondary {
    background: #ffffff;
    border-color: var(--line-strong);
    color: var(--accent);
}

.button.secondary:hover,
button.secondary:hover {
    background: var(--accent-soft);
    border-color: #a8b8d3;
    color: var(--accent);
}

.button.danger,
button.danger {
    background: #ffffff;
    border-color: #f1b8b3;
    color: var(--danger);
}

.button.danger:hover,
button.danger:hover {
    background: var(--danger-soft);
    border-color: #df8b83;
    color: var(--danger);
}

button:disabled,
button:disabled:hover {
    background: #f5f7fa;
    border-color: var(--line);
    color: var(--muted);
    cursor: not-allowed;
    opacity: .75;
}

.button.small,
button.small {
    font-size: 12px;
    min-height: 30px;
    padding: 4px 9px;
}

form {
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 13px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 6px;
    align-content: start;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    margin: 0;
}

.field.full {
    grid-column: 1 / -1;
}

.share-form-panel {
    scroll-margin-top: 76px;
}

.share-form-panel .field.full {
    grid-column: 1 / -1;
}

label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.field-label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.optional-label {
    color: var(--muted);
    font-weight: 400;
}

input,
select,
textarea {
    background: var(--input-bg);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    min-height: 36px;
    padding: 7px 9px;
    width: 100%;
}

select {
    padding-right: 34px;
}

textarea {
    min-height: 84px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: #df8b83;
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .10);
}

input[type="checkbox"] {
    min-height: 0;
    width: auto;
}

.file-input-native {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.dropzone {
    align-items: center;
    background: var(--panel-soft);
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 5px;
    justify-items: center;
    min-height: 132px;
    padding: 18px 14px;
    text-align: center;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.dropzone span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.dropzone-icon {
    color: var(--teal);
    height: 28px;
    width: 28px;
}

.input-action,
.link-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.input-action input {
    min-width: 0;
}

.link-actions {
    flex-wrap: wrap;
}

.folder-link {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.folder-link .icon {
    color: var(--teal);
    height: 15px;
    width: 15px;
}

.share-dialog {
    background: transparent;
    border: 0;
    color: var(--text);
    max-width: min(920px, calc(100vw - 32px));
    padding: 0;
    width: 920px;
}

.share-dialog::backdrop {
    background: rgba(15, 23, 42, .44);
}

.share-dialog-content {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 24px 58px rgba(31, 42, 55, .22);
    padding: 20px;
}

.share-dialog-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.share-dialog-header h2 {
    margin: 0;
}

.share-present {
    align-items: center;
    display: grid;
    gap: 26px;
    grid-template-columns: auto minmax(0, 1fr);
}

.share-qr-code {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.qr-svg {
    display: block;
    height: min(48vh, 420px);
    max-height: 420px;
    max-width: 100%;
    width: min(48vh, 420px);
}

.share-link-box {
    display: grid;
    gap: 13px;
}

.share-link-box p {
    margin: 0;
}

.share-list-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: -20px -20px 14px;
    padding: 18px 20px 14px;
}

.share-list-head h2 {
    margin-bottom: 7px;
}

.share-list-head p {
    margin: 0;
}

.share-big-link {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    display: block;
    font-size: 18px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    padding: 15px;
}

.check-row {
    align-items: center;
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.check-stack {
    display: grid;
    gap: 8px;
    min-height: 36px;
}

.form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    font-size: 14px;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 9px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

tr:hover td {
    background: #fbfdff;
}

.badge {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
}

.badge.ok {
    background: var(--ok-soft);
    border-color: #abefc6;
    color: var(--ok);
}

.badge.off {
    background: var(--danger-soft);
    border-color: #f1b8b3;
    color: var(--danger);
}

.quota-meter {
    background: #e6ebf2;
    border-radius: 999px;
    height: 10px;
    margin: 8px 0 10px;
    overflow: hidden;
}

.quota-meter span {
    background: linear-gradient(90deg, var(--teal), var(--accent));
    display: block;
    height: 100%;
}

.notice {
    border: 1px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 14px;
    padding: 10px 12px;
}

.notice-success {
    background: var(--ok-soft);
    border-color: #abefc6;
    color: var(--ok);
}

.notice-error {
    background: var(--danger-soft);
    border-color: #f1b8b3;
    color: var(--danger);
}

.notice-info {
    background: var(--warn-bg);
    border-color: #f3d98b;
    color: var(--warn-text);
}

.file-list {
    display: grid;
    gap: 7px;
}

.file-row {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 48px;
    padding: 9px 11px;
}

a.file-row:hover {
    background: #fbfdff;
    border-color: var(--accent);
    color: var(--text);
    text-decoration: none;
}

.file-name {
    overflow-wrap: anywhere;
}

.file-title-link {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 8px;
    min-width: 0;
}

.file-icon {
    color: var(--teal);
    height: 18px;
    width: 18px;
}

.share-chips {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.file-browser-meta .share-chips {
    margin-top: 0;
}

.share-chip {
    align-items: center;
    background: var(--accent-soft);
    border: 1px solid #c9d8ff;
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    font-size: 12px;
    gap: 5px;
    max-width: 100%;
    padding: 3px 7px;
}

.share-chip.is-off {
    background: var(--panel-soft);
    border-color: var(--line);
    color: var(--muted);
}

.share-chip a {
    color: inherit;
}

.share-chip .icon {
    height: 13px;
    width: 13px;
}

.chip-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: inherit;
    display: inline-flex;
    min-height: 20px;
    padding: 2px;
}

.chip-button:hover {
    background: rgba(37, 99, 235, .12);
    color: inherit;
}

.file-meta {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.file-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.inline-form {
    align-items: center;
    display: flex;
    gap: 7px;
}

.inline-form input {
    background: var(--input-bg);
    color: var(--text);
    min-height: 30px;
    min-width: 180px;
    padding: 4px 8px;
}

.breadcrumb {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 6px;
}

pre.log {
    background: #101828;
    border: 1px solid #243145;
    border-radius: var(--radius);
    color: #e4e7ec;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    max-height: 620px;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
}

@media (max-width: 720px) {
    html {
        scroll-padding-top: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
        position: static;
    }

    .nav {
        justify-content: flex-start;
    }

    .page {
        padding: 22px 14px 38px;
    }

    .panel {
        padding: 16px;
    }

    .share-form-panel {
        scroll-margin-top: 16px;
    }

    .form-grid,
    .file-row,
    .file-workspace,
    .public-header,
    .share-present {
        grid-template-columns: 1fr;
    }

    .file-browser-head {
        display: grid;
        padding: 16px;
    }

    .file-browser-actions {
        justify-content: flex-start;
    }

    .file-browser-meta {
        padding: 8px 16px;
    }

    .public-header {
        display: grid;
    }

    .public-header button {
        width: 100%;
    }

    .share-dialog-content {
        padding: 16px;
    }

    .qr-svg {
        height: min(78vw, 360px);
        width: min(78vw, 360px);
    }

    .share-big-link {
        font-size: 15px;
    }

    .share-list-head {
        display: grid;
        margin: -16px -16px 14px;
        padding: 16px;
    }

    .file-meta {
        white-space: normal;
    }

    .file-actions,
    .inline-form,
    .input-action {
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
    }

    .inline-form input {
        min-width: 0;
    }
}
