/* ProxyData Mini App — stylesheet.
 *
 * THEME STRATEGY. Every colour is a token on :root defined as
 *   var(--tg-<something>, <V3.1 fallback>)
 * so the app adopts the surrounding Telegram client's palette when telegram.js has set those
 * variables, and falls back to the V3.1 dark design otherwise. Rules below reference only the
 * app's own tokens (--bg, --panel, --text, --accent, …) — never --tg-* directly — so there is
 * exactly one place to change when a token's meaning shifts, and a screen can never
 * accidentally hard-code a colour that ignores the user's theme.
 *
 * The accent stays ours in both modes: #00E5FF is brand, not chrome, and a Telegram theme's
 * button colour would make the product unrecognisable between clients.
 *
 * No @import, no external font, no remote image — Phase 1 makes zero external requests, and a
 * stylesheet is the easiest place to leak one by accident.
 */

:root {
  --bg:            var(--tg-bg, #05070c);
  --bg-grad-top:   #0c1322;
  --panel:         var(--tg-secondary-bg, rgba(255, 255, 255, .035));
  --panel-strong:  rgba(255, 255, 255, .06);
  --panel-line:    rgba(255, 255, 255, .07);
  --text:          var(--tg-text, #ffffff);
  --muted:         var(--tg-hint, #8fa0b8);
  --dim:           #4b5768;
  --accent:        #00E5FF;
  --accent-soft:   #7df0ff;
  --accent-dim:    rgba(0, 229, 255, .12);
  --ok:            #3ddc97;
  --warn:          #ffb454;
  --danger:        #ff6b6b;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;

  --topbar-h: 52px;
  --tabbar-h: 60px;
  --col: 390px;

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); }

/* V3.1 hides scrollbars entirely — the app is a phone surface, not a document. */
::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

@keyframes fadeIn  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(100%); }            to { transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes skel    { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes spin    { to { transform: rotate(360deg); } }

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

/* ── shell ─────────────────────────────────────────────────────────────────── */

.app {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 0%, var(--bg-grad-top), var(--bg) 70%);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(5, 7, 12, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-line);
}
.topbar__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar__logo {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #2a6cff);
  box-shadow: 0 0 10px rgba(0, 229, 255, .45);
}
.topbar__title { font-weight: 650; font-size: 15px; letter-spacing: .2px; }
.topbar__right { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-dim); color: var(--accent);
  font-size: 12px; font-weight: 700;
}

.screen {
  flex: 1 1 auto;
  padding: 14px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  overflow-y: auto;
  animation: fadeIn .22s ease both;
}
.screen-home, .screen-accesses, .screen-detail { display: block; }

.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 30;
  width: 100%; max-width: var(--col);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(5, 7, 12, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--panel-line);
}
.tab {
  background: none; border: 0; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--dim); font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
  transition: color .15s ease;
}
.tab__icon { font-size: 17px; line-height: 1; }
.tab--active { color: var(--accent); }

.staging-banner {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .4px;
  background: #3a2a00; color: var(--warn); border-top: 1px solid rgba(255, 180, 84, .3);
}
.staging-banner--visible { display: block; }

/* ── primitives ────────────────────────────────────────────────────────────── */

