/* ══════════════════════════════════════════════════════════════════
   ATLAS COCKPIT — VIEW & COMPONENT STYLES
   ══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────  TODAY · HERO BRIEFING  ───────────────── */
.hero {
  border: 1px solid var(--rule); border-radius: var(--r-xl); padding: clamp(22px,2.6vw,32px);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-weak), transparent 55%),
    var(--bg-elevated);
  box-shadow: var(--sh-sm); position: relative; overflow: hidden;
}
.hero-greet { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hero-greet .eyebrow { color: var(--ink-muted); }
.hero-line {
  font-size: clamp(22px, 3vw, 30px); font-weight: 680; letter-spacing: -0.03em; line-height: 1.22; max-width: 24ch;
}
.hero-line .hl { color: var(--ink); }
.hero-line .dim { color: var(--ink-faint); font-weight: 600; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 0; margin-top: 22px; border-top: 1px solid var(--rule); }
.hero-stat { padding: 16px 26px 4px 0; margin-right: 26px; border-right: 1px solid var(--rule); }
.hero-stat:last-child { border-right: 0; }
.hero-stat .v { font-size: 23px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 7px; }
.hero-stat .v.alert { color: var(--danger); }
.hero-stat .l { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); margin-top: 8px; }
.hero-cta { position: absolute; top: clamp(22px,2.6vw,32px); right: clamp(22px,2.6vw,32px); display: flex; gap: 8px; }
@media (max-width: 760px) { .hero-cta { position: static; margin-top: 18px; } }

/* two-column today layout */
.today-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--s-6); align-items: start; margin-top: var(--s-8); }
@media (max-width: 1080px) { .today-grid { grid-template-columns: 1fr; } }
.rail { display: flex; flex-direction: column; gap: var(--s-6); position: sticky; top: 16px; }

/* mini list card (rail) */
.mini { padding: var(--s-5); }
.mini-head { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s-3); }
.mini-head .t { font-size: 13px; font-weight: 620; }
.mini-head .c { margin-left: auto; }
.mini-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.mini-row:first-of-type { border-top: 0; }
.mini-row .mr-main { flex: 1; min-width: 0; }
.mini-row .mr-title { font-weight: 520; line-height: 1.35; }
.mini-row .mr-sub { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

/* expandable blocker rows in "Needs your input" */
.blk { border-top: 1px solid var(--rule); }
.blk:first-of-type { border-top: 0; }
.blk-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.blk-row .mr-main { flex: 1; min-width: 0; }
.blk-row .mr-title { font-weight: 520; line-height: 1.35; font-size: 13px; }
.blk-row .mr-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-faint); margin-top: 3px; }
.blk-chev { flex-shrink: 0; color: var(--ink-faint); margin-top: 1px; cursor: pointer; transition: transform 200ms var(--ease); }
.blk-row.open .blk-chev { transform: rotate(180deg); color: var(--accent); }
.blk-detail { padding: 0 0 12px 26px; display: flex; flex-direction: column; gap: 9px; }
.blk-why { font-size: 12.5px; color: var(--ink-muted); line-height: 1.5; }
.blk-link { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }

/* ──────────────────────────  ACTION QUEUE  ──────────────────────── */
.queue { display: flex; flex-direction: column; gap: var(--s-3); }
.aq {
  background: var(--bg-elevated); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); overflow: hidden; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.aq:hover { border-color: var(--rule-strong); box-shadow: var(--sh-md); }
