:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #17212b;
    --muted: #5b6875;
    --border: #d6dde4;
    --accent: #0b6e99;
    --accent-text: #ffffff;
    --ok: #1d7a46;
    --warn: #8a5a00;
    --bad: #b3261e;
    --drop-bg: #eef5f9;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1419;
        --surface: #182029;
        --text: #e6ebf0;
        --muted: #9aa7b4;
        --border: #2c3946;
        --accent: #4fb3e0;
        --accent-text: #0f1419;
        --ok: #5cc98a;
        --warn: #e0b04f;
        --bad: #f2867f;
        --drop-bg: #1c2a35;
    }
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font:
        16px/1.5 system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        sans-serif;
}

h1 {
    font-size: 1.4rem;
    margin: 0 0 0.5rem;
}

h2 {
    font-size: 1.1rem;
    margin: 0;
}

p {
    margin: 0.5rem 0;
}

.masthead {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.25rem 16px 0.5rem;
}

.brand-logo {
    display: block;
    height: 36px;
    width: auto;
}

@media (prefers-color-scheme: dark) {
    .brand-logo {
        filter: brightness(1.3);
    }
}

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 3rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.875rem;
}

.error {
    color: var(--bad);
}

.notice {
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.button {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.button.primary {
    background: var(--accent);
    color: var(--accent-text);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button:focus-visible,
.dropzone:focus-within {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.facts div {
    margin: 0;
}

.facts dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.facts dd {
    margin: 0;
    font-weight: 600;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: var(--drop-bg);
    padding: 1.5rem 1rem;
    text-align: center;
}

.dropzone.active {
    border-color: var(--accent);
}

.dropzone.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.dropzone-title {
    font-weight: 600;
    margin: 0;
}

.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.file-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.file {
    border-top: 1px solid var(--border);
    padding: 0.75rem 0;
}

.file-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

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

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

.file-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.file-state progress {
    flex: 1;
    max-width: 260px;
    height: 0.6rem;
}

.file-reason {
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.status-received {
    color: var(--ok);
}

.status-checking,
.status-review,
.status-busy {
    color: var(--warn);
}

.status-not_accepted,
.status-failed {
    color: var(--bad);
}

.status-cancelled,
.status-waiting {
    color: var(--muted);
}
