/* ============================================================
   evalue.ai — Pulse
   Editorial / journal system: Swiss editorial meets a
   well-set financial broadsheet. Numbers-as-hero.
   ============================================================ */

:root,
[data-theme="light"] {
  --bg: #F7F5F0;
  --card: #FCFBF8;
  --ink: #1A1A18;
  --muted: #6B6862;
  --hairline: #E5E1D8;
  --hairline-strong: #D8D3C7;
  --terracotta: #C2683E;
  --terracotta-tint: rgba(194, 104, 62, 0.07);
  --sage: #5B7C63;
  --red: #A8392E;
  --amber: #B8862B;
  --card-shadow: 0 1px 2px rgba(26, 26, 24, 0.03);
  --card-shadow-hover: 0 6px 22px rgba(26, 26, 24, 0.08);
  --warm-tint: rgba(194, 104, 62, 0.035);
}

[data-theme="dark"] {
  --bg: #1B1A17;
  --card: #232118;
  --ink: #EDE8DC;
  --muted: #A39C8C;
  --hairline: #34312A;
  --hairline-strong: #403C32;
  --terracotta: #D17A4E;
  --terracotta-tint: rgba(209, 122, 78, 0.10);
  --sage: #7FA086;
  --red: #C9594C;
  --amber: #D2A648;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --card-shadow-hover: 0 8px 26px rgba(0, 0, 0, 0.35);
  --warm-tint: rgba(209, 122, 78, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  /* Transition only background-color. Transitioning an inherited,
     variable-based `color` leaves the computed value stuck at the old
     ink in some engines, so text color snaps instantly instead. */
  transition: background-color 0.5s ease;
}

/* ---- Type primitives ---- */
.serif {
  font-family: "Newsreader", serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.mono {
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.label {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.sage { color: var(--sage); }
.red { color: var(--red); }
.amber { color: var(--amber); }
.terra { color: var(--terracotta); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: flex;
  width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

/* ---- Left nav ---- */
.nav {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav.collapsed { width: 68px; }
.nav-panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  width: 240px;
  box-sizing: border-box;
  border-right: 1px solid var(--hairline);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 30;
  overflow: hidden;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.24s ease, padding 0.24s ease;
}
.nav.collapsed .nav-panel { width: 68px; padding-left: 14px; padding-right: 14px; }
.nav.collapsed:hover .nav-panel {
  width: 240px;
  padding-left: 20px;
  padding-right: 20px;
  box-shadow: 16px 0 48px -16px rgba(20, 16, 10, 0.28);
  z-index: 60;
}
.brand-block {
  padding: 0 8px 26px;
  border-bottom: 1px solid var(--hairline);
}
.brand {
  font-family: "Newsreader", serif;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 1px;
}
.brand .dot { color: var(--terracotta); }
.workspace {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.workspace .ws-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--bg);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.workspace .ws-name {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.nav-list {
  list-style: none;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  transition: background-color 0.18s ease, color 0.18s ease;
  position: relative;
}
.nav-item:hover {
  background: var(--terracotta-tint);
  color: var(--ink);
}
.nav-item.active {
  background: var(--ink);
  color: var(--bg);
}
.nav-item.active .nav-glyph { border-color: var(--bg); }
.nav-glyph {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  opacity: 0.9;
}
.nav-glyph.g-pulse { border-radius: 50%; }
.nav-glyph.g-flow { border-radius: 2px; transform: rotate(45deg); }
.nav-glyph.g-loop { border-radius: 50%; border-style: dashed; }
.nav-glyph.g-signal { border-radius: 4px 4px 4px 0; }
.nav-glyph.g-interv { border-radius: 50% 50% 50% 2px; }
.nav-label { flex: 1; }
.nav-badge {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--hairline);
  color: var(--muted);
}
.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.16);
  color: var(--bg);
}
.nav-foot {
  margin-top: auto;
  padding: 0 8px;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
}
.nav-foot .label { font-size: 10px; }

/* ---- Content column ---- */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.crumb .sep { color: var(--hairline-strong); }
.crumb .here { color: var(--ink); }
.crumb .prev { color: var(--muted); }
.topbar-spacer { flex: 1; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  width: 230px;
  padding: 0 11px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  background: var(--card);
  cursor: text;
  transition: border-color 0.18s ease;
}
.search:hover { border-color: var(--hairline-strong); }
.search .search-icon {
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.search .search-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  background: currentColor;
  bottom: -1px;
  right: -3px;
  transform: rotate(45deg);
}
.search .kbd {
  margin-left: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--hairline);
  border-radius: 5px;
}

.btn-new {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--terracotta);
  color: #fff;
  border: none;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.1s ease;
}
.btn-new:hover { filter: brightness(1.06); }
.btn-new:active { transform: translateY(1px); }
.btn-new .plus { font-size: 15px; line-height: 1; font-weight: 500; }

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--card);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: border-color 0.18s ease, background-color 0.3s ease;
}
.theme-toggle:hover { border-color: var(--hairline-strong); }
.theme-toggle .tm {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  position: relative;
  transition: all 0.4s ease;
}
[data-theme="light"] .theme-toggle .tm {
  background: transparent;
  border: 1.5px solid var(--ink);
  box-shadow: inset -4px -4px 0 0 var(--ink);
}
[data-theme="dark"] .theme-toggle .tm {
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Body: main + rail ---- */
.layout {
  display: flex;
  align-items: flex-start;
}
.main {
  flex: 1;
  padding: 40px 36px 64px;
  min-width: 0;
}
.rail {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--hairline);
  padding: 36px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 64px;
  align-self: flex-start;
}