.aq.dragging { opacity: 0.55; }
.aq.drop-into { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.aq-bar { display: flex; align-items: stretch; }
.aq-prio { width: 3px; flex-shrink: 0; background: var(--ink-faint); }
.aq.u-critical .aq-prio, .aq.u-high .aq-prio { background: var(--danger); }
.aq.u-medium .aq-prio { background: var(--warning); }
.aq.u-low .aq-prio { background: var(--ink-faint); }
.aq-main { flex: 1; min-width: 0; }
.aq-top { display: flex; align-items: center; gap: 12px; padding: 15px 16px; cursor: pointer; transition: background 130ms var(--ease); }
.aq-top:hover { background: var(--bg-hover); }
.aq-grip { color: var(--ink-faint); cursor: grab; opacity: 0; transition: opacity 140ms var(--ease); align-self: flex-start; margin-top: 2px; }
.aq:hover .aq-grip { opacity: 1; }
.aq-grip:active { cursor: grabbing; }
.aq-body { flex: 1; min-width: 0; align-self: center; }
.aq-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.aq-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.aq-why { font-size: 13px; color: var(--ink-muted); margin-top: 4px; line-height: 1.5; }
.aq-meta { display: flex; align-items: center; gap: 12px; margin-top: 9px; flex-wrap: wrap; }
.aq-meta .m { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 5px; }
.aq-meta .m.due { color: var(--warning); }
.aq-meta .m.overdue { color: var(--danger); }
.aq-prog { display: flex; align-items: center; gap: 8px; }
.aq-prog .bar { width: 54px; }
.aq-chev {
  flex-shrink: 0; width: 28px; height: 28px; border: 1px solid var(--rule); border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-muted); background: var(--bg-elevated);
  transition: transform 200ms var(--ease), background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}
.aq:hover .aq-chev { border-color: var(--rule-strong); color: var(--ink); }
.aq.open .aq-chev { transform: rotate(180deg); background: var(--accent-weak); color: var(--accent); border-color: transparent; }
.aq-expand { max-height: 0; overflow: hidden; transition: max-height 280ms var(--ease); }
.aq.open .aq-expand { max-height: 1400px; }
.aq-expand-inner { padding: 0 16px 16px 41px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--rule); margin-top: 2px; padding-top: 14px; }
.aq-suggest { font-size: 13px; background: var(--accent-weak); border-radius: var(--r-md); padding: 11px 13px; color: var(--ink); display: flex; gap: 9px; }
.aq-suggest .si { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.checklist { display: flex; flex-direction: column; gap: 2px; }
.cl-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 13px; line-height: 1.45; }
.cl-row.done .cl-text { color: var(--ink-faint); text-decoration: line-through; }
.aq-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

/* bulk bar */
.bulkbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: var(--s-3);
  background: var(--ink); color: var(--bg); border-radius: var(--r-md); box-shadow: var(--sh-md);
  font-size: 13px; animation: toastIn 200ms var(--ease);
}
[data-theme="dark"] .bulkbar { background: var(--bg-elevated); color: var(--ink); border: 1px solid var(--rule-strong); }
.bulkbar .bb-count { font-weight: 650; }
.bulkbar .bb-sp { flex: 1; }
.bulkbar button { font-size: 12.5px; font-weight: 560; padding: 6px 11px; border-radius: 7px; border: 0; background: rgba(255,255,255,0.15); color: var(--bg); }
[data-theme="dark"] .bulkbar button { background: var(--bg-sunken); color: var(--ink); }
.bulkbar button:hover { filter: brightness(1.15); }

/* ───────────────────────────  PROJECTS  ─────────────────────────── */
.toolbar { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-5); flex-wrap: wrap; }
.toolbar .tb-sp { flex: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(316px, 1fr)); gap: var(--s-4); }
.ptile { padding: var(--s-5); display: flex; flex-direction: column; gap: 14px; }
.ptile-head { display: flex; align-items: flex-start; gap: 10px; }
.ptile-name { font-size: 17px; font-weight: 660; letter-spacing: -0.02em; }
.ptile-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; line-height: 1.45; }
.ptile-mid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 13px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ptile-m .ml { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.ptile-m .mv { font-size: 15px; font-weight: 640; letter-spacing: -0.01em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ptile-m .mv.muted { color: var(--ink-faint); font-weight: 500; }
.ptile-block { font-size: 12.5px; color: var(--ink-muted); display: flex; gap: 8px; line-height: 1.45; }
.ptile-block .bi { color: var(--warning); flex-shrink: 0; margin-top: 1px; }
.ptile-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.ptile-foot .pf-meta { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-faint); }
.conf { display: inline-flex; gap: 2px; align-items: center; }
.conf i { width: 4px; height: 11px; border-radius: 1px; background: var(--rule-strong); }
.conf.high i { background: var(--success); }
.conf.medium i:nth-child(-n+2) { background: var(--warning); }
.conf.low i:nth-child(1) { background: var(--danger); }

/* project table view */
.ptable-wrap { border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elevated); box-shadow: var(--sh-sm); }
table.dt { font-size: 13px; }
table.dt th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-muted); padding: 12px 16px; background: var(--bg-sunken);
  border-bottom: 1px solid var(--rule); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.dt th.r, table.dt td.r { text-align: right; }
