/* eSIM Mini App — спокойный «тревел» интерфейс: один акцент (синий), крупные цели нажатия,
   обе темы Telegram. Все цвета — токены; светлая тема переопределяет их под [data-theme="light"]. */
:root, [data-theme="dark"] {
  --bg: #0e1218;
  --bg-sheet: #131820;
  --surface: #181d26;
  --surface-2: #202733;
  --surface-3: #2b3340;
  --bar: rgba(14, 18, 24, 0.88);
  --bar-solid: #0e1218;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --text-1: #f2f5f9;
  --text-2: #b3bcc8;
  --text-3: #919bab;
  --accent: #6aa8ff;
  --accent-bg: rgba(106, 168, 255, 0.14);
  --ok: #45d39a;
  --ok-bg: rgba(69, 211, 154, 0.14);
  --warn: #f5bd55;
  --warn-bg: rgba(245, 189, 85, 0.14);
  --err: #ff7d8e;
  --err-bg: rgba(255, 125, 142, 0.13);
  --shadow: none;
  --scrim: rgba(0, 0, 0, 0.56);
  --seg-ind: #333c4a;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f2f4f7;
  --bg-sheet: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #edf0f4;
  --surface-3: #dfe4eb;
  --bar: rgba(242, 244, 247, 0.9);
  --bar-solid: #f2f4f7;
  --line: rgba(16, 24, 40, 0.08);
  --line-2: rgba(16, 24, 40, 0.15);
  --text-1: #0d1320;
  --text-2: #445063;
  --text-3: #5a6576;
  --accent: #1a63d6;
  --accent-bg: rgba(26, 99, 214, 0.09);
  --ok: #0b7a4a;
  --ok-bg: rgba(11, 122, 74, 0.1);
  --warn: #8a5300;
  --warn-bg: rgba(245, 160, 0, 0.16);
  --err: #c42a3f;
  --err-bg: rgba(196, 42, 63, 0.09);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 18px rgba(16, 24, 40, 0.05);
  --scrim: rgba(10, 14, 22, 0.42);
  --seg-ind: #ffffff;
  color-scheme: light;
}
:root {
  --btn: #1f6fe5;          /* фон основной кнопки: белый текст 4.7:1 в обеих темах */
  --btn-press: #1a5fc6;
  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Китайский и прочие письменности — системный запасной шрифт (флаги-эмодзи не перехватываются). */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  /* Отступы устройства и интерфейса Telegram (Bot API 8.0+): максимум из двух источников, без двойного учёта */
  --sa-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --sa-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --top-inset: calc(var(--sa-top) + var(--tg-content-safe-area-inset-top, 0px));
  --bottom-inset: calc(var(--sa-bottom) + var(--tg-content-safe-area-inset-bottom, 0px));
  --tabbar-h: 64px;
}

/* ── база ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100vh);
  background: var(--bg);
  color: var(--text-1);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}
html.no-scroll body { overflow: hidden; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: inherit;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
button:disabled { cursor: default; }
h1, h2, h3, p, figure, ol, ul { margin: 0; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.small { font-size: 13px; line-height: 1.45; color: var(--text-3); }
.center { text-align: center; }
.noscript { padding: 24px; font-size: 16px; }

/* ── каркас ───────────────────────────────────────────────────────────── */
.app { position: relative; max-width: 560px; margin: 0 auto; }
.top-shade {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--top-inset);
  background: var(--bar);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  pointer-events: none;
}
.main { padding: calc(var(--top-inset) + 16px) 16px calc(var(--tabbar-h) + var(--bottom-inset) + 28px); }
.screen { display: flex; flex-direction: column; gap: 22px; animation: fadeUp 0.22s var(--ease); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.pad-top { padding-top: 8px; }
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.h1 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.h2 {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.lead { margin-top: 6px; font-size: 15.5px; line-height: 1.45; color: var(--text-2); }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec-title { font-size: 19px; line-height: 1.25; font-weight: 720; letter-spacing: -0.01em; }
.sec-sub { font-size: 14px; font-weight: 650; color: var(--text-2); }
.card {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ── кнопки ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s;
}
.btn:active:not(:disabled),
.cta:active:not(:disabled),
.dest:active,
.pkg:active,
.method:active,
.ecard:active,
.pcard:active {
  transform: scale(0.98);
}
.btn:disabled, .cta:disabled { opacity: 0.6; }
.btn-primary { background: var(--btn); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-1); border: 1px solid var(--line-2); }
.btn-ghost { color: var(--accent); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14.5px; border-radius: var(--r-sm); }
.btn-lg { min-height: 56px; padding: 0 22px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 8px 18px;
  border-radius: 16px;
  background: var(--btn);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 22px -12px rgba(31, 111, 229, 0.9);
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s;
}
.cta:active:not(:disabled) { background: var(--btn-press); }
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--text-2);
}
.icon-btn:active { background: var(--surface-2); }
.link {
  display: inline;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  -webkit-user-select: text;
  user-select: text;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 40px;
  margin-top: -2px;
  padding: 0 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  font-size: 18px;
}
.lang-code { font-size: 13.5px; font-weight: 700; color: var(--text-2); letter-spacing: 0.02em; }

