/* Exa Spark — C layout × D palette (softened), Exa orange accent. Dark and light themes. */
:root, :root[data-theme="dark"] {
  /* Slate dark (option C): cool grey-blue, Exa orange accent */
  --bg: #161C1F; --rail: #111618; --surface: #1F282C; --surface-2: #243034; --border: #2D393F; --border-2: #3E4D54;
  --track: #2D393F; --text: #E1E8EA; --strong: #F2F6F7; --muted: #97A8AF; --soft: #BDCBD0; --globe: #AABAC0;
  --accent: #FF7E34; --on-accent: #1E1206; --accent-soft: #3A2C24; --accent-text: #FFA066;
  --link: #FFA066; --shadow: none; --nav-on: #283439; --nav-text: #97A8AF; --nav-on-text: #F2F6F7;
  --input: #161C1F; --focus: #FFA066; --good: #5DBE8E; --bad: #E07A7A; --warn: #E0B45A;
  --st-requested: #6F8189; --st-triage: #D9B36A; --st-not_started: #3E4D54; --st-in_progress: #6AA6D4;
  --st-in_review: #B79BD9; --st-approved: #4FA99A; --st-delivered: #5DBE8E; --st-stuck: #E07A7A; --st-declined: #55666D;
  --st-returned: #C98A5A; --st-waiting_on_portco: #E0B45A;
  --pill-fg: #161C1F; --pill-ns-fg: #E1E8EA;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F5F3FA; --rail: #FFFFFF; --surface: #FFFFFF; --surface-2: #F7F5FC; --border: #E5E1F0; --border-2: #C9C3DD;
  --track: #ECE9F4; --text: #2A2540; --strong: #1A1630; --muted: #625B7E; --soft: #4A4466;
  --accent: #FF7E34; --on-accent: #2A1404; --accent-soft: #FFEADB; --accent-text: #B04A0C;
  --link: #B04A0C; --shadow: 0 1px 2px rgba(30,20,60,.06); --nav-on: #F1ECFA; --nav-text: #625B7E; --nav-on-text: #1A1630;
  --input: #FFFFFF; --focus: #B04A0C; --good: #2F7D57; --bad: #B0425A; --warn: #8A6414;
  --st-requested: #8A84A8; --st-triage: #C99A3A; --st-not_started: #D8D3E6; --st-in_progress: #3B79AE;
  --st-in_review: #6E5CB8; --st-approved: #267A68; --st-delivered: #2F7F58; --st-stuck: #B04A5E; --st-declined: #B9B4CC; --st-returned: #A8632E; --st-waiting_on_portco: #B8761E;
  --pill-fg: #FFFFFF; --pill-ns-fg: #2A2540;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: 'DM Sans', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.45; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--strong); margin: 0; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; }
h2 { font-size: 17px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 12px; }
.strong { color: var(--strong); font-weight: 700; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 18px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }

/* ---- App shell ---- */
.shell { display: flex; min-height: 100vh; }
.rail { flex: 0 0 92px; background: var(--rail); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 18px 0 14px; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail .logo { width: 58px; display: block; margin-top: 2px; }
.logo-light, .rail .logo.logo-light { display: none; }
:root[data-theme="light"] .logo-dark, :root[data-theme="light"] .rail .logo.logo-dark { display: none; }
:root[data-theme="light"] .logo-light, :root[data-theme="light"] .rail .logo.logo-light { display: block; }
.rail .brand-word { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--accent-text); margin: 4px 0 16px; }
.nav-link { width: 78px; padding: 9px 0; border-radius: 12px; font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--nav-text); position: relative; text-align: center; }
.nav-link:hover { background: var(--nav-on); text-decoration: none; color: var(--nav-on-text); }
.nav-link.on { background: var(--nav-on); color: var(--nav-on-text); }
.nav-link svg { width: 20px; height: 20px; }
.nav-badge { position: absolute; top: 4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rail-spacer { flex: 1; min-height: 12px; }
.rail-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.rail-btn:hover { color: var(--strong); }
.rail-btn svg { width: 18px; height: 18px; }
.theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-icon-moon { display: block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.main { flex: 1; min-width: 0; padding: 30px 32px 56px; }
.main-wrap { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.main-col { flex: 999 1 620px; min-width: 0; }
.side-col { flex: 1 1 300px; max-width: 360px; display: flex; flex-direction: column; gap: 18px; }

/* ---- Page header ---- */
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head p { margin-top: 6px; color: var(--muted); }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.board-badge { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; color: #16132B; flex: 0 0 auto; }
.pc-badge { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #16132B; flex: 0 0 auto; }
:root[data-theme="light"] .pc-badge, :root[data-theme="light"] .board-badge { color: #2A2540; }
.pc-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: var(--border-2); color: var(--strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.05); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tag-sample { font-size: 12px; color: var(--muted); border: 1px dashed var(--border-2); padding: 4px 10px; border-radius: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.chip.neutral { background: var(--surface-2); color: var(--soft); border: 1px solid var(--border); }
.count-pill { min-width: 22px; text-align: center; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--soft); border: 1px solid var(--border); }

/* ---- Status ---- */
.pill { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 800; color: var(--pill-fg); white-space: nowrap; min-width: 92px; }
.pill.not_started { color: var(--pill-ns-fg); }
:root[data-theme="dark"] .pill.requested, :root[data-theme="dark"] .pill.declined { color: #F2F6F7; }
:root[data-theme="light"] .pill.triage, :root[data-theme="light"] .pill.requested { color: #1A1630; }
.pill.requested { background: var(--st-requested); } .pill.triage { background: var(--st-triage); }
.pill.not_started { background: var(--st-not_started); } .pill.in_progress { background: var(--st-in_progress); }
.pill.in_review { background: var(--st-in_review); } .pill.approved { background: var(--st-approved); }
.pill.delivered { background: var(--st-delivered); } .pill.stuck { background: var(--st-stuck); }
.pill.declined { background: var(--st-declined); }
.pill.returned, .seg.returned, .sw.returned, .status-select.returned { background: var(--st-returned); }
.pill.waiting_on_portco, .seg.waiting_on_portco, .sw.waiting_on_portco, .status-select.waiting_on_portco { background: var(--st-waiting_on_portco); }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.requested, .seg.requested { background: var(--st-requested); } .sw.triage, .seg.triage { background: var(--st-triage); }
.sw.not_started, .seg.not_started { background: var(--st-not_started); } .sw.in_progress, .seg.in_progress { background: var(--st-in_progress); }
.sw.in_review, .seg.in_review { background: var(--st-in_review); } .sw.approved, .seg.approved { background: var(--st-approved); }
.sw.delivered, .seg.delivered { background: var(--st-delivered); } .sw.stuck, .seg.stuck { background: var(--st-stuck); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--track); }
.bar .seg { display: block; height: 100%; }
.due-overdue { color: var(--bad); font-weight: 700; }
.due-soon { color: var(--warn); font-weight: 700; }
.prio-high { color: var(--warn); font-weight: 700; } .prio-urgent { color: var(--bad); font-weight: 800; }
.status-select { appearance: none; border: 0; border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; color: var(--pill-fg); min-width: 110px; text-align: center; }
.status-select.not_started { color: var(--pill-ns-fg); }
.status-select.requested { background: var(--st-requested); } .status-select.triage { background: var(--st-triage); }
.status-select.not_started { background: var(--st-not_started); } .status-select.in_progress { background: var(--st-in_progress); }
.status-select.in_review { background: var(--st-in_review); } .status-select.approved { background: var(--st-approved); }
.status-select.delivered { background: var(--st-delivered); } .status-select.stuck { background: var(--st-stuck); }
.status-select option { background: var(--surface); color: var(--text); }

/* ---- Portfolio cards ---- */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pc-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s; }
.pc-card:hover { border-color: var(--border-2); text-decoration: none; }
.pc-card .name { font-weight: 800; font-size: 17px; color: var(--strong); }
.stat-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.stat-trio .lbl { color: var(--muted); font-size: 11px; }
.stat-trio .val { font-weight: 800; font-size: 18px; color: var(--strong); }
.hs-connected { color: var(--good); font-weight: 700; font-size: 13px; }
.hs-error { color: var(--bad); font-weight: 700; font-size: 13px; }
.hs-not_connected { color: var(--muted); font-weight: 700; font-size: 13px; }
.pc-next { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--soft); }

/* ---- Lists in side cards ---- */
.list-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 8px; }
.cap-row { margin-top: 10px; }
.cap-track { height: 8px; background: var(--track); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.cap-fill { height: 100%; border-radius: 4px; background: var(--st-delivered); }
.cap-fill.warn { background: var(--st-triage); } .cap-fill.over { background: var(--st-stuck); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--strong); text-decoration: none; }
.tab.on { color: var(--strong); font-weight: 800; border-bottom-color: var(--accent); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; min-width: 860px; }
table.grid th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.grid td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
table.grid tr:first-child td { border-top: 0; }
table.grid tbody tr:hover td { background: var(--surface-2); }
table.grid td.title a { color: var(--strong); font-weight: 700; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 24px 0 8px; }
.group-head h2 { font-size: 15px; }

/* ---- Kanban ---- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 220px; }
.kcol-bar { height: 4px; }
.kcol-head { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.kcol-body { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.kcol.drop-target { outline: 2px dashed var(--accent); outline-offset: -4px; }
.kcard { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; color: var(--text); cursor: grab; }
.kcard:hover { border-color: var(--border-2); text-decoration: none; }
.kcard.readonly { cursor: pointer; }
.kcard.dragging { opacity: .4; }
.kcard .t { font-weight: 700; color: var(--strong); margin-top: 6px; line-height: 1.3; }
.kcard .meta { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 8px; }
.type-tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }

/* ---- Timeline ---- */
.tl { min-width: 900px; }
.tl-row { display: grid; align-items: center; min-height: 42px; border-bottom: 1px solid var(--border); }
.tl-head { font-size: 11px; font-weight: 700; color: var(--muted); }
.tl-head > div { padding: 12px 4px; text-align: center; border-left: 1px solid var(--border); }
.tl-head > div.now { color: var(--accent-text); background: var(--accent-soft); }
.tl-label { padding: 8px 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label a { color: var(--text); }
.tl-group { background: var(--surface-2); font-weight: 800; color: var(--strong); padding: 9px 14px; grid-column: 1 / -1; }
.tl-bar { height: 24px; border-radius: 12px; margin: 0 3px; padding: 0 10px; display: flex; align-items: center; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; color: var(--pill-fg); }
.tl-bar.not_started { color: var(--pill-ns-fg); }
.tl-ms.end { justify-content: flex-end; padding: 0 8px 0 0; }
.tl-ms { display: flex; align-items: center; gap: 8px; padding-left: 6px; font-size: 12px; font-weight: 700; color: var(--warn); white-space: nowrap; }
.tl-ms i { width: 12px; height: 12px; transform: rotate(45deg); background: var(--st-triage); border-radius: 2px; display: inline-block; }

/* ---- Calendar ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); min-width: 800px; }
.cal-dow { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-height: 118px; padding: 6px 7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--surface-2); opacity: .6; }
.cal-day.today .num { background: var(--accent); color: var(--on-accent); border-radius: 50%; }
.cal-day .num { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--soft); }
.cal-ev { display: flex; align-items: center; gap: 6px; font-size: 11px; padding: 3px 6px; margin-top: 3px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev:hover { text-decoration: none; border-color: var(--border-2); }
.cal-ev.ms { border-color: var(--st-triage); }

/* ---- Forms ---- */
label.f { display: block; font-weight: 700; color: var(--strong); margin-bottom: 6px; font-size: 13px; }
.f-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.req { color: var(--accent-text); }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--input); color: var(--text); border: 1px solid var(--border-2); border-radius: 10px; padding: 9px 11px; font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { color: var(--muted); font: inherit; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fgrid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .fgrid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.type-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.type-card { display: block; padding: 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.type-card:hover { border-color: var(--accent); text-decoration: none; }
.type-card h3 { margin-bottom: 6px; }

/* ---- Flash ---- */
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; background: var(--accent-soft); color: var(--strong); border: 1px solid var(--border); }
.flash.err { background: transparent; border-color: var(--bad); color: var(--bad); }

/* ---- Item detail ---- */
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; align-items: center; }
.detail-grid .k { color: var(--muted); font-size: 13px; }
.subtask { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.subtask:last-child { border-bottom: 0; }
.subtask.done .st-title { text-decoration: line-through; color: var(--muted); }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: 0; }
.comment .body { white-space: pre-wrap; margin-top: 3px; }
.brief dt { color: var(--muted); font-size: 12px; margin-top: 10px; }
.brief dd { margin: 2px 0 0; white-space: pre-wrap; color: var(--text); }

/* ---- Proofing ---- */
.proof-layout { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.proof-stage { flex: 999 1 560px; min-width: 0; }
.proof-side { flex: 1 1 320px; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.page-wrap { position: relative; display: inline-block; max-width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; line-height: 0; }
.page-wrap img { max-width: 100%; height: auto; display: block; }
.page-wrap.pinning { cursor: crosshair; }
.pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); color: var(--on-accent); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.35); padding: 0; }
.pin span { transform: rotate(45deg); }
.pin.resolved { background: #8E88B0; }
.pin.active { outline: 3px solid var(--focus); }
.pin.draft { background: var(--st-in_review); }
.page-label { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pcomment { padding: 10px 0; border-bottom: 1px solid var(--border); }
.pcomment.active { background: var(--surface-2); margin: 0 -10px; padding: 10px; border-radius: 10px; }
.pcomment .num { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 800; align-items: center; justify-content: center; }
.pcomment.resolved .num { background: #8E88B0; color: #fff; }
.pcomment.resolved .body { color: var(--muted); }
.reply { margin-left: 28px; padding-top: 8px; }
.approver { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.approver:last-child { border-bottom: 0; }
.dec-approved { color: var(--good); font-weight: 700; } .dec-changes_requested { color: var(--bad); font-weight: 700; } .dec-pending { color: var(--muted); font-weight: 700; }

/* ---- Brand hub ---- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.asset { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.asset .thumb { height: 130px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.asset .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset .info { padding: 12px; }
.filetype { font-size: 22px; font-weight: 800; color: var(--muted); letter-spacing: 1px; }

/* ---- Timesheet ---- */
table.ts td input { width: 64px; text-align: right; padding: 6px 8px; }
table.ts td, table.ts th { text-align: center; }
table.ts td:first-child, table.ts th:first-child { text-align: left; }

/* ---- Login ---- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.login-card .logo { width: 90px; }
.sso { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.sso .btn { height: 46px; }
.dev-list { margin-top: 18px; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.dev-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: transparent; border: 0; border-bottom: 1px solid var(--border); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.dev-user:hover { background: var(--surface-2); }
.dev-user:last-child { border-bottom: 0; }

/* ---- Help ---- */
.help-toc a { display: block; padding: 6px 0; color: var(--soft); }
.help-section { scroll-margin-top: 20px; }
.help-section ol, .help-section ul { padding-left: 20px; margin: 8px 0 0; }
.help-section li { margin: 4px 0; }

.empty { padding: 28px; text-align: center; color: var(--muted); }
details.more > summary { cursor: pointer; color: var(--link); font-weight: 700; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail { flex-direction: row; width: 100%; height: auto; position: static; padding: 8px; overflow-x: auto; justify-content: flex-start; }
  .rail .logo { width: 44px; } .rail .brand-word { display: none; }
  .nav-link { width: 64px; flex: 0 0 auto; }
  .rail-spacer { display: none; }
  .main { padding: 20px 16px 40px; }
  .side-col { max-width: none; }
}

/* ---- Release 2: stages, gate, clocks, projects ---- */
.own { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--soft); }
.own-exa { color: var(--accent-text); border-color: var(--accent); }
.own-portco { color: var(--st-in_progress); border-color: var(--st-in_progress); }
.own-both { color: var(--st-in_review); border-color: var(--st-in_review); }
.stages { list-style: none; margin: 8px 0 0; padding: 0; }
.stage { padding: 12px 0 12px 4px; border-top: 1px solid var(--border); }
.stage:first-child { border-top: 0; }
.stage-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-2); flex: none; }
.stage-active .stage-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stage-done .stage-dot { border-color: var(--good); background: var(--good); }
.stage-skipped { opacity: .6; } .stage-skipped .strong { text-decoration: line-through; }
.stage-pending .strong { color: var(--soft); font-weight: 600; }
.clock { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--soft); border: 1px solid var(--border); }
.clock-amber { color: var(--warn); border-color: var(--warn); }
.clock-red { color: var(--bad); border-color: var(--bad); }
.clock-paused { color: var(--st-waiting_on_portco); border-style: dashed; }
.gate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.gate-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.gate-box.ok { border-color: var(--good); }
.gate-box.ok .strong::before { content: "✓ "; color: var(--good); }
.claim { border-top: 1px solid var(--border); padding: 10px 0; }
.claim.ok .strong { color: var(--good); }
.paths { border: 0; padding: 0; margin-left: 0; margin-right: 0; display: grid; gap: 8px; }
.path-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.path-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.path-opt input { margin-top: 3px; width: auto; }
.type-card.on { border-color: var(--accent); background: var(--accent-soft); }
.health { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.health-on_track { color: var(--good); } .health-at_risk { color: var(--warn); } .health-off_track { color: var(--bad); }
.rate { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.rate legend { width: 100%; }
.rate-opt input { position: absolute; opacity: 0; }
.rate-opt span { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border-2); font-weight: 800; cursor: pointer; }
.rate-opt input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.rate-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.stars { color: var(--warn); letter-spacing: 1px; }
.gantt { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; overflow-x: auto; }
.gantt-labels { padding-top: 24px; }
.g-label { height: 42px; display: flex; align-items: center; font-size: 12px; padding-right: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.g-label a { overflow: hidden; text-overflow: ellipsis; }
.gantt-area { position: relative; min-width: 420px; }
.g-ticks { position: relative; height: 24px; border-bottom: 1px solid var(--border); }
.g-ticks span { position: absolute; font-size: 11px; color: var(--muted); white-space: nowrap; }
.g-rows { position: relative; }
.g-row { height: 42px; position: relative; border-bottom: 1px dashed var(--border); }
.g-bar { position: absolute; top: 12px; height: 18px; border-radius: 9px; background: var(--st-not_started); }
.g-bar.in_progress { background: var(--st-in_progress); } .g-bar.in_review { background: var(--st-in_review); }
.g-bar.approved { background: var(--st-approved); } .g-bar.delivered { background: var(--st-delivered); }
.g-bar.stuck { background: var(--st-stuck); } .g-bar.waiting_on_portco { background: var(--st-waiting_on_portco); }
.g-ms { position: absolute; top: 12px; width: 16px; height: 16px; margin-left: -8px; transform: rotate(45deg); background: var(--accent); border-radius: 3px; }
.g-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.g-arrows path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.g-arrows path.late { stroke: var(--bad); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .7; }

/* ---- My work, bulk edit, search, mentions ---- */
.mw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.bulk-bar { position: sticky; top: 8px; z-index: 6; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent); box-shadow: 0 6px 24px rgba(0,0,0,.25); margin: 10px 0; }
.bulk-bar select, .bulk-bar input { width: auto; }
.bulk-bar[hidden] { display: none; }
select.cell:not(.status-select), input.cell { width: auto; min-width: 120px; padding: 5px 8px; font-size: 12px; background: transparent; border-color: transparent; }
select.cell:not(.status-select):hover, input.cell:hover, select.cell:focus, input.cell:focus { border-color: var(--border-2); background: var(--input); }
.flash.live { position: fixed; bottom: 18px; right: 18px; z-index: 50; margin: 0; box-shadow: 0 6px 24px rgba(0,0,0,.3); background: var(--surface); }
.search-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(5,8,10,.55); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-overlay[hidden] { display: none; }
.search-box { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden; }
.search-box input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px 18px; font-size: 16px; background: transparent; }
.search-results { max-height: 50vh; overflow-y: auto; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 10px 16px; color: var(--text); }
.search-results a.on, .search-results a:hover { background: var(--nav-on); text-decoration: none; }
.search-foot { padding: 8px 16px; border-top: 1px solid var(--border); }
.mention-pop { position: absolute; z-index: 20; left: 0; top: 100%; min-width: 220px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 4px; }
.mention-pop button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: transparent; color: var(--text); border-radius: 7px; font: inherit; cursor: pointer; }
.mention-pop button.on, .mention-pop button:hover { background: var(--nav-on); }

/* ---- Website health ---- */
.globe-link { display: inline-flex; vertical-align: middle; }
.globe { display: block; }
.sev-critical { color: var(--bad); } .sev-warning { color: var(--warn); } .sev-info { color: var(--muted); }
.chip.sev-critical { background: transparent; border: 1px solid var(--bad); }
.chip.sev-warning { background: transparent; border: 1px solid var(--warn); }
.checks-strip { display: flex; gap: 2px; flex-wrap: wrap; }
.checks-strip span { width: 8px; height: 22px; border-radius: 2px; background: var(--good); }
.checks-strip span.bad { background: var(--bad); }

.seg-switch { display: inline-flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; }
.seg-switch button { border: 0; background: transparent; color: var(--soft); font: inherit; font-size: 12px; font-weight: 700; padding: 7px 12px; cursor: pointer; }
.seg-switch button.on { background: var(--nav-on); color: var(--strong); }
.pc-badge.sm { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; display: inline-flex; vertical-align: middle; }
table.grid.compact td { padding-top: 7px; padding-bottom: 7px; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.swatch { display: flex; gap: 10px; align-items: center; }
.swatch > span { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); flex: none; }

/* ---- Dashboards ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; }
.tile-val { font-size: 28px; font-weight: 800; color: var(--strong); letter-spacing: -.5px; margin: 2px 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.meter { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: var(--track); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--st-in_progress); border-radius: 0 4px 4px 0; }
pre.log { white-space: pre-wrap; font-size: 12px; max-height: 360px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: 10px; }
.filters select, .filters input[type=search] { width: auto; max-width: 220px; }

/* ---- Portco workspace ---- */
.nav-cta { display: block; margin: 6px 8px 10px; padding: 9px 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800; text-align: center; text-decoration: none; }
.nav-cta:hover { filter: brightness(1.06); text-decoration: none; }
.eyebrow { font-size: 12px; color: var(--muted); margin: 0 0 2px; }
.need-card { border-color: var(--accent); }
.need-row { display: flex; gap: 16px; align-items: center; padding: 14px; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.need-actions { flex-wrap: nowrap; gap: 8px; }
.svc-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.accent-text { color: var(--accent-text); }
.fstate { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; background: var(--surface-2); color: var(--soft); }
.fstate-ok { color: var(--good); } .fstate-warn { color: var(--warn); } .fstate-bad { color: var(--bad); }
@media (max-width: 720px) { .need-row { flex-direction: column; align-items: stretch; } }

/* ---- Request form ---- */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; }
.steps a { display: inline-block; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--soft); border: 1px solid var(--border); text-decoration: none; }
.steps a.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.choice-grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border-2); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--surface); }
.choice:hover { border-color: var(--accent); text-decoration: none; }
.choice.on { border: 2px solid var(--accent); background: var(--accent-soft); padding: 13px 15px; }
.svc-panel { background: var(--surface-2); }
.next-card { border-color: var(--accent); background: var(--accent-soft); }
.next-card h2, .next-card p { color: var(--accent-text); }
.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin: 6px 0; }
.accent-bullets li::marker { color: var(--accent); }

