/* ScoutWire — signal-intelligence sales desk
   Brand: deep pine ground, blaze accent, field-sand ink.
   Accent variable names are kept from the original build so component CSS keeps
   working; the values are ScoutWire's. --indigo is the primary accent (blaze). */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #12201a;
  --bg-deep: #0c1712;
  --surface: #182a22;
  --surface-2: #1f332a;
  --surface-3: #274035;
  --line: #2e4c3e;
  --line-soft: #22392e;

  --ink: #f0ebe0;
  --ink-2: #b3c2b6;
  --ink-3: #7f9488;

  /* primary accent = blaze */
  --indigo: #ff4a1c;
  --indigo-soft: #ff6b42;
  --indigo-glow: rgba(255, 74, 28, 0.32);
  --orange: #ff4a1c;
  --orange-soft: #ff8a5c;
  --green: #4fae8a;
  --green-soft: #6fc4a2;

  /* charts: muted sage on pine, blaze reserved for emphasis */
  --chart-1: #6f9b83;
  --chart-2: #e0703f;
  --chart-3: #c9a24d;
  --chart-4: #5f92b0;

  --sl-managed: #5fbf9b;     /* Managed AI */
  --sl-transform: #e8c07a;   /* AI Transformation */
  --sl-engineering: #ff6b42; /* AI Engineering */

  --font: 'Figtree', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-drawer: -24px 0 80px rgba(6, 14, 10, 0.72);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { background: var(--bg); }

::selection { background: rgba(255, 74, 28, 0.35); }

button { font-family: inherit; cursor: pointer; }

/* ---------- shell ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  height: 64px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(18, 32, 26, 0.86);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 26px; display: block; }

.ws-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2); font-weight: 500;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; white-space: nowrap;
}
.ws-chip .ws-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange-soft); flex: none; }
@media (max-width: 1080px) { .ws-chip { display: none; } }
.brand .app-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-top: 1px;
}

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav button {
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
.nav button:hover { color: var(--ink); background: var(--surface); }
.nav button.active { color: var(--ink); background: var(--surface-2); }
.nav button .count {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--indigo-soft);
  margin-left: 6px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.live-dot {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-3); font-weight: 500;
}
.live-dot i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(79, 174, 138, 0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 174, 138, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(79, 174, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 174, 138, 0); }
}

.rep-switch {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
}
.rep-switch select {
  background: none; border: none; color: var(--ink);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  outline: none; appearance: none; cursor: pointer;
  padding-right: 2px;
}
.rep-switch select option { background: var(--surface-2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em;
  color: #fff; flex: none;
}

.main { max-width: 1440px; margin: 0 auto; padding: 26px 28px 80px; }

.view { display: none; animation: viewIn 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.view.active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.view-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.view-head .sub { color: var(--ink-3); font-size: 14px; }
.view-head .spacer { flex: 1; }

/* ---------- stat tiles ---------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
}
.stat .label {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
}
.stat .value {
  font-size: 30px; font-weight: 800; letter-spacing: -0.03em;
  margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat .delta { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.stat .delta.up { color: var(--ink-2); }
.stat .spark { position: absolute; right: 12px; bottom: 10px; opacity: 0.9; }

/* ---------- panels & grid ---------- */

.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.panel-head .hint { color: var(--ink-3); font-size: 12.5px; }
.panel-head .spacer { flex: 1; }

/* ---------- filter chips ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px; font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }

.seg {
  display: inline-flex; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 3px;
}
.seg button {
  background: none; border: none; color: var(--ink-2);
  font-size: 13px; font-weight: 700; padding: 5px 13px; border-radius: 6px;
  transition: all 0.15s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface-3); color: var(--ink); }

.search-box {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: inherit; font-size: 13px;
  padding: 6px 12px; width: 210px; outline: none; margin-left: 12px;
}
.search-box:focus { border-color: var(--indigo-soft); }
.search-box::placeholder { color: var(--ink-3); }

.chip-groups { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.chip-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); margin-right: 4px; align-self: center;
}

/* search + filters live in their own toolbar row, below the inbox title.
   Desktop: search left, filter groups right. Mobile: fully stacked (see media). */
.inbox-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 12px 18px; border-bottom: 1px solid var(--line-soft);
}
.inbox-toolbar .search-box { margin-left: 0; width: 260px; flex: none; }
.filter-selects { display: none; } /* desktop uses chips; selects are the mobile control */

.rf-icon { display: inline-block; }
.spinning .rf-icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- news desk ---------- */

