/* TUL LLM Rank — editorial data board.
   Direction: warm ink paper, serif display + grotesk body + mono data,
   one signal accent for UI, validated categorical hues for charts only. */

:root {
  color-scheme: light;
  --bg: #f3f1ea;
  --bg-alt: #ebe8df;
  --surface: #fbfaf6;
  --surface-2: #f6f4ee;
  --line: rgba(20, 19, 15, 0.1);
  --line-strong: rgba(20, 19, 15, 0.22);
  --text: #14130f;
  --text-2: #4f4c44;
  --muted: #6f6b61;
  --accent: #3f6a00;
  --accent-ink: #f6ffe0;
  --accent-soft: rgba(63, 106, 0, 0.1);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --track: rgba(20, 19, 15, 0.07);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 20px 50px -30px rgba(30, 25, 10, 0.35);

  --f-display: 'Instrument Serif', 'Times New Roman', serif;
  --f-body: 'Geist', system-ui, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, monospace;

  --step-hero: clamp(2.8rem, 1.2rem + 5.6vw, 6.4rem);
  --step-h2: clamp(2.1rem, 1.3rem + 2.8vw, 3.6rem);
  --space-section: clamp(4.5rem, 3rem + 6vw, 9rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r-s: 6px;
  --r-m: 12px;
  --r-l: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0c;
    --bg-alt: #121211;
    --surface: #161614;
    --surface-2: #1b1b19;
    --line: rgba(240, 236, 225, 0.08);
    --line-strong: rgba(240, 236, 225, 0.2);
    --text: #efece4;
    --text-2: #b9b5a9;
    --muted: #8a867b;
    --accent: #c8f169;
    --accent-ink: #141a05;
    --accent-soft: rgba(200, 241, 105, 0.1);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --track: rgba(240, 236, 225, 0.07);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0c;
  --bg-alt: #121211;
  --surface: #161614;
  --surface-2: #1b1b19;
  --line: rgba(240, 236, 225, 0.08);
  --line-strong: rgba(240, 236, 225, 0.2);
  --text: #efece4;
  --text-2: #b9b5a9;
  --muted: #8a867b;
  --accent: #c8f169;
  --accent-ink: #141a05;
  --accent-soft: rgba(200, 241, 105, 0.1);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --track: rgba(240, 236, 225, 0.07);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* paper grain */
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--f-mono); font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--track); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--f-mono); font-size: 0.8125rem; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.display { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.02em; line-height: 0.98; margin: 0; }
.display em { font-style: italic; color: var(--accent); }
.display.small { font-size: 2.4rem; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-s); }
.skip:focus { left: 16px; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - 1240px) / 2));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, padding 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.brand-mark i { width: 4px; border-radius: 1px; background: var(--accent); transform-origin: bottom; animation: bars 2.4s var(--ease) infinite; }
.brand-mark i:nth-child(1) { height: 45%; }
.brand-mark i:nth-child(2) { height: 75%; animation-delay: 0.2s; }
.brand-mark i:nth-child(3) { height: 100%; animation-delay: 0.4s; }
@keyframes bars { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.55); } }
.brand-name { font-weight: 600; letter-spacing: -0.01em; }
.brand-name em { font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 1.15em; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 6px 12px; border-radius: 999px; color: var(--text-2); font-size: 0.9rem; transition: color 0.2s, background 0.2s; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); background: var(--track); }
.nav-end { display: flex; align-items: center; gap: 8px; }
.chip { padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-2); white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; transition: transform 0.4s var(--ease), background 0.2s; }
.icon-btn:hover { background: var(--track); transform: rotate(-20deg); }

