/* ============ Design Tokens ============
   Tokens now live in tokens.css (link it BEFORE this file).
   This file consumes the CSS variables it defines. */

/* ============ Reset / Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }
.tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Header ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 17, 22, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: padding .15s ease;
}
[data-theme="light"] .header { background: rgba(255,255,255,.78); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 24px;
  max-width: var(--container);
  margin: 0 auto;
}
.header.scrolled .header-inner { height: 52px; }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-size: 16px;
}
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 50%, #000));
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 4px;
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 45%, rgba(255,255,255,.85) 45%, rgba(255,255,255,.85) 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(255,255,255,.85) 45%, rgba(255,255,255,.85) 55%, transparent 55%);
  opacity: .9;
}
.brand small { color: var(--text-3); font-weight: 400; font-size: 11px; margin-left: 2px; letter-spacing: .04em; text-transform: uppercase; }
.brand-name { font-weight: 600; letter-spacing: -.02em; }
.brand-name .ai { color: var(--accent); font-weight: 700; }

.nav { display: flex; gap: 2px; align-items: center; flex: 1; margin-left: 12px; }
.nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}
.nav a:hover { color: var(--text); background: var(--bg-hover); }
.nav a.active {
  color: var(--text);
}
.nav a.active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -19px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.search-btn {
  display: flex; align-items: center; gap: 10px;
  height: 34px;
  padding: 0 10px 0 12px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
  min-width: 260px;
  transition: border .15s, background .15s;
}
.search-btn:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-btn .kbd { margin-left: auto; }
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  line-height: 1;
}

.icon-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-elev); border-color: var(--border); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: all .12s ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
}
[data-theme="light"] .btn-primary { color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-elev); color: var(--text); }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ============ Cmd+K overlay ============ */
.cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(4px);
}
.cmdk-overlay.open { display: flex; }
.cmdk {
  width: 640px;
  max-width: calc(100vw - 32px);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cmdk-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
}
.cmdk-input input::placeholder { color: var(--text-3); }
.cmdk-results { max-height: 60vh; overflow: auto; padding: 6px; }
.cmdk-group { padding: 6px 8px; color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--bg-hover); }
.cmdk-item .ico {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev-2);
  font-size: 12px;
}
.cmdk-item .meta { color: var(--text-3); font-size: 12px; margin-left: auto; }
.cmdk-foot {
  display: flex; gap: 16px; align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

/* ============ Sections ============ */
.section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section-tight { padding: 32px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0;
}
.section-head .sub { color: var(--text-2); font-size: 13px; }
.section-head .right { display: flex; gap: 8px; align-items: center; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}
.link-arrow:hover { text-decoration: underline; }

/* ============ Hero ============ */
.hero {
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: stretch;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.025em;
  margin: 0 0 16px;
  max-width: 16ch;
  text-wrap: balance;
}
.hero .sub {
  font-size: 16px;
  color: var(--text-2);
  max-width: 50ch;
  margin: 0 0 24px;
}
.live-metrics {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 28px;
}
.live-metrics .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); display: inline-block; margin-right: 6px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-metrics b { color: var(--text); font-weight: 500; }
.hero-cta { display: flex; gap: 16px; align-items: center; }