.stack { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  padding: 14px;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row__label { color: var(--muted); font-size: 12.5px; }
.row__value { font-weight: 600; font-size: 13px; text-align: right; word-break: break-all; }

.muted { color: var(--muted); font-size: 12.5px; }

.section { display: flex; flex-direction: column; gap: 10px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section__title { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--dim); }
.section__count { font-size: 12px; color: var(--muted); }
.section__link { font-size: 12px; color: var(--accent); cursor: pointer; background: none; border: 0; font-family: inherit; padding: 0; }

.btn {
  appearance: none; border: 0; cursor: pointer; font-family: inherit;
  border-radius: var(--r-md); padding: 11px 16px;
  font-size: 13.5px; font-weight: 650; letter-spacing: .2px;
  transition: transform .1s ease, opacity .15s ease, background .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #041016; }
.btn--primary:hover:not(:disabled) { background: var(--accent-soft); }
.btn--ghost { background: var(--panel-strong); color: var(--text); }
.btn--danger { background: rgba(255, 107, 107, .16); color: var(--danger); }

.chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
}
.chip--ok    { background: rgba(61, 220, 151, .14); color: var(--ok); }
.chip--warn  { background: rgba(255, 180, 84, .14); color: var(--warn); }
.chip--muted { background: var(--panel-strong); color: var(--muted); }

.bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #2a6cff); transition: width .3s ease; }

.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton__line { height: 54px; border-radius: var(--r-md); background: var(--panel); animation: skel 1.3s ease-in-out infinite; }

.empty { text-align: center; padding: 34px 18px; }
.empty__title { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.empty__sub { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin-bottom: 16px; }

.errorpanel { text-align: center; padding: 34px 18px; }
.errorpanel__title { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.errorpanel__sub { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }

/* The honest-unavailability panel. Deliberately calm rather than alarming: a deferred feature
 * is a plan, not an error, and it must not read as a crash. */
.blocked {
  background: var(--panel); border: 1px dashed rgba(255, 180, 84, .35);
  border-radius: var(--r-lg); padding: 18px; text-align: center;
}
.blocked__badge {
  display: inline-block; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 180, 84, .14); color: var(--warn);
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.blocked__title { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.blocked__reason { font-size: 12.5px; color: var(--warn); font-weight: 600; margin-bottom: 8px; word-break: break-word; }
.blocked__note { font-size: 12px; color: var(--muted); line-height: 1.55; }

.note { border-radius: var(--r-md); padding: 11px 13px; font-size: 12.5px; line-height: 1.5; }
.note--info   { background: var(--accent-dim); color: var(--accent-soft); }
.note--warn   { background: rgba(255, 180, 84, .1); color: var(--warn); }
.note--muted  { background: var(--panel); color: var(--muted); }
.note__title  { font-weight: 650; margin-bottom: 3px; }
.note__sub    { opacity: .82; }

.decision { background: var(--panel); border-left: 2px solid var(--warn); border-radius: var(--r-sm); padding: 10px 12px; }
.decision__title { font-size: 12px; font-weight: 700; color: var(--warn); margin-bottom: 4px; }
.decision__body { font-size: 12px; color: var(--muted); line-height: 1.55; }

.copyrow, .credrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--panel-line); }
.copyrow:last-child, .credrow:last-child { border-bottom: 0; }
.copyrow__label, .credrow__label { color: var(--muted); font-size: 12px; flex: 0 0 88px; }
.copyrow__value, .credrow__value { flex: 1 1 auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.credrow__value--masked { letter-spacing: 2px; color: var(--muted); }
.copyrow__btn, .credrow__btn, .credrow__toggle {
  flex: 0 0 auto; background: var(--panel-strong); border: 0; cursor: pointer; font-family: inherit;
  color: var(--accent); border-radius: var(--r-sm); padding: 5px 10px; font-size: 11.5px; font-weight: 650;
}
.credrow__actions { display: flex; gap: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: 650; color: var(--muted); }
.field__hint { font-size: 11.5px; color: var(--dim); }
.field__control {
  width: 100%; background: rgba(0, 0, 0, .28); color: var(--text);
  border: 1px solid var(--panel-line); border-radius: var(--r-md);
  padding: 10px 12px; font-family: inherit; font-size: 13px;
}
.field__control:focus { outline: none; border-color: var(--accent); }
.field__control:disabled { opacity: .5; cursor: not-allowed; }
.field__control--area { min-height: 132px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.field__control--select { appearance: none; }

.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chipset__chip {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r-md);
  padding: 8px 11px; font-family: inherit; color: var(--text); font-size: 12.5px;
}
.chipset__chip--on { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.chipset__icon { font-size: 14px; }
.chipset__label { font-weight: 600; }
.chipset__desc { color: var(--muted); font-size: 11.5px; }

.navlist { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r-lg); overflow: hidden; }
.navlist__body { display: flex; flex-direction: column; }
.navlist__item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--panel-line);
  cursor: pointer; font-family: inherit; color: var(--text); padding: 13px 14px;
}
.navlist__item:last-child { border-bottom: 0; }
.navlist__item:active { background: var(--panel-strong); }
.navlist__item--external .navlist__chevron { color: var(--accent); }
.navlist__icon { font-size: 17px; width: 22px; text-align: center; color: var(--accent); flex-shrink: 0; }
.navlist__label { font-size: 13.5px; font-weight: 600; }
.navlist__sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.navlist__chevron { margin-left: auto; color: var(--dim); font-size: 15px; }

.factlist, .speclist { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r-lg); padding: 4px 14px; }
.factlist__body, .speclist__body { display: flex; flex-direction: column; }
.factlist__item, .speclist__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--panel-line); }
.factlist__item:last-child, .speclist__row:last-child { border-bottom: 0; }
.factlist__label, .speclist__label { color: var(--muted); font-size: 12.5px; }
.speclist__value { font-weight: 600; font-size: 13px; text-align: right; }
.speclist__value--pending { color: var(--dim); font-weight: 500; font-style: italic; }
.speclist__hint { font-size: 11.5px; color: var(--dim); padding: 0 0 10px; }

/* ── home ──────────────────────────────────────────────────────────────────── */

