:root {
  --bg: #0f0f10;
  --panel: #141415;
  --hover: #1a1a1c;
  --sel: #1c1c28;
  --line: #232326;
  --text: #e4e4e7;
  --dim: #8a8a93;
  --mute: #52525b;
  --acc: #5e6ad2;
  --acc-bg: rgba(94, 106, 210, 0.12);
  --green: #4cb782;
  --yellow: #f2c94c;
  --orange: #f2994a;
  --red: #eb5757;
  /* System stack only — no phantom Inter we never load (S5.5). */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body {
  font: 12.5px/1.35 var(--font);
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
.shell { height: 100%; display: flex; flex-direction: column; }
.top {
  height: 34px; flex-shrink: 0; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--panel);
}
.logo { font-weight: 600; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.logo i {
  width: 13px; height: 13px; border-radius: 3px;
  background: linear-gradient(135deg, #5e6ad2, #7c6cf0); display: block;
}
.identity {
  font-size: 11px; color: var(--dim); padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg);
}
.view-as {
  display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--mute);
}
.view-as select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  padding: 2px 6px; color: var(--text); max-width: 220px;
}
.demo { font-size: 10px; color: var(--mute); }
.top-r { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--mute); font-size: 11px; }
.ver {
  font-family: var(--mono); font-size: 10px; color: var(--mute);
  padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px;
  user-select: all;
}
.btn {
  border: 1px solid var(--line); background: var(--hover); border-radius: 4px;
  padding: 2px 7px; font-size: 11.5px; color: var(--text);
}
.btn:hover { background: #222; }
.btn.p { background: var(--acc); border-color: transparent; color: #fff; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.danger { border-color: rgba(235, 87, 87, 0.4); color: #f0a0a0; }
.body { flex: 1; min-height: 0; display: grid; grid-template-columns: 148px 1fr; position: relative; }
.body.side-collapsed { grid-template-columns: 0 1fr; }
.side {
  border-right: 1px solid var(--line); background: var(--panel);
  padding: 6px 5px; overflow-y: auto; min-width: 0;
  transition: opacity 0.12s ease;
}
.body.side-collapsed .side {
  overflow: hidden; padding: 0; border-right: none; pointer-events: none;
  opacity: 0;
}
.side-tools {
  display: flex; justify-content: flex-end; margin-bottom: 2px;
}
.side-toggle {
  padding: 1px 6px; font-size: 11px; line-height: 1.2; min-width: 22px;
  color: var(--mute);
}
.side-toggle:hover { color: var(--text); }
.side-inner { min-width: 136px; }
.body.side-collapsed .side-inner { display: none; }
.side-reopen {
  position: absolute; left: 0; top: 8px; z-index: 5;
  border: 1px solid var(--line); border-left: none;
  background: var(--panel); color: var(--dim);
  border-radius: 0 4px 4px 0; padding: 4px 6px; font-size: 12px;
}
.side-reopen:hover { background: var(--hover); color: var(--text); }
.sl {
  font-size: 9px; color: var(--mute); padding: 7px 5px 2px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ni {
  display: flex; width: 100%; text-align: left; padding: 3px 5px;
  border-radius: 3px; color: var(--dim); font-size: 12px;
}
.ni:hover { background: var(--hover); color: var(--text); }
.ni.on { background: var(--acc-bg); color: var(--text); }
.ni .c { margin-left: auto; font-size: 10.5px; color: var(--mute); }
.proj-sel {
  width: 100%; margin: 2px 0 6px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 3px; padding: 3px 5px; color: var(--text); font-size: 11.5px;
}
.login-gate {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: min(360px, 92vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px;
}
.login-card h2 { font-size: 14px; margin-bottom: 8px; }
.login-card input {
  width: 100%; margin: 8px 0; background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; padding: 8px; color: var(--text);
}
.login-card .btn { width: 100%; margin-top: 4px; padding: 6px; }
.hint {
  margin: 8px 5px; padding: 6px 7px; border-radius: 4px; background: var(--bg);
  border: 1px solid var(--line); font-size: 10.5px; color: var(--mute); line-height: 1.4;
}
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; flex: 1; }
/* Split desk: list + detail co-mounted (S3.1) */
.main.split {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.35fr);
}
/* Up next focus stage (layout A): bar + full-width scrollable detail — no middle waste */
.main.focus {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main.focus .detail-col {
  border-left: none;
  flex: 1;
  min-height: 0;
}
.list-col, .detail-col {
  min-height: 0; min-width: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.detail-col { border-left: 1px solid var(--line); }
.detail-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.list-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.row-selected { background: var(--sel); }
.row-selected .row { background: transparent; }
.kb-focus { outline: 1px solid var(--acc); outline-offset: -1px; }
@media (prefers-reduced-motion: no-preference) {
  .detail-col { animation: lot-fade 120ms ease-out; }
}
@keyframes lot-fade {
  from { opacity: 0.55; }
  to { opacity: 1; }
}
@media (max-width: 720px) {
  .main.split { grid-template-columns: 1fr; }
  .main.split .list-col { display: none; }
}
.lh {
  height: 32px; flex-shrink: 0; padding: 0 10px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
}
.lh h1 { font-size: 12.5px; font-weight: 600; }
.pill { padding: 1px 6px; border-radius: 9px; color: var(--dim); font-size: 10.5px; }
.pill.on { background: var(--acc-bg); color: #b8bdf0; }
.meta { margin-left: auto; color: var(--mute); font-size: 10.5px; }
.ff {
  min-height: 26px; flex-shrink: 0; padding: 3px 10px; border-bottom: 1px solid var(--line);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.seg { display: flex; gap: 2px; }
.seg button { padding: 1px 6px; border-radius: 3px; color: var(--mute); font-size: 10.5px; }
.seg button.on { background: var(--hover); color: var(--text); }
.leg { font-size: 10px; color: var(--mute); margin-left: auto; }
.leg i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin: 0 2px 0 6px; vertical-align: middle;
}
.leg i.r { background: var(--red); }
.leg i.o { background: var(--orange); }
.leg i.g { background: var(--green); }
.list { flex: 1; overflow-y: auto; position: relative; }
.list-virt-inner { width: 100%; }
.list-filter {
  flex: 1; min-width: 100px; max-width: 220px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  padding: 2px 6px; color: var(--text); font-size: 11px;
}
.list-filter:focus { outline: 1px solid var(--acc); border-color: var(--acc); }
.list-stamp-click {
  flex: 1 1 100%;
  max-width: 100%;
  margin: 2px 0 0;
  order: 10; /* wrap under filter row when .ff is flex */
}
.ff { flex-wrap: wrap; }
.filter-pending {
  color: var(--acc); font-size: 9px; margin-left: 4px;
  animation: lot-pulse 0.9s ease-in-out infinite;
}
@keyframes lot-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .filter-pending { animation: none; opacity: 0.7; }
}
.row-wrap { box-sizing: border-box; }
.list-coach {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 10.5px;
  color: var(--mute);
  border-bottom: 1px solid var(--line);
  background: rgba(94, 106, 210, 0.06);
  line-height: 1.35;
}
.bulk {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 4px 10px; border-bottom: 1px solid var(--line); background: #121218;
}
.row-wrap {
  display: flex; align-items: center; gap: 4px;
  box-shadow: inset 0 1px 0 var(--line);
}
.row-wrap:first-child { box-shadow: none; }
.bulk-ck { margin-left: 6px; flex-shrink: 0; accent-color: var(--acc); }
.row {
  display: grid;
  grid-template-columns: 7px 54px minmax(0, 1fr) auto auto;
  gap: 6px; align-items: center; width: 100%; text-align: left;
  padding: 4px 10px 4px 4px; color: inherit; min-height: 26px;
}
.row.row-with-chips {
  grid-template-columns: 7px 54px minmax(0, 1fr) minmax(0, 9rem) auto auto;
}
.row:hover { background: var(--hover); }
.surf { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.surf.red { background: var(--red); }
.surf.orange { background: var(--orange); }
.surf.green { background: var(--green); }
.surf.none { background: transparent; border: 1px solid var(--line); }
.key { font-family: var(--mono); font-size: 10.5px; color: var(--mute); }
.ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.row-chips {
  display: flex; gap: 3px; flex-wrap: nowrap; overflow: hidden;
  min-width: 0; max-width: 9rem; justify-content: flex-end;
}
.row-chip {
  flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9px; line-height: 1.2; padding: 1px 4px; border-radius: 3px;
  border: 1px solid var(--line); color: var(--dim); background: var(--bg);
  max-width: 4.5rem;
}
.row-chip.machine {
  border-color: rgba(94, 106, 210, 0.35); color: #b8bdf0;
}
.row-chip.more {
  flex-shrink: 0; color: var(--mute); border-style: dashed;
}
.trk { font-size: 9px; text-transform: uppercase; color: var(--mute); }
.trk.code { color: #7ec8e3; }
.trk.legal { color: #b9a0e8; }
.st { color: var(--dim); font-size: 11px; }
/* Single detail column (workflow sticky strip + scrollable body) */
.dp {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.dp.single { display: flex; }
.dm {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 14px 18px 36px;
  min-width: 0;
  min-height: 0;
  width: 100%;
  flex: 1 1 auto;
}
/* Legacy rail kept only if reintroduced — not used in Option A */
.ds {
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 12px 20px;
  overflow-y: auto;
  font-size: 11.5px;
  min-width: 0;
}
.dk {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.dt {
  width: 100%;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 10px;
  color: var(--text);
}
/* Sticky workflow strip under title */
.sticky-acts {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 12px;
  padding: 10px 0 10px;
  background: linear-gradient(var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--line);
}
.sticky-acts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.sticky-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.sticky-chips .chip,
.chip {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #1e1e25;
  color: var(--dim);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.mute { color: var(--mute); }
.milestone-block h3 { margin-bottom: 8px; }
.milestone-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 8px;
}
.milestone-select {
  min-width: 180px; max-width: 100%;
  padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: #111113; color: var(--text);
}
.milestone-create {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.milestone-new {
  flex: 1; min-width: 140px;
  padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: #111113; color: var(--text);
}
.milestone-new::placeholder { color: var(--mute); }
.sticky-gate { margin-top: 8px; margin-bottom: 0; }
.audit-block .audit { margin-top: 0; }
.block {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.block:last-child { border-bottom: none; padding-bottom: 0; }
.block h3 {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--mute); font-weight: 500; margin-bottom: 6px;
}
.deps-lists { font-size: 12px; }
.deps-lists button {
  display: block; width: 100%; text-align: left;
  padding: 4px 6px; margin: 2px 0; border-radius: 3px;
  color: var(--dim); background: var(--bg); border: 1px solid var(--line);
}
.deps-lists button:hover { color: var(--text); background: var(--hover); }
.desc, .evurl, .cf textarea {
  width: 100%; background: transparent; border: 1px solid var(--line);
  border-radius: 3px; padding: 6px; color: var(--dim);
}
.evurl { font-family: var(--mono); font-size: 12px; color: var(--text); }
.desc { min-height: 56px; resize: vertical; }
.prop { margin-bottom: 7px; }
.prop label {
  display: block; font-size: 9.5px; color: var(--mute); margin-bottom: 2px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.prop select, .prop .v {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 3px; padding: 3px 5px; font-size: 11.5px;
}
.acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.gate {
  margin-top: 8px; padding: 6px 7px; border-radius: 4px;
  border: 1px solid var(--line); font-size: 10.5px; color: var(--mute); line-height: 1.35;
}
.gate.warn { border-color: rgba(242, 153, 74, 0.4); color: var(--orange); }
.gate.ok { border-color: rgba(76, 183, 130, 0.35); color: var(--green); }

/* Next-step coach — answers “comment or status?” */
.coach {
  margin: 0 0 14px;
  padding: 10px 12px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.coach.go { border-color: rgba(76, 183, 130, 0.45); background: rgba(76, 183, 130, 0.06); }
.coach.warn { border-color: rgba(242, 153, 74, 0.45); background: rgba(242, 153, 74, 0.06); }
.coach.wait { border-color: rgba(94, 106, 210, 0.4); background: rgba(94, 106, 210, 0.07); }
.coach.done { border-color: var(--line); opacity: 0.92; }
.coach-kicker {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mute); font-weight: 600; margin-bottom: 4px;
}
.coach-headline { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.coach-body { font-size: 12px; color: var(--dim); line-height: 1.4; margin: 0 0 6px; }
.coach-recipe { font-size: 10.5px; color: var(--mute); line-height: 1.35; margin: 0 0 8px; }
.coach-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.coach-hint { font-size: 10.5px; color: var(--mute); }
.wf-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mute); font-weight: 600; margin-bottom: 2px;
}
.wf-sub { font-size: 10.5px; color: var(--mute); line-height: 1.35; margin: 0 0 10px; }
.cm { padding: 5px 0; border-top: 1px solid var(--line); }
.cm.st-retracted, .cm.st-superseded { opacity: 0.55; }
.cm .w { font-weight: 500; font-size: 11.5px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.cm .w span { font-weight: 400; color: var(--mute); margin-left: 4px; font-size: 10.5px; }
.cm .b { color: var(--dim); margin-top: 1px; }
.cm .b.md p { margin: 2px 0; }
.cm .b.md h3, .cm .b.md h4 { font-size: 12px; margin: 4px 0 2px; color: var(--text); }
.cm .b.md .md-li { margin-left: 4px; }
.cviews { display: flex; gap: 4px; margin-bottom: 6px; }
.cviews button {
  padding: 1px 7px; border-radius: 3px; border: 1px solid var(--line);
  color: var(--mute); font-size: 10.5px;
}
.cviews button.on { background: var(--acc-bg); color: var(--text); }
.clist { max-height: 280px; overflow-y: auto; margin-bottom: 6px; }
.cf select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px;
}
.cf { margin-top: 5px; display: flex; gap: 5px; }
.cf textarea { flex: 1; min-height: 32px; }
.err { color: var(--red); padding: 12px; font-size: 12px; }
.empty { padding: 16px; text-align: center; color: var(--mute); }
.empty p { margin: 0.4rem 0; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* Markdown (comments + description) */
.md p { margin: 0.35rem 0; }
.md h3, .md h4 { margin: 0.6rem 0 0.3rem; font-size: 0.95rem; }
.md-li { margin: 0.15rem 0 0.15rem 0.5rem; }
.md code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  background: var(--panel2, #1a1a22);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.md-table-wrap { overflow-x: auto; margin: 0.6rem 0; }
.md-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}
.md-table th, .md-table td {
  border: 1px solid var(--line, #333);
  padding: 0.35rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.md-table th {
  background: var(--panel2, #1a1a22);
  color: var(--fg, #eee);
  font-weight: 600;
}
.md-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.toast {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); padding: 4px 10px;
  border-radius: 5px; font-size: 11px; color: var(--dim); z-index: 50;
}
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 40;
}
.modal {
  width: min(360px, 92vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 7px; padding: 12px;
}
.modal h2 { font-size: 12.5px; margin-bottom: 8px; }
.modal label { display: block; font-size: 10.5px; color: var(--mute); margin: 6px 0 2px; }
.modal label.chk-row {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 11.5px; color: var(--dim); cursor: pointer;
}
.modal label.chk-row input { margin: 0; }
.modal input, .modal select, .modal textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 3px; padding: 4px 7px;
}
.modal .ar { display: flex; gap: 5px; justify-content: flex-end; margin-top: 10px; }
.modal-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.session-modal { width: min(420px, 94vw); }
.session-modal .fld { display: block; margin-top: 8px; }
.session-modal .fld span {
  display: block; font-size: 10.5px; color: var(--mute); margin-bottom: 2px;
}
.hint-inline { font-size: 11px; color: var(--mute); line-height: 1.4; margin-bottom: 4px; }
.acc label { display: flex; gap: 6px; align-items: flex-start; padding: 2px 0; color: var(--dim); font-size: 12px; }
.subs button {
  display: block; width: 100%; text-align: left; padding: 3px 2px; color: var(--dim);
}
.subs button:hover { background: var(--hover); color: var(--text); }
.audit { margin-top: 8px; font-size: 10.5px; color: var(--mute); }
.audit div { padding: 2px 0; border-top: 1px solid var(--line); }
.tag.tag-mine {
  border-color: rgba(120, 200, 160, 0.55);
  box-shadow: inset 0 0 0 1px rgba(120, 200, 160, 0.15);
}
.tag {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: #1e1e25; color: var(--dim); white-space: nowrap;
  border: 1px solid var(--line);
}
.tag.v1 { color: #a8b0ff; border-color: rgba(94,106,210,.4); }
.tag-rm {
  border: none; background: transparent; color: var(--mute);
  cursor: pointer; padding: 0 2px; font-size: 12px; line-height: 1;
}
.tag-rm:hover { color: #f88; }

/* Up next — focus-stage horizontal bar (layout A) */
.up-next-bar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(94, 106, 210, 0.07);
}
.up-next-bar .up-next-kicker {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  width: 100%;
  margin: 0;
}
.up-next-bar-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  text-align: left;
  color: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
}
.up-next-bar-btn:hover { background: var(--hover); border-color: var(--line); }
.up-next-bar-btn.on { background: var(--sel); border-color: rgba(94, 106, 210, 0.45); }
.up-next-bar-btn .up-next-title {
  font-size: 13.5px;
  font-weight: 550;
  flex: 1;
  min-width: 120px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.up-next-bar.empty { color: var(--mute); }

/* Legacy card (list-pane fallback) */
.up-next-wrap { padding: 16px 14px 24px; max-width: 520px; }
.up-next-kicker {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mute); margin-bottom: 8px;
}
.up-next-card {
  display: flex; gap: 10px; align-items: flex-start;
  width: 100%; text-align: left; color: inherit;
  padding: 14px 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(94, 106, 210, 0.12);
}
.up-next-card:hover { background: var(--hover); border-color: rgba(94, 106, 210, 0.45); }
.up-next-card.on { background: var(--sel); border-color: var(--acc); }
.up-next-card .surf { margin-top: 5px; flex-shrink: 0; }
.up-next-body { min-width: 0; flex: 1; }
.up-next-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.up-next-title {
  font-size: 14px; font-weight: 550; line-height: 1.35;
  margin-bottom: 8px; word-break: break-word;
}
.up-next-hint { font-size: 11px; color: var(--mute); line-height: 1.4; }
.dep-flag { font-size: 10px; color: var(--orange); }

/* ── Stakeholder Progress shell (hybrid B+C+D) ─────────────── */
.main.progress { display: block; overflow: auto; }
.main.playbook { display: block; overflow: auto; }
.progress-pane { padding: 16px 18px 32px; max-width: 720px; }
/* Playbook — one-page process guide */
.playbook-pane {
  padding: 16px 18px 48px;
  max-width: 640px;
}
.playbook-hero { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.playbook-kicker {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mute); margin-bottom: 4px;
}
.playbook-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.playbook-blurb { font-size: 12px; color: var(--dim); line-height: 1.45; }
.playbook-blurb a { color: var(--acc); text-decoration: none; }
.playbook-blurb a:hover { text-decoration: underline; }
.playbook-body.md { font-size: 12.5px; line-height: 1.45; color: var(--text); }
.playbook-body.md h3 {
  font-size: 13px; font-weight: 600; margin: 1.1rem 0 0.4rem;
  color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 3px;
}
.playbook-body.md h4 { font-size: 12px; font-weight: 600; margin: 0.8rem 0 0.3rem; color: var(--dim); }
.playbook-body.md p { margin: 0.35rem 0; color: var(--dim); }
.playbook-body.md p strong, .playbook-body.md .md-li strong { color: var(--text); }
.playbook-body.md a { color: var(--acc); }
.playbook-body.md code {
  font-family: var(--mono); font-size: 11px;
  background: var(--hover); padding: 1px 4px; border-radius: 3px;
}
.playbook-body .md-pre {
  margin: 0.55rem 0; padding: 8px 10px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--line);
  overflow-x: auto; font-family: var(--mono); font-size: 11px; line-height: 1.4;
  color: var(--text);
}
.playbook-body .md-pre code { background: none; padding: 0; font-size: inherit; }
.playbook-body .md-mermaid,
.playbook-body .mermaid {
  margin: 0.75rem 0; padding: 10px 8px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--line);
  overflow-x: auto; text-align: center;
}
.playbook-body .md-table-wrap { margin: 0.5rem 0; }
.pb-index { list-style: none; margin: 0; padding: 0; }
.pb-index li { border-bottom: 1px solid var(--line); }
.pb-row {
  display: grid; grid-template-columns: 52px 1fr; gap: 2px 10px;
  width: 100%; text-align: left; padding: 10px 8px; border-radius: 4px;
}
.pb-row:hover { background: var(--hover); }
.pb-slug {
  font-family: var(--mono); font-size: 11px; color: var(--acc); font-weight: 600;
  grid-row: 1 / span 2; align-self: center;
}
.pb-row-title { font-size: 13px; font-weight: 600; color: var(--text); }
.pb-meta { font-size: 11px; color: var(--mute); grid-column: 2; }
.playbook-detail-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.progress-hero {
  display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.progress-ring {
  width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
}
.progress-ring span {
  width: 66px; height: 66px; border-radius: 50%; background: var(--bg);
  display: grid; place-items: center; font-size: 17px; font-weight: 650;
}
.progress-kicker {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mute); margin-bottom: 2px;
}
.progress-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.progress-blurb { font-size: 12px; color: var(--dim); line-height: 1.4; max-width: 420px; }
.progress-meta { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.progress-sec { margin-bottom: 18px; }
.progress-sec > h3 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--mute); margin-bottom: 8px;
}
.progress-rag {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
@media (max-width: 640px) {
  .progress-rag { grid-template-columns: 1fr; }
}
.progress-rag article {
  border-radius: 8px; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel);
}
.progress-rag .g { border-color: rgba(76, 183, 130, 0.4); }
.progress-rag .y { border-color: rgba(242, 201, 76, 0.4); }
.progress-rag .r { border-color: rgba(235, 87, 87, 0.4); }
.progress-rag h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.progress-rag .g h4 { color: var(--green); }
.progress-rag .y h4 { color: var(--yellow); }
.progress-rag .r h4 { color: var(--red); }
.progress-rag ul { list-style: none; }
.progress-rag li {
  font-size: 11.5px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--dim);
}
.progress-rag li:last-child { border: 0; }
.progress-rag li.mute { color: var(--mute); }
.progress-tl { position: relative; padding-left: 20px; }
.progress-tl::before {
  content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.progress-tl .tl-item { position: relative; margin-bottom: 12px; }
.progress-tl .tl-item::before {
  content: ""; position: absolute; left: -19px; top: 3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--acc);
}
.progress-tl .tl-item.done::before {
  border-color: var(--green); background: rgba(76, 183, 130, 0.25);
}
.progress-tl .tl-item.now::before {
  border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242, 153, 74, 0.2);
}
.progress-tl .tl-item.future::before { border-color: var(--mute); }
.progress-tl h4 { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.progress-tl .when {
  font-size: 10px; color: var(--mute); font-family: var(--mono); margin-bottom: 3px;
}
.progress-tl p { font-size: 11.5px; color: var(--dim); line-height: 1.4; }
.badge-now {
  display: inline-block; font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--orange); border: 1px solid rgba(242, 153, 74, 0.4);
  padding: 0 4px; border-radius: 3px; margin-left: 5px;
}
.progress-ms-list { display: flex; flex-direction: column; gap: 8px; }
.progress-ms-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.progress-ms-row[open] { border-color: rgba(94, 106, 210, 0.45); }
.progress-ms-row > summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; cursor: pointer; list-style: none;
}
.progress-ms-row > summary::-webkit-details-marker { display: none; }
.progress-ms-row > summary:hover { background: var(--hover); }
.progress-ms-row .name { font-weight: 600; font-size: 12.5px; flex: 1; min-width: 120px; }
.progress-ms-row .pct {
  font-family: var(--mono); font-size: 11.5px; color: #b8bdf0; min-width: 2.8rem; text-align: right;
}
.progress-ms-row .bar {
  height: 6px; border-radius: 3px; background: #1e1e25; overflow: hidden;
  width: 100%; max-width: 140px;
}
.progress-ms-row .bar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #5e6ad2, #7c8cff);
}
.progress-ms-row .ms-meta {
  font-size: 10.5px; color: var(--mute); padding: 0 12px 8px;
}
.progress-ms-row .ms-items {
  border-top: 1px solid var(--line); padding: 6px 12px 10px;
}
.progress-ms-row .ms-item {
  display: flex; gap: 8px; align-items: center; padding: 4px 0;
  font-size: 11.5px; color: var(--dim);
}
.progress-ms-row .st {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line);
  min-width: 76px; text-align: center; flex-shrink: 0;
}
.progress-ms-row .st.plan { color: var(--mute); }
.progress-ms-row .st.prog { color: #b8bdf0; border-color: rgba(94, 106, 210, 0.4); }
.progress-ms-row .st.rev { color: var(--yellow); border-color: rgba(242, 201, 76, 0.35); }
.progress-ms-row .st.you { color: var(--orange); border-color: rgba(242, 153, 74, 0.4); }
.progress-ms-row .st.done { color: var(--green); border-color: rgba(76, 183, 130, 0.35); }
.progress-ms-row .ms-empty { font-size: 11px; color: var(--mute); }
.progress-foot {
  margin-top: 10px; font-size: 11px; color: var(--mute); line-height: 1.4;
  padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px;
}

/* ── Stamp labels (multi-press ink) ─────────────────────────── */
.stamps-block h3 { margin-bottom: 8px; }
.stamp-field {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #111113;
}
.stamp-field:focus-within {
  border-color: rgba(94, 106, 210, 0.5);
  box-shadow: 0 0 0 1px rgba(94, 106, 210, 0.18);
}
.stamp-ghost {
  flex: 1; min-width: 110px; border: 0; outline: 0;
  background: transparent; color: var(--text); font: inherit; font-size: 12.5px;
  padding: 4px 2px;
}
.stamp-ghost::placeholder { color: var(--mute); }
.stamp-hint {
  margin-top: 8px; font-size: 11px; color: var(--mute); line-height: 1.45;
}
.stamp-suggest {
  display: flex; flex-wrap: wrap; gap: 4px 6px;
  margin-top: 6px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
}
.stamp-suggest-item {
  font-size: 11px; font-family: var(--mono); color: var(--dim);
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line);
  background: #111113;
}
.stamp-suggest-item:hover {
  color: var(--text); border-color: rgba(94, 106, 210, 0.45); background: var(--hover);
}
.stamp-suggest .hint-inline { font-size: 11px; color: var(--mute); }
.stamp-verify-row { margin-top: 6px; }

/*
 * Multi-press stamp:
 *  - Host + .p1 = first press (~70% coverage via miss holes)
 *  - .p2–.p4 = ghost re-presses (stack wear via --m)
 *  - machine = static double border, no ghosts
 */
.stamp {
  --ink: #7c8cff;
  --rot: 0deg;
  --m: 0;
  --bg: #111113;
  --ox: 2.4px; --oy: -1.8px;
  --ox2: -2.8px; --oy2: 2.2px;
  --ox3: 1.6px; --oy3: 2.8px;
  --r2: 0deg; --r3: 0deg; --r4: 0deg;
  --h1x: 18%; --h1y: 22%;
  --h2x: 82%; --h2y: 30%;
  --h3x: 70%; --h3y: 78%;
  --h4x: 28%; --h4y: 70%;
  --h5x: 50%; --h5y: 48%;
  --h6x: 42%; --h6y: 18%;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  isolation: isolate;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  transform: rotate(var(--rot));
  cursor: pointer;
  user-select: none;
  margin: 3px 4px;
  padding: 0;
  border: none;
  background: transparent;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.stamp:hover { transform: rotate(0deg) scale(1.04); z-index: 3; }
.stamp.press-flash {
  animation: stamp-press 0.28s ease-out;
}
@keyframes stamp-press {
  0%   { transform: rotate(var(--rot)) scale(0.88); filter: brightness(1.45); }
  55%  { transform: rotate(var(--rot)) scale(1.08); filter: brightness(1.2); }
  100% { transform: rotate(var(--rot)) scale(1); filter: none; }
}
/* Peel: slight reverse tilt then fade */
.stamp.peel-tilt {
  animation: stamp-peel 0.22s ease-in forwards;
}
@keyframes stamp-peel {
  0%   { transform: rotate(var(--rot)) scale(1); opacity: 1; }
  60%  { transform: rotate(calc(var(--rot) * -1.4 - 6deg)) scale(0.96) translateY(-2px); opacity: 0.7; }
  100% { transform: rotate(calc(var(--rot) * -1.8 - 10deg)) scale(0.9) translateY(-4px); opacity: 0; }
}

.stamp .p1 {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: stretch;
  border-radius: inherit;
  border: 1.5px solid color-mix(in srgb, var(--ink) 82%, transparent);
  opacity: 0.92;
  background:
    radial-gradient(circle at var(--h1x) var(--h1y),
      var(--bg) 0 3.2px, transparent 3.8px),
    radial-gradient(circle at var(--h2x) var(--h2y),
      var(--bg) 0 2.8px, transparent 3.4px),
    radial-gradient(circle at var(--h3x) var(--h3y),
      var(--bg) 0 3px, transparent 3.6px),
    radial-gradient(circle at var(--h4x) var(--h4y),
      var(--bg) 0 2.5px, transparent 3.1px),
    radial-gradient(circle at var(--h5x) var(--h5y),
      var(--bg) 0 3.5px, transparent 5px),
    radial-gradient(circle at var(--h6x) var(--h6y),
      var(--bg) 0 2.2px, transparent 2.8px),
    repeating-linear-gradient(
      -14deg,
      transparent 0 2px,
      rgba(255, 255, 255, 0.035) 2px 3px
    ),
    color-mix(in srgb, var(--ink) 15%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent),
    1px 1px 0 rgba(0, 0, 0, 0.3);
  text-shadow: 0 0 8px color-mix(in srgb, var(--ink) 22%, transparent);
}
.stamp .p2,
.stamp .p3,
.stamp .p4 {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  border: 1.5px solid color-mix(in srgb, var(--ink) 70%, transparent);
  background:
    radial-gradient(circle at calc(var(--h1x) + 8%) calc(var(--h1y) - 5%),
      var(--bg) 0 2.8px, transparent 3.4px),
    radial-gradient(circle at calc(var(--h3x) - 6%) var(--h3y),
      var(--bg) 0 2.5px, transparent 3.1px),
    color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent);
}
.stamp .p2 {
  transform: translate(var(--ox), var(--oy)) rotate(var(--r2));
  opacity: calc(var(--m) * 0.5);
}
.stamp .p3 {
  transform: translate(var(--ox2), var(--oy2)) rotate(var(--r3));
  opacity: calc(max(0, var(--m) - 0.25) * 0.65);
}
.stamp .p4 {
  transform: translate(var(--ox3), var(--oy3)) rotate(var(--r4));
  opacity: calc(max(0, var(--m) - 0.5) * 0.8);
  filter: blur(0.3px);
}
.stamp .ns {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 5px 3px 6px;
  border-right: 1.5px solid color-mix(in srgb, var(--ink) 50%, transparent);
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  text-transform: lowercase;
}
.stamp .val { padding: 3px 7px 3px 5px; }
.stamp.plain .ns { display: none; }
.stamp.plain .val { padding: 3px 8px; }
.stamp .x {
  border: 0; background: transparent; cursor: pointer;
  color: inherit; opacity: 0.55; font-size: 12px; padding: 0 5px 0 0; line-height: 1;
  position: relative; z-index: 2;
}
.stamp .x:hover { opacity: 1; }
/* Machine: locked double border, no multi-press wear, never tilted */
.stamp.machine {
  cursor: default;
  --rot: 0deg !important;
  --r2: 0deg !important;
  --r3: 0deg !important;
  --r4: 0deg !important;
  transform: none;
}
.stamp.machine .p2,
.stamp.machine .p3,
.stamp.machine .p4 { display: none; }
.stamp.machine .p1 {
  border-style: double;
  border-width: 3px;
}
.stamp.machine .x { display: none; }
.stamp.machine:hover { transform: none; }
.stamp.machine.press-flash,
.stamp.machine.peel-tilt { animation: none; }
.stamp .val[data-n]::after {
  content: attr(data-n);
  margin-left: 3px; font-size: 9px; opacity: 0.75; font-weight: 500;
}
.stamp.s0, .stamp.s0 .p1, .stamp.s0 .p2, .stamp.s0 .p3, .stamp.s0 .p4 { border-radius: 3px; }
.stamp.s1, .stamp.s1 .p1, .stamp.s1 .p2, .stamp.s1 .p3, .stamp.s1 .p4 { border-radius: 999px; }
.stamp.s2, .stamp.s2 .p1, .stamp.s2 .p2, .stamp.s2 .p3, .stamp.s2 .p4 { border-radius: 2px 10px 2px 3px; }
.stamp.s3, .stamp.s3 .p1, .stamp.s3 .p2, .stamp.s3 .p3, .stamp.s3 .p4 { border-radius: 4px 3px 6px 2px; }
