/* PictureSync website theme. Light and dark follow the system setting (FR-018, FR-019).
   Every text/background pair below meets WCAG 2.1 AA (at least 4.5:1). */
:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --surface: #f3f4f6;
    --text: #111827;       /* 17.7:1 on --bg */
    --muted: #4b5563;      /* 7.6:1 on --bg */
    --border: #9ca3af;
    --primary: #1d4ed8;    /* 6.7:1 on --bg; white text on it 6.7:1 */
    --on-primary: #ffffff;
    --success: #166534;    /* 7.1:1 */
    --warning: #92400e;    /* 7.1:1 */
    --danger: #b91c1c;     /* 6.5:1 */
    --focus: #1d4ed8;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0f14;
        --surface: #161b22;
        --text: #e6edf3;       /* 16.1:1 on --bg */
        --muted: #9aa4af;      /* 7.6:1 on --bg */
        --border: #4b5563;
        --primary: #7ab7ff;    /* 9.3:1 on --bg; dark text on it 9.3:1 */
        --on-primary: #0b0f14;
        --success: #6ee7a0;    /* 12.4:1 */
        --warning: #fbbf5a;    /* 11.4:1 */
        --danger: #ff8f8f;     /* 8.4:1 */
        --focus: #7ab7ff;
    }
}

* { box-sizing: border-box; }

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

a { color: var(--primary); }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem; }

.top {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.top nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; }

.page { max-width: 64rem; margin: 0 auto; padding: 1rem; }

.card {
    display: grid;
    gap: .5rem;
    max-width: 32rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: var(--surface);
}

label { font-weight: 600; }

input {
    font: inherit;
    padding: .5rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: .375rem;
}

button, .button {
    font: inherit;
    display: inline-block;
    padding: .5rem 1rem;
    border-radius: .375rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
button.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.link { border: 0; background: none; color: var(--primary); text-decoration: underline; padding: 0; }
button:disabled { opacity: .6; cursor: not-allowed; }

.inline { display: inline; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.muted { color: var(--muted); }

.notice {
    padding: .75rem 1rem;
    border-left: 4px solid var(--primary);
    background: var(--surface);
}
.notice.warning { border-color: var(--warning); }
.notice.danger { border-color: var(--danger); }

.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.5rem; letter-spacing: .15em; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); }

.status, .files .state { font-weight: 600; }
.s-success, .state.ok { color: var(--success); }
.s-partialsuccess, .s-needsattention, .state.warn { color: var(--warning); }
.s-failure, .state.bad { color: var(--danger); }
.s-nothingtosync { color: var(--muted); }

.files { list-style: none; padding: 0; }
.files li { display: flex; justify-content: space-between; gap: 1rem; padding: .375rem 0; border-bottom: 1px solid var(--border); }
.files progress { width: 8rem; }

.pager { display: flex; gap: 1rem; margin-top: 1rem; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
