
/* =========================================================
   TRADESMITH v1.4 — Design system: "Vigil"
   The Batman terminal aesthetic, the trader's edition.
   - Near-black canvas with chartreuse signal accent
   - Display italic for hero moments, mono for data
   - Three-tier surface elevation, ambient gradient lighting
   - Subliminal grid, hairline borders, no shadows
   - One accent. Surgical. Always means something.
   ========================================================= */

:root {
  /* SURFACES — every neutral carries a trace of warm ink */
  --canvas-deep:    #060704;   /* off-screen voids */
  --canvas:         #0a0c08;   /* primary canvas */
  --surface-low:    #11140e;   /* sunk panels (form fields, recessed) */
  --surface:        #161913;   /* baseline panels */
  --surface-mid:    #1c1f17;   /* elevated panels */
  --surface-high:   #232719;   /* highest elevation, hover */

  /* INK — borders/dividers, all on white-alpha for natural light */
  --ink-1:          rgba(255, 255, 240, 0.04);   /* faintest divider */
  --ink-2:          rgba(255, 255, 240, 0.07);   /* default border */
  --ink-3:          rgba(255, 255, 240, 0.11);   /* prominent border */
  --ink-4:          rgba(255, 255, 240, 0.18);   /* hover border */

  /* TEXT — never pure white, always carries warm cast */
  --text:           #ecebe2;
  --text-soft:      #c8c7bd;
  --text-dim:       #8a8a7e;
  --text-faint:     #5a5a52;
  --text-ghost:     #3a3a36;

  /* THE SIGNAL — chartreuse. one accent, surgical. */
  --signal:         #d4ff3a;
  --signal-warm:    #c5ee2c;
  --signal-glow:    rgba(212, 255, 58, 0.18);
  --signal-bloom:   rgba(212, 255, 58, 0.06);
  --signal-ink:     #1a1d0e;     /* text-on-signal-bg */

  /* SEMANTIC — used only when meaning requires */
  --win:            #6dd29e;
  --win-glow:       rgba(109, 210, 158, 0.18);
  --loss:           #ff7a6e;
  --loss-glow:      rgba(255, 122, 110, 0.18);
  --warn:           #ffb84a;
  --warn-glow:      rgba(255, 184, 74, 0.18);

  /* TIER COLORS — gradient from signal → loss */
  --tier-aaa:       #d4ff3a;
  --tier-aa:        #ffd56a;
  --tier-a:         #ff9b6e;
  --tier-session:   #c08e6e;
  --tier-lhf:       #6e7466;
  --tier-no:        #5a3838;

  /* TYPOGRAPHY */
  --display:        'Newsreader', Georgia, serif;
  --sans:           'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:           'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* GEOMETRY */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== AMBIENT LIGHTING — the Batman atmosphere =====
   Two off-screen gradient blobs simulate dim cinematic light.
   Warm signal-tinted bloom from top-right, cool void from bottom-left.
   Plus a subliminal grid texture overlay. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 90% -10%, var(--signal-bloom), transparent 60%),
    radial-gradient(ellipse 700px 500px at -5% 105%, rgba(60, 80, 40, 0.08), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 240, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 240, 0.012) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

main, .topbar, .tabs { position: relative; z-index: 1; }

/* =========================================================
   TOP BAR — heavy presence, light interaction
   ========================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(180deg,
    rgba(10, 12, 8, 0.92) 0%,
    rgba(10, 12, 8, 0.78) 100%);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--ink-1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--signal-glow) 30%,
    var(--signal-glow) 70%,
    transparent);
  opacity: 0.6;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.brand .mark {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.brand .mark em {
  font-style: italic;
  color: var(--signal);
  font-weight: 600;
}

.brand .ver {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.clock {
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock strong {
  color: var(--text);
  font-weight: 500;
}

.clock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: all 0.4s ease;
}

.clock-dot.active {
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal-glow), 0 0 20px var(--signal-glow);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.topbar-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--ink-2);
  color: var(--text-dim);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.icon-btn:hover {
  border-color: var(--ink-4);
  color: var(--text);
  background: var(--surface-low);
}

/* =========================================================
   TABS — restrained, focused, with luminance hierarchy
   ========================================================= */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 28px;
  background: rgba(10, 12, 8, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ink-1);
  position: sticky;
  top: 65px;
  z-index: 99;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: transparent;
  border: none;
  color: var(--text-faint);
  padding: 14px 18px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab:hover { color: var(--text-soft); }
