/* ============ Щит — голубая тема ============ */
:root {
  --bg: #eef5ff;
  --bg-2: #e2eeff;
  --card: #ffffff;
  --card-2: #f5f9ff;
  --ink: #0f2744;
  --ink-2: #2c4566;
  --muted: #5f7896;
  --line: #d9e7fb;
  --primary: #2a7cf6;
  --primary-2: #59a8ff;
  --primary-ink: #ffffff;
  --primary-soft: #e1eeff;
  --accent: #19b5e6;
  --danger: #e5484d;
  --danger-soft: #fde8e8;
  --ok: #1fa971;
  --gold: #f59e0b;
  --gold-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(20, 60, 120, .06), 0 8px 24px rgba(30, 90, 180, .08);
  --shadow-lg: 0 20px 60px rgba(15, 50, 110, .22);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --nav-h: 66px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #07111f;
  --bg-2: #0b1a2f;
  --card: #0f2038;
  --card-2: #132845;
  --ink: #e8f1ff;
  --ink-2: #c3d5ef;
  --muted: #8aa4c6;
  --line: #1c3354;
  --primary: #4a98ff;
  --primary-2: #7cc0ff;
  --primary-soft: #14305a;
  --accent: #3cc8f2;
  --danger: #ff6b6f;
  --danger-soft: #3a1a24;
  --gold: #fbbf24;
  --gold-soft: #3b2a0f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
[hidden] { display: none !important; }

.wrap { overflow-wrap: anywhere; word-break: break-word; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 35%, transparent) transparent; }
}
::-webkit-scrollbar { width: 6px; height: 5px; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 32%, transparent); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--primary) 55%, transparent); }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Фон ---------- */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-2), var(--bg) 60%); }
#bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 18s var(--ease) infinite alternate; }
#bg i:nth-child(1) { width: 320px; height: 320px; left: -80px; top: -60px; background: #8cc4ff; }
#bg i:nth-child(2) { width: 260px; height: 260px; right: -90px; top: 180px; background: #9fe3ff; animation-duration: 22s; }
#bg i:nth-child(3) { width: 220px; height: 220px; left: 30%; bottom: -80px; background: #b9d5ff; animation-duration: 26s; }
[data-theme="dark"] #bg i { opacity: .18; }
@keyframes float { to { transform: translate(30px, 40px) scale(1.12); } }

/* ---------- Каркас ---------- */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 14px) 16px calc(var(--nav-h) + var(--safe-bottom) + 38px);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}
.screen { animation: screenIn .38s var(--ease) both; }
.screen.push { animation-name: pushIn; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes pushIn { from { opacity: 0; transform: translateX(28px); } }

.rise { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Загрузка ---------- */
.boot { min-height: 70vh; display: grid; place-items: center; }
.boot-logo { width: 64px; height: 64px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow-lg);
  animation: pulse 1.2s var(--ease) infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); filter: brightness(1.1); } }

