/* Демо Mini App «Бот-ателье» — палитра и шрифт как на лендинге (тёмный фон, бирюзовые акценты, Manrope). */
@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #0b0f14;
  --bg2: #0f151c;
  --text: #e6edf3;
  --text-2: #c5d0db;
  --muted: #94a3b8;
  --faint: #64748b;
  --glass: rgba(17, 25, 33, .62);
  --glass-2: rgba(26, 36, 46, .7);
  --glass-hi: rgba(255, 255, 255, .055);
  --stroke: rgba(255, 255, 255, .08);
  --stroke-2: rgba(255, 255, 255, .14);
  --shadow: 0 20px 44px -26px rgba(0, 0, 0, .85);
  --chip: rgba(255, 255, 255, .06);
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
  --tint-rgb: 234, 88, 12;
  --r: 20px;
  --r-sm: 14px;
  --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-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));
  color-scheme: dark;
}
html[data-preset="clinic"] { --accent: #14b8a6; --accent-2: #5eead4; --accent-ink: #04201d; --accent-rgb: 20, 184, 166; }
html[data-preset="salon"]  { --accent: #fb7185; --accent-2: #fda4af; --accent-ink: #2a0911; --accent-rgb: 251, 113, 133; }

html[data-theme="light"] {
  --bg: #eef2f5;
  --bg2: #e6ecf0;
  --text: #0f1720;
  --text-2: #334155;
  --muted: #5b6876;
  --faint: #8a97a5;
  --glass: rgba(255, 255, 255, .7);
  --glass-2: rgba(255, 255, 255, .86);
  --glass-hi: rgba(255, 255, 255, .6);
  --stroke: rgba(15, 23, 42, .07);
  --stroke-2: rgba(15, 23, 42, .12);
  --shadow: 0 18px 40px -28px rgba(15, 23, 42, .45);
  --chip: rgba(15, 23, 42, .05);
  --danger: #dc2626;
  --ok: #059669;
  color-scheme: light;
}
html[data-theme="light"][data-preset="clinic"] { --accent: #0d9488; --accent-2: #0f766e; --accent-ink: #ffffff; }
html[data-theme="light"][data-preset="salon"]  { --accent: #e11d48; --accent-2: #be123c; --accent-ink: #ffffff; }

html[data-season="autumn"] { --tint-rgb: 234, 88, 12; }
html[data-season="winter"] { --tint-rgb: 96, 165, 250; }
html[data-season="spring"] { --tint-rgb: 244, 114, 182; }
html[data-season="summer"] { --tint-rgb: 250, 204, 21; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  transition: background-color .3s ease, color .3s ease;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p { margin: 0; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ---------- Фон: статичный (дёшево для backdrop-filter) ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(var(--tint-rgb), .26), transparent 62%),
    radial-gradient(90% 50% at 110% 105%, rgba(var(--accent-rgb), .2), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg) 60%);
  transition: background .4s ease; }
.blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; }
.b1 { width: 260px; height: 260px; left: -80px; top: 120px; background: rgba(var(--accent-rgb), .22); }
.b2 { width: 220px; height: 220px; right: -70px; top: 360px; background: rgba(var(--tint-rgb), .2); }
.b3 { width: 300px; height: 200px; left: 20%; bottom: -60px; background: rgba(var(--accent-rgb), .14); }
html[data-theme="light"] .blob { opacity: .45; }

/* ---------- Сезонные слои ---------- */
.fx { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; }
.fx--back { z-index: 1; }
.fx--front { z-index: 45; opacity: .92; }
html[data-theme="light"] .fx--back { opacity: .85; }

/* ---------- Каркас ---------- */
.app { position: relative; z-index: 2; max-width: 480px; margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 108px); }
html.in-tg .app { padding-top: calc(var(--safe-top) + 8px); }
.view:focus { outline: none; }

/* ---------- Шапка ---------- */
.top { display: flex; align-items: center; gap: 10px; height: 52px; margin-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand__mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px rgba(var(--accent-rgb), .8); }
.brand__mark svg.i { width: 22px; height: 22px; stroke-width: 2.6; }
.brand__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand__txt b { font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__txt small { color: var(--muted); font-size: 12px; font-weight: 600; }
.iconbtn { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--glass); border: 1px solid var(--stroke); color: var(--text-2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .15s, color .2s; }
.iconbtn:active { transform: scale(.94); }
.iconbtn.is-on { color: var(--accent); }
.iconbtn.is-off { opacity: .55; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent-2), var(--accent)); border: 2px solid rgba(255, 255, 255, .14); }

