/* TickerWorth — "warm paper & gold" editorial-financial look.
   LIGHT is the primary theme (:root); dark is an optional toggle override.
   Two families only (serif display + mono data). */
:root {
  /* ---- Light: the primary look ---- */
  --bg: #f3efe6;
  --surface: #fffefb;
  --surface-2: #f7f2e8;
  --line: #e4ddcd;
  --line-soft: #eee8da;
  --text: #1b2026;
  --muted: #5c6672;
  --faint: #9aa1ab;
  --gold: #a97b16;
  --gold-soft: #f0e3c2;
  --up: #10876a;
  --up-soft: #d8efe7;
  --down: #c33a2b;
  --down-soft: #f7ddd8;
  --blue: #2860c8;
  --shadow: 0 20px 46px -26px rgba(70, 56, 22, 0.32);

  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r: 14px;
  --r-sm: 9px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --glow: rgba(169, 123, 22, 0.07);
}
:root[data-theme="dark"] {
  --bg: #0a0d10;
  --surface: #12161b;
  --surface-2: #191f26;
  --line: #232b34;
  --line-soft: #1a212a;
  --text: #e8ecf1;
  --muted: #8a94a3;
  --faint: #5b6673;
  --gold: #e3b23c;
  --gold-soft: #4a3c1c;
  --up: #35d29a;
  --up-soft: #143026;
  --down: #f2685f;
  --down-soft: #331a1a;
  --blue: #6ea8fe;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  --glow: rgba(227, 178, 60, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 82% -8%, var(--glow), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
header.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.top-inner { display: flex; align-items: center; gap: 18px; padding: 14px 22px; max-width: 1120px; margin: 0 auto; }
.brand { display: flex; align-items: baseline; gap: 10px; cursor: pointer; user-select: none; }
.brand .mark {
  font-family: var(--serif); font-size: 22px; letter-spacing: -0.02em; color: var(--text);
}
.brand .mark b { color: var(--gold); font-style: italic; }
.brand .tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }

.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 8px 7px 16px; transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 260px;
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search input {
  background: none; border: none; outline: none; color: var(--text);
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  width: 100%; min-width: 60px;
}
.search input::placeholder { color: var(--faint); letter-spacing: 0.04em; }
.search button {
  border: none; cursor: pointer; border-radius: 999px; padding: 7px 15px;
  background: var(--gold); color: #16130a; font-family: var(--mono); font-weight: 700;
  font-size: 12.5px; letter-spacing: 0.05em; transition: transform 0.15s var(--ease), filter 0.15s;
}
.search button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.search button:active { transform: translateY(0); }
.theme-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 15px;
  display: grid; place-items: center; transition: color 0.2s, border-color 0.2s;
}
.theme-btn:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- hero / landing ---------- */
.hero { padding: 58px 0 26px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.025em;
  font-size: clamp(2.3rem, 1.2rem + 4.2vw, 4.1rem); line-height: 1.02; margin: 0 0 16px;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero p.lede { max-width: 640px; color: var(--muted); font-size: clamp(1rem, 0.95rem + 0.4vw, 1.18rem); margin: 0 0 26px; }
.hero .big-search { display: flex; gap: 10px; max-width: 540px; }
.hero .big-search input {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 15px 18px; color: var(--text); font-family: var(--mono); font-size: 17px;
  letter-spacing: 0.08em; text-transform: uppercase; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.hero .big-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.hero .big-search button {
  border: none; cursor: pointer; border-radius: var(--r-sm); padding: 0 26px;
  background: var(--gold); color: #16130a; font-family: var(--mono); font-weight: 700; font-size: 15px;
  letter-spacing: 0.04em; transition: transform 0.15s var(--ease), filter 0.15s;
}
.hero .big-search button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hint { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.hint b { color: var(--muted); font-weight: 600; }

/* section label */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--faint); display: flex; align-items: center; gap: 12px; margin: 40px 0 18px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* ---------- autocomplete dropdown ---------- */
.search, .hero .big-search { position: relative; }
.ac-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow); overflow: hidden; max-height: 340px; overflow-y: auto;
  animation: fade 0.15s var(--ease);
}
.hero .big-search .ac-dropdown { right: 116px; }  /* align under the input, not the Run-it button */
.ac-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: var(--surface-2); }
.ac-tk { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--gold); }
.ac-nm { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-ex { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 620px) { .hero .big-search .ac-dropdown { right: 0; } }

/* ---------- analysed stat + sector grouping ---------- */
.analysed-stat { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.analysed-stat .stat-num { color: var(--gold); font-weight: 700; font-size: 15px; }
.models-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 40px 0 16px; }
.models-head .eyebrow::after { display: none; }
.sector-filter { display: flex; gap: 7px; flex-wrap: wrap; }
.sector-chip {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.sector-chip:hover { color: var(--gold); border-color: var(--gold); }
.sector-chip.active { color: #16130a; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.sector-group { margin-bottom: 26px; }
.sector-head {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
}
.sector-head .sector-count {
  font-size: 10.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 1px 8px; letter-spacing: 0.02em;
}

/* ---------- company grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 16px 14px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow); }
.card .tk { font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: 0.05em; }
.card .nm { color: var(--muted); font-size: 12.5px; margin: 2px 0 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .duo { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.card .duo .lab { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.card .duo .val { font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 13px; overflow: hidden; position: relative; }
.bar i { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--faint); }
.bar span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.pill {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0.03em; display: inline-block;
}
.pill.up { color: var(--up); background: var(--up-soft); }
.pill.down { color: var(--down); background: var(--down-soft); }
.pill.flat { color: var(--muted); background: var(--surface-2); }
.pill.parked { color: var(--gold); background: var(--gold-soft); }
.card .pill { position: absolute; top: 14px; right: 14px; }

/* ---------- company view ---------- */
#view { padding-bottom: 80px; }
.back {
  font-family: var(--mono); font-size: 12px; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; margin: 26px 0 18px; background: none; border: none;
}
.back:hover { color: var(--gold); }
.co-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.co-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.9rem); letter-spacing: -0.02em; margin: 0; }
.co-head .tk-big { font-family: var(--mono); color: var(--gold); font-size: 15px; letter-spacing: 0.08em; margin-top: 8px; }
.badges { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; align-items: center; }
.badge {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.badge.modeled { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, var(--line)); }
.badge.auto { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-top: 16px; }
.panel h3 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; font-weight: 600; }
.notice {
  border: 1px solid var(--gold-soft); background: color-mix(in srgb, var(--gold-soft) 40%, transparent);
  border-radius: var(--r-sm); padding: 12px 15px; font-size: 13px; color: var(--text); margin-top: 16px;
}
.notice b { color: var(--gold); }

