/* Estate CRM.
 *
 * The idea: elapsed time is the typography. An agent's only question is who is
 * waiting and for how long, so every lead carries that figure in condensed
 * display type, and a heat rail ranks the page before a word is read.
 *
 * One family, Archivo, at two ends of its width axis. Five sizes. Flare red is
 * reserved for "this is costing you a lead" and nothing else. Spacing is on the
 * 4px scale. Rows are ledger lines on hairlines, not floating cards.
 */

@font-face {
  font-family: Archivo;
  src: url('/static/fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #eef1f2;
  --card: #ffffff;
  --ink: #0e1a24;
  --muted: #4d5c68;
  --line: #d2dade;
  --fog: #e2e7ea;
  --slab: #0f2233;
  --slab-2: #17324d;
  --slab-ink: #f3f6f7;
  --slab-muted: #a9bac6;
  --flare: #cf3517;
  --flare-ink: #ffffff;
  --warm: #9c5f00;
  --cool: #2b6688;
  --good: #1c7053;
  --shadow: 0 8px 24px rgb(15 34 51 / 14%);

  --t-label: 13px;
  --t-body: 16px;
  --t-name: 20px;
  --t-head: 36px;
  --t-display: clamp(72px, 17vw, 88px);

  --tabs: 64px;
  --action: 72px;
  color-scheme: light;
}

[data-theme='dark'] {
  --paper: #0a1118;
  --card: #111b24;
  --ink: #e9eef1;
  --muted: #93a4b1;
  --line: #24323e;
  --fog: #16222d;
  --slab: #16293a;
  --slab-2: #1e3a55;
  --flare: #ff6a47;
  --flare-ink: #1a0a05;
  --warm: #e0a040;
  --cool: #6db1d6;
  --good: #58c39d;
  --shadow: 0 8px 24px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/1.5 Archivo, system-ui, sans-serif;
  font-stretch: 100%;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom));
}
body.has-actionbar { padding-bottom: calc(var(--tabs) + var(--action) + env(safe-area-inset-bottom)); }
body.bare { padding: 0; }

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1 { font-size: var(--t-head); font-weight: 800; font-stretch: 75%; line-height: 1.05; letter-spacing: -.01em; }
h2 { font-size: var(--t-name); font-weight: 700; font-stretch: 85%; line-height: 1.2; }
h3 { font-size: var(--t-label); font-weight: 700; margin-top: 16px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--cool); outline-offset: 2px; }
.i { width: 24px; height: 24px; flex: none; display: block; }
code { font-size: var(--t-label); background: var(--fog); padding: 0 4px; }

/* ---------------------------------------------------------- frame */

.shell { min-width: 0; }
.top {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--slab); color: var(--slab-ink);
  position: sticky; top: 0; z-index: 20;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.top-search { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--slab-2); padding: 0 12px; height: 44px; }
.top-search .i { width: 20px; height: 20px; color: var(--slab-muted); }
.top-search input { flex: 1; min-width: 0; background: none; border: 0; color: inherit; height: 44px; outline-offset: 4px; }
.top-search input::placeholder { color: var(--slab-muted); }
.icon-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  background: none; border: 0; color: inherit; flex: none; }
.badge { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 4px;
  background: var(--flare); color: var(--flare-ink); font-size: var(--t-label); font-weight: 700;
  line-height: 20px; text-align: center; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-stretch: 85%; }
.brand-mark { width: 16px; height: 32px; background: linear-gradient(var(--flare) 0 40%, var(--slab-muted) 40% 100%); flex: none; }
.brand-small { width: 28px; flex: none; }

main { padding-bottom: 24px; }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabs) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabs a, .tabs button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--muted); text-decoration: none;
  font-size: var(--t-label); font-stretch: 85%;
}
.tabs [aria-current] { color: var(--ink); font-weight: 700; box-shadow: inset 0 3px 0 var(--slab-2); }

.rail { display: none; }

/* ---------------------------------------------------------- hero */

.hero {
  position: relative; overflow: hidden;
  background: var(--slab); color: var(--slab-ink);
  padding: 16px 16px 24px;
  display: flex; align-items: flex-end; gap: 16px;
  min-height: 160px;
}
.hero-figure {
  font-size: clamp(144px, 42vw, 240px); line-height: .76; font-weight: 900; font-stretch: 62%;
  letter-spacing: -.03em; color: var(--slab-2); margin-left: -8px; margin-bottom: -8px;
  flex: none;
}
.hero-owed .hero-figure { color: var(--flare); }
.hero-copy { min-width: 0; }
.hero-copy h1 { font-size: var(--t-head); }
.hero-copy p { color: var(--slab-muted); font-size: var(--t-label); margin-top: 8px; }

