/* ─────────────────────────────────────────────────────────────────────────
   Компоненты нового дизайна (?ui=v2). Только var(--…) из theme_v2.css —
   никаких цветов здесь. Общие для главной, страниц карт и /styleguide.
   Разделы: база · шапка · общие компоненты · главная страница.
   ───────────────────────────────────────────────────────────────────────── */

/* ── База ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font-body);
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding: 0 0 2rem;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font-family: inherit; }

.wrap { max-width: 980px; margin: -44px auto 0; padding: 0 16px; position: relative; }
h1 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.1; }
.sub { font-size: 14px; color: var(--muted); margin-bottom: 1.25rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Шапка-полоса ─────────────────────────────────────────────────────── */
.hero { background: var(--hero); border-bottom: 6px solid var(--hero-stripe); padding: 22px 16px 66px; }
.hero-inner { max-width: 980px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 46px; height: 46px; flex-shrink: 0; }
.brand-logo path, .brand-logo rect { fill: var(--gold); stroke: var(--gold-ink); stroke-width: 1.2; stroke-linejoin: round; }
.brand-title { color: var(--hero-text); font-size: 34px; text-shadow: 0 3px 0 var(--shadow); }
.brand-title span { color: var(--gold); }
.brand-sub { margin-top: 6px; font-weight: 800; font-size: 14px; color: var(--hero-sub); }
.hero-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-btn {
  font-weight: 800; font-size: 13px; color: var(--hero-text); background: transparent;
  border: 2px solid var(--hero-btn-border); border-radius: 999px; padding: 8px 14px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
}
.hero-btn:hover { background: var(--hero-btn-hover); color: var(--hero-text); }
.hero-btn-gold { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); box-shadow: 0 3px 0 var(--gold-shadow); }
.hero-btn-gold:hover { background: var(--gold); color: var(--gold-ink); filter: brightness(1.05); }
.theme-toggle { width: 42px; height: 42px; padding: 0; justify-content: center; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.hero #authArea .auth-btn {
  font-size: 13px; font-weight: 900; min-height: 40px; border-radius: 999px; padding: 8px 16px;
  color: var(--gold-ink); background: var(--gold); border: 2px solid var(--gold); box-shadow: 0 3px 0 var(--gold-shadow);
}
.hero #authArea .auth-btn:hover { filter: brightness(1.05); }

/* ── Общие компоненты ─────────────────────────────────────────────────── */
/* Контейнер «мультяшный»: толстый контур + нажимная тень. Внутри — облегчённо. */
.panel {
  background: var(--panel); border: var(--border-w) solid var(--outline);
  border-radius: var(--radius-lg); box-shadow: var(--press); overflow: hidden; margin-bottom: 1.5rem;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--panel-head); border-bottom: var(--border-w) solid var(--outline); padding: 12px 18px;
}
.panel-title { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--heading); }
.panel-body { padding: 16px 18px; }

/* Мягкая карточка внутри панели или списка: без контура и тени */
.soft { background: var(--panel); border: 2px solid var(--sep); border-radius: var(--radius-md); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-display); font-weight: 400; font-size: 17px; letter-spacing: 0.3px;
  border: 0; border-radius: 12px; padding: 10px 22px; min-height: 44px; cursor: pointer; text-decoration: none;
  transition: transform .06s, box-shadow .06s, filter .12s;
}
.btn:active:not(:disabled) { transform: translateY(3px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 0 var(--primary-shadow); }
.btn-primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--primary-shadow); }
.btn-gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 4px 0 var(--gold-shadow); }
.btn-gold:active:not(:disabled) { box-shadow: 0 1px 0 var(--gold-shadow); }
.btn-primary:hover:not(:disabled), .btn-gold:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost {
  font-family: var(--font-body); font-weight: 800; font-size: 14px;
  background: transparent; color: var(--text); border: 2px solid var(--line); box-shadow: none;
}
.btn-ghost:hover { background: var(--hover); }
.btn-danger { font-family: var(--font-body); font-weight: 800; font-size: 14px; background: var(--bad-bg); color: var(--bad-text); border: 2px solid var(--bad-text); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* Переключатель из нескольких кнопок (.toggle > button[.active]) */
.toggle { display: inline-flex; gap: 4px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 12px; padding: 3px; }
.toggle > button {
  font-family: var(--font-body); font-weight: 800; font-size: 13px; color: var(--muted);
  background: transparent; border: 0; border-radius: 9px; padding: 6px 14px; min-height: 34px; cursor: pointer;
}
.toggle > button:hover { color: var(--text); }
.toggle > button.active { background: var(--primary); color: var(--on-primary); }

/* Поля ввода */
.input {
  width: 100%; font-weight: 700; font-size: 15px; color: var(--text); background: var(--input-bg);
  border: 2px solid var(--input-border); border-radius: 12px; padding: 10px 14px; outline: none;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--muted); opacity: .8; }