.hero, .summary { text-align: center; padding: 22px 14px 18px; }
.hero__label, .summary__label { font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.hero__figure, .summary__figure { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.hero__value, .summary__value { font-size: 42px; font-weight: 700; letter-spacing: -1.4px; line-height: 1; }
.hero__unit, .summary__unit { font-size: 17px; font-weight: 650; color: var(--muted); }
/* The V3.1 product rule: the sum is a display aggregate, NOT a shared pool. */
.hero__sub, .summary__meta { margin-top: 9px; font-size: 12px; color: var(--muted); }
.hero__note { margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.summary__head { display: flex; align-items: center; justify-content: center; gap: 8px; }
.home__actions { display: flex; flex-direction: column; gap: 10px; }

.lowstrip { background: rgba(255, 180, 84, .09); border: 1px solid rgba(255, 180, 84, .22); border-radius: var(--r-md); padding: 11px 13px; }
.lowstrip__title { font-size: 12.5px; font-weight: 650; color: var(--warn); margin-bottom: 6px; }
.lowstrip__list { display: flex; flex-direction: column; gap: 4px; }
.lowstrip__item { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.lowstrip__label { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lowstrip__value { color: var(--warn); font-weight: 650; }

.access-mini { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font-family: inherit; color: var(--text); padding: 11px 0; border-bottom: 1px solid var(--panel-line); }
.access-mini:last-child { border-bottom: 0; }
.access-mini__main { flex: 1 1 auto; min-width: 0; }
.access-mini__label { font-size: 13px; font-weight: 600; }
.access-mini__meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.access-mini__chevron { color: var(--dim); }

/* ── accesses ──────────────────────────────────────────────────────────────── */

.access-row {
  display: flex; flex-direction: column; gap: 9px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r-lg);
  cursor: pointer; font-family: inherit; color: var(--text); padding: 13px 14px;
}
.access-row:active { background: var(--panel-strong); }
.access-row__head { display: flex; align-items: center; gap: 8px; }
.access-row__left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.access-row__pkg { font-size: 13.5px; font-weight: 650; }
.access-row__chevron { margin-left: auto; color: var(--dim); }
.access-row__bar { width: 100%; }
.access-row__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.access-row__label, .access-row__meta { font-size: 11.5px; color: var(--muted); }
.access-row__speed { font-size: 11.5px; color: var(--accent); font-weight: 600; }

/* ── access detail ─────────────────────────────────────────────────────────── */

.conn { display: flex; flex-direction: column; }
.conn__row { display: flex; flex-direction: column; gap: 4px; }

.pool { display: flex; flex-direction: column; }
.pool__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--panel-line); }
.pool__row:last-child { border-bottom: 0; }
.pool__label { color: var(--muted); font-size: 12.5px; }
.pool__value { font-weight: 600; font-size: 13px; }
.pool__hint { font-size: 11.5px; color: var(--dim); padding-top: 8px; }

.usage { display: flex; flex-direction: column; gap: 10px; }
.usage__percent { font-size: 26px; font-weight: 700; letter-spacing: -.6px; }
.usage__counters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.usage__counter { background: rgba(0, 0, 0, .22); border-radius: var(--r-md); padding: 10px 12px; }
.usage__counter-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .4px; }
.usage__counter-value { font-size: 14px; font-weight: 650; margin-top: 3px; }

/* ── tools / checker ───────────────────────────────────────────────────────── */

.tools { display: flex; flex-direction: column; gap: 12px; }

.checker { display: flex; flex-direction: column; gap: 12px; }
.checker__controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.checker__count { font-size: 12px; color: var(--muted); }
.checker__proto { display: flex; gap: 6px; }
.checker__proto-btn { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r-sm); padding: 6px 11px; cursor: pointer; font-family: inherit; color: var(--muted); font-size: 12px; font-weight: 600; }
.checker__proto-btn--on { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.checker__input { width: 100%; }
.checker__results { display: flex; flex-direction: column; gap: 10px; }
.checker__summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.checker__summary-count { font-size: 12.5px; font-weight: 650; }
.checker__summary-count--alive { color: var(--ok); }
.checker__summary-count--dead { color: var(--danger); }
.checker__summary-actions { display: flex; gap: 6px; }
.checker__group { display: flex; flex-direction: column; gap: 6px; }
.checker__group-title { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--dim); }
.checker__row { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r-md); padding: 9px 11px; }
.checker__row--alive { border-left: 2px solid var(--ok); }
.checker__row--dead { border-left: 2px solid var(--danger); }
.checker__row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.checker__row-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.checker__line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.checker__status { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0; }
.checker__status--alive { color: var(--ok); }
.checker__status--dead { color: var(--danger); }
.checker__status--invalid { color: var(--warn); }
.checker__cols { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.checker__col { display: flex; gap: 5px; align-items: baseline; }
.checker__col-label { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .3px; }
.checker__col-value { font-size: 12px; font-weight: 600; }

/* ── buy ───────────────────────────────────────────────────────────────────── */

.buy { display: flex; flex-direction: column; gap: 12px; }
.buy__actions { display: flex; flex-direction: column; gap: 8px; }
.buy__blocked { display: flex; flex-direction: column; gap: 10px; }
.buy__reasons { display: flex; flex-direction: column; gap: 8px; }
.buy__reason { font-size: 12px; color: var(--muted); line-height: 1.55; }

.pkg { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r-lg); padding: 13px 14px; }
.pkg--unlimited { border-color: rgba(0, 229, 255, .28); }
.pkg__main { min-width: 0; }
.pkg__title { font-size: 14px; font-weight: 650; }
.pkg__sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pkg__price { text-align: right; flex-shrink: 0; }
.pkg__price-amount { font-size: 14px; font-weight: 700; }
/* "REFERENCE ONLY" must not read as a price. Dim and uppercase, never accent-coloured. */
.pkg__price-tag { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--dim); margin-top: 2px; }