.band { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 16px; font-weight: 600; }
.band-alert { background: var(--fog); box-shadow: inset 4px 0 0 var(--flare); }
.band-claim { background: var(--slab-2); color: var(--slab-ink); justify-content: space-between; }

/* ---------------------------------------------------------- blocks */

.block { padding: 16px 16px 8px; }
.block > h2 { padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 0; }
.block-tight { background: var(--fog); }
.block-danger { border-top: 1px solid var(--line); margin-top: 16px; }
.block > .btn, .block > form { margin-top: 8px; }
.count { font-weight: 800; font-stretch: 62%; color: var(--muted); margin-left: 4px; }
.empty { color: var(--muted); padding: 16px 0; }
.hint { color: var(--muted); font-size: var(--t-label); padding: 8px 0; }
.board-hint { padding: 0 16px 8px; }
.hint-warn { color: var(--ink); background: var(--fog); padding: 8px 12px; box-shadow: inset 4px 0 0 var(--warm); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.desk-only { display: none; }
.filter-note { padding: 0 16px 8px; color: var(--muted); font-size: var(--t-label); }
.panel { background: var(--card); padding: 16px; margin: 0 0 8px; border-block: 1px solid var(--line); }
.panel h2 { margin-bottom: 8px; }
.panel > summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel > .hint { padding-top: 0; }
.scroll { overflow-x: auto; }
.pager { display: flex; justify-content: center; gap: 8px; padding: 16px; }

/* ---------------------------------------------------------- lead row */

.rows { border-top: 1px solid var(--line); }
.lead {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 72px; padding: 8px 12px 8px 20px;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.lead::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--fog); }
.heat-1::before { background: var(--line); }
.heat-2::before { background: var(--cool); }
.heat-3::before { background: var(--warm); }
.heat-4::before { background: var(--flare); }
.lead-main { flex: 1; min-width: 0; text-decoration: none; display: flex; flex-direction: column; justify-content: center; align-self: stretch; }
.lead-name { font-size: var(--t-name); font-weight: 700; font-stretch: 85%; line-height: 1.2; overflow-wrap: anywhere; }
.lead-meta { display: block; color: var(--muted); font-size: var(--t-label); line-height: 1.35; }
.lead-clock { flex: none; text-align: right; min-width: 56px; }
.lead-clock b { display: block; font-size: var(--t-head); font-weight: 800; font-stretch: 62%; line-height: 1; letter-spacing: -.01em; }
.lead-clock span { display: block; color: var(--muted); font-size: 11px; font-size: var(--t-label); font-stretch: 75%; white-space: nowrap; }
.heat-4 .lead-clock b { color: var(--flare); }
.lead-call { display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  background: var(--slab); color: var(--slab-ink); }
.demo { font-size: var(--t-label); font-weight: 600; font-stretch: 85%; padding: 0 4px; background: var(--fog);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); vertical-align: middle; }
.late-wrap .task { box-shadow: inset 8px 0 0 var(--flare); }

.selectable { display: flex; align-items: stretch; }
.selectable .lead { flex: 1; min-width: 0; }
.pick { display: grid; place-items: center; width: 44px; flex: none; background: var(--card); border-bottom: 1px solid var(--line); }
.pick input { width: 20px; height: 20px; }

