/* Groundwork "day sheet" design system (v5).
   Field-campaign paper: flat sheet, heavy section rules, highlighter for attention,
   ballpoint blue for interaction, mono for data. No cards, no shadows, no radii.
   Chart series colors keep the validated dataviz reference values. */

:root {
  color-scheme: light;
  --page: #ecebe3;
  --surface: #ecebe3;
  --surface-2: #e2e0d4;
  --ink: #201f1a;
  --ink-2: #56534a;
  --muted: #837f71;
  --grid: #c6c3b4;
  --rule: #201f1a;
  --border: #c6c3b4;
  --accent: #2f45a0;
  --accent-ink: #ecebe3;
  --hl: #f7e455;
  --hl-ink: #201f1a;
  --seq-250: #86b6ef; --seq-350: #5598e7; --seq-450: #2a78d6; --seq-550: #1c5cab;
  --c-blue: #2a78d6; --c-orange: #eb6834; --c-aqua: #1baf7a; --c-yellow: #eda100;
  --c-magenta: #e87ba4; --c-green: #008300; --c-violet: #4a3aa7; --c-red: #e34948;
  --s-good: #2e7d4f; --s-warn: #a06c00; --s-serious: #a34b26; --s-crit: #b3402e;
  --good-text: #2e7d4f;
  --font-display: Futura, "Century Gothic", "Trebuchet MS", sans-serif;
  --font-body: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #16150f;
    --surface: #16150f;
    --surface-2: #201f16;
    --ink: #e9e6d8;
    --ink-2: #b5b1a0;
    --muted: #8a8678;
    --grid: #3d3b2e;
    --rule: #e9e6d8;
    --border: #3d3b2e;
    --accent: #93a4ea;
    --accent-ink: #16150f;
    --hl: rgba(247, 228, 85, 0.26);
    --hl-ink: #e9e6d8;
    --seq-250: #184f95; --seq-350: #1c5cab; --seq-450: #256abf; --seq-550: #3987e5;
    --c-blue: #3987e5; --c-orange: #d95926; --c-aqua: #199e70; --c-yellow: #c98500;
    --c-magenta: #d55181; --c-green: #008300; --c-violet: #9085e9; --c-red: #e66767;
    --s-good: #5faf7f; --s-warn: #d9a03c; --s-serious: #d97a4d; --s-crit: #d96a55;
    --good-text: #5faf7f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #16150f;
  --surface: #16150f;
  --surface-2: #201f16;
  --ink: #e9e6d8;
  --ink-2: #b5b1a0;
  --muted: #8a8678;
  --grid: #3d3b2e;
  --rule: #e9e6d8;
  --border: #3d3b2e;
  --accent: #93a4ea;
  --accent-ink: #16150f;
  --hl: rgba(247, 228, 85, 0.26);
  --hl-ink: #e9e6d8;
  --seq-250: #184f95; --seq-350: #1c5cab; --seq-450: #256abf; --seq-550: #3987e5;
  --c-blue: #3987e5; --c-orange: #d95926; --c-aqua: #199e70; --c-yellow: #c98500;
  --c-magenta: #d55181; --c-green: #008300; --c-violet: #9085e9; --c-red: #e66767;
  --s-good: #5faf7f; --s-warn: #d9a03c; --s-serious: #d97a4d; --s-crit: #d96a55;
  --good-text: #5faf7f;
}

