/*
 * aia — site styles: theme tokens (12 themes) → layout → components → sections → mobile rules.
 * Later blocks refine earlier ones (look for the "/* ---------- name ---------- */" headings).
 * Fonts are self-hosted from /vendor/fonts (Vazirmatn, Inter — SIL OFL) so the site works without Google in Iran.
 * References: https://developer.mozilla.org/docs/Web/CSS/@font-face · https://developer.mozilla.org/docs/Web/CSS/@media/prefers-reduced-motion
 */
/* self-hosted fonts (Vazirmatn, Inter — SIL OFL 1.1); no requests to Google */
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/vendor/fonts/vazirmatn-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/vendor/fonts/vazirmatn-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/vendor/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
: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;
}

* { 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) 95%, 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: var(--r); 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: var(--r); cursor: pointer; color: var(--muted); font-weight: 600; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-current="page"], .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: var(--r); 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: var(--r-lg); 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: var(--r-lg); 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: var(--r); padding: 7px 10px; font-size: 14px; color: var(--text); width: 100%;
  /* every filter box the same size: fixed height, no inherited Persian line-height */
  height: 42px; line-height: 1.4; box-sizing: border-box; font-weight: 500;
}
.filters input[type=search] { height: 46px; font-size: 15px; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.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: var(--r-lg); 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: var(--r-sm); 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: var(--r-sm); 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: var(--r-lg); 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: var(--r); 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: var(--r); 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: var(--r-lg); 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: var(--r); 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: var(--r); padding: 6px 10px; }

/* hardware */
.hw-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; 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: var(--r); 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: var(--r-lg); 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: var(--r); 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: var(--r-sm); 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%); }

.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 */
html.anim .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); }
html.anim .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: 999px; 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; }
/* stat card: value, label, sub-line. A column so every part starts on the same side (right in RTL, even for an LTR
   number), cards in a row share one height and the sub-line sits at the bottom of each */
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.kpi b { font-size: 22px; line-height: 1.2; max-width: 100%; text-align: start; }
.kpi b.txt { font-size: 17px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* a name, not a number: one line */
.kpi span { font-size: 12.5px; font-weight: 600; max-width: 100%; }
.kpi small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; margin-top: auto; padding-top: 2px; }
.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: var(--r); 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: 999px; 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: var(--r); padding: 6px 8px; color: var(--text); }
.tmap { position: relative; height: 620px; direction: ltr; border-radius: var(--r); 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: var(--r-sm); }
.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: var(--r-xs); 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: var(--r); 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: 999px; display: block; }
.map-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: var(--r-xs); margin-inline-end: 4px; vertical-align: middle; }

.tape { margin: 0 0 14px; max-width: none; border: 1px solid var(--border); border-radius: var(--r); 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: var(--r); 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: var(--r); 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: 999px; 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: var(--r); 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: var(--r); 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: var(--r); 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: var(--r); 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: var(--r-xs); 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: var(--r-sm); 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: var(--r-sm); 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: var(--r); 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: var(--r); 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; } }

/* ---------- brand icons ---------- */
.vi { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-inline-end: 0.4em; flex: none; align-items: center; justify-content: center; font-style: normal; }
.vi svg { width: 100%; height: 100%; display: block; }
.vl { border-radius: var(--r-sm); background: hsl(var(--h) 55% 45%); color: #fff; font-size: 0.68em; font-weight: 800; line-height: 1; }
.ve { font-size: 0.95em; }
.co-logo.has-ico { background: var(--surface-2); font-size: 20px; }
.co-logo.has-ico .vi { margin: 0; }
.race-name b, td.name b a { display: inline-flex; align-items: center; }
thead th[data-cs] { cursor: pointer; }
thead th[data-cs]:not(.asc):not(.desc)::after { content: " ↕"; color: var(--muted); font-size: 10px; }
thead th[data-cs]:hover { color: var(--accent); }
td.gpu b { font-weight: 700; }

/* ---------- tokens tab: simple guide + numbered sections ---------- */
#p-tokens { counter-reset: tkstep; }
.tk-guide { margin: 14px 0; padding: 14px 16px; border-radius: var(--r-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent)); border: 1px solid var(--border); }
.tk-guide h3 { margin: 0 0 8px; }
.tk-guide ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.tk-guide li { line-height: 1.7; }
.tkg-ask { margin: 12px 0 6px; font-weight: 700; }
.tk-step { counter-increment: tkstep; scroll-margin-top: 90px; }
.tk-step > h3::before { content: counter(tkstep, persian) ". "; color: var(--accent); }
:lang(en) .tk-step > h3::before, [dir="ltr"] .tk-step > h3::before { content: counter(tkstep) ". "; }
.tk-sub { margin-top: -6px; border-top-left-radius: 0; border-top-right-radius: 0; }

/* ---------- connect tab ---------- */
.cx-form { align-items: end; }
.cx-host { min-width: min(100%, 420px); flex: 1; }
.cx-hostinfo { margin: 8px 0 0; color: var(--muted); }
.road-chips .chip { font-size: 14px; padding: 8px 14px; }
.cx-road-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 6px; }
.cx-road-top h3 { margin: 0; }
.rsteps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; position: relative; }
.rstep { display: grid; grid-template-columns: 40px 1fr; gap: 12px; animation: mdIn 0.5s both; animation-delay: calc(var(--i) * 60ms); }
.rs-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink, #fff); font-weight: 800; position: relative; }
.rs-b { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.rs-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rs-h h4 { margin: 0; font-size: 15px; }
.rs-cost { color: var(--accent); white-space: nowrap; }
.rs-b .sub { margin: 4px 0 8px; }
.rs-pick { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; padding: 4px 0; }
.rs-pick.alt { opacity: 0.72; font-size: 13px; }
.rs-pick a { color: var(--text); font-weight: 600; }
.rs-pick .num { margin-inline-start: auto; }
.rs-tools { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag.tool { cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; display: inline-flex; align-items: center; }
.tag.host { display: inline-flex; align-items: center; }
.rs-free { margin-top: 6px; color: var(--muted); }
.warn-note { border-inline-start: 3px solid #f59e0b; }
.cx-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cx-filter input { max-width: 280px; }
.cx-table td.adds { white-space: normal; min-width: 260px; max-width: 380px; }
.cx-table td.adds ul { margin: 0; padding-inline-start: 16px; font-size: 12.5px; line-height: 1.6; }
.cx-table td .flags { flex-wrap: wrap; max-width: 260px; }
tr.flash { animation: cxFlash 1.6s ease; }
@keyframes cxFlash { 0%, 40% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
@media (max-width: 640px) {
  .rstep { grid-template-columns: 30px 1fr; gap: 8px; }
  .rs-n { width: 28px; height: 28px; font-size: 13px; }
  .rs-pick .num { margin-inline-start: 0; width: 100%; }
  .cx-filter input { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .rstep, tr.flash { animation: none; } }
.kpi.kpi-sm b { font-size: 17px; line-height: 1.4; }
.tk-form > label { min-width: 0; }
.tk-form select, .tk-form input:not([type="checkbox"]) { max-width: 100%; min-width: 0; width: 100%; }
.cx-host select { text-overflow: ellipsis; }

/* ---------- page chrome: skip link, banner, language switch, summary, 404 ---------- */
a.tab { text-decoration: none; display: inline-block; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 44px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font-weight: 600; text-align: center; position: relative; }
.banner .close-x { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; font-size: 22px; cursor: pointer; }
.lang-switch { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 7px 10px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 700; text-decoration: none; }
.lang-switch:hover { border-color: var(--accent); }
.hero .hero-title { font-size: clamp(32px, 6.4vw, 72px); line-height: 1.12; margin: 18px 0 14px; font-weight: 900; letter-spacing: -.5px; }
[dir="ltr"] .hero .hero-title { letter-spacing: -2px; text-transform: uppercase; }
.seo-sum { margin-top: 28px; }
.seo-sum h1, .seo-sum h2 { font-size: 20px; margin: 0 0 8px; }
.seo-sum h3 { font-size: 16px; margin: 18px 0 8px; }
.seo-sum p { color: var(--muted); line-height: 1.8; }
.seo-sum .table-wrap { max-height: 420px; }
.seo-sum th[scope="row"] { font-weight: 600; }
.seo-list { columns: 2 260px; padding-inline-start: 18px; line-height: 1.9; margin: 0; }
.seo-sum ol { line-height: 1.8; padding-inline-start: 20px; }
#foot .foot-links { font-size: 13px; color: var(--muted); }
#foot .foot-links a { color: var(--text); }
/* footer credit: one quiet line, the domain a little stronger */
#foot .foot-powered { margin: 10px 0 0; }
.powered { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; letter-spacing: .01em; color: var(--muted); opacity: .85; }
.powered a { color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 1px dotted color-mix(in srgb, var(--muted) 55%, transparent); transition: color .15s, border-color .15s; }
.powered a:hover, .powered a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }
.mp-foot .powered { margin-top: 8px; }
.nf .powered, .legal-page .powered { font-size: 12px; }
body.loading main { cursor: progress; }
body.loading .panel:not([hidden]) { opacity: .55; transition: opacity .2s; }
.nf { max-width: 640px; margin: 18vh auto; text-align: center; padding: 0 16px; }
.nf h1 { font-size: 96px; margin: 0; }
.banner[hidden] { display: none; }

/* ---------- logos: easier to see, especially on phones ---------- */
.vi { width: 1.3em; height: 1.3em; vertical-align: -0.28em; }
td.name .vi, .race-name .vi, .rs-pick .vi { width: 20px; height: 20px; }
.marquee-track span .vi { width: 16px; height: 16px; vertical-align: -3px; }
.marquee-track span b { margin-inline-start: 0; }

/* ---------- phones and tablets: drop the effects that make scrolling stutter ---------- */
@media (max-width: 760px), (pointer: coarse) {
  .aurora { display: none; }
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .card, .stat, .filters, .table-wrap, .tm-tip { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .glow { animation: none; filter: none; }
  .btn.shine::after, .logo::after, .stat.hot::after { display: none; }
  .marquee-track { animation-duration: 90s; }
  tbody tr { animation: none; }
  .panel:not([hidden]) { animation: none; }
  html.anim .reveal { transform: none; transition-duration: .35s; }
}

/* ---------- roadmaps v2: fields → goal cards → compact steps (phone-first) ---------- */
.field-chips { margin: 12px 0 10px; }
.road-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.road-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: start; padding: 12px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s, transform .2s; }
.road-card:hover { border-color: var(--accent); }
.road-card[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); box-shadow: 0 0 0 1px var(--accent) inset; }
.road-card .rc-emo { grid-row: span 2; font-size: 26px; line-height: 1; }
.road-card b { font-size: 14px; line-height: 1.5; }
.road-card small { color: var(--muted); font-size: 12px; }
.cx-road-top h3 { margin: 0; } .cx-road-top .sub { margin: 2px 0 0; }
.rstep { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; }
.rs-h { display: flex; align-items: center; gap: 10px; }
.rs-h h4 { flex: 1; margin: 0; font-size: 15px; line-height: 1.5; }
.rs-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink, #fff); font-weight: 800; font-size: 13px; }
.rs-cost { flex: none; }
.rs-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-top: 1px dashed var(--border); }
.rs-pick:first-of-type { border-top: 0; }
.rs-name { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-weight: 600; }
.rs-name a { overflow-wrap: anywhere; }
.rs-price { margin-inline-start: auto; font-size: 13px; }
.rs-pick .num { margin-inline-start: auto; }
.rs-alts { margin-top: 2px; border: 0; padding: 0; }
.rs-alts summary { cursor: pointer; color: var(--accent); font-size: 13px; padding: 4px 0; list-style: none; }
.rs-alts summary::before { content: "▸ "; } .rs-alts[open] summary::before { content: "▾ "; }
[dir="rtl"] .rs-alts summary::before { content: "◂ "; } [dir="rtl"] .rs-alts[open] summary::before { content: "▾ "; }
.rs-alts .rs-pick.alt { opacity: .8; font-size: 13px; }
@media (max-width: 640px) {
  .field-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-inline: -4px; }
  .field-chips::-webkit-scrollbar { display: none; }
  .field-chips .chip { flex: none; }
  .road-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .road-card { grid-template-columns: 1fr; padding: 10px; }
  .road-card .rc-emo { grid-row: auto; font-size: 22px; margin-bottom: 4px; }
  .road-card b { font-size: 13px; }
  .road-card small { display: none; }
  .rstep { padding: 10px 12px; }
  .rs-h h4 { font-size: 14px; }
  .rs-price { width: 100%; margin-inline-start: 0; color: var(--muted); }
  .rs-tools .tag { font-size: 11.5px; }
  #cxRoadKpis { grid-template-columns: 1fr 1fr; }
  .rstep { animation: none; }
}
.rstep .sub { margin: 6px 0 8px; }
/* compare tray: one slim scrollable row on phones so it doesn't cover the page */
@media (max-width: 640px) {
  .tray { flex-wrap: nowrap; overflow-x: auto; bottom: 8px; inset-inline: 8px; padding: 6px 8px; gap: 6px; scrollbar-width: none; }
  .tray::-webkit-scrollbar { display: none; }
  .tray > b { display: none; }
  .tray .pill { flex: none; font-size: 12px; padding: 2px 8px; }
  .tray .pill .vi { width: 14px; height: 14px; }
  .tray .btn { flex: none; margin-inline-start: 0 !important; padding: 6px 10px; font-size: 13px; position: sticky; inset-inline-end: 0; }
}

/* ---------- reference home: highlight boxes + ranking table ---------- */
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.hl { padding: 14px 16px; margin: 0; }
.hl-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hl-h h3 { margin: 0; font-size: 15px; }
.hl-more { font-size: 13px; color: var(--accent); text-decoration: none; }
.hl-list { list-style: none; margin: 0; padding: 0; }
.hl-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); min-width: 0; }
.hl-list li:first-child { border-top: 0; }
.hl-list a { display: inline-flex; align-items: center; min-width: 0; flex: 1; color: var(--text); text-decoration: none; }
.hl-list a b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-list small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hl-n { width: 18px; color: var(--muted); font-size: 12px; text-align: center; flex: none; }
.hl-list li.hl-news { padding: 4px 0; }
#p-explore .table-wrap { max-height: none; }
#tbl td.rank { color: var(--muted); font-size: 12.5px; width: 34px; text-align: center; }
#tbl td.price { font-weight: 600; }
#tbl td.caps { white-space: nowrap; }
#tbl .cap { display: inline-block; margin-inline-end: 4px; font-size: 15px; cursor: help; }
#tbl tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
#tbl .cmp-btn { min-width: 30px; padding: 3px 8px; }
.seo-sum .table-wrap { max-height: none; }
.seo-sum thead th { cursor: pointer; }
.seo-sum thead th:not(.asc):not(.desc)::after { content: " ↕"; color: var(--muted); font-size: 10px; }
.seo-news { line-height: 1.9; padding-inline-start: 20px; }

/* ---------- news ---------- */
.news-head { margin-bottom: 14px; }
.news-head h2 { margin: 0 0 4px; }
.news-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.news-list { display: grid; gap: 10px; }
.news-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration: none; text-align: left; transition: border-color .2s; }
.news-item:hover { border-color: var(--accent); }
.news-item .ni-logo { flex: none; font-size: 22px; line-height: 1; padding-top: 2px; }
.news-item .ni-logo .vi { margin: 0; width: 24px; height: 24px; }
.ni-body { display: grid; gap: 4px; min-width: 0; }
.ni-body b { font-size: 15px; line-height: 1.45; }
.ni-x { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.ni-body small { color: var(--muted); font-size: 12px; }
.ni-src { font-weight: 700; color: var(--text); }
.ni-src.official { color: var(--accent-2); }
.news-item.compact { padding: 0; border: 0; background: none; gap: 8px; }
.news-item.compact .ni-logo .vi { width: 18px; height: 18px; }
.news-item.compact .ni-body b { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-side .card { margin-bottom: 14px; }
.news-side h3 { font-size: 15px; margin: 0 0 6px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 7px 0; border-top: 1px solid var(--border); display: grid; gap: 2px; }
.side-list li:first-child { border-top: 0; }
.side-list a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.side-list a b { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.side-list small { color: var(--muted); font-size: 12px; }

/* ---------- roadmap layout: tidy grid ---------- */
.road-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.road-card { min-height: 76px; }
.cx-road-top { margin-top: 14px; }

@media (max-width: 900px) {
  .highlights { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .highlights { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; scrollbar-width: none; margin-inline: -4px; padding: 0 4px; }
  .highlights::-webkit-scrollbar { display: none; }
  .hl { flex: 0 0 86%; scroll-snap-align: start; }
  .road-grid { grid-template-columns: 1fr 1fr; }
  .news-item { padding: 10px 12px; }
  .ni-x { display: none; }
}

/* model chips inside summary tables; no inner scrollbars on data tables */
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mchip .vi { width: 16px; height: 16px; }
.seo-sum td { white-space: normal; }
.table-wrap { max-height: none; }

/* hero: four clear feature boxes instead of a long sentence */
.hero-feats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 880px; margin: 0 auto 22px; }
.hero-feat { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 14px 10px; border-radius: var(--r-lg); border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s, transform .2s; }
.hero-feat:hover { border-color: var(--accent); transform: translateY(-2px); }
.hero-feat .hf-i { font-size: 24px; line-height: 1.2; }
.hero-feat b { font-size: 14.5px; }
.hero-feat small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 640px) { .hero-feats { grid-template-columns: 1fr 1fr; gap: 8px; } .hero-feat { padding: 10px 8px; } }

/* ---------- lab: daily test, benchmarks, research cards, demos ---------- */
.hero-feats { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 1040px; }
.lab-head h2 { margin: 0 0 4px; }
.lt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lt-head h3 { margin: 0; }
.lt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.lt-task { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.lt-n { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.lt-q { margin: 0 0 8px; font-weight: 600; line-height: 1.8; }
.lt-code { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; font-size: 12.5px; overflow-x: auto; margin: 0 0 8px; }
.lt-how summary { cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 600; }
.lt-how ol { margin: 6px 0; padding-inline-start: 20px; line-height: 1.9; font-size: 13.5px; }
.lt-how p { margin: 4px 0 0; }
.lt-res { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lt-m { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); }
.lt-m.good { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border)); }
.lt-m.bad { color: #ff8787; }
.lt-m .vi { width: 14px; height: 14px; }
.kpi.hot { border-color: var(--accent-2); }
.lb-chips { margin: 8px 0 10px; }
.lb-charts { margin-top: 10px; }
.lb-papers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.lb-paper { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; min-width: 0; }
.lb-paper img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--bg); display: block; }
.lp-body { padding: 12px 14px; display: grid; gap: 6px; }
.lp-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.lb-paper h4 { margin: 0; font-size: 15px; line-height: 1.5; }
.lp-sec { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.lp-sec b { color: var(--text); }
.lp-sec.good-sec b { color: var(--accent-2); }
.lp-links { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; margin-top: 2px; }
.lp-links a { color: var(--accent); text-decoration: none; }
.lb-demos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lb-demo { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); color: var(--text); text-decoration: none; min-width: 0; }
.lb-demo:hover { border-color: var(--accent); }
.lb-demo .ld-e { grid-row: span 2; font-size: 24px; }
.lb-demo b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-demo small { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .lt-grid { grid-template-columns: 1fr; } .hero-feats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .hero-feats { grid-template-columns: 1fr 1fr; } .hero-feat:last-child { grid-column: span 2; }
  .lb-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; } .lb-chips .chip { flex: none; }
  .lb-papers { grid-template-columns: 1fr; } .lb-demos { grid-template-columns: 1fr 1fr; }
}

