/* Slipstream admin console — token layer and hand-rolled primitives.
   Density is the point: 34–37px rows, 12–12.5px body. No component library. */

:root {
  --canvas: #f5f4f2;
  --surface: #ffffff;
  --surface-header: #fafaf9;
  --surface-hover: #faf9f7;
  --ink: #17171a;
  --ink-2: #3d3c3a;
  --ink-3: #4a4947;
  --muted: #6b6a68;
  --faint: #9a9895;
  --disabled: #c9c7c3;
  --border: #e5e4e1;
  --border-strong: #dcdad6;
  --border-hover: #b9b6b1;
  --hairline: #f2f1ee;
  --hairline-2: #f5f4f2;

  --accent: #be123c;
  --accent-hover: #a5102f;
  --accent-link-hover: #8f0e2d;
  --accent-bg: #fdf1f4;
  --accent-border: #f3c6d2;
  --accent-mid: #e79aad;
  --accent-light: #f3cdd8;
  --accent-on-dark: #f3a2b6;
  --selection: #fbd5de;

  --ok: #15803d;      --ok-bg: #eef7f0;      --ok-bd: #cfe6d5;
  --warn: #b45309;    --warn-bg: #fdf6ec;    --warn-bd: #f0dcbc;
  --neutral: #6b6a68; --neutral-bg: #f2f1ee; --neutral-bd: #dcdad6;
  --alert: #be123c;   --alert-bg: #fdf1f4;   --alert-bd: #f3c6d2;

  --bar: #2b2b2f;
  --bar-under: #cfcdc9;

  --side-bg: #17171a;
  --side-fg: #a8a6a2;
  --side-fg-hover: #f2f0ec;
  --side-bg-hover: #232327;
  --side-bg-active: #2b2b2f;
  --side-group: #6a686e;
  --side-dot: #4d4b50;
  --side-divider: #2b2b2f;
  --side-avatar: #3a383d;
  --side-sub: #77757a;
  --side-text: #e6e4e0;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-pill: 0 1px 2px rgba(0, 0, 0, .06);
  --topbar-h: 50px;
}

/* ---------- Fonts (self-hosted, latin subset, OFL) ---------- */
/* IBM Plex Sans ships as one variable file covering 400–700; Mono is static
   per weight and the console only uses 400 and 500. Three requests, same
   origin, preloaded from index.html. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/admin/fonts/ibm-plex-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/admin/fonts/ibm-plex-mono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/admin/fonts/ibm-plex-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--canvas); }
body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-link-hover); text-decoration: underline; }
input, button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--selection); }
h1, h2, h3, p { margin: 0; }
table { border-collapse: collapse; border-spacing: 0; }

@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- Text utilities ---------- */

