/* Собственное современное оформление: светлая и тёмная темы, карточки, мягкие тени, индиго-акцент.
   Переменные в :root используются и админкой (tools/admin). */
:root {
  --bg: #f5f6fa; --card: #ffffff; --surface: #ffffff; --surface2: #f1f3f9; --text: #1b2230; --muted: #667085; --line: #e3e6ee; --sec: #eef1f8;
  --accent: #4f46e5; --accent2: #4338ca; --accent-text: #ffffff; --accent-soft: #eceafd; --accent-ink: #3730a3;
  --best: #def7ec; --best-text: #046c4e; --warn: #b54708; --ok: #12a150; --danger: #d92d20;
  --head: rgba(255, 255, 255, .86); --th: #eef1f8; --zebra: #fafbfe; --hover-row: #f1f0ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow2: 0 12px 32px rgba(16, 24, 40, .16);
  --r: 10px; --r2: 16px;
  --c0: #4f46e5; --c1: #0ea5a4; --c2: #f59e0b; --c3: #e11d48; --c4: #8b5cf6; --c5: #16a34a;
  --link: #3f3bd6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1320; --card: #171c2b; --surface: #171c2b; --surface2: #1e2437; --text: #e8ebf5; --muted: #9aa3b8; --line: #2a3148; --sec: #1e2437;
    --accent: #7c83ff; --accent2: #6a71f0; --accent-text: #0f1320; --accent-soft: #272c52; --accent-ink: #c7cbff;
    --best: #123a2b; --best-text: #6ee7b7; --warn: #fdb022; --head: rgba(15, 19, 32, .86); --th: #1e2437; --zebra: #1a2031; --hover-row: #232a45;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow2: 0 12px 32px rgba(0, 0, 0, .55); --link: #a5aaff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1320; --card: #171c2b; --surface: #171c2b; --surface2: #1e2437; --text: #e8ebf5; --muted: #9aa3b8; --line: #2a3148; --sec: #1e2437;
  --accent: #7c83ff; --accent2: #6a71f0; --accent-text: #0f1320; --accent-soft: #272c52; --accent-ink: #c7cbff;
  --best: #123a2b; --best-text: #6ee7b7; --warn: #fdb022; --head: rgba(15, 19, 32, .86); --th: #1e2437; --zebra: #1a2031; --hover-row: #232a45;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow2: 0 12px 32px rgba(0, 0, 0, .55); --link: #a5aaff; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; border: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.wrap { width: 1180px; max-width: 100%; margin: 0 auto; padding: 0 20px; }

/* ---------- кнопки и поля ---------- */
button { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); padding: 7px 14px; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover:not(:disabled) { background: var(--surface2); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.green { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover:not(:disabled), .btn.green:hover { background: var(--accent2); border-color: var(--accent2); color: var(--accent-text); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; margin: 0 8px 8px 0; cursor: pointer; text-decoration: none; box-shadow: var(--shadow); transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--surface2); text-decoration: none; color: var(--text); }
input[type=text], input[type=search], input[type=number], input[type=email], select {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 7px 10px; font-size: 14px; max-width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
::placeholder { color: var(--muted); opacity: .8; }

/* ---------- шапка ---------- */
.hdr { position: sticky; top: 0; z-index: 1000; background: var(--head); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.hdr .wrap { height: 64px; position: relative; display: flex; align-items: center; gap: 8px; }
.logo { display: flex; align-items: center; gap: 10px; margin-right: 28px; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; color: var(--text); }
.logo svg { width: 30px; height: 30px; padding: 5px; border-radius: 9px; background: var(--accent); color: #fff; flex: none; }
.menu { display: flex; gap: 4px; }
.menu a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 15px; text-transform: lowercase; transition: background .15s, color .15s; }
.menu a:first-letter { text-transform: uppercase; }
.menu a.nocase { text-transform: none; }
.menu a:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.menu a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.searchbtn { width: 40px; height: 40px; margin-left: auto; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--muted); }
.searchbtn:hover:not(:disabled) { background: var(--surface2); color: var(--text); border: 0; }
.searchbtn svg { width: 20px; height: 20px; }
.menubtn { display: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--text); }
.poisk { display: none; border-top: 1px solid var(--line); padding: 12px 20px; }
.poisk.on { display: block; }
.poisk input { display: block; width: 640px; max-width: 100%; margin: 0 auto; padding: 11px 16px; font-size: 16px; border-radius: 999px; }
.poisk-res { position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% - 4px); width: 640px; max-width: calc(100% - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow2); max-height: 60vh; overflow: auto; z-index: 1100; }
.poisk { position: relative; }
.poisk-res a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--line); font-size: 15px; }
.poisk-res a:last-child { border-bottom: 0; }
.poisk-res a:hover, .poisk-res a.on { background: var(--accent-soft); text-decoration: none; }
.poisk-res a small { color: var(--muted); flex: none; }
.poisk-res .none { padding: 14px 16px; color: var(--muted); }

