/* Kaz Research — design system (v1, per Design handoff 2026-06-03) */

:root {
  /* surfaces */
  --bg: #0a0a0a;
  --card: #131316;
  --card-2: #1a1a1f;       /* was #18181b — raised surface */
  --border: #1f1f23;
  --border-hi: #2c2c34;    /* renamed --border-hover */
  --border-hover: #2c2c34; /* legacy alias */

  /* text */
  --text-1: #ededed;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --text-4: #52525b;
  --text: #ededed;         /* legacy alias for --text-1 */

  /* accent + semantic */
  --accent: #fb923c;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #facc15;
  --blue: #60a5fa;
  --purple: #c084fc;
  --orange: #fb923c;       /* legacy alias for --accent */

  /* tinted fills (for tag/pill chips) */
  --green-bg:  rgba(74,222,128,.10);  --green-bd:  rgba(74,222,128,.22);
  --red-bg:    rgba(248,113,113,.10); --red-bd:    rgba(248,113,113,.22);
  --yellow-bg: rgba(250,204,21,.10);  --yellow-bd: rgba(250,204,21,.22);
  --blue-bg:   rgba(96,165,250,.10);  --blue-bd:   rgba(96,165,250,.22);
  --accent-bg: rgba(251,146,60,.10);  --accent-bd: rgba(251,146,60,.24);

  /* type */
  --display: "Inter Tight","Inter",system-ui,sans-serif;
  --ui:      "Inter",system-ui,sans-serif;
  --mono:    "Geist Mono","SF Mono",ui-monospace,"JetBrains Mono",monospace;

  /* spacing scale (base 4, primary 8) */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px;
  --s6:24px; --s8:32px; --s10:40px; --s12:48px; --s16:64px;

  /* radii */
  --r-chip:8px; --r-row:12px; --r-card:16px; --r-lg:20px;

  /* layout */
  --maxw: 1320px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--ui), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.mono {
  font-family: 'Geist Mono', 'JetBrains Mono', 'SF Mono', Menlo, ui-monospace, monospace;
  font-feature-settings: 'tnum' on, 'lnum' on;
  font-variant-numeric: tabular-nums;
}

/* ───── Layout ───── */

.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s8) var(--s16);
}

@media (max-width: 1024px) { .shell { padding: 0 var(--s6) var(--s12); } }
@media (max-width: 768px)  { .shell { padding: 0 var(--s5) var(--s10); } }

/* ───── Nav — sticky, full-bleed, backdrop-blur ───── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--s8);
  background: rgba(10,10,10,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin: 0 calc(var(--s8) * -1) var(--s8);
}
@media (max-width: 1024px) { .nav { padding: 0 var(--s6); margin: 0 calc(var(--s6) * -1) var(--s6); } }
@media (max-width: 768px)  { .nav { padding: 0 var(--s5); margin: 0 calc(var(--s5) * -1) var(--s5); } }

.brand-mark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.brand-mark img {
  height: 28px;          /* wordmark — larger than the previous 15px text */
  width: auto;
  display: block;
}
.brand-mark.wordmark-link img { height: 28px; }
@media (max-width: 768px) { .brand-mark img { height: 22px; } }
.brand-mark:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* Legacy inline wordmark — kept for any fallback */
.brand, .wordmark {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
}
.brand-name, .wordmark .k { color: var(--text-1); }
.brand-slash, .wordmark .sl { color: var(--blue); margin: 0 1px; }
.brand-tail, .wordmark .r { color: var(--text-2); transition: color .15s; }
.brand:hover .brand-tail, .wordmark:hover .r { color: var(--text-1); }

/* Ghost-pill tab bar (replaces the plain text nav-links) */
.nav-links, .tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.nav-links a, .tabs a, .tabs button {
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: 7px;
  transition: color .15s, background .15s, box-shadow .15s;
  text-decoration: none;
  line-height: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-links a:hover, .tabs a:hover, .tabs button:hover { color: var(--text-1); }
.nav-links a.active, .tabs a.on, .tabs button.on {
  background: var(--card);
  color: var(--text-1);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.nav-links a.soon, .tabs a.soon {
  color: var(--text-4);
  cursor: default;
  display: inline-flex; align-items: center; gap: 5px;
}
.nav-links a.soon:hover { color: var(--text-3); }
.nav-links .soon, .tabs .soon .mid { color: var(--text-4); font-size: inherit; }

/* ───── Header ───── */

.page-header {
  margin-bottom: var(--s8);
  padding-top: var(--s5);
}
.page-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s8);
  flex-wrap: wrap;
}
.page-header-flex .divider { width: 100%; flex-basis: 100%; }
.ph-left { flex: 1 1 auto; }
.ph-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s2);
  padding-top: var(--s2);
}
.ph-context { margin: 0; }