/* Плашки */
.chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; font-size: 12px; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip-gold { background: var(--gold); color: var(--gold-ink); }
.chip-elixir { background: var(--elixir); color: var(--on-status); }
.chip-primary { background: var(--primary); color: var(--on-primary); }
.chip-soft { background: var(--surface-2); color: var(--muted); }
.chip-good { background: var(--good-bg); color: var(--good-text); }
.chip-bad { background: var(--bad-bg); color: var(--bad-text); }
.chip-warn { background: var(--warn-bg); color: var(--warn-text); }
.chip-info { background: var(--info-bg); color: var(--info-text); }

/* Информационные блоки */
.note-box { font-size: 13px; color: var(--muted); background: var(--surface-2); border: 2px solid var(--sep); border-radius: 12px; padding: 8px 12px; line-height: 1.5; }
.text-good { color: var(--good-text); }
.text-bad { color: var(--bad-text); }
.text-warn { color: var(--warn-text); }

/* Модальные окна: .modal (затемнение) > .modal-panel */
.modal { position: fixed; inset: 0; z-index: 600; background: var(--overlay); align-items: center; justify-content: center; }
.modal-panel {
  background: var(--panel); color: var(--text); border: var(--border-w) solid var(--outline);
  border-radius: var(--radius-lg); box-shadow: var(--press); padding: 24px; width: 100%; max-width: 420px; margin: 16px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-title { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--heading); }
.modal-close { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.modal-close:hover { background: var(--hover); color: var(--text); }

/* Модальные окна — варианты и содержимое */
.modal-top { align-items: flex-start; overflow-y: auto; }
.modal-top .modal-panel { margin: 40px 16px; }
.modal-panel-wide { max-width: 520px; background: var(--surface-2); }
.modal-scroll { max-width: 480px; max-height: 80vh; overflow-y: auto; }
.modal-text { font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 14px; }
.modal-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.modal-links { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; }
.divider { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--sep); }
.stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.form-error { color: var(--bad-text); font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.form-success { color: var(--good-text); font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.auth-btn-block { width: 100%; justify-content: center; padding: 10px; font-size: 14px; margin-bottom: 14px; }
select.input { appearance: auto; }
textarea.input { resize: vertical; }

/* Всплывашка «What's new» */
.popup {
  position: fixed; bottom: 20px; right: 20px; z-index: 999; max-width: 320px; padding: 16px;
  background: var(--panel); color: var(--text); border: var(--border-w) solid var(--outline); border-radius: var(--radius-lg); box-shadow: var(--press);
}
.popup-title { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--heading); }

/* Записи changelog (окно и всплывашка) */
.cl-entry { margin-bottom: 18px; }
.cl-version { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.cl-title { font-size: 15px; font-weight: 900; color: var(--text); margin-bottom: 6px; }
.cl-items { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text); line-height: 1.7; }
.cl-sep { border: none; border-top: 1px solid var(--sep); margin: 12px 0; }

/* Ссылки */
.link-muted { color: var(--muted); }
.link-strong { color: var(--text); font-weight: 800; }

/* Тексты и строки раскладки */
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 16px; }
.hint-xs { font-size: 11px; color: var(--muted); }
.section-desc { font-size: 13px; color: var(--muted); margin: -6px 0 12px; line-height: 1.6; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.section-title-meta { font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--muted); }
.badge-row { margin-bottom: 12px; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tab-btn-sm { padding: 4px 12px; font-size: 12px; }
.input-sm { width: 180px; padding: 7px 12px; font-size: 13px; }
.input-row-plain { background: transparent; border: 0; box-shadow: none; padding: 0; margin-bottom: 8px; }
.toggle-full { display: flex; width: 100%; margin-top: 16px; }
.toggle-full > button { flex: 1; }

/* Поиск с выпадающим списком */
.search-wrap { position: relative; margin-bottom: 10px; }
.dropdown {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: 100%; max-height: 220px; overflow-y: auto;
  background: var(--panel); border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--press-sm);
}

/* Легенды */
.chart-legend { margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: middle; border: 1px solid transparent; }
.swatch-wc   { background: var(--gold); }
.swatch-deck { background: var(--primary); }
.swatch-syn1 { background: var(--panel); border-color: var(--muted); }
.swatch-syn2 { background: var(--panel); border-color: var(--line); }

/* Пункты выпадающего списка */
.dd-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; font-size: 14px; }
.dd-item:hover { background: var(--hover); }
.dd-item img { width: 28px; border-radius: 3px; flex-shrink: 0; }
.dd-item .chip { margin-left: auto; }

/* Окно настроек аккаунта */
.set-card { background: var(--panel); border: 2px solid var(--sep); border-radius: var(--radius-md); padding: 16px; margin-bottom: 14px; }
.set-card-danger { border-color: var(--bad-text); }
.set-title { font-size: 15px; font-weight: 900; margin-bottom: 10px; }
.set-title-danger { color: var(--bad-text); }
.set-desc { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.set-profile { display: flex; align-items: center; gap: 12px; }
.set-profile img { width: 44px; height: 44px; border-radius: 50%; }
.set-name { font-size: 16px; font-weight: 900; }
.set-tag-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--sep); flex-wrap: wrap; font-size: 14px; }
.set-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.set-msg { font-size: 13px; font-weight: 800; margin-left: 8px; }
.set-footer { font-size: 12px; text-align: center; }

