/* VerifyBase — спокойный минималистичный интерфейс. Темы: auto (как в Telegram), light, dark. */

@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url("../fonts/onest-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url("../fonts/onest-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url("../fonts/onest-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url("../fonts/onest-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url("../fonts/onest-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url("../fonts/onest-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url("../fonts/onest-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url("../fonts/onest-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 800; font-display: swap; src: url("../fonts/onest-cyrillic-800-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 800; font-display: swap; src: url("../fonts/onest-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 20px;
  --r: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

:root, :root[data-theme="light"] {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --line: #e4e8ee;
  --text: #0f1729;
  --text-2: #4a5568;
  --muted: #8a94a6;
  --accent: #2b65f0;
  --accent-soft: #e9efff;
  --on-accent: #ffffff;
  --ok: #16a34a; --ok-soft: #e8f6ee;
  --warn: #c27803; --warn-soft: #fdf3e2;
  --bad: #e5484d; --bad-soft: #fdecec;
  --shadow: 0 1px 2px rgba(15, 23, 41, .04);
  --overlay: rgba(15, 23, 41, .32);
  --balance-bg: linear-gradient(135deg, #2b65f0 0%, #3b7bff 60%, #5a8dff 100%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0e13;
  --surface: #14181f;
  --surface-2: #1b2029;
  --line: #232a35;
  --text: #edf0f5;
  --text-2: #b0b8c6;
  --muted: #7c8696;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, .14);
  --on-accent: #ffffff;
  --ok: #3ccf7a; --ok-soft: rgba(60, 207, 122, .13);
  --warn: #f0b04a; --warn-soft: rgba(240, 176, 74, .13);
  --bad: #ff6b6f; --bad-soft: rgba(255, 107, 111, .13);
  --shadow: none;
  --overlay: rgba(0, 0, 0, .55);
  --balance-bg: linear-gradient(135deg, #2350c8 0%, #2e64e6 60%, #3f74f0 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body { font-family: var(--font); font-weight: 500; font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); min-height: 100vh;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg { flex: none; }

/* ---------- каркас ---------- */
#app { min-height: 100vh; }
.page { max-width: 600px; margin: 0 auto; padding: 12px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); animation: in .25s var(--ease); }
.page.no-tabbar { padding-bottom: calc(var(--safe-b) + 24px); }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 15px; line-height: 1.35; }
p { margin: 0; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: proportional-nums; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }
.stack > * + * { margin-top: 12px; }

.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 12px; }
.topbar h1 { font-size: 22px; flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-sm); border: 0; background: var(--surface); color: var(--text);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); flex: none; }
.icon-btn:active { transform: scale(.95); }
.icon-btn.plain { background: transparent; box-shadow: none; }

.section { margin-top: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.section-title h2 { font-size: 15px; font-weight: 700; color: var(--text-2); }
.link { font-size: 14px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- поверхности ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.group { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; background: none;
  text-align: left; color: var(--text); cursor: pointer; position: relative; }
.item + .item::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 1px solid var(--line); }
.item.no-icon + .item::before, .item + .item.no-icon::before { left: 16px; }
.item:active { background: var(--surface-2); }
.item.static { cursor: default; }
.item.static:active { background: none; }
.item .title { font-weight: 600; }
.item .sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.item .end { color: var(--muted); font-size: 14px; text-align: right; flex: none; }
.item .chev { color: var(--muted); opacity: .7; }
.ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.ico.accent { background: var(--accent-soft); color: var(--accent); }
.ico.ok { background: var(--ok-soft); color: var(--ok); }
.ico.warn { background: var(--warn-soft); color: var(--warn); }
.ico.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 14px;
  border: 0; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .12s var(--ease), opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.ghost { background: transparent; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }

/* ---------- поля ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 6px; }
.field > small { display: block; font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.input, .textarea, .select { width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .15s; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap .input { padding-left: 42px; }
.card .input, .card .textarea, .card .select, .sheet .input, .sheet .textarea, .sheet .select { background: var(--surface-2); border-color: transparent; }
.card .input:focus, .sheet .input:focus, .card .textarea:focus, .sheet .textarea:focus, .card .select:focus, .sheet .select:focus { border-color: var(--accent); }
.toggle { position: relative; width: 46px; height: 28px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; border-radius: 14px; background: var(--line); transition: background .2s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(18px); }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; min-width: max-content; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-2); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 41, .08); }
.page > .seg, .card .seg { background: var(--surface-2); }
.page > .seg { background: var(--surface); box-shadow: var(--shadow); }
.page > .seg button.on { background: var(--accent-soft); color: var(--accent); box-shadow: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.mt { margin-top: 16px; } .chips.mt-s { margin-top: 8px; }
* + .finish { margin-top: 12px; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 0; background: var(--surface); box-shadow: var(--shadow);
  color: var(--text-2); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); }

.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 12px; }
.stepper button { width: 38px; height: 38px; border: 0; background: none; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: proportional-nums; }

.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.presets button { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600;
  font-size: 14px; color: var(--text-2); cursor: pointer; font-variant-numeric: proportional-nums; }
.presets button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- статусы ---------- */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- цены ---------- */
.price { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-variant-numeric: proportional-nums; }
.price .rub { font-weight: 700; font-size: 15px; white-space: nowrap; }
.price .alt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.price.left { align-items: flex-start; }
.price.lg .rub { font-size: 26px; letter-spacing: -.03em; }
.price.lg .alt { font-size: 13px; }

/* ---------- главная ---------- */
.home-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; font-size: 16px; }
.avatar { position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }

.balance { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 18px; color: #fff; background: var(--balance-bg); }
.balance::after { content: ""; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.balance .label { font-size: 13px; opacity: .8; }
.balance .sum { font-size: 32px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; font-variant-numeric: proportional-nums; }
.balance .alt { font-size: 13px; opacity: .75; font-variant-numeric: proportional-nums; }
.balance .actions { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.balance .actions .btn { height: 40px; border-radius: 12px; background: rgba(255,255,255,.18); color: #fff; font-size: 14px; flex: 1; }
.balance .actions .btn.light { background: #fff; color: #1f4fd1; }

.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 14px; border-radius: var(--r); border: 0; background: var(--surface);
  box-shadow: var(--shadow); color: var(--text); text-align: left; cursor: pointer; min-height: 116px; }
.cat:active { transform: scale(.98); }
.cat .name { font-weight: 700; }
.cat .desc { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.35; }

.promo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.promo + .promo { margin-top: 10px; }
.code { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; border: 1px dashed var(--accent);
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .02em; cursor: pointer; }

/* ---------- товары ---------- */
.thumb { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r); }
.cat-hero { display: flex; align-items: center; gap: 14px; padding: 4px 4px 16px; }
.cat-hero .ico { width: 48px; height: 48px; border-radius: 14px; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); font-variant-numeric: proportional-nums; }
.rating svg { color: #f5a524; }

/* ---------- нижнее меню ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar .inner { max-width: 600px; margin: 0 auto; height: var(--tabbar-h); display: flex; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
  font-size: 11px; font-weight: 600; position: relative; }
.tabbar a.on { color: var(--accent); }
.tabbar .badge-dot { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ---------- шторка ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: var(--overlay); animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; max-width: 600px;
  margin: 0 auto; padding: 8px 16px calc(20px + var(--safe-b)); border-radius: 22px 22px 0 0; background: var(--bg); animation: up .3s var(--ease); }
.sheet .grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; font-size: 18px; }
.sheet.closing { animation: down .22s var(--ease) forwards; }
.sheet-bg.closing { animation: fadeout .22s forwards; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }

/* ---------- тосты ---------- */
.toasts { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 480px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  display: flex; gap: 10px; align-items: center; animation: toast .3s var(--ease); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.err { background: var(--bad); color: #fff; }
.toast.out { animation: fadeout .25s forwards; }
@keyframes toast { from { transform: translateY(-12px); opacity: 0; } }

/* ---------- профиль ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 20px; }
.profile-head h1 { font-size: 21px; margin-top: 12px; }
.level-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.level-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .8s var(--ease); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 14px 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: proportional-nums; }
.stat small { font-size: 12px; color: var(--muted); }

/* ---------- топы ---------- */
.top-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: relative; }
.top-row + .top-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.top-row.me { background: var(--accent-soft); }
.top-row .pos { width: 22px; font-weight: 700; color: var(--muted); font-variant-numeric: proportional-nums; text-align: center; }
.top-row .pos.p1 { color: #e0a100; } .top-row .pos.p2 { color: #8f9bb0; } .top-row .pos.p3 { color: #c47a45; }
.top-row .avatar { width: 34px; height: 34px; font-size: 14px; }

/* ---------- чат ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 84px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 16px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg .meta { display: block; font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; }
.msg img { border-radius: 10px; margin-top: 6px; max-height: 240px; }
.msg a.file { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: inherit; font-weight: 600; text-decoration: underline; }
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 12px calc(8px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.composer .inner { max-width: 600px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 40px; max-height: 140px; height: 40px; padding: 9px 14px; border-radius: 20px; border: 0; background: var(--surface-2); resize: none; outline: none; }
.composer .send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.composer .attach { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none; }
.composer .file-tag { max-width: 600px; margin: 0 auto 6px; font-size: 13px; color: var(--accent); display: flex; gap: 8px; align-items: center; }
.composer .closed { max-width: 600px; margin: 0 auto; text-align: center; color: var(--muted); font-size: 14px; padding: 10px 0; }

/* ---------- обучение ---------- */
.onb { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top, 0px)) 24px calc(24px + var(--safe-b)); animation: fade .25s; }
.onb .skip { align-self: flex-end; }
.onb .slide { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; width: 100%; animation: in .3s var(--ease); }
.onb .art { width: 88px; height: 88px; border-radius: 26px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 28px; }
.onb h1 { font-size: 26px; line-height: 1.2; }
.onb p { margin-top: 12px; font-size: 16px; color: var(--text-2); line-height: 1.5; }
.onb .points { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.onb .points div { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 15px; }
.onb .points svg { color: var(--accent); margin-top: 1px; }
.onb .dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.onb .dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width .25s var(--ease), background .25s; }
.onb .dots i.on { width: 20px; background: var(--accent); }
.onb .foot { max-width: 420px; width: 100%; margin: 0 auto; }

/* ---------- прочее ---------- */
.empty { text-align: center; padding: 40px 24px; }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); }
.empty h3 { font-size: 16px; }
.empty p { color: var(--muted); margin: 6px auto 16px; font-size: 14px; max-width: 300px; }
.skeleton { border-radius: var(--r); background: var(--surface); position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--surface-2), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; word-break: break-word; }
.code-box { padding: 12px; border-radius: 12px; background: var(--surface-2); font-family: ui-monospace, Menlo, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.rich { font-size: 15px; line-height: 1.6; color: var(--text-2); }
.rich b { color: var(--text); }
.pay { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface);
  color: var(--text); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.pay + .pay { margin-top: 8px; }
.pay.on { border-color: var(--accent); }
.pay .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.pay.on .radio { border: 6px solid var(--accent); }
.result { text-align: center; padding: 8px 0 4px; }
.result .mark { width: 64px; height: 64px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; animation: pop .4s var(--ease); }
.result .mark.ok { background: var(--ok-soft); color: var(--ok); }
.result .mark.bad { background: var(--bad-soft); color: var(--bad); }
.result .mark.wait { background: var(--accent-soft); color: var(--accent); }
.result .mark.wait svg { animation: spin 2.4s linear infinite; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.gate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.splash { position: fixed; inset: 0; display: grid; place-items: center; z-index: 95; background: var(--bg); transition: opacity .3s; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash .loader { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.splash-ico { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.finish .title { font-weight: 700; }
.finish .sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.finish.done { border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.rate-pick { display: flex; justify-content: center; gap: 6px; }
.rate-pick button { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--line); transition: transform .15s var(--ease), color .15s; -webkit-tap-highlight-color: transparent; }
.rate-pick button.on { color: #f5a524; }
.rate-pick button:active { transform: scale(.88); }
.stars-row { display: inline-flex; gap: 2px; color: #f5a524; }
.my-review { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
@keyframes breathe { 50% { opacity: .6; transform: scale(.95); } }
/* подарки */
.gift-card + .gift-card { margin-top: 12px; }
.gift-card .badge { flex: none; }
.gift-hero { text-align: center; padding: 26px 18px 22px; border-radius: var(--r); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); box-shadow: var(--shadow); }
.gift-hero .mark { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent); color: #fff; animation: pop .45s var(--ease); }
.gift-hero h1 { margin-top: 6px; font-size: 22px; }
.gift-msg { margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); font-size: 14px; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.file-pick { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 14px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.file-pick input { display: none; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-pick button { padding: 12px 6px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.theme-pick button.on { border-color: var(--accent); color: var(--accent); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.admin-tabs { margin: 0 -16px 16px; padding: 0 16px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.metric .label { font-size: 13px; color: var(--muted); }
.metric .val { font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: proportional-nums; }
.metric .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

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

/* выбор иконки раздела в админке */
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 2px; }
.icon-pick button { aspect-ratio: 1; border-radius: 12px; border: 1.5px solid transparent; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.icon-pick button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.plain-btn { background: none; border: 0; padding: 0; margin: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