/* ---------- каркас ---------- */
.crumbs { width: 1180px; max-width: 100%; margin: 0 auto; padding: 16px 20px 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .dom { display: inline-block; width: 13px; height: 12px; margin-right: 2px; vertical-align: -1px; background: currentColor; clip-path: polygon(50% 0, 100% 48%, 86% 48%, 86% 100%, 14% 100%, 14% 48%, 0 48%); }
.body { padding: 0 20px; }
.content { max-width: 1000px; margin: 0 auto; padding: 8px 0 56px; }
.content.wide { max-width: 1180px; }
h1.zag { font-size: 32px; margin: 18px 0 14px; }
h1.zag.r { text-align: left; }
.content h2 { margin: 36px 0 14px; font-size: 22px; }
.content h3 { margin: 22px 0 8px; font-size: 18px; }
.content p { margin: 12px 0; }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 760px; }
.note-box { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r); font-size: 13px; line-height: 1.55; color: var(--muted); }
.steps { padding-left: 22px; } .steps li { margin: 8px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }

/* ---------- подвал ---------- */
.ftop { margin-top: 24px; background: var(--surface); border-top: 1px solid var(--line); }
.ftop .wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 32px; padding-bottom: 20px; }
.fcol > div { display: flex; flex-direction: column; gap: 6px; }
.fh { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; font-weight: 700; font-size: 14px; }
.fh:first-child { margin-top: 0; }
.fh svg { width: 18px; height: 18px; color: var(--accent); }
.fcol a { color: var(--muted); font-size: 14px; }
.fcol a:hover { color: var(--accent); }
.fbot { background: var(--surface); }
.fbot .wrap { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; font-size: 13px; }
.fbot a { color: var(--muted); }
.fbot a:hover { color: var(--accent); }
.fbot .src { flex-basis: 100%; font-size: 12px; color: var(--muted); max-width: 780px; margin: 4px 0 0; }
.fbot .cp { margin-left: auto; text-align: right; color: var(--muted); }
.toup { position: fixed; right: 18px; bottom: 18px; z-index: 900; padding: 9px 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow2); font-size: 13px; font-weight: 600; display: none; }

