/* ==========================================================================
   VoidX KAI — Core stylesheet
   Dark / electric-blue theme derived from the brand mark.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  /* Surfaces */
  --bg:            #05070c;
  --bg-elev:       #0a0e17;
  --surface:       #0d1220;
  --surface-2:     #121829;
  --surface-hover: #172038;

  /* Lines */
  --line:          #1b2338;
  --line-soft:     #141b2c;

  /* Text */
  --text:          #e8edf7;
  --text-dim:      #9aa6bf;
  --text-mute:     #63708c;

  /* Brand */
  --blue:          #0a84ff;
  --blue-bright:   #3aa0ff;
  --blue-deep:     #0059d1;
  --blue-glow:     rgba(10, 132, 255, .35);
  --silver:        #c9d2e0;

  /* Market semantics */
  --up:            #16c784;
  --up-soft:       rgba(22, 199, 132, .12);
  --down:          #ea3943;
  --down-soft:     rgba(234, 57, 67, .12);
  --warn:          #f0b90b;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Chart-only tokens — read by JS via getComputedStyle, see app.js readTheme() */
  --chart-grid:      #1b2338;
  --chart-axis:      #63708c;
  --chart-crosshair: #3a4761;
  --chart-track:     #182236;
  --chart-dii:       #3aa0ff;
  --chart-donut-rest:#2a3550;
  --chart-marker:    #ffffff;

  /* Metrics */
  --nav-h: 64px;
  --tick-h: 38px;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1280px;
}

/* --- Light theme --------------------------------------------------------
   Applied when <html data-theme="light">. The brand blue and the up/down
   semantics carry over; surfaces, lines and text invert. Blue is darkened
   slightly so it keeps contrast against white.
   ------------------------------------------------------------------------ */
:root[data-theme="light"] {
  --bg:            #ffffff;
  --bg-elev:       #f5f7fb;
  --surface:       #ffffff;
  --surface-2:     #f1f4f9;
  --surface-hover: #e7ecf4;

  --line:          #dde3ec;
  --line-soft:     #eaeff6;

  --text:          #0d1220;
  --text-dim:      #4a5468;
  --text-mute:     #737f95;

  --blue:          #0a6fd8;
  --blue-bright:   #0a6fd8;
  --blue-deep:     #0450a6;
  --blue-glow:     rgba(10, 111, 216, .28);
  --silver:        #46536b;

  --up:            #0e9f6a;
  --up-soft:       rgba(14, 159, 106, .12);
  --down:          #d92d3a;
  --down-soft:     rgba(217, 45, 58, .10);
  --warn:          #a97803;

  --chart-grid:      #e6ebf3;
  --chart-axis:      #737f95;
  --chart-crosshair: #a9b4c7;
  --chart-track:     #e6ebf3;
  --chart-dii:       #0a6fd8;
  --chart-donut-rest:#d5dce7;
  --chart-marker:    #0d1220;
}

/* Chrome-effect heading gradient needs a darker ramp on white.
   Use background-image, not the `background` shorthand — the shorthand would
   reset background-clip:text from the base rule and paint a solid block. */
