/* =========================================================================
   Фото на документы — Telegram Mini App
   Эстетика: «точный прибор / официальный документ» — крой-марки, монотипика
   для метрик, строгая сетка. Theme-aware через переменные Telegram.
   ========================================================================= */

/* Атрибут hidden всегда прячет элемент (иначе .outset/.step/.upsell с display
   в классе перекрывают его и оверлей ловит клики). Критично для #outside. */
[hidden] { display: none !important; }

/* ---- Токены ------------------------------------------------------------- */
:root {
  /* Структурные — переопределяются из tg.themeParams в app.js.
     Здесь безопасные дефолты (светлая тема). */
  --bg:        #f4f5f7;
  --text:      #10151c;
  --hint:      #5b6472;   /* WCAG AA ≥4.5:1 на светлом card (метрики — ядро продукта) */
  --btn:       #2f6df6;
  --btn-text:  #ffffff;
  --card:      #ffffff;

  /* Бренд-акценты — не зависят от темы, подобраны под доверие к документу */
  --ink:       #17213a;   /* «чернила паспорта» */
  --accent:    #0ea5a0;   /* тил — свежий, не «AI-фиолетовый» */
  --accent-2:  #12b981;   /* изумруд для «бесплатно/успех» */
  --hot-a:     #ff7a3d;   /* коралл — бейдж decoy 🔥 */
  --hot-b:     #ff4d6d;
  --warn:      #eab308;
  --danger:    #ef4444;
  --star:      #f5b301;

  /* Производные (пересчитываются в app.js под тему) */
  --border:    color-mix(in srgb, var(--text) 12%, transparent);
  --border-strong: color-mix(in srgb, var(--text) 22%, transparent);
  --card-2:    color-mix(in srgb, var(--card) 92%, var(--text));
  --overlay:   color-mix(in srgb, var(--text) 6%, transparent);
  --ring:      color-mix(in srgb, var(--btn) 40%, transparent);

  /* Радиусы / тени / ритм */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --shadow-sm: 0 1px 2px rgba(16,21,28,.05), 0 1px 1px rgba(16,21,28,.04);
  --shadow-md: 0 6px 20px -8px rgba(16,21,28,.20);
  --shadow-lg: 0 18px 48px -16px rgba(16,21,28,.30);
  --ease: cubic-bezier(.22,.61,.36,1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          system-ui, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Roboto Mono", "Menlo",
          "Consolas", monospace;
}

/* ---- Сброс -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible {
  outline: 2px solid var(--btn);
  outline-offset: 2px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Каркас ------------------------------------------------------------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 var(--sp-4)
           calc(var(--sp-10) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---- Шапка -------------------------------------------------------------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: calc(var(--sp-3) + env(safe-area-inset-top)) 0 var(--sp-3);
  /* Сплошной «потолок» + блюр: контент не должен просвечивать сквозь шапку. */
  background: var(--bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 1px 0 var(--border);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.brand__mark { flex: none; }
.brand__frame {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--ink), color-mix(in srgb, var(--ink) 60%, var(--accent)));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), var(--shadow-sm);
  position: relative;
}
/* крой-марки на логотипе — отсылка к фото-гайдам */
.brand__frame::before, .brand__frame::after {
  content: ""; position: absolute; inset: 6px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 75%, white);
  border-radius: 3px;
  clip-path: polygon(0 0,34% 0,34% 8%,8% 8%,8% 34%,0 34%,
                     0 66%,8% 66%,8% 92%,34% 92%,34% 100%,0 100%,
                     100% 100%,66% 100%,66% 92%,92% 92%,92% 66%,100% 66%,
                     100% 34%,92% 34%,92% 8%,66% 8%,66% 0,100% 0);
}
.brand__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent-2) 85%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent);
}
.brand__text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.brand__text strong {
  font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__text small { font-size: 11px; color: var(--hint); letter-spacing: .02em; }

.pill {
  flex: none;
  display: inline-flex; align-items: center; gap: var(--sp-2);
  max-width: 40vw;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--text);
  font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform .12s var(--ease), border-color .2s var(--ease);
}
.pill #statusText {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill__spark {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent);
}
.pill[data-tier="premium"] { border-color: color-mix(in srgb, var(--star) 55%, var(--border)); }
.pill[data-tier="premium"] .pill__spark { background: var(--star); box-shadow: 0 0 0 3px color-mix(in srgb, var(--star) 25%, transparent); }