/* ============================================================
   Hero header
   ============================================================ */
.hero {
  margin-bottom: 38px;
}
.hero .eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 9px;
  align-items: center;
}
.hero .eyebrow .live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 0 var(--sage);
  animation: pulse-dot 2.4s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sage) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero h1 {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: 47px;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 16px 0 0;
  max-width: 17ch;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--terracotta); font-style: italic; }
.hero .sub {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero .sub p {
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.4;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--terracotta);
  color: var(--terracotta);
  border-radius: 7px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--terracotta-tint);
}
.chip .chip-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--terracotta);
}

/* ============================================================
   Cards (shared)
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

/* ---- Stat cards ---- */
.section-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-rule .label { white-space: nowrap; }
.section-rule .line {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.stat-card {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  min-height: 158px;
}
.stat-card .stat-label {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.3;
}
.stat-card .stat-value {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-value .unit {
  font-size: 22px;
  color: var(--muted);
  margin-left: 1px;
}
.stat-card .stat-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-delta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-note {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}
.sparkline-wrap { margin-top: 12px; height: 30px; }
.sparkline { display: block; overflow: visible; }
.spark-path {
  fill: none;
  stroke: var(--sage);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
}
.spark-dot {
  fill: var(--sage);
  opacity: 0;
}
.reveal-spark .spark-path {
  animation: draw 1.1s 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.reveal-spark .spark-dot {
  animation: dot-in 0.3s 1.5s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot-in { to { opacity: 1; } }

/* ---- Department cards ---- */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.dept-card {
  padding: 26px 26px 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s ease, border-color 0.22s ease,
              background-color 0.3s ease;
}
.dept-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--terracotta);
  background:
    linear-gradient(0deg, var(--warm-tint), var(--warm-tint)),
    var(--card);
}
.dept-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.dept-head .dept-name {
  font-family: "Newsreader", serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.dept-head .dept-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}
.trend-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--sage) 12%, transparent);
  color: var(--sage);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.dept-lead {
  margin-top: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.dept-pain {
  font-family: "Newsreader", serif;
  font-size: 23px;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 22px 0 20px;
  max-width: 22ch;
  text-wrap: pretty;
}
.dept-pain .hl {
  background: linear-gradient(transparent 62%, var(--terracotta-tint) 0);
  padding: 0 1px;
}

/* Segment bar */
.segbar {
  margin-bottom: 22px;
}
.segbar .seg-track {
  display: flex;
  height: 10px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
  background: transparent;
}
.segbar .seg {
  height: 100%;
  border-radius: 2px;
  transition: opacity 0.18s ease;
}
.dept-card:hover .seg:not(.seg-key) { opacity: 0.78; }
.segbar .seg-legend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.seg-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}
.seg-leg-item .sw {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.seg-leg-item .pct { color: var(--ink); font-variant-numeric: tabular-nums; }
.seg-leg-item.key .pct { color: var(--terracotta); }

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--hairline);
}
.mini-metric {
  padding: 16px 14px 18px;
  border-right: 1px solid var(--hairline);
}
.mini-metric:last-child { border-right: none; }
.mini-metric .mm-label {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 9.5px;
  color: var(--muted);
  line-height: 1.35;
}
.mini-metric .mm-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  margin-top: 7px;
  letter-spacing: -0.01em;
}
.mini-metric .mm-value .mm-unit {
  font-size: 12px; color: var(--muted); margin-left: 2px;
}

.dept-foot {
  border-top: 1px solid var(--hairline);
  padding: 14px 0 16px;
  margin-top: 0;
}
.dept-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--terracotta);
  font-size: 13.5px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "IBM Plex Sans", sans-serif;
  transition: gap 0.18s ease;
}
.dept-card:hover .dept-link { gap: 11px; }
.dept-link .arrow { transition: transform 0.18s ease; }

/* ============================================================
   Right rail cards
   ============================================================ */
.rail-card {
  padding: 18px 18px 8px;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.rail-head .rh-title {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}
.rail-head .rh-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--hairline);
  color: var(--muted);
}