.ticker {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg-deep);
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  padding: 8px 0;
  position: relative;
}
.ticker-inner { display: inline-block; animation: tick 80s linear infinite; }
.ticker-inner span { padding-right: 48px; }
.ticker:hover .ticker-inner { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

.news-row {
  display: grid;
  grid-template-columns: 92px 74px 1fr 190px;
  gap: 14px;
  align-items: baseline;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.news-row:last-child { border-bottom: none; }
.news-row.linkable { cursor: pointer; transition: background 0.15s; }
.news-row.linkable:hover { background: var(--surface-2); }
.news-row.compact { grid-template-columns: 64px 1fr; padding: 11px 16px; }

.n-ts { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.n-cat {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em;
  color: var(--ink-3); white-space: nowrap;
}
.n-cat::before { content: '● '; font-size: 8px; vertical-align: 1px; }
.cat-funding::before { color: var(--indigo-soft); }
.cat-funds::before { color: var(--indigo-soft); }
.cat-ma::before { color: var(--orange-soft); }
.cat-product::before { color: var(--sl-managed); }
.cat-hiring::before { color: var(--orange-soft); }
.cat-case::before { color: var(--ink-3); }
.cat-deal::before { color: var(--green); }

.n-head { font-size: 14px; font-weight: 600; line-height: 1.4; }
.n-snip { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.55; }
.n-src { font-style: italic; }
.n-lead {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.n-lead.dim { color: var(--ink-3); font-weight: 400; }

@media (max-width: 1080px) {
  .news-row { grid-template-columns: 74px 1fr; }
  .n-ts, .n-lead { display: none; }
}

/* ---------- signal feed rows ---------- */

.signal-row {
  display: grid;
  grid-template-columns: 44px 1.5fr 1fr minmax(150px, 165px) 118px auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
  cursor: pointer;
}
.signal-row:last-child { border-bottom: none; }
.signal-row:hover { background: var(--surface-2); }

.co-mark {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--ink-2);
  flex: none; letter-spacing: 0.01em;
  border: 1px solid var(--line);
}

.signal-co .co-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.signal-co .co-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }

.raise { font-variant-numeric: tabular-nums; }
.raise .amt { font-weight: 800; font-size: 15px; }
.raise .rnd { color: var(--ink-3); font-size: 12.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px;
  white-space: nowrap;
}
.badge.vert { background: var(--surface-3); color: var(--ink-2); }
.badge.sl-managed, .badge.sl-transform, .badge.sl-engineering {
  background: var(--surface-3); color: var(--ink-2);
}
.badge.sl-managed::before, .badge.sl-transform::before, .badge.sl-engineering::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none;
}
.badge.sl-managed::before { background: var(--sl-managed); }
.badge.sl-transform::before { background: var(--sl-transform); }
.badge.sl-engineering::before { background: var(--sl-engineering); }
.badge.new { background: none; border: 1px solid var(--line); color: var(--ink-2); }
.badge.inpipe {
  background: rgba(79, 174, 138, 0.10); color: var(--green-soft);
  border: 1px solid rgba(79, 174, 138, 0.28);
}
.sr-badges { overflow: hidden; }
.sr-badges .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.fit { display: flex; align-items: center; gap: 8px; }
.fit .bar {
  width: 64px; height: 5px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden; flex: none;
}
.fit .bar i { display: block; height: 100%; border-radius: 3px; background: var(--indigo-soft); }
.fit .num { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

.btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--ink-3); }
.btn.primary {
  background: var(--indigo); border-color: var(--indigo); color: #fff;
}
.btn.primary:hover { background: #4630ff; }
.btn.ghost { background: none; }
.btn.sm { font-size: 12px; padding: 5px 10px; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- charts ---------- */

.chart-block { padding: 16px 18px; }
.chart-block h3 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px;
}
.chart-tip {
  position: fixed; z-index: 90; pointer-events: none;
  background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 11px;
  font-size: 12.5px; box-shadow: 0 8px 26px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.12s;
}
.chart-tip.show { opacity: 1; }
.chart-tip .t-label { color: var(--ink-3); font-size: 11px; }
.chart-tip .t-val { font-weight: 700; font-variant-numeric: tabular-nums; }

.hbar-row { display: grid; grid-template-columns: 92px 1fr 34px; gap: 10px; align-items: center; margin-bottom: 9px; }
.hbar-row .hb-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-row .hb-track { height: 14px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar-row .hb-fill { display: block; height: 100%; border-radius: 4px; background: var(--chart-1); transition: width 0.6s cubic-bezier(0.16,1,0.3,1); }
.hbar-row .hb-val { font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- kanban ---------- */

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(238px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.col { min-width: 0; }
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 10px;
}
.col-head .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.col-head h3 { font-size: 12.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.col-head .n { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.col-body {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 120px;
  border-radius: var(--r-md);
  transition: background 0.15s;
  padding: 2px;
}
.col-body.drag-over { background: rgba(255, 74, 28, 0.07); outline: 1px dashed var(--indigo-soft); }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 14px 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: 0 10px 30px rgba(6,14,10,0.5); }
.card.dragging { opacity: 0.55; transform: rotate(1.6deg); }
.card .c-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.card .c-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.card .c-raise { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card .c-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.card .c-foot { display: flex; align-items: center; margin-top: 10px; gap: 8px; }
.card .c-foot .due { font-size: 11.5px; color: var(--ink-3); }
.card .c-foot .due.hot { color: var(--orange-soft); font-weight: 600; }
.card .avatar { width: 22px; height: 22px; font-size: 9px; margin-left: auto; }

/* ---------- drawer ---------- */

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 18, 13, 0.58);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(620px, 94vw);
  background: var(--bg-deep);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-drawer);
  transform: translateX(103%);
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }

.drawer-head { padding: 22px 26px 0; }
.drawer-head .d-row { display: flex; align-items: flex-start; gap: 14px; }
.drawer-head .co-mark { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
.drawer-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.drawer-head .d-sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.drawer-head .d-site {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--indigo-soft);
  text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s;
}
.drawer-head .d-site:hover { border-bottom-color: var(--indigo-soft); }
.drawer-head .d-site .ext { font-size: 11px; opacity: .7; }
.card-site {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  text-decoration: none; border-bottom: 1px solid transparent;
}
.card-site:hover { color: var(--indigo-soft); border-bottom-color: var(--indigo-soft); }
.drawer-head .d-close {
  margin-left: auto; background: none; border: none; color: var(--ink-3);
  font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.drawer-head .d-close:hover { color: var(--ink); background: var(--surface); }

.d-fund {
  display: flex; gap: 22px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 16px;
  margin-top: 16px;
}
.d-fund .f { min-width: 90px; }
.d-fund .f b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d-fund .f span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }

.d-stage-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.d-stage-row select {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 10px; outline: none;
}
.d-stage-row select option { background: var(--surface-2); }

.tabs { display: flex; gap: 2px; margin-top: 18px; border-bottom: 1px solid var(--line-soft); padding: 0 2px; }
.tabs button {
  background: none; border: none;
  color: var(--ink-3); font-size: 14px; font-weight: 700;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--indigo-soft); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 26px 40px; }

.d-section { margin-bottom: 24px; }
.d-section > h3 {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px;
}

.research-summary {
  font-size: 14.5px; color: var(--ink-2); line-height: 1.65;
  border-left: 3px solid var(--indigo-soft);
  padding-left: 14px;
}

.pain {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 15px;
  margin-bottom: 10px;
}
.pain .p-head { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.pain .p-head b { font-size: 14px; font-weight: 700; }
.pain p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }

.hooks li {
  list-style: none; position: relative;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.6;
  padding-left: 20px; margin-bottom: 7px;
}
.hooks li::before {
  content: ''; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
}

.approach {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--indigo-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.65;
}
.approach b { color: var(--ink); }

.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-cell { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 11px 13px; }
.score-cell .sc-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.score-cell .sc-top span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.score-cell .sc-top b { font-family: var(--mono); font-size: 12.5px; }
.score-cell .bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.score-cell .bar i { display: block; height: 100%; border-radius: 3px; background: var(--chart-1); }

/* contacts */
.contact {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 9px;
}
.contact .ct-info { min-width: 0; }
.contact .ct-info b { font-size: 14px; display: block; }
.contact .ct-info span { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }
.contact .src { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }

/* email composer */
.composer {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.composer .comp-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px; color: var(--ink-3);
}
.composer .comp-head b { color: var(--ink-2); font-weight: 600; }
.composer .subject {
  width: 100%; background: none; border: none; outline: none;
  color: var(--ink); font-family: inherit;
  font-size: 14.5px; font-weight: 700;
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
}
.composer textarea {
  width: 100%; min-height: 240px; resize: vertical;
  background: none; border: none; outline: none;
  color: var(--ink-2); font-family: inherit;
  font-size: 13.8px; line-height: 1.65;
  padding: 13px 14px;
}
.composer .comp-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-top: 1px solid var(--line-soft);
}
.composer .comp-foot .note { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }

.typing-caret::after {
  content: '▍'; color: var(--indigo-soft);
  animation: blink 0.85s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.draft-empty {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 26px 20px;
  text-align: center;
}
.draft-empty p { color: var(--ink-3); font-size: 13.5px; margin-bottom: 14px; }

/* timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line-soft); border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--ink-3);
}
.tl-item.hot::before { border-color: var(--green-soft); background: rgba(16,185,129,0.25); }
.tl-item .tl-text { font-size: 13.5px; color: var(--ink-2); }
.tl-item .tl-text b { color: var(--ink); }
.tl-item .tl-ts { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 18px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 14px 40px rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  z-index: 100;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .tick { color: var(--green-soft); font-size: 15px; }

/* team view */
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

.rep-line {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
.rep-line:last-child { border-bottom: none; }
.rep-line .r-name { font-weight: 700; font-size: 14px; }
.rep-line .r-sub { font-size: 12px; color: var(--ink-3); }
.rep-line .r-stat { margin-left: auto; text-align: right; }
.rep-line .r-stat b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rep-line .r-stat span { display: block; font-size: 11px; color: var(--ink-3); }

/* empty states */
.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

/* today-view row variants (classes, not inline grids — so media queries can win) */
.tr-follow { grid-template-columns: 44px 1.4fr 1fr auto auto; }
.tr-reply  { grid-template-columns: 44px 1.4fr 2fr auto; }
.tr-fresh  { grid-template-columns: 34px 1fr auto; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .team-grid { grid-template-columns: 1fr; }
  .signal-row:not(.today-row) { grid-template-columns: 44px 1.5fr 1fr auto; }
  .signal-row:not(.today-row) .sr-fit,
  .signal-row:not(.today-row) .sr-badges { display: none; }
}

@media (max-width: 820px) {
  .main { padding: 20px 16px 64px; }
}

@media (max-width: 720px) {
  /* topbar → compact brand + rep on row 1, scrollable nav strip on row 2 */
  .topbar {
    flex-wrap: wrap; height: auto; min-height: 54px;
    padding: 8px 14px; gap: 8px 12px;
  }
  .brand img { height: 24px; }
  .brand .app-tag, .live-dot { display: none; }
  .nav {
    order: 4; width: 100%; margin: 0 -14px; padding: 2px 14px 4px;
    overflow-x: auto; flex-wrap: nowrap; gap: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: none; white-space: nowrap; padding: 7px 12px; }
  .topbar-right { gap: 8px; }
  .rep-switch { padding: 4px 10px 4px 5px; }
  .rep-switch select { font-size: 12.5px; max-width: 116px; }

  /* mobile-first inbox: title, then full-width search, then scrollable filters */
  .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .inbox-toolbar { flex-direction: column; gap: 10px; padding: 12px 14px; }
  .inbox-toolbar .search-box { width: 100%; }
  /* 16px on editable fields stops iOS zooming (and getting stuck) on focus */
  .search-box, .composer .subject, .composer textarea { font-size: 16px; padding: 10px 12px; }
  /* filters become compact dropdowns on mobile (chips are desktop-only) */
  .chip-groups { display: none; }
  .filter-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .filter-selects label {
    display: flex; flex-direction: column; gap: 3px;
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3);
  }
  .filter-selects select {
    width: 100%; font-family: inherit; font-size: 16px; font-weight: 600; color: var(--ink);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
    padding: 9px 30px 9px 11px; outline: none; -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%237f9488' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat; background-position: right 11px center;
  }
  .filter-selects select:focus { border-color: var(--indigo-soft); }

  /* keep the header short so the list is visible without scrolling */
  .view-head .sub { display: none; }

  /* signals-first: list above the summary tiles on a phone */
  #view-signals.active { display: flex; flex-direction: column; }
  #view-signals .view-head { order: 1; }
  #view-signals .panel { order: 2; }
  #view-signals .stats { order: 3; margin: 8px 0 0; }

  .view-head { gap: 10px 14px; margin-bottom: 16px; }
  .view-head h1 { font-size: 21px; }
  .stat .spark { display: none; }
  .stat .value { font-size: 26px; }
}

@media (max-width: 560px) {
  /* signal rows → two-line cards (scoped away from today rows) */
  .signal-row:not(.today-row) {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    grid-template-areas: "mark name act" "mark raise act";
    column-gap: 11px; row-gap: 2px; padding: 13px 15px; align-items: center;
  }
  .signal-row:not(.today-row) > .co-mark { grid-area: mark; width: 38px; height: 38px; }
  .signal-row:not(.today-row) > .signal-co { grid-area: name; min-width: 0; }
  .signal-row:not(.today-row) > .raise { grid-area: raise; }
  .signal-row:not(.today-row) > .btn,
  .signal-row:not(.today-row) > .badge.inpipe { grid-area: act; justify-self: end; }
  .signal-co .co-name { font-size: 14px; }
  .signal-co .co-sub, .raise .rnd {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }

  /* today rows → 3-col, trimming the least-critical cells */
  .tr-follow, .tr-reply { grid-template-columns: 38px minmax(0, 1fr) auto; column-gap: 10px; }
  .tr-follow .due, .tr-follow .avatar, .tr-reply .tr-quote { display: none; }
  .tr-fresh { grid-template-columns: 34px minmax(0, 1fr); }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* drawer full-bleed */
  .drawer { width: 100vw; }
  .drawer-head { padding: 18px 16px 0; }
  .drawer-head h2 { font-size: 19px; }
  .drawer-body { padding: 16px 16px 32px; }
  .d-fund { gap: 14px 20px; }
  .score-grid { grid-template-columns: 1fr; }
  .composer textarea { min-height: 200px; }

  .board { grid-auto-columns: minmax(210px, 80vw); }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .demo-bar { padding: 8px 14px; gap: 8px 10px; font-size: 12.5px; }
  .demo-bar .db-switch {
    margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .demo-bar .db-switch::-webkit-scrollbar { display: none; }
  .demo-bar .db-switch a { flex: none; }
  .demo-bar .db-cta { margin-left: auto; }
}

/* ---------- demo-mode banner (app.html?demo=<key>) ---------- */
.demo-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 22px;
  font-size: 13px;
  color: var(--ink);
  background: linear-gradient(90deg, rgba(255, 74, 28, 0.16), rgba(255, 74, 28, 0.05));
  border-bottom: 1px solid rgba(255, 74, 28, 0.35);
}
.demo-bar .db-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--indigo); flex: none;
  box-shadow: 0 0 0 0 var(--indigo-glow);
  animation: dbpulse 2.4s infinite;
}
@keyframes dbpulse {
  0% { box-shadow: 0 0 0 0 var(--indigo-glow); }
  70% { box-shadow: 0 0 0 8px rgba(255, 74, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 74, 28, 0); }
}
.demo-bar .db-msg { color: var(--ink-2); }
.demo-bar .db-msg b { color: var(--ink); font-weight: 700; }
.demo-bar .db-switch {
  margin-left: auto;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.demo-bar .db-switch a {
  color: var(--ink-2); text-decoration: none;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.demo-bar .db-switch a:hover { border-color: var(--indigo); color: var(--ink); }
.demo-bar .db-switch a.on {
  background: rgba(255, 74, 28, 0.16); border-color: rgba(255, 74, 28, 0.5); color: var(--ink);
}
.demo-bar .db-cta {
  font-weight: 700; font-size: 12.5px; color: #fff; text-decoration: none;
  background: var(--indigo); border-radius: 8px; padding: 7px 14px; white-space: nowrap;
}
.demo-bar .db-cta:hover { background: var(--indigo-soft); }
@media (prefers-reduced-motion: reduce) { .demo-bar .db-dot { animation: none; } }

/* ---------- mobile safety: never let a flex row with a nowrap child overflow ---------- */
@media (max-width: 560px) {
  .pain .p-head { flex-wrap: wrap; row-gap: 6px; }
  .composer .comp-head { flex-wrap: wrap; row-gap: 4px; }
  .contact { flex-wrap: wrap; row-gap: 6px; }
  .d-stage-row { row-gap: 8px; }
  .drawer-body { overflow-x: hidden; }
  .view-head .sub { width: 100%; }
}

/* ---------- iOS auto-zoom guard ----------
   Safari zooms (and can get stuck off 1:1) whenever a focused field is < 16px.
   Force every editable control to 16px at ALL widths, high enough in the cascade
   (end of file) to beat the component rules above. */
.search-box,
.rep-switch select,
.d-stage-row select,
.composer .subject,
.composer textarea,
.filter-selects select,
input, select, textarea { font-size: 16px; }