/* mini leaderboard */
.mini-board {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mini-board-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.mini-board-head .updated { color: var(--green); text-transform: none; letter-spacing: 0; font-weight: 500; }
.mini-rows { flex: 1; }
.mini-row {
  display: grid;
  grid-template-columns: 24px 24px 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.mini-row:first-child { border-top: none; }
.mini-row:hover { background: var(--bg-hover); }
.mini-row .rank { color: var(--text-3); font-family: var(--font-mono); font-size: 12px; text-align: right; }
.mini-row .name { font-weight: 500; }
.mini-row .num { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.mini-row .ix { color: var(--accent); }
.mini-board-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  display: flex; justify-content: space-between; align-items: center;
}

/* provider logo bubble */
.logo {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: white;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.logo-sm { width: 16px; height: 16px; font-size: 8px; border-radius: 4px; }
.logo-md { width: 28px; height: 28px; font-size: 11px; border-radius: 6px; }
.logo-lg { width: 36px; height: 36px; font-size: 13px; border-radius: 8px; }
.logo-xl { width: 56px; height: 56px; font-size: 16px; border-radius: 12px; }

/* ============ 4-tile showcase ============ */
.tile-filter {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.chip .num { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }

.showcase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 14px;
  transition: border .15s, transform .15s;
  position: relative;
}
.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tile-label {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.tile-label .sym { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.tile-name { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; }
.tile-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1;
}
.tile-value .unit { color: var(--text-3); font-size: 15px; margin-left: 4px; }
.tile .arrow { position: absolute; top: 18px; right: 18px; color: var(--text-3); opacity: 0; transition: opacity .15s; }
.tile:hover .arrow { opacity: 1; }
.tile-bar {
  height: 4px;
  background: var(--bg-elev-2);
  border-radius: 2px;
  overflow: hidden;
}
.tile-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* ============ Leaderboard table ============ */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  border-bottom: none;
}
.input {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 220px;
}
.input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 13px;
}
.input input::placeholder { color: var(--text-3); }
.select {
  height: 32px; padding: 0 28px 0 10px;
  border-radius: 8px;
  background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='%238B92A0' d='M2 4l3 3 3-3z'/></svg>") no-repeat right 10px center;
  border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-family: inherit;
  appearance: none;
}
.toolbar .sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2);
}
.toggle .sw {
  width: 30px; height: 18px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  position: relative; transition: background .15s;
}
.toggle .sw::after {
  content: ""; position: absolute;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-2); left: 2px; top: 2px;
  transition: left .15s;
}
.toggle.on .sw { background: var(--accent); border-color: transparent; }
.toggle.on .sw::after { left: 14px; background: white; }

.table-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
table.lb {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table.lb th, table.lb td {
  padding: var(--row-pad-y) var(--row-pad-x);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.lb tr:last-child td { border-bottom: none; }
table.lb thead th {
  background: var(--bg-elev-2);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  user-select: none;
  cursor: pointer;
}
table.lb thead th:hover { color: var(--text-2); }
table.lb thead th.sorted { color: var(--accent); }
table.lb thead th .arr { display: inline-block; margin-left: 4px; opacity: .5; }
table.lb thead th.sorted .arr { opacity: 1; }
table.lb tbody tr { transition: background .12s; }
table.lb tbody tr:hover { background: var(--bg-hover); }
table.lb td.num, table.lb th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.lb td.rank { color: var(--text-3); font-family: var(--font-mono); width: 36px; }
table.lb td.model { font-weight: 500; }
table.lb td .price-rub { display: block; color: var(--text-3); font-size: 11px; font-family: var(--font-mono); }
table.lb .iq-bar {
  display: inline-block;
  width: 56px; height: 4px;
  background: var(--bg-elev-2);
  border-radius: 2px;
  margin-left: 8px;
  vertical-align: middle;
  overflow: hidden;
}
table.lb .iq-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
table.lb .checkbox { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border-strong); display: inline-block; vertical-align: middle; cursor: pointer; }
table.lb .checkbox.on { background: var(--accent); border-color: var(--accent); position: relative; }
table.lb .checkbox.on::after { content: ""; position: absolute; left: 3px; top: 0px; width: 4px; height: 8px; border: 2px solid white; border-top: 0; border-left: 0; transform: rotate(45deg); }
.access-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: var(--text-2);
}
.access-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.access-pill .dot.g { background: var(--green); }
.access-pill .dot.y { background: var(--amber); }
.access-pill .dot.r { background: var(--red); }
.row-actions { display: flex; gap: 6px; }
.row-actions a { color: var(--text-3); font-size: 12px; }
.row-actions a:hover { color: var(--accent); }

