/* ============================================================
   Evolution of the World · 2026 – 2100
   Futuristic dark theme · space timeline
   ============================================================ */

:root {
  --bg: #04060f;
  --bg-2: #070b1a;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #e8edff;
  --muted: #8b93ad;
  --muted-2: #5c6480;
  --accent-1: #22d3ee;
  --accent-2: #a78bfa;
  --accent-3: #f472b6;
  --grad: linear-gradient(100deg, var(--accent-1), var(--accent-2) 45%, var(--accent-3));
  --radius: 18px;
  /* Chrome heights the hero has to fit between: the sticky header above and the
     fixed era map pinned to the viewport bottom. */
  --header-h: 64px;
  --map-h: 50px;
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  /* category colors (overridden per card) */
  --cat: #22d3ee;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the hidden attribute must always win over display rules
   (e.g. .modal-backdrop uses display:flex and would otherwise
   override the hidden attribute and stay on screen forever) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(167, 139, 250, 0.35); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-1), var(--accent-2));
  border-radius: 8px;
}

/* ---------- backdrop ---------- */

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.nebula-a {
  width: 60vw; height: 60vw;
  top: -18vw; left: -12vw;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 65%);
}
.nebula-b {
  width: 55vw; height: 55vw;
  bottom: -18vw; right: -10vw;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.32), transparent 65%);
}

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad);
  z-index: 90;
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.7);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(4, 6, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.brand-orb {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.9);
  animation: pulse 3s ease-in-out infinite;
}
.brand em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.era-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.era-nav::-webkit-scrollbar { display: none; }
.era-nav a {
  text-decoration: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.era-nav a:hover { color: var(--text); border-color: var(--line-strong); }
.era-nav a.active {
  color: #04121a;
  background: var(--grad);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 18px -4px rgba(34, 211, 238, 0.55);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 24px calc(var(--map-h) + 26px);
}

.hero-inner { max-width: 900px; }

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 26px;
  opacity: 0.9;
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.grad-text {
  background: var(--grad);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 6s ease-in-out infinite;
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.22rem);
  max-width: 640px;
  margin: 0 auto 40px;
}
.hero-sub b { color: var(--text); font-weight: 600; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 44px;
}

.meta-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 128px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.meta-chip b {
  font-family: var(--font-mono);
  font-size: 22px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.meta-chip span {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 30px;
  border-radius: 999px;
  text-decoration: none;
  color: #04121a;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  background: var(--grad);
  box-shadow: 0 10px 40px -8px rgba(34, 211, 238, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cta:hover { transform: translateY(-3px); box-shadow: 0 16px 50px -8px rgba(167, 139, 250, 0.65); }
.cta-arrow { transition: transform 0.25s ease; }
.cta:hover .cta-arrow { transform: translateY(3px); }

.scroll-hint {
  /* Flows under the CTA instead of pinning to the hero box: the hero grows past
     one screen on short viewports, where an absolutely placed cue landed on top
     of the button and the fixed era map. */
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
}
/* Laptop-height viewports: tighten the hero's vertical rhythm so the CTA stays
   above the fixed era map instead of being covered by it. */
@media (min-width: 601px) and (max-height: 900px) {
  .hero { padding-top: 40px; }
  .hero-kicker { margin-bottom: 16px; }
  .hero h1 { font-size: clamp(3rem, 7vw, 5.2rem); margin-bottom: 20px; }
  .hero-sub { margin-bottom: 24px; }
  .hero-meta { margin-bottom: 26px; }
}

/* 1366x768-class screens: the map bar is permanently on screen, so the hero
   compresses further rather than sliding its call to action underneath it. */
@media (min-width: 601px) and (max-height: 780px) {
  .hero { padding-top: 26px; }
  .hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.2rem); }
  .hero-sub { margin-bottom: 18px; }
  .hero-meta { gap: 10px; margin-bottom: 20px; }
  .meta-chip { padding: 10px 14px; }
  .scroll-hint { display: none; }
}
.scroll-line {
  width: 1px; height: 42px;
  background: linear-gradient(var(--accent-1), transparent);
  animation: scrollDrop 2s ease-in-out infinite;
}

/* ---------- toolbar ---------- */

.toolbar {
  position: relative;
  z-index: 2;
  padding: 26px clamp(16px, 4vw, 48px) 8px;
  scroll-margin-top: 90px;
}

.toolbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 18px;
  color: var(--muted);
  font-size: 18px;
  transform: rotate(-45deg);
  pointer-events: none;
}
#searchInput {
  width: 100%;
  padding: 15px 52px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
