/* v3 styles — chrome (topbar, hero, dash, card) and shell layouts.

   Foundation tokens (paper/ink/rule/up/down/warm/cool, fonts, shadows, radii)
   plus body base styles + utility classes (.serif/.mono/.tabnum/.up/.down)
   and scrollbar rules now live in src/shared/tokens.css. dashboard.html
   loads that file as a real <link rel="stylesheet">, so this string only
   needs the chrome/component CSS that comes after.

   Density modifiers tied to component selectors live in styles-modules.jsx.
*/
const CSS_V3 = `
/* Topbar (.topbar/.brand/.nav-main/.tb-*/.search-v3/.session-v3) and its
   responsive @media rules now live in src/shared/chrome.css so legacy pages can
   share them. The pulse keyframe also lives there. */

/* ============ HERO — market at a glance + regime + catalyst queue ============ */
.hero {
  max-width: 1560px; margin: 0 auto;
  padding: 14px 24px 14px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: 14px;
}
.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}
.hero-lead { min-width: 0; }
.hero .kicker {
  font-family: var(--sans);
  font-size: 10px; font-weight: 700; color: var(--warm);
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}
.hero-line {
  font-family: var(--serif);
  font-size: 17px; color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.35;
  text-wrap: pretty;
  margin: 0;
}
.hero-line strong { font-weight: 600; }
.hero-line em { font-style: italic; color: var(--warm); font-weight: 500; }
.hero-line .sep { color: var(--ink-4); margin: 0 8px; }
.hero-line .mono { font-family: var(--mono); font-size: 15px; color: var(--ink); font-weight: 600; }
.hero-line .up   { color: var(--up);   font-family: var(--mono); font-size: 14px; font-weight: 700; }
.hero-line .down { color: var(--down); font-family: var(--mono); font-size: 14px; font-weight: 700; }

.hero-stats {
  display: flex; align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}
.hero-stat {
  padding: 6px 13px 7px;
  display: flex; flex-direction: column; gap: 0;
  border-right: 1px solid var(--rule-soft);
  min-width: 0;
}
.hero-stat:last-child { border-right: 0; }
.hs-k {
  font-family: var(--sans); font-size: 9px; font-weight: 700;
  color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 2px;
}
.hs-v {
  font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums;
  white-space: nowrap; line-height: 1.1;
}
.hs-t {
  font-family: var(--sans); font-size: 10px; color: var(--ink-3);
  font-weight: 500; white-space: nowrap; margin-top: 1px;
}
.hero-stat.tone-warm .hs-t { color: var(--warm); font-weight: 600; }
.hero-stat.tone-cool .hs-t { color: var(--cool); font-weight: 600; }
.hero-stat.tone-up .hs-t   { color: var(--up);   font-weight: 700; }
.hero-stat.tone-down .hs-t { color: var(--down); font-weight: 700; }

/* Regime pills + catalyst queue row */
.hero-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-regimes, .hero-catalysts {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.hrg-label, .hca-label {
  font-family: var(--sans); font-size: 9.5px; font-weight: 700;
  color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase;
  flex-shrink: 0;
  padding-right: 4px;
}
.hrg-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--mono);
  white-space: nowrap;
}
.hrg-k {
  font-size: 9.5px; font-weight: 600; color: var(--ink-3);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.hrg-v {
  font-size: 11px; font-weight: 700; color: var(--ink);
  letter-spacing: 0.01em;
}
.hrg-pill.tone-warm { border-color: var(--warm); background: var(--warm-bg); }
.hrg-pill.tone-warm .hrg-v { color: var(--warm); }
.hrg-pill.tone-cool { border-color: var(--cool); background: var(--cool-bg); }
.hrg-pill.tone-cool .hrg-v { color: var(--cool); }
.hrg-pill.tone-up { border-color: var(--up); background: var(--up-bg); }
.hrg-pill.tone-up .hrg-v { color: var(--up); }
.hrg-pill.tone-down { border-color: var(--down); background: var(--down-bg); }
.hrg-pill.tone-down .hrg-v { color: var(--down); }

.hero-catalysts {
  flex-wrap: wrap;
}
.hca-item {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 10px;
  text-decoration: none; color: inherit;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background 140ms;
}
.hca-item:hover { background: var(--paper-1); }
.hca-d {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--warm); letter-spacing: 0.06em; text-transform: uppercase;
  min-width: 24px;
}
.hca-item.tone-cool .hca-d { color: var(--cool); }
.hca-t {
  font-family: var(--serif); font-size: 13px; font-weight: 500; color: var(--ink);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.hca-h {
  font-family: var(--sans); font-size: 11px; color: var(--ink-3);
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .hero-top { grid-template-columns: 1fr; gap: 12px; }
  .hero-stats {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Edge fade so users can see there's more content to scroll */
    mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 24px), transparent 100%);
    scrollbar-width: none;
  }
  .hero-stats::-webkit-scrollbar { display: none; }
  .hero-bottom { grid-template-columns: 1fr; gap: 10px; }
  .hero-catalysts { justify-self: start; border-left: 0; padding-left: 0; }
  .hca-h { display: none; }
}
@media (max-width: 820px) {
  .hero { padding: 10px 14px; gap: 10px; }
  .dash { padding: 14px 14px 24px; gap: 22px; }
}
@media (max-width: 640px) {
  .hero-line { font-size: 15px; }
}

/* ============ DASH LAYOUT ============ */
.dash {
  max-width: 1560px; margin: 0 auto;
  padding: 20px 24px 24px;
  display: flex; flex-direction: column; gap: 28px;
}
.section { display: flex; flex-direction: column; gap: 14px; }

.section-hd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 6px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2px;
  align-items: baseline;
}
.section-hd .sh-title { grid-column: 1; grid-row: 1; min-width: 0; }
.section-hd .hd-actions {
  grid-column: 2; grid-row: 1;
  display: flex; gap: 8px; align-items: center;
  align-self: start; padding-top: 6px;
  flex-shrink: 0;
}
.section-hd .expl {
  grid-column: 1 / -1; grid-row: 2;
  font-family: var(--sans);
  color: var(--ink-3); font-size: 12.5px; font-weight: 400;
  text-wrap: balance;
  max-width: 720px;
  line-height: 1.45;
  margin: 0;
}
.section-hd .kicker {
  font-family: var(--sans);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--warm);
  display: block; margin-bottom: 4px;
}
.section-hd .kicker.cool { color: var(--cool); }
.section-hd h2 {
  font-family: var(--serif);
  font-size: 26px; font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.15;
  text-wrap: balance;
}
.section-hd h2 em { font-style: italic; color: var(--warm); }

.chip-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border: 1px solid var(--rule); border-radius: 12px;
  font-family: var(--sans);
  font-size: 10.5px; color: var(--ink-2);
  letter-spacing: 0.06em;
}
.chip-live .d { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: pulse 1.8s ease-in-out infinite; }

/* ---- Card ---- */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: border-color 160ms, box-shadow 160ms, transform 160ms;
}
.card:hover { border-color: var(--rule-strong); }
.card-hd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px; row-gap: 4px;
  align-items: center;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--rule-soft);
  min-width: 0;
}
.card-hd .t {
  font-family: var(--serif);
  font-size: 15px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.008em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.card-hd .explain {
  grid-column: 1 / -1;
  font-family: var(--sans);
  color: var(--ink-3); font-size: 11px; font-weight: 400;
  line-height: 1.35;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.card-hd .tag {
  font-family: var(--sans);
  font-size: 9.5px; color: var(--ink-3);
  padding: 2px 7px; border-radius: 3px;
  background: var(--paper-2);
  letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
.card-hd .tag.live { color: var(--up); background: var(--up-bg); }
.card-hd .tag.live .d { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--up); margin-right: 5px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }
.card-hd .tag.warm { color: var(--warm); background: var(--warm-bg); }
.card-hd .tag.cool { color: var(--cool); background: var(--cool-bg); }
.card-bd { padding: 0; flex: 1; min-height: 0; }

/* ---- Utility: accent zebra for sections ---- */
.section[data-tone="warm"] .section-hd .kicker { color: var(--warm); }
.section[data-tone="cool"] .section-hd .kicker { color: var(--cool); }

/* Everything below re-uses existing classes; styles-v3-modules.jsx adds module-specific overrides */

/* Topbar responsive @media (progressive collapse) lives in src/shared/chrome.css */

/* ============ TRAILHEAD / TOOLKIT ============ */
.trailhead-section .trail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.trail-col { display: flex; flex-direction: column; gap: 10px; }
.trail-col-h {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.trail-col-name {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700;
  color: var(--ink-2); letter-spacing: 0.14em; text-transform: uppercase;
}
.trail-col-dash { flex: 1; height: 1px; background: var(--rule-soft); }
.trail-col-count {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--ink-3);
}
.trail-list { display: flex; flex-direction: column; gap: 8px; }
.trail-tile {
  position: relative;
  display: block;
  padding: 12px 14px 12px 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  transition: border-color 140ms, transform 140ms, background 140ms;
}
.trail-tile:hover {
  border-color: var(--cool);
  background: var(--paper-1);
}
.trail-tile:hover .tt-arrow { color: var(--cool); transform: translateX(3px); }
.tt-top {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.trail-mark {
  width: 20px; height: 14px;
  color: var(--cool);
  flex-shrink: 0;
}
.tt-name {
  font-family: var(--serif); font-size: 15px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.005em;
  flex: 1; min-width: 0;
}
.tt-meta {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 2px;
  color: var(--ink-3); background: var(--paper-2);
}
.tt-meta-live { color: var(--up); background: var(--up-bg); }
.tt-meta-pro, .tt-meta-beta { color: var(--warm); background: var(--warm-bg); }
.tt-meta-new { color: var(--cool); background: var(--cool-bg); }
.tt-tag {
  font-family: var(--sans); font-size: 11.5px; color: var(--ink-3);
  line-height: 1.35;
}
.tt-arrow {
  position: absolute; right: 10px; top: 12px;
  color: var(--ink-4); font-family: var(--mono); font-size: 13px;
  transition: color 140ms, transform 140ms;
}
@media (max-width: 1100px) { .trailhead-section .trail-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .trailhead-section .trail-grid { grid-template-columns: 1fr; } }
`;
document.getElementById("v3-styles").textContent = CSS_V3;