:root[data-theme="light"] .text-grad {
  background-image: linear-gradient(180deg, #131a2b 0%, #3c4761 100%);
}

/* The logo is a JPEG with a baked-in black background — give it a dark
   tile in light mode instead of a black square floating on white. */
:root[data-theme="light"] .brand img {
  background: #05070c;
  padding: 3px;
}

/* Ticker tape keeps a dark bar in light mode: it reads as a market strip
   and keeps the up/down colours punchy. */
:root[data-theme="light"] .tape {
  background: #0d1220;
  border-bottom-color: #0d1220;
}
:root[data-theme="light"] .tape-item .sym { color: #9aa6bf; }
:root[data-theme="light"] .tape-item .px  { color: #e8edf7; }

:root[data-theme="light"] .nav {
  background: rgba(255, 255, 255, .92);
  border-bottom-color: var(--line);
}

/* Active nav item needs real contrast on white — the shared --surface-2
   token is too close to the page background to register as "selected". */
:root[data-theme="light"] .nav-links a.active {
  background: rgba(10, 111, 216, .10);
  color: var(--blue);
}
:root[data-theme="light"] .nav-links a:hover { background: var(--surface-2); color: var(--text); }
:root[data-theme="light"] .tabs button.on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(13, 18, 32, .12);
}

:root[data-theme="light"] .hero::before {
  background: radial-gradient(ellipse at center, rgba(10,111,216,.10), transparent 62%);
}

/* Soften the hero grid so it reads as a faint blueprint, not dark scoring */
:root[data-theme="light"] .hero::after { opacity: .55; }

:root[data-theme="light"] .footer { background: var(--bg-elev); }

:root[data-theme="light"] .btn-primary { color: #fff; }

:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd4e1; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b3bfd0; }

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;   /* wide content scrolls inside its own container, never the page */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.22rem; }
p  { margin: 0 0 1rem; color: var(--text-dim); }

::selection { background: var(--blue); color: #fff; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e2740; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2b3654; }

/* --- Layout helpers ----------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section-sm { padding: 52px 0; }
.grid { display: grid; gap: 20px; }
/* Grid/flex children default to min-width:auto, which lets wide tables and
   canvases push a track past its container. Reset it everywhere. */
.grid > *, .panel, .card { min-width: 0; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.center { text-align: center; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-dim); }

.section-head { margin-bottom: 36px; max-width: 720px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head p { font-size: 1.02rem; margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--blue-bright);
  margin-bottom: 14px;
}

.text-grad {
  background: linear-gradient(180deg, #ffffff 0%, #b8c4d8 55%, #8794ad 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-blue { color: var(--blue-bright); }

/* --- Ticker tape -------------------------------------------------------- */
.tape {
  height: var(--tick-h);
  background: #04060a;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.tape-track {
  display: flex;
  gap: 34px;
  white-space: nowrap;
  animation: tape-scroll 62s linear infinite;
  padding-left: 24px;
  will-change: transform;
}
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tape-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: .78rem;
  font-family: var(--mono);
}
.tape-item .sym { color: var(--text-dim); font-weight: 600; letter-spacing: .04em; }
.tape-item .px  { color: var(--text); }
.tape-item .chg { font-size: .74rem; }

/* --- Navigation --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(5, 7, 12, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-in {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt b { font-size: .96rem; letter-spacing: .1em; font-weight: 700; color: var(--text); }
.brand-txt span { font-size: .58rem; letter-spacing: .34em; color: var(--blue); font-weight: 600; margin-top: 3px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: .875rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color .16s, background .16s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }

.nav-cta { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--blue-bright), var(--blue-deep));
  color: #fff;
  box-shadow: 0 4px 22px -6px var(--blue-glow);
}
.btn-primary:hover { box-shadow: 0 6px 30px -6px var(--blue-glow); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: #2a3550; }
.btn-lg { padding: 13px 28px; font-size: .95rem; }

.burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 38px; height: 38px;
  color: var(--text);
  align-items: center;
  justify-content: center;
}

/* --- Live / sample data badge ------------------------------------------- */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(22,199,132,.7);
  animation: pulse 2.2s infinite;
  flex-shrink: 0;
}
.live-dot.sample { background: var(--warn); animation: none; box-shadow: none; }
.live-dot.off    { background: var(--text-mute); animation: none; box-shadow: none; }

.data-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-dim);
  white-space: nowrap;
}
.data-badge.is-live   { color: var(--up);   border-color: rgba(22,199,132,.3); background: var(--up-soft); }
.data-badge.is-sample { color: var(--warn); border-color: rgba(240,185,11,.3); background: rgba(240,185,11,.08); }

/* Sits in a panel header next to the title */
.panel-head .data-badge { margin-left: auto; }

/* --- Theme toggle ------------------------------------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  transition: color .16s, background .16s, border-color .16s;
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); border-color: #2a3550; }
:root[data-theme="light"] .theme-toggle:hover { border-color: #c3ccdb; }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; display: block; }

/* Show the icon for the theme you'd switch TO */
.theme-toggle .i-sun   { display: none; }
.theme-toggle .i-moon  { display: block; }
:root[data-theme="light"] .theme-toggle .i-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* Smooth the swap, but never animate layout or the first paint */
.theme-anim,
.theme-anim .nav,
.theme-anim .card,
.theme-anim .panel,
.theme-anim .post,
.theme-anim .side,
.theme-anim .footer,
.theme-anim .tape,
.theme-anim .stat,
.theme-anim thead th,
.theme-anim tbody td {
  transition: background-color .22s ease, color .22s ease, border-color .22s ease;
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 96px 0 72px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -320px; left: 50%;
  transform: translateX(-50%);
  width: 1100px; height: 700px;
  background: radial-gradient(ellipse at center, rgba(10,132,255,.20), transparent 62%);
  pointer-events: none;
  filter: blur(20px);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 25%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 25%, #000 20%, transparent 75%);
  opacity: .5;
  pointer-events: none;
}
.hero-in { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 20px; }
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  max-width: 660px;
  margin: 0 auto 32px;
  color: var(--text-dim);
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px 6px 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: .78rem;
  color: var(--text-dim);
  margin-bottom: 26px;
}
.pill b { color: var(--text); font-weight: 600; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(22,199,132,.7);
  animation: pulse 2.2s infinite;
}
.dot.red { background: var(--down); animation: none; box-shadow: none; }
@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(22,199,132,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,199,132,0); }
}