/* ---------- BUTTONS / PILLS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; cursor: pointer; position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s, color 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform: translateY(101%); transition: transform 0.45s var(--ease); z-index: -1; }
.btn.primary:hover:not([disabled]) { color: var(--accent-ink); }
.btn.primary:hover:not([disabled])::after { transform: translateY(0); }
.btn.ghost { border-color: var(--line-strong); background: transparent; }
.btn.ghost:hover { background: var(--track); }
.btn.small { height: 36px; padding: 0 16px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.pill { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); cursor: pointer; font-size: 0.875rem; transition: all 0.2s; }
.pill:hover { color: var(--text); border-color: var(--text-2); }
.pill.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- HERO ---------- */
.hero { position: relative; padding: clamp(3rem, 2rem + 5vw, 7rem) 0 3rem; overflow: hidden; isolation: isolate; }
.hero-grid {
  position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 30%, transparent 75%);
  animation: grid-drift 40s linear infinite;
}
@keyframes grid-drift { to { background-position: 64px 64px; } }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 5rem); align-items: end; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); margin: 0 0 28px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.live { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: var(--step-hero); max-width: 13ch; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.16em 0 0.1em; margin: -0.16em 0 -0.1em; }
.hero h1 .w > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 55ms); }
.hero h1.is-in .w > span { transform: none; }
.lead { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--text-2); max-width: 52ch; margin: 28px 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-board { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px; box-shadow: var(--shadow); }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-weight: 500; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.board li:last-child { border-bottom: 0; }
.board li:hover .b-name { color: var(--accent); }
.b-rank { font-family: var(--f-mono); color: var(--muted); font-size: 0.8rem; }
.b-name { font-weight: 500; transition: color 0.2s; }
.b-org { font-size: 0.78rem; color: var(--muted); margin-left: 6px; }
.b-val { font-family: var(--f-mono); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

.bar { display: block; position: relative; height: 6px; border-radius: 4px; background: var(--track); overflow: hidden; margin-top: 6px; }
.bar > i { position: absolute; inset: 0; border-radius: 4px; background: var(--fill, var(--series-1)); transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease); transition-delay: calc(var(--d, 0) * 60ms); }
.is-in .bar > i, .bar.is-in > i { transform: scaleX(var(--v, 0)); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.stat { padding: 22px 20px 0 0; display: flex; flex-direction: column; gap: 2px; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.4rem, 2rem + 2vw, 3.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-2); font-size: 0.92rem; }

/* ---------- TICKER ---------- */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--bg-alt); }
.ticker-track { display: flex; width: max-content; animation: marquee 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; font-family: var(--f-mono); font-size: 0.82rem; color: var(--text-2); white-space: nowrap; border-right: 1px solid var(--line); }
.ticker-item b { color: var(--text); font-weight: 500; }
.ticker-item .up { color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- SECTIONS ---------- */
.section { padding: var(--space-section) 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: end; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.sec-num { color: var(--accent); align-self: start; padding-top: 0.9rem; }
.sec-head h2 { font-family: var(--f-display); font-weight: 400; font-size: var(--step-h2); line-height: 1; letter-spacing: -0.02em; margin: 0; }
.sec-head p { color: var(--text-2); margin: 0; max-width: 46ch; justify-self: end; }

/* ---------- SPOTLIGHT ---------- */
.spot {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 40px;
}
.spot-copy { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 18px; border-right: 1px solid var(--line); }
.spot-label { display: flex; gap: 10px; align-items: center; color: var(--accent); }
.spot-name { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.6rem, 1.6rem + 3vw, 4.4rem); line-height: 0.95; letter-spacing: -0.02em; margin: 0; }
.spot-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); }
.spot-score { display: flex; align-items: baseline; gap: 14px; margin-top: auto; }
.spot-score b { font-family: var(--f-display); font-weight: 400; font-size: 5rem; line-height: 0.9; font-variant-numeric: tabular-nums; }
.spot-score span { color: var(--text-2); max-width: 24ch; }
.spot-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.spot-chart { padding: 24px; display: grid; place-items: center; background: var(--surface-2); min-height: 360px; }
.spot-chart .chart-box { width: 100%; max-width: 440px; height: 340px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--f-mono); font-size: 0.72rem; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; }
.tag.new { border-color: var(--accent); color: var(--accent); }
.tag.free { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- CARDS ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.card {
  position: relative; background: var(--surface); padding: 22px; display: flex; flex-direction: column; gap: 14px;
  cursor: pointer; text-align: left; border: 0; min-height: 250px; overflow: hidden;
  transition: background 0.3s;
  opacity: 0; transform: translateY(16px);
  animation: card-in 0.7s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 50ms);
}
@keyframes card-in { to { opacity: 1; transform: none; } }
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
}
.card:hover { background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card:hover .card-arrow { transform: translate(3px, -3px); color: var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.card-rank { font-family: var(--f-mono); font-size: 0.78rem; color: var(--muted); }
.card-arrow { transition: transform 0.3s var(--ease), color 0.2s; color: var(--muted); }
.card h3 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.card-org { color: var(--muted); font-size: 0.85rem; }
.card-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.card-score b { font-family: var(--f-display); font-weight: 400; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.card-best { font-size: 0.82rem; color: var(--text-2); text-align: right; }
.card-best strong { display: block; color: var(--text); font-weight: 500; }
.mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; height: 40px; }
.mini i { display: block; border-radius: 3px 3px 0 0; background: var(--track); position: relative; overflow: hidden; }
.mini i::after { content: ''; position: absolute; inset: auto 0 0 0; height: calc(var(--v) * 100%); background: var(--text-2); opacity: 0.55; border-radius: 3px 3px 0 0; transform-origin: bottom; animation: grow 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + 200ms); }
.mini i.top::after { background: var(--accent); opacity: 1; }
@keyframes grow { from { transform: scaleY(0); } }
.mini-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-family: var(--f-mono); font-size: 0.62rem; color: var(--muted); text-align: center; margin-top: -8px; }
.card.is-hidden { display: none; }