/* ---- Сцена / шаги ------------------------------------------------------- */
.stage { display: flex; flex-direction: column; gap: var(--sp-5); padding-top: var(--sp-2); }

.hook {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background:
    linear-gradient(120deg,
      color-mix(in srgb, var(--accent-2) 16%, var(--card)),
      color-mix(in srgb, var(--accent) 12%, var(--card)));
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
  animation: rise .4s var(--ease) both;
}
.hook__gift { font-size: 22px; flex: none; }
.hook__text { font-size: 13.5px; }
.hook__text b { font-weight: 700; }

.step { animation: rise .4s var(--ease) both; }
.step__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.step__num {
  flex: none;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  font-family: var(--mono);
  color: var(--btn-text);
  background: var(--ink);
  /* контур, чтобы плашка не сливалась с тёмным фоном (dark theme) */
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border-strong));
  box-shadow: var(--shadow-sm);
}
.step__num--done { background: var(--accent-2); }
.step__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }

/* блокировка шага 2 до выбора документа */
.step--locked[data-locked="true"] { opacity: .45; pointer-events: none; filter: saturate(.5); }
.step--locked { transition: opacity .3s var(--ease), filter .3s var(--ease); }

/* ---- Сетка пресетов ----------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
.preset {
  position: relative;
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-4);
  min-height: 118px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.preset:active { transform: scale(.98); }
.preset[aria-checked="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-md);
}
.preset[aria-checked="true"] .preset__check { opacity: 1; transform: scale(1); }
.preset__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.preset__flag { font-size: 26px; line-height: 1; }
/* мини-превью реальных пропорций документа */
.preset__ratio {
  flex: none;
  align-self: center;
  width: 22px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 32%, var(--border-strong));
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  box-shadow: inset 0 -6px 0 -3px color-mix(in srgb, var(--ink) 14%, transparent);
}
.preset__title { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.preset__size {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--hint);
  letter-spacing: -.02em;
}
.preset__check {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px;
  opacity: 0; transform: scale(.6);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

/* ---- Свой размер -------------------------------------------------------- */
.custom-toggle {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: transparent;
  font-size: 14px; font-weight: 600;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.custom-toggle:active { background: var(--overlay); }
.custom-toggle__icon { font-size: 16px; }
.custom-toggle__chev {
  margin-left: auto; font-size: 20px; color: var(--hint);
  transition: transform .25s var(--ease);
}
.custom-toggle[aria-expanded="true"] { border-style: solid; border-color: var(--accent); }
.custom-toggle[aria-expanded="true"] .custom-toggle__chev { transform: rotate(90deg); }

.custom-panel {
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  display: flex; flex-direction: column; gap: var(--sp-4);
  animation: rise .3s var(--ease) both;
}
.field-row { display: flex; align-items: flex-end; gap: var(--sp-3); }
.field-row .field { flex: 1; }
.field-x { padding-bottom: 12px; color: var(--hint); font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: 600; color: var(--hint); }
.field__label em { font-style: normal; font-weight: 400; opacity: .8; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus { outline: none; border-color: var(--btn); box-shadow: 0 0 0 3px var(--ring); }

/* ---- Dropzone ----------------------------------------------------------- */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.dropzone:active { border-color: var(--accent); }
.dropzone.is-drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.dropzone__empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
}
.dropzone__icon { font-size: 34px; }
.dropzone__title { font-size: 15px; font-weight: 650; }
.dropzone__hint { font-size: 12px; color: var(--hint); max-width: 30ch; }
.dropzone__preview { position: relative; background: var(--overlay); }
.dropzone__preview img {
  width: 100%; max-height: 320px; object-fit: contain; margin: 0 auto;
}
/* крой-марки поверх превью */
.dropzone__marks, .result__crop {
  position: absolute; inset: 10px; pointer-events: none;
  border-radius: 8px;
}
.dropzone__marks::before, .dropzone__marks::after,
.result__crop::before, .result__crop::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2px solid color-mix(in srgb, var(--accent) 80%, white);
}
.dropzone__marks::before, .result__crop::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.dropzone__marks::after, .result__crop::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.dropzone__meta {
  margin-top: var(--sp-2);
  font-family: var(--mono); font-size: 12px; color: var(--hint);
  text-align: center;
}

/* ---- Кнопки ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 50px;
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 15px; font-weight: 650; letter-spacing: -.01em;
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--cta { width: 100%; margin-top: var(--sp-4); }
.btn--primary {
  background: var(--btn); color: var(--btn-text);
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--btn) 90%, black);
}
.btn--primary:active { box-shadow: 0 4px 12px -8px color-mix(in srgb, var(--btn) 90%, black); }
.btn--ghost {
  background: var(--card); color: var(--text);
  border-color: var(--border-strong);
}
.btn--referral {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 58px; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--accent-2) 32%, transparent);
  background: color-mix(in srgb, var(--accent-2) 10%, var(--card));
  text-align: left;
}
.btn--referral > span:last-child { display: flex; flex-direction: column; }
.btn--referral b { font-size: 14.5px; }
.btn--referral small { font-size: 12px; color: var(--hint); }
.btn--referral > span:first-child { font-size: 22px; }

/* ---- Обработка ---------------------------------------------------------- */
.processing {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-6) 0;
}
.processing__ring {
  position: relative; width: 54px; height: 54px; margin-bottom: var(--sp-2);
}
.processing__ring span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
.processing__ring span:last-child {
  inset: 9px; border-top-color: var(--accent-2);
  animation-duration: 1.4s; animation-direction: reverse;
}
.processing__title { font-size: 16px; font-weight: 650; }
.processing__hint { font-size: 12.5px; color: var(--hint); }
.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(100deg,
    var(--overlay) 30%, color-mix(in srgb, var(--text) 12%, transparent) 50%, var(--overlay) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton--photo { width: 168px; height: 216px; margin-top: var(--sp-4); }

/* ---- Результат ---------------------------------------------------------- */
.result__figure { margin: 0; }
.result__frame {
  position: relative;
  display: grid; place-items: center;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background:
    var(--card)
    linear-gradient(0deg, var(--overlay), var(--overlay));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.result__frame img {
  max-height: 340px; width: auto;
  border-radius: 6px;
  box-shadow: 0 6px 22px -10px rgba(0,0,0,.5);
}
.meta-chips {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-4); justify-content: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--text);
}
.chip b { color: var(--accent); }
.chip--ok { border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); }
.chip--ok b { color: var(--accent-2); }