/* --- Cards -------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .18s, transform .18s, background .18s;
}
.card-hover:hover { border-color: #26334f; transform: translateY(-3px); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head h3 { margin: 0; font-size: 1rem; }
.card-head .meta { font-size: .74rem; color: var(--text-mute); font-family: var(--mono); }

.icon-box {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(10,132,255,.18), rgba(10,132,255,.05));
  border: 1px solid rgba(10,132,255,.24);
  margin-bottom: 15px;
  font-size: 1.15rem;
}

/* --- Index / quote cards ------------------------------------------------ */
.quote-card { padding: 18px 20px; }
.quote-card .qname {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
  margin-bottom: 8px;
}
.quote-card .qval {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.quote-card .qchg { font-family: var(--mono); font-size: .82rem; font-weight: 500; }
.spark { margin-top: 12px; height: 40px; width: 100%; display: block; }

/* --- Tables ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 480px; }
/* 3-column tables (commodities, forex) sit in narrow panels — let them fit */
table.compact { min-width: 340px; }
table.compact thead th, table.compact tbody td { padding-left: 13px; padding-right: 13px; }
thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: var(--surface-2); }
tbody td:first-child { color: var(--text); font-weight: 500; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  border: 1px solid;
}
.tag-up   { color: var(--up);   background: var(--up-soft);   border-color: rgba(22,199,132,.3); }
.tag-down { color: var(--down); background: var(--down-soft); border-color: rgba(234,57,67,.3); }
.tag-blue { color: var(--blue-bright); background: rgba(10,132,255,.1); border-color: rgba(10,132,255,.3); }
.tag-warn { color: var(--warn); background: rgba(240,185,11,.1); border-color: rgba(240,185,11,.3); }
.tag-mute { color: var(--text-mute); background: var(--surface-2); border-color: var(--line); }

/* --- Insight / article cards -------------------------------------------- */
.post {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .18s, transform .18s;
}
.post:hover { border-color: #26334f; transform: translateY(-3px); }
.post .kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-mute); font-weight: 600; margin-bottom: 12px;
}
.post h3 { font-size: 1.05rem; margin-bottom: 9px; }
.post p { font-size: .88rem; margin-bottom: 16px; flex: 1; }
.post .foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .76rem; color: var(--text-mute);
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.read-more { color: var(--blue-bright); font-weight: 600; }

/* --- Stats strip -------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 24px 20px; text-align: center; }
.stat b { display: block; font-family: var(--mono); font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.stat span { font-size: .76rem; color: var(--text-mute); letter-spacing: .06em; text-transform: uppercase; }

/* --- Feature list ------------------------------------------------------- */
.flist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.flist li { display: flex; gap: 11px; align-items: flex-start; font-size: .92rem; color: var(--text-dim); }
.flist li::before {
  content: "";
  flex-shrink: 0;
  width: 16px; height: 16px; margin-top: 4px;
  border-radius: 50%;
  background: rgba(10,132,255,.14);
  border: 1px solid rgba(10,132,255,.4);
  background-image: linear-gradient(135deg, transparent 45%, var(--blue-bright) 45%, var(--blue-bright) 55%, transparent 55%);
}

/* --- Dashboard shell ---------------------------------------------------- */
/* minmax(0,1fr) stops wide tables/canvases from blowing out the grid column */
.dash { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 24px; align-items: start; }
.dash > main { min-width: 0; }
.side {
  position: sticky; top: calc(var(--nav-h) + 20px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.side .grp { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-mute); font-weight: 600; padding: 12px 10px 6px; }
.side a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  font-size: .86rem; color: var(--text-dim); font-weight: 500;
  transition: background .15s, color .15s;
}
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a.active { background: rgba(10,132,255,.12); color: var(--blue-bright); }

/* --- Chart panels ------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-size: .98rem; }
.panel-body { padding: 20px; }

.tabs { display: flex; gap: 4px; background: var(--bg-elev); padding: 3px; border-radius: 9px; border: 1px solid var(--line-soft); }
.tabs button {
  padding: 5px 13px; border-radius: 7px; border: none;
  background: transparent; color: var(--text-mute);
  font-size: .78rem; font-weight: 600;
  transition: background .15s, color .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--surface-hover); color: var(--text); }

.chart-holder { position: relative; width: 100%; }
.chart-holder canvas { display: block; width: 100%; }
/* Belt-and-braces: no canvas may exceed its container box */
canvas { max-width: 100%; }
/* …except the fixed-size gauge/donut, which are centred at their natural size */
canvas.gauge, #breadthDonut, #vixGauge { width: auto; }

.chart-tip {
  display: none;
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid #26334f;
  border-radius: 8px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: .76rem;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}
.chart-tip b { color: var(--text); }
.chart-tip span { color: var(--text-mute); margin-left: 8px; }

/* Bar meters (FII/DII) */
.meter { display: grid; gap: 14px; }
.meter-row { display: grid; grid-template-columns: 96px 1fr 88px; gap: 12px; align-items: center; font-size: .84rem; }
.meter-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; }
.meter-fill.pos { background: linear-gradient(90deg, rgba(22,199,132,.5), var(--up)); }
.meter-fill.neg { background: linear-gradient(90deg, rgba(234,57,67,.5), var(--down)); }