/* ---------- Карточки (стекло) ---------- */
.glass { background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
.card { padding: 16px; margin-bottom: 12px; }
.section-t { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 4px 10px; font-size: 13px;
  font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.section-t a, .section-t button { text-transform: none; letter-spacing: 0; color: var(--accent); font-weight: 700; font-size: 13px; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 14px; font-weight: 700; font-size: 15px; line-height: 1.2; transition: transform .15s ease, background .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 28px -14px rgba(var(--accent-rgb), .9); }
.btn--ghost { background: var(--chip); border: 1px solid var(--stroke); color: var(--text); }
.btn--danger { color: var(--danger); }
.btn--icon { width: 44px; padding: 0; }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; border-radius: 16px; font-size: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg.i { width: 18px; height: 18px; }

/* ---------- Приветствие ---------- */
.hello { margin: 4px 4px 14px; }
.hello__date { color: var(--muted); font-size: 13px; font-weight: 700; }
.hello h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 2px; }
.hello p.sub { color: var(--text-2); font-size: 14px; }

/* Переключатель пресета / сегменты */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 13px; background: var(--chip); border: 1px solid var(--stroke); }
.seg button { flex: 1; min-height: 34px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--muted);
  white-space: nowrap; transition: background .2s, color .2s; }
.seg button.is-active { background: var(--glass-2); color: var(--text); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .5); }
html[data-theme="light"] .seg button.is-active { background: #fff; }
.demo-switch { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; }
.demo-switch span { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.demo-switch .seg { flex: 1; }

/* ---------- Ближайшая запись ---------- */
.next { position: relative; overflow: hidden; }
.next::before { content: ""; position: absolute; inset: 0 0 auto auto; width: 180px; height: 180px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .22), transparent); transform: translate(40px, -60px); }
.next__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.next__label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800;
  background: rgba(var(--accent-rgb), .14); color: var(--accent-2); border: 1px solid rgba(var(--accent-rgb), .3); white-space: nowrap; }
html[data-theme="light"] .pill { color: var(--accent-2); }
.pill--muted { background: var(--chip); color: var(--muted); border-color: var(--stroke); }
.pill--ok { background: rgba(52, 211, 153, .12); color: var(--ok); border-color: rgba(52, 211, 153, .28); }
.pill--bad { background: rgba(248, 113, 113, .1); color: var(--danger); border-color: rgba(248, 113, 113, .26); }
.next__title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.next__who { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.when { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; }
.datebox { width: 54px; height: 58px; border-radius: 14px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .28); line-height: 1; }
.datebox b { font-size: 22px; font-weight: 800; color: var(--accent-2); }
.datebox span { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); margin-top: 4px; letter-spacing: .04em; }
.when__txt b { display: block; font-size: 16px; font-weight: 800; }
.when__txt span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.meta { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); margin: 6px 0; }
.meta svg.i { width: 17px; height: 17px; color: var(--muted); margin-top: 1px; }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.actions .btn { flex: 1; padding: 10px 10px; font-size: 14px; }
.actions .btn--icon { flex: none; }
.empty { text-align: center; padding: 22px 16px; }
.empty b { display: block; font-size: 17px; margin: 8px 0 4px; }
.empty p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

/* CTA */
.cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 60%); color: var(--accent-ink); box-shadow: 0 18px 36px -18px rgba(var(--accent-rgb), .9); margin-bottom: 12px;
  transition: transform .15s; }
