/* Support ledger — a records-office aesthetic, not a SaaS dashboard.
   Mono carries every piece of data (ranks, ticket numbers, counts, statuses,
   dates); sans is reserved for the two things a human wrote: client names and
   ticket subjects. */

:root {
  color-scheme: light dark;

  --paper: #faf9f7;
  --surface: #ffffff;
  --surface-sunk: #f3f2ef;
  --rule: #e6e3dd;
  --rule-strong: #d2cec6;

  --ink: #17171e;
  --ink-soft: #5c5c68;
  --ink-faint: #8d8d99;

  --accent: #4340ce;
  --accent-soft: #ecebfb;
  --open: #b4560a;
  --open-soft: #fdf0e2;
  --danger: #b3261e;

  /* Status colour says who is holding the ticket: us, them, or nobody. */
  --st-open-fg: #b42318;    --st-open-bg: #fee4e2;    --st-open-br: #fda29b;
  --st-pending-fg: #b54708; --st-pending-bg: #fef0c7; --st-pending-br: #fec84b;
  --st-customer-fg: #175cd3;--st-customer-bg: #d1e9ff;--st-customer-br: #84caff;
  --st-blocked-fg: #5925dc; --st-blocked-bg: #ebe9fe; --st-blocked-br: #bdb4fe;
  --st-resolved-fg: #067647;--st-resolved-bg: #dcfae6;--st-resolved-br: #75e0a7;
  --st-closed-fg: #5c6474;  --st-closed-bg: #f1f3f6;  --st-closed-br: #d4d9e0;

  --sans: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --step: 4px;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c0c11;
    --surface: #14141b;
    --surface-sunk: #1b1b24;
    --rule: #262631;
    --rule-strong: #383846;

    --ink: #eceaf4;
    --ink-soft: #9d9cae;
    --ink-faint: #6d6c7e;

    --accent: #8f8bff;
    --accent-soft: #21203a;
    --open: #e0a25c;
    --open-soft: #2e2417;
    --danger: #f0776c;

    --st-open-fg: #ffab9f;    --st-open-bg: #3d1a16;    --st-open-br: #7d2f27;
    --st-pending-fg: #f2b95f; --st-pending-bg: #3a2712; --st-pending-br: #7d571f;
    --st-customer-fg: #8ccdff;--st-customer-bg: #10243d;--st-customer-br: #205081;
    --st-blocked-fg: #c3bbff; --st-blocked-bg: #231d4a; --st-blocked-br: #473c92;
    --st-resolved-fg: #7ce3ac;--st-resolved-bg: #0d2d1f; --st-resolved-br: #205e40;
    --st-closed-fg: #9aa1b1;  --st-closed-bg: #1d1d27;  --st-closed-br: #35354a;
  }
}

:root[data-theme="dark"] {
  --paper: #0c0c11;
  --surface: #14141b;
  --surface-sunk: #1b1b24;
  --rule: #262631;
  --rule-strong: #383846;

  --ink: #eceaf4;
  --ink-soft: #9d9cae;
  --ink-faint: #6d6c7e;

  --accent: #8f8bff;
  --accent-soft: #21203a;
  --open: #e0a25c;
  --open-soft: #2e2417;
  --danger: #f0776c;

  --st-open-fg: #ffab9f;    --st-open-bg: #3d1a16;    --st-open-br: #7d2f27;
  --st-pending-fg: #f2b95f; --st-pending-bg: #3a2712; --st-pending-br: #7d571f;
  --st-customer-fg: #8ccdff;--st-customer-bg: #10243d;--st-customer-br: #205081;
  --st-blocked-fg: #c3bbff; --st-blocked-bg: #231d4a; --st-blocked-br: #473c92;
  --st-resolved-fg: #7ce3ac;--st-resolved-bg: #0d2d1f;--st-resolved-br: #205e40;
  --st-closed-fg: #9aa1b1;  --st-closed-bg: #1d1d27;  --st-closed-br: #35354a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Every label, number and code in the interface shares one voice. */
.mono, .eyebrow, .rank, .tid, .figure-value, .measure-count, .chip, .stamp, .bar-value, .bar-date {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-faint);
}

/* ----------------------------------------------------------------- login --- */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 36px 32px;
}

.login-card h1 { margin: 6px 0 6px; font-size: 21px; letter-spacing: -.02em; font-weight: 600; }
.login-card p.sub { margin: 0 0 28px; color: var(--ink-soft); font-size: 13.5px; }

