/* ============================================================================
   app.css — components. Every colour comes from tokens.css; none is declared
   here as a literal, so both themes resolve as a set.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

/* Every figure on the page is mono with tabular digits — that is the rule that
   makes columns line up and stops numbers shimmying as they update. */
.num, td.num, .stat-v, .flow-n, .kpi-v { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.ico { width: 1em; height: 1em; flex: none; }
.flow-arrow .ico { width: 15px; height: 15px; display: block; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--surface-3); }

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

/* ============================================================== app shell == */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}

.rail-top { padding: 18px 16px 14px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: var(--t-md); font-weight: 600; letter-spacing: -0.01em; }
.logo-mark {
  width: 22px; height: 22px; border-radius: var(--r-sm); flex: none;
  background: var(--action); color: var(--ink-on);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.logo-sub { font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .04em; margin-top: 3px; padding-left: 31px; }

.nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; }
.nav-label {
  font-size: var(--t-xs); font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); padding: 16px 8px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-size: var(--t-md); font-weight: 450;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--ink); font-weight: 550; }
.nav svg { width: 15px; height: 15px; flex: none; stroke-width: 1.6; }
.nav .count {
  margin-left: auto; font-family: var(--mono); font-size: var(--t-xs);
  padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2);
}
.nav .count.alert { background: var(--warn-bg); color: var(--warn); }

.rail-foot { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.whoami { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--r-sm); }
.avatar {
  width: 26px; height: 26px; border-radius: 999px; flex: none; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2); font-family: var(--mono); font-size: var(--t-xs); font-weight: 600;
}
.whoami-t { min-width: 0; }
.whoami-t b { display: block; font-size: var(--t-sm); font-weight: 550; }
.whoami-t span { display: block; font-size: var(--t-xs); color: var(--ink-3); }

/* ================================================================= topbar == */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; min-height: 57px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.015em; }
.topbar .sub { font-size: var(--t-sm); color: var(--ink-3); }
.grow { flex: 1 1 auto; }

.page { padding: 20px 24px 72px; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 880px; }

/* ================================================================ controls == */
.btn {
  appearance: none; cursor: pointer; font: inherit; font-size: var(--t-sm); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 6px 11px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-1);
  transition: background .12s var(--ease), border-color .12s var(--ease), opacity .12s;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 14px; height: 14px; stroke-width: 1.7; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--action); color: var(--ink-on); border-color: var(--action); }
.btn-primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--bad); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-lg { padding: 9px 16px; font-size: var(--t-md); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 2px; gap: 1px; }
.seg button {
  appearance: none; cursor: pointer; font: inherit; font-size: var(--t-sm); font-weight: 500;
  color: var(--ink-2); background: none; border: 0; border-radius: var(--r-sm); padding: 4px 11px;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.sel { position: relative; display: inline-flex; }
.sel select, .inp, .ta {
  appearance: none; font: inherit; font-size: var(--t-sm); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 6px 10px; box-shadow: var(--shadow-1); width: 100%;
  transition: border-color .12s var(--ease);
}
.sel select { cursor: pointer; padding-right: 26px; }
.sel::after {
  content: ''; position: absolute; right: 9px; top: 50%; pointer-events: none;
  width: 5px; height: 5px; border-right: 1.4px solid var(--ink-3); border-bottom: 1.4px solid var(--ink-3);
  transform: translateY(-4px) rotate(45deg);
}
.sel.on select { border-color: var(--focus); }
.inp:hover, .ta:hover, .sel select:hover { border-color: var(--ink-3); }
.inp::placeholder, .ta::placeholder { color: var(--ink-3); }
.ta { resize: vertical; min-height: 84px; line-height: 1.55; font-size: var(--t-md); }
.inp.num-in { font-family: var(--mono); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--t-sm); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  width: 30px; height: 18px; border-radius: 999px; background: var(--surface-3); position: relative;
  transition: background .16s var(--ease); flex: none;
}
.switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-1); transition: transform .16s var(--ease);
}
.switch input:checked + i { background: var(--action); }
.switch input:checked + i::after { transform: translateX(12px); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: block; cursor: pointer; font-size: var(--t-sm); color: var(--ink-2);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 12px;
  background: var(--surface); transition: all .12s var(--ease); user-select: none;
}
.chip span:hover { border-color: var(--ink-3); color: var(--ink); }
.chip input:checked + span { background: var(--action); border-color: var(--action); color: var(--ink-on); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ================================================================== cards == */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.card-h h2 { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.01em; }
.card-h .hint { font-size: var(--t-sm); color: var(--ink-3); }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }

/* ============================================================= stat tiles == */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 13px 15px 14px; display: flex; flex-direction: column; gap: 5px; }
.stat-l { font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .03em; }
.stat-v { font-size: var(--t-xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.stat-v.hero { font-size: var(--t-2xl); }
.stat-d { font-size: var(--t-xs); color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.stat-d b { font-family: var(--mono); font-weight: 550; color: var(--ink-2); }

/* ======================================================== the funnel flow == */
/* A funnel that is actually funnel-shaped. Columns are sized by volume so the
   run narrows left to right; the ramps between them turn each drop into a
   slope you can see. The conversion rate sits under its own ramp, labelling a
   shape rather than floating between two bars. */
/* Four small charts in a row, deliberately separate: gaps between them and a
   ring in each gap, so the eye steps stage by stage instead of reading one
   fused blob. The descent is carried by the bar heights alone. */
.pf { display: grid; align-items: start; overflow-x: auto; column-gap: 4px; padding-top: 2px; text-align: center; }

/* Every column shares one height and one baseline, so the tops are comparable. */
.pf-col { position: relative; height: 132px; display: flex; align-items: flex-end; justify-content: center; }
.pf-bar { width: 100%; max-width: 76px; border-radius: 3px 3px 0 0; }


/* Where this stage should stand today, drawn on the bar's own scale — above
   the line is ahead of pace, below it is behind. */
.pf-goal {
  position: absolute; left: 50%; transform: translateX(-50%); height: 0;
  width: 100%; max-width: 76px;      /* exactly the bar it measures, no wider */
  border-top: 2px dashed var(--ink-2); opacity: .75;
}

/* The rate as an arc, with the flow arrow in the hole. */
.pf-ring {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 54px; height: 54px;
}
.pf-ring svg { display: block; width: 100%; height: 100%; }
.pf-ring circle { fill: none; stroke-width: 5.5; }
.pf-ring-t { stroke: var(--surface-3); }
.pf-ring-a { stroke: currentColor; stroke-linecap: round; }
.pf-arrow {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--ink-3);
}
.pf-arrow .ico { width: 15px; height: 15px; }

/* Counts and rates are the same figure at the same size on the same line —
   they are all "how many made it this far", just measured two ways. */
.pf-n {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: var(--t-xl); font-weight: 600; letter-spacing: -0.015em;
  color: var(--ink); padding-top: 12px;
}

/* The stage name and, under it, the same stage measured against its month —
   one stack, so there is no second row of goal text anywhere on the card. */
.pf-l { font-size: var(--t-sm); color: var(--ink-3); padding-top: 3px; line-height: 1.4; }
.pf-l em {
  display: block; font-style: normal; font-size: var(--t-xs);
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600;
}

/* Distance from goal, one scale, wherever it is carried. */
.g-on    { color: var(--grade-on); }
.g-near  { color: var(--grade-near); }
.g-under { color: var(--grade-under); }
.g-bad   { color: var(--grade-bad); }
.g-none  { color: var(--grade-none); }
.pf-n.g-none { color: var(--ink); }   /* an ungraded figure is still a figure */

@media (max-width: 620px) {
  .pf      { column-gap: 2px; }
  .pf-col  { height: 92px; }
  .pf-bar  { max-width: 52px; }
  .pf-goal { max-width: 52px; }
  .pf-ring { width: 40px; height: 40px; }
  .pf-arrow .ico { width: 12px; height: 12px; }
  .pf-n    { font-size: var(--t-lg); }
  .pf-l    { font-size: var(--t-xs); }
}

.flow-foot { padding: 13px 16px; border-top: 1px solid var(--border); font-size: var(--t-sm); color: var(--ink-3); }
.flow-foot b { font-family: var(--mono); color: var(--ink); font-weight: 600; }

/* ================================================================= tables == */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 1; text-align: right; white-space: nowrap;
  font-size: var(--t-xs); font-weight: 500; color: var(--ink-3); letter-spacing: .03em;
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
thead th:first-child, tbody td:first-child { text-align: left; }
tbody td { text-align: right; white-space: nowrap; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: var(--t-md); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.name { font-weight: 500; }
td.dim, .dim { color: var(--ink-3); }
td.wrap-cell { white-space: normal; min-width: 200px; }

/* A hairline bar under a figure — magnitude without a second chart. */
.bar-cell { position: relative; }
.bar-cell i { position: absolute; right: 12px; bottom: 4px; height: 2px; border-radius: 1px; background: var(--series-1); }

/* ================================================== pills, tags, statuses == */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-xs); font-weight: 500; padding: 2px 8px; border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.pill.win  { background: var(--good-bg); color: var(--good); }
.pill.loss { background: var(--bad-bg);  color: var(--bad);  }
.pill.open { background: var(--warn-bg); color: var(--warn); }
.pill.void { background: var(--surface-3); color: var(--ink-3); }
.pill svg { width: 11px; height: 11px; stroke-width: 2; }

.dot { width: 6px; height: 6px; border-radius: 999px; flex: none; }

.note {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 13px;
  border-radius: var(--r); font-size: var(--t-sm); color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border);
}
.note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; stroke-width: 1.8; }
.note b { color: var(--ink); font-weight: 600; }
.note.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.note.warn b { color: var(--warn); }
.note.bad  { background: var(--bad-bg);  border-color: transparent; color: var(--bad);  }
.note.bad b { color: var(--bad); }
.note.good { background: var(--good-bg); border-color: transparent; color: var(--good); }
.note.good b { color: var(--good); }
.note.info { background: var(--info-bg); border-color: transparent; }