.task { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px 8px 20px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.task-body { flex: 1; min-width: 0; }
.task strong { display: block; font-weight: 600; }
.tick { display: grid; place-items: center; width: 44px; height: 44px; background: none;
  border: 2px solid var(--line); color: transparent; }
.tick:hover { border-color: var(--good); color: var(--good); }

.mini { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.mini strong { display: block; font-weight: 600; }
.mini span { display: block; color: var(--muted); font-size: var(--t-label); }
.mini form { margin-top: 4px; }

.alert { display: block; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); text-decoration: none; }
.alert strong { display: block; font-weight: 500; }
.alert.is-new { box-shadow: inset 4px 0 0 var(--flare); }
.alert.is-new strong { font-weight: 700; }
.alert span, .alert time { display: block; color: var(--muted); font-size: var(--t-label); }

/* ---------------------------------------------------------- person */

.person-head {
  position: relative; background: var(--slab); color: var(--slab-ink);
  padding: 12px 16px 16px; display: grid; gap: 12px;
}
.person-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--slab-2); }
.person-head.heat-3::after { background: var(--warm); }
.person-head.heat-4::after { background: var(--flare); }
.person-title { display: flex; align-items: flex-start; gap: 4px; margin-left: -8px; }
.back { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.person-title h1 { font-size: clamp(40px, 11vw, 72px); font-weight: 900; font-stretch: 62%; line-height: .98; overflow-wrap: anywhere; min-width: 0; }
.person-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.person-facts dt { color: var(--slab-muted); font-size: var(--t-label); }
.person-facts dd { font-weight: 500; overflow-wrap: anywhere; }
.person-clock { display: flex; align-items: baseline; gap: 8px; padding-bottom: 8px; }
.person-clock b { font-size: var(--t-display); font-weight: 900; font-stretch: 62%; line-height: .9; letter-spacing: -.02em; }
.person-head.heat-4 .person-clock b { color: var(--flare); }
.person-clock span { color: var(--slab-muted); font-size: var(--t-label); }

.person-state { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; background: var(--fog); }

.timeline .tl { padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
.tl::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: var(--line); }
.tl-inquiry::before, .tl-email_in::before, .tl-registered::before { background: var(--flare); }
.tl-call::before, .tl-text::before, .tl-email_out::before { background: var(--good); }
.tl-note::before { background: var(--warm); }
.tl-site_visit::before, .tl-listing::before { background: var(--cool); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
.tl-head strong { font-weight: 600; }
.tl time, .tl .by { color: var(--muted); font-size: var(--t-label); }
.tl p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.tl .by { display: block; }
.tl details, .block details { margin-top: 8px; font-size: var(--t-label); color: var(--muted); }
.tl summary, .block summary, .filters summary { cursor: pointer; min-height: 32px; }
.tl li { padding: 2px 0; }

.facts > div { display: grid; grid-template-columns: 112px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: var(--t-label); }
.facts dd { overflow-wrap: anywhere; }
.bg { white-space: pre-wrap; padding: 12px; background: var(--fog); margin-top: 8px; overflow-wrap: anywhere; }
.route { font-size: var(--t-label); padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain li { padding: 2px 0; font-size: var(--t-label); }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }

.actionbar {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--tabs) + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: var(--action); background: var(--slab); color: var(--slab-ink);
}
.actionbar a, .actionbar button, .actionbar .off {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; border-left: 1px solid var(--slab-2); color: inherit;
  text-decoration: none; font-size: var(--t-label); font-weight: 600;
}
.actionbar > :first-child { background: var(--flare); color: var(--flare-ink); border: 0; }
.actionbar .off { opacity: .5; }

/* ---------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; background: var(--card); color: var(--ink);
  border: 1px solid var(--ink); text-decoration: none; font-weight: 600; font-stretch: 90%;
}
.btn .i { width: 20px; height: 20px; }
.btn-primary { background: var(--slab); color: var(--slab-ink); border-color: var(--slab); }
[data-theme='dark'] .btn-primary { background: var(--slab-ink); color: var(--slab); border-color: var(--slab-ink); }
.btn-danger { color: var(--flare); border-color: var(--flare); }
@media (hover: hover) {
  .btn:not(.btn-primary):hover { background: var(--fog); color: var(--ink); }
  .btn-primary:hover { background: var(--slab-2); border-color: var(--slab-2); color: var(--slab-ink); }
  [data-theme='dark'] .btn-primary:hover { background: var(--slab-muted); border-color: var(--slab-muted); color: var(--slab); }
}
.link { background: none; border: 0; padding: 0; text-decoration: underline; color: inherit; min-height: 32px; font-size: var(--t-label); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: var(--t-label); color: var(--muted); }
input:not([type='checkbox'], [type='radio'], [type='file'], [type='search']), select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 0; font-size: 16px;
}
textarea { resize: vertical; }
input[readonly] { background: var(--fog); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check input { width: 20px; height: 20px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.grid-form .wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 12px; }
.row-form { display: flex; gap: 8px; align-items: center; }
.row-form input, .row-form select { flex: 1; min-width: 0; }
.form-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.filters { padding: 0 16px 12px; }
.filters form { padding-top: 12px; }

.pills { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.pills a { flex: none; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 500; font-stretch: 90%; white-space: nowrap; }
.pills a b { font-weight: 800; font-stretch: 62%; font-size: var(--t-name); line-height: 1; }
.pills [aria-current] { background: var(--slab); color: var(--slab-ink); border-color: var(--slab); }
.page-head .pills { padding: 0; }

.tag { display: inline-block; padding: 4px 8px; font-size: var(--t-label); font-weight: 600; background: var(--fog); border: 0; }
.tone-hot { color: var(--flare); }
.tone-good { color: var(--good); }
.tone-warm { color: var(--warm); }
.tone-cool { color: var(--cool); }

.table { width: 100%; border-collapse: collapse; font-size: var(--t-label); }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 12px 8px 0; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table input[type='checkbox'] { width: 20px; height: 20px; }

.flash p { padding: 12px 16px; font-weight: 600; background: var(--fog); }
.flash-ok { box-shadow: inset 4px 0 0 var(--good); }
.flash-err { box-shadow: inset 4px 0 0 var(--flare); background: var(--fog); padding: 8px 12px; }

.toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs) + 12px + env(safe-area-inset-bottom));
  z-index: 60; padding: 12px 16px; background: var(--ink); color: var(--paper); font-weight: 600; }

/* ---------------------------------------------------------- sheets */

.sheet {
  margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh; padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  border: 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow); overflow-y: auto;
}
.sheet::backdrop { background: rgb(10 17 24 / 60%); }
.sheet > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; background: var(--card); }
.sheet-close { min-height: 44px; padding: 0 12px; background: none; border: 1px solid var(--line); }
.sheet-links a, .sheet-links button { display: flex; align-items: center; gap: 12px; min-height: 52px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-decoration: none; text-align: left; padding: 0; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label { display: block; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px; border: 1px solid var(--line); font-weight: 600; }
.choice input:checked + span { background: var(--slab); color: var(--slab-ink); border-color: var(--slab); }
.choice input:focus-visible + span { outline: 3px solid var(--cool); outline-offset: 2px; }

.bulkbar {
  position: fixed; left: 0; right: 0; z-index: 28; bottom: calc(var(--tabs) + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--slab); color: var(--slab-ink);
}
.bulkbar[hidden] { display: none; }
.bulkbar select, .bulkbar input { flex: 1 1 140px; width: auto; color: var(--ink); }
.bulkbar .btn-primary { background: var(--slab-ink); color: var(--slab); }

/* ---------------------------------------------------------- board */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 84vw); gap: 8px;
  overflow-x: auto; padding: 0 16px 16px; scroll-snap-type: x proximity; align-items: start; }
