/* Chivo and Chivo Mono, served from this site (SIL Open Font License, see /static/fonts/OFL.txt) */
@font-face { font-family: "Chivo"; src: url("/static/fonts/chivo.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Chivo Mono"; src: url("/static/fonts/chivo-mono.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
/* Shared look for the site pages (landing, login, account, admin, legal). The desk keeps its own copy of
   these tokens so it stays one file. Cool greys, UP blue, DOWN orange, model magenta. */
:root {
  --bg: #edf0f3; --surface: #ffffff; --surface-2: #f6f8fa; --sunk: #e4e9ee; --chip: #e9edf1;
  --line: #dfe4ea; --line-2: #c9d1da;
  --ink: #0e141b; --ink-2: #46515f; --muted: #6b7684;
  --up: #2a78d6; --up-soft: rgba(42,120,214,0.12);
  --down: #eb6834; --down-soft: rgba(235,104,52,0.13);
  --model: #c0399f; --model-soft: rgba(192,57,159,0.12);
  --good: #0b7a0b; --bad: #c23030; --warn: #9a5b00;
  --good-soft: rgba(11,122,11,0.10); --bad-soft: rgba(194,48,48,0.10); --warn-soft: rgba(154,91,0,0.12);
  --shadow: 0 1px 0 rgba(14,20,27,0.04), 0 1px 2px rgba(14,20,27,0.06);
  --lift: 0 10px 30px rgba(14,20,27,0.10);
  --sans: "Chivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Chivo Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 12px; --r-sm: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e13; --surface: #10151c; --surface-2: #141a22; --sunk: #1a212b; --chip: #18202a;
    --line: #1e2631; --line-2: #2c3542;
    --ink: #e5eaf0; --ink-2: #a7b1bd; --muted: #7c8794;
    --up: #3987e5; --up-soft: rgba(57,135,229,0.16);
    --down: #d95926; --down-soft: rgba(217,89,38,0.18);
    --model: #d65bb8; --model-soft: rgba(214,91,184,0.16);
    --good: #2fb54f; --bad: #ec5a52; --warn: #e8a33a;
    --good-soft: rgba(47,181,79,0.13); --bad-soft: rgba(236,90,82,0.14); --warn-soft: rgba(232,163,58,0.14);
    --shadow: 0 1px 0 rgba(0,0,0,0.3); --lift: 0 12px 34px rgba(0,0,0,0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0e13; --surface: #10151c; --surface-2: #141a22; --sunk: #1a212b; --chip: #18202a;
  --line: #1e2631; --line-2: #2c3542;
  --ink: #e5eaf0; --ink-2: #a7b1bd; --muted: #7c8794;
  --up: #3987e5; --up-soft: rgba(57,135,229,0.16);
  --down: #d95926; --down-soft: rgba(217,89,38,0.18);
  --model: #d65bb8; --model-soft: rgba(214,91,184,0.16);
  --good: #2fb54f; --bad: #ec5a52; --warn: #e8a33a;
  --good-soft: rgba(47,181,79,0.13); --bad-soft: rgba(236,90,82,0.14); --warn-soft: rgba(232,163,58,0.14);
  --shadow: 0 1px 0 rgba(0,0,0,0.3); --lift: 0 12px 34px rgba(0,0,0,0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--up); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1120px; margin: 0 auto; }
.narrow { max-width: 760px; margin: 0 auto; }

/* brand mark: a strike line with the model dot riding it */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; text-decoration: none; white-space: nowrap; }
.mark { width: 26px; height: 18px; position: relative; flex: none; }
.mark::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--ink); border-radius: 2px; }
.mark::after { content: ""; position: absolute; left: 15px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--model); box-shadow: 0 0 0 2px var(--surface); }

/* top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 58px; padding-block: 8px; }
.topbar nav { display: flex; gap: 4px; align-items: center; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.navlink { padding: 6px 10px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600; border: 0; background: none; }
.navlink:hover { color: var(--ink); background: var(--surface-2); }
.navlink[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px; padding: 9px 15px; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { opacity: 0.9; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.big { padding: 13px 20px; font-size: 15px; border-radius: 10px; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; font-weight: 600; }
.linkbtn:hover { color: var(--ink); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea, .input {
  width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 10px 12px; font-size: 15px; font-weight: 400; color: var(--ink);
}
.field textarea { font-family: var(--mono); font-size: 12px; min-height: 120px; resize: vertical; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--up-soft); border-color: var(--up); }
.field input[type="file"] { font-size: 14px; font-weight: 400; color: var(--ink-2); max-width: 100%; }
.field input[type="file"]::file-selector-button { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 10px; margin-right: 10px; cursor: pointer; }
.field input[type="file"]::file-selector-button:hover { border-color: var(--ink-2); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-error { color: var(--bad); font-size: 13.5px; font-weight: 600; }
.form-ok { color: var(--good); font-size: 13.5px; font-weight: 600; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 20px 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.cluster { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 64ch; }
.note { font-size: 13px; color: var(--muted); max-width: 80ch; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.ok { background: var(--good); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.tri { display: inline-block; width: 0; height: 0; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; vertical-align: 1px; }
.tri.up { border-bottom: 7px solid var(--up); }
.tri.down { border-top: 7px solid var(--down); }
.pos { color: var(--good); } .neg { color: var(--bad); }
.codebox { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: nowrap; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
td.r, th.r { text-align: right; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }

/* toasts */
.toasts { position:static; max-width:1280px; margin:12px auto 0; padding:0 24px; display:flex; flex-direction:column; gap:8px; }.toasts:empty { display:none; }
.toast { background:var(--surface-2); color:var(--ink); border:1px solid var(--line); border-radius:10px; padding:11px 14px; font-size:14px; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding-block: 28px 40px; color: var(--muted); font-size: 13px; }
.foot-in { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
.foot a { color: var(--ink-2); }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .pad { padding: 16px; }
  .lead { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.hide { display: none !important; }