/* ============================================================ call queue == */
/* A closer's outstanding calls. The card itself carries the urgency, so the
   list can be scanned without reading a single word. */
/* One call is one line, always. A queue is read by scanning it, and a row that
   wraps to three lines turns twelve open calls into a page you have to scroll —
   at which point the queue stops being a list and starts being a chore. So
   nothing here wraps: the time, the name and the buttons hold their width and
   the middle column gives, truncating the email long before the row grows. */
.queue { display: flex; flex-direction: column; gap: 6px; }
.qcard {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 7px 12px; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: var(--r); transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.qcard:hover { box-shadow: var(--shadow-1); }
/* The left edge carries the state, so a glance down the rail is enough: blue is
   an open task, amber is one that has gone past its window, green is filed. */
.qcard.todo    { border-left-color: var(--todo); }
.qcard.overdue { border-left-color: var(--warn); background: var(--warn-bg); }
.qcard.done    { opacity: .55; border-left-color: var(--good); }

.qtime { font-family: var(--mono); font-size: var(--t-md); font-weight: 600; white-space: nowrap; }
.qtime span { font-size: var(--t-xs); font-weight: 400; color: var(--ink-3); margin-left: 6px; }

/* Name and detail share the line. The name never truncates — it is what the
   row is about — so the meta beside it is what gives when space runs out. */
.qwho { display: flex; align-items: baseline; gap: 10px; min-width: 0; overflow: hidden; }
.qname {
  font-weight: 550; font-size: var(--t-md); white-space: nowrap;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.qmeta {
  font-size: var(--t-sm); color: var(--ink-3); display: flex; flex-wrap: nowrap;
  gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap;
}
.qmeta span { flex: 0 0 auto; }
.qmeta .grow { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qactions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }

/* Between a phone and a wide desktop the five buttons and the call's detail
   cannot both have the room they want, and the row is not allowed to grow. The
   buttons win — filing the call is the whole reason the row is here — so the
   detail gives way in order of how little it is missed: source and email first,
   then the name ellipsises rather than being cut mid-word. */
@media (max-width: 1180px) {
  .qcard { gap: 10px; }
  .qmeta { display: none; }
  .qactions { gap: 4px; }
  .qactions .btn { padding-left: 8px; padding-right: 8px; }
}

/* ================================================================= modal == */
.scrim {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--ink) 45%, transparent); backdrop-filter: blur(3px);
  animation: fade .16s var(--ease);
}
.modal {
  width: min(660px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); animation: rise .2s var(--ease);
}
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 13px; border-bottom: 1px solid var(--border); }
.modal-h h2 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.015em; }
.modal-h p { font-size: var(--t-sm); color: var(--ink-3); margin-top: 2px; }
.modal-b { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-f { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--border); }

@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99) } }

