/* Mission Control. Visual identity carried over from the Deal Dashboards artifact: an auction
   clerk's board, deal rows with a segmented lot-number ribbon. */
:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --ink: #18201e;
  --muted: #5d6a66;
  --line: #d7dedb;
  --accent: #0d6b5a;
  --accent-ink: #ffffff;
  --done: #0d6b5a;
  --found: #b7791f;
  --found-bg: #fbf1df;
  --na: #9aa6a2;
  --open: #c9d2ce;
  --warn: #a8321f;
  --found-ink: #8a5a12;
  --field-line: #7a8883;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111615; --surface: #19201e; --ink: #e6ecea; --muted: #94a39e; --line: #2c3633;
    --accent: #3fb59b; --accent-ink: #0b1210; --done: #3fb59b; --found: #e0a548;
    --found-bg: #2e2617; --na: #6c7975; --open: #36423f; --warn: #ef7a63; --found-ink: #e0a548; --field-line: #5f6e6a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111615; --surface: #19201e; --ink: #e6ecea; --muted: #94a39e; --line: #2c3633;
  --accent: #3fb59b; --accent-ink: #0b1210; --done: #3fb59b; --found: #e0a548;
  --found-bg: #2e2617; --na: #6c7975; --open: #36423f; --warn: #ef7a63; --found-ink: #e0a548; --field-line: #5f6e6a; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); }