table.dt td { padding: 13px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.dt tr:last-child td { border-bottom: 0; }
table.dt tbody tr { cursor: pointer; transition: background 120ms var(--ease); }
table.dt tbody tr:hover { background: var(--bg-hover); }
table.dt td.name { font-weight: 600; letter-spacing: -0.01em; }
.dt-num { font-variant-numeric: tabular-nums; }
.dt-num.muted { color: var(--ink-faint); }
table.dt th.sortable { cursor: pointer; }
table.dt th.sortable:hover { color: var(--ink); }
table.dt th .sarrow { opacity: 0; margin-left: 4px; }
table.dt th.sorted .sarrow { opacity: 1; color: var(--accent); }

/* ───────────────────────────  FINANCE  ──────────────────────────── */
.fin-wrap { border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elevated); box-shadow: var(--sh-sm); overflow-x: auto; }
table.fin { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 680px; }
table.fin th {
  text-align: right; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-muted); padding: 12px 16px; background: var(--bg-sunken);
  border-bottom: 1px solid var(--rule); white-space: nowrap;
}
table.fin th:first-child { text-align: left; position: sticky; left: 0; z-index: 3; }
table.fin td { padding: 12px 16px; border-bottom: 1px solid var(--rule); text-align: right; }
table.fin td:first-child { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--bg-elevated); z-index: 1; }
table.fin tr:hover td { background: var(--bg-hover); }
table.fin tr:hover td:first-child { background: var(--bg-hover); }
table.fin tr.subtotal td { background: var(--bg-sunken); font-weight: 600; border-top: 1px solid var(--rule-strong); }
table.fin tr.subtotal td:first-child { background: var(--bg-sunken); }
table.fin tr.total td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; background: var(--bg-sunken); }
table.fin tr.total td:first-child { background: var(--bg-sunken); }
.num.muted { color: var(--ink-faint); }
.num.up { color: var(--success); }
.num.down { color: var(--danger); }
.cell-edit {
  background: transparent; border: 1px solid transparent; color: inherit; font: inherit;
  text-align: right; width: 92px; padding: 3px 7px; border-radius: 5px; font-variant-numeric: tabular-nums;
  transition: all 120ms var(--ease);
}
.cell-edit:hover { border-color: var(--rule-strong); background: var(--bg-sunken); }
.cell-edit:focus { outline: none; border-color: var(--accent); background: var(--bg-elevated); }
.cell-edit.placeholder { color: var(--ink-faint); }
.cell-note { width: 100%; text-align: left; font-size: 12px; color: var(--ink-muted); }

/* projections */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
@media (max-width: 720px) { .proj-grid { grid-template-columns: 1fr; } }
.proj-card { display: flex; flex-direction: column; gap: 12px; }
.proj-val { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.proj-val.muted { color: var(--ink-faint); }
.proj-assume { font-size: 12.5px; color: var(--ink-muted); line-height: 1.5; padding-top: 12px; border-top: 1px solid var(--rule); }
.proj-assume .eyebrow { display: block; margin-bottom: 4px; }

/* ─────────────────────────────  RISKS  ──────────────────────────── */
.heatstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: var(--s-5); }
.heat { padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--rule); background: var(--bg-elevated); }
.heat .hv { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.heat .hl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin-top: 7px; }
.heat.high { border-left: 3px solid var(--danger); }
.heat.high .hv { color: var(--danger); }
.heat.medium { border-left: 3px solid var(--warning); }
.heat.medium .hv { color: var(--warning); }
.heat.low { border-left: 3px solid var(--ink-faint); }
.risk-card { padding: var(--s-5); display: flex; flex-direction: column; gap: 12px; }
.risk-card.sev-high { border-top: 3px solid var(--danger); }
.risk-card.sev-medium { border-top: 3px solid var(--warning); }
.risk-card.sev-low { border-top: 3px solid var(--ink-faint); }
.risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px,1fr)); gap: var(--s-4); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: 12.5px; }
.kv .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); padding-top: 1px; }
.kv .v { color: var(--ink); line-height: 1.5; }

