:root, [data-theme="light"] {
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #eef0f6; --border: #dde1ea;
  --text: #161a23; --muted: #5f6878; --accent: #3b5bdb; --accent-2: #0ca678; --accent-ink: #fff;
  --warn: #e8590c; --danger: #e03131; --shadow: 0 1px 2px rgba(20,25,40,.06), 0 6px 20px rgba(20,25,40,.06);
  --c1:#3b5bdb; --c2:#0ca678; --c3:#e8590c; --c4:#ae3ec9; --c5:#1098ad; --c6:#f59f00; --c7:#d6336c; --c8:#5c940d;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1218; --surface: #171b24; --surface-2: #1f2430; --border: #2b3140;
  --text: #e8ebf2; --muted: #98a1b3; --accent: #748ffc; --accent-2: #38d9a9; --accent-ink: #0f1218;
  --warn: #ffa94d; --danger: #ff6b6b; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  --c1:#748ffc; --c2:#38d9a9; --c3:#ffa94d; --c4:#da77f2; --c5:#3bc9db; --c6:#ffd43b; --c7:#f783ac; --c8:#94d82d;
  color-scheme: dark;
}
[data-theme="midnight"] {
  --bg: #070b1a; --surface: #0e1430; --surface-2: #151d42; --border: #233064;
  --text: #e6eaff; --muted: #8f9bd0; --accent: #7c8cff; --accent-2: #4dd4ff; --accent-ink: #070b1a;
  --warn: #ffb86b; --danger: #ff6b8b; --shadow: 0 8px 30px rgba(0,0,30,.5);
  --c1:#7c8cff; --c2:#4dd4ff; --c3:#ffb86b; --c4:#c792ea; --c5:#80ffdb; --c6:#ffe66d; --c7:#ff6b8b; --c8:#a3e635;
  color-scheme: dark;
}
[data-theme="ocean"] {
  --bg: #eaf6fb; --surface: #ffffff; --surface-2: #d9eef7; --border: #b8dbea;
  --text: #0b2a3a; --muted: #4a6d7f; --accent: #0b7285; --accent-2: #1971c2; --accent-ink: #fff;
  --warn: #e67700; --danger: #c92a2a; --shadow: 0 6px 20px rgba(11,114,133,.12);
  --c1:#0b7285; --c2:#1971c2; --c3:#e67700; --c4:#6741d9; --c5:#2b8a3e; --c6:#f08c00; --c7:#c2255c; --c8:#15aabf;
  color-scheme: light;
}
[data-theme="forest"] {
  --bg: #0f1a14; --surface: #16241c; --surface-2: #1d3025; --border: #2a4334;
  --text: #e3f1e7; --muted: #93b39f; --accent: #69db7c; --accent-2: #ffd43b; --accent-ink: #0f1a14;
  --warn: #ffa94d; --danger: #ff8787; --shadow: 0 8px 24px rgba(0,0,0,.35);
  --c1:#69db7c; --c2:#ffd43b; --c3:#ffa94d; --c4:#63e6be; --c5:#a9e34b; --c6:#ff8787; --c7:#74c0fc; --c8:#e599f7;
  color-scheme: dark;
}
[data-theme="sunset"] {
  --bg: #fff4ec; --surface: #ffffff; --surface-2: #ffe8d6; --border: #f5ccae;
  --text: #3a1d10; --muted: #8a5a40; --accent: #e8590c; --accent-2: #c2255c; --accent-ink: #fff;
  --warn: #f08c00; --danger: #c92a2a; --shadow: 0 6px 20px rgba(232,89,12,.12);
  --c1:#e8590c; --c2:#c2255c; --c3:#f08c00; --c4:#862e9c; --c5:#d9480f; --c6:#5f3dc4; --c7:#2b8a3e; --c8:#1864ab;
  color-scheme: light;
}
[data-theme="rose"] {
  --bg: #fff0f5; --surface: #ffffff; --surface-2: #ffe0eb; --border: #f8c4d6;
  --text: #3b0f22; --muted: #8c4a64; --accent: #d6336c; --accent-2: #7048e8; --accent-ink: #fff;
  --warn: #e8590c; --danger: #c92a2a; --shadow: 0 6px 20px rgba(214,51,108,.12);
  --c1:#d6336c; --c2:#7048e8; --c3:#e8590c; --c4:#1c7ed6; --c5:#0ca678; --c6:#f59f00; --c7:#ae3ec9; --c8:#495057;
  color-scheme: light;
}
[data-theme="mono"] {
  --bg: #fafafa; --surface: #ffffff; --surface-2: #f0f0f0; --border: #d4d4d4;
  --text: #111; --muted: #666; --accent: #111; --accent-2: #555; --accent-ink: #fff;
  --warn: #444; --danger: #000; --shadow: none;
  --c1:#111; --c2:#555; --c3:#888; --c4:#333; --c5:#777; --c6:#aaa; --c7:#222; --c8:#999;
  color-scheme: light;
}
[data-theme="cyber"] {
  --bg: #0a0a0f; --surface: #12121c; --surface-2: #1b1b2a; --border: #2d2d48;
  --text: #f0f0ff; --muted: #a0a0c8; --accent: #ff2bd6; --accent-2: #00f0ff; --accent-ink: #0a0a0f;
  --warn: #ffe600; --danger: #ff3860; --shadow: 0 0 24px rgba(255,43,214,.15);
  --c1:#ff2bd6; --c2:#00f0ff; --c3:#ffe600; --c4:#7cff4f; --c5:#9d4dff; --c6:#ff8a00; --c7:#ff3860; --c8:#00ff9c;
  color-scheme: dark;
}
[data-theme="sand"] {
  --bg: #f7f1e6; --surface: #fffcf5; --surface-2: #efe5d2; --border: #dccdb0;
  --text: #2e2617; --muted: #7a6a4c; --accent: #8f5b1a; --accent-2: #3d7a5c; --accent-ink: #fff;
  --warn: #b35c00; --danger: #a61e1e; --shadow: 0 6px 20px rgba(110,80,30,.1);
  --c1:#8f5b1a; --c2:#3d7a5c; --c3:#b35c00; --c4:#5c4b8a; --c5:#2f6f8f; --c6:#c49a2c; --c7:#a3405a; --c8:#6b8e23;
  color-scheme: light;
}
[data-theme="nord"] {
  --bg: #2e3440; --surface: #3b4252; --surface-2: #434c5e; --border: #4c566a;
  --text: #eceff4; --muted: #c0c8d6; --accent: #88c0d0; --accent-2: #a3be8c; --accent-ink: #2e3440;
  --warn: #ebcb8b; --danger: #bf616a; --shadow: 0 8px 24px rgba(0,0,0,.25);
  --c1:#88c0d0; --c2:#a3be8c; --c3:#ebcb8b; --c4:#b48ead; --c5:#81a1c1; --c6:#d08770; --c7:#bf616a; --c8:#8fbcbb;
  color-scheme: dark;
}
[data-theme="contrast"] {
  --bg: #000; --surface: #000; --surface-2: #111; --border: #fff;
  --text: #fff; --muted: #e0e0e0; --accent: #ffd400; --accent-2: #00e5ff; --accent-ink: #000;
  --warn: #ff9100; --danger: #ff5252; --shadow: none;
  --c1:#ffd400; --c2:#00e5ff; --c3:#ff9100; --c4:#e040fb; --c5:#69f0ae; --c6:#fff; --c7:#ff5252; --c8:#448aff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
[dir="ltr"] body { font-family: "Inter", "Vazirmatn", system-ui, sans-serif; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.top-inner { max-width: 1400px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: .5px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; color: var(--accent-ink); font-size: 14px; font-weight: 900; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-inline-start: auto; }
.tab { border: 1px solid transparent; background: none; padding: 7px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.tools { display: flex; gap: 6px; align-items: center; }
.tools select, .tools button { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; cursor: pointer; }

main { max-width: 1400px; margin: 0 auto; padding: 18px 16px 60px; }
.panel[hidden] { display: none; }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }
.updated { color: var(--muted); font-size: 13px; margin: -6px 0 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); display: inline-block; }

/* filters */
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; box-shadow: var(--shadow); margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.filters input[type=search], .filters select, .filters input[type=number] {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; font-size: 14px; color: var(--text); width: 100%;
}
.filters .search { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }
.chip { border: 1px solid var(--border); background: var(--surface-2); padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* table */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: auto; box-shadow: var(--shadow); max-height: 70vh; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; cursor: pointer; user-select: none; font-size: 12.5px; }
thead th[data-sort]::after { content: " ↕"; color: var(--muted); font-size: 10px; }
thead th.asc::after { content: " ▲"; color: var(--accent); }
thead th.desc::after { content: " ▼"; color: var(--accent); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
td.name { white-space: normal; min-width: 220px; }
td.name b { display: block; }
td.name small { color: var(--muted); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-inline-end: 3px; border: 1px solid var(--border); }
.tag.open { background: color-mix(in srgb, var(--accent-2) 18%, transparent); border-color: transparent; }
.tag.api { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: transparent; }
.tag.free { background: color-mix(in srgb, var(--c6) 24%, transparent); border-color: transparent; }
.yes { color: var(--accent-2); font-weight: 800; }
.no { color: var(--muted); opacity: .6; }
.cmp-btn { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 3px 9px; cursor: pointer; font-size: 12px; }
.cmp-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.pager button { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }

/* compare tray */
.tray { position: fixed; bottom: 14px; inset-inline: 14px; max-width: 900px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; z-index: 30; }
.tray[hidden] { display: none; }
.tray .pill { background: var(--surface-2); border-radius: 999px; padding: 3px 10px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.tray .pill button { border: none; background: none; cursor: pointer; color: var(--muted); padding: 0; }
.btn { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 9px; padding: 7px 14px; cursor: pointer; font-weight: 700; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* compare */
.cmp-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.cmp-head input { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; min-width: 260px; flex: 1; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cmp-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 960px) { .cmp-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card p.sub { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
.cmp-table td, .cmp-table th { white-space: normal; vertical-align: top; }
.cmp-table th { position: static; cursor: default; }
.cmp-table td:first-child { color: var(--muted); font-weight: 600; width: 160px; }
.best { background: color-mix(in srgb, var(--accent-2) 16%, transparent); font-weight: 700; }
.verdict { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.verdict li { margin: 3px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.chart-box { position: relative; height: 340px; }
.chart-box.tall { height: 460px; }
.chart-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-controls select { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; }

/* hardware */
.hw-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.hw-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tier-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tier-legend div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; font-size: 13px; }
.tier-legend b { display: block; }
.fit-good { color: var(--accent-2); font-weight: 700; }
.fit-mid { color: var(--warn); font-weight: 700; }

/* detail dialog */
dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); max-width: 760px; width: calc(100% - 32px); padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dlg-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-body { padding: 14px 18px 18px; max-height: 70vh; overflow: auto; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.kv div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.kv span { display: block; color: var(--muted); font-size: 11.5px; }
.close-x { border: none; background: var(--surface-2); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 18px; }

.news li { margin: 4px 0; }
.method p, .method li { color: var(--muted); }
.method h3 { margin-top: 20px; }
footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 20px 16px 90px; }

@media (max-width: 720px) {
  .tabs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0; }
  .tab { white-space: nowrap; }
  .tools { margin-inline-start: auto; }
  .chart-box { height: 300px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- motion layer ---------- */
body { position: relative; overflow-x: hidden; }
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: .22; animation: drift 26s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: var(--accent); top: -25vmax; inset-inline-start: -15vmax; }
.aurora i:nth-child(2) { background: var(--accent-2); bottom: -30vmax; inset-inline-end: -20vmax; animation-duration: 32s; animation-delay: -8s; }
.aurora i:nth-child(3) { background: var(--c4); top: 30%; inset-inline-start: 35%; width: 35vmax; height: 35vmax; opacity: .12; animation-duration: 38s; animation-delay: -16s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.12); } 100% { transform: translate(-6vw, 10vh) scale(.95); } }
.grid-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 65%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 65%); }
[data-theme="mono"] .aurora, [data-theme="contrast"] .aurora { display: none; }

.hero { text-align: center; padding: 46px 0 30px; }
.hero .badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; padding: 5px 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); }
.hero .badge .dot { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.hero h1 { font-size: clamp(32px, 6.4vw, 72px); line-height: 1.12; margin: 18px 0 14px; font-weight: 900; letter-spacing: -.5px; }
[dir="ltr"] .hero h1 { letter-spacing: -2px; text-transform: uppercase; }
.glow { background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 35%, var(--c4) 65%, var(--accent) 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 7s linear infinite; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 45%, transparent)); }
@keyframes flow { to { background-position: -250% 0; } }
.hero p { max-width: 640px; margin: 0 auto 22px; color: var(--muted); font-size: 16.5px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn { padding: 11px 22px; border-radius: 999px; font-size: 15px; }
.btn { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.shine { position: relative; overflow: hidden; }
.btn.shine::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }

.marquee { margin: 34px auto 0; overflow: hidden; max-width: 1100px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); direction: ltr; }
.marquee-track { display: flex; gap: 10px; width: max-content; animation: scroll-x 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.marquee-track span b { color: var(--text); margin-inline-end: 6px; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { --d: .08s; } .hero .reveal:nth-child(3) { --d: .16s; } .hero .reveal:nth-child(4) { --d: .24s; } .hero .reveal:nth-child(5) { --d: .32s; }

/* cards & panels */
.card, .stat, .filters, .table-wrap { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(8px); }
.card, .stat { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s; }
.card:hover, .stat:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 18%, transparent); }
.stat b { background: linear-gradient(90deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel:not([hidden]) { animation: rise .55s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
tbody tr { animation: row-in .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 14ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tab { transition: background .25s, color .25s, transform .2s; }
.tab:active, .chip:active, .cmp-btn:active { transform: scale(.96); }
.chip, .cmp-btn { transition: background .2s, color .2s, border-color .2s, transform .15s; }
.logo { position: relative; overflow: hidden; }
.logo::after { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.5), transparent 30%); animation: spin 4s linear infinite; mix-blend-mode: overlay; }
@keyframes spin { to { transform: rotate(360deg); } }
.tray { animation: rise .4s cubic-bezier(.2,.8,.2,1); }
dialog[open] { animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .aurora i, .glow, .marquee-track, .btn.shine::after, .logo::after, .hero .badge .dot { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  tbody tr, .panel:not([hidden]), dialog[open], .tray { animation: none !important; }
}
@media (max-width: 720px) { .hero { padding: 26px 0 18px; } .hero p { font-size: 15px; } }

/* ===== context window, model map, stock market ===== */
button.stat { font: inherit; color: inherit; text-align: start; cursor: pointer; }
.stat.hot { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--accent-2) 16%, var(--surface))); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); position: relative; overflow: hidden; }
.stat.hot b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat.hot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.18) 50%, transparent 65%); transform: translateX(-100%); animation: sheen 3.8s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.up { color: #2fb36d !important; } .down { color: #e5484d !important; }
.muted { color: var(--muted); font-size: 12px; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 14px; line-height: 1.8; }
.card h2 { margin: 0 0 4px; font-size: 20px; }
.map-card:hover, .ctx-card:hover, .mk-head:hover { transform: none; }

.ctxbar { display: inline-block; width: 46px; height: 6px; border-radius: 99px; background: var(--surface-2); vertical-align: middle; margin-inline-end: 6px; overflow: hidden; }
.ctxbar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.ctx-cell { white-space: nowrap; }
.cmp-table .ctx-cell + small { display: block; color: var(--muted); font-size: 11px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.kpi b { font-size: 22px; line-height: 1.2; }
.kpi span { font-size: 12.5px; font-weight: 600; }
.kpi small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-card .kpi:first-child b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ctx-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.ctx-grid h3 { margin: 4px 0; }

.race { display: grid; gap: 4px; }
.race-row, .gain-row { display: grid; grid-template-columns: 26px minmax(110px, 1.1fr) 2fr 86px; gap: 10px; align-items: center; background: none; border: 0; padding: 5px 6px; border-radius: 9px; cursor: pointer; color: inherit; font: inherit; text-align: start;
  opacity: 0; transform: translateY(8px); transition: opacity .5s ease calc(var(--i) * 40ms), transform .5s ease calc(var(--i) * 40ms), background .2s; }
.gain-row { grid-template-columns: minmax(120px, 1.1fr) 2fr 120px; }
.race-row.go, .gain-row.go { opacity: 1; transform: none; }
.race-row:hover, .gain-row:hover { background: var(--surface-2); }
.rank { color: var(--muted); font-size: 12px; text-align: center; }
.race-name { min-width: 0; display: grid; }
.race-name b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-name small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-bars { display: grid; gap: 3px; }
.race-bars i, .gain-bar i { display: block; height: 12px; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 1.1s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 45ms + 120ms); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 35%, transparent); }
.race-bars i.b2 { height: 4px; background: var(--c3); box-shadow: none; opacity: .85; }
.go .race-bars i, .go .gain-bar i, .gain-bar i.go { width: var(--w); }
.race-val { text-align: end; font-weight: 700; font-size: 14px; display: grid; }
.race-val small { color: var(--muted); font-weight: 500; font-size: 11px; }
.gain-bar { display: block; }
.gain-bar.down i { background: linear-gradient(90deg, #ff8a8f, #e5484d); box-shadow: 0 0 12px rgba(229,72,77,.3); }
.gain-bar.up i { background: linear-gradient(90deg, #6ee7a8, #2fb36d); box-shadow: 0 0 12px rgba(47,179,109,.3); }
.gain-cell { display: flex; gap: 8px; align-items: center; min-width: 170px; }
.gain-cell .gain-bar { flex: 1; } .gain-cell .gain-bar i { height: 8px; }

.hist { height: 300px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; padding-top: 10px; }
.hist .col { height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 4px; text-align: center; }
.hist .col span { font-weight: 700; font-size: 13px; opacity: 0; transition: opacity .4s calc(var(--i) * 90ms + 500ms); }
.hist .col i { align-self: end; height: 0; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent-2) 70%, transparent)); transition: height 1s cubic-bezier(.2,.8,.2,1) calc(var(--i) * 90ms); }
.hist .col.go i { height: var(--h); } .hist .col.go span { opacity: 1; }
.hist .col small { color: var(--muted); font-size: 10.5px; }

.map-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.map-ctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.map-ctl label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.map-ctl select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 6px 8px; color: var(--text); }
.tmap { position: relative; height: 620px; direction: ltr; border-radius: 12px; overflow: hidden; background: var(--bg); }
.tmap.mk { height: 460px; }
.tm-group, .tm-tile { position: absolute; transition: left .8s cubic-bezier(.2,.8,.2,1), top .8s cubic-bezier(.2,.8,.2,1), width .8s cubic-bezier(.2,.8,.2,1), height .8s cubic-bezier(.2,.8,.2,1), opacity .6s, background-color .6s; transition-delay: var(--d, 0ms); }
.tm-group { border: 1px solid var(--border); border-radius: 6px; }
.tm-group > span { position: absolute; top: 1px; inset-inline: 6px; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-tile { border-radius: 3px; overflow: hidden; cursor: pointer; padding: 2px 4px; color: var(--text); font-size: 10px; line-height: 1.25; display: flex; flex-direction: column; justify-content: center; text-shadow: 0 1px 2px color-mix(in srgb, var(--bg) 70%, transparent); }
.tm-tile b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.tm-tile.big b { font-size: 12px; } .tm-tile small { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
.tmap.mk .tm-tile { align-items: center; text-align: center; } .tmap.mk .tm-tile.big b { font-size: clamp(12px, 1.6vw, 22px); }
.tm-tile:hover { outline: 2px solid var(--text); outline-offset: -2px; z-index: 2; filter: brightness(1.15); }
.tm-tip { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; max-width: 300px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; display: grid; gap: 2px; }
.tm-tip[hidden] { display: none; }
.tm-tip > b { font-size: 13px; }
.map-legend { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.map-legend > i { width: 180px; height: 8px; border-radius: 99px; display: block; }
.map-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 4px; vertical-align: middle; }

.tape { margin: 0 0 14px; max-width: none; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 8px 0; }
.tape em { font-style: normal; font-weight: 700; margin-inline-start: 4px; }
.mk-head .chips { margin-top: 8px; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 14px 0; }
.co { display: grid; gap: 10px; align-content: start; opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .6s ease calc(var(--i) * 50ms), transform .6s cubic-bezier(.2,.8,.2,1) calc(var(--i) * 50ms), box-shadow .25s, border-color .25s; scroll-margin: 90px; }
.co.go { opacity: 1; transform: none; }
.co.go:hover { transform: translateY(-4px); transition-delay: 0s; }
.co header { display: flex; gap: 10px; align-items: center; }
.co header h3 { margin: 0; font-size: 15px; }
.co header small { color: var(--muted); font-size: 11.5px; }
.co-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; font-size: 13px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); flex: none; }
.co-price { margin-inline-start: auto; text-align: end; display: grid; }
.co-price b { font-size: 17px; } .co-price b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.co-price em { font-style: normal; font-weight: 700; font-size: 13px; }
.spark { width: 100%; height: 60px; display: block; }
.spark .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.spark .area { opacity: 0; transition: opacity .8s .9s; }
.co.go .spark .line { animation: draw 1.6s cubic-bezier(.4,0,.2,1) forwards; animation-delay: calc(var(--i) * 50ms + 200ms); }
.co.go .spark .area { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.co-rets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.co-rets span { background: var(--surface-2); border-radius: 9px; padding: 5px 6px; display: grid; text-align: center; }
.co-rets small { color: var(--muted); font-size: 10.5px; } .co-rets b { font-size: 13px; }
.co-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.co-meta b { color: var(--text); }
.range52 { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); direction: ltr; }
.range52 > span { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #e5484d, #f5a524, #2fb36d); position: relative; opacity: .85; }
.range52 > span i { position: absolute; top: 50%; left: var(--p); width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 2px solid var(--surface); transform: translate(-50%, -50%); }
.range52 em { grid-column: 1 / -1; font-style: normal; text-align: center; margin-top: -4px; }
.co-models { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px dashed var(--border); padding-top: 8px; }
.co-models small { width: 100%; color: var(--muted); font-size: 11.5px; }
.co-models a { font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 3px 9px; text-decoration: none; }
.co-models a span { color: var(--muted); font-size: 11px; }
#mkPrivate .chip b { color: var(--text); }

@media (max-width: 860px) {
  .ctx-grid { grid-template-columns: 1fr; }
  .hist { height: 200px; }
  .tmap { height: 520px; } .tmap.mk { height: 360px; }
  .race-row { grid-template-columns: 22px minmax(90px, 1fr) 1.2fr 70px; gap: 6px; }
  .gain-row { grid-template-columns: minmax(90px, 1fr) 1fr 96px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .race-row, .gain-row, .co, .tm-group, .tm-tile, .race-bars i, .gain-bar i, .hist .col i, .hist .col span { transition: none !important; }
  .stat.hot::after { animation: none; }
  .spark .line { stroke-dashoffset: 0; animation: none !important; }
}

/* ---------- tokens tab ---------- */
.tab.hot { position: relative; }
.tab.hot::after { content: ""; position: absolute; inset-inline-end: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: tkPing 2.2s infinite; }
@keyframes tkPing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.tk-q, .hw-q input { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
.tk-q { margin-top: 10px; font-size: 15px; }
.hw-q { grid-column: 1 / -1; }
.tk-q:focus, .hw-q input:focus, .tk-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tk-text { width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; resize: vertical; }
.small { font-size: 12.5px; }
.tk-row { cursor: default; }
.tk-sample { margin-top: 10px; }
.tk-sample summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.tk-sample p { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; line-height: 1.8; }
.tk-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; align-items: end; }
.tk-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.tk-form input[type="number"], .tk-form select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
.tk-form input[type="range"] { accent-color: var(--accent); }
.tk-check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; padding-bottom: 8px; }
.tk-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.tk-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.s-in { background: var(--c1); } .s-cache { background: var(--c2); } .s-out { background: var(--c3); } .s-think { background: var(--c4); }
.tk-table { max-height: 620px; overflow: auto; }
.tk-table td.small { font-size: 12px; color: var(--muted); }
.stack { display: flex; width: 100%; min-width: 120px; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; cursor: help; }
.stack i { display: block; height: 100%; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 25ms); }
#tkCalcBody tr { --i: 0; }
#tkCalcBody.go .stack i { width: var(--w); }
#tkCalcBody tr .stack i { transition-delay: calc(var(--i) * 25ms); }
tr.dim td { opacity: .55; }
.flags { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 3px; }
.tag.warn { background: color-mix(in srgb, var(--danger) 20%, transparent); border-color: transparent; }
small.good { color: var(--accent-2); font-weight: 700; }
small.bad { color: var(--danger); font-weight: 700; }
.eff { display: inline-block; padding: 1px 6px; margin: 1px 2px; border-radius: 6px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.eff.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tk-calc th.wide { min-width: 140px; }
h4 { margin: 4px 0 6px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) { .tk-form { grid-template-columns: 1fr 1fr; } .tk-table { max-height: 520px; } }
@media (prefers-reduced-motion: reduce) { .tab.hot::after { animation: none; } .stack i { transition: none; } }

/* ---- tokens tab: usage by kind of generation ---- */
.md-cats { flex-wrap: wrap; }
.md-chip small { opacity: .7; margin-inline-start: 4px; font-size: 11px; }
.md-how { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface-2)), var(--surface-2)); border: 1px solid var(--border); animation: mdIn .45s ease both; }
.md-how b { display: block; margin-bottom: 4px; }
.md-how p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--text); }
.md-off { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.md-off-i { display: grid; gap: 2px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); text-decoration: none; color: inherit; min-width: 0; transition: transform .2s, border-color .2s; }
.md-off-i:hover { transform: translateY(-2px); border-color: var(--accent); }
.md-off-i b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-off-i small { color: var(--muted); font-size: 11px; }
.tk-media .flags[data-tipk] { cursor: help; }
@keyframes mdIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .md-how { animation: none; } .md-off-i { transition: none; } }
