/* ─────────────────────────────────────────────────────────
   AI Traders — single stylesheet
   "Trading terminal": near-black panels, green/red moves, amber AI accent.
   ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 76px; } /* keep anchored sections clear of the sticky header */

:root {
  --bg:        #0a0d12;
  --panel:     #10151d;
  --panel-2:   #151c26;
  --border:    #1f2834;
  --border-hi: #2b3646;
  --text:      #e1e7ee;
  --text-mid:  #a3aebc;
  --text-dim:  #6f7b8a;
  --up:        #18c37e;
  --down:      #f0505a;
  --amber:     #f3b61f;
  --cyan:      #3fc6e8;
  --radius:    8px;
  --mono:      ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans:      system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg) radial-gradient(1200px 500px at 70% -10%, rgba(63,198,232,.07), transparent 60%) no-repeat;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .55em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); font-weight: 800; }
h1 span { color: var(--amber); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.65rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--text-dim); }
.small { font-size: .86rem; }
.lead { font-size: 1.1rem; color: var(--text-mid); max-width: 72ch; }
.lead strong { color: var(--text); }
.eyebrow { font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .14em; color: var(--amber); margin-bottom: 12px; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-mid); }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--amber); color: #111; padding: 8px 14px; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }

/* ── HEADER ───────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(10,13,18,.92); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--mono); font-weight: 700; letter-spacing: .06em; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--amber); }
.header-status { margin: 0 auto 0 4px; font-family: var(--mono); font-size: .76rem; color: var(--text-dim); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.header-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(24,195,126,.18); }
.site-nav { display: flex; gap: 2px; }
.site-nav a { color: var(--text-mid); padding: 8px 12px; border-radius: 6px; font-size: .93rem; }
.site-nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-toggle { display: none; width: 42px; height: 42px; padding: 10px; border: 1px solid var(--border-hi); border-radius: 6px; background: var(--panel); }
.nav-toggle span { display: block; height: 2px; margin: 4px 0; background: var(--text); }

/* ── BUTTONS / CONTROLS ───────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--border-hi); background: var(--panel-2); color: var(--text); font-weight: 600; }
.btn:hover { text-decoration: none; border-color: var(--text-dim); }
.btn--primary { background: var(--amber); border-color: var(--amber); color: #15120a; }
.btn--primary:hover { filter: brightness(1.08); }
.seg { display: inline-flex; border: 1px solid var(--border-hi); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--border-hi); background: transparent; color: var(--text-mid); padding: 6px 12px; font-family: var(--mono); font-size: .82rem; min-height: 34px; }
.seg button:last-child { border-right: 0; }
.seg button.is-active { background: var(--panel-2); color: var(--amber); }
.seg button:hover { color: var(--text); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-family: var(--mono); font-size: .85rem; font-weight: 600; background: var(--panel-2); }
.pill.up { background: rgba(24,195,126,.13); }
.pill.down { background: rgba(240,80,90,.13); }
.pill--lg { font-size: 1rem; padding: 4px 12px; }

/* ── HERO ─────────────────────────────────────────────── */
.hero { padding: 40px 20px 24px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.hero__facts li { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text-mid); font-size: .9rem; }
.hero__facts b { color: var(--text); font-family: var(--mono); }

/* ── BOARD (featured chart) ───────────────────────────── */
.board { padding-bottom: 12px; }
.board__panel { padding: 18px; }
.board__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 8px; }
.board__head > div { min-width: 0; max-width: 100%; }
.ticker-select { width: 100%; max-width: 420px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--border-hi); border-radius: 6px; background: var(--panel-2); color: var(--text); font-family: var(--mono); }
.board__name { margin: 10px 0 0; font-size: 1.25rem; }
.quote { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 26px; margin: 0; }
.quote dt { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); }
.quote dd { margin: 2px 0 0; font-family: var(--mono); font-size: 1.15rem; font-weight: 700; }
.chart { position: relative; }
.chart__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.chart__link { font-size: .9rem; }
canvas[data-chart] { display: block; width: 100%; height: 360px; touch-action: pan-y; cursor: crosshair; }
.chart__empty { position: absolute; left: 0; right: 0; top: 46%; text-align: center; color: var(--text-dim); }