* { box-sizing: border-box; border-radius: 0 !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600; margin: 0 0 4px;
  text-transform: uppercase; letter-spacing: 0.05em; text-wrap: balance;
}
h2 {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; margin: 0 0 12px;
  text-transform: uppercase; letter-spacing: 0.12em;
  border-top: 3px solid var(--rule); padding-top: 7px;
}
h3 {
  font-family: var(--font-display);
  font-size: 11.5px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-2); font-weight: 600;
}
p { margin: 0 0 10px; }
.sub { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--muted); }
.num, code, .when { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
code { font-size: 12px; background: none; padding: 0; color: var(--ink-2); }

/* Top bar: masthead with a heavy rule */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--page);
  border-bottom: 3px solid var(--rule);
  display: flex; align-items: baseline; gap: 6px;
  padding: 14px 24px 10px;
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink); display: flex; align-items: baseline; gap: 10px; margin-right: 22px;
}
.brand:hover { text-decoration: none; }
.brand .logo { display: none; }
.brand .proto {
  font-family: var(--font-mono); font-size: 10px; font-weight: 400;
  color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.nav { display: flex; gap: 20px; flex: 1; flex-wrap: wrap; }
.nav a {
  font-family: var(--font-display); font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-2); padding: 2px 0;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.persona { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-right: 12px; white-space: nowrap; }
.themebtn {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  border: none; background: none; color: var(--muted); cursor: pointer; padding: 2px 0;
}
.themebtn:hover { color: var(--ink); }
.themebtn::before { content: "["; }
.themebtn::after { content: "]"; }

/* Layout: one flat sheet */
.wrap { width: 100%; margin: 0; padding: 24px clamp(16px, 2.5vw, 56px) 72px; }
.wrap.narrow { max-width: 880px; margin: 0 auto; }
.cols { display: grid; gap: 32px; }
@media (min-width: 880px) {
  .cols-2 { grid-template-columns: 1fr 1fr; }
  .cols-31 { grid-template-columns: 2fr 1fr; }
}
.pagehead { margin-bottom: 22px; }

/* "Cards" are now plain sections: space, not boxes */
.card { background: none; border: none; padding: 0; margin-bottom: 30px; }
.card.flush { padding: 0; }
.divider { border: 0; border-top: 1px solid var(--grid); margin: 14px 0; }

/* Banner: a flagged note, not a box */
.banner {
  border: none; border-top: 3px solid var(--rule); border-bottom: 1px solid var(--grid);
  background: none; padding: 10px 0 12px; margin-bottom: 20px;
  font-size: 13.5px; color: var(--ink-2);
}
.banner.crit { border-top-color: var(--s-crit); color: var(--ink); }
.banner.info { border-top-color: var(--accent); }

/* Stat tiles: bare figures over a rule */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; margin-bottom: 26px; }
.tile { background: none; border: none; border-top: 3px solid var(--rule); padding: 8px 0 0; }
.tile .v { font-family: var(--font-mono); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.tile .l { font-family: var(--font-display); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); margin-top: 2px; }
.tile .d { font-size: 12px; margin-top: 3px; color: var(--muted); }

/* Chips: quiet mono labels with a square marker */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-2);
  background: none; border: none; padding: 0; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; background: var(--muted); flex: none; }
.chip.ready .dot { background: var(--c-blue); }
.chip.submitted .dot { background: var(--c-aqua); }
.chip.screening .dot { background: var(--c-orange); }
.chip.offer .dot { background: var(--c-green); }
.chip.monitoring .dot { background: var(--c-violet); }
.chip.closed .dot, .chip.rejected .dot { background: var(--muted); }
.chip.owner::before { content: "/ "; color: var(--muted); }

/* Badges: attention = highlighter; the rest is colored ink */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em;
  padding: 1px 2px; line-height: 1.4; background: none;
}
.badge.warn { background: linear-gradient(100deg, transparent 0, var(--hl) 4%, var(--hl) 96%, transparent 100%); color: var(--hl-ink); padding: 1px 7px; }
.badge.crit { color: var(--s-crit); font-weight: 600; }
.badge.good { color: var(--good-text); }
.badge.wait { color: var(--muted); }