/* ---------- Шапка ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 40px; }
.topbar h1 { font-size: clamp(20px, 5.6vw, 26px); line-height: 1.2; margin: 0; flex: 1; min-width: 0; letter-spacing: -.01em; }
.icon-btn { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 14px; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow); color: var(--ink); transition: transform .15s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .3s; }
.live.on::before { background: var(--ok); box-shadow: 0 0 0 0 rgba(31, 169, 113, .5); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(31, 169, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 169, 113, 0); } }

/* ---------- Герой ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(135deg, #1f6fe5 0%, #3b93ff 55%, #2cc0ee 100%); box-shadow: var(--shadow-lg); }
.hero.gold { background: linear-gradient(135deg, #d97706 0%, #f59e0b 55%, #fbbf24 100%); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.hero::before { width: 220px; height: 220px; right: -70px; top: -90px; animation: float 12s var(--ease) infinite alternate; }
.hero::after { width: 140px; height: 140px; right: 40px; bottom: -80px; animation: float 15s var(--ease) infinite alternate-reverse; }
.hero > * { position: relative; z-index: 1; }
.hero-row { display: flex; align-items: center; gap: 14px; }
.hero-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .2); backdrop-filter: blur(6px); font-size: 26px; }
.hero-icon svg { width: 28px; height: 28px; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.hero h2 { margin: 0; font-size: clamp(19px, 5.2vw, 23px); line-height: 1.2; }
.hero p { margin: 4px 0 0; opacity: .92; font-size: 14px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.hero-stat { background: rgba(255, 255, 255, .16); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.hero-stat b { display: block; font-size: 22px; line-height: 1.1; }
.hero-stat span { font-size: 12px; opacity: .9; }

/* ---------- Карточки и списки ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 65%, transparent); padding: 16px; min-width: 0; }
.card + .card, .card + .list, .list + .card { margin-top: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 22px 4px 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.section-title:first-child { margin-top: 4px; }
.list { display: grid; gap: 10px; }

.case-card { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .2s; }
.case-card:active { transform: scale(.98); }
@media (hover: hover) { .case-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); } }
.thumb { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-soft), var(--card-2)); color: var(--primary); font-size: 24px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; animation: fadeIn .4s both; }
@keyframes fadeIn { from { opacity: 0; } }
.case-body { flex: 1; min-width: 0; }
.case-title { font-weight: 600; font-size: 16px; line-height: 1.3; }
.case-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chev { color: var(--muted); flex: 0 0 auto; }
.chev svg { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.4; background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.badge > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.badge.muted { background: var(--card-2); color: var(--muted); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; font-weight: 600; font-size: 15px; line-height: 1.2; text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform .15s var(--ease), filter .2s, opacity .2s; position: relative; overflow: hidden; max-width: 100%; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn.block { width: 100%; }
.btn.soft { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); box-shadow: none; }
.btn.gold { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; box-shadow: 0 6px 18px rgba(245, 158, 11, .35); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn .ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .45); transform: scale(0);
  animation: ripple .6s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.btn.loading { color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin .7s linear infinite; }
.btn.soft.loading::after, .btn.ghost.loading::after, .btn.ok.loading::after { border-color: var(--primary) var(--primary) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.actions.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.actions .btn { min-width: 0; padding: 0 10px; }
.actions .btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Детали дела и карточки архива ---------- */
.case-head h2 { margin: 0 0 8px; font-size: clamp(19px, 5.2vw, 23px); line-height: 1.25; }
.case-head p { margin: 10px 0 0; color: var(--ink-2); white-space: pre-wrap; }

.timeline { position: relative; display: grid; gap: 12px; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--primary), color-mix(in srgb, var(--primary) 10%, transparent)); }
.ev { position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.ev::before { content: ""; position: absolute; left: -18px; top: 18px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--primary); }
.ev-img { position: relative; background: var(--card-2); max-height: 360px; overflow: hidden; cursor: zoom-in; }
.ev-img img { width: 100%; height: auto; max-height: 360px; object-fit: cover; object-position: top; }
.ev-img .skeleton { height: 200px; border-radius: 0; }
.ev-body { padding: 12px 14px 14px; display: grid; gap: 8px; min-width: 0; }
.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ev-note { white-space: pre-wrap; color: var(--ink-2); }
.ev-link { display: flex; gap: 6px; align-items: center; font-size: 13px; min-width: 0; text-decoration: none; }
.ev-link svg { width: 15px; height: 15px; flex: 0 0 auto; }
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; color: var(--muted); }
.ev.new { animation: newEv .9s var(--ease) both; }
@keyframes newEv { 0% { opacity: 0; transform: translateY(-10px) scale(.96); box-shadow: 0 0 0 4px var(--primary); } 100% { box-shadow: var(--shadow); } }

.arch-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.arch-card.prio { border: 1.5px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.arch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 8px; }
.arch-handle { font-weight: 700; font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 6px; min-width: 0; }
.arch-links { display: flex; flex-wrap: wrap; gap: 8px; }
.arch-links a { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 4px 10px;
  border-radius: 999px; background: var(--card-2); text-decoration: none; }
.arch-links a svg { width: 13px; height: 13px; }
.arch-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }

/* ---------- Поисковая строка ---------- */
.search-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.search-bar .search { flex: 1; min-width: 0; margin: 0; }
.search-bar .btn { flex: 0 0 48px; width: 48px; height: 48px; min-height: 48px; padding: 0; }
.quota-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px;
  border-radius: 16px; background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  box-shadow: var(--shadow); margin-bottom: 12px; font-size: 13px; }
.donate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.donate-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 14px 10px; border-radius: 16px; background: var(--card-2); border: 1.5px solid var(--line);
  font-weight: 700; transition: transform .15s var(--ease), border-color .2s; }
.donate-btn:active { transform: scale(.96); }
.donate-btn b { font-size: 18px; color: var(--gold); }
.donate-btn span { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---------- Пустые состояния / скелетоны ---------- */
.empty { text-align: center; padding: 34px 20px; }
.empty .em { font-size: 44px; animation: bob 3s ease-in-out infinite; display: inline-block; }
.empty h3 { margin: 10px 0 6px; font-size: 18px; }
.empty p { margin: 0 auto 16px; color: var(--muted); max-width: 340px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Чипы (строго в границах колонки, без выезда за края) ---------- */
.chips { display: flex; align-items: center; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; padding: 2px 0 8px; margin: 0 0 6px; width: 100%;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; gap: 8px; }
.chip { scroll-snap-align: start; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; max-width: none;
  min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow);
  font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease); }
.chips.wrap-chips .chip { max-width: 100%; }
.chip > span { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.lock { opacity: .85; }

/* ---------- Инструкция ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; counter-increment: s; min-width: 0; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.steps li::before { content: counter(s); flex: 0 0 28px; height: 28px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px; }
.steps li > span { padding-top: 3px; min-width: 0; overflow-wrap: anywhere; }

.tpl-body { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); background: var(--card-2); border-radius: 12px;
  padding: 12px; margin: 10px 0 12px; max-height: 160px; overflow: hidden; position: relative; transition: max-height .4s var(--ease); overflow-wrap: anywhere; }
.tpl-body.open { max-height: 2000px; }
.tpl-body:not(.open)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background: linear-gradient(transparent, var(--card-2)); }
.tpl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-actions .btn { flex: 1 1 140px; }

/* ---------- Формы ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--card-2); font-size: 16px;
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.hint { font-size: 12px; color: var(--muted); }
input[type="date"].input { appearance: none; -webkit-appearance: none; }

.drop { display: grid; place-items: center; gap: 6px; text-align: center; padding: 22px 16px; border-radius: 16px;
  border: 2px dashed color-mix(in srgb, var(--primary) 45%, transparent); background: var(--primary-soft); color: var(--primary);
  cursor: pointer; transition: transform .15s var(--ease), background .2s; }
.drop:active, .drop.over { transform: scale(.98); background: color-mix(in srgb, var(--primary) 20%, var(--card)); }
.drop svg { width: 30px; height: 30px; }
.drop b { font-size: 15px; }
.drop span { font-size: 12px; color: var(--muted); }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.previews .pv { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card-2); animation: rise .35s var(--ease) both; }
.previews img { width: 100%; height: 100%; object-fit: cover; }
.previews .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; font-size: 14px; }
.progress { height: 6px; border-radius: 6px; background: var(--primary-soft); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .2s; }

.switch { position: relative; width: 48px; height: 28px; flex: 0 0 48px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 28px; background: var(--line); transition: background .25s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }

/* ---------- Нижнее меню (Поиск с лупой строго по центру!) ---------- */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 10px calc(8px + var(--safe-bottom));
  display: flex; justify-content: center; pointer-events: none; }
.tabs { pointer-events: auto; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  width: 100%; max-width: 540px; height: var(--nav-h); padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.tab { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; gap: 2px; min-width: 0;
  color: var(--muted); font-size: 10.5px; font-weight: 600; transition: color .25s; }
.tab svg { width: 21px; height: 21px; transition: transform .3s var(--ease); }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tab.on { color: var(--primary); }
.tab.on svg { transform: translateY(-1px) scale(1.08); }
.tab.tab-center { color: var(--primary); }
.tab.tab-center .tab-ic-ring { width: 34px; height: 28px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 42%, transparent); transition: transform .25s var(--ease); }
.tab.tab-center .tab-ic-ring svg { width: 17px; height: 17px; stroke-width: 2.4; }
.tab.tab-center.on .tab-ic-ring { transform: scale(1.08) translateY(-1px); }
.tab-ind { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px; border-radius: 16px; background: var(--primary-soft);
  transition: transform .4s var(--ease), width .4s var(--ease); }