/* ---------- LIVE FREE ---------- */
.live { margin-top: 48px; border-top: 1px solid var(--line-strong); padding-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; }
.live-head h3 .dot { height: 8px; align-self: center; }
.live-head h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-family: var(--f-display); font-weight: 400; font-size: 2rem; line-height: 1.1; }
.live-head p { margin: 0; font-size: 0.92rem; }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.live-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.live-list li > span { min-width: 0; }
.live-name { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-id { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-list .btn { height: 30px; padding: 0 12px; font-size: 0.8rem; }

/* ---------- LEADERBOARD ---------- */
.lb-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--track); flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--text-2); font-size: 0.9rem; transition: color 0.2s, background 0.25s var(--ease); }
.tab:hover { color: var(--text); }
.tab.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); font-size: 0.9rem; }
.toggle input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; flex: none; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform 0.3s var(--ease); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); }

.lb { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.lb-row {
  display: grid; grid-template-columns: 48px minmax(0, 1.3fr) minmax(0, 2fr) 70px; gap: 8px 20px; align-items: center;
  padding: 14px 8px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
  transition: background 0.2s;
}
.lb-row:hover { background: var(--track); }
.lb-row:hover .lb-name { color: var(--accent); }
.lb-pos { font-family: var(--f-display); font-size: 1.7rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row:nth-child(-n+3) .lb-pos { color: var(--text); }
.lb-name { font-weight: 500; transition: color 0.2s; }
.lb-sub { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.8rem; flex-wrap: wrap; }
.lb-bar { height: 10px; margin: 0; }
.lb-bar > i { transition-duration: 0.9s; }
.lb-val { font-family: var(--f-mono); text-align: right; font-size: 1rem; font-variant-numeric: tabular-nums; }

/* ---------- COMPARE ---------- */
.cmp { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; }
.cmp-pick { display: flex; flex-direction: column; gap: 14px; }
.slot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 14px 14px 18px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.slot::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--c); }
.slot label { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; flex: none; }
select { width: 100%; height: 40px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: var(--surface-2); padding: 0 10px; cursor: pointer; }
.cmp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px; box-shadow: var(--shadow); }
.cmp-chart { display: flex; flex-direction: column; gap: 10px; }
.chart-box { position: relative; height: 380px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.cmp-table-wrap { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cmp-table th, .cmp-table td { padding: 11px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; color: var(--text-2); }
.cmp-table thead th { font-weight: 500; font-size: 0.8rem; color: var(--muted); vertical-align: bottom; }
.cmp-table thead th span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-table td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--text-2); }
.cmp-table td.win { color: var(--text); font-weight: 500; }
.cmp-table td.win::before { content: '▲ '; color: var(--accent); font-size: 0.7em; }
.cmp-table tr.total td { border-bottom: 0; padding-top: 16px; font-size: 1.05rem; }
.cmp-verdict { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-m); background: var(--accent-soft); color: var(--text); font-size: 0.92rem; }