.col.tone-hot, .col.tone-warm, .col.tone-good, .col.tone-cool, .col.tone-neutral { color: var(--ink); }
.col { background: var(--fog); scroll-snap-align: center; min-width: 0; }
.col > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 12px; color: var(--ink); border-top: 4px solid currentColor; }
.col.tone-hot > header { color: var(--flare); }
.col.tone-warm > header { color: var(--warm); }
.col.tone-good > header { color: var(--good); }
.col.tone-cool > header { color: var(--cool); }
.col > header h2 { color: var(--ink); }
.col > header b { font-size: var(--t-head); font-weight: 800; font-stretch: 62%; line-height: 1; color: var(--ink); }
.col-cards { display: grid; gap: 4px; padding: 4px; min-height: 96px; }
.col-cards.is-over { background: var(--line); }
.card { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px 8px 8px 16px; background: var(--card); touch-action: pan-y; }
.card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--fog); }
.card a { grid-column: 1; grid-row: 1; text-decoration: none; min-width: 0; }
.card strong { display: block; font-weight: 700; font-stretch: 85%; overflow-wrap: anywhere; }
.grip { grid-column: 2; grid-row: 1; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: grab; touch-action: none; }
.card-move { grid-column: 1 / -1; min-height: 44px; }
@media (hover: hover) and (pointer: fine) {
  .card-move:not(:focus) { min-height: 28px; padding-block: 0; font-size: var(--t-label); color: var(--muted); border-color: transparent; background-color: var(--fog); }
}
.card.is-dragging { position: fixed; z-index: 70; pointer-events: none; box-shadow: var(--shadow); opacity: .95; }
.card-gap { background: var(--line); }

.stageline { display: flex; gap: 4px; padding: 0 16px 12px; overflow-x: auto; }
.stageline button { flex: none; min-height: 44px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); font-weight: 500; white-space: nowrap; }
.stageline [aria-current] { background: var(--slab); color: var(--slab-ink); border-color: var(--slab); }

.split-row { display: grid; grid-template-columns: 1fr 96px; gap: 8px; margin-bottom: 8px; }

