/* ===========================================================
   Cinder workspace — client thread tracker
   Tokens and colour values reused verbatim from public/styles.css
   (the landing page) so the workspace and the marketing site read
   as one thing. Structural rules (.item, .badge, .entry, .entry.k,
   .who, .ts) follow ~/Documents/Outwest/outstanding-2026-07-28.html,
   the hand-written tracker this replaces — same shapes, this app's
   colours, no localStorage or note-folding (the server replaces it).
   =========================================================== */

:root {
  --bg:          #ffffff;                 /* --white in styles.css */
  --bg-alt:      #f7f4f1;                 /* --paper in styles.css */
  --line:        rgba(23, 22, 26, 0.1);   /* --hairline in styles.css */
  --line-strong: rgba(23, 22, 26, 0.14);  /* --hairline-grid in styles.css */
  --ink:         #17161a;                 /* --ink in styles.css */
  --ink-soft:    #5c575f;                 /* --muted-grey in styles.css */
  --ink-softer:  #8b857f;                 /* --attr-grey in styles.css */
  --red:         #E0231C;
  --red-text:    #C7231C;
  --orange:      #FF7A2F;
  --success:     #7ed492;

  --font-ui:   Archivo, Helvetica, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--red-text); text-decoration: none; }
a:hover { color: var(--orange); }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

p { margin: 0; }

.wrap { max-width: 880px; margin: 0 auto; padding: 36px 24px 100px; }

/* ---------- Breadcrumb ---------- */

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-softer);
  margin-bottom: 20px;
}
.crumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-softer); }
.crumb a:hover { color: var(--red-text); }
.crumb svg { width: 14px; height: 14px; flex: none; }
.crumb-sep { color: var(--line-strong); }

h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }

/* ---------- Filter bar (client.html) ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 4px;
}
.bar button {
  font: inherit;
  font-family: var(--font-ui);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 2px;
  padding: 6px 12px;
  font-size: 13px;
}
.bar button:hover { border-color: var(--ink-softer); }
.bar button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.bar input[type="text"] {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  min-width: 160px;
}
.bar .spacer { flex: 1; }
.counts { color: var(--ink-soft); font-size: 12px; font-family: var(--font-mono); white-space: nowrap; }

/* ---------- Collapsed list rows (index.html + client.html) ----------
   Required shapes: .item, .item .head, .item .num, .badge, .s-<status> */

.item {
  display: block;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.item:hover .title { color: var(--red-text); }
.item .head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  cursor: pointer;
}
.item .num {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 2.5ch;
  font-family: var(--font-mono);
  font-size: 13px;
}
.item .title { flex: 1; font-weight: 600; font-size: 15px; min-width: 0; }
.item .meta {
  color: var(--ink-softer);
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  white-space: nowrap;
}
/* No background tints per status here — this app keeps to the two page
   backgrounds only (#ffffff / #f7f4f1); status reads by border + text
   colour instead, same restraint as the landing page's accent borders. */
.s-open     { color: var(--ink-soft); }
.s-decision { color: var(--red-text); border-color: var(--red-text); }
.s-blocked  { color: var(--red);      border-color: var(--red); }
.s-onhold   { color: var(--ink-softer); border-style: dashed; }
.s-fixed    { color: var(--success);  border-color: var(--success); }
.s-archived { color: var(--ink-softer); opacity: .6; }

/* ---------- Thread detail header (thread.html) ---------- */

.thread-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.thread-head .num { color: var(--ink-soft); font-family: var(--font-mono); font-size: 15px; }
.thread-head .title { flex: 1; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; min-width: 0; }

/* ---------- Decision block — the point of the item, gets the weight ---------- */

.decision {
  margin: 22px 0 28px;
  padding: 20px 22px;
  background: var(--bg-alt);
  border-left: 3px solid var(--red);
}
.decision .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-softer);
  margin: 16px 0 5px;
}
.decision .lbl:first-child { margin-top: 0; }
.decision .question { font-size: 18px; font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; }
.decision .options { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.decision .options li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 14px;
}
.decision .options li.rec { border-color: var(--red-text); }
.decision .options .cost {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
  flex: none;
}
.decision .rec-line { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--red-text); }

/* ---------- Plain block (what / why / next) ---------- */

.plain { margin: 20px 0; padding: 16px 18px; background: var(--bg-alt); }
.plain .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-softer);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 12px 0 3px;
}
.plain .lbl:first-child { margin-top: 0; }
.plain p { font-size: 14.5px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }

/* ---------- Finding — technical detail, least visual weight ---------- */

.finding { margin: 18px 0 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.finding .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-softer);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.finding p { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); white-space: pre-wrap; }

/* ---------- Entries — required shapes: .entry, .entry.k, .who, .ts ---------- */

.entries { margin-top: 8px; }
/* Who and when sit in a left gutter beside the text, not stacked above it —
   the eye runs down one column of names and across to whichever it wants,
   instead of stepping over a header before every message. 29 Jul. */