/* ---------- Сегменты ---------- */
.seg { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 16px; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent); box-shadow: var(--shadow);
  overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 36px; padding: 0 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); transition: background .25s, color .25s; white-space: nowrap; text-align: center; }
.seg button.on { background: var(--primary); color: #fff; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.stat b { display: block; font-size: 25px; line-height: 1.1; color: var(--primary); }
.stat span { font-size: 12px; color: var(--muted); }
.stat small { display: block; font-size: 12px; color: var(--ok); margin-top: 2px; }
.stat.bump b { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.15); } }

.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-width: 0; }
.row + .row { border-top: 1px solid var(--line); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { font-size: 13px; color: var(--muted); }
.card.flush { padding: 0; overflow: hidden; }
.avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 14px; display: grid; place-items: center; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }

.note { display: flex; gap: 12px; align-items: flex-start; }
.note .ni { flex: 0 0 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 20px; }
.note h3 { margin: 0 0 4px; font-size: 16px; }
.note p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Шторка (bottom sheet) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(5, 20, 45, .45); backdrop-filter: blur(2px);
  animation: fadeIn .25s both; }
.backdrop.out { animation: fadeOut .25s both; }
@keyframes fadeOut { to { opacity: 0; } }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px;
  max-height: calc(100dvh - var(--safe-top) - 24px); display: flex; flex-direction: column;
  background: var(--bg); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  animation: sheetIn .42s var(--ease) both; }
.sheet.out { animation: sheetOut .28s ease-in both; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.sheet-head { flex: 0 0 auto; padding: 8px 16px 6px; touch-action: none; cursor: grab; }
.sheet-grip { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 10px; }
.sheet-title { display: flex; align-items: center; gap: 10px; }
.sheet-title h3 { flex: 1; min-width: 0; margin: 0; font-size: 19px; line-height: 1.25; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 10px 16px calc(18px + var(--safe-bottom)); }
@media (min-width: 680px) {
  .sheet { bottom: 50%; border-radius: 24px; transform: translateY(50%); max-height: 86vh; width: calc(100% - 40px); }
  @keyframes sheetIn { from { opacity: 0; transform: translateY(calc(50% + 30px)) scale(.97); } to { transform: translateY(50%); } }
  @keyframes sheetOut { from { transform: translateY(50%); } to { opacity: 0; transform: translateY(calc(50% + 30px)) scale(.97); } }
}

/* ---------- Просмотр скриншота ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(3, 10, 22, .94); overflow: auto; overscroll-behavior: contain;
  animation: fadeIn .25s both; display: flex; }
.viewer img { margin: auto; max-width: 100%; height: auto; padding: calc(var(--safe-top) + 56px) 0 calc(var(--safe-bottom) + 20px); animation: zoomIn .35s var(--ease) both; }
.viewer .icon-btn { position: fixed; top: calc(var(--safe-top) + 12px); right: 12px; background: rgba(255, 255, 255, .15); color: #fff; box-shadow: none; }
@keyframes zoomIn { from { transform: scale(.92); opacity: 0; } }

/* ---------- Уведомления ---------- */
#toasts { position: fixed; z-index: 80; left: 0; right: 0; top: calc(var(--safe-top) + 10px); display: grid; justify-items: center;
  gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { --c: var(--primary); position: relative; overflow: hidden; pointer-events: auto; touch-action: none; user-select: none;
  width: min(420px, 100%); display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 14px 12px; border-radius: 18px;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--ink);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line));
  box-shadow: 0 12px 40px color-mix(in srgb, var(--c) 22%, rgba(10, 30, 70, .18)), 0 2px 6px rgba(10, 30, 70, .08);
  animation: toastIn .55s cubic-bezier(.18, 1.25, .4, 1) both; }