.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 64px; display: grid; gap: 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
a { color: var(--accent); }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.top { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; justify-content: space-between; }
.top .crumb { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.syncbox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 6px 12px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }
.back { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 6px 12px; font-weight: 600; color: var(--ink); align-self: center; }
.back::before { content: "\2190"; margin-right: 6px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 3px solid transparent; background: none; padding: 8px 14px; font-weight: 600; color: var(--muted); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.report { width: 100%; min-height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.post { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.post form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.post label { display: grid; gap: 4px; font-size: .85rem; min-width: 0; }
.post input, .post textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 6px 8px; width: 100%; }
.post textarea { min-height: 64px; resize: vertical; }
.post .wide { grid-column: 1 / -1; }
.post .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.statusset { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.clog { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.clog .row { display: flex; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; }
.clog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.starter { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.starter .row { display: flex; gap: 6px 12px; align-items: center; flex-wrap: wrap; }
.starter textarea { width: 100%; min-height: 160px; font: inherit; font-size: 13px; }
.clog li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 10px; font-size: .88rem; }
.clog li .mono { color: var(--muted); font-size: .8rem; padding-top: 1px; }
.clog li span:last-child { overflow-wrap: anywhere; }
@media (max-width: 560px) { .clog li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.statusset select { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 4px 8px; }

/* progress ribbon: ten sections, each a segment sized by step count */
.ribbon { display: flex; gap: 3px; height: 10px; width: 100%; }
.ribbon .seg { position: relative; background: var(--open); border-radius: 2px; overflow: hidden; display: flex; }
.ribbon .seg i { display: block; height: 100%; }
.ribbon .seg .d { background: var(--done); }
.ribbon .seg .f { background: var(--found); }
.ribbon.big { height: 16px; }
.ribbon.big .seg { cursor: pointer; border: 0; padding: 0; }

/* home list */
.deals { display: grid; gap: 10px; }
.deal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; text-align: left; width: 100%; }
.deal-row:hover { border-color: var(--accent); }
.deal-row .name { font-family: var(--display); font-size: 1.3rem; font-weight: 600; min-width: 0; }
.deal-row .meta { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.deal-row .ribbon { grid-column: 1 / -1; }
.count { font-family: var(--mono); font-size: .9rem; white-space: nowrap; }
.count b { font-size: 1.15rem; }
.pill { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: .74rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.pill.found { color: var(--found); border-color: var(--found); background: var(--found-bg); }

/* deal header */
.head { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 18px; }
.facts div { display: grid; gap: 2px; min-width: 0; }
.facts .v { font-weight: 600; overflow-wrap: anywhere; }
.links { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: .9rem; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* filters */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; font-size: .85rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* sections + steps */
.section { display: grid; gap: 6px; scroll-margin-top: 16px; }
.section > header { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.step { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--open); border-radius: 6px; }
.step.done { border-left-color: var(--done); }
.step.found { border-left-color: var(--found); background: linear-gradient(90deg, var(--found-bg), var(--surface) 40%); }
.step.na { border-left-color: var(--na); }
.step.na .txt { text-decoration: line-through; color: var(--muted); }
.step .id { font-family: var(--mono); color: var(--muted); padding-top: 2px; }
.step .txt { min-width: 0; }
.step .src { font-size: .78rem; color: var(--muted); }
.step .src .flag { color: var(--found); font-weight: 600; }
.acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: end; }
.acts button { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 3px 9px; font-size: .8rem; }
.acts button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.more { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.more select, .more input { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 3px 8px; font-size: .82rem; }
.more input { flex: 1 1 180px; min-width: 0; }
.note { font-size: .82rem; color: var(--ink); }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 28px; text-align: center; color: var(--muted); }
.banner { font-size: .85rem; padding: 8px 12px; border-radius: 6px; background: var(--found-bg); color: var(--ink); border: 1px solid var(--found); }
@media (max-width: 560px) {
  .step { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .acts { grid-column: 1 / -1; justify-content: start; }
  .more { grid-column: 1 / -1; }
  h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: no-preference) { .ribbon i { transition: width .3s ease; } }

/* ---- Mission Control additions (same tokens) ---- */
body { margin: 0; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; color: var(--accent); text-decoration: none; }
.bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.bar .who { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); }
.nav { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 10px 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; display: flex; align-items: center; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.btn, .back, .chip, .acts button, .tab { min-height: 36px; }
@media (pointer: coarse) { .btn, .back, .chip, .acts button, .tab, .nav a { min-height: 44px; } }
.bell { position: relative; }
.bell b { position: absolute; top: -4px; right: -4px; background: var(--warn); color: #fff; border-radius: 99px; font-size: .68rem; padding: 0 5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 12px; }
.signin { max-width: 380px; margin: 10vh auto 0; }
.field { display: grid; gap: 4px; font-size: .9rem; }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 9px 10px; width: 100%; font: inherit; color: inherit; }
.err { color: var(--warn); font-size: .88rem; }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: .9rem; z-index: 10; }
.toast.bad { background: var(--warn); color: #fff; }
.queue { font-size: .8rem; border: 1px solid var(--found); color: var(--found); background: var(--found-bg); border-radius: 99px; padding: 2px 10px; }
.stale { color: var(--warn); font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 10px; font-size: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.feed li .mono { color: var(--muted); font-size: .78rem; padding-top: 2px; }
@media (max-width: 560px) { .feed li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.deal-row { color: var(--ink); text-decoration: none; }
.deal-row .nm { min-width: 0; }
.pill.late, .late { color: var(--warn); border-color: var(--warn); }
.late { font-weight: 600; }
.legend .lg-done { --c: var(--done); } .legend .lg-found { --c: var(--found); } .legend .lg-open { --c: var(--open); }
a.tab { text-decoration: none; display: inline-flex; align-items: center; }
a.back { text-decoration: none; }
.head p.label { margin: 0 0 6px; }
.more input[type="date"] { flex: 0 0 auto; }
.facts div { align-content: start; }

/* review fixes: text-grade amber, visible field borders, spacing, touch targets */
.pill.found, .step .src .flag { color: var(--found-ink); border-color: var(--found-ink); }
.more select, .more input, .statusset select, .acts button, .field input, .field select, .field textarea, .chip { border-color: var(--field-line); }
.toast.bad { color: #fff; }
#view { display: grid; gap: 16px; }
#view:focus { outline: none; }
.section h2:focus { outline: none; }
.section h2:focus-visible { outline: 2px solid var(--accent); }
@media (pointer: coarse) {
  .more select, .more input, .statusset select, .links a, .btn, .bell { min-height: 44px; }
  .links a { display: inline-flex; align-items: center; }
  .ribbon.big { height: 28px; }
  .ribbon.big .seg { min-width: 24px; }
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notes { position: absolute; right: 16px; left: 16px; max-width: 520px; margin-left: auto; z-index: 5; max-height: 70vh; overflow: auto; }
header#chrome { position: relative; display: grid; gap: 8px; }
.thread { grid-column: 1 / -1; display: grid; gap: 8px; }
.comment { display: flex; gap: 8px; }
.comment input { flex: 1 1 auto; min-width: 0; border: 1px solid var(--field-line); background: var(--bg); border-radius: 6px; padding: 8px 10px; font: inherit; color: inherit; }
.ask p { margin: 0; }
.ask.error { border-color: var(--warn); }
a.step.work { color: var(--ink); text-decoration: none; grid-template-columns: 3.2rem minmax(0, 1fr); }
a.step.work:hover { border-color: var(--accent); }
a.step.work.overdue { border-left-color: var(--warn); }
.card textarea { min-height: 80px; resize: vertical; }
.banner.conflict { display: grid; gap: 6px; }
.banner.conflict p { margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast.bad, :root:not([data-theme="light"]) .bell b { color: #1a0b07; } }
:root[data-theme="dark"] .toast.bad, :root[data-theme="dark"] .bell b { color: #1a0b07; }
.queue { color: var(--found-ink); border-color: var(--found-ink); white-space: nowrap; }
.bar { flex-wrap: wrap; }
.bar .who { flex-wrap: wrap; justify-content: flex-end; }
.btn { white-space: nowrap; }
@media (max-width: 560px) { #me { display: none; } }
.step.target { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.tall { min-height: 44px; }
.promptbox { width: 100%; min-height: 180px; font: inherit; font-size: 13px; }
p.err:empty { display: none; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid thead th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.card { overflow-x: auto; }
ul.plain { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; }