.attn-row {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: padding-left 0.18s ease;
}
.attn-row:last-child { border-bottom: none; }
.attn-row:hover { padding-left: 4px; }
.attn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.attn-dot.red { background: var(--red); }
.attn-dot.amber { background: var(--amber); }
.attn-dot.sage { background: var(--sage); }
.attn-body .attn-title {
  font-family: "Newsreader", serif;
  font-size: 16px;
  line-height: 1.28;
  letter-spacing: -0.005em;
}
.attn-body .attn-detail {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}

.signal-row {
  display: flex;
  gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.signal-row:last-child { border-bottom: none; }
.signal-row.fresh { animation: fade-up 0.6s ease both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.sig-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--hairline);
  color: var(--muted);
  display: grid; place-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-top: 1px;
}
.sig-body { min-width: 0; }
.sig-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: flex;
  gap: 7px;
}
.sig-quote {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.32;
  margin-top: 5px;
  color: var(--ink);
}
.sig-time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: auto;
}

.loop-card { padding: 18px; }
.loop-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.loop-id {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11.5px;
}
.loop-id .day { color: var(--terracotta); }
.loop-pct {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.loop-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--hairline);
  margin: 12px 0 12px;
  overflow: hidden;
}
.loop-fill {
  height: 100%;
  background: var(--terracotta);
  border-radius: 3px;
  width: 0;
  transition: width 1.2s 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.loop-next {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.loop-next .ln-mark { color: var(--ink); }

/* ============================================================
   Staggered load reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .spark-path { stroke-dashoffset: 0; animation: none; }
  .spark-dot { opacity: 1; animation: none; }
  .loop-fill { transition: none; }
}

/* ============================================================
   SIGNALS screen
   ============================================================ */
.sig-main {
  flex: 1;
  padding: 40px 44px 72px;
  min-width: 0;
}

/* reassurance chip — sage border variant */
.chip.sage-chip {
  border-color: var(--sage);
  color: var(--sage);
  background: color-mix(in srgb, var(--sage) 8%, transparent);
}
.chip.sage-chip .chip-dot { background: var(--sage); }

/* hero variant: wider headline for Signals */
.hero h1.sig-h1 { max-width: 20ch; }

/* ---- Two-column layout ---- */
.sig-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 36px;
}
.sig-col-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.sig-col-rule .label { white-space: nowrap; }
.sig-col-rule .line { flex: 1; height: 1px; background: var(--hairline); }

.panel-stack { display: flex; flex-direction: column; gap: 24px; }

/* ---- Ranked survey bars ---- */
.rank-list { display: flex; flex-direction: column; gap: 24px; }
.rank-row { display: flex; flex-direction: column; gap: 12px; }
.rank-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  row-gap: 4px;
  flex-wrap: wrap;
}
.rank-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  width: 16px;
  flex-shrink: 0;
}
.rank-label {
  font-family: "Newsreader", serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}
.dept-pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  color: var(--muted);
  white-space: nowrap;
  align-self: center;
}
.rank-pct {
  margin-left: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.rank-track {
  height: 8px;
  border-radius: 4px;
  background: var(--hairline);
  overflow: hidden;
  margin-left: 28px;
}
.rank-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--terracotta);
  width: 0;
  transition: width 1.05s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--bar-delay, 0s);
}
.rank-row:not(.lead) .rank-fill { background: var(--hairline-strong); }
.rank-row.lead .rank-label { color: var(--ink); }

/* ---- Featured verbatim quote ---- */
.quote-card {
  padding: 30px 32px 26px;
  position: relative;
  overflow: hidden;
}
.quote-card .hung {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: 92px;
  line-height: 0.7;
  color: var(--terracotta);
  opacity: 0.32;
  position: absolute;
  top: 22px;
  left: 24px;
  user-select: none;
}
.quote-card .quote-text {
  font-family: "Newsreader", serif;
  font-size: 27px;
  line-height: 1.32;
  letter-spacing: -0.012em;
  font-weight: 400;
  position: relative;
  padding-left: 38px;
  text-wrap: pretty;
}
.quote-card .quote-foot {
  margin-top: 22px;
  padding-left: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.quote-attr {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.outcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--sage) 13%, transparent);
  color: var(--sage);
}