/* Трекер замен — строка «убрал → добавил» */
.trk-row { display: flex; align-items: center; gap: 10px; }
.trk-card { text-align: center; flex-shrink: 0; }
.trk-card img { width: 40px; height: 45px; object-fit: contain; display: block; margin: 0 auto 2px; }
.trk-card-name { font-size: 10px; color: var(--muted); max-width: 50px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.trk-card.added .trk-card-name { color: var(--text); font-weight: 800; }
.trk-arrow { font-size: 18px; color: var(--muted); }
.trk-stats { margin-left: auto; text-align: right; }
.trk-wr { font-size: 14px; }
.trk-delta { font-weight: 900; }

/* Легенда графика винрейта */
.chart-legend-line { color: var(--chart-line); font-weight: 800; }
.chart-legend-item { margin-left: 10px; }
.chart-change { margin-bottom: 4px; }
.chart-change-mark { color: var(--chart-deck-line); }
.chart-changes { margin-top: 6px; }

/* Тексты полноэкранного лоадера */
.lo-title { font-family: var(--font-display); font-size: 18px; color: var(--heading); letter-spacing: 2px; text-transform: uppercase; }
.lo-fact { max-width: 320px; min-height: 40px; text-align: center; font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.5; transition: opacity .4s; }

/* ── Главная страница ─────────────────────────────────────────────────── */

/* Поле тега */
.input-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1rem;
  background: var(--panel); border: var(--border-w) solid var(--outline); border-radius: 18px; padding: 12px; box-shadow: var(--press);
}
.input-row input {
  flex: 1 1 200px; min-width: 0; font-weight: 800; font-size: 18px; color: var(--text); background: var(--input-bg);
  border: 2px solid var(--input-border); border-radius: 12px; padding: 11px 16px; outline: none;
}
.input-row input:focus { border-color: var(--primary); }
.input-row button {
  font-family: var(--font-display); font-size: 20px; color: var(--on-primary); background: var(--primary);
  border: 0; border-radius: 12px; padding: 10px 28px; min-height: 48px; box-shadow: 0 4px 0 var(--primary-shadow); cursor: pointer; white-space: nowrap;
}
.input-row button:hover { filter: brightness(1.06); }
.input-row button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-shadow); }
.input-row button:disabled { opacity: .55; cursor: not-allowed; }
.info-box { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin-bottom: 1.5rem; }
.error-box { font-size: 13px; font-weight: 800; color: var(--bad-text); background: var(--bad-bg); border: 2px solid var(--bad-text); border-radius: 12px; padding: 10px 14px; margin-bottom: 1rem; display: none; }

/* Вкладки */
#tabBar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px; margin-bottom: 22px;
  background: var(--panel); border: var(--border-w) solid var(--outline); border-radius: 18px; box-shadow: var(--press);
}
#tabBar .tab-btn {
  margin: 0; border-radius: 12px; padding: 10px 8px; min-height: 50px;
  font-family: var(--font-display); font-weight: 400; font-size: 18px; letter-spacing: 0.3px;
  background: transparent; color: var(--tab-idle); box-shadow: none; transition: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.15;
}
#tabBar .tab-btn:hover { background: var(--hover); }
#tabBar .tab-btn.active { background: var(--gold); color: var(--gold-ink); box-shadow: inset 0 -4px 0 var(--gold-shadow); }
#tabBar .tab-btn.tab-locked, #tabBar .tab-btn.tab-soon { opacity: 1; background: var(--tab-off-bg); color: var(--tab-off-text); cursor: not-allowed; }
#tabBar .tab-sub { display: none; font-family: var(--font-body); font-size: 11px; font-weight: 800; color: var(--tab-off-text); }
#tabBar .tab-locked .tab-sub, #tabBar .tab-soon .tab-sub { display: block; }
#tabStats, #tabImprove, #tabAI, #tabDeckBuilder { display: none; }
#tabLockedMsg { display: none; font-size: 13px; font-weight: 800; color: var(--warn-text); background: var(--warn-bg); border-radius: 10px; padding: 8px 14px; margin: -10px 0 16px; text-align: center; }

/* Маленькие кнопки-переключатели вне шапки (День/Месяц/Год, группировка в Deck Builder) */
.tab-btn {
  padding: 6px 14px; border: 2px solid var(--line); cursor: pointer; font-size: 13px; font-weight: 800;
  background: var(--surface-2); color: var(--muted); border-radius: 999px; margin-right: 6px; transition: background .15s, color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tab-btn.tab-locked { opacity: .45; cursor: not-allowed; }

/* Заголовки секций */
.section-title { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--heading); margin: 0 0 12px; letter-spacing: 0.2px; }