/* ---------- header: one tidy row on PC, two short rows on phones (both languages) ---------- */
.top-inner { flex-wrap: nowrap; gap: 14px; }
.brand { flex: none; }
.tabs { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline-start: 8px; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
[dir="rtl"] .tabs { -webkit-mask-image: linear-gradient(270deg, #000 92%, transparent); mask-image: linear-gradient(270deg, #000 92%, transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex: none; }
.tools { flex: none; }
[dir="ltr"] .hero h1, [dir="ltr"] .hero .hero-title { text-transform: none; letter-spacing: -1px; }
.hero h1 .glow { font-size: .62em; display: inline-block; margin-top: 6px; }
@media (max-width: 720px) {
  .top-inner { flex-wrap: wrap; row-gap: 8px; padding: 8px 12px; }
  .brand { font-size: 19px; }
  .brand small { font-size: 10.5px; }
  .tools { margin-inline-start: auto; }
  .tabs { order: 3; flex-basis: 100%; margin: 0; }
  .hero h1, .hero .hero-title { font-size: clamp(28px, 9vw, 40px); }
}

/* ---------- lab gallery ---------- */
.gl-theme { margin: 6px 0 10px; line-height: 1.8; }
.gl-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gl-grid.site, .gl-grid.video { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.gl-card { margin: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.gl-h { display: flex; align-items: center; gap: 4px; padding: 8px 12px; font-size: 13.5px; }
.gl-h small { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.gl-card img, .gl-card video { width: 100%; display: block; background: #000; aspect-ratio: 16 / 9; object-fit: cover; }
.gl-card audio { width: calc(100% - 20px); margin: 6px 10px 12px; }
.gl-note { margin: 0 12px; font-weight: 700; font-size: 13px; color: var(--accent); }
.gl-say { margin: 4px 12px 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.gl-site { width: 100%; height: 340px; border: 0; background: #fff; display: block; }
.gl-open { padding: 8px 12px; font-size: 13px; color: var(--accent); text-decoration: none; }
.rm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rm-card { margin: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; min-width: 0; }
.rm-card img, .rm-card video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; display: block; }
.rm-card figcaption { padding: 10px 12px; display: grid; gap: 6px; }
.rm-card figcaption a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 13.5px; line-height: 1.5; }
.rm-card figcaption small { color: var(--muted); font-size: 12px; }
.rm-card figcaption small a { color: var(--accent); font-weight: 400; }
@media (max-width: 640px) { .gl-grid, .gl-grid.site, .gl-grid.video, .rm-grid { grid-template-columns: 1fr; } .gl-site { height: 300px; } }

/* ---------- account button, personal settings, stars ---------- */
.acct { box-sizing: border-box; flex: none; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.acct.on { width: 34px; padding: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border: 0; }
.acct[hidden] { display: grid; visibility: hidden; } /* keeps its slot so the header never shifts when it appears */
.pf-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.pf-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.pf-list li span { flex: 1; font-weight: 600; }
.btn.sm { padding: 3px 9px; font-size: 13px; border-radius: var(--r-sm); }
.pf-show { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.pf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
td.name .star { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 2px; margin-inline-end: 4px; vertical-align: -2px; }
td.name .star.on { color: #fcc419; }
.watch-chip { margin-inline-start: 6px; }
body:not(.acct-on) td.name .star, body:not(.signed) .watch-chip { display: none; }
@media (max-width: 720px) {
  .brand { flex: 1 1 0; min-width: 0; }
  .brand > div:last-child { min-width: 0; }
  .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- robustness: never scroll sideways; hero always centred (any browser, zoom or Windows scaling) ---------- */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
main, .hero, .stats, .hero-feats, .highlights { max-width: 100%; }
.hero { text-align: center; margin-inline: auto; }
.hero h1, .hero .hero-title { max-width: 22ch; margin-inline: auto; text-align: center; text-wrap: balance; }
.hero h1 .glow, .hero .hero-title .glow { display: block; font-size: .6em; margin-top: 8px; }
.hero p { margin-inline: auto; }
.legal-page { max-width: 820px; margin: 30px auto 60px; padding: 0 16px; }
.legal { margin-bottom: 16px; line-height: 1.9; }
.legal h1 { font-size: 26px; margin: 0 0 8px; } .legal h2 { font-size: 17px; margin: 16px 0 4px; }

/* ---------- sign-in window ---------- */
.si-btns { display: grid; gap: 8px; margin: 12px 0; }
.si-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 700; }
.si-btn:hover { border-color: var(--accent); }
.si-btn .vi { width: 20px; height: 20px; }
.si-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0 8px; }
.si-or::before, .si-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.si-form { display: grid; gap: 10px; }
.si-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.si-form input { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 9px 12px; color: var(--text); font: inherit; }
.si-err { color: #ff8787; min-height: 1.2em; margin: 0; font-size: 13px; }
.si-switch { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 0; justify-self: start; }

/* ---------- sign-in (Claude-style card) ---------- */
.signin-dlg { max-width: 420px; padding: 0; border-radius: var(--r-xl); position: relative; }
.signin-dlg::backdrop { background: rgba(5, 8, 15, .6); backdrop-filter: blur(4px); }
.si-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; }
.si-card { padding: 34px 30px 24px; display: grid; gap: 12px; text-align: center; }
.si-logo { width: 54px; height: 54px; margin: 0 auto 4px; border-radius: var(--r-lg); display: grid; place-items: center; font-weight: 900; font-size: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.si-h { margin: 0; font-size: 24px; }
.si-p { margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.si-btns { display: grid; gap: 10px; }
.si-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px; border-radius: var(--r); font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.si-btn svg { width: 20px; height: 20px; flex: none; }
.si-btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.si-btn.github { background: #24292f; color: #fff; border: 1px solid #24292f; }
.si-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.si-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 6px 0; }
.si-or::before, .si-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.si-form { display: grid; gap: 10px; }
.si-form input { width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; text-align: start; }
.si-form input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.si-main { padding: 12px 16px; border-radius: var(--r); border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.si-err { color: #ff8787; min-height: 1.2em; margin: 0; font-size: 13px; }
.si-link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.si-terms { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.si-terms a { color: var(--muted); }
@media (max-width: 480px) { .signin-dlg { width: calc(100% - 20px); } .si-card { padding: 30px 18px 20px; } }

/* ---------- tab bar: its own row, icons, clear active state ---------- */
.top { position: sticky; top: 0; z-index: 40; }
.top-inner { flex-wrap: wrap; row-gap: 0; padding-bottom: 0; }
.tabs { order: 3; flex: 1 1 100%; margin: 6px -4px 0; padding: 0 4px; gap: 2px; border-top: 1px solid var(--border); -webkit-mask-image: none; mask-image: none; }
.tools { margin-inline-start: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 11px 14px 10px; border-radius: 0; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; background: none; position: relative; }
.tab .ti { font-size: 16px; line-height: 1; filter: saturate(.85); }
.tab:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text); }
.tab[aria-current="page"], .tab[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); border-bottom-color: var(--accent); }
.tab[aria-current="page"] .ti { filter: none; }
.tab.hot::after { top: 8px; inset-inline-end: 6px; }
/* compact page header on non-Rankings sections */
.page-head { display: flex; align-items: center; gap: 16px; padding: 26px 4px 10px; }
.page-head[hidden] { display: none; }
.ph-i { width: 56px; height: 56px; flex: none; border-radius: var(--r-lg); display: grid; place-items: center; font-size: 28px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, var(--surface)), color-mix(in srgb, var(--accent-2) 20%, var(--surface))); border: 1px solid var(--border); }
.ph-kicker { margin: 0; color: var(--muted); font-size: 12.5px; }
.page-head h1 { margin: 2px 0 4px; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.25; }
.ph-sub { margin: 0; color: var(--muted); max-width: 820px; line-height: 1.8; font-size: 14.5px; }
.hero[hidden], .stats[hidden] { display: none !important; }
@media (max-width: 720px) {
  .tabs { margin-top: 4px; }
  .tab { padding: 10px 11px 9px; font-size: 13.5px; }
  .tab .ti { font-size: 15px; }
  .page-head { padding: 18px 2px 6px; gap: 12px; }
  .ph-i { width: 44px; height: 44px; font-size: 22px; border-radius: var(--r); }
  .ph-sub { font-size: 13.5px; }
}
.updated[hidden], #pageHead[hidden] { display: none !important; }

/* ---------- Persian typography: Estedad (SIL OFL, by Amin Abedi) for Persian letters, Inter for Latin ---------- */
@font-face { font-family: "Estedad"; font-style: normal; font-weight: 400; font-display: swap; src: url(/vendor/fonts/estedad-regular.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Estedad"; font-style: normal; font-weight: 500 600; font-display: swap; src: url(/vendor/fonts/estedad-semibold.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Estedad"; font-style: normal; font-weight: 700 900; font-display: swap; src: url(/vendor/fonts/estedad-bold.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
body, button, input, select, textarea { font-family: "Estedad", "Inter", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
[dir="ltr"] body, [dir="ltr"] button, [dir="ltr"] input, [dir="ltr"] select, [dir="ltr"] textarea { font-family: "Inter", "Estedad", system-ui, -apple-system, "Segoe UI", sans-serif; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
/* Persian letters join; negative or wide letter-spacing breaks the joins, so none in RTL */
[dir="rtl"] *, [dir="rtl"] *::before, [dir="rtl"] *::after { letter-spacing: 0 !important; }
[dir="rtl"] body { line-height: 1.85; font-size: 15px; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { font-weight: 700; line-height: 1.5; }
[dir="rtl"] .hero h1 { font-weight: 800; line-height: 1.35; }
[dir="rtl"] .tab, [dir="rtl"] .chip, [dir="rtl"] .btn { font-weight: 600; }
[dir="rtl"] .sub, [dir="rtl"] .ph-sub, [dir="rtl"] p { line-height: 1.9; }
[dir="rtl"] td, [dir="rtl"] th { line-height: 1.6; }

/* ---------- site-wide search ---------- */
.gs-open { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; font-size: 13.5px; min-width: 190px; }
.gs-open:hover { border-color: var(--accent); color: var(--text); }
.gs-open kbd, .hero-search kbd { margin-inline-start: auto; font: 11px/1 "Inter", system-ui, sans-serif; padding: 4px 6px; border-radius: var(--r-sm); border: 1px solid var(--border); background: color-mix(in srgb, var(--text) 5%, transparent); direction: ltr; }
.hero-search { display: flex; align-items: center; gap: 12px; width: min(720px, 100%); margin: 18px auto 6px; padding: 15px 18px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--surface); color: var(--muted); font: inherit; font-size: 15.5px; cursor: text; text-align: start; box-shadow: 0 10px 40px -18px color-mix(in srgb, var(--accent) 60%, transparent); transition: border-color .2s, box-shadow .2s; }
.hero-search:hover { border-color: var(--accent); box-shadow: 0 12px 44px -14px color-mix(in srgb, var(--accent) 70%, transparent); }
.hero-search .hs-ph { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-dlg { padding: 0; border: 0; background: transparent; width: min(760px, calc(100vw - 24px)); max-height: none; margin: 8vh auto auto; color: var(--text); }
.gs-dlg::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(4px); }
.gs-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6); overflow: hidden; display: flex; flex-direction: column; max-height: 80vh; }
.gs-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 18px; }
.gs-in input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 17px; padding: 4px 0; min-width: 0; }
.gs-in input::-webkit-search-cancel-button { display: none; }
#gsX { border: 1px solid var(--border); background: none; color: var(--muted); border-radius: var(--r-sm); font: 11px "Inter", sans-serif; padding: 4px 7px; cursor: pointer; }
.gs-res { overflow-y: auto; padding: 8px; flex: 1; }
.gs-foot { padding: 9px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.sr-group { margin-bottom: 6px; }
.sr-gh { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.sr-gh small { font-weight: 500; opacity: .8; }
.sr-all { margin-inline-start: auto; border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 12.5px; }
.sr-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r); background: none; color: var(--text); text-align: start; cursor: pointer; font: inherit; }
.sr-item:hover, .sr-item.on { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.sr-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.sr-ic img, .sr-ic svg { width: 24px; height: 24px; }
.sr-emo { font-size: 20px; }
.sr-tx { display: flex; flex-direction: column; min-width: 0; }
.sr-tx b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-tx small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-empty { padding: 22px 14px; color: var(--muted); }
.sr-tips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sr-filters { padding: 6px 10px 2px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 720px) {
  .gs-open { min-width: 0; padding: 0 10px; } .gs-open .gs-l, .gs-open kbd { display: none; }
  .gs-dlg { margin-top: 0; width: 100vw; max-width: 100vw; height: 100dvh; } .gs-box { border-radius: 0; max-height: 100dvh; height: 100dvh; }
  .hero-search { font-size: 14px; padding: 13px 14px; } .hero-search kbd { display: none; }
}
/* ---------- compare: best model for me ---------- */
#cmpPrio { margin-bottom: 14px; }
.prio summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.prio summary::-webkit-details-marker { display: none; }
.prio summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.prio:not([open]) summary::after { content: "◂"; }
.pr-t { font-size: 18px; font-weight: 700; }
.prio summary small { color: var(--muted); }
.pr-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.3fr); gap: 20px; margin-top: 14px; }
.pr-sliders { display: grid; gap: 10px; align-content: start; }
.pr-sl { display: grid; grid-template-columns: 9.5em 1fr 1.6em; align-items: center; gap: 10px; font-size: 14px; }
.pr-sl input { accent-color: var(--accent); width: 100%; }
.pr-sl b { text-align: center; }
.pr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-top: 4px; }
.pr-row select { margin-inline-start: 6px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.pr-th { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pr-top ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pr-top li { display: grid; grid-template-columns: 1.6em minmax(0, 1.4fr) minmax(0, 1.4fr) 70px 2em 30px; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.pr-top li a { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text); text-decoration: none; }
.pr-top li a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-top li small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-n { color: var(--muted); }
.pr-bar { height: 7px; border-radius: var(--r); background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.pr-bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; }
.pr-s { text-align: center; }
.cmp-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pr-rows { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chk input { accent-color: var(--accent); }
@media (max-width: 860px) {
  .pr-grid { grid-template-columns: 1fr; }
  .pr-top li { grid-template-columns: 1.4em minmax(0, 1fr) 54px 2em 30px; }
  .pr-top li small { display: none; }
  .pr-sl { grid-template-columns: 8em 1fr 1.4em; }
}

/* ---------- header typography (Persian): readable tagline, airy tabs, nothing clipped ---------- */
.brand { letter-spacing: 0; }
.brand small { font-size: 12.5px; font-weight: 400; margin-top: 2px; }
[dir="rtl"] .brand small { font-size: 13px; }
.tabs { margin-inline: 0; padding-inline: 10px; scroll-padding-inline: 10px; gap: 4px; }
.tab { gap: 8px; padding: 12px 14px 11px; font-size: 14.5px; font-weight: 500; }
[dir="rtl"] .tab { font-weight: 500; font-size: 15px; }
.tab[aria-current="page"], .tab[aria-selected="true"], [dir="rtl"] .tab[aria-current="page"] { font-weight: 700; }
.tab .tl { line-height: 1.5; }
.gs-open { font-size: 14px; }
[dir="rtl"] .hero .badge { font-weight: 500; }
@media (max-width: 720px) { .tab, [dir="rtl"] .tab { font-size: 14px; padding: 11px 12px 10px; } .brand small { font-size: 12px; } }
/* mobile header: logo keeps its square shape; tagline may wrap to two lines instead of being cut */
.logo { flex: none; }
@media (max-width: 720px) { .brand small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; font-size: 11.5px; } .tools { gap: 6px; } }
@media (max-width: 520px) { .brand small { display: none; } }
/* Firefox safety: Estedad ships 400/600/700 only — never let the browser fake heavier weights (synthetic bold smears Persian letters) */
[dir="rtl"] body, [dir="rtl"] button, [dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea { font-synthesis: none; }
[dir="rtl"] .hero h1, [dir="rtl"] .hero .hero-title, [dir="rtl"] .brand, [dir="rtl"] .logo { font-weight: 700; }

/* ---------- compare: model picker, 6-slot selection bar, toast ---------- */
.cmp-pick { position: relative; flex: 1 1 320px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 0 12px; }
.cmp-pick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.cmp-head .cmp-pick input { border: 0; background: none; outline: 0; padding: 11px 0; min-width: 0; flex: 1; font: inherit; color: var(--text); }
.cmp-sug { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 35; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 20px 50px -15px rgb(0 0 0 / .55); padding: 6px; max-height: 60vh; overflow-y: auto; }
.cs-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--text); padding: 8px 10px; border-radius: var(--r); cursor: pointer; text-align: start; font: inherit; }
.cs-opt span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cs-opt small { color: var(--muted); font-size: 12px; }
.cs-opt em { font-style: normal; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--border); color: var(--accent); }
.cs-opt.in em { background: var(--accent); color: #fff; border-color: var(--accent); }
.cs-opt:hover, .cs-opt.on { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.cs-none { padding: 12px; color: var(--muted); }
.cmp-sel { position: sticky; top: var(--head-h, 112px); z-index: 25; margin: 0 0 14px; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); box-shadow: 0 12px 30px -20px rgb(0 0 0 / .6); }
.cs-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.cs-h small { color: var(--muted); }
.cs-h .btn { margin-inline-start: auto; }
.cs-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cs-slot { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2, var(--surface)); min-width: 0; position: relative; }
.cs-slot.on { border-color: color-mix(in srgb, var(--c) 55%, var(--border)); box-shadow: inset 0 3px 0 var(--c); }
.cs-slot.empty { justify-content: center; border-style: dashed; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; background: none; }
.cs-slot.empty:hover { border-color: var(--accent); color: var(--text); }
.cs-slot.flash { animation: csPop .9s cubic-bezier(.2,.8,.2,1); }
@keyframes csPop { 0% { transform: scale(.85); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent), inset 0 3px 0 var(--c); } 60% { transform: scale(1.04); box-shadow: 0 0 0 8px transparent, inset 0 3px 0 var(--c); } 100% { transform: none; } }
.cs-i { flex: none; width: 26px; display: grid; place-items: center; }
.cs-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cs-t a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-t small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-x { flex: none; width: 24px; height: 24px; border-radius: var(--r-sm); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.cs-x:hover { background: color-mix(in srgb, #ef4444 18%, transparent); color: #ef4444; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0; z-index: 60; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 24px)); padding: 10px 14px; border-radius: var(--r-lg); background: var(--surface); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 18px 50px -12px rgb(0 0 0 / .6); font-size: 14px; transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast small { color: var(--muted); }
.toast img, .toast svg { width: 20px; height: 20px; }
/* sort bubble under the rankings table header */
.sort-bubble { position: fixed; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: var(--r); background: var(--accent); color: #fff; box-shadow: 0 14px 34px -10px rgb(0 0 0 / .55); font-size: 13px; pointer-events: none; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .2s; white-space: nowrap; }
.sort-bubble.show { opacity: 1; transform: none; }
.sort-bubble::before { content: ""; position: absolute; top: -6px; left: calc(var(--ax, 50%) - 6px); border: 6px solid transparent; border-top: 0; border-bottom-color: var(--accent); }
.sort-bubble span:last-child { display: flex; flex-direction: column; line-height: 1.5; }
.sort-bubble small { opacity: .9; }
.sb-arrow { font-size: 18px; }
thead th[data-sort] { cursor: pointer; user-select: none; }
thead th[data-sort]:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 10%, transparent); }
@media (max-width: 1200px) { .cs-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .cmp-sel { top: var(--head-h, 100px); padding: 8px; }
  .cs-row { display: flex; overflow-x: auto; scrollbar-width: none; }
  .cs-row::-webkit-scrollbar { display: none; }
  .cs-slot { flex: 0 0 150px; }
  .cs-slot.empty { flex: 0 0 110px; }
  .cmp-head .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .cs-slot.flash { animation: none; } .toast, .sort-bubble { transition: none; } }
/* compare table: each model column gets its colour (same as the bar and charts); names on one tidy line */
.cmp-table thead th.cmp-th { min-width: 150px; border-top: 3px solid var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); vertical-align: bottom; }
.cmp-thi { display: flex; align-items: center; gap: 6px; }
.cmp-thi a { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; color: var(--text); text-decoration: none; }
.cmp-thi b { font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmp-th small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; }
.cmp-table tbody td:not(:first-child) { min-width: 150px; }
.cmp-table thead th:first-child { min-width: 140px; }
/* selection bar: one row of chips that wraps only when needed; table gets the full width on mid screens */
.cs-row, .cs-row[class] { display: flex; flex-wrap: wrap; gap: 8px; grid-template-columns: none; }
.cs-slot { flex: 1 1 190px; max-width: 260px; }
.cs-slot.empty { flex: 0 0 auto; max-width: none; padding-inline: 16px; gap: 6px; }
@media (max-width: 1200px) { .cmp-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cs-row, .cs-row[class] { flex-wrap: nowrap; overflow-x: auto; } .cs-slot { flex: 0 0 160px; } }
/* phone: compact sticky bar — one line of model chips, short header */
@media (max-width: 560px) {
  .cmp-sel { padding: 6px 8px 8px; border-radius: var(--r); }
  .cs-h { margin-bottom: 6px; font-size: 12.5px; }
  .cs-h b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
  .cs-h .btn.sm { padding: 4px 10px; font-size: 12px; }
  .cs-slot { flex: 0 0 auto; max-width: 70vw; min-height: 40px; padding: 4px 6px; }
  .cs-t a { font-size: 13px; }
  .cs-t small { display: none; }
  .cs-i { width: 20px; }
  .cs-slot.empty { flex: 0 0 auto; padding-inline: 12px; }
}
/* compare picker, browse mode: popular models + company logo grid */
.cmp-sug { max-height: min(70vh, 560px); }
.cb-sec { padding: 10px 10px 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; padding: 4px 4px 6px; }
.cb-ven { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2, var(--surface)); color: var(--text); cursor: pointer; font: inherit; min-width: 0; transition: border-color .15s, transform .15s; }
.cb-ven:hover, .cb-ven:focus-visible { border-color: var(--accent); transform: translateY(-1px); outline: none; }
.cb-ven img, .cb-ven svg, .cb-ven .ico { width: 30px; height: 30px; }
.cb-ven b { font-size: 12.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-ven small { color: var(--muted); font-size: 11px; }
.cb-head { position: sticky; top: -6px; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 6px 4px 8px; margin: -6px -6px 4px; padding-inline: 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.cb-v { display: flex; align-items: center; gap: 8px; }
.cb-v img, .cb-v svg { width: 24px; height: 24px; }
.cb-v small { color: var(--muted); }
@media (max-width: 560px) { .cb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cmp-sug { max-height: 60vh; } }
.cb-ven .vi { width: 30px; height: 30px; font-size: 15px; } .cb-ven .vi svg { width: 100%; height: 100%; }
.cb-v .vi { width: 24px; height: 24px; } .cb-v .vi svg { width: 100%; height: 100%; }

/* ---------- news ticker under the header (marquee with faded edges, shiny badge; pauses on hover, focus or the button) ---------- */
.ticker { position: relative; z-index: 5; display: flex; align-items: center; gap: 10px; width: min(1400px, calc(100% - 24px)); margin: 10px auto 0; padding: 5px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.ticker[hidden] { display: none; }
.tk-badge { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; color: var(--accent-ink); text-decoration: none; background: linear-gradient(110deg, var(--accent) 20%, color-mix(in srgb, var(--accent-2) 80%, #fff) 50%, var(--accent) 80%); background-size: 250% 100%; animation: tk-shine 5s linear infinite; }
.tk-badge:focus-visible, .tk-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: tk-ping 1.8s ease-out infinite; }
@keyframes tk-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 70%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes tk-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.tk-view { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.tk-track { display: flex; width: max-content; animation: tk-scroll var(--tk-dur, 60s) linear infinite; will-change: transform; }
[dir="rtl"] .tk-track { animation-name: tk-scroll-rtl; }
/* pause only while the pointer or keyboard focus is on the headlines themselves, not on the pause button (it keeps focus after a click) */
.tk-track:hover, .tk-track:focus-within, .ticker.paused .tk-track { animation-play-state: paused; }
@keyframes tk-scroll { to { transform: translateX(-50%); } }
@keyframes tk-scroll-rtl { to { transform: translateX(50%); } }
.tk-run { display: flex; align-items: center; flex: none; }
.tk-i { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; white-space: nowrap; color: var(--text); text-decoration: none; font-size: 13.5px; border-radius: 999px; cursor: pointer; transition: background-color .2s, color .2s; }
.tk-i:hover { background: var(--surface-2); color: var(--accent); }
.tk-i:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tk-i .vi, .nwt .vi { width: 18px; height: 18px; flex: none; }
.tk-k { flex: none; font-size: 11px; font-weight: 700; line-height: 1.6; padding: 1px 8px; border-radius: 999px; color: var(--kc); background: color-mix(in srgb, var(--kc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--kc) 35%, transparent); }
.k-launch { --kc: var(--c3); } .k-new { --kc: var(--c2); } .k-tiny { --kc: var(--c4); } .k-model { --kc: var(--c1); } .k-paper { --kc: var(--c5); }
.tk-sep { flex: none; width: 5px; height: 5px; margin: 0 6px; border-radius: 50%; background: var(--muted); opacity: .45; }
.tk-pause { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background-color .2s; }
.tk-pause:hover { background: var(--surface-2); }
.tk-pause svg { fill: currentColor; }
.tk-pause .tk-ir, .ticker.paused .tk-pause .tk-ip { display: none; }
.ticker.paused .tk-pause .tk-ir { display: inline; }
@media (max-width: 640px) {
  .ticker { width: calc(100% - 16px); margin-top: 8px; gap: 6px; }
  .tk-badge { padding: 6px 10px; }
  .tk-badge span:last-child { display: none; }
  .tk-i { font-size: 13px; padding: 5px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tk-track { animation: none; }
  .tk-view { overflow-x: auto; -webkit-mask-image: none; mask-image: none; scrollbar-width: thin; }
  .tk-run[aria-hidden] { display: none; }
  .tk-badge, .tk-dot { animation: none; }
  .tk-pause { display: none; }
}

/* ---------- news page: today's highlight cards (pointer spotlight) ---------- */
.nw-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin: 0 0 16px; }
.nw-top[hidden] { display: none; }
.nwt-h { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.nwt-h h3 { margin: 0; }
.nwt { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; min-height: 96px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; overflow: hidden; cursor: pointer; transition: transform .25s cubic-bezier(.22,1,.36,1), border-color .25s, box-shadow .25s; }
.nwt::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%); pointer-events: none; }
.nwt:hover, .nwt:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); }
.nwt:hover::before, .nwt:focus-visible::before { opacity: 1; }
.nwt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nwt-top { display: flex; align-items: center; gap: 8px; }
.nwt-top small { margin-inline-start: auto; }
.nwt b { font-weight: 600; line-height: 1.6; font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .nwt, .nwt:hover { transition: none; transform: none; } }

/* compare: context bars grow from their start edge when Motion animates them */
[dir="rtl"] .cmp-table .ctxbar i { transform-origin: right center; }
[dir="ltr"] .cmp-table .ctxbar i { transform-origin: left center; }

/* ===== stock market: picked-company performance chart + centred gain/loss bars ===== */
.mk-perf, .mk-gain { position: relative; overflow: hidden; margin: 14px 0; }
.mk-perf::before, .mk-gain::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent); pointer-events: none; }
.mk-gain::before { inset: auto auto -50% -10%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent); }
.mk-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; position: relative; }
.mk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; transition: background .2s, border-color .2s, opacity .2s, transform .2s; }
.mk-chip:hover { transform: translateY(-1px); border-color: var(--c); }
.mk-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mk-chip b { color: var(--text); font-size: 12px; }
.mk-chip em { font-style: normal; font-weight: 700; font-size: 11.5px; }
.mk-chip[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), 0 4px 14px color-mix(in srgb, var(--c) 22%, transparent); }
.mk-chip[aria-pressed="true"] .dv-logo { box-shadow: 0 0 0 2px var(--c); }
.mk-chip[aria-pressed="false"] { opacity: .7; } .mk-chip[aria-pressed="false"] .dv-logo { filter: grayscale(1); }
.mk-chip.dim { opacity: .35; }
.mk-chip.ghost { padding: 4px 12px; border-style: dashed; }
.mk-cv { height: 480px; } .mk-cv canvas { direction: ltr; }
.dv-logo { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--surface); border: 1px solid var(--border); font-style: normal; font-size: 10px; font-weight: 800; overflow: hidden; }
.dv-logo .vi, .dv-logo svg, .dv-logo img { width: 17px; height: 17px; }
.mk-chip .dv-logo { width: 22px; height: 22px; } .mk-chip .dv-logo .vi, .mk-chip .dv-logo svg, .mk-chip .dv-logo img { width: 14px; height: 14px; }

.dv { display: grid; gap: 2px; margin-top: 12px; position: relative; }
.dv-row, .dv-axis { grid-template-columns: 28px minmax(150px, 1.25fr) minmax(0, 3fr) 104px; }
.dv-axis { display: grid; gap: 10px; padding: 0 6px 4px; }
.dv-scale { display: flex; justify-content: space-between; direction: ltr; font-size: 11px; color: var(--muted); border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.dv-scale b { font-weight: 600; }
.dv-rank { color: var(--muted); font-size: 12px; text-align: center; font-weight: 700; }
.dv-row:nth-child(2) .dv-rank, .dv-row:nth-child(3) .dv-rank, .dv-row:nth-child(4) .dv-rank { color: var(--accent); }
.dv-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dv-bar { position: relative; height: 30px; direction: ltr; border-radius: var(--r-sm);
  background: linear-gradient(90deg, rgba(229,72,77,.07), rgba(229,72,77,.02) 50%, rgba(47,179,109,.02) 50%, rgba(47,179,109,.07)); }
.dv-bar::before { content: ""; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 1.5px; background: var(--muted); opacity: .5; }
.dv-bar i { position: absolute; top: 50%; height: 14px; width: 0; margin-top: -7px; transition: width 1.1s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 45ms + 120ms); }
.dv-bar.up i { left: 50%; border-radius: 0 99px 99px 0; background: linear-gradient(90deg, #2fb36d, #6ee7a8); box-shadow: 0 0 14px rgba(47,179,109,.35); }
.dv-bar.down i { right: 50%; border-radius: 99px 0 0 99px; background: linear-gradient(270deg, #e5484d, #ff8a8f); box-shadow: 0 0 14px rgba(229,72,77,.3); }
.dv-row.go .dv-bar i { width: var(--w); }
.dv-bar em { position: absolute; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 800; font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .4s calc(var(--i, 0) * 45ms + 700ms);
  padding: 1px 6px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.dv-row.go .dv-bar em { opacity: 1; }
.dv-bar.up em { left: min(calc(50% + var(--w) + 6px), calc(100% - 62px)); color: #2fb36d; }
.dv-bar.down em { right: min(calc(50% + var(--w) + 6px), calc(100% - 62px)); color: #e5484d; }
.dv-row .race-val { font-size: 13.5px; }
.dv-row:hover .dv-logo { transform: scale(1.08); } .dv-logo { transition: transform .2s; }
@media (max-width: 720px) {
  .dv-row, .dv-axis { grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.25fr); gap: 6px; }
  .dv-row .race-val, .dv-axis > span:last-child { display: none; }
  .dv-name .dv-logo { display: none; }
  .mk-cv { height: 340px; }
  .mk-pick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
  .mk-chip { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .dv-bar i, .dv-bar em, .mk-chip { transition: none !important; } }

/* ===== tab groups + line icons ===== */
.tab .ti { display: inline-grid; place-items: center; filter: none; opacity: .75; transition: opacity .2s, transform .2s; }
.tab .ti svg { display: block; }
.tab:hover .ti, .tab[aria-current="page"] .ti { opacity: 1; }
.tab[aria-current="page"] .ti { color: var(--accent); transform: translateY(-1px); }
.tabs:not(.custom) .tab.gs { margin-inline-start: 10px; }
.tabs:not(.custom) .tab.gs::before { content: ""; position: absolute; inset-inline-start: -6px; top: 30%; bottom: 30%; width: 1px; background: var(--border); }
.ph-i svg { width: 28px; height: 28px; color: var(--accent); }
@media (max-width: 720px) { .ph-i svg { width: 22px; height: 22px; } .tabs:not(.custom) .tab.gs { margin-inline-start: 6px; } .tabs:not(.custom) .tab.gs::before { inset-inline-start: -4px; } }

/* ===== model hover card ===== */
.hv { position: fixed; z-index: 120; width: 330px; max-width: calc(100vw - 16px); pointer-events: none; display: grid; gap: 9px; padding: 13px 14px 11px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: var(--r-lg); box-shadow: 0 18px 48px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.03) inset;
  opacity: 0; transform: translateY(4px) scale(.98); transition: opacity .16s ease, transform .18s ease; font-size: 12.5px; }
.hv.show { opacity: 1; transform: none; }
.hv[hidden] { display: none; }
.hv-head { display: flex; gap: 10px; align-items: center; }
.hv-ico { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.hv-ico .vi { width: 22px; height: 22px; }
.hv-head b { display: block; font-size: 14.5px; line-height: 1.3; }
.hv-head small { color: var(--muted); font-size: 11.5px; }
.hv-sum { margin: 0; color: var(--text); opacity: .88; line-height: 1.7; }
.hv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); gap: 5px; }
.hv-facts span { background: var(--surface-2); border-radius: var(--r-sm); padding: 4px 7px; display: grid; min-width: 0; }
.hv-facts small { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-facts b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: end; }
.hv-cmp { display: grid; gap: 6px; border-top: 1px dashed var(--border); padding-top: 8px; }
.hv-vs { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; }
.hv-key { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.hv-key small { color: var(--muted); font-weight: 500; }
.hv-key i, .hv-bars i { display: block; border-radius: 999px; }
.hv-key i { width: 10px; height: 10px; }
.hv i.me { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.hv i.best { background: #f5b942; }
.hv-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 4px 8px; align-items: center; }
.hv-l { color: var(--muted); font-size: 11px; }
.hv-bars { display: grid; gap: 3px; direction: ltr; }
.hv-bars i { height: 5px; width: var(--w); min-width: 3px; }
.hv-v { display: grid; text-align: end; line-height: 1.2; min-width: 52px; direction: ltr; }
.hv-v b { font-size: 11.5px; } .hv-v small { font-size: 10.5px; color: #f5b942; }
.hv-n { grid-column: 2 / -1; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); margin-top: -2px; }
.hv-n.good { color: #2fb36d; } .hv-n.bad { color: #e5484d; }
.hv-benches { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 5px; }
.hv-bench { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; align-items: baseline; background: var(--surface-2); border-radius: var(--r-sm); padding: 4px 8px; font-size: 11.5px; min-width: 0; }
.hv-bench span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-bench small { grid-column: 1 / -1; }
.hv-bench span { color: var(--muted); } .hv-bench small { color: var(--muted); font-size: 10.5px; }
.hv-crown { display: flex; gap: 8px; align-items: center; font-weight: 700; color: #f5b942; background: color-mix(in srgb, #f5b942 12%, transparent); border-radius: var(--r); padding: 7px 9px; }
.hv-load { color: var(--muted); font-size: 11.5px; }
.hv-hint { color: var(--muted); font-size: 10.5px; text-align: center; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .hv { transition: none; } }

/* ===== market: view toggle + small multiples ===== */
.mk-ph { display: flex; justify-content: space-between; gap: 12px; align-items: start; flex-wrap: wrap; position: relative; }
.mk-ph .chips { margin: 0; }
.mk-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; position: relative; }
.mk-multi[hidden], .mk-pick[hidden], .mk-cv[hidden] { display: none; }
.mm { display: grid; gap: 4px; padding: 9px 10px 6px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: inherit; font: inherit; text-align: start; cursor: pointer;
  opacity: 0; transform: translateY(8px); transition: opacity .45s ease calc(var(--i) * 30ms), transform .45s ease calc(var(--i) * 30ms), border-color .2s, box-shadow .2s; }
.mm.go { opacity: 1; transform: none; }
.mm:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.mm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mm-h { display: flex; gap: 8px; align-items: center; min-width: 0; }
.mm-h .race-name { flex: 1; }
.mm-r { font-size: 15px; font-weight: 800; }
.mm svg { width: 100%; height: 78px; display: block; }
.mm-zero { stroke: var(--muted); stroke-opacity: .5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: reduce) { .mm { transition: none; opacity: 1; transform: none; } }

/* ===== wide monitors: use the room, two columns where it reads better ===== */
@media (min-width: 1680px) {
  main, .top-inner { max-width: 1640px; }
  .mk-cv { height: 540px; }
}
@media (min-width: 2200px) {
  html { font-size: 17px; }
  main, .top-inner { max-width: 2040px; }
  .mk-cv { height: 620px; }
  .mk-multi { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (min-width: 1680px) {
  .mk-duo { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .mk-duo > .card { margin: 0; }
  .mk-duo .dv-row, .mk-duo .dv-axis { grid-template-columns: 24px minmax(130px, 1.2fr) minmax(0, 2fr) 84px; }
}
@media (min-width: 1680px) { .mk-duo > .mk-perf:not(.multi) { position: sticky; top: 112px; } }
@media (max-width: 720px) { .mk-multi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .mm { padding: 7px 8px 4px; } .mm .dv-logo { display: none; } .mm-r { font-size: 13px; } .mm svg { height: 56px; } .hv { display: none !important; } }

/* ===== model map: company colours, zoom, 3D tiles ===== */
.tm-crumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 34px; margin-bottom: 8px; font-size: 13px; }
.tm-crumb .chip { margin: 0; }
.tm-cur { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; } .tm-cur .vi { width: 20px; height: 20px; }
.tm-hint { color: var(--muted); font-size: 12.5px; }
@media (min-width: 1680px) { .tmap { height: 760px; } } @media (min-width: 2200px) { .tmap { height: 900px; } }

/* ===== language menu ===== */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; cursor: pointer; gap: 5px; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary svg { opacity: .8; }
.lang-menu[open] > summary { border-color: var(--accent); }
.lang-list { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; min-width: 150px; display: grid; padding: 5px; border-radius: var(--r); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: lmIn .16s ease; }
.lang-list a { padding: 7px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px; text-align: start; }
.lang-list a:hover, .lang-list a:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
.lang-list a[aria-current] { color: var(--accent); }
.lang-list a[aria-current]::after { content: " ✓"; }
@keyframes lmIn { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .lang-list { animation: none; } }

/* ===== styled tooltips (replace the browser's plain title box) ===== */
.tipx { position: fixed; z-index: 130; max-width: min(320px, calc(100vw - 16px)); padding: 7px 11px; border-radius: var(--r); pointer-events: none;
  font-size: 12.5px; line-height: 1.55; font-weight: 500; color: var(--text); text-align: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 32px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
  opacity: 0; transform: translateY(4px) scale(.97); transition: opacity .14s ease, transform .16s ease; }
.tipx.below { transform: translateY(-4px) scale(.97); }
.tipx.show { opacity: 1; transform: none; }
.tipx[hidden] { display: none; }
.tipx::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -5px; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg);
  background: inherit; border-right: 1px solid color-mix(in srgb, var(--text) 12%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }
.tipx.below::after { bottom: auto; top: -5px; transform: translateX(-50%) rotate(225deg); }
@media (prefers-reduced-motion: reduce) { .tipx { transition: none; } }

/* ===== "noir" — the default dark theme, cinematic and quiet =====
   near-black canvas with a soft spotlight and film grain, hairline borders, big rounded bento cards,
   a floating glass navigation capsule, pill controls, light gradient headlines; colour only where it carries meaning */
[data-theme="dark"] {
  --bg: #08080a; --surface: #111114; --surface-2: #19191d; --border: #26262c;
  --text: #ededf0; --muted: #8d8d96; --accent: #a5b4fc; --accent-2: #5eead4; --accent-ink: #08080a;
  --shadow: 0 0 0 1px rgba(255,255,255,.035), 0 24px 60px rgba(0,0,0,.55);
  --hair: rgba(255,255,255,.075); --glass: rgba(255,255,255,.035);
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 520px at 50% -140px, rgba(165,180,252,.13), transparent 70%),
    radial-gradient(900px 600px at 100% 30%, rgba(94,234,212,.045), transparent 70%),
    radial-gradient(900px 700px at 0% 70%, rgba(165,180,252,.04), transparent 70%),
    #08080a;
  background-attachment: fixed;
}
[data-theme="dark"] body::after { content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: .045; mix-blend-mode: overlay;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .aurora { opacity: .35; filter: saturate(.6); }

/* header: glass bar, navigation as a floating capsule */
[data-theme="dark"] .top { background: rgba(8,8,10,.86); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border-bottom: 1px solid var(--hair); box-shadow: none; }
/* the capsule's size and place are the same in every theme (only colours change), so switching theme never moves the header */
[data-theme] .tabs { border-top: 0; margin: 4px auto 10px; flex: 0 1 auto; width: fit-content; max-width: 100%; padding: 4px; gap: 2px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border); }
[data-theme] .tab { border-radius: 999px; border-bottom: 0; padding: 8px 14px; font-weight: 600; }
/* the selected section is shown by colour only: no box, ring or shadow around it */
[data-theme] .tab[aria-current="page"], [data-theme] .tab[aria-selected="true"] { background: none; box-shadow: none; border-color: transparent; color: var(--accent); }
[data-theme="dark"] .tabs { background: var(--glass); border-color: var(--hair); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
[data-theme="dark"] .tab { color: var(--muted); }
[data-theme="dark"] .tab:hover { background: rgba(255,255,255,.05); color: var(--text); }
[data-theme="dark"] .tab[aria-current="page"], [data-theme="dark"] .tab[aria-selected="true"] { background: none; box-shadow: none; color: var(--accent); }
[data-theme="dark"] .tab[aria-current="page"] .ti { color: var(--accent); }
[data-theme="dark"] .tabs:not(.custom) .tab.gs::before { background: var(--hair); }

/* surfaces */
[data-theme="dark"] .card, [data-theme="dark"] .table-wrap, [data-theme="dark"] .filters, [data-theme="dark"] .panel > .card {
  border-radius: var(--r-xl); border: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)) , var(--bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 30px 60px -30px rgba(0,0,0,.6); }
[data-theme="dark"] .card:hover { border-color: rgba(255,255,255,.11); }
[data-theme="dark"] .kpi, [data-theme="dark"] .stat { border-radius: var(--r-lg); background: rgba(255,255,255,.025); border: 1px solid var(--hair); }

/* controls: pills, quiet until chosen, chosen = white on black */
[data-theme="dark"] .chip { border-radius: 999px; background: rgba(255,255,255,.035); border: 1px solid var(--hair); color: var(--text); }
[data-theme="dark"] .chip:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
[data-theme="dark"] .chip[aria-pressed="true"] { background: #ededf0; color: #08080a; border-color: #ededf0; box-shadow: 0 6px 22px rgba(237,237,240,.12); }
[data-theme="dark"] .btn { border-radius: 999px; }
[data-theme="dark"] .btn:not(.ghost) { background: #ededf0; color: #08080a; box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 10px 30px rgba(237,237,240,.12); }
[data-theme="dark"] .btn:not(.ghost):hover { background: #fff; box-shadow: 0 0 0 1px #fff, 0 12px 40px rgba(237,237,240,.2); }
[data-theme="dark"] .btn.ghost { background: rgba(255,255,255,.04); border: 1px solid var(--hair); color: var(--text); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { border-radius: var(--r); background: rgba(255,255,255,.035); border-color: var(--hair); }
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus { border-color: rgba(165,180,252,.55); box-shadow: 0 0 0 4px rgba(165,180,252,.12); outline: none; }
[data-theme="dark"] .lang-switch, [data-theme="dark"] .icon-btn { border-radius: 999px; background: rgba(255,255,255,.04); border-color: var(--hair); }

/* tables: hairlines, small muted headers, gentle row light */
[data-theme="dark"] thead th { background: transparent; color: var(--muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--hair); }
[data-theme="dark"] tbody td { border-bottom: 1px solid rgba(255,255,255,.04); }
[data-theme="dark"] tbody tr:hover td { background: rgba(255,255,255,.025); }

/* headlines: big, tight, softly lit */
[data-theme="dark"] .hero h1, [data-theme="dark"] .hero .hero-title, [data-theme="dark"] .page-head h1 {
  background: linear-gradient(180deg, #ffffff 30%, rgba(237,237,240,.55)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
html:not([lang="fa"]):not([lang="ar"])[data-theme="dark"] .hero h1, html:not([lang="fa"]):not([lang="ar"])[data-theme="dark"] .page-head h1, html:not([lang="fa"]):not([lang="ar"])[data-theme="dark"] .card h2 { letter-spacing: -0.025em; }
[data-theme="dark"] .ph-i { border-radius: var(--r-lg); background: radial-gradient(circle at 30% 20%, rgba(165,180,252,.25), rgba(255,255,255,.03) 70%); border: 1px solid var(--hair); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 30px rgba(0,0,0,.4); }
[data-theme="dark"] .ph-i svg { color: #fff; }
[data-theme="dark"] .hero .badge { border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--hair); }

/* moving news bar: same capsule language */
[data-theme="dark"] .ticker { border-color: var(--hair); background: rgba(255,255,255,.02); }

@media (max-width: 720px) {
  [data-theme] .tabs { width: auto; margin: 2px 0 8px; border-radius: var(--r-lg); }
  [data-theme="dark"] .card, [data-theme="dark"] .table-wrap { border-radius: var(--r-lg); }
}
@media (prefers-reduced-transparency: reduce) { [data-theme="dark"] .top, .tipx { backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* hero headline: give Persian/Arabic descenders room so line 1 never runs into line 2 */
.hero h1 > span:first-child, .hero .hero-title > span:first-child { display: block; line-height: 1.3; padding-bottom: .08em; }
[dir="rtl"] .hero h1 > span:first-child, [dir="rtl"] .hero .hero-title > span:first-child { line-height: 1.55; padding-bottom: .12em; }
.hero h1 .glow, .hero .hero-title .glow { display: block; line-height: 1.5; margin-top: .18em; padding-bottom: .1em; }
.hero h1 br, .hero .hero-title br { display: none; }

/* ===== "Trending on Hugging Face": heat bars, ember glow on the top three ===== */
.hl-hot { position: relative; overflow: hidden; }
.hl-hot::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,120,60,.18), transparent); filter: blur(4px); animation: hftGlow 6s ease-in-out infinite alternate; }
@keyframes hftGlow { to { transform: translate(-30px, 20px) scale(1.15); opacity: .7; } }
.hl-list li.hft { position: relative; isolation: isolate; padding: 7px 8px; margin: 0 -8px; border-radius: var(--r); border-top-color: transparent; cursor: pointer; transition: background .2s, transform .2s; }
.hl-list li.hft + li.hft { margin-top: 2px; }
.hl-list li.hft:hover { background: color-mix(in srgb, #ff7a3c 8%, transparent); transform: translateX(calc(var(--dirx, 1) * -2px)); }
.hft-bar { position: absolute; inset-inline-start: 0; bottom: 2px; height: 2px; width: var(--heat); border-radius: 999px; z-index: -1; opacity: .75;
  background: linear-gradient(90deg, #ff4d6d, #ff7a3c 55%, #ffc94d); box-shadow: 0 0 10px rgba(255,122,60,.6); transform-origin: inline-start; animation: hftBar 1s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
[dir="rtl"] .hft-bar { background: linear-gradient(270deg, #ff4d6d, #ff7a3c 55%, #ffc94d); }
@keyframes hftBar { from { width: 0; } }
.hft-a { gap: 8px; }
.hft-t { display: grid; min-width: 0; line-height: 1.25; }
.hft-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.hft-t small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hft-l { color: #ff8a5c; font-weight: 700; white-space: nowrap; }
.hft.hot1 .hl-n, .hft.hot2 .hl-n, .hft.hot3 .hl-n { color: #fff; border-radius: var(--r-sm); min-width: 22px; text-align: center; background: linear-gradient(135deg, #ff4d6d, #ff9a3c); box-shadow: 0 0 14px rgba(255,110,60,.45); }
.hft.hot2 .hl-n { background: linear-gradient(135deg, #ff7a3c, #ffc94d); }
.hft.hot3 .hl-n { background: linear-gradient(135deg, #ffb23c, #ffe28a); color: #3a1d00; }
.hft.hot1 .hft-bar { height: 3px; opacity: 1; }
.hft-heat { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.hft-heat i { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); position: relative; overflow: hidden; }
.hft-heat i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--heat); border-radius: inherit; background: linear-gradient(90deg, #ff4d6d, #ff7a3c, #ffc94d); box-shadow: 0 0 10px rgba(255,122,60,.6); }
[dir="rtl"] .hft-heat i::after { inset: 0 0 0 auto; background: linear-gradient(270deg, #ff4d6d, #ff7a3c, #ffc94d); }
.hft-heat b { color: #ff8a5c; }
.hft-caps { display: flex; flex-wrap: wrap; gap: 5px; }
.hft-caps span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }
.hft-fit, .hft-line, .hft-cat { margin: 0; font-size: 12px; }
.hft-line small { color: var(--muted); }
.hft-line b { font-size: 11.5px; overflow-wrap: anywhere; }
.hft-cat { color: #2fb36d; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .hl-hot::before, .hft-bar { animation: none; } }

/* ===== "My settings" panel: profile card, theme swatches, draggable section rows with switches, start-page tiles ===== */
dialog.pf-dlg { width: min(640px, calc(100vw - 24px)); }
.pf { display: grid; gap: 12px; }
.pf-h { margin: 8px 0 0; font-size: 13px; font-weight: 800; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.pf-h small { font-weight: 500; font-size: 11.5px; opacity: .8; }
.pf-me { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-lg); position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 9%, transparent); }
.pf-av { width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff;
  background: conic-gradient(from 210deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 80) 80% 55%), hsl(var(--h) 80% 60%)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--surface) 80%, transparent), 0 10px 26px hsl(var(--h) 80% 40% / .45); }
.pf-who { display: grid; min-width: 0; flex: 1; } .pf-who b { font-size: 16px; } .pf-who small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pf-stat { display: grid; text-align: center; padding: 6px 12px; border-radius: var(--r); background: color-mix(in srgb, var(--text) 5%, transparent); }
.pf-stat b { font-size: 20px; } .pf-stat small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.pf-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.pf-sw { display: grid; gap: 6px; padding: 6px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--text) 9%, transparent); background: color-mix(in srgb, var(--surface-2) 50%, transparent); color: var(--text); font: inherit; font-size: 11.5px; cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s; animation: pfIn .4s ease backwards; animation-delay: calc(var(--i) * 25ms); }
.pf-sw i { height: 38px; border-radius: var(--r); background: linear-gradient(135deg, var(--a) 0 22%, transparent 22%), linear-gradient(135deg, transparent 70%, var(--a2) 70%), linear-gradient(180deg, var(--sf) 0 40%, var(--bg) 40%); box-shadow: inset 0 0 0 1px rgba(127,127,127,.25); }
.pf-sw:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.pf-sw[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.pf-list2 { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pf-row2 { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface-2) 55%, transparent); border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  transition: opacity .2s, transform .2s, border-color .2s, background .2s; animation: pfIn .4s ease backwards; animation-delay: calc(var(--i) * 35ms); }
.pf-row2 b { flex: 1; font-size: 14px; }
.pf-row2.off { opacity: .5; } .pf-row2.off .pf-ico { filter: grayscale(1); }
.pf-row2.drag { opacity: .35; transform: scale(.98); } .pf-row2.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pf-grip { color: var(--muted); cursor: grab; display: grid; opacity: .7; } .pf-row2:active .pf-grip { cursor: grabbing; }
.pf-ico { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; color: var(--accent); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--text) 4%, transparent) 75%); }
.pf-ico svg { width: 17px; height: 17px; }
.pf-mv { display: flex; gap: 4px; }
.pf-mv button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); background: transparent; color: var(--text); cursor: pointer; transition: background .2s, transform .2s; }
.pf-mv button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 16%, transparent); transform: scale(1.06); }
.pf-mv button:disabled { opacity: .3; cursor: default; }
.pf-sw2 { width: 44px; height: 26px; flex: none; border-radius: 999px; border: 0; padding: 3px; cursor: pointer; background: color-mix(in srgb, var(--text) 18%, transparent); transition: background .25s; display: flex; }
.pf-sw2 i { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.pf-sw2[aria-checked="true"] { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.pf-sw2[aria-checked="true"] i { transform: translateX(18px); } [dir="rtl"] .pf-sw2[aria-checked="true"] i { transform: translateX(-18px); }
.pf-sw2:focus-visible, .pf-mv button:focus-visible, .pf-sw:focus-visible, .pf-home button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-lock { font-size: 11px; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.pf-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.pf-home button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--text) 9%, transparent); background: color-mix(in srgb, var(--surface-2) 50%, transparent); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .2s, background .2s; text-align: start; }
.pf-home button span { display: grid; color: var(--muted); } .pf-home button svg { width: 16px; height: 16px; }
.pf-home button:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.pf-home button[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 700; }
.pf-home button[aria-checked="true"] span { color: var(--accent); }
.pf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px dashed color-mix(in srgb, var(--text) 12%, transparent); padding-top: 12px; margin-top: 4px; }
.pf-foot small { flex: 1; min-width: 200px; }
.pf-out { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, #e5484d 45%, transparent); background: color-mix(in srgb, #e5484d 8%, transparent); color: #ff6b6f; font: inherit; font-weight: 700; cursor: pointer; transition: background .2s; }
.pf-out:hover { background: color-mix(in srgb, #e5484d 18%, transparent); }
@keyframes pfIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .pf-sw, .pf-row2 { animation: none; } .pf-sw2 i { transition: none; } }
@media (max-width: 560px) { .pf-mv { display: none; } .pf-stat { display: none; } .pf-themes { grid-template-columns: repeat(4, 1fr); } .pf-sw span { font-size: 10px; } }

/* announcement bar tones + pinned headlines */
.banner[data-tone="info"] { background: linear-gradient(90deg, #1c7ed6, #4dabf7); color: #fff; }
.banner[data-tone="warn"] { background: linear-gradient(90deg, #e8590c, #ffa94d); color: #1a0d00; }
.banner[data-tone="good"] { background: linear-gradient(90deg, #2b8a3e, #51cf66); color: #fff; }
.banner a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.tk-k.k-pin { background: linear-gradient(135deg, #f5b942, #ff7a3c); color: #1a0d00; }

/* fonts first: boot.js hides the page until the site font is ready (max 1.6 s), then everything fades in together */
html.fl body { opacity: 0; }
html.fr body { animation: siteIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes siteIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html.fr body { animation: none; } }

/* ===== one design language: corner tokens, one card shape, one icon style ===== */
:root { --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-card: 20px; }
.card, .table-wrap, .filters, .hl, .co, .nwt, .mm, .kpi, .stat, dialog, .hv, .tm-tip, .lang-list, .pf-me, .ticker { border-radius: var(--r-card); }
.kpi, .stat, .mm, .nwt { border-radius: var(--r-lg); }
.ticker, .chip, .btn, .tab, .lang-switch, .mk-chip, .seg, .tk-k { border-radius: 999px; }
.ui-i { width: 1.12em; height: 1.12em; vertical-align: -.2em; display: inline-block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  color: var(--accent); margin-inline-end: .2em; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 35%, transparent)); }
.ui-i.ui-heart { color: #ff6b8a; filter: none; } .ui-i.ui-flame { color: #ff7a3c; } .ui-i.ui-star { color: #f5b942; fill: color-mix(in srgb, #f5b942 30%, transparent); }
.btn .ui-i, .chip[aria-pressed="true"] .ui-i, .tk-k .ui-i, .num .ui-i, .seg button .ui-i, .tab .ui-i { color: currentColor; filter: none; }
.cap .ui-i { margin: 0; width: 1.05em; height: 1.05em; }

/* theme change pixel wipe */


/* ===== theme switch: three icons in one pill, a thumb slides to the chosen one ===== */
.th-seg { position: relative; box-sizing: border-box; width: 98px; flex: none; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 30px; height: 34px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); isolation: isolate; --i: 0; }
[data-theme="dark"] .th-seg { background: rgba(255,255,255,.035); border-color: var(--hair); }
.th-thumb { position: absolute; z-index: -1; top: 3px; bottom: 3px; width: 30px; inset-inline-start: calc(3px + var(--i) * 30px); border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 4px 14px -4px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: inset-inline-start .35s cubic-bezier(.4,0,.2,1); }
.tools .th-seg button { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 30px; height: 100%; border-radius: 999px; cursor: pointer; color: var(--muted);
  transition: color .25s ease, transform .2s ease; }
.tools .th-seg button:hover { color: var(--text); }
.tools .th-seg button[aria-checked="true"] { color: var(--accent); }
.tools .th-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 720px) { .th-seg { width: 92px; grid-auto-columns: 28px; height: 32px; } .th-thumb { width: 28px; inset-inline-start: calc(3px + var(--i) * 28px); } .tools .th-seg button { width: 28px; } }

/* theme change: the browser's own snapshots do the animation (see themeFx); nothing else may transition meanwhile */
/* the new page shows through: solid disc ∪ (pixel tile ∩ soft disc), all three grown from the centre by themeFx */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 57%, transparent 60%), var(--th-px, linear-gradient(#000, #000)), radial-gradient(circle closest-side, #000 52%, rgba(0,0,0,.5) 66%, transparent 79%);
  mask-image: radial-gradient(circle closest-side, #000 57%, transparent 60%), var(--th-px, linear-gradient(#000, #000)), radial-gradient(circle closest-side, #000 52%, rgba(0,0,0,.5) 66%, transparent 79%);
  -webkit-mask-repeat: no-repeat, repeat, no-repeat; mask-repeat: no-repeat, repeat, no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: 0 0, 72px 72px, 0 0; mask-size: 0 0, 72px 72px, 0 0;
  -webkit-mask-composite: source-over, source-in; mask-composite: add, intersect; }
/* the switch is its own layer: it changes at once, so the thumb slides without waiting for the wave */
.th-seg { view-transition-name: th-seg; }
::view-transition-group(th-seg), ::view-transition-new(th-seg) { animation: none; }
::view-transition-old(th-seg) { animation: none; opacity: 0; }
/* ring of light at the wave front, in the new accents, above everything */
.th-wave { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; contain: strict; view-transition-name: th-wave; }
::view-transition-group(th-wave), ::view-transition-new(th-wave) { animation: none; }
.th-wave i { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%,-50%) scale(0); opacity: 0;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent), var(--accent-2), var(--accent));
  -webkit-mask: radial-gradient(circle closest-side, transparent 80%, rgba(0,0,0,.08) 90%, rgba(0,0,0,.35) 97.6%, #000 98.8%, transparent 100%);
  mask: radial-gradient(circle closest-side, transparent 80%, rgba(0,0,0,.08) 90%, rgba(0,0,0,.35) 97.6%, #000 98.8%, transparent 100%); }
html.th-x *:not(.th-thumb), html.th-x *::before, html.th-x *::after { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .th-thumb { transition: none; } }

/* ===== model map v2: company tiles -> model grid. Only opacity/transform animate, nothing is staggered, text is never cut ===== */
#tmap { overflow: visible; background: transparent; height: 600px; }
#tmap.mm-list { height: auto; direction: inherit; }
#tmap.mm-in { animation: mmIn .22s ease-out; }
@keyframes mmIn { from { transform: translateY(6px); } } /* movement only: the map must never be invisible if the animation does not run */
.mm-co { all: unset; box-sizing: border-box; position: absolute; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; overflow: hidden; cursor: zoom-in;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(0,0,0,.2); direction: var(--mm-dir, rtl);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; }
html[dir="ltr"] .mm-co { --mm-dir: ltr; }
.mm-co:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 24px -8px rgba(0,0,0,.45); z-index: 2; }
.mm-co:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.mm-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mm-h .vi { width: calc(var(--fs) * 1.15); height: calc(var(--fs) * 1.15); flex: none; border-radius: 6px; background: rgba(255,255,255,.92); padding: 2px; box-sizing: border-box; }
.mm-plus { display: grid; place-items: center; color: #222; font-weight: 800; text-shadow: none; }
.mm-h b { font-size: var(--fs); font-weight: 800; line-height: 1.15; white-space: nowrap; }
.mm-n { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 5px; font-size: 12.5px; opacity: .88; line-height: 1.35; }
.mm-n .flag { margin: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.mm-n span { white-space: nowrap; }
.mm-dot { font-style: normal; opacity: .6; }
.mm-m .mm-n, .tm-cur .mm-n { color: var(--muted); opacity: 1; font-size: 12px; }
.mm-m .mm-n .flag, .tm-cur .mm-n .flag { box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent); }
.tm-cur .mm-n { margin-inline-start: 6px; font-weight: 400; }
.tm-tip .flag { margin-inline-end: 4px; }
.mm-top { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; direction: ltr; text-align: start; }
html[dir="rtl"] .mm-top { text-align: end; }
.mm-top i { font-style: normal; font-size: 12.5px; line-height: 16px; white-space: nowrap; opacity: .92; }
.mm-co.xs { padding: 6px; justify-content: center; align-items: center; gap: 2px; }
.mm-co.xs .mm-n { font-size: 11px; }
.mm-h { flex: none; } .mm-co.xs .mm-h .vi { width: 20px; height: 20px; }
.mm-sn { font-size: 11.5px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.mm-co:not(.xs) .mm-sn { margin-top: -2px; }
.mm-k { display: flex; align-items: center; gap: 8px; margin: 14px 2px 8px; font-size: 14px; font-weight: 800; }
.mm-k:first-child { margin-top: 2px; } .mm-k em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.mm-m { all: unset; box-sizing: border-box; position: relative; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; border-radius: 12px; cursor: pointer; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 4px solid var(--c); transition: transform .14s ease, border-color .14s ease, background .14s ease; }
.mm-m:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 60%, var(--border)); background: color-mix(in srgb, var(--c) 10%, var(--surface-2)); }
.mm-m:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mm-m b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.mm-m b .vi { width: 18px; height: 18px; flex: none; }
.mm-m small { color: var(--muted); font-size: 12px; }
.mm-m i { position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; width: var(--w, 0); background: var(--c); opacity: .75; }
.mm-grid.mm-cos .mm-m { cursor: zoom-in; }
@media (max-width: 720px) { #tmap { height: 520px; } .mm-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; } .mm-co { padding: 8px 9px; border-radius: 12px; } .tm-hint { font-size: 11.5px; } }
@media (min-width: 1680px) { #tmap { height: 700px; } }
@media (prefers-reduced-motion: reduce) { #tmap.mm-in { animation: none; } .mm-co, .mm-m { transition: none; } }

/* ===== one form-control system for the whole site =====
   Every dropdown, number field, checkbox, radio and slider looks the same in every section and every browser
   (Chrome, Firefox, Safari, phones): the browser's own arrow/spinner/box is turned off and drawn here instead.
   ":not(#_)" lifts these rules above the older per-section rules without !important. */
:root { --field-bg: var(--surface-2); --field-h: 38px; --field-r: 10px;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6878' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] { --field-bg: rgba(255,255,255,.04);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d8d96' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="midnight"] {
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f9bd0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

select:not(#_), input[type="number"]:not(#_) {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; min-height: var(--field-h); margin: 0;
  padding-block: 0; padding-inline: 12px; border: 1px solid var(--border); border-radius: var(--field-r);
  background-color: var(--field-bg); color: var(--text); font-size: 14px; line-height: calc(var(--field-h) - 2px);
  box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease; }
select:not(#_) { padding-inline-end: 36px; cursor: pointer; text-overflow: ellipsis; white-space: nowrap;
  background-image: var(--chev); background-repeat: no-repeat; background-size: 16px 16px; background-position: right 12px center; }
[dir="rtl"] select:not(#_) { background-position: left 12px center; }
select:not(#_)::-ms-expand { display: none; }
select:not(#_) option { background: var(--surface); color: var(--text); }
select:not(#_):hover, input[type="number"]:not(#_):hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
select:not(#_):focus-visible, input[type="number"]:not(#_):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select:not(#_):disabled, input[type="number"]:not(#_):disabled { opacity: .55; cursor: not-allowed; }
input[type="number"]:not(#_) { -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* checkbox + radio */
input[type="checkbox"]:not(#_), input[type="radio"]:not(#_) {
  -webkit-appearance: none; appearance: none; flex: none; box-sizing: border-box; width: 18px; height: 18px; margin: 0; vertical-align: -4px;
  border: 1.5px solid color-mix(in srgb, var(--text) 30%, var(--border)); border-radius: 5px; background: var(--field-bg) center / 12px 12px no-repeat;
  cursor: pointer; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
input[type="radio"]:not(#_) { border-radius: 50%; }
input[type="checkbox"]:not(#_):checked { border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E"); }
input[type="radio"]:not(#_):checked { border-color: var(--accent); background-color: var(--field-bg); box-shadow: inset 0 0 0 4px var(--accent); }
input[type="checkbox"]:not(#_):focus-visible, input[type="radio"]:not(#_):focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type="radio"]:not(#_):checked:focus-visible { box-shadow: inset 0 0 0 4px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* slider */
input[type="range"]:not(#_) { -webkit-appearance: none; appearance: none; height: 22px; margin: 0; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 14%, var(--field-bg)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 14%, var(--field-bg)); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent); }

@media (max-width: 720px) { :root { --field-h: 40px; } select:not(#_), input[type="number"]:not(#_) { font-size: 16px; } } /* 16px stops iPhone zooming in on tap */
@media (prefers-reduced-motion: reduce) { select:not(#_), input:not(#_) { transition: none; } }

/* ===== token calculator form: two aligned rows, every field the same height ===== */
#tkCalcCard .tk-form { display: grid; gap: 12px; margin: 14px 0 0; align-items: end; }
#tkCalcCard .tk-nums { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); }
#tkCalcCard .tk-opts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px 0 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.tk-form > label { display: grid; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.tk-form > label > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-form .tk-field { box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: var(--field-h); padding-inline: 12px; border: 1px solid var(--border); border-radius: var(--field-r); background: var(--field-bg); color: var(--text); font-size: 14px; }
.tk-form .tk-range .tk-field input { flex: 1; min-width: 0; width: auto; }
.tk-form .tk-range .tk-field b { flex: none; min-width: 3ch; text-align: end; font-size: 13.5px; }
.tk-form .tk-check { display: grid !important; padding: 0 !important; color: var(--muted) !important; }
.tk-form .tk-check .tk-field { cursor: pointer; }
.tk-form select:not(#_), .tk-form input[type="number"]:not(#_) { width: 100%; }
@media (max-width: 900px) { #tkCalcCard .tk-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } #tkCalcCard .tk-nums .tk-range { grid-column: 1 / -1; } #tkCalcCard .tk-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== roadmap: chips, scenario cards and the price switch share one look ===== */
#cxRoads { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 4px 0 10px; }
#cxRoads .road-card { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; min-height: 74px; padding: 12px 14px; border-radius: var(--r-lg); cursor: pointer; text-align: start;
  border: 1px solid var(--border); background: var(--surface); transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
[data-theme="dark"] #cxRoads .road-card { background: rgba(255,255,255,.025); border-color: var(--hair); }
#cxRoads .road-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
#cxRoads .road-card[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
#cxRoads .road-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#cxRoads .rc-emo { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; grid-row: auto; margin: 0;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--accent); }
#cxRoads .rc-emo .ui-i { width: 20px; height: 20px; }
#cxRoads .rc-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#cxRoads .rc-txt b { font-size: 14px; line-height: 1.45; }
#cxRoads .rc-txt small { display: block; color: var(--muted); font-size: 12px; }
#cxTier { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
#cxTier .chip { margin: 0; border: 0; background: transparent; color: var(--muted); padding: 6px 14px; font-size: 13px; box-shadow: none; }
#cxTier .chip:hover { color: var(--text); background: transparent; }
#cxTier .chip[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.14), inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
@media (max-width: 640px) { #cxRoads { grid-template-columns: 1fr; gap: 8px; } #cxRoads .road-card { min-height: 64px; padding: 10px 12px; } }
@media (max-width: 640px) { #tkCalcCard .tk-opts { grid-template-columns: 1fr; } }

/* ===== one corner system for the whole site (was 12-22px cards and full pills everywhere) =====
   cards 12px · controls 8px · parts inside a control 6px · small labels 4px.
   Only bars, slider tracks, switches and the avatar stay round. ":root" lifts these over older per-theme rules. */
:root { --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 10px; --r-xl: 12px; --r-card: 12px; --field-r: 8px; }
:root .chip, :root .btn, :root .hero-cta .btn, :root .lang-switch, :root .icon-btn, :root .mk-chip, :root .mchip, :root .lt-m, :root .co-models a,
:root .tray .pill, :root .hero .badge, :root .tk-badge, :root .pf-out, :root .ticker, :root .tabs, :root .th-seg, :root .seg, :root #cxTier,
:root .gs-open, :root .acct, :root .marquee-track span, :root .pf-lock { border-radius: var(--r); }
:root .tab, :root .tk-i, :root .th-thumb, :root .tools .th-seg button, :root #cxTier .chip, :root .seg button { border-radius: var(--r-sm); }
:root .tag, :root .tk-k, :root .hft-caps span, :root .nc-tp { border-radius: var(--r-xs); }
:root .acct.on { border-radius: 50%; }
:root .card, :root .table-wrap, :root .filters, :root .hl, :root .co, :root .mm, :root .kpi, :root .stat, :root dialog, :root .hv, :root .tm-tip,
:root .lang-list, :root .pf-me, :root .signin-dlg, :root .news-item, :root #cxRoads .road-card, :root .rstep { border-radius: var(--r-card); }

/* ===== model map tiles: calm tint + thin colour bar instead of saturated gradients ===== */
:root .mm-co { border-radius: var(--r); color: var(--text); text-shadow: none;
  background: color-mix(in oklab, var(--c) 13%, var(--surface)); border: 1px solid color-mix(in oklab, var(--c) 28%, var(--border)); border-top: 3px solid var(--c);
  box-shadow: none; }
:root .mm-co:hover { filter: none; background: color-mix(in oklab, var(--c) 20%, var(--surface)); box-shadow: 0 6px 18px -10px rgba(0,0,0,.35); }
:root .mm-co .mm-n { color: var(--muted); opacity: 1; }
:root .mm-co .mm-top i { color: color-mix(in srgb, var(--text) 82%, transparent); opacity: 1; }
:root .mm-h .vi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); }
:root .mm-plus { color: var(--text); }
:root .mm-m { border-radius: var(--r); }

/* ===== news page: a lead story, two side stories, then a card grid. Covers are the company colour + logo, not copied photos ===== */
.nw-top { display: block; margin: 0 0 14px; }
.nw-lead { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
.nw-lead-side { display: grid; gap: 12px; align-content: start; }
#nwList { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.nc { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); transition: border-color .15s ease, transform .15s ease; }
[data-theme="dark"] .nc { background: rgba(255,255,255,.025); border-color: var(--hair); }
.nc:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.nc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nc-cover { flex: none; display: grid; place-items: center; height: 76px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, hsl(var(--h) 55% 50% / .18), hsl(var(--h) 55% 50% / .04)); }
[data-theme="dark"] .nc-cover { border-color: var(--hair); }
.nc-cover .vi { width: 32px; height: 32px; margin: 0; font-size: 28px; }
.nc-body { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px 14px; min-width: 0; }
.nc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.nc-tp { padding: 1px 7px; font-size: 11px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nc b { font-size: 15px; line-height: 1.6; font-weight: 700; overflow-wrap: anywhere; }
.nc-x { color: var(--muted); font-size: 13.5px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc-en { color: var(--muted); font-size: 11.5px; }
.nc-lead .nc-cover { height: 170px; } .nc-lead .nc-cover .vi { width: 60px; height: 60px; font-size: 52px; }
.nc-lead .nc-body { padding: 16px 18px 18px; gap: 9px; } .nc-lead b { font-size: 21px; line-height: 1.5; } .nc-lead .nc-x { font-size: 14.5px; -webkit-line-clamp: 4; }
.nc-side { flex-direction: row; } .nc-side .nc-cover { width: 92px; height: auto; border-bottom: 0; border-inline-end: 1px solid var(--border); }
[data-theme="dark"] .nc-side .nc-cover { border-color: var(--hair); }
.nc-side .nc-x { -webkit-line-clamp: 2; }
.nw-sep { display: inline-block; width: 1px; height: 22px; margin: 0 4px; background: var(--border); vertical-align: middle; }
@media (max-width: 860px) { .nw-lead { grid-template-columns: 1fr; } .nc-lead .nc-cover { height: 120px; } .nc-lead b { font-size: 18px; } }
@media (max-width: 640px) { #nwList { grid-template-columns: 1fr; } .nc-cover { height: 60px; } .nc-side .nc-cover { width: 64px; } }
@media (prefers-reduced-motion: reduce) { .nc { transition: none; } .nc:hover { transform: none; } }

/* ---------- hardware catalogue: one card per GPU / computer / server ---------- */
.hw-cats { margin-bottom: 10px; }
.hwd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.hwd { display: flex; flex-direction: column; gap: 4px; text-align: start; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 12px; min-width: 0;
  transition: border-color .15s, background-color .15s; }
.hwd:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); }
.hwd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hwd[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 9%, var(--surface)); }
.hwd-h { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hwd-h b { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; line-height: 1.35; }
.hwd-h .vi { flex: none; }
.hwd-new { margin-inline-start: auto; flex: none; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-xs);
  color: var(--accent); background: color-mix(in oklab, var(--accent) 13%, transparent); }
.hwd-mem { font-size: 20px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.hwd-spec { font-size: 12px; color: var(--muted); }
.hwd-f { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; }
.hwd-f span:last-child { color: var(--text); font-weight: 600; }
.hwd-fit { font-size: 11.5px; color: var(--muted); }
.hwd[aria-pressed="true"] .hwd-fit { color: var(--accent); font-weight: 600; }
#hwDevNote { margin-top: 10px; margin-bottom: 14px; }
@media (max-width: 640px) { .hwd-grid { grid-template-columns: 1fr 1fr; gap: 6px; } .hwd { padding: 9px 10px; } .hwd-mem { font-size: 17px; } .hwd-f { flex-direction: column; gap: 0; } }

/* specialist field of a model (medicine, maths…) next to its kind */
.dom-tag { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: var(--r-xs); font-size: 11px; font-weight: 600; line-height: 1.6;
  color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 12%, transparent); white-space: nowrap; vertical-align: 1px; }


/* ===== header: ONE row on every screen (logo · section links · tools).
   app.js fitNav() measures it: it first tightens the links (hc1), then shortens search to an icon (hc2), then hides
   the tagline (hc3); if the links still don't fit they fold into the «menu» button (nav-fold) and open as a panel. ===== */
.top .top-inner { position: relative; flex-wrap: nowrap; row-gap: 0; gap: 12px; padding-block: 10px; }
.top .top-inner > .brand { flex: none; order: 0; min-width: 0; }
.top .top-inner > .tools { flex: none; order: 2; margin-inline-start: 0; }
[data-theme] .top .top-inner > nav.tabs { order: 1; flex: 0 1 auto; width: auto; min-width: 0; max-width: none; margin: 0 auto; flex-wrap: nowrap; overflow: hidden;
  -webkit-mask-image: none; mask-image: none; }
.top.hc1 .top-inner > nav.tabs { gap: 0; }
[data-theme] .top.hc1 .top-inner > nav.tabs .tab { padding-inline: 10px; }
.top.hc2 .gs-open { min-width: 0; padding: 0 10px; }
.top.hc2 .gs-open .gs-l, .top.hc2 .gs-open kbd { display: none; }
.top.hc3 .brand small { display: none; }
/* the menu button: only when the links are folded */
.tools button.nav-menu { display: none; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; }
.tools button.nav-menu:hover { border-color: var(--accent); }
.top.nav-fold .tools button.nav-menu { display: inline-flex; }
.top.nav-open .tools button.nav-menu { border-color: var(--accent); color: var(--accent); }
.top.hc3 .nav-menu .nm-l { display: none; }
.top.hc3 .tools button.nav-menu { width: 36px; padding: 0; justify-content: center; }
[data-theme="dark"] .tools button.nav-menu { background: rgba(255,255,255,.04); border-color: var(--hair); }
[data-theme] .top.nav-fold .top-inner > nav.tabs { display: none; }
/* folded links open as a panel under the header */
[data-theme] .top.nav-fold.nav-open .top-inner > nav.tabs { display: grid; position: absolute; z-index: 50; top: calc(100% + 6px); inset-inline: 12px; margin: 0; padding: 8px; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: calc(100vh - 100px); overflow: auto; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 18px 50px -12px rgba(0,0,0,.35); }
[data-theme="dark"] .top.nav-fold.nav-open .top-inner > nav.tabs { background: #111114; border-color: var(--hair); }
[data-theme] .top.nav-open .top-inner > nav.tabs .tab { justify-content: flex-start; margin: 0; padding: 11px 14px; border-radius: var(--r); }
.top.nav-open .top-inner > nav.tabs .tab.gs::before { display: none; }
@media (max-width: 480px) { [data-theme] .top.nav-fold.nav-open .top-inner > nav.tabs { grid-template-columns: 1fr 1fr; inset-inline: 8px; } }
@media (prefers-reduced-motion: no-preference) { .top.nav-open .top-inner > nav.tabs { animation: navIn .16s ease-out; } }
@keyframes navIn { from { opacity: 0; transform: translateY(-4px); } }
.top.nav-open .top-inner > nav.tabs .tab.hot::after { position: static; flex: none; align-self: center; width: 6px; height: 6px; margin-inline-start: 2px; }
/* very small phones: logo only, tighter gaps */
.top.hc4 .brand > div:last-child { display: none; }
.top.hc4 .top-inner { gap: 6px; padding-inline: 10px; }
.top.hc4 .tools { gap: 4px; }
.top.hc4 .lang-switch { min-width: 0; padding-inline: 8px; }

/* roadmap: search + level filter, level / free badges on each card */
.cx-rfilter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 10px 0 8px; }
.cx-rfilter input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.field-chips .chip[disabled] { opacity: .4; cursor: default; }
.road-card .rc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.road-card .rc-tags > span { font-size: 11px; font-weight: 600; line-height: 1.6; padding: 0 6px; border-radius: var(--r-xs); white-space: nowrap; }
.rc-lvl.start { color: var(--text); background: color-mix(in srgb, var(--c6) 24%, transparent); }
.rc-lvl.pro { color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 13%, transparent); }
.rc-free { color: var(--muted); background: color-mix(in oklab, var(--text) 7%, transparent); }
.rc-f { color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); }
#cxRoads .empty { grid-column: 1 / -1; padding: 14px 4px; }
@media (max-width: 640px) { .road-card small:not(.rc-tags *) { display: none; } .cx-rfilter input[type="search"] { max-width: none; } }

/* coding: agent bar in the compare table, roadmap cost across coding models */
.cmp-table .pr-bar.ag { display: inline-block; width: 56px; vertical-align: middle; margin-inline-end: 6px; }
.cx-codecmp { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line, color-mix(in srgb, var(--text) 12%, transparent)); }
.cx-codecmp h4 { margin: 0 0 2px; }
.cx-codecmp tr.best td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cx-codecmp .cc-n { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cx-codecmp .cc-n small { color: var(--muted); }

/* ===== header: logo only, theme as one icon with a drop-down, all header buttons the same size ===== */
a.brand { text-decoration: none; color: inherit; flex: none; }
a.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r); }
.top .brand .logo { width: 36px; height: 36px; }
/* one size for every icon button in the header: search, theme, account, language, menu */
.top .tools { gap: 6px; }
.top .tools .gs-open, .top .tools .th-btn, .top .tools .acct, .top .tools .lang-switch, .top .tools .nav-menu {
  box-sizing: border-box; height: 36px; min-width: 36px; border-radius: var(--r-sm, 8px); }
.top .tools .th-btn, .top .tools .acct, .top .tools .lang-switch { width: 36px; padding: 0; display: inline-grid; place-items: center; }
.top .tools .gs-open svg, .top .tools .th-btn svg, .top .tools .lang-switch svg { width: 18px; height: 18px; }
.top .tools .lang-switch > span { display: none; } /* the globe alone; the list shows the language names */
.th-menu { position: relative; }
.th-menu > summary { list-style: none; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
[data-theme="dark"] .th-menu > summary { background: rgba(255,255,255,.04); border-color: var(--hair); }
.th-menu > summary::-webkit-details-marker { display: none; }
.th-menu > summary:hover, .th-menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.th-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-list { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; min-width: 160px; display: grid; gap: 2px; padding: 5px; border-radius: var(--r);
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: lmIn .16s ease; }
.tools .th-list button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm, 8px);
  cursor: pointer; color: var(--text); font-weight: 600; font-size: 14px; }
.tools .th-list button svg { flex: none; opacity: .8; }
.tools .th-list button:hover, .tools .th-list button:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tools .th-list button[aria-checked="true"] { color: var(--accent); }
.tools .th-list button[aria-checked="true"]::after { content: "✓"; margin-inline-start: auto; }
@media (prefers-reduced-motion: reduce) { .th-list { animation: none; } }
/* when search shrinks to its icon it becomes the same 36px square as the others */
.top.hc2 .tools .gs-open { width: 36px; padding: 0; justify-content: center; }
@media (max-width: 720px) { .top .tools .gs-open { width: 36px; padding: 0; justify-content: center; } }
/* language button: same surface and border as the theme and search buttons */
.top .tools .lang-switch { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
[data-theme="dark"] .top .tools .lang-switch { background: rgba(255,255,255,.04); border-color: var(--hair); }
.top .tools .lang-switch:hover, .top .tools .lang-menu[open] > .lang-switch { border-color: var(--accent); color: var(--accent); }

/* ===== header round 2: mark-only logo, no frame around the menu bar ===== */
.top .brand .logo { font-size: 0; color: var(--accent-ink); }
.top .brand .logo svg { position: relative; z-index: 1; display: block; }
[data-theme] .top:not(.nav-open) .top-inner > nav.tabs { background: none; border-color: transparent; box-shadow: none; }

/* ===== appearance panel (header theme icon) ===== */
.th-list.ap { width: 288px; max-width: calc(100vw - 24px); min-width: 0; padding: 12px; gap: 12px; }
.ap .ap-h { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.ap .ap-sec { display: grid; gap: 6px; }
.ap .ap-row { grid-auto-flow: column; justify-content: space-between; align-items: center; }
.ap .ap-l { font-size: 13px; font-weight: 600; color: var(--text); }
.ap .ap-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tools .ap .ap-modes button { all: unset; box-sizing: border-box; display: grid; justify-items: center; gap: 4px; padding: 8px 2px; border-radius: var(--r-sm, 8px);
  border: 1px solid var(--border); cursor: pointer; color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; }
.tools .ap .ap-modes button:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.tools .ap .ap-modes button[aria-checked="true"] { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ap .ap-sw { display: flex; gap: 8px; flex-wrap: wrap; }
.tools .ap .ap-sw button { all: unset; box-sizing: border-box; width: 26px; height: 26px; border-radius: 50%; background: var(--sw); cursor: pointer;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: box-shadow .15s; }
.tools .ap .ap-sw button:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.tools .ap .ap-sw button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.ap .ap-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; border-radius: var(--r-sm, 8px); background: var(--surface-2); }
.tools .ap .ap-seg button { all: unset; box-sizing: border-box; display: grid; place-items: center; min-height: 30px; padding: 4px 6px; border-radius: calc(var(--r-sm, 8px) - 2px);
  cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; }
.tools .ap .ap-seg button:hover { color: var(--text); }
.tools .ap .ap-seg button[aria-checked="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tools .ap .ap-seg button b { line-height: 1; font-weight: 700; }
.tools .ap .ap-f-vazir { font-family: "Vazirmatn", "Inter", sans-serif !important; }
.tools .ap .ap-f-system { font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif !important; }
.tools .ap .ap-switch { all: unset; box-sizing: border-box; position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border); cursor: pointer; transition: background .2s; }
.tools .ap .ap-switch i { position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.tools .ap .ap-switch[aria-checked="true"] { background: var(--accent); }
.tools .ap .ap-switch[aria-checked="true"] i { inset-inline-start: 19px; }
.tools .ap :is(button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tools .ap .ap-reset { all: unset; box-sizing: border-box; justify-self: start; padding: 4px 0; font-size: 12.5px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tools .ap .ap-reset:hover { color: var(--accent); }
.tools .th-list.ap button::after { content: none !important; }
[data-theme="dark"] .ap .ap-seg, [data-theme="midnight"] .ap .ap-seg { background: rgba(255,255,255,.05); }
[data-theme="dark"] .tools .ap .ap-seg button[aria-checked="true"], [data-theme="midnight"] .tools .ap .ap-seg button[aria-checked="true"] { background: rgba(255,255,255,.1); }

/* accent colours (light themes use the deeper shade, dark themes the lighter one) */
:root[data-accent="blue"]   { --accent: #2563eb; --accent-ink: #fff; }
:root[data-accent="violet"] { --accent: #7c3aed; --accent-ink: #fff; }
:root[data-accent="green"]  { --accent: #059669; --accent-ink: #fff; }
:root[data-accent="orange"] { --accent: #ea580c; --accent-ink: #fff; }
:root[data-accent="pink"]   { --accent: #db2777; --accent-ink: #fff; }
:root[data-accent="blue"]:is([data-theme="dark"], [data-theme="midnight"])   { --accent: #60a5fa; --accent-ink: #08080a; }
:root[data-accent="violet"]:is([data-theme="dark"], [data-theme="midnight"]) { --accent: #a78bfa; --accent-ink: #08080a; }
:root[data-accent="green"]:is([data-theme="dark"], [data-theme="midnight"])  { --accent: #34d399; --accent-ink: #08080a; }
:root[data-accent="orange"]:is([data-theme="dark"], [data-theme="midnight"]) { --accent: #fb923c; --accent-ink: #08080a; }
:root[data-accent="pink"]:is([data-theme="dark"], [data-theme="midnight"])   { --accent: #f472b6; --accent-ink: #08080a; }

/* font */
html[data-font="vazir"] :is(body, button, input, select, textarea) { font-family: "Vazirmatn", "Inter", system-ui, sans-serif; }
html[data-font="system"] :is(body, button, input, select, textarea) { font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
/* text size: the whole page scales, so spacing stays in proportion */
html[data-fs="sm"] body { zoom: .92; }
html[data-fs="lg"] body { zoom: 1.1; }
/* reduce motion */
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
/* small screens: the panel spans the width under the header instead of hanging off one side */
@media (max-width: 720px) { .th-list.ap { position: fixed; top: 62px; inset-inline: 12px; width: auto; max-width: none; max-height: calc(100vh - 80px); overflow-y: auto; } }

/* ===== model pages (/model/<slug>/): facts + related links, official sources first ===== */
.mp-body { min-height: 100vh; }
.mp-top { display: flex; align-items: center; gap: 14px; max-width: 1080px; margin: 0 auto; padding: 14px 16px; }
.mp-top .logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.mp-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--muted); }
.mp-crumb a { color: var(--muted); text-decoration: none; } .mp-crumb a:hover { color: var(--accent); }
.mp-crumb > span:last-child { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp { max-width: 1080px; margin: 0 auto; padding: 8px 16px 40px; }
.mp-head { display: flex; align-items: center; gap: 14px; margin: 10px 0 8px; }
.mp-head .vi { width: 48px; height: 48px; flex: none; }
.mp-head h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.25; overflow-wrap: anywhere; }
.mp-sub { margin: 4px 0 0; color: var(--muted); }
.mp-desc { max-width: 75ch; line-height: 1.8; color: var(--text); }
.mp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 22px; }
.mp-actions .btn { text-decoration: none; }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .mp-grid { grid-template-columns: 1fr; } }
.mp-sec { border: 1px solid var(--border); border-radius: var(--r-lg, 14px); background: var(--surface); padding: 16px; }
.mp-linkcol { display: grid; gap: 16px; }
.mp-sec h2 { margin: 0 0 12px; font-size: 15px; color: var(--muted); font-weight: 700; }
.mp-facts .kv { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.mp-facts .kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mp-facts .kv > div:last-child { border-bottom: 0; }
.mp-facts dt { color: var(--muted); } .mp-facts dd { margin: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.mp-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.mp-links a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r, 10px); border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--surface-2); transition: border-color .15s, color .15s; }
.mp-links a:hover, .mp-links a:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.mp-links svg { flex: none; color: var(--accent); }
.mp-links span { display: grid; min-width: 0; }
.mp-links b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-links small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="dark"] .mp-sec, [data-theme="midnight"] .mp-sec { background: rgba(255,255,255,.025); }
[data-theme="dark"] .mp-links a, [data-theme="midnight"] .mp-links a { background: rgba(255,255,255,.035); }
.mp-foot { max-width: 1080px; margin: 0 auto; padding: 18px 16px 30px; color: var(--muted); font-size: 13px; }
.mp-foot a { color: var(--muted); }

/* hover card: the pointer can move onto it (it stays open until the pointer leaves it) */
.hv { pointer-events: auto; }
.hv::before { content: ""; position: absolute; inset-inline: 0; top: -12px; height: 12px; }
.hv.up::before { top: auto; bottom: -12px; }

/* ===== compare: layout adapts to the number of models (app.js cmpFit) ===== */
.cmp-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.cmp-grid.wide { grid-template-columns: minmax(0, 1fr); }
.cmp-grid.wide .cmp-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: stretch; } /* cards in a row: one height */
/* full width: every model column visible, cells shrink and wrap instead of scrolling */
@media (min-width: 721px) {
  .cmp-grid.wide .cmp-table { width: 100%; table-layout: fixed; }
  .cmp-grid.wide .cmp-table thead th.cmp-th, .cmp-grid.wide .cmp-table tbody td:not(:first-child) { min-width: 0; }
  .cmp-grid.wide .cmp-table thead th:first-child, .cmp-grid.wide .cmp-table td:first-child { width: 150px; min-width: 0; }
  .cmp-grid.wide .cmp-table td, .cmp-grid.wide .cmp-table th { overflow-wrap: anywhere; }
  .cmp-grid.wide[data-n="7"] .cmp-table, .cmp-grid.wide[data-n="8"] .cmp-table { font-size: 13px; }
}

/* ===== maker country flags (SVG, no emoji: Windows does not draw flag emoji). <i class="flag" data-cc="US"> ===== */
.flag { display: inline-block; width: 18px; height: 12px; border-radius: 2px; vertical-align: -1px; flex: none; background: var(--surface-2) center / cover no-repeat; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent); margin-inline-end: 5px; }
.flag[data-cc="US"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23b22234'%2F%3E%3Cpath%20d%3D'M0%203.08h30M0%206.15h30M0%209.23h30M0%2012.3h30M0%2015.4h30M0%2018.5h30'%20stroke%3D'%23fff'%20stroke-width%3D'1.54'%2F%3E%3Crect%20width%3D'13'%20height%3D'10.77'%20fill%3D'%233c3b6e'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="CN"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23de2910'%2F%3E%3Cpath%20fill%3D'%23ffde00'%20d%3D'M5.5%202.5l1.2%203.6h3.8L7.4%208.4l1.2%203.6-3.1-2.2-3.1%202.2%201.2-3.6L.5%206.1h3.8z'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="FR"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'10'%20height%3D'20'%20fill%3D'%230055a4'%2F%3E%3Crect%20x%3D'10'%20width%3D'10'%20height%3D'20'%20fill%3D'%23fff'%2F%3E%3Crect%20x%3D'20'%20width%3D'10'%20height%3D'20'%20fill%3D'%23ef4135'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="DE"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'6.67'%20fill%3D'%23000'%2F%3E%3Crect%20y%3D'6.67'%20width%3D'30'%20height%3D'6.67'%20fill%3D'%23dd0000'%2F%3E%3Crect%20y%3D'13.33'%20width%3D'30'%20height%3D'6.67'%20fill%3D'%23ffce00'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="GB"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23012169'%2F%3E%3Cpath%20d%3D'M0%200l30%2020M30%200L0%2020'%20stroke%3D'%23fff'%20stroke-width%3D'4'%2F%3E%3Cpath%20d%3D'M0%200l30%2020M30%200L0%2020'%20stroke%3D'%23c8102e'%20stroke-width%3D'1.6'%2F%3E%3Cpath%20d%3D'M15%200v20M0%2010h30'%20stroke%3D'%23fff'%20stroke-width%3D'6'%2F%3E%3Cpath%20d%3D'M15%200v20M0%2010h30'%20stroke%3D'%23c8102e'%20stroke-width%3D'3.6'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="CA"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23fff'%2F%3E%3Crect%20width%3D'7.5'%20height%3D'20'%20fill%3D'%23d52b1e'%2F%3E%3Crect%20x%3D'22.5'%20width%3D'7.5'%20height%3D'20'%20fill%3D'%23d52b1e'%2F%3E%3Cpath%20fill%3D'%23d52b1e'%20d%3D'M15%203.5l1.3%202.5%201.7-.7-.6%203.8%202.1-1.5.5%201.5%201.7-.3-1.1%202.1.9.6-3.4%202.1-.2%201.6h-1.6v2.3h-.6v-2.3h-1.6l-.2-1.6-3.4-2.1.9-.6-1.1-2.1%201.7.3.5-1.5%202.1%201.5-.6-3.8%201.7.7z'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="KR"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23fff'%2F%3E%3Ccircle%20cx%3D'15'%20cy%3D'10'%20r%3D'5'%20fill%3D'%23c60c30'%2F%3E%3Cpath%20d%3D'M10%2010a5%205%200%200%200%2010%200%202.5%202.5%200%200%200-5%200%202.5%202.5%200%200%201-5%200'%20fill%3D'%23003478'%2F%3E%3Cpath%20d%3D'M4.5%204.5l3%202M22.5%2013.5l3%202M4.5%2015.5l3-2M22.5%206.5l3-2'%20stroke%3D'%23000'%20stroke-width%3D'1.3'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="AE"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23fff'%2F%3E%3Crect%20width%3D'30'%20height%3D'6.67'%20fill%3D'%2300732f'%2F%3E%3Crect%20y%3D'13.33'%20width%3D'30'%20height%3D'6.67'%20fill%3D'%23000'%2F%3E%3Crect%20width%3D'8'%20height%3D'20'%20fill%3D'%23ff0000'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="IL"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23fff'%2F%3E%3Crect%20y%3D'2'%20width%3D'30'%20height%3D'3'%20fill%3D'%230038b8'%2F%3E%3Crect%20y%3D'15'%20width%3D'30'%20height%3D'3'%20fill%3D'%230038b8'%2F%3E%3Cpath%20d%3D'M15%206.4l3.1%205.3h-6.2zM15%2013.6l-3.1-5.3h6.2z'%20fill%3D'none'%20stroke%3D'%230038b8'%20stroke-width%3D'.9'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="JP"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23fff'%2F%3E%3Ccircle%20cx%3D'15'%20cy%3D'10'%20r%3D'6'%20fill%3D'%23bc002d'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="IN"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'6.67'%20fill%3D'%23ff9933'%2F%3E%3Crect%20y%3D'6.67'%20width%3D'30'%20height%3D'6.67'%20fill%3D'%23fff'%2F%3E%3Crect%20y%3D'13.33'%20width%3D'30'%20height%3D'6.67'%20fill%3D'%23138808'%2F%3E%3Ccircle%20cx%3D'15'%20cy%3D'10'%20r%3D'2.6'%20fill%3D'none'%20stroke%3D'%23000080'%20stroke-width%3D'.8'%2F%3E%3C%2Fsvg%3E"); }
.flag[data-cc="CH"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2030%2020'%3E%3Crect%20width%3D'30'%20height%3D'20'%20fill%3D'%23d52b1e'%2F%3E%3Cpath%20d%3D'M13%204h4v4h4v4h-4v4h-4v-4H9V8h4z'%20fill%3D'%23fff'%2F%3E%3C%2Fsvg%3E"); }

/* ===== hardware: where a model runs, and whether it is worth running on given hardware ===== */
.run, .hvd { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.run-cloud { color: #2563eb; background: color-mix(in srgb, #2563eb 12%, transparent); }
.run-local { color: #059669; background: color-mix(in srgb, #059669 12%, transparent); }
.run-both { color: #7c3aed; background: color-mix(in srgb, #7c3aed 12%, transparent); }
.hvd-great { color: #047857; background: color-mix(in srgb, #10b981 16%, transparent); }
.hvd-good { color: #0369a1; background: color-mix(in srgb, #0ea5e9 14%, transparent); }
.hvd-tight, .hvd-slow { color: #b45309; background: color-mix(in srgb, #f59e0b 16%, transparent); }
.hvd-useless, .hvd-no { color: #b91c1c; background: color-mix(in srgb, #ef4444 14%, transparent); }
.hvd-cloud, .hvd-na { color: var(--muted); background: var(--surface-2); }
:is([data-theme="dark"], [data-theme="midnight"]) .run-cloud { color: #93c5fd; }
:is([data-theme="dark"], [data-theme="midnight"]) .run-local { color: #6ee7b7; }
:is([data-theme="dark"], [data-theme="midnight"]) .run-both { color: #c4b5fd; }
:is([data-theme="dark"], [data-theme="midnight"]) .hvd-great { color: #6ee7b7; }
:is([data-theme="dark"], [data-theme="midnight"]) .hvd-good { color: #7dd3fc; }
:is([data-theme="dark"], [data-theme="midnight"]) :is(.hvd-tight, .hvd-slow) { color: #fcd34d; }
:is([data-theme="dark"], [data-theme="midnight"]) :is(.hvd-useless, .hvd-no) { color: #fca5a5; }
.mp-hw h3 { margin: 14px 0 8px; font-size: 14px; color: var(--muted); }
.mp-hw dt small { color: var(--muted); font-weight: 400; }
.mp-hwt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mp-hwt th, .mp-hwt td { padding: 7px 4px; border-bottom: 1px solid var(--border); text-align: start; }
.mp-hwt tr:last-child > * { border-bottom: 0; }
.mp-hwt th { font-weight: 600; white-space: nowrap; }
.mp-hwt td:last-child { color: var(--muted); font-size: 12.5px; }

/* ---------- subscription plans (#p-plans) ---------- */
.pl-head { margin-bottom: 12px; }
.pl-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; }
.pl-bar .chips { grid-column: auto; }
.pl-bill { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.pl-bill .chip { border: 0; background: transparent; }
.pl-bill .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
/* cards of a row are one height and share 10 rows (head, price, billing line, notes, models, 4 feature groups, source),
   so the same part sits at the same height in every card; the column count comes from app.js (--pl-cols, even rows) */
.pl-grid { display: grid; grid-template-columns: repeat(var(--pl-cols, 4), minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; align-items: stretch; }
.pl-card { display: flex; flex-direction: column; gap: 8px; position: relative; min-width: 0; transition: transform .2s ease, box-shadow .2s ease; }
@supports (grid-template-rows: subgrid) {
  .pl-card { display: grid; grid-template-rows: subgrid; grid-row: span 10; row-gap: 8px; align-content: start; }
}
.pl-card:hover { transform: translateY(-2px); }
.pl-card.best-buy { border-color: color-mix(in srgb, var(--accent-2) 60%, var(--border)); }
.pl-top { display: flex; align-items: center; gap: 10px; }
.pl-top > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pl-top b, .pl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-top b { font-size: 13px; color: var(--muted); font-weight: 600; }
.pl-name { font-size: 17px; font-weight: 800; line-height: 1.4; }
.pl-top .vi { flex: none; }
.pl-top .tag { flex: none; align-self: flex-start; }
.pl-price { margin: 0; display: flex; align-items: baseline; gap: 4px; }
.pl-price b { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.pl-price span { color: var(--muted); font-size: 13px; }
.pl-sub { margin: -6px 0 0; min-height: 1.2em; }
.pl-notes { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.pl-notes:empty { min-height: 0; }
.pl-models { align-content: flex-start; }
.tag.warn { background: color-mix(in srgb, var(--c3) 22%, transparent); border-color: transparent; }
.pl-models { display: flex; flex-wrap: wrap; gap: 4px; }
.pl-models .mchip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.pl-g h4 { margin: 6px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pl-g dl { margin: 0; }
.pl-g dl > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.pl-g dl > div:last-child { border-bottom: 0; }
.pl-g dt { color: var(--text); }
.pl-g dd { margin: 0; text-align: end; }
.pl-v { font-weight: 700; }
.pl-v.yes { color: var(--accent-2); }
.pl-v.no, .pl-v.unk { color: var(--muted); font-weight: 500; }
.pl-v.l { color: var(--c3); }
.pl-v.m { color: var(--accent); }
.pl-v.x { color: var(--c4); }
.pl-src { margin: auto 0 0; align-self: end; padding-top: 6px; border-top: 1px solid var(--border); color: var(--muted); }
.pl-mx { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-mx th, .pl-mx td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.pl-mx th[scope="row"] { white-space: nowrap; font-weight: 700; }
.pl-mx th[scope="row"] .vi { margin-inline-end: 6px; }
.pl-cell { display: flex; justify-content: space-between; gap: 8px; width: 100%; min-width: 120px; margin: 2px 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.pl-cell.on { border-color: var(--accent); }
.pl-cell:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.pl-warn { color: var(--c3); font-weight: 800; }
@media (max-width: 600px) { .pl-grid { grid-template-columns: 1fr; } .pl-price b { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .pl-card { transition: none; } .pl-card:hover { transform: none; } }

/* Tokens: the six stat cards wrap evenly — 6, 3 or 2 per row, never 5 + 1 */
#tkKpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { #tkKpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1180px) { #tkKpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* status bubbles: [hidden] must win over their display: flex (they were invisible boxes left in the page) */
.toast[hidden], .sort-bubble[hidden] { display: none; }

/* ---------- tables: fit the frame, same alignment in every row (1.7.1) ----------
   Headers may wrap so numeric columns stay narrow; long names, architectures and GPU names stop at a width with "…"
   (app.js adds the full text as a tooltip); numbers are centred, under a centred header, in every language; the first
   column stays in view while scrolling sideways, and a shadow on the end side shows there is more to scroll. */
thead th { white-space: normal; vertical-align: bottom; line-height: 1.3; min-width: 56px; text-align: center; }
thead th:first-child { text-align: start; }
td.num { text-align: center; }
td.name { white-space: nowrap; min-width: 170px; max-width: 250px; }
td.name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.name b a { display: inline; }
td.name b .vi { vertical-align: -4px; margin-inline-end: 6px; }
td.name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.ltr { max-width: 170px; overflow: hidden; text-overflow: ellipsis; text-align: center; }
td.gpu { max-width: 210px; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: center; } /* LTR names: cut at their end, not their start */
.table-wrap thead th:first-child, .table-wrap tbody td:first-child { position: sticky; inset-inline-start: 0; }
.table-wrap thead th:first-child { z-index: 3; }
.table-wrap tbody td:first-child { z-index: 1; background: var(--surface); }
.table-wrap tbody tr:hover td:first-child { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.table-wrap.x-scroll { box-shadow: var(--shadow), inset -16px 0 14px -14px rgba(0, 0, 0, .28); }
html[dir="rtl"] .table-wrap.x-scroll { box-shadow: var(--shadow), inset 16px 0 14px -14px rgba(0, 0, 0, .28); }
.table-wrap.x-scroll.at-end { box-shadow: var(--shadow); }
/* hardware table: 14 columns; under 1600px the popularity column (13th) steps aside and names get a little narrower,
   so the table fits its frame at 1440px; below that it scrolls with the first column pinned */
@media (max-width: 1599px) {
  #p-hardware table :is(th, td):nth-child(13) { display: none; }
  #p-hardware td.name { max-width: 210px; }
  #p-hardware td.gpu { max-width: 180px; }
}
/* type and access cells hold several tags: wrap inside a fixed width instead of widening the table */
td.kind, td.acc { white-space: normal; min-width: 90px; max-width: 170px; line-height: 1.7; }
#p-hardware th, #p-hardware td { padding-inline: 8px; }
/* model name inside a table cell: its own direction, cut at its end */
td.name b { display: flex; align-items: center; gap: 0; }
td.name b > a { display: flex; align-items: center; min-width: 0; overflow: hidden; }
td.name .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.name b .vi { flex: none; }
td.name b .star { flex: none; }
/* dark theme: the pinned first column takes the table's own (near-black) background, not the lighter surface */
[data-theme="dark"] .table-wrap tbody td:first-child { background: color-mix(in srgb, #fff 2.5%, var(--bg)); }
[data-theme="dark"] .table-wrap tbody tr:hover td:first-child { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }

/* ---------- news story page (/news/<slug>/), story tags, model-card excerpts, "how to run", plan pages (1.8.0) ---------- */
.nwp { border: 1px solid var(--border); border-radius: var(--r-lg, 14px); background: var(--surface); overflow: hidden; margin: 12px 0 16px; }
.nwp-cover { display: grid; place-items: center; height: 150px; background: radial-gradient(120% 140% at 20% 0%, hsl(var(--h) 70% 55% / .35), transparent 60%), linear-gradient(135deg, hsl(var(--h) 55% 45% / .28), hsl(calc(var(--h) + 40) 60% 50% / .18)); border-bottom: 1px solid var(--border); }
.nwp-cover .vi { width: 64px; height: 64px; font-size: 56px; margin: 0; }
.nwp > :not(.nwp-cover) { margin-inline: 20px; }
.nwp-meta { margin-top: 14px; color: var(--muted); font-size: 13px; }
.nwp h1 { font-size: clamp(22px, 3.4vw, 30px); line-height: 1.45; margin: 6px 20px 10px; }
.nwp-sum { font-size: 17px; line-height: 2; margin-bottom: 10px; }
.nwp-ctx { color: var(--muted); line-height: 1.9; }
.nwp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 20px; }
.nwp-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.nwp-tag .vi { width: 16px; height: 16px; margin: 0; }
.nwp-tag:hover, .nwp-tag:focus-visible { border-color: var(--accent); color: var(--accent); }
.nwp-tag.k-topic { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.nwp-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 20px 6px; }
.nwp-go .btn { font-size: 15px; padding: 10px 18px; }
.nwp-note { margin-bottom: 18px; }
.nwp-rel { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nwp-rel li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r, 10px); }
.nwp-rel li a { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; min-width: 0; }
.nwp-rel li a:hover { color: var(--accent); }
.nwp-rel li a > span { overflow: hidden; text-overflow: ellipsis; }
.nwp-rel .vi { width: 18px; height: 18px; flex: none; margin: 0; }
.nwp-rel .nolink { font-weight: 600; }
.nc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.nc-tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.nc-tag.k-co { color: var(--text); }
.chip.nw-tagon { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mp-card { margin: 14px 0 20px; }
.mp-card p { line-height: 1.95; margin: 0 0 10px; }
.mp-card h3, .mp-run h3 { font-size: 14px; margin: 14px 0 6px; }
.mp-bench { max-height: none; margin: 6px 0 10px; box-shadow: none; }
.mp-bench table { font-size: 13px; }
.mp-run { margin-top: 20px; }
.mp-code { margin: 0 0 8px; padding: 10px 12px; border-radius: var(--r, 10px); background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; text-align: left; }
.plp-price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.plp-price > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg, 14px); background: var(--surface); }
.plp-price b { font-size: 26px; font-weight: 900; }
.pl-more { font-weight: 700; }
@media (max-width: 760px) { .nwp-cover { height: 110px; } .nwp-sum { font-size: 16px; } }
.mp-sec h3 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.mp-sec h3:first-child { margin-top: 0; }
/* model page: long commands scroll inside their box instead of widening the column (phones) */
.mp-linkcol, .mp-sec { min-width: 0; }
.mp-code { max-width: 100%; }
.mp-linkcol { grid-template-columns: minmax(0, 1fr); }
/* "runs on common hardware" table on model pages: cells wrap on phones instead of widening the page */
.mp-hwt th, .mp-hwt td { white-space: normal; }
.mp-hwt td.ltr { max-width: none; overflow: visible; text-align: end; }
.mp-hwt th[scope="row"] { white-space: nowrap; }

/* ---------- model page: icon row of every link, table of contents, numbered quick start, deep-link highlight (1.8.2) ---------- */
.mp-iconbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.mp-iconbar a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.mp-iconbar a:hover, .mp-iconbar a:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.mp-toc { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; margin: 10px 0 14px; padding: 6px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); scrollbar-width: none; }
.mp-toc::-webkit-scrollbar { display: none; }
.mp-toc a { flex: none; padding: 5px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mp-toc a:hover, .mp-toc a:focus-visible { background: var(--surface-2); color: var(--accent); outline: none; }
.mp [id] { scroll-margin-top: 70px; }
.mp-sec:target, .mp-linkcol:target > .mp-sec:first-child { animation: mp-target 2.2s ease-out 1; border-color: var(--accent); }
@keyframes mp-target { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .mp-sec:target, .mp-linkcol:target > .mp-sec:first-child { animation: none; } }
html:has(.mp) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(.mp) { scroll-behavior: auto; } }
.mp-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 12px; }
.mp-steps > li { line-height: 1.9; }
.mp-steps > li::marker { font-weight: 800; color: var(--accent); }
.mp-steps .mp-code { margin-top: 6px; }
.mp-fit { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.mp-fit li { padding: 5px 10px; border-radius: var(--r, 10px); background: var(--surface-2); font-size: 13px; }
/* long repository names in the quick-start steps break instead of spilling out on phones */
.mp-steps > li { min-width: 0; overflow-wrap: anywhere; }
.mp-run .muted a, .mp-card .muted a { overflow-wrap: anywhere; }

/* ---------- Lab: safety and red-team evaluations (1.9.0) ---------- */
.sf-h4 { margin: 16px 0 2px; font-size: 14px; }
.sf-wrap { max-height: none; margin: 8px 0; box-shadow: none; }
.sf-t th a { color: inherit; text-decoration: none; }
.sf-t th a:hover { color: var(--accent); }
.sf-t thead th small { display: block; font-weight: 500; }
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; align-items: stretch; }
.sf-card { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.sf-card h4 { margin: 0; font-size: 16px; line-height: 1.6; }
.sf-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sf-k.k-incident { background: color-mix(in srgb, var(--c3) 22%, transparent); border-color: transparent; }
.sf-k.k-eval { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: transparent; }
.sf-k.k-benchmark { background: color-mix(in srgb, var(--accent-2) 18%, transparent); border-color: transparent; }
.sf-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.sf-cat { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.sf-dl { margin: 0; display: grid; gap: 2px; }
.sf-dl dt { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.sf-dl dd { margin: 0; line-height: 1.85; font-size: 14px; }
.sf-models { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-models .mchip a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.sf-models .mchip .vi { width: 14px; height: 14px; }
.sf-src { margin: auto 0 0; padding-top: 6px; border-top: 1px solid var(--border); }
.sf-card:target { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) { .sf-grid { grid-template-columns: 1fr; } }
.sf-models .mchip { gap: 6px; }

/* ---------- model page redesign (1.9.1): hero, chips, Read more, main + side columns, beginner run guide ---------- */
.mp-hero { padding: 6px 0 4px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.mp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.mp-chip b { color: var(--text); font-weight: 700; }
.mp-chip.ok { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, var(--border)); }
.mp-more { margin: 8px 0 4px; line-height: 1.95; max-width: 75ch; }
.mp-more > summary { list-style: none; cursor: pointer; }
.mp-more > summary::-webkit-details-marker { display: none; }
.mp-morebtn, .mp-lessbtn { color: var(--accent); font-weight: 700; white-space: nowrap; }
.mp-more .mp-lessbtn, .mp-more[open] .mp-morebtn, .mp-more[open] .mp-short { display: none; }
.mp-more[open] .mp-lessbtn { display: inline; }
.mp-more > p { margin: 0 0 6px; }
.mp-grid2 { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
.mp-main, .mp-side { display: grid; gap: 16px; align-content: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.mp-specs { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .mp-grid2 { grid-template-columns: minmax(0, 1fr); } }
/* "which way is for me?" */
.mp-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 6px; }
.mp-wayc { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r-lg, 14px); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; }
.mp-wayc:hover, .mp-wayc:focus-visible { border-color: var(--accent); outline: none; transform: translateY(-1px); }
.mp-wayi { font-size: 26px; line-height: 1; }
.mp-wayc b { font-size: 15px; }
.mp-wayc small { color: var(--muted); font-size: 12.5px; }
.mp-way { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); scroll-margin-top: 70px; }
.mp-way h3 { font-size: 16px; margin: 0 0 10px; }
.mp-dev > summary { cursor: pointer; list-style: none; }
.mp-dev > summary::-webkit-details-marker { display: none; }
.mp-dev > summary h3 { display: inline; }
.mp-dev > summary::after { content: " ▾"; color: var(--muted); }
.mp-dev[open] > summary::after { content: " ▴"; }
.mp-pick { display: grid; gap: 8px; padding: 12px; margin-bottom: 12px; border-radius: var(--r-lg, 14px); background: var(--surface-2); border: 1px solid var(--border); }
.mp-pick label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.mp-pick select { padding: 6px 10px; border-radius: var(--r, 10px); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.mp-pick-out { font-weight: 700; line-height: 1.8; }
.mp-pick-out.yes { color: var(--accent-2); }
.mp-pick-out.no { color: var(--c3); }
.mp-cmd { position: relative; margin-top: 6px; }
.mp-cmd .mp-code { padding-right: 70px; }
.mp-cp { position: absolute; top: 6px; inset-inline-end: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
html[dir="rtl"] .mp-cmd .mp-cp { inset-inline-end: auto; left: 6px; right: auto; }
html[dir="rtl"] .mp-cmd .mp-code { padding-left: 70px; padding-right: 12px; }
.mp-cp.ok { border-color: var(--accent-2); color: var(--accent-2); }
.mp-note { padding: 10px 12px; border-radius: var(--r, 10px); background: color-mix(in srgb, var(--c3) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c3) 35%, var(--border)); line-height: 1.9; }
.mp-alt { margin: 12px 0 0; }
.mp-term { text-decoration: underline dotted; cursor: help; }
.mp-gloss { margin-top: 16px; font-size: 13.5px; }
.mp-gloss > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.mp-gloss dl { margin: 8px 0 0; display: grid; gap: 4px; }
.mp-gloss dt { font-weight: 700; margin-top: 6px; }
.mp-gloss dd { margin: 0; color: var(--muted); line-height: 1.8; }
.mp-chip.warn { color: var(--c3); border-color: color-mix(in srgb, var(--c3) 45%, var(--border)); }
/* model page: facts from the maker's own pages, each with its source */
.mp-facts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mp-facts-list li { padding: 10px 12px; border-radius: var(--r, 10px); background: var(--surface-2); border: 1px solid var(--border); }
.mp-facts-list p { margin: 0 0 4px; line-height: 1.9; }
.mp-facts-list a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.mp-facts-list a:hover { color: var(--accent); }

/* ===== news 1.11.0: one hero story, then equal cards; every card has a designed 16:9 cover (cover.js) — no copied photos.
   The cover box has a fixed ratio, so nothing moves while the page fills in (no layout shift). ===== */
.cov { display: block; width: 100%; height: 100%; }
.nc-cover { position: relative; display: block; height: auto; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.nc-cover .cov { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.nc:hover .nc-cover .cov { transform: scale(1.04); }
.nc-cover .nc-tp { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: #fff; background: rgba(10,12,20,.55); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#nwList { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; align-items: stretch; }
.nc { height: 100%; border-radius: var(--r-lg, 14px); }
.nc-body { flex: 1; gap: 8px; padding: 12px 14px 14px; }
.nc-meta { gap: 6px; color: var(--muted); font-size: 12px; min-width: 0; }
.nc-meta .ni-src { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-dot { opacity: .5; }
.nc .nc-t { font-size: 15px; line-height: 1.6; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc-x { -webkit-line-clamp: 2; }
.nc-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nc-tags { margin-top: 0; flex-wrap: nowrap; overflow: hidden; }
.nc-tag { overflow: hidden; text-overflow: ellipsis; max-width: 45%; flex: none; }
/* the hero: cover beside the text on wide screens, stacked on small ones */
.nw-top { display: block; margin: 0 0 16px; }
.nc-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.nc-hero .nc-cover { border-bottom: 0; border-inline-end: 1px solid var(--border); aspect-ratio: 16 / 9; }
.nc-hero .nc-body { justify-content: center; gap: 10px; padding: 22px 24px; }
.nc-hero .nc-t { font-size: clamp(19px, 2vw, 25px); line-height: 1.45; -webkit-line-clamp: 4; }
.nc-hero .nc-x { font-size: 14.5px; -webkit-line-clamp: 4; }
.nc-hero .nc-foot { margin-top: 4px; }
.nc-hero .nc-tp { font-size: 12px; padding: 4px 11px; }
[data-theme="dark"] .nc-cover, [data-theme="dark"] .nc-hero .nc-cover { border-color: var(--hair); }
@media (max-width: 860px) { .nc-hero { grid-template-columns: 1fr; } .nc-hero .nc-cover { border-inline-end: 0; border-bottom: 1px solid var(--border); } .nc-hero .nc-body { padding: 14px 16px 16px; } }
@media (max-width: 640px) { #nwList { grid-template-columns: 1fr; } .nc-cover { height: auto; } }
/* popular tags under the filters */
.nw-tags { margin-top: 10px; align-items: center; }
.nw-tags[hidden] { display: none; }
.nw-tags-l { font-size: 12px; color: var(--muted); font-weight: 600; margin-inline-end: 2px; }
.nw-tagc { display: inline-flex; align-items: center; gap: 5px; }
.nw-tagc .vi { width: 14px; height: 14px; margin: 0; }
.nw-tagc[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.nw-tagc small { opacity: .7; }
/* small covers: home "latest news" rows and related stories */
.ni-thumb { flex: none; display: block; width: 84px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.news-item.compact { align-items: center; gap: 10px; }
.news-item.compact .ni-body { min-width: 0; }
.nwp-relc a { gap: 10px; }
.nwp-relc a > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* story page cover */
.nwp-cover { display: block; height: auto; aspect-ratio: 16 / 9; max-height: 380px; width: 100%; padding: 0; background: var(--surface-2); overflow: hidden; }
.nwp-cover .cov { height: 100%; }
@media (max-width: 760px) { .nwp-cover { height: auto; } }
@media (prefers-reduced-motion: reduce) { .nc-cover .cov { transition: none; } .nc:hover .nc-cover .cov { transform: none; } }

/* ===== news 1.12.0: the story's own picture over the designed cover (cover stays underneath as the fallback),
   a credit line for the publisher, and one category per story ===== */
.nc-cover > .nc-img, .ni-thumb > .ni-img, .nwp-cover > .nwp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: transparent; }
.ni-thumb, .nwp-cover { position: relative; }
.nc-cover > .nc-img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.nc:hover .nc-cover > .nc-img { transform: scale(1.04); }
.nc-cover::after { content: ""; position: absolute; inset: auto 0 0 0; height: 42%; background: linear-gradient(to top, rgba(0,0,0,.55), transparent); pointer-events: none; opacity: 0; }
.nc-cover:has(.nc-img)::after { opacity: 1; }
.nc-credit { position: absolute; inset-block-end: 7px; inset-inline-end: 9px; z-index: 1; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.92); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.nc-cover:not(:has(.nc-img)) .nc-credit { display: none; } /* picture failed to load: no credit for a picture that is not there */
/* category chip: on the picture (cards), inline elsewhere */
.nc-cat, .ni-cat { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap;
  --cc: var(--accent); color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--cc) 30%, transparent); text-decoration: none; }
.c-model { --cc: #7c5cff; } .c-research { --cc: #0ea5a4; } .c-product { --cc: #3b82f6; } .c-pricing { --cc: #16a34a; }
.c-security { --cc: #e11d48; } .c-opensource { --cc: #d97706; } .c-policy { --cc: #8b5cf6; } .c-industry { --cc: #64748b; }
[data-theme="dark"] .c-industry { --cc: #94a3b8; }
.nc-cover > .nc-cat { position: absolute; z-index: 1; inset-block-start: 10px; inset-inline-start: 10px; color: #fff; background: color-mix(in srgb, var(--cc) 78%, rgba(10,12,20,.6));
  border-color: rgba(255,255,255,.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nc-hero .nc-cover > .nc-cat { font-size: 12px; padding: 3px 11px; }
.ni-cat { font-size: 10px; padding: 0 7px; margin-inline-end: 2px; }
.nwp-meta .nc-cat { margin-inline-end: 6px; vertical-align: middle; }
.nwp-meta .nc-cat:hover { filter: brightness(1.1); }
/* story page: picture + credit linking to the original story */
.nwp-cover { margin: 0; }
.nwp-credit { position: absolute; inset-block-end: 8px; inset-inline-end: 10px; z-index: 1; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; color: #fff;
  background: rgba(10,12,20,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.nwp-credit a { color: #fff; font-weight: 700; text-decoration: none; }
.nwp-credit a:hover { text-decoration: underline; }
.nwp-cover:not(:has(.nwp-img)) .nwp-credit { display: none; }
@media (prefers-reduced-motion: reduce) { .nc-cover > .nc-img { transition: none; } .nc:hover .nc-cover > .nc-img { transform: none; } }

/* ===== news 1.13.0: moving covers (GIF / video) and the story page gallery. Everything is the publisher's file, linked;
   motion loads lazily, videos play only on screen, and reduced motion gets still pictures (or nothing that moves) ===== */
.nc-cover > .nw-pic, .nwp-cover > .nw-pic { position: absolute; inset: 0; display: block; }
.nw-pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nwp-cover > video.nwp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.nc-cover:has(.nw-pic)::after { opacity: 1; }
.nc-mv { position: absolute; z-index: 1; inset-block-start: 10px; inset-inline-end: 10px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px;
  border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: rgba(10,12,20,.62); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.nwp-cover:has(.nw-pic) .nwp-credit, .nwp-cover:has(video) .nwp-credit { display: inline-block; }
/* gallery on the story page */
.nwp-gal { margin: 14px 20px 6px; }
.nwp-gal h2 { font-size: 16px; margin: 0 0 10px; }
.nwp-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.nwp-gi { position: relative; margin: 0; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.nwp-gi .nw-pic, .nwp-gi > img, .nwp-gi > video { position: absolute; inset: 0; width: 100%; height: 100%; }
.nwp-gi img, .nwp-gi video { width: 100%; height: 100%; object-fit: cover; display: block; }
.nwp-gi:not(:has(img, video)) { display: none; } /* a file that failed to load leaves no empty box */
.nwp-gal p { margin: 8px 0 0; }
.nwp-gal p a { color: inherit; font-weight: 600; }
.nwp-motion-off { display: none; }
@media (prefers-reduced-motion: reduce) {
  .nwp-gi.k-gif { display: none; }                      /* animations have no still version: hidden, and said so */
  .nwp-gal:has(.k-gif) .nwp-motion-off { display: inline; }
}
/* a real picture/animation on the story page gets more height than the designed cover, so less of it is cropped */
.nwp-cover:has(.nwp-img, .nw-pic) { max-height: 560px; }

/* ===== tokens tab 1.14.0: token counter & cost calculator (#tcCard). Text in, counts + per-model costs out; all local ===== */
.tc { position: relative; overflow: hidden; }
.tc::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .9; }
.tc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.tc-head h3 { margin: 0 0 4px; font-size: 19px; }
.tc-head .sub { margin: 0; max-width: 70ch; }
.tc-private { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 11%, transparent); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); }
.tc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.tc-in, .tc-set { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.tc-area { border: 1px solid var(--border); border-radius: var(--r-lg, 14px); background: var(--surface-2); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.tc-area:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
#tcText { display: block; width: 100%; min-height: 190px; max-height: 420px; resize: vertical; border: 0; outline: 0; padding: 14px 16px; background: transparent; color: var(--text);
  font-family: inherit; font-size: 14px; line-height: 1.85; }
.tc-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tc-file { position: relative; cursor: pointer; overflow: hidden; }
.tc-file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.tc-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.tc-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tc-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r, 10px); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.tc-stat b { font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-stat:first-child { grid-column: span 2; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.tc-stat:first-child b { font-size: 26px; color: var(--accent); }
.tc-stat span { font-size: 12px; color: var(--muted); }
.tc-stat small { font-size: 11px; line-height: 1.5; }
.tc-mix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.tc-mix:empty { display: none; }
.tc-mixbar { display: flex; flex: 1 1 160px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.tc-mixbar i, .tc-mixk i { display: block; }
.tc-mixk { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tc-mixk span { display: inline-flex; align-items: center; gap: 5px; }
.tc-mixk i { width: 9px; height: 9px; border-radius: 3px; }
.mx-fa { background: #7c5cff; } .mx-ar { background: #0ea5a4; } .mx-zh { background: #e11d48; } .mx-en { background: #3b82f6; } .mx-code { background: #d97706; }
.tc-l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.tc-form label { display: grid; gap: 5px; align-content: start; font-size: 12.5px; color: var(--muted); min-width: 0; }
.tc-form input[type="number"] { padding: 9px 11px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; width: 100%; }
.tc-form input[type="number"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
.tc-form small { font-size: 11px; line-height: 1.5; }
.tc-form .tk-field { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.tc-form input[type="range"] { flex: 1; accent-color: var(--accent); }
.tc-outp { gap: 4px; }
.tc-outp .chip { font-size: 11px; padding: 2px 8px; }
.tc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tc-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.tc-models { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-lg, 14px); border: 1px dashed var(--border); }
.tc-mlist { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-m { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding-block: 4px; padding-inline: 10px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; }
.tc-m > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-m .vi { width: 15px; height: 15px; margin: 0; flex: none; }
.tc-m button { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.tc-m button:hover, .tc-m button:focus-visible { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
#tcAdd { padding: 8px 11px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
#tcAdd:disabled { opacity: .6; }
/* results */
.tc-res { margin-top: 16px; }
.tc-best { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--r, 10px); font-size: 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); }
[dir="rtl"] .tc-best { background: linear-gradient(270deg, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent); }
.tc-best:empty { display: none; }
.tc-crown { color: #f5b301; font-size: 16px; }
.tc-table table { width: 100%; font-size: 13.5px; }
.tc-table th, .tc-table td { padding: 10px; vertical-align: middle; }
.tc-table th.name { text-align: start; min-width: 170px; }
.tc-table th.name a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); text-decoration: none; }
.tc-table th.name a:hover { color: var(--accent); }
.tc-table th.name small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tc-table tr.best td, .tc-table tr.best th { background: color-mix(in srgb, var(--accent-2) 7%, transparent); }
.tc-tag { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tc-tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.tc-mo { min-width: 120px; }
.tc-mo small { display: block; font-size: 11px; }
.tc-bar { display: block; height: 5px; margin-top: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tc-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.tc-ctxc { min-width: 96px; }
.tc-ctx { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 3px; }
.tc-ctx i { display: block; height: 100%; background: var(--accent-2); border-radius: inherit; }
.tc-ctx.near i { background: var(--warn); } .tc-ctx.over i { background: var(--danger); }
.tc-ctxc small { font-size: 11px; color: var(--muted); }
.tc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tc-note { margin: 10px 0 0; line-height: 1.8; }
@media (max-width: 1000px) { .tc-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .tc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-stat:first-child { grid-column: 1 / -1; }
  #tcText { min-height: 150px; }
  .tc-table th, .tc-table td { padding: 8px 7px; }
}
@media (max-width: 380px) { .tc-form { grid-template-columns: 1fr; } }

/* phones: each model becomes a small card (name on top, then the numbers in two columns), so the monthly cost is never off-screen */
@media (max-width: 640px) {
  .tc-table { overflow: visible; max-height: none; border: 0; box-shadow: none; background: none; }
  .tc-table table, .tc-table tbody { display: block; }
  .tc-table thead { display: none; }
  .tc-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-bottom: 10px; padding: 10px 12px; border-radius: var(--r-lg, 14px); border: 1px solid var(--border); background: var(--surface); }
  .tc-table tr.best { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border)); }
  .tc-table tr > * { display: block; padding: 3px 0 !important; border: 0 !important; background: none !important; position: static !important; text-align: start; min-width: 0 !important; }
  .tc-table td.tc-rk { display: none; }
  .tc-table th.name { grid-column: 1 / -1; padding-bottom: 6px !important; }
  .tc-table td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); }
  .tc-table td.tc-mo { grid-column: 1 / -1; order: -1; font-size: 17px; font-weight: 800; }
  .tc-table th.name { order: -2; }
}

/* ===== 1.15.0: open-source alternatives tab (#p-alternatives) ===== */
.al-head h2 { margin: 0 0 6px; }
.al-head .sub { max-width: 80ch; }
.al-search input { width: 100%; padding: 11px 14px; border-radius: var(--r-lg, 14px); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; margin: 10px 0 8px; }
.al-search input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
.al-cats, .al-flt { margin-top: 8px; align-items: center; }
.al-cats .chip small { opacity: .65; }
.al-fl { font-size: 12px; color: var(--muted); font-weight: 600; margin-inline-end: 2px; }
.al-f[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.al-list { display: grid; gap: 16px; margin: 14px 0; }
.al-pair { padding: 16px 18px; }
.al-paid { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.al-paid > .vi { width: 38px; height: 38px; flex: none; margin: 2px 0 0; border-radius: 10px; font-size: 18px; }
.al-paid h3 { margin: 0; font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.al-paid p { margin: 4px 0 0; font-size: 13px; }
.al-paid a { white-space: nowrap; }
.al-arrow { color: var(--muted); }
[dir="rtl"] .al-arrow { display: inline-block; transform: scaleX(-1); }
.al-oss { font-size: 13px; font-weight: 700; color: var(--accent-2); }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; align-items: stretch; }
.al-alt { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 14px; border-radius: var(--r-lg, 14px); border: 1px solid var(--border); background: var(--surface-2);
  border-top: 3px solid var(--hc, var(--border)); }
.al-alt.h-active { --hc: #16a34a; } .al-alt.h-slow { --hc: #d97706; } .al-alt.h-inactive, .al-alt.h-archived { --hc: #e11d48; }
.al-alt > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.al-an { display: flex; flex-direction: column; min-width: 0; }
.al-an b { font-size: 16px; overflow-wrap: anywhere; }
.al-an small { color: var(--muted); font-size: 12px; }
.al-h { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); }
.al-h i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.al-h.h-active i { background: #16a34a; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 22%, transparent); }
.al-h.h-slow i { background: #d97706; } .al-h.h-inactive i, .al-h.h-archived i { background: #e11d48; }
.al-sum { margin: 0; font-size: 13.5px; line-height: 1.85; }
.al-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.al-run, .al-fa { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.al-run.hw { color: var(--muted); }
.al-fa { color: #7c5cff; border-color: color-mix(in srgb, #7c5cff 35%, var(--border)); text-decoration: none; font-weight: 700; }
.al-fa:hover { background: color-mix(in srgb, #7c5cff 10%, transparent); }
.al-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.al-meta div { min-width: 0; }
.al-meta dt { font-size: 11px; color: var(--muted); }
.al-meta dd { margin: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-lic { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; --lc: var(--muted); color: var(--lc); background: color-mix(in srgb, var(--lc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 32%, transparent); }
.al-lic.k-permissive { --lc: #16a34a; } .al-lic.k-weak { --lc: #0ea5a4; } .al-lic.k-copyleft { --lc: #3b82f6; } .al-lic.k-opencore { --lc: #8b5cf6; } .al-lic.k-custom { --lc: #d97706; } .al-lic.k-source { --lc: #e11d48; }
.al-note { margin: 0; padding: 8px 10px; border-radius: 9px; font-size: 12.5px; line-height: 1.8; background: color-mix(in srgb, var(--warn) 8%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.al-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.al-more { margin-top: 12px; }
.al-more summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--accent); }
.al-cmp { margin-top: 8px; }
.al-cmp table { font-size: 13px; }
.al-cmp th[scope="row"] { font-weight: 500; text-align: start; }
.al-cmp td { text-align: center; }
.al-y { color: #16a34a; font-weight: 800; } .al-n { color: var(--muted); } .al-q { color: var(--muted); opacity: .7; }
.al-models { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.al-models .chip { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.al-models .vi { width: 14px; height: 14px; margin: 0; }
.al-warn { margin: 12px 0 0; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.al-legend h3 { margin-top: 0; }
.al-legend h4 { margin: 14px 0 6px; font-size: 14px; }
.al-legend ul { margin: 0; padding-inline-start: 18px; line-height: 1.9; font-size: 13.5px; }
.al-lk { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.al-lk li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .al-pair { padding: 12px; }
  .al-paid h3 { font-size: 16px; }
  .al-meta { grid-template-columns: 1fr 1fr; }
}

/* ===== 1.16.0: Roadmaps tab sections, link to the alternatives, "translate to English" in the token calculator ===== */
.cx-sub { margin-top: 12px; }
.cx-sub .chip { text-decoration: none; }
.cx-sub .cx-sub-alt { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border)); color: var(--accent-2); font-weight: 700; }
.cx-alt { display: grid; gap: 14px; margin-top: 16px; scroll-margin-top: 80px; }
#roadmaps, #connectors { scroll-margin-top: 80px; }
.cx-alt .al-list { margin: 0; }
.al-link { margin: 8px 0 0; }
.al-link a { font-weight: 700; color: var(--accent-2); text-decoration: none; }
.al-link a:hover { text-decoration: underline; }
.tc-en { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg, 14px); border: 1px solid color-mix(in srgb, var(--accent-2) 35%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 70%); }
.tc-en[hidden] { display: none; }
.tc-en-say { margin: 0; font-size: 13.5px; line-height: 1.9; }
.tc-en-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.tc-en-act small { font-size: 11.5px; line-height: 1.6; }
.tc-en-prompt[hidden], .tc-en-out[hidden] { display: none; }
.tc-en-prompt p { margin: 0 0 6px; line-height: 1.8; }
.tc-en-pre { margin: 0 0 6px; max-height: 160px; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; line-height: 1.6; }
.tc-en-out { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.tc-en-out textarea { width: 100%; min-height: 110px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.7; }
.tc-en-out textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
.tc-en-t table { font-size: 12.5px; width: 100%; }
.tc-en-t th[scope="row"] { text-align: start; font-weight: 600; white-space: nowrap; }
.tc-en-t th[scope="row"] .vi { width: 14px; height: 14px; margin-inline-end: 5px; }
.tc-good { color: #16a34a; font-weight: 700; } .tc-bad { color: var(--danger); font-weight: 700; }
.tc-en-tot { margin: 4px 0 0; font-size: 13.5px; }
.tc-en-warn { margin: 0; line-height: 1.8; }
.tc-en { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.tc-en > * { min-width: 0; }
.tc-en-t { max-width: 100%; }

/* ===== 1.17.0: translate / optimize with on-device AI, our server (with consent) or a ready prompt ===== */
.tc-en-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.tc-en-h { font-size: 14px; }
.tc-en-modes .chip { font-size: 12px; }
.tc-en-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.7; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 8%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); cursor: pointer; }
.tc-en-consent[hidden] { display: none; }
.tc-en-consent input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.tc-en-how { display: block; font-size: 11.5px; line-height: 1.6; }
.tc-en-how:empty { display: none; }
.tc-en-res { display: grid; gap: 8px; min-width: 0; }
.tc-en-res[hidden] { display: none; }
#tcEnSrv:disabled, #tcEnGo:disabled { opacity: .55; cursor: not-allowed; }
