/* public/desk.css — the desk's look: a terminal ledger (Jorg, 28 September 2026).
 *
 * "The current theme has a comic book feeling: rounded edges, big fonts. This is a
 * dev website; it needs to be clean, straight lines." Chosen from three directions:
 * the front page's own type and colour (IBM Plex Sans and Mono, ink on paper, clean
 * green, defect rust), finds as ruled rows like a log, numbers and PEL-47 in mono.
 *
 * ⛔ LOADED ON THE DESK ONLY AND SCOPED TO body.desk. The front page loads app.css
 * and home.css, was approved on top of them, and must render byte for byte as it
 * did. app.css stays the base; everything here overrides it one class deeper.
 *
 * ⛔ MONO IS FOR DATA, never for decoration: find numbers, grades, dates, counts,
 * the snippet, the history. Prose and labels are sans.
 *
 * ⚠ TAP TARGETS STAY 40px ON A TOUCH SCREEN (the mobile done-when, item 3), and
 * shrink to 32px only where the pointer is fine. Corners are 2px everywhere.
 */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-500.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-600.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-500.woff2) format('woff2'); }

body.desk {
  --paper: #F5F3EC;
  --panel: #FFFFFF;
  --sunk: #EDEAE1;
  --ink: #17160F;
  --muted: #5B5850;
  --rule: #DCD8CC;
  --rule-strong: #BDB8AA;
  --clean: #146C43;
  --clean-tint: #E3F1E9;
  --defect: #B4470F;
  --defect-tint: #F7E6DC;
  --on-ink: #F5F3EC;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --r: 2px;
  --tap: 2.5rem;
  --gap: 1rem;
  --line: 1px solid var(--rule);
  --radius: var(--r);
  color-scheme: light;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  body.desk {
    --paper: #121210;
    --panel: #1A1A17;
    --sunk: #0D0D0B;
    --ink: #ECE9E0;
    --muted: #A19D92;
    --rule: #2E2D28;
    --rule-strong: #46443C;
    --clean: #4FBF86;
    --clean-tint: #15291E;
    --defect: #E58A57;
    --defect-tint: #2E1C12;
    --on-ink: #121210;
    color-scheme: dark;
  }
}
@media (pointer: fine) { body.desk { --tap: 2rem; } }

/* ── frame ─────────────────────────────────────────────────────────────── */
body.desk header.top { background: var(--paper); border-bottom: 1px solid var(--ink); padding: 0.6rem 1rem; }
body.desk header.top a.brand { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
body.desk header.top a.brand::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--clean); margin-right: 0.5rem; vertical-align: 1px; }
body.desk header.top nav { font-size: 13px; }
body.desk header.top nav a { color: var(--ink); }
body.desk main { max-width: 52rem; }
body.desk footer.foot { max-width: 52rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 12px; }

body.desk h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 1.5rem 0 0.5rem; }
body.desk h2 { font-size: 13px; font-weight: 600; margin: 2rem 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--ink); }
body.desk h3 { font-size: 14px; font-weight: 600; }
body.desk .muted, body.desk label, body.desk .find .meta, body.desk footer.foot { color: var(--muted); }
body.desk .small { font-size: 12px; }
body.desk .ok { color: var(--clean); }
body.desk .bad { color: var(--defect); }
body.desk a { color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 2px; }
body.desk a:hover { text-decoration-color: var(--ink); }
body.desk :focus-visible { outline: 2px solid var(--clean); outline-offset: 1px; }

/* ── panels ────────────────────────────────────────────────────────────── */
body.desk .card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 0.9rem 1rem; }
body.desk details { border-bottom: 1px solid var(--rule); }
body.desk details summary { font-weight: 500; }
body.desk details.card { padding: 0.6rem 1rem; }
body.desk details.card[open] { padding-bottom: 1rem; }

body.desk .notice { border: 1px solid var(--clean); border-radius: var(--r); background: var(--clean-tint); padding: 0.6rem 0.9rem; }
body.desk .notice.bad { border-color: var(--defect); background: var(--defect-tint); }

/* ── numbers ───────────────────────────────────────────────────────────── */
body.desk .num b { font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; }
body.desk .num span { font-size: 12px; color: var(--muted); }
body.desk .spark i { background: var(--clean); border-radius: 0; opacity: 1; }
body.desk .spark i.none { background: var(--rule); }

body.desk .chip {
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  padding: 0 0.35rem;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  background: transparent;
}
body.desk .chip.on { border-color: var(--ink); color: var(--ink); }
body.desk .chip.warn { border-color: var(--defect); color: var(--defect); }

