/* Layout: карта города на весь экран; поверх неё панель звания и цели, кнопки карты и нижнее меню.
   Пожертвование и профиль открываются отдельным экраном, домик партнёра — карточкой снизу. */
:root {
  --bg: #f3f5f9;
  --sky-top: #dce8f5;
  --sky-bottom: #f5eee3;
  --surface: #ffffff;
  --surface-2: #edf0f6;
  --ink: #161f31;
  --muted: #5b667d;
  --line: #d9dfe9;
  --primary: #3a57cc;
  --primary-ink: #ffffff;
  --primary-soft: #e3e9fb;
  --accent: #df5236;
  --accent-ink: #ffffff;
  --gold: #f2b93b;
  --gold-soft: #fcf1d6;
  --gold-ink: #6b4700;
  --good: #1d8757;
  --danger: #c0392b;
  --road: #d5dbe4;
  --fog: #f4f6f9;
  --fog-ground: #cdd3dc;
  --shadow: 0 6px 20px rgba(22, 31, 49, 0.12);
  --font-display: 'Unbounded', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1320; --sky-top: #152039; --sky-bottom: #1c1a26; --surface: #192032; --surface-2: #232c40; --ink: #e9edf5;
    --muted: #9ba6bc; --line: #2c374c; --primary: #7d95ff; --primary-ink: #0b1020; --primary-soft: #1f2a4c;
    --accent: #f26a4f; --accent-ink: #1a0b06; --gold: #f2b93b; --gold-soft: #3a2d10; --gold-ink: #f7d68c;
    --good: #52cc90; --danger: #ff7b68; --road: #39435a; --fog: #c7cfdb; --fog-ground: #4a5468;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1320; --sky-top: #152039; --sky-bottom: #1c1a26; --surface: #192032; --surface-2: #232c40; --ink: #e9edf5;
  --muted: #9ba6bc; --line: #2c374c; --primary: #7d95ff; --primary-ink: #0b1020; --primary-soft: #1f2a4c;
  --accent: #f26a4f; --accent-ink: #1a0b06; --gold: #f2b93b; --gold-soft: #3a2d10; --gold-ink: #f7d68c;
  --good: #52cc90; --danger: #ff7b68; --road: #39435a; --fog: #c7cfdb; --fog-ground: #4a5468;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; overflow: hidden; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
h3 { font-size: 0.95rem; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }
.eyebrow { font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; }
.coin { width: 18px; height: 18px; flex: none; }

.app { position: relative; height: 100%; overflow: hidden; }
.gutter-x { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- Город ---------- */
.city { position: absolute; inset: 0; }
.map {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}
.map.dragging { cursor: grabbing; }
.city-svg { width: 100%; height: 100%; display: block; }
.house, [data-tap] { cursor: pointer; }
.free-lot text.free-plus { font: 700 22px var(--font-body); }
.map-labels { position: absolute; inset: 0; pointer-events: none; }
.map-label {
  position: absolute; left: 0; top: 0; pointer-events: auto; white-space: nowrap; border: 0; cursor: pointer;
  font: 600 12px/1 var(--font-body); padding: 6px 10px; border-radius: 999px;
  background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(22, 31, 49, 0.18);
  min-height: 26px; display: inline-flex; align-items: center;
}
/* Невидимая зона нажатия: подпись выглядит маленькой, но ловит палец 44 px. */
.map-label::before { content: ""; position: absolute; inset: -9px -4px; }
.ml-quarter::before { display: none; }
.map-label.seen::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); margin-left: 6px; }
.ml-institute { background: var(--primary); color: var(--primary-ink); font-family: var(--font-display); font-size: 12px; }
.ml-goal { background: var(--gold); color: #3d2a00; }
.ml-closed { background: rgba(255, 255, 255, 0.85); color: #3b4456; white-space: normal; max-width: 180px; text-align: center; line-height: 1.3; }
.ml-quarter {
  pointer-events: none; background: none; box-shadow: none; padding: 0; min-height: 0; cursor: default;
  font: 700 10px var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.ml-partner { opacity: 0; visibility: hidden; transition: opacity 0.2s; }
.show-names .ml-partner { opacity: 1; visibility: visible; }
.ml-quarter { text-shadow: 0 1px 0 var(--surface); }

.hud {
  position: absolute; z-index: 3; top: 10px; left: 0; right: 0; margin: 0 auto; max-width: 560px;
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-rank, .hud-goal {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
}
.hud-rank { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; }
.hud-rank-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hud-rank-text b { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; }
.hud-coins {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--gold-soft); color: var(--gold-ink); padding: 5px 10px; border-radius: 999px;
}
.hud-goal { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; text-align: left; cursor: pointer; width: 100%; }
.hud-goal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.85rem; }
.hud-goal-top > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.hud-goal-top b { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.mini-bar, .bar { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar { height: 10px; }
.bar-goal { height: 8px; }
.mini-bar > span, .bar > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.8s ease; }
.bar-goal > span { background: linear-gradient(90deg, var(--gold), #f08a3a); }

.medal {
  width: 92px; height: 92px; display: grid; place-items: center; margin: 0 auto;
  background: linear-gradient(160deg, #ffd56a, #e9a21b); color: #5b3a00;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  font-family: var(--font-display); font-weight: 800; font-size: 2.2rem;
}
.medal-sm { width: 52px; height: 52px; font-size: 1.3rem; margin: 0; }
.medal-xs { width: 38px; height: 38px; font-size: 1rem; margin: 0; flex: none; }
.medal-thanks { background: linear-gradient(160deg, #ff9b84, var(--accent)); color: #fff; }
.medal-thanks .icon { width: 40px; height: 40px; }

.map-tools {
  position: absolute; z-index: 3; right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.tool {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; text-decoration: none;
}
.tool-wide { width: auto; padding: 0 14px; display: inline-flex; gap: 6px; font-weight: 600; font-size: 0.85rem; }
.demo-note {
  position: absolute; z-index: 2; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
  font-size: 0.72rem; color: var(--muted); background: var(--surface); padding: 4px 10px; border-radius: 999px; opacity: 0.9;
  max-width: calc(100% - 90px);
}

.list-view {
  position: absolute; z-index: 2; left: 0; right: 0; top: 0; bottom: 0; overflow-y: auto; background: var(--bg);
  padding-top: 150px; padding-bottom: calc(var(--tabbar-h) + 90px + env(safe-area-inset-bottom, 0px));
}
.list-inner {
  max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.list-inner section { display: flex; flex-direction: column; gap: 8px; }
.list-inner ul { display: flex; flex-direction: column; gap: 6px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.list-item > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-item small { color: var(--muted); }
.list-item .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--q); flex: none; }
.seen-mark { font-size: 0.75rem; color: var(--good); font-weight: 600; }

/* ---------- Нижнее меню ---------- */
.tabbar {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar-h);
  text-decoration: none; color: var(--muted); font-size: 0.72rem; font-weight: 600;
}
.tabbar a.active { color: var(--primary); }
.tab-donate { position: relative; }
.tab-donate-btn {
  width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(223, 82, 54, 0.4); border: 4px solid var(--surface);
}
.tab-donate-btn .icon { width: 24px; height: 24px; }
.tabbar a.tab-donate.active { color: var(--accent); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 0.92rem; cursor: pointer; text-decoration: none;
}
.btn-sm { min-height: 44px; padding: 0 12px; font-size: 0.82rem; }
.btn-lg { min-height: 54px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:hover { filter: brightness(1.06); }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 0; background: var(--surface-2);
  color: var(--ink); cursor: pointer; text-decoration: none; flex: none;
}
.chip { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.chip-example { background: var(--gold-soft); color: var(--gold-ink); align-self: flex-start; }

/* ---------- Карточка партнёра ---------- */
.sheet { position: absolute; inset: 0; z-index: 8; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 24, 0.45); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 88%; overflow-y: auto;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 16px; animation: sheet-in 0.28s ease-out;
}
.sheet-panel:focus { outline: none; }
#sheet-body { display: flex; flex-direction: column; gap: 16px; }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); align-self: center; }
.sheet-close { position: absolute; top: 12px; right: 12px; }
.sheet-head { display: flex; align-items: flex-end; gap: 14px; padding-right: 48px; }
.mini-house { width: 96px; height: 96px; flex: none; }
.sheet-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sheet-section { display: flex; flex-direction: column; gap: 8px; }
.gifts { display: flex; flex-direction: column; gap: 8px; }
.gift {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.gift-title { flex: 1 1 180px; font-weight: 600; }
.gift.is-locked .gift-title { color: var(--muted); }
.locked { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.locked .icon { width: 16px; height: 16px; }
.address { flex-direction: row; align-items: center; gap: 8px; color: var(--muted); }
.map-link { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
.sub-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.sub-amounts .btn { flex: 1 1 auto; }

/* ---------- Экраны ---------- */
.screen {
  position: absolute; inset: 0; z-index: 5; overflow-y: auto; background: var(--bg);
  padding-top: 12px; padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.screen > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.screen > * + * { margin-top: 14px; }
.screen-head { display: flex; align-items: center; gap: 12px; }
.card, .goal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.goal-top { display: flex; justify-content: space-between; align-items: baseline; }
.goal-pct { font-family: var(--font-display); font-weight: 700; color: var(--gold-ink); }
.goal-card .bar > span { background: linear-gradient(90deg, var(--gold), #f08a3a); }

.donate-form { display: flex; flex-direction: column; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding: 0; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.segmented label, .amount, .method { position: relative; }
.segmented input, .amount input[type="radio"], .method input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; min-height: 44px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.segmented input:focus-visible + span, .amount input:focus-visible + span, .method input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.amounts legend { grid-column: 1 / -1; }
.amount > span {
  display: grid; place-items: center; min-height: 52px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); font-weight: 700; font-variant-numeric: tabular-nums;
}
.amount input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.amount-custom input {
  width: 100%; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); text-align: center; font: 700 1rem var(--font-body); padding: 0 6px;
}
.amount-custom input:focus { border-color: var(--accent); outline: none; }
.preview { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.unlocks { display: flex; flex-direction: column; gap: 8px; }
.unlocks li { display: flex; align-items: flex-start; gap: 10px; }
.unlocks .icon { width: 18px; height: 18px; color: var(--primary); margin-top: 1px; }
.unlocks li.good { color: var(--good); font-weight: 500; }
.unlocks li.good .icon { color: var(--good); }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.methods legend { grid-column: 1 / -1; }
.method > span {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
}
.method small { color: var(--muted); font-size: 0.78rem; }
.method input:checked + span { border-color: var(--primary); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; cursor: pointer; }
.agree input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); margin: 0; }

/* Профиль */
.rank-top { display: flex; align-items: center; gap: 12px; }
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ladder li {
  font-size: 0.68rem; font-weight: 600; line-height: 1.2; padding: 7px 5px; border-radius: 8px; text-align: center;
  background: var(--surface-2); color: var(--muted); overflow-wrap: anywhere;
}
.ladder li.passed { background: var(--primary-soft); color: var(--primary); }
.ladder li.current { background: var(--primary); color: var(--primary-ink); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.stat b { font-family: var(--font-display); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.75rem; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: var(--radius-sm); border: 1px dashed var(--line); color: var(--muted); }
.badge-mark {
  width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  background: var(--surface-2); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}
.badge-name { font-weight: 600; font-size: 0.85rem; }
.badge-hint { font-size: 0.73rem; }
.badge.earned { border-style: solid; border-color: transparent; background: var(--gold-soft); color: var(--gold-ink); }
.badge.earned .badge-mark { background: var(--gold); color: #4a3000; }
.coupons { display: flex; flex-direction: column; gap: 8px; }
.coupon {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2);
}
.coupon-qr { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.coupon-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.coupon-text small { color: var(--muted); }
.coupon-open { font-size: 0.78rem; font-weight: 600; color: var(--primary); white-space: nowrap; }
.history li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.history li:first-child { border-top: 0; }
.history b { font-variant-numeric: tabular-nums; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.warn { color: var(--danger); font-weight: 500; }

/* ---------- Окна поверх ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(10, 14, 24, 0.6);
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
}
.overlay-card {
  position: relative; width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto; background: var(--surface);
  border-radius: 24px; padding: 28px 22px 22px; box-shadow: var(--shadow); animation: pop-in 0.35s ease-out;
}
.success, .processing, .coupon-modal { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.success .medal { animation: medal-in 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) both; margin-bottom: 6px; }
.success h2 { font-size: 1.6rem; }
.success-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.success-stats span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); font-weight: 600; font-size: 0.85rem;
}
.success-stats .icon { width: 16px; height: 16px; color: var(--accent); }
.success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 8px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.confetti i {
  position: absolute; top: -12px; left: calc(var(--i) * 5.5% + 2%); width: 8px; height: 12px; border-radius: 2px;
  background: hsl(calc(var(--i) * 47), 85%, 60%); animation: fall 1.8s ease-in calc(var(--i) * 0.05s) both; opacity: 0;
}
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.qr { width: 216px; height: 216px; display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 16px; color: #333; }
.qr img, .qr canvas { display: block; max-width: 100%; }
.code { font: 700 1.05rem var(--font-body); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }

.toast {
  position: absolute; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  width: max-content; max-width: min(calc(100% - 32px), 460px); background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: 14px; font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow);
}

@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes medal-in { from { transform: scale(0.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(420px) rotate(540deg); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
  .amounts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .amount-custom { grid-column: 1 / -1; }
  .ladder li { font-size: 0.6rem; padding: 6px 3px; }
  .stat b { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- Персонаж ---------- */
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.hud-avatar { width: 34px; height: 46px; flex: none; margin: -4px 0; }
.hud-rank-text small { font-size: 0.68rem; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.hud-invite {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 0.86rem;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow);
}
.walker { cursor: pointer; }
.w-glow { opacity: 0.35; animation: glow-pulse 1.6s ease-in-out infinite; }
.w-sparkles rect { animation: twinkle 1.2s ease-in-out infinite; }
.w-sparkles rect:nth-child(2) { animation-delay: 0.4s; }
.w-sparkles rect:nth-child(3) { animation-delay: 0.8s; }
.w-tag-text { font: 700 8px var(--font-body); }

.ward-intro { background: var(--gold-soft); color: var(--gold-ink); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.ward-stage {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 0;
  background: radial-gradient(circle at 50% 70%, var(--primary-soft), transparent 70%);
}
.ward-preview { width: 144px; height: 198px; }
.icon-btn.flip .icon { transform: rotate(180deg); }
.ward-level { text-align: center; font-size: 0.88rem; color: var(--muted); }
.ward-level b { color: var(--ink); }
.ward-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.ward-tab { border: 0; background: transparent; border-radius: 10px; min-height: 44px; font-weight: 600; font-size: 0.8rem; color: var(--muted); cursor: pointer; padding: 0 4px; }
.ward-tab.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ward-body { display: flex; flex-direction: column; gap: 14px; }
.ward-group { display: flex; flex-direction: column; gap: 8px; }
.ward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.ward-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; min-height: 120px; cursor: pointer;
  border-radius: 12px; border: 2px solid var(--line); background: var(--surface); text-align: center;
}
.ward-cell.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.ward-cell.locked { opacity: 0.55; }
.ward-cell.locked .ward-thumb { filter: grayscale(1); }
.ward-cell.r-rare { border-color: #5b8def; }
.ward-cell.r-epic { border-color: #9a5bd6; }
.ward-cell.r-legendary { border-color: #e0a526; background: linear-gradient(180deg, var(--gold-soft), var(--surface)); }
.ward-cell.on.r-rare, .ward-cell.on.r-epic, .ward-cell.on.r-legendary { border-color: var(--accent); }
.ward-thumb { width: 48px; height: 66px; }
.ward-name { font-size: 0.72rem; font-weight: 600; line-height: 1.2; }
.ward-meta { font-size: 0.66rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.ward-meta .icon { width: 12px; height: 12px; }
.ward-none { width: 48px; height: 66px; display: grid; place-items: center; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--accent); }
.ward-actions { position: sticky; bottom: 0; padding: 10px 0 4px; background: linear-gradient(transparent, var(--bg) 30%); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.field input { min-height: 46px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 600 1rem var(--font-body); padding: 0 12px; }
.field input:focus { border-color: var(--primary); outline: none; }

.level-top { display: flex; align-items: center; gap: 14px; }
.profile-avatar { width: 72px; height: 99px; flex: none; }
.level-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.lvl-grid { display: flex; flex-direction: column; gap: 4px; }
.lvl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; }
.lvl-row.mine { background: var(--primary-soft); }
.lvl-rank { font-size: 0.82rem; font-weight: 600; }
.lvl-steps { display: flex; gap: 4px; }
.lvl-steps li {
  width: 34px; height: 26px; display: grid; place-items: center; border-radius: 6px; font-size: 0.7rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.lvl-steps li.passed { background: var(--primary-soft); color: var(--primary); }
.lvl-steps li.current { background: var(--primary); color: var(--primary-ink); }
.success-avatar { width: 120px; height: 165px; animation: medal-in 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip-item { font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); }

@keyframes glow-pulse { 50% { opacity: 0.15; } }
@keyframes twinkle { 50% { opacity: 0.1; } }

.ward-meta.price { color: var(--gold-ink); font-weight: 700; }
.ward-meta .coin { width: 12px; height: 12px; }
.ward-rarity { font-size: 0.6rem; color: var(--muted); }
.ward-level .coin { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.ward-balance { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.ward-balance.short { color: var(--danger); }

/* Онбординг (экран 5 по ТЗ): поверх всего, пока житель не вошёл или не выбрал «посмотреть город». */
.onboarding {
  position: absolute; inset: 0; z-index: 20; overflow-y: auto; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.ob-panel { max-width: 440px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; animation: pop-in 0.35s ease-out; }
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.ob-top .icon-btn + .ob-brand { margin-right: auto; }
.ob-brand { font: 700 0.85rem var(--font-display); color: var(--primary); }
.ob-art { display: grid; place-items: center; min-height: 210px; padding: 12px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.ob-art-svg { width: 100%; max-width: 320px; height: auto; }
.ob-title { font: 700 1.45rem/1.2 var(--font-display); margin: 4px 0 0; text-wrap: balance; }
.ob-text { margin: 0; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.ob-dots { display: flex; justify-content: center; gap: 2px; margin-top: auto; }
.ob-dot { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.ob-dot::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: width 0.2s, background 0.2s; }
.ob-dot.on::after { width: 22px; background: var(--primary); }
.ob-goal, .ob-perks { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.ob-perks { align-items: center; }
.ob-goal-title { margin: 0; font-weight: 700; }
.ob-goal .bar > span { background: linear-gradient(90deg, var(--gold), #f08a3a); }
.ob-goal-nums { margin: 0; font-size: 0.85rem; color: var(--muted); }
.ob-uses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.ob-uses li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.ob-uses .icon { flex: none; color: var(--good); }
.ob-avatar { image-rendering: pixelated; }
.ob-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.ob-legal { text-align: center; margin: 0; }
.ob-form { display: flex; flex-direction: column; gap: 14px; }
.btn-tg { background: #2aabee; color: #fff; }
.btn-tg:disabled { opacity: 0.85; cursor: progress; }
.spinner-sm { width: 18px; height: 18px; border-width: 3px; border-top-color: #fff; }
.phone-input { display: flex; align-items: stretch; gap: 8px; }
.phone-prefix { display: grid; place-items: center; padding: 0 12px; border-radius: 12px; background: var(--surface-2); font-weight: 700; }
.phone-input input { flex: 1; min-width: 0; }
.code-input { letter-spacing: 0.5em; text-align: center; font-size: 1.4rem !important; }
.field > .phone-input { font-size: 1rem; color: var(--ink); font-weight: 600; }

/* Экран 6 «Институт» */
.goal-list, .reports, .events, .report-items, .split-legend { list-style: none; margin: 0; padding: 0; }
.goal-list { display: flex; flex-direction: column; gap: 12px; }
.goal-row { display: flex; gap: 10px; align-items: flex-start; }
.goal-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.goal-row small { color: var(--muted); font-size: 0.8rem; }
.goal-row.done .icon { color: var(--good); flex: none; margin-top: 2px; }
.goal-row.next { opacity: 0.75; }
.goal-row.next .icon { color: var(--muted); flex: none; margin-top: 2px; width: 18px; height: 18px; }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 4px 0 10px; }
.split-bar > span { display: block; height: 100%; }
.split-legend { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.split-legend li { display: flex; align-items: center; gap: 8px; }
.split-legend b { margin-left: auto; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.reports { display: flex; flex-direction: column; gap: 8px; }
.report { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.report-head {
  width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.report-head > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.report-head small { color: var(--muted); font-size: 0.8rem; }
.chev { font-size: 1.3rem; color: var(--primary); width: 24px; text-align: center; }
.report.open { background: var(--surface-2); }
.report-items { padding: 0 14px; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.report-items li { display: flex; justify-content: space-between; gap: 12px; }
.report-items b { white-space: nowrap; }
.report > .muted { padding: 8px 14px 12px; margin: 0; }
.events { display: flex; flex-direction: column; gap: 12px; }
.event { display: flex; gap: 12px; align-items: flex-start; }
.event.is-locked .event-body > b { color: var(--muted); }
.event-date {
  flex: none; width: 52px; padding: 6px 0; border-radius: 12px; background: var(--primary-soft); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
}
.event-date b { font: 700 1.3rem/1.1 var(--font-display); }
.event-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.event-body small { color: var(--muted); font-size: 0.8rem; }

/* Экран 7 «Рейтинг и стена славы» */
.rate-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ward-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(22, 31, 49, 0.12); }
.rate-list { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rate-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; min-height: 56px; }
.rate-row.me { background: var(--primary-soft); }
.rate-place { width: 26px; flex: none; text-align: center; font-weight: 700; color: var(--muted); }
.rate-place.top1, .rate-place.top2, .rate-place.top3 { height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; }
.rate-place.top1 { background: var(--gold); color: #3d2a00; }
.rate-place.top2 { background: #cfd6e2; color: #2d3648; }
.rate-place.top3 { background: #e7b48a; color: #4a2508; }
.rate-avatar { width: 36px; height: 49.5px; flex: none; image-rendering: pixelated; }
.rate-house { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--q); color: #fff; font-weight: 700; }
.rate-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.rate-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate-name small { color: var(--muted); font-size: 0.78rem; }
.rate-sum { white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.rate-sum small { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0 2px; border-top: 1px solid var(--line); cursor: pointer; min-height: 44px; }
.switch-row input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--muted); font-size: 0.8rem; }
.wall { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plate {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-soft), var(--surface)); border: 1px solid var(--gold); color: var(--gold-ink);
}
.plate b { font: 700 1rem var(--font-display); color: var(--ink); }
.plate small { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.plate span { font-size: 0.88rem; color: var(--muted); }
.tabbar a span { white-space: nowrap; }
.ml-home { background: var(--gold); color: #3d2a00; font-weight: 700; }
.home-card h3 { display: flex; align-items: center; gap: 8px; }
.home-card.is-locked h3 .icon { width: 18px; height: 18px; color: var(--muted); }
.danger-link { color: var(--danger); }
.danger-card { border: 1px solid var(--danger); }
.wall-title { margin: 14px 0 2px; }
.wall-title:first-child { margin-top: 0; }
.wall-names { list-style: none; margin: 8px 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wall-names li { padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-size: 0.85rem; font-weight: 600; }
.wall-names li.me { background: var(--primary); color: var(--primary-ink); }

/* Экран 8 «Кабинет партнёра» */
.demo-switch select { min-height: 46px; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface); color: var(--ink); font: 600 1rem var(--font-body); padding: 0 10px; }
.cab-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; scrollbar-width: none; }
.cab-tab { flex: 1 0 auto; min-height: 44px; padding: 0 9px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 600 0.78rem var(--font-body); cursor: pointer; }
.cab-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(22, 31, 49, 0.12); }
.cab-form { display: flex; flex-direction: column; gap: 14px; }
.cab-form textarea, .cab-form select { border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 500 1rem var(--font-body); padding: 10px 12px; }
.cab-form select { min-height: 46px; padding: 0 10px; }
.cab-form textarea:focus, .cab-form select:focus { border-color: var(--primary); outline: none; }
.cab-form input[type="range"] { accent-color: var(--primary); min-height: 44px; }
.cab-preview { display: grid; place-items: center; background: var(--surface-2); border-radius: 16px; padding: 10px; }
.cab-preview .mini-house { width: 160px; height: 160px; }
.style-opts { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.style-opts legend { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; padding: 0; }
.style-opt input { position: absolute; opacity: 0; }
.style-opt span { display: grid; place-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); font-weight: 600; cursor: pointer; }
.style-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.style-opt input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.style-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.cab-gifts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cab-gift { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.cab-gift.off { background: var(--surface-2); }
.cab-gift-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.cab-gift-row select, .cab-gift-row input { width: 100%; min-width: 0; }
.cab-gift-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.scanner { display: flex; flex-direction: column; gap: 10px; }
.scan-view { position: relative; aspect-ratio: 1 / 1; max-height: 320px; border-radius: 16px; overflow: hidden; background: #111827; display: grid; place-items: center; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; }
.scan-idle { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #c9d1e0; text-align: center; padding: 20px; font-size: 0.9rem; }
.scan-idle .icon { width: 40px; height: 40px; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.scan-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin: 12px 0; }
.scan-status span { display: flex; flex-direction: column; gap: 2px; }
.scan-status small { font-size: 0.82rem; }
.scan-status.ok { background: color-mix(in srgb, var(--good) 15%, var(--surface)); color: var(--good); }
.scan-status.error { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); color: var(--danger); }
.scan-status.info { background: var(--primary-soft); color: var(--primary); }
.scan-status .icon { flex: none; margin-top: 2px; }
.code-form { margin-top: 12px; }
.code-form input { text-transform: uppercase; letter-spacing: 0.08em; }
.demo-codes { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.demo-codes li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.demo-codes code { font-weight: 700; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat-tiles .stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-tiles .stat b { font: 700 1.3rem var(--font-display); }
.stat-tiles .stat span { font-size: 0.78rem; color: var(--muted); }
.sbars { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 140px; align-items: end; }
.sbars li { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.sbar { width: 100%; max-width: 32px; background: var(--primary); border-radius: 6px 6px 2px 2px; position: relative; min-height: 4px; }
.sbar b { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 0.7rem; color: var(--muted); }
.sbars small { font-size: 0.7rem; color: var(--muted); }
.gift-stats { padding: 0; }
.tariffs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tariff { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tariff.mine { border: 2px solid var(--primary); background: var(--primary-soft); }
.tariff-head { display: flex; flex-direction: column; gap: 2px; }
.tariff-head span { font-size: 0.85rem; color: var(--muted); }
.tariff-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.tariff-perks li { display: flex; gap: 6px; align-items: flex-start; }
.tariff-perks .icon { width: 16px; height: 16px; color: var(--good); flex: none; margin-top: 2px; }
.chip-wait { background: var(--gold-soft); color: var(--gold-ink); }
.tariff .chip:not(.chip-wait) { background: var(--primary); color: var(--primary-ink); }

/* Админка */
.hud-season { display: block; margin-top: 6px; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-align: left; }
.demo-roles .btn { flex: 1 1 0; }
.adm-apps, .adm-qs, .adm-seasons, .pay-list, .adm-gifts { list-style: none; margin: 8px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.adm-app { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.adm-app p { margin: 0; }
.adm-app.rejected { opacity: 0.7; }
.adm-app-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.adm-gifts { margin: 0; gap: 2px; font-size: 0.85rem; }
.adm-gifts li::before { content: "• "; color: var(--muted); }
.chip-new { background: var(--gold-soft); color: var(--gold-ink); }
.chip-approved { background: color-mix(in srgb, var(--good) 18%, var(--surface)); color: var(--good); }
.chip-rejected { background: var(--surface-2); color: var(--muted); }
.warn.small, p.warn { color: var(--danger); }
.adm-q { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding-left: 10px; border-left: 4px solid var(--q); }
.adm-q .field { flex: 1 1 200px; }
.adm-season { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.adm-season span:first-child { display: flex; flex-direction: column; gap: 2px; }
.adm-season small { color: var(--muted); font-size: 0.78rem; }
.adm-season.active { border-color: var(--good); }
.adm-goal-state { margin: 14px 0 10px; }
.card .btn-block + .btn-block { margin-top: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pay-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.pay-list li span { display: flex; flex-direction: column; }
.pay-list small { color: var(--muted); font-size: 0.75rem; }
.pay-list .refund { color: var(--danger); }
.exports { display: flex; flex-direction: column; gap: 8px; }
.invite-link { width: 100%; min-height: 44px; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface-2); color: var(--ink); font: 600 0.85rem var(--font-body); padding: 0 10px; }
.tg-widget { display: flex; justify-content: center; min-height: 48px; }