/* Heat grid */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.heat-cell {
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  border: 1px solid var(--line);
  transition: transform .15s;
}
.heat-cell:hover { transform: scale(1.03); }
.heat-cell .hn { font-size: .78rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.heat-cell .hv { font-family: var(--mono); font-size: .95rem; font-weight: 600; }

/* Gauge */
.gauge-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gauge { flex-shrink: 0; }

/* --- Timeline / events -------------------------------------------------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--blue);
}
.tl-item.done::before { border-color: var(--text-mute); }
.tl-date { font-size: .72rem; font-family: var(--mono); color: var(--text-mute); letter-spacing: .04em; }
.tl-item h4 { margin: 3px 0 4px; font-size: .93rem; font-weight: 600; }
.tl-item p { font-size: .84rem; margin: 0; }

/* --- Forms -------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 7px; color: var(--text-dim); }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  transition: border-color .16s, box-shadow .16s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,132,255,.14);
}
.field textarea { resize: vertical; min-height: 128px; }
.field .hint { font-size: .74rem; color: var(--text-mute); margin-top: 6px; }

.form-note {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  margin-bottom: 16px;
  display: none;
}
.form-note.ok { display: block; background: var(--up-soft); border: 1px solid rgba(22,199,132,.3); color: var(--up); }

/* --- CTA band ----------------------------------------------------------- */
.cta-band {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 60% 120% at 50% 0%, rgba(10,132,255,.16), transparent 70%),
    var(--surface);
  padding: 54px 32px;
  text-align: center;
  overflow: hidden;
}
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { max-width: 560px; margin: 0 auto 26px; }

/* --- Disclaimer bar ----------------------------------------------------- */
.disclaimer-bar {
  background: rgba(240,185,11,.06);
  border: 1px solid rgba(240,185,11,.22);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: .82rem;
  color: var(--text-dim);
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.disclaimer-bar b { color: var(--warn); }

/* --- Footer ------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-elev);
  padding: 56px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 40px;
}
.footer h5 {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text); margin: 0 0 14px; font-weight: 600;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer ul a { font-size: .86rem; color: var(--text-mute); transition: color .15s; }
.footer ul a:hover { color: var(--blue-bright); }
.footer .about { font-size: .86rem; color: var(--text-mute); max-width: 320px; margin: 14px 0 0; }
.footer-bot {
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .78rem; color: var(--text-mute);
}
.footer-risk {
  font-size: .74rem;
  color: var(--text-mute);
  line-height: 1.7;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 26px;
  background: var(--surface);
}

/* --- Legal / prose ------------------------------------------------------ */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.34rem; margin-top: 40px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; color: var(--text-dim); }
.prose li { margin-bottom: 8px; font-size: .93rem; }
.prose p { font-size: .93rem; }

/* --- Reveal on scroll --------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1040px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dash { grid-template-columns: 1fr; }
  .side { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
  .side .grp { display: none; }
  .side a { white-space: nowrap; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 12px;
    gap: 2px;
  }
  .burger { display: inline-flex; }
  .nav-cta .btn { display: none; }
  .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 60px 0; }
}
@media (max-width: 620px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .meter-row { grid-template-columns: 78px 1fr 74px; font-size: .78rem; }
  .hero { padding: 62px 0 48px; }
  .wrap { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Homepage — cinematic hero layout
   --------------------------------------------------------------------------
   Two-column hero with a rendered mark, a stat strip, and a three-panel row.
   Scoped under .home-* so nothing here touches the other pages.
   ========================================================================== */

.home-hero {
  position: relative;
  padding: 40px 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.home-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: 460px;
}
.home-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 22px;
}
.home-eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue-bright); box-shadow: 0 0 0 4px rgba(10,132,255,.16);
}
.home-h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.04; letter-spacing: -.02em; margin: 0 0 14px;
  text-transform: uppercase; font-weight: 800;
}
.home-kicker {
  font-size: clamp(.82rem, 1.3vw, 1rem);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue-bright); margin: 0 0 22px; font-weight: 600;
}
.home-lede { font-size: 1.02rem; color: var(--text-dim); max-width: 46ch; margin: 0 0 28px; }
.home-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* The rendered mark. A large VOIDX wordmark over the skyline, in place of the
   bull render from the comp — no stock asset, nothing to license. */
.home-art {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}
.home-art-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 45% at 55% 45%, rgba(10,132,255,.30), transparent 68%),
    radial-gradient(ellipse 70% 40% at 50% 92%, rgba(60,150,255,.16), transparent 72%);
  filter: blur(12px); pointer-events: none;
}
/* The bull render. A JPEG has no alpha, so the edges are dissolved with a mask
   instead — otherwise a hard rectangle sits over the hero glow. */