/* ─────────────────────────────  IDEAS  ──────────────────────────── */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px,1fr)); gap: var(--s-4); }
.idea-card { padding: var(--s-5); display: flex; flex-direction: column; gap: 12px; }
.idea-top { display: flex; align-items: flex-start; gap: 12px; }
.idea-score-ring { flex-shrink: 0; width: 42px; height: 42px; position: relative; display: grid; place-items: center; }
.idea-score-ring .sv { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink); }
.idea-name { font-size: 15px; font-weight: 640; letter-spacing: -0.015em; line-height: 1.3; }
.idea-thesis { font-size: 13px; color: var(--ink-muted); line-height: 1.55; }
.idea-detail { display: flex; flex-direction: column; gap: 6px; }
.idea-detail > div { display: flex; gap: 10px; font-size: 12px; }
.idea-k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); min-width: 74px; flex-shrink: 0; padding-top: 2px; }
.idea-v { color: var(--ink-muted); line-height: 1.45; }

/* rubric strip (idea scoring) */
.rubric { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 11px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.rubric-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-right: 4px; }
.rubric-cell { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; font-weight: 700; border: 1px solid var(--rule); color: var(--ink-faint); cursor: help; }
.rubric-cell.strong { background: var(--success); color: #fff; border-color: transparent; }
.rubric-cell.weak { background: var(--warning); color: #fff; border-color: transparent; }
.rubric-cell.fail { background: var(--danger); color: #fff; border-color: transparent; }
.rubric-sum { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-muted); }
.rubric-sum.fail { color: var(--danger); }
.rubric-sum.weak { color: var(--warning); }
.rubric-sum.strong { color: var(--success); }
.rubric-sum.unscored { color: var(--ink-faint); }
.idea-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.idea-foot { display: flex; gap: 7px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }

/* decided idea sections (Accepted / Analysis requested / Rejected / Trashed) */
.idea-sec-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ink-faint); flex-shrink: 0; }
.idea-sec-dot.accept { background: var(--success); }
.idea-sec-dot.analyze { background: var(--accent); }
.idea-sec-dot.reject { background: var(--warning); }
.idea-sec-dot.trash { background: var(--ink-faint); }
.decided-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--s-3); }
.decided-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.decided-score { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-muted); background: var(--bg-sunken); border-radius: 7px; padding: 5px 8px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.decided-main { flex: 1; min-width: 0; }
.decided-name { font-size: 13.5px; font-weight: 580; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decided-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-faint); margin-top: 3px; }
.decided-card.trashed { opacity: 0.55; }
.decided-card.trashed .decided-name { text-decoration: line-through; color: var(--ink-muted); }

/* recommendations */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--s-4); }
@media (max-width: 560px) { .rec-grid { grid-template-columns: 1fr; } }
.rec-card2 { display: flex; flex-direction: column; gap: 12px; }
.rec-top { display: flex; align-items: flex-start; gap: 13px; }
.rec-score2 { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-weak); border-radius: 8px; padding: 6px 9px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rec-title2 { font-size: 15px; font-weight: 640; letter-spacing: -0.015em; line-height: 1.3; }
.rec-thesis2 { font-size: 13px; color: var(--ink-muted); line-height: 1.55; }

/* compare tray */
.compare-tray {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 350;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px;
  background: var(--bg-elevated); border: 1px solid var(--rule-strong); border-radius: var(--r-lg);
  box-shadow: var(--sh-pop); animation: toastIn 220ms var(--ease);
}
.compare-tray .ct-label { font-size: 13px; font-weight: 580; }
.compare-tray .ct-chips { display: flex; gap: 6px; }