/* ---------- главная ---------- */
.home-hero { text-align: center; padding: 56px 20px 40px; margin: 8px 0 8px; border-radius: 24px; background: radial-gradient(900px 300px at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--surface); border: 1px solid var(--line); }
.home-hero h1 { font-size: 40px; line-height: 1.15; margin: 0 auto 16px; max-width: 760px; letter-spacing: -.03em; }
.home-hero .lead { margin: 0 auto; text-align: center; }
.sect { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0 8px; }
.sect > a { position: relative; display: block; padding: 22px 22px 22px 88px; min-height: 108px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.sect > a:hover { transform: translateY(-2px); box-shadow: var(--shadow2); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); text-decoration: none; }
.sect .ic { position: absolute; left: 22px; top: 22px; width: 48px; height: 48px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; border-radius: 14px; }
.sect .ic svg { width: 26px; height: 26px; }
.sect b { display: block; font-size: 19px; margin-bottom: 6px; }
.sect b .n { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.sect p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.plitki { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 12px 0 20px; }
.plitka { display: block; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s; }
.plitka:hover { transform: translateY(-2px); box-shadow: var(--shadow2); text-decoration: none; }
.plitka .t { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.plitka .vs { display: block; font-size: 16px; font-weight: 700; line-height: 1.35; }
.plitka p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- каталог раздела ---------- */
.intro { text-align: center; padding: 28px 0 8px; }
.intro .big { font-size: 38px; letter-spacing: -.03em; }
.intro .lead { margin: 14px auto 18px; text-align: center; }
.knopkass { display: inline-flex; align-items: center; gap: 10px; margin: 6px 6px 0; padding: 11px 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.knopkass:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.knopkass svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.plitka-box { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; padding: 18px 20px; margin: 24px 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }
.badge-n { display: flex; align-items: center; gap: 10px; align-self: center; padding: 8px 14px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 12px; }
.badge-n svg { width: 22px; height: 22px; }
.badge-n div { font-size: 11px; line-height: 1.1; text-transform: uppercase; letter-spacing: .05em; }
.badge-n b { display: block; font-size: 20px; letter-spacing: 0; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.fgroup span.l { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--muted); }
.fgroup .yr { font-size: 11px; }
.plitka-box br { display: none; }
.dirbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--surface); font-size: 16px; user-select: none; }
.dirbtn:hover { background: var(--surface2); }
.resetbtn { margin-left: auto; align-self: center; cursor: pointer; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 600; padding: 6px 4px; }
.resetbtn:hover:not(:disabled) { background: none; text-decoration: underline; border: 0; }
table.lst { border-collapse: separate; border-spacing: 0; width: 100%; margin: 0; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); overflow: hidden; }
table.lst td { border-bottom: 1px solid var(--line); padding: 10px 14px; vertical-align: middle; }
table.lst tbody tr:last-child td { border-bottom: 0; }
table.lst tbody tr { cursor: pointer; transition: background .12s; }
table.lst tbody tr:hover { background: var(--hover-row); }
table.lst thead td { background: var(--th); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-align: center; padding: 12px 14px; }
table.lst thead td:nth-child(2) { text-align: left; }
table.lst td.n { width: 1%; padding: 10px 6px 10px 16px; color: var(--muted); font-size: 13px; text-align: center; }
table.lst td.nm { position: relative; padding-left: 64px; min-height: 56px; font-size: 16px; font-weight: 600; }
table.lst td.nm a { color: var(--text); }
table.lst td.nm a:hover { color: var(--accent); text-decoration: none; }
table.lst td.nm .vi { position: absolute; left: 14px; top: 50%; margin-top: -18px; width: 36px; height: 36px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
table.lst td.c { text-align: center; font-size: 14px; }
.mal { font-size: 12px; font-weight: 400; color: var(--muted); }
.more { text-align: center; margin: 18px 0 8px; }
.more button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 26px; border-radius: 999px; font-weight: 600; font-size: 14px; background: var(--surface); box-shadow: var(--shadow); }
.more button svg { width: 18px; height: 18px; }
.none-found { text-align: center; padding: 40px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r2); }
details.static-list { margin-top: 36px; }
details.static-list > summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 10px 0; }
.biglist { columns: 3 240px; column-gap: 28px; padding: 0; margin: 8px 0 20px; list-style: none; }
.biglist li { break-inside: avoid; padding: 4px 0; font-size: 14px; }
.biglist small { color: var(--muted); }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.jump a { padding: 4px 12px; border-radius: 999px; background: var(--surface2); color: var(--text); font-size: 13px; }
.jump a:hover { background: var(--accent-soft); text-decoration: none; }