.tab.active {
  color: var(--text);
}
.tab.active::after {
  transform: scaleX(1);
  box-shadow: 0 0 8px var(--signal-glow);
}

.tab .badge {
  display: inline-block;
  margin-left: 7px;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text-dim);
  font-weight: 500;
}

.tab.active .badge {
  background: var(--signal);
  color: var(--signal-ink);
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: panelEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   TYPOGRAPHY — confident, dimensional, with personality
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  font-size: 44px;
  line-height: 1.05;
  margin-bottom: 8px;
  font-weight: 600;
}

h1 em {
  font-style: italic;
  color: var(--signal);
  font-weight: 600;
}

h2 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 16px;
}

h3 {
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
  font-weight: 500;
}

.eyebrow.signal { color: var(--signal); }
.eyebrow.warn { color: var(--warn); }
.eyebrow.win { color: var(--win); }
.eyebrow.loss { color: var(--loss); }

.lead {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  font-weight: 400;
  color: var(--text-soft);
  max-width: 68ch;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

/* Glossary tooltip — hover any acronym for definition */
.gloss {
  border-bottom: 1px dashed var(--text-faint);
  cursor: help;
  transition: color 0.2s;
}
.gloss:hover { color: var(--signal); border-bottom-color: var(--signal); }

/* =========================================================
   PANELS — three-tier elevation, ambient depth
   ========================================================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--ink-2);
  padding: 22px 24px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  position: relative;
}

.panel.tight { padding: 16px 18px; }
.panel.dense { padding: 12px 16px; }

.panel.elevated {
  background: var(--surface-mid);
  border-color: var(--ink-3);
}

.panel.featured {
  background:
    linear-gradient(135deg, var(--signal-bloom), transparent 70%),
    var(--surface-mid);
  border-color: rgba(212, 255, 58, 0.22);
}

.panel.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--signal) 0%, transparent 50%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.4;
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-1);
}

.panel-header h3 { margin-bottom: 0; }

.row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.col { flex: 1 1 0; min-width: 0; }
.col-2 { flex: 0 0 calc(50% - 9px); }
.col-3 { flex: 0 0 calc(33.33% - 12px); }
.col-4 { flex: 0 0 calc(25% - 13.5px); }

@media (max-width: 980px) {
  .col-2, .col-3, .col-4 { flex: 1 1 100%; }
  h1 { font-size: 36px; }
  .lead { font-size: 17px; }
  main { padding: 24px 20px 60px; }
}

/* =========================================================
   FORM CONTROLS — sunk surface, signal focus
   ========================================================= */
label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  background: var(--surface-low);
  border: 1px solid var(--ink-2);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

input[type="number"], input.mono { font-feature-settings: "tnum" 1, "zero" 1; }

input:hover, select:hover, textarea:hover {
  border-color: var(--ink-3);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--signal);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--signal-glow);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 9px;
  accent-color: var(--signal);
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 70px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

.field { margin-bottom: 14px; }

.field-help {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.5;
  letter-spacing: 0;
}

/* =========================================================
   BUTTONS — three weights, all confident
   ========================================================= */
.btn {
  background: var(--surface-mid);
  border: 1px solid var(--ink-3);
  color: var(--text);
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.btn:hover {
  background: var(--surface-high);
  border-color: var(--ink-4);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--signal);
  color: var(--signal-ink);
  border-color: var(--signal);
  font-weight: 600;
  box-shadow: 0 0 0 0 var(--signal-glow);
}