#searchInput::placeholder { color: var(--muted-2); }
#searchInput:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15), 0 0 30px -6px rgba(34, 211, 238, 0.4);
}
.search-clear {
  position: absolute;
  right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.search-clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--accent-1));
  box-shadow: 0 0 8px var(--chip-color, var(--accent-1));
}
.chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.chip.active {
  color: #04121a;
  background: var(--chip-color, var(--accent-1));
  border-color: transparent;
  font-weight: 600;
}
.chip.active .dot { background: #04121a; box-shadow: none; }
.chip.active:hover { transform: none; }

.result-note {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ---------- timeline ---------- */

#timeline {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 48px) 170px;
}

.era {
  scroll-margin-top: 84px;
  margin-top: 90px;
}
.era:first-child { margin-top: 30px; }

/* era header */
.era-head { position: relative; margin-bottom: 54px; }

.era-ghost {
  position: absolute;
  top: -64px;
  left: -8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(7rem, 20vw, 13rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.07);
  pointer-events: none;
  user-select: none;
}

.era-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}
.era-kicker b {
  display: inline-block;
  padding: 3px 10px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--grad);
  color: #04121a;
}

.era-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 10px 0 8px;
  background: linear-gradient(100deg, #fff, #aab4d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.era-tagline { color: var(--muted); max-width: 560px; font-size: 15px; }

.era-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.era-summary li {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text);
}
.era-summary li::before {
  content: "\2726";
  color: var(--accent-1);
  margin-top: 1px;
  font-size: 12px;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
}

/* era explainer — "the big picture" */
.era-explainer {
  margin-top: 22px;
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}
.era-explainer summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
}
.era-explainer summary::-webkit-details-marker { display: none; }
.era-explainer summary::after {
  content: "+";
  margin-left: auto;
  color: var(--accent-1);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
}
.era-explainer[open] summary::after { content: "\2212"; }
.era-explainer-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.era-explainer-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.era-explainer-body {
  padding: 4px 20px 20px;
  border-top: 1px solid var(--line);
}
.era-explainer-body p {
  margin-top: 13px;
  max-width: 74ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.62;
}
.era-explainer-body h4 {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.era-shifts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 12px;
  list-style: none;
}
.era-shifts li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  font-size: 12.5px;
}
.shift-from { color: var(--muted); }
.shift-arrow { color: var(--accent-1); font-weight: 700; text-shadow: 0 0 8px rgba(34, 211, 238, 0.8); }
.shift-to { color: var(--text); font-weight: 600; }

/* timeline rail */
.tl {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.tl::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg,
    rgba(34, 211, 238, 0.05),
    rgba(34, 211, 238, 0.5),
    rgba(167, 139, 250, 0.5),
    rgba(244, 114, 182, 0.05));
}

.item {
  position: relative;
  width: calc(50% - 34px);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.item.visible { opacity: 1; transform: none; }

.item:nth-child(odd) { align-self: flex-start; }
.item:nth-child(even) { align-self: flex-end; }

.item::after {
  content: "";
  position: absolute;
  top: 30px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--cat);
  box-shadow: 0 0 16px var(--cat);
  z-index: 2;
}
.item:nth-child(odd)::after { right: -43px; }
.item:nth-child(even)::after { left: -43px; }

.item-connector {
  position: absolute;
  top: 38px;
  height: 2px;
  background: linear-gradient(90deg, var(--cat), transparent);
  opacity: 0.55;
}
.item:nth-child(odd) .item-connector { right: -34px; left: auto; width: 34px; }
.item:nth-child(even) .item-connector { left: -34px; right: auto; width: 34px; }

/* card */
.card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px 22px 18px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at var(--mx, 50%) 0%, var(--cat-alpha, rgba(34,211,238,0.08)), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--cat) 55%, transparent);
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.8), 0 0 34px -14px var(--cat);
}
.card:hover::before { opacity: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--cat);
  letter-spacing: 0.5px;
}
.card-year::before {
  content: "\25B8";
  margin-right: 6px;
  font-size: 10px;
}

.card-cat {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cat) 45%, transparent);
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 9%, transparent);
}

.card h3 {
  font-family: var(--font-head);
  font-size: 17.5px;
  font-weight: 600;
  margin-bottom: 7px;
  line-height: 1.35;
}

.card p {
  font-size: 13.8px;
  color: var(--muted);
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--cat);
  font-family: var(--font-mono);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.85;
}
.card-foot::after {
  content: "\2192";
  transition: transform 0.25s ease;
}
.card:hover .card-foot::after { transform: translateX(4px); }