.progress { height: 10px; border-radius: 6px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--good); border-radius: 6px; }
.fcard { display: flex; gap: 18px; align-items: center; }
@media (max-width: 720px) { .fcard { flex-direction: column; align-items: stretch; } }

.process { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 12px; }
.process li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.process li::before { content: counter(step); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rules-card .rule { padding: 10px 0; border-top: 1px solid var(--border); }
.rules-card .rule:first-of-type { border-top: 0; }
[data-filterable].filtered-out { display: none; }

/* ---- Results ---- */
.src-tag { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--soft); border: 1px solid var(--border); }
.chg-good { color: var(--good); } .chg-bad { color: var(--bad); } .chg-flat { color: var(--muted); }
.vbars { display: flex; align-items: flex-end; gap: 14px; height: 240px; padding-top: 10px; border-bottom: 1px solid var(--border); }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; padding-bottom: 22px; }
.vbar-col { width: min(56px, 70%); background: var(--st-in_progress); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbar-col.on { background: var(--accent); }
.vbar-col.partial { background: var(--track); }
.vbar-val { font-size: 12px; font-weight: 700; margin-bottom: 4px; color: var(--strong); }
.vbar-lab { position: absolute; bottom: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; }
@media print {
  .rail, .no-print, .tag-sample, .flash, .search-overlay { display: none !important; }
  .main { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { break-inside: avoid; box-shadow: none !important; }
}