label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font: 15px/1.4 var(--mono);
  color: var(--ink);
  background: var(--surface-sunk);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
}

input[type="password"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

button { font: inherit; cursor: pointer; border-radius: 6px; border: 1px solid transparent; }

.btn-primary {
  width: 100%;
  margin-top: 20px;
  padding: 11px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
}

.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .55; cursor: progress; }

.error { margin-top: 16px; font-size: 13px; color: var(--danger); min-height: 20px; }

/* -------------------------------------------------------------- masthead --- */
/* Two tiers: who/what plus utilities on top, then the report's scope on its own
   band. Previously five identically-weighted pills meant the period picker —
   which defines the entire report — looked exactly like Sign out. */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  transition: box-shadow .18s ease;
}

/* a shadow alone barely reads on a dark ground, so the rule firms up too */
.masthead.is-stuck { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45); border-bottom-color: var(--rule-strong); }
@media (prefers-reduced-motion: reduce) { .masthead { transition: none; } }

.masthead-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 32px;
}

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.brand-mark svg { width: 18px; height: 18px; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 15.5px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.brand-account { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tools { display: flex; align-items: center; gap: 3px; }

.tool {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
}

.tool:hover { background: var(--surface-sunk); color: var(--ink); border-color: var(--rule); }
.tool-quiet { color: var(--ink-faint); }
.tool-quiet:hover { color: var(--danger); border-color: var(--danger); background: transparent; }

.tool .ico { width: 15px; height: 15px; flex: none; }

.tool-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.tool-divider { width: 1px; height: 20px; margin: 0 6px; background: var(--rule-strong); }

/* one icon per theme, so the button shows the state you would switch to */
.ico-moon { display: none; }
:root[data-theme="dark"] .ico-sun { display: none; }
:root[data-theme="dark"] .ico-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sun { display: none; }
  :root:not([data-theme="light"]) .ico-moon { display: block; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- scope band: the period is the loudest control on the page --- */

.masthead-scope {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 32px;
  border-top: 1px solid var(--rule);
  background: var(--surface-sunk);
}

.scope-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
}

.scope-filter:hover { color: var(--ink); border-color: var(--st-blocked-br); }

.scope-filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
}

.scope-filter[aria-pressed="true"] {
  color: var(--st-blocked-fg);
  background: var(--st-blocked-bg);
  border-color: var(--st-blocked-br);
}

.scope-filter[aria-pressed="true"] .scope-filter-dot {
  background: var(--st-blocked-fg);
  border-color: var(--st-blocked-fg);
}

.filter-short { display: none; }

.scope-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; }
.scope-range { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.scope-stamp { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-faint); }

.btn-ghost {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 7px 11px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.btn-ghost:hover { color: var(--ink); border-color: var(--accent); }

.select-button {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 13px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 7px;
  cursor: pointer;
}

.select-button:hover { background: var(--accent-soft); }

/* --------------------------------------------------------------- dropdown --- */

.select { position: relative; }

.select-button { display: flex; align-items: center; gap: 9px; }
.select.is-open .select-button { color: var(--ink); border-color: var(--accent); }
.select-caret { font-size: 9px; color: var(--ink-faint); }

.select-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 100%;
  z-index: 40;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .45);
}

.select-option {
  padding: 7px 10px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  cursor: pointer;
}

.select-option.is-active { background: var(--surface-sunk); color: var(--ink); }
.select-option[aria-selected="true"] { color: var(--accent); }
.select-option[aria-selected="true"]::after { content: " ✓"; }
.btn-ghost.quiet { border-color: transparent; }
.btn-ghost.quiet:hover { border-color: var(--rule-strong); }

main { max-width: 1140px; margin: 0 auto; padding: 26px 32px 72px; }

/* --------------------------------------------------------------- figures --- */
/* One strip, hairline-divided — a masthead of numbers, not a grid of boxes.
   The old 7-tile grid always orphaned a card onto a second row. */

.figures {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.figure {
  flex: 1 1 200px;
  padding: 18px 22px 20px;
  border-right: 1px solid var(--rule);
}

.figure:last-child { border-right: 0; }

.figure .k {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
}

.figure-value {
  display: block;
  margin-top: 10px;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}

.figure.lead .figure-value { color: var(--accent); }
.figure.attention .figure-value { color: var(--open); }

/* provenance, not headline: everything that would otherwise become a tile */
.figure-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  padding: 11px 4px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}