/* ── SECTIONS / TABLES ────────────────────────────────── */
.section { padding: 34px 20px; }
.section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section__head h2 { margin: 0; }
.filter input { min-width: 260px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-hi); border-radius: 6px; background: var(--panel); color: var(--text); }
.notice { padding: 12px 16px; border: 1px solid rgba(243,182,31,.35); background: rgba(243,182,31,.07); border-radius: var(--radius); color: var(--text-mid); }
.notice p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--panel-2); font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 600; }
thead th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
thead th[aria-sort] button { color: var(--amber); }
thead th[aria-sort="ascending"] button::after { content: " ▲"; }
thead th[aria-sort="descending"] button::after { content: " ▼"; }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th a { font-family: var(--mono); font-weight: 700; color: var(--text); }
td.num, th.num { text-align: right; font-family: var(--mono); }

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.col { padding: 18px; }
.col p { margin: 0; color: var(--text-mid); }

.faq details { margin-bottom: 10px; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--amber); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--text-mid); }

/* ── STOCK PAGE ───────────────────────────────────────── */
.stock-head { padding: 30px 20px 10px; }
.breadcrumb { font-family: var(--mono); font-size: .78rem; color: var(--text-dim); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-mid); }
.stock-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; padding-top: 10px; padding-bottom: 6px; }
.forecast-card { padding: 20px; display: flex; flex-direction: column; }
.forecast-card__label { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--amber); margin: 0 0 8px; }
.forecast-card__price { font-family: var(--mono); font-size: 2.4rem; font-weight: 800; line-height: 1.1; margin: 0 0 10px; }
.forecast-card__move { margin: 0 0 16px; color: var(--text-mid); }
.forecast-card__note { margin: auto 0 0; padding-top: 14px; font-size: .82rem; color: var(--text-dim); }
.kv { margin: 0; display: grid; gap: 10px; }
.kv dt { font-size: .76rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }
.kv dd { margin: 2px 0 0; font-family: var(--mono); }
.chart-panel { padding: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; }
.stat span { display: block; font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; font-family: var(--mono); }
.stat b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 1.15rem; }
.track td, .track th { font-size: .9rem; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.related a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text-mid); }
.related a:hover { border-color: var(--amber); text-decoration: none; color: var(--text); }
.related b { font-family: var(--mono); color: var(--text); margin-right: 6px; }

/* ── PROSE / LEGAL ────────────────────────────────────── */
.prose { max-width: 800px; padding-top: 30px; padding-bottom: 44px; }
.prose h2 { margin-top: 1.7em; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; color: var(--text-mid); }
.prose p { color: var(--text-mid); }
.prose strong { color: var(--text); }

/* ── FOOTER ───────────────────────────────────────────── */
.site-footer { margin-top: 36px; padding: 30px 0 22px; border-top: 1px solid var(--border); background: #080a0e; }
.footer-warning { padding: 12px 16px; border: 1px solid rgba(240,80,90,.3); background: rgba(240,80,90,.06); border-radius: var(--radius); color: var(--text-mid); font-size: .92rem; }
.footer-warning strong { color: var(--text); }
.footer-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 22px; }
.footer-col { display: flex; flex-direction: column; gap: 6px; }
.footer-col strong { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-dim); margin-bottom: 4px; }
.footer-col a { color: var(--text-mid); font-size: .93rem; }
.footer-bottom { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-dim); }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 960px) {
  .stock-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .quote { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 760px) {
  .header-status { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; padding: 8px 20px 14px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 6px; }
  canvas[data-chart] { height: 280px; }
  .hide-sm { display: none; }
  .filter, .filter input { width: 100%; min-width: 0; }
  th, td { padding: 9px 10px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .quote { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; }
  .quote dd { font-size: 1rem; }
  .stats { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
