/* «Кодекс Таэрна»: графит, пергамент, золото игровых диалогов; цвета редкостей — как в игре. */
:root {
  --bg: #e9e7e2;
  --panel: #f4f3ef;
  --panel-2: #fbfaf7;
  --line: #d6d2c9;
  --line-2: #c3beb2;
  --text: #22252a;
  --muted: #69665f;
  --accent: #8a6414;
  --accent-soft: #efe4cb;
  --gold: #8a6414;
  --good: #2f7d3a;
  --warn: #b0532a;
  --r-rar: #8b6a3e; --r-psy: #0b8583; --r-syn: #a8235c; --r-set: #4e8913; --r-epic: #9a7408; --r-none: var(--text);
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(30, 30, 30, .06), 0 6px 18px rgba(30, 30, 30, .08);
  --radius: 6px;
  --topbar: 56px;
  --sidebar: 230px;
  --detail: 420px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13161a; --panel: #1a1e23; --panel-2: #22272e; --line: #2c3239; --line-2: #3b424c;
    --text: #e6e0d2; --muted: #8f8a7e; --accent: #d9ab52; --accent-soft: #2a2416; --gold: #d9ab52;
    --good: #8fcf7c; --warn: #e3a17a;
    --r-rar: #d4b38a; --r-psy: #4fd3d1; --r-syn: #e0558d; --r-set: #96d452; --r-epic: #f0c94a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13161a; --panel: #1a1e23; --panel-2: #22272e; --line: #2c3239; --line-2: #3b424c;
  --text: #e6e0d2; --muted: #8f8a7e; --accent: #d9ab52; --accent-soft: #2a2416; --gold: #d9ab52;
  --good: #8fcf7c; --warn: #e3a17a;
  --r-rar: #d4b38a; --r-psy: #4fd3d1; --r-syn: #e0558d; --r-set: #96d452; --r-epic: #f0c94a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
/* Редкость задаёт --rc у строки, карточки и подсказки. */
[data-rar="Рар"] { --rc: var(--r-rar); }
[data-rar="Психорар"] { --rc: var(--r-psy); }
[data-rar="Синергетик"] { --rc: var(--r-syn); }
[data-rar="Сет"] { --rc: var(--r-set); }
[data-rar="Эпик"] { --rc: var(--r-epic); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--sans);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.global-search input:focus-visible, .local-search:focus-visible, select:focus-visible { outline: 0; }

/* ---------- topbar ---------- */
.topbar {
  height: var(--topbar);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 30;
}
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-text { font: 700 21px/1 var(--serif); letter-spacing: .01em; }
.logo-text b { color: var(--accent); }

.global-search { flex: 1; max-width: 560px; position: relative; margin-left: auto; }
.global-search input, .local-search, select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit; font-size: 15px;
  outline: none;
}
.global-search input:focus, .local-search:focus, select:focus { border-color: var(--accent); }
.search-results {
  position: absolute; top: 42px; left: 0; right: 0;
  max-height: 70vh; overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 4px;
}
.sr {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px; color: var(--text);
}
.sr:hover, .sr.active { background: var(--accent-soft); text-decoration: none; }
.sr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-sec { color: var(--muted); font-size: 12px; }
.sr-more { padding: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.sr-group { padding: 8px 8px 2px; color: var(--muted); font-size: 13px; }
.sr-group:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; }
.sr-name { font: 700 16px/1.2 var(--serif); color: var(--rc, var(--text)); }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: transparent; color: var(--text);
  font-size: 16px; cursor: pointer;
}
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.icon-btn[aria-disabled] { opacity: .35; pointer-events: none; }
.menu-btn { display: none; }

/* ---------- layout ---------- */
.layout {
  display: flex;
  height: calc(100% - var(--topbar));
}
.sidebar {
  width: var(--sidebar); flex: none;
  overflow-y: auto;
  padding: 14px 0;
  background: var(--bg);
  border-right: 1px solid var(--line);
}
.main {
  flex: 1; min-width: 0;
  overflow-y: auto;
  padding: 24px 28px 60px;
}
.detail {
  width: var(--detail); flex: none;
  overflow-y: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 12px 20px 40px;
}
.backdrop { display: none; }

/* ---------- sidebar ---------- */
.nav-title { margin: 18px 20px 4px; font-size: 13px; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; }
.nav-item, .nav-subitem {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 20px;
  color: var(--text); font-size: 15px;
}
.nav-item:hover, .nav-subitem:hover { background: var(--panel); text-decoration: none; }
.nav-item.active, .nav-subitem.active { color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); background: var(--accent-soft); }
.nav-item.open:not(.active) { font-weight: 500; }
.count { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: normal; }
.nav-sub { display: flex; flex-direction: column; margin: 0 0 6px; }
.nav-subitem { padding: 4px 20px 4px 34px; font-size: 14px; }