/* ── поиск и витрина ──────────────────────────────────────────────────── */
.search { position: relative; margin-top: -8px; }
.search-ico {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 56px;
  padding: 0 48px 0 48px;
  border-radius: 16px;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--text-1);
  font: 500 17px var(--font);
  outline: none;
  box-shadow: var(--shadow);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--text-3); font-weight: 400; font-size: 16px; }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-x { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 104px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.15s var(--ease);
}
.dest-flag { margin-bottom: 6px; font-size: 32px; line-height: 1; }
.dest-name { font-size: 16px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.dest-sub { font-size: 13px; color: var(--text-3); }
.dest-price {
  margin-top: auto;
  padding-top: 4px;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.list {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 10px 10px 14px;
  text-align: left;
}
.row + .row, .hist-row + .hist-row { border-top: 1px solid var(--line); }
.row:active { background: var(--surface-2); }
.row-flag { flex: none; font-size: 26px; line-height: 1; }
.row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-title { font-size: 16px; font-weight: 560; line-height: 1.3; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; line-height: 1.35; color: var(--text-3); }
.row-right {
  flex: none;
  max-width: 45%;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.row-chev { flex: none; color: var(--text-3); }
.az-letter {
  padding: 5px 14px;
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-3);
}
.az-letter:first-child { padding-top: 6px; }
.az-letter + .row { border-top: 0; }

/* ── нижняя навигация ─────────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  padding: 6px 8px calc(6px + var(--bottom-inset));
  background: var(--bar);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--line);
  transition: transform 0.22s var(--ease), opacity 0.2s;
}
.tab {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 52px;
  color: var(--text-3);
}
.tab-ico {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: 15px;
  transition: background 0.2s, color 0.2s;
}
.tab-label {
  max-width: 100%;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab.on { color: var(--accent); }
.tab.on .tab-ico { background: var(--accent-bg); }
.tab-dot {
  position: absolute;
  top: 3px;
  right: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--err);
  box-shadow: 0 0 0 2px var(--bar-solid);
}
html.kb .tabbar { transform: translateY(140%); opacity: 0; pointer-events: none; }

/* ── слои (страна, заказ, eSIM) ───────────────────────────────────────── */
.layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
}
.layer.in { transform: none; }
.layer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--top-inset) + 16px) 16px 28px;
}
.backbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: var(--top-inset) 6px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.backbar + .layer-scroll { padding-top: 14px; }
.backbar-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.backbar-sp { width: 44px; flex: none; }
.layer-dock {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px calc(12px + var(--bottom-inset));
  background: var(--bar);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

/* ── нижние листы ─────────────────────────────────────────────────────── */
.sheet-wrap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
}
.sheet-scrim {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  max-height: calc(100% - var(--top-inset) - 24px);
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  background: var(--bg-sheet);
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.3), inset 0 1px 0 var(--line-2);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}
.sheet-wrap.in .sheet-scrim { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; }
.sheet-grab {
  flex: none;
  width: 38px;
  height: 5px;
  margin: 8px auto 2px;
  border-radius: 3px;
  background: var(--line-2);
}
.sheet-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 2px 8px 4px 16px;
}
.sheet-title {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.01em;
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 18px;
}
.sheet-dock {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px calc(12px + var(--bottom-inset));
  border-top: 1px solid var(--line);
}
/* клавиатура открыта: обёртка листа = видимая область (visualViewport), лист прижат к клавиатуре */
html.kb .sheet-wrap {
  top: var(--vv-top, 0px);
  bottom: auto;
  height: var(--vv-h, 100%);
}
html.kb .sheet { max-height: calc(100% - 12px - max(0px, var(--top-inset) - var(--vv-top, 0px))); }
html.kb .sheet-dock { padding-bottom: 10px; }