.steps { counter-reset: step; display: grid; gap: 8px; }
.step { counter-increment: step; background: var(--fog); padding: 8px 12px 12px; }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-no::before { content: counter(step); font-size: var(--t-head); font-weight: 800; font-stretch: 62%; line-height: 1; }
.step-body { display: none; gap: 8px; margin-top: 8px; }
.step-body.is-on { display: flex; flex-wrap: wrap; }
.step-body > * { flex: 1 1 120px; }
.rotation { display: grid; grid-template-columns: 1fr 72px; gap: 8px 12px; align-items: center; border: 1px solid var(--line); padding: 12px; }
.template { border-bottom: 1px solid var(--line); padding: 8px 0; }
.review { background: var(--card); padding: 12px; border-bottom: 1px solid var(--line); }
.review summary span { display: block; color: var(--muted); font-size: var(--t-label); }
.review pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fog); padding: 12px; font: inherit; font-size: var(--t-label); }

.bars { display: grid; gap: 12px; padding: 12px 0; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.bar-name { font-weight: 600; }
.bar-value { font-size: var(--t-head); font-weight: 800; font-stretch: 62%; line-height: 1; }
.bar-track { grid-column: 1 / -1; height: 8px; background: var(--fog); display: block; }
.bar-fill { display: block; height: 100%; background: var(--good); }
.bar-fill.is-slow { background: var(--flare); }
.bar-note { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-label); }

/* ---------------------------------------------------------- sign in */

.auth { min-height: 100dvh; display: grid; align-content: center; gap: 24px; padding: 24px 16px;
  background: var(--slab); color: var(--slab-ink); overflow: hidden; }
.auth-figure { font-size: clamp(72px, 19vw, 180px); line-height: .86; font-weight: 900; font-stretch: 62%; letter-spacing: -.02em; color: var(--slab-2); }
.auth-card { background: var(--card); color: var(--ink); padding: 24px 16px; display: grid; gap: 12px; }
.auth-card a:not(.btn) { font-size: var(--t-label); }
body.bare main { padding-bottom: 24px; }

/* ---------------------------------------------------------- wide */

@media (min-width: 960px) {
  :root { --t-head: 40px; }
  .desk-only { display: inline-flex; }
  body, body.has-actionbar { padding-bottom: 0; padding-left: 224px; }
  body.bare { padding: 0; }
  .tabs { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 16px;
    position: fixed; inset: 0 auto 0 0; width: 224px; padding: 16px 0;
    background: var(--slab); color: var(--slab-ink); overflow-y: auto; z-index: 30;
  }
  .rail .brand { padding: 0 16px; }
  .rail nav { display: grid; }
  .rail nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 16px; text-decoration: none; color: var(--slab-muted); }
  .rail nav a:hover { color: var(--slab-ink); }
  .rail nav [aria-current] { color: var(--slab-ink); background: var(--slab-2); box-shadow: inset 4px 0 0 var(--flare); }
  .rail-foot { margin-top: auto; padding: 0 16px; font-size: var(--t-label); color: var(--slab-muted); overflow-wrap: anywhere; }
  .top { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); padding: 8px 16px; }
  .top-search { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); max-width: 480px; margin-right: auto; }
  .top-search input::placeholder, .top-search .i { color: var(--muted); }
  .brand-small { display: none; }
  .hero { padding: 24px; min-height: 220px; }
  .hero-figure { font-size: 240px; }
  .split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
  .split-even { grid-template-columns: 1fr 1fr; }
  .block, .page-head, .pills, .filters { padding-inline: 24px; }
  .board { padding-inline: 24px; grid-auto-columns: minmax(240px, 1fr); }
  .board-hint, .filter-note { padding-inline: 24px; }
  .panel { margin-inline: 24px; border: 1px solid var(--line); }
  .person-head { grid-template-columns: minmax(0, 1fr) auto; padding: 16px 24px 24px; align-items: end; }
  .person-title { grid-column: 1 / -1; }
  .person-facts { grid-template-columns: repeat(4, auto); justify-content: start; gap: 8px 32px; }
  .person-state { padding-inline: 24px; max-width: 760px; }
  .actionbar { left: 224px; bottom: 0; height: 56px; }
  .actionbar a, .actionbar button, .actionbar .off { flex-direction: row; gap: 8px; }
  body.has-actionbar { padding-bottom: 56px; }
  .bulkbar { left: 224px; bottom: 0; }
  .toast { left: auto; right: 24px; bottom: 24px; max-width: 420px; }
  .sheet { margin: auto; width: 560px; max-height: 86dvh; }
  .auth { grid-template-columns: 1.2fr minmax(340px, 420px); align-items: center; padding: 48px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .tick, .pills a { transition: background-color .15s, color .15s; }
}

@media print {
  .tabs, .rail, .top, .actionbar { display: none; }
}