.cta:active { transform: scale(.98); }
.cta__ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(0, 0, 0, .12); flex: none; }
html[data-theme="light"] .cta__ico { background: rgba(255, 255, 255, .18); }
.cta__ico svg.i { width: 22px; height: 22px; stroke-width: 2.2; }
.cta b { display: block; font-size: 17px; font-weight: 800; }
.cta small { display: block; font-size: 13px; font-weight: 600; opacity: .78; }
.cta > svg.i:last-child { margin-left: auto; }

/* Плитки */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; min-height: 96px; text-align: left; transition: transform .15s; }
.tile:active { transform: scale(.97); }
.tile__ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .13); color: var(--accent); }
.tile__ico svg.i { width: 19px; height: 19px; }
.tile b { font-size: 15px; font-weight: 800; line-height: 1.15; }
.tile span { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.2; }

/* Промо */
.promo { display: flex; gap: 12px; align-items: center; position: relative; overflow: hidden; }
.promo::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--tint-rgb), .28), transparent); pointer-events: none; }
.promo__ico { width: 46px; height: 46px; border-radius: 15px; flex: none; display: grid; place-items: center;
  background: rgba(var(--tint-rgb), .16); color: rgb(var(--tint-rgb)); }
.promo__ico svg.i { width: 24px; height: 24px; }
.promo__txt { flex: 1; min-width: 0; }
.promo__txt small { font-size: 11px; font-weight: 800; color: rgb(var(--tint-rgb)); text-transform: uppercase; letter-spacing: .06em; }
html[data-theme="light"] .promo__txt small { filter: brightness(.8); }
.promo__txt b { display: block; font-size: 15px; font-weight: 800; }
.promo__txt span { display: block; font-size: 13px; color: var(--text-2); }
.promo .btn { min-height: 38px; padding: 8px 12px; font-size: 13px; position: relative; z-index: 1; }