.lb-foot {
  padding: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Floating compare */
.compare-bar {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px 10px 16px;
  display: flex; align-items: center; gap: 14px;
  font-size: 13px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.compare-bar.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.compare-bar .stack { display: flex; }
.compare-bar .stack .logo { margin-left: -6px; border: 2px solid var(--bg-elev); }
.compare-bar .stack .logo:first-child { margin-left: 0; }

/* ============ Categories ============ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.cat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border .15s, transform .15s;
  position: relative;
  min-height: 132px;
}
.cat-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.cat-card .ico {
  width: 24px; height: 24px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.cat-card h3 { font-size: 15px; font-weight: 500; margin: 0; letter-spacing: -.01em; }
.cat-card .meta { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.cat-card .meta b { color: var(--green); font-weight: 500; }
.cat-card .top { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.cat-card .top span { font-size: 11px; color: var(--text-3); margin-right: 4px; }
.cat-card .stack { display: flex; }
.cat-card .stack .logo-sm { margin-left: -3px; border: 1.5px solid var(--bg-elev); }
.cat-card .stack .logo-sm:first-child { margin-left: 0; }

/* ============ News / GitHub ============ */
.news-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.news-list { display: flex; flex-direction: column; gap: 2px; }
.news-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.news-row:first-child { border-top: none; padding-top: 0; }
.news-row .accent-bar {
  width: 3px;
  border-radius: 2px;
  align-self: stretch;
  min-height: 36px;
}
.news-row[data-kind="release"] .accent-bar { background: var(--accent); }
.news-row[data-kind="bench"] .accent-bar { background: var(--green); }
.news-row[data-kind="biz"] .accent-bar { background: var(--blue); }
.news-row[data-kind="reg"] .accent-bar { background: var(--red); }
.news-row[data-kind="oss"] .accent-bar { background: var(--amber); }
.news-row .tag {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-elev-2);
}
.news-row h4 {
  font-size: 15px; font-weight: 500; margin: 6px 0 6px;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.news-row .news-meta {
  font-size: 12px; color: var(--text-3);
  font-family: var(--font-mono);
}
.news-row .summary {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  display: none;
}
.news-row:hover .summary { display: block; }
.news-row .age { white-space: nowrap; color: var(--text-3); font-family: var(--font-mono); font-size: 12px; align-self: start; padding-top: 2px; }

.gh-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 4px 14px;
}
.gh-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 8px;
}
.gh-head h3 { font-size: 14px; margin: 0; font-weight: 600; }
.gh-row {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 0 4px;
}
.gh-row:hover { background: var(--bg-hover); }
.gh-repo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.gh-repo b { color: var(--accent); font-weight: 500; }
.gh-desc { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }
.gh-metrics { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); margin-top: 6px; display: flex; gap: 12px; }
.gh-metrics b { color: var(--green); font-weight: 500; }
.lang-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; }

/* ============ Utilities row ============ */
.util-row {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.util-row::-webkit-scrollbar { height: 6px; }
.util-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.util-card {
  flex: 0 0 280px;
  height: 180px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex; flex-direction: column;
  transition: border .15s;
}
.util-card:hover { border-color: var(--border-strong); }
.util-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.util-head .ico {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.util-head h4 { font-size: 14px; font-weight: 500; margin: 0; }
.util-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-bottom: auto; }
.util-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.util-preview .row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.util-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: inherit;
}
.util-result {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  margin-top: 6px;
}
.util-result b { color: var(--accent); font-weight: 500; }

.util-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  outline: none;
}
.util-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}
.util-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* ============ MCP ============ */
.mcp-card {
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.mcp-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}
.mcp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; position: relative; }
.mcp-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.badge-new {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid var(--accent-border);
}
.mcp-sub { color: var(--text-2); font-size: 14px; margin-bottom: 22px; max-width: 70ch; position: relative; }
.mcp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
}
.mcp-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 4px;
}
.mcp-item .row { display: flex; align-items: center; gap: 10px; }
.mcp-item h4 { margin: 0; font-size: 14px; font-weight: 500; font-family: var(--font-mono); letter-spacing: -.01em; }
.mcp-item .cat { font-size: 11px; color: var(--text-3); }
.mcp-item .metrics { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); margin-top: 6px; display: flex; gap: 10px; }
.mcp-item .install { margin-top: 10px; }

/* ============ Compare widget ============ */
.compare-block {
  background: var(--bg-elev);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
}
.compare-block::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 50%);
  opacity: .5;
}
.compare-block > * { position: relative; }
.compare-pickers {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 10px;
  margin: 16px 0 18px;
}
.compare-picker {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.compare-picker:hover { border-color: var(--border-strong); }
.compare-picker .name { font-weight: 500; }
.compare-picker .empty { color: var(--text-3); }
.compare-mini {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.compare-mini table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-mini th, .compare-mini td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-mini th { color: var(--text-3); font-weight: 500; font-size: 12px; width: 140px; }
.compare-mini tr:last-child th, .compare-mini tr:last-child td { border-bottom: none; }
.compare-mini td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.compare-mini td .winner { color: var(--green); }

/* ============ Tools grid ============ */
.tool-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tool-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border .15s, transform .15s;
}
.tool-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tool-preview {
  aspect-ratio: 16 / 9;
  background: var(--bg-elev-2);
  position: relative;
  overflow: hidden;
  background-image:
    repeating-linear-gradient(45deg, transparent 0px, transparent 18px, rgba(255,255,255,0.025) 18px, rgba(255,255,255,0.025) 19px);
}
.tool-preview::after {
  content: attr(data-label);
  position: absolute; left: 12px; bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tool-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tool-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.tool-cat { font-size: 11px; color: var(--text-3); }
.tool-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.tool-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px;
  font-family: var(--font-mono); color: var(--text-3);
}
.tool-foot .pricing { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 4px; background: var(--bg-elev-2); color: var(--text-2); font-family: var(--font-sans); }
.tool-foot .pricing.free { background: var(--green-soft); color: var(--green); }
.tool-foot .pricing.paid { background: var(--blue-soft); color: var(--blue); }
.tool-foot .pricing.rub { background: var(--amber-soft); color: var(--amber); }
.tool-foot .stars { color: var(--amber); }

/* ============ Manufacturers ============ */
.manu-section { display: flex; flex-direction: column; gap: 20px; }
.manu-group { display: flex; flex-direction: column; gap: 10px; }
.manu-group-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.manu-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.manu-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border .15s, transform .15s;
}
.manu-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.manu-card .name { font-size: 12px; text-align: center; font-weight: 500; }
.manu-card .ct { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); }

