/* AI Radar — дизайн-система.
   Палітра: Paper #F6F6FB, Ink #14141C, Violet #5B3DF5 (у темній темі #8B74FF), Signal #0E9F6E.
   Шрифт: Onest (кирилиця + латиниця), цифри з tabular-nums. Один акцент, нейтральні поверхні. */

:root {
  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #F6F6FB;
  --surface: #FFFFFF;
  --raised: #FFFFFF;
  --sunken: #EEEEF7;
  --text: #14141C;
  --muted: #5C5C74;
  --faint: #6C6C86;
  --line: rgba(20, 20, 40, .09);
  --line-strong: rgba(20, 20, 40, .17);

  --accent: #5B3DF5;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(91, 61, 245, .09);
  --accent-line: rgba(91, 61, 245, .38);
  --signal: #0E9F6E;
  --signal-soft: rgba(14, 159, 110, .12);
  --warn: #B7791F;

  --shadow-sm: 0 1px 2px rgba(20, 20, 40, .05);
  --shadow-md: 0 1px 1px rgba(20, 20, 40, .04), 0 10px 28px -12px rgba(20, 20, 60, .18);
  --shadow-lg: 0 1px 1px rgba(20, 20, 40, .04), 0 30px 70px -30px rgba(50, 30, 140, .38);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --nav-h: 64px;
}

:root[data-theme="dark"] {
  --bg: #0C0C13;
  --surface: #13131C;
  --raised: #191925;
  --sunken: #0F0F17;
  --text: #ECECF5;
  --muted: #A1A1BA;
  --faint: #8686A2;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);

  --accent: #8B74FF;
  --accent-ink: #0C0C13;
  --accent-soft: rgba(139, 116, 255, .15);
  --accent-line: rgba(139, 116, 255, .5);
  --signal: #34D399;
  --signal-soft: rgba(52, 211, 153, .14);
  --warn: #F5B14C;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 1px 1px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .65);
  --shadow-lg: 0 1px 1px rgba(0, 0, 0, .3), 0 34px 80px -30px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font);
  font-feature-settings: "ss01", "cv11";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--r-md); text-decoration: none; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- Іконки ---------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i .fill, svg .fill { fill: currentColor; stroke: none; }

/* ---------- Навбар ---------- */
.nav-shell { position: sticky; top: 0; z-index: 50; padding: 12px 20px 0; pointer-events: none; }
.navbar {
  pointer-events: auto;
  position: relative;
  width: min(1160px, 100%); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 6px 8px 6px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease), background-color .35s var(--ease);
}
.nav-shell.is-scrolled .navbar { box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.06rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; transition: transform .6s var(--ease); }
.brand:hover .brand__mark { transform: rotate(40deg); }