/* ── страна / регион ──────────────────────────────────────────────────── */
.area-hero { display: flex; align-items: center; gap: 14px; }
.area-flag { flex: none; font-size: 58px; line-height: 1; }
.area-hero .lead { margin-top: 4px; }
.pkgs, .methods { display: flex; flex-direction: column; gap: 10px; }
.pkg, .method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease);
}
.pkg { min-height: 78px; }
.method { min-height: 60px; }
.pkg.on, .method.on {
  border-color: var(--accent);
  background: linear-gradient(var(--accent-bg), var(--accent-bg)), var(--surface);
}
.pkg-radio {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  transition: border 0.15s;
}
.on > .pkg-radio { border: 7px solid var(--accent); }
.pkg-main { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.pkg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pkg-gb {
  font-size: 22px;
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.pkg-days { font-size: 14px; color: var(--text-2); }
.pkg-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.pkg-price { font-size: 18px; font-weight: 720; font-variant-numeric: tabular-nums; }
.pkg-per { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.badge {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.badge-pop { background: var(--accent-bg); color: var(--accent); }
.badge-val { background: var(--ok-bg); color: var(--ok); }
.facts { display: flex; flex-direction: column; gap: 14px; }
.fact { display: flex; align-items: flex-start; gap: 12px; }
.fact-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-bg);
  color: var(--accent);
}
.fact-main { display: flex; flex-direction: column; min-width: 0; }
.fact-label { font-size: 13px; color: var(--text-3); }
.fact-val { font-size: 15px; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.3;
  color: var(--text-2);
}
.chip .ico { flex: none; color: var(--accent); }
.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 15.5px;
  font-weight: 620;
  text-align: left;
}
.link-row span { flex: 1; }
.clist { display: flex; flex-wrap: wrap; gap: 6px; }
.cchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
}

/* ── раскрывающиеся блоки ─────────────────────────────────────────────── */
.coll {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.coll.card { padding: 0; }
.coll-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 12px 12px 14px;
  text-align: left;
}
.coll-ico { flex: none; color: var(--accent); }
.coll-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 620;
  line-height: 1.35;
}
.coll-chev { flex: none; color: var(--text-3); transition: transform 0.2s var(--ease); }
.coll.open .coll-chev { transform: rotate(180deg); }
.coll-body {
  padding: 0 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  animation: fadeUp 0.18s var(--ease);
}
.faq { display: flex; flex-direction: column; gap: 8px; }

/* ── подсказки, ошибки, пусто ─────────────────────────────────────────── */
.note, .warnbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--accent-bg);
  font-size: 14.5px;
  line-height: 1.45;
}
.note > .ico { flex: none; color: var(--accent); }
.warnbox { background: var(--warn-bg); }
.warnbox > .ico { flex: none; color: var(--warn); }
.note-code { flex: none; font: 700 15px var(--mono); color: var(--accent); }
.errbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--err-bg);
  font-size: 14.5px;
  line-height: 1.45;
}
.errbox-ico { flex: none; color: var(--err); }
.errbox-text { flex: 1; min-width: 55%; }
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 12px 12px;
  text-align: center;
}
.empty-art { font-size: 52px; line-height: 1.1; }
.empty-title { font-size: 19px; font-weight: 720; }
.empty-text { max-width: 32ch; font-size: 15px; color: var(--text-2); }
.empty .btn { margin-top: 10px; }

/* ── оплата ───────────────────────────────────────────────────────────── */
.sum { display: flex; align-items: center; gap: 12px; padding: 14px; }
.sum-flag { flex: none; font-size: 34px; line-height: 1; }
.sum-main { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.sum-title { font-size: 16.5px; font-weight: 680; overflow-wrap: anywhere; }
.sum-sub { font-size: 14px; color: var(--text-2); }
.sum-price { flex: none; font-size: 19px; font-weight: 740; font-variant-numeric: tabular-nums; }
.method-ico { flex: none; color: var(--text-2); }
.method-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; }
.method-price {
  flex: none;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 620; color: var(--text-2); }