.home-bull {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
  mask-image: radial-gradient(ellipse 68% 66% at 50% 50%, #000 38%, rgba(0,0,0,.55) 66%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse 68% 66% at 50% 50%, #000 38%, rgba(0,0,0,.55) 66%, transparent 82%);
}
/* The art is rendered for a dark hero; on a light page it reads as a black
   slab, so soften it rather than let it dominate. */
/* Light mode: frame the render rather than convert it.

   Every attempt to make this dark artwork sit on white failed — a mask left a
   grey smear, no mask left a raw black rectangle, and inverting it produced a
   hollow outline with the city showing through the bull. The subject is black
   metal on a night city; it is not convertible.

   So the panel becomes the design: a dark rounded card with padding and a
   shadow, which reads as an intentional block on the page. */
:root[data-theme="light"] .home-art {
  background: linear-gradient(165deg, #0d1626 0%, #070c16 100%);
  border-radius: 22px;
  padding: 26px 22px 18px;
  box-shadow:
    0 24px 60px rgba(12, 26, 50, .20),
    0 3px 10px rgba(12, 26, 50, .10);
  overflow: hidden;
}
:root[data-theme="light"] .home-bull {
  /* Inside a dark panel the render needs no treatment at all — the mask only
     has to soften where it meets the panel's own edge. */
  mask-image: radial-gradient(ellipse 88% 90% at 50% 50%, #000 74%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 88% 90% at 50% 50%, #000 74%, transparent 100%);
  opacity: 1;
  filter: none;
  box-shadow: none;
  border-radius: 0;
  max-width: 400px;
  margin: 0 auto;
}
/* Keep the blue bloom inside the panel — it is what stops the card reading
   as a flat grey box. */
:root[data-theme="light"] .home-art-glow {
  display: block;
  background: radial-gradient(ellipse 60% 55% at 50% 45%, rgba(40,120,255,.30), transparent 70%);
}

.home-mark { position: relative; text-align: center; }
.home-mark img { width: clamp(150px, 20vw, 230px); opacity: .96; }
.home-mark b {
  display: block; margin-top: 16px;
  font-size: clamp(1.9rem, 3.6vw, 3rem); font-weight: 800;
  letter-spacing: .34em; text-indent: .34em; color: var(--text);
}
.home-mark span {
  display: block; margin-top: 6px;
  font-size: clamp(.7rem, 1.1vw, .9rem); letter-spacing: .5em; text-indent: .5em;
  color: var(--blue-bright); font-weight: 600;
}

/* Three-panel row */
.home-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  /* stretch, not start: three panels of differing content length looked
     ragged against each other with start alignment. */
  align-items: stretch;
}
.home-row > .panel { display: flex; flex-direction: column; }
.home-row > .panel > .panel-body { flex: 1; }
.home-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.home-panel-head h3 { margin: 0; font-size: .92rem; }

/* Placeholder state for panels with no data behind them yet */
.home-empty {
  padding: 30px 18px; text-align: center;
}
.home-empty b {
  display: block; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 8px;
}
.home-empty p { font-size: .84rem; color: var(--text-mute); margin: 0; max-width: 34ch; margin-inline: auto; }

@media (max-width: 1040px) {
  .home-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .home-hero-grid { grid-template-columns: 1fr; gap: 10px; min-height: 0; }
  .home-art { min-height: 280px; order: -1; }
  .home-hero { padding-top: 26px; }
}
@media (max-width: 620px) {
}

/* ==========================================================================
   Homepage — KAI hero
   --------------------------------------------------------------------------
   Two-column hero: copy left, an app mockup right, feature cards beneath.
   Scoped under .kai-* so nothing here reaches the other pages.
   ========================================================================== */

.kai-hero {
  position: relative;
  padding: 46px 0 0;
  overflow: hidden;
  /* Navy cast rather than pure black, as in the comp: the flat near-black made
     the vortex read as a smudge because there was nothing for it to sit in. */
  background:
    radial-gradient(ellipse 90% 70% at 72% 30%, rgba(16,42,86,.55), transparent 62%),
    linear-gradient(180deg, #0a1428 0%, #070d1a 42%, var(--bg) 100%);
}

.kai-hero > .wrap { position: relative; z-index: 2; }

/* Faint blueprint grid over the gradient. Masked so it fades out well before
   the headline — texture at the edges, clean ground under the copy. */
.kai-grid-tex {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(90,150,220,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90,150,220,.055) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 78% 70% at 62% 34%, #000 8%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 78% 70% at 62% 34%, #000 8%, transparent 72%);
  pointer-events: none; z-index: 0;
}

/* The navy ground is built for a dark page; on white it would be a dark slab. */
:root[data-theme="light"] .kai-hero {
  background:
    radial-gradient(ellipse 90% 70% at 72% 30%, rgba(10,111,216,.07), transparent 62%),
    linear-gradient(180deg, #f2f6fc 0%, #f8fafd 46%, var(--bg) 100%);
}
:root[data-theme="light"] .kai-grid-tex {
  background-image:
    linear-gradient(rgba(20,70,140,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,70,140,.05) 1px, transparent 1px);
}
.kai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}

/* Radial bloom behind the mockup, which is what stops the right side reading
   as a flat screenshot pasted onto the page. */
/* The vortex behind the mockup. Concentric rings with one bright sweeping arc,
   built from gradients rather than an image so it scales and recolours. */
.kai-hero::before {
  content: "";
  position: absolute;
  top: -30px; right: 6%;
  width: 680px; height: 680px;
  border-radius: 50%;
  background:
    /* the bright arc: a conic sweep clipped to a ring by the mask below */
    conic-gradient(from 200deg,
      transparent 0deg,
      rgba(90,180,255,.75) 42deg,
      rgba(150,215,255,.95) 62deg,
      rgba(60,150,255,.55) 84deg,
      transparent 130deg),
    radial-gradient(circle at 50% 50%, rgba(10,132,255,.22), transparent 64%);
  /* Hollow centre so the arc reads as an orbit rather than a filled disc. */
  mask-image: radial-gradient(circle at 50% 50%,
    transparent 34%, #000 44%, #000 62%, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%,
    transparent 34%, #000 44%, #000 62%, transparent 74%);
  filter: blur(1.5px);
  opacity: .9;
  pointer-events: none;
  animation: kaiSpin 46s linear infinite;
}

/* Faint outer rings, and a soft bloom to lift the whole right side. */
.kai-hero::after {
  content: "";
  position: absolute;
  top: -140px; right: -4%;
  width: 940px; height: 940px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 40%, rgba(60,150,255,.10) 41%, transparent 42%),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(60,150,255,.08) 53%, transparent 54%),
    radial-gradient(circle at 50% 50%, transparent 64%, rgba(60,150,255,.06) 65%, transparent 66%),
    radial-gradient(circle at 50% 50%, rgba(10,132,255,.16), transparent 58%);
  filter: blur(6px);
  pointer-events: none;
}

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

/* Decoration only, so it is the first thing to go. */
@media (prefers-reduced-motion: reduce) {
  .kai-hero::before { animation: none; }
}

/* The rings are tuned for a dark page; on white they read as grey smudges. */
:root[data-theme="light"] .kai-hero::before { opacity: .38; }
:root[data-theme="light"] .kai-hero::after { opacity: .5; }

.kai-pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 7px 14px; border-radius: 999px;
  margin-bottom: 26px;
}
.kai-pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-bright); box-shadow: 0 0 0 3px rgba(10,132,255,.18);
}