/* ---------- headings / chips ---------- */
.page-title { margin: 0; font: 700 32px/1.1 var(--serif); letter-spacing: .005em; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.list-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.list-head .src-link { margin-left: auto; margin-top: 0; }
.banner {
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font-size: 13px;
}
.chip i { font-style: normal; color: var(--muted); font-size: 11px; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.chip.active i { color: var(--bg); opacity: .8; }
/* Категории на широком экране уже есть в боковом меню — облако нужно только на телефоне. */
.cat-chips { display: none; margin-bottom: 14px; }

/* ---------- home ---------- */
.home-hero { max-width: 760px; padding: 18px 0 26px; }
.home-hero .page-title { font-size: 44px; }
.home-search {
  display: flex; align-items: center; width: 100%; height: 50px; margin-top: 20px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel);
  color: var(--muted); font: 17px var(--sans); text-align: left; cursor: text;
}
.home-search:hover { border-color: var(--accent); }
.home-search kbd, .kbd { margin-left: auto; font: 13px var(--sans); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 7px; color: var(--muted); }
.home-grid { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); border-top: 1px solid var(--line); }
.home-tile { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.home-tile-head { display: flex; align-items: baseline; gap: 12px; color: var(--text); }
.home-tile-head:hover { text-decoration: none; }
.home-tile-head b { font: 700 23px/1.15 var(--serif); }
.home-tile-head:hover b { color: var(--accent); }
.home-tile-head span { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.home-tile p { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.home-tile p a { color: var(--text); }
.home-tile p a:hover { color: var(--accent); }
.home-note { margin: 22px 0 0; color: var(--muted); font-size: 14px; }
.home-recent { margin: 0 0 26px; }
.home-h { margin: 0 0 10px; font: 700 20px/1.2 var(--serif); }
.bref span { color: var(--rc, var(--text)); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; }
.toolbar .local-search { flex: 1; }
.toolbar select { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; flex: none; }
.seg button {
  height: 34px; padding: 0 12px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font: 15px var(--sans);
}
.seg button.active { background: var(--accent-soft); color: var(--accent); }
.result-count { margin: 14px 0 6px; color: var(--muted); font-size: 14px; }
/* Фильтр редкости: точка цвета редкости, как в игре. */
.rar-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill {
  height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 15px; background: transparent;
  color: var(--rc, var(--muted)); font: 14px var(--sans); cursor: pointer;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill:hover { border-color: var(--rc, var(--accent)); }
.pill.on { color: var(--rc, var(--text)); border-color: var(--rc, var(--accent)); background: var(--panel); box-shadow: inset 0 0 0 1px var(--rc, var(--accent)); }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- icons ---------- */
/* Ячейка иконки как слот инвентаря: рамка цвета редкости. */
.ico {
  width: 48px; height: 48px; flex: none;
  border-radius: 5px;
  background: radial-gradient(circle at 50% 40%, var(--panel-2), var(--bg));
  border: 1px solid var(--rc, var(--line-2));
  display: grid; place-items: center;
  overflow: hidden;
}
.ico img { max-width: 100%; max-height: 100%; image-rendering: auto; }
.ico-empty { color: var(--muted); font-weight: 700; font-size: 18px; }
.ico-sm { width: 28px; height: 28px; border-radius: 6px; font-size: 12px; }
.ico-lg { width: 80px; height: 80px; border-radius: 12px; font-size: 30px; }

/* ---------- список: строки-инвентарь ---------- */
.grid { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.card {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 76px minmax(0, 200px); gap: 14px; align-items: center;
  padding: 7px 8px; border-bottom: 1px solid var(--line);
  color: var(--text); position: relative;
}
.card:hover { background: var(--panel); text-decoration: none; }
.card.selected { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--rc, var(--accent)); }
.card.fav .card-name::after { content: " ★"; color: var(--gold); font: 14px var(--sans); }
.card-body { min-width: 0; }
.card-name { font: 700 18px/1.2 var(--serif); color: var(--rc, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-lvl { text-align: right; color: var(--muted); font-size: 14px; white-space: nowrap; }
.card-lvl b, .card-key b { color: var(--text); font-weight: 500; }
.card-key { text-align: right; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Когда открыта широкая карточка, колонка списка узкая — оставляем иконку и имя. */
.main { container-type: inline-size; }
@container (max-width: 620px) {
  .card { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .card-key { display: none; }
}
@container (max-width: 380px) {
  .card { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .card-lvl { display: none; }
  .card .ico { width: 40px; height: 40px; }
}
.lvl {
  display: inline-block;
  padding: 0 7px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 500;
}

/* ---------- table ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th {
  position: sticky; top: 0;
  background: var(--panel-2); font-weight: 600; font-size: 12px;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--accent); }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--accent-soft); }
.tbl .num { text-align: right; }
.tname a { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }

/* ---------- detail ---------- */
.detail-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.detail-bar .spacer { flex: 1; }
.fav-btn.on { color: var(--gold); border-color: var(--gold); }
.fav-btn.on .i { fill: currentColor; }
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.detail-head h2 { margin: 0 0 2px; font: 700 26px/1.1 var(--serif); color: var(--rc, var(--text)); }
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
/* Характеристики группами в рамке цвета редкости — как подсказка предмета в игре. */
.props { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); margin-bottom: 16px; }
.detail-head[data-rar] ~ .props { border-color: color-mix(in srgb, var(--rc) 55%, var(--line)); }
.pgrp { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pgrp:last-child { border-bottom: 0; }
.pgrp h4 { margin: 0 0 6px; font: 500 13px var(--sans); color: var(--muted); }
.props .kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; margin: 0; font-size: 15px; }
.props .kv dt { color: var(--muted); }
.props .kv dd { margin: 0; text-align: right; }
.props .kv dd.plus { color: var(--good); }
.props .kv dd.req { color: var(--warn); }
.res-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.res-tiles div { background: var(--panel); border-radius: 5px; padding: 6px 4px; text-align: center; font-size: 13px; color: var(--muted); }
.res-tiles b { display: block; font-size: 18px; font-weight: 500; color: var(--text); }
.desc {
  padding: 12px; margin-bottom: 14px;
  background: var(--panel-2); border-radius: 8px;
  white-space: normal;
}
.name-en { color: var(--muted); font-size: 12px; margin: -2px 0 4px; }
.model {
  margin: 0 0 14px; padding: 10px;
  background: radial-gradient(circle at 50% 40%, var(--panel-2), var(--bg));
  border: 1px solid var(--line); border-radius: 10px;
  text-align: center;
}
.model img { max-width: 100%; max-height: 300px; }
.block { margin: 14px 0; }
.block > h3 { font: 700 18px/1.2 var(--serif); margin: 0 0 6px; color: var(--text); }
.block-html {
  padding: 10px 12px;
  background: var(--panel-2); border-radius: 8px; border: 1px solid var(--line);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.block-html img { max-height: 48px; max-width: 64px; vertical-align: middle; margin: 2px; border-radius: 6px; }
.block-html hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.block-html dl { margin: 4px 0; }
.block-html dd { margin-left: 14px; }
.block-html .cnt { font-size: 11px; font-weight: 700; color: var(--accent); margin-left: -6px; }
.block-html div { display: inline-block; }
.ref { cursor: pointer; }
img.ref:hover { outline: 2px solid var(--accent); }
.img-missing {
  display: inline-block; padding: 1px 6px; margin: 2px;
  border: 1px solid var(--line); border-radius: 4px; font-size: 12px;
}
.img-missing.ref, span.ref { color: var(--accent); }
.detail-list h3 { font-size: 14px; margin: 16px 0 6px; }
.detail-list ul { margin: 0; padding-left: 18px; }
.src-link { display: inline-block; margin-top: 12px; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .detail {
    position: fixed; top: var(--topbar); right: 0; bottom: 0;
    width: min(var(--detail), 100%); z-index: 25;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .2);
  }
  .backdrop:not([hidden]) {
    display: block; position: fixed; inset: var(--topbar) 0 0 0;
    background: rgba(0, 0, 0, .35); z-index: 20;
  }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .logo-text { display: none; }
  .sidebar {
    position: fixed; top: var(--topbar); left: 0; bottom: 0; z-index: 26;
    transform: translateX(-100%); transition: transform .18s;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, .2); }
  .main { padding: 16px 16px 60px; }
  .list-head { flex-wrap: wrap; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .local-search { flex-basis: 100%; }
  .card { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .card-key { display: none; }
  .ico { width: 44px; height: 44px; }
  .cat-chips { display: flex; }
  .page-title { font-size: 28px; }
  .home-hero .page-title { font-size: 34px; }
  .home-grid { grid-template-columns: 1fr; }
  .toolbar .flt-toggle { display: inline-flex; }
  .main .filters.collapsed { display: none; }
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .cat-chips .chip { flex: none; }
  .zoom { margin-left: 0; }
}

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px;
}
.filters select { width: auto; height: 32px; font-size: 13px; }
.flt-toggle { display: none; }
.flt-toggle.on { border-color: var(--accent); color: var(--accent); }
.flt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.flt input[type="number"] {
  width: 64px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
.flt input:focus { outline: none; border-color: var(--accent); }
.flt.chk { cursor: pointer; }
.link-btn {
  border: 0; background: none; color: var(--accent);
  font: inherit; font-size: 13px; cursor: pointer; padding: 4px 6px;
}
.link-btn:hover { text-decoration: underline; }
.diff-seg button { width: auto; padding: 0 10px; font-size: 12px; height: 30px; }
.detail .diff-seg { display: flex; margin: 0 0 12px; }
.detail .diff-seg button { flex: 1; }

/* ---------- marks ---------- */
.card.have .card-meta::before { content: "✓ есть, "; color: var(--good); }
.tbl tr.have td:first-child { box-shadow: inset 3px 0 0 #3a9a5b; }
.mark-btn.on { color: #fff; background: #3a9a5b; border-color: #3a9a5b; }
.cmp-btn.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.note textarea {
  width: 100%; resize: vertical;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
.note textarea:focus { outline: none; border-color: var(--accent); }

/* ---------- backrefs ---------- */
.block h3 i { font-style: normal; color: var(--muted); font-weight: normal; }
.brefs { display: flex; flex-wrap: wrap; gap: 6px; }
.bref {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 3px; max-width: 100%;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: 13px;
}
.bref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bref:hover { border-color: var(--accent); text-decoration: none; }
.bref.hl { border-color: var(--accent); background: var(--accent-soft); }
.map-link { color: var(--accent); cursor: pointer; border-bottom: 1px dashed currentColor; }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; z-index: 100; pointer-events: none;
  max-width: 300px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
  font-size: 12px;
}
.tip-head { display: flex; gap: 8px; align-items: center; }
.tip-head b { display: block; font-size: 13px; }
.tip-head small { color: var(--muted); }
.tip table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.tip th { text-align: left; color: var(--muted); font-weight: normal; padding: 1px 8px 1px 0; }
.tip td { text-align: right; padding: 1px 0; }

/* ---------- compare ---------- */
.tbl.cmp th, .tbl.cmp td { white-space: normal; vertical-align: top; }
.tbl.cmp tbody th { color: var(--muted); font-weight: normal; background: var(--panel); position: static; width: 180px; }
.tbl.cmp tbody tr { cursor: default; }
.tbl.cmp tbody tr:hover { background: none; }
.tbl.cmp tr.differ td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tbl.cmp td.best { color: #3a9a5b; font-weight: 700; }
.cmp-head { display: flex; align-items: center; gap: 6px; }
.cmp-head a { display: flex; align-items: center; gap: 6px; color: var(--text); }
.cmp-head .x { border: 0; background: none; color: var(--muted); cursor: pointer; margin-left: auto; padding: 2px; display: inline-grid; }
.cmp-head .x:hover { color: var(--accent); }
.tbl.cmp small { color: var(--muted); font-weight: normal; }

/* ---------- maps ---------- */
.map-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.map-card {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text);
}
.map-card:hover { border-color: var(--accent); text-decoration: none; }
.map-thumb {
  height: 110px; background: var(--panel-2)
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(127, 127, 127, .06) 10px 20px);
}
.map-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-card-body { padding: 8px 10px; }
.map-card-body b { display: block; font: 700 17px/1.2 var(--serif); }
.map-card-body small { color: var(--muted); }
.zoom { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--muted); }
.map-wrap {
  overflow: auto; max-height: 75vh;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2);
}
.map-canvas { position: relative; min-width: 100%; }
.map-img { display: block; width: 100%; }
.map-canvas.noimg { aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(45deg, transparent 0 14px, rgba(127, 127, 127, .08) 14px 28px); }
.marker {
  position: absolute; transform: translate(-50%, -50%);
  display: grid; place-items: center; text-decoration: none;
}
.marker:hover { text-decoration: none; z-index: 3; }
.marker.point .ico {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.marker.point:hover .ico { border-color: var(--accent); transform: scale(1.15); }
.marker.hl { z-index: 4; }
.marker.hl .ico { border-color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 171, 82, .9); }
  50% { box-shadow: 0 0 0 10px rgba(217, 171, 82, 0); }
}
.marker.portal span {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #1aa0d8; color: #fff; font-size: 12px;
  border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.marker.portal em {
  position: absolute; top: 24px; white-space: nowrap;
  font-style: normal; font-size: 11px; color: #fff;
  background: rgba(0, 0, 0, .7); padding: 1px 5px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity .1s;
}
.marker.portal:hover em { opacity: 1; }
.small { font-size: 12px; }
.tip-desc { margin: 6px 0 0; color: var(--muted); line-height: 1.4; }

/* ---------- таблицы из статей ---------- */
table.wb { width: 100%; border-collapse: collapse; }
table.wb td, table.wb th { padding: 4px 6px; text-align: center; vertical-align: top; border-bottom: 1px solid var(--line); }
table.wb tr:last-child td { border-bottom: 0; }
table.wb p { margin: 2px 0; }
table.wb ul { text-align: left; margin: 4px 0; padding-left: 18px; }
.block-html table.wb img { max-height: 40px; }
.tscroll { overflow-x: auto; max-width: 100%; }
table.wb.skill th { white-space: nowrap; font-size: 12px; font-weight: 600; }
table.wb.skill td { white-space: nowrap; }
.block-html h2, .block-html h3 { font-size: 15px; margin: 14px 0 6px; color: var(--accent); text-transform: none; letter-spacing: 0; }
.block-html table { max-width: 100%; }
.block-html table td, .block-html table th { padding: 3px 6px; }
.props td.block-html { padding: 6px 8px; background: none; }

/* полоски здоровья / маны / выносливости */
.bars { display: flex; flex-direction: column; gap: 5px; margin: 0 0 14px; }
.bar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 12px; border-radius: 4px; color: #f4efe4; font-size: 14px;
}
.bar b { margin-left: auto; font-weight: 500; }
.bar small { opacity: .8; font-size: 12px; }
.bar.hp { background: #8e2a22; }
.bar.mana { background: #24508a; }
.bar.stam { background: #33683a; }

/* широкая панель карточки */
body.detail-wide .detail { width: min(860px, 58vw); }
@media (max-width: 1100px) { body.detail-wide .detail { width: 100%; } }
body.detail-wide .main .toolbar { flex-wrap: wrap; }
body.detail-wide .main .local-search { flex-basis: 100%; }

/* ---------- дисклеймер ---------- */
.side-note {
  margin: 18px 10px 6px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px; line-height: 1.5; color: var(--muted);
}
.side-note a { display: block; margin-top: 4px; }
.notice {
  margin-top: 14px; padding: 10px 14px; font-size: 13px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px;
  background: var(--panel);
}
.about { max-width: 760px; line-height: 1.6; }
.about h3 { margin: 24px 0 6px; font: 700 20px/1.2 var(--serif); color: var(--text); }
.about p { margin: 0 0 8px; }

/* ---------- типы атак мобов ---------- */
.atk { display: inline-flex; gap: 4px; vertical-align: middle; }
.atk i {
  display: inline-block; width: 22px; height: 22px; border-radius: 6px;
  background: var(--atk-c) center / 15px 15px no-repeat;
  -webkit-mask: none; position: relative;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--atk-c) 60%, transparent);
}
.atk i::before {
  content: ""; position: absolute; inset: 3px; background: #fff;
  -webkit-mask: var(--atk-i) center / contain no-repeat; mask: var(--atk-i) center / contain no-repeat;
}
.atk i.off { background: transparent; box-shadow: inset 0 0 0 1px var(--line); opacity: .45; }
.atk i.off::before { background: var(--muted); }
.atk-sm i { width: 18px; height: 18px; border-radius: 5px; }
.atk-sm i::before { inset: 3px; }
.atk-b { --atk-c: #c0503a; --atk-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 2 13 9.5l1.5 1.5L22 3.5V2zM4.4 14.2l1.4-1.4 5.4 5.4-1.4 1.4-1.4-1.4-2.5 2.5.7.7-1.4 1.4-3.5-3.5 1.4-1.4.7.7 2.5-2.5zM12 9.9l2.1 2.1-5.4 5.4-2.1-2.1z'/%3E%3C/svg%3E"); }
.atk-d { --atk-c: #3d8a4f; --atk-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 21 15.6 8.4l-2-.6L16 3l1 3 3 1-4.8 2.4-.6-2L4.4 22.4z'/%3E%3Cpath d='M5 3c7 0 16 9 16 16h-2C19 13 11 5 5 5z'/%3E%3C/svg%3E"); }
.atk-m { --atk-c: #7a4fb8; --atk-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5C6.5 5 2.7 9.3 1.5 12c1.2 2.7 5 7 10.5 7s9.3-4.3 10.5-7C21.3 9.3 17.5 5 12 5zm0 11.5a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9zm0-2.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E"); }
.atk-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.card-meta .atk { margin-left: auto; }
.block-html .atk { margin: 2px 0; }

/* ---------- статьи ---------- */
.block-html h3 { font: 700 21px/1.2 var(--serif); margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--text); }
.block-html h4 { font-size: 15px; margin: 16px 0 6px; color: var(--muted); }
.block-html h3:first-child, .block-html h4:first-child { margin-top: 0; }
.block-html p { margin: 0 0 10px; }
.block-html p.lead { font-style: italic; color: var(--text); border-left: 3px solid var(--accent); padding-left: 10px; }
.block-html .kv { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0; font-size: 13px; }
.block-html .kv > div { padding: 3px 0; }
.block-html .tscroll { margin: 8px 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table.art { border-collapse: collapse; width: 100%; font-size: 13px; }
table.art td, table.art th { padding: 6px 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  vertical-align: middle; text-align: left; min-width: 6em; }
table.art td:has(ul) { min-width: 11em; }
table.art td:last-child, table.art th:last-child { border-right: 0; }
table.art tr:last-child td { border-bottom: 0; }
table.art tr:first-child td, table.art tr:first-child th, table.art th {
  background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
table.art tr:nth-child(even) td { background: color-mix(in srgb, var(--text) 3%, transparent); }
table.art ul { margin: 0; padding-left: 16px; }
table.art p { margin: 0; }
table.art img { max-height: 48px; vertical-align: middle; }
.block-html img.big { max-width: 100%; max-height: 360px; height: auto; display: block; margin: 8px auto; cursor: zoom-in; }
.block-html .tscroll { display: block; }
.block-html .img-missing { display: inline-block; font-size: 12px; padding: 1px 6px; margin: 1px; border-radius: 4px;
  border: 1px solid var(--line); color: var(--muted); }
.block-html .img-missing.ref { color: var(--accent); cursor: pointer; }
/* палитра для цветного текста статей */
.c-red { color: #c62f2f; } .c-orange { color: #c46a12; } .c-yellow { color: #a07a00; }
.c-green { color: #2f8a3c; } .c-cyan { color: #0f8a92; } .c-blue { color: #2d62c4; } .c-purple { color: #8a45b8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-red { color: #ff7a6b; } :root:not([data-theme="light"]) .c-orange { color: #ffae5c; }
  :root:not([data-theme="light"]) .c-yellow { color: #f2d45c; } :root:not([data-theme="light"]) .c-green { color: #6fd47f; }
  :root:not([data-theme="light"]) .c-cyan { color: #5fdde5; } :root:not([data-theme="light"]) .c-blue { color: #7fa8ff; }
  :root:not([data-theme="light"]) .c-purple { color: #c99bff; }
}
:root[data-theme="dark"] .c-red { color: #ff7a6b; } :root[data-theme="dark"] .c-orange { color: #ffae5c; }
:root[data-theme="dark"] .c-yellow { color: #f2d45c; } :root[data-theme="dark"] .c-green { color: #6fd47f; }
:root[data-theme="dark"] .c-cyan { color: #5fdde5; } :root[data-theme="dark"] .c-blue { color: #7fa8ff; }
:root[data-theme="dark"] .c-purple { color: #c99bff; }
.block-html td > div, .block-html th > div { display: block; }
table.art td, table.art th { overflow-wrap: normal; }
.side-note .side-contact { margin-top: 8px; }
.side-note .side-contact a { display: inline; margin: 0; }

/* ---------- статические страницы (e/*.html) ---------- */
body.static { background: var(--bg); }
.static .topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.static-nav { margin-left: auto; font-size: 14px; }
.static-page { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.static-page h1 { font: 700 34px/1.1 var(--serif); margin: 0 0 4px; }
.static-page .block > h2 { font: 700 18px/1.2 var(--serif); margin: 0 0 6px; color: var(--text); }
.static-page .detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.static-open { display: inline-block; padding: 6px 12px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent); font-weight: 600; text-decoration: none; }
.static-page table.props { margin: 12px 0; width: 100%; max-width: 560px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.static-page table.props th { text-align: left; font-weight: 400; color: var(--muted); padding: 5px 14px; }
.static-page table.props td { text-align: right; padding: 5px 14px; }
.static-page table.props tr + tr th, .static-page table.props tr + tr td { border-top: 1px solid var(--line); }
.static-list { columns: 3 220px; padding-left: 18px; margin: 6px 0 14px; }
.static-list li { break-inside: avoid; margin: 2px 0; }
.static-toc { margin: 10px 0 18px; }
.static-page h2 small { color: var(--muted); font-weight: normal; font-size: 14px; }
.static-foot { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.static-page .block-html a img { cursor: pointer; }
.static-page .ref-link { display: inline-flex; flex-direction: column; align-items: center; max-width: 110px;
  margin: 2px 4px; vertical-align: top; text-align: center; text-decoration: none; }
.static-page .ref-name { font-size: 11px; line-height: 1.25; }
.static-page .ref-link .img-missing { display: none; }
.block-html ul.plain-list { list-style: none; margin: 0; padding: 0; }
.block-html ul.plain-list li { padding: 2px 0; }
.block-html ul.plain-list small { color: var(--muted); }
.help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  font-size: 10px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); cursor: help; vertical-align: 1px; }
.help[data-help] { cursor: pointer; }
.help:hover { color: var(--accent); border-color: var(--accent); }
.block-html img.skill-ico { width: 28px; height: 28px; max-height: 28px; margin: 0 6px 0 0; border-radius: 6px; }
.block-html ul.plain-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.tip-desc b { color: var(--accent); font-weight: 600; }

/* ---------- переодевалка ---------- */
.builder { margin-top: 26px; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.3fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1350px) { .builder { grid-template-columns: 1fr 1fr; } .builder .b-doll { grid-column: 1 / -1; order: -1; } }
@media (max-width: 760px) { .builder { grid-template-columns: 1fr; } }
.b-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.b-panel h3 { font: 700 18px/1.2 var(--serif); color: var(--text); margin: 16px 0 6px; }
.b-panel h3:first-child { margin-top: 0; }
.b-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.b-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.b-row select, .b-row input { min-width: 120px; }
.b-stats, .b-res { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.b-stats th, .b-res th { text-align: left; font-weight: 500; padding: 4px 4px; white-space: nowrap; }
.b-stats thead th, .b-res thead th { font-size: 13px; color: var(--muted); font-weight: 500; }
.b-stats td, .b-res td { padding: 3px 4px; }
.b-stats .sum, .b-res .sum { font-weight: 700; color: var(--gold); text-align: right; }
.b-stats .plus { font-size: 11px; color: var(--muted); }
.b-res .pct { text-align: right; font-weight: 600; white-space: nowrap; }
.b-in { width: 72px; padding: 3px 6px; }
.st-ico { display: inline-block; width: 20px; }
.res-bar { height: 6px; background: var(--panel-2); border-radius: 3px; min-width: 50px; overflow: hidden; }
.res-bar i { display: block; height: 100%; background: var(--gold); }
.doll { position: relative; width: 100%; max-width: 460px; aspect-ratio: 1; margin: 0 auto; }
.doll::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; border: 2px solid var(--line); }
.doll-slot { position: absolute; transform: translate(-50%, -50%); width: 17%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--line); background: var(--panel); cursor: pointer; display: grid; place-items: center; padding: 0;
  box-shadow: var(--shadow); }
.doll-slot span { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.1; padding: 2px; }
.doll-slot img { width: 78%; height: 78%; object-fit: contain; }
.doll-slot.filled { border-color: var(--gold); }
.doll-slot.bad { border-color: #c62f2f; box-shadow: 0 0 0 3px rgba(198, 47, 47, .25); }
.doll-slot.blocked { opacity: .4; }
.doll-slot:hover { border-color: var(--accent); }
.doll-x { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  color: #fff; font-style: normal; font-size: 14px; line-height: 20px; text-align: center; display: none; }
.doll-slot:hover .doll-x { display: block; }
.doll-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46%; aspect-ratio: 1;
  border-radius: 50%; background: var(--panel-2); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; }
.doll-center b { font-size: 17px; }
.doll-center span { font-size: 13px; color: var(--muted); }
.doll-center .doll-power { color: var(--accent); font-weight: 700; font-size: 15px; }
.b-actions { display: flex; gap: 8px; justify-content: center; margin: 12px 0 4px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: 15px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.b-warn { background: color-mix(in srgb, #c62f2f 10%, transparent); border: 1px solid color-mix(in srgb, #c62f2f 40%, transparent);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.b-warn ul { margin: 4px 0 0; padding-left: 18px; }
.b-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.b-list li { padding: 3px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; }
.b-list li b { color: var(--gold); white-space: nowrap; }
.picker { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.picker[hidden] { display: none; }
.pk-card { background: var(--panel); border-radius: var(--radius); width: min(640px, 100%); max-height: 85vh; display: flex;
  flex-direction: column; box-shadow: var(--shadow); padding: 12px; gap: 10px; }
.pk-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pk-head input[type=search] { flex: 1; min-width: 160px; }
.pk-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.pk-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); cursor: pointer; color: var(--text); font: inherit; }
.pk-item:hover { border-color: var(--accent); }
.pk-main { display: flex; flex-direction: column; min-width: 0; }
.pk-main small { color: var(--muted); font-size: 12px; }
.pk-stats { color: var(--text) !important; }
.b-skills { margin-top: 18px; }
.sk-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.sk-head .btn { margin-left: auto; }
.sp { display: inline-flex; align-items: center; gap: 3px; margin: 0 6px 0 2px; font-weight: 700; font-size: 15px;
  color: var(--text); vertical-align: middle; }
.sp b { color: var(--sp-c); }
.sp-ico { width: 20px; height: 19px; }
.sp.t1 { --sp-c: #d4a514; } .sp.t2 { --sp-c: #ee7a1e; } .sp.t3 { --sp-c: #e0342c; }
.sk-main small .sp { font-size: 13px; } .sk-main small .sp-ico { width: 17px; height: 16px; }
.sk-lv.t1 { color: #b8960b; border-color: #e0c040; }
.sk-lv.t2 { color: #d0661a; border-color: #f08a3c; }
.sk-lv.t3 { color: #c62f2f; border-color: #e05050; }
.sk-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 900px) { .sk-cols { grid-template-columns: 1fr; } }
.sk-cols h4 { margin: 4px 0 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.sk-row { display: grid; grid-template-columns: 36px 1fr auto auto auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.sk-ico { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.sk-main { display: flex; flex-direction: column; min-width: 0; }
.sk-main small { color: var(--muted); font-size: 12px; }
.sk-main em { color: #c62f2f; font-style: normal; }
.sk-btn { width: 30px; height: 30px; padding: 0; font-weight: 700; }
.sk-btn:disabled { opacity: .35; cursor: default; }
.sk-lv { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 700; border: 2px solid var(--line); }
.sk-lv.t0 { color: var(--muted); }

.b-doll { padding-top: 6px; }
.b-base { white-space: nowrap; }
.b-base .b-in { width: 64px; text-align: center; margin: 0 3px; }
.st-btn { width: 22px; height: 22px; padding: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer; font-weight: 700; line-height: 1; }
.st-btn:hover { border-color: var(--accent); color: var(--accent); }
.b-free { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--line); }
.b-free b { color: var(--gold); font-size: 15px; }
.b-free.bad b { color: #c62f2f; }
.btn-sm { padding: 3px 8px; font-size: 12px; margin-left: auto; }
.nowrap { white-space: nowrap; }
.b-base .b-in { width: 54px; }
.b-stats .plus { white-space: nowrap; padding-left: 0; }
.b-stats th, .b-stats td { padding-left: 2px; padding-right: 2px; }

/* ---------- калькулятор крафта ---------- */
.cf { font-size: 15px; }
.cf-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 8px; }
.cf-head input { width: 80px; height: 32px; margin-left: 6px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; }
.cf-sum { color: var(--muted); }
.cf-sum b { color: var(--gold); font-weight: 500; }
.cf h4 { margin: 12px 0 6px; font: 500 13px var(--sans); color: var(--muted); }
.cf ul { list-style: none; margin: 0; padding: 0; }
.cf-raw li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.cf-raw b { font-weight: 500; color: var(--gold); }
.cf-tree ul { margin-left: 14px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.cf-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 3px 0; }
.cf-n { min-width: 46px; text-align: right; font-weight: 500; color: var(--gold); }
.cf-ok { color: var(--good); }
.cf-have { margin-left: auto; color: var(--muted); font-size: 13px; }
.cf-have input { width: 64px; height: 26px; margin-left: 4px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.ref-name { display: inline-flex; align-items: center; gap: 6px; color: var(--rc, var(--text)); }
.ref-name .ico-sm { width: 26px; height: 26px; }

/* ---------- спорные значения ---------- */
.disp { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; font-weight: 700;
  color: var(--bg); background: var(--warn); vertical-align: 1px; cursor: help; }
.disputes { margin: -6px 0 16px; padding: 10px 14px; border: 1px dashed color-mix(in srgb, var(--warn) 60%, var(--line)); border-radius: 8px; font-size: 14px; }
.disputes h4 { margin: 0 0 6px; font: 500 13px var(--sans); color: var(--warn); }
.disputes ul { margin: 0; padding-left: 18px; }
.disputes li { margin: 3px 0; }
.disputes p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.block-html ol.steps { margin: 0; padding-left: 22px; }
.block-html ol.steps li { margin: 4px 0; }

/* ---------- переодевалка 2.0 ---------- */
.b-saved { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; }
.b-saved select { width: auto; max-width: 220px; height: 34px; }
.b-extra { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.b-x { display: grid; grid-template-columns: minmax(0, 1fr) 76px 30px; gap: 6px; }
.b-x input { height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; min-width: 0; }
.b-x .icon-btn { width: 30px; height: 30px; }
.b-extra .btn-sm { align-self: flex-start; margin-left: 0; }
.b-cmp { margin-top: 18px; }
.b-cmp td.up { color: var(--good); }
.b-cmp td.down { color: var(--warn); }

/* ---------- оглавление статьи ---------- */
.toc { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.toc h4 { margin: 0 0 6px; font: 500 13px var(--sans); color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; columns: 2 220px; }
.toc button { border: 0; background: none; padding: 1px 0; color: var(--accent); font: 15px var(--sans); text-align: left; cursor: pointer; }
.toc button:hover { text-decoration: underline; }
.block-html h3 { scroll-margin-top: 12px; }

/* ---------- инструменты карты ---------- */
.map-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.map-tools .local-search { width: 220px; flex: none; height: 32px; margin-left: auto; }
.marker.point.dim { opacity: .25; }
.marker.point.found .ico { border-color: var(--accent); transform: scale(1.25); z-index: 5; }