.input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--text-1);
  font: 400 17px var(--font);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.input.is-err { border-color: var(--err); }
.field-hint { font-size: 13px; color: var(--text-3); }
.field-hint.is-err { color: var(--err); }
.muted-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-3);
}
.consent { font-size: 12.5px; line-height: 1.4; color: var(--text-3); text-align: center; }
.demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.demo-art { font-size: 48px; line-height: 1.1; }
.demo-text { max-width: 34ch; color: var(--text-2); }
.demo .sum { width: 100%; text-align: left; }

/* ── заказ ────────────────────────────────────────────────────────────── */
.order-head { display: flex; align-items: center; gap: 12px; }
.order-flag { flex: none; font-size: 42px; line-height: 1; }
.order-head-main { min-width: 0; }
.order-title { font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.order-sub { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px 0 0; list-style: none; }
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 16px;
  right: calc(50% + 20px);
  width: calc(100% - 40px);
  height: 2px;
  border-radius: 1px;
  background: var(--line-2);
}
.step-done::before, .step-run::before { background: var(--ok) !important; }
.step-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-3);
}
.step-done .step-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
[data-theme="dark"] .step-done .step-dot { color: #062014; }
.step-run .step-dot { border-color: var(--accent); background: var(--accent-bg); }
.step-fail .step-dot { border-color: var(--err); background: var(--err-bg); color: var(--err); }
.step-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.step-label {
  padding: 0 2px;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.25;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.step-run .step-label, .step-done .step-label { color: var(--text-1); }
.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 18px 22px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}
.status-ico {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
}
.status-ok .status-ico { background: var(--ok-bg); color: var(--ok); }
.status-muted .status-ico { background: var(--surface-2); color: var(--text-2); }
.status-emoji { font-size: 34px; line-height: 1; }
.status-title { font-size: 22px; font-weight: 740; line-height: 1.25; letter-spacing: -0.01em; }
.status-text { max-width: 36ch; font-size: 15px; line-height: 1.5; color: var(--text-2); }

/* ── eSIM ─────────────────────────────────────────────────────────────── */
.esim-head { display: flex; align-items: center; gap: 14px; }
.esim-flag { flex: none; font-size: 50px; line-height: 1; }
.esim-head-main { min-width: 0; }
.esim-head-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.25;
}
.pill-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-err { background: var(--err-bg); color: var(--err); }
.pill-info { background: var(--accent-bg); color: var(--accent); }
.pill .spinner { border-width: 2px; }
.usage { display: flex; flex-direction: column; gap: 8px; }
.usage-text { font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.usage-text b { font-size: 24px; font-weight: 760; color: var(--text-1); }
.bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.bar i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 5px;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}
.bar-low i { background: var(--warn); }
.usage-sm .bar { height: 6px; }
.usage-sm .usage-text { font-size: 13.5px; }
.usage-sm .usage-text b { font-size: 15px; }
.usage-card { display: flex; flex-direction: column; gap: 12px; }
.usage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 13.5px;
  color: var(--text-2);
}
.usage-meta span { display: inline-flex; align-items: center; gap: 6px; }
.usage-meta .ico { flex: none; }
.usage-upd { color: var(--text-3); }
.install { display: flex; flex-direction: column; gap: 18px; }
.install-quick { display: flex; flex-direction: column; gap: 10px; }
.install-req { font-size: 13px; line-height: 1.45; color: var(--text-3); text-align: center; }
.qr { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-img {
  width: 224px;
  height: 224px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line-2);
}
.qr-cap { max-width: 30ch; font-size: 13.5px; color: var(--text-2); text-align: center; }
.manual, .howto { display: flex; flex-direction: column; gap: 8px; }
.manual-title { font-size: 14px; font-weight: 650; color: var(--text-2); }
.copyf {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 8px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.copyf-main { flex: 1; min-width: 0; }
.copyf-label { font-size: 12.5px; color: var(--text-3); }
.copyf-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}
.copyf-btn { color: var(--accent); }
.seg {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}
.seg-ind {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: 9px;
  background: var(--seg-ind);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.22s var(--ease), width 0.22s var(--ease);
}
.seg-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 40px;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-2);
  text-align: center;
}
.seg-btn.on { color: var(--text-1); }
.olist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-1);
}
.olist li { display: flex; gap: 10px; }
.olist-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.tips { display: flex; flex-direction: column; gap: 8px; }
.tips-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 680;
}
.tips-title .ico { color: var(--accent); }
.tips p { font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.hist-main { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.hist-title { font-size: 15px; font-weight: 600; }
.hist-sub { font-size: 13px; color: var(--text-3); }
.hist-price { flex: none; font-size: 15px; font-weight: 620; font-variant-numeric: tabular-nums; }

/* ── «Мои eSIM» ───────────────────────────────────────────────────────── */
.pcard, .ecard {
  display: flex;
  width: 100%;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.15s var(--ease);
}
.pcard { align-items: center; gap: 12px; padding: 12px 8px 12px 14px; }
.pcard-flag, .ecard-flag { flex: none; font-size: 32px; line-height: 1; }
.pcard-main, .ecard-main { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.pcard-title { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.pcard-sub, .ecard-sub { font-size: 13px; color: var(--text-3); }
.pcard-side { flex: none; max-width: 46%; }
.ecard { flex-direction: column; gap: 12px; padding: 14px; }
.ecard-top { display: flex; align-items: center; gap: 12px; }
.ecard-title { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.ecard.is-dim .ecard-flag { filter: grayscale(0.7); opacity: 0.8; }
.ecard-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 620;
}
.ecard-cta .ico:last-child { margin-left: auto; }

/* ── «Помощь» ─────────────────────────────────────────────────────────── */
.how {
  padding: 2px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  list-style: none;
}
.how-step { display: flex; gap: 12px; padding: 14px 0; }
.how-step + .how-step { border-top: 1px solid var(--line); }
.how-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--btn);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.how-main { display: flex; flex-direction: column; gap: 2px; }
.how-title { font-size: 16px; font-weight: 650; }
.how-text { font-size: 14.5px; color: var(--text-2); }
.compat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-1);
}
.ticks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.ticks li { display: flex; gap: 8px; }
.ticks .ico { flex: none; margin-top: 2px; color: var(--ok); }
.lang-row.on .row-title { font-weight: 700; }
.lang-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  color: var(--accent);
}
.support-btn { margin-top: 4px; }