.card-stocks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
}
.stock-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-right: 3px;
}
.ticker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, color 0.2s ease;
  cursor: help;
}
.ticker:hover { border-color: var(--cat); color: var(--cat); }
.ticker.more {
  color: var(--muted);
  border-style: dashed;
  cursor: help;
}
.ticker.more:hover { color: var(--muted); border-color: var(--line-strong); }

/* ---------- achievements checklist ---------- */
.achieve-check {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 4;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.item:hover .achieve-check,
.item.achieved .achieve-check,
.achieve-check:focus-within {
  opacity: 1;
  pointer-events: auto;
}
.achieve-check:hover { transform: scale(1.1); }
.achieve-input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.achieve-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: rgba(4, 6, 15, 0.85);
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.achieve-check:hover .achieve-box { border-color: #34d399; color: rgba(52, 211, 153, 0.4); }
.item.achieved .achieve-box {
  background: linear-gradient(135deg, #34d399, #2dd4bf);
  border-color: transparent;
  color: #04121a;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.75);
}
.item.achieved .card {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.8), 0 0 34px -14px rgba(52, 211, 153, 0.55);
}
.item.achieved .card-foot::before {
  content: "✓ Achieved · ";
  color: #34d399;
}
.card-top { padding-right: 34px; }

.era-progress {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.era-progress.done {
  color: #04121a;
  background: linear-gradient(135deg, #34d399, #2dd4bf);
  border-color: transparent;
  font-weight: 600;
}

.achieve-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.ap-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.ap-label {
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-size: 10px;
  color: #34d399;
}
.ap-count { margin-left: auto; color: var(--text); }
.ap-reset {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: 0.2s ease;
}
.ap-reset:hover { color: var(--text); border-color: var(--line-strong); }
.ap-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ap-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #2dd4bf);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
  transition: width 0.4s ease;
}

.achieve-btn {
  margin-top: 22px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.achieve-btn:hover {
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 22px -8px rgba(52, 211, 153, 0.5);
}
.achieve-btn.on {
  background: linear-gradient(135deg, #34d399, #2dd4bf);
  color: #04121a;
  border-color: transparent;
}

@media (hover: none) {
  .achieve-check { opacity: 1; pointer-events: auto; }
}

mark {
  background: rgba(244, 114, 182, 0.35);
  color: #ffd9ec;
  border-radius: 3px;
  padding: 0 2px;
}

.era.hidden { display: none; }
.item.hidden { display: none; }

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 54px clamp(16px, 4vw, 48px) 140px;
  background: linear-gradient(180deg, transparent, rgba(7, 11, 26, 0.8));
}

.footer-inner { max-width: 1080px; margin: 0 auto; text-align: center; }

.footer-brand {
  font-family: var(--font-head);
  font-weight: 600;
  margin-bottom: 14px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-footer p { color: var(--muted); font-size: 13px; max-width: 720px; margin: 0 auto 10px; }
.site-footer p b { color: var(--text); }
.footer-note { font-family: var(--font-mono); font-size: 11px !important; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted-2) !important; }

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.modal {
  position: relative;
  max-width: 680px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(165deg, #0c1226, #080c1c 60%);
  padding: 38px 36px 30px;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.9), 0 0 60px -24px var(--cat);
  animation: modalIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-close:hover { color: var(--text); border-color: var(--line-strong); transform: rotate(90deg); }

.modal-nav {
  position: absolute;
  top: 16px; right: 60px;
  display: flex;
  gap: 8px;
}
.modal-nav-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-nav-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.modal-nav-btn:disabled { opacity: 0.35; cursor: default; }
.modal:focus { outline: none; }

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.modal-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--cat);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cat) 45%, transparent);
}
.modal-cat {
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-mono);
}

.modal h2 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
}

.modal-desc { color: var(--text); font-size: 15px; }

.modal-impact {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-left: 3px solid var(--cat);
}
.modal-impact h3 {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cat);
  margin-bottom: 8px;
}
.modal-impact p { color: var(--muted); font-size: 14px; }

/* modal explainer — how it works, gates, key terms */
.modal-explain {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-left: 3px solid var(--accent-1);
}
.modal-explain h3 {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 8px;
}
.modal-explain h4 {
  margin: 14px 0 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.modal-explain p { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.me-terms { display: grid; gap: 8px; margin-top: 4px; }
.me-term {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12.5px;
}
.me-term b { color: var(--text); font-weight: 600; white-space: nowrap; }
.me-term span { color: var(--muted); }
@media (max-width: 600px) {
  .me-term { flex-direction: column; gap: 3px; }
  .me-term b { white-space: normal; }
}

.modal-stocks { margin-top: 22px; }
.modal-stocks h3 {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cat);
  margin-bottom: 10px;
}
.modal-watch-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: none;
  color: var(--muted-2);
  margin-left: 6px;
}
.modal-stock-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-stock {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
  color: var(--muted);
}
.modal-stock b {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--text);
}

