:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #1d1f22;
  --muted: #5e636b;
  --line: #dcd7cb;
  --accent: #c2410c;
  --accent-soft: #fde7da;
  --ok: #15803d;
  --warn: #a16207;
  --warn-soft: #fef3c7;
  --lcd: #b9d27a;
  --lcd-ink: #22300c;
  --radius: 10px;
  --maxw: 1100px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --surface: #1d2024; --surface-2: #262a2f; --text: #e8e6e1;
    --muted: #a0a5ad; --line: #353a41; --accent: #fb923c; --accent-soft: #3a2415;
    --ok: #4ade80; --warn: #fbbf24; --warn-soft: #3a3012; --lcd: #7e9446; --lcd-ink: #0e1405;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --surface: #1d2024; --surface-2: #262a2f; --text: #e8e6e1;
  --muted: #a0a5ad; --line: #353a41; --accent: #fb923c; --accent-soft: #3a2415;
  --ok: #4ade80; --warn: #fbbf24; --warn-soft: #3a3012; --lcd: #7e9446; --lcd-ink: #0e1405;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-top: .4em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 8px; font-size: .93rem; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
@media (max-width: 720px) {
  .top { position: static; }
  .nav a { padding: 4px 8px; font-size: .9rem; }
}

main { padding: 8px 0 64px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card h3 { margin-top: 0; }
a.card { color: inherit; text-decoration: none; display: block; transition: border-color .15s; }
a.card:hover { border-color: var(--accent); }
.card .kicker { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 600; }

/* notes */
.note { background: var(--warn-soft); border-left: 4px solid var(--warn); padding: 10px 14px; border-radius: 6px; margin: 16px 0; }
.tip { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin: 16px 0; }
.badge { display: inline-block; font-size: .75rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.verify { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.on { background: var(--ok); color: #fff; border-color: transparent; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
tr.live td { background: color-mix(in srgb, var(--ok) 10%, transparent); }

/* controls */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .92rem; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
input[type="search"] { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; flex: 1 1 200px; max-width: 320px; }

/* steps */
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 4px 0 10px 44px; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .9rem;
}
details.howto { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; }
details.howto > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; }
details.howto > summary::-webkit-details-marker { display: none; }
details.howto > summary::before { content: "▸ "; color: var(--accent); }
details.howto[open] > summary::before { content: "▾ "; }
details.howto > .body { padding: 0 16px 12px; }

/* receiver illustration */
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 16px 0; }
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.kbd { display: inline-block; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font-size: .88em; background: var(--surface-2); font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }

/* bands spectrum */
.spectrum { display: grid; gap: 10px; margin: 16px 0; }
.band-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.band-bar { height: 28px; border-radius: 6px; background: var(--surface-2); position: relative; overflow: hidden; border: 1px solid var(--line); }
.band-bar span { position: absolute; top: 0; bottom: 0; background: var(--accent); opacity: .8; }
.band-bar em { position: absolute; left: 8px; top: 3px; font-style: normal; font-size: .82rem; color: var(--text); mix-blend-mode: normal; }
@media (max-width: 560px) { .band-row { grid-template-columns: 1fr; gap: 4px; } }

/* antennas */
.ant { display: flex; flex-direction: column; gap: 8px; }
.ant .price { font-size: 1.2rem; font-weight: 700; }
.stars { color: var(--accent); letter-spacing: 1px; white-space: nowrap; }
.ratings { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .9rem; }
.ant ul { margin: 0; padding-left: 18px; font-size: .92rem; }
.ant .meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* clock */
.clock { font-family: ui-monospace, Consolas, monospace; background: var(--lcd); color: var(--lcd-ink); padding: 4px 10px; border-radius: 6px; font-weight: 700; }

footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .88rem; }

/* active chip: counter readable */
.chip.active .muted { color: rgba(255,255,255,.85); }

/* раскрывающиеся строки «как включить» */
tr.has-detail { cursor: pointer; }
tr.has-detail:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
tr.has-detail.open td { background: var(--accent-soft); border-bottom-color: transparent; }
tr.detail > td { background: var(--accent-soft); padding: 0 12px 14px; }
.tune-btn { font: inherit; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 2px 8px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tune-btn:hover { border-color: var(--accent); }
.tune-btn .caret { color: var(--accent); font-size: .8em; transition: transform .15s; }
tr.open .tune-btn .caret { transform: rotate(180deg); }
.tune { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.tune p { margin: 6px 0; }
.tune ul { margin: 6px 0 0; padding-left: 18px; }
.tune-keys { font-size: 1.02rem; line-height: 2.1; }
.tune-keys .kbd { font-size: .95rem; padding: 1px 8px; }
.tune-pre { font-size: .92rem; background: var(--warn-soft); border-radius: 6px; padding: 4px 8px; }
.kbd.hold { border-color: var(--accent); }
.tune-lcd { font: 700 1.05rem/1.2 ui-monospace, Consolas, monospace; background: var(--lcd); color: var(--lcd-ink);
  padding: 12px 14px; border-radius: 8px; white-space: pre; min-width: 170px; text-align: right; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.tune-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.play-btn { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer;
  background: var(--ok); color: #fff; }
@media (max-width: 640px) {
  .tune { grid-template-columns: 1fr; }
  .tune-lcd { order: -1; text-align: left; }
}

/* плеер онлайн-потока */
.player { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 20; width: min(560px, calc(100% - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: 10px 14px; display: flex; gap: 12px; align-items: center; }
.player[hidden] { display: none; }
.player .ptitle { flex: 1; min-width: 0; }
.player .ptitle b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .pstate { font-size: .82rem; color: var(--muted); }
.player button { font: inherit; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px;
  width: 38px; height: 38px; cursor: pointer; flex: none; }
.player button.main { background: var(--accent); color: #fff; border-color: var(--accent); }
body.has-player main { padding-bottom: 110px; }
/* на узком экране таблица скроллится вбок — карточку подсказки держим в видимой области */
@media (max-width: 760px) {
  tr.detail > td { padding: 0 0 12px; }
  .tune { position: sticky; left: 0; width: calc(100vw - 34px); }
}
button.badge { cursor: pointer; font-family: inherit; }
button.badge:hover { border-color: var(--ok); color: var(--ok); }

/* антенны: галерея и отзывы */
.ant-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gallery { display: grid; gap: 6px; margin: -4px -6px 4px; }
.gallery-main { width: 100%; height: 240px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.thumbs { display: flex; gap: 6px; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: 6px; background: #fff; cursor: pointer; width: 56px; height: 56px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb.on { border-color: var(--accent); }
.ant .wb { font-size: .85rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.reviews { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: .92rem; }
.reviews p { margin: 4px 0; }
.reviews .pc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 420px) { .reviews .pc { grid-template-columns: 1fr; } }
.reviews ul { margin: 2px 0 0; padding-left: 0; list-style: none; font-size: .88rem; }
.reviews li { padding-left: 16px; position: relative; margin: 2px 0; }
.reviews ul.plus li::before { content: "+"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.reviews ul.minus li::before { content: "−"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.ant .buy { font-weight: 600; margin-top: auto; }

/* фото приёмника */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; }
.hero-photo { background: #0b1220; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hero-photo img { width: 100%; height: auto; display: block; }
.hero-photo figcaption { font-size: .8rem; color: #a7b0c0; padding: 6px 10px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