/* the duel */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.duel .side { text-align: center; }
.duel .side .lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.duel .side .num { font-family: var(--mono); font-size: clamp(2rem, 1rem + 4vw, 3.3rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.duel .side.value .num { color: var(--gold); }
.duel .vs { font-family: var(--serif); font-style: italic; color: var(--faint); font-size: 20px; }
.verdict { text-align: center; margin-top: 14px; }
.verdict .big { font-family: var(--mono); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict .cap { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* WACC slider hero */
.slider-hero { position: relative; }
.sh-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.sh-read .lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.sh-read .v { font-family: var(--mono); font-size: clamp(2.4rem, 1.4rem + 4vw, 3.6rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; color: var(--gold); }
.sh-up { text-align: right; font-family: var(--mono); }
.sh-up .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sh-up .lab { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.chart-box { position: relative; margin: 10px 0 4px; }
#curve { width: 100%; height: 210px; display: block; }
.wacc-row { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.wacc-val { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--text); min-width: 92px; }
.wacc-val small { color: var(--faint); font-size: 12px; font-weight: 400; letter-spacing: 0.1em; }
input[type="range"].wacc {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--up) 0%, var(--gold) 55%, var(--down) 100%);
  outline: none; cursor: pointer;
}
input[type="range"].wacc::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--text); border: 4px solid var(--gold); cursor: grab; box-shadow: 0 3px 12px rgba(0,0,0,0.5);
  transition: transform 0.12s var(--ease);
}
input[type="range"].wacc::-webkit-slider-thumb:active { transform: scale(1.18); cursor: grabbing; }
input[type="range"].wacc::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: var(--text); border: 4px solid var(--gold); cursor: grab;
}
.wacc-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.wacc-meta b { color: var(--text); }
.reset-w { font-family: var(--mono); font-size: 11px; color: var(--faint); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.reset-w:hover { color: var(--gold); border-color: var(--gold); }

/* metric strip */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.metric { background: var(--surface); padding: 16px 18px; }
.metric .lab { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.metric .val { font-family: var(--mono); font-size: 21px; font-variant-numeric: tabular-nums; margin-top: 6px; }
.metric .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* two-col */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 780px) { .cols { grid-template-columns: 1fr; } .duel { grid-template-columns: 1fr; } .duel .vs { display: none; } }

/* heatmap */
table.heat { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12px; }
table.heat th { color: var(--faint); font-weight: 600; padding: 6px; font-size: 10.5px; letter-spacing: 0.06em; }
table.heat td { padding: 9px 6px; text-align: center; font-variant-numeric: tabular-nums; border-radius: 4px; color: #0c0f12; font-weight: 600; }
table.heat td.axis { background: none; color: var(--muted); font-weight: 400; }
table.heat td.base { outline: 2px solid var(--text); outline-offset: -2px; }

/* assumptions table */
table.assum { border-collapse: collapse; width: 100%; font-size: 13px; }
table.assum tr { border-bottom: 1px solid var(--line-soft); }
table.assum td { padding: 9px 8px; vertical-align: top; }
table.assum td.k { color: var(--muted); width: 40%; }
table.assum td.v { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.kind { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-left: 8px; }
.kind.reported { color: var(--up); background: var(--up-soft); }
.kind.guidance { color: var(--blue); background: color-mix(in srgb, var(--blue) 15%, transparent); }
.kind.estimate { color: var(--gold); background: var(--gold-soft); }
.src { display: block; color: var(--faint); font-size: 11px; font-family: var(--sans); text-align: right; margin-top: 2px; max-width: 100%; }

/* news */
.news-item { border-left: 2px solid var(--line); padding: 4px 0 16px 16px; position: relative; }
.news-item:last-child { padding-bottom: 0; }
.news-item .dt { font-family: var(--mono); font-size: 11px; color: var(--gold); letter-spacing: 0.04em; }
.news-item .hl { font-weight: 600; margin: 3px 0; }
.news-item .bd { color: var(--muted); font-size: 13px; }
.bull-bear { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; font-size: 12.5px; }
.bull-bear .bx { padding: 8px 11px; border-radius: var(--r-sm); }
.bull-bear .bull { background: var(--up-soft); }
.bull-bear .bear { background: var(--down-soft); }
.bull-bear .bx b { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-bottom: 3px; }
.bull-bear .bull b { color: var(--up); } .bull-bear .bear b { color: var(--down); }

/* explainer prose */
.prose { color: var(--text); font-size: 14.5px; line-height: 1.7; }
.prose h1, .prose h2, .prose h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 22px 0 8px; }
.prose h1 { font-size: 22px; } .prose h2 { font-size: 19px; } .prose h3 { font-size: 16px; }
.prose p { margin: 0 0 12px; color: var(--muted); }
.prose strong { color: var(--text); }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.prose ul { color: var(--muted); padding-left: 20px; }

.disclaimer { font-size: 12px; color: var(--faint); text-align: center; margin: 34px auto 0; max-width: 640px; line-height: 1.6; }
.footer { border-top: 1px solid var(--line-soft); margin-top: 50px; padding: 26px 0; text-align: center; color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; }

/* states */
.loader { text-align: center; padding: 70px 0; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.spin { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; margin: 0 auto 16px; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.err-card { text-align: center; padding: 50px 24px; }
.err-card .ico { font-size: 34px; }
.err-card h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 14px 0 8px; letter-spacing: normal; text-transform: none; color: var(--text); }
.err-card p { color: var(--muted); max-width: 460px; margin: 0 auto; }
.hidden { display: none !important; }
.fade { animation: fade 0.4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- prominent download CTA ---------- */
.dl-cta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; }
.dl-cta {
  display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: #16130a;
  border: none; border-radius: var(--r-sm); padding: 12px 20px; cursor: pointer;
  font-family: var(--mono); font-weight: 700; font-size: 14px; text-decoration: none;
  transition: filter 0.15s, transform 0.15s var(--ease);
}
.dl-cta:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.dl-cta.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.dl-cta.ghost:hover { border-color: var(--gold); color: var(--gold); }
.dl-cta.locked { background: var(--surface-2); color: var(--text); border: 1px dashed color-mix(in srgb, var(--gold) 55%, var(--line)); }
.dl-cta.locked:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.dl-cta-note { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

/* ---------- DCF model breakdown (Pro) ---------- */
.model-intro { color: var(--muted); font-size: 13px; margin: -4px 0 16px; }
.model-intro b { color: var(--text); }
.model-scroll { overflow-x: auto; border-radius: var(--r-sm); }
table.waterfall { border-collapse: collapse; width: 100%; min-width: 720px; font-family: var(--mono); font-size: 12px; }
table.waterfall th { text-align: right; padding: 8px 9px; color: var(--faint); font-weight: 600; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.waterfall th:first-child, table.waterfall td:first-child { text-align: left; }
table.waterfall td { text-align: right; padding: 9px 9px; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.waterfall td.yr { color: var(--gold); font-weight: 600; }
table.waterfall td.muted { color: var(--muted); }
table.waterfall td.strong { font-weight: 600; color: var(--text); }
table.waterfall td.gold { color: var(--gold); }
table.waterfall tr.tv-row td { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--gold-soft) 22%, transparent); }
.bridge { margin-top: 18px; max-width: 460px; margin-left: auto; }
.brow { display: flex; justify-content: space-between; padding: 7px 0; font-family: var(--mono); font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.brow .bval { color: var(--text); font-variant-numeric: tabular-nums; }
.brow.sum { color: var(--text); font-weight: 600; }
.brow.final { border-top: 2px solid var(--line); border-bottom: none; margin-top: 4px; padding-top: 12px; font-family: var(--serif); font-size: 17px; color: var(--text); }
.brow.final .bval { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.dl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.dl-lab { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.dl-btn { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; transition: border-color 0.2s, color 0.2s, transform 0.15s var(--ease); }
.dl-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); text-decoration: none; }
.model-teaser { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 20px; line-height: 1.7; }

/* ---------- gating / locked / upgrade ---------- */
.locked { position: relative; }
.locked-blur { filter: blur(6px); opacity: 0.5; pointer-events: none; user-select: none; }
.locked-cta {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 6px; padding: 20px;
}
.lock-ico { font-size: 26px; }
.lock-title { font-family: var(--serif); font-size: 20px; }
.lock-sub { color: var(--muted); font-size: 13px; max-width: 380px; }
.lock-btn {
  margin-top: 10px; background: var(--gold); color: #16130a; border: none; border-radius: var(--r-sm);
  padding: 11px 22px; font-family: var(--mono); font-weight: 700; font-size: 13px; cursor: pointer;
  transition: filter 0.15s, transform 0.15s var(--ease);
}
.lock-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.upgrade-card .lock-btn { margin-top: 18px; }
.upgrade-sub { font-size: 12px; color: var(--faint); margin-top: 14px; }
.free-meter {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.free-meter b { color: var(--gold); }
.free-meter a { color: var(--gold); cursor: pointer; }
.free-meter-wrap { margin: 6px 0 34px; min-height: 1px; }

/* ---------- footer + legal pages ---------- */
.footer-disc { color: var(--muted); font-family: var(--sans); font-size: 12.5px; margin-bottom: 8px; }
.footer-disc b { color: var(--text); }
.footer-links a { color: var(--faint); }
.footer-links a:hover { color: var(--gold); }
.legal { max-width: 760px; padding-bottom: 80px; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); letter-spacing: -0.02em; margin: 8px 0 12px; }
.legal h2 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--muted); font-size: 15px; line-height: 1.7; }
.legal b { color: var(--text); }
.legal ul { padding-left: 20px; }
.legal a { color: var(--gold); }
.legal .updated { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.legal .legal-note { background: var(--gold-soft); color: var(--text); border-radius: var(--r-sm); padding: 12px 15px; font-size: 13.5px; }
.legal .callout { border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); border-radius: var(--r-sm); padding: 16px 18px; margin: 20px 0; color: var(--text); font-size: 14.5px; line-height: 1.65; }
.legal .legal-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-family: var(--mono); font-size: 13px; }

/* ---------- account + auth modal ---------- */
.account { display: flex; align-items: center; }
.signin-btn {
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; cursor: pointer; transition: border-color 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.signin-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }
.acct-wrap { position: relative; }
.acct-btn {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--text);
  font-family: var(--mono); font-size: 12.5px; transition: border-color 0.2s;
}
.acct-btn:hover { border-color: var(--gold); }
.acct-email { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pro-badge { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; color: #16130a; background: var(--gold); padding: 2px 6px; border-radius: 4px; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow); overflow: hidden; min-width: 190px; z-index: 30;
  animation: fade 0.2s var(--ease);
}
.acct-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 11px 15px; color: var(--text); font-family: var(--sans); font-size: 13px; transition: background 0.15s;
}
.acct-menu button:hover { background: var(--surface-2); }
.acct-menu button.upgrade { color: var(--gold); font-weight: 600; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(4, 6, 8, 0.66); backdrop-filter: blur(4px); animation: fade 0.25s var(--ease);
}
.modal {
  position: relative; width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 30px 28px 24px; box-shadow: var(--shadow);
  animation: modalIn 0.3s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--faint); font-size: 15px; cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: var(--text); }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; background: none; border: none; cursor: pointer; padding: 8px; border-radius: 999px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; font-weight: 600; transition: background 0.2s, color 0.2s; }