.figure-notes b { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.figure-notes .sep { color: var(--rule-strong); }

/* ----------------------------------------------------------------- chart --- */

.chart {
  margin-top: 18px;
  padding: 16px 18px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.chart h2 { margin: 0 0 16px; font-size: 10.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); font-weight: 400; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 84px; border-bottom: 1px solid var(--rule-strong); }

.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 5px; min-width: 0; }

.bar {
  width: 100%;
  max-width: 68px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: .3;
}

.bar-col.peak .bar { opacity: 1; }
.bar-value { font-size: 10.5px; color: var(--ink-faint); }
.bar-col.peak .bar-value { color: var(--accent); }

.bar-dates { display: flex; gap: 3px; padding-top: 7px; }
.bar-date { flex: 1; text-align: center; font-size: 10px; color: var(--ink-faint); min-width: 0; overflow: hidden; white-space: nowrap; }

/* --------------------------------------------------------------- section --- */

.section-head { margin: 38px 0 14px; }
.section-head h2 { margin: 5px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.section-head p { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; max-width: 68ch; }

/* ---------------------------------------------------------------- ledger --- */

/* One card per client. A single shared container ran each client's tickets
   straight into the next client's header with nothing to separate them. */
.ledger { display: flex; flex-direction: column; gap: 10px; }

.entry {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Rank 01 keeps a second hairline ring so the ordering still reads now that
   every client shares the accent outline. */
.entry.is-lead { box-shadow: 0 0 0 1px var(--accent); }

.entry-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  cursor: pointer;
}

.entry-head:hover { background: var(--surface-sunk); }

.rank { flex: none; width: 22px; font-size: 11.5px; color: var(--ink-faint); letter-spacing: .02em; }
.entry.is-lead .rank { color: var(--accent); }

.entry-id { min-width: 0; flex: 1 1 40%; }
.entry-id .name { font-size: 14.5px; font-weight: 550; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-id .where { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }

/* The signature: volume as a drawn measure, split resolved / still open, so
   relative load is legible without reading a single number. */
.measure { flex: 0 1 240px; display: flex; align-items: center; gap: 10px; min-width: 90px; }

.measure-track { flex: 1; display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--surface-sunk); }
.measure-done { background: var(--accent); opacity: .75; }
.measure-open { background: var(--open); }
.measure-count { flex: none; font-size: 12px; font-weight: 600; width: 18px; text-align: right; }

.chip {
  flex: none;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-faint);
}

.chip.auto { border-color: var(--open); color: var(--open); }

/* Status and priority are the two things you scan for, so they are filled and
   colour-coded while neutral metadata chips stay hairline. */