.toast.ok { --c: var(--ok); }
.toast.err { --c: var(--danger); }
.toast.warn { --c: #f5a524; }
.toast.info { --c: var(--primary); }
.toast-ic { flex: 0 0 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 19px;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #fff));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 40%, transparent); animation: iconPop .6s .1s cubic-bezier(.2, 1.6, .4, 1) both; }
.toast-ic svg { width: 20px; height: 20px; stroke-width: 2.6; }
.toast.ok .toast-ic svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .3s ease-out forwards; }
.toast-body { flex: 1; min-width: 0; display: grid; gap: 2px; padding-top: 1px; }
.toast-body b { font-size: 15px; line-height: 1.3; font-weight: 650; }
.toast-body span { font-size: 13px; line-height: 1.35; color: var(--muted); }
.toast-x { flex: 0 0 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); opacity: .7; }
.toast-x svg { width: 15px; height: 15px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; background: var(--c); opacity: .55;
  animation: toastBar var(--dur, 3s) linear forwards; }
.toast.paused .toast-bar { animation-play-state: paused; }
.toast.out { animation: toastOut .32s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-26px) scale(.92); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toastBar { to { transform: scaleX(0); } }
@keyframes iconPop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.toast.err { animation: toastIn .55s cubic-bezier(.18, 1.25, .4, 1) both, shake .4s .45s ease-in-out; }
@keyframes shake { 25% { translate: -5px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
.toast.out, .toast.err.out { animation: toastOut .32s ease-in both; }
@media (min-width: 680px) { #toasts { justify-items: end; padding-right: 20px; top: 16px; } }

.blocked-screen { min-height: 70vh; display: grid; place-items: center; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Дополнения ---------- */
.still, .still .rise { animation: none !important; }
.btn.white { background: #fff; color: #1f6fe5; box-shadow: 0 6px 18px rgba(0, 30, 80, .18); }
.btn.white .ripple { background: rgba(31, 111, 229, .25); }
.hero .btn { margin-top: 16px; }
.icon-btn.sm { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; box-shadow: none; background: var(--card-2); }
.icon-btn.sm svg { width: 17px; height: 17px; }
.icon-btn.danger { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.muted { color: var(--muted); }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.mt-lg { margin-top: 20px; }
.between > .note { flex: 1; min-width: 0; }
.between > .btn { flex: 0 0 auto; }
.actions.cols-3 .btn { padding: 0 6px; font-size: 12.5px; }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.footer-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 24px; }
.platform-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.platform-head .pi { font-size: 26px; width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-soft); }
.platform-head h3 { margin: 0; font-size: 18px; min-width: 0; }

.list, .timeline { grid-template-columns: minmax(0, 1fr); }
.list > *, .timeline > *, .stats > *, .field > *, .actions > *, .grid-2 > * { min-width: 0; }
.sheet-body > *, .sheet-body form { min-width: 0; max-width: 100%; }
.case-head .badge > span { white-space: normal; overflow-wrap: anywhere; }

.ref-card { background: linear-gradient(135deg, var(--card), var(--primary-soft)); }
.ref-count { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 4px; flex-wrap: wrap; }
.ref-count b { font-size: 40px; line-height: 1; color: var(--primary); letter-spacing: -.02em; }
.ref-count span { color: var(--muted); font-size: 14px; }
.ref-count.bump b { animation: bump .6s var(--ease); }
.ref-link { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1.5px dashed color-mix(in srgb, var(--primary) 40%, transparent);
  color: var(--primary); font-size: 14px; font-weight: 500; display: flex; min-width: 0; }
.rank { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700;
  background: var(--card-2); color: var(--muted); }
.rank.top { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.avatar.is-blocked { background: linear-gradient(135deg, #9aa9bd, #c3cfdd); }
.avatar.lg { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 18px; font-size: 22px; }
.user-head { display: flex; gap: 14px; align-items: center; min-width: 0; animation: rise .4s var(--ease) both; }
.user-head .case-meta { margin-top: 6px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.kv > div { background: var(--card); border-radius: 12px; padding: 10px 12px; min-width: 0; box-shadow: var(--shadow); animation: rise .4s var(--ease) both; }
.kv span { display: block; font-size: 12px; color: var(--muted); }
.kv b { display: block; font-size: 14px; font-weight: 600; margin-top: 2px; }
.bc-run { border: 1.5px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.bc-run .progress { height: 10px; margin-top: 14px; }
.bc-run .progress i { transition: width .6s var(--ease); background-size: 200% 100%;
  background-image: linear-gradient(90deg, var(--primary), var(--accent), var(--primary)); animation: shimmer 1.4s linear infinite; }
.btn.danger.small { min-height: 32px; }

.gate { min-height: 75vh; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 20px 0; }
.gate-icon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 28px; display: grid; place-items: center; font-size: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow-lg); animation: pulse 1.6s var(--ease) infinite alternate; }
.gate h2 { margin: 0 0 8px; font-size: clamp(21px, 6vw, 26px); line-height: 1.2; }
.gate > p { margin: 0 auto 20px; max-width: 360px; color: var(--muted); }
.gate-ch { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 12px 12px 14px; }
.gate-ch .btn { flex: 0 0 auto; }


/* ---------- Прокрутка фильтров и вкладок админки с ПК (колёсико + drag + аккуратный скроллбар без стрелок) ---------- */
.chips:not(.wrap-chips), .seg { touch-action: pan-x; }
.chips:not(.wrap-chips).dragging, .seg.dragging { cursor: grabbing !important; scroll-snap-type: none; user-select: none; }
@media (hover: hover) and (pointer: fine) {
  .chips:not(.wrap-chips), .seg { cursor: grab; }
  @supports not selector(::-webkit-scrollbar) {
    .chips:not(.wrap-chips), .seg {
      scrollbar-width: thin;
      scrollbar-color: color-mix(in srgb, var(--primary) 32%, transparent) transparent;
    }
  }
  .chips:not(.wrap-chips)::-webkit-scrollbar,
  .seg::-webkit-scrollbar { display: block; height: 4px; }
  .chips:not(.wrap-chips)::-webkit-scrollbar-button,
  .seg::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  .chips:not(.wrap-chips)::-webkit-scrollbar-thumb,
  .seg::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 28%, transparent);
    border-radius: 999px;
  }
  .chips:not(.wrap-chips):hover::-webkit-scrollbar-thumb,
  .seg:hover::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 52%, transparent);
  }
  .chips:not(.wrap-chips)::-webkit-scrollbar-track,
  .seg::-webkit-scrollbar-track { background: transparent; }
}

/* ---------- Режим технических работ ---------- */
.maint-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 16px;
  background: var(--gold-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  font-size: 13px;
}
.maint-banner b { color: var(--gold); }
.maint-screen { min-height: 75vh; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 20px 0; }
.maint-icon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 28px; display: grid; place-items: center; font-size: 40px;
  background: linear-gradient(135deg, #d97706, #f59e0b); box-shadow: var(--shadow-lg); animation: pulse 1.6s var(--ease) infinite alternate; }


/* ---------- Анимированные стикеры (TGS / Lottie + PNG фоллбэк) ---------- */
.stk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--s, 32px);
  height: var(--s, 32px);
  flex: 0 0 var(--s, 32px);
  vertical-align: middle;
  overflow: hidden;
  pointer-events: none;
}
.stk img, .stk svg {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block;
}
.stk-inline { margin-right: 2px; }
.stk-empty { margin: 0 auto 6px; display: flex; }
.chip > span { display: inline-flex; align-items: center; gap: 6px; }
.badge > span { display: inline-flex; align-items: center; gap: 5px; }
.note .ni.stk-ni { background: var(--primary-soft); padding: 4px; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px; }
.platform-head .pi { padding: 5px; }
.hero-icon.stk-hero { width: 56px; height: 56px; flex: 0 0 56px; padding: 4px; }

/* Компактная адаптация таббара при 6 вкладках (админ) */
.tabs.tabs-6 .tab { font-size: 9.5px; }
.tabs.tabs-6 .tab svg { width: 19px; height: 19px; }
.tabs.tabs-6 .tab.tab-center .tab-ic-ring { width: 32px; height: 26px; }

/* Произвольная сумма доната */
.donate-custom { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.donate-custom .input { flex: 1; min-height: 46px; }
.donate-custom .btn { flex: 0 0 auto; min-height: 46px; padding: 0 16px; }


/* ---------- Компактная адаптация 7 вкладок (админ: Поиск ровно по центру!) ---------- */
.tabs.tabs-7 { max-width: 580px; padding: 5px; }
.tabs.tabs-7 .tab-ind { top: 5px; bottom: 5px; border-radius: 15px; }
.tabs.tabs-7 .tab { font-size: 9px; gap: 1px; }
.tabs.tabs-7 .tab svg { width: 18px; height: 18px; }
.tabs.tabs-7 .tab.tab-center .tab-ic-ring { width: 30px; height: 24px; }
@media (min-width: 520px) {
  .tabs.tabs-7 .tab { font-size: 10.5px; }
  .tabs.tabs-7 .tab svg { width: 20px; height: 20px; }
}
.tab.tab-sos { color: var(--danger); }
.tab.tab-sos.on { color: var(--danger); }

/* ---------- Экран SOS, Экстренные номера и Памятки ---------- */
.hero.sos-hero {
  background: linear-gradient(135deg, #c81e32 0%, #e5484d 55%, #ff6b6f 100%);
}
.hero.sos-hero.active-sos {
  animation: sosPulse 2.2s ease-in-out infinite;
}
@keyframes sosPulse {
  0%, 100% { box-shadow: 0 12px 36px rgba(229, 72, 77, .35); }
  50% { box-shadow: 0 14px 48px rgba(229, 72, 77, .65); }
}
.btn.sos-main {
  min-height: 54px;
  font-size: 16px;
  font-weight: 700;
  background: #fff;
  color: #c81e32;
  box-shadow: 0 8px 22px rgba(80, 0, 10, .25);
}
.btn.sos-main .ripple { background: rgba(200, 30, 50, .22); }
.sos-alert-box > span { flex: 1; min-width: 0; }
.sos-alert-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 16px; margin-bottom: 12px;
  background: var(--danger-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  font-size: 13px;
}
.hotline-card {
  display: grid; gap: 8px;
}
.hotline-card.urgent {
  border: 1.5px solid color-mix(in srgb, var(--danger) 42%, transparent);
}
.hotline-phone {
  font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--primary);
  text-decoration: none;
}
.hotline-card.urgent .hotline-phone { color: var(--danger); }
.guide-card { padding: 0; overflow: hidden; }
.guide-head {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: transparent;
}
.guide-head .ni {
  flex: 0 0 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--primary-soft); font-size: 22px;
}
.guide-chev { color: var(--muted); transition: transform .25s var(--ease); flex: 0 0 auto; }
.guide-card.open .guide-chev { transform: rotate(90deg); }
.guide-body {
  display: none; padding: 0 16px 16px; border-top: 1px solid var(--line);
}
.guide-card.open .guide-body { display: block; padding-top: 12px; }


/* ---------- Удобная плавающая кнопка «Добавить пост» и действия карточки ---------- */
.fab-add-post {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px);
  z-index: 19;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 48%, rgba(0, 0, 0, .28));
  transition: transform .18s var(--ease), box-shadow .2s;
}
.fab-add-post:active { transform: scale(.95); }
.fab-add-post svg { width: 18px; height: 18px; stroke-width: 2.5; flex: 0 0 auto; }
@media (min-width: 760px) {
  .fab-add-post { right: max(16px, calc(50% - 344px)); }
}
.arch-foot-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topbar .btn.small { flex: 0 0 auto; min-height: 36px; }

/* ---------- Блок управления Pro-подпиской в админке ---------- */
.pro-admin-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  box-shadow: var(--shadow);
}
.pro-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.pro-presets .btn { min-height: 36px; padding: 0 6px; font-size: 12.5px; border-radius: 10px; }
.pro-custom-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.pro-custom-row .input { flex: 1; min-height: 44px; padding: 10px 12px; }
.pro-custom-row .btn { flex: 0 0 auto; min-height: 44px; padding: 0 14px; }