/* Метрики */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 1.75rem; }
.metric-archetype { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.metric {
  background: var(--panel); border: var(--border-w) solid var(--outline); border-radius: 18px; box-shadow: var(--press);
  overflow: hidden; padding: 0 0 12px;
}
.metric-label { background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; padding: 6px 14px; margin-bottom: 6px; }
.metric:nth-child(1) .metric-label { background: var(--gold); color: var(--gold-ink); }
.metric:nth-child(2) .metric-label { background: var(--win); color: var(--on-status); }
.metric:nth-child(3) .metric-label { background: var(--elixir); color: var(--on-status); }
.metric-val { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.1; padding: 0 14px; }
.metric-sub { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 14px; margin-top: 2px; }

/* Колода */
.deck { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin-bottom: 1.75rem; }
.card { position: relative; background: transparent; border: 0; border-radius: 12px; padding: 4px 2px 6px; text-align: center; }
.card-evolved { background: var(--surface-2); box-shadow: 0 0 0 2px var(--evo), 0 0 12px 3px var(--evo-glow); }
.card-champion { background: var(--surface-2); box-shadow: 0 0 0 2px var(--champion), 0 0 10px 2px var(--champion-glow); }
.card-img { width: 100%; max-width: 76px; height: auto; aspect-ratio: 5 / 6; object-fit: contain; display: block; margin: 0 auto 4px; }
.card-img-placeholder { width: 100%; max-width: 76px; aspect-ratio: 5 / 6; display: block; margin: 0 auto 4px; background: var(--surface-2); border-radius: 8px; }
.card-name { font-size: 12px; font-weight: 800; margin-bottom: 3px; line-height: 1.2; }
.card-elixir { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.2px; color: var(--on-status); background: var(--elixir); border-radius: 999px; padding: 1px 9px; }
.card-stats { font-size: 10px; color: var(--muted); }
.card.locked { box-shadow: 0 0 0 3px var(--gold) !important; }
.lock-btn { position: absolute; top: 2px; right: 2px; background: none; border: none; font-size: 12px; line-height: 1; padding: 2px; cursor: pointer; opacity: 0.35; transition: opacity .15s; z-index: 1; }
.lock-btn:hover, .lock-btn.locked { opacity: 1; }

/* Последние бои */
.battles {
  background: var(--panel); border: var(--border-w) solid var(--outline); border-radius: var(--radius-lg); box-shadow: var(--press);
  overflow: hidden; margin-bottom: 1.75rem; padding: 2px 16px;
}
.battle { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sep); font-size: 14px; }
.battle:last-child { border-bottom: none; }
.result { font-size: 12px; font-weight: 800; letter-spacing: 0.8px; padding: 4px 8px; border-radius: 8px; min-width: 54px; text-align: center; color: var(--on-status); }
.win  { background: var(--win); color: var(--on-status); }
.loss { background: var(--loss); color: var(--on-status); }
.draw { background: var(--draw); color: var(--on-status); }
.battle-info { flex: 1; }
.battle-opp { font-size: 12px; color: var(--muted); margin-top: 2px; }
.battle-crowns { font-size: 14px; font-weight: 900; color: var(--text); }
.battle-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.battle-opp-name { font-weight: 800; }
.opp-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.opp-card { display: flex; flex-direction: column; align-items: center; width: 44px; }
.opp-card img { width: 40px; height: 46px; object-fit: contain; }
.opp-card img.evo { border-radius: 6px; box-shadow: 0 0 0 2px var(--evo), 0 0 8px 2px var(--evo-glow); }
.opp-card-name { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.2; margin-top: 1px; max-width: 44px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Таблица тяжёлых матчапов */
.matchup-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 1.75rem; background: var(--panel);
  border: var(--border-w) solid var(--outline); border-radius: var(--radius-lg); box-shadow: var(--press); overflow: hidden;
}
.matchup-table th { font-size: 12px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 14px; background: var(--panel-head); border-bottom: var(--border-w) solid var(--outline); }
.matchup-table td { font-size: 14px; padding: 10px 14px; border-bottom: 1px solid var(--sep); }
.matchup-table tr:last-child td { border-bottom: none; }
.loss-bar { height: 8px; border-radius: 999px; background: var(--loss-track); position: relative; min-width: 60px; overflow: hidden; }
.loss-bar-fill { height: 100%; border-radius: 999px; background: var(--loss-bar); }
.loss-rate-high { color: var(--bad-text); font-weight: 900; }
.loss-rate-mid  { color: var(--warn-text); font-weight: 800; }