.btn.primary:hover {
  background: var(--signal-warm);
  border-color: var(--signal-warm);
  box-shadow: 0 0 24px var(--signal-glow), 0 0 0 1px var(--signal-warm);
}

.btn.discipline {
  background: transparent;
  border: 1px solid var(--win);
  color: var(--win);
}
.btn.discipline:hover {
  background: rgba(109, 210, 158, 0.08);
  box-shadow: 0 0 16px var(--win-glow);
}

.btn.danger {
  border-color: rgba(255, 122, 110, 0.4);
  color: var(--loss);
  background: rgba(255, 122, 110, 0.05);
}
.btn.danger:hover {
  background: rgba(255, 122, 110, 0.12);
  border-color: var(--loss);
}

.btn.sm { padding: 6px 12px; font-size: 11px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   CHIPS / BADGES — the signaling layer
   ========================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink-2);
  background: var(--surface-low);
  color: var(--text-dim);
  border-radius: 99px;
  font-weight: 500;
}

.chip.on {
  background: var(--signal);
  color: var(--signal-ink);
  border-color: var(--signal);
}
.chip.warn { color: var(--warn); border-color: rgba(255, 184, 74, 0.4); background: rgba(255, 184, 74, 0.06); }
.chip.danger { color: var(--loss); border-color: rgba(255, 122, 110, 0.4); background: rgba(255, 122, 110, 0.06); }
.chip.good { color: var(--win); border-color: rgba(109, 210, 158, 0.4); background: rgba(109, 210, 158, 0.06); }

.tier-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  padding: 3px 13px;
  letter-spacing: 0.01em;
  border: 1px solid currentColor;
  border-radius: 4px;
  line-height: 1.3;
}

.tier-aaa { color: var(--tier-aaa); background: rgba(212, 255, 58, 0.08); box-shadow: 0 0 16px rgba(212, 255, 58, 0.12); }
.tier-aa  { color: var(--tier-aa); background: rgba(255, 213, 106, 0.08); }
.tier-a   { color: var(--tier-a); background: rgba(255, 155, 110, 0.06); }
.tier-session { color: var(--tier-session); }
.tier-lhf { color: var(--tier-lhf); }
.tier-no  { color: var(--tier-no); }

/* =========================================================
   TABLES — dense data, scan-friendly
   ========================================================= */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-1);
}

th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
  background: var(--surface-mid);
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--ink-2);
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface-mid); }

td.mono { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 1; }
td.right { text-align: right; }
td.center { text-align: center; }

.empty-row td {
  text-align: center;
  color: var(--text-faint);
  font-style: italic;
  padding: 32px 20px;
  font-family: var(--display);
  font-size: 14px;
}

/* =========================================================
   STATS — the headline numbers, 2:1 number-to-unit ratio
   ========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--ink-2);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  overflow: hidden;
}

.stat {
  background: var(--surface);
  padding: 18px 20px;
  position: relative;
  transition: background 0.2s;
}

.stat:hover { background: var(--surface-mid); }

.stat .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat .val {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1, "zero" 1;
}

.stat .sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  font-feature-settings: "tnum" 1;
}

.stat.accent .val { color: var(--signal); }
.stat.good .val { color: var(--win); }
.stat.warn .val { color: var(--warn); }
.stat.danger .val { color: var(--loss); }

/* =========================================================
   PROGRESS BARS — minimal, expressive
   ========================================================= */
.progress {
  height: 4px;
  background: var(--surface-low);
  border-radius: 99px;
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}

.progress > div {
  height: 100%;
  background: var(--signal);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px var(--signal-glow);
}

.progress.good > div { background: var(--win); box-shadow: 0 0 8px var(--win-glow); }
.progress.warn > div { background: var(--warn); box-shadow: 0 0 8px var(--warn-glow); }
.progress.danger > div { background: var(--loss); box-shadow: 0 0 8px var(--loss-glow); }

