/* NEIIA Deal Room - Terminal (workspace) dark theme
   Loaded on top of custom.css for /room/*.html pages only.
   Marketing pages keep their light look. */

:root {
  /* Warmer, editorial surfaces — was cool gray, now matches the marketing site */
  --bg-base: #FFFFFF;
  --bg-panel: #FBFAF6;          /* cream */
  --bg-panel-elev: #F4F2EC;     /* warm muted */
  --bg-row-hover: #FBFAF6;
  --border-t: #E7E5E0;          /* warm hairline */
  --border-t-soft: #EFEDE6;
  --text-primary: #0A0A0A;
  --text-secondary: #5C5650;
  --text-muted: #8E867B;
  /* Brand accent — Nigerian green. Red (#E04F39 / --down / --warn) reserved for danger states only. */
  --accent: #0E7A3C;
  --accent-hover: #0A5C2D;
  --accent-soft: #E6F3EB;
  --up: #15803D;
  --down: #B91C1C;
  --warn: #92400E;
  --info: #1F2937;
  /* JetBrains Mono retired. The workspace now uses Inter throughout — labels,
     eyebrows, dates, badges, AND number columns. Number alignment is preserved via
     "tnum" / "zero" font features (tabular numerals). The --mono/--num names are
     kept so existing inline styles keep working without an HTML sweep. */
  --mono: "Inter", "SF Pro Text", system-ui, -apple-system, sans-serif;
  --num:  "Inter", "SF Pro Text", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", "GT Super", Georgia, serif;
}

html.terminal, html.terminal body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--db-font-sans);
}

html.terminal {
  --db-text: var(--text-primary);
  --db-text-muted: var(--text-secondary);
  --db-text-faint: var(--text-muted);
  --db-ink: var(--text-primary);
  --db-ink-soft: var(--accent);
  --db-surface: var(--bg-base);
  --db-surface-muted: var(--bg-panel);
  --db-surface-sunken: var(--bg-panel-elev);
  --db-border: var(--border-t);
  --db-border-soft: var(--border-t-soft);
}

/* Tabular numerals on body so even Inter-rendered numbers line up */
html.terminal, html.terminal body { font-feature-settings: "tnum", "zero"; }

/* Anywhere inline-styled with var(--mono) now renders Inter with tabular numerals.
   For true monospace (table numbers, code-y bits), use class="num" or class="db-num". */
html.terminal .mono { font-family: var(--mono); font-feature-settings: "tnum", "zero"; letter-spacing: 0; }
html.terminal .num,
html.terminal .db-num { font-family: var(--num); font-feature-settings: "tnum", "zero"; font-variant-numeric: tabular-nums; }

/* Workspace layout */
html.terminal .app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header header"
    "side   main";
  min-height: 100vh;
  background: var(--bg-base);
}
@media (max-width: 900px) {
  html.terminal .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }
}

/* Global header */
.t-header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-t);
  position: sticky;
  top: 0;
  z-index: 30;
}
.t-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.t-header .brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--accent);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--mono);
  font-size: 13px;
}
.t-header .brand-text {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.t-header .brand-text .accent { color: var(--accent); }

.t-header .header-spacer { flex: 1; }
.t-header .icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.t-header .icon-btn:hover { background: var(--bg-panel-elev); color: var(--text-primary); border-color: var(--border-t); }
.t-header .icon-btn .badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.t-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-t);
  color: var(--text-primary);
  cursor: pointer;
}
.t-profile-btn:hover { background: var(--bg-panel-elev); }
.t-profile-btn .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.t-profile-btn .caret { color: var(--text-muted); }

/* Dropdown menus */
.t-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  padding: 6px;
  z-index: 60;
  display: none;
}
.t-menu.is-open { display: block; }
.t-menu a, .t-menu button {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.t-menu a:hover, .t-menu button:hover {
  background: var(--bg-panel-elev);
  color: var(--accent);
}
.t-menu .menu-sep {
  height: 1px;
  background: var(--border-t);
  margin: 4px 0;
}
.t-menu .menu-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 10px 2px;
}

.t-popover {
  position: absolute;
  min-width: 200px;
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.6);
  padding: 6px;
  z-index: 9991;
}
.t-popover button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.t-popover button:hover {
  background: var(--bg-panel-elev);
  color: var(--accent);
}
.t-popover button.danger:hover { color: var(--down); }

/* Ticker strip */
.t-ticker {
  grid-area: ticker;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-t);
  height: 30px;
  overflow: hidden;
  position: relative;
  z-index: 10;
}
.t-ticker .track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  height: 30px;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}
.t-ticker:hover .track { animation-play-state: paused; }
.t-ticker .tick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-primary);
  border-right: 1px solid var(--border-t-soft);
}
.t-ticker .tick .sym { color: var(--text-secondary); letter-spacing: 0.06em; }
.t-ticker .tick .last { color: var(--text-primary); }
.t-ticker .tick.up    .chg { color: var(--up); }
.t-ticker .tick.down  .chg { color: var(--down); }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Command bar */
.t-cmd {
  grid-area: cmd;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-t);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  position: sticky;
  top: 30px;
  z-index: 20;
}
.t-cmd .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}
.t-cmd input {
  flex: 1;
  height: 30px;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0 10px;
  letter-spacing: 0.04em;
}
.t-cmd input:focus {
  outline: 1px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.t-cmd input::placeholder { color: var(--text-muted); }
.t-cmd .hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.t-cmd kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  color: var(--text-secondary);
}

/* Sidebar */
html.terminal .workspace-nav {
  grid-area: side;
  background: #FFFFFF;
  color: var(--text-secondary);
  padding: 16px 12px;
  border-right: 1px solid var(--border-t);
  position: sticky;
  top: 124px; /* header(48) + ticker(30) + cmd(46) */
  height: calc(100vh - 124px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (max-width: 900px) {
  html.terminal .workspace-nav {
    grid-area: main;
    display: none;
  }
  html.terminal .workspace-nav.is-mobile-open {
    display: flex;
    position: fixed;
    inset: 124px 0 0 0;
    height: auto;
    z-index: 40;
  }
}

html.terminal .workspace-nav .nav-brand-block { display: none; }
html.terminal .workspace-nav a,
html.terminal .workspace-nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, color 120ms ease;
}
html.terminal .workspace-nav a:hover,
html.terminal .workspace-nav button:hover {
  background: var(--bg-panel-elev);
  color: var(--text-primary);
}
html.terminal .workspace-nav a.is-active {
  background: var(--bg-panel-elev);
  color: var(--accent);
  border-left-color: var(--accent);
}
html.terminal .workspace-nav .nav-section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 14px 14px 4px;
  border: 0;
}
html.terminal .workspace-nav .nav-spacer { flex: 1; min-height: 8px; }
html.terminal .workspace-nav .acct {
  padding: 10px 14px;
  border-top: 1px solid var(--border-t);
  margin-top: 8px;
}
html.terminal .workspace-nav .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
}

/* Main content area */
html.terminal .workspace-content {
  grid-area: main;
  padding: 20px 24px 64px;
  background: var(--bg-base);
  min-width: 0;
}
@media (max-width: 640px) {
  html.terminal .workspace-content { padding: 16px 14px 48px; }
}

/* Panels */
html.terminal .panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: 4px;
}
html.terminal .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-t);
  background: #11151C;
}
html.terminal .panel-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}
html.terminal .panel-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}
html.terminal .panel-body { padding: 14px; }

/* KPI tiles */
html.terminal .kpi-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
  position: relative;
}
html.terminal .kpi-card .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0;
}
html.terminal .kpi-card .value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
html.terminal .kpi-card .delta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  margin: 0;
}
html.terminal .delta-up,
html.terminal .up   { color: var(--up) !important; }
html.terminal .delta-down,
html.terminal .down { color: var(--down) !important; }

html.terminal .kpi-card .kpi-spark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 80px;
  height: 28px;
  opacity: 0.85;
}

/* Tables */
html.terminal .db-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
html.terminal .db-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-t);
  background: #11151C;
  cursor: pointer;
  user-select: none;
}
html.terminal .db-table thead th.no-sort { cursor: default; }
html.terminal .db-table thead th.text-right { text-align: right; }
html.terminal .db-table thead th .arrow {
  display: inline-block;
  margin-left: 4px;
  color: var(--accent);
  opacity: 0;
  font-family: var(--mono);
}
html.terminal .db-table thead th.sorted-asc .arrow,
html.terminal .db-table thead th.sorted-desc .arrow { opacity: 1; }

html.terminal .db-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-t-soft);
  color: var(--text-primary);
  vertical-align: middle;
  background: var(--bg-panel);
}
html.terminal .db-table tbody td.num,
html.terminal .db-table tbody td.text-right { text-align: right; font-family: var(--mono); }
html.terminal .db-table tbody tr:hover td { background: var(--bg-row-hover); }
html.terminal .db-table a { color: var(--text-primary); text-decoration: none; }
html.terminal .db-table a:hover { color: var(--accent); }

/* Badges */
html.terminal .badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--bg-panel-elev);
  border: 1px solid var(--border-t);
  color: var(--text-secondary);
  white-space: nowrap;
}
html.terminal .badge-success { background: rgba(22,163,74,0.12); color: var(--up); border-color: rgba(22,163,74,0.3); }
html.terminal .badge-warning { background: rgba(245,158,11,0.12); color: var(--warn); border-color: rgba(245,158,11,0.3); }
html.terminal .badge-info    { background: rgba(59,130,246,0.12); color: var(--info); border-color: rgba(59,130,246,0.3); }
html.terminal .badge-danger  { background: rgba(220,38,38,0.12); color: var(--down); border-color: rgba(220,38,38,0.3); }

