/* OLV Monitor: white + muted gold. Shared tokens, controls and sign-in pages (public asset).
   Tokens and rationale: docs/design/local-ui-brief.md ("White and gold" section). */
:root {
    --bg: #ffffff;           /* page: pure white, no grey wash */
    --surface: #ffffff;
    --surface-2: #fafaf8;    /* table heads, hover rows only */
    --line: #e8e6e1;
    --line-strong: #d4d1c9;
    --ink: #15171b;
    --ink-2: #3c4047;        /* 10.6:1 on white */
    --ink-3: #5d626a;        /* 6.1:1 on white */
    --gold: #a9822f;         /* single accent: fills, rules, focus — never body text on white */
    --gold-hover: #957226;
    --gold-ink: #7a5b1c;     /* gold when it has to be text: 6.4:1 on white */
    --gold-tint: #f8f4ea;    /* selected nav / in-stream tag background */
    --gold-line: #e3d4ae;
    --ok: #1f6a3d;
    --warn: #8a4b08; --warn-tint: #fbf3e6;
    --bad: #a3231f; --bad-tint: #fcefee;
    --r-sm: 6px; --r: 8px; --r-lg: 10px;
    --font: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; }
::selection { background: #efe3c4; color: var(--ink); }
input, select, button { font: inherit; color: inherit; }
input { caret-color: var(--gold); }
a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }

h1 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; }
.logo { width: 22px; height: 22px; border-radius: 5px; background: var(--ink); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; left: 8px; top: 6px; border-left: 8px solid var(--gold); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease); }
.btn:hover { background: var(--surface-2); border-color: #bfbbb1; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; } /* ink on gold: 5.6:1 */
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: #fff; }
.btn-primary:disabled:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-danger { color: var(--bad); border-color: #e6c3c0; }
.btn-danger:hover { background: var(--bad-tint); color: var(--bad); border-color: #dca9a5; }
.btn-link { border: 0; background: none; color: var(--ink-2); padding: 0 4px; min-height: 32px; cursor: pointer; font-weight: 500; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.btn-link:hover { color: var(--gold-ink); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.tag-gold { background: var(--gold-tint); color: var(--gold-ink); border-color: var(--gold-line); }
.tag-warn { background: var(--warn-tint); color: var(--warn); border-color: #ecd5b4; }
.tag-bad { background: var(--bad-tint); color: var(--bad); border-color: #ecc6c3; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin: 6px 0 -2px; font-size: 14px; font-weight: 600; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.form-field textarea { resize: vertical; font: 13px/1.45 var(--mono); overflow-wrap: anywhere; }
.form-field input:hover, .form-field textarea:hover, .form-field select:hover { border-color: #bfbbb1; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169, 130, 47, .18); }
.form-field [aria-invalid="true"] { border-color: var(--bad); }
.form-field input:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.form-hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.form-error { margin: 0; color: var(--bad); font-size: 13px; }
.form-ok { margin: 0; color: var(--ok); font-size: 13px; }
.form-error:empty, .form-ok:empty { display: none; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pw { position: relative; }
.pw input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-toggle:disabled { cursor: not-allowed; opacity: .5; }
.btn-block { width: 100%; min-height: 42px; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; padding: 0; }
.spinner { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.is-busy .spinner { display: inline-block; }
.is-busy { cursor: progress; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--bg); }
.auth-card { width: min(400px, 100%); animation: rise .24s var(--ease) both; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 15px; }
.auth-brand strong { font-weight: 650; letter-spacing: -0.01em; }
.auth h1 { font-size: 24px; margin-bottom: 6px; }
.auth-lead { margin: 0 0 24px; color: var(--ink-2); }
.auth .btn-primary { margin-top: 4px; }
.auth-notice { margin-bottom: 14px; }
.auth-foot { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
code { font: 12px/1.5 var(--mono); background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