.kai-h1 {
  font-size: clamp(1.9rem, 3.5vw, 3.1rem);
  line-height: 1.08; letter-spacing: -.025em;
  margin: 0 0 20px; font-weight: 700;
}
.kai-h1 .l2 { color: var(--blue-bright); display: block; }
.kai-lede {
  font-size: clamp(.98rem, 1.3vw, 1.1rem);
  color: var(--text-dim); max-width: 48ch; margin: 0 0 30px;
}
.kai-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* Stat strip — coverage facts, which are verifiable, rather than performance */
.kai-stats {
  display: grid; grid-template-columns: repeat(4, auto);
  gap: 34px; margin-top: 38px; justify-content: start;
}
.kai-stat b {
  display: block; font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  color: var(--blue-bright); font-weight: 700; letter-spacing: -.01em;
}
.kai-stat span {
  font-size: .78rem; color: var(--text-mute);
}

/* Broker strip. Named as a data source, not as an endorsement: an API key is
   not a partnership, and their marks are not ours to imply one with. */
.kai-trust { margin-top: 40px; }
.kai-trust > small {
  display: block; font-size: .68rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: 14px;
}
.kai-trust-row { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.kai-src {
  font-size: .84rem; color: var(--text-dim); display: inline-flex;
  align-items: center; gap: 8px;
}
.kai-src b { color: var(--text); font-weight: 600; }

/* --- App mockup --------------------------------------------------------- */
.kai-app {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--bg-elev) 0%, var(--bg) 100%);
  /* Shadow offset to the right, away from the tilt, so the panel reads as
     lifted off the page rather than flatly outlined. */
  box-shadow: 26px 44px 100px rgba(0, 8, 24, .62);
  overflow: hidden;
  /* Tilted further than the comp: a shorter perspective distance and a
     stronger Y rotation give the panel real depth, and the slight Z twist
     stops it looking like a flat rectangle sheared sideways. Kept within the
     range where the numbers inside are still readable — past about -14deg the
     right-hand column starts to compress badly. */
  transform: perspective(1500px) rotateY(-12deg) rotateX(3.5deg) rotate(-.6deg);
  transform-origin: 65% 50%;
}
.kai-app-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.kai-app-brand { font-size: .84rem; font-weight: 700; letter-spacing: .02em; }
.kai-app-brand span { color: var(--blue-bright); }
.kai-app-search {
  margin-left: auto; font-size: .68rem; color: var(--text-mute);
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 12px;
  background: var(--surface-2);
}
.kai-app-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.kai-side {
  border-right: 1px solid var(--line); padding: 12px 0;
  display: flex; flex-direction: column; gap: 2px;
}
.kai-side a {
  font-size: .72rem; color: var(--text-dim); text-decoration: none;
  padding: 7px 14px; display: block;
  /* "Economic Calendar" is the longest label and would wrap to two lines,
     breaking the even row rhythm the mockup depends on. */
  white-space: nowrap;
}
.kai-side a.on {
  color: var(--blue-bright); background: rgba(10,132,255,.10);
  box-shadow: inset 2px 0 0 var(--blue-bright);
}
.kai-main { padding: 13px; display: grid; gap: 11px; min-width: 0; }
.kai-sec-label {
  font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 8px;
}
.kai-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kai-card {
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 10px; background: var(--surface-2); min-width: 0;
}
.kai-card small {
  display: block; font-size: .58rem; letter-spacing: .06em;
  color: var(--text-mute); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kai-card b { display: block; font-size: .82rem; margin-top: 3px; }
.kai-card i { font-size: .62rem; font-style: normal; }

.kai-split { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 11px; }
.kai-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); padding: 11px; min-width: 0;
}
.kai-panel h4 {
  margin: 0 0 9px; font-size: .72rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.kai-panel h4 .meta { margin-left: auto; font-size: .6rem; color: var(--text-mute); }
.kai-rows { display: flex; flex-direction: column; gap: 7px; }
.kai-row {
  display: flex; align-items: center; gap: 8px; font-size: .68rem;
}
.kai-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.kai-row .v { color: var(--text); }

/* --- Feature cards ------------------------------------------------------ */
.kai-features {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px; margin-top: 56px;
}
.kai-feat {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-elev); padding: 24px 22px;
}
.kai-feat-ico {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: rgba(10,132,255,.10); border: 1px solid rgba(10,132,255,.28);
  color: var(--blue-bright);
}
.kai-feat h3 { font-size: 1.02rem; margin: 0 0 9px; line-height: 1.25; }
.kai-feat p { font-size: .86rem; color: var(--text-mute); margin: 0; }

