/* ===== Цвета: тёмная тема по умолчанию, светлая — через data-theme="light" ===== */
:root {
  --bg: #121214; --card: #1c1c1f; --inset: #141416; --text: #ececef; --muted: #9a9aa3; --line: #2f2f34;
  --accent: #6d28d9; --accent-text: #a78bfa; --ok: #36c37a; --warn: #f2b53c; --fail: #ef5a5a;
  --banner-bg: #3a2f12; --banner-text: #ffd98a; --tip-bg: #2f2f34;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e6e4eb; --card: #f3f2f6; --inset: #ece5fb; --text: #1c1727; --muted: #574f69; --line: #c9c2d6;
  --accent: #5b21b6; --accent-text: #5b21b6; --ok: #1f9d5c; --warn: #b7791f; --fail: #d64545;
  --banner-bg: #f8ecc8; --banner-text: #6b4800; --tip-bg: #1c1727;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e6e4eb; --card: #f3f2f6; --inset: #ece5fb; --text: #1c1727; --muted: #574f69; --line: #c9c2d6;
    --accent: #5b21b6; --accent-text: #5b21b6; --ok: #1f9d5c; --warn: #b7791f; --fail: #d64545;
    --banner-bg: #f8ecc8; --banner-text: #6b4800; --tip-bg: #1c1727;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
:root { accent-color: var(--accent); }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
.top { padding: 24px 16px 8px; max-width: 960px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.top h1 { margin: 0 0 4px; font-size: 28px; }
.top p { margin: 0; color: var(--muted); }
/* Заголовок сжимается и переносит строки, а кнопки остаются справа на любом языке */
.top > div:first-child { flex: 1 1 0; min-width: 240px; }
.top .toolbar { flex-shrink: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--inset); }
.lang button { border: 0; background: none; color: var(--muted); padding: 8px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button.on { background: var(--accent); color: #fff; }
.banner { max-width: 928px; margin: 12px auto; padding: 10px 14px; border-radius: 8px; background: var(--banner-bg); color: var(--banner-text); font-size: 14px; }
@media (max-width: 960px) { .banner { margin: 12px 16px; } }
main { max-width: 960px; margin: 0 auto; padding: 0 16px 40px; display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.card h2 { margin: 0 0 14px; font-size: 18px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.muted { color: var(--muted); font-weight: 400; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; align-items: start; }
.grid > label { align-content: start; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px 14px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
label.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
select, input[type=number] { width: 100%; min-width: 0; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--inset); color: var(--text); font-size: 15px; }
/* Свой вид списков и поля FPS на всех системах (iPhone/Safari иначе рисует их по-своему: фиолетовый текст, свои стрелки) */
select, input[type=number] { -webkit-appearance: none; appearance: none; font-family: inherit; line-height: 1.3; margin: 0; }
select { padding-right: 30px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select:focus, input[type=number]:focus { outline: none; border-color: var(--accent-text); }
select option, select optgroup { background: var(--card); color: var(--text); }
/* Подписи над полями одной высоты, даже если рядом значок «?» */
label > span:first-child { display: flex; align-items: center; gap: 6px; min-height: 18px; line-height: 18px; }
button { font: inherit; }
button.primary { padding: 10px 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; }
button.primary:hover { filter: brightness(1.1); }
button.ghost { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset); color: var(--text); font-size: 14px; cursor: pointer; }
button.ghost:hover { border-color: var(--accent-text); }
button.link { border: 0; background: none; color: var(--accent-text); cursor: pointer; font-size: 14px; padding: 0; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.act { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent-text) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--text); font-size: 14px; font-weight: 600; transition: transform .12s, background .12s, border-color .12s; }
.act svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act:hover { background: color-mix(in srgb, var(--accent) 26%, var(--card)); border-color: var(--accent-text); transform: translateY(-1px); }
.act:active { transform: translateY(0); }
.act:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.act-main { grid-column: 3 / -1; min-height: 50px; font-size: 15px; border: 0; color: #fff;
  background: var(--accent); }
.act-main svg { stroke: #fff; }
.act-main:hover { background: var(--accent); filter: brightness(1.1); }
.toast { min-height: 20px; margin-top: 8px; font-size: 14px; color: var(--ok); }
.warnings { margin: 10px 0 0; padding-left: 18px; color: var(--warn); font-size: 14px; }

/* Подсказки к терминам */
.tip { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; line-height: 1; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted);
  font-size: 11px; font-style: normal; font-weight: 700; cursor: help; position: relative; vertical-align: middle; }
.tip:hover::after, .tip:focus::after { content: attr(data-text); position: absolute; left: 50%; top: 22px; transform: translateX(-50%); z-index: 10;
  width: min(280px, 80vw); padding: 10px 12px; border-radius: 8px; background: var(--tip-bg); color: #fff; font-size: 13px; font-weight: 400; line-height: 1.4; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.tip:focus { outline: 2px solid var(--accent-text); outline-offset: 1px; }

/* Результат */
.score { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.ring { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700;
  background: conic-gradient(var(--c, var(--accent)) calc(var(--p, 0) * 1%), var(--line) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; }
.bars { flex: 1; min-width: 220px; display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 1fr 48px; gap: 2px 10px; font-size: 13px; }
.bar > span { grid-column: 1 / -1; color: var(--muted); }
.bar > i { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; align-self: center; }
.bar b { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.bar em { font-style: normal; text-align: right; }
.fps { margin: 18px 0 6px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fps .tile { background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fps .tile.active { border-color: var(--accent-text); }
.fps .tile small { color: var(--muted); display: block; }
.fps .tile strong { font-size: 24px; white-space: nowrap; }
.fps .hint { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.notes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.notes li { padding: 9px 12px 9px 34px; border-radius: 8px; background: var(--inset); position: relative; font-size: 14px; }
.notes li::before { position: absolute; left: 12px; font-weight: 700; }
.notes li.ok::before { content: "✓"; color: var(--ok); }
.notes li.warn::before { content: "!"; color: var(--warn); }
.notes li.fail::before { content: "✕"; color: var(--fail); }
.notes li.fail { outline: 1px solid var(--fail); }

/* Варианты */
/* ПК: сборки сеткой. Слайдер с выглядывающими соседними карточками — только на телефоне (ниже) */
.slider { position: relative; }
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sl-btn { display: none; }
.variant { text-align: left; background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--text); cursor: pointer; display: grid; gap: 6px; min-width: 0; }
.variant:hover { border-color: var(--muted); }
.variant.active { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.variant .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.variant .head b { font-size: 16px; }
.variant .vmain { display: none; font-size: 13px; color: var(--muted); }
.specs-toggle { display: none; }
.swipe-hint { display: none; }
.notes-toggle { display: none; margin-top: 10px; }
.variant .tag { font-size: 12px; color: var(--muted); text-align: right; }
.variant .big { font-size: 22px; font-weight: 700; }
.variant .pct { font-size: 13px; font-weight: 600; }
.variant ul { margin: 0; padding-left: 16px; font-size: 13px; color: var(--muted); }

/* Апгрейд */
.up-steps { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.up-steps li { background: var(--inset); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.up-steps .why { color: var(--muted); font-size: 13px; display: block; }
.up-steps .from { text-decoration: line-through; color: var(--muted); }

/* Сравнение */
.table-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
.cmp th, .cmp td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp th { color: var(--muted); font-weight: 500; width: 22%; }
.cmp td.better { color: var(--ok); font-weight: 600; }

/* Сохранённые */
.saved { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.saved li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--inset); border-radius: 8px; padding: 10px 12px; font-size: 14px; flex-wrap: wrap; }
.saved li .btns { display: flex; gap: 6px; }
.saved .empty { background: none; color: var(--muted); padding: 0; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px; }
footer a { color: var(--muted); }

/* Реклама */
.ad-top { max-width: 960px; margin: 12px auto 0; padding: 0 16px; min-height: 90px; display: grid; place-items: center; }
.ad-top > * { width: 100%; }
.ad-placeholder { height: 90px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; text-align: center; padding: 0 12px; }

/* Телефон */
@media (max-width: 560px) {
  select, input[type=number] { font-size: 16px; } /* меньше 16px — iPhone увеличивает страницу при нажатии */
  .top h1 { font-size: 23px; }
  .card { padding: 14px; }
  .parts { grid-template-columns: 1fr; }
  .ring { width: 76px; height: 76px; font-size: 19px; }
  .ring::before { inset: 8px; }
  .fps { gap: 6px; }
  .fps .tile { padding: 8px; }
  .fps .tile small { font-size: 12px; }
  .fps .rnum { display: none; }
  .fps .tile strong { font-size: 17px; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  /* Сборки: горизонтальный слайдер, карточка компактная, характеристики по кнопке */
  /* Слайдер: выбранная по центру, по краям видны соседние карточки */
  .variants { --vw: 68%; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 2px 0 10px;
    scrollbar-width: none; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); }
  .variants::-webkit-scrollbar { display: none; }
  .variants::before, .variants::after { content: ""; flex: 0 0 calc((100% - var(--vw)) / 2 - 10px); }
  .variants > .variant { flex: 0 0 var(--vw); scroll-snap-align: center; transition: opacity .25s ease; }
  .variants > .variant:not(.active) { opacity: .6; }
  .top > div:first-child { width: 100%; }
  .toolbar { width: 100%; justify-content: space-between; align-items: center; }
  .toolbar button.ghost, .lang button { min-height: 38px; }
  .variants { align-items: flex-start; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid > label:first-child { grid-column: 1 / -1; }
  .grid { grid-auto-flow: row dense; }
  .variant { padding: 12px; gap: 4px; }
  .score { flex-wrap: nowrap; gap: 14px; align-items: center; }
  .bars { min-width: 0; gap: 6px; }
  .bar { font-size: 12px; }
  .variant .head { flex-direction: column; gap: 0; }
  .variant .tag { text-align: left; }
  .variant .big { font-size: 20px; }
  .variant .vmain { display: block; }
  .variant .specs { display: none; }
  .variant.open .specs { display: block; margin-top: 4px; }
  .specs-toggle { display: block; justify-self: start; border: 0; background: none; padding: 4px 0; color: var(--accent-text); font-size: 13px; font-weight: 600; cursor: pointer; }
  .swipe-hint { display: inline; }
  #variantsCard h2 .muted:not(.swipe-hint) { display: none; }
  /* Результат: успешные проверки свёрнуты */
  .notes:not(.all) li.ok { display: none; }
  .notes-toggle { display: inline-block; }
  .act { font-size: 13px; padding: 8px; }
  .ad-top { min-height: 60px; }
  .ad-placeholder { height: 60px; }
}

/* Печать / PDF: только сборка и результат, на белом фоне */
@media print {
  :root { --bg: #fff; --card: #fff; --inset: #f4f4f4; --text: #000; --muted: #555; --line: #ccc; color-scheme: light; }
  .no-print, .ad-top { display: none !important; }
  .card { border: 0; padding: 0 0 12px; break-inside: avoid; }
  select { appearance: none; border: 0; padding: 2px 0; background: none !important; font-weight: 600; }
  footer { font-size: 10px; }
}

/* Магазины-партнёры */
.act-shop { grid-column: 1 / 3; min-height: 50px; font-size: 15px; border: 1.5px solid var(--accent-text); }
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.partner { display: grid; place-items: center; gap: 4px; min-height: 84px; padding: 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); color: var(--text); text-decoration: none; text-align: center; }
a.partner:hover { border-color: var(--accent-text); }
.partner img, .pick-partner img { max-width: 120px; max-height: 40px; object-fit: contain; }
.partner small, .pick-partner small { color: var(--muted); font-size: 12px; }
.logo-text { font-weight: 700; font-size: 14px; }
.partner-empty { border-style: dashed; color: var(--muted); }
.partner-empty .logo-text { font-weight: 500; color: var(--muted); }

.shop-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); }
.shop-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.shop-dialog form { display: grid; gap: 12px; padding: 18px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-close { border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.shop-dialog p { margin: 0; }
.shop-dialog input[type=text], .shop-dialog textarea { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--inset); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.pick-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pick-partner { display: block; cursor: pointer; }
.pick-partner input { position: absolute; opacity: 0; }
.pick-partner span { display: grid; place-items: center; gap: 2px; min-height: 62px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--inset); text-align: center; color: var(--text); }
.pick-partner input:checked + span { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.pick-partner input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.shop-build summary { cursor: pointer; color: var(--accent-text); font-size: 14px; }
.shop-build pre { white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--muted); background: var(--inset); padding: 10px; border-radius: 8px; margin: 8px 0 0; }
.hidden-field { position: absolute; left: -9999px; }
.shop-status { font-size: 14px; min-height: 20px; }
.shop-status.ok { color: var(--ok); } .shop-status.err { color: var(--fail); } .shop-status.warn { color: var(--warn); }
@media (max-width: 560px) {
  .act-shop, .act-main { grid-column: 1 / -1; }
  .partners { grid-template-columns: 1fr 1fr; }
}


/* Счётчик посещений в шапке */
.visits[hidden] { display: none !important; }
.visits { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset); color: var(--muted); font-size: 14px; white-space: nowrap; }
.visits svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visits b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .partners { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .toolbar { flex-wrap: nowrap; gap: 6px; }
  .visits { min-height: 38px; padding: 0 8px; gap: 5px; font-size: 13px; }
  .visits svg { width: 15px; height: 15px; }
  .toolbar button.ghost { padding: 8px 9px; font-size: 13px; white-space: nowrap; }
  .lang button { padding: 8px 9px; }
  .lang, .visits { flex-shrink: 0; }
}
.toolbar.compact .th-txt { display: none; }
.toolbar.compact button.ghost { padding: 8px 12px; }

/* Телефон: кнопка «Подобрать варианты» в одной строке с полем Intel/AMD */
@media (max-width: 560px) {
  #step1 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 10px; align-items: end; }
  #step1 > h2 { grid-column: 1 / -1; margin-bottom: 0; }
  #step1 .grid { display: contents; }
  #step1 .pick-row { display: contents; }
  /* кнопка режима — рядом с Intel/AMD, «Подобрать варианты» — ниже на всю ширину */
  #step1 .mode-btn { order: 1; margin: 0; width: 100%; height: 41px; padding: 0 6px; font-size: 14px; line-height: 1.1; white-space: normal; }
  #step1 #pick { order: 2; grid-column: 1 / -1; margin: 4px 0 0; width: 100%; height: 44px; font-size: 15px; }
}

/* Цена в сохранённых сборках */
.saved .price { display: inline-block; margin: 3px 0 1px; color: var(--accent-text); font-weight: 600; }
.saved-note { font-size: 12px; margin: 8px 0 0; }
.saved-note:empty { display: none; }

/* Пометка «упор в процессор» на плитке FPS */
.fps .tile .lim { display: block; font-style: normal; font-size: 12px; color: var(--warn, #d97706); margin-top: 2px; }
@media (max-width: 560px) { .fps .tile .lim { font-size: 11px; line-height: 1.2; } }

/* ===== Простой и расширенный режим ===== */
.pick-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.pick-row #pick, .pick-row .mode-btn { margin: 0; }
.mode-btn { font-size: 15px; padding: 10px 18px; }
.simple-only { display: none !important; }
body.simple .simple-only { display: revert !important; }
body.simple .adv-only { display: none !important; }
/* Простой режим: кнопки под сборками, результат — только % и FPS для выбранного разрешения */
#variantsCard .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#variantsCard .act-shop { grid-column: auto; min-height: 0; }
#variantsCard .toast:empty { display: none; }
#variantsCard .warnings:empty { display: none; }
body.simple .fps { grid-template-columns: minmax(0, 320px); }
body.simple .fps .tile:not(.active) { display: none; }
@media (max-width: 560px) {
  #variantsCard .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #variantsCard .act-shop { grid-column: 1 / -1; min-height: 50px; }
  body.simple .fps { grid-template-columns: 1fr; }
}
/* PDF из простого режима: печатается полный список деталей */
@media print {
  body.simple #buildCard { display: block !important; }
  body.simple #buildCard .parts { display: grid !important; }
}

/* ===== Простой режим: подробный итог ===== */
.sres { display: grid; gap: 18px; }
.sres-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sbox { background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.sbox small { color: var(--muted); font-size: 12px; }
.sbox b { font-size: 17px; }
.sbox span { font-size: 14px; }
.sbox em { font-style: normal; color: var(--muted); font-size: 12px; }
.sbox-fps { grid-column: span 2; }
.sfps { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sfps strong { font-size: 30px; line-height: 1.15; }
.sfps span { font-weight: 600; font-size: 14px; }
.meter { position: relative; height: 8px; margin: 10px 0 18px; border-radius: 4px; background: var(--line); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent-text); }
.meter u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); text-decoration: none; }
.meter u span { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--muted); }
.sbox-compat { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.sbox-compat div { display: grid; gap: 2px; }
.sbox-compat b { font-size: 14px; font-weight: 600; }
.ring.ring-s { width: 64px; height: 64px; font-size: 16px; }
.ring.ring-s::before { inset: 7px; }
.sres-sec h3 { margin: 0 0 8px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--inset); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.chip b { color: var(--text); margin-left: 4px; }
.sparts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sp { background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.sp-role { font-size: 12px; color: var(--muted); }
.sp-role em { font-style: normal; color: var(--accent-text); font-weight: 600; }
.sp b { font-size: 14px; overflow-wrap: anywhere; }
.sp small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.stips { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.stips li::marker { color: var(--accent-text); }
.sres .hint { margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .sres-grid { grid-template-columns: 1fr 1fr; }
  .sbox-fps { grid-column: 1 / -1; }
  .sparts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sres { gap: 16px; }
  .sres-grid { gap: 8px; }
  .sbox { padding: 10px 12px; }
  .sbox-compat, .sbox-price { grid-column: 1 / -1; }
  .sfps strong { font-size: 26px; }
  .stips { font-size: 13.5px; }
}
/* Расширенный режим: подробный итог отдельным блоком, без повторов FPS и совместимости */
body:not(.simple) .sbox-fps, body:not(.simple) .sbox-compat { display: none; }
/* Простой режим: итог коротко — без пояснений мелким шрифтом, только 2 главных совета */
body.simple .sbox em { display: none; }
body.simple .stips li:nth-child(n+3) { display: none; }

/* ===== Работа и учёба, настройки графики, «Мой ПК», картинка ===== */
body.work .game-only { display: none !important; }
.variant .big-work { font-size: 17px; line-height: 1.25; }
.variant .vwork { font-size: 13px; margin-top: 2px; }
.sfps .swork { font-size: 22px; line-height: 1.25; }
/* Кнопки: в расширенном 5 в ряд (+ «Картинкой»), в простом — 4 */
#buildCard .actions { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#buildCard .act-shop { grid-column: 1 / 3; }
#buildCard .act-main { grid-column: 3 / -1; }
body.work #buildCard .act-shop { grid-column: 1 / -1; }
#variantsCard .actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mypc-btn { font-size: 15px; padding: 10px 18px; }
@media (max-width: 560px) {
  #buildCard .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #buildCard .act-shop, #buildCard .act-main, #buildCard #imgBtn { grid-column: 1 / -1; }
  #variantsCard .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #variantsCard .act { flex-direction: column; gap: 4px; font-size: 12px; padding: 8px 4px; text-align: center; line-height: 1.15; }
  #variantsCard .act-shop { flex-direction: row; gap: 8px; font-size: 15px; }
  #step1 .mypc-btn { order: 3; grid-column: 1 / -1; width: 100%; height: 44px; margin: 0; padding: 0 8px; font-size: 15px; }
  body.work #step1 > .grid > label:first-child { grid-column: 1 / -1; }
}
/* Окно «Мой ПК» */
.mypc-dialog .dlg-body { display: grid; gap: 12px; padding: 18px; }
.mypc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mypc-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.mypc-dialog .hint { color: var(--muted); font-size: 12px; margin: 0; }
.mypc-out { display: grid; gap: 10px; }
.mypc-now { font-weight: 600; }
.mypc-ok { color: var(--ok); font-weight: 600; }
.mypc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mypc-list li { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); }
.mypc-list li.best { border-color: var(--accent-text); }
.mp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mp-top .tag { font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.mp-swap { font-size: 14px; }
.mp-swap .from { color: var(--muted); text-decoration: line-through; }
.mp-nums { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.mp-fps { color: var(--ok); font-weight: 700; }
.mp-cost { color: var(--muted); }
@media (max-width: 560px) { .mypc-grid { grid-template-columns: 1fr; } }
@media (min-width: 561px) { #step1 .grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
body.work .fps .tile strong { white-space: normal; overflow-wrap: anywhere; font-size: 17px; line-height: 1.25; }
body.work .fps { grid-template-columns: minmax(0, 420px); }
.mypc-dialog .mypc-grid { grid-template-columns: 1fr; }
.mypc-now { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); }
.mypc-now b { font-size: 17px; }
.mypc-now small { font-size: 12px; }
.mp-apply { justify-self: start; margin-top: 4px; }
.mypc-now .chip { background: var(--card); }

/* Боковые баннеры: слева и справа от сайта, не касаясь основного блока. Только на широком экране */
.ad-side { display: none; }
@media (min-width: 1340px) {
  .ad-side { --sw: 160px; display: block; position: fixed; top: 24px; width: var(--sw); max-height: calc(100vh - 48px); overflow: hidden; z-index: 1; }
  .ad-left { left: calc(50% - 480px - 24px - var(--sw)); }
  .ad-right { right: calc(50% - 480px - 24px - var(--sw)); }
  .ad-side img { display: block; width: 100%; height: auto; border-radius: 10px; }
  .ad-side-ph { height: 600px; max-height: calc(100vh - 48px); line-height: 1.5; }
  .ad-side-ph small { font-size: 11px; opacity: .8; }
}
@media (min-width: 1660px) { .ad-side { --sw: 300px; } }
.visits .v24 { font-size: 12px; color: var(--muted); }
.toolbar.compact .visits .v24 { display: none; }
/* Телефон: «Что входит в сборку» — только тип детали и название, одной строкой */
@media (max-width: 560px) {
  .sparts { gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--inset); overflow: hidden; }
  .sp { grid-template-columns: 38% 1fr; align-items: baseline; gap: 8px; padding: 8px 12px; border: 0; border-radius: 0; background: none; }
  .sp + .sp { border-top: 1px solid var(--line); }
  .sp small, .sp-role em { display: none; }
  .sp b { font-size: 13px; font-weight: 600; }
}

/* ===== Верхний баннер: свои промо (Lis-Skins, магазины-партнёры) ===== */
.promo, .promo-img { position: relative; display: flex; align-items: center; gap: 18px; width: 100%; min-height: 90px; padding: 12px 22px; border-radius: 10px; text-decoration: none; overflow: hidden; }
.promo-img { padding: 0; min-height: 0; justify-content: center; }
.promo-img img { display: block; width: 100%; max-height: 90px; object-fit: contain; border-radius: 10px; }
.promo-brand { flex: none; font-weight: 800; font-size: 26px; letter-spacing: .5px; }
.promo-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.promo-text b { font-size: 18px; line-height: 1.2; }
.promo-text small { font-size: 13px; opacity: .75; }
.promo-btn { flex: none; padding: 10px 18px; border-radius: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.promo-ad { position: absolute; top: 4px; right: 8px; font-size: 10px; opacity: .6; letter-spacing: .3px; }
.promo-img .promo-ad { background: rgba(0, 0, 0, .45); color: #fff; padding: 1px 5px; border-radius: 4px; opacity: .8; }
/* Lis-Skins: тёмно-синий фон и оранжевый акцент */
.promo-lis { background: linear-gradient(100deg, #0d1220 0%, #141b30 60%, #1d1730 100%); color: #f3f4f8; border: 1px solid #2a3150; }
.promo-lis .promo-brand { color: #fff; }
.promo-lis .promo-brand i { font-style: normal; color: #ff7a1a; }
.promo-lis .promo-btn { background: #ff7a1a; color: #14110d; }
.promo-lis:hover .promo-btn { background: #ff8f3d; }
/* Свой баннер: в цветах сайта */
.promo-par { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.promo-par .promo-btn { background: var(--accent); color: #fff; }
@media (max-width: 560px) {
  .promo { min-height: 64px; gap: 10px; padding: 16px 10px 10px 12px; }
  .promo-brand { font-size: 15px; }
  .promo-text b { font-size: 13px; }
  .promo-text small, .promo-par .promo-brand { display: none; }
  .promo-btn { padding: 8px 10px; font-size: 12.5px; }
  .promo-ad { top: 2px; right: 8px; }
}
@media (max-width: 360px) { .promo-lis .promo-brand { display: none; } }

/* ===== Шапка сайта: одна строка — логотип, баннер, язык/тема/профиль ===== */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.hbar { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; flex: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; font-size: 19px; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: .2px; }
.brand-name span { color: var(--muted); font-weight: 600; }
.brand-logo { display: block; height: 38px; width: auto; max-width: 180px; object-fit: contain; }
.htools { display: flex; align-items: center; gap: 8px; flex: none; }
.htools .visits { min-height: 36px; }
.htools .th-txt { display: none; }
.icon-btn { min-width: 38px; min-height: 36px; padding: 6px 9px; display: inline-grid; place-items: center; }
.icon-btn svg, .login-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.login-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; }
.burger { display: none; }
/* Баннер — между логотипом и кнопками, занимает свободное место */
.hbar .ad-top { flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; padding: 0; min-height: 0; display: block; }
.hbar .ad-top > * { width: 100%; }
.site-head .promo { min-height: 58px; padding: 8px 14px; gap: 12px; }
.site-head .promo-brand { font-size: 18px; }
.site-head .promo-text b { font-size: 14px; }
.site-head .promo-text small { font-size: 12px; }
.site-head .promo-btn { padding: 7px 12px; font-size: 13px; }
.site-head .promo-img img { max-height: 60px; }
.site-head .ad-placeholder { height: 58px; font-size: 12px; }
.top { display: block; padding: 20px 16px 8px; }
.top h1 { font-size: 26px; }
/* ПК: язык — узкий столбик, справа колонкой «Тема» над «Войти» */
@media (min-width: 561px) {
  .htools { display: grid; grid-template-rows: auto auto; gap: 6px 8px; align-items: stretch; }
  .htools .visits { grid-column: 1; grid-row: 1 / 3; }
  .htools .lang { grid-column: 2; grid-row: 1 / 3; flex-direction: column; }
  .htools .lang button { padding: 2px 10px; font-size: 12.5px; line-height: 1.2; flex: 1; }
  .htools .lang button + button { border-left: 0; border-top: 1px solid var(--line); }
  /* «Войти» сверху, тема снизу; одинаковые размер, шрифт и высота */
  .htools .login-btn, #themeBtn { grid-column: 3; display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; height: 40px; min-height: 40px; width: var(--hbtn-w, 186px); justify-content: flex-start; padding: 0 14px; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; }
  .login-btn { grid-row: 1; }
  #themeBtn { grid-row: 2; }
  .htools .login-btn svg { width: 17px; height: 17px; }
  .htools #themeBtn .th-txt { display: inline; }
  /* баннер по высоте = столбик языков (две кнопки), симметрично */
  .hbar .ad-top { align-self: stretch; display: flex; }
  .hbar .ad-top > * { height: 100%; min-height: 0; }
  .site-head .promo { min-height: 0; padding-top: 6px; padding-bottom: 6px; }
  .site-head .ad-placeholder { height: auto; }
  .site-head .promo-brand { font-size: 22px; }
  .site-head .promo-text b { font-size: 16px; }
  .site-head .promo-text small { font-size: 13px; }
  .site-head .promo-btn { padding: 9px 14px; font-size: 14px; }
  .brand-mark { width: 38px; height: 38px; font-size: 21px; }
  .brand-name { font-size: 21px; }
  .brand-logo { height: 44px; }
}
@media (max-width: 900px) and (min-width: 561px) {
  .htools .v24, .site-head .promo-text small, .site-head .promo-brand { display: none; }
  .htools #themeBtn .th-txt, .login-btn span { display: none; }
  .htools { --hbtn-w: 44px; }
  .htools .login-btn, #themeBtn { justify-content: center; padding: 0; }
}
/* Телефон: логотип, язык, ☰. В меню — тема и профиль. Баннер — ниже, на всю ширину */
@media (max-width: 560px) {
  .hbar { padding: 8px 12px 10px; gap: 8px; flex-wrap: wrap; }
  .brand { margin-right: auto; }
  .brand-mark { width: 30px; height: 30px; font-size: 17px; }
  .brand-name { font-size: 17px; }
  .brand-logo { height: 32px; }
  .htools { display: contents; }
  .htools .visits { order: 1; min-height: 34px; }
  .htools .lang { order: 2; }
  .htools .lang button { min-height: 34px; padding: 6px 8px; font-size: 12px; }
  .burger { order: 3; display: inline-grid; min-height: 34px; }
  .hbar .ad-top { order: 7; flex: 1 1 100%; }
  #themeBtn, .login-btn { display: none; order: 6; flex: 1 1 40%; justify-content: center; min-height: 40px; }
  body.menu-open #themeBtn, body.menu-open .login-btn { display: inline-flex; align-items: center; gap: 6px; }
  body.menu-open #themeBtn .th-txt { display: inline; }
  .site-head .promo { min-height: 52px; padding: 14px 10px 8px 12px; }
  .site-head .promo-brand { font-size: 15px; }
  .site-head .promo-text b { font-size: 13px; }
  .site-head .promo-text small { display: none; }
  .site-head .ad-placeholder { height: 52px; }
  .top { padding: 14px 16px 4px; }
  .top h1 { font-size: 22px; }
}

/* Счётчик посетителей — маленький значок справа от заголовка «Подбор ПК» */
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.title-row h1 { margin: 0; }
.title-row .visits { display: inline-flex; align-items: center; gap: 5px; min-height: 0; height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; }
.title-row .visits svg { width: 14px; height: 14px; }
.title-row .visits .v24 { display: inline; font-size: 11.5px; }