.modal-foot {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- back to top ---------- */

#toTop {
  position: fixed;
  bottom: 26px; right: 26px;
  z-index: 85;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}
#toTop:hover {
  background: var(--grad);
  color: #04121a;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -8px rgba(167, 139, 250, 0.6);
}

/* ---------- animations ---------- */

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes scrollDrop {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(26px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes shoot {
  0% { transform: translate(0, 0) rotate(-35deg); opacity: 0; }
  5% { opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(-60vw, 42vw) rotate(-35deg); opacity: 0; }
}

.shooting-star {
  position: fixed;
  top: 0; left: 100vw;
  width: 130px; height: 1.5px;
  background: linear-gradient(90deg, #fff, transparent);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  animation: shoot 5.5s linear infinite;
}
.shooting-star:nth-child(2) { animation-delay: 2.4s; width: 90px; }
.shooting-star:nth-child(3) { animation-delay: 4.1s; width: 110px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .tl::before { left: 13px; transform: none; }
  .item, .item:nth-child(odd), .item:nth-child(even) {
    width: 100%;
    align-self: auto;
    padding-left: 40px;
  }
  .item::after, .item:nth-child(odd)::after, .item:nth-child(even)::after {
    left: 4px;
    right: auto;
    width: 16px; height: 16px;
    top: 26px;
  }
  .item-connector { display: none; }
  .era-ghost { top: -40px; }
}

@media (max-width: 600px) {
  .site-header { padding: 10px 14px; }
  :root { --header-h: 51px; }
  .brand-text { display: none; }
  .era-nav a { font-size: 11px; padding: 5px 9px; }
  .hero { padding: 72px 18px calc(var(--map-h) + 20px); }
  .meta-chip { min-width: 106px; padding: 11px 12px; }
  .modal { padding: 28px 20px 24px; }
  .card { padding: 17px 17px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .item { opacity: 1; transform: none; }
}

/* ---------- insights dashboard ---------- */
.insights {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 48px) 0;
}
.insights-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 17px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.stat-tile b {
  font-family: var(--font-head);
  font-size: clamp(15px, 2.6vw, 24px);
  line-height: 1.15;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-tile span {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.mini-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 6px;
}
.mini-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #2dd4bf);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  transition: width 0.4s ease;
}
.insights-cats {
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.insights-cats h3 {
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.insights-note {
  margin: -4px 0 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted-2);
}
.cat-row {
  display: grid;
  grid-template-columns: 150px 1fr 44px 36px;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 12.5px;
}
.cat-row .cb-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row .cb-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.cat-row .cb-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.cat-row .cb-count {
  font-family: var(--font-mono);
  color: var(--muted);
  text-align: right;
}
.cat-row .cb-done {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #34d399;
  text-align: right;
  white-space: nowrap;
}

/* ---------- domain evolution guide ---------- */
.domain-guide {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 48px) 0;
}
.domain-guide-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}
.section-kicker {
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--accent-1);
}
.domain-guide h2 {
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.domain-guide-head > p {
  max-width: 540px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.domain-guide-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.055);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.domain-guide-note > span:first-child { color: #fbbf24; font-size: 15px; line-height: 1.1; }
.domain-guide-note b { color: var(--text); }
.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.domain-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-top-color: color-mix(in srgb, var(--cat) 55%, transparent);
  border-radius: 15px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat) 7%, var(--panel)), var(--panel));
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.domain-card:hover {
  border-color: color-mix(in srgb, var(--cat) 60%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -27px var(--cat);
}
.domain-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.domain-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cat);
  box-shadow: 0 0 12px var(--cat);
}
.domain-card-top small {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.domain-thesis {
  min-height: 43px;
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.domain-stages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
  counter-reset: stage;
}
.domain-stages li {
  counter-increment: stage;
  display: flex;
  gap: 5px;
  align-items: baseline;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}
.domain-stages li::before {
  content: counter(stage, decimal-leading-zero);
  color: var(--cat);
  font-family: var(--font-mono);
  font-size: 9px;
}
.domain-unlock {
  min-height: 48px;
  margin: 11px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.domain-unlock b { color: var(--text); font-weight: 600; }
.domain-watch > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.25px;
  text-transform: uppercase;
}
.domain-watch > div { display: flex; flex-wrap: wrap; gap: 5px; }
.domain-ticker {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 4px 6px;
  border: 1px solid color-mix(in srgb, var(--cat) 24%, var(--line));
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}
.domain-ticker b { color: var(--cat); font-size: 10px; }
.domain-research {
  margin-top: 11px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.domain-research summary {
  padding: 9px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.65px;
  cursor: pointer;
  list-style: none;
}
.domain-research summary::-webkit-details-marker { display: none; }
.domain-research summary::after {
  content: "+";
  float: right;
  color: var(--cat);
  font-size: 13px;
  line-height: 0.7;
}
.domain-research[open] summary::after { content: "−"; }
.domain-research p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.48;
}
.domain-research p b { color: var(--text); font-weight: 600; }
.domain-alternates, .domain-sources { margin: 9px 0; }
.domain-alternates > span, .domain-sources > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.domain-alternate {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 4px 6px;
  border: 1px dashed color-mix(in srgb, var(--cat) 42%, var(--line));
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}
.domain-alternate b { color: var(--cat); font-size: 10px; }
.domain-sources a {
  color: var(--cat);
  font-size: 10px;
  text-decoration: none;
}
.domain-sources a:hover, .domain-sources a:focus-visible { color: var(--text); text-decoration: underline; }
.domain-research small {
  display: block;
  margin: 7px 0 10px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.4;
}
.domain-explore {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--cat);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.4px;
  text-align: left;
  cursor: pointer;
}
.domain-explore:hover, .domain-explore:focus-visible { color: var(--text); }
.domain-explore:focus-visible { outline: 2px solid var(--cat); outline-offset: 3px; border-radius: 3px; }