/* ── profile / activity / legal ────────────────────────────────────────────── */

.profile { display: flex; flex-direction: column; gap: 12px; }
.profile__head { display: flex; align-items: center; gap: 13px; }
.profile__avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); font-size: 21px; font-weight: 700; flex-shrink: 0; }
.profile__ident { min-width: 0; }
.profile__name { font-size: 16px; font-weight: 650; }
.profile__handle { font-size: 13px; color: var(--accent); }
.profile__auth { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.profile__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.profile__stat { background: var(--panel); border-radius: var(--r-md); padding: 11px 13px; }
.profile__stat-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .4px; }
.profile__stat-value { font-size: 16px; font-weight: 700; margin-top: 3px; }

.activity { display: flex; flex-direction: column; }
.activity__row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--panel-line); }
.activity__row:last-child { border-bottom: 0; }
.activity__main { flex: 1 1 auto; min-width: 0; }
.activity__label { font-size: 13px; font-weight: 600; }
.activity__meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.activity__id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--dim); }
.activity__date { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.activity__state { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }

.legal { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; padding: 10px 0 4px; }
.legal__link { font-size: 11.5px; color: var(--dim); cursor: pointer; background: none; border: 0; font-family: inherit; padding: 0; }
.legal__link:hover { color: var(--muted); }

/* ── parser / referral / wallet (deferred screens) ─────────────────────────── */

.parser, .referral, .wallet { display: flex; flex-direction: column; gap: 12px; }
.parser__lead { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* The disabled design preview: visible so the intent is legible, unmistakably inert so nobody
 * mistakes it for a working control. */
.preview { position: relative; opacity: .55; pointer-events: none; filter: saturate(.6); }
.preview__badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 2px 8px; border-radius: 999px; background: rgba(255, 180, 84, .16); color: var(--warn);
  font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.preview__grid { display: flex; flex-direction: column; gap: 10px; }

/* ── toasts + sheets ───────────────────────────────────────────────────────── */

.toasts { position: fixed; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; width: min(var(--col), 100%); padding: 0 14px; pointer-events: none; }
.toast { background: rgba(20, 26, 38, .97); border: 1px solid var(--panel-line); border-radius: var(--r-md); padding: 9px 13px; font-size: 12.5px; text-align: center; animation: toastIn .18s ease both; box-shadow: 0 6px 22px rgba(0, 0, 0, .45); }
.toast--info  { color: var(--text); }
.toast--ok    { color: var(--ok); }
.toast--error { color: var(--danger); }
.toast--warn  { color: var(--warn); }
.toast--out   { opacity: 0; transition: opacity .2s ease; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: var(--col); max-height: 86dvh; display: flex; flex-direction: column; background: #0f1420; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: sheetUp .24s ease both; padding-bottom: env(safe-area-inset-bottom); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px 11px; border-bottom: 1px solid var(--panel-line); }
.sheet__title { font-size: 15px; font-weight: 650; }
.sheet__close { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 15px; font-family: inherit; padding: 4px; }
.sheet__body { padding: 15px 16px 22px; overflow-y: auto; }

/* ── wide viewports ────────────────────────────────────────────────────────── */
/* Telegram Desktop renders the Mini App in a narrow panel, but the staging dev server is
 * opened in a normal browser. Keep the phone column and give it an edge so it reads as a
 * device rather than a broken full-width page. */
@media (min-width: 430px) {
  .app { border-left: 1px solid var(--panel-line); border-right: 1px solid var(--panel-line); min-height: 100dvh; }
}