/* Выбор архетипа и AI */
.archetype-box, .ai-box {
  background: var(--panel); border: var(--border-w) solid var(--outline); border-radius: var(--radius-lg); box-shadow: var(--press);
  padding: 1.25rem; margin-bottom: 1.5rem;
}
.archetype-box h2 { font-family: var(--font-display); font-weight: 400; font-size: 20px; color: var(--heading); margin-bottom: 4px; }
.archetype-box p { font-size: 13px; color: var(--muted); margin-bottom: 1rem; }
.archetype-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 1rem; }
.archetype-card { border: 2px solid var(--sep); border-radius: 12px; padding: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.archetype-card:hover { border-color: var(--line); background: var(--hover); }
.archetype-card.selected { border-color: var(--primary); background: var(--info-bg); }
.archetype-card-name { font-size: 14px; font-weight: 900; margin-bottom: 3px; }
.archetype-card-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.archetype-note label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.archetype-note textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--input-border); border-radius: 12px; font-size: 14px; resize: vertical;
  outline: none; margin-bottom: 1rem; background: var(--input-bg); color: var(--text);
}
.archetype-note textarea:focus { border-color: var(--primary); }
.analyze-btn {
  width: 100%; padding: 12px; min-height: 50px; font-family: var(--font-display); font-size: 19px; color: var(--gold-ink); background: var(--gold);
  border: none; border-radius: 12px; box-shadow: 0 4px 0 var(--gold-shadow); cursor: pointer;
}
.analyze-btn:hover { filter: brightness(1.05); }
.analyze-btn:disabled { opacity: .55; cursor: not-allowed; }
.ai-badge { font-size: 11px; font-weight: 900; background: var(--info-bg); color: var(--info-text); padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 8px; }
.ai-context { font-size: 12px; color: var(--muted); margin-bottom: 12px; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; line-height: 1.5; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--sep); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-content { font-size: 14px; line-height: 1.7; white-space: pre-wrap; color: var(--text); }

/* Трекер замен */
.tracker-card { background: var(--panel); border: 2px solid var(--sep); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 10px; }
.tracker-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tracker-swap { font-size: 14px; font-weight: 900; }
.tracker-date { font-size: 11px; color: var(--muted); margin-left: auto; }
.tracker-status-pending, .tracker-status-organic, .tracker-status-accepted { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.tracker-status-pending  { background: var(--warn-bg); color: var(--warn-text); }
.tracker-status-organic  { background: var(--info-bg); color: var(--info-text); }
.tracker-status-accepted { background: var(--good-bg); color: var(--good-text); }
.tracker-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tracker-bar-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.tracker-bar-val { font-family: var(--font-display); font-size: 22px; margin-bottom: 4px; }
.tracker-bar-sub { font-size: 11px; color: var(--muted); }
.tracker-delta { font-size: 13px; font-weight: 900; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sep); }
.tracker-pending-msg { font-size: 12px; color: var(--muted); font-style: italic; }