@media (max-width: 1080px) {
  .kai-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .kai-app { transform: none; }
  .kai-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .kai-stats { grid-template-columns: repeat(2, auto); gap: 20px 28px; }
  .kai-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kai-split { grid-template-columns: minmax(0, 1fr); }
  .kai-app-body { grid-template-columns: 1fr; }
  .kai-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .kai-features { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Economic calendar page
   ========================================================================== */
.ec-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.ec-nav { display: flex; flex-direction: column; gap: 2px; }
.ec-nav a {
  display: flex; align-items: center; gap: 10px;
  font-size: .84rem; color: var(--text-dim);
  padding: 9px 12px; border-radius: 9px;
}
.ec-nav a.on { background: rgba(10,132,255,.10); color: var(--blue-bright); }
.ec-nav a:hover:not(.on) { background: var(--surface-2); color: var(--text); }

.ec-head h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0 0 6px; }
.ec-head p { font-size: .92rem; margin: 0 0 22px; }

.ec-toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.ec-range {
  font-size: .88rem; font-weight: 600; padding: 0 6px;
}

/* Summary tiles */
.ec-tiles {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.ec-tile {
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg-elev); padding: 13px 15px;
  position: relative;
}
.ec-tile b { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.ec-tile span { font-size: .72rem; color: var(--text-mute); }
.ec-tile i {
  position: absolute; top: 13px; right: 14px;
  width: 7px; height: 7px; border-radius: 50%;
}
.ec-tile.high b { color: var(--down); }
.ec-tile.high i { background: var(--down); }
.ec-tile.med b { color: var(--warn); }
.ec-tile.med i { background: var(--warn); }
.ec-tile.low b { color: var(--up); }
.ec-tile.low i { background: var(--up); }

/* Event table */
.ec-table { width: 100%; min-width: 0; border-collapse: collapse; }
.ec-table thead th {
  text-align: left; font-size: .66rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-mute); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.ec-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); font-size: .84rem; }
.ec-table tr.ec-day td {
  background: var(--surface-2); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-dim); font-weight: 600;
  padding: 8px 12px;
}
.ec-table td.t { white-space: nowrap; color: var(--text-dim); }
.ec-ccy {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; color: var(--text-dim);
}
.ec-flag {
  display: inline-grid; place-items: center;
  width: 22px; height: 15px; border-radius: 3px;
  font-size: .54rem; font-weight: 700; letter-spacing: 0;
  background: var(--surface-hover); color: var(--text-dim);
}
.ec-imp {
  font-size: .66rem; padding: 2px 9px; border-radius: 5px; font-weight: 600;
}
.ec-imp.high { background: var(--down-soft); color: var(--down); }
.ec-imp.medium { background: rgba(240,185,11,.14); color: var(--warn); }
.ec-imp.low { background: var(--up-soft); color: var(--up); }
.ec-dash { color: var(--text-mute); }