/* Buttons: rubber-stamp rectangles */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 11.5px/1 var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 9px 14px; cursor: pointer;
  border: 1.5px solid var(--ink); background: none; color: var(--ink);
}
.btn:hover { background: var(--ink); color: var(--page); text-decoration: none; }
.btn.primary { background: var(--ink); color: var(--page); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; color: var(--accent); padding-left: 0; padding-right: 0; }
.btn.ghost:hover { background: none; color: var(--accent); text-decoration: underline; }
.btn.sm { padding: 6px 10px; font-size: 10.5px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn[disabled]:hover { background: none; color: var(--ink); }
.btn.ghost[disabled]:hover { color: var(--accent); }

/* Tables: ruled lines only */
.tablewrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th {
  text-align: left; font-family: var(--font-display); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-2); font-weight: 600; padding: 7px 10px 5px 0;
  border-bottom: 2px solid var(--rule); white-space: nowrap;
  position: sticky; top: 0; background: var(--page);
}
table.grid th.sortable { cursor: pointer; }
table.grid th.sortable:hover { color: var(--ink); }
table.grid td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.grid tr:hover td { background: var(--surface-2); }
table.grid td.nowrap { white-space: nowrap; }

/* Forms: ruled fields */
label.f {
  display: block; font-family: var(--font-display); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); margin: 14px 0 4px;
}
input[type="text"], input[type="date"], textarea, select {
  width: 100%; font: 14px/1.4 var(--font-body);
  color: var(--ink); background: var(--page); border: none; border-bottom: 1.5px solid var(--ink-2);
  padding: 7px 2px;
}
textarea { min-height: 70px; resize: vertical; border: 1.5px solid var(--ink-2); padding: 8px; }
select { border: 1.5px solid var(--ink-2); padding: 7px 8px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { accent-color: var(--ink); }

/* Filter row */
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .fchip {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 4px 0; cursor: pointer; border: none; background: none; color: var(--ink-2);
}
.filters .fchip:hover { color: var(--ink); }
.filters .fchip.on { color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.filters input[type="text"] { width: 200px; }
.filters select { width: auto; }

/* Accordion: ruled entries */
details.acc { border: none; border-bottom: 1px solid var(--grid); margin: 0; background: none; }
details.acc summary {
  cursor: pointer; padding: 11px 2px; font-weight: 600; font-size: 14px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
details.acc summary::after { content: "+"; color: var(--muted); font-family: var(--font-mono); font-size: 15px; }
details.acc[open] summary::after { content: "\2212"; }
details.acc .accbody { padding: 0 2px 14px; color: var(--ink-2); font-size: 14px; }
details.acc .accbody blockquote {
  margin: 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--rule);
  background: none; color: var(--ink); max-width: 65ch;
}

/* Timeline: square markers on a rule */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px;
  background: var(--ink);
}
.timeline li::after {
  content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 1px; background: var(--grid);
}
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 11.5px; color: var(--muted); }

/* Funnel */
.funnel .frow { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; margin-bottom: 8px; }
.funnel .flabel { font-family: var(--font-display); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); text-align: right; }
.funnel .fbarwrap { background: var(--surface-2); height: 18px; position: relative; }
.funnel .fbar { height: 100%; min-width: 3px; }
.funnel .fval { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }

/* Stepper: a numbered line */
.steps { display: flex; gap: 26px; margin-bottom: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--grid); padding-bottom: 0; }
.steps .step {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding: 6px 0 8px; border-bottom: 3px solid transparent; cursor: default;
}
.steps .step.on { color: var(--ink); border-bottom-color: var(--ink); }
.steps .step.done { color: var(--good-text); }
.steps .step.done::before { content: "\2713 "; }

/* Copy rows: ledger entries */
.copyrow {
  display: flex; align-items: flex-start; gap: 12px;
  border: none; border-bottom: 1px solid var(--grid); padding: 10px 0; margin-bottom: 0;
  background: none;
}
.copyrow .cval { flex: 1; font-size: 13.5px; }
.copyrow .cval .cl {
  font-family: var(--font-display); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin-bottom: 2px;
}
.copyrow code { font-size: 12.5px; }

/* Phone frame: a pocket sheet */
.phone {
  max-width: 420px; margin: 0 auto;
  border: 1.5px solid var(--ink);
  background: var(--page);
  padding: 18px 16px 24px;
}
.phone .card { margin-bottom: 18px; }
.phone h3 { display: flex; justify-content: space-between; gap: 8px; }