/* Похожие колоды и замены */
.swap-tier-header { font-size: 12px; font-weight: 900; color: var(--muted); margin: 14px 0 6px; padding: 4px 0; border-bottom: 1px solid var(--sep); display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: .5px; }
.swap-tier-meta { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; }
.swap-top-deck { background: var(--surface-2); border: 1px solid var(--sep); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.swap-top-deck-wr { font-weight: 900; color: var(--good-text); }
.td-cards { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.td-match { background: var(--good-bg); color: var(--good-text); border-radius: 6px; padding: 2px 6px; font-size: 11px; display: inline-flex; align-items: center; gap: 2px; }
.td-diff  { background: var(--warn-bg); color: var(--warn-text); border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; }
/* «How similar decks perform» — группы по совпадению карт и карточки колод */
.sim-intro { font-size: 14px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.sim-group { margin-bottom: 8px; border: 2px solid var(--sep); border-radius: var(--radius-md); overflow: hidden; background: var(--panel); }
.sim-group > summary {
  padding: 12px 16px; cursor: pointer; font-weight: 900; font-size: 14px; background: var(--panel-head);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; user-select: none;
}
.sim-group-meta { font-size: 12px; font-weight: 700; color: var(--muted); }
.sim-group-body { padding: 12px; }
.sim-deck { background: var(--surface-2); border: 1px solid var(--sep); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.sim-deck-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.sim-wr { font-size: 16px; font-weight: 900; color: var(--good-text); }
.sim-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.sim-legend span { display: flex; align-items: center; gap: 4px; }
.sim-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; border: 2px solid; }
.sim-swatch.mine { border-color: var(--win); }
.sim-swatch.diff { border-color: var(--gold); }
.sim-cards { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.sim-card { text-align: center; }
.sim-card img { width: 36px; height: 41px; object-fit: contain; border-radius: 5px; border: 2px solid; }
.sim-card.mine { opacity: 0.75; }
.sim-card.mine img { border-color: var(--win); }
.sim-card.diff img { border-color: var(--gold); }
.sim-card-name { font-size: 9px; color: var(--muted); max-width: 40px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sim-divider { width: 1px; background: var(--line); margin: 0 4px; align-self: stretch; }
.sim-swap { font-size: 12px; color: var(--muted); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sep); }
.sim-swap-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px 10px; margin-top: 6px; }
.chip-card { display: inline-flex; align-items: center; gap: 4px; }
.chip-card img { width: 32px; height: 36px; object-fit: contain; vertical-align: middle; }

.swap-card { background: var(--panel); border: 2px solid var(--sep); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.swap-subtitle { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.swap-remove { font-size: 14px; color: var(--bad-text); font-weight: 900; }
.swap-arrow  { font-size: 16px; color: var(--muted); flex-shrink: 0; }
.swap-add    { font-size: 14px; color: var(--good-text); font-weight: 900; }
.swap-gain   { margin-left: auto; font-size: 12px; font-weight: 900; color: var(--good-text); background: var(--good-bg); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.swap-games  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.swap-evo    { font-size: 11px; color: var(--elixir); margin-top: 1px; }

/* Граф синергий (цвета узлов из JS переедут сюда на этапе 5) */
#synergyGraph { width: 100%; background: var(--surface-2); border: var(--border-w) solid var(--outline); border-radius: var(--radius-lg); box-shadow: var(--press); overflow: hidden; }
#synergyGraph .node-label { font-size: 9px; fill: var(--muted); text-anchor: middle; pointer-events: none; }
#synergyGraph .link { stroke: var(--line); stroke-opacity: 0.8; }
#synergyGraph .node-wc   rect { fill: var(--gold); }
#synergyGraph .node-deck rect { fill: var(--primary); }
#synergyGraph .node-syn1 rect { fill: var(--panel); stroke: var(--muted); stroke-width: 1; }
#synergyGraph .node-syn2 rect { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
/* Подписи стоят под карточкой, на фоне графа — поэтому цвет текста темы */
#synergyGraph .node-wc   .node-label { fill: var(--text); font-weight: 900; }
#synergyGraph .node-deck .node-label { fill: var(--text); font-weight: 800; }
#synergyGraph .node-wc rect, #synergyGraph .node-deck rect { stroke: none; }
#synergyGraph g.expanded rect { stroke: var(--gold); stroke-width: 2.5; }

/* Лоадер секции (дракон) */
.section-loader { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; padding: 12px 0; }
.dl-track { width: 60px; height: 28px; position: relative; flex-shrink: 0; }
.dl-dragon { position: absolute; top: 0; left: 0; font-size: 22px; line-height: 1; animation: dlPace 2.2s ease-in-out infinite; }
.dl-dragon span { display: inline-block; animation: dlBounce 0.28s ease-in-out infinite; }
@keyframes dlPace {
  0%   { transform: translateX(0px)  scaleX(1); }
  40%  { transform: translateX(36px) scaleX(1); }
  50%  { transform: translateX(36px) scaleX(-1); }
  90%  { transform: translateX(0px)  scaleX(-1); }
  100% { transform: translateX(0px)  scaleX(1); }
}
@keyframes dlBounce { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-5px); } }

/* Матрица матчапов (цвета ячеек считает JS — переедут на токены на этапе 5) */
#metaMatrix th, #metaMatrix td { border: 1px solid var(--sep); padding: 6px 8px; text-align: center; white-space: nowrap; }
#metaMatrix thead th, #metaMatrix tbody th { background: var(--panel-head); font-size: 11px; font-weight: 900; color: var(--muted); }
#metaMatrix tbody th { text-align: left; padding-right: 12px; }
#metaMatrix td { font-size: 12px; font-weight: 800; min-width: 58px; background: var(--panel); }
#metaMatrix td.mm-none { color: var(--muted); font-weight: 600; opacity: .6; }
#metaMatrix .mm-wr { font-size: 12px; font-weight: 900; }
#metaMatrix .mm-delta { font-size: 10px; font-weight: 700; opacity: 0.8; }
#metaMatrix tr.mm-player-row th, #metaMatrix tr.mm-player-row td, #metaMatrix th.mm-player-col { outline: 2px solid var(--text); outline-offset: -2px; }
.wr-high { color: var(--good-text); }
.wr-mid  { color: var(--muted); }
.wr-low  { color: var(--bad-text); }

/* <details> */
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; }
details summary::after { content: '▼'; font-size: 10px; color: var(--muted); transition: transform .2s; }
details[open] summary::after { transform: rotate(180deg); }

/* Полноэкранный лоадер */
#loadingOverlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(3px);
  flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.lo-arena { position: relative; width: 120px; height: 120px; }
/* Мечи — независимые элементы, чтобы z-index сравнивался с .lo-crown, а не внутри трансформированной обёртки */
.lo-s { position: absolute; top: 50%; left: 50%; font-size: 24px; line-height: 1; animation: loOrbit 2.4s linear infinite; }
.lo-s:nth-child(1) { animation-delay: 0s; }
.lo-s:nth-child(2) { animation-delay: -0.6s; }
.lo-s:nth-child(3) { animation-delay: -1.2s; }
.lo-s:nth-child(4) { animation-delay: -1.8s; }
@keyframes loOrbit {
  0%   { transform: translate(-50%,-50%) rotate(0deg)   translateY(-46px); z-index: 0; }
  24%  { z-index: 0; }
  25%  { z-index: 2; transform: translate(-50%,-50%) rotate(90deg)  translateY(-46px); }
  75%  { z-index: 2; transform: translate(-50%,-50%) rotate(270deg) translateY(-46px); }
  76%  { z-index: 0; }
  100% { transform: translate(-50%,-50%) rotate(360deg) translateY(-46px); z-index: 0; }
}
.lo-crown { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 46px; animation: loPulse 1.2s ease-in-out infinite; }
@keyframes loPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.lo-dots span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin: 0 3px; animation: loDot 1.2s ease-in-out infinite; }
.lo-dots span:nth-child(2) { animation-delay: .2s; }
.lo-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes loDot { 0%, 80%, 100% { transform: scale(1); background: var(--line); } 40% { transform: scale(1.4); background: var(--gold); } }

/* Deck Builder */
.db-group { border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.db-group-header { font-size: 12px; font-weight: 900; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.db-group-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.db-error { color: var(--bad-text); font-size: 12px; font-weight: 800; padding: 4px 8px; background: var(--bad-bg); border-radius: 8px; }
.db-card {
  display: inline-flex; flex-direction: column; align-items: center; cursor: pointer; padding: 6px 4px; border-radius: 12px;
  border: 2px solid var(--sep); background: var(--panel); transition: border .12s, background .12s; width: 88px;
}
.db-card:hover { background: var(--hover); }
.db-card.in-deck { opacity: .35; cursor: default; pointer-events: none; }
.db-card.db-blocked { opacity: .55; cursor: not-allowed; }
.db-card.cat-champion, .db-slot-filled.cat-champion { background: var(--champion-bg); }
.db-card.cat-evolution, .db-slot-filled.cat-evolution { background: var(--evo-bg); }
.db-card.db-green  { border-color: var(--win); background: var(--good-bg); }
.db-card.db-yellow { border-color: var(--warn-text); background: var(--warn-bg); }
.db-syn { position: absolute; bottom: 3px; right: 3px; font-size: 10px; font-weight: 900; border-radius: 5px; padding: 1px 5px; line-height: 1.4; }
.db-syn.syn-hi  { background: var(--good-bg); color: var(--good-text); }
.db-syn.syn-mid { background: var(--warn-bg); color: var(--warn-text); }
.db-syn.syn-lo  { background: var(--surface-2); color: var(--muted); }
.db-syn-inline { position: static; display: inline-block; font-size: 11px; vertical-align: 1px; }
.db-group-count { font-weight: 700; color: var(--muted); }

/* Статистика собранной колоды (dbUpdateStats) */
.db-stats-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 14px; margin-bottom: 8px; }
.db-stats-line b { font-weight: 900; }
.db-stats-sep { color: var(--line); margin: 0 6px; }
.db-stat-row { display: flex; align-items: center; padding: 3px 0; }
.db-stat-label { font-size: 13px; color: var(--text); width: 104px; flex-shrink: 0; }
.cells { display: inline-flex; align-items: center; }
.cell { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 2px; background: var(--sep); transition: background .2s; }
.cell.good { background: var(--win); }
.cell.warn { background: var(--warn-text); }
.cell.lo   { background: var(--muted); }
.cells-score { font-size: 12px; color: var(--muted); margin-left: 5px; min-width: 28px; }

/* Панель анализа колоды (dbRenderInsights) */
.insight-title { font-weight: 900; font-size: 15px; margin-bottom: 10px; }
.insight-text { font-size: 14px; color: var(--text); margin-bottom: 14px; line-height: 1.7; }
.insight-arrow { color: var(--muted); font-size: 16px; margin: 0 2px; }
.insight-meta { font-size: 12px; color: var(--muted); margin-left: 6px; }
.insight-gain { margin-left: auto; font-weight: 900; white-space: nowrap; }
.db-insight-swap img { border-radius: 4px; vertical-align: middle; }
.wr-big { font-size: 17px; font-weight: 900; }
.meter { display: inline-block; vertical-align: middle; width: 80px; height: 8px; background: var(--sep); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.meter-fill.text-good { background: var(--win); }
.meter-fill.text-warn { background: var(--warn-text); }
.meter-fill.text-bad  { background: var(--loss); }
.db-badges { display: flex; justify-content: center; align-items: center; gap: 1px; margin-top: 3px; height: 15px; }
.db-badge-slot { width: 15px; height: 15px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.db-insight-panel { background: var(--panel); border: var(--border-w) solid var(--outline); border-radius: var(--radius-lg); box-shadow: var(--press); padding: 14px 16px; margin-bottom: 16px; }
.db-insight-swap { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--sep); font-size: 13px; }
.db-insight-swap:last-child { border-bottom: none; }
.db-slot { position: relative; width: 64px; height: 76px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.db-slot-empty { border: 2px dashed var(--line); color: var(--line); font-size: 24px; cursor: default; }
.db-slot-filled { border: 2px solid var(--outline); background: var(--panel); cursor: pointer; }
.db-slot-filled:hover { border-color: var(--loss); background: var(--bad-bg); }
.db-slot-filled.locked { border-color: var(--gold) !important; }
.db-slot-name { font-size: 8px; text-align: center; line-height: 1.2; margin-top: 2px; color: var(--text); }
.db-card-name { font-size: 10px; font-weight: 800; text-align: center; line-height: 1.2; margin-top: 3px; color: var(--text); }
.db-card-elixir { font-size: 11px; color: var(--muted); margin-top: 1px; }
.db-info { position: absolute; top: 2px; left: 3px; font-size: 11px; line-height: 1; color: var(--muted); text-decoration: none; padding: 1px 2px; z-index: 1; pointer-events: auto; }
.db-info:hover { color: var(--text); }
.db-badge { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 900; }
.db-badge-ok   { background: var(--good-bg); color: var(--good-text); }
.db-badge-warn { background: var(--warn-bg); color: var(--warn-text); }

/* Вход и аккаунт */
#authArea { position: relative; }
.si-input {
  width: 100%; padding: 10px 12px; border: 2px solid var(--input-border); border-radius: 10px; font-size: 14px; margin-bottom: 8px;
  outline: none; background: var(--input-bg); color: var(--text);
}
.si-input:focus { border-color: var(--primary); }
.auth-btn {
  font-size: 12px; font-weight: 800; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 5px 12px;
  cursor: pointer; color: var(--text); display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.auth-btn:hover { background: var(--hover); }
.auth-btn img { width: 18px; height: 18px; border-radius: 50%; }

/* Футер */
.site-footer { max-width: 980px; margin: 28px auto 16px; padding: 0 16px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.site-footer p { margin-bottom: 8px; }
.site-footer .link-strong { font-size: 14px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ── Страницы карт и служебные страницы (card_pages.py, обёртка .cp) ─── */
a.brand { text-decoration: none; }
.brand-title { font-family: var(--font-display); font-weight: 400; line-height: 1.1; }
.cp-sheet {
  background: var(--panel); border: var(--border-w) solid var(--outline); border-radius: var(--radius-lg);
  box-shadow: var(--press); padding: 22px 24px 26px;
}
.cp nav { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.cp nav a { color: var(--muted); }
.cp nav a:hover { color: var(--text); }
.cp h1 { font-size: 32px; color: var(--heading); margin-bottom: 4px; display: flex; align-items: center; gap: 14px; }
.cp h1 img { width: 60px; height: auto; }
.cp h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--heading); margin: 28px 0 10px; }
.cp .sub { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.cp .lead { font-size: 15px; background: var(--surface-2); border: 2px solid var(--sep); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 8px; }
.cp .kpis { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.cp .kpi { background: var(--surface-2); border: 2px solid var(--sep); border-radius: var(--radius-md); padding: 10px 16px; min-width: 130px; }
.cp .kpi b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.15; }
.cp .kpi span { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.cp table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 2px solid var(--sep); border-radius: var(--radius-md); overflow: hidden; font-size: 14px; }
.cp th, .cp td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.cp tr:last-child td { border-bottom: none; }
.cp th { font-size: 12px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); background: var(--panel-head); }
.cp td.num, .cp th.num { text-align: right; white-space: nowrap; }
.cp td a { color: var(--text); text-decoration: none; font-weight: 800; }
.cp td > a { display: inline-flex; align-items: center; vertical-align: middle; }
.cp td a:hover { color: var(--link); }
.cp .deck { display: flex; gap: 3px; flex-wrap: wrap; margin: 0; }
.cp .deck img { width: 36px; height: auto; }
.cp .mini { display: inline-flex; align-items: center; gap: 8px; }
.cp .mini img { width: 28px; height: auto; display: block; }
.cp .up { color: var(--good-text); font-weight: 900; }
.cp .down { color: var(--bad-text); font-weight: 900; }
.cp .cta {
  display: inline-flex; align-items: center; margin: 24px 0 4px; font-family: var(--font-display); font-size: 18px;
  color: var(--gold-ink); background: var(--gold); text-decoration: none; padding: 10px 22px; border-radius: 12px; box-shadow: 0 4px 0 var(--gold-shadow);
}
.cp .cta:hover { filter: brightness(1.05); color: var(--gold-ink); }
.cp ul.hist { background: var(--surface-2); border: 2px solid var(--sep); border-radius: var(--radius-md); padding: 10px 16px 10px 32px; font-size: 14px; }
.cp ul.hist li { margin: 4px 0; }
.cp .scroll { overflow-x: auto; }
.cp > footer { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.cp > footer p { margin-bottom: 6px; }
.cp > footer a { color: var(--muted); }

/* Формы на служебных страницах (сброс пароля) — те же классы есть в классическом CSS */
.form-narrow { max-width: 420px; }
.form-input {
  width: 100%; padding: 11px 14px; border: 2px solid var(--input-border); border-radius: 12px; margin-bottom: 10px;
  font-size: 15px; font-weight: 700; background: var(--input-bg); color: var(--text); outline: none;
}
.form-input:focus { border-color: var(--primary); }
.form-btn {
  width: 100%; padding: 10px; min-height: 46px; font-family: var(--font-display); font-size: 18px; color: var(--on-primary);
  background: var(--primary); border: none; border-radius: 12px; box-shadow: 0 4px 0 var(--primary-shadow); cursor: pointer;
}
.form-msg { font-size: 13px; font-weight: 800; margin-top: 10px; color: var(--bad-text); }

/* ── Телефон ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .deck { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .brand-title { font-size: 26px; }
  .hero { padding-bottom: 60px; }
}
@media (max-width: 560px) {
  .cp-sheet { padding: 16px 14px 20px; }
  .cp h1 { font-size: 26px; }
  .cp .deck img { width: 30px; }
  .cp th, .cp td { padding: 7px 8px; }
  #tabBar { grid-template-columns: repeat(2, 1fr); }
  #tabBar .tab-btn { font-size: 16px; }
  .archetype-grid { grid-template-columns: 1fr; }
  .metric-val { font-size: 26px; }
}