/* ---------- страницы рейтинга ---------- */
.fblock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); margin-bottom: 18px; font-size: 13px; }
.fblock .ftitle { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 700; }
.fblock .ind { font-size: 13px; font-weight: 500; color: var(--muted); }
.fblock .ind .hid { color: var(--warn); }
.fbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px 20px; padding: 18px 20px 6px; align-items: end; }
.fcell { min-width: 0; }
.fcell > .t { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.fcell select, .fcell input[type=text], .fcell input[type=number] { width: 100%; font-size: 13px; padding: 7px 9px; }
.fcell input[type=number][style] { width: calc(50% - 8px) !important; }
.fcell label.cb { display: flex; gap: 8px; align-items: center; cursor: pointer; padding: 7px 0; }
.act { color: var(--accent) !important; }
.fcell.right { grid-column: span 2; }
.dd { position: relative; display: block; z-index: 10; }
.dd > input { width: 100%; cursor: pointer; text-overflow: ellipsis; padding-right: 26px !important; }
.dd > .arr { position: absolute; right: 10px; top: 50%; margin-top: -2px; width: 0; height: 0; border: 4px solid transparent; border-top: 5px solid var(--muted); pointer-events: none; }
.dd-list { display: none; position: absolute; left: 0; top: calc(100% + 4px); min-width: 100%; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow2); text-align: left; z-index: 899; white-space: nowrap; padding: 4px; }
.dd.open .dd-list { display: block; }
.dd-list label { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.dd-list label:hover { background: var(--accent-soft); }
.dd-list small { color: var(--muted); }
.fbtns { display: flex; justify-content: flex-end; gap: 18px; padding: 4px 20px 16px; }
.fbtns a { cursor: pointer; font-size: 13px; font-weight: 600; }
.howto { padding: 12px 20px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.howto > span { cursor: pointer; font-weight: 600; color: var(--accent); }
.howto .txt { display: none; padding: 10px 0 0; line-height: 1.6; }
.howto.open .txt { display: block; }
.sortbar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 4px 2px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sortbar select { font-weight: 400; color: var(--text); }
.rtwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); box-shadow: var(--shadow); }
table.rt { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; }
table.rt td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: middle; }
table.rt tbody tr:last-child td { border-bottom: 0; }
table.rt thead td { position: sticky; top: 0; background: var(--th); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 12px 10px; white-space: nowrap; user-select: none; }
table.rt thead td[data-sort]:hover { color: var(--accent); }
table.rt td.num { color: var(--muted); width: 40px; }
table.rt td.nm { text-align: left; font-size: 14px; font-weight: 600; min-width: 200px; }
table.rt td.nm .lk { color: var(--text); cursor: pointer; }
table.rt td.nm .lk:hover { color: var(--accent); }
table.rt tbody tr:nth-child(even) td { background: var(--zebra); }
table.rt tbody tr:hover td { background: var(--hover-row); }
table.rt tr.cmpd td { background: var(--accent-soft) !important; }
table.rt tr.cmpd td.nm .lk { color: var(--accent-ink); }
table.rt td.cb { width: 36px; }
.diag { position: relative; width: 190px; max-width: 100%; height: 24px; margin: 0 auto; border-radius: 999px; background: var(--surface2); overflow: hidden; text-align: left; }
.diag .bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); }
.diag .v { position: absolute; left: 10px; top: 0; line-height: 24px; font-size: 12px; font-weight: 700; color: var(--text); mix-blend-mode: normal; text-shadow: 0 0 3px var(--surface); }
.diag.none .v { color: var(--muted); font-weight: 400; text-shadow: none; }
.rt-more { text-align: center; margin: 18px 0 8px; }
.ctx { position: fixed; z-index: 3000; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow2); font-size: 13px; display: none; min-width: 210px; padding: 4px; }
.ctx div { padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.ctx div:hover { background: var(--accent-soft); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.cmp-panel { position: fixed; z-index: 2500; right: 20px; bottom: 20px; width: 300px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow2); font-size: 13px; display: none; overflow: hidden; }
.cmp-panel h4 { background: var(--accent); color: var(--accent-text); font-size: 13px; padding: 10px 40px 10px 14px; margin: 0; position: relative; }
.cmp-panel h4 span { position: absolute; right: 12px; top: 6px; cursor: pointer; font-size: 20px; }
.cmp-panel .it { padding: 8px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.cmp-panel .it b { cursor: pointer; color: var(--danger); font-weight: 400; }
.cmp-panel .go { display: block; margin: 12px; text-align: center; background: var(--accent); color: var(--accent-text); padding: 10px; border-radius: var(--r); font-weight: 700; }
.cmp-panel .go:hover { background: var(--accent2); text-decoration: none; }
.popup { position: fixed; z-index: 3500; left: 50%; top: 5vh; transform: translateX(-50%); width: 680px; max-width: 94%; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: var(--r2); box-shadow: var(--shadow2); display: none; }
.popup .ph { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 52px 14px 20px; font-size: 18px; font-weight: 700; z-index: 2; }
.popup .x { position: absolute; right: 14px; top: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; cursor: pointer; line-height: 1; }
.popup .x:hover { background: var(--surface2); }
.popup .pb { padding: 6px 20px 20px; }
.popup .pb .lk { margin-top: 12px; }
.popup-bg { position: fixed; inset: 0; z-index: 3400; background: rgba(10, 14, 28, .5); display: none; }

/* ---------- страницы сравнения ---------- */
.addbox { position: relative; width: 340px; max-width: 100%; margin: 0 0 16px; z-index: 800; }
.addbtn { display: block; width: 100%; background: var(--accent); border: 0; color: var(--accent-text); text-align: center; font-size: 15px; font-weight: 700; padding: 11px 14px; border-radius: var(--r); box-shadow: var(--shadow); }
.addbtn:hover:not(:disabled) { background: var(--accent2); border: 0; }
.addbtn span { margin-left: 8px; font-size: 12px; font-weight: 500; opacity: .8; }
.addpanel { display: none; position: absolute; left: 0; top: calc(100% + 8px); width: 440px; max-width: calc(100vw - 40px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow2); padding: 14px; max-height: calc(100vh - 150px); overflow-y: auto; }
.addpanel.open { display: block; }
.addpanel .fl { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.addpanel .fl .fr { flex: 1 1 130px; min-width: 120px; }
.addpanel .fl .fr > span { display: block; font-weight: 600; margin-bottom: 4px; }
.addpanel .fl select, .addpanel .fl input[type=number] { width: 100%; font-size: 12px; padding: 6px 8px; }
.addpanel .fl input[type=number] { width: calc(50% - 6px); }
.addpanel .fl details summary { cursor: pointer; list-style: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface); color: var(--text); }
.addpanel .fl .opts { margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; max-height: 150px; overflow: auto; padding: 4px 8px; background: var(--surface); color: var(--text); }
.addpanel .fl .opts label, .addpanel .fl .bools label { display: flex; gap: 6px; align-items: center; cursor: pointer; padding: 2px 0; }
.addpanel .fl .bools { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.addpanel .q { width: 100%; }
.addpanel .found { font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.addpanel .list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); }
.addpanel .list label { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.addpanel .list label:last-child { border-bottom: 0; }
.addpanel .list label:hover { background: var(--accent-soft); }
.addpanel .list label small { display: block; color: var(--muted); font-size: 12px; }
.addpanel .list label.in { opacity: .45; }
.addpanel .list .none { padding: 18px; color: var(--muted); text-align: center; }
.addpanel .acts { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.addpanel .acts .btn { margin: 0; padding: 7px 12px; font-size: 13px; box-shadow: none; }
.cmpbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 14px; }
.cmpbar .acts2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cmpbar .btn { margin: 0; padding: 7px 14px; font-size: 14px; }
.cmpbar label.tg { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.cmpbar .settings-wrap { position: relative; display: inline-block; }
.settings { position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-width: 94vw; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow2); padding: 14px; z-index: 850; }
.settings .modes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.settings .rowlist { border-top: 1px solid var(--line); padding-top: 8px; max-height: 320px; overflow-y: auto; }
.settings .rowlist b { display: block; margin: 10px 0 2px; font-size: 13px; }
.settings .rowlist label { display: flex; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.settings .rowlist label.off { color: var(--muted); cursor: default; }
.msg { min-height: 20px; font-size: 13px; color: var(--warn); }
.cmpwrap { overflow: auto; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); border-radius: var(--r2); }
@media (min-width: 1100px) { .cmpwrap { overflow: visible; max-height: none; } }
table.cmp { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; min-width: calc(200px + var(--n, 2) * 150px); font-size: 14px; background: var(--surface); }
@media (min-width: 1100px) { table.cmp { min-width: 100%; } }
.cmp th, .cmp td { border-bottom: 1px solid var(--line); vertical-align: middle; text-align: center; }
.cmp thead th { position: sticky; top: 0; z-index: 5; background: var(--surface); height: 76px; padding: 12px 28px 10px 10px; border-bottom: 2px solid var(--line); box-shadow: 0 6px 10px -8px rgba(16, 24, 40, .25); }
@media (min-width: 1100px) { .cmp thead th { top: 64px; } }
.cmp th.corner { width: 200px; text-align: left; left: 0; z-index: 6; }
.cmp th.corner button { font-size: 12px; padding: 5px 10px; }
.cmp th.dev { cursor: grab; }
.cmp th.dev .av { display: none; }
.cmp th.dev .nm { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; }
.cmp th.dev .sub { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--muted); line-height: 1.3; }
.cmp th.dev .x { position: absolute; top: 8px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.cmp th.dev .x:hover { background: var(--surface2); color: var(--danger); border: 0; }
.cmp th.dev.over { background: var(--accent-soft); }
.cmp th.dev::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--col); }
.cmp tr.sec td { background: var(--th); text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; cursor: pointer; user-select: none; }
.cmp tr.sec td span { position: sticky; left: 14px; }
.cmp td { padding: 10px 10px; color: var(--text); }
.cmp tr.lbl:nth-child(even) td { background: var(--zebra); }
.cmp tr.lbl td:first-child { text-align: left; background: var(--surface); color: var(--muted); font-size: 13px; padding-left: 14px; position: sticky; left: 0; z-index: 1; }
.cmp tr.lbl:nth-child(even) td:first-child { background: var(--zebra); }
.cmp tr.lbl.diff td:first-child { color: var(--text); font-weight: 700; }
.cmp .val { word-break: break-word; }
.cmp .meter { height: 5px; max-width: 150px; margin: 6px auto 0; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.cmp .meter i { display: block; height: 100%; border-radius: 999px; }
.cmp td.best { background: var(--best) !important; }
.cmp td.best .val { font-weight: 700; color: var(--best-text); }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--r2); background: var(--surface); }
.empty strong { display: block; color: var(--text); font-size: 22px; margin-bottom: 6px; }
.empty .btn { margin: 14px 0 0; }
.empty .pairs { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; font-size: 13px; }
.empty .pairs span { flex-basis: 100%; }
.empty .pairs .btn { margin: 0; font-size: 13px; padding: 7px 14px; }
.rating { margin-top: 24px; padding: 22px 24px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }
.rating h3 { font-size: 18px; margin: 0 0 14px; }
.rating .r { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; gap: 14px; align-items: center; padding: 6px 0; }
.rating .nm { font-weight: 600; font-size: 14px; }
.rating .v { font-size: 12px; color: var(--muted); font-weight: 400; }
.rating .track { background: var(--surface2); height: 26px; border-radius: 999px; overflow: hidden; }
.rating .fill { height: 100%; background: var(--col); display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; color: #fff; font-size: 12px; font-weight: 700; min-width: 48px; border-radius: 999px; }
.rating .note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.help { margin-top: 24px; padding: 18px 22px; font-size: 14px; line-height: 1.6; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); color: var(--muted); }
.help h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.help ul { margin: 0 0 8px; padding-left: 20px; }