/* =========================================================
   QUOTES — Burke's voice, dimensional, gravitas
   ========================================================= */
.quote {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  font-weight: 400;
  color: var(--text-soft);
  border-left: 2px solid var(--signal);
  padding: 6px 0 6px 22px;
  margin: 18px 0;
  line-height: 1.55;
  letter-spacing: -0.005em;
  position: relative;
}

.quote cite {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 10px;
  font-weight: 500;
}

/* =========================================================
   PLAN CARDS — the decision engine output
   ========================================================= */
.plan-card {
  background: var(--surface-mid);
  border: 1px solid var(--ink-2);
  border-left-width: 3px;
  padding: 18px 22px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}

.plan-card:hover { border-color: var(--ink-3); background: var(--surface-high); }

.plan-card.tier-card-aaa { border-left-color: var(--tier-aaa); }
.plan-card.tier-card-aa  { border-left-color: var(--tier-aa); }
.plan-card.tier-card-a   { border-left-color: var(--tier-a); }
.plan-card.tier-card-session { border-left-color: var(--tier-session); }
.plan-card.tier-card-lhf { border-left-color: var(--tier-lhf); }
.plan-card.tier-card-no  { border-left-color: var(--tier-no); opacity: 0.6; }

.plan-card.featured-card {
  background:
    linear-gradient(135deg, var(--signal-bloom) 0%, transparent 60%),
    var(--surface-high);
  border-color: rgba(212, 255, 58, 0.22);
  box-shadow: 0 0 32px rgba(212, 255, 58, 0.06);
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.plan-pair {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.plan-rationale {
  font-family: var(--display);
  font-size: 16px;
  font-style: italic;
  color: var(--text-soft);
  line-height: 1.55;
  margin-top: 8px;
  letter-spacing: -0.005em;
}

.flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* =========================================================
   CONFLUENCE / VIOLATION / EMOTION GRIDS
   ========================================================= */
.conf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 18px;
}

.conf-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: var(--text-soft);
  transition: color 0.15s;
  border-radius: var(--radius-sm);
}

.conf-item:hover { color: var(--text); }
.conf-item input { margin-top: 2px; flex-shrink: 0; }
.conf-item .star {
  color: var(--signal);
  font-size: 11px;
  filter: drop-shadow(0 0 4px var(--signal-glow));
}

/* =========================================================
   EXEC CHECKLIST — the four gates
   ========================================================= */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-low);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.check-row .num {
  color: var(--text-faint);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 12px;
  width: 18px;
  flex-shrink: 0;
}

.check-row .lbl {
  flex: 1;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 500;
}

.check-row select {
  flex: 0 0 200px;
  font-size: 12px;
  padding: 7px 10px;
}

.check-row.green {
  border-color: rgba(109, 210, 158, 0.4);
  background: rgba(109, 210, 158, 0.04);
}
.check-row.green .num { color: var(--win); }
.check-row.green .lbl { color: var(--win); }

.check-row.red {
  border-color: rgba(255, 122, 110, 0.4);
  background: rgba(255, 122, 110, 0.04);
}
.check-row.red .num { color: var(--loss); }
.check-row.red .lbl { color: var(--loss); }

/* =========================================================
   LISTS
   ========================================================= */
ul.simple { list-style: none; padding: 0; }
ul.simple li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--ink-1);
  font-size: 14px;
  color: var(--text-soft);
}
ul.simple li:last-child { border-bottom: none; }

ul.bullet {
  padding-left: 22px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}
ul.bullet li { padding: 4px 0; }

/* =========================================================
   TRADE DETAIL EXPANSION
   ========================================================= */
.trade-detail {
  background: var(--surface-mid);
  padding: 20px 24px;
  border-bottom: 1px solid var(--ink-2);
  font-size: 13px;
  color: var(--text-soft);
}

