@font-face {
  font-family: Onest;
  src: url('/telegram-mini-app/onest.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #39393a;
  --muted: #777775;
  --teal: #297373;
  --teal-deep: #275655;
  --orange: #ff8552;
  --paper: #f8f7f5;
  --card: #fcfcfa;
  --line: rgba(57, 57, 58, .11);
  --shadow-card: 0 16px 38px rgba(48, 47, 44, .075), 0 2px 7px rgba(48, 47, 44, .035);
  --ease: cubic-bezier(.2, .75, .2, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 Onest, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--teal); }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.app-shell {
  width: 100%;
  max-width: 620px;
  min-height: 100dvh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 0 36px rgba(26, 33, 31, .035);
}
.app-main { flex: 1; min-height: 0; padding-bottom: calc(102px + env(safe-area-inset-bottom)); }
.screen { padding: 27px 20px 34px; }
.screen[hidden] { display: none; }
.screen:not([hidden]) { animation: screen-enter .32s var(--ease) both; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.screen-head > div { min-width: 0; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 820;
  line-height: 1.25;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; color: var(--ink); font-size: clamp(29px, 8vw, 35px); font-weight: 820; line-height: 1.05; letter-spacing: -.055em; }
h2 { font-size: 20px; font-weight: 790; line-height: 1.16; letter-spacing: -.035em; }
h3 { font-size: 16px; font-weight: 770; letter-spacing: -.02em; }
.subcopy { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.avatar { width: 62px; height: 62px; flex: none; display: block; overflow: hidden; border: 4px solid var(--orange); border-radius: 50%; background: #fff; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); }
.screen-body { margin-top: 23px; }
.loading { padding: 26px 1px; color: var(--muted); font-size: 13px; animation: breathe 1.6s ease-in-out infinite; }

.card, .empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.card { padding: 20px; }
.card + .card { margin-top: 11px; }
.card-head, .split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.esim-card { position: relative; overflow: hidden; border-color: rgba(255, 133, 82, .48); border-top: 3px solid var(--orange); padding-top: 18px; }
.esim-card {
  min-height: 210px;
  padding: 12px;
  border: 1.5px solid var(--orange);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 9px 22px rgba(57, 57, 58, .10), 0 2px 4px rgba(255, 133, 82, .10);
}
.esim-photo {
  position: absolute;
  inset: 0 0 0 auto;
  width: 54%;
  background-size: cover;
  background-position: 67% center;
  clip-path: ellipse(105% 86% at 100% 50%);
}
.esim-card .card-head, .esim-card .country-name, .esim-card .plan-line,
.esim-card .divider, .esim-card .metrics, .esim-card .primary { position: relative; z-index: 1; }
.esim-card .card-head { align-items: start; }
.esim-card .status { padding: 4px 9px; background: var(--teal); color: #fff; font-size: 10px; }
.esim-card .status.warning { background: #b86746; }
.esim-card .status::before { width: 5px; height: 5px; }
.esim-card .order-no { color: #5f5f5e; font-size: 10px; }
.esim-card .country-name { display: flex; align-items: center; gap: 7px; margin: 7px 0 1px; font-size: 21px; }
.esim-card .country-name .country-flag { font-size: 20px; }
.esim-card .plan-line { font-size: 10px; }
.esim-card .divider { margin: 10px 0; }
.photo-card .divider { display: none; }
.esim-card .metrics { width: 66%; margin-top: 11px; gap: 8px; }
.esim-card:not(.photo-card) .metrics { width: 100%; }
.esim-card .meter-label { margin-bottom: 3px; font-size: 10px; }
.esim-card .meter-label strong { font-size: 10px; }
.esim-card .meter { height: 5px; background: #e5e4e2; }
.card.esim-card .primary { min-height: 42px; margin-top: 17px; padding: 7px 30px; gap: 7px; font-size: 13px; }
.esim-card .primary svg { width: 18px; height: 18px; }
.esim-card .primary svg:last-child { position: absolute; right: 12px; width: 16px; height: 16px; }
.photo-card .country-name, .photo-card .plan-line { max-width: 68%; }
.country-flag { display: inline-block; flex: none; font-size: 19px; line-height: 1; }
.quiet-card-main { min-width: 0; flex: 1; }
.quiet-card .chevron { color: var(--muted); font-size: 23px; font-weight: 400; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px; background: #e9f3ef; color: var(--teal); font-size: 11px; font-weight: 780; line-height: 1.2; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.warning { color: #a95c3b; background: #fff0e8; }
.order-no { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.country-name { margin: 16px 0 3px; font-size: 27px; font-weight: 820; line-height: 1.1; letter-spacing: -.045em; }
.plan-line { color: var(--muted); font-size: 12px; line-height: 1.45; }
.divider { height: 1px; margin: 18px 0; background: var(--line); }
.metrics { display: grid; gap: 16px; }
.meter-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 690; }
.meter-label strong { font-size: 12px; font-weight: 760; font-variant-numeric: tabular-nums; text-align: right; }
.meter { height: 8px; overflow: hidden; border-radius: 99px; background: #e9e7e3; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--orange); transform-origin: left center; animation: meter-fill .72s var(--ease) both; }

.primary, .secondary {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 48px; padding: 11px 16px;
  border-radius: 12px; font-size: 13px; font-weight: 780;
  text-align: center; text-decoration: none; line-height: 1.3;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s ease, border-color .2s ease;
}
.primary { border: 1px solid var(--teal); background: var(--teal); color: #fff; box-shadow: 0 8px 18px rgba(41, 115, 115, .14); }
.primary:active { background: var(--teal-deep); transform: scale(.985); box-shadow: 0 3px 9px rgba(41, 115, 115, .12); }
.secondary { border: 1px solid rgba(41, 115, 115, .27); background: #fff; color: var(--teal); }
.secondary:active { background: #edf4f1; transform: scale(.99); }
.card .primary, .card .secondary { margin-top: 19px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 29px 0 11px; }
.section-heading h2 { margin: 0; }
.section-heading small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.quiet-card, .result-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; text-align: left; color: var(--ink); }
.quiet-card { min-height: 66px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 5px 14px rgba(48, 47, 44, .04); transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease; }
.quiet-card strong { font-size: 14px; font-weight: 760; }
.quiet-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.empty-state { padding: 23px 21px; }
.empty-state h2 { margin-bottom: 9px; font-size: 22px; }
.empty-state > p { margin-bottom: 17px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.empty-state .primary { margin-top: 7px; }
.inline-error, .field-error { color: #a1452d; font-size: 12px; line-height: 1.45; }
.inline-error { margin: 12px 0; }
.field-error { margin: 9px 0 0; }
.back-button { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 18px; padding: 3px 0; border: 0; background: none; color: var(--teal); font-size: 12px; font-weight: 750; }
.back-button svg { width: 17px; height: 17px; }
.detail-qr { display: block; width: 180px; height: 180px; margin: 17px auto; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.detail-code { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.detail-actions { display: grid; gap: 9px; margin-top: 18px; }

.bottom-nav {
  position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 620px); min-height: calc(79px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr 1.2fr 1fr 1fr; gap: 4px; align-items: end;
  padding: 8px 8px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(252, 252, 250, .97);
  box-shadow: 0 -10px 30px rgba(57, 57, 58, .04);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.nav-item {
  min-width: 0; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 2px; border: 0; border-radius: 13px; background: transparent; color: var(--muted);
  font-size: 10px; font-weight: 720; white-space: nowrap;
  transition: transform .22s var(--ease), background .22s ease, color .22s ease, box-shadow .22s ease;
}
.nav-item svg { width: 21px; height: 21px; transition: transform .24s var(--ease); }
.nav-item.selected:not(.nav-buy) { background: #f8eee9; color: #dc7047; box-shadow: inset 0 -2px 0 var(--orange); }
.nav-buy { height: 61px; background: var(--teal); color: #fff; box-shadow: 0 6px 15px rgba(41, 115, 115, .13); }
.nav-buy.selected { background: var(--teal-deep); }
.nav-item:active { transform: scale(.96); }

.search-field { height: 52px; margin: 22px 0 0; padding: 0 14px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 20px rgba(48, 47, 44, .055); transition: border-color .2s ease, box-shadow .2s ease; }
.search-field:focus-within { border-color: rgba(41, 115, 115, .57); box-shadow: 0 0 0 3px rgba(41, 115, 115, .1); }
.search-field svg { width: 19px; height: 19px; flex: none; color: var(--teal); }
.search-field input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-field input::placeholder, .form input::placeholder { color: #aaa9a6; opacity: 1; }
.directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.direction { min-width: 0; min-height: 81px; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); color: var(--ink); box-shadow: 0 8px 20px rgba(48, 47, 44, .05); text-align: left; font-size: 13px; font-weight: 770; transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s ease; }
.direction .flag { font-size: 25px; line-height: 1; flex: none; }
.direction small { display: block; margin-top: 3px; color: #cf6a3f; font-size: 11px; font-weight: 730; }
.results { display: grid; gap: 8px; }
.result-item { min-height: 59px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 5px 14px rgba(48, 47, 44, .035); transition: transform .2s var(--ease), border-color .2s ease; }
.result-item strong { font-size: 13px; font-weight: 760; }
.result-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.plan-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); box-shadow: 0 7px 19px rgba(48, 47, 44, .045); }
.plan-card + .plan-card { margin-top: 10px; }
.plan-card .split { align-items: start; }
.plan-card strong { font-size: 15px; font-weight: 780; }
.plan-card small { color: var(--muted); font-size: 11px; }
.plan-price { color: #c7643c; font-size: 16px; font-weight: 810; white-space: nowrap; }
.plan-card .secondary { min-height: 41px; margin-top: 14px; }

.form { display: grid; gap: 15px; }
.form label:not(.consent) { display: block; color: var(--ink); font-size: 12px; font-weight: 750; }
.form input:not([type=checkbox]) { width: 100%; min-height: 50px; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; transition: border-color .2s ease, box-shadow .2s ease; }
.form input:not([type=checkbox]):focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px rgba(41, 115, 115, .1); }
.form .primary { margin-top: 2px; }
.consent { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.consent input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--teal); }
.consent a { text-underline-offset: 2px; }

.profile-identity { display: flex; align-items: center; gap: 15px; }
.profile-identity .avatar { width: 68px; height: 68px; }
.profile-identity > div { min-width: 0; }
.profile-identity strong { display: block; font-size: 20px; font-weight: 800; line-height: 1.14; letter-spacing: -.035em; }
.profile-identity small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.profile-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 13px; font-size: 12px; }
.profile-fact strong { color: var(--teal); font-size: 21px; line-height: 1; font-weight: 820; }
.profile-email { min-width: 0; font-size: 12px; overflow-wrap: anywhere; text-align: right; }
.bonus-number { display: block; margin: 6px 0; color: var(--teal); font-size: 40px; font-weight: 850; line-height: 1; letter-spacing: -.055em; }
.profile-link { margin: 10px 0 0; color: var(--teal); font-size: 11px; overflow-wrap: anywhere; }
.text-action { padding: 4px 0; border: 0; background: none; color: var(--teal); font-size: 12px; font-weight: 750; text-align: left; }
.referral-card { background: #edf4f1; border-color: rgba(41, 115, 115, .09); }
.referral-card .secondary { border-color: rgba(41, 115, 115, .23); }

#screen-support:not([hidden]) { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(98px + env(safe-area-inset-bottom)); }
.chat-messages { display: grid; align-content: start; gap: 11px; flex: 1; min-height: 160px; overflow-y: auto; margin: 22px 0; padding: 2px; }
.chat-bubble { max-width: 85%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; background: var(--card); color: var(--ink); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 5px 12px rgba(48, 47, 44, .035); }
.chat-bubble.mine { justify-self: end; border-color: #d0e6df; border-radius: 16px 16px 5px 16px; background: #e6f2ee; }
.chat-form { display: flex; align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 18px rgba(48, 47, 44, .055); }
.chat-form:focus-within { border-color: rgba(41, 115, 115, .55); box-shadow: 0 0 0 3px rgba(41, 115, 115, .09); }
.chat-form input { min-width: 0; flex: 1; padding: 0 6px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.chat-form button { width: 39px; height: 39px; flex: none; display: grid; place-items: center; border: 0; border-radius: 11px; background: var(--teal); color: #fff; transition: transform .2s var(--ease), background .2s ease; }
.chat-form button:active { transform: scale(.94); background: var(--teal-deep); }
.chat-form svg { width: 17px; height: 17px; }
.screen .consent { margin-top: 12px; }
#support-consent[hidden] { display: none; }

/* Layout scales with the Telegram webview. */
:root {
  --surface: #fff;
  --shadow-card: 0 2px 4px #39393a06, 0 7px 20px #39393a09;
  --gutter: clamp(13px, 4vw, 24px);
}
.app-main { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.screen { padding: 20px var(--gutter) 24px; }
.eyebrow { font-size: 10px; letter-spacing: .08em; margin-bottom: 4px; }
h1 { font-size: clamp(29px, 7.6vw, 38px); letter-spacing: -.045em; }
.screen-head { align-items: center; }
.screen-head .avatar { width: clamp(64px, 19vw, 78px); height: auto; aspect-ratio: 1; }
.screen-head .eyebrow { color: var(--muted); }
.subcopy { font-size: 13px; margin-top: 4px; }
.screen-body { margin-top: 16px; }
.card, .empty-state, .plan-card { padding: 16px; border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-card); }
.section-heading { margin: 17px 2px 8px; }
.section-heading h2, .card h2 { font-size: 17px; }
.esim-card { display: flex; flex-direction: column; gap: 14px; min-height: 194px; padding: 12px 10px 10px; border: 1px solid var(--orange); }
.esim-photo { bottom: 43px; width: 48%; clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%); }
.esim-card-top { position: relative; width: 69%; }
.esim-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; }
.esim-title-line strong { font-size: 18px; line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
.esim-title-line .country-flag { font-size: 22px; line-height: 1; }
.esim-title-line .status { color: #246957; background: #e3f3eb; font-size: 10px; }
.esim-title-line .warning { color: #964d28; background: #fff1e6; }
.esim-order-line { margin-top: 4px; color: var(--muted); font-size: 11px; }
.esim-card .metrics { width: 54%; margin: 0; gap: 10px; }
.esim-card .meter-label { font-size: 11px; }
.card.esim-card .primary { min-height: 37px; margin-top: auto; border-radius: 10px; }
.quiet-card { min-height: 44px; justify-content: flex-start; padding: 6px 11px; border-radius: 10px; box-shadow: none; }
.quiet-card .country-flag { font-size: 23px; }
.quiet-card .quiet-card-main { flex: 1; margin: 0; line-height: 1.2; }
.quiet-card-main strong { color: var(--ink); }
.quiet-card .quiet-card-main span { margin: 0; }
.quiet-card > svg, .direction > svg, .result-item > svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.empty-state { padding: 20px; }
.empty-state h2 { font-size: 21px; }
.empty-state > p:last-child { margin-bottom: 0; }
.form input:not([type=checkbox]), .chat-form input, .search-field input { font-size: 16px; }
.form input[name=code] { font-variant-numeric: tabular-nums; letter-spacing: .25em; }
.detail-code { font-family: ui-monospace, monospace; }
.detail-qr { width: min(72%, 220px); height: auto; aspect-ratio: 1; }
.bottom-nav { min-height: 56px; padding: 4px var(--gutter) calc(5px + env(safe-area-inset-bottom)); grid-template-columns: 1fr 1.55fr 1fr 1fr; align-items: center; box-shadow: 0 -3px 16px #39393a08; }
.nav-item { height: 44px; font-size: 10px; gap: 1px; border-radius: 0; }
.nav-item svg { width: 18px; height: 18px; }
.nav-buy { flex-direction: row; gap: 5px; border-radius: 11px; box-shadow: none; }
.nav-item.selected:not(.nav-buy) { background: transparent; color: #bc522c; }
.search-field { margin-top: 14px; height: 44px; border-radius: 13px; }
.direction, .region-item { background: #fff; border-radius: 14px; box-shadow: var(--shadow-card); }
.direction { min-height: 64px; gap: 7px; padding: 9px; }
.direction-copy, .region-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.direction-copy strong, .region-copy strong { display: block; font-size: 14px; }
.region-item { gap: 9px; padding: 8px 11px; min-height: 52px; }
.region-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e7f2ef; color: var(--teal); flex: none; }
.region-price { color: #ae522e; font-weight: 760; font-size: 12px; }
.plan-card .secondary { background: var(--teal); color: white; }
.profile-identity .avatar { width: clamp(62px,21vw,100px); height: auto; aspect-ratio: 1; }
.rank-copy { flex: 1; border-left: 1px solid var(--line); padding-left: 13px; }
.discount-pill { display: inline-block; margin: 7px 0; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: #fff0e4; }
.discount-pill b { color: #b34c22; }
.rank-copy .meter { height: 6px; }
.rank-copy .meter i { background: var(--teal); }
.rank-copy .subcopy { font-size: 11px; }
.card h2 { margin: 0 0 10px; }
.referral-summary { display: grid; grid-template-columns: 2fr 3fr; gap: 12px; align-items: center; background: #eaf3f0; padding: 10px 12px; border-radius: 11px; }
.referral-summary span, .referral-summary p { font-size: 12px; line-height: 1.35; margin: 0; }
.referral-summary p { padding-left: 12px; border-left: 1px solid #ccdcd7; }
.bonus-number { font-size: 34px; margin: 0; }
.referral-card .primary { gap: 8px; margin-top: 10px; }
.account-card .divider { margin: 10px 0; }
.account-card .secondary { margin-top: 0; }
#screen-support:not([hidden]) { min-height: calc(100dvh - 68px - env(safe-area-inset-bottom)); padding-bottom: 8px; }
.chat-bubble { box-shadow: none; }
.chat-bubble.mine { background: var(--teal); color: white; }
.chat-form { border-radius: 17px; }
@media (max-width:360px) { .direction { gap: 5px; } .direction .flag { font-size: 21px; } .screen-head .subcopy { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@keyframes screen-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes meter-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes breathe { 50% { opacity: .58; } }