/* ───────────────────────────  CALENDAR  ─────────────────────────── */
.cal { border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elevated); box-shadow: var(--sh-sm); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); padding: 11px 12px; border-bottom: 1px solid var(--rule); background: var(--bg-sunken); text-align: left; }
.cal-cell { min-height: 104px; padding: 9px 10px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--bg-sunken); }
.cal-date { font-size: 12px; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-date { color: var(--accent-ink); background: var(--accent); width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; }
.cal-ev { font-size: 11px; line-height: 1.3; padding: 4px 7px; border-radius: 5px; background: var(--accent-weak); color: var(--accent); border-left: 2px solid var(--accent); }
.cal-ev.beta { background: var(--danger-weak); color: var(--danger); border-left-color: var(--danger); }
.cal-ev.done { opacity: 0.5; text-decoration: line-through; }

/* week list */
.week-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: var(--s-4); padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.week-row:last-child { border-bottom: 0; }
.week-row.today { background: var(--accent-weak); }
.week-day { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); }
.week-row.today .week-day { color: var(--accent); font-weight: 600; }
.week-text { font-size: 13.5px; }
.week-text.done { color: var(--ink-faint); text-decoration: line-through; }

/* ─────────────────────────────  SETTINGS  ───────────────────────── */
.set-row { display: flex; align-items: center; gap: var(--s-4); padding: 16px 0; border-bottom: 1px solid var(--rule); }
.set-row:last-child { border-bottom: 0; }
.set-row .sr-main { flex: 1; }
.set-row .sr-title { font-size: 14px; font-weight: 580; }
.set-row .sr-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.switch { width: 42px; height: 25px; border-radius: 99px; background: var(--rule-strong); border: 0; position: relative; transition: background 180ms var(--ease); flex-shrink: 0; }
.switch.on { background: var(--accent); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 99px; background: #fff; transition: transform 180ms var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch.on::after { transform: translateX(17px); }
.src-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.src-row:last-child { border-bottom: 0; }

/* decision log */
.log-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.log-row:last-child { border-bottom: 0; }
.log-icon { width: 30px; height: 30px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; background: var(--bg-sunken); color: var(--ink-muted); }
.log-icon.approve, .log-icon.complete, .log-icon.accept, .log-icon.research { background: var(--success-weak); color: var(--success); }
.log-icon.decline, .log-icon.reject, .log-icon.pass, .log-icon.trash { background: var(--danger-weak); color: var(--danger); }
.log-icon.defer { background: var(--warning-weak); color: var(--warning); }
.log-main { flex: 1; min-width: 0; }
.log-title { font-size: 13.5px; font-weight: 560; }
.log-note { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; line-height: 1.45; }
.log-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-faint); margin-top: 5px; }
.log-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }

/* ───────────────────────────  DRAWER  ───────────────────────────── */
.drawer-scrim { position: fixed; inset: 0; background: var(--bg-overlay); z-index: 300; opacity: 0; transition: opacity 240ms var(--ease); backdrop-filter: blur(2px); }
.drawer-scrim.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(540px, 94vw); z-index: 310;
  background: var(--bg-elevated); border-left: 1px solid var(--rule); box-shadow: var(--sh-pop);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform 300ms var(--ease);
}
.drawer.show { transform: none; }
.drawer-head { padding: 20px 22px 0; flex-shrink: 0; }
.drawer-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.drawer-title { font-size: 20px; font-weight: 680; letter-spacing: -0.025em; line-height: 1.2; }
.drawer-sub { font-size: 13px; color: var(--ink-muted); margin-top: 5px; line-height: 1.5; }
.drawer-close { margin-left: auto; }
.drawer-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.drawer-tab { padding: 10px 13px; font-size: 12.5px; font-weight: 540; color: var(--ink-muted); background: transparent; border: 0; border-bottom: 2px solid transparent; white-space: nowrap; transition: all 140ms var(--ease); }
.drawer-tab:hover { color: var(--ink); }
.drawer-tab.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }
.drawer-sec { margin-bottom: 24px; }
.drawer-sec-t { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 11px; }
.tl { position: relative; padding-left: 20px; }
.tl-item { position: relative; padding: 0 0 16px 0; }
.tl-item::before { content: ''; position: absolute; left: -16px; top: 5px; width: 8px; height: 8px; border-radius: 99px; background: var(--accent); }
.tl-item::after { content: ''; position: absolute; left: -12.5px; top: 13px; bottom: -3px; width: 1px; background: var(--rule); }
.tl-item:last-child::after { display: none; }
.tl-date { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); }
.tl-text { font-size: 13px; margin-top: 2px; line-height: 1.5; }