/* ---------- roadmap field guide ---------- */
.field-guide {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px var(--gutter) 42px;
}
.field-guide-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 16px;
}
.field-guide h2 {
  margin: 4px 0 0;
  font-family: var(--font-head);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -1px;
  color: var(--text);
}
.field-guide-head > p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.field-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px) {
  .field-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.field-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.055), var(--panel));
}
.field-card-num {
  color: var(--accent-1);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.2px;
}
.field-card h3 {
  margin: 11px 0 7px;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 14px;
  line-height: 1.25;
}
.field-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.58;
}
.field-card p b, .field-guide-foot b { color: var(--text); font-weight: 600; }
.field-guide-foot {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 11px;
  padding: 10px 13px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.045);
}
.field-guide-foot > span { color: var(--accent-1); font-family: var(--font-mono); }
.field-guide-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ---------- status filter row ---------- */
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chips-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-2);
  align-self: center;
}

/* ---------- next-up tracker ---------- */
.next-up {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.next-up:hover:not(:disabled) {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px -10px rgba(34, 211, 238, 0.7);
}
.next-up:disabled { cursor: default; }
.next-up:disabled .nu-title { color: var(--muted); }
.next-up:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }
.nu-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-2);
}
.nu-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent-1);
  flex-shrink: 0;
}
.nu-title { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nu-year {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
}

/* ---------- export buttons ---------- */
.ap-reset.is-empty { opacity: 0.35; pointer-events: none; }

/* ---------- mini-map ---------- */
.map-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, rgba(4, 6, 15, 0), rgba(4, 6, 15, 0.94) 45%);
  pointer-events: none;
}
.map-track {
  position: relative;
  height: 34px;
  max-width: 1080px;
  margin: 0 auto;
  pointer-events: auto;
  cursor: crosshair;
}
.map-range {
  position: absolute;
  bottom: -2px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted-2);
  pointer-events: none;
}
.map-start { left: 2px; }
.map-end { right: 2px; }
.map-dot {
  position: absolute;
  top: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  opacity: 0.85;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.map-dot:hover { transform: translate(-50%, -50%) scale(1.9); opacity: 1; z-index: 2; }
.map-dot.dim { opacity: 0.16; }
.map-dot.done { box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.9); }
.map-now {
  position: absolute;
  top: -3px;
  z-index: 3;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, 0);
}
.map-now-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 1px 5px;
  margin-bottom: 2px;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}
