/* venlytics team — tokens from core's docs/DESIGN_SYSTEM.md (light / dark). No build step. */
:root {
  --bg: #f4f6f8; --surface: #ffffff; --ink: #1f2933; --muted: #5b6770; --faint: #8797a4;
  --hair: #cdd5de; --hair-strong: #b7c1cc; --zebra: #f7f9fb; --secondary: #e8edf2;
  --chrome-bg: #334155; --chrome-hi: #3f5168; --accent: #0d9488; --accent-dark: #0f766e;
  --accent-wash: #e1f5ee; --warn-fg: #b45309; --warn-bg: #fef3c7; --danger: #c0392b;
  --radius-card: 10px; --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720; --surface: #16212e; --ink: #e6eef4; --muted: #9fb0bd; --faint: #6b7c8a;
    --hair: #243140; --hair-strong: #33475a; --zebra: #131e29; --secondary: #1e2b39;
    --chrome-bg: #0b1219; --chrome-hi: #1a2734; --accent: #14b8a6; --accent-dark: #0d9488;
    --accent-wash: #123634; --warn-fg: #fbbf24; --warn-bg: #3a2f12;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

/* top bar */
.topbar {
  background: var(--chrome-bg); color: #fff; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 2px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
         font-weight: 600; font-size: 17px; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand small { font-weight: 400; color: #cbd5e1; font-size: 14px; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.topbar .who { color: #cbd5e1; font-size: 14px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
main.narrow { max-width: 420px; padding-top: 48px; }

.card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-card);
  padding: 20px 22px;
}
.card + .card { margin-top: 16px; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--accent); font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 20px; }
.help { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

label { display: block; color: var(--muted); font-size: 13px; margin: 14px 0 4px; }
input[type=password], input[type=text] {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--hair-strong); border-radius: var(--radius);
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input.code { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

button {
  font: inherit; border-radius: var(--radius); padding: 8px 16px; cursor: pointer;
  border: 1px solid transparent;
}
button.primary { background: var(--accent); color: #fff; width: 100%; margin-top: 20px;
                 padding: 10px 16px; font-weight: 600; }
button.primary:hover { background: var(--accent-dark); }
button.outline { background: transparent; color: var(--ink); border-color: var(--hair-strong); }
.topbar button.outline { color: #fff; border-color: var(--chrome-hi); background: var(--chrome-hi); }
.topbar button { white-space: nowrap; }
button.outline:hover { border-color: var(--accent); }

.message { border-radius: var(--radius); padding: 10px 12px; margin: 0 0 16px; font-size: 14px; }
.message.error { background: var(--warn-bg); color: var(--warn-fg); }

.qr { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr svg { width: 220px; height: 220px; border-radius: var(--radius); border: 1px solid var(--hair); }
.secret { font-family: Consolas, "Cascadia Mono", monospace; font-size: 14px; text-align: center;
          background: var(--zebra); border-radius: var(--radius); padding: 8px; word-break: break-all; }
ol.steps { padding-left: 20px; margin: 0 0 8px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-card);
        padding: 14px 16px; }
.tile .n { font-size: 26px; font-weight: 600; }
.tile .t { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }

@media (max-width: 480px) {
  main.narrow { padding-top: 24px; }
  .topbar { gap: 4px; padding: 10px 10px; }
  .topbar button { padding: 6px 10px; font-size: 14px; }
  .brand span { display: none; }  /* the mark alone: four links and Sign out must fit 360 px */
  .nav { gap: 0; margin-left: 0; }
  .nav a { padding: 6px 6px; font-size: 13.5px; }
  .brand small { display: none; }
  .topbar .who { display: none; }
}
.spaced { margin-top: 16px; }
.row.spaced { margin-top: 12px; }

/* ── viewer (T4) ─────────────────────────────────────────────────────────── */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { color: #cbd5e1; padding: 6px 10px; border-radius: var(--radius); font-size: 14px; }
.nav a:hover { color: #fff; background: var(--chrome-hi); text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; background: var(--chrome-hi); }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.faint { color: var(--faint); font-size: 13px; }
.empty { color: var(--muted); margin: 4px 0; }
.crumbs { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head h2 { margin-bottom: 12px; }
a.tile { color: inherit; }
a.tile:hover { border-color: var(--accent); text-decoration: none; }

/* chips — the status set of DESIGN_SYSTEM.md */
.chip { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12.5px;
        font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--accent-wash); color: var(--accent-dark); }
.chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip.flag { background: #fde8e6; color: var(--danger); }
.chip.muted { background: var(--secondary); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .chip.ok { color: #5eead4; }
  .chip.flag { background: #3a1916; color: #f19a90; }
}

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px;
            background: var(--zebra); padding: 8px 10px; border-bottom: 1px solid var(--hair); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table tr.retracted td { color: var(--faint); font-style: italic; }
.figures > div { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.figures > div > span { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* filters */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
           gap: 4px 14px; align-items: end; }
.filters label { margin: 0; display: flex; flex-direction: column; gap: 4px; }
select, input[type=date] {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--hair-strong); border-radius: var(--radius); padding: 6px 8px;
}
.filters .actions { display: flex; align-items: center; gap: 12px; padding-bottom: 2px; }
button.primary.small { width: auto; margin: 0; padding: 7px 18px; }
.pager { display: flex; gap: 16px; justify-content: flex-end; color: var(--muted);
         font-size: 13px; padding-top: 12px; }

/* run facts */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
         gap: 12px 20px; margin: 0; }
.facts dt { color: var(--muted); font-size: 12.5px; }
.facts dd { margin: 2px 0 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pill { border: 1px solid var(--hair-strong); border-radius: 999px; padding: 2px 12px;
        font-size: 13px; color: var(--ink); }
.pill.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-dark); }
.pill:hover { text-decoration: none; border-color: var(--accent); }

/* comments (T5) */
.notes { list-style: none; margin: 0 0 8px; padding: 0; }
.notes li { border-left: 3px solid var(--accent); background: var(--zebra);
            border-radius: 0 var(--radius) var(--radius) 0; padding: 8px 12px; margin-bottom: 8px; }
.notes p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-form select, .note-form textarea { width: 100%; }
textarea {
  font: inherit; color: var(--ink); background: var(--surface); resize: vertical;
  border: 1px solid var(--hair-strong); border-radius: var(--radius); padding: 8px 10px;
}
textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* PCs (T6) */
.narrow-form form, .narrow-form .help { max-width: 460px; }
.message.ok { background: var(--accent-wash); color: var(--accent-dark); }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 14px; }
label.check input { margin-top: 3px; accent-color: var(--accent); }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { filter: brightness(0.92); }
.danger-zone { border-color: #e9b8b2; }
@media (prefers-color-scheme: dark) { .danger-zone { border-color: #5a2a25; } }
main.wide-narrow { max-width: 560px; }
.token { font-family: Consolas, "Cascadia Mono", monospace; font-size: 15px; background: var(--zebra);
         border: 1px dashed var(--accent); border-radius: var(--radius); padding: 12px;
         word-break: break-all; user-select: all; }
a.button-link { display: inline-block; background: var(--accent); color: #fff;
                border-radius: var(--radius); padding: 8px 18px; font-weight: 600; }
a.button-link:hover { background: var(--accent-dark); text-decoration: none; }

/* a phone (or a narrow window): every table row becomes a small card, labels beside the
   values — below 820 px a table of runs no longer fits on one line per run */
@media (max-width: 820px) {
  .nav { margin-left: 4px; }
  .nav a { padding: 6px 7px; }
  .card { padding: 14px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--hair); padding: 8px 0; }
  .table tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 2px 0; display: flex; gap: 12px; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px;
                      flex: 0 0 96px; }
  .table .num { text-align: left; }
}