/* ── controls ──────────────────────────────────────────────────────────── */
body.desk label { font-size: 12px; }
body.desk input[type=text], body.desk input[type=email], body.desk input[type=password],
body.desk input[type=date], body.desk textarea, body.desk select {
  min-height: var(--tap);
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink);
  font: 400 14px/1.4 var(--sans);
}
body.desk input[type=date] { display: block; width: 100%; margin-top: 0.25rem; font-family: var(--mono); font-size: 13px; }
body.desk textarea { min-height: 4.5rem; }
body.desk select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 1.8rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 9px) 55%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}
body.desk input:hover, body.desk select:hover, body.desk textarea:hover { border-color: var(--ink); }
body.desk input[type=checkbox], body.desk input[type=radio] { accent-color: var(--ink); width: 1rem; height: 1rem; }
body.desk fieldset.bands { border: 1px solid var(--rule); border-radius: var(--r); padding: 0.4rem 0.75rem 0.6rem; background: var(--panel); }
body.desk fieldset.bands legend { font-size: 12px; color: var(--muted); }
body.desk fieldset.bands label { color: var(--ink); font-size: 14px; display: flex; gap: 0.5rem; align-items: center; min-height: var(--tap); }
body.desk fieldset.bands label + label { margin-top: 0; }

body.desk button, body.desk .btn {
  min-height: var(--tap);
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: transparent;
  color: var(--ink);
  font: 500 13px/1 var(--sans);
}
body.desk button:hover, body.desk .btn:hover { background: var(--sunk); }
body.desk button.primary, body.desk .btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 500; }
body.desk button.primary:hover, body.desk .btn.primary:hover { background: var(--clean); border-color: var(--clean); color: #fff; }
body.desk button.small, body.desk .btn.small { min-height: calc(var(--tap) - 0.25rem); padding: 0.2rem 0.6rem; font-size: 12px; }
body.desk button.on { background: var(--ink); color: var(--on-ink); }
body.desk button.danger { border-color: var(--defect); color: var(--defect); background: transparent; }
body.desk button.danger:hover { background: var(--defect-tint); }
body.desk button:disabled { opacity: 0.45; }

/* Filters stay links (v1 rule 12), drawn as one segmented strip per axis. */
body.desk .filters { gap: 0; align-items: stretch; }
body.desk .filters a {
  display: inline-flex; align-items: center;
  min-height: var(--tap);
  padding: 0 0.7rem;
  margin: 0 -1px 0 0;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--panel);
}
body.desk .filters a:first-of-type { border-radius: var(--r) 0 0 var(--r); }
body.desk .filters a:last-of-type { border-radius: 0 var(--r) var(--r) 0; }
body.desk .filters a.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); position: relative; font-weight: 500; }

body.desk pre.snippet {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--sunk);
  color: var(--ink);
  font: 400 12px/1.5 var(--mono);
}
body.desk code { font-family: var(--mono); font-size: 0.92em; }

/* ── the overview table ────────────────────────────────────────────────── */
body.desk .table-wrap { border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); }
body.desk table.gates { font-size: 13px; }
body.desk table.gates thead th { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--ink); }
body.desk table.gates th, body.desk table.gates td { border-bottom: 1px solid var(--rule); padding: 0.5rem 0.45rem; }
body.desk table.gates .n, body.desk table.gates .d { font-family: var(--mono); font-size: 12px; }
body.desk table.gates tbody tr:hover { background: var(--sunk); }
/* Open work (FIN-16): eight columns that must fit 320px without a scrollbar. */
@media (max-width: 36rem) {
  body.desk table.open-work th, body.desk table.open-work td { padding: 0.45rem 0.2rem; }
  body.desk table.open-work thead th { hyphens: manual; font-size: 10px; }
  body.desk table.open-work .n { font-size: 11px; }
  body.desk table.open-work tbody th { font-size: 12px; overflow-wrap: normal; }
}

/* ── the inbox as a ledger ─────────────────────────────────────────────── */
/* ⛔ ONE FIND, ONE BOX (Jorg, 28 September 2026): a hairline between rows lost the
   overview on a long inbox. Each find is a bordered card, its number and chips on a
   header strip, and the form inside it sits on paper so it reads as part of it. */