/* Прогресс уровня */
.level { display: flex; align-items: center; gap: 12px; }
.level__ring { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--chip) 0); }
.level__ring i { width: 42px; height: 42px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; font-style: normal; color: var(--accent); }
.level__txt { flex: 1; min-width: 0; }
.level__txt b { font-size: 16px; font-weight: 800; }
.level__txt span { display: block; font-size: 13px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--chip); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.foot { text-align: center; color: var(--faint); font-size: 12px; margin: 22px 0 4px; line-height: 1.6; }
.foot b { color: var(--muted); }
.foot svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- Запись ---------- */
.bk-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.bk-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.bk-head p { font-size: 13px; color: var(--muted); font-weight: 600; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; }
.stepper li { font-size: 11px; font-weight: 800; color: var(--faint); text-align: center; }
.stepper li::before { content: ""; display: block; height: 4px; border-radius: 99px; background: var(--chip); margin-bottom: 6px; transition: background .25s; }
.stepper li.is-done::before, .stepper li.is-active::before { background: var(--accent); }
.stepper li.is-active { color: var(--text); }
.stepper li.is-done { color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--glass); border: 1px solid var(--stroke); color: var(--text-2); }
.chip.is-active { background: rgba(var(--accent-rgb), .16); border-color: rgba(var(--accent-rgb), .45); color: var(--accent-2); }
.list { padding: 4px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: 16px; transition: background .2s; }
.row + .row { border-top: 1px solid var(--stroke); border-radius: 0; }
.row:active { background: var(--chip); }
.row.is-selected { background: rgba(var(--accent-rgb), .1); border-radius: 16px; }
.row__ico { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.row__txt { flex: 1; min-width: 0; }
.row__txt b { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; }
.row__txt span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row__end { text-align: right; font-weight: 800; font-size: 14px; white-space: nowrap; }
.row__end small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--stroke-2); flex: none; display: grid; place-items: center; }
.is-selected .radio { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.radio svg.i { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.is-selected .radio svg.i { opacity: 1; }
.picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.picked b { font-weight: 800; }
.picked .muted { margin-left: auto; }
.picked button { color: var(--accent); font-weight: 700; font-size: 13px; margin-left: auto; }

/* Календарь */
.cal { padding: 14px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal__head b { font-size: 16px; font-weight: 800; }
.cal__head .iconbtn { width: 34px; height: 34px; border-radius: 11px; }
.cal__head .iconbtn[disabled] { opacity: .3; pointer-events: none; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal__wd { font-size: 11px; font-weight: 800; color: var(--faint); text-transform: uppercase; padding: 4px 0; }
.day { position: relative; aspect-ratio: 1; border-radius: 12px; font-weight: 700; font-size: 15px; display: grid; place-items: center; color: var(--text); transition: background .15s, transform .15s; }
.day:active { transform: scale(.92); }
.day[disabled] { color: var(--faint); opacity: .45; pointer-events: none; }
.day.is-full { text-decoration: line-through; }
.day.is-few::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--warn); }
.day.is-today { box-shadow: inset 0 0 0 1.5px var(--stroke-2); }
.day.is-selected { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px rgba(var(--accent-rgb), .9); }
.day.is-selected::after { background: var(--accent-ink); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; padding: 0 2px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Время */
.slots__t { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 4px 2px 8px; display: flex; gap: 6px; align-items: center; }
.slots__t svg.i { width: 15px; height: 15px; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.slot { min-height: 44px; border-radius: 13px; font-weight: 800; font-size: 15px; background: var(--glass); border: 1px solid var(--stroke); transition: transform .15s, background .2s; }
.slot:active { transform: scale(.95); }
.slot[disabled] { color: var(--faint); text-decoration: line-through; opacity: .5; pointer-events: none; }
.slot.is-selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 10px 22px -12px rgba(var(--accent-rgb), .9); }

/* Подтверждение */
.sum { padding: 6px 16px; }
.sum__row { display: flex; gap: 12px; align-items: center; padding: 11px 0; }
.sum__row + .sum__row { border-top: 1px solid var(--stroke); }
.sum__row svg.i { color: var(--muted); width: 19px; height: 19px; }
.sum__row span { color: var(--muted); font-size: 13px; flex: none; width: 92px; }
.sum__row b { flex: 1; text-align: right; font-size: 14.5px; font-weight: 700; }
.total { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px; }
.total span { color: var(--muted); font-weight: 700; }
.total b { font-size: 22px; font-weight: 800; }
.total s { color: var(--faint); font-size: 14px; margin-right: 8px; font-weight: 600; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.switch-row__txt { flex: 1; min-width: 0; }
.switch-row__txt b { display: block; font-size: 15px; font-weight: 700; }
.switch-row__txt span { display: block; font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--stroke-2); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: .45; }
textarea.field { width: 100%; min-height: 76px; resize: none; padding: 12px 14px; border-radius: 14px; background: var(--chip); border: 1px solid var(--stroke); outline: none; font-size: 14px; }
textarea.field:focus { border-color: rgba(var(--accent-rgb), .6); }
.notes { list-style: none; padding: 0; margin: 4px 4px 0; font-size: 13px; color: var(--muted); }
.notes li { display: flex; gap: 8px; margin: 8px 0; }
.notes svg.i { width: 17px; height: 17px; color: var(--accent); }

/* Успех */
.done { text-align: center; padding: 26px 18px 18px; }
.done__ico { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 10px rgba(var(--accent-rgb), .14), 0 20px 40px -14px rgba(var(--accent-rgb), .9); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.done__ico svg.i { width: 40px; height: 40px; stroke-width: 2.6; }
.done__ico path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .25s ease forwards; }
.done h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.done p { color: var(--text-2); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Бонусы ---------- */
.balance { position: relative; overflow: hidden; padding: 18px; border-radius: 24px; color: var(--accent-ink); margin-bottom: 12px;
  background: linear-gradient(140deg, var(--accent-2), var(--accent) 55%);
  box-shadow: 0 24px 44px -22px rgba(var(--accent-rgb), .95); }
html[data-theme="light"] .balance { background: linear-gradient(140deg, var(--accent), var(--accent-2)); }
.balance::before { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -90px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.balance::after { content: ""; position: absolute; width: 140px; height: 140px; right: 40px; bottom: -80px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.balance > * { position: relative; z-index: 1; }
.balance__top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 13px; opacity: .85; }
.balance__lvl { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, .14); font-size: 12px; }
html[data-theme="light"] .balance__lvl { background: rgba(255, 255, 255, .2); }
.balance__lvl svg.i { width: 15px; height: 15px; }
.balance__sum { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 0; line-height: 1.1; }
.balance__sum small { font-size: 16px; font-weight: 700; opacity: .8; margin-left: 6px; }
.balance__sub { font-size: 13px; font-weight: 600; opacity: .8; }
.balance .bar { background: rgba(0, 0, 0, .16); margin-top: 14px; }
html[data-theme="light"] .balance .bar { background: rgba(255, 255, 255, .25); }
.balance .bar i { background: currentColor; opacity: .85; }
.balance__foot { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 6px; opacity: .8; }
.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.perk { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.perk b { font-size: 15px; font-weight: 800; }
.perk span { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.code { display: flex; align-items: center; gap: 12px; }
.code__val { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; font-size: 17px; letter-spacing: .06em; padding: 8px 12px; border-radius: 12px; border: 1px dashed rgba(var(--accent-rgb), .55); color: var(--accent-2); }
.op { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.op + .op { border-top: 1px solid var(--stroke); }
.op__txt { flex: 1; min-width: 0; }
.op__txt b { display: block; font-size: 14px; font-weight: 700; }
.op__txt span { font-size: 12px; color: var(--muted); }
.op__v { font-weight: 800; font-size: 15px; }
.op__v.plus { color: var(--ok); }
.op__v.minus { color: var(--muted); }

/* ---------- История ---------- */
.visit { padding: 14px; margin-bottom: 10px; }
.visit__top { display: flex; gap: 12px; align-items: center; }
.visit .datebox { width: 50px; height: 54px; }
.visit .datebox b { font-size: 19px; }
.visit__txt { flex: 1; min-width: 0; }
.visit__txt b { display: block; font-size: 15px; font-weight: 800; line-height: 1.25; }
.visit__txt span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.visit__bottom { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.visit__bottom .pts { font-size: 13px; font-weight: 800; color: var(--ok); }
.visit__bottom .note { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; }
.visit__bottom .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.visit__rate { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.stars { display: flex; gap: 2px; }
.stars button { color: var(--faint); padding: 2px; }
.stars button.is-on { color: var(--warn); }
.stars svg.i { width: 22px; height: 22px; }
.stars button.is-on svg.i { fill: currentColor; }

/* ---------- Ещё ---------- */
.profile { display: flex; align-items: center; gap: 14px; }
.profile .avatar { width: 56px; height: 56px; font-size: 18px; }
.profile b { display: block; font-size: 18px; font-weight: 800; }
.profile div span { font-size: 13px; color: var(--muted); }
.menu { padding: 2px 0; }
.mrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; min-height: 54px; }
.mrow + .mrow, .mrow + .mblock, .mblock + .mrow, .mblock + .mblock { border-top: 1px solid var(--stroke); }
.mrow__ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--chip); color: var(--text-2); flex: none; }
.mrow__ico svg.i { width: 19px; height: 19px; }
.mrow__txt { flex: 1; min-width: 0; }
.mrow__txt b { display: block; font-size: 15px; font-weight: 700; }
.mrow__txt span { display: block; font-size: 12.5px; color: var(--muted); }
.mrow > svg.i:last-child { color: var(--faint); width: 18px; height: 18px; }
.mblock { padding: 13px 14px; }
.mblock__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mblock .seg button { font-size: 12.5px; padding: 6px 6px; }
details.faq + details.faq { border-top: 1px solid var(--stroke); }
details.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px; font-weight: 700; font-size: 15px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; flex: none; }
details.faq[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.faq p { padding: 0 14px 14px; color: var(--text-2); font-size: 14px; }
.made { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-style: dashed; border-color: rgba(20, 184, 166, .35); }
.made__head { display: flex; align-items: center; gap: 10px; }
.made__head img { width: 34px; height: 34px; }
.made__head b { font-size: 15px; font-weight: 800; }
.made p { font-size: 13px; color: var(--text-2); }
.made .btn { background: #14b8a6; color: #04201d; }
.diag { font-size: 11.5px; color: var(--faint); text-align: center; margin-top: 10px; }

/* ---------- Таббар ---------- */
.tabbar { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 12px);
  width: calc(100% - 28px); max-width: 440px; height: 66px; padding: 6px; display: flex; gap: 2px; border-radius: 24px;
  background: rgba(17, 25, 33, .7); border: 1px solid var(--stroke-2);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); transition: transform .3s ease, opacity .3s ease; }
html[data-theme="light"] .tabbar { background: rgba(255, 255, 255, .78); box-shadow: 0 16px 36px -18px rgba(15, 23, 42, .4); }
.tabbar.is-hidden { transform: translate(-50%, 130%); opacity: 0; pointer-events: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 18px;
  font-size: 10.5px; font-weight: 700; color: var(--muted); transition: color .2s, background .2s; min-width: 0; }
.tab svg.i { width: 22px; height: 22px; }
.tab.is-active { color: var(--accent-2); background: rgba(var(--accent-rgb), .14); }
html[data-theme="light"] .tab.is-active { color: var(--accent); }
.tab:active { transform: scale(.95); }

/* Резервная «главная кнопка» (вне Telegram) */
.mainbtn { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(180deg, transparent, var(--bg) 40%); }
.mainbtn .btn { width: 100%; max-width: 448px; margin: 0 auto; display: flex; min-height: 54px; border-radius: 16px; font-size: 16px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 16px 32px -16px rgba(var(--accent-rgb), .95); }
.mainbtn .btn[disabled] { opacity: .4; }
.mainbtn .btn.is-loading { pointer-events: none; }
.mainbtn .btn.is-loading::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Шторка и тост ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .5); animation: fade .2s ease; }
.sheet[hidden] { display: none; }
.sheet__box { width: 100%; max-width: 480px; padding: 10px 18px calc(var(--safe-bottom) + 18px); border-radius: 26px 26px 0 0;
  background: var(--glass-2); border: 1px solid var(--stroke-2); border-bottom: 0;
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); animation: up .28s cubic-bezier(.2, .9, .3, 1); }
html[data-theme="dark"] .sheet__box { background: rgba(20, 29, 38, .94); }
.sheet__grip { width: 40px; height: 5px; border-radius: 99px; background: var(--stroke-2); margin: 0 auto 14px; }
.sheet__box h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.sheet__box p { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.sheet__btns { display: grid; gap: 8px; }
.toast { position: fixed; z-index: 70; left: 50%; top: calc(var(--safe-top) + 14px); transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 700;
  background: rgba(15, 23, 32, .94); color: #e6edf3; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 18px 30px -16px rgba(0, 0, 0, .7);
  transition: opacity .25s, transform .25s; display: flex; gap: 8px; align-items: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast svg.i { color: var(--accent-2); width: 18px; height: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

/* ---------- Появление экрана ---------- */
.enter > * { animation: rise .42s cubic-bezier(.2, .8, .3, 1) both; }
.enter > *:nth-child(2) { animation-delay: .04s; }
.enter > *:nth-child(3) { animation-delay: .08s; }
.enter > *:nth-child(4) { animation-delay: .12s; }
.enter > *:nth-child(5) { animation-delay: .16s; }
.enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.noscript { position: relative; z-index: 3; padding: 40px 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
@media (min-width: 520px) {
  .app { padding-top: calc(var(--safe-top) + 20px); }
}
