/* ═══ §9 · TAB: HOME ══════════════════════════════════════════════════════════════════ */

/* scoped to .active so the base `.view { display: none }` still hides Home on other tabs —
   without `.active` the ID selector wins and Home leaks across every tab. */
#view-home.active {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  /* NO side inset: the shell already owns the one card inset. An 8px of its own is what made
     every Home card 16px narrower than every Race card. */
  padding: var(--sp-md) 0;
}
.home-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 14px;
  padding: var(--sp-md) var(--sp-md) calc(var(--sp-md) + 2px);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.home-section:active { transform: scale(0.985); }
.home-empty {
  padding: var(--sp-md) 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Portfolio rows ── */
.home-portfolio-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-portfolio-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--sp-sm);
  align-items: baseline;
  padding: 6px 4px;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.home-portfolio-row:last-child { border-bottom: none; }
.home-portfolio-row .sym { font-weight: 700; color: var(--text-primary); }
.home-portfolio-row .qty { font-family: var(--font-mono); color: var(--text-dim); font-size: 0.7rem; }
.home-portfolio-row .mkt { font-family: var(--font-mono); color: var(--text-secondary); font-size: 0.7rem; }
.home-portfolio-row .pnl { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; }
.home-portfolio-row .pnl.pos  { color: var(--outcome-win); }
.home-portfolio-row .pnl.neg  { color: #ff6b6b; }
.home-portfolio-row .pnl.flat { color: #8892b0; }

/* ── the SFTi scanner grid (S · F · T · i) ── */
.sfti-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px;
}
.sfti-grid-tile {
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 10px;
  padding: 8px 8px;
  cursor: pointer;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.sfti-grid-tile:hover { border-color: rgba(212, 175, 55, 0.5); transform: translateY(-1px); }
.sfti-grid-tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  margin-bottom: 4px;
}
.sfti-grid-label {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-gold);
  /* ★ 0, NOT 0.04em (operator 2026-08-12: "fully spell Volume on F, put Movers next to first on
     S, add Hours next to after on T" — the fuller names). Positive tracking on a MONOSPACE font
     is pure overhead: every glyph already owns a fixed advance width, so 0.04em added ~0.67px
     PER CHARACTER on top of that with no legibility gain — on "S - First Movers" (17 chars) that
     was ~11px of the ~37px this label was short by. Removing it is the one change here that
     costs nothing visually (mono characters do not touch at 0 tracking) while buying back real
     width; the padding/margin trims below make up the rest. */
  letter-spacing: 0;
  /* ★ ONE LINE, TRUNCATED — not wrapped (operator: "the names next to S F T and i … stop
     wrapping"). `.sfti-grid-tile-head` is a flex row, and a flex item's default `min-width` is
     `auto` — the CONTENT's min size, not zero — so the browser's only way to shrink the label
     past that floor is to wrap the text and let the longest WORD become the new floor. That is
     the wrap: not a font-size problem, a flex-sizing one. `min-width: 0` removes that floor so
     the label can shrink freely, and nowrap + ellipsis is what it shrinks INTO instead of a
     second line. Nothing is lost: the full name is still the modal's title one tap away
     (modal-scanner.js sets `scanner-modal-name` from the same `s.name`), the same reasoning
     `.sfti-grid-meta` beside it already earned for the same defect on the count (comment above). */
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sfti-grid-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  /* the count is ONE token: without these two, a two-line title squeezes "50" into a
     digit-per-line stack in the tile corner (operator's shot, 2026-08-10) */
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 4px;
}
.sfti-grid-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 0.78rem;
  cursor: pointer;
}
.sfti-grid-row .sym { font-weight: 700; color: var(--text-primary); }
.sfti-grid-row .px {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-left: auto;
  padding-right: 6px;
}
.sfti-grid-row .pct { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; }
.sfti-grid-row .pct.pos { color: var(--outcome-win); }
.sfti-grid-row .pct.neg { color: #ff6b6b; }
.sfti-grid-empty {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  padding: 6px 0;
}

/* ── News ── */
.home-news-rows { display: flex; flex-direction: column; gap: 6px; }
.home-news-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-sm);
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
}
.home-news-row:last-child { border-bottom: none; }
.home-news-row .chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(192, 192, 192, 0.1);
  color: var(--accent-silver);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
  height: fit-content;
}
.home-news-row .summary { color: var(--text-secondary); line-height: 1.35; }
.home-news-row .ts { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.62rem; }

/* ── Signals feed ── */
.home-signals-rows { display: flex; flex-direction: column; gap: 6px; }
.home-signal-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.12s ease;
}
.home-signal-row:last-child { border-bottom: none; }
.home-signal-row:hover { background: rgba(212, 175, 55, 0.05); }
.home-signal-row .chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(212, 175, 55, 0.12);
  color: var(--accent-gold);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
  grid-row: 1;
  grid-column: 1;
}
.home-signal-row .strategy {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  grid-row: 1;
  grid-column: 2;
  align-self: center;
}
.home-signal-row .meta {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  grid-row: 1;
  grid-column: 3;
  align-self: center;
}
.home-signal-row .entries {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}
.home-signal-row .entries b { color: var(--text-secondary); font-weight: 700; margin-right: 2px; }