/* ──────────────────────  COMMAND PALETTE  ───────────────────────── */
.cmd-scrim { position: fixed; inset: 0; background: var(--bg-overlay); z-index: 500; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; opacity: 0; transition: opacity 160ms var(--ease); backdrop-filter: blur(3px); }
.cmd-scrim.show { opacity: 1; }
.cmd { width: min(620px, 92vw); background: var(--bg-elevated); border: 1px solid var(--rule-strong); border-radius: var(--r-xl); box-shadow: var(--sh-pop); overflow: hidden; transform: scale(0.97) translateY(-6px); transition: transform 180ms var(--ease); }
.cmd-scrim.show .cmd { transform: none; }
.cmd-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.cmd-input { flex: 1; border: 0; background: transparent; font-size: 16px; font-weight: 480; color: var(--ink); }
.cmd-input:focus { outline: none; }
.cmd-input::placeholder { color: var(--ink-faint); }
.cmd-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmd-group-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); padding: 12px 12px 6px; }
.cmd-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; }
.cmd-item .ci-ico { width: 17px; height: 17px; color: var(--ink-muted); flex-shrink: 0; }
.cmd-item .ci-main { flex: 1; min-width: 0; }
.cmd-item .ci-title { font-size: 13.5px; font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item .ci-sub { font-size: 11.5px; color: var(--ink-faint); }
.cmd-item .ci-kind { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.cmd-item.active { background: var(--accent-weak); }
.cmd-item.active .ci-ico, .cmd-item.active .ci-title { color: var(--accent); }
.cmd-empty { padding: 32px; text-align: center; color: var(--ink-faint); font-size: 13px; }
.cmd-foot { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 11px; color: var(--ink-faint); }
.cmd-foot .ck { display: inline-flex; align-items: center; gap: 5px; }

/* ══════════════════════════════════════════════════════════════════
   PASS 1 ADDITIONS
   ══════════════════════════════════════════════════════════════════ */

/* sidebar status dot tones */
.sb-status .dot.agg-live { background: var(--success); }
.sb-status .dot.agg-partial { background: var(--warning); }
.sb-status .dot.agg-errored { background: var(--danger); }
.sb-status .dot.agg-local { background: var(--ink-faint); }

/* ───── connections aggregate pill ───── */
.agg-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--rule); color: var(--ink-muted); }
.agg-pill .agg-dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.agg-pill.agg-live { color: var(--success); background: var(--success-weak); border-color: transparent; }
.agg-pill.agg-partial { color: var(--warning); background: var(--warning-weak); border-color: transparent; }
.agg-pill.agg-errored { color: var(--danger); background: var(--danger-weak); border-color: transparent; }
.agg-pill.agg-local { color: var(--ink-muted); }