/* ================================================================== forms == */
.fields { display: grid; gap: 14px; }
.fields.c2 { grid-template-columns: 1fr 1fr; }
.fg { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fg > label { font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.fg > label em { font-style: normal; color: var(--bad); }
.fg .help { font-size: var(--t-xs); color: var(--ink-3); }
.fg .err { font-size: var(--t-xs); color: var(--bad); display: none; }
.fg.bad .err { display: block; }
.fg.bad .inp, .fg.bad .ta, .fg.bad select { border-color: var(--bad); }

fieldset { border: 0; display: flex; flex-direction: column; gap: 12px; }
legend { font-size: var(--t-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 8px; width: 100%; border-bottom: 1px solid var(--border); }

/* ================================================================ charts == */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.gridline { stroke: var(--border); stroke-width: 1; }
.axis-t { fill: var(--ink-3); font-size: 10px; font-family: var(--mono); }
.avgline { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }

.tip {
  position: absolute; z-index: 5; pointer-events: none; opacity: 0; transform: translate(-50%, -100%);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
  padding: 8px 10px; min-width: 130px; box-shadow: var(--shadow-2); transition: opacity .1s;
}
.tip.on { opacity: 1; }
.tip .t-d { font-size: var(--t-xs); color: var(--ink-3); margin-bottom: 5px; }
.tip .t-r { display: flex; align-items: center; gap: 7px; font-size: var(--t-sm); white-space: nowrap; }
.tip .t-r + .t-r { margin-top: 3px; }
.tip .t-k { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.tip .t-v { margin-left: auto; font-family: var(--mono); font-weight: 600; }

.legend { display: flex; gap: 14px; align-items: center; }
.legend button { appearance: none; cursor: pointer; background: none; border: 0; font: inherit; display: flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); padding: 0; }
.legend button[aria-pressed="false"] { opacity: .38; }
.legend i { width: 10px; height: 2px; border-radius: 1px; }

/* Radar — a closer's skill profile. Axis labels are buttons: each opens that
   skill's week-by-week trend. */
.radar-wrap { display: flex; align-items: center; justify-content: center; padding: 6px 0; }
.radar-wrap svg { width: 100%; max-width: 430px; height: auto; }
.radar text { font-size: 10px; fill: var(--ink-2); font-family: var(--sans); }
.radar .rgrid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar .rspoke { stroke: var(--border); stroke-width: 1; }
.radar .rarea { fill: var(--series-1); fill-opacity: .16; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.radar .rprev { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 3 3; }
.radar .rdot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }

.skills { display: flex; flex-direction: column; gap: 1px; }
.skill {
  display: grid; grid-template-columns: minmax(0,1fr) 54px 40px; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; border: 0; background: none;
  font: inherit; text-align: left; color: var(--ink); width: 100%;
}
.skill:hover { background: var(--surface-2); }
.skill[aria-pressed="true"] { background: var(--surface-3); }
.skill-n { font-size: var(--t-md); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
/* display:block — a bare inline span ignores height and the track vanishes. */
.skill-t { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.skill-t i { display: block; height: 100%; border-radius: 2px; background: var(--series-1); }
.skill-v { font-family: var(--mono); font-size: var(--t-sm); font-weight: 600; text-align: right; }
.skill-delta { font-family: var(--mono); font-size: var(--t-xs); text-align: right; }
.skill-delta.up { color: var(--good); } .skill-delta.down { color: var(--bad); }

/* ================================================================= login == */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-card .logo { justify-content: flex-start; }
.login h1 { font-size: var(--t-xl); font-weight: 600; letter-spacing: -0.02em; }
.login p.lede { font-size: var(--t-md); color: var(--ink-3); }
.demo-keys { display: flex; flex-direction: column; gap: 6px; }
.demo-key {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; font-size: var(--t-sm); padding: 9px 11px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
}
.demo-key:hover { border-color: var(--ink-3); }
.demo-key b { font-weight: 550; }
/* :last-of-type, not `span` — the avatar is a span too, and a second auto
   margin would split the free space and centre the row. */
.demo-key > span:last-of-type { color: var(--ink-3); margin-left: auto; font-family: var(--mono); font-size: var(--t-xs); }

/* ============================================================== utilities == */
.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: var(--t-md); }
.empty svg { width: 22px; height: 22px; margin-bottom: 8px; stroke-width: 1.5; opacity: .6; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.link { color: var(--series-1); text-decoration: none; }
a.link:hover { text-decoration: underline; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 9px; padding: 10px 15px; border-radius: var(--r);
  background: var(--action); color: var(--ink-on); font-size: var(--t-sm); font-weight: 500;
  box-shadow: var(--shadow-2); animation: rise .2s var(--ease);
}

/* ============================================================ responsive == */
@media (max-width: 1180px) { .grid.side { grid-template-columns: minmax(0, 1fr); } .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .rail-top { padding: 12px 14px; } .logo-sub { display: none; }
  .nav { flex-direction: row; padding: 8px; gap: 2px; }
  .nav-label { display: none; } .nav a { white-space: nowrap; }
  .rail-foot { border-top: 0; padding: 8px; } .whoami-t { display: none; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .page, .topbar { padding-left: 14px; padding-right: 14px; }
  .fields.c2 { grid-template-columns: 1fr; }
  .qcard { grid-template-columns: auto minmax(0,1fr); gap: 10px; }
  .qactions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}

/* ============================================================================
   The admin's Closer view. Deliberately the loudest thing on the page — an
   admin who forgets which mode they're in is the one about to file a report
   on somebody's real call.
   ========================================================================== */
.preview-bar {
  position: sticky; top: 57px; z-index: 19;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 24px;
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid var(--border);
  font-size: var(--t-sm);
}
.preview-bar b { font-weight: 650; }
/* Real data gets the calmer info colour — the amber is for "this isn't real". */
.preview-bar.real { background: var(--info-bg); color: var(--ink-2); }
.preview-bar.real b { color: var(--ink); }
.preview-bar .ico { width: 15px; height: 15px; flex: none; }
.preview-bar .sel select { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.preview-bar .btn { background: var(--surface); }

@media (max-width: 900px) {
  .preview-bar { position: static; padding: 10px 14px; }
}