/* ── загрузка, тосты, старт ───────────────────────────────────────────── */
.spinner {
  display: inline-block;
  flex: none;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.75s linear infinite;
}
.skel {
  display: block;
  flex: none;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.toasts {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabbar-h) + var(--bottom-inset) + 14px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.app.has-layer .toasts { bottom: calc(var(--bottom-inset) + 96px); }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  background: rgba(24, 28, 36, 0.96);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.35;
  pointer-events: auto;
  animation: fadeUp 0.2s var(--ease);
}
.toast-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(106, 168, 255, 0.18);
  color: #8fbcff;
}
.toast-ok .toast-ico { background: rgba(69, 211, 154, 0.18); color: #59dca6; }
.toast-error .toast-ico { background: rgba(255, 125, 142, 0.18); color: #ff8f9d; }
.splash, .fatal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100vh);
  padding: calc(var(--top-inset) + 24px) 28px calc(var(--bottom-inset) + 24px);
  text-align: center;
}
.fatal .lead { max-width: 34ch; margin: 0 0 8px; }
.logo-mark { border-radius: 16px; box-shadow: 0 12px 28px -12px rgba(31, 111, 229, 0.9); }
.splash-bar {
  position: relative;
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.splash-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 2px;
  background: var(--accent);
  animation: slide 1.1s var(--ease) infinite;
}

/* ── анимации ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}
@keyframes pulse {
  50% { transform: scale(0.6); opacity: 0.5; }
}
@keyframes slide {
  from { left: -40%; }
  to { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 350px) {
  .h1 { font-size: 25px; }
  .main, .layer-scroll { padding-left: 12px; padding-right: 12px; }
  .grid2 { gap: 8px; }
  .pkg-gb { font-size: 20px; }
}