.mono { font-family: var(--mono); }
.micro {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.micro--accent { color: var(--accent); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink-2 { color: var(--ink-2); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.accent { color: var(--accent); }
.right { text-align: right; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }

/* ---------- App shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 214px minmax(1106px, 1fr);
  min-width: 1320px;
  min-height: 100vh;
  background: var(--canvas);
}

.sidebar {
  background: var(--side-bg);
  color: #d6d4d0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 16px 15px;
  border-bottom: 1px solid var(--side-divider);
}
.brand__mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand__text { display: flex; flex-direction: column; gap: 1px; }
.brand__name { font-size: 13px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.brand__sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-sub); }

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 8px;
  flex: 1;
  overflow-y: auto;
}
.nav__group {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--side-group);
  padding: 14px 8px 5px;
}
.nav__group:first-child { padding-top: 6px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--side-fg);
  cursor: pointer;
  text-decoration: none;
}
.nav__item:hover { background: var(--side-bg-hover); color: var(--side-fg-hover); text-decoration: none; }
.nav__item.is-active { background: var(--side-bg-active); color: #fff; font-weight: 500; }
.nav__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--side-dot); flex: none; }
.nav__item.is-active .nav__dot { background: var(--accent); }
.nav__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  padding: 1px 5px;
  border-radius: 20px;
}
.nav__count--alert { background: var(--alert); }

.sidebar__footer {
  padding: 11px 14px;
  border-top: 1px solid var(--side-divider);
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--side-avatar);
  color: var(--side-text);
  font-size: 10.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.sidebar__user { display: flex; flex-direction: column; min-width: 0; }
.sidebar__signout {
  margin-left: auto;
  background: transparent;
  border: 0;
  padding: 2px 0;
  font-size: 10.5px;
  color: var(--side-sub);
}
.sidebar__signout:hover { color: var(--side-fg-hover); }
.sidebar__name { font-size: 11.5px; color: var(--side-text); }
.sidebar__role { font-size: 10px; color: var(--side-sub); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.crumb__sep { color: var(--disabled); }
.crumb__current { color: var(--ink); font-weight: 500; }

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  width: 250px;
  margin: 0;
}
.search__glyph { width: 10px; height: 10px; border: 1.5px solid var(--faint); border-radius: 50%; flex: none; }
.search__input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12px;
  width: 100%;
  font-family: var(--mono);
  padding: 0;
}
.search__input::placeholder { color: var(--faint); }

.content {
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.content.is-loading { opacity: .6; }
/* Screen mount: the outgoing screen dims while the next one loads unseen in its place. */
#screen { position: relative; }
.screen.is-leaving { opacity: .6; pointer-events: none; transition: opacity .15s ease; }
/* No transition here: the swap must be instant, or the new screen fades in over a bare background. */
.screen.is-staged { position: absolute; top: 0; left: 0; right: 0; opacity: 0; pointer-events: none; }
.content--inner { padding: 0; }
.notice--shell { margin: 20px 20px 0; }

.notice {
  background: var(--surface);
  border: 1px solid var(--alert-bd);
  border-radius: 7px;
  padding: 12px 13px;
  font-size: 12px;
  color: var(--alert);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Good news in the same slot (a connection made, a push done); the default is the alert colour. */
.notice--ok { border-color: var(--ok-bd); color: var(--ok); }

/* ---------- Page header ---------- */

.page-head { display: flex; align-items: flex-end; gap: 20px; }
.page-head--center { align-items: center; }
.page-head__text { display: flex; flex-direction: column; gap: 5px; }
.page-head__title { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.page-head__desc { font-size: 12.5px; color: var(--muted); }
.page-head__controls { display: flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }

/* ---------- Buttons, chips, segmented controls ---------- */

.btn {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { border-color: var(--border-hover); text-decoration: none; color: var(--ink-2); }
.btn--primary { background: var(--accent); border-color: var(--accent-hover); color: #fff; font-weight: 500; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; padding: 8px; }
.btn--dark:hover { background: var(--side-bg-active); color: #fff; }
.btn--quiet { color: var(--muted); padding: 8px 11px; }
.btn--block { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip--head { padding: 6px 10px; }
.chip__label { color: var(--faint); }

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  margin: 0;
}
.seg--in-card { background: var(--neutral-bg); }
.seg__item {
  padding: 5px 11px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.seg--tight .seg__item { padding: 4px 10px; }
.seg__item:hover { text-decoration: none; color: var(--ink); }
.seg__item.is-on { background: var(--ink); color: #fff; }
.seg--light .seg__item.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pill); }

/* Market selector: a chip that opens a popover. Lives in page-head controls (outside cards, which clip overflow). */
.picker { position: relative; display: inline-flex; }
.picker__root { position: relative; display: inline-flex; }
.picker__button { font: inherit; cursor: pointer; }
.picker__button:hover { border-color: var(--border-hover); }
.picker__button[aria-expanded="true"] { border-color: var(--ink); }
.picker__caret { width: 0; height: 0; margin-left: 3px; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid var(--muted); }
.picker__pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08), var(--shadow-pill);
  padding: 10px;
  white-space: normal;
  text-align: left;
}
.picker__body { display: flex; flex-direction: column; gap: 10px; }
.picker__scopes { align-self: flex-start; }
.picker__loading { font-size: 11.5px; }
.picker__note { font-size: 11px; color: var(--faint); line-height: 1.5; }
button.seg__item { border: 0; background: none; font: inherit; cursor: pointer; }

/* ---------- Billing & charges ---------- */

/* The auto-charge cycle: the one dark card in the content area, because it is system state rather than a windowed readout. */
.cycle { background: var(--ink); border-radius: 7px; padding: 14px; display: flex; flex-direction: column; gap: 11px; color: var(--side-fg); }
.cycle__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-sub); }
.cycle__next { display: flex; align-items: baseline; gap: 8px; }
.cycle__count { font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -.01em; color: #fff; }
.cycle__text { font-size: 11.5px; color: var(--side-fg); line-height: 1.5; }
.cycle__rule { border-top: 1px solid var(--side-divider); }
.cycle__stats { display: flex; gap: 10px; }
.cycle__stat { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cycle__value { font-family: var(--mono); font-size: 15px; color: #fff; white-space: nowrap; }
.cycle__value--accent { color: var(--accent-on-dark); }
.cycle__stat-label { font-size: 10.5px; color: var(--side-sub); line-height: 1.3; white-space: nowrap; }
/* The label's second line: the count behind the figure, in mono. */
.cycle__stat-sub { font-family: var(--mono); font-size: 10px; color: var(--side-sub); }
/* Platform overview: how far through the month the cycle is. */
.cycle__bar { height: 6px; border-radius: 3px; background: var(--side-divider); overflow: hidden; }
.cycle__fill { height: 100%; background: var(--accent); border-radius: 3px; }
.note { padding: 12px 13px; display: flex; flex-direction: column; gap: 6px; }
.note__text { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.kdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--faint); }
.kdot--credit { background: var(--ok); }
.kdot--deposit { background: var(--warn); }
.kdot--failure { background: var(--alert); }
.table .cell-gap10 { padding-right: 10px; }
.table .num--strong { font-weight: 500; }
.table .num--muted { color: var(--muted); }
.table .cell-end { text-align: right; padding-left: 14px; }
.table .cell-status { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.amount--credit { color: var(--ok); }
.amount--failure { color: var(--alert); }
/* A select inside a chip borrows the chip's border: no box of its own, just the caret. */
.btn[disabled] { color: var(--faint); cursor: default; }

/* ---------- Searchable select (combo): a button that opens a filterable list ---------- */
.combo { position: relative; display: block; min-width: 0; }
.combo--chip { display: inline-flex; }
.combo__button { display: inline-flex; align-items: center; gap: 6px; text-align: left; cursor: pointer; font: inherit; }
.combo__button.input { width: 100%; padding-right: 10px; color: var(--ink); }
.combo__button.input:hover:not([disabled]) { border-color: var(--border-hover); }
.combo__button.input:focus-visible, .combo__button.input[aria-expanded="true"] { border-color: var(--ink); outline: none; }
.combo__button.chip { background: var(--surface); }
.combo__button.chip:hover:not([disabled]) { border-color: var(--border-hover); }
.combo__button.chip[aria-expanded="true"] { border-color: var(--ink); }
.combo__button.chip:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.combo__button[disabled] { cursor: default; color: var(--faint); background: var(--surface-header); }
.combo__button[disabled] .picker__caret { border-top-color: var(--disabled); }
.combo__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo__text--placeholder { color: var(--faint); }
.combo__pop {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08), var(--shadow-pill);
  text-align: left;
  white-space: normal;
}
.combo__search { font: inherit; font-size: 12px; width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-header); outline: none; }
.combo__search::placeholder { color: var(--faint); }
.combo__search:focus { border-color: var(--ink); background: var(--surface); }
.combo__list { list-style: none; margin: 0; padding: 0; max-height: 232px; overflow-y: auto; overscroll-behavior: contain; }
.combo__option { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 4px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.combo__option.is-active { background: var(--surface-hover); color: var(--ink); }
.combo__option.is-selected { color: var(--ink); font-weight: 500; }
.combo__option--none { color: var(--muted); }
.combo__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo__hint { flex: 0 1 auto; min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.combo__check { font-size: 11px; color: var(--accent); }
.combo__empty { padding: 8px; font-size: 11.5px; color: var(--faint); }

/* Custom date range: a popover under the reporting-window segment. */
.range { width: 340px; display: flex; flex-direction: column; gap: 10px; }
.range__dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.range__foot { display: flex; align-items: center; gap: 6px; }

.legend { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend__item { display: flex; align-items: center; gap: 5px; }

/* ---------- Pills, badges, dots ---------- */

.pill {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--neutral-bd);
  background: var(--neutral-bg);
  color: var(--neutral);
  white-space: nowrap;
  line-height: normal;
}
.pill--ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.pill--warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.pill--neutral { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-bd); }
.pill--alert { background: var(--alert-bg); color: var(--alert); border-color: var(--alert-bd); }
.pill--state-transferring { color: var(--ink-2); }
.pill--sm { padding: 1px 6px; }

.badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--split { color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border); }
.badge--gap { font-size: 8.5px; color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-bd); }
.badge--primary { font-size: 8.5px; color: #fff; background: var(--ink); }

.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; display: inline-block; background: var(--border-strong); }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }
.dot--off { background: var(--faint); }
.dot--none { background: var(--border-strong); }
.dot--live { background: var(--accent); animation: blip 1.6s ease-in-out infinite; }

/* ---------- Stat tiles & inventory strip ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tiles--4 { grid-template-columns: repeat(4, 1fr); }
.tiles--5 { grid-template-columns: repeat(5, 1fr); }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tile__value { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.tile__value--accent { color: var(--accent); }
.tile__value--alert { color: var(--alert); }
.tile__context { font-size: 11px; color: var(--muted); }
.tile__context--ok { color: var(--ok); }
.tile__context--warn { color: var(--warn); }

.strip { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.strip__sep { color: var(--border-strong); }
.strip__pair { display: inline-flex; align-items: center; gap: 14px; }

/* ---------- Two-pane grids ---------- */

.two-pane { display: grid; grid-template-columns: minmax(660px, 1fr) 340px; gap: 14px; align-items: start; }
.two-pane--zips { grid-template-columns: minmax(660px, 1fr) 372px; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 62px; }
.rail--card { gap: 0; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: clip; /* clip, not hidden: keeps sticky table headers working */
}
.card__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.card__head--center { align-items: center; gap: 8px; padding: 11px 13px; }
.card__title { font-size: 13.5px; font-weight: 600; }
.card__sub { font-size: 11.5px; color: var(--muted); }
.card__meta { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.card__meta--strong { font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.card__note { font-size: 11.5px; color: var(--warn); }
.card__body { padding: 12px 13px; display: flex; flex-direction: column; gap: 10px; }
.card__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.card__count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-header);
}
.card__foot .mono { font-size: 11px; color: var(--faint); }
.card__section { padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; border-bottom: 1px solid var(--border); }
.card__section:last-child { border-bottom: 0; }
.card__section--head { padding: 13px 14px 12px; gap: 3px; }
.card__section--alloc { gap: 10px; }

/* ---------- Tables ---------- */

.table { width: 100%; table-layout: fixed; }
.table th, .table td { padding: 0; text-align: left; vertical-align: middle; font-weight: 400; }
.table th:first-child, .table td:first-child { padding-left: 14px; }
.table th:last-child, .table td:last-child { padding-right: 14px; }
.table--pad12 th:first-child, .table--pad12 td:first-child { padding-left: 12px; }
.table--pad12 th:last-child, .table--pad12 td:last-child { padding-right: 12px; }
.table thead th {
  height: 28px;
  background: var(--surface-header);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  position: sticky;
  top: var(--topbar-h);
  z-index: 1;
}
.table thead th.num { font-size: 9.5px; }
.table--h30 thead th { height: 30px; }
.table tbody td { height: 34px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.table--h37 tbody td { height: 37px; }
.table--h44 tbody td { height: 44px; }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr.is-link:hover td { background: var(--surface-hover); }
.table tbody tr.is-selected td { background: var(--accent-bg); }
.table tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table .num { font-family: var(--mono); font-size: 12px; text-align: right; }
.table .num--gap { padding-right: 18px; }
.table .cell-mono { font-family: var(--mono); font-size: 11.5px; }
.table .cell-mono--strong { font-size: 12.5px; font-weight: 500; }
.table .cell-mono--accept { font-size: 12px; color: var(--ink-2); }
.table .cell-flex { display: flex; align-items: center; gap: 7px; min-width: 0; }
.table .cell-flex--6 { gap: 6px; }
.table .cell-flex--8 { gap: 8px; }
.table .cell-gap { padding-right: 14px; }
.table .cell-sub { font-size: 11.5px; color: var(--muted); }
.table .cell-fips { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.table td > a.row-link { color: inherit; text-decoration: none; }
/* A name over a meta line (the platform overview's account rows). */
.table .cell-stack { line-height: 1.3; }
.table .cell-stack > a.row-link { display: block; }
.table .cell-stack__meta { font-size: 10.5px; color: var(--faint); }
.table__empty td { height: 60px; text-align: center; color: var(--faint); font-size: 12px; }

/* Inline recording player in the call log */
.rec { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rec__btn {
  flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.rec__btn:hover { border-color: var(--accent); color: var(--accent); }
.rec__btn.is-on { background: var(--accent); border-color: var(--accent-hover); color: #fff; }
.rec__btn.is-on:hover { background: var(--accent-hover); }
.rec__play { width: 0; height: 0; margin-left: 2px; border-style: solid; border-width: 4px 0 4px 7px; border-color: transparent transparent transparent currentColor; }
.rec__pause { width: 6px; height: 8px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.rec__track { flex: 1; min-width: 36px; height: 12px; padding: 5px 0; box-sizing: border-box; cursor: pointer; }
.rec__track:focus-visible { outline: 2px solid var(--accent-border); outline-offset: 2px; border-radius: 2px; }
.rec__fill { height: 2px; background: var(--accent); border-radius: 1px; position: relative; }
.rec__track::before { content: ""; display: block; height: 2px; margin-bottom: -2px; background: var(--border); border-radius: 1px; }
.rec__time { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.rec.is-active .rec__time { color: var(--ink-2); }
.rec__time.alert { color: var(--alert); }

/* Pagination inside table footers */
.pager { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; }
.pager a, .pager span { color: var(--muted); }
.pager .is-disabled { color: var(--disabled); }

/* ---------- Routing funnel ---------- */

.funnel { padding: 10px 14px 14px; }
.funnel__row {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr) 58px 54px 250px;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid var(--hairline-2);
}
.funnel__row--head { padding: 0 0 7px; border-top: 0; }
.funnel__label { font-size: 12.5px; }
.funnel__track { height: 20px; background: var(--hairline-2); border-radius: 3px; overflow: hidden; }
.funnel__fill { height: 100%; background: var(--bar); border-radius: 3px; }
.funnel__fill--final { background: var(--accent); }
.funnel__count { font-family: var(--mono); font-size: 12.5px; text-align: right; }
.funnel__pct { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.funnel__lost { font-size: 11px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Duration histogram ---------- */

.hist { padding: 16px 14px 12px; position: relative; }
.hist__bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 122px; }
.hist__col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.hist__count { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.hist__bar { width: 100%; background: var(--bar); border-radius: 2px 2px 0 0; }
.hist__bar--under { background: var(--bar-under); }
.hist__bar--edge { background: var(--warn); }

/* Present for screen readers and the table view of a chart; invisible otherwise. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Calls received over time (platform admins) ---------- */

.vol { position: relative; padding: 10px 6px 4px; }
.vol__svg svg { display: block; width: 100%; height: auto; overflow: visible; }
.vol__tick { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.vol__peak { font-family: var(--mono); font-size: 11px; font-weight: 500; fill: var(--ink-2); }
.vol__empty { font-size: 12px; fill: var(--faint); }
.vol__tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 5px 9px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  white-space: nowrap;
}
.vol__tip-value { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.vol__tip-label { font-size: 11px; color: var(--muted); margin-top: 1px; }
.card__note--quiet { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.hist__labels { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.hist__label { font-family: var(--mono); font-size: 9.5px; color: var(--faint); text-align: center; }
.hist__rule { position: absolute; left: 60%; top: 12px; bottom: 26px; width: 0; border-left: 1px dashed var(--accent); }
.hist__marker {
  position: absolute; left: 60%; top: 0;
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 9.5px; color: var(--accent);
  background: var(--surface); padding: 0 4px;
  white-space: nowrap;
}

/* ---------- Calls in flight ---------- */

.live__row { padding: 9px 13px; border-bottom: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 4px; }
.live__row:last-child { border-bottom: 0; }
.live__line { display: flex; align-items: center; gap: 8px; }
.live__number { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.live__elapsed { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.live__where { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.live__zip { font-family: var(--mono); }
.live__arrow { color: var(--disabled); }
.live__target { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Cascade card ---------- */

.cascade__rows { display: flex; flex-direction: column; gap: 7px; }
.cascade__row { display: flex; align-items: baseline; gap: 8px; }
.cascade__value { font-family: var(--mono); font-size: 15px; }
.cascade__label { font-size: 11.5px; color: var(--muted); }
.cascade__foot { font-size: 11px; color: var(--faint); line-height: 1.5; border-top: 1px solid var(--hairline); padding-top: 8px; }

/* ---------- Allocation bars ---------- */

.alloc { display: flex; height: 6px; width: 88px; border-radius: 3px; overflow: hidden; background: var(--hairline); flex: none; }
.alloc--wide { width: auto; height: 8px; border-radius: 4px; }
.alloc__seg { height: 100%; background: var(--accent-light); }
.alloc__seg--0 { background: var(--accent); }
.alloc__seg--1 { background: var(--accent-mid); }
.alloc__seg--2 { background: var(--accent-light); }
.swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--accent-light); display: inline-block; }
.swatch--0 { background: var(--accent); }
.swatch--1 { background: var(--accent-mid); }
.swatch--2 { background: var(--accent-light); }

/* ---------- ZIP detail panel ---------- */

.zip-head { display: flex; align-items: baseline; gap: 8px; }
.zip-head__zip { font-family: var(--mono); font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.zip-head__place { font-size: 12.5px; color: var(--ink-2); }
.zip-head__summary { font-size: 11.5px; color: var(--muted); }

.parts { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; margin-top: -4px; }
.parts th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
  font-weight: 400; text-align: left; padding: 2px 3px 4px 0;
}
.parts td { font-size: 12px; padding: 3px 3px 3px 0; border-top: 1px solid var(--hairline-2); vertical-align: middle; }
.parts .cell-fips, .parts .num-sm { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: left; }
.parts .num-sm--ink { color: var(--ink); }
.parts__name { display: flex; align-items: center; gap: 6px; }

.terminal {
  background: var(--ink);
  border-radius: 6px;
  padding: 11px 12px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.75;
  color: var(--bar-under);
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal__key { color: var(--side-group); }
.terminal__val { color: #fff; }
.terminal__fips { color: var(--accent-on-dark); }

.override { display: flex; gap: 7px; flex-wrap: wrap; margin: 0; }
.override__pill {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
}
.override__pill:hover { border-color: var(--border-hover); }
.override__pill.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.override__pill[disabled] { cursor: default; }
.override__help { font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* Portal sign-ins on the contractor page */
.pu__row { padding: 7px 0; border-bottom: 1px solid var(--hairline); }
.pu__row:last-child { border-bottom: 0; }
.pu__line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pu__line .btn { flex: none; white-space: nowrap; }
.pu__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pu__name { font-size: 12.5px; color: var(--ink); }
.pu__meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pu__meta .mono { color: var(--ink-2); }
.pu__form { display: flex; flex-direction: column; gap: 9px; padding: 4px 0 6px; }
.avatar--light { background: var(--neutral-bg); color: var(--muted); border: 1px solid var(--border); }

/* The Stripe Payment Element's mount; Stripe draws inside it. */
.stripe-element { min-height: 44px; padding: 2px 0 6px; }

/* A failed charge in the Billing rail. */
.failed__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.failed__name { font-weight: 500; color: var(--ink); text-decoration: none; }
.failed__name:hover { text-decoration: underline; }


.callout {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.callout__text { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; text-wrap: pretty; }
.callout__code { font-family: var(--mono); font-size: 11px; }

/* ---------- Form fields ---------- */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label { font-size: 11px; color: var(--muted); }
.field__help { font-size: 11px; color: var(--faint); line-height: 1.5; }
.field__error { font-size: 11px; color: var(--accent); line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid--1 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.kv th { width: 76px; font-size: 11px; font-weight: 400; color: var(--muted); text-align: left; padding: 3px 6px 3px 0; vertical-align: top; }
.kv td { font-size: 12px; padding: 3px 0; vertical-align: top; overflow-wrap: anywhere; }
.input--mono { font-family: var(--mono); font-size: 12.5px; }
.input--select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 14px, calc(100% - 10px) 14px; background-size: 4px 4px; background-repeat: no-repeat; }
.input--textarea { height: auto; min-height: 64px; padding-top: 6px; padding-bottom: 6px; line-height: 1.5; resize: vertical; font-family: inherit; }
.input[disabled] { color: var(--faint); background: var(--surface-header); }
.two-pane--form { grid-template-columns: minmax(560px, 1fr) 340px; }
.card__foot--actions { padding: 11px 14px; gap: 10px; border-top: 1px solid var(--border); }
.btn--wide { padding-left: 16px; padding-right: 16px; }
.btn[disabled] { opacity: .5; cursor: default; }
.crumb-link { color: inherit; }
.form-status { font-size: 11.5px; color: var(--muted); }
.form-status--ok { color: var(--ok); }
.form-status--error { color: var(--accent); }

/* Territory assignments on the contractor page: availability toggle, read-only readout, county checklist */
.readout { border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-family: var(--mono); font-size: 12.5px; background: var(--surface-header); color: var(--ink); }
.readout--muted { color: var(--warn); }
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.toggle__btn { font: inherit; font-size: 12px; }
.toggle__btn.is-on--ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok); font-weight: 500; }
.toggle__btn.is-on--warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn); font-weight: 500; }
.checklist { border: 1px solid var(--border-strong); border-radius: 6px; max-height: 232px; overflow-y: auto; display: flex; flex-direction: column; background: var(--surface); }
.checklist__item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12px; border-bottom: 1px solid var(--hairline); cursor: pointer; min-width: 0; }
.checklist__item:last-child { border-bottom: 0; }
.checklist__item:hover { background: var(--surface-hover); }
.checklist__item.is-off { color: var(--faint); cursor: default; }
.checklist__item.is-off:hover { background: none; }
.checklist__item input { margin: 0; flex: none; }
.checklist__note { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.checklist__fips { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: auto; flex: none; }
.checklist__empty { padding: 16px 10px; font-size: 11.5px; color: var(--faint); text-align: center; }
.checklist__tools { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--faint); }

/* Pricing: inline price cells, the bulk form's checkbox, import errors */
.input--cell { height: 26px; padding: 3px 8px; font-family: var(--mono); font-size: 12px; text-align: right; width: 84px; }
.cell-prefix { font-size: 11.5px; color: var(--faint); }
.cell-status { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.cell-status--ok { color: var(--ok); }
.cell-status--error { color: var(--accent); }
.table tbody tr.is-gap td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.checkbox__row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.checkbox__row input { margin: 0; }
.file { font-size: 12px; max-width: 100%; }
.import-errors { margin: 0; padding: 0; list-style: none; font-size: 11.5px; max-height: 180px; overflow-y: auto; border: 1px solid var(--alert-bd); border-radius: 6px; }
.import-errors li { padding: 4px 8px; border-bottom: 1px solid var(--hairline); color: var(--alert); display: flex; gap: 8px; }
.import-errors li:last-child { border-bottom: 0; }
.import-errors .mono { color: var(--muted); flex: none; }
.cascade__price { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; }

/* ---------- Sign-in ---------- */

.login {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login[hidden] { display: none; }
.login__card {
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}
.login__brand { display: flex; align-items: center; gap: 9px; padding-bottom: 4px; }
.login__name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.login__sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.login__title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.input {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12.5px;
  background: var(--surface);
  width: 100%;
  outline: none;
}
.input:focus { border-color: var(--ink); }
.input[aria-invalid="true"] { border-color: var(--accent); }
.login__error { font-size: 11.5px; color: var(--accent); line-height: 1.5; }
.login__error[hidden] { display: none; }
.login__submit { padding: 8px; }
.login__submit[disabled] { opacity: .6; cursor: default; }
.login__help { font-size: 11px; color: var(--faint); line-height: 1.5; }

/* ---------- Coverage map ---------- */

:root {
  --map-none: #e9e7e3;   /* a county or state in the registry with no contractor */
  --map-off: #f4f3f1;    /* geometry the registry does not know */
  --map-level-1: #cfe6d5;
  --map-level-2: #9bd0ac;
  --map-level-3: #55a872;
  --map-level-4: #15803d;
}

.two-pane--coverage { grid-template-columns: minmax(660px, 1fr) 372px; }

.map { position: relative; background: var(--surface); }
.map__svg { display: block; width: 100%; height: 540px; }
.map__area {
  fill: var(--map-none);
  stroke: var(--surface);
  stroke-width: .6;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  outline: none;
}
.map__area--off { fill: var(--map-off); cursor: default; }
.map__area--unstaffed, .map__area--level-0 { fill: var(--map-none); }
.map__area--covered { fill: var(--ok); }
.map__area--thin { fill: var(--warn); }
.map__area--level-1 { fill: var(--map-level-1); }
.map__area--level-2 { fill: var(--map-level-2); }
.map__area--level-3 { fill: var(--map-level-3); }
.map__area--level-4 { fill: var(--map-level-4); }
.map__outline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.map__outline--selected { stroke: var(--accent); stroke-width: 2; }
.map__outline--focus { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 2; }
.map__empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; }
.map__tip {
  position: absolute;
  z-index: 2;
  transform: translate(12px, 12px);
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.45;
  padding: 6px 9px;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  white-space: nowrap;
}
.map__tip--left { transform: translate(calc(-100% - 12px), 12px); }
.map__tip-sub { color: var(--bar-under); font-size: 11px; }

.legend__swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--map-none); flex: none; }
.legend__swatch--covered { background: var(--ok); }
.legend__swatch--thin { background: var(--warn); }
.legend__swatch--unstaffed, .legend__swatch--level-0 { background: var(--map-none); }
.legend__swatch--level-1 { background: var(--map-level-1); }
.legend__swatch--level-2 { background: var(--map-level-2); }
.legend__swatch--level-3 { background: var(--map-level-3); }
.legend__swatch--level-4 { background: var(--map-level-4); }

/* County detail in the rail */
.county-head__name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.parts tr.is-current td { background: var(--surface-header); }
.parts__link { color: inherit; }
.cascade-list { display: flex; flex-direction: column; }
.cascade-list__row {
  display: grid;
  grid-template-columns: 16px 6px minmax(0, 1fr) 108px 44px;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid var(--hairline-2);
  font-size: 12px;
}
.cascade-list__row:first-child { border-top: 0; }
.cascade-list__row.is-paused .cascade-list__name, .cascade-list__row.is-paused .cascade-list__phone, .cascade-list__row.is-paused .cascade-list__price { color: var(--faint); }
.cascade-list__slot { font-size: 11px; color: var(--muted); text-align: center; }
.cascade-list__name { color: var(--ink); }
.cascade-list__phone { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cascade-list__price { font-size: 11.5px; text-align: right; }

/* States with contractors (nationwide rail) */
.rank { display: flex; flex-direction: column; }
.rank__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--hairline);
  color: inherit;
  text-decoration: none;
}
.rank__row:last-child { border-bottom: 0; }
.rank__row:hover { background: var(--surface-hover); text-decoration: none; color: inherit; }
.rank__name { font-size: 12.5px; font-weight: 500; }
.rank__meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rank__bar { grid-column: 1 / -1; display: flex; height: 4px; border-radius: 2px; background: var(--hairline); overflow: hidden; }
.rank__fill { height: 100%; }
.rank__fill--ok { background: var(--ok); }
.rank__fill--warn { background: var(--warn); }

/* ----- Brand switcher (top bar) ----- */
.switcher { margin-right: 10px; }
.switcher__pop { right: 0; left: auto; min-width: 240px; padding: 6px; }
.switcher__group + .switcher__group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--hairline); }
.switcher__account { padding: 4px 8px 2px; }
.switcher__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; }
.switcher__item:hover { background: var(--neutral-bg); }
.switcher__item.is-on { font-weight: 500; }
.switcher__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher__meta { font-family: var(--mono); font-size: 10px; color: var(--warn); }
.switcher__check { font-size: 11px; color: var(--accent); }

/* ----- Accounts & brands ----- */
.brand-list { padding-top: 2px; padding-bottom: 2px; gap: 0; }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.brand-item:last-child .brand-row, .brand-item:last-child .brand-row__form { border-bottom: 0; }
.brand-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-row__name { font-size: 12.5px; font-weight: 500; }
.brand-row__meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-row__form { padding: 8px 0 10px; border-bottom: 1px solid var(--hairline); }

/* ---------- Audit trail ---------- */

/* The tiles are filters: one per category the trail is asked about most. */
.tiles--audit { grid-template-columns: repeat(4, 1fr); }
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--border-hover); }
a.tile.is-selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