/* ============ Blog ============ */
.blog-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.blog-feature {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.blog-cover {
  aspect-ratio: 16 / 10;
  background: var(--bg-elev-2);
  position: relative;
  background-image:
    repeating-linear-gradient(45deg, transparent 0px, transparent 26px, rgba(255,255,255,0.04) 26px, rgba(255,255,255,0.04) 27px);
}
.blog-cover::after {
  content: attr(data-label);
  position: absolute; left: 18px; bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.blog-feature-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.blog-tag {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  align-self: flex-start;
}
.blog-feature h3 {
  font-size: 22px; line-height: 1.2; font-weight: 600; margin: 0;
  letter-spacing: -.02em;
}
.blog-feature p { font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.5; }
.blog-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin-top: auto; padding-top: 6px; }

.blog-list { display: flex; flex-direction: column; gap: 16px; }
.blog-item {
  display: flex; gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.blog-item:last-child { border-bottom: none; padding-bottom: 0; }
.blog-thumb {
  width: 90px; height: 70px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg-elev-2);
  background-image: repeating-linear-gradient(45deg, transparent 0px, transparent 12px, rgba(255,255,255,0.05) 12px, rgba(255,255,255,0.05) 13px);
}
.blog-item h4 { font-size: 14px; font-weight: 500; margin: 6px 0 6px; line-height: 1.35; letter-spacing: -.01em; }
.blog-item .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* ============ Newsletter ============ */
.newsletter {
  background: linear-gradient(135deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.newsletter::before {
  content: "";
  position: absolute;
  width: 400px; height: 400px;
  right: -100px; bottom: -200px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.newsletter > * { position: relative; }
.newsletter h2 { font-size: 26px; font-weight: 600; letter-spacing: -.025em; margin: 0 0 8px; line-height: 1.15; text-wrap: balance; }
.newsletter .sub { color: var(--text-2); font-size: 14px; margin: 0 0 16px; max-width: 50ch; }
.newsletter ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.newsletter ul li::before { content: "·"; color: var(--accent); margin-right: 8px; font-weight: bold; }
.nl-form { display: flex; flex-direction: column; gap: 10px; }
.nl-input-row { display: flex; gap: 8px; }
.nl-input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.nl-input:focus { border-color: var(--accent); }
.nl-proof {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  display: flex; gap: 16px; align-items: center;
}
.nl-proof b { color: var(--text-2); font-weight: 500; }

/* ============ Footer ============ */
.footer { padding: 40px 0 24px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 36px;
}
.footer h5 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin: 0 0 12px;
  font-weight: 600;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer ul a { font-size: 13px; color: var(--text-2); }
.footer ul a:hover { color: var(--text); }
.footer-foot {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
}
.footer-foot .socials { display: flex; gap: 4px; }
.footer-foot .socials a {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-2);
}
.footer-foot .socials a:hover { background: var(--bg-elev); color: var(--text); }
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
}
.lang-toggle span {
  padding: 4px 8px;
  color: var(--text-3);
  cursor: pointer;
}
.lang-toggle span.on { background: var(--bg-elev); color: var(--text); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .mcp-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .manu-grid { grid-template-columns: repeat(4, 1fr); }
  .blog-grid { grid-template-columns: 1fr; }
  .newsletter { grid-template-columns: 1fr; padding: 28px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .search-btn { min-width: 0; flex: 1; }
}

@media (max-width: 640px) {
  .hero { padding: 28px 0; }
  .hero h1 { font-size: 30px; }
  .showcase { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 14px; gap: 10px; }
  .tile-value { font-size: 24px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .mcp-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .manu-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 36px 0; }
  table.lb th:nth-child(4),
  table.lb td:nth-child(4),
  table.lb th:nth-child(7),
  table.lb td:nth-child(7),
  table.lb th:nth-child(8),
  table.lb td:nth-child(8) { display: none; }
}

/* Direct edit overrides slot (kept at end) */

/* ============ V2: Releases feed (middle column of news block) ============ */
.releases-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 4px 14px;
}
.releases-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 0 4px;
  align-items: start;
}
.releases-row + .releases-row { border-top: 1px solid var(--border); margin-top: 0; border-radius: 0; }
.releases-row:hover { background: var(--bg-hover); }
.releases-row .rel-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.releases-row .rel-name .ver {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.releases-row .rel-what {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  line-height: 1.4;
}
.releases-row .rel-when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  padding-top: 2px;
}

/* News block converted to 3 columns */
.news-grid-3 {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 20px;
}
.news-col { display: flex; flex-direction: column; }
.news-col-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.news-col-head h3 {
  font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -.01em;
}
.news-col-head .sub { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

/* Compact news rows for narrower 3-col layout */
.news-grid-3 .news-row {
  padding: 12px 0;
}
.news-grid-3 .news-row h4 {
  font-size: 14px;
  line-height: 1.3;
}
.news-grid-3 .news-row .news-meta {
  font-size: 11px;
}
.news-grid-3 .news-row .age {
  font-size: 11px;
}
.news-grid-3 .news-row .summary { display: none; }

/* ============ V2: Leaderboard tabs ============ */
.lb-tabs {
  display: flex; gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tab {
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.lb-tab:hover { color: var(--text); }
.lb-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.lb-tab .badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-elev-2);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-weight: 500;
}
.lb-tab.active .badge { background: var(--accent-soft); color: var(--accent); }
.lb-tab.all-link { margin-left: auto; color: var(--accent); }

/* ============ V2: Skills block ============ */
.skills-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 8px;
  transition: border .15s, transform .15s;
}
.skills-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.skills-head {
  display: flex; align-items: center; gap: 10px;
}
.skills-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.skills-name { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.skills-author { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.skills-cat {
  display: inline-flex; align-items: center;
  font-size: 11px; padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-elev-2);
  color: var(--text-2);
  font-weight: 500;
}
.skills-desc { font-size: 12px; color: var(--text-2); line-height: 1.45; min-height: 32px; }
.skills-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  display: flex; gap: 12px;
}
.skills-meta b { color: var(--text-2); font-weight: 500; }
.skills-compat {
  display: flex; align-items: center; gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-3);
}
.agent-pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-2);
}
.agent-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.skills-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
}