.trade-detail .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.trade-detail .lbl {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 4px;
  font-weight: 500;
}

.trade-detail .val {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

/* =========================================================
   HELPERS
   ========================================================= */
.muted { color: var(--text-faint); }
.dim { color: var(--text-dim); }
.signal-text { color: var(--signal); }
.win-text { color: var(--win); }
.warn-text { color: var(--warn); }
.danger-text, .loss-text { color: var(--loss); }
.good-text { color: var(--win); }
.accent-text { color: var(--signal); }

.divider {
  border: none;
  border-top: 1px solid var(--ink-1);
  margin: 22px 0;
}

.kbd {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--surface-low);
  border: 1px solid var(--ink-2);
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--text-soft);
}

.spacer-sm { height: 10px; }
.spacer-md { height: 20px; }
.spacer-lg { height: 32px; }

.display-italic {
  font-family: var(--display);
  font-style: italic;
}

/* =========================================================
   TOAST — surgical signaling
   ========================================================= */
.toast-host {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: var(--surface-high);
  border: 1px solid var(--ink-3);
  border-left: 3px solid var(--signal);
  padding: 14px 18px;
  font-size: 13px;
  max-width: 380px;
  border-radius: var(--radius);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 24px var(--signal-bloom);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  color: var(--text-soft);
  line-height: 1.5;
}

.toast.good {
  border-left-color: var(--win);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 24px var(--win-glow);
}
.toast.warn {
  border-left-color: var(--warn);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 24px var(--warn-glow);
}
.toast.bad {
  border-left-color: var(--loss);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 24px var(--loss-glow);
}

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =========================================================
   MASTERY GATES
   ========================================================= */
.gate {
  background: var(--surface);
  border: 1px solid var(--ink-2);
  padding: 18px 22px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  transition: all 0.3s;
}

.gate.locked { opacity: 0.45; }
.gate.unlocked {
  border-color: rgba(109, 210, 158, 0.3);
  background: linear-gradient(135deg, rgba(109, 210, 158, 0.04), transparent 60%), var(--surface);
}

.gate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gate-head h4 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.gate-head .seal {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}

.gate.unlocked .seal { color: var(--win); }

.gate-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.55;
}

/* =========================================================
   CIRCUIT BREAKERS
   ========================================================= */
.cb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.cb {
  background: var(--surface);
  border: 1px solid var(--ink-2);
  padding: 16px 18px;
  border-radius: var(--radius);
  transition: all 0.25s;
}

.cb.tripped {
  border-color: rgba(255, 122, 110, 0.4);
  background: linear-gradient(135deg, rgba(255, 122, 110, 0.06), transparent 60%), var(--surface);
}

.cb .name {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  font-weight: 500;
}

.cb .val {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  margin: 6px 0;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

/* =========================================================
   HISTOGRAM
   ========================================================= */
.histo {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding: 12px;
  background: var(--surface-low);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius);
}

.histo .bar {
  flex: 1;
  background: var(--ink-3);
  min-height: 1px;
  position: relative;
  transition: background 0.2s;
  border-radius: 2px 2px 0 0;
}

.histo .bar.win { background: var(--win); box-shadow: 0 -2px 8px var(--win-glow); }
.histo .bar.loss { background: var(--loss); box-shadow: 0 -2px 8px var(--loss-glow); }

.histo-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* =========================================================
   WATCHLIST — collapsible per instrument
   ========================================================= */
.wl-instrument {
  background: var(--surface);
  border: 1px solid var(--ink-2);
  margin-bottom: 10px;
  border-radius: var(--radius-lg);
  transition: all 0.25s;
  overflow: hidden;
}

.wl-instrument:hover { border-color: var(--ink-3); }

.wl-instrument.open {
  border-color: var(--ink-3);
  background: var(--surface-mid);
}

.wl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background 0.2s;
}

.wl-head:hover { background: var(--surface-mid); }
.wl-instrument.open .wl-head { border-bottom-color: var(--ink-2); }