.entry { display: grid; grid-template-columns: 130px 1fr; gap: 0; border: 1px solid var(--line); border-bottom: none; }
.entry:last-of-type { border-bottom: 1px solid var(--line); }
.entry.k { background: var(--bg-alt); }
.who {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.who .ts { margin-top: 4px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.entry .who { padding: 14px 12px; border-right: 1px solid var(--line); }
.entry p { margin: 0; padding: 14px 16px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
@media (max-width: 640px) {
  .entry { grid-template-columns: 1fr; }
  .entry .who { border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
}

/* ---------- Reply form ---------- */

.reply { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.reply textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  font: inherit;
  font-family: var(--font-ui);
  font-size: 14.5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  color: var(--ink);
}
.reply textarea:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.reply-row { display: flex; gap: 14px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.reply-budget { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.reply-budget input {
  width: 68px;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  color: var(--ink);
}
.budget-inforce { font-size: 12px; color: var(--ink-softer); font-family: var(--font-mono); white-space: nowrap; }
.reply .spacer { flex: 1; }
.reply button[type="submit"] {
  padding: 10px 22px;
  border: none;
  border-radius: 2px;
  background: linear-gradient(100deg, var(--red), var(--orange));
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: filter .15s ease;
}
.reply button[type="submit"]:hover { filter: brightness(1.08); }
.reply button[type="submit"][disabled] { cursor: default; filter: brightness(.85); }

/* ---------- 422 errors — legible, never a raw alert() ---------- */

.formerror { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--red-text); background: var(--bg-alt); font-size: 13.5px; }
.formerror .lbl { font-weight: 700; color: var(--red-text); margin-bottom: 6px; }
.formerror ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.formerror li { padding-top: 8px; border-top: 1px solid var(--line); }
.formerror li:first-child { padding-top: 0; border-top: none; }
.formerror .rule {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-softer);
}
.formerror .match { font-style: italic; margin-top: 2px; }
.formerror .guidance { color: var(--ink-soft); margin-top: 4px; white-space: pre-wrap; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .wrap { padding: 24px 16px 80px; }
  h1 { font-size: 22px; }
  .thread-head { flex-wrap: wrap; }
  .thread-head .title { font-size: 18px; flex-basis: 100%; order: 3; }
  .item .head { flex-wrap: wrap; }
  .item .meta { flex-basis: 100%; order: 3; }
  .bar { gap: 6px; }
  .bar input[type="text"] { flex: 1 1 100%; }
  .reply-row { align-items: stretch; }
  .reply .spacer { display: none; }
  .reply button[type="submit"] { width: 100%; }
}

/* Decision block, cut back 29 Jul. Default view is the question and what
   happens if it goes unanswered. Everything else lives behind a disclosure —
   present, not shouted. No second accent colour; the left rule is enough. */
.decision { background: var(--bg-alt); border-left: 3px solid var(--ink); padding: 16px 18px; margin: 0 0 20px; }
.decision .question { font-size: 17px; font-weight: 600; line-height: 1.4; }
.decision .next { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.decision .more { margin-top: 12px; }
.decision .more > summary { font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.decision .opt { display: flex; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.decision .opt:last-of-type { border-bottom: 0; }
.decision .opt-label { flex: 0 0 auto; font-weight: 600; }
.decision .opt.rec .opt-label { color: var(--ink); }
.decision .opt-cost { color: var(--ink-soft); }
.decision .lbl { margin-top: 12px; }

/* One block of prose, no labels, no disclosure. 29 Jul. */
.item-body { font-size: 16px; line-height: 1.55; margin: 0 0 24px; }
.item-body p { margin: 0 0 12px; }
.item-body p:first-child { font-weight: 600; }
.item-body p:last-child { margin-bottom: 0; }

/* ---------- Board — one widget per worktree (board.html) ----------
   As many columns as fit, each a fixed-height scrolling card. No drag, no
   resize, no layout persistence in this phase — see the board design doc. */

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.widget {
  display: flex;
  flex-direction: column;
  height: 360px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.widget-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.widget-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.widget-client { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }

.widget-seen {
  padding: 7px 16px;
  font-size: 11.5px;
  color: var(--ink-softer);
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--line);
}

.widget-headline {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.widget-headline.waiting { color: var(--red-text); }

.widget-threads { flex: 1; overflow-y: auto; }
.widget-empty { padding: 14px 16px; color: var(--ink-softer); font-size: 13px; }

.widget-thread {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.widget-thread:last-child { border-bottom: none; }
.widget-thread:hover .title { color: var(--red-text); }
.widget-thread .num {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 2.2ch;
}
.widget-thread .title { flex: 1; font-size: 13.5px; min-width: 0; }
.widget-thread.waiting .title { font-weight: 600; }
.widget-thread .badge { font-size: 10px; padding: 2px 7px; }