.h-date {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-1);
  margin: 0 0 var(--s2);
}
@media (max-width: 768px) { .h-date { font-size: 32px; } }

.h-sub {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-2);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.h-sub .price { color: var(--text); }
.h-sub .change.up { color: var(--green); }
.h-sub .change.down { color: var(--red); }

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0 32px;
}

/* ============================================================
   TYPE SCALE (Design v1)
   ============================================================ */
.t-hero  { font-family: var(--mono); font-size: 56px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.t-h1    { font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.t-h2    { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.t-h3    { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.t-body  { font-family: var(--ui); font-size: 15px; font-weight: 400; line-height: 1.6; }
.t-label { font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.t-caption { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }

/* ============================================================
   PRIMITIVE COMPONENTS (Design v1)
   ============================================================ */

/* Directional tag — 做多 / 做空 / 横盘 / info */
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 3px 9px; border-radius: var(--r-chip);
  letter-spacing: 0; white-space: nowrap; line-height: 1.4;
}
.tag-green { color: var(--green); background: var(--green-bg); border: 1px solid var(--green-bd); }
.tag-red { color: var(--red); background: var(--red-bg); border: 1px solid var(--red-bd); }
.tag-yellow { color: var(--yellow); background: var(--yellow-bg); border: 1px solid var(--yellow-bd); }
.tag-blue { color: var(--blue); background: var(--blue-bg); border: 1px solid var(--blue-bd); }
.tag-accent { color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-bd); }

/* Score chip — colour by value */
.score-chip {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 3px;
}
.score-chip.s95 { color: var(--purple); }
.score-chip.s80, .score-chip.s85 { color: var(--green); }
.score-chip.s70, .score-chip.s75 { color: var(--yellow); }
.score-chip.s0, .score-chip.s65 { color: var(--red); }
.score-chip.sx { color: var(--text-3); }

/* Status pill — dot + label */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-2);
  padding: 4px 11px 4px 9px; border-radius: 99px;
  background: var(--card-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.pill .d { width: 7px; height: 7px; border-radius: 50%; }
.pill.live .d { background: var(--green); animation: pulse 2.2s ease-in-out infinite; }
.pill.pending .d { background: var(--yellow); }
.pill.selected .d { background: var(--blue); }
.pill.hidden-route .d { background: var(--text-3); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Catalyst importance dots */
.dots { display: inline-flex; align-items: center; gap: 4px; }
.dot { border-radius: 50%; display: inline-block; }
.dot.hi { width: 8px; height: 8px; }
.dot.mid { width: 6px; height: 6px; }
.dot.lo { width: 4px; height: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--ui); font-size: 13px; font-weight: 500; line-height: 1;
  padding: 9px 15px; border-radius: 9px;
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn:hover { color: var(--text-1); border-color: var(--border-hi); background: var(--card-2); }
.btn-primary { background: var(--text-1); color: #0a0a0a; border-color: var(--text-1); font-weight: 600; }
.btn-primary:hover { background: #fff; color: #000; border-color: #fff; }
.btn-accent { background: var(--accent); color: #1a1206; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { background: #fca85a; border-color: #fca85a; }
.btn-sm { font-size: 12px; padding: 6px 11px; border-radius: 8px; }

/* Data table primitive */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  font-family: var(--ui); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); text-align: left;
  padding: 0 14px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl thead th.r, .tbl td.r { text-align: right; }
.tbl tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: middle;
}
.tbl tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-1); }
.tbl .num.pos { color: var(--green); }
.tbl .num.neg { color: var(--red); }
.tbl .num.acc { color: var(--accent); }
.tbl .name { color: var(--text-1); }

/* In-page tab wrap (Day Detail Morning/Evening) */
.day-tabs-wrap {
  display: flex;
  justify-content: center;
  margin: var(--s6) 0 var(--s8);
}

/* ───── Grid (2x2) ───── */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

/* ───── Card ───── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.15s ease;
}

.card-link {
  cursor: pointer;
}

.card-link:hover {
  border-color: var(--border-hover);
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-2);
  text-transform: uppercase;
  margin: 0 0 20px;
}

.card-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-2);
  text-transform: uppercase;
  margin: 0 0 8px;
}

/* ───── TLDR Card ───── */

.tldr-thesis {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 12px;
}

.tldr-core {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: var(--card-2);
  border-radius: 10px;
  border-left: 2px solid var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tldr-core-line {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0;
}

/* Single emphasis rule: only $price gets accent color (orange).
   Everything else stays plain — the typography (font / weight / size)
   already carries the hierarchy. */
.hl-price {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;  /* don't break "$39.4k" mid-chip when cell wraps */
}

/* Legacy classes retained as no-ops for safety */
.hl, .hl-num, .hl-key { color: inherit; font-weight: inherit; }

/* Separator within a card */
.tldr-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0 16px;
}

/* Last evening recap inside the TLDR card */
.tldr-eve-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.tldr-eve-core {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid var(--text-3);
  margin-bottom: 14px;
}
.tldr-eve-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.tldr-eve-trig-label { margin-top: 6px; }

/* Density grid in SETUP card */
.density-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.density-row {
  display: grid;
  grid-template-columns: 56px 56px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.015);
}
.density-row.long .density-side { color: var(--green); }
.density-row.short .density-side { color: var(--red); }
.density-row.range .density-side { color: var(--yellow); }
.density-side { font-weight: 600; }
.density-pct {
  font-weight: 600;
  color: var(--text);
}
.density-desc {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

/* Headline signals — emoji prefix rows with optional inline bold */
.tldr-headline-signals {
  list-style: none;
  margin: 8px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tldr-headline-signals li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  padding-left: 0;
  word-break: break-word;
}
.tldr-headline-signals li b {
  font-weight: 700;
  color: var(--text);
}

/* Probability shift diff table */
.prob-diff {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0 16px;
  padding: 12px 14px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid var(--border-hover);
}
.prob-diff-row {
  display: grid;
  grid-template-columns: 1fr 48px 18px 48px 48px;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.prob-diff-row.agg {
  color: var(--text);
  font-weight: 600;
}
.prob-diff-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.pd-label { color: var(--text-2); }
.prob-diff-row.agg .pd-label { color: var(--text); }
.pd-prev { color: var(--text-3); text-align: right; }
.pd-arrow { color: var(--text-3); text-align: center; }
.pd-curr { color: var(--text); text-align: right; }
.pd-delta { text-align: right; font-weight: 600; }
.pd-delta.pos { color: var(--green); }
.pd-delta.neg { color: var(--red); }
.pd-delta.zero { color: var(--text-3); }

/* Yesterday recap (collapsible) */
.tldr-recap {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.tldr-recap-summary {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tldr-recap-summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--text-3);
}
.tldr-recap[open] .tldr-recap-summary::before {
  transform: rotate(90deg);
}
.tldr-recap-summary::-webkit-details-marker { display: none; }
.tldr-recap[open] .tldr-headline-signals {
  margin-top: 10px;
}

/* HERO banner — one-sentence essence above the grid */
.hero-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  margin: 0 0 24px;
  background: linear-gradient(135deg, rgba(251,146,60,0.06), rgba(251,146,60,0.02));
  border: 1px solid rgba(251,146,60,0.25);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
}
.hero-marker {
  font-size: 20px;
  line-height: 1.4;
  flex-shrink: 0;
}
.hero-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.005em;
}
.hero-text b { font-weight: 700; }
@media (max-width: 768px) {
  .hero-banner { padding: 14px 16px; gap: 10px; }
  .hero-text { font-size: 14px; }
}

.tldr-signals {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tldr-signals li {
  font-size: 13px;
  color: var(--text-2);
  padding-left: 14px;
  position: relative;
}

.tldr-signals li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--text-3);
}

.tldr-anchor {
  font-size: 14px;
  color: var(--text);
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--card-2);
  border-radius: 10px;
  border-left: 2px solid var(--blue);
}