/* Question/note cards: ruled entries */
.qcard { border: none; border-bottom: 1px solid var(--grid); padding: 10px 0; margin-bottom: 0; background: none; }
.qcard .qmeta { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 5px; }
.qcard.answered { opacity: 0.65; }

/* Static-mock marker */
.mock { position: relative; }
.mock::after {
  content: "static mock"; position: absolute; top: 4px; right: 0;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

/* Dense list vocabulary */
.ghead {
  display: flex; align-items: baseline; gap: 10px; cursor: pointer; user-select: none;
  padding: 8px 0 6px; margin-top: 22px; border-bottom: 2px solid var(--rule);
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
}
.ghead .caret { transition: transform 0.12s ease; color: var(--muted); font-size: 10px; }
.ghead.closed .caret { transform: rotate(-90deg); }
.ghead .gcount { font-family: var(--font-mono); color: var(--muted); font-weight: 400; }
.ghead .gdigest { margin-left: auto; font-family: var(--font-mono); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 11.5px; display: flex; gap: 8px; align-items: center; }
.lrow {
  display: grid; grid-template-columns: 7px minmax(200px, 1.1fr) minmax(180px, 1.6fr) auto;
  gap: 14px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 13.5px; cursor: pointer;
}
.lrow:hover { background: var(--surface-2); }
.lrow .ldot { width: 7px; height: 7px; align-self: center; }
.lrow .lemployer { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lrole { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lmeta { display: flex; gap: 10px; align-items: baseline; white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.age { display: inline-flex; gap: 2px; align-items: center; }
.age i { width: 5px; height: 5px; background: var(--grid); font-style: normal; }
.age i.on { background: var(--muted); }
.age.hot i.on { background: var(--s-serious); }
.stale { color: var(--s-serious); font-weight: 600; }
.agebar { display: inline-flex; height: 7px; overflow: hidden; vertical-align: baseline; }
.agebar span { display: block; height: 100%; }

/* Task rows */
.trow { border-bottom: 1px solid var(--grid); }
.trow .trhead { display: flex; gap: 12px; align-items: baseline; padding: 11px 0; cursor: pointer; }
.trow .trhead:hover { background: var(--surface-2); }
.trow .tglyph { flex: none; font-family: var(--font-mono); font-weight: 700; width: 18px; text-align: center; }
.trow.k-do .tglyph { color: var(--accent); }
.trow.k-decide .tglyph { color: var(--s-serious); }
.trow.k-review .tglyph { color: var(--ink-2); }
.trow .trtitle { font-weight: 600; font-size: 14.5px; }
.trow .trwhy { color: var(--muted); font-size: 12.5px; }
.trow .trbody { padding: 2px 0 16px 30px; max-width: 720px; }
.trow.done .trtitle { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.viewswitch { display: inline-flex; gap: 16px; border: none; }
.viewswitch span {
  padding: 4px 0; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; cursor: pointer; color: var(--ink-2);
}
.viewswitch span:hover { color: var(--ink); }
.viewswitch span.on { color: var(--ink); box-shadow: 0 2px 0 var(--ink); }

/* Board panels: the one place a box remains, drawn in ink */
.pilepanel { border: 1.5px solid var(--ink); background: none; }
.pilepanel .ph { padding: 12px 14px; border-bottom: 2px solid var(--rule); }
.pilepanel .ph .cnt { font-family: var(--font-mono); font-size: 24px; font-weight: 600; }
.pilepanel .lrow { padding-left: 14px; padding-right: 14px; }
.jcard { border: 1.5px solid var(--ink); background: none; padding: 12px 14px; margin-bottom: 12px; }

/* Sankey text */
.slabel { font: 600 12px var(--font-body); fill: var(--ink); }
.scount { font: 600 12px var(--font-mono); fill: var(--ink); }
.ssub { font: 11px var(--font-body); fill: var(--muted); }

/* Footer */
.foot {
  margin-top: 40px; font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  border-top: 3px solid var(--rule); padding-top: 10px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