.wl-pair {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.wl-summary {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.wl-body { display: none; padding: 18px; }
.wl-instrument.open .wl-body { display: block; }

.wl-body .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.forensic {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--surface-low);
  border-left: 2px solid var(--signal);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.forensic .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 10px;
  margin-bottom: 4px;
  font-weight: 500;
}

.forensic .lbl:first-child { margin-top: 0; }

.forensic .txt {
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 13px;
}

.forensic ul.bullet {
  font-size: 13px;
  color: var(--text-soft);
}

.no-burke {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}

/* =========================================================
   GLOSSARY POPOVER
   ========================================================= */
.gloss-pop {
  position: fixed;
  background: var(--surface-high);
  border: 1px solid var(--ink-3);
  padding: 14px 16px;
  font-size: 13px;
  max-width: 320px;
  border-radius: var(--radius);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 24px var(--signal-bloom),
    0 0 0 1px var(--ink-2);
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s, transform 0.18s;
  line-height: 1.55;
  color: var(--text-soft);
}
.gloss-pop.show { opacity: 1; transform: translateY(0); }
.gloss-pop strong {
  color: var(--signal);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

/* =========================================================
   FIRST-LAUNCH TOUR
   ========================================================= */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 4, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: tourFade 0.4s ease;
}

@keyframes tourFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tour-card {
  background: var(--surface-mid);
  border: 1px solid var(--ink-3);
  padding: 36px 40px;
  max-width: 580px;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 80px var(--signal-bloom);
  position: relative;
}

.tour-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--signal) 0%, transparent 50%, var(--signal) 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.3;
  pointer-events: none;
}

.tour-step {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 12px;
}

.tour-card h2 {
  font-family: var(--display);
  font-style: italic;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.1;
}

.tour-card p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
  margin-bottom: 14px;
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 16px;
}

.tour-progress {
  display: flex;
  gap: 5px;
}
.tour-progress span {
  width: 24px;
  height: 3px;
  background: var(--ink-3);
  border-radius: 99px;
  transition: background 0.3s;
}
.tour-progress span.done { background: var(--signal); }

/* =========================================================
   LEARN TRACK — sequential chapters
   ========================================================= */
.learn-toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.learn-chapter-card {
  background: var(--surface);
  border: 1px solid var(--ink-2);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.learn-chapter-card:hover {
  border-color: var(--ink-3);
  background: var(--surface-mid);
  transform: translateY(-2px);
}

.learn-chapter-card.read {
  border-left: 2px solid var(--win);
}

.learn-chapter-card .num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--signal);
  margin-bottom: 8px;
}

.learn-chapter-card .ttl {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}

.learn-chapter-card .desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.chapter-body {
  background: var(--surface);
  border: 1px solid var(--ink-2);
  padding: 36px 40px;
  border-radius: var(--radius-lg);
}

.chapter-body h2 {
  font-family: var(--display);
  font-style: italic;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.05;
}

.chapter-body .chapter-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 10px;
}

.chapter-body p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 16px;
  letter-spacing: -0.005em;
}

.chapter-body p strong {
  color: var(--text);
  font-weight: 600;
}

.chapter-body h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  margin-top: 26px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.chapter-body ul {
  margin-bottom: 18px;
  padding-left: 22px;
}
.chapter-body ul li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-2);
}

/* =========================================================
   STEP HEADER — for the Tuesday Plan steps
   ========================================================= */
.step {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
}

.step .step-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
  font-weight: 500;
}

.step .step-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.step-coach {
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 16px;
  max-width: 70ch;
}

/* =========================================================
   EMPTY STATES — educational, not blank
   ========================================================= */
.empty-state {
  padding: 32px 28px;
  text-align: center;
  border: 1px dashed var(--ink-2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at center, var(--signal-bloom), transparent 70%),
    var(--surface-low);
}