.auth-tab.active { background: var(--gold); color: #16130a; }
.auth-h { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.fld { display: block; margin-bottom: 14px; }
.fld span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.fld input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; color: var(--text); font-family: var(--sans); font-size: 15px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fld input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.auth-error { background: var(--down-soft); color: var(--down); font-size: 13px; padding: 9px 12px; border-radius: var(--r-sm); margin-bottom: 14px; }
.auth-submit {
  width: 100%; background: var(--gold); color: #16130a; border: none; border-radius: var(--r-sm);
  padding: 13px; font-family: var(--mono); font-weight: 700; font-size: 14px; cursor: pointer;
  transition: filter 0.15s, transform 0.15s var(--ease);
}
.auth-submit:hover { filter: brightness(1.07); transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 12px; }
.auth-foot a { color: var(--muted); }
.auth-note { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ---------- lens: multiples & health ---------- */
.lens-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
.lens-gtitle { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.lens-row { display: grid; grid-template-columns: 12px 1fr auto; grid-template-areas: "dot lab val" ". note note"; align-items: center; gap: 2px 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.lens-dot { grid-area: dot; width: 8px; height: 8px; border-radius: 50%; }
.lens-lab { grid-area: lab; font-size: 13px; color: var(--text); }
.lens-val { grid-area: val; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.lens-note { grid-area: note; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.lens-src { margin-top: 16px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
@media (max-width: 620px) { .lens-groups { grid-template-columns: 1fr; } }

/* ---------- motion polish ---------- */
/* Smooth theme cross-fade — targeted surfaces only, so toggling light/dark glides. */
body, header.top, .panel, .card, .metric, .search, .hero .big-search input,
.badge, table.assum tr, .metrics {
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
              color 0.35s var(--ease);
}

/* Card hover: lift + a gold accent line that wipes in across the top. */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.card:hover::before { transform: scaleX(1); }
.card .val { transition: color 0.2s ease; }

/* Staggered reveal for the company view — each panel eases up a beat after the last.
   JS sets --i on the fade elements; keeps the cascade cheap and declarative. */
.fade { animation: fade 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* Slider value feedback: a soft pulse when the number changes. */
.sh-read .v.pulse { animation: pulse 0.28s var(--ease); }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }

/* Skeleton shimmer while the grid loads (esp. a cold backend). */
.skel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); height: 128px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--line) 60%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.back { transition: color 0.2s ease, transform 0.2s var(--ease); }
.back:hover { transform: translateX(-3px); }
.badge { transition: border-color 0.25s, color 0.25s, transform 0.2s var(--ease); }

/* ---------- mobile ---------- */
@media (max-width: 620px) {
  .top-inner { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .brand { flex: 1; min-width: 0; }
  .brand .tag { display: none; }
  .brand .mark { font-size: 19px; }
  .search { order: 3; flex-basis: 100%; margin-left: 0; min-width: 0; }
  .search input { min-width: 0; }
  .wrap { padding: 0 16px; }
  .hero { padding: 34px 0 20px; }
  .hero .big-search { flex-direction: column; }
  .hero .big-search button { padding: 13px; }
  .duel { gap: 8px; }
  .co-head h2 { font-size: 2rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: 1fr; }
  .wacc-row { flex-wrap: wrap; }
  .reset-w { order: 3; }
  .panel { padding: 18px 15px; }
  table.assum { table-layout: fixed; }
  table.assum td.k { width: 54%; word-break: break-word; }
  table.assum td.v { width: 46%; white-space: normal; word-break: break-word; }
  .src { max-width: 100%; word-break: break-word; }
  .duel .side .num { font-size: 2.2rem; }
  .sh-read .v { font-size: 2.4rem; }
}

/* ---------- peer comparison table (Pro) ---------- */
.pc-kind { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; margin-left: 8px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); vertical-align: middle; }
.pc-kind.sector { color: var(--gold); background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.peer-scroll { overflow-x: auto; }
.peer-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.peer-table th { text-align: right; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 0 10px 10px; font-weight: 600; white-space: nowrap; }
.peer-table th.pc-co { text-align: left; }
.peer-table td { text-align: right; padding: 10px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
.peer-table td.pc-co { text-align: left; }
.peer-table tbody tr { cursor: pointer; transition: background 0.15s; }
.peer-table tbody tr:hover { background: var(--surface-2); }
.pc-tk { font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }
.pc-nm { color: var(--muted); font-size: 10.5px; margin-left: 8px; }
.peer-table tr.pc-subj { background: color-mix(in srgb, var(--gold) 8%, transparent); }
.peer-table tr.pc-subj td { border-top: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); }
.peer-table tr.pc-subj .pc-tk { color: var(--gold); }
.peer-table tr.pc-median { cursor: default; }
.peer-table tr.pc-median:hover { background: none; }
.peer-table tr.pc-median td { color: var(--muted); border-top: 1.5px solid var(--line); font-style: italic; }
.peer-src { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 12px; }

/* ---------- reverse DCF (Pro) ---------- */
.rev-big { font-family: var(--mono); font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rev-big.gold { color: var(--gold); }
.rev-big .rev-sub { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.rev-cmp { display: flex; align-items: flex-end; gap: 14px; margin: 16px 0 12px; }
.rev-cmp > div:not(.rev-arrow) { flex: 1; }
.rev-cmp .lab { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.rev-cmp .v { font-family: var(--mono); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; }
.rev-cmp .v.gold { color: var(--gold); }
.rev-cmp .v small { font-size: 12px; color: var(--muted); font-weight: 400; }
.rev-arrow { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 14px; padding-bottom: 4px; flex: 0 0 auto; }
.rev-verdict { color: var(--text); font-size: 13.5px; margin: 0 0 4px; }
.rev-note { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 12px 0 0; }
.rev-note b { color: var(--text); }

/* ---------- watchlist ☆/★ button ---------- */
.watch-btn {
  margin-left: auto; align-self: flex-start; margin-top: 6px;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}
.watch-btn:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-1px); }
.watch-btn .star { font-size: 15px; line-height: 1; }
.watch-btn.on { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: var(--gold-soft); }

/* ---------- dashboard ---------- */
#dashboard { padding-bottom: 80px; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 26px; }
.dash-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.6rem); letter-spacing: -0.02em; margin: 0; display: flex; align-items: center; gap: 12px; }
.dash-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.dash-section { margin: 30px 0; }
.brief-slot h3 { display: flex; align-items: center; gap: 10px; }
.brief-date { font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.06em; color: var(--faint); text-transform: none; }
.brief-summary { color: var(--text); font-size: 14px; margin: 0 0 18px; line-height: 1.5; }
.brief-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.brief-sec { min-width: 0; }
.brief-stitle { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.brief-row { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.brief-row:hover .brief-tk { color: var(--gold); }
.brief-tk { font-family: var(--mono); font-weight: 700; font-size: 12.5px; letter-spacing: 0.04em; flex: 0 0 auto; }
.brief-nm { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.brief-v { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.empty-state {
  font-family: var(--mono); font-size: 13px; color: var(--muted); line-height: 1.6;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r-sm);
  padding: 22px 20px; text-align: center;
}
.empty-state b { color: var(--gold); }
.wl-remove {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 24px; height: 24px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; line-height: 1; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.wl-remove:hover { color: var(--down); border-color: var(--down); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spin { animation: sp 0.8s linear infinite !important; } /* keep loader legible */
}