/* ───── connection rows ───── */
.conn-unreachable { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: var(--s-4); border-radius: var(--r-md); background: var(--warning-weak); color: var(--ink); font-size: 12.5px; line-height: 1.5; }
.conn-unreachable .cu-ico { color: var(--warning); flex-shrink: 0; margin-top: 1px; }
.conn-row { display: grid; grid-template-columns: 18% minmax(0, 1fr) 168px; gap: 16px; align-items: start; padding: 16px var(--s-5); border-bottom: 1px solid var(--rule); }
.conn-row:last-child { border-bottom: 0; }
.conn-head { background: var(--bg-sunken); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); padding-top: 11px; padding-bottom: 11px; }
.conn-name { display: flex; align-items: center; gap: 8px; padding-top: 7px; }
.conn-head.conn-row .conn-name, .conn-head .conn-name, .conn-head .conn-creds, .conn-head .conn-stat { padding-top: 0; }
.conn-dot { width: 9px; height: 9px; border-radius: 99px; flex-shrink: 0; box-shadow: 0 0 0 2px var(--bg-elevated); }
.conn-nm { font-weight: 540; font-size: 13.5px; }
.conn-creds { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.conn-fields { display: flex; flex-direction: column; gap: 7px; }
.conn-field { position: relative; display: flex; align-items: center; gap: 6px; }
.conn-input { flex: 1; min-width: 0; height: 34px; padding: 0 11px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }
.conn-eye { width: 30px; height: 30px; flex-shrink: 0; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--bg-elevated); color: var(--ink-faint); display: grid; place-items: center; }
.conn-eye:hover { color: var(--ink-muted); border-color: var(--rule-strong); }
.conn-save-chip { flex-shrink: 0; height: 30px; padding: 0 13px; border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.conn-save-chip:hover:not(:disabled) { filter: brightness(1.06); }
.conn-save-chip:disabled { cursor: not-allowed; opacity: 0.85; }
.conn-save-chip.saving { background: color-mix(in srgb, var(--accent) 75%, transparent); }
.conn-spinner {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent-ink) 35%, transparent);
  border-top-color: var(--accent-ink); animation: connSpin 0.9s linear infinite;
}
@keyframes connSpin { to { transform: rotate(360deg); } }
.conn-help { font-size: 11.5px; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 4px; width: fit-content; }
.conn-help:hover { color: var(--accent); }
.conn-help.muted-help { cursor: default; }
.conn-saved { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.conn-mask { font-size: 12.5px; color: var(--ink-muted); letter-spacing: 0.12em; }
.conn-stat { display: flex; justify-content: flex-end; padding-top: 7px; }
.conn-status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--rule); background: var(--bg-elevated); white-space: nowrap; }
.conn-status .cs-dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.conn-status.connected { color: var(--success); background: var(--success-weak); border-color: transparent; }
.conn-status.pending { color: var(--warning); background: var(--warning-weak); border-color: transparent; }
.conn-status.errored { color: var(--danger); background: var(--danger-weak); border-color: transparent; cursor: pointer; }
.conn-status.errored:hover { filter: brightness(1.05); }
.conn-foot { margin-top: 10px; }
@media (max-width: 720px) {
  .conn-row { grid-template-columns: 1fr; gap: 10px; }
  .conn-stat { justify-content: flex-start; }
  .conn-head { display: none; }
}

/* ───── form modal ───── */
.form-modal { background: var(--bg-elevated); border: 1px solid var(--rule-strong); border-radius: var(--r-xl); box-shadow: var(--sh-pop); display: flex; flex-direction: column; max-height: 88vh; overflow: hidden; transform: scale(0.98); animation: fmIn 200ms var(--ease) forwards; }
@keyframes fmIn { to { transform: none; } }
.fm-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--rule); }
.fm-title { font-size: 18px; font-weight: 680; letter-spacing: -0.02em; }
.fm-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; }
.fm-head .icon-btn { margin-left: auto; }
.fm-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.fm-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--rule); background: var(--bg-sunken); }
.ff { display: flex; flex-direction: column; }
.ff-hint { font-family: var(--font-sans); font-weight: 450; text-transform: none; letter-spacing: 0; color: var(--ink-faint); margin-left: 7px; font-size: 11px; }
.ff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .ff-grid { grid-template-columns: 1fr; } }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 99px; background: var(--bg-sunken); outline: none; margin: 12px 0 4px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-elevated); box-shadow: var(--sh-sm); cursor: pointer; }
.range::-moz-range-thumb { width: 17px; height: 17px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-elevated); cursor: pointer; }