.nav { position: relative; display: flex; align-items: center; gap: 2px; }
.nav a {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .94rem;
  transition: color .25s var(--ease);
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.is-active { color: var(--accent); }
.nav__ind {
  position: absolute; z-index: 0; left: 0; top: 50%; height: 36px; width: 0; margin-top: -18px;
  background: var(--accent-soft); border-radius: 12px; opacity: 0;
  transition: transform .45s var(--ease), width .45s var(--ease), opacity .25s var(--ease);
}
.nav__ind.is-ready { opacity: 1; }
.nav__ind.no-anim { transition: none; }

.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 600; line-height: 1;
  animation: pop .35s var(--ease);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.tools { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover { background: var(--sunken); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn--sm { width: 34px; height: 34px; border-radius: 10px; }
#themeBtn .i { grid-area: 1 / 1; transition: transform .5s var(--ease), opacity .3s var(--ease); }
:root[data-theme="light"] #themeBtn .i-sun { opacity: 0; transform: rotate(-70deg) scale(.6); }
:root[data-theme="dark"] #themeBtn .i-moon { opacity: 0; transform: rotate(70deg) scale(.6); }
.menu-btn { display: none; }
.menu-btn .i { grid-area: 1 / 1; transition: transform .35s var(--ease), opacity .25s var(--ease); }
.menu-btn .i-shut { opacity: 0; transform: rotate(-60deg) scale(.6); }
.nav-shell.nav-open .menu-btn .i-open { opacity: 0; transform: rotate(60deg) scale(.6); }
.nav-shell.nav-open .menu-btn .i-shut { opacity: 1; transform: none; }

/* ---------- Каркас сторінок ---------- */
main { padding-bottom: 120px; }
.view { padding-top: 28px; }
.page-head { padding: 36px 0 24px; max-width: 760px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 14px; }
.lead { color: var(--muted); font-size: clamp(1.02rem, 1.4vw, 1.16rem); max-width: 56ch; }

/* ---------- Hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; padding: 48px 0 40px; isolation: isolate; }
.hero > * { min-width: 0; }
/* Радарні кільця: на всю ширину вікна, але без горизонтального переповнення сторінки */
.hero::before {
  content: ""; position: absolute; z-index: -1; top: -40px; bottom: -20px; left: 50%; width: 100vw; max-width: 100vw; transform: translateX(-50%);
  background: repeating-radial-gradient(circle at calc(50% + 315px) 46%, transparent 0 62px, var(--line) 62px 63px);
  -webkit-mask-image: radial-gradient(circle 560px at calc(50% + 315px) 46%, #000 0, transparent 100%);
  mask-image: radial-gradient(circle 560px at calc(50% + 315px) 46%, #000 0, transparent 100%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); letter-spacing: -.035em; line-height: 1.04; margin-bottom: 18px; max-width: 14ch; }

.search {
  display: flex; align-items: center; gap: 12px; height: 60px; margin-top: 30px; padding: 0 16px 0 18px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-md);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .35s var(--ease);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-md); }
.search__icon { width: 20px; height: 20px; color: var(--faint); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 1.05rem; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__key {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 8px;
  font: 500 .8rem var(--font); color: var(--faint); background: var(--sunken);
}

.metrics { display: flex; gap: 0; margin: 36px 0 0; padding: 0; }
.metrics > div { padding: 0 24px; border-left: 1px solid var(--line-strong); }
.metrics > div:first-child { padding-left: 0; border-left: 0; }
.metrics dt { color: var(--muted); font-size: .86rem; order: 2; }
.metrics dd { margin: 0 0 2px; font-size: clamp(1.25rem, 2.2vw, 1.65rem); font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.metrics > div { display: flex; flex-direction: column; }
.metrics .skeleton-line { display: block; width: 90px; height: 1.2em; border-radius: 6px; }

/* Панель «Щойно виявлені» */
.live {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  padding: 8px; transition: background-color .35s var(--ease);
}
.live__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px; }
.live__head h2 { display: flex; align-items: center; gap: 10px; font-size: 1rem; letter-spacing: -.01em; }
.live__date { color: var(--muted); font-size: .84rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); flex: none; }
.dot--idle { background: var(--faint); box-shadow: 0 0 0 4px var(--sunken); }
.dot--stale { background: var(--warn); box-shadow: 0 0 0 4px rgba(183, 121, 31, .16); }
.live__list { list-style: none; margin: 0; padding: 0; }
.live__list li + li { border-top: 1px solid var(--line); }
.live__row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px;
  color: inherit; text-decoration: none; border-radius: 14px;
  transition: background-color .2s var(--ease);
}
.live__row:hover { background: var(--sunken); text-decoration: none; }
.live__txt { min-width: 0; }
.live__name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live__sub { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live__go { color: var(--faint); transition: color .2s var(--ease), transform .25s var(--ease); }
.live__row:hover .live__go { color: var(--accent); transform: translate(2px, -2px); }
.live__skel { height: 62px; margin: 4px 6px; border-radius: 14px; }

/* Моно-тайл з першою літерою домену */
.tile {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 1rem; text-transform: uppercase;
}
.tile--lg { width: 42px; height: 42px; border-radius: 12px; }

/* ---------- Панель фільтрів ---------- */
.toolbar { display: grid; gap: 18px; margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.toolbar--news { grid-template-columns: auto minmax(0, 1fr); align-items: center; border-top: 0; padding-top: 0; margin-top: 0; gap: 20px; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -2px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }
.pill {
  flex: none; height: 38px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--muted);
  font-size: .92rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.pill:hover { color: var(--text); border-color: var(--accent-line); }
.pill:active { transform: scale(.97); }
.pill.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 28px; }
.ctl { display: grid; gap: 8px; min-width: 190px; }
.ctl__label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.ctl__label output { color: var(--text); font-weight: 600; }
.ctl select {
  appearance: none; -webkit-appearance: none; height: 42px; padding: 0 40px 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8AA2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer; transition: border-color .2s var(--ease), background-color .35s var(--ease);
}
.ctl select:hover { border-color: var(--accent-line); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 42px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--line-strong); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent-line), var(--shadow-sm); transition: transform .2s var(--ease); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent-line); }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }

.switch { display: inline-flex; align-items: center; gap: 12px; height: 42px; cursor: pointer; font-size: .94rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); transition: background-color .3s var(--ease); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .35s var(--ease); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 550; font-size: .94rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { box-shadow: 0 8px 22px -8px var(--accent); }
.btn--quiet { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.btn--quiet:hover { color: var(--text); border-color: var(--accent-line); }
.btn--sm { height: 34px; padding: 0 14px; border-radius: 10px; font-size: .88rem; }

/* ---------- Результати ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 28px 2px 16px; color: var(--muted); font-size: .92rem; min-height: 24px; }
.meta b { color: var(--text); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease), background-color .35s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
  transition: opacity .35s var(--ease);
}
.card > * { position: relative; }
.card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }

.card__head { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.card__id { min-width: 0; }
.card__domain { display: block; font-weight: 600; font-size: 1.04rem; letter-spacing: -.01em; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__domain:hover { color: var(--accent); text-decoration: none; }
.card__title { margin: 2px 0 0; color: var(--faint); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__sum { color: var(--muted); font-size: .93rem; line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.card__sum.is-open { -webkit-line-clamp: unset; display: block; }
.more { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--accent); font-size: .86rem; font-weight: 550; cursor: pointer; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 550; }
.chip--plain { background: var(--sunken); color: var(--muted); font-weight: 500; }
.chip--new { background: var(--signal-soft); color: var(--signal); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }

.card__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .84rem; }

.cmp-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font-size: .86rem; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.cmp-btn .i { width: 16px; height: 16px; }
.cmp-btn:hover { border-color: var(--accent); color: var(--accent); }
.cmp-btn:active { transform: scale(.97); }
.cmp-btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cmp-btn.is-on:hover { color: var(--accent-ink); }

/* Кільцева шкала DR */
.dr { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.dr svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dr__track { fill: none; stroke: var(--line-strong); stroke-width: 3.5; }
.dr__val { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: var(--c); stroke-dashoffset: var(--off); }
.dr--hi .dr__val { stroke: var(--signal); }
.dr--none .dr__track { stroke-dasharray: 3 5; }
.dr b { font-size: .88rem; font-weight: 650; letter-spacing: -.01em; }
.dr--none b { color: var(--faint); font-weight: 500; }

/* Скелетони й стани */
.skeleton, .skel, .skeleton-line {
  background: linear-gradient(100deg, var(--sunken) 30%, var(--accent-soft) 50%, var(--sunken) 70%); background-size: 300% 100%;
  border-radius: var(--r-lg); animation: shimmer 1.5s linear infinite;
}
.skel { height: 232px; border: 1px solid var(--line); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.state {
  grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 64px 20px; text-align: center; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-xl);
}
.state strong { color: var(--text); font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.state .btn { margin-top: 12px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 32px 0 6px; color: var(--muted); font-size: .92rem; }
.pager .btn { gap: 6px; }

/* ---------- Новинки ---------- */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 14px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 550; font-size: .9rem; cursor: pointer; transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.day { display: flex; align-items: baseline; gap: 12px; margin: 36px 0 14px; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.day span { color: var(--muted); font-weight: 450; font-size: .9rem; }
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; }

/* ---------- Порівняння ---------- */
.cmp-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-md); }
table.cmp { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 620px; }
table.cmp th, table.cmp td { padding: 16px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: .93rem; }
table.cmp tbody tr:last-child th, table.cmp tbody tr:last-child td { border-bottom: 0; }
table.cmp th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); color: var(--muted); font-weight: 500; width: 150px; white-space: nowrap; }
table.cmp thead th { padding-top: 22px; padding-bottom: 20px; }
table.cmp thead th:first-child { position: sticky; left: 0; background: var(--surface); }
.cmp-head { display: grid; gap: 12px; justify-items: start; }
.cmp-head a { font-weight: 600; font-size: 1.02rem; color: var(--text); text-decoration: none; word-break: break-all; }
.cmp-head a:hover { color: var(--accent); }
.dr-bar { display: grid; gap: 8px; min-width: 110px; }
.dr-bar b { font-size: 1.15rem; font-weight: 650; }
.dr-bar .bar { height: 6px; background: var(--sunken); border-radius: 6px; overflow: hidden; }
.dr-bar .bar i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 6px; transform-origin: left; animation: grow .8s var(--ease) both; }
.dr-bar.best .bar i { background: var(--signal); }
.dr-bar.best b { color: var(--signal); }
.best-tag { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--signal-soft); color: var(--signal); font-size: .74rem; font-weight: 600; vertical-align: 2px; }
@keyframes grow { from { transform: scaleX(0); } }
.cmp-actions { margin-top: 18px; }
.cmp-cards { display: none; }
.cmp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-md); overflow: hidden; }
.cmp-card__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.cmp-card__id { display: grid; gap: 2px; min-width: 0; }
.cmp-card__id a { font-weight: 600; font-size: 1.05rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.cmp-card__id span { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-card__list { margin: 0; padding: 4px 16px 8px; }
.cmp-card__list > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.cmp-card__list > div:last-child { border-bottom: 0; }
.cmp-card__list dt { color: var(--muted); }
.cmp-card__list dd { margin: 0; overflow-wrap: anywhere; }
.cmp-card__sum { grid-template-columns: 1fr !important; gap: 6px !important; }
.cmp-card__sum dd { color: var(--muted); line-height: 1.55; }

/* ---------- Панель вибраних ---------- */
.tray {
  position: fixed; left: 50%; bottom: 22px; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px;
  background: var(--raised);
  border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 28px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .5s var(--ease), opacity .3s var(--ease), visibility 0s linear .5s;
}
.tray[data-open="true"] { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.tray__stack { display: flex; }
.tray__stack .tile { width: 32px; height: 32px; border-radius: 10px; font-size: .86rem; border: 2px solid var(--raised); background: var(--accent-soft); }
.tray__stack .tile + .tile { margin-left: -8px; }
.tray__text { font-size: .9rem; font-weight: 500; white-space: nowrap; }

/* ---------- План ---------- */
.plan { border-top: 1px solid var(--line); }
.plan__row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.plan__row h2 { font-size: 1.15rem; letter-spacing: -.015em; position: sticky; top: 92px; align-self: start; }
.plan__body { display: grid; gap: 18px; max-width: 72ch; }
.plan__body p, .notes li, .defs dd { color: var(--muted); }
.plan__body code { padding: 2px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-family: inherit; font-size: .9em; font-weight: 500; }
.defs { display: grid; gap: 0; margin: 0; }
.defs > div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.defs > div:first-child { padding-top: 0; }
.defs > div:last-child { border-bottom: 0; padding-bottom: 0; }
.defs dt { font-weight: 550; }
.defs dd { margin: 0; }
.notes { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.plan__table { width: 100%; min-width: 600px; border-collapse: collapse; }
.plan__table th, .plan__table td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: .92rem; }
.plan__table th { color: var(--muted); font-weight: 500; background: var(--sunken); }
.plan__table tbody tr:last-child td { border-bottom: 0; }
.plan__table td:first-child { font-weight: 550; white-space: nowrap; }

/* ---------- Футер ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 56px 0 28px; transition: background-color .35s var(--ease); }
.foot__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.foot__brand p { margin-top: 16px; max-width: 34ch; color: var(--muted); font-size: .94rem; }
.foot__col h3 { margin-bottom: 14px; font-size: .9rem; font-weight: 600; color: var(--text); letter-spacing: 0; }
.foot__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot__col a { color: var(--muted); text-decoration: none; font-size: .94rem; transition: color .2s var(--ease); }
.foot__col a:hover { color: var(--accent); text-decoration: none; }
.foot__base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.status { display: inline-flex; align-items: center; gap: 12px; }

/* ---------- Анімації появи (один оркестрований момент + результати) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > *, .live { animation: rise .7s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: .06s; }
  .hero__copy > :nth-child(3) { animation-delay: .12s; }
  .hero__copy > :nth-child(4) { animation-delay: .18s; }
  .live { animation-delay: .16s; }
  .card.reveal, .live__row.reveal { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 32ms); }
  .dr__val { animation: ring 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 32ms + 120ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
  @keyframes ring { from { stroke-dashoffset: var(--c); } }

  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; animation-timing-function: var(--ease); }
  .nav-shell { view-transition-name: navbar; }
  .tray { view-transition-name: tray; }
  ::view-transition-group(navbar), ::view-transition-group(tray) { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 28px; }
  .hero h1 { max-width: 18ch; }
  .hero::before {
    background: repeating-radial-gradient(circle at 82% 170px, transparent 0 62px, var(--line) 62px 63px);
    -webkit-mask-image: radial-gradient(circle 460px at 82% 170px, #000 0, transparent 100%);
    mask-image: radial-gradient(circle 460px at 82% 170px, #000 0, transparent 100%);
  }
}
@media (max-width: 980px) {
  .toolbar--news { grid-template-columns: 1fr; }
  .plan__row { grid-template-columns: 1fr; gap: 14px; }
  .plan__row h2 { position: static; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .nav-shell { padding: 10px 12px 0; }
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
    background: var(--raised); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top right;
    transition: opacity .25s var(--ease), transform .35s var(--ease), visibility 0s linear .35s;
  }
  .nav-shell.nav-open .nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav a { padding: 13px 14px; font-size: 1rem; }
  .nav a.is-active { background: var(--accent-soft); }
  .nav__ind { display: none; }
  .wrap { width: min(1160px, 100% - 28px); }
  .metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .metrics > div { padding: 0 16px; }
  .metrics > div:nth-child(3) { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .controls { gap: 16px; }
  .ctl { min-width: 100%; }
  .defs > div { grid-template-columns: 1fr; gap: 4px; }
  .cmp-cards { display: grid; gap: 14px; }
  .cmp-wrap { display: none; }
  .tray { width: calc(100% - 24px); justify-content: space-between; gap: 10px; bottom: 64px; }
  main { padding-bottom: 56px; }
  .foot { padding: 36px 0 20px; }
  .foot__base { padding-right: 190px; }
  .foot__grid { gap: 28px 20px; }
  .foot__brand p { margin-top: 12px; }
  .foot__col h3 { margin-bottom: 10px; }
  .foot__col ul { gap: 4px; }
  .foot__col a { display: inline-block; padding: 6px 0; }
  .foot__base { margin-top: 28px; padding-top: 18px; }
  .tray__text { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 480px) {
  .foot__base { padding-right: 0; padding-bottom: 48px; }
  .search__key { display: none; }
}