.map-now-line {
  display: block;
  width: 2px;
  height: 24px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

/* ---------- card flash on map jump ---------- */
.item.flash .card { animation: flashCard 1.6s ease; }
@keyframes flashCard {
  0%, 100% { box-shadow: none; }
  20% { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 0 44px -8px #fff; }
}

@media (max-width: 600px) {
  .cat-row { grid-template-columns: 105px 1fr 36px; }
  .cat-row .cb-done { display: none; }
  .nu-year { display: none; }
  .map-track { height: 28px; }
  .map-dot { width: 5px; height: 5px; }
  .map-now-line { height: 18px; }
  .domain-guide-head { display: block; }
  .domain-guide-head > p { margin-top: 10px; }
  .field-guide { padding-bottom: 30px; }
  .field-guide-head { display: block; }
  .field-guide-head > p { margin-top: 10px; }
  .field-guide-grid { grid-template-columns: 1fr; }
  .domain-grid { grid-template-columns: 1fr; }
  .domain-thesis, .domain-unlock { min-height: 0; }
}

/* ---------- investment radar ---------- */
.radar {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 48px) 0;
}
.radar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.radar-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.radar-sub {
  font-size: 13px;
  color: var(--muted);
}
.radar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-2);
}
.radar-legend b {
  color: var(--muted);
  font-weight: 600;
}
.radar-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 84px auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.radar-row:hover {
  border-color: var(--line-strong);
  transform: translateX(4px);
  box-shadow: 0 8px 26px -12px rgba(0, 0, 0, 0.7);
}
.rr-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-1);
}
.rr-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rr-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rr-sector {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rr-entry {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 999px;
  color: #04121a;
  background: linear-gradient(135deg, #34d399, #2dd4bf);
  font-weight: 700;
  white-space: nowrap;
}
.rr-entry.enter { animation: pulseGreen 2.2s ease-in-out infinite; }
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}
.conf-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--conf, #8b93ad);
  color: var(--conf, #8b93ad);
  background: color-mix(in srgb, var(--conf, #8b93ad) 10%, transparent);
  white-space: nowrap;
}
.radar-disclaimer {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted-2);
  font-style: italic;
}
.radar-empty {
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

/* ---------- modal investment play ---------- */
.modal-invest {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-left: 3px solid #f59e0b;
}
.modal-invest h3 {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #f59e0b;
  margin-bottom: 10px;
}
.mi-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mi-sector {
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.modal-invest p { font-size: 13.5px; color: var(--muted); margin-top: 7px; }
.modal-invest p b { color: var(--text); font-weight: 600; }

@media (max-width: 1000px) {
  .rr-quotes .rq:nth-child(n+3) { display: none; }
}
@media (max-width: 820px) {
  .radar-row { grid-template-columns: 46px minmax(0, 1fr) 84px auto; }
  .radar-row .rr-quotes { display: none; }
}
@media (max-width: 640px) {
  .radar-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .rr-sector, .radar-row .conf-badge { display: none; }
  .rr-entry { font-size: 9px; letter-spacing: 0.6px; padding: 3px 7px; }
}

/* ============================================================
   Tier 1 · live quotes, watchlist, alerts, notes, radar controls
   ============================================================ */

/* ---------- radar controls ---------- */
.radar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 20px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.rc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.rc-field b {
  color: var(--accent-1);
  font-size: 11px;
}
.rc-field select {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 10px;
  cursor: pointer;
}
.rc-field select:hover { border-color: var(--line-strong); }
.rc-horizon { flex: 1; min-width: 200px; }
.rc-horizon input[type="range"] {
  width: 100%;
  accent-color: var(--accent-1);
  cursor: pointer;
}
.quote-status {
  align-self: center;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted-2);
  white-space: nowrap;
  cursor: help;
}
.quote-status.on { color: #34d399; }
.quote-status.off { color: #f87171; }
.market-state {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted-2);
  white-space: nowrap;
  cursor: help;
}
.market-state.open {
  color: #34d399;
  animation: pulseGreen 2.4s ease-in-out infinite;
}
.rc-share {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.rc-share:hover { color: var(--text); border-color: var(--line-strong); }
.ms-perf {
  display: inline-flex;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.rq.held { border-color: rgba(52, 211, 153, 0.55); }
.rq.held::after {
  content: "\25CF";
  color: #34d399;
  font-size: 7px;
  margin-left: 1px;
}
.modal-stock.held {
  border-color: color-mix(in srgb, #34d399 40%, transparent);
}

/* ---------- radar live quotes ---------- */
.rr-quotes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}
.rq {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  white-space: nowrap;
}
.rq b { color: var(--text); font-weight: 600; }
.rq i { font-style: normal; }

/* ---------- pnl colors ---------- */
.pos-up { color: #34d399; }
.pos-down { color: #f87171; }
.pos-flat { color: var(--muted-2); }

/* ---------- modal stock rows: live quotes + watch buttons ---------- */
.modal-stock { flex-wrap: wrap; max-width: 100%; }
/* Wide enough for one line: let the name/role truncate instead of wrapping the
   price and watch button onto a second row. */
@media (min-width: 720px) {
  .modal-stock { flex-wrap: nowrap; }
}
.ms-t { color: var(--accent-1); }
/* The company name is the only elastic part: long names must truncate rather
   than push the price/watch group onto its own line. */
.ms-name {
  font-size: 12px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.ms-quote {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 7px;
}
.ms-spark { display: inline-flex; }
.ms-spark svg { display: block; }
.ms-price {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.ms-chg {
  font-family: var(--font-mono);
  font-size: 11px;
}
.ms-watch {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ms-watch:hover { color: var(--accent-1); border-color: var(--accent-1); }
.ms-watch.on {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.08);
}
.ms-watch-all {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--accent-1);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.07);
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
}
.ms-watch-all:hover { background: rgba(34, 211, 238, 0.16); }
.ms-watch-all.on { color: #34d399; border-color: rgba(52, 211, 153, 0.5); }

/* ---------- modal actions: alert + calendar ---------- */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.ma-btn {
  flex: 1;
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.ma-btn:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 18px -8px rgba(167, 139, 250, 0.6);
}
.ma-btn.on {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(34, 211, 238, 0.25));
  border-color: var(--accent-2);
}

/* ---------- modal notes ---------- */
.modal-notes { margin-top: 22px; }
.modal-notes h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cat);
  margin-bottom: 10px;
}
.notes-saved {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: #34d399;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.notes-saved.show { opacity: 1; }
#modalNotes {
  width: 100%;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 90px;
}
#modalNotes:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
#modalNotes::placeholder { color: var(--muted-2); }

/* ---------- card note badge ---------- */
.card-note {
  font-size: 11px;
  color: var(--cat);
  opacity: 0.85;
  cursor: default;
}

/* ---------- bell + reminders ---------- */
.bell-wrap {
  align-self: flex-end;
  position: relative;
}
.bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.bell-btn:hover { border-color: var(--line-strong); }
.bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f87171);
  color: #04121a;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bell-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(340px, 86vw);
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 22px 50px -18px rgba(0, 0, 0, 0.8);
  z-index: 75;
}
.bell-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.bell-empty { font-size: 12.5px; color: var(--muted); }
.bell-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted-2);
}
.rem-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text);
}
.rem-row:hover { background: var(--panel); }
.rem-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-1);
  white-space: nowrap;
}
.rem-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rem-row.due .rem-title { color: #f59e0b; }
.rem-due {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: #04121a;
  background: linear-gradient(135deg, #f59e0b, #f87171);
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 700;
  white-space: nowrap;
}
.rem-del {
  border: none;
  background: none;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
}
.rem-del:hover { color: #f87171; }

/* ---------- watchlist section ---------- */
.watchlist-sec {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 48px) 0;
}
.wl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.wl-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wl-sub { font-size: 13px; color: var(--muted); }
.wl-help {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.wl-help summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-head);
  font-size: 13.5px;
  color: var(--text);
}
.wl-help summary::-webkit-details-marker { display: none; }
.wl-help summary::after {
  content: "+";
  margin-left: auto;
  color: var(--accent-1);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
}
.wl-help[open] summary::after { content: "\2212"; }
.wl-help-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.wl-help-body {
  padding: 2px 16px 14px;
  border-top: 1px solid var(--line);
}
.wl-help-body p {
  margin-top: 10px;
  max-width: 74ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.wl-help-body b { color: var(--text); font-weight: 600; }
.wl-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.wl-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.wl-btn:hover { color: var(--text); border-color: var(--line-strong); }
.wl-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.wl-tile {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.wl-tile b {
  display: block;
  font-family: var(--font-head);
  font-size: 19px;
  color: var(--text);
}
.wl-tile span {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--font-mono);
}
.wl-sector {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.wl-sector h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.ws-row {
  display: grid;
  grid-template-columns: 140px 1fr 52px;
  align-items: center;
  gap: 12px;
  padding: 3px 0;
  font-size: 12.5px;
}
.ws-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.ws-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.ws-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.ws-none { font-size: 12px; color: var(--muted); }
.wl-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.wl-add input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  min-width: 0;
}
.wl-add input:focus { outline: none; border-color: var(--line-strong); }
#wlTicker { width: 150px; font-family: var(--font-mono); text-transform: uppercase; }
#wlEntry, #wlShares { width: 130px; }
.wl-add-btn {
  padding: 9px 18px;
  color: #04121a;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border: none;
  font-weight: 700;
}
.wl-add-btn:hover { color: #04121a; filter: brightness(1.1); }
.wl-add-msg {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
}
.wl-row {
  display: grid;
  grid-template-columns: 104px minmax(120px, 1.4fr) 88px 80px 88px 104px 130px 28px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12.5px;
}
.wl-sym b {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-1);
  display: block;
}
.wl-sym small {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-sector-tag {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.wl-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}
.wl-input:focus { outline: none; border-color: var(--line-strong); }
.wl-field { display: block; min-width: 0; }
.wl-field > span { display: none; }
.wl-price, .wl-mv, .wl-pnl {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.wl-pnl { text-align: right; }
.wl-pnl small { display: block; font-size: 10px; opacity: 0.85; }
.wl-cats {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 2px;
}
/* Keep rows compact: three nearest catalysts, expand on demand. */
.wl-cats .wl-cat:nth-child(n+4) { display: none; }
.wl-cats.expanded .wl-cat:nth-child(n+4) { display: inline-flex; }
.wl-cats-more {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--accent-1);
  cursor: pointer;
  white-space: nowrap;
}
.wl-cats-more:hover { border-color: var(--accent-1); }
.wl-cat {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.wl-cat:hover { color: var(--text); border-color: var(--line-strong); }
.wl-cat.soon { border-color: rgba(245, 158, 11, 0.4); color: #f59e0b; }
.wl-cat.now {
  border-color: rgba(52, 211, 153, 0.5);
  color: #34d399;
  animation: pulseGreen 2.2s ease-in-out infinite;
}
.wl-del {
  border: none;
  background: none;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
}
.wl-del:hover { color: #f87171; background: rgba(248, 113, 113, 0.08); }
.wl-empty {
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}
.wl-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted-2);
  font-style: italic;
}

@media (max-width: 1000px) {
  /* Every track has a min that fits ~620px of content box, so the row shrinks
     with the viewport instead of pushing the page into horizontal scroll. */
  .wl-row {
    grid-template-columns: minmax(78px, 104px) minmax(62px, 88px) minmax(56px, 80px) minmax(70px, 88px) minmax(78px, 104px) minmax(96px, 1fr) 26px;
  }
  .wl-sector-tag { display: none; }
}
@media (max-width: 640px) {
  .rr-quotes { display: none; }
  .wl-tiles { grid-template-columns: repeat(2, 1fr); }
  .wl-row {
    position: relative;
    grid-template-columns: 1fr 1fr;
    gap: 10px 8px;
    padding: 12px;
  }
  .wl-sym { grid-column: 1 / -1; padding-right: 28px; }
  .wl-field > span {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted-2);
  }
  .wl-price, .wl-mv, .wl-pnl { text-align: left; }
  .wl-price::before, .wl-mv::before, .wl-pnl::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted-2);
  }
  .wl-pnl { grid-column: 1 / -1; }
  .wl-cats { grid-column: 1 / -1; }
  .wl-del { position: absolute; top: 10px; right: 6px; }
  .bell-pop { top: calc(100% + 8px); }
}
@media (max-width: 560px) {
  .ms-spark { display: none; }
}
@media (max-width: 480px) {
  .ms-role { display: none; }
  .modal-stock .ms-name { display: none; }
}

/* ============================================================
   Ordered watchlists — first = most direct current business exposure
   ============================================================ */

/* rank #1 ticker on timeline cards */
.ticker.lead {
  color: var(--cat);
  border-color: var(--cat);
  background: color-mix(in srgb, var(--cat) 10%, transparent);
}

/* rank #1 quote chip on radar rows */
.rq.lead {
  color: var(--text);
  border-color: var(--accent-1);
  background: rgba(34, 211, 238, 0.08);
}
.rq.lead b { color: var(--accent-1); }

/* modal stock rows: rank badge + role tag */
.modal-stock.lead {
  border-color: color-mix(in srgb, var(--cat) 45%, transparent);
  background: color-mix(in srgb, var(--cat) 6%, transparent);
}
.ms-rank {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  flex-shrink: 0;
}
.modal-stock.lead .ms-rank {
  color: #04121a;
  background: var(--cat);
  border-color: transparent;
  box-shadow: 0 0 12px -2px var(--cat);
}
.ms-role {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--cat);
  border: 1px solid color-mix(in srgb, var(--cat) 35%, transparent);
  background: color-mix(in srgb, var(--cat) 8%, transparent);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