/* ───── EOD nudge ───── */
.eod-nudge { display: flex; align-items: center; gap: 11px; padding: 12px 14px; margin-bottom: var(--s-5); border: 1px solid var(--accent-mid); border-radius: var(--r-lg); background: var(--accent-weak); animation: toastIn 240ms var(--ease); }
.eod-nudge .en-ico { color: var(--accent); flex-shrink: 0; }
.eod-nudge .en-text { font-size: 13.5px; font-weight: 560; }
.eod-nudge .en-sp { flex: 1; }
.eod-nudge .en-x { width: 30px; height: 30px; border: 0; background: transparent; }
.eod-nudge .en-x:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ───── briefs ───── */
.brief-card .brief-age { margin-bottom: 4px; }
.brief-card .brief-preview { font-size: 12.5px; color: var(--ink-muted); line-height: 1.5; }
.brief-chip { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--bg-sunken); color: var(--ink-muted); }
.brief-chip.k-friday { background: var(--accent-weak); color: var(--accent); }
.brief-chip.k-monday { background: var(--success-weak); color: var(--success); }
.brief-row { display: flex; align-items: center; gap: 16px; padding: 15px var(--s-5); border-bottom: 1px solid var(--rule); }
.brief-row:last-child { border-bottom: 0; }
.brief-row-main { flex: 1; min-width: 0; cursor: pointer; }
.brief-row-top { display: flex; align-items: center; gap: 10px; }
.brief-row-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.brief-row-prev { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; line-height: 1.45; }
.brief-row-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brief-row-age { white-space: nowrap; }
.brief-dl { width: 32px; height: 32px; }

/* markdown render (brief drawer) */
.md { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.md .md-h2 { font-size: 18px; font-weight: 680; letter-spacing: -0.02em; margin: 4px 0 12px; }
.md .md-h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin: 20px 0 8px; }
.md .md-h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin: 18px 0 7px; }
.md .md-p { margin: 0 0 11px; color: var(--ink-muted); }
.md .md-p strong, .md li strong { color: var(--ink); font-weight: 640; }
.md .md-list { margin: 0 0 12px; padding-left: 20px; color: var(--ink-muted); display: flex; flex-direction: column; gap: 5px; }
.md .md-list li { line-height: 1.5; }

/* ───── project tile add button ───── */
.tile-add { width: 28px; height: 28px; flex-shrink: 0; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--bg-elevated); color: var(--ink-faint); display: grid; place-items: center; transition: all 130ms var(--ease); }
.tile-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-weak); }

/* ───── drawer toolbar (copy-link / add action) ───── */
.drawer-toolbar { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.drawer-toolbar .copy-link .kbd { padding: 1px 5px; font-size: 9.5px; }

/* ───── finance scope ───── */
.fin-scope { display: flex; align-items: center; gap: 14px; margin-bottom: var(--s-5); flex-wrap: wrap; }
.fin-scope-note { font-size: 12px; color: var(--ink-faint); }
.margin-cell.m-good { background: var(--success-weak); }
.margin-cell.m-good .cell-edit, .margin-cell.m-good .num { color: var(--success); }
.margin-cell.m-warn { background: var(--warning-weak); }
.margin-cell.m-warn .cell-edit, .margin-cell.m-warn .num { color: var(--warning); }
.margin-cell.m-bad { background: var(--danger-weak); }
.margin-cell.m-bad .cell-edit, .margin-cell.m-bad .num { color: var(--danger); }

/* ───── decision log groups ───── */
.log-group { margin-bottom: var(--s-5); }
.log-day { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px; }
.log-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.log-actions { display: flex; gap: 5px; opacity: 0; transition: opacity 140ms var(--ease); }
.log-row:hover .log-actions { opacity: 1; }
@media (max-width: 600px) { .log-actions { opacity: 1; } }
/* hash-router flash for #/decisions/:id deep-link targets */
.log-row.flash { animation: logRowFlash 1.4s var(--ease) 1; border-radius: 8px; }
@keyframes logRowFlash {
  0%   { background: var(--accent-mid); }
  55%  { background: var(--accent-weak); }
  100% { background: transparent; }
}