.tldr-prob {
  display: flex;
  gap: 24px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tldr-prob .label { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.tldr-prob .val { font-weight: 600; }
.tldr-prob .short .val { color: var(--red); }
.tldr-prob .long .val { color: var(--green); }
.tldr-prob .range .val { color: var(--yellow); }

/* ───── Setup Card ───── */

.setup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
}

.setup + .setup { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }

.setup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* Big side tag — 做多 / 做空 */
.setup-side {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.setup-side.long {
  background: rgba(74, 222, 128, 0.16);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.setup-side.short {
  background: rgba(248, 113, 113, 0.16);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.setup-label {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.setup-tail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.setup-name {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.setup-emph { color: var(--purple); font-size: 13px; }

.setup-grid {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px 14px;
  font-size: 13px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-feature-settings: 'tnum' on;
  align-items: baseline;
}

.setup-grid .k {
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.setup-grid .v {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setup-grid .v-multiline {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.6;
}

.setup-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
}

.setup-more {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease;
}

.setup-more::after {
  content: ' →';
  color: var(--text-3);
}

.setup-more:hover { color: var(--text); }
.setup-more:hover::after { color: var(--text); }

/* ───── Modal ───── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: modal-fade 180ms ease;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: modal-slide 200ms ease;
}

.modal::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-2);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.modal-close:hover { color: var(--text); background: var(--card-2); }

.modal-body .setup + .setup {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 6px;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-slide {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ───── Desk Recent ───── */

.desk-recent-label {
  margin: 24px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.desk-recent-day {
  margin-bottom: 14px;
}

.desk-recent-date {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.desk-recent-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
  align-items: baseline;
}

.desk-recent-row:hover {
  background: var(--card-2);
  padding-left: 6px;
  padding-right: 6px;
  margin-left: -6px;
  margin-right: -6px;
}

.desk-recent-row-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.desk-kind-mini {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
}

.desk-recent-title {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ───── Desk Card ───── */

.desk-section {
  padding: 8px 0;
}

.desk-section + .desk-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }

.desk-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.desk-kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.desk-score {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
}

.desk-score.s95 { color: var(--purple); }
.desk-score.s85 { color: var(--green); }
.desk-score.s75 { color: var(--yellow); }
.desk-score.s65 { color: var(--orange); }

.desk-title {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}

.desk-empty {
  font-size: 14px;
  color: var(--text-3);
  font-style: italic;
}

/* ───── Next Catalyst Card ───── */

.cat-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  font-family: 'Inter Tight', 'Inter', sans-serif;
}

.cat-importance { display: inline; }

.cat-countdown {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--yellow);
  margin: 4px 0 6px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cat-countdown.urgent { color: var(--red); animation: pulse 1.5s ease infinite; }

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

.cat-fc {
  font-size: 13px;
  color: var(--text-2);
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  margin-bottom: 24px;
}

/* PATHS — stacked card layout (no more side-by-side grid that overflowed) */
.cat-paths {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cat-path {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
}
.cat-path .cond {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -0.005em;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}
.cat-path .out {
  font-family: var(--ui);
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cat-after {
  margin-top: 8px;
}

.cat-after-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  align-items: baseline;
}

.cat-after-row .t { color: var(--text-3); }
.cat-after-row .e { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-after-row .fc { color: var(--text-3); text-align: right; }

/* ───── BTC Calendar ───── */

.cal-head-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.cal-head {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}

.cal-cell-gap {
  /* leading padding cells — invisible spacer */
}

.cal-cell {
  aspect-ratio: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.1s ease;
  min-height: 140px;
  position: relative;
}
.cal-cell.clickable { cursor: pointer; }
.cal-cell.clickable:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.cal-cell.today {
  border: 1.5px solid var(--blue);
  box-shadow: 0 0 32px rgba(96, 165, 250, 0.18);
  background: linear-gradient(180deg, rgba(96,165,250,0.05), transparent 60%), var(--card);
}

.cal-cell.future {
  background: transparent;
  border: 1px dashed var(--border);
  opacity: 0.45;
}

.cal-cell.blank-past {
  background: transparent;
  border: 1px dashed var(--border);
  opacity: 0.6;
}

/* Top row: day num + TODAY tag / flag */
.cal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.cal-num {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}
.cal-cell.future .cal-num,
.cal-cell.blank-past .cal-num { color: var(--text-3); font-weight: 500; }

.cal-today-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
  text-transform: uppercase;
}
.cal-flag-top { font-size: 14px; line-height: 1; }

/* Price + change */
.cal-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.cal-chg {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.cal-chg.up { color: var(--green); }
.cal-chg.down { color: var(--red); }
.cal-tri { font-size: 8px; line-height: 1; }

.cal-empty-mark {
  font-size: 24px;
  color: var(--text-3);
  font-weight: 300;
  margin-top: 6px;
}

/* Sparkline */
.cal-spark {
  width: 100%;
  height: 28px;
  margin-top: 6px;
  display: block;
}
.cal-spark-spacer { height: 28px; margin-top: 6px; }

/* Footer: dots (left) + scores (right) */
.cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}
.cal-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.cal-dot { display: inline-block; border-radius: 50%; }
.cal-dot.hi { width: 7px; height: 7px; background: var(--red); }
.cal-dot.mid { width: 6px; height: 6px; background: var(--orange); }
.cal-dot.lo { width: 5px; height: 5px; background: var(--yellow); }
.cal-dot.ghost { width: 5px; height: 5px; background: var(--text-3); opacity: 0.3; }

.cal-scores {
  display: flex;
  gap: 4px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  align-items: baseline;
}
.cal-scores .s.s95 { color: var(--purple); }
.cal-scores .s.s85 { color: var(--green); }
.cal-scores .s.s75 { color: var(--yellow); }
.cal-scores .s.s65 { color: var(--orange); }
.cal-scores .s-arrow { color: var(--text-3); font-size: 10px; }
.cal-flag { color: var(--purple); font-size: 12px; margin-left: 2px; }

@media (max-width: 900px) {
  .cal-grid { gap: 8px; }
  .cal-head-row { gap: 8px; }
  .cal-cell { min-height: 110px; padding: 10px; }
  .cal-num { font-size: 18px; }
  .cal-price { font-size: 14px; }
  .cal-chg { font-size: 10px; }
}

/* ───── Day Detail empty state ───── */
.day-empty {
  text-align: center;
  padding: 80px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.day-empty-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 20px;
  opacity: 0.85;
}
.day-empty-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}
.day-empty-msg {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 0 28px;
}
.day-empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.day-empty-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.day-empty-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}
.day-empty-btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--bg);
  font-weight: 600;
}
.day-empty-btn.primary:hover {
  background: #4d8fea;
  border-color: #4d8fea;
}
.day-empty-hint {
  margin-top: 32px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ───── Position page ───── */
.pos-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.pos-header-right {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
.pos-reanalyze-btn { /* now styled via .btn .btn-accent — no overrides needed */ }
.pos-reanalyze-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ───── Confirm modal ───── */
.modal-confirm { max-width: 440px; }
.confirm-lead { font-size: 13px; color: var(--text); margin: 0 0 12px; }
.confirm-steps {
  margin: 0 0 18px 18px;
  padding: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}
.confirm-warn {
  font-size: 11px;
  color: var(--text-3);
  margin: 6px 0;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-secondary, .btn-danger {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-hover); }
.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: var(--bg);
}
.btn-danger:hover { background: #ef5454; border-color: #ef5454; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

/* ───── Reanalyze progress / success / error ───── */
.reanalyze-progress, .reanalyze-success, .reanalyze-error {
  text-align: center;
  padding: 16px 0 8px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text {
  font-size: 14px; color: var(--text); margin: 0 0 6px;
}
.progress-eta {
  font-size: 11px; color: var(--text-3); margin: 4px 0;
}
.progress-jobid {
  font-size: 10px; color: var(--text-3); margin-top: 12px;
}
.success-tick, .error-x {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 24px; font-weight: 700;
  margin: 0 auto 16px;
}
.success-tick { background: rgba(74,222,128,0.15); color: var(--green); }
.error-x { background: rgba(248,113,113,0.15); color: var(--red); }
.success-title, .error-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  margin: 0 0 10px;
}
.error-msg {
  font-size: 11px; color: var(--text-2);
  padding: 10px;
  background: var(--card-2);
  border-radius: 4px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px; overflow-y: auto;
  margin: 0 0 16px;
}
.pos-header .h-sub .short { color: var(--red); font-weight: 700; }
.pos-header .h-sub .long  { color: var(--green); font-weight: 700; }
.pos-sync { text-align: right; }
.pos-sync-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.pos-sync-time { font-size: 14px; color: var(--text); font-weight: 600; }
.pos-sync-abs { font-size: 11px; color: var(--text-3); }

.pos-card {
  margin-bottom: 18px;
  padding: 24px;
}

/* Snapshot hero row */
.pos-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 4px 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.pos-hero-pnl { text-align: left; }
.pos-hero-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.pos-hero-val { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.pos-hero-val.up { color: var(--green); }
.pos-hero-val.down { color: var(--red); }
.pos-hero-range { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.pos-kv-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 18px;
  font-size: 13px;
}
.pos-kv-k {
  color: var(--text-3);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.pos-kv-v { color: var(--text); }

.pos-method-note {
  margin-top: 14px;
  font-size: 10px;
  color: var(--text-3);
  text-align: right;
}

/* Compliance check */
.pos-compliance {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pos-compliance li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.pos-comp-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.pos-comp-icon.ok { background: rgba(74,222,128,0.15); color: var(--green); }
.pos-comp-icon.warn { background: rgba(250,204,21,0.15); color: var(--yellow); }
.pos-comp-icon.fail { background: rgba(248,113,113,0.15); color: var(--red); }
.pos-compliance li.pos-comp-warn .pos-comp-text { color: var(--text); }
.pos-compliance li.pos-comp-fail .pos-comp-text { color: var(--text); }

/* Price ladder */
.pos-ladder { position: relative; height: 240px; padding: 0 12px; }
.pos-ladder-inner { position: relative; height: 100%; }
.pos-ladder-row {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
  font-size: 12px;
}
.pos-ladder-row.liq   { color: var(--text-3); }
.pos-ladder-row.entry { color: var(--text-2); }
.pos-ladder-row.stop  { color: var(--red); }
.pos-ladder-row.mark  { color: var(--yellow); }
.pl-label {
  width: 50px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pl-line {
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}
.pos-ladder-row.mark .pl-line {
  height: 2px; opacity: 0.7;
}
.pos-ladder-row.stop .pl-line {
  background-image: linear-gradient(90deg, currentColor 50%, transparent 50%);
  background-size: 6px 1px;
  background-color: transparent;
  height: 2px;
  opacity: 0.6;
}
.pl-px { font-weight: 600; min-width: 90px; text-align: right; }
.pl-dist {
  font-size: 11px;
  color: var(--text-3);
  min-width: 60px;
  text-align: right;
}

/* PnL split bar */
.pnl-split { padding: 8px 0; }
.pnl-bar {
  height: 24px;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--card-2);
}
.pnl-bar-locked { background: var(--green); }
.pnl-bar-floating { background: rgba(74,222,128,0.4); border-left: 1px solid var(--bg); }
.pnl-legend { display: flex; flex-direction: column; gap: 8px; }
.pnl-leg { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.pnl-leg-dot { width: 12px; height: 12px; border-radius: 2px; }
.pnl-leg-dot.locked { background: var(--green); }
.pnl-leg-dot.floating { background: rgba(74,222,128,0.4); }
.pnl-leg-label { flex: 1; color: var(--text-2); }
.pnl-leg-val { color: var(--green); font-weight: 600; }
.pnl-total {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: right;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

/* PnL trajectory sparkline */
.pos-spark-svg {
  width: 100%;
  height: 140px;
  display: block;
  margin-top: 12px;
}

/* EXEC — stacked card list (was a grid table that overflowed) */
.exec-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.exec-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.exec-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.exec-item-pri {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.exec-item-when {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: -0.005em;
}
.exec-item-action {
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.5;
  word-break: break-word;
}
.exec-item-meta {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 6px 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.exec-meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 3px;
  line-height: 1.4;
}
.exec-meta-value {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.exec-meta-value.exec-lock-val {
  color: var(--green);
  font-weight: 600;
}
.exec-meta-value.exec-lock-val .hl-price { color: var(--green); }

/* SCENARIO — stacked card list per row */
.scen-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.scen-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.scen-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.scen-item-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  flex: 1 1 auto;
  line-height: 1.4;
  word-break: break-word;
}
.scen-item-prob {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  flex-shrink: 0;
}
.scen-item-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
}
.scen-meta-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.scen-meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.scen-meta-val {
  color: var(--text-1);
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.scen-total-val {
  color: var(--green);
  font-weight: 600;
}
.scen-total-val .hl-price { color: var(--green); }
.scen-conclusion {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  background: rgba(96,165,250,0.05);
  border-left: 3px solid var(--blue);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}
.scen-conclusion strong { color: var(--blue); }

/* Strategy markdown blocks */
.pos-md { font-size: 13px; line-height: 1.6; color: var(--text-2); }
.pos-md p { margin: 0 0 10px; }
.pos-md ul { margin: 6px 0 10px 22px; padding: 0; }
.pos-md li { margin: 4px 0; }
.pos-md strong { color: var(--text); }
.pos-md code { font-size: 12px; padding: 1px 4px; background: var(--card-2); border-radius: 3px; }

/* Position trail */
.trail-table {
  display: grid;
  grid-template-columns: 140px 200px 1fr;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 12px;
}
.trail-row { display: contents; }
.trail-row > div {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.trail-row:first-child > div { border-top: 0; }
.trail-time { color: var(--text-3); }
.trail-size { color: var(--text); font-weight: 600; }
.trail-event { color: var(--text-2); }

/* ───── Toggle ───── */

.toggle-group {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.toggle-btn {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.toggle-btn.active { background: var(--card-2); color: var(--text); }

/* ───── Stocks placeholder ───── */

.stocks-empty {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stocks-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
}

.stocks-em {
  width: 32px;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.stocks-msg {
  font-size: 16px;
  color: var(--text-2);
  margin: 0 0 8px;
}

.stocks-list {
  font-size: 13px;
  color: var(--text-3);
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
}

/* ───── Position page ───── */

.pos-hero-pnl {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  margin: 12px 0 6px;
}

.pos-hero-pnl.up { color: var(--green); }
.pos-hero-pnl.down { color: var(--red); }

.pos-hero-sub {
  font-size: 15px;
  color: var(--text-2);
}

.pos-list {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px 24px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  margin: 32px 0;
}

.pos-list .k { color: var(--text-3); }
.pos-list .v { color: var(--text); }

.pos-history {
  margin-top: 32px;
}

.pos-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px 90px;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  align-items: baseline;
}

.pos-row .t { color: var(--text-3); }
.pos-row .a { color: var(--text); }
.pos-row .p { color: var(--text-2); }
.pos-row .pnl { font-weight: 600; text-align: right; }
.pos-row .pnl.up { color: var(--green); }
.pos-row .pnl.down { color: var(--red); }

/* ───── Day detail page ───── */

.day-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-2);
}

.day-nav a:hover { color: var(--text); }

.day-hero-price {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  margin: 8px 0;
}

.day-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin: 32px 0 24px;
  font-size: 14px;
}

.day-tab {
  padding: 12px 0;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  font-family: inherit;
}

.day-tab:hover { color: var(--text-2); }
.day-tab.active { color: var(--text); border-bottom-color: var(--blue); }

.day-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

.day-content h1, .day-content h2, .day-content h3 {
  color: var(--text);
  margin: 28px 0 12px;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.day-content h1 { font-size: 22px; }
.day-content h2 { font-size: 18px; }
.day-content h3 { font-size: 15px; font-weight: 600; }

.day-content p { margin: 8px 0; }
.day-content code {
  background: var(--card-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
}

.day-content pre {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-size: 12px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  white-space: pre;
}

.day-content table {
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  width: 100%;
}

.day-content th, .day-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.day-content th { background: var(--card-2); color: var(--text); font-weight: 600; }
.day-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 16px;
  color: var(--text-3);
  margin: 12px 0;
}

.day-content ul, .day-content ol { padding-left: 24px; }
.day-content li { margin: 4px 0; }
.day-content a { color: var(--blue); }

/* ───── Chart ───── */

.chart-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-top: 24px;
  min-height: 420px;
}

/* ───── Loading ───── */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--text-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading {
  color: var(--text-3);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.error {
  color: var(--red);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}