/* Lane chips — v3 product-mode classifier */
.lane-chip,
html.terminal .lane-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.lane-chip.lane-a { background: rgba(224,79,57,0.10); color: #B43A28; border-color: rgba(224,79,57,0.32); }
.lane-chip.lane-b { background: rgba(201,162,39,0.12); color: #8A6F1A; border-color: rgba(201,162,39,0.34); }
.lane-chip.lane-fund { background: rgba(15,23,42,0.06); color: #334155; border-color: rgba(15,23,42,0.15); }

/* Allocation cell — bar + percent */
.alloc-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.alloc-bar  { position: relative; flex: 1; height: 6px; background: rgba(15,23,42,0.08); border-radius: 999px; overflow: hidden; }
.alloc-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width 240ms ease; }
.alloc-fill.mid  { background: #94a3b8; }
.alloc-fill.hot  { background: #16a34a; }
.alloc-fill.over { background: #E04F39; }
.alloc-pct  { font-family: var(--mono, ui-monospace, monospace); font-size: 11px; color: var(--text-secondary, #475569); min-width: 32px; text-align: right; }

/* Hover tooltip — uses [data-tip] attribute, native title= still set for screenreaders */
[data-tip] { position: relative; }
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 60;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0A0A0A;
  color: #FBFAF6;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--sans, system-ui, sans-serif);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  text-align: left;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  pointer-events: none;
  animation: tipFade 120ms ease-out;
}
[data-tip]:hover::before,
[data-tip]:focus-visible::before {
  content: '';
  position: absolute;
  z-index: 60;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0A0A0A;
  pointer-events: none;
}
@keyframes tipFade { from { opacity: 0; transform: translateX(-50%) translateY(4px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
/* Suppress browser tooltip while CSS one is showing */
[data-tip]:hover { /* keeps title for a11y; the duplicate native bubble is acceptable */ }

/* Subscription modal (v3 Lane A/B Invest flow) */
.sub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-t, #E7E5E0); margin-bottom: 14px; }
.sub-ticker { font-family: var(--mono, ui-monospace, monospace); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; color: #0A0A0A; }
.sub-legal  { font-size: 13px; color: var(--text-secondary, #475569); margin-top: 2px; }
.sub-chips  { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.wrap-chip  { display: inline-flex; padding: 3px 8px; border-radius: 4px; background: rgba(15,23,42,0.06); color: #334155; font-family: var(--mono, ui-monospace, monospace); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; border: 1px solid rgba(15,23,42,0.12); }
.sub-grid   { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; margin-bottom: 14px; }
.sub-grid label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-bottom: 3px; }
.sub-val    { font-family: var(--mono, ui-monospace, monospace); font-size: 14px; color: #0A0A0A; font-weight: 600; }
.sub-callout { padding: 10px 12px; border-radius: 6px; font-size: 12px; line-height: 1.45; margin-bottom: 14px; }
.sub-callout.ok   { background: rgba(22,163,74,0.08);  border: 1px solid rgba(22,163,74,0.25); color: #166534; }
.sub-callout.warn { background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.30); color: #92400E; }
.sub-form label   { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary, #475569); font-weight: 600; margin-bottom: 5px; }
.sub-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 12px; line-height: 1.45; color: var(--text-secondary, #475569); text-transform: none; letter-spacing: 0; font-weight: 400; cursor: pointer; }
.sub-check input { margin-top: 2px; flex-shrink: 0; }

/* Tier-cap annual aggregate counter (v3 Part 5) */
.sub-annual { padding: 10px 12px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 6px; background: var(--bg-panel-elev, #FBFAF6); margin-bottom: 14px; }
.sub-annual-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary, #475569); margin-bottom: 6px; }
.sub-annual-row strong { font-family: var(--mono, ui-monospace, monospace); color: #0A0A0A; }
.sub-annual-bar { position: relative; height: 5px; background: rgba(15,23,42,0.08); border-radius: 3px; overflow: hidden; }
.sub-annual-bar span { display: block; height: 100%; background: #0A0A0A; border-radius: 3px; transition: width 240ms ease; }
.sub-annual-foot { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 6px; }
.sub-annual-foot strong { color: #0A0A0A; font-family: var(--mono, ui-monospace, monospace); }

/* NIBSS payment instruction modal (v3 Part 11) */
.pay-wrap { font-family: var(--sans, system-ui, sans-serif); }
.pay-banner { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 6px; background: rgba(22,163,74,0.08); color: #15803D; border: 1px solid rgba(22,163,74,0.25); font-size: 12.5px; line-height: 1.45; margin-bottom: 14px; }
.pay-banner svg { flex-shrink: 0; color: #15803D; }
.pay-grid { display: flex; flex-direction: column; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.pay-row { display: grid; grid-template-columns: 160px 1fr; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); align-items: center; font-size: 13px; }
.pay-row:last-child { border-bottom: 0; }
.pay-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.pay-v { color: #0A0A0A; }
.pay-amt { font-family: var(--mono, ui-monospace, monospace); font-size: 16px; font-weight: 700; }
.pay-mono { font-family: var(--mono, ui-monospace, monospace); }
.pay-ref { display: flex; align-items: center; gap: 8px; }
.pay-ref code { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; padding: 4px 8px; background: var(--bg-panel-elev, #FBFAF6); border: 1px solid var(--border-t, #E7E5E0); border-radius: 4px; color: #0A0A0A; letter-spacing: 0.04em; word-break: break-all; }
.pay-ref .t-btn { height: 26px; padding: 0 10px; font-size: 11px; }
.pay-note { padding: 10px 12px; border-radius: 6px; background: var(--bg-panel-elev, #FBFAF6); font-size: 12px; line-height: 1.5; color: var(--text-secondary, #475569); margin-bottom: 10px; }
.pay-note:last-child { margin-bottom: 0; }
.pay-note strong { color: #0A0A0A; }
.pay-note-warn { background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.22); color: #92400E; }
.pay-note-warn strong { color: #92400E; }

/* PIN pad — 6-digit transaction PIN per v3 */
.pin-wrap     { max-width: 280px; margin: 0 auto; padding: 4px 0 8px; }
.pin-subtitle { font-size: 12px; color: var(--text-secondary, #475569); line-height: 1.5; text-align: center; margin-bottom: 18px; }
.pin-cells    { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.pin-cell     { width: 36px; height: 44px; border-radius: 6px; border: 1.5px solid var(--border-t, #E7E5E0); background: #FBFAF6; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #0A0A0A; transition: border-color 120ms ease, transform 80ms ease; font-family: var(--mono, ui-monospace, monospace); }
.pin-cell.filled { border-color: #0A0A0A; background: #FFFFFF; transform: translateY(-1px); }
.pin-pad      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.pin-key      { height: 46px; border-radius: 6px; border: 1px solid var(--border-t, #E7E5E0); background: #FFFFFF; font-size: 18px; font-weight: 500; color: #0A0A0A; cursor: pointer; font-family: var(--sans, system-ui, sans-serif); transition: background 120ms ease, border-color 120ms ease, transform 60ms ease; }
.pin-key:hover { background: #F4F2EC; border-color: #0A0A0A; }
.pin-key:active { transform: scale(0.97); background: #EDEAE1; }
.pin-key-back  { background: #FBFAF6; font-size: 16px; }
.pin-help      { font-size: 11px; color: var(--text-muted, #94a3b8); text-align: center; line-height: 1.5; }
.pin-error     { font-size: 12px; color: #B43A28; text-align: center; padding: 8px 12px; margin: 0 0 10px; background: rgba(224,79,57,0.06); border: 1px solid rgba(224,79,57,0.22); border-radius: 6px; font-weight: 500; }

/* Bilateral Subscription Agreement preview */
.agreement     { font-family: var(--sans, system-ui, sans-serif); color: #0A0A0A; max-height: 60vh; overflow-y: auto; padding-right: 8px; }
.agr-head      { padding-bottom: 14px; border-bottom: 1px solid var(--border-t, #E7E5E0); margin-bottom: 14px; }
.agr-eyebrow   { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted, #94a3b8); margin-bottom: 6px; }
.agr-title     { font-family: var(--serif, Georgia, serif); font-size: 22px; line-height: 1.15; }
.agr-meta      { font-size: 11px; color: var(--text-secondary, #475569); margin-top: 6px; }
.agr-section   { margin-bottom: 16px; }
.agr-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary, #475569); font-weight: 700; margin-bottom: 8px; }
.agr-section ul { list-style: none; padding: 0; margin: 0; font-size: 12.5px; line-height: 1.6; }
.agr-section ul li { padding: 3px 0; }
.agr-section ul li strong { color: var(--text-muted, #6b7280); font-weight: 600; min-width: 140px; display: inline-block; }
.agr-section p { font-size: 12.5px; line-height: 1.6; color: var(--text-secondary, #475569); margin: 0; }
.agr-risk { background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.20); border-radius: 6px; padding: 12px 14px; }
.agr-risk h4 { color: #92400E; }
.agr-sig  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 12px; }
.agr-sig > div { padding: 12px; background: var(--bg-panel-elev, #FBFAF6); border: 1px dashed var(--border-t, #E7E5E0); border-radius: 4px; }
.agr-sig em { color: var(--text-muted, #94a3b8); font-size: 11px; }

/* Portfolio bucket tabs (v3 Part 19J) */
.pf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-t, #E7E5E0); margin: 6px 0 8px; flex-wrap: wrap; }
.pf-tab  { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 500; color: var(--text-secondary, #475569); cursor: pointer; transition: color 120ms ease, border-color 120ms ease; font-family: var(--sans, system-ui, sans-serif); }
.pf-tab:hover { color: #0A0A0A; }
.pf-tab.is-active { color: #0A0A0A; border-bottom-color: #0A0A0A; font-weight: 600; }
.pf-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--bg-panel-elev, #F4F2EC); color: var(--text-secondary, #475569); font-size: 10px; font-family: var(--mono, ui-monospace, monospace); font-weight: 600; }
.pf-tab.is-active .pf-tab-count { background: #0A0A0A; color: #FFFFFF; }
.pf-tabhint { font-size: 12px; color: var(--text-muted, #94a3b8); margin: 0 0 14px; }

/* Header verification pill + tier pill */
.t-verify-pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid transparent; font-family: var(--sans, system-ui, sans-serif); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; transition: background 120ms ease, color 120ms ease, border-color 120ms ease; margin-right: 4px; }
.t-verify-pill.is-verified   { background: rgba(22,163,74,0.10);  color: #15803D; border-color: rgba(22,163,74,0.30); }
.t-verify-pill.is-verified:hover { background: rgba(22,163,74,0.16); }
.t-verify-pill.is-unverified { background: rgba(224,79,57,0.10); color: #B43A28; border-color: rgba(224,79,57,0.30); }
.t-verify-pill.is-unverified:hover { background: rgba(224,79,57,0.16); }

.t-tier-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; font-family: var(--mono, ui-monospace, monospace); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; border: 1px solid transparent; margin-right: 8px; cursor: help; }
.t-tier-pill.t-tier-1 { background: rgba(15,23,42,0.06);  color: #334155; border-color: rgba(15,23,42,0.15); }
.t-tier-pill.t-tier-2 { background: rgba(59,130,246,0.10);color: #1D4ED8; border-color: rgba(59,130,246,0.28); }
.t-tier-pill.t-tier-3 { background: rgba(201,162,39,0.14);color: #7C5E12; border-color: rgba(201,162,39,0.40); }

/* Paywall modal */
.pw-wrap     { max-width: 560px; }
.pw-lede     { font-size: 13px; color: var(--text-secondary, #475569); line-height: 1.55; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-t, #E7E5E0); }
.pw-switch   { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.pw-switch-btn { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; border: 1.5px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; text-align: left; }
.pw-switch-btn:hover { border-color: #0A0A0A; }
.pw-switch-btn.is-active { border-color: #0A0A0A; background: var(--bg-panel-elev, #FBFAF6); }
.pw-switch-btn strong { font-size: 13px; color: #0A0A0A; font-weight: 600; }
.pw-switch-btn span   { font-size: 11px; color: var(--text-secondary, #475569); line-height: 1.4; }

.pw-grid     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pw-card     { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: 8px; border: 1.5px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; text-align: left; font-family: var(--sans, system-ui, sans-serif); transition: border-color 120ms ease, transform 80ms ease, background 120ms ease; }
.pw-card:hover { border-color: #0A0A0A; transform: translateY(-1px); }
.pw-card.is-selected { border-color: #0A0A0A; background: var(--bg-panel-elev, #FBFAF6); box-shadow: inset 0 0 0 1px #0A0A0A; }
.pw-card-head   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pw-card-cycle  { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.pw-card-save   { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: rgba(22,163,74,0.12); color: #166534; font-weight: 600; }
.pw-card-price  { font-size: 22px; font-weight: 700; color: #0A0A0A; line-height: 1.1; font-family: var(--mono, ui-monospace, monospace); }
.pw-card-usd    { font-size: 11px; color: var(--text-secondary, #475569); }
.pw-card-foot   { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 6px; }
.pw-foot-note   { font-size: 11px; color: var(--text-muted, #94a3b8); line-height: 1.5; padding: 8px 0; }
.pw-details     { margin-top: 10px; font-size: 12px; }
.pw-details summary { cursor: pointer; color: var(--text-secondary, #475569); font-weight: 500; padding: 6px 0; }
.pw-includes    { margin: 8px 0 0 20px; padding: 0; font-size: 12px; line-height: 1.7; color: var(--text-secondary, #475569); }
.pw-includes li { margin-bottom: 2px; }

/* Tier-upgrade modal */
.tier-wrap     { max-width: 480px; }
.tier-meta     { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border-t, #E7E5E0); margin-bottom: 14px; flex-wrap: wrap; }
.tier-from-to  { display: inline-flex; align-items: center; gap: 8px; }
.tier-arrow    { color: var(--text-muted, #94a3b8); font-size: 16px; }
.tier-reason   { font-size: 12px; color: var(--text-secondary, #475569); flex: 1; min-width: 200px; }
.tier-lede     { font-size: 12px; color: var(--text-secondary, #475569); line-height: 1.55; margin-bottom: 14px; }
.tier-opts     { display: flex; flex-direction: column; gap: 8px; }
.tier-opt      { text-align: left; padding: 12px 14px; border-radius: 8px; border: 1.5px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; font-family: var(--sans, system-ui, sans-serif); }
.tier-opt:hover { border-color: #0A0A0A; }
.tier-opt.is-selected { border-color: #0A0A0A; background: var(--bg-panel-elev, #FBFAF6); }
.tier-opt-head { display: flex; align-items: center; gap: 10px; }
.tier-opt-head strong { font-size: 13px; color: #0A0A0A; font-weight: 600; }
.tier-opt-hint { font-size: 11.5px; color: var(--text-secondary, #475569); margin-top: 4px; margin-left: 26px; line-height: 1.45; }
.tier-opt-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-t, #94a3b8); background: #FFFFFF; flex-shrink: 0; position: relative; }
.tier-opt-radio.is-on { border-color: #0A0A0A; background: #0A0A0A; }
.tier-opt-radio.is-on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #FFFFFF; }

/* Tier-upgrade evidence form (revealed under selected option) */
.tier-opt-wrap { display: flex; flex-direction: column; }
.ev-form { padding: 14px 16px; margin-top: 4px; background: var(--bg-panel-elev, #FBFAF6); border: 1px solid var(--border-t, #E7E5E0); border-top: 0; border-radius: 0 0 8px 8px; }
.ev-form-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-bottom: 8px; }
.ev-file-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 9px 11px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 6px; background: #FFFFFF; margin-bottom: 6px; }
.ev-file-label { font-size: 12.5px; color: #0A0A0A; font-weight: 500; }
.ev-file-control { display: flex; align-items: center; gap: 10px; }
.ev-file-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-family: var(--mono, ui-monospace, monospace); }
.ev-file-empty { color: var(--text-muted, #94a3b8); font-style: italic; font-family: var(--sans, system-ui, sans-serif); }
.ev-file-ok    { color: #15803D; }
.ev-file-ok svg { color: #15803D; }
.ev-file-input { font-size: 11px; max-width: 180px; }
.ev-field-row { margin-bottom: 10px; }
.ev-field-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary, #475569); font-weight: 600; margin-bottom: 5px; }
.ev-field-control { display: flex; align-items: center; gap: 10px; }
.ev-field-control .t-input { flex: 1; font-family: var(--mono, ui-monospace, monospace); letter-spacing: 0.04em; }
.ev-field-status { min-width: 0; }
.ev-field-hint { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 4px; line-height: 1.4; }

/* Live-validating field status states */
.lvf-typing { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; background: rgba(15,23,42,0.05); color: var(--text-muted, #94a3b8); font-size: 11px; font-family: var(--mono, ui-monospace, monospace); }
.lvf-pending { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 4px; background: rgba(59,130,246,0.08); color: #1D4ED8; font-size: 11px; font-family: var(--mono, ui-monospace, monospace); }
.lvf-valid { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px; background: rgba(22,163,74,0.10); color: #15803D; font-size: 11px; font-weight: 500; }
.lvf-valid svg { color: #15803D; }
.lvf-invalid { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px; background: rgba(220,38,38,0.08); color: #991B1B; font-size: 11px; font-weight: 500; }
.lvf-invalid svg { color: #991B1B; }
.lvf-spin { animation: lvf-spin 0.9s linear infinite; }
@keyframes lvf-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.lvf-input-valid { border-color: rgba(22,163,74,0.45); background: rgba(22,163,74,0.04); }
.lvf-input-invalid { border-color: rgba(220,38,38,0.45); background: rgba(220,38,38,0.04); }

/* Prefixed inputs (e.g. RC- before CAC RC number) */
.lvf-prefix-wrap { display: flex; align-items: stretch; flex: 1; }
.lvf-prefix {
  display: inline-flex; align-items: center; padding: 0 11px;
  background: rgba(15,23,42,0.06);
  border: 1px solid var(--border-t, #E7E5E0);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  color: #475569;
  user-select: none;
}
.lvf-with-prefix {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-left-width: 1px;
  flex: 1;
  min-width: 0;
}

/* Issuer countersign queue (v3 Part 9) */
.cs-body { padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.cs-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: var(--bg-panel-elev, #FBFAF6); border-left: 3px solid #F59E0B; }
.cs-row-main { flex: 1; min-width: 0; }
.cs-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.cs-row-head strong { font-size: 13px; color: #0A0A0A; font-weight: 600; }
.cs-row-amt { font-family: var(--mono, ui-monospace, monospace); font-weight: 700; color: #0A0A0A; font-size: 14px; }
.cs-row-meta { font-size: 11.5px; color: var(--text-secondary, #475569); font-family: var(--mono, ui-monospace, monospace); }
.cs-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cs-row-actions .t-btn { height: 30px; padding: 0 12px; font-size: 12px; }

/* Countersign queue — tabs + per-row state */
.cs-tabs { display: flex; gap: 4px; padding: 8px 16px 0; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); }
.cs-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; background: transparent; border: 0; border-bottom: 2px solid transparent; font: 500 12px var(--sans, system-ui, sans-serif); color: var(--text-secondary, #475569); cursor: pointer; transition: color 120ms ease, border-color 120ms ease; }
.cs-tab:hover { color: #0A0A0A; }
.cs-tab.is-active { color: #0A0A0A; border-bottom-color: #0A0A0A; font-weight: 600; }
.cs-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(15,23,42,0.08); color: var(--text-secondary, #475569); font-family: var(--mono, ui-monospace, monospace); font-size: 10px; font-weight: 600; }
.cs-tab.is-active .cs-tab-count { background: #0A0A0A; color: #FFFFFF; }
.cs-empty { padding: 18px 16px; font-size: 12px; color: var(--text-muted, #94a3b8); font-style: italic; }
.cs-row-accepted { border-left-color: #16A34A; }
.cs-row-declined { border-left-color: #DC2626; opacity: 0.85; }
.cs-row-pending  { border-left-color: #F59E0B; }

/* Portfolio countersign state pill */
.cs-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-family: var(--sans, system-ui, sans-serif); font-size: 10.5px; font-weight: 600; border: 1px solid; letter-spacing: 0.02em; }
.cs-pill.cs-pending  { background: rgba(245,158,11,0.10); color: #92400E; border-color: rgba(245,158,11,0.30); }
.cs-pill.cs-accepted { background: rgba(22,163,74,0.10);  color: #15803D; border-color: rgba(22,163,74,0.30); }
.cs-pill.cs-declined { background: rgba(220,38,38,0.08);  color: #991B1B; border-color: rgba(220,38,38,0.28); }
.cs-pill.cs-withdrawn{ background: rgba(15,23,42,0.06);   color: #475569; border-color: rgba(15,23,42,0.18); }

/* "Your sub · X" badge on deal rows in the deal room */
.your-sub-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-family: var(--sans, system-ui, sans-serif); font-size: 9px; font-weight: 600; letter-spacing: 0.02em; text-transform: none; vertical-align: middle; border: 1px solid; }
.your-sub-pending   { background: rgba(245,158,11,0.10); color: #92400E; border-color: rgba(245,158,11,0.30); }
.your-sub-accepted  { background: rgba(22,163,74,0.10);  color: #15803D; border-color: rgba(22,163,74,0.30); }
.your-sub-declined  { background: rgba(220,38,38,0.08);  color: #991B1B; border-color: rgba(220,38,38,0.28); }
.your-sub-withdrawn { background: rgba(15,23,42,0.06);   color: #475569; border-color: rgba(15,23,42,0.18); }

/* Publisher Workspace (Data Cell) — your listed deals */
.my-listings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.my-listing-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 10px; background: #FFFFFF; text-decoration: none; color: inherit; transition: border-color 160ms ease, transform 120ms ease, box-shadow 160ms ease; }
.my-listing-card:hover { border-color: #0A0A0A; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,0.06); }
.my-listing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.my-listing-ticker { font-family: var(--mono, ui-monospace, monospace); font-size: 14px; font-weight: 700; letter-spacing: 0.06em; color: #0A0A0A; }
.my-listing-name { font-size: 12.5px; color: var(--text-secondary, #475569); margin-top: 2px; line-height: 1.3; }
.my-listing-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.my-listing-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; padding-top: 8px; border-top: 1px solid var(--border-t-soft, #EFEDE6); }
.my-listing-stats > div { display: flex; flex-direction: column; gap: 1px; }
.my-listing-stats > div.full { grid-column: 1 / -1; }
.my-listing-stats dt { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.my-listing-stats dd { margin: 0; font-size: 12.5px; color: #0A0A0A; font-weight: 500; }
.my-listings-empty { padding: 28px 20px; text-align: center; background: var(--bg-panel-elev, #FBFAF6); border: 1px dashed var(--border-t, #E7E5E0); border-radius: 10px; }

/* Preferences modal — row layout */
.prefs-grid { display: flex; flex-direction: column; gap: 14px; }
.pref-row { display: grid; grid-template-columns: 1fr 200px; gap: 18px; align-items: center; padding: 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; }
.pref-row label { display: block; font-size: 12.5px; color: #0A0A0A; font-weight: 600; text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
.pref-hint { font-size: 11px; color: var(--text-muted, #94a3b8); line-height: 1.45; }
.pref-row .t-input { width: 100%; }
.pref-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary, #475569); }
.pref-toggle input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* Account modal — v3 dashboard view */
.acct-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-t, #E7E5E0); margin-bottom: 14px; flex-wrap: wrap; }
.acct-modal-name { font-family: var(--serif, Georgia, serif); font-size: 22px; line-height: 1.15; color: #0A0A0A; }
.acct-modal-email { font-size: 12.5px; color: var(--text-secondary, #475569); margin-top: 2px; font-family: var(--mono, ui-monospace, monospace); }
.acct-modal-pills { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acct-modal-pills .acct-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid; }
.acct-modal-pills .acct-pill svg { display: inline-block; }
.acct-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin: 0 0 16px; }
.acct-modal-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 6px 0; }
.acct-modal-grid > div.full { grid-column: 1 / -1; }
.acct-modal-grid dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.acct-modal-grid dd { font-size: 13px; color: #0A0A0A; margin: 0; line-height: 1.45; }
.acct-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border-t, #E7E5E0); }
.acct-modal-actions .t-btn { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* Sidebar account block — mini pills + action links */
.acct { padding-top: 14px; }
.acct-id { display: flex; gap: 10px; align-items: center; }
.acct-avatar { display: inline-flex; align-items: center; justify-content: center; height: 32px; width: 32px; border-radius: 8px; background: #0A0A0A; color: #FFFFFF; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.acct-id-text { min-width: 0; flex: 1; }
.acct-id-name { color: #0A0A0A; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-id-email { color: var(--text-muted, #94a3b8); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-mini-badges { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0 10px; }
.acct-mini-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; border: 1px solid; font-family: var(--sans, system-ui, sans-serif); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; cursor: default; }
.acct-mini-pill.ok { background: rgba(22,163,74,0.10); color: #15803D; border-color: rgba(22,163,74,0.30); }
.acct-mini-pill.warn { background: rgba(224,79,57,0.10); color: #B43A28; border-color: rgba(224,79,57,0.30); cursor: pointer; }
.acct-mini-pill.warn:hover { background: rgba(224,79,57,0.16); }
.acct-mini-pill.t-tier-1 { background: rgba(15,23,42,0.06); color: #334155; border-color: rgba(15,23,42,0.15); }
.acct-mini-pill.t-tier-2 { background: rgba(59,130,246,0.10); color: #1D4ED8; border-color: rgba(59,130,246,0.28); }
.acct-mini-pill.t-tier-3 { background: rgba(201,162,39,0.14); color: #7C5E12; border-color: rgba(201,162,39,0.40); }
.acct-links { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--border-t-soft, #EFEDE6); }
.acct-link { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; border: 0; background: transparent; color: var(--text-secondary, #475569); font: 500 12.5px var(--sans, system-ui, sans-serif); cursor: pointer; text-decoration: none; text-align: left; }
.acct-link:hover { background: rgba(15,23,42,0.04); color: #0A0A0A; }
.acct-link svg { width: 14px; height: 14px; opacity: 0.7; flex-shrink: 0; }
.acct-link-danger { color: var(--down, #DC2626); }
.acct-link-danger:hover { background: rgba(220,38,38,0.06); color: var(--down, #DC2626); }
.acct-signout-only { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-t-soft, #EFEDE6); border-radius: 0; }

/* Settings — Account & KYC section */
.acct-grid    { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; margin-bottom: 14px; }
.acct-cell-wide { grid-column: 1 / -1; }
.acct-label   { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-bottom: 4px; }
.acct-val     { font-size: 13px; color: #0A0A0A; line-height: 1.5; }
.acct-val strong { font-weight: 600; }
.acct-pill    { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.acct-pill.ok    { background: rgba(22,163,74,0.10);  color: #15803D; border: 1px solid rgba(22,163,74,0.30); }
.acct-pill.warn  { background: rgba(245,158,11,0.10); color: #92400E; border: 1px solid rgba(245,158,11,0.30); }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border-t, #E7E5E0); }

/* Locked invest button — small inline SVG padlock, opacity hint, no emoji */
.t-btn-locked { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; font-size: 11px; margin-right: 6px; background: rgba(15,23,42,0.04); color: var(--text-secondary, #475569); border: 1px solid rgba(15,23,42,0.18); cursor: pointer; }
.t-btn-locked:hover { background: rgba(15,23,42,0.08); color: #0A0A0A; border-color: rgba(15,23,42,0.32); }
.t-btn-locked .btn-lock { color: currentColor; flex-shrink: 0; }

/* Subscription modal — "What you're funding" brief panel */
.brief-box     { border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; margin-bottom: 14px; background: var(--bg-panel-elev, #FBFAF6); overflow: hidden; }
.brief-summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary, #475569); font-weight: 600; list-style: none; }
.brief-summary::-webkit-details-marker { display: none; }
.brief-box[open] .brief-summary { border-bottom: 1px solid var(--border-t, #E7E5E0); }
.brief-chev    { display: inline-flex; transition: transform 160ms ease; color: var(--text-muted, #94a3b8); }
.brief-box[open] .brief-chev { transform: rotate(180deg); }
.brief-body    { padding: 12px 14px 14px; }
.brief-text    { font-size: 12.5px; line-height: 1.55; color: #0A0A0A; margin: 0 0 12px; }
.brief-uop-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin: 12px 0 6px; }
.brief-uop     { list-style: none; padding: 0; margin: 0; }
.brief-uop li  { margin-bottom: 8px; }
.brief-uop-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; font-size: 12px; color: #0A0A0A; }
.brief-uop-label { color: var(--text-secondary, #475569); }
.brief-uop-pct { font-family: var(--mono, ui-monospace, monospace); font-weight: 600; color: #0A0A0A; }
.brief-uop-ngn { font-family: var(--mono, ui-monospace, monospace); color: var(--text-secondary, #475569); }
.brief-uop-bar { height: 4px; border-radius: 2px; background: rgba(15,23,42,0.08); margin-top: 4px; overflow: hidden; }
.brief-uop-bar span { display: block; height: 100%; background: #0A0A0A; border-radius: 2px; }
.brief-bullets { list-style: disc; padding-left: 18px; margin: 0 0 8px; font-size: 12px; line-height: 1.6; color: var(--text-secondary, #475569); }
.agr-brief     { font-size: 12.5px; line-height: 1.55; color: #0A0A0A; margin: 0 0 10px; background: var(--bg-panel-elev, #FBFAF6); padding: 10px 12px; border-radius: 6px; border-left: 3px solid #0A0A0A; }

/* List-a-Deal wizard */
.ld-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ld-progress-bar { position: relative; flex: 1; height: 4px; background: rgba(15,23,42,0.08); border-radius: 2px; overflow: hidden; }
.ld-progress-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: #0A0A0A; border-radius: 2px; transition: width 200ms ease; }
.ld-progress-label { font-size: 11px; color: var(--text-muted, #94a3b8); font-family: var(--mono, ui-monospace, monospace); }
.ld-step    { font-family: var(--sans, system-ui, sans-serif); }
.ld-h3      { font-size: 18px; font-weight: 600; color: #0A0A0A; margin: 4px 0 4px; letter-spacing: -0.01em; }
.ld-sub     { font-size: 12.5px; color: var(--text-secondary, #475569); line-height: 1.55; margin: 0 0 14px; }
.ld-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ld-grid label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary, #475569); font-weight: 600; margin-bottom: 5px; }
.ld-grid .t-input { width: 100%; }
.ld-check-inline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary, #475569); cursor: pointer; padding-top: 22px; }
.ld-route   { margin-top: 14px; padding: 12px 14px; border-radius: 8px; border: 1px solid; }
.ld-route.ok   { background: rgba(22,163,74,0.05); border-color: rgba(22,163,74,0.25); }
.ld-route.warn { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.30); }
.ld-route-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ld-route-caliber { font-weight: 600; font-size: 14px; color: #0A0A0A; }
.ld-route-reason { font-size: 12px; color: #92400E; margin-bottom: 4px; }
.ld-route-meta   { font-size: 12px; color: var(--text-secondary, #475569); line-height: 1.5; }
.ld-warn    { padding: 10px 12px; border-radius: 6px; background: rgba(220,38,38,0.06); border: 1px solid rgba(220,38,38,0.25); color: #991B1B; font-size: 12px; margin: 14px 0; }

.ld-wrap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 6px; }
.ld-wrap-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 8px; border: 1.5px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; text-align: left; transition: border-color 120ms ease, background 120ms ease; font-family: var(--sans, system-ui, sans-serif); }
.ld-wrap-card:hover { border-color: #0A0A0A; }
.ld-wrap-card.is-selected { border-color: #0A0A0A; background: var(--bg-panel-elev, #FBFAF6); }
.ld-wrap-card strong { font-size: 13px; color: #0A0A0A; font-weight: 600; }
.ld-wrap-card span   { font-size: 11px; color: var(--text-secondary, #475569); line-height: 1.4; }

.ld-cw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ld-cw-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 8px; border: 1.5px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; text-align: left; transition: border-color 120ms ease, background 120ms ease; font-family: var(--sans, system-ui, sans-serif); }
.ld-cw-card:hover { border-color: #0A0A0A; }
.ld-cw-card.is-selected { border-color: #0A0A0A; background: var(--bg-panel-elev, #FBFAF6); }
.ld-cw-card strong { font-size: 14px; color: #0A0A0A; font-weight: 600; }
.ld-cw-card span   { font-size: 11px; color: var(--text-secondary, #475569); line-height: 1.4; }

.ld-uop { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ld-uop-row { display: grid; grid-template-columns: 1fr 80px auto 30px; gap: 8px; align-items: center; }
.ld-uop-ngn { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; color: var(--text-secondary, #475569); white-space: nowrap; }
.ld-uop-rm  { background: transparent; border: 0; color: var(--text-muted, #94a3b8); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 4px; }
.ld-uop-rm:hover { color: #DC2626; background: rgba(220,38,38,0.06); }

.ld-review { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; padding: 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: var(--bg-panel-elev, #FBFAF6); margin-bottom: 14px; }
.ld-review div { display: flex; flex-direction: column; gap: 2px; }
.ld-review dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.ld-review dd { font-size: 12.5px; color: #0A0A0A; margin: 0; }

.ld-sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ld-sig-tile { padding: 16px; border: 1.5px dashed var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; text-align: center; transition: border-color 200ms ease, background 200ms ease; }
.ld-sig-tile.done { border-style: solid; border-color: #16A34A; background: rgba(22,163,74,0.04); }
.ld-sig-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-bottom: 10px; }
.ld-sig-ok    { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #15803D; font-weight: 600; }
.ld-ticker-hint { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 4px; line-height: 1.4; }
.ld-ticker-hint.ld-ticker-ok    { color: #15803D; }
.ld-ticker-hint.ld-ticker-taken { color: #B43A28; }
.t-input.is-invalid { border-color: #B43A28; background: rgba(224,79,57,0.04); }

/* List-a-Deal Step 4 file uploads */
.ld-files { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.ld-file-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; }
.ld-file-label { font-size: 12.5px; color: #0A0A0A; font-weight: 500; display: flex; flex-direction: column; gap: 2px; text-transform: none; letter-spacing: 0; margin-bottom: 0; }
.ld-file-hint  { font-size: 11px; color: var(--text-muted, #94a3b8); font-weight: 400; }
.ld-file-control { display: flex; align-items: center; gap: 10px; }
.ld-file-meta { font-size: 11.5px; color: var(--text-secondary, #475569); font-family: var(--mono, ui-monospace, monospace); white-space: nowrap; }
.ld-file-empty { color: var(--text-muted, #94a3b8); font-style: italic; font-family: var(--sans, system-ui, sans-serif); }
.ld-file-input { font-size: 11px; max-width: 180px; }
.your-raise-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(224,79,57,0.10); color: #B43A28; font-family: var(--sans, system-ui, sans-serif); font-size: 9px; font-weight: 600; letter-spacing: 0.02em; text-transform: none; vertical-align: middle; border: 1px solid rgba(224,79,57,0.32); }

/* Activity feed severity tiers (v3 Part 19I) */
.alert-tier { margin-bottom: 16px; }
.alert-tier-head { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); }
.alert-tier-label { font-size: 10.5px; font-family: var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: 0.10em; font-weight: 700; }
.alert-tier-count { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; padding: 1px 7px; border-radius: 999px; background: rgba(15,23,42,0.08); color: #475569; }
.alert-tier-blurb { font-size: 11px; color: var(--text-muted, #94a3b8); margin-left: auto; }
.alert-tier-critical .alert-tier-label { color: #B43A28; }
.alert-tier-standard .alert-tier-label { color: #1D4ED8; }
.alert-tier-passive  .alert-tier-label { color: #475569; }
.alert-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 6px; margin-bottom: 5px; background: #FFFFFF; }
.alert-card-body { min-width: 0; flex: 1; }
.alert-card-line { display: flex; align-items: center; gap: 6px; }
.alert-card-symbol { font-family: var(--mono, ui-monospace, monospace); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #0A0A0A; }
.alert-card-label { font-size: 12px; color: var(--text-secondary, #475569); }
.alert-card-time { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; color: var(--text-muted, #94a3b8); margin-top: 2px; }
.alert-card.alert-critical { border-left: 3px solid #B43A28; background: rgba(224,79,57,0.03); }
.alert-card.alert-standard { border-left: 3px solid #3B82F6; }
.alert-card.alert-passive  { border-left: 3px solid rgba(15,23,42,0.15); opacity: 0.85; }

/* Alerts modal v2 — toolbar, filters, click-through cards, empty state */
.alerts-modal { display: flex; flex-direction: column; gap: 10px; }
.alerts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-t, #E7E5E0); flex-wrap: wrap; }
.alerts-summary { font-size: 12.5px; color: var(--text-secondary, #475569); }
.alerts-summary strong { color: #0A0A0A; font-family: var(--mono, ui-monospace, monospace); font-weight: 700; }
.alerts-summary .alerts-unread { color: #B43A28; }
.alerts-toolbar-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.alerts-toolbar-actions .t-btn { height: 28px; padding: 0 10px; font-size: 11.5px; }

.alert-filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.alert-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; font: 500 11px var(--sans, system-ui, sans-serif); color: var(--text-secondary, #475569); transition: background 120ms ease, border-color 120ms ease, color 120ms ease; white-space: nowrap; }
.alert-filter-chip:hover { border-color: #0A0A0A; color: #0A0A0A; }
.alert-filter-chip.is-active { background: #0A0A0A; color: #FFFFFF; border-color: #0A0A0A; font-weight: 600; }
.alert-filter-count { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; padding: 1px 5px; border-radius: 999px; background: rgba(15,23,42,0.08); color: inherit; opacity: 0.8; }
.alert-filter-chip.is-active .alert-filter-count { background: rgba(255,255,255,0.18); }

.alert-empty { padding: 28px 16px; text-align: center; color: var(--text-muted, #94a3b8); }
.alert-empty svg { display: inline-block; margin-bottom: 10px; opacity: 0.5; }
.alert-empty-head { font-family: var(--serif, Georgia, serif); font-size: 18px; color: #0A0A0A; margin-bottom: 4px; }
.alert-empty-sub { font-size: 12px; line-height: 1.5; max-width: 36ch; margin: 0 auto; }

/* Alert card upgrades */
.alert-card { display: flex; align-items: stretch; gap: 0; padding: 0; border: 1px solid var(--border-t, #E7E5E0); border-radius: 6px; margin-bottom: 5px; background: #FFFFFF; overflow: hidden; transition: background 120ms ease, border-color 120ms ease; }
.alert-card.is-unread { background: #FBFAF6; }
.alert-card.alert-critical.is-unread { background: rgba(224,79,57,0.05); }
.alert-card.has-href { cursor: pointer; }
.alert-card.has-href:hover { border-color: #0A0A0A; }
.alert-card-link { flex: 1; display: flex; gap: 10px; padding: 10px 12px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.alert-card[data-mark-read] { padding: 10px 12px; gap: 10px; align-items: center; cursor: pointer; }
.alert-card[data-mark-read]:hover { background: rgba(15,23,42,0.03); }
.alert-card-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--bg-panel-elev, #FBFAF6); display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary, #475569); flex-shrink: 0; }
.alert-card-icon svg { width: 14px; height: 14px; }
.alert-card.alert-critical .alert-card-icon { background: rgba(224,79,57,0.10); color: #B43A28; }
.alert-card.alert-standard .alert-card-icon { background: rgba(59,130,246,0.10); color: #1D4ED8; }
.alert-card.alert-passive  .alert-card-icon { background: rgba(15,23,42,0.06); color: var(--text-muted, #94a3b8); }
.alert-unread-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #B43A28; flex-shrink: 0; }
.alert-card-value { color: var(--text-secondary, #475569); font-family: var(--mono, ui-monospace, monospace); margin-left: 4px; }
.alert-card-remove { flex-shrink: 0; align-self: stretch; height: auto; width: 32px; padding: 0; font-size: 18px; line-height: 1; color: var(--text-muted, #94a3b8); background: transparent; border: 0; border-left: 1px solid var(--border-t-soft, #EFEDE6); cursor: pointer; border-radius: 0; }
.alert-card-remove:hover { color: #DC2626; background: rgba(220,38,38,0.04); }

/* Saved screens — Bloomberg-style filter preset chips */
.screen-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; padding: 4px 0; }
.screen-chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-t, #E7E5E0); background: #FFFFFF; font-family: var(--sans, system-ui, sans-serif); font-size: 11.5px; font-weight: 500; color: var(--text-secondary, #475569); cursor: pointer; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; white-space: nowrap; }
.screen-chip:hover { border-color: #0A0A0A; color: #0A0A0A; }
.screen-chip.is-active { background: #0A0A0A; color: #FFFFFF; border-color: #0A0A0A; font-weight: 600; }

/* Compact tables — portfolio + investors. Progressive column hiding via media queries. */
.compact-table { table-layout: auto; width: 100%; }
.compact-table th, .compact-table td { padding: 9px 8px; }

/* Portfolio · subscriptions table (#invBody parent) — 9 cols. Drop secondary cols on narrower viewports. */
@media (max-width: 1180px) {
  #invPanel .compact-table th:nth-child(4),  /* Sector */
  #invPanel .compact-table td:nth-child(4),
  #invPanel .compact-table th:nth-child(8),  /* Signed */
  #invPanel .compact-table td:nth-child(8) { display: none; }
}
@media (max-width: 980px) {
  #invPanel .compact-table th:nth-child(6),  /* Valuation cap */
  #invPanel .compact-table td:nth-child(6) { display: none; }
}
@media (max-width: 780px) {
  #invPanel .compact-table th:nth-child(3),  /* Wrapper */
  #invPanel .compact-table td:nth-child(3) { display: none; }
}

/* Portfolio · fund positions table (#posPanel) — 10 cols. */
@media (max-width: 1180px) {
  #posPanel .compact-table th:nth-child(3),  /* Sector */
  #posPanel .compact-table td:nth-child(3),
  #posPanel .compact-table th:nth-child(6),  /* Distributed */
  #posPanel .compact-table td:nth-child(6) { display: none; }
}
@media (max-width: 980px) {
  #posPanel .compact-table th:nth-child(5),  /* Called */
  #posPanel .compact-table td:nth-child(5) { display: none; }
}
@media (max-width: 780px) {
  #posPanel .compact-table th:nth-child(7),  /* NAV */
  #posPanel .compact-table td:nth-child(7) { display: none; }
}

/* Investors page — 9 cols */
@media (max-width: 1180px) {
  .workspace-content .compact-table th:nth-child(6),  /* Manager */
  .workspace-content .compact-table td:nth-child(6),
  .workspace-content .compact-table th:nth-child(8),  /* Last contact */
  .workspace-content .compact-table td:nth-child(8) { display: none; }
}

/* Deals table — 7-column compact layout, no horizontal scroll */
.deals-table-wrap { width: 100%; }
.deals-table { table-layout: fixed; width: 100%; }
.deals-table th, .deals-table td { padding: 10px 8px; vertical-align: middle; }
.deals-table th:first-child, .deals-table td:first-child { padding-left: 14px; }
.deals-table th:last-child,  .deals-table td:last-child  { padding-right: 14px; }
.deals-table .col-company { width: auto;   min-width: 0; }
.deals-table .col-lane    { width: 130px; }
.deals-table .col-wrapper { width: 110px; }
.deals-table .col-size    { width: 70px; }
.deals-table .col-alloc   { width: 130px; }
.deals-table .col-status  { width: 110px; }
.deals-table .col-actions { width: 140px; text-align: right; white-space: nowrap; }

/* Row company cell — stacked: name, sector + ticker meta line */
.row-co       { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-co-text  { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.row-co-name  { font-weight: 500; color: var(--text-primary, #0A0A0A); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-co-name:hover { text-decoration: underline; }
.row-co-meta  { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted, #94a3b8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row-co-ticker { font-family: var(--mono, ui-monospace, monospace); letter-spacing: 0.06em; color: var(--text-secondary, #475569); }
.row-meta-dot { color: rgba(15,23,42,0.2); }

/* Compact allocation cell inside the narrow column */
.col-alloc .alloc-cell { min-width: 0; }
.col-alloc .alloc-bar  { height: 5px; }

/* Compact action buttons */
.deals-table .col-actions .t-btn,
.deals-table .col-actions .t-btn-locked { height: 26px; padding: 0 9px; font-size: 11px; margin-right: 4px; }
.deals-table .col-actions .star-cell,
.deals-table .col-actions .kebab-btn { width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-right: 2px; }
.deals-table .col-actions .kebab-btn { margin-right: 0; }

/* Lane chip + wrapper text fit tightly */
.col-lane .lane-chip { font-size: 9.5px; padding: 2px 7px; }
.col-wrapper { font-size: 12px; color: var(--text-secondary, #475569); }
.col-wrapper > span { border-bottom: 1px dotted rgba(0,0,0,0.18); cursor: help; }

/* Status badge fits column */
.col-status .badge { font-size: 9.5px; padding: 2px 7px; }

/* Hide less-critical columns on narrow viewports */
@media (max-width: 1100px) {
  .deals-table .col-wrapper { display: none; }
}
@media (max-width: 920px) {
  .deals-table .col-size { display: none; }
  .row-co-meta { font-size: 10.5px; }
}
@media (max-width: 760px) {
  .deals-table .col-lane { display: none; }
  .deals-table .col-actions { width: 100px; }
  .deals-table .col-actions .t-btn,
  .deals-table .col-actions .t-btn-locked { padding: 0 6px; }
}

/* v3 deal.html — lifecycle hero + pipeline + allocation tier + snapshot */
.lc-hero        { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border-t, #E7E5E0); }
.lc-hero-eyebrow{ font-family: var(--mono, ui-monospace, monospace); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted, #94a3b8); margin-bottom: 8px; }
.lc-hero-title  { font-family: var(--serif, Georgia, serif); font-size: 32px; font-weight: 400; letter-spacing: -0.025em; line-height: 1.1; color: #0A0A0A; margin: 0 0 10px; }
.lc-hero-ticker { font-family: var(--mono, ui-monospace, monospace); font-size: 18px; letter-spacing: 0.06em; color: var(--text-muted, #94a3b8); margin-left: 6px; vertical-align: 4px; }
.lc-hero-meta   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-hero-meta-text { font-size: 12px; color: var(--text-secondary, #475569); }

/* Lifecycle pipeline — 4 columns × N states */
.lc-pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.lc-group    { padding: 12px 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; }
.lc-group.is-past    { opacity: 0.55; }
.lc-group.is-current { border-color: #0A0A0A; background: var(--bg-panel-elev, #FBFAF6); }
.lc-group.is-future  { opacity: 0.85; }
.lc-group-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.10em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.lc-here       { color: #B43A28; font-weight: 600; letter-spacing: 0.04em; font-size: 9px; padding: 2px 6px; border: 1px solid rgba(224,79,57,0.4); border-radius: 999px; text-transform: lowercase; }
.lc-states     { display: flex; flex-direction: column; gap: 4px; }
.lc-state      { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 4px; font-size: 11.5px; color: var(--text-secondary, #475569); line-height: 1.3; }
.lc-state-dot  { width: 6px; height: 6px; border-radius: 50%; background: rgba(15,23,42,0.25); flex-shrink: 0; }
.lc-state.is-current { background: #0A0A0A; color: #FFFFFF; font-weight: 500; }
.lc-state.is-current .lc-state-dot { background: #FFFFFF; }
.lc-state.lc-success.is-current { background: #15803D; }
.lc-state.lc-warning.is-current { background: #B45309; }
.lc-state.lc-danger.is-current  { background: #991B1B; }
.lc-state-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Allocation tier bar */
.lc-alloc       { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; }
.lc-alloc-label { font-size: 13px; font-weight: 600; color: #0A0A0A; }
.lc-alloc-blurb { color: var(--text-muted, #94a3b8); font-weight: 400; font-size: 12px; }
.lc-alloc-bar   { position: relative; height: 10px; background: rgba(15,23,42,0.06); border-radius: 4px; margin: 8px 0 6px; overflow: hidden; }
.lc-alloc-tick  { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(15,23,42,0.18); z-index: 2; }
.lc-alloc-fill  { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transition: width 240ms ease; }
.lc-alloc-fill.early   { background: #94a3b8; }
.lc-alloc-fill.mid     { background: #94a3b8; }
.lc-alloc-fill.mid-high{ background: #3B82F6; }
.lc-alloc-fill.near    { background: #16A34A; }
.lc-alloc-fill.full    { background: #16A34A; }
.lc-alloc-fill.over    { background: #E04F39; box-shadow: inset 0 0 0 1px #E04F39; }
.lc-alloc-foot  { font-family: var(--mono, ui-monospace, monospace); font-size: 11px; color: var(--text-secondary, #475569); }

/* Two-column page layout */
.lc-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .lc-grid { grid-template-columns: 1fr; } }
.lc-main { display: grid; gap: 14px; }
.lc-side { display: grid; gap: 14px; }

.lc-brief { padding: 14px 18px; font-family: var(--sans, system-ui, sans-serif); }
.lc-brief p { font-size: 13px; line-height: 1.6; color: #0A0A0A; margin: 0 0 12px; }
.lc-brief-uop-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin: 12px 0 6px; }

.lc-snap { padding: 6px 0; }
.lc-snap-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); }
.lc-snap-row:last-child { border-bottom: 0; }
.lc-snap-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.lc-snap-v { font-size: 13px; color: #0A0A0A; font-weight: 500; text-align: right; }
/* Brief / UoP text row in snapshot — stack rather than right-align since it's long copy */
.lc-snap-row.lc-snap-brief { flex-direction: column; align-items: stretch; gap: 4px; }
.lc-snap-row.lc-snap-brief .lc-snap-v { text-align: left; font-weight: 400; line-height: 1.55; font-size: 12.5px; color: var(--text-secondary, #475569); }

/* Deal page chart panel — every deal gets a graph (Apex area chart) */
.deal-chart-panel { margin-bottom: 18px; }
.deal-chart-host { padding: 4px 12px 12px; min-height: 280px; }
.deal-chart-host .apexcharts-tooltip { font-family: var(--sans, system-ui, sans-serif) !important; box-shadow: 0 4px 16px rgba(15,23,42,0.08) !important; border: 1px solid var(--border-t, #E7E5E0) !important; }

/* Portfolio subscription state-filter chip row */
.inv-state-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.inv-state-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; font: 500 11.5px var(--sans, system-ui, sans-serif); color: var(--text-secondary, #475569); transition: background 120ms ease, border-color 120ms ease, color 120ms ease; }
.inv-state-chip:hover { border-color: #0A0A0A; color: #0A0A0A; }
.inv-state-chip.is-active { background: #0A0A0A; color: #FFFFFF; border-color: #0A0A0A; font-weight: 600; }
.inv-state-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: rgba(15,23,42,0.08); color: inherit; opacity: 0.85; font-family: var(--mono, ui-monospace, monospace); font-size: 10px; }
.inv-state-chip.is-active .inv-state-count { background: rgba(255,255,255,0.18); }

.lc-trans-body { padding: 14px 18px; }
.lc-trans-current { font-size: 12px; color: var(--text-secondary, #475569); margin-bottom: 12px; }
.lc-trans-current .badge { margin-left: 4px; }
.lc-trans-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.lc-trans-btns .t-btn { height: 30px; padding: 0 12px; font-size: 12px; }
.lc-trans-cooldown { padding: 10px 12px; background: rgba(220,38,38,0.06); border: 1px solid rgba(220,38,38,0.22); border-radius: 6px; font-size: 12.5px; color: #991B1B; line-height: 1.5; margin-bottom: 12px; }

.lc-activity { padding: 4px 16px 12px; max-height: 280px; overflow: auto; }
.lc-activity-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); font-size: 12px; }
.lc-activity-row:last-child { border-bottom: 0; }
.lc-activity-date { font-family: var(--mono, ui-monospace, monospace); color: var(--text-muted, #94a3b8); min-width: 84px; }
.lc-activity-text { color: var(--text-secondary, #475569); line-height: 1.4; }

/* Reporting cadence panel */
.rep-body { padding: 12px 16px 14px; }
.rep-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.rep-toolbar .t-btn { height: 30px; padding: 0 12px; font-size: 12px; }
.rep-note { font-size: 11px; color: var(--text-muted, #94a3b8); margin-left: auto; }
.rep-card { padding: 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: var(--bg-panel-elev, #FBFAF6); margin-bottom: 12px; }
.rep-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rep-card-cycle { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.rep-card-date { font-family: var(--mono, ui-monospace, monospace); font-size: 11px; color: var(--text-secondary, #475569); }
.rep-card-foot { font-size: 10.5px; color: var(--text-muted, #94a3b8); margin-top: 6px; }
.rep-daily-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; }
.rep-daily-row strong { font-family: var(--mono, ui-monospace, monospace); color: #0A0A0A; }
.rep-list { display: flex; flex-direction: column; gap: 10px; }
.rep-item { padding: 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; }
.rep-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rep-text { font-size: 12.5px; line-height: 1.55; color: #0A0A0A; margin: 0; }
.rep-fiscal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin: 0; }
.rep-fiscal > div { display: flex; flex-direction: column; gap: 2px; }
.rep-fiscal dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.rep-fiscal dd { font-size: 13px; color: #0A0A0A; margin: 0; }
.rep-fiscal-full { grid-column: 1 / -1; }
.rep-empty { font-size: 12px; color: var(--text-muted, #94a3b8); padding: 8px 0; }
.rep-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary, #475569); font-weight: 600; margin-bottom: 5px; }
.rep-hint { font-size: 11.5px; color: var(--text-muted, #94a3b8); margin: 0 0 10px; }
.rep-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Structured Q&A panel — fair-disclosure (v3 Part 13) */
.qa-body { padding: 12px 16px 14px; }
.qa-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.qa-toolbar .t-btn { height: 30px; padding: 0 12px; font-size: 12px; }
.qa-list { display: flex; flex-direction: column; gap: 12px; }
.qa-item { padding: 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; }
.qa-question { padding-bottom: 10px; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); margin-bottom: 10px; }
.qa-q-head { font-size: 11px; color: var(--text-muted, #94a3b8); margin-bottom: 4px; }
.qa-q-head strong { color: var(--text-secondary, #475569); }
.qa-question p { font-size: 13px; color: #0A0A0A; line-height: 1.55; margin: 0; }
.qa-answer { background: var(--bg-panel-elev, #FBFAF6); padding: 10px 12px; border-radius: 6px; border-left: 3px solid #16A34A; }
.qa-answer-head { font-size: 11px; color: var(--text-muted, #94a3b8); margin-bottom: 6px; }
.qa-answer-head strong { color: #15803D; font-weight: 600; }
.qa-answer p { font-size: 12.5px; color: #0A0A0A; line-height: 1.55; margin: 0; }
.qa-pending { border-left-color: #94a3b8; }
.qa-pending em { font-size: 12px; color: var(--text-muted, #94a3b8); }
.qa-pending-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qa-date { color: var(--text-muted, #94a3b8); font-family: var(--mono, ui-monospace, monospace); font-size: 11px; }
.qa-q-preview { padding: 10px 12px; background: var(--bg-panel-elev, #FBFAF6); border-radius: 6px; font-size: 12.5px; color: var(--text-secondary, #475569); margin-bottom: 12px; line-height: 1.5; }

/* Issuer broadcast updates (v3 Part 13) */
.bc-body-wrap { padding: 12px 16px 14px; }
.bc-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.bc-list { display: flex; flex-direction: column; gap: 10px; }
.bc-item { padding: 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; background: #FFFFFF; border-left: 3px solid #0A0A0A; }
.bc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; font-size: 11px; }
.bc-when { font-family: var(--mono, ui-monospace, monospace); color: var(--text-muted, #94a3b8); }
.bc-immutable { color: var(--text-muted, #94a3b8); margin-left: auto; font-size: 10.5px; letter-spacing: 0.02em; }
.bc-body { font-size: 13px; line-height: 1.55; color: #0A0A0A; margin: 0; white-space: pre-wrap; }
.bc-cat, .bc-cat-pick { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-family: var(--mono, ui-monospace, monospace); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid; white-space: nowrap; }
.bc-cat-info,    .bc-cat-pick.bc-cat-info    { background: rgba(59,130,246,0.10);  color: #1D4ED8; border-color: rgba(59,130,246,0.30); }
.bc-cat-success, .bc-cat-pick.bc-cat-success { background: rgba(22,163,74,0.10);   color: #15803D; border-color: rgba(22,163,74,0.30); }
.bc-cat-danger,  .bc-cat-pick.bc-cat-danger  { background: rgba(220,38,38,0.10);   color: #991B1B; border-color: rgba(220,38,38,0.30); }
.bc-cat-warning, .bc-cat-pick.bc-cat-warning { background: rgba(245,158,11,0.10);  color: #92400E; border-color: rgba(245,158,11,0.30); }
.bc-cat-muted,   .bc-cat-pick.bc-cat-muted   { background: rgba(15,23,42,0.06);    color: #475569; border-color: rgba(15,23,42,0.15); }
.bc-item.bc-item-success { border-left-color: #16A34A; }
.bc-item.bc-item-danger  { border-left-color: #DC2626; }
.bc-item.bc-item-warning { border-left-color: #F59E0B; }
.bc-cat-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bc-cat-pick { cursor: pointer; opacity: 0.55; transition: opacity 120ms ease, transform 80ms ease; }
.bc-cat-pick:hover { opacity: 0.85; }
.bc-cat-pick.is-selected { opacity: 1; transform: scale(1.04); box-shadow: 0 0 0 2px currentColor; }

/* AI assistant — corpus-bound (v3 Part 13) */
.ai-panel { }
.ai-body { padding: 12px 16px 14px; }
.ai-disclaimer { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 6px; background: rgba(201,162,39,0.08); border: 1px solid rgba(201,162,39,0.25); color: #7C5E12; font-size: 11.5px; line-height: 1.5; margin-bottom: 12px; }
.ai-disclaimer svg { flex-shrink: 0; margin-top: 1px; }
.ai-empty { font-size: 12.5px; color: var(--text-muted, #94a3b8); padding: 18px 8px; text-align: center; font-style: italic; }
.ai-history { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; max-height: 360px; overflow-y: auto; }
.ai-turn { display: flex; flex-direction: column; gap: 6px; }
.ai-q, .ai-a { display: flex; gap: 8px; align-items: flex-start; }
.ai-tag { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; padding: 2px 7px; border-radius: 999px; background: rgba(15,23,42,0.08); color: #475569; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; flex-shrink: 0; margin-top: 2px; }
.ai-tag-bot { background: rgba(15,23,42,0.85); color: #FFFFFF; }
.ai-q { font-size: 13px; color: #0A0A0A; line-height: 1.5; }
.ai-a-body { font-size: 12.5px; color: var(--text-secondary, #475569); line-height: 1.6; flex: 1; }
.ai-a-body p { margin: 0 0 6px; }
.ai-a-body p:last-child { margin-bottom: 0; }
.ai-a-body strong { color: #0A0A0A; }
.ai-cites { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; margin-left: 60px; }
.ai-cite { font-family: var(--mono, ui-monospace, monospace); font-size: 9.5px; padding: 2px 7px; border-radius: 999px; background: rgba(15,23,42,0.05); color: var(--text-secondary, #475569); border: 1px solid var(--border-t, #E7E5E0); }
.ai-form { display: flex; gap: 8px; }
.ai-form .t-input { flex: 1; }
.ai-form .t-btn { height: 36px; padding: 0 14px; font-size: 12.5px; }

/* Sidebar locked items — clickable but routed through the right gate */
.workspace-nav a.is-locked { opacity: 0.55; cursor: pointer; position: relative; }
.workspace-nav a.is-locked:hover { opacity: 0.85; background: rgba(15,23,42,0.04); }
.workspace-nav a.is-locked .nav-lock { margin-left: auto; flex-shrink: 0; color: var(--text-muted, #94a3b8); }
.workspace-nav a.is-locked:hover .nav-lock { color: #0A0A0A; }

/* Compliance inbox (v3 Part 19E) */
.cmpl-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .cmpl-grid { grid-template-columns: 1fr; } }
.cmpl-stat { display: flex; flex-direction: column; align-items: center; padding: 8px 14px; background: var(--bg-panel-elev, #FBFAF6); border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; min-width: 80px; }
.cmpl-stat-n { font-family: var(--mono, ui-monospace, monospace); font-size: 20px; font-weight: 700; color: #0A0A0A; line-height: 1; }
.cmpl-stat-l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-top: 4px; }

.cmpl-list-panel { max-height: 70vh; overflow-y: auto; }
.cmpl-list-empty { padding: 24px; font-size: 13px; color: var(--text-muted, #94a3b8); text-align: center; line-height: 1.5; }
.cmpl-row { width: 100%; display: block; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); background: #FFFFFF; cursor: pointer; transition: background 120ms ease; font-family: var(--sans, system-ui, sans-serif); }
.cmpl-row:hover { background: var(--bg-panel-elev, #FBFAF6); }
.cmpl-row.is-selected { background: var(--bg-panel-elev, #FBFAF6); box-shadow: inset 3px 0 0 #0A0A0A; }
.cmpl-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cmpl-row-ticker { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: #0A0A0A; }
.cmpl-row-name { font-size: 13px; color: #0A0A0A; font-weight: 500; margin-bottom: 6px; line-height: 1.3; }
.cmpl-row-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.cmpl-row-meta-text { font-size: 11.5px; color: var(--text-secondary, #475569); }
.cmpl-row-foot { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-muted, #94a3b8); font-family: var(--mono, ui-monospace, monospace); margin-top: 4px; }

.cmpl-detail-panel { min-height: 320px; }
.cmpl-empty { padding: 60px 24px; text-align: center; }
.cmpl-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border-t, #E7E5E0); }
.cmpl-detail-eyebrow { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted, #94a3b8); margin-bottom: 6px; }
.cmpl-detail-title { font-family: var(--serif, Georgia, serif); font-size: 22px; font-weight: 400; letter-spacing: -0.01em; color: #0A0A0A; margin: 0; line-height: 1.15; }
.cmpl-detail-ticker { font-family: var(--mono, ui-monospace, monospace); font-size: 14px; color: var(--text-muted, #94a3b8); margin-left: 6px; }
.cmpl-detail-meta { font-size: 12px; color: var(--text-secondary, #475569); margin-top: 8px; line-height: 1.5; }
.cmpl-detail-status { text-align: right; }
.cmpl-detail-failed { font-family: var(--mono, ui-monospace, monospace); font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 6px; }
.cmpl-cooldown { padding: 12px 18px; background: rgba(220,38,38,0.06); border-bottom: 1px solid rgba(220,38,38,0.20); font-size: 12.5px; color: #991B1B; }
.cmpl-brief { padding: 12px 20px; font-size: 12.5px; color: var(--text-secondary, #475569); line-height: 1.55; border-bottom: 1px solid var(--border-t-soft, #EFEDE6); }
.cmpl-brief strong { color: #0A0A0A; }
.cmpl-hold-note { padding: 12px 20px; background: rgba(245,158,11,0.06); border-bottom: 1px solid rgba(245,158,11,0.20); font-size: 12.5px; color: #92400E; line-height: 1.5; }
.cmpl-checklist { padding: 14px 20px; }
.cmpl-checklist-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-bottom: 10px; }
.cmpl-check-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 6px; cursor: pointer; transition: background 120ms ease; }
.cmpl-check-row:hover { background: var(--bg-panel-elev, #FBFAF6); }
.cmpl-check-row.is-checked { background: rgba(22,163,74,0.06); }
.cmpl-check-row input { margin-top: 2px; flex-shrink: 0; }
.cmpl-check-label { font-size: 12.5px; color: #0A0A0A; line-height: 1.4; }
.cmpl-check-row.is-checked .cmpl-check-label { color: #15803D; }
.cmpl-actions { display: flex; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--border-t, #E7E5E0); justify-content: flex-end; }
.cmpl-actions .t-btn { height: 32px; padding: 0 14px; font-size: 12.5px; }

/* Data Vault (v3 Part 10) */
.vault-locked-panel { padding: 0; }
.vault-locked { padding: 60px 32px; text-align: center; max-width: 480px; margin: 0 auto; }
.vault-locked-icon { display: flex; justify-content: center; color: var(--text-muted, #94a3b8); margin-bottom: 14px; }
.vault-locked-title { font-family: var(--serif, Georgia, serif); font-size: 26px; color: #0A0A0A; margin-bottom: 6px; }
.vault-locked-sub { font-size: 13px; color: var(--text-secondary, #475569); margin-bottom: 18px; line-height: 1.5; }
.vault-locked-security { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 22px; line-height: 1.8; text-align: left; max-width: 360px; margin-left: auto; margin-right: auto; }

.vault-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-t, #E7E5E0); flex-wrap: wrap; }
.vault-unlocked-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(22,163,74,0.10); color: #15803D; font-size: 11.5px; font-weight: 600; border: 1px solid rgba(22,163,74,0.30); }
.vault-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.vault-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border-t, #E7E5E0); background: #FFFFFF; cursor: pointer; font-family: var(--sans, system-ui, sans-serif); font-size: 11.5px; color: var(--text-secondary, #475569); transition: background 120ms ease, color 120ms ease; }
.vault-tab:hover { background: var(--bg-panel-elev, #FBFAF6); color: #0A0A0A; }
.vault-tab.is-active { background: #0A0A0A; color: #FFFFFF; border-color: #0A0A0A; }
.vault-tab-count { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; opacity: 0.7; }
.vault-relock { font-size: 11.5px; }
.vault-docs { padding: 14px 16px; }
.vault-empty { padding: 50px 24px; text-align: center; }
.vault-doc { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border-t, #E7E5E0); border-radius: 8px; margin-bottom: 8px; background: #FFFFFF; }
.vault-doc-glyph { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-panel-elev, #FBFAF6); display: flex; align-items: center; justify-content: center; font-family: var(--serif, Georgia, serif); font-size: 18px; color: var(--text-secondary, #475569); }
.vault-doc-title { font-size: 13.5px; font-weight: 500; color: #0A0A0A; }
.vault-doc-sub { font-size: 12px; color: var(--text-secondary, #475569); margin-top: 2px; line-height: 1.4; }
.vault-doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 6px; }
.vault-doc-kind { font-weight: 600; color: var(--text-secondary, #475569); }
.vault-doc-hash { font-family: var(--mono, ui-monospace, monospace); }

.vault-preview { position: relative; padding: 4px 0; max-height: 60vh; overflow-y: auto; }
.vault-watermark { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-25deg); font-family: var(--serif, Georgia, serif); font-size: 22px; color: rgba(15,23,42,0.07); white-space: nowrap; pointer-events: none; user-select: none; letter-spacing: 0.04em; z-index: 0; }
.vault-preview-head { padding-bottom: 12px; border-bottom: 1px solid var(--border-t, #E7E5E0); margin-bottom: 14px; position: relative; z-index: 1; }
.vault-preview-eyebrow { font-family: var(--mono, ui-monospace, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted, #94a3b8); margin-bottom: 6px; }
.vault-preview-title { font-family: var(--serif, Georgia, serif); font-size: 22px; color: #0A0A0A; line-height: 1.15; }
.vault-preview-sub { font-size: 12.5px; color: var(--text-secondary, #475569); margin-top: 4px; }
.vault-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 0 0 14px; position: relative; z-index: 1; }
.vault-kv > div { display: flex; flex-direction: column; gap: 2px; }
.vault-kv dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #94a3b8); font-weight: 600; }
.vault-kv dd { font-size: 13px; color: #0A0A0A; margin: 0; }
.vault-empty-payload { font-size: 12px; color: var(--text-muted, #94a3b8); padding: 14px 0; position: relative; z-index: 1; }
.vault-preview-foot { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border-t, #E7E5E0); border-bottom: 1px solid var(--border-t, #E7E5E0); font-size: 11px; color: var(--text-secondary, #475569); position: relative; z-index: 1; }
.vault-preview-foot strong { color: var(--text-muted, #94a3b8); margin-right: 4px; }
.vault-access { margin-top: 14px; position: relative; z-index: 1; }
.vault-access-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #94a3b8); font-weight: 600; margin-bottom: 6px; }
.vault-access-row { display: grid; grid-template-columns: 180px 1fr 120px; gap: 10px; padding: 6px 0; font-size: 11px; color: var(--text-secondary, #475569); border-bottom: 1px solid var(--border-t-soft, #EFEDE6); font-family: var(--mono, ui-monospace, monospace); }
.vault-access-row:last-child { border-bottom: 0; }

/* Buttons */
html.terminal .t-btn,
html.terminal button.t-btn,
html.terminal a.t-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--bg-panel-elev);
  color: var(--text-primary);
  border: 1px solid var(--border-t);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
html.terminal .t-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
html.terminal .t-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
html.terminal .t-btn-primary:hover { background: var(--accent-hover); color: #FFFFFF; }
html.terminal .t-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Inputs */
html.terminal .t-input,
html.terminal input.t-input,
html.terminal select.t-input {
  height: 32px;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
}
html.terminal .t-input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
html.terminal .t-input::placeholder { color: var(--text-muted); }

/* Chip */
html.terminal .t-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 3px;
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  color: var(--text-secondary);
  cursor: pointer;
}
html.terminal .t-chip:hover { color: var(--text-primary); border-color: var(--text-secondary); }
html.terminal .t-chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Modal */
.t-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  padding: 20px;
}
.t-modal.is-open { display: flex; }
.t-modal .modal-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: 6px;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.t-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-t);
  background: var(--bg-base);
}
.t-modal .modal-title {
  font-family: var(--font-sans, "Inter", sans-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
}
.t-modal .modal-header .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.t-modal .modal-header .icon-btn:hover {
  background: var(--bg-panel);
  color: var(--text-primary);
  border-color: var(--border-t);
}
.t-modal .modal-body { padding: 20px 22px; }
.t-modal .modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--border-t);
  background: var(--bg-panel);
}
.t-modal label {
  display: block;
  font-family: var(--font-sans, "Inter", sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.t-modal select, .t-modal input, .t-modal textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--dur-fast, 120ms) var(--ease-out, ease-out),
              box-shadow var(--dur-fast, 120ms) var(--ease-out, ease-out);
}
.t-modal select:hover, .t-modal input:hover, .t-modal textarea:hover {
  border-color: #D4D4D4;
}
.t-modal select:focus, .t-modal input:focus, .t-modal textarea:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}

/* Toast - dark */
html.terminal .db-toast {
  background: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
}

/* Sector heat tiles */
.t-heatgrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
@media (max-width: 640px) {
  .t-heatgrid { grid-template-columns: repeat(2, 1fr); }
}
.t-heat {
  padding: 10px;
  border-radius: 3px;
  border: 1px solid var(--border-t);
  background: var(--bg-panel-elev);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.t-heat .name {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.2;
}
.t-heat .pct {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}
.t-heat.up    { background: rgba(22,163,74,0.12);  border-color: rgba(22,163,74,0.3); }
.t-heat.up.up-strong { background: rgba(22,163,74,0.28); }
.t-heat.down  { background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.3); }
.t-heat.down.down-strong { background: rgba(220,38,38,0.28); }
.t-heat .pct.up { color: var(--up); }
.t-heat .pct.down { color: var(--down); }

/* Sparkline svg */
.sparkline { display: inline-block; vertical-align: middle; }
.sparkline path.line { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.sparkline path.line.up { stroke: var(--up); }
.sparkline path.line.down { stroke: var(--down); }

/* Top movers row */
.t-mover-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-t-soft);
}
.t-mover-row:last-child { border-bottom: 0; }
.t-mover-row .name { color: var(--text-primary); font-size: 12px; text-decoration: none; }
.t-mover-row .name:hover { color: var(--accent); }
.t-mover-row .last,
.t-mover-row .pct  { font-family: var(--mono); font-size: 11px; }

/* Tabs */
.t-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-t); margin-bottom: 12px; }
.t-tab {
  padding: 8px 14px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.t-tab:hover { color: var(--text-primary); }
.t-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.t-tabpanel { display: none; }
.t-tabpanel.is-active { display: block; }

/* Form labels in terminal */
html.terminal .field-error { color: var(--down); }

/* Apex chart dark override - reduce internal padding */
.apex-host { width: 100%; }

/* Scrollbar */
html.terminal ::-webkit-scrollbar { width: 10px; height: 10px; }
html.terminal ::-webkit-scrollbar-track { background: var(--bg-base); }
html.terminal ::-webkit-scrollbar-thumb { background: #D4D4D4; border-radius: 4px; }
html.terminal ::-webkit-scrollbar-thumb:hover { background: #2E3848; }

/* Empty state */
html.terminal .t-empty {
  border: 1px dashed var(--border-t);
  background: var(--bg-panel);
  border-radius: 4px;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-secondary);
}
html.terminal .t-empty .empty-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Risk row dark */
html.terminal .risk-row { border-bottom-color: var(--border-t-soft); }
html.terminal .risk-row .note { color: var(--text-secondary); }

/* Timeline dark */
html.terminal .timeline::before { background: var(--border-t); }
html.terminal .timeline-item::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg-panel);
}
html.terminal .timeline-item .when { color: var(--text-muted); }
html.terminal .timeline-item .text { color: var(--text-primary); }

/* Stat tile dark (company.html) */
html.terminal .stat-tile {
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: 4px;
  padding: 14px 16px;
}
html.terminal .stat-tile .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}
html.terminal .stat-tile .value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* News feed item */
.t-news-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-t-soft);
  align-items: start;
}
.t-news-item:last-child { border-bottom: 0; }
.t-news-item .news-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.t-news-item .news-headline {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}
.t-news-item .news-headline a { color: var(--text-primary); text-decoration: none; }
.t-news-item .news-headline a:hover { color: var(--accent); }
.t-news-item .news-source {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-secondary);
  background: var(--bg-panel-elev);
  border: 1px solid var(--border-t);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Star button reused in tables */
html.terminal .star-cell {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 0;
  border-radius: 3px;
}
html.terminal .star-cell:hover { color: var(--accent); background: var(--bg-panel-elev); }
html.terminal .star-cell.is-active { color: var(--accent); }
html.terminal .star-cell.is-active svg { fill: var(--accent); }

/* Kebab button */
html.terminal .kebab-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: 3px;
}
html.terminal .kebab-btn:hover { color: var(--accent); background: var(--bg-panel-elev); }

/* Help / shortcuts dialog content */
.shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  align-items: center;
}
.shortcuts-grid kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-primary);
}
.shortcuts-grid .desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Mobile menu trigger */
.t-mobile-trigger { display: none; }
@media (max-width: 900px) {
  .t-mobile-trigger { display: inline-flex; }
}

/* ==========================================================================
   DESIGN REFRESH — radius scale, motion system, type scale, elevation, color
   Appended 2026-05-20. Overrides earlier rules where they collide.
   ========================================================================== */

html.terminal {
  /* --- Radius scale --- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* --- Motion --- */
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:     120ms;
  --dur-med:      200ms;
  --dur-slow:     320ms;

  /* --- Type scale --- */
  --fs-xxs: 10px;   --lh-xxs: 1.4;
  --fs-xs:  11px;   --lh-xs:  1.45;
  --fs-sm:  12px;   --lh-sm:  1.5;
  --fs-md:  13px;   --lh-md:  1.55;
  --fs-base:14px;   --lh-base:1.6;
  --fs-lg:  16px;   --lh-lg:  1.55;
  --fs-xl:  19px;   --lh-xl:  1.4;
  --fs-2xl: 24px;   --lh-2xl: 1.3;
  --fs-3xl: 30px;   --lh-3xl: 1.2;
  --fs-4xl: 40px;   --lh-4xl: 1.1;

  --tracking-tight: -0.02em;
  --tracking-snug:  -0.01em;
  --tracking-normal: 0;
  --tracking-wide:  0.04em;
  --tracking-eyebrow: 0.14em;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-display:  800;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: var(--mono);

  /* --- Elevation (white/black-friendly shadows) --- */
  --shadow-xs: 0 1px 1px rgba(10, 10, 10, 0.04);
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.05), 0 1px 1px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(10, 10, 10, 0.08), 0 2px 4px -1px rgba(10, 10, 10, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(10, 10, 10, 0.12), 0 4px 8px -2px rgba(10, 10, 10, 0.06);
  --shadow-pop: 0 16px 40px -10px rgba(10, 10, 10, 0.18), 0 4px 12px -2px rgba(10, 10, 10, 0.08);

  --ring: 0 0 0 3px rgba(10, 10, 10, 0.08);
  --ring-focus: 0 0 0 3px rgba(10, 10, 10, 0.18);

  /* --- Status (muted, refined) --- */
  --c-up-bg:   rgba(22, 163, 74, 0.10);
  --c-up-fg:   #15803D;
  --c-up-bd:   rgba(22, 163, 74, 0.28);
  --c-down-bg: rgba(220, 38, 38, 0.10);
  --c-down-fg: #B91C1C;
  --c-down-bd: rgba(220, 38, 38, 0.28);
  --c-warn-bg: rgba(180, 83, 9, 0.10);
  --c-warn-fg: #92400E;
  --c-warn-bd: rgba(180, 83, 9, 0.28);
  --c-info-bg: rgba(31, 41, 55, 0.06);
  --c-info-fg: #1F2937;
  --c-info-bd: rgba(31, 41, 55, 0.18);
}

/* ----- Body typography ----- */
html.terminal, html.terminal body {
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html.terminal h1, html.terminal h2, html.terminal h3, html.terminal h4 {
  font-family: var(--font-sans);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

html.terminal .num,
html.terminal .mono,
html.terminal .db-num,
html.terminal .kpi-value {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero", "ss03";
  letter-spacing: var(--tracking-snug);
}

/* ----- Buttons ----- */
html.terminal .t-btn,
html.terminal .t-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: var(--fs-md);
  letter-spacing: var(--tracking-normal);
  padding: 7px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-t);
  background: var(--bg-base);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-spring);
  will-change: transform;
}
html.terminal .t-btn:hover {
  background: var(--bg-panel);
  border-color: #D4D4D4;
}
html.terminal .t-btn:active {
  transform: scale(0.97);
  background: var(--bg-panel-elev);
}
html.terminal .t-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

html.terminal .t-btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}
html.terminal .t-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-sm);
}
html.terminal .t-btn-primary:active {
  transform: scale(0.97);
}
html.terminal .t-btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.22);
}
html.terminal .t-btn:disabled,
html.terminal .t-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ----- Inputs ----- */
html.terminal .t-input {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-t);
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
html.terminal .t-input::placeholder { color: var(--text-muted); }
html.terminal .t-input:hover { border-color: #D4D4D4; }
html.terminal .t-input:focus,
html.terminal .t-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}
html.terminal textarea.t-input { min-height: 88px; line-height: 1.55; resize: vertical; }
html.terminal select.t-input { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* ----- Chips ----- */
html.terminal .t-chip {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-t);
  background: var(--bg-base);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
html.terminal .t-chip:hover { border-color: #D4D4D4; color: var(--text-primary); background: var(--bg-panel); }
html.terminal .t-chip.is-active { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
html.terminal .t-chip:active { transform: scale(0.96); }

/* ----- Panels ----- */
html.terminal .panel {
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
html.terminal .panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-t-soft);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
html.terminal .panel-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: var(--tracking-eyebrow);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
}
html.terminal .panel-sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ----- KPI cards ----- */
html.terminal .kpi-card {
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out),
              transform var(--dur-med) var(--ease-spring);
}
html.terminal .kpi-card:hover {
  border-color: #D4D4D4;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
html.terminal .kpi-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}
html.terminal .kpi-value {
  font-size: var(--fs-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-top: 6px;
}

/* ----- Tables ----- */
html.terminal .db-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
}
html.terminal .db-table thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-t);
  background: var(--bg-base);
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 1;
}
html.terminal .db-table thead th.no-sort { cursor: default; }
html.terminal .db-table thead th .arrow {
  display: inline-block;
  width: 8px;
  text-align: right;
  margin-left: 4px;
  opacity: 0.35;
  transition: opacity var(--dur-fast) var(--ease-out);
}
html.terminal .db-table thead th[data-dir]      .arrow { opacity: 1; color: var(--text-primary); }
html.terminal .db-table thead th[data-dir="asc"]  .arrow::before { content: "▲"; }
html.terminal .db-table thead th[data-dir="desc"] .arrow::before { content: "▼"; }
html.terminal .db-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-t-soft);
  color: var(--text-primary);
  vertical-align: middle;
}
html.terminal .db-table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}
html.terminal .db-table tbody tr:hover { background: var(--bg-row-hover); }
html.terminal .db-table .num,
html.terminal .db-table .text-right { text-align: right; }
html.terminal .db-table .num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero";
}
html.terminal .db-table a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}
html.terminal .db-table a:hover { border-bottom-color: var(--accent); }

/* ----- Badges ----- */
html.terminal .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  padding: 3px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-t);
  color: var(--text-secondary);
  background: var(--bg-panel);
}
html.terminal .badge-success { background: var(--c-up-bg);   color: var(--c-up-fg);   border-color: var(--c-up-bd); }
html.terminal .badge-danger  { background: var(--c-down-bg); color: var(--c-down-fg); border-color: var(--c-down-bd); }
html.terminal .badge-warning { background: var(--c-warn-bg); color: var(--c-warn-fg); border-color: var(--c-warn-bd); }
html.terminal .badge-info    { background: var(--c-info-bg); color: var(--c-info-fg); border-color: var(--c-info-bd); }

/* ----- Workspace nav (sidebar) ----- */
html.terminal .workspace-nav {
  background: var(--bg-base);
  border-right: 1px solid var(--border-t);
  padding: 18px 12px 18px;
}
html.terminal .workspace-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: var(--fs-md);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
  position: relative;
}
html.terminal .workspace-nav a:hover { background: var(--bg-panel); color: var(--text-primary); }
html.terminal .workspace-nav a:active { transform: scale(0.98); }
html.terminal .workspace-nav a.is-active {
  background: var(--bg-panel);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  box-shadow: inset 3px 0 0 var(--accent);
}
html.terminal .workspace-nav .nav-section-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 12px 8px;
}
html.terminal .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ----- Star (favourite) ----- */
html.terminal .star-cell {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  line-height: 0;
  border-radius: var(--r-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
html.terminal .star-cell:hover { color: var(--accent); background: var(--bg-panel); }
html.terminal .star-cell:active { transform: scale(0.85); }
html.terminal .star-cell.is-active { color: var(--accent); animation: pop var(--dur-med) var(--ease-spring); }
html.terminal .star-cell.is-active svg { fill: var(--accent); }
@keyframes pop {
  0%   { transform: scale(0.85); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ----- Kebab ----- */
html.terminal .kebab-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
html.terminal .kebab-btn:hover { color: var(--text-primary); background: var(--bg-panel); }

/* ----- Modal + popover entry -----
   The .t-modal element is the full-viewport backdrop (flex-centered).
   Radii, shadow, and the scale animation belong on the inner .modal-panel,
   not the backdrop — otherwise the whole viewport shifts off-center. */
html.terminal .t-modal {
  animation: fade-in var(--dur-med) var(--ease-out) both;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
html.terminal .t-modal .modal-panel {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  animation: panel-in var(--dur-med) var(--ease-spring) both;
}
html.terminal .t-popover {
  animation: pop-in var(--dur-fast) var(--ease-spring) both;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-pop) !important;
}
html.terminal .t-popover button { border-radius: var(--r-sm); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ----- Toast ----- */
html.terminal .db-toast,
html.terminal .t-toast {
  animation: toast-in var(--dur-slow) var(--ease-spring) both;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-lg) !important;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- Header ----- */
html.terminal .t-header {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-t);
  padding: 12px 22px;
}
html.terminal .t-header .brand-mark { border-radius: var(--r-sm); }
html.terminal .t-header .icon-btn { border-radius: var(--r-md); }
html.terminal .t-header .icon-btn:active { transform: scale(0.92); }
html.terminal .t-header .t-profile-btn { border-radius: var(--r-md); transition: background var(--dur-fast) var(--ease-out); }

/* ----- Menus + popover ----- */
html.terminal .t-menu {
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  animation: pop-in var(--dur-fast) var(--ease-spring) both;
}
html.terminal .t-menu a, html.terminal .t-menu button { border-radius: var(--r-sm); }

/* ----- Workspace content padding (give it room to breathe) ----- */
html.terminal .workspace-content { padding: 28px 32px 48px; }
@media (max-width: 720px) { html.terminal .workspace-content { padding: 18px 16px 32px; } }

/* ----- Heading sizes inside workspace content ----- */
html.terminal .workspace-content h1 {
  font-size: var(--fs-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-2xl);
}

/* ----- Settings sub-nav links ----- */
html.terminal .settings-nav a {
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
html.terminal .settings-nav a:active { transform: scale(0.98); }

/* ----- Toggle (refined) ----- */
html.terminal .toggle-slider {
  border-radius: var(--r-full);
  transition: background var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out);
}
html.terminal .toggle-slider::before {
  border-radius: 50%;
  transition: transform var(--dur-med) var(--ease-spring),
              background var(--dur-med) var(--ease-out);
}

/* ----- Reduced motion safety ----- */
@media (prefers-reduced-motion: reduce) {
  html.terminal *, html.terminal *::before, html.terminal *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----- Scrollbars (subtle, light theme) ----- */
html.terminal ::-webkit-scrollbar { width: 10px; height: 10px; }
html.terminal ::-webkit-scrollbar-track { background: var(--bg-panel); }
html.terminal ::-webkit-scrollbar-thumb {
  background: #D4D4D4;
  border-radius: var(--r-full);
  border: 2px solid var(--bg-panel);
}
html.terminal ::-webkit-scrollbar-thumb:hover { background: #A3A3A3; }

/* ==========================================================================
   DEAL ROOM components
   ========================================================================== */

/* Pipeline stages */
html.terminal .pipe-stages {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px;
}
html.terminal .pipe-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-t);
  background: var(--bg-base);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
}
html.terminal .pipe-step:not(:last-child)::after {
  content: "→";
  margin-left: 8px;
  margin-right: -8px;
  color: var(--border-t);
}
html.terminal .pipe-step .pipe-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-panel); color: var(--text-muted);
  font-family: var(--font-mono); font-size: 10px; font-weight: var(--weight-semibold);
}
html.terminal .pipe-step.is-done { border-color: var(--c-up-bd); color: var(--c-up-fg); background: var(--c-up-bg); }
html.terminal .pipe-step.is-done .pipe-dot { background: var(--c-up-fg); color: #FFFFFF; }
html.terminal .pipe-step.is-current { border-color: var(--accent); color: var(--accent); background: var(--bg-base); font-weight: var(--weight-semibold); box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06); }
html.terminal .pipe-step.is-current .pipe-dot { background: var(--accent); color: #FFFFFF; }

/* Documents (data room) */
html.terminal .doc-folder { border-bottom: 1px solid var(--border-t-soft); }
html.terminal .doc-folder:last-child { border-bottom: 0; }
html.terminal .doc-folder-hdr {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 12px 16px; background: transparent; border: 0; cursor: pointer;
  color: var(--text-primary); font-weight: var(--weight-semibold); font-size: var(--fs-md);
  transition: background var(--dur-fast) var(--ease-out);
}
html.terminal .doc-folder-hdr:hover { background: var(--bg-panel); }
html.terminal .doc-folder-hdr .caret { font-size: 10px; color: var(--text-muted); width: 12px; text-align: center; }
html.terminal .doc-folder-hdr .doc-folder-count {
  margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-muted); padding: 2px 8px; border-radius: var(--r-full);
  border: 1px solid var(--border-t);
}
html.terminal .doc-folder-body { padding: 0 16px 10px 38px; }
html.terminal .doc-item {
  display: grid;
  grid-template-columns: 44px 1fr auto auto auto;
  gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-md);
  transition: background var(--dur-fast) var(--ease-out);
}
html.terminal .doc-item:hover { background: var(--bg-panel); }
html.terminal .doc-item .doc-type {
  font-family: var(--font-mono); font-size: 9px;
  font-weight: var(--weight-bold); letter-spacing: 0.1em;
  padding: 3px 6px; border-radius: var(--r-xs);
  background: var(--bg-panel-elev); color: var(--text-secondary);
  border: 1px solid var(--border-t);
  text-align: center;
}
html.terminal .doc-item .doc-name { font-size: var(--fs-md); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.terminal .doc-item .doc-meta { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
html.terminal .doc-item .doc-lock { width: 18px; text-align: center; font-size: 12px; color: var(--c-warn-fg); }
html.terminal .doc-item .doc-action { white-space: nowrap; }

/* DD checklist */
html.terminal .dd-item {
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  margin-bottom: 8px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
html.terminal .dd-item:last-child { margin-bottom: 0; }
html.terminal .dd-item:hover { border-color: #D4D4D4; }
html.terminal .dd-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
html.terminal .dd-name { font-size: var(--fs-md); font-weight: var(--weight-medium); color: var(--text-primary); }
html.terminal .dd-fraction { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
html.terminal .dd-bar {
  height: 6px; border-radius: var(--r-full);
  background: var(--bg-panel-elev); overflow: hidden; margin-top: 6px;
}
html.terminal .dd-bar-fill {
  height: 100%; background: var(--accent);
  transition: width var(--dur-slow) var(--ease-out);
}
html.terminal .dd-item.is-complete .dd-bar-fill { background: var(--c-up-fg); }
html.terminal .dd-item.is-ontrack  .dd-bar-fill { background: var(--accent); }
html.terminal .dd-item.is-midway   .dd-bar-fill { background: var(--c-warn-fg); }
html.terminal .dd-item.is-early    .dd-bar-fill { background: var(--c-down-fg); }
html.terminal .dd-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; font-family: var(--font-mono); }

/* Q&A */
html.terminal .qa-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-t-soft);
}
html.terminal .qa-item:last-child { border-bottom: 0; }
html.terminal .qa-item .qa-q {
  font-size: var(--fs-md); font-weight: var(--weight-medium);
  color: var(--text-primary); display: flex; gap: 10px; align-items: baseline;
}
html.terminal .qa-item .qa-num {
  font-family: var(--font-mono); font-size: 10px; font-weight: var(--weight-bold);
  color: var(--accent); letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: var(--r-xs);
  background: var(--accent-soft);
}
html.terminal .qa-item .qa-a {
  font-size: var(--fs-md); color: var(--text-secondary);
  line-height: 1.6; margin-top: 6px; padding-left: 28px;
}
html.terminal .qa-item .qa-from {
  display: inline-block; margin-right: 8px;
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}

/* IC vote pills */
html.terminal .ic-vote {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-weight: var(--weight-bold); font-size: var(--fs-xs);
  border: 1px solid var(--border-t);
}
html.terminal .ic-vote.vote-yes { background: var(--c-up-bg);   color: var(--c-up-fg);   border-color: var(--c-up-bd); }
html.terminal .ic-vote.vote-no  { background: var(--c-down-bg); color: var(--c-down-fg); border-color: var(--c-down-bd); }
html.terminal .ic-vote.vote-abs { background: var(--bg-panel);  color: var(--text-secondary); }

/* ==========================================================================
   EDITORIAL OVERHAUL — moving the workspace off the "Bloomberg terminal" feel
   toward a subscription business-data product. Sentence-case, warmer colors,
   serif hero, content cards.
   ========================================================================== */

/* ---- Brand mark in the header (no longer DATA**BANK** caps) ---- */
html.terminal .t-header .brand-mark {
  background: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  border-radius: var(--r-sm);
}
html.terminal .t-header .brand-text {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
}
html.terminal .t-header .brand-text .accent { color: var(--text-primary); }

/* ---- Top search (replaces the green CMD> prompt) ---- */
.t-topsearch {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 480px;
  margin-left: 12px;
}
.t-topsearch-icon {
  position: absolute;
  left: 12px;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
}
.t-topsearch input {
  width: 100%;
  height: 36px;
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: var(--r-md);
  padding: 0 14px 0 36px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.t-topsearch input::placeholder { color: var(--text-muted); }
.t-topsearch input:hover { border-color: #D4D4D4; background: var(--bg-base); }
.t-topsearch input:focus {
  outline: none;
  background: var(--bg-base);
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
@media (max-width: 900px) {
  .t-topsearch { display: none; }
}

/* ---- Hide ticker tape and command bar if they ever render (defensive) ---- */
html.terminal .t-ticker,
html.terminal .t-cmd { display: none !important; }

/* ---- Panel titles: sentence case, sans, not green-on-dark mono caps ---- */
html.terminal .panel {
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 0 rgba(10, 10, 10, 0.02);
  overflow: hidden;
}
html.terminal .panel-header {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-t-soft);
  padding: 18px 22px;
  align-items: flex-start;
}
html.terminal .panel-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
  line-height: 1.25;
}
html.terminal .panel-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 3px;
}
html.terminal .panel-body { padding: 18px 22px; }

/* Apex chart host — keep tooltips/markers from getting clipped by panel overflow */
.apex-host { width: 100%; position: relative; }
.apex-host .apexcharts-tooltip {
  border-radius: 10px !important;
  border: 1px solid var(--border-t) !important;
  box-shadow: 0 8px 24px -6px rgba(10, 10, 10, 0.18) !important;
  background: #FFFFFF !important;
  font-family: "Inter", system-ui, sans-serif !important;
  overflow: hidden;
}
.apex-host .apexcharts-tooltip-title {
  background: var(--bg-panel) !important;
  border-bottom: 1px solid var(--border-t-soft) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
}
.apex-host .apexcharts-tooltip-series-group { padding: 4px 12px 8px !important; }
.apex-host .apexcharts-tooltip-y-group { padding: 0 !important; }
.apex-host .apexcharts-xaxistooltip,
.apex-host .apexcharts-yaxistooltip {
  background: var(--text-primary) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 6px !important;
  font-family: "Inter", system-ui, sans-serif !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
}
.apex-host .apexcharts-xaxistooltip::before,
.apex-host .apexcharts-xaxistooltip::after,
.apex-host .apexcharts-yaxistooltip::before,
.apex-host .apexcharts-yaxistooltip::after { display: none !important; }
.apex-host .apexcharts-gridlines-horizontal line,
.apex-host .apexcharts-gridlines-vertical line { stroke: var(--border-t-soft) !important; }

/* Tables — sentence-case headers in sans */
html.terminal .db-table thead th {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  background: var(--bg-base);
}

/* KPI labels — sentence-case, no mono caps */
html.terminal .kpi-card .label,
html.terminal .kpi-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}
html.terminal .kpi-card .value,
html.terminal .kpi-value {
  font-family: var(--font-sans);
  font-feature-settings: "tnum";
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
html.terminal .kpi-card .delta {
  font-family: var(--font-sans);
  font-feature-settings: "tnum";
  font-size: 12px;
}
html.terminal .kpi-card .kpi-spark { display: none; }  /* the lurking sparkline in the corner felt too "trading desk" */

/* Sidebar: warmer, no caps-mono section label */
html.terminal .workspace-nav { padding-top: 22px; }
html.terminal .workspace-nav .nav-section-label { display: none; }
html.terminal .workspace-nav a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-radius: var(--r-md);
  padding: 9px 12px;
}
html.terminal .workspace-nav a.is-active {
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Accent — apply it for real now (was masked to black before) */
html.terminal .t-btn-primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #FFFFFF;
}
html.terminal .t-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ===== Editorial workspace home (room/index.html) ===== */

/* Date / eyebrow above the greeting */
html.terminal .wh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
html.terminal .wh-eyebrow .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--accent);
}

/* Greeting hero */
html.terminal .wh-greeting {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  max-width: 28ch;
}
html.terminal .wh-greeting em { font-style: italic; }
html.terminal .wh-dek {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 56ch;
}
@media (max-width: 640px) {
  html.terminal .wh-greeting { font-size: 32px; }
  html.terminal .wh-dek { font-size: 15px; }
}

/* Quick actions row */
html.terminal .wh-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Snapshot strip — at-a-glance stats without KPI-card noise */
html.terminal .wh-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border-t);
  border-bottom: 1px solid var(--border-t);
  margin-top: 28px;
}
html.terminal .wh-snap {
  padding: 22px 24px;
  border-right: 1px solid var(--border-t);
}
html.terminal .wh-snap:last-child { border-right: 0; }
html.terminal .wh-snap-value {
  font-family: var(--font-sans);
  font-feature-settings: "tnum";
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
html.terminal .wh-snap-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
@media (max-width: 700px) {
  html.terminal .wh-snapshot { grid-template-columns: repeat(2, 1fr); }
  html.terminal .wh-snap { padding: 16px 18px; }
  html.terminal .wh-snap:nth-child(2) { border-right: 0; }
  html.terminal .wh-snap:nth-child(1),
  html.terminal .wh-snap:nth-child(2) { border-bottom: 1px solid var(--border-t); }
  html.terminal .wh-snap-value { font-size: 24px; }
}

/* Subscription banner */
html.terminal .wh-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-t);
  background: var(--bg-panel);
  margin-top: 28px;
  flex-wrap: wrap;
}
html.terminal .wh-sub-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
html.terminal .wh-sub-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 9999px;
  background: var(--text-primary);
  color: #fff;
}
html.terminal .wh-sub-text {
  font-size: 14px;
  color: var(--text-primary);
}
html.terminal .wh-sub-text strong { font-weight: 600; }
html.terminal .wh-sub-meter {
  width: 120px;
  height: 6px;
  background: var(--bg-panel-elev);
  border-radius: 9999px;
  overflow: hidden;
}
html.terminal .wh-sub-meter > span {
  display: block;
  height: 100%;
  background: var(--text-primary);
}
html.terminal .wh-sub-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
html.terminal .wh-sub-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Section header (used across the home page) */
html.terminal .wh-section { margin-top: 56px; }
html.terminal .wh-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
html.terminal .wh-section-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
html.terminal .wh-section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-primary);
}
html.terminal .wh-section-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}
html.terminal .wh-section-link:hover { color: var(--accent); }

/* Companies-worth-watching card grid */
html.terminal .wh-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 980px) { html.terminal .wh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { html.terminal .wh-cards { grid-template-columns: 1fr; } }

html.terminal .wh-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-t);
  background: var(--bg-base);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-out);
}
html.terminal .wh-card:hover {
  border-color: rgba(10, 10, 10, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
html.terminal .wh-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
html.terminal .wh-card-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
/* Variant that holds a real logo image — light bg + bordered square so the logo reads cleanly */
html.terminal .wh-card-logo-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}
html.terminal .wh-card-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
html.terminal .wh-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
html.terminal .wh-card-sector {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}
html.terminal .wh-card-why {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 8px 0 16px;
}
html.terminal .wh-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-t-soft);
}
html.terminal .wh-card-price {
  font-feature-settings: "tnum";
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
html.terminal .wh-card-change {
  font-feature-settings: "tnum";
  font-size: 12px;
  font-weight: 500;
  margin-left: 6px;
}

/* Editorial briefing cards (sectors) */
html.terminal .wh-briefings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 760px) { html.terminal .wh-briefings { grid-template-columns: 1fr; } }

html.terminal .wh-brief {
  display: block;
  padding: 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-t);
  background: var(--bg-panel);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
html.terminal .wh-brief:hover {
  border-color: var(--text-primary);
  transform: translateY(-2px);
}
html.terminal .wh-brief-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
html.terminal .wh-brief-eyebrow .dot {
  width: 5px; height: 5px; border-radius: 9999px; background: var(--accent);
}
html.terminal .wh-brief-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 10px;
}
html.terminal .wh-brief-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}
html.terminal .wh-brief-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Watchlist mini-list */
html.terminal .wh-watch {
  border-radius: var(--r-lg);
  border: 1px solid var(--border-t);
  background: var(--bg-base);
  overflow: hidden;
}
html.terminal .wh-watch-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-t-soft);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-fast) var(--ease-out);
}
html.terminal .wh-watch-row:last-child { border-bottom: 0; }
html.terminal .wh-watch-row:hover { background: var(--bg-panel); }
html.terminal .wh-watch-logo {
  width: 32px; height: 32px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 13px;
}
html.terminal .wh-watch-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
html.terminal .wh-watch-sector { font-size: 12px; color: var(--text-muted); }
html.terminal .wh-watch-price {
  font-feature-settings: "tnum";
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  text-align: right;
}
html.terminal .wh-watch-change {
  font-feature-settings: "tnum";
  font-size: 12px; font-weight: 500;
  min-width: 64px; text-align: right;
}

/* Setup / Activity stacked side cards */
html.terminal .wh-side-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 24px;
}
@media (max-width: 900px) { html.terminal .wh-side-grid { grid-template-columns: 1fr; } }

html.terminal .wh-mini {
  padding: 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-t);
  background: var(--bg-base);
}
html.terminal .wh-mini-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}
html.terminal .wh-mini ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
html.terminal .wh-mini li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}
html.terminal .wh-mini li .check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 9999px; flex-shrink: 0;
  background: var(--bg-panel-elev); color: var(--text-muted);
  font-size: 10px; margin-top: 1px;
}
html.terminal .wh-mini li.done .check { background: var(--up); color: #fff; }
html.terminal .wh-mini li.current .check { background: var(--accent); color: #fff; }
html.terminal .wh-mini li.done { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-t); }
html.terminal .wh-mini li.current { color: var(--text-primary); font-weight: 500; }

html.terminal .wh-mini-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
html.terminal .wh-mini-progress-bar {
  flex: 1; height: 6px; border-radius: 9999px;
  background: var(--bg-panel-elev); overflow: hidden;
}
html.terminal .wh-mini-progress-bar > span {
  display: block; height: 100%; background: var(--accent);
}
html.terminal .wh-mini-progress-pct {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  font-feature-settings: "tnum";
}

/* Activity items — sentence case, no badges */
html.terminal .wh-activity {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column;
}
html.terminal .wh-activity li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-t-soft);
}
html.terminal .wh-activity li:last-child { border-bottom: 0; }
html.terminal .wh-activity .who {
  width: 32px; height: 32px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 11px;
}
html.terminal .wh-activity .txt {
  font-size: 13px; color: var(--text-primary); line-height: 1.5;
}
html.terminal .wh-activity .when {
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
  font-feature-settings: "tnum";
}

/* ==========================================================================
   SUBSCRIPTION TAGS, PAYWALL, PAYMENT MODAL
   ========================================================================== */

/* Subscription tag (pill) — appears on every business in the system */
html.terminal .sub-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid var(--border-t);
  background: var(--bg-base);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
  font-family: var(--font-sans);
}
html.terminal .sub-tag:hover { border-color: var(--text-primary); transform: translateY(-1px); }
html.terminal .sub-tag:active { transform: translateY(0); }
html.terminal .sub-tag .sub-tag-dot {
  width: 6px; height: 6px; border-radius: 9999px; background: var(--accent);
}
html.terminal .sub-tag.locked .sub-tag-dot { background: var(--accent); }
html.terminal .sub-tag.locked { background: var(--bg-base); color: var(--text-primary); }
html.terminal .sub-tag.locked:hover { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
html.terminal .sub-tag.locked:hover .sub-tag-dot { background: var(--accent); }

html.terminal .sub-tag.subscribed {
  background: rgba(21, 128, 61, 0.08);
  border-color: rgba(21, 128, 61, 0.25);
  color: var(--up);
  cursor: default;
}
html.terminal .sub-tag.subscribed:hover { transform: none; }
html.terminal .sub-tag.subscribed .sub-tag-dot { background: var(--up); }

/* Lock icon (small) */
html.terminal .sub-tag svg { width: 11px; height: 11px; }

/* ---- Paywall overlay (used on company.html sections) ---- */
html.terminal .paywall {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-t);
  background: var(--bg-panel);
  padding: 32px;
  text-align: center;
  overflow: hidden;
}
html.terminal .paywall::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(224, 79, 57, 0.10), transparent 70%),
    var(--bg-panel);
  z-index: 0;
}
html.terminal .paywall > * { position: relative; z-index: 1; }
html.terminal .paywall-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #fff;
  margin-bottom: 14px;
}
html.terminal .paywall-title {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}
html.terminal .paywall-text {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 42ch;
  margin: 0 auto 18px;
  line-height: 1.55;
}

/* ---- Payment modal ---- */
html.terminal .pay-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
html.terminal .pay-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
}
html.terminal .pay-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
html.terminal .pay-price {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1;
}
html.terminal .pay-price .pay-per {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}
html.terminal .pay-includes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
@media (max-width: 540px) {
  html.terminal .pay-includes { grid-template-columns: 1fr; }
}
html.terminal .pay-includes li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
}
html.terminal .pay-includes li::before {
  content: "";
  flex-shrink: 0;
  margin-top: 6px;
  width: 11px;
  height: 6px;
  border: solid var(--up);
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(-45deg);
}
html.terminal .pay-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border-t);
  padding-top: 16px;
}
html.terminal .pay-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  margin: 10px 0 6px;
}
html.terminal .pay-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-feature-settings: "tnum";
  font-size: 14px;
  color: var(--text-primary);
}
html.terminal .pay-input:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
html.terminal .pay-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
html.terminal .pay-fineprint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 12px;
}

/* ---- Sidebar: "Subscribed data" section ---- */
html.terminal .workspace-nav .subs-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-t);
}
html.terminal .workspace-nav .subs-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
html.terminal .workspace-nav .subs-label .count {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--bg-panel-elev);
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 9999px;
}
html.terminal .workspace-nav .sub-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 8px 12px !important;
  border-radius: var(--r-md) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none;
  border-left: 0 !important;
  box-shadow: none !important;
}
html.terminal .workspace-nav .sub-item:hover { background: var(--bg-panel) !important; color: var(--text-primary) !important; }
html.terminal .workspace-nav .sub-item .sub-logo {
  width: 22px; height: 22px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 10px; flex-shrink: 0;
}
html.terminal .workspace-nav .sub-item .sub-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html.terminal .workspace-nav .subs-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
html.terminal .workspace-nav .subs-empty a {
  color: var(--accent);
  text-decoration: none;
}
html.terminal .workspace-nav .subs-empty a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Active filter tags (deals page — replaces the hardcoded chip row) */
html.terminal .active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
html.terminal .filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 12px;
  border-radius: 9999px;
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
html.terminal .filter-tag:hover {
  background: var(--bg-panel-elev);
  border-color: var(--text-primary);
}
html.terminal .filter-tag svg {
  color: var(--text-muted);
  flex-shrink: 0;
}
html.terminal .filter-tag:hover svg { color: var(--accent); }

/* Company-page subscribe banner */
html.terminal .co-sub-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-t);
  margin-bottom: 18px;
  background: var(--bg-panel);
  flex-wrap: wrap;
}
html.terminal .co-sub-banner.is-locked {
  border-color: var(--text-primary);
  box-shadow: 0 1px 0 var(--text-primary);
  background:
    linear-gradient(to right, rgba(224, 79, 57, 0.06), transparent 40%),
    var(--bg-panel);
}
html.terminal .co-sub-banner.is-subscribed {
  border-color: rgba(21, 128, 61, 0.3);
  background: rgba(21, 128, 61, 0.04);
}
html.terminal .co-sub-banner .co-sub-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--text-primary);
  color: #fff;
  flex-shrink: 0;
}
html.terminal .co-sub-banner.is-subscribed .co-sub-icon {
  background: var(--up);
}
html.terminal .co-sub-banner .co-sub-text {
  flex: 1;
  min-width: 200px;
}
html.terminal .co-sub-banner .co-sub-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
html.terminal .co-sub-banner .co-sub-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}
html.terminal .co-sub-banner .co-sub-sub strong {
  font-weight: 600;
  color: var(--text-primary);
  font-feature-settings: "tnum";
}

/* Paywall cover overlay on tab panels */
html.terminal .t-tabpanel.is-paywalled {
  position: relative;
}
html.terminal .t-tabpanel.is-paywalled > :not(.paywall-cover) {
  filter: blur(3px) saturate(0.4);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}
html.terminal .paywall-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.95) 40%);
}
html.terminal .paywall-cover .paywall {
  max-width: 460px;
  width: calc(100% - 32px);
}

/* ===== Deal lifecycle (wizard + deal detail) ===== */
.df-veh-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.df-veh-card {
  text-align: left;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.df-veh-card:hover { border-color: var(--text-primary); }
.df-veh-card.is-selected {
  border-color: var(--text-primary);
  background: var(--bg-elevated, #fafafa);
}
.df-veh-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.df-veh-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.df-veh-defaults {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* Deal page header + stage strip */
.deal-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}
.deal-hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}
.deal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.stage-seg {
  position: relative;
  padding: 12px 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-left: 3px solid var(--border-t);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  text-align: left;
}
.stage-seg:hover { border-color: var(--text-primary); }
.stage-seg.is-done {
  border-left-color: #2e7d32;
}
.stage-seg.is-current {
  border-left-color: var(--text-primary);
  background: var(--bg-elevated, #fafafa);
}
.stage-seg-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.stage-seg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}
.stage-seg.is-done .stage-seg-num::after {
  content: " ✓";
  color: #2e7d32;
}

.stage-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.stage-panel-blurb {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 62ch;
  line-height: 1.5;
}

.deal-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
@media (max-width: 920px) {
  .deal-grid { grid-template-columns: 1fr; }
  .stage-strip { grid-template-columns: repeat(2, 1fr); }
  .df-veh-grid { grid-template-columns: 1fr; }
}

.kv-list { display: grid; gap: 8px; font-size: 13px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; }
.kv-key { color: var(--text-muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; align-self: center; }
.kv-val { color: var(--text-primary); text-align: right; }

.artifact-list { display: grid; gap: 6px; }
.artifact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-t);
  border-radius: 4px;
  font-size: 13px;
}
.artifact-row-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.artifact-row-name { color: var(--text-primary); font-weight: 500; }
.artifact-row-meta { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }

/* AI spinner for portfolio AI summary */
.ai-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-t);
  border-top-color: var(--text-primary);
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* warn badge */
html.terminal .badge-warn { background: rgba(234,179,8,0.12); color: #92400e; border-color: rgba(234,179,8,0.3); }

/* Currency segmented toggle in workspace header */
html.terminal .t-ccy-switch {
  display: inline-flex;
  align-items: stretch;
  height: 30px;
  padding: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--border-t);
  border-radius: 999px;
  margin-right: 6px;
}
html.terminal .t-ccy-seg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
  letter-spacing: 0.02em;
}
html.terminal .t-ccy-seg:hover { color: var(--text-primary); }
html.terminal .t-ccy-seg.is-active {
  background: var(--bg-base);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px var(--border-t);
}
html.terminal .t-ccy-seg .t-ccy-code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
@media (max-width: 720px) {
  html.terminal .t-ccy-seg .t-ccy-code { display: none; }
  html.terminal .t-ccy-seg { padding: 0 10px; }
}

/* ============================================================
   Mobile responsive — consolidated overrides for all the modals
   and grids added during phases 1–6 + audit fixes.
   ============================================================ */

/* Modal panel — narrow viewports get 92vw + smaller padding */
@media (max-width: 720px) {
  html.terminal .t-modal .modal-panel { max-width: 94vw; max-height: 88vh; border-radius: 8px; }
  html.terminal .t-modal .modal-header { padding: 14px 16px; }
  html.terminal .t-modal .modal-title  { font-size: 15.5px; }
  html.terminal .t-modal .modal-body   { padding: 14px 16px; }
  html.terminal .t-modal .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  html.terminal .t-modal .modal-footer .t-btn { flex: 1 1 auto; min-width: 0; }
}

/* 2-col modal grids → 1-col on mobile */
@media (max-width: 640px) {
  .sub-grid,
  .ld-grid,
  .acct-modal-grid,
  .acct-grid,
  .rep-form-grid,
  .vault-kv,
  .pw-grid,
  .pw-switch,
  .ev-form .ld-grid,
  .agr-sig { grid-template-columns: 1fr !important; }
  .acct-modal-grid > div.full,
  .acct-grid > div.acct-cell-wide,
  .rep-fiscal-full { grid-column: 1 / -1; }
  .rep-fiscal { grid-template-columns: 1fr; }
  .ld-cw-grid { grid-template-columns: 1fr; }
  .ld-wrap-grid { grid-template-columns: 1fr; }
}

/* Modal headers (sub-head etc.) stack on mobile */
@media (max-width: 640px) {
  .sub-head, .agr-sig, .cmpl-detail-head { flex-direction: column; align-items: flex-start; }
  .sub-chips, .acct-modal-pills { align-items: flex-start; flex-wrap: wrap; }
}

/* PIN pad — keep on screen */
@media (max-width: 480px) {
  .pin-wrap { max-width: 100%; }
  .pin-pad { gap: 6px; }
  .pin-key { height: 42px; font-size: 17px; }
  .pin-cell { width: 32px; height: 40px; font-size: 20px; }
}

/* Payment instruction modal — wide rows stack */
@media (max-width: 640px) {
  .pay-row { grid-template-columns: 1fr !important; gap: 4px; padding: 10px 12px; }
  .pay-k { font-size: 10px; }
  .pay-ref { flex-wrap: wrap; }
}

/* List-a-Deal wizard step 4 — file rows stack */
@media (max-width: 640px) {
  .ld-file-row, .ev-file-row { grid-template-columns: 1fr; gap: 6px; }
  .ld-file-control, .ev-file-control { justify-content: flex-start; }
  .ld-uop-row { grid-template-columns: 1fr 70px 30px; row-gap: 6px; }
  .ld-uop-row .ld-uop-ngn { grid-column: 1 / -1; text-align: right; }
}

/* Tier upgrade evidence form — fields stack */
@media (max-width: 640px) {
  .ev-field-control { flex-direction: column; align-items: stretch; gap: 8px; }
  .ev-field-status  { min-height: 22px; }
}

/* Paywall — single column under 640 */
@media (max-width: 640px) {
  .pw-grid { gap: 8px; }
  .pw-card { padding: 12px; }
  .pw-card-price { font-size: 18px; }
}

/* Workspace header — wrap on narrow */
@media (max-width: 720px) {
  html.terminal .t-header { padding: 0 12px; gap: 6px; flex-wrap: wrap; height: auto; min-height: 56px; }
  html.terminal .t-topsearch { display: none; }
  html.terminal .t-tier-pill,
  html.terminal .t-verify-pill { margin-right: 2px; }
  html.terminal .t-verify-pill span,
  html.terminal .t-tier-pill { font-size: 10px; }
}

/* Sidebar mobile drawer — add backdrop + full-height */
@media (max-width: 900px) {
  html.terminal .workspace-nav.is-mobile-open {
    inset: 56px 0 0 0;                 /* below the wrap-friendly header */
    height: calc(100vh - 56px);
    width: min(320px, 86vw);
    right: auto;                       /* slide from left only */
    background: var(--bg-base);
    border-right: 1px solid var(--border-t);
    box-shadow: 0 12px 40px rgba(15,23,42,0.12);
    overflow-y: auto;
    padding: 12px 8px 24px;
  }
  /* dim the rest of the screen when drawer is open */
  html.terminal .workspace-nav.is-mobile-open::after {
    content: "";
    position: fixed;
    left: min(320px, 86vw);
    top: 56px;
    right: 0; bottom: 0;
    background: rgba(15,23,42,0.35);
    z-index: -1;
    pointer-events: none;
  }
}

/* Workspace content — tighter on mobile */
@media (max-width: 640px) {
  html.terminal .workspace-content { padding: 14px 12px 28px; }
  html.terminal .workspace-content > header h1,
  html.terminal .workspace-content > header .wh-greeting { font-size: 26px !important; line-height: 1.1; }
  html.terminal .panel-header { padding: 12px 14px; }
}

/* Deal page chart panel — shrink height on mobile */
@media (max-width: 640px) {
  .deal-chart-host { min-height: 200px; padding: 4px 6px 8px; }
  .lc-hero-title { font-size: 22px; }
  .lc-hero-ticker { font-size: 14px; vertical-align: 2px; }
  .lc-pipeline { grid-template-columns: 1fr 1fr; gap: 6px; }
  .lc-group { padding: 10px 10px 12px; }
  .lc-alloc { padding: 12px 14px; }
}

/* Compliance review — checklist row stacks */
@media (max-width: 640px) {
  .cmpl-detail-head { padding: 14px 16px 12px; }
  .cmpl-detail-title { font-size: 18px; }
  .cmpl-detail-status { text-align: left; }
  .cmpl-actions { flex-direction: column-reverse; gap: 8px; padding: 12px 16px 14px; }
  .cmpl-actions .t-btn { width: 100%; }
  .cmpl-check-row { padding: 10px; }
}

/* Vault — preview stacks on mobile */
@media (max-width: 640px) {
  .vault-toolbar { gap: 8px; padding: 10px 12px; }
  .vault-tabs { width: 100%; }
  .vault-doc { grid-template-columns: 32px 1fr; }
  .vault-doc-actions { grid-column: 1 / -1; }
  .vault-access-row { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
  .vault-preview-foot { gap: 6px; }
}

/* Settings — main grid collapse on mobile */
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border-t, #E7E5E0); }
  .settings-nav a { padding: 6px 10px; border-radius: 999px; border-left: 0; font-size: 12px; }
  .settings-nav a.is-active { background: #0A0A0A; color: #FFFFFF; border-color: #0A0A0A; }
}

/* Countersign queue rows stack actions */
@media (max-width: 640px) {
  .cs-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .cs-row-actions { width: 100%; }
  .cs-row-actions .t-btn { flex: 1; }
  .cs-tabs { overflow-x: auto; }
}

/* My listings grid — single col on phone */
@media (max-width: 640px) {
  .my-listings-grid { grid-template-columns: 1fr; }
  .my-listing-stats { grid-template-columns: 1fr 1fr; }
}

/* Alerts modal — toolbar wraps cleanly */
@media (max-width: 640px) {
  .alerts-toolbar { flex-direction: column; align-items: stretch; }
  .alerts-toolbar-actions { justify-content: space-between; }
  .alerts-toolbar-actions .t-btn { flex: 1; }
}

/* Common: any wide table that has overflow-x:auto already scrolls horizontally — preserved */

/* ============================================================
   Alignment polish — normalize panel headers + button heights
   ============================================================ */
.panel-header { padding: 14px 18px; }
.panel-header .panel-title { font-size: 13.5px; font-weight: 600; }
.panel-header .panel-sub   { font-size: 11px; color: var(--text-muted, #94a3b8); }

/* Standardize button height tiers across the app */
.t-btn { box-sizing: border-box; }
/* xs = 24px (table row buttons), sm = 28px, md = 32px (modal footer), lg = 36px (form submits) */
.t-btn[data-size="xs"] { height: 24px; padding: 0 9px; font-size: 11px; }
.t-btn[data-size="sm"] { height: 28px; padding: 0 11px; font-size: 12px; }
.t-btn[data-size="md"] { height: 32px; padding: 0 14px; font-size: 12.5px; }
.t-btn[data-size="lg"] { height: 36px; padding: 0 16px; font-size: 13px; }