/* Right rail */
.ec-rail { display: flex; flex-direction: column; gap: 14px; }
.ec-up-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.ec-up-item:last-child { border-bottom: 0; }
.ec-up-top { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.ec-up-top .tm { color: var(--text-dim); white-space: nowrap; }
.ec-up-top .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-up-sub { font-size: .7rem; color: var(--text-mute); }

.ec-count { text-align: center; padding: 6px 0 2px; }
.ec-count b {
  display: block; font-family: var(--mono);
  font-size: 1.9rem; color: var(--blue-bright); letter-spacing: .04em;
}
.ec-count span { font-size: .68rem; color: var(--text-mute); letter-spacing: .12em; text-transform: uppercase; }

.ec-legend { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.ec-legend-row { display: flex; align-items: center; gap: 8px; font-size: .76rem; }
.ec-legend-row i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.ec-legend-row .v { margin-left: auto; color: var(--text-mute); font-size: .72rem; }

@media (max-width: 1180px) {
  .ec-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .ec-nav { display: none; }
}
@media (max-width: 900px) {
  .ec-layout { grid-template-columns: minmax(0, 1fr); }
  .ec-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .ec-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ec-table td.fc, .ec-table th.fc { display: none; }
}

/* ==========================================================================
   KAI inner pages — Intelligence, Research, Lab
   ========================================================================== */

/* Shared page hero: eyebrow, two-line headline, lede, optional search */
.kp-hero { position: relative; padding: 40px 0 26px; overflow: hidden; }
.kp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--blue-bright); margin-bottom: 16px;
}
.kp-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue-bright);
}
.kp-h1 { font-size: clamp(1.8rem, 3.4vw, 2.9rem); line-height: 1.12; margin: 0 0 14px; }
.kp-h1 .l2 { color: var(--blue-bright); display: block; }
.kp-lede { font-size: .95rem; color: var(--text-dim); max-width: 52ch; margin: 0 0 22px; }

.kp-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 420px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text-mute); font-size: .86rem;
}
.kp-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--text); font: inherit;
}

/* Index strip under a page hero */
.kp-strip {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.kp-strip > div { padding: 12px 16px; border-right: 1px solid var(--line); min-width: 0; }
.kp-strip > div:last-child { border-right: 0; }
.kp-strip small {
  display: block; font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-mute);
}
.kp-strip b { font-size: .92rem; }
.kp-strip i { font-style: normal; font-size: .72rem; margin-left: 6px; }

/* Tabs shared by Terminal / Research */
.kp-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.kp-tabs button {
  background: none; border: 0; color: var(--text-dim);
  font-size: .86rem; padding: 10px 14px; border-bottom: 2px solid transparent;
}
.kp-tabs button.on { color: var(--blue-bright); border-bottom-color: var(--blue-bright); }
.kp-tabs button:hover:not(.on) { color: var(--text); }

/* Placeholder marker. Every fabricated figure carries one so it can be found
   and replaced, and so a reader can see it is not a measurement. */
.kp-ph {
  font-size: .54rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--warn); border: 1px solid rgba(240,185,11,.35);
  border-radius: 4px; padding: 1px 5px; margin-left: 6px;
  vertical-align: middle; white-space: nowrap;
}

/* Research report cards */
.kp-reports { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kp-report {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-elev); padding: 18px; display: flex; flex-direction: column;
}
.kp-report h4 { font-size: .96rem; margin: 0 0 4px; }
.kp-report .dt { font-size: .72rem; color: var(--text-mute); margin-bottom: 10px; }
.kp-report p { font-size: .82rem; margin: 0 0 16px; }
.kp-report .btn { margin-top: auto; align-self: flex-start; }

/* Lab metrics rail */
.kp-metrics { display: flex; flex-direction: column; gap: 0; }
.kp-metric {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: .84rem;
}
.kp-metric:last-child { border-bottom: 0; }
.kp-metric .k { color: var(--text-dim); }
.kp-metric .v { font-family: var(--mono); font-weight: 600; }

.kp-tool {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); font-size: .8rem; color: var(--text-dim);
  margin-bottom: 7px;
}
.kp-tool:hover { color: var(--text); border-color: rgba(10,132,255,.35); }

/* Feature strip at the foot of the comps */
.kp-features {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px; padding: 34px 0; border-top: 1px solid var(--line);
}
.kp-feature h5 {
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-bright); margin: 12px 0 8px;
}
.kp-feature p { font-size: .82rem; margin: 0; }

@media (max-width: 1080px) {
  .kp-reports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kp-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .kp-reports, .kp-features { grid-template-columns: minmax(0, 1fr); }
  .kp-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