/* ---------- PLAYGROUND ---------- */
.pg { display: grid; grid-template-columns: 320px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); min-height: 620px; }
.pg-side { border-right: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 18px; background: var(--surface-2); }
.tabs.vertical { flex-direction: column; border-radius: var(--r-m); padding: 4px; }
.tabs.vertical .tab { text-align: left; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.tabs.vertical .tab b { font-weight: 500; color: var(--text); }
.tabs.vertical .tab small { font-size: 0.76rem; color: var(--muted); }
.pg-config { display: flex; flex-direction: column; gap: 12px; font-size: 0.9rem; }
.pg-config label { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 0.82rem; }
.pg-config input[type="password"], .pg-config input[type="text"] { height: 40px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: var(--surface); padding: 0 10px; min-width: 0; }
.pg-config label.toggle { flex-direction: row; font-size: 0.85rem; }
.pg-config .hint { color: var(--muted); font-size: 0.8rem; line-height: 1.5; margin: 0; }
.pg-config .hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.pg-status { color: var(--text-2); font-size: 0.78rem; line-height: 1.5; padding: 10px 12px; border-radius: var(--r-s); border: 1px dashed var(--line-strong); }
.pg-status.ok { border-style: solid; border-color: var(--accent); color: var(--text); }
.pg-status.err { border-style: solid; border-color: var(--series-2); }
.progress { height: 4px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.3s; }

.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 18px; max-height: 560px; }
.chat-empty { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 560px; }
.suggest button { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 8px 14px; cursor: pointer; color: var(--text-2); font-size: 0.86rem; transition: all 0.2s; }
.suggest button:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 16px; line-height: 1.6; animation: msg-in 0.45s var(--ease); overflow-wrap: anywhere; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg.user { align-self: flex-end; background: var(--text); color: var(--bg); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.bot.err { border-color: var(--series-2); }
.msg-meta { display: block; font-family: var(--f-mono); font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
.msg pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; margin: 8px 0; }
.msg pre code { background: none; padding: 0; }
.caret::after { content: ''; display: inline-block; width: 7px; height: 1.05em; vertical-align: -0.15em; margin-left: 2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-form { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; min-width: 0; resize: none; min-height: 46px; max-height: 180px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface-2); padding: 12px 14px; line-height: 1.45; }
.chat-form textarea:focus { outline: none; border-color: var(--accent); }

/* modes, notices, own key, preview */
.modes { display: flex; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.mode { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); cursor: pointer; font-size: 0.875rem; transition: all 0.25s var(--ease); }
.mode:hover { color: var(--text); border-color: var(--text-2); }
.mode.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg.notice { border-color: var(--accent); background: var(--accent-soft); max-width: 92%; }
.msg.notice a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.own-key { border: 1px solid var(--line-strong); border-radius: var(--r-m); padding: 10px 12px; background: var(--surface); }
.own-key[open] { display: flex; flex-direction: column; gap: 10px; }
.own-key summary { cursor: pointer; font-weight: 500; font-size: 0.86rem; display: flex; align-items: center; gap: 8px; list-style: none; }
.own-key summary::-webkit-details-marker { display: none; }
.own-key summary::before { content: '+'; font-family: var(--f-mono); color: var(--accent); }
.own-key[open] summary::before { content: '−'; }
.preview { width: min(1100px, 100vw - 32px); height: min(820px, 100dvh - 32px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-l); background: var(--surface); color: var(--text); overflow: hidden; }
.preview[open] { display: flex; flex-direction: column; animation: pop 0.45s var(--ease); }
.preview.is-full { width: 100vw; height: 100dvh; border-radius: 0; }
.preview::backdrop { background: rgba(10, 10, 8, 0.55); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(10px); } }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.preview-bar b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.preview-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.preview iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- METHOD / FOOTER ---------- */
.method { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.method > div { background: var(--bg); padding: 28px; }
.method h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.8rem; margin: 0 0 10px; }
.method p { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.foot { border-top: 1px solid var(--line); padding: 32px 0; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 0.88rem; }

/* ---------- DRAWER ---------- */
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw; border: 0; padding: 0; background: var(--surface); color: var(--text); border-left: 1px solid var(--line); }
.drawer[open] { animation: drawer-in 0.5s var(--ease); }
.drawer::backdrop { background: rgba(10, 10, 8, 0.45); backdrop-filter: blur(4px); animation: fade 0.3s; }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
.drawer-inner { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.drawer-close { align-self: flex-end; }
.drawer h2 { font-family: var(--f-display); font-weight: 400; font-size: 3rem; line-height: 1; margin: 0; letter-spacing: -0.02em; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; margin: 0; }
.facts div { background: var(--surface); padding: 12px 14px; }
.facts dt { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cat-list li { display: grid; grid-template-columns: 110px 1fr 36px; gap: 12px; align-items: center; font-size: 0.9rem; }
.cat-list .bar { margin: 0; height: 8px; }
.cat-list b { font-family: var(--f-mono); font-weight: 400; text-align: right; }
.run-box { border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.run-box pre { margin: 0; font-family: var(--f-mono); font-size: 0.85rem; background: var(--bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1180px) {
  .cmp-body { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cmp { grid-template-columns: 1fr; }
  .cmp-pick { display: grid; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero-inner, .spot, .cmp-body, .pg { grid-template-columns: 1fr; }
  .spot-copy { border-right: 0; border-bottom: 1px solid var(--line); }
  .pg-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .sec-head { grid-template-columns: 1fr; gap: 10px; }
  .sec-num { padding-top: 0; }
  .sec-head p { justify-self: start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .method, .live, .live-list { grid-template-columns: 1fr; }
  .lb-row { grid-template-columns: 36px minmax(0, 1fr) 56px; }
  .lb-row .lb-bar { grid-column: 2 / 4; grid-row: 2; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .cmp-pick { grid-template-columns: 1fr; }
  .chip { display: none; }
  .msg { max-width: 92%; }
  .chat-log { padding: 18px; }
  .spot-score b { font-size: 4rem; }
  .cmp-body { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal, .card { opacity: 1; transform: none; }
  .hero h1 .w > span { transform: none; }
}

.msg-note{margin:.5rem 0 0;font-size:.85rem;color:var(--muted, #888)}