/* ---- Intent vs reality (fusion) ---- */
.fusion-card { padding: 22px 24px 20px; }
.fusion-head {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10.5px;
  color: var(--muted);
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.fusion-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.fusion-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}
.fusion-tag.said { color: var(--muted); }
.fusion-tag.measured { color: var(--terracotta); }
.fusion-body { min-width: 0; }
.fusion-text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 8px;
}
.fusion-text .q { color: var(--muted); }
.fusion-text .strong { color: var(--ink); }
.fusion-mini {
  height: 6px;
  border-radius: 3px;
  background: var(--hairline);
  overflow: hidden;
}
.fusion-mini .fm {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 1s 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.fusion-mini .fm.said { background: var(--hairline-strong); }
.fusion-mini .fm.measured { background: var(--terracotta); }
.fusion-caption {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}
.fusion-caption .lead-word { color: var(--ink); }

/* ---- Retro panel ---- */
.retro-card { padding: 22px 22px 8px; }
.retro-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.retro-head .rt-title {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
}
.retro-head .rt-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
}
.gap-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}
.gap-row:last-of-type { border-bottom: none; }
.gap-name {
  font-family: "Newsreader", serif;
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.gap-assist {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.gap-assist .ga-arrow { color: var(--terracotta); flex-shrink: 0; }
.gap-assist .owner { color: var(--ink); }
.gap-action { margin-top: 13px; }
.queue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--terracotta);
  background: transparent;
  color: var(--terracotta);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease,
              border-color 0.25s ease, transform 0.08s ease;
}
.queue-btn:hover { background: var(--terracotta-tint); }
.queue-btn:active { transform: scale(0.97); }
.queue-btn .qb-arrow { transition: transform 0.18s ease; }
.queue-btn:hover .qb-arrow { transform: translateX(3px); }

.queue-btn.queued {
  border-color: var(--sage);
  background: color-mix(in srgb, var(--sage) 13%, transparent);
  color: var(--sage);
  cursor: default;
  pointer-events: none;
}
.queue-btn.queued .qb-arrow { display: none; }
.queue-btn .qb-check {
  width: 13px; height: 13px;
  display: inline-grid;
  place-items: center;
}
.queue-btn .qb-check svg { display: block; }
.queue-btn.pop { animation: qb-pop 0.34s cubic-bezier(0.22, 1.4, 0.4, 1); }
@keyframes qb-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* in-loop (already committed) state */
.queue-btn.inloop {
  border-style: dashed;
  border-color: var(--terracotta);
  background: var(--terracotta-tint);
  color: var(--terracotta);
  cursor: default;
  pointer-events: none;
}
.queue-btn.inloop .qb-arrow { display: none; }

.retro-foot {
  border-top: 1px solid var(--hairline);
  padding: 15px 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .rank-fill, .fusion-mini .fm { transition: none; }
}

/* ============================================================
   Collapsible sidebar + interactivity polish (shared)
   ============================================================ */
.nav-label, .brand, .ws-name, .nav-foot .label, .nc-label { white-space: nowrap; }

/* collapse toggle */
.nav-collapse {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px; margin-bottom: 10px;
  border: 1px solid var(--hairline); border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12.5px; cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease, transform 0.1s ease;
}
.nav-collapse:hover { border-color: var(--hairline-strong); color: var(--ink); background: var(--terracotta-tint); }
.nav-collapse:active { transform: scale(0.98); }
.nc-icon { position: relative; width: 15px; height: 15px; flex-shrink: 0; border: 1.5px solid currentColor; border-radius: 3px; }
.nc-icon::before { content: ""; position: absolute; top: 1.5px; bottom: 1.5px; left: 4.5px; border-left: 1.5px solid currentColor; }
.nc-icon.is-collapsed::after { content: "›"; position: absolute; left: 4.5px; top: -3px; font-size: 12px; line-height: 1; }

/* collapsed (not hovered): center glyphs, clip handles the labels */
.nav.collapsed:not(:hover) .nav-item { gap: 0; justify-content: center; padding-left: 0; padding-right: 0; }
.nav.collapsed:not(:hover) .nav-collapse { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.nav.collapsed:not(:hover) .workspace { justify-content: center; }

/* interactivity polish */
.search, .btn-new, .nav-collapse { font-family: inherit; }
.avatar { transition: transform 0.16s ease, box-shadow 0.16s ease; cursor: pointer; }
.avatar:hover { transform: translateY(-1px); box-shadow: 0 0 0 3px var(--terracotta-tint); }
.btn-new:active { transform: translateY(1px) scale(0.98); }
.theme-toggle { transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.1s ease; }
.theme-toggle:hover { background: var(--terracotta-tint); }
.theme-toggle:active { transform: scale(0.94); }
.search { transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.1s ease; }
.search:active { transform: scale(0.99); }
.nav-item:active { transform: scale(0.985); }
.dept-card { transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.dept-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(20, 16, 10, 0.32); }

/* focus-visible accessibility */
.nav-item:focus-visible, .btn-new:focus-visible, .search:focus-visible,
.theme-toggle:focus-visible, .nav-collapse:focus-visible, .dept-link:focus-visible,
.queue-btn:focus-visible, .avatar:focus-visible {
  outline: 2px solid var(--terracotta); outline-offset: 2px;
}