body.desk .find {
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  margin: 0 0 0.9rem;
  padding: 0 0.9rem 0.6rem;
  background: var(--panel);
}
body.desk .find > .fhead {
  margin: 0 -0.9rem 0.6rem;
  padding: 0.5rem 0.9rem;
  background: var(--sunk);
  border-bottom: 1px solid var(--rule-strong);
}
body.desk .find > .fhead > span { font-family: var(--mono); font-size: 13px; font-weight: 500; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
body.desk .find .summary { font-weight: 600; }
body.desk .find .note { font-size: 14px; max-width: 72ch; }
body.desk .find .meta { font-family: var(--mono); font-size: 11px; line-height: 1.6; }
body.desk .find .meta b { font-family: var(--sans); font-size: 12px; color: var(--ink); }
body.desk .find form.findform .sels select { flex: 1 1 8.5rem; font-size: 13px; }
body.desk .find form.findform { padding: 0.6rem; margin-top: 0.6rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); }
body.desk .find details.fixnote, body.desk .find details.history, body.desk .find details.erase { border: 0; }
body.desk .find details summary { font-size: 12px; color: var(--muted); font-weight: 400; }
body.desk .find details.history ul { font-family: var(--mono); font-size: 11px; color: var(--muted); list-style: none; padding-left: 0; }
body.desk .find details.history li { padding: 0.15rem 0; border-top: 1px dotted var(--rule); }

/* ── the add form and the map ──────────────────────────────────────────── */
body.desk details.add > summary { font-size: 13px; }
body.desk details.add > summary b { font-weight: 600; }
body.desk .map { gap: 0 1rem; }
body.desk .map .stage h2 { display: flex; justify-content: space-between; font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
body.desk .map .stage h2 span { font-weight: 400; }
body.desk .map .mapcard { padding: 0.7rem 0.8rem; margin-bottom: 0.6rem; }
body.desk .map .mapcard h3 { font-size: 14px; margin: 0 0 0.35rem; }
body.desk .map .mapcard ul { font-family: var(--mono); font-size: 12px; padding-left: 0; list-style: none; margin: 0.35rem 0 0.6rem; }
body.desk .map .mapcard details { border: 0; padding: 0.4rem 0 0; }
body.desk details.add .sels { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
body.desk details.add .sels > * { flex: 1 1 9rem; width: auto; margin: 0; }
body.desk details.add form:has(select[name="kind"] option[value="idea"]:checked) select.sev { display: none; }
body.desk .filters { margin: 0 0 0.4rem; }
body.desk .filters > span { display: inline-flex; align-items: center; width: 4.75rem; font-family: var(--mono); font-size: 11px; }
body.desk .filters > span + a { border-radius: var(--r) 0 0 var(--r); }
body.desk .map { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
body.desk .find > .notice, body.desk .mapcard > .notice { margin: 0 0 0.6rem; }
body.desk .find > .notice { margin: 0.6rem 0; }
body.desk .find { scroll-margin-top: 3.5rem; }
body.desk .mapcard { scroll-margin-top: 3.5rem; }

/* The site page: its one way to the settings, top right (docs/PLAN-build-sessions.md). */
body.desk .site-tools { display: flex; justify-content: flex-end; margin: 0 0 0.5rem; }
body.desk .site-tools { gap: 0.5rem; }
/* No terminal on a phone: the session button shows only with a fine pointer. */
body.desk .session-start { display: none; }
@media (pointer: fine) { body.desk .session-start { display: inline-flex; } }

/* Next up: the build queue, one line per item, the reason in mono. */
body.desk .queue ol { margin: 0; padding: 0; list-style: none; }
body.desk .queue li { padding: 0.5rem 0; border-top: var(--line); display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
body.desk .queue li:first-child { border-top: 0; }
body.desk .queue .q-why { font-family: var(--mono); font-size: 12px; min-width: 9rem; }
body.desk .queue .q-blocks .q-why { color: var(--defect); font-weight: 500; }
body.desk .queue .q-find { flex-basis: 100%; }
body.desk .queue .q-find .ref { font-family: var(--mono); font-size: 12px; margin-right: 0.35rem; }

/* Next up folds away when you only want the inbox; the count stays on the fold. */
body.desk details.queue { border: 1px solid var(--rule); }
body.desk details.queue > summary { cursor: pointer; list-style-position: inside; }
body.desk details.queue > summary h3 { display: inline; margin: 0; }
body.desk .queue .q-count { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 0.5rem; }
body.desk details.queue[open] > summary { margin-bottom: 0.5rem; }
body.desk .filters + .find, body.desk .filters + .card { margin-top: 1rem; }

/* The inbox, the archive, everything: three links with counts, the inbox first. */
body.desk .inbox-switch { display: flex; flex-wrap: wrap; gap: 0; margin: 1.5rem 0 0.4rem; border-bottom: 1px solid var(--ink); }
body.desk .inbox-switch a { padding: 0.45rem 0.9rem 0.4rem; text-decoration: none; border: 1px solid transparent; border-bottom: 0; color: var(--muted); }
body.desk .inbox-switch a b { font-weight: 600; color: var(--ink); }
body.desk .inbox-switch a span { font-family: var(--mono); font-size: 12px; margin-left: 0.3rem; }
body.desk .inbox-switch a.on { border-color: var(--ink); background: var(--panel); margin-bottom: -1px; }
body.desk .inbox-switch { scroll-margin-top: 1rem; }