.notice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: 13px;
}
.notice--warn {
  background: color-mix(in srgb, var(--warn) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.notice__icon { font-size: 17px; flex: none; }

.checklist {
  margin-top: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  overflow: hidden;
}
.checklist__summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4);
  font-size: 14px; font-weight: 650;
  list-style: none; cursor: pointer;
}
.checklist__summary::-webkit-details-marker { display: none; }
.checklist__badge {
  font-size: 11px; font-weight: 600; color: var(--hint);
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--overlay);
}
.checklist__list {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: 0 var(--sp-4) var(--sp-4);
}
.checklist__list li {
  position: relative; padding-left: 26px;
  font-size: 13px; color: var(--text);
}
.checklist__list li::before {
  content: "✓"; position: absolute; left: 0; top: -1px;
  display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
}

.result__actions {
  display: flex; flex-direction: column; gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* ---- Апселл ------------------------------------------------------------- */
.upsell {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
  animation: rise .4s var(--ease) both;
}
.upsell__head { text-align: center; margin-bottom: var(--sp-4); }
.upsell__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.upsell__sub { font-size: 13px; color: var(--hint); margin-top: 4px; }
.upsell__cards { display: flex; flex-direction: column; gap: var(--sp-3); }

.product {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4);
  text-align: left;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--card);
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.product:active { transform: scale(.985); }
.product__body { flex: 1; min-width: 0; }
.product__title { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.product__frame { display: block; font-size: 12px; color: var(--hint); margin-top: 3px; line-height: 1.35; }
.product__price {
  flex: none;
  display: inline-flex; align-items: baseline; gap: 3px;
  font-family: var(--mono); font-weight: 700; font-size: 17px;
}
.product__price .star { color: var(--star); font-size: 15px; }

/* Цель (unlim30) — крупнее, «горячий» бейдж, акцент */
.product--target {
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(120deg, var(--hot-a), var(--hot-b)) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 14px 30px -18px var(--hot-b);
  padding-top: var(--sp-5);
}
.product--target .product__title { font-size: 16px; }
.product--target .product__price { font-size: 19px; }
.product__badge {
  position: absolute; top: -11px; left: var(--sp-4);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  color: #fff;
  background: linear-gradient(120deg, var(--hot-a), var(--hot-b));
  box-shadow: 0 6px 14px -6px var(--hot-b);
}
.product__anchor { text-decoration: line-through; color: var(--hint); font-size: 12px; margin-right: 2px; }

.upsell__pay-note {
  margin-top: var(--sp-4);
  text-align: center; font-size: 12.5px; color: var(--hint);
}
.upsell__pay-note span { color: var(--star); }
.upsell__soc {
  margin-top: var(--sp-2);
  text-align: center; font-size: 12px; color: var(--hint);
}

/* ---- Подвал ------------------------------------------------------------- */
.appfoot {
  margin-top: auto;
  padding-top: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.appfoot__trust {
  text-align: center; font-size: 11px; color: var(--hint);
  padding: 0 var(--sp-4);
}

/* ---- Тост --------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 60;
  display: flex; align-items: center; gap: var(--sp-3);
  max-width: min(520px, calc(100vw - 32px));
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast__icon {
  flex: none; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--danger); font-size: 12px; font-weight: 700;
}
.toast p { font-size: 13.5px; }

/* ---- Заглушка вне Telegram ---------------------------------------------- */
.outside {
  position: fixed; inset: 0;
  display: grid; place-items: center; padding: var(--sp-6);
  background: var(--bg);
  z-index: 100;
}
.outside__card {
  max-width: 340px; text-align: center;
  padding: var(--sp-8) var(--sp-6);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.outside__mark { display: inline-block; margin-bottom: var(--sp-4); transform: scale(1.4); }
.outside__card h1 { font-size: 20px; font-weight: 700; margin-bottom: var(--sp-2); }
.outside__card p { font-size: 14px; color: var(--hint); margin-bottom: var(--sp-5); }
.outside__card .btn { width: 100%; }

/* ---- Анимации ----------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

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

/* Тёмная тема: если Telegram не передал цвета — подстрахуемся системной */
@media (prefers-color-scheme: dark) {
  :root:not([data-tg-theme]) {
    --bg: #12151a;
    --text: #eef1f5;
    --hint: #8a93a3;
    --btn: #4b8bff;
    --btn-text: #ffffff;
    --card: #1b1f27;
  }
}

/* Узкие экраны */
@media (max-width: 360px) {
  .preset { min-height: 108px; padding: var(--sp-3); }
  .brand__text small { display: none; }
}