.status, .prio {
  flex: none;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.st-open      { color: var(--st-open-fg);     background: var(--st-open-bg);     border-color: var(--st-open-br); }
.st-pending   { color: var(--st-pending-fg);  background: var(--st-pending-bg);  border-color: var(--st-pending-br); }
.st-customer  { color: var(--st-customer-fg); background: var(--st-customer-bg); border-color: var(--st-customer-br); }
.st-blocked   { color: var(--st-blocked-fg);  background: var(--st-blocked-bg);  border-color: var(--st-blocked-br); }
/* custom statuses we have no meaning for: readable, but claiming nothing */
.st-other     { color: var(--ink-soft);       background: var(--surface-sunk);   border-color: var(--rule-strong); }
.st-resolved  { color: var(--st-resolved-fg); background: var(--st-resolved-bg); border-color: var(--st-resolved-br); }
.st-closed    { color: var(--st-closed-fg);   background: var(--st-closed-bg);   border-color: var(--st-closed-br); }

.p-urgent { color: #fff; background: var(--danger); border-color: var(--danger); }
.p-high   { color: var(--st-open-fg); background: var(--st-open-bg); border-color: var(--st-open-br); }

/* the dark-theme danger red is light, so urgent text flips to near-black on it */
:root[data-theme="dark"] .p-urgent { color: #2a0f0c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .p-urgent { color: #2a0f0c; }
}

.chev { flex: none; color: var(--ink-faint); font-size: 10px; transition: transform .18s ease; }
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
.entry[data-open] .chev { transform: rotate(90deg); }

/* Always present, never fading in. A control that appears under a cursor that is
   already moving is a control you click by accident. It also arms on first
   click, so a stray hit costs nothing. */
.hide-btn {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 8px;
  min-width: 62px;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--rule);
  opacity: .45;
  transition: opacity .12s ease;
}

@media (prefers-reduced-motion: reduce) { .hide-btn { transition: none; } }

.entry-head:hover .hide-btn, .record:hover .hide-btn, .hide-btn:focus-visible { opacity: 1; }
.hide-btn:hover { color: var(--danger); border-color: var(--danger); }

.hide-btn.is-armed {
  opacity: 1;
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  font-weight: 600;
}

/* ----------------------------------------------------------------- toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 540px);
  padding: 11px 12px 11px 16px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .55);
}

.toast-text {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-undo {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 5px 11px;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.toast-undo:hover { filter: brightness(1.12); }

.toast-close {
  flex: none;
  padding: 4px 7px;
  font-size: 11px;
  color: var(--ink-faint);
  background: transparent;
  border-color: transparent;
}

.toast-close:hover { color: var(--ink); }

.entry-body { display: none; border-top: 1px solid var(--rule); background: var(--surface-sunk); }
.entry[data-open] .entry-body { display: block; }

.reporters {
  padding: 9px 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}

.record {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 9px 18px 9px 16px;
  border-bottom: 1px solid var(--rule);
  border-left: 2px solid var(--rule-strong);
  background: var(--surface);
}

.record:last-child { border-bottom: 0; }
.record:hover { background: var(--surface-sunk); border-left-color: var(--accent); }

/* YouTrack issue pulled out of the ticket's private notes */
.yt {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.yt:hover { color: #fff; background: var(--accent); }

.tid { flex: none; width: 58px; font-size: 11px; color: var(--ink-faint); }

.record-subject { flex: 1; min-width: 0; }
.record-subject a { font-size: 13.5px; color: var(--ink); text-decoration: none; font-weight: 500; }
.record-subject a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.record-subject .by { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-soft); margin-top: 3px; }

.stamp { flex: none; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.period .stamp { font-size: 11px; color: var(--ink-faint); }

/* ----------------------------------------------------------- disclosures --- */

.fold { margin-top: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.fold > summary {
  cursor: pointer;
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-soft);
}
.fold > summary:hover { color: var(--ink); }
.fold[open] > summary { border-bottom: 1px solid var(--rule); }
.fold .fold-body { padding: 6px 18px 14px; }
.fold ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13px; }
.fold li { margin-bottom: 5px; }
.fold .ledger { border: 0; border-radius: 0; }

/* hidden-items tray */

.tray { margin-top: 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.tray > summary {
  cursor: pointer;
  padding: 11px 18px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-soft);
}
.tray[open] > summary { border-bottom: 1px solid var(--rule); }

.tray-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.tray-row:last-child { border-bottom: 0; }
.tray-row .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-row .kind { flex: none; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); }

.restore {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 9px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--rule-strong);
}
.restore:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- states --- */

.notice { padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink-soft); font-size: 13.5px; }
.notice.bad { border-color: var(--danger); color: var(--danger); }

.loading { padding: 64px 0; text-align: center; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); }

@media (max-width: 760px) {
  .masthead-top { padding: 11px 16px; }
  .masthead-scope { padding: 10px 16px; }
  main { padding: 20px 18px 56px; }

  /* icons alone once the labels stop fitting; the titles still name them */
  .tool-label { display: none; }
  .tool { padding: 8px; }
  .brand-name { font-size: 14.5px; }

  /* keep the scope band to one line so the sticky header stays shallow */
  .masthead-scope { gap: 10px; }
  .filter-long { display: none; }
  .filter-short { display: inline; }
  .scope-filter { padding: 8px 10px; }
  /* the period button already names the window; the restated range is what
     pushed the sticky header to two rows on a phone */
  .scope-facts { display: none; }
  .figure { flex-basis: 50%; border-bottom: 1px solid var(--rule); }
  .measure { flex-basis: 96px; }
  .measure-track { display: none; }
  .record { flex-wrap: wrap; gap: 5px 12px; }
  .tid { width: auto; }
  .hide-btn { opacity: 1; }

  /* nothing on a phone should need squinting at */
  .bar-date { font-size: 10px; }
  .chip { font-size: 10.5px; }
  .figure-notes { font-size: 12px; }
  .figure-value { font-size: 32px; }
}
