/* ─────────────────────────────────────────────────────────────────────────────
   Highmark — app.css
   Design tokens + component styles, faithfully ported from App Sketch v3.
   ───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --navy:     #162839;
  --navy-dk:  #0e1c26;
  --navy-md:  #1e3a52;
  --green:    #32594d;
  --green-lt: #e8f0ee;
  --pos:      #1A7A4A;
  --warn:     #B45309;
  --warn-lt:  #FEF3C7;
  --red:      #C0392B;
  --red-lt:   #FEE2E2;
  --cream:    #faf8f5;
  --border:   #E5E0D8;
  --border-dk:#d4cec5;
  --text-dk:  #1a1614;
  --text-md:  #4A5568;
  --text-lt:  #8c8078;
  --white:    #ffffff;
  --gold:     #D69E2E;
  --sidebar-w:220px;
  --header-h: 56px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--cream);
  color: var(--text-dk);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy-dk);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-logo .app-name {
  font-size: .75rem;
  font-weight: 800;
  color: white;
  letter-spacing: -.01em;
  margin-bottom: 6px;
}
.sidebar-logo .org-stack { font-size: .62rem; color: rgba(255,255,255,.4); line-height: 1.6; }
.sidebar-logo .org-name  { display: block; font-weight: 600; }

.nav-group { padding: 16px 0 4px; }
.nav-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 0 18px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  border-radius: 0;
  transition: all .15s;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav-item:hover   { color: white; background: rgba(255,255,255,.06); }
.nav-item.active  { color: white; background: rgba(255,255,255,.1); border-left-color: var(--green); font-weight: 600; }
.nav-icon { font-size: .9rem; width: 16px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  flex-shrink: 0;
}
.sidebar-footer .user-name { color: rgba(255,255,255,.75); font-weight: 600; font-size: .8rem; }
.sidebar-footer form { display: inline; }
.sidebar-footer button {
  background: none; border: none; color: rgba(255,255,255,.4);
  font-size: .75rem; cursor: pointer; padding: 0; font-family: inherit;
}
.sidebar-footer button:hover { color: rgba(255,255,255,.7); }

/* ── Main content ──────────────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }
.page-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header .title    { font-size: .95rem; font-weight: 700; color: var(--navy); }
.page-header .subtitle { font-size: .75rem; color: var(--text-lt); margin-top: 1px; }
.content { padding: 24px 28px; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card { background: white; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.card-header {
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--border);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-lt);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-action {
  font-size: .7rem; font-weight: 600; color: var(--green);
  text-transform: none; letter-spacing: 0; cursor: pointer; text-decoration: none;
}
.card-action:hover { text-decoration: underline; }
.card-body { padding: 14px 16px; }

/* ── Alert strip ───────────────────────────────────────────────────────────── */
.alert-strip {
  background: var(--navy);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.strip-label {
  font-size: .65rem; font-weight: 700; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; white-space: nowrap;
}
.alert-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px; padding: 4px 10px; font-size: .72rem;
  color: rgba(255,255,255,.85); cursor: pointer; transition: background .15s;
  text-decoration: none;
}
.alert-pill:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.3); }
.alert-pill .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-red  { background: #FC8181; }
.dot-gold { background: #F6C053; }
.dot-grn  { background: #68D391; }
.alert-strip-dismiss {
  margin-left: auto; font-size: .7rem; color: rgba(255,255,255,.35);
  cursor: pointer; white-space: nowrap;
}

/* ── Fund health bar ───────────────────────────────────────────────────────── */
.fund-health { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.fund-tile {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; border-top: 3px solid var(--border);
}
.fund-tile.fund-i   { border-top-color: var(--navy); }
.fund-tile.fund-ii  { border-top-color: var(--green); }
.fund-tile.fund-sof { border-top-color: var(--gold); }
.fund-tile.fund-lth { border-top-color: #0891B2; }
.fund-tile.fillmore { border-top-color: #0F766E; }
.fund-tile.fund-ht  { border-top-color: #7C3AED; }
.fund-name  { font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-lt); margin-bottom: 8px; }
.fund-metrics { display: flex; gap: 10px; flex-wrap: wrap; }
.fund-metric .label { font-size: .58rem; color: var(--text-lt); font-weight: 600; }
.fund-metric .val   { font-size: 1rem; font-weight: 800; color: var(--navy); line-height: 1.1; margin-top: 1px; }
.fund-metric .val.pos  { color: var(--pos); }
.fund-metric .val.warn { color: var(--warn); }
.fund-sub { font-size: .63rem; color: var(--text-lt); margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); }

/* ── Fund filter tiles (Companies) ────────────────────────────────────────── */
.fund-filter-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.fund-filter-tile  { flex: 1 1 160px; min-width: 140px; max-width: 220px; box-sizing: border-box; }
.fund-filter-tile {
  background: white; border: 2px solid var(--border); border-radius: 10px;
  padding: 10px 13px; border-top: 3px solid var(--border); cursor: pointer;
  transition: all .15s; user-select: none;
  text-decoration: none; display: block;
}
.fund-filter-tile:hover { border-color: var(--border-dk); box-shadow: 0 2px 8px rgba(22,40,57,.08); }
.fund-filter-tile.active { border-color: var(--navy); background: rgba(22,40,57,.04); }
.fund-filter-tile.fft-i   { border-top-color: var(--navy); }
.fund-filter-tile.fft-ii  { border-top-color: var(--green); }
.fund-filter-tile.fft-sof { border-top-color: var(--gold); }
.fund-filter-tile.fft-lth { border-top-color: #0891B2; }
.fund-filter-tile.fft-fill { border-top-color: #0F766E; }
.fund-filter-tile.fft-ht   { border-top-color: #7C3AED; }
.fft-name    { font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-lt); margin-bottom: 5px; }
.fft-metrics { display: flex; gap: 10px; }
.fft-metrics .fft-val   { font-size: .9rem; font-weight: 800; color: var(--navy); }
.fft-metrics .fft-label { font-size: .6rem; color: var(--text-lt); font-weight: 600; }
.fft-sub         { font-size: .62rem; color: var(--text-lt); margin-top: 5px; }
.fft-select-hint { font-size: .62rem; color: var(--green); font-weight: 600; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.fund-filter-tile:hover .fft-select-hint { opacity: 1; }
.fund-filter-tile.active .fft-select-hint { opacity: 1; color: var(--navy); }
.fund-clear-btn {
  flex: 0 0 auto; height: 30px; padding: 0 12px;
  border: 1.5px solid var(--border-dk); border-radius: 20px;
  background: white; color: var(--text-md); font-size: .73rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s; align-self: center;
}
.fund-clear-btn:hover { background: var(--cream); border-color: var(--text-md); color: var(--navy); }

/* ── Status filters ────────────────────────────────────────────────────────── */
.status-filters { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
/* Pill group separator — thin vertical line between Mode and Performance groups */
.pill-group-sep {
  width: 1px; height: 20px; background: var(--border);
  margin: 0 4px; flex-shrink: 0;
}
/* Small uppercase label before each pill group */
.pill-group-label {
  font-size: .58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-lt);
  padding: 0 2px; white-space: nowrap; align-self: center;
}
.sfilter {
  font-size: .72rem; font-weight: 600; padding: 5px 13px;
  border-radius: 20px; border: 1.5px solid var(--border);
  background: white; color: var(--text-md); cursor: pointer; transition: all .15s;
  text-decoration: none; display: inline-block;
}
.sfilter:hover { border-color: var(--navy); color: var(--navy); }
.sfilter.active { background: var(--navy); color: white; border-color: var(--navy); }

/* ── Search bar ────────────────────────────────────────────────────────────── */
.search-bar-wrap {
  background: white; border: 1.5px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 16px;
}
.search-bar-wrap input {
  flex: 1; border: none; outline: none; font-size: .9rem;
  font-family: inherit; color: var(--text-dk); background: transparent;
}
.search-bar-wrap input::placeholder { color: var(--text-lt); }

/* ── Portfolio tile grid ───────────────────────────────────────────────────── */
.portfolio-grid-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.portfolio-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ptile {
  background: white; border: 1px solid var(--border); border-radius: 9px;
  padding: 12px 13px; cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  border-left: 3px solid var(--border);
  text-decoration: none; display: block;
}
.ptile:hover { box-shadow: 0 2px 12px rgba(22,40,57,.1); border-color: var(--border-dk); }
.ptile.status-green  { border-left-color: var(--pos); }
.ptile.status-yellow { border-left-color: var(--gold); }
.ptile.status-red    { border-left-color: var(--red); }
.ptile.status-grey   { border-left-color: #A0AEC0; }
.ptile.status-blue   { border-left-color: #3B82F6; }
.ptile-top    { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.ptile-name   { font-size: .82rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.ptile-moic   { font-size: .9rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.moic-green  { color: var(--pos); }
.moic-yellow { color: var(--gold); }
.moic-red    { color: var(--red); }
.moic-grey   { color: #A0AEC0; }
.ptile-meta   { font-size: .68rem; color: var(--text-lt); margin-top: 5px; display: flex; gap: 5px; flex-wrap: wrap; }
.ptile-badge  { font-size: .62rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.badge-fund1 { background: rgba(22,40,57,.1);    color: var(--navy); }
.badge-fund2 { background: rgba(50,89,77,.12);   color: var(--green); }
.badge-sof   { background: rgba(214,158,46,.12); color: #92650a; }
.badge-lth   { background: rgba(8,145,178,.12);  color: #0e7490; }
.badge-fill  { background: rgba(124,58,237,.1);  color: #5B21B6; }
.badge-exit  { background: #F3F4F6; color: #6B7280; }
.ptile-bottom {
  margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.ptile-industry { font-size: .67rem; color: var(--text-lt); }
.ptile-mark     { font-size: .62rem; color: var(--text-lt); }

/* ── Home grid (Command Center) ────────────────────────────────────────────── */
.home-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.home-left  { display: flex; flex-direction: column; gap: 14px; }

/* ── Searcher panel ────────────────────────────────────────────────────────── */
.capacity-highlight {
  background: var(--cream); border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.capacity-big   { font-size: 1.6rem; font-weight: 800; color: var(--green); line-height: 1; }
.capacity-label { font-size: .68rem; color: var(--text-lt); margin-top: 2px; }
.capacity-detail { font-size: .72rem; color: var(--text-md); text-align: right; line-height: 1.5; }

.searcher-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.searcher-row:last-child { border-bottom: none; }
.sr-label     { font-size: .76rem; font-weight: 600; color: var(--navy); }
.sr-meta      { font-size: .68rem; color: var(--text-lt); margin-top: 1px; }
.sr-count     { font-size: 1.1rem; font-weight: 800; color: var(--navy); text-align: right; }
.sr-count-sub { font-size: .62rem; color: var(--text-lt); text-align: right; }

/* ── Fillmore pacing ───────────────────────────────────────────────────────── */
.pacing-row  { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pacing-label { font-size: .75rem; font-weight: 600; color: var(--navy); flex: 1; }
.pacing-bar-wrap { width: 100px; height: 6px; background: var(--border); border-radius: 3px; flex-shrink: 0; }
.pacing-bar   { height: 100%; border-radius: 3px; background: var(--green); }
.pacing-pct   { font-size: .7rem; font-weight: 700; color: var(--text-md); width: 32px; text-align: right; flex-shrink: 0; }

/* ── Pipeline Pulse ────────────────────────────────────────────────────────── */
.pipeline-rail  { display: flex; flex-direction: column; gap: 12px; }
.funnel-stages  { display: flex; gap: 3px; margin: 10px 0 8px; align-items: stretch; }
.funnel-stage   { flex: 1; border-radius: 4px; padding: 7px 4px; text-align: center; text-decoration: none; display: block; }
.funnel-stage .f-count { font-size: .95rem; font-weight: 800; color: white; }
.funnel-stage .f-label { font-size: .58rem; font-weight: 600; color: rgba(255,255,255,.75); margin-top: 1px; }
.funnel-stage.clickable { cursor: pointer; }
.funnel-stage.clickable:hover { filter: brightness(1.12); }
.fs-id  { background: #94A3B8; }
.fs-nda { background: #64748B; }
.fs-cim { background: #475569; }
.fs-rev { background: #334155; }
.fs-pur { background: var(--navy); }
.attio-link { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; color: var(--green); text-decoration: none; margin-top: 8px; }
.attio-link:hover { text-decoration: underline; }
.funnel-detail { font-size: .72rem; color: var(--text-md); line-height: 1.6; }
.funnel-detail strong { color: var(--navy); font-weight: 700; }
.pipeline-refresh-btn {
  height: 24px; padding: 0 9px; border-radius: 12px;
  background: var(--cream); border: 1px solid var(--border);
  font-size: .68rem; font-weight: 600; color: var(--text-md);
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit; transition: background .15s;
}
.pipeline-refresh-btn:hover:not(:disabled) { background: var(--border); color: var(--navy); }
.pipeline-refresh-btn:disabled { opacity: .5; cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Investment Profile ────────────────────────────────────────────────────── */
.profile-header { background: var(--navy); color: white; border-radius: 10px; padding: 20px 24px 18px; margin-bottom: 14px; }
.profile-back   { font-size: .75rem; color: rgba(255,255,255,.55); margin-bottom: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.profile-back:hover { color: rgba(255,255,255,.85); }
.profile-top    { display: flex; justify-content: space-between; align-items: flex-start; }
.profile-name   { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.profile-sub    { font-size: .78rem; color: rgba(255,255,255,.55); margin-top: 3px; }
.profile-badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pbadge         { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 4px; }
.pb-fund1  { background: rgba(22,40,57,.4);    color: #93c5fd; }
.pb-fund2  { background: rgba(50,89,77,.3);    color: #a8d5c6; }
.pb-sof    { background: rgba(214,158,46,.25); color: #fcd34d; }
.pb-lth    { background: rgba(8,145,178,.25);  color: #7dd3fc; }
.pb-fill   { background: rgba(124,58,237,.25); color: #c4b5fd; }
.pb-type   { background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.pb-status { background: rgba(26,122,74,.3);   color: #86efac; }
.pb-warn   { background: rgba(214,158,46,.25); color: #fcd34d; }
.pb-moic   { background: rgba(26,122,74,.3);   color: #86efac; }
.profile-actions { display: flex; gap: 8px; align-items: flex-start; }
.btn-action {
  font-size: .72rem; font-weight: 600; padding: 6px 13px; border-radius: 6px;
  cursor: pointer; border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12); color: white; transition: all .15s;
  text-decoration: none; display: inline-block;
}
.btn-action:hover { background: rgba(255,255,255,.22); }
.btn-action.primary-action { background: var(--green); border-color: var(--green); }
.btn-action.primary-action:hover { background: #3d6b5d; }

/* KPI strip */
.kpi-strip { display: grid; grid-template-columns: 1.15fr 1fr 1.3fr 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
/* Searcher profiles show only 3 tiles (MOIC · Called · Distributions) */
.kpi-strip--searching { grid-template-columns: repeat(3, 1fr); }
.kpi-tile  { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; border-top: 3px solid var(--border); }
.kpi-tile.north-star { background: var(--navy); border-top-color: var(--green); }
.kpi-label { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-lt); }
.north-star .kpi-label { color: rgba(255,255,255,.55); }
.kpi-val   { font-size: 1.2rem; font-weight: 800; color: var(--navy); margin-top: 3px; }
.north-star .kpi-val { color: white; }
.kpi-sub   { font-size: .62rem; color: var(--text-lt); margin-top: 1px; }
.north-star .kpi-sub { color: rgba(255,255,255,.45); }

/* Valuation mini-tile */
.val-tile-rows { margin-top: 4px; }
.val-row  { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 0; border-bottom: 1px solid var(--border); }
.val-row:last-child { border-bottom: none; }
.val-type   { font-size: .62rem; font-weight: 700; color: var(--text-lt); }
.val-amount { font-size: .78rem; font-weight: 800; color: var(--navy); }
.val-amount.best { color: var(--pos); }

/* Profile tabs — consolidated (anchor-tag based) */
.tab-bar {
  display: flex; gap: 2px; margin-bottom: 20px;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 22px; font-size: .84rem; font-weight: 600; color: #94A3B8;
  text-decoration: none !important; white-space: nowrap;
  border: none; background: transparent; cursor: pointer; outline: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s; display: inline-flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Overview 3-col */
.overview-grid { display: grid; grid-template-columns: 260px 1fr 230px; gap: 14px; }
/* Searcher profiles have no Valuation History column */
.overview-grid--searching { grid-template-columns: 260px 1fr; }
.term-row  { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.term-row:last-child { border-bottom: none; }
.term-label { font-size: .72rem; color: var(--text-lt); font-weight: 600; flex-shrink: 0; }
.term-val   { font-size: .78rem; font-weight: 700; color: var(--navy); text-align: right; }
.narrative-card { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 13px 15px; margin-top: 12px; }
.narrative-header { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-lt); margin-bottom: 6px; }
.narrative-text { font-size: .8rem; color: var(--text-md); line-height: 1.6; }

/* Financials */
.metric-selector { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.metric-btn {
  font-size: .72rem; font-weight: 600; padding: 5px 13px;
  border-radius: 20px; border: 1.5px solid var(--border);
  background: white; color: var(--text-md); cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.metric-btn:hover { border-color: var(--navy); color: var(--navy); }
.metric-btn.active { background: var(--navy); color: white; border-color: var(--navy); }

.fin-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fin-chart-card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.fin-table-card { background: white; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.chart-title { font-size: .78rem; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.chart-legend { display: flex; gap: 14px; margin-top: 10px; font-size: .7rem; color: var(--text-lt); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; }

.fin-table { width: 100%; border-collapse: collapse; }
.fin-table th {
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-lt); padding: 9px 14px; background: var(--cream);
  text-align: right; border-bottom: 1px solid var(--border);
}
.fin-table th:first-child { text-align: left; }
.fin-table td { padding: 8px 14px; font-size: .78rem; color: var(--text-dk); border-bottom: 1px solid var(--border); text-align: right; }
.fin-table td:first-child { font-weight: 600; text-align: left; }
.fin-table tr:last-child td { border-bottom: none; }
.fin-table tr:hover td { background: var(--cream); }
.fin-row-active td { background: #eef2f7 !important; }
.fin-row-active td:first-child { color: var(--navy); }
.fin-row-derived td { color: var(--text-lt); font-size: .74rem; }

/* ── Analytics ─────────────────────────────────────────────────────────────── */
.fund-headline-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 18px; }
.fh-tile { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; border-top: 3px solid transparent; text-align: center; }
.fh-tile.fh-i   { border-top-color: var(--navy); }
.fh-tile.fh-ii  { border-top-color: var(--green); }
.fh-tile.fh-sof { border-top-color: var(--gold); }
.fh-tile.fh-lth { border-top-color: #0891B2; }
.fh-tile.fh-fill { border-top-color: #7C3AED; }
.fh-name    { font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-lt); margin-bottom: 6px; }
.fh-primary { font-size: 1.25rem; font-weight: 800; color: var(--navy); line-height: 1; }
.fh-primary.pos { color: var(--pos); }
.fh-meta    { font-size: .62rem; color: var(--text-lt); margin-top: 4px; }

.byo-section { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.byo-row     { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.byo-step-label { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-lt); white-space: nowrap; min-width: 56px; }
.byo-opts    { display: flex; gap: 6px; flex-wrap: wrap; }
.byo-btn {
  font-size: .75rem; font-weight: 600; padding: 5px 13px;
  border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--cream); color: var(--text-md); cursor: pointer;
  transition: all .15s; font-family: inherit; text-decoration: none;
}
.byo-btn:hover { border-color: var(--navy); color: var(--navy); background: white; }
.byo-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.byo-divider { width: 100%; height: 1px; background: var(--border); margin: 12px 0; }
.avg-med { display: flex; border: 1.5px solid var(--border); border-radius: 20px; overflow: hidden; margin-left: auto; }
.am-btn  { font-size: .72rem; font-weight: 600; padding: 4px 12px; cursor: pointer; color: var(--text-md); background: white; border: none; transition: all .15s; font-family: inherit; }
.am-btn.active { background: var(--navy); color: white; }

.analytics-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.analytics-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 16px; }

.simple-chart { padding: 4px 0; }
.sc-row       { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sc-label     { font-size: .72rem; color: var(--text-md); font-weight: 600; width: 80px; flex-shrink: 0; text-align: right; }
.sc-bar-wrap  { flex: 1; height: 22px; background: var(--cream); border-radius: 4px; overflow: hidden; }
.sc-bar       { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; min-width: 2px; }
.sc-bar-val   { font-size: .7rem; font-weight: 700; color: white; white-space: nowrap; }
.sc-num       { font-size: .72rem; font-weight: 700; color: var(--navy); width: 36px; flex-shrink: 0; }
/* Distribution chart — stacked segment bars */
.dist-seg             { height: 100%; transition: width .25s; }
.dist-seg-0           { background: var(--navy); }
.dist-seg-1           { background: var(--green); }
.dist-seg-2           { background: #e8a838; }
.dist-seg-3           { background: #7c5cbf; }
.dist-seg-4           { background: #0891b2; }
.dist-seg-5           { background: #9e9e9e; }
.dist-legend          { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.dist-legend-item     { display: flex; align-items: center; gap: 5px; font-size: .65rem; color: var(--text-md); }
.dist-swatch          { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }

/* ── Analytics filter bar ──────────────────────────────────────────────────── */
.af-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; margin-bottom: 12px;
}
.af-group  { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.af-label  {
  font-size: .6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-lt); margin-right: 3px; white-space: nowrap;
}
.af-sep    { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.af-btn {
  font-size: .7rem; font-weight: 600; padding: 4px 11px; border-radius: 20px;
  border: 1px solid var(--border); cursor: pointer; background: white;
  color: var(--text-md); transition: all .15s; font-family: inherit;
}
.af-btn:hover  { border-color: var(--navy); color: var(--navy); }
.af-btn.active { background: var(--navy); color: white; border-color: var(--navy); }

/* Thin vertical separator between segment buttons and HT toggle */
.byo-ht-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; flex-shrink: 0; }

/* Reset link in filter bar */
.af-reset {
  font-size: .65rem; font-weight: 600; color: var(--text-lt);
  text-decoration: none; border: 1px solid var(--border); border-radius: 20px;
  padding: 3px 10px; transition: all .15s;
}
.af-reset:hover { color: var(--navy); border-color: var(--navy); background: white; }

/* hint text inside card-header */
.card-hint {
  float: right; font-size: .6rem; font-weight: 400; color: var(--text-lt);
  font-style: italic; margin-top: 1px;
}

/* ── BYO bar drill interaction ─────────────────────────────────────────────── */
.byo-bar-drillable { cursor: pointer; border-radius: 4px; padding: 2px 4px; margin: 0 -4px; transition: background .12s; }
.byo-bar-drillable:hover { background: rgba(0,0,0,.04); }
.byo-bar-drillable.htmx-request .byo-bar-label { opacity: .5; }

/* ── Drill-through panel ───────────────────────────────────────────────────── */
.drill-panel {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: 0;
}
.drill-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: #f8f9fb;
}
.drill-title   { display: flex; align-items: center; gap: 10px; }
.drill-dim-badge {
  font-size: .6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: white; background: var(--navy);
  padding: 2px 8px; border-radius: 10px;
}
.drill-val     { font-size: .9rem; font-weight: 700; color: var(--navy); }
.drill-count   { font-size: .72rem; color: var(--text-lt); }
.drill-close {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border);
  background: white; cursor: pointer; font-size: .7rem; color: var(--text-md);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; flex-shrink: 0; font-family: inherit;
}
.drill-close:hover { background: var(--red); color: white; border-color: var(--red); }
.drill-table-wrap { overflow-x: auto; }
.drill-table {
  width: 100%; border-collapse: collapse; font-size: .72rem;
}
.drill-table th {
  padding: 7px 12px; text-align: left; font-size: .6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-lt);
  border-bottom: 1px solid var(--border); white-space: nowrap; background: #f8f9fb;
}
.drill-table th.num, .drill-table td.num { text-align: right; }
.drill-table td {
  padding: 7px 12px; border-bottom: 1px solid var(--border);
  color: var(--text-md); vertical-align: middle;
}
.drill-table tbody tr:last-child td { border-bottom: none; }
.drill-row:hover { background: #f0f4ff; }
.drill-name   { font-weight: 600; color: var(--navy) !important; }
.drill-fund   { font-size: .68rem; color: var(--text-lt); white-space: nowrap; }
.drill-moic-up { color: var(--pos) !important; font-weight: 700; }
.drill-moic-dn { color: var(--red) !important; font-weight: 700; }
.drill-empty  { padding: 24px; text-align: center; font-size: .8rem; color: var(--text-lt); }

.cohort-table { width: 100%; border-collapse: collapse; }
.cohort-table th {
  font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-lt); padding: 7px 12px; background: var(--cream);
  border-bottom: 1px solid var(--border); text-align: right;
}
.cohort-table th:first-child { text-align: left; }
.cohort-table td { padding: 8px 12px; font-size: .78rem; border-bottom: 1px solid var(--border); text-align: right; }
.cohort-table td:first-child { font-weight: 600; text-align: left; color: var(--navy); }
.cohort-table tr:last-child td { border-bottom: none; }
.cohort-table .bold-row td { font-weight: 700; background: var(--cream); }

/* ── Ask Anything ──────────────────────────────────────────────────────────── */
.ama-layout { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
.chat-container { background: white; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; min-height: 520px; }
.chat-messages { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 460px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; }
.avatar-ai   { background: var(--navy); color: white; }
.avatar-user { background: var(--green); color: white; }
.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 10px; font-size: .82rem; line-height: 1.55; color: var(--text-dk); }
.bubble-ai   { background: var(--cream); border: 1px solid var(--border); border-radius: 4px 10px 10px 10px; }
.bubble-user { background: var(--navy); color: white; border-radius: 10px 4px 10px 10px; }
.bubble-ai p:not(:last-child) { margin-bottom: 8px; }
.bubble-ai pre { background: rgba(22,40,57,.05); border-radius: 4px; padding: 8px; font-size: .75rem; overflow-x: auto; }
.chat-input-wrap { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.chat-input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: .83rem; font-family: inherit; outline: none;
  background: var(--cream); color: var(--text-dk);
}
.chat-input:focus { border-color: var(--navy); background: white; }
.btn-send { background: var(--navy); color: white; border: none; border-radius: 8px; padding: 8px 14px; font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-send:hover { background: var(--navy-md); }
.suggest-pill {
  background: white; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: .77rem; color: var(--text-md); cursor: pointer;
  transition: all .15s; line-height: 1.3; margin-bottom: 6px; display: block;
  width: 100%; text-align: left; font-family: inherit;
}
.suggest-pill:hover { border-color: var(--navy); color: var(--navy); background: var(--cream); }
.ama-cap-note { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: .72rem; color: var(--text-md); line-height: 1.5; margin-top: 10px; }
.thinking-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-lt); animation: pulse 1s infinite; }
.thinking-dot:nth-child(2) { animation-delay: .2s; }
.thinking-dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%,80%,100%{opacity:.3} 40%{opacity:1} }

/* ── People / Team cards ───────────────────────────────────────────────────── */
.three-col   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.two-col     { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.person-card { background: white; border: 1px solid var(--border); border-radius: 9px; padding: 13px 15px; }
.person-name   { font-size: .88rem; font-weight: 700; color: var(--navy); }
.person-school { font-size: .72rem; color: var(--text-lt); margin-top: 2px; }
.li-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #0A66C2; color: white; border-radius: 5px;
  padding: 4px 10px; font-size: .7rem; font-weight: 600; text-decoration: none; margin-top: 7px;
}

/* ── Tags / badges ─────────────────────────────────────────────────────────── */
.tag         { display: inline-block; font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 3px; }
.tag-green   { background: rgba(26,122,74,.1);  color: var(--pos); }
.tag-yellow  { background: rgba(214,158,46,.1); color: var(--warn); }
.tag-red     { background: rgba(192,57,43,.1);  color: var(--red); }
.tag-grey    { background: #F1F5F9; color: #64748B; }
.tag-blue    { background: rgba(59,130,246,.1); color: #2563EB; }

/* ── Universe strip ─────────────────────────────────────────────────── */
.universe-strip {
  display: flex; align-items: center; gap: 0;
  background: var(--navy); color: #fff;
  border-radius: 8px; padding: 10px 20px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.u-stat { display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
.u-val  { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.u-label { font-size: .6rem; font-weight: 600; text-transform: uppercase;
           letter-spacing: .06em; color: rgba(255,255,255,.6); margin-top: 2px; }
.u-divider { width: 1px; height: 32px; background: rgba(255,255,255,.2); flex-shrink: 0; }
.tag-navy    { background: rgba(22,40,57,.1);   color: var(--navy); }

/* ── Stat strip (light, per-page, fund-reactive) ────────────────────────────── */
.stat-strip {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px 10px;
  margin-bottom: 16px;
}
.ss-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
}
.ss-divider {
  height: 1px; background: var(--border); margin: 8px 0 4px;
}
.ss-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 14px; min-width: 58px;
}
.ss-val {
  font-size: 1.4rem; font-weight: 700; color: var(--navy);
  line-height: 1.1; letter-spacing: -.02em;
}
.ss-lbl {
  font-size: .6rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-lt);
  margin-top: 2px; white-space: nowrap;
}
.ss-sep { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }
.ss-across {
  font-size: .7rem; color: var(--text-lt);
  padding: 0 2px; align-self: center; line-height: 1;
}
/* Performance accent colors (legible on light bg) */
.ss-above { color: #15803d; }
.ss-on    { color: #16a34a; }
.ss-below { color: #d97706; }
.ss-risk  { color: #dc2626; }
.ss-muted { color: #94a3b8; }
/* Stronger group-boundary divider */
.ss-sep-lg { width: 1px; height: 36px; background: #94a3b8; flex-shrink: 0; margin: 0 4px; }
@media (max-width: 680px) {
  .ss-item  { padding: 3px 8px; min-width: 44px; }
  .ss-val   { font-size: 1.1rem; }
  .ss-lbl   { font-size: .54rem; }
}

/* ── Ask Highmark filter bar ───────────────────────────────────────────────── */
.ask-filter-wrap {
  display: flex; align-items: center; gap: 8px;
  background: white; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  margin-bottom: 8px; transition: border-color .15s;
}
.ask-filter-wrap:focus-within { border-color: var(--navy); }
.ask-filter-icon { color: var(--navy); font-size: .9rem; flex-shrink: 0; opacity: .7; }
.ask-filter-wrap input[type="text"] {
  flex: 1; border: none; outline: none; font-size: .82rem;
  color: var(--text-dk); background: transparent; font-family: inherit;
}
.ask-filter-wrap input[type="text"]::placeholder { color: var(--text-lt); }
.ask-filter-btn {
  background: var(--navy); color: white; border: none; border-radius: 6px;
  padding: 5px 14px; font-size: .78rem; font-weight: 600; cursor: pointer;
  font-family: inherit; flex-shrink: 0; transition: background .15s;
}
.ask-filter-btn:hover:not(:disabled) { background: var(--navy-md); }
.ask-filter-btn:disabled { opacity: .5; cursor: default; }
.ask-filter-clear {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(239,68,68,.08); color: var(--red); border: 1px solid rgba(239,68,68,.2);
  border-radius: 6px; padding: 5px 12px; font-size: .75rem; font-weight: 600;
  cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.ask-filter-clear:hover { background: rgba(239,68,68,.15); }

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.divider      { height: 1px; background: var(--border); margin: 12px 0; }
.section-label { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-lt); margin-bottom: 8px; }
.scrollable   { max-height: 600px; overflow-y: auto; }
.stat-row     { display: flex; gap: 18px; }
.stat-item .s-val   { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.stat-item .s-label { font-size: .65rem; color: var(--text-lt); font-weight: 600; margin-top: 1px; }
.btn-primary  { background: var(--navy); color: white; border: none; border-radius: 6px; padding: 7px 16px; font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-primary:hover { background: var(--navy-md); }
.text-pos  { color: var(--pos); }
.text-warn { color: var(--warn); }
.text-red  { color: var(--red); }
.text-lt   { color: var(--text-lt); }
.text-navy { color: var(--navy); }

/* ── Co-investors / Board tables ───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.data-table th {
  font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-lt); padding: 9px 14px; background: var(--cream);
  text-align: left; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 9px 14px; font-size: .78rem; color: var(--text-dk); border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(250,248,245,.6); }
.data-table td.right { text-align: right; }
.data-table td.muted { color: var(--text-lt); }

/* ── Admin ─────────────────────────────────────────────────────────────────── */
.admin-sql-input {
  width: 100%; min-height: 120px; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 12px; font-size: .82rem; font-family: 'Courier New', monospace;
  background: var(--cream); color: var(--text-dk); outline: none; resize: vertical;
}
.admin-sql-input:focus { border-color: var(--navy); background: white; }
.result-count { font-size: .72rem; color: var(--text-lt); margin-bottom: 8px; }
.error-box { background: var(--red-lt); border: 1px solid #FECACA; border-radius: 8px; padding: 12px 16px; font-size: .82rem; color: var(--red); }

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--cream);
}
.login-card {
  width: 380px; background: white; border: 1px solid var(--border);
  border-radius: 14px; padding: 40px; box-shadow: 0 4px 24px rgba(22,40,57,.08);
}
.login-logo { font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; margin-bottom: 4px; }
.login-org  { font-size: .8rem; color: var(--text-lt); margin-bottom: 28px; }
.form-label { font-size: .75rem; font-weight: 600; color: var(--text-dk); margin-bottom: 5px; display: block; }
.form-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: .88rem; font-family: inherit;
  outline: none; color: var(--text-dk); background: var(--cream);
}
.form-input:focus { border-color: var(--navy); background: white; }
.form-group { margin-bottom: 16px; }
.btn-login { width: 100%; background: var(--navy); color: white; border: none; border-radius: 8px; padding: 11px; font-size: .9rem; font-weight: 700; cursor: pointer; font-family: inherit; margin-top: 8px; }
.btn-login:hover { background: var(--navy-md); }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: .75rem; color: var(--text-lt); }
.login-divider::before,.login-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.btn-google {
  width: 100%; background: white; color: var(--text-dk);
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px; font-size: .88rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; text-decoration: none;
}
.btn-google:hover { border-color: var(--border-dk); background: var(--cream); }
.login-error { background: var(--red-lt); border: 1px solid #FECACA; border-radius: 6px; padding: 10px 14px; font-size: .78rem; color: var(--red); margin-bottom: 16px; }

/* ── HTMX loading indicator ────────────────────────────────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator  { opacity: 1; }
.loading-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BYO Analytics Chart (bar chart partial) ─────────────────────────────── */
.byo-chart-wrap { display: flex; flex-direction: column; gap: 6px; }
.byo-bar-row { display: flex; align-items: center; gap: 8px; }
.byo-bar-label { font-size: .68rem; font-weight: 600; color: var(--text-md); width: 100px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.byo-bar-wrap { flex: 1; background: var(--border); border-radius: 3px; height: 20px; overflow: hidden; }
.byo-bar { height: 100%; border-radius: 3px; min-width: 4px; display: flex; align-items: center; transition: width .3s ease; }
.byo-bar-val { font-size: .63rem; font-weight: 700; color: white; padding: 0 6px; white-space: nowrap; }
.byo-bar-n { font-size: .63rem; color: var(--text-lt); width: 36px; text-align: right; flex-shrink: 0; }

/* ── Ask Anything layout ─────────────────────────────────────────────────── */
.ask-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; height: calc(100vh - 80px); max-height: 820px; }
.ask-main { display: flex; flex-direction: column; gap: 0; min-height: 0; }
.ask-header { padding: 0 0 16px 0; flex-shrink: 0; }
.ask-title { font-size: 1.15rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.ask-subtitle { font-size: .78rem; color: var(--text-lt); margin-top: 3px; }

.chat-messages {
  flex: 1; overflow-y: auto; background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px;
  min-height: 0;
}
.chat-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px 20px; flex: 1; justify-content: center; }
.welcome-icon { font-size: 2.2rem; margin-bottom: 12px; }
.welcome-heading { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.welcome-body { font-size: .78rem; color: var(--text-lt); max-width: 360px; line-height: 1.6; margin-bottom: 20px; }

.suggestion-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 480px; }
.suggestion-pill {
  background: var(--cream); border: 1.5px solid var(--border); border-radius: 20px;
  padding: 6px 14px; font-size: .73rem; color: var(--text-md); cursor: pointer;
  font-family: inherit; font-weight: 500; transition: all .15s;
}
.suggestion-pill:hover { border-color: var(--navy); color: var(--navy); background: white; }

.chat-turn { display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 85%; border-radius: 12px; padding: 12px 16px; }
.user-bubble { background: var(--navy); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-bubble   { background: var(--cream); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble-text { font-size: .82rem; line-height: 1.65; word-break: break-word; }
.user-bubble .bubble-text { color: white; }
.bubble-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bubble-badge { font-size: .63rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); background: rgba(22,40,57,.08); border-radius: 4px; padding: 2px 6px; }
.bubble-thinking { font-size: .7rem; color: var(--text-lt); animation: pulse-text 1.4s ease-in-out infinite; }
@keyframes pulse-text { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.ask-input-bar {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 0 4px 0; flex-shrink: 0;
}
.ask-textarea {
  flex: 1; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 14px;
  font-size: .85rem; font-family: inherit; outline: none; color: var(--text-dk);
  background: white; resize: none; max-height: 160px; line-height: 1.5; overflow-y: auto;
}
.ask-textarea:focus { border-color: var(--navy); }
.ask-send-btn {
  width: 38px; height: 38px; border-radius: 8px; background: var(--navy); border: none;
  color: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
  /* touch-action:manipulation removes the 300ms delay and tells the browser
     this element handles taps directly — prevents inadvertent scroll interception */
  touch-action: manipulation;
}
.ask-send-btn:hover { background: var(--navy-md); }
.ask-send-btn:disabled { background: var(--border-dk); cursor: not-allowed; opacity: .7; }
.ask-disclaimer { font-size: .67rem; color: var(--text-lt); padding-bottom: 4px; flex-shrink: 0; }
/* Spinner shown inside send button while request is in-flight */
.ask-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: ask-spin .7s linear infinite;
}
@keyframes ask-spin { to { transform: rotate(360deg); } }
/* Disabled textarea style */
.ask-textarea:disabled { background: var(--bg); color: var(--text-lt); cursor: not-allowed; }

.ask-sidebar { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.ask-sidebar-section { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.ask-sidebar-heading { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-lt); margin-bottom: 10px; }
.ask-sidebar-body { font-size: .78rem; color: var(--text-md); }
.ask-capability-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ask-capability-list li { font-size: .73rem; color: var(--text-md); padding-left: 14px; position: relative; line-height: 1.45; }
.ask-capability-list li::before { content: '·'; position: absolute; left: 2px; color: var(--navy); font-weight: 700; }

.data-source-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); }
.data-source-row:last-child { border-bottom: none; }
.ds-label { font-size: .75rem; color: var(--text-md); font-weight: 500; }

/* Markdown render in chat */
.md-h2 { font-size: .88rem; font-weight: 700; color: var(--navy); margin: 10px 0 4px; }
.md-h3 { font-size: .82rem; font-weight: 700; color: var(--text-dk); margin: 8px 0 3px; }
.md-list { padding-left: 16px; margin: 6px 0; }
.md-list li { font-size: .82rem; line-height: 1.5; }
.md-line { font-size: .82rem; line-height: 1.65; min-height: .4em; }
.md-gap  { height: .55em; }
.md-hr   { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.inline-code { background: rgba(22,40,57,.07); border-radius: 3px; padding: 1px 5px; font-family: 'SF Mono', monospace; font-size: .78em; color: var(--navy); }
/* Markdown tables in chat bubbles */
.md-table { width: 100%; border-collapse: collapse; font-size: .78rem; margin: 8px 0; }
.md-table th { background: var(--navy); color: white; font-weight: 600; padding: 5px 10px; text-align: left; }
.md-table td { padding: 4px 10px; border-bottom: 1px solid var(--border); }
.md-table tr:last-child td { border-bottom: none; }
.md-table tr:nth-child(even) td { background: var(--bg); }

/* ── Admin page ─────────────────────────────────────────────────────────────── */
.sql-textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: .82rem; font-family: 'SF Mono', 'Fira Code', monospace;
  outline: none; color: var(--text-dk); background: var(--cream); resize: vertical;
  line-height: 1.6; box-sizing: border-box;
}
.sql-textarea:focus { border-color: var(--navy); background: white; }
.snippet-btn {
  background: white; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: .7rem; font-weight: 500; color: var(--text-md);
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.snippet-btn:hover { border-color: var(--navy); color: var(--navy); }
.btn-secondary { background: white !important; color: var(--navy) !important; border: 1.5px solid var(--navy) !important; }
.btn-secondary:hover { background: var(--cream) !important; }

/* ── Co-Investors search bar ─────────────────────────────────────────────── */
.search-form-inline { display: flex; align-items: center; gap: 8px; }
.search-input-sm {
  border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 12px;
  font-size: .82rem; font-family: inherit; outline: none; color: var(--text-dk);
  background: white; width: 220px;
}
.search-input-sm:focus { border-color: var(--navy); }
.filter-bar { display: flex; align-items: center; gap: 8px; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.link-navy { color: var(--navy); text-decoration: none; font-weight: 600; }
.link-navy:hover { text-decoration: underline; }
.btn-sm { padding: 5px 10px !important; font-size: .75rem !important; }

/* ── Logo images ─────────────────────────────────────────────────────────── */
.sidebar-logo-img {
  width: 140px; height: auto; display: block; margin-bottom: 6px;
  /* slight brightness boost to pop on navy */
  filter: brightness(1.05);
}
.login-logo-wrap { text-align: center; margin-bottom: 4px; }
.login-logo-img  { width: 180px; height: auto; display: inline-block; }

/* ── Search Funds table ──────────────────────────────────────────────────── */
/* Desktop wrapper: scrollable if viewport is too narrow for the full table */
.sf-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sf-table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.sf-table thead th {
  background: var(--navy); color: rgba(255,255,255,.85); font-size: .65rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 9px 12px; text-align: right;
  /* Sticky header — stays visible when scrolling down a long list */
  position: sticky; top: 0; z-index: 2;
}
.sf-table thead th:first-child, .sf-table thead th:nth-child(2) { text-align: left; }
.sf-table tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.sf-table tbody tr:last-child { border-bottom: none; }
.sf-table tbody tr:hover td { background: #f4f1ec; }
.sf-table td { padding: 9px 12px; font-size: .76rem; color: var(--text-dk); text-align: right; vertical-align: middle; }
.sf-table td:first-child, .sf-table td:nth-child(2) { text-align: left; }
.sf-name-cell { min-width: 160px; }
.sf-entrepreneur { font-weight: 600; font-size: .78rem; color: var(--navy); }
.sf-fund-name-sub { font-size: .68rem; color: var(--text-lt); margin-top: 2px; }

/* lifecycle badges */
.lc-badge { display: inline-block; border-radius: 20px; padding: 2px 8px; font-size: .65rem; font-weight: 700; letter-spacing: .04em; }
.lc-searching    { background: #EFF6FF; color: #1D4ED8; }
.lc-fundraising  { background: #FFFBEB; color: #B45309; }  /* legacy — keep for safety */
.lc-operating    { background: #F0FDF4; color: #15803D; }
.lc-exited       { background: #F5F3FF; color: #6D28D9; }
.lc-written-off  { background: #FEF2F2; color: #B91C1C; }
.lc-hsc-passed   { background: #F8FAFC; color: #64748B; border: 1px solid #CBD5E1; }
.lc-exited-search { background: #FFF7ED; color: #9A3412; }

/* Mobile card layout (desktop: hidden; ≤860px: shown) */
.sf-cards { display: none; }
.sf-card {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  transition: background .1s;
}
.sf-card:hover { background: #f9f7f3; }
.sf-card-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-card-meta { justify-content: space-between; margin-bottom: 4px; }
.sf-card-fund { font-size: .68rem; color: var(--text-lt); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sf-card-name { font-weight: 700; font-size: .88rem; color: var(--navy); margin-bottom: 2px; }
.sf-card-company { font-size: .74rem; color: var(--text-md); margin-bottom: 4px; }
.sf-card-details { gap: 6px; margin-bottom: 6px; }
.sf-card-details span {
  font-size: .7rem; color: var(--text-lt); background: var(--bg);
  border-radius: 4px; padding: 1px 6px; border: 1px solid var(--border);
}
.sf-months-stale { color: var(--gold) !important; font-weight: 700 !important; }
.sf-card-fin { gap: 14px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 2px; }
.sf-card-fin span { font-size: .74rem; color: var(--text-dk); }
.sf-fin-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-lt); margin-right: 3px; }

/* ── Hunter Trust sidebar toggle ────────────────────────────────────────── */
.ht-toggle-wrap {
  margin: 0 12px 8px; padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ht-toggle-label { display: flex; flex-direction: column; gap: 2px; }
.ht-toggle-label span:first-child { font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.75); }
.ht-badge { font-size: .6rem; color: rgba(255,255,255,.4); font-weight: 400; }
.ht-toggle-btn {
  flex-shrink: 0; width: 38px; height: 22px; border-radius: 11px;
  border: none; cursor: pointer; font-size: .65rem; font-weight: 700;
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.5);
  transition: all .2s; font-family: inherit;
}
.ht-toggle-btn.ht-on { background: var(--green); color: white; }
.ht-toggle-btn:hover { opacity: .85; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first overrides
   Breakpoints:
     ≤ 860px  → sidebar becomes off-canvas drawer, .main fills full width
     ≤ 768px  → major grid collapses, reduced padding, stacked layouts
     ≤ 480px  → further compression for phones
   Desktop layout (> 860px) is completely unchanged.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Mobile topbar & sidebar close btn (hidden on desktop) ─────────────── */
.topbar {
  display: flex; align-items: center;
  background: var(--navy-dk);
  padding: 0 18px;
  height: 44px;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar-hamburger  { display: none; }   /* hidden on desktop */
.topbar-app-name   { display: none; }   /* hidden on desktop */
.topbar-actions    { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar-btn,
a.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px;
  color: rgba(255,255,255,.65) !important; text-decoration: none !important;
  font-size: .78rem; font-weight: 500; letter-spacing: .01em;
  transition: background .15s, color .15s;
}
.topbar-btn:hover,
a.topbar-btn:hover       { background: rgba(255,255,255,.1); color: #fff !important; }
.topbar-btn-active,
a.topbar-btn.topbar-btn-active { background: rgba(255,255,255,.12); color: #fff !important; }
.topbar-btn-icon        { font-size: .9rem; line-height: 1; }
.mobile-bar             { display: none; }   /* legacy — unused */
.sidebar-overlay   { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); }
.sidebar-close-btn { display: none; }

@media (max-width: 860px) {
  /* ── Sidebar: off-canvas drawer ─────────────────────────────────────── */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
  }
  .sidebar.open          { transform: translateX(0); }
  .sidebar-overlay.visible { display: block; }

  .sidebar-close-btn {
    display: block;
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,.12); border: none; color: rgba(255,255,255,.8);
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    font-size: .85rem; line-height: 1; font-family: inherit;
    transition: background .15s;
  }
  .sidebar-close-btn:hover { background: rgba(255,255,255,.22); }

  /* ── Main fills full width ──────────────────────────────────────────── */
  .main { margin-left: 0; }

  /* ── Mobile topbar ──────────────────────────────────────────────────── */
  /* topbar on mobile: show hamburger + app name, hide action labels */
  .topbar-hamburger { display: flex; flex-direction: column; gap: 4px;
    background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0; }
  .topbar-hamburger span { display: block; width: 20px; height: 2px; background: white; border-radius: 2px; }
  .topbar-app-name  { display: block; color: white; font-weight: 700; font-size: .9rem; }
  .topbar-btn-label { display: none; }  /* icon-only on mobile */
  .menu-btn {
    background: none; border: none; cursor: pointer; padding: 4px;
    display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
  }
  .menu-btn span {
    display: block; width: 20px; height: 2px;
    background: white; border-radius: 2px;
  }

  /* ── Content & page-header padding ─────────────────────────────────── */
  .content      { padding: 16px 14px; }
  /* Allow page-header to grow vertically when right-side content wraps
     (e.g. Search Funds status pill row). min-height preserves the look
     for simple headers that have no wrapping content. */
  .page-header  {
    padding: 10px 14px;
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ── Search Funds status pills: wrap on mobile ───────────────────────── */
  .sf-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    padding-bottom: 2px;
  }
  /* Shrink pill text slightly so more fit per row */
  .sf-status-pills .sfilter { font-size: .68rem; padding: 4px 11px; }

  /* ── Login card full-width ──────────────────────────────────────────── */
  .login-card { width: calc(100% - 32px); max-width: 380px; padding: 28px 20px; }

  /* ── Fund health strip: 5-col → 3-col ──────────────────────────────── */
  .fund-health          { grid-template-columns: repeat(3, 1fr); }
  .fund-headline-strip  { grid-template-columns: repeat(3, 1fr); }

  /* ── Portfolio tiles: 3-col → 2-col ────────────────────────────────── */
  .portfolio-tiles { grid-template-columns: repeat(2, 1fr); }

  /* ── Command Center home-grid: stack left/right ─────────────────────── */
  .home-grid { grid-template-columns: 1fr; }

  /* ── KPI strip: 6 unequal cols → 3 equal cols ──────────────────────── */
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  /* min-width:0 prevents grid cells from overflowing their track */
  .kpi-tile  { padding: 8px 10px; min-width: 0; }
  .kpi-val   { font-size: 1.05rem; }

  /* ── Profile header: clip overflow, allow long text to wrap ─────────── */
  .profile-header { overflow: hidden; }
  .profile-name   { font-size: 1.2rem; overflow-wrap: break-word; word-break: break-word; }
  /* profile-sub uses &nbsp; separators (U+00A0) which are unbreakable even with
     overflow-wrap: break-word. Use 'anywhere' which breaks ANY sequence, including
     non-breaking spaces, preventing the string from expanding the scroll container */
  .profile-sub    { white-space: normal; overflow-wrap: anywhere; }

  /* ── Profile: stack name + actions ─────────────────────────────────── */
  .profile-top     { flex-direction: column; gap: 10px; }
  /* width:100% counteracts align-items:flex-start on .profile-top (desktop default),
     which would otherwise shrink .profile-actions to its intrinsic content width */
  .profile-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  /* Each action button grows equally; min-width keeps them from going too narrow */
  .btn-action      { flex: 1 1 auto; text-align: center; min-width: 110px; }

  /* overflow-x: hidden on .main was removed — it suppresses touch events on iOS
     (the browser treats the hidden scroll container as intercepting tap gestures).
     The profile-sub overflow issue is handled by overflow-wrap:anywhere +
     overflow:hidden on .profile-header, so .main doesn't need this. */

  /* Tab bar scrollbar/touch handled in base rule now */
  .tab-btn { padding: 8px 14px; font-size: .78rem; }
  .tab-btn { padding: 8px 12px; font-size: .76rem; }

  /* ── Overview 3-col → 1-col ─────────────────────────────────────────── */
  .overview-grid { grid-template-columns: 1fr; }

  /* ── Financials 2-col → 1-col ───────────────────────────────────────── */
  .fin-body { grid-template-columns: 1fr; }

  /* ── Analytics grids ────────────────────────────────────────────────── */
  .analytics-grid-2 { grid-template-columns: 1fr; }
  .analytics-grid-3 { grid-template-columns: 1fr 1fr; }

  /* ── Ask Anything / AMA layout ─────────────────────────────────────── */
  .ama-layout  { grid-template-columns: 1fr; }
  /* Mobile ask layout: single column, height proportional to viewport.
     dvh (dynamic viewport height) shrinks when the virtual keyboard is shown
     on iOS 15.4+ / Chrome 108+; older browsers fall back to 100vh.
     Subtract ~116px = mobile-bar (~44px) + page-header (~56px) + top padding (16px). */
  .ask-layout  {
    grid-template-columns: 1fr;
    height: calc(100dvh - 116px);
    height: calc(100vh  - 116px); /* non-dvh fallback (overridden by dvh above) */
    max-height: none;
    min-height: 320px;
  }
  /* Hide sidebar on mobile — capabilities/tips not essential on small screens */
  .ask-sidebar { display: none; }
  /* Chat messages: allow growth within the constrained layout container */
  .chat-messages { max-height: none; }
  /* Send button: minimum 44px touch target per Apple HIG */
  .ask-send-btn { width: 44px; height: 44px; border-radius: 10px; }
  /* suggestion pills: ensure taps register as clicks (no 300ms delay) */
  .suggestion-pill { touch-action: manipulation; }
  /* Input bar: no extra padding needed when sidebar is gone */
  .ask-disclaimer { padding-bottom: 8px; }

  /* ── Team cards ─────────────────────────────────────────────────────── */
  .three-col { grid-template-columns: 1fr 1fr; }
  .two-col   { grid-template-columns: 1fr; }

  /* ── Universe strip: tighten spacing ───────────────────────────────── */
  .u-stat  { padding: 0 10px; }
  .u-val   { font-size: .95rem; }

  /* ── Capacity highlight: stack ──────────────────────────────────────── */
  .capacity-highlight { flex-direction: column; align-items: flex-start; gap: 6px; }
  .capacity-detail    { text-align: left; }

  /* ── Pacing bar: shrink fixed width ─────────────────────────────────── */
  .pacing-bar-wrap { width: 70px; }

  /* ── Search input: full-width ───────────────────────────────────────── */
  .search-input-sm { width: 100%; }
  .search-form-inline { flex-wrap: wrap; }

  /* ── Search Funds: swap table → cards on mobile ─────────────────────── */
  .sf-table-wrap { display: none; }
  .sf-cards      { display: block; }
}

/* ── Narrow phone (≤ 480px) ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .fund-health         { grid-template-columns: repeat(2, 1fr); }
  .fund-headline-strip { grid-template-columns: repeat(2, 1fr); }
  .portfolio-tiles     { grid-template-columns: 1fr; }
  .kpi-strip           { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .analytics-grid-3    { grid-template-columns: 1fr; }
  .three-col           { grid-template-columns: 1fr; }

  /* KPI: tighter on phones — 2-col still fits fine at 375px */
  .kpi-tile  { padding: 7px 8px; min-width: 0; }
  .kpi-val   { font-size: .95rem; }
  .kpi-label { font-size: .58rem; }
  .kpi-sub   { font-size: .58rem; }

  /* Profile header: less padding, smaller name */
  .profile-header { padding: 14px 14px 12px; }
  .profile-name   { font-size: 1.05rem; }

  /* Action buttons: stack full-width on phones */
  .profile-actions { flex-direction: column; gap: 6px; }
  .btn-action      { width: 100%; text-align: center; box-sizing: border-box; flex: none; }

  /* Fund filter tiles: allow smaller minimum */
  .fund-filter-tile { min-width: 120px; }

  /* Universe strip: hide dividers on very small screens */
  .u-divider { display: none; }
  .universe-strip { gap: 0; padding: 8px 12px; }
  .u-stat { padding: 4px 8px; }

  /* Stat row: wrap */
  .stat-row { flex-wrap: wrap; gap: 10px; }

  /* Chat bubbles: full width */
  .chat-bubble { max-width: 95%; }
}

/* ── Tablet (861px – 1100px): softer grid collapses ─────────────────────── */
@media (min-width: 861px) and (max-width: 1100px) {
  .portfolio-tiles     { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid-3    { grid-template-columns: 1fr 1fr; }
  .kpi-strip           { grid-template-columns: repeat(3, 1fr); }
  .fund-headline-strip { grid-template-columns: repeat(3, 1fr); }
  /* Overview: drop the narrow 3rd column, let it be 2-col */
  .overview-grid { grid-template-columns: 240px 1fr; }
  .content { padding: 20px 22px; }
}

/* ═══════════════════════════════════════════════════════════
   What-If Board
═══════════════════════════════════════════════════════════ */

.wi-card { padding: 0; overflow: hidden; }
.wi-hint {
  font-size: .78rem; color: var(--text-lt);
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: #f8fafc; display: flex; align-items: center; gap: 6px;
}
.wi-hint-icon { font-size: .75rem; opacity: .6; }
.wi-hint-key {
  display: inline-block; background: #e2e8f0; border: 1px solid #cbd5e1;
  border-radius: 4px; padding: 0 5px; font-size: .68rem; font-family: monospace;
  color: var(--text-lt); line-height: 1.6; margin-left: 2px;
}

/* Table */
.wi-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.wi-table thead th {
  background: var(--navy); color: rgba(255,255,255,.85);
  padding: 10px 14px; text-align: left;
  font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap;
}
.wi-table thead th.num  { text-align: right; }
.wi-table thead th.wi-adj-th {
  background: #1e40af; color: #fff;
  border-left: 2px solid #60a5fa; border-right: 2px solid #60a5fa;
}
.wi-table tbody td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wi-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wi-table tbody td.wi-adj-td {
  background: #eff6ff;
  border-left: 2px solid #bfdbfe; border-right: 2px solid #bfdbfe;
}
.wi-table tbody tr:last-child td { border-bottom: none; }
.wi-table tbody tr:hover td { background: #f1f5f9; }
.wi-table tbody tr:hover td.wi-adj-td { background: #dbeafe; }

/* Fund badge cell — wrap badges with gap */
.wi-fund-cell { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }

/* Row tints when MOIC changed */
.wi-row.wi-up   td { background: #f0fdf4 !important; }
.wi-row.wi-up   td.wi-adj-td { background: #dcfce7 !important; border-color: #86efac !important; }
.wi-row.wi-down td { background: #fef2f2 !important; }
.wi-row.wi-down td.wi-adj-td { background: #fee2e2 !important; border-color: #fca5a5 !important; }
.wi-row.wi-up:hover   td, .wi-row.wi-down:hover td { filter: brightness(.97); }

/* Input */
.wi-input {
  width: 80px; text-align: right;
  border: 1.5px solid #93c5fd; border-radius: 6px;
  padding: 5px 8px;
  font-size: .84rem; font-family: inherit; font-weight: 600;
  background: #fff; color: var(--navy);
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.wi-input::-webkit-inner-spin-button,
.wi-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.wi-input:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.wi-input:hover { border-color: #3b82f6; }

/* Mono numbers */
.mono { font-variant-numeric: tabular-nums; }

/* Toolbar controls */
.wi-select {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 10px; font-size: .82rem; background: #fff;
  color: var(--navy); cursor: pointer;
}
.wi-btn-ghost {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 12px; font-size: .82rem; background: #fff;
  color: var(--text-lt); cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 4px;
}
.wi-btn-ghost:hover { background: var(--hover); color: var(--navy); }

/* Strip: highlight adjusted values */
.ss-adj-live { color: #1d4ed8; font-weight: 800; }

/* ── Tab bar (Analytics + future pages) ────────────────────────────────── */
/* tab-bar/tab-btn rules consolidated above — see "Profile tabs" section */

/* ── Fund tile clickable upgrade (Portfolio tab) ─────────────────────── */
.fh-clickable {
  text-decoration: none !important; display: block; cursor: pointer;
  transition: box-shadow .15s, transform .12s;
}
.fh-clickable:hover { box-shadow: 0 4px 16px rgba(22,40,57,.13); transform: translateY(-1px); }
.fh-sub  { font-size: .6rem; color: var(--text-lt); margin-top: 3px; }
.fh-drill { font-size: .6rem; color: var(--navy); font-weight: 700; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.fh-clickable:hover .fh-drill { opacity: 1; }
/* Hunter Trust fund color */
.fh-tile.fh-ht   { border-top-color: #B45309; }

/* ── Return histogram (Portfolio + Fund View) ────────────────────────── */
.hist-chart { display: flex; flex-direction: column; gap: 6px; }
.hist-row   { display: flex; align-items: center; gap: 8px; }
.hist-label { font-size: .7rem; color: var(--text-md); width: 52px; text-align: right; flex-shrink: 0; }
.hist-bar-wrap { flex: 1; height: 22px; background: #F1F5F9; border-radius: 4px; position: relative; min-width: 0; }
.hist-bar   { height: 100%; border-radius: 4px; display: flex; align-items: center; min-width: 28px; transition: width .3s; }
.hist-val   { font-size: .7rem; font-weight: 700; color: #fff; padding-left: 8px; white-space: nowrap; }
/* Histogram bucket colors */
.hist-red     { background: var(--red); }
.hist-orange  { background: #F97316; }
.hist-yellow  { background: var(--gold); }
.hist-ltgreen { background: #86EFAC; }
.hist-green   { background: var(--pos); }
.hist-dkgreen { background: #065F46; }

/* ── Fund View page ──────────────────────────────────────────────────── */
.fv-breadcrumb { margin-bottom: 8px; }
.fv-breadcrumb a { font-size: .75rem; color: var(--text-lt); text-decoration: none; }
.fv-breadcrumb a:hover { color: var(--navy); text-decoration: underline; }
/* Fund accent on page header */
.fv-header.fh-i-accent    { border-left: 4px solid var(--navy); padding-left: 12px; }
.fv-header.fh-ii-accent   { border-left: 4px solid var(--green); padding-left: 12px; }
.fv-header.fh-lth-accent  { border-left: 4px solid #0891B2; padding-left: 12px; }
.fv-header.fh-fill-accent { border-left: 4px solid #0F766E; padding-left: 12px; }
.fv-header.fh-ht-accent   { border-left: 4px solid #B45309; padding-left: 12px; }

/* ── Global search (Command Center) ──────────────────────────────────── */
.gs-wrap { position: relative; }
.gs-input-wrap {
  display: flex; align-items: center;
  background: #fff; border: 1.5px solid #CBD5E1;
  border-radius: 10px; padding: 0 14px; gap: 10px;
  box-shadow: 0 1px 4px rgba(22,40,57,.06);
  transition: border-color .15s, box-shadow .15s;
}
.gs-input-wrap:focus-within {
  border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,40,57,.10);
}
.gs-icon-svg {
  width: 18px; height: 18px; color: #94A3B8; flex-shrink: 0;
  transition: color .15s;
}
.gs-input-wrap:focus-within .gs-icon-svg { color: var(--navy); }
.gs-input {
  flex: 1; border: none; outline: none; padding: 13px 0;
  font-size: .9rem; color: var(--navy); background: transparent;
}
.gs-kbd {
  font-size: .68rem; font-weight: 600; color: #94A3B8;
  background: #F1F5F9; border: 1px solid #E2E8F0;
  border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
  font-family: monospace; user-select: none;
  transition: opacity .15s;
}
.gs-input-wrap:focus-within .gs-kbd { opacity: 0; pointer-events: none; }
.gs-input::placeholder { color: var(--text-lt); }
.gs-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 120;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(22,40,57,.13);
  overflow: hidden;
}
.gs-panel.gs-empty { padding: 14px 16px; font-size: .8rem; color: var(--text-lt); }
.gs-result {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  text-decoration: none !important; color: var(--navy);
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.gs-result:last-child { border-bottom: none; }
.gs-result:hover { background: var(--hover); }
.gs-result-icon { font-size: 1rem; flex-shrink: 0; opacity: .65; }
.gs-result-body { flex: 1; min-width: 0; }
.gs-result-name { font-size: .83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-result-sub  { font-size: .67rem; color: var(--text-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-type-pill   { font-size: .6rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
                  padding: 2px 6px; border-radius: 4px; flex-shrink: 0; white-space: nowrap; }
.gs-type-co     { background: #EFF6FF; color: #1D4ED8; }
.gs-type-person { background: #F0FDF4; color: #15803D; }

/* ── Portfolio Summary Strip (Analytics → Portfolio tab) ──────────────── */
.port-summary-strip {
  display: flex; align-items: stretch; gap: 0;
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 20px; margin-bottom: 20px; flex-wrap: wrap;
}
.pss-block  { display: flex; flex-direction: column; align-items: center; justify-content: center;
              padding: 6px 18px; min-width: 80px; flex: 1; }
.pss-sep    { width: 1px; background: var(--border); margin: 4px 0; flex-shrink: 0; }
.pss-val    { font-size: 1.35rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.pss-lbl    { font-size: .67rem; color: var(--text-lt); margin-top: 3px; text-align: center; white-space: nowrap; }
.pss-pct    { font-size: .7rem; font-weight: 600; color: var(--text-md); margin-top: 1px; }
.pss-pos    { color: var(--pos); }
.pss-neg    { color: var(--red); }
.pss-above .pss-val { color: #065F46; }
.pss-on    .pss-val { color: var(--pos); }
.pss-below .pss-val { color: var(--gold); }
.pss-risk  .pss-val { color: var(--red); }

/* ── Portfolio Performance card (Command Center) ─────────────────────── */
.pp-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 16px; }
.pp-item      { display: flex; flex-direction: column; }
.pp-val       { font-size: 1.25rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.pp-lbl       { font-size: .67rem; color: var(--text-lt); margin-top: 2px; }
.pp-band-row  { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pp-band-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pp-band-lbl  { font-size: .73rem; color: var(--text-md); flex: 1; }
.pp-band-count{ font-size: .78rem; font-weight: 600; color: var(--navy); }
.pp-band-pct  { font-size: .68rem; color: var(--text-lt); min-width: 34px; text-align: right; }
.pp-view-link { display: block; text-align: center; font-size: .72rem; color: var(--navy);
                text-decoration: none; margin-top: 4px; opacity: .6; }
.pp-view-link:hover { opacity: 1; text-decoration: underline; }

/* ── General Info & Return Data card (Overview tab) ────────────────────── */
.gi-card { margin-bottom: 14px; }
.gi-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media(max-width:700px){ .gi-body { grid-template-columns: 1fr; } }
.gi-col { padding: 4px 0; }
.gi-col + .gi-col { border-left: 1px solid var(--border); padding-left: 24px; }
@media(max-width:700px){ .gi-col + .gi-col { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 4px; margin-top: 4px; } }
.gi-row { padding: 7px 0; border-bottom: 1px solid var(--border); }
.gi-row:last-child { border-bottom: none; }
.gi-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-lt); margin-bottom: 2px; }
.gi-val   { font-size: .88rem; color: var(--text); line-height: 1.4; }
.gi-val--bold { font-weight: 700; color: var(--navy); }
.gi-pos   { color: #2e7d32; }
.gi-warn  { color: #c0392b; }
.gi-link  { color: var(--blue, #2563eb); text-decoration: none; }
.gi-link:hover { text-decoration: underline; }

/* ── Return Time Series charts (Overview tab) ───────────────────────────── */
.rt-chart-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.rt-chart-card { min-width: 0; }
@media(max-width:700px){ .rt-chart-row { grid-template-columns: 1fr; } }


/* Cobalt provenance badge + refresh button on MOIC/IRR charts */
.rt-chart-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rt-source-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 10px;
  background: #eef2f7; color: #4a5568;
}
.rt-source-cobalt { background: #e6f1ff; color: #1d4ed8; }
.rt-source-db     { background: #f3f4f6; color: #6b7280; }
.rt-refresh-btn {
  font-size: 11px; font-weight: 500; padding: 3px 10px;
  border: 1px solid #d0d7de; background: #fff; border-radius: 6px;
  cursor: pointer; color: #24292f; transition: background .15s ease;
}
.rt-refresh-btn:hover  { background: #f6f8fa; }
.rt-refresh-btn:active { background: #eef2f7; }
.rt-refresh-btn .htmx-indicator { display: none; }
.rt-refresh-btn.htmx-request .htmx-indicator { display: inline; }
.rt-refresh-btn.htmx-request .rt-refresh-label { display: none; }

/* ── Funds page + cross-page fund toggle (promoted from profile page) ───── */
.fund-toggle-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  background: #f4f6fa;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 8px;
}
.fund-toggle-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #6b7489; margin-right: 4px;
}
.fund-pill {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border, #d6dae2);
  background: #fff; color: #3a4763;
  transition: all .12s ease;
}
.fund-pill:hover  { background: #eef2fb; border-color: #c7cfe0; }
.fund-pill.active { background: #0f1d3b; color: #fff; border-color: #0f1d3b; }

/* Fund Summary card (Funds page) */
.fund-summary-card {
  background: #fff;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 10px;
  padding: 22px 28px 26px 28px;
  box-shadow: 0 1px 2px rgba(20, 30, 60, .03);
}
.fund-summary-title {
  font-size: 1rem; font-weight: 700; color: var(--text, #1f2a44);
  margin: 0 0 18px 0;
}
.fund-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 48px;
}
.fs-item { display: flex; flex-direction: column; gap: 4px; }
.fs-label {
  font-size: .8rem; font-weight: 700; color: var(--text, #1f2a44);
  letter-spacing: 0;
}
.fs-value {
  font-size: .95rem; font-weight: 400; color: #4a5568;
  font-variant-numeric: tabular-nums;
}

/* Returns section on /funds */
.fund-section-title {
  font-size: 1rem; font-weight: 700; color: var(--text, #1f2a44);
  margin: 26px 0 12px 2px;
}
.returns-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.returns-kpi {
  background: #fff;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 10px;
  padding: 16px 18px 14px 18px;
  box-shadow: 0 1px 2px rgba(20, 30, 60, .03);
  position: relative;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.returns-kpi-title {
  font-size: .85rem; font-weight: 600; color: var(--text, #1f2a44);
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f2f6;
}
.returns-kpi-value {
  font-size: 2rem; font-weight: 400;
  color: #2f68e5; text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 12px 0;
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.returns-kpi-tags {
  display: flex; gap: 4px;
  justify-content: flex-start;
}
.returns-kpi-tag {
  display: inline-block;
  font-size: .65rem; font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eef2f7; color: #4a5568;
  letter-spacing: .02em;
}
.returns-sub-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 10px;
  padding: 18px 24px;
  box-shadow: 0 1px 2px rgba(20, 30, 60, .03);
}
.returns-sub-item { text-align: center; }
.returns-sub-label {
  font-size: .75rem; font-weight: 700; color: var(--text, #1f2a44);
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.returns-sub-value {
  font-size: 1.2rem; font-weight: 500; color: #2f68e5;
  font-variant-numeric: tabular-nums;
}

/* ── Investment Summary table (Funds page) ────────────────────────────────
   Quarterly-update-style table: per-company rows with Invested / Realized /
   Unrealized / Total Value / Multiple, plus a Total row at the bottom.
   Matches the LP-report xlsx conventions — blue text on hardcoded inputs,
   black text on derived formula values, navy total-row border.              */
.investment-summary-card {
  background: #fff;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(20, 30, 60, .03);
  overflow: hidden;
}
.investment-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.investment-summary-table thead th {
  background: #1f3864;  /* NAVY — matches LP report header */
  color: #fff;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .03em;
  padding: 10px 14px;
  text-align: right;
  border: none;
}
.investment-summary-table thead th.col-name { text-align: left; }
.investment-summary-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid #f0f2f6;
  color: var(--text, #1f2a44);
  text-align: right;
}
.investment-summary-table tbody td.col-name {
  text-align: left;
  font-weight: 500;
}
.investment-summary-table tbody tr:hover td {
  background: #f8fafc;
}
/* Hardcoded-input values — blue, matches LP-report xlsx convention */
.investment-summary-table td.val-input { color: #0000ff; }
/* Derived/formula values — black, matches LP-report xlsx convention */
.investment-summary-table td.val-formula { color: var(--text, #1f2a44); }

.investment-summary-table tfoot .total-row td {
  font-weight: 700;
  border-top: 2px solid #1f3864;
  border-bottom: 2px solid #1f3864;
  padding: 10px 14px;
  background: #f8fafc;
  text-align: right;
  color: var(--text, #1f2a44);
}
.investment-summary-table tfoot .total-row td.col-name { text-align: left; }

.investment-summary-table .empty-row td {
  text-align: center;
  color: var(--muted, #6b7280);
  padding: 24px 14px;
  font-style: italic;
}

.investment-summary-table th.col-num,
.investment-summary-table td.col-num  { min-width: 120px; }
.investment-summary-table th.col-mult,
.investment-summary-table td.col-mult { min-width: 80px; }

/* ── Investment Details section (Overview tab) ────────────────────────────
   Three narrative fields between the Inv+Return / Team+SF top row and the
   MOIC/IRR charts below. Top row: Company Description | Significant Updates.
   Bottom row (full-width): Investment Thesis. Uses the same card chrome as
   the surrounding Overview tiles so it reads as one continuous section.   */
.inv-details-section {
  margin: 18px 0 24px;
}
.inv-details-header {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text, #1f2a44);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.inv-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(0, auto);
  gap: 14px;
}
.inv-details-card {
  background: #fff;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(20, 30, 60, .03);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.inv-details-card--full {
  grid-column: 1 / -1;
  min-height: 140px;
}
.inv-details-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-lt, #6b7280);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.inv-details-body {
  font-size: .92rem;
  line-height: 1.5;
  color: var(--text, #1f2a44);
  white-space: pre-wrap;  /* preserve line breaks entered in narrative text */
  flex: 1;
}
.inv-details-body.is-empty {
  color: var(--text-lt, #9ca3af);
  font-style: italic;
}
/* Bulleted thesis / updates rendered as <ul> inside stored HTML */
.inv-details-body ul {
  margin: 0;
  padding-left: 20px;
}
.inv-details-body li {
  margin-bottom: 8px;
}
.inv-details-body li:last-child { margin-bottom: 0; }
.inv-details-body strong { color: var(--text, #1f2a44); }

@media (max-width: 900px) {
  .inv-details-grid { grid-template-columns: 1fr; }
}

/* ── Significant Updates inline editor ────────────────────────────────────
   Adds an Edit pencil/button to the Significant Updates card header and swaps
   the card body between read mode (rendered HTML) and edit mode (textarea +
   Save/Cancel). Only significant_updates is editable; company_description and
   investment_thesis intentionally render label-only (no label-row).         */
.inv-details-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.inv-details-label-row .inv-details-label {
  margin-bottom: 0;  /* the row handles spacing now */
}
.inv-details-edit-btn,
.inv-details-save-btn,
.inv-details-cancel-btn {
  background: #fff;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-lt, #6b7280);
  cursor: pointer;
  transition: all 120ms ease;
}
.inv-details-edit-btn:hover { border-color: #1f3864; color: #1f3864; }
.inv-details-save-btn {
  background: #1f3864;
  border-color: #1f3864;
  color: #fff;
}
.inv-details-save-btn:hover { background: #18294a; border-color: #18294a; }
.inv-details-cancel-btn:hover { border-color: #b84747; color: #b84747; }
.inv-details-edit-actions {
  display: flex;
  gap: 6px;
}
.inv-details-textarea {
  flex: 1;
  width: 100%;
  min-height: 160px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e8eaf0);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text, #1f2a44);
  resize: vertical;
  background: #fafbfc;
}
.inv-details-textarea:focus {
  outline: none;
  border-color: #1f3864;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.12);
}