/* ---------- страницы устройств ---------- */
table.spec { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; box-shadow: var(--shadow); }
.spec caption { text-align: left; font-size: 17px; font-weight: 700; padding: 6px 2px 10px; caption-side: top; }
.spec th, .spec td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; vertical-align: top; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.spec th { width: 40%; font-weight: 400; color: var(--muted); background: var(--zebra); }
.spec td { font-weight: 600; }
.dev-actions { margin: 16px 0; }

/* ---------- прочее ---------- */
.cookie { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 780px; margin: 0 auto; z-index: 3000; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow2); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; line-height: 1.5; }
.cookie p { margin: 0; flex: 1 1 300px; }
.cookie .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie .btn { margin: 0; padding: 8px 14px; font-size: 13px; }
.edit-fab { position: fixed; left: 12px; bottom: 12px; z-index: 2900; padding: 9px 16px; background: #111827; color: #fff; font-size: 13px; font-weight: 700; border-radius: 999px; box-shadow: var(--shadow2); }
.edit-fab:hover { background: var(--accent); color: #fff; text-decoration: none; }
.cat-loading { padding: 48px; text-align: center; color: var(--muted); }

/* ---------- узкие экраны ---------- */
@media (max-width: 960px) {
  .hdr .wrap { height: 58px; }
  .logo { margin-right: 0; }
  .menubtn { display: block; }
  .searchbtn { margin-left: auto; }
  .menu { display: none; position: absolute; left: 12px; right: 12px; top: 62px; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow2); padding: 8px; }
  .menu.open { display: flex; }
  .menu a { padding: 12px 16px; border-radius: 10px; font-size: 16px; }
  .ftop .wrap { grid-template-columns: 1fr 1fr; }
  .home-hero h1 { font-size: 32px; }
}
@media (max-width: 720px) {
  .wrap, .crumbs { padding-left: 16px; padding-right: 16px; }
  .body { padding: 0 16px; }
  h1.zag { font-size: 26px; }
  .intro .big { font-size: 30px; }
  .home-hero { padding: 36px 16px 28px; border-radius: 18px; }
  .home-hero h1 { font-size: 27px; }
  .sect { grid-template-columns: 1fr; }
  .sect > a { padding: 18px 18px 18px 80px; }
  .sect .ic { left: 18px; top: 18px; }
  .ftop .wrap { grid-template-columns: 1fr; gap: 8px; }
  .fbot .cp { margin-left: 0; text-align: left; }
  .plitka-box { padding: 14px; }
  .fgroup { flex: 1 1 140px; }
  .badge-n { flex-basis: 100%; }
  table.lst { display: block; overflow-x: auto; }
  table.lst td { padding: 8px 10px; }
  table.lst td.nm { font-size: 15px; min-width: 190px; }
  .fbody { grid-template-columns: 1fr 1fr; padding: 14px 14px 4px; gap: 12px; }
  .fcell.right { grid-column: span 2; }
  .fbtns { padding: 4px 14px 14px; }
  .howto, .fblock .ftitle { padding-left: 14px; padding-right: 14px; }
  .addbox { width: 100%; }
  .addpanel { width: calc(100vw - 32px); }
  table.cmp { min-width: calc(110px + var(--n, 2) * 130px); font-size: 13px; }
  .cmp th.corner { width: 110px; }
  .cmp thead th { padding-right: 22px; height: 70px; }
  .cmp th.dev .sub { display: none; }
  .rating .r { grid-template-columns: 1fr; gap: 4px; }
  .toup { bottom: 74px; }
  .cmp-panel { right: 12px; bottom: 12px; }
}

[hidden] { display: none !important; }
.dd-list .gh { padding: 6px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.fcell label.cb small { color: var(--muted); }
.dd-list .gh { padding: 6px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.fcell label.cb small { color: var(--muted); }