.empty-state .icon {
  font-family: var(--display);
  font-style: italic;
  font-size: 40px;
  color: var(--signal);
  margin-bottom: 14px;
  line-height: 1;
  opacity: 0.7;
}

.empty-state h4 {
  font-family: var(--display);
  font-size: 22px;
  font-style: italic;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 50ch;
  margin: 0 auto 16px;
  line-height: 1.6;
}

/* =========================================================
   SCROLLBAR
   ========================================================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb {
  background: var(--surface-mid);
  border-radius: 99px;
  border: 2px solid var(--canvas);
}
::-webkit-scrollbar-thumb:hover { background: var(--surface-high); }

/* =========================================================
   CODE / EXPORT OUTPUT
   ========================================================= */
.code-output {
  background: var(--surface-low);
  border: 1px solid var(--ink-2);
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text-soft);
  max-height: 320px;
  overflow-y: auto;
  border-radius: var(--radius);
}

/* Selection */
::selection { background: var(--signal); color: var(--signal-ink); }

/* =========================================================
   TRADESMITH v2 — Auth page + Mobile enhancements
   ========================================================= */

/* Auth page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface-mid);
  border: 1px solid var(--ink-3);
  padding: 48px 44px;
  max-width: 440px;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 80px var(--signal-bloom);
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--signal) 0%, transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.3;
  pointer-events: none;
}

.auth-brand {
  margin-bottom: 32px;
}

.auth-brand .mark {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.auth-brand .mark em {
  font-style: italic;
  color: var(--signal);
}

.auth-brand .sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

.auth-card h2 {
  font-family: var(--display);
  font-style: italic;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.6;
}

.auth-success {
  text-align: center;
  padding: 12px 0;
}

.auth-success .icon {
  font-family: var(--display);
  font-style: italic;
  font-size: 48px;
  color: var(--signal);
  margin-bottom: 16px;
  display: block;
}

.auth-success h3 {
  font-family: var(--display);
  font-size: 24px;
  font-style: italic;
  margin-bottom: 10px;
}

.auth-success p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.user-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

/* Signout button in topbar */
.signout-btn {
  background: transparent;
  border: 1px solid var(--ink-2);
  color: var(--text-faint);
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.signout-btn:hover {
  border-color: rgba(255,122,110,0.4);
  color: var(--loss);
}

/* =========================================================
   MOBILE-FIRST ENHANCEMENTS (< 768px)
   ========================================================= */
@media (max-width: 768px) {
  .topbar {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-right {
    font-size: 11px;
    gap: 10px;
  }

  .brand .mark { font-size: 22px; }

  .tabs {
    padding: 0 12px;
    top: 56px;
  }

  .tab {
    padding: 12px 12px;
    font-size: 11px;
  }

  main {
    padding: 20px 16px 60px;
  }

  h1 { font-size: 32px; }
  h2 { font-size: 22px; }
  .lead { font-size: 16px; }

  .auth-card {
    padding: 32px 24px;
  }

  .auth-brand .mark { font-size: 30px; }

  .row { flex-direction: column; }
  .col-2, .col-3, .col-4 { flex: 1 1 100%; }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat .val { font-size: 28px; }

  input, select, textarea {
    font-size: 16px; /* prevent iOS zoom */
    padding: 12px 14px;
    min-height: 44px;
  }

  .btn {
    min-height: 44px;
    padding: 12px 18px;
  }

  .check-row select { flex: 1 1 100%; }

  table { font-size: 12px; }
  th, td { padding: 8px 10px; }

  .conf-grid { grid-template-columns: 1fr; }

  .plan-card-head { flex-direction: column; gap: 6px; }

  .tour-card { padding: 24px 20px; }
  .tour-card h2 { font-size: 26px; }

  .chapter-body { padding: 24px 20px; }

  .toast-host { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  .tabs { top: 50px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .val { font-size: 24px; }
  .topbar { padding: 12px 12px; }
  .brand .mark { font-size: 20px; }
}