.badge-hot {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.14);
  color: #FB7185;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid rgba(244, 63, 94, 0.32);
}

/* ============ V2: Agents block ============ */
.agents-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border .15s, transform .15s;
}
.agents-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.agents-banner {
  height: 64px;
  background: var(--bg-elev-2);
  position: relative;
  background-image:
    radial-gradient(circle at 80% 50%, var(--accent-soft) 0%, transparent 50%),
    repeating-linear-gradient(135deg, transparent 0px, transparent 14px, rgba(255,255,255,0.025) 14px, rgba(255,255,255,0.025) 15px);
}
.agents-banner .stripe {
  position: absolute;
  bottom: 14px; left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--text-3);
  text-transform: uppercase;
}
.agents-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.agents-head { display: flex; align-items: center; gap: 10px; }
.agents-head h4 { margin: 0; font-size: 14px; font-weight: 500; }
.agents-cat { font-size: 11px; color: var(--text-3); }
.agents-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.agents-bench {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
}
.agents-bench .label { color: var(--text-3); font-size: 11px; }
.agents-bench .val { color: var(--accent); font-weight: 500; }
.agents-bench .pricing { font-size: 11px; color: var(--text-2); }

/* Responsive */
@media (max-width: 1024px) {
  .news-grid-3 { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .news-grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   A4 — Reusable states: skeleton / empty / error
   Drop-in blocks for loading, no-data and failure.
   ============================================================ */
@keyframes skel-shimmer { 100% { background-position: -200% 0; } }
.skeleton {
  position: relative;
  background: linear-gradient(90deg,
    var(--bg-elev-2) 0%, var(--bg-hover) 50%, var(--bg-elev-2) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.skel-line { height: 12px; }
.skel-line.sm { height: 10px; }
.skel-line.lg { height: 18px; }
.skel-circle { border-radius: 50%; }
.skel-block { border-radius: var(--r-lg); }

/* skeleton row (table-style) */
.skel-row {
  display: grid; grid-template-columns: 36px 1.6fr 1fr 80px 90px;
  gap: 16px; align-items: center;
  padding: 14px var(--row-pad-x);
  border-bottom: 1px solid var(--border);
}
.skel-row .skel-circle { width: 28px; height: 28px; }

/* skeleton card */
.skel-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.skel-card .skel-head { display: flex; align-items: center; gap: 12px; }
.skel-card .skel-head .skel-circle { width: 40px; height: 40px; flex-shrink: 0; }

/* empty + error share a layout */
.state-empty, .state-error {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 48px 24px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-xl);
}
.state-empty .ico, .state-error .ico {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.state-empty .ico { background: var(--bg-elev-2); color: var(--text-3); }
.state-error .ico { background: var(--red-soft); color: var(--red); }
.state-empty h3, .state-error h3 { margin: 0; font-size: 16px; font-weight: 600; }
.state-empty p, .state-error p { margin: 0; font-size: 13.5px; color: var(--text-2); max-width: 42ch; }
.state-empty .actions, .state-error .actions { display: flex; gap: 8px; margin-top: 10px; }

/* "скоро / soon" badge for placeholder destinations */
.soon-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 5px; border-radius: 4px; vertical-align: middle;
  background: var(--amber-soft); color: var(--amber); margin-left: 5px;
}

/* generic "soon" toast (driven by ui-common.js) */
#soon-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg-elev);
  padding: 11px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; transition: all .25s ease; z-index: 300; pointer-events: none;
}
#soon-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   A4b — Typed toast stack (success / error / info)
   Driven by AIKraftToast(message, {type,title}). Top-right stack.
   ============================================================ */
.toast-stack {
  position: fixed; top: 18px; right: 18px; z-index: 400;
  display: flex; flex-direction: column; gap: 10px;
  width: min(360px, calc(100vw - 36px)); pointer-events: none;
}
.toast {
  pointer-events: auto; position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 13px 12px 14px; border-radius: var(--r-lg);
  background: var(--bg-elev); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(120%); opacity: 0;
  transition: transform .3s cubic-bezier(.2,.85,.25,1), opacity .3s;
}
.toast::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--text-3);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast .t-ico { flex: none; width: 20px; height: 20px; margin-top: .5px; color: var(--text-3); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.toast .t-msg { font-size: 13px; color: var(--text-2); line-height: 1.45; margin-top: 1px; }
.toast .t-close {
  flex: none; width: 22px; height: 22px; margin: -2px -2px 0 0; padding: 0;
  border: none; background: none; cursor: pointer; color: var(--text-3);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.toast .t-close:hover { background: var(--bg-hover); color: var(--text); }
.toast.success::before { background: var(--green); }
.toast.success .t-ico { color: var(--green); }
.toast.error::before { background: var(--red); }
.toast.error .t-ico { color: var(--red); }
.toast.info::before { background: var(--blue); }
.toast.info .t-ico { color: var(--blue); }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .2s; transform: none; } .toast.hide { transform: none; } }

/* ============================================================
   A4c — 404 / not-found page block
   ============================================================ */
.nf-wrap { max-width: 640px; margin: 0 auto; padding: 72px 24px 96px; text-align: center; }
.nf-code {
  font-family: var(--font-mono); font-weight: 600; line-height: .9;
  font-size: clamp(96px, 18vw, 168px); letter-spacing: -.04em;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-3) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 6px;
}
.nf-wrap h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 10px; }
.nf-wrap > p { color: var(--text-2); font-size: 15px; line-height: 1.55; max-width: 44ch; margin: 0 auto 26px; }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.nf-maybe { text-align: left; border-top: 1px solid var(--border); padding-top: 26px; }
.nf-maybe .nf-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 14px;
}
.nf-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nf-link {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg-elev); transition: border-color .15s, background .15s;
}
.nf-link:hover { border-color: var(--accent-border); background: var(--bg-hover); }
.nf-link .nf-link-ico {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.nf-link .nf-link-t { font-size: 14px; font-weight: 600; line-height: 1.2; }
.nf-link .nf-link-s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 560px) { .nf-links { grid-template-columns: 1fr; } }
