/* ============================================================
   GreenLight cabinet — redesign (Этап 3 Jinja port)
   Self-contained stylesheet for migrated cabinet screens.
   Does NOT load alongside app.css (class-name collisions).
   Source of truth: redesign/mockups/ (shell.css + per-screen).
   ============================================================ */

/* ============================================================
   Green Light — redesign mockups
   Shared design tokens + app shell (premium minimal · dark)
   Reference sensibility: Apple dark product pages / Stripe calm
   ============================================================ */

:root {
  /* --- surfaces (near-black, slightly cool, layered) --- */
  --bg:            #08090b;
  --bg-elev:       #0e0f12;
  --surface:       #141519;
  --surface-2:     #191b20;
  --surface-hover: #1d1f25;

  /* --- hairlines --- */
  --line:        rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);

  /* --- text --- */
  --text:      #f4f5f7;
  --text-2:    rgba(244, 245, 247, .64);   /* secondary, ~4.5:1 on --bg */
  --text-3:    rgba(244, 245, 247, .48);   /* labels only, non-essential */

  /* --- accent: restrained emerald, NOT neon --- */
  --accent:        #34d17e;
  --accent-soft:   rgba(52, 209, 126, .14);
  --accent-line:   rgba(52, 209, 126, .34);
  --accent-text:   #4ade9a;

  /* --- states --- */
  --warn:      #e0a341;
  --warn-soft: rgba(224, 163, 65, .13);
  --danger:    #e5705a;

  /* --- shape --- */
  --r-card: 18px;
  --r-btn:  11px;
  --r-pill: 999px;

  /* --- type --- */
  --font: "Neue Montreal", -apple-system, BlinkMacSystemFont, "SF Pro Display",
          "Segoe UI", Inter, system-ui, sans-serif;

  --shadow-card: 0 1px 0 rgba(255,255,255,.02) inset, 0 18px 40px -28px rgba(0,0,0,.9);
}

* { box-sizing: border-box; }

/* Keep SVG icons out of the inline text baseline and centered in flex/grid controls. */
svg {
  display: block;
  flex: none;
  vertical-align: middle;
}
button > svg,
a > svg,
[class$="-ico"] > svg,
[class$="-icon"] > svg {
  align-self: center;
  justify-self: center;
}
[class$="-ico"],
[class$="-icon"] {
  line-height: 0;
}

/* tabular figures for counters / dates / prices (ui-ux: number-tabular) */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* visible focus rings (ui-ux a11y: focus-states) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: var(--r-btn);
}

/* respect reduced motion (ui-ux a11y: reduced-motion) */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:active { transform: none !important; }
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

/* subtle top vignette so it doesn't read as flat black */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 520px at 22% -8%, rgba(52,209,126,.06), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(80,110,255,.04), transparent 55%);
  z-index: 0;
}

/* ---------- shell layout ---------- */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(256px, 256px) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  width: 256px;
  min-width: 256px;
  height: 100dvh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px 2px;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.brand b { font-weight: 600; }
.brand span { color: var(--accent-text); font-weight: 600; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 1.06rem;
  font-weight: 580;
  transition: background .15s ease, color .15s ease;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 640;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.nav a.is-active svg { color: var(--accent-text); opacity: 1; }

.side-foot {
  margin-top: auto;
  padding: 0 10px;
  font-size: .78rem;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.side-foot a {
  color: var(--text-3);
  text-decoration: none;
}
.side-foot a:hover {
  color: var(--text-2);
}
.side-foot a.is-active {
  color: var(--accent-text);
}

/* ---------- main / page ---------- */
.main {
  padding: clamp(34px, 5vw, 64px) clamp(24px, 5vw, 72px);
  width: 100%;           /* fill the grid track — without this a grid item with
                            margin:auto shrinks to its content width (the bug) */
  max-width: 960px;
  margin-inline: auto;   /* centre the column within the post-sidebar area */
}

.page-head { margin-bottom: 34px; }
.page-head .eyebrow {
  display: inline-block;
  font-size: .76rem;
  font-weight: 560;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.page-head h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 540;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.page-head p {
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 1.02rem;
  max-width: 52ch;
  line-height: 1.5;
}

/* ---------- shared atoms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 520;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(180deg, #46d98c, var(--accent));
  color: #052012;
  font-weight: 560;
  box-shadow: 0 6px 20px -8px rgba(52,209,126,.5), inset 0 1px 0 rgba(255,255,255,.2);
  transition: background .15s, box-shadow .15s, transform .12s ease;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #54e29a, #3bd585);
  box-shadow: 0 9px 26px -8px rgba(52,209,126,.62), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:active {
  box-shadow: 0 4px 14px -8px rgba(52,209,126,.5);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--text-3); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 520;
  letter-spacing: 0;
}
.pill-ok {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-line);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-muted {
  background: rgba(255,255,255,.04);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid rgba(224,163,65,.3);
}

/* ---------- mobile bottom tab bar (≤5 items, ui-ux: bottom-nav-limit) ---------- */
.mobile-nav { display: none; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main {
    padding: 26px 16px calc(90px + env(safe-area-inset-bottom, 0px));   /* small mobile gutter */
    max-width: none;
    margin-inline: 0;   /* reset desktop auto-centering so the grid item fills the row */
    width: 100%;
    min-width: 0;       /* grid item defaults to min-width:auto → 1fr track grows past the
                           viewport under wide content and clips it; 0 lets it shrink to fit */
  }
  /* .page-head shares the .main gutter (16px) so the heading lines up with the cards */

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: rgba(14, 15, 18, .92);
    -webkit-backdrop-filter: blur(16px);
            backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 48px;             /* touch target */
    color: var(--text-3);
    text-decoration: none;
    font-size: .66rem;
    font-weight: 480;
    letter-spacing: -0.01em;
  }
  .mobile-nav a svg { width: 22px; height: 22px; }
  .mobile-nav a.is-active { color: var(--accent-text); }
  .mobile-nav a:active { color: var(--text); }
}


/* ============================================================
   subscriptions list (from subs-c.html)
   ============================================================ */
/* ===== Variant C — "Spotlight" (refined per ui-ux-pro-max + Magic inspiration) =====
   - SVG icons instead of emoji  (no-emoji-icons)
   - tabular figures on counters/dates  (number-tabular)
   - icon-led meta list  (adapted from 21st.dev subscription card)
   - faint dot-grid texture  (adapted from 21st.dev demo background)
*/

/* faint dot-grid texture — pure CSS, zero asset weight */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(1100px 700px at 30% 0%, #000, transparent 80%);
          mask-image: radial-gradient(1100px 700px at 30% 0%, #000, transparent 80%);
}

/* mode glyph used in hero + rows */
.mode-ico { width: 18px; height: 18px; flex: none; }
.mode-ico.is-backup { color: var(--warn); }
.mode-ico.is-main   { color: var(--accent-text); }

/* icon-led meta list inside hero (adapted from Magic subscription card) */
.sub-hero-meta {
  display: flex;
  gap: 24px;                         /* equal thirds → even spacing */
  margin: 0 0 24px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}
.meta { flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0; }
.sub-hero-meta .meta:nth-child(2) { justify-content: center; }
.sub-hero-meta .meta:last-child  { justify-content: flex-end; }
.meta-ico {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--accent-text);
}
.meta-ico svg { width: 17px; height: 17px; }
.meta-ico.is-main   { color: var(--accent-text); }
.meta-ico.is-backup { color: var(--warn); }
.meta-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meta-txt .k { color: var(--text-3); font-size: .76rem; letter-spacing: .02em; line-height: 1; }
.meta-txt .v { color: var(--text); font-size: .94rem; font-weight: 480; line-height: 1; white-space: nowrap; }

@media (max-width: 640px) {
  /* mobile: spec-sheet rows — label left, value right, full width */
  .sub-hero-meta { flex-direction: column; gap: 0; }
  .meta {
    width: 100%;
    gap: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .meta:first-child { padding-top: 4px; }
  .meta:last-child  { border-bottom: 0; padding-bottom: 0; }
  .meta-ico { display: none; }
  .meta-txt {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
  }
  .meta-txt .k { font-size: .9rem; color: var(--text-2); line-height: 1.2; }
  .meta-txt .v { line-height: 1.2; }

  /* (1) page heading + section head centred on phone */
  .page-head { text-align: center; }
  .sub-sub-head { justify-content: center; }

  /* (2B) drop the billboard counter; surface the days at the progress bar */
  .sub-hero-days { display: none; }
  .sub-hero-bar .head { display: block; }
  .bar-left { display: inline; }

  /* (3) rows: 2-line meta + full-width action button below */
  .sub-row {
    grid-template-columns: auto 1fr;
    padding: 14px 16px;
    row-gap: 14px;
  }
  .row-action { grid-column: 1 / -1; }
  .row-action .btn { width: 100%; }
  .row-chevron { display: none; }
  .row-dim { display: block; margin-top: 3px; color: var(--text-3); font-size: .82rem; }
  .row-sep { display: none; }

  /* phone: tighter hero padding */
  .sub-hero { padding: 24px 18px; border-radius: 16px; }
}

/* full-bleed across the whole mobile range (sidebar hidden ≤820) — kept inline so it
   doesn't depend on shell.css being re-fetched from cache */
@media (max-width: 820px) {
  .main {
    margin-inline: 0;        /* auto margins were shrinking+centring the grid item */
    max-width: none;
    width: 100%;
    padding-left: 16px;      /* small breathing gutter */
    padding-right: 16px;
  }
  .sub-sub-head { margin-left: 0; }
}

/* ---------- hero card ---------- */
.sub-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(680px 280px at 6% -25%, rgba(52,209,126,.10), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8), var(--shadow-card);
  margin-bottom: 28px;
}
.sub-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.sub-hero-titlerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sub-hero-name { font-size: 1.5rem; font-weight: 540; letter-spacing: -0.025em; }
.sub-hero-sub  { margin-top: 7px; color: var(--text-2); font-size: .94rem; }
.sub-hero-days { text-align: right; line-height: 1; }
.sub-hero-days .num {
  font-size: 2.5rem;
  font-weight: 540;
  letter-spacing: -0.04em;
}
.sub-hero-days .lbl { color: var(--text-2); font-size: .85rem; margin-top: 6px; }

.sub-hero-bar { margin-bottom: 26px; }
.sub-hero-bar .head {
  display: none;                /* desktop: bar is a pure visual; days in counter, date in meta */
  margin-bottom: 9px;
  font-size: .82rem; color: var(--text-2);
}
.sub-hero-bar .track {
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.sub-hero-bar .fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #5ee9a6);
}
.sub-hero-actions { display: flex; gap: 12px; }
.sub-hero-actions .btn { flex: 1; height: 46px; }

/* hero "expiring soon" (paid, ≤7 days) — orange treatment */
.sub-hero.is-expiring {
  border-color: rgba(224,163,65,.34);
  background:
    radial-gradient(680px 280px at 6% -25%, rgba(224,163,65,.10), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}
.sub-hero.is-expiring .sub-hero-bar .fill { background: linear-gradient(90deg, var(--warn), #f0c270); }

/* ---------- secondary section ---------- */
.sub-sub-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 14px 2px;
}
.sub-sub-head h2 { margin: 0; font-size: 1.02rem; font-weight: 520; }
.sub-sub-head span { color: var(--text-3); font-size: .88rem; }

.sub-rows { display: flex; flex-direction: column; gap: 10px; }
.sub-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.row-action { display: flex; align-items: center; }
.row-chevron { display: none; }   /* desktop: text button only */
.bar-left { display: none; }      /* desktop: big counter carries the days */
.sub-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.sub-row:active { transform: scale(.995); }
.sub-row .row-mode {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.sub-row .row-mode svg { width: 19px; height: 19px; }
.sub-row .row-mode.is-active   { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.sub-row .row-mode.is-expiring { color: var(--warn); border-color: rgba(224,163,65,.34); background: var(--warn-soft); }
.sub-row .row-mode.is-expired  { color: var(--danger); border-color: rgba(229,112,90,.30); background: rgba(229,112,90,.10); }
.sub-row .row-info { min-width: 0; }
.sub-row .btn { min-width: 132px; }   /* keep «Управлять» and «Продлить» the same width */
.sub-row .row-name { font-weight: 500; font-size: 1rem; }
.sub-row .row-meta { color: var(--text-2); font-size: .88rem; margin-top: 3px; }
.sub-row.is-expired { opacity: .9; }

@media (prefers-reduced-motion: reduce) {
  .sub-row { transition: background .15s, border-color .15s; }
  .sub-row:active { transform: none; }
}

/* "add another subscription" tile */
.sub-add {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
  color: inherit; text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.sub-add:hover { border-color: var(--accent); background: rgba(52,209,126,.14); }
.sub-add:active { transform: scale(.995); }
.sub-add-ico {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.sub-add-ico svg { width: 20px; height: 20px; }
.sub-add-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sub-add-name { font-weight: 520; font-size: 1rem; color: var(--text); }
.sub-add-sub { color: var(--text-2); font-size: .88rem; }
.sub-add-arrow { color: var(--accent-text); display: grid; place-items: center; }
.sub-add-arrow svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  .sub-add { transition: background .15s, border-color .15s; }
  .sub-add:active { transform: none; }
}

/* coloured status word at the start of the row meta */
.st { font-weight: 520; }
.st-active   { color: var(--accent-text); }
.st-expiring { color: var(--warn); }
.st-expired  { color: var(--danger); }

/* ============================================================
   profile (from profile.html)
   ============================================================ */
/* ── profile hero ── */
.profile-hero {
  display: flex; align-items: center; gap: 20px; margin-bottom: 36px;
}
.avatar {
  width: 72px; height: 72px; flex: none; border-radius: 50%;
  background: var(--accent-soft); border: 2px solid var(--accent-line);
  display: grid; place-items: center;
  font-size: 1.55rem; font-weight: 620; color: var(--accent-text); letter-spacing: -0.02em;
}
/* email-shape блок выше (email + подпись + кнопка) → крупнее аватар, чтобы совпасть по высоте */
.profile-hero.is-email .avatar { width: 86px; height: 86px; font-size: 1.95rem; }
.profile-name  { font-size: 1.15rem; font-weight: 580; color: var(--text); }
.profile-meta  { margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-handle { color: var(--text-2); font-size: .9rem; }
.profile-id {
  color: var(--text-3); font-size: .8rem;
  padding: 2px 7px; background: rgba(255,255,255,.04);
  border: 1px solid var(--line); border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
/* hero: email shape */
.hero-sub { margin-top: 4px; color: var(--text-2); font-size: .9rem; }
.hero-link-tg {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 11px;
  height: 32px; padding: 0 13px; border-radius: var(--r-pill);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text); font-size: .82rem; font-weight: 540;
  cursor: pointer; font-family: inherit; text-decoration: none;
  transition: background .15s;
}
.hero-link-tg:hover { background: rgba(52,209,126,.2); }
.hero-link-tg svg { width: 14px; height: 14px; }

/* ── card stack ── */
.profile-cards { display: flex; flex-direction: column; gap: 10px; }

.profile-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
}

/* card top row: icon + label/value + optional action */
.card-top {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
}
.card-ico {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--text-3);
}
.card-ico svg { width: 18px; height: 18px; }
.card-info { flex: 1; min-width: 0; }
.card-label { font-size: .76rem; font-weight: 560; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.card-value { font-size: .97rem; font-weight: 520; color: var(--text); margin-top: 3px; }
.card-action { flex: none; }
.profile-action-btn {
  width: 96px;
  height: 34px;
  padding: 0 12px;
  font-size: .84rem;
}

.card-sep  { margin: 0; border: 0; border-top: 1px solid var(--line); }
.card-body { padding: 16px 20px; }

/* grouped identity card */
.card-group-head {
  padding: 16px 20px 2px; font-size: .76rem; font-weight: 560;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-3);
}

/* ── slot / email states ── */
.email-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.slot-none-value { color: var(--text-3); }
.badge-ok {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text); font-size: .74rem; font-weight: 560;
}
.badge-ok svg { width: 11px; height: 11px; }
.badge-warn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  background: var(--warn-soft); border: 1px solid rgba(224,163,65,.3);
  color: var(--warn); font-size: .74rem; font-weight: 560;
}
.badge-warn svg { width: 11px; height: 11px; }

/* info strip below a slot (benefit / pending action) */
.info-strip {
  display: flex; gap: 10px; align-items: center;
  padding: 13px 16px; border-top: 1px solid var(--line);
  color: var(--text-2); font-size: .86rem; line-height: 1.5;
}
.info-strip svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.info-strip.is-warn { background: var(--warn-soft); border-top-color: rgba(224,163,65,.2); }
.info-strip.is-warn svg { color: var(--warn); }
.info-strip a { color: var(--accent-text); text-decoration: none; font-weight: 520; }

/* ── balance ── */
.balance-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.balance-num {
  font-size: 1.05rem; font-weight: 560; letter-spacing: -0.02em; line-height: 1;
  color: var(--text); font-variant-numeric: tabular-nums;
}

/* ── referral ── */
.ref-desc { font-size: .9rem; color: var(--text-2); line-height: 1.5; margin: 0 0 14px; }
.ref-desc strong { color: var(--text); font-weight: 520; }
.ref-link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px;
}
.ref-link-text {
  flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: .82rem;
  color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ref-copy {
  appearance: none; flex: none;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font: inherit; font-size: .8rem; font-weight: 520;
  transition: color .15s, background .15s, border-color .15s;
}
.ref-copy:hover { background: var(--surface-hover); border-color: var(--text-3); }
.ref-copy.is-copied { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.ref-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%; gap: 0; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.ref-stat { min-width: 0; padding-inline: 10px; text-align: center; }
.ref-stat-val { font-size: 1.4rem; font-weight: 580; color: var(--text); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ref-stat-lbl { font-size: .78rem; color: var(--text-3); margin-top: 2px; }

/* referral locked (no Telegram) */
.ref-empty { padding: 8px 20px 22px; text-align: center; }
.ref-empty p { margin: 0 auto; max-width: 36ch; color: var(--text-2); font-size: .9rem; line-height: 1.5; }
.ref-empty .btn { margin-top: 16px; }

/* ── post-link toast ── */
.toast {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px; padding: 13px 16px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 12px; color: var(--accent-text); font-size: .9rem; font-weight: 500;
}
.toast[hidden] { display: none; }
.toast svg { width: 17px; height: 17px; flex: none; }

/* ── logout ── */
.logout-wrap { margin-top: 28px; }
.logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 44px; border-radius: var(--r-btn);
  background: transparent; border: 1px solid rgba(229,112,90,.22);
  color: var(--danger); font: inherit; font-size: .92rem; font-weight: 520; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.logout-btn:hover { background: rgba(229,112,90,.08); border-color: rgba(229,112,90,.4); }
.logout-btn svg { width: 16px; height: 16px; }
.btn-danger {
  background: var(--danger);
  border-color: transparent;
  color: #210a06;
  font-weight: 580;
}
.btn-danger:hover { background: #ee806a; }

/* ── dialogs ── */
body:has(.profile-dialog[open]) { overflow: hidden; }
.profile-dialog {
  width: min(440px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.profile-dialog::backdrop {
  background: rgba(4,5,7,.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.dialog-panel {
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 32px 90px rgba(0,0,0,.58);
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
}
.dialog-title-wrap { flex: 1; min-width: 0; }
.dialog-title {
  margin: 0;
  color: var(--text);
  font-size: 1.14rem;
  font-weight: 580;
  letter-spacing: -.02em;
}
.dialog-subtitle {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: .86rem;
  line-height: 1.45;
}
.dialog-close {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.dialog-close:hover {
  color: var(--text);
  background: rgba(255,255,255,.045);
  border-color: var(--line);
}
.dialog-close svg { width: 18px; height: 18px; }
.dialog-body { padding: 20px 22px 22px; }
.dialog-body[data-balance-form] {
  display: grid;
  gap: 14px;
}
.form-field { display: grid; gap: 8px; }
.form-label {
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 540;
}
.form-input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .94rem;
  caret-color: var(--accent);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-input:hover { border-color: rgba(255,255,255,.18); }
.form-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #16181c;
}
.form-input::placeholder { color: var(--text-3); }
#profileEmail:focus::placeholder { color: transparent; }
.form-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--text-3);
  font-size: .8rem;
  line-height: 1.45;
}
.form-hint svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.form-hint a { color: var(--accent-text); text-decoration: none; }
.form-hint .linkbtn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; }
.form-hint .linkbtn:hover { text-decoration: underline; }
.dialog-actions {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.dialog-body[data-balance-form] .dialog-actions { margin-top: 4px; }
.dialog-actions .btn {
  width: 100%;
  height: 42px;
  padding-inline: 14px;
}
.logout-dialog-copy {
  margin: 0;
  color: var(--text-2);
  font-size: .9rem;
  line-height: 1.55;
}
.logout-dialog-copy strong {
  color: var(--text);
  font-weight: 540;
}
.amount-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.dialog-body[data-balance-form] .amount-options { margin-bottom: 0; }
.amount-option {
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .84rem;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.amount-option:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.amount-option.is-selected {
  color: var(--accent-text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.amount-input-wrap { position: relative; }
.amount-input-wrap .form-input {
  padding-right: 38px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.amount-input-wrap .form-input::-webkit-outer-spin-button,
.amount-input-wrap .form-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
.amount-currency {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--text-3);
  font-size: .95rem;
  transform: translateY(-50%);
  pointer-events: none;
}
.balance-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--text-2);
  font-size: .82rem;
}
.dialog-body[data-balance-form] .balance-preview { margin-top: 0; }
.balance-preview strong {
  flex: none;
  color: var(--text);
  font-size: .9rem;
  font-weight: 580;
  font-variant-numeric: tabular-nums;
}

/* code input (verify dialog) */
.code-input {
  letter-spacing: .5em; text-align: center;
  font-variant-numeric: tabular-nums; font-size: 1.1rem; font-weight: 560;
}

@media (max-width: 640px) {
  html, body { overflow-x: clip; }
  .shell,
  .main,
  .profile-cards,
  .profile-card { min-width: 0; }
  .shell { width: 100%; }
  .main { overflow: hidden; }

  .profile-hero {
    gap: 14px;
    margin-bottom: 28px;
  }
  .profile-hero > div:last-child { min-width: 0; }
  .avatar { width: 60px; height: 60px; font-size: 1.3rem; }
  .profile-hero.is-email .avatar { width: 72px; height: 72px; font-size: 1.55rem; }
  .profile-name {
    overflow: hidden;
    font-size: 1.08rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .profile-meta { gap: 6px; }
  .profile-handle { font-size: .84rem; }
  .profile-id { font-size: .74rem; }

  .profile-cards { gap: 10px; }
  .card-top {
    gap: 12px;
    padding: 16px;
  }
  .card-top:has(.card-action) {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
  }
  .card-top:has(.card-action) .card-action {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 2px;
  }
  .profile-action-btn {
    width: 100%;
    height: 42px;
    font-size: .86rem;
  }
  .email-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    gap: 8px;
  }
  .email-address {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .badge-ok, .badge-warn { justify-self: end; height: 21px; padding-inline: 7px; font-size: .7rem; }

  .card-body { padding: 14px 16px; }
  .info-strip { padding: 12px 16px; }
  .ref-desc {
    margin-bottom: 12px;
    font-size: .86rem;
  }
  .ref-link-row {
    gap: 8px;
    padding: 9px 10px;
  }
  .ref-link-text { font-size: .76rem; }
  .ref-copy {
    height: 34px;
    padding-inline: 10px;
    font-size: .76rem;
  }
  .ref-stats {
    margin-top: 12px;
    padding-top: 12px;
  }
  .ref-stat { padding-inline: 4px; }
  .ref-stat + .ref-stat { border-left: 1px solid var(--line); }
  .ref-stat-val { font-size: 1.25rem; }
  .ref-stat-lbl { font-size: .72rem; line-height: 1.35; }
  .logout-wrap { margin-top: 20px; }
  .logout-btn { min-height: 46px; }

  .profile-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    margin: auto 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .dialog-panel {
    max-height: inherit;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 18px;
  }
  .dialog-head { padding: 20px 18px 16px; }
  .dialog-body { padding: 18px; }
  .dialog-actions { grid-template-columns: 1fr; }
  .dialog-actions .btn { min-height: 46px; }
  .dialog-actions .btn-primary { grid-row: 1; }
  .logout-dialog .btn-danger { grid-row: 1; }
  .amount-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   plans / buy (from plans.html) — topup dialog reuses profile .dialog-*
   ============================================================ */
/* ── back ── */
.back {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px;
  color: var(--text); font-size: .95rem; font-weight: 500;
  background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
}
.back svg { width: 18px; height: 18px; color: var(--accent-text); }
.back:hover { color: var(--accent-text); }

/* ── current-subscription context ── */
.renew-context {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 30px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
}
.renew-context-ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 11px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.renew-context-ico svg { width: 20px; height: 20px; }
.renew-context-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.renew-context-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.renew-context-name { font-size: .98rem; font-weight: 540; color: var(--text); }
.renew-context-protocol {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: .72rem;
  font-weight: 560;
}
.renew-context-meta { font-size: .85rem; color: var(--text-2); }
.renew-context-meta .accent { color: var(--accent-text); font-weight: 520; }
.renew-context-note {
  color: var(--text-3);
  font-size: .8rem;
  line-height: 1.4;
}

/* ── section heads ── */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 0 14px;
}
.section-head h2 {
  margin: 0; font-size: 1.02rem; font-weight: 560; letter-spacing: -0.01em; color: var(--text);
}
.section + .section { margin-top: 30px; }

/* ── plan grid ── */
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s ease;
}
.plan-card:hover { border-color: var(--line-strong); }
.plan-card:active { transform: scale(.99); }
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card:has(input:checked) {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), transparent 120%);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.plan-card:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-name { font-size: 1.05rem; font-weight: 560; color: var(--text); }
.plan-check {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1.6px solid var(--line-strong); background: transparent;
  display: grid; place-items: center; transition: border-color .15s, background .15s;
}
.plan-check svg { width: 12px; height: 12px; color: #052012; opacity: 0; transition: opacity .15s; }
.plan-card:has(input:checked) .plan-check { border-color: var(--accent); background: var(--accent); }
.plan-card:has(input:checked) .plan-check svg { opacity: 1; }

.plan-price-row { display: flex; align-items: baseline; gap: 8px; }
.plan-total { font-size: 1.55rem; font-weight: 580; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.plan-permonth { font-size: .82rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

.plan-foot { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.plan-save {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text); font-size: .74rem; font-weight: 560; font-variant-numeric: tabular-nums;
}
.plan-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); background: rgba(255,255,255,.05); border: 1px solid var(--line-strong);
  color: var(--text-2); font-size: .74rem; font-weight: 540;
}

/* ── payment methods ── */
.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay-option {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s ease;
}
.pay-option:hover { border-color: var(--line-strong); }
.pay-option:not(.is-disabled):active { transform: scale(.99); }
.pay-option input { position: absolute; opacity: 0; pointer-events: none; }
.pay-option:has(input:checked) { border-color: var(--accent-line); box-shadow: inset 0 0 0 1px var(--accent-line); }
.pay-option:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.pay-option.is-disabled { cursor: not-allowed; }
.pay-option-wrap { display: block; }
.pay-option-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.pay-option.is-disabled .pay-option-choice,
.pay-option.is-disabled .pay-radio {
  opacity: .55;
  cursor: not-allowed;
}
.balance-topup {
  appearance: none;
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(224,163,65,.28);
  border-radius: 8px;
  background: transparent;
  color: var(--warn);
  font: inherit;
  font-size: .8rem;
  font-weight: 540;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.balance-topup:hover {
  background: var(--warn-soft);
  border-color: rgba(224,163,65,.45);
}
.balance-topup:focus-visible {
  outline: 2px solid var(--warn);
  outline-offset: 2px;
}
.balance-topup-short { display: none; }
.pay-option-wrap.is-short .balance-topup { display: inline-flex; }

/* ── balance top-up dialog ── */
body:has(.topup-dialog[open]) { overflow: hidden; }
.topup-dialog {
  width: min(440px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.topup-dialog::backdrop {
  background: rgba(4,5,7,.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.topup-panel {
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 32px 90px rgba(0,0,0,.58);
}
.topup-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
}
.topup-title-wrap { flex: 1; min-width: 0; }
.topup-title {
  margin: 0;
  color: var(--text);
  font-size: 1.14rem;
  font-weight: 580;
  letter-spacing: -.02em;
}
.topup-subtitle {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: .86rem;
  line-height: 1.45;
}
.topup-close {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.topup-close:hover {
  color: var(--text);
  background: rgba(255,255,255,.045);
  border-color: var(--line);
}
.topup-close svg { width: 18px; height: 18px; }
.topup-form { padding: 20px 22px 22px; }
.topup-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.topup-option {
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .84rem;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.topup-option:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.topup-option.is-selected {
  color: var(--accent-text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.topup-field { display: grid; gap: 8px; }
.topup-label {
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 540;
}
.topup-input-wrap { position: relative; }
.topup-input {
  width: 100%;
  height: 46px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .94rem;
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
  -moz-appearance: textfield;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.topup-input::-webkit-outer-spin-button,
.topup-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
.topup-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #16181c;
}
.topup-currency {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--text-3);
  transform: translateY(-50%);
  pointer-events: none;
}
.topup-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--text-2);
  font-size: .82rem;
}
.topup-preview strong {
  flex: none;
  color: var(--text);
  font-size: .9rem;
  font-weight: 580;
  font-variant-numeric: tabular-nums;
}
.topup-actions {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.topup-actions .btn {
  width: 100%;
  height: 42px;
  padding-inline: 14px;
}

.pay-ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 11px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--text-2);
}
.pay-ico svg { width: 20px; height: 20px; }
.pay-info { flex: 1; min-width: 0; }
.pay-name {
  display: block;
  font-size: .96rem;
  font-weight: 520;
  color: var(--text);
}
.pay-sub {
  display: block;
  margin-top: 2px;
  font-size: .82rem;
  color: var(--text-3);
}
.pay-sub.warn { color: var(--warn); }
.pay-radio {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1.6px solid var(--line-strong); transition: border-color .15s;
  display: grid; place-items: center;
}
.pay-radio::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); transform: scale(0); transition: transform .15s;
}
.pay-option:has(input:checked) .pay-radio { border-color: var(--accent); }
.pay-option:has(input:checked) .pay-radio::after { transform: scale(1); }

/* ── order summary ── */
.order-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 32px; padding: 20px 22px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-card);
}
.order-info { flex: 1; min-width: 0; }
.order-label { font-size: .78rem; font-weight: 560; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.order-total {
  display: block; margin-top: 2px;
  font-size: 1.7rem; font-weight: 580; letter-spacing: -0.03em; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.order-sub { margin-top: 3px; font-size: .85rem; color: var(--text-2); }
.order-cta { flex: none; height: 48px; padding: 0 26px; font-size: .98rem; }
.order-cta:disabled { opacity: .5; cursor: not-allowed; }
.order-cta:disabled:hover { background: var(--accent); }

.legal-accept {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--text-2);
  font-size: .84rem;
  line-height: 1.45;
}
.legal-accept input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.legal-accept a {
  color: var(--accent-text);
  text-decoration: none;
}
.legal-accept a:hover { text-decoration: underline; }
.order-legal { margin-top: 24px; }
.legal-error {
  margin: 9px 0 0 28px;
  color: var(--danger);
  font-size: .83rem;
  line-height: 1.4;
}
.legal-error[hidden] { display: none; }
.dialog-body .legal-accept {
  width: 100%;
  margin: 0;
}
.dialog-body .legal-error {
  margin-top: -2px;
}
.dialog-body[data-balance-form] .legal-error {
  margin: -6px 0 0 28px;
}
.dialog-body[data-balance-form] .form-hint {
  margin: 0;
}
.form-min-hint {
  margin: 7px 0 0;
  font-size: .8rem;
  color: var(--text-3);
}

.order-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; color: var(--text-3); font-size: .82rem; line-height: 1.45;
}
.order-note svg { width: 15px; height: 15px; flex: none; }

/* ============================================================
   service screens: payment wait, error, logout
   ============================================================ */
.service-main {
  max-width: 820px;
}

.checkout-wait-main {
  max-width: 900px;
}

.service-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(520px 260px at 50% -12%, rgba(52, 209, 126, .13), transparent 72%);
}

.service-card > * {
  position: relative;
}

.service-card-compact {
  display: grid;
  justify-items: start;
  gap: 22px;
  max-width: 620px;
}

.service-ico {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.service-ico svg {
  width: 26px;
  height: 26px;
}

.service-ico-warn {
  border-color: rgba(224, 163, 65, .34);
  background: var(--warn-soft);
  color: var(--warn);
}

.service-head {
  margin-top: 22px;
}

.service-card-compact .service-head {
  margin-top: 0;
}

.service-head h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  font-weight: 540;
  line-height: 1.06;
}

.service-head p {
  max-width: 56ch;
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.55;
}

.service-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 26px 0 0;
}

.service-summary div {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.service-summary dt {
  margin: 0 0 6px;
  color: var(--text-3);
  font-size: .72rem;
  font-weight: 560;
  line-height: 1;
  text-transform: uppercase;
}

.service-summary dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text);
  font-size: .96rem;
  font-weight: 540;
  line-height: 1.25;
}

.service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.checkout-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checkout-title-row h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.72rem, 3vw, 2.35rem);
  font-weight: 540;
  line-height: 1.08;
}

.checkout-actions {
  justify-content: center;
}

.checkout-actions .btn {
  min-width: 180px;
  justify-content: center;
}

.logout-main {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
}

.logout-card {
  width: min(100%, 620px);
  justify-items: center;
  text-align: center;
}

.logout-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logout-status-title {
  color: var(--text);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 560;
  line-height: 1.1;
}

.logout-ico {
  border-radius: 14px;
}

.logout-ico svg {
  width: 25px;
  height: 25px;
}

.logout-head {
  margin-top: 0;
}

.logout-head p {
  margin: 0;
  text-align: center;
}

.logout-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  justify-content: center;
  width: 100%;
}

.logout-actions .btn {
  width: 100%;
  justify-content: center;
}

.error-card {
  width: min(100%, 620px);
  justify-items: stretch;
}

.error-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.error-status h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 560;
  line-height: 1.1;
}

.error-ico {
  border-radius: 14px;
}

.error-ico svg {
  width: 25px;
  height: 25px;
}

.error-head {
  margin-top: 0;
}

.error-head p {
  max-width: none;
  margin: 0;
}

.error-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  justify-content: center;
  width: 100%;
}

.error-actions .btn {
  width: 100%;
  justify-content: center;
}

.service-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 22px 0 0;
  color: var(--text-3);
  font-size: .84rem;
  line-height: 1.45;
}

.service-note svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.checkout-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: .8rem;
  font-weight: 560;
  line-height: 1;
}

.checkout-status[hidden] {
  display: none;
}

.checkout-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(52, 209, 126, .13);
  animation: checkout-pulse 1.6s ease-in-out infinite;
}

.checkout-status[data-checkout-state="paid"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.checkout-status[data-checkout-state="failed"] {
  border-color: rgba(229, 112, 90, .32);
  background: rgba(229, 112, 90, .1);
  color: var(--danger);
}

.checkout-status[data-checkout-state="paid"] .checkout-status-dot,
.checkout-status[data-checkout-state="failed"] .checkout-status-dot {
  animation: none;
}

.checkout-done {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 15px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-soft);
  text-align: center;
}

.checkout-done[hidden] {
  display: none;
}

.checkout-done-ico {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(52, 209, 126, .16);
  color: var(--accent-text);
}

.checkout-done-ico svg {
  width: 21px;
  height: 21px;
}

.checkout-done strong,
.checkout-done span {
  display: block;
}

.checkout-done strong {
  color: var(--text);
  font-size: .96rem;
  font-weight: 560;
}

.checkout-done span {
  margin-top: 2px;
  color: var(--text-2);
  font-size: .86rem;
  line-height: 1.4;
}

@keyframes checkout-pulse {
  0%, 100% {
    opacity: .55;
    transform: scale(.9);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .service-main {
    padding-top: 22px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .logout-main {
    min-height: 100dvh;
    place-items: center;
    align-content: center;
  }

  .service-card {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .service-card-compact {
    gap: 20px;
  }

  .service-head {
    margin-top: 18px;
  }

  .checkout-title-row {
    justify-content: center;
    text-align: left;
  }

  .service-card-compact .service-head {
    margin-top: 0;
  }

  .service-head h1 {
    font-size: 1.72rem;
    line-height: 1.08;
  }

  .service-head p {
    font-size: .91rem;
    line-height: 1.48;
  }

  .service-summary {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 22px;
  }

  .service-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    margin-top: 24px;
  }

  .service-actions .btn {
    width: 100%;
    min-height: 46px;
  }

  .error-status {
    justify-content: center;
    width: 100%;
  }

  .error-head {
    text-align: center;
  }

  .error-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-actions .btn { width: 100%; }
}

/* ============================================================
   legal documents tabs
   ============================================================ */
.legal-main {
  max-width: 1040px;
}

.legal-head {
  margin-bottom: 22px;
}

.legal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.legal-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .028), transparent),
    var(--surface);
}

.legal-card-ico {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.legal-card-ico svg {
  width: 20px;
  height: 20px;
}

.legal-card-title {
  min-width: 0;
  flex: 1;
}

.legal-card-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 580;
  line-height: 1.2;
}

.legal-card-title p {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: .82rem;
  line-height: 1.35;
}

.legal-document {
  padding: 24px 28px 30px;
}

.legal-document .gl-text-stack,
.legal-document .gl-legal-text {
  display: grid;
  gap: 0;
}

.legal-document .gl-legal-text {
  width: 100%;
  max-width: none;
  color: var(--text-2);
  font-size: .96rem;
  line-height: 1.68;
}

.legal-document .gl-legal-text > p:first-child {
  margin-top: 0;
}

.legal-document .gl-legal-text > p:first-child strong {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 580;
  line-height: 1.35;
}

.legal-document .gl-legal-text p {
  margin: 0 0 11px;
}

.legal-document .gl-legal-text h3 {
  margin: 28px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 1rem;
  font-weight: 580;
  line-height: 1.35;
}

.legal-document .gl-legal-text h3:first-of-type {
  margin-top: 18px;
}

.legal-document .gl-legal-text ul {
  margin: 0 0 13px;
  padding-left: 20px;
}

.legal-document .gl-legal-text li {
  margin: 0 0 7px;
}

.legal-document .gl-legal-text a {
  color: var(--accent-text);
  text-decoration: none;
}

.legal-document .gl-legal-text a:hover {
  text-decoration: underline;
}

.legal-document .gl-legal-text strong {
  color: var(--text);
  font-weight: 560;
}

.legal-document .gl-legal-text em {
  color: var(--text-3);
  font-style: normal;
}

@media (prefers-reduced-motion: reduce) {
  .plan-card, .pay-option { transition: background .15s, border-color .15s, box-shadow .15s; }
  .plan-card:active, .pay-option:not(.is-disabled):active { transform: none; }
}

@media (max-width: 640px) {
  html { overflow-x: clip; }
  .main {
    padding-top: 18px;
    padding-bottom: calc(178px + env(safe-area-inset-bottom, 0px));
  }
  .back {
    min-height: 44px;
    margin: -4px 0 8px;
    touch-action: manipulation;
  }
  .page-head {
    margin-bottom: 22px;
    padding-inline: 0;
  }
  .page-head h1 {
    font-size: 1.72rem;
    line-height: 1.08;
  }
  .page-head p {
    margin-top: 8px;
    max-width: none;
    font-size: .91rem;
    line-height: 1.45;
  }
  .renew-context {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px;
    border-radius: 16px;
  }
  .renew-context-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .renew-context-ico svg { width: 18px; height: 18px; }
  .renew-context-info { gap: 3px; }
  .renew-context-title { gap: 7px; }
  .renew-context-name { font-size: .94rem; }
  .renew-context-protocol {
    min-height: 20px;
    padding-inline: 7px;
    font-size: .68rem;
  }
  .renew-context-meta {
    font-size: .79rem;
    line-height: 1.35;
  }
  .renew-context-note {
    font-size: .75rem;
    line-height: 1.4;
  }
  .section-head { margin-bottom: 10px; }
  .section-head h2 { font-size: .96rem; }
  .section + .section { margin-top: 24px; }
  .plan-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .plan-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 20px;
    grid-template-rows: auto auto;
    gap: 8px 10px;
    min-height: 78px;
    padding: 14px 16px;
    border-radius: 15px;
    touch-action: manipulation;
  }
  .plan-top { display: contents; }
  .plan-name {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    font-size: .96rem;
  }
  .plan-check {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }
  .plan-price-row {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
  }
  .plan-total { font-size: 1.18rem; }
  .plan-permonth {
    font-size: .68rem;
    line-height: 1.25;
  }
  .plan-foot {
    grid-column: 1 / 3;
    grid-row: 2;
    min-height: 20px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .plan-save,
  .plan-tag {
    flex: none;
    height: 20px;
    padding-inline: 8px;
    font-size: .68rem;
    white-space: nowrap;
  }
  .pay-list { gap: 7px; }
  .pay-option {
    gap: 10px;
    min-height: 64px;
    padding: 11px 13px;
    border-radius: 13px;
    touch-action: manipulation;
  }
  .pay-option-choice { gap: 10px; }
  .pay-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .pay-ico svg { width: 18px; height: 18px; }
  .pay-name { font-size: .91rem; }
  .pay-sub {
    margin-top: 1px;
    font-size: .75rem;
  }
  .balance-topup {
    min-height: 42px;
    padding-inline: 10px;
    font-size: .74rem;
    touch-action: manipulation;
  }
  .topup-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    margin: auto 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .topup-panel {
    max-height: inherit;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .topup-head { padding: 20px 18px 16px; }
  .topup-form { padding: 18px; }
  .topup-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topup-option { min-height: 44px; }
  .topup-actions { grid-template-columns: 1fr; }
  .topup-actions .btn-primary { grid-row: 1; }
  .topup-actions .btn { min-height: 46px; }
  .order-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    margin: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(25,27,32,.96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 50px rgba(0,0,0,.4);
  }
  .order-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }
  .order-label {
    display: block;
    font-size: .63rem;
    font-weight: 560;
    line-height: 1;
    letter-spacing: .055em;
  }
  .order-total {
    margin-top: 0;
    font-size: 1.25rem;
    line-height: 1.05;
  }
  .order-sub { display: none; }
  .order-cta {
    width: min(176px, 52vw);
    justify-self: end;
    min-height: 44px;
    height: 44px;
    padding-inline: 14px;
    font-size: .86rem;
    white-space: nowrap;
    touch-action: manipulation;
  }
  .order-note {
    gap: 7px;
    margin-top: 12px;
    font-size: .76rem;
  }
}

@media (max-width: 760px) {
  .legal-main {
    padding-top: 22px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .legal-card-top {
    align-items: flex-start;
    padding: 18px;
  }

  .legal-card-top .pill {
    display: none;
  }

  .legal-document {
    padding: 20px 18px 24px;
  }

  .legal-document .gl-legal-text {
    max-width: none;
    font-size: .91rem;
    line-height: 1.62;
  }

  .legal-document .gl-legal-text > p:first-child strong {
    font-size: 1rem;
  }

  .legal-document .gl-legal-text h3 {
    margin-top: 24px;
    padding-top: 16px;
    font-size: .96rem;
  }
}

@media (max-width: 360px) {
  .pay-option { padding-inline: 12px; }
  .pay-option-choice { gap: 8px; }
  .pay-ico {
    width: 34px;
    height: 34px;
  }
  .balance-topup {
    min-height: 40px;
    padding-inline: 9px;
  }
  .balance-topup-full { display: none; }
  .balance-topup-short { display: inline; }
}

/* ============================================================
   home dashboard (from home.html + home-empty.html extras)
   ============================================================ */
.page-head .greet-sub { margin-top: 12px; color: var(--text-2); font-size: 1.02rem; line-height: 1.5; }

/* ── subscription spotlight ── */
.spot {
  position: relative; overflow: hidden;
  margin-bottom: 30px; padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-card);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8), var(--shadow-card);
}
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(480px 220px at 50% -12%, rgba(52,209,126,.14), transparent 72%);
}
.spot > * { position: relative; }

.spot-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.spot-brand { font-size: .9rem; font-weight: 520; color: var(--text-2); }

.spot-main {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}
.spot-days { display: flex; align-items: baseline; gap: 10px; }
.spot-num {
  font-size: clamp(2.6rem, 6vw, 3.4rem); font-weight: 560; line-height: .9;
  letter-spacing: -0.04em; color: var(--text); font-variant-numeric: tabular-nums;
}
.spot-days-lbl { color: var(--text-2); font-size: 1rem; }
.spot-actions { display: flex; gap: 10px; }
.spot-actions .btn { height: 42px; }

.spot-bar {
  height: 7px; margin: 20px 0 12px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.06); overflow: hidden;
}
.spot-bar span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); }

.spot-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: .86rem; color: var(--text-2);
}
.spot-foot .muted { color: var(--text-3); }

/* ── section heading ── */
.sec-head {
  margin: 0 0 14px; font-size: .76rem; font-weight: 560;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-3);
}

/* ── quick actions ── */
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 30px; }
.qa {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  transition: border-color .15s, background .15s, transform .12s ease;
}
.qa:hover { border-color: var(--line-strong); background: var(--surface-2); }
.qa:active { transform: scale(.99); }
.qa-ico {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 11px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.qa-ico svg { width: 20px; height: 20px; }
.qa-name { font-size: .95rem; font-weight: 520; color: var(--text); }
.qa-sub { font-size: .82rem; color: var(--text-3); margin-top: -6px; }

/* ── resilience nudge ── */
.nudge {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  transition: border-color .15s, background .15s, transform .12s ease;
}
.nudge:hover { border-color: var(--line-strong); background: var(--surface-2); }
.nudge:active { transform: scale(.99); }
.nudge-ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 11px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--text-2);
}
.nudge-ico svg { width: 20px; height: 20px; }
.nudge-body { flex: 1; min-width: 0; }
.nudge-title { font-size: .96rem; font-weight: 520; color: var(--text); }
.nudge-sub { margin-top: 3px; font-size: .85rem; color: var(--text-2); line-height: 1.45; }
.nudge-arrow { flex: none; color: var(--text-3); }
.nudge-arrow svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .qa, .nudge { transition: background .15s, border-color .15s; }
  .qa:active, .nudge:active { transform: none; }
}

@media (max-width: 640px) {
  .spot { padding: 20px; }
  .spot-main { align-items: stretch; }
  .spot-actions { width: 100%; }
  .spot-actions .btn { flex: 1; min-height: 46px; }
  .spot-foot { flex-direction: column; align-items: center; text-align: center; gap: 4px; }
  .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nudge { padding: 16px; }
  .nudge-arrow { display: none; }
}

/* empty-state spotlight + 3-col quick-actions (from home-empty.html) */
.spot-empty {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-bottom: 30px; padding: 38px 28px;
  background: var(--surface);
  border: 1px dashed var(--line-strong); border-radius: var(--r-card);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8), var(--shadow-card);
}
.spot-empty::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(480px 220px at 50% -12%, rgba(52,209,126,.14), transparent 72%);
}
.spot-empty > * { position: relative; }
.spot-empty-ico {
  width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 20px;
  border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.spot-empty-ico svg { width: 27px; height: 27px; }
.spot-empty h2 { margin: 0; font-size: 1.2rem; font-weight: 560; letter-spacing: -0.02em; color: var(--text); }
.spot-empty p { margin: 10px 0 0; max-width: 40ch; color: var(--text-2); font-size: .95rem; line-height: 1.55; }
.spot-empty .btn { margin-top: 24px; height: 46px; padding: 0 26px; font-size: .98rem; }
.qa-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .spot-empty { padding: 30px 20px; }
  .spot-empty .btn { width: 100%; min-height: 48px; }
  .qa-grid.is-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   entry hub + login modal (from index.html); modal = app.js overlay
   ============================================================ */
.entry {
  position: relative; z-index: 1;
  min-height: 100vh; display: grid; place-items: center;
  padding: 28px 20px;
}
.entry-card { width: 100%; max-width: 460px; }

.entry-brand {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; color: var(--text); text-decoration: none;
  font-size: 1.42rem; font-weight: 600; letter-spacing: -0.02em;
}
.entry-brand i { font-style: normal; color: var(--accent-text); }

.entry-panel {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 32px 28px;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8), var(--shadow-card);
}
.entry-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(480px 220px at 50% -12%, rgba(52,209,126,.14), transparent 72%),
    radial-gradient(700px 360px at 50% -40%, rgba(80,110,255,.05), transparent 70%);
}
.entry-panel > * { position: relative; }

.sec-label {
  margin: 24px 0 12px; font-size: .76rem; font-weight: 560;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-3);
}
.entry-title { margin: 0; text-align: center; font-size: 1.5rem; font-weight: 560; letter-spacing: -0.02em; color: var(--text); }
.entry-sub { margin: 9px auto 22px; max-width: 34ch; text-align: center; color: var(--text-2); font-size: .95rem; line-height: 1.55; }

/* primary login button */
.entry-login {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 50px; border-radius: var(--r-btn);
  background: linear-gradient(180deg, #46d98c, var(--accent));
  color: #052012; font: inherit; font-size: 1rem; font-weight: 560;
  cursor: pointer; border: 1px solid transparent;
  box-shadow: 0 6px 20px -8px rgba(52,209,126,.5), inset 0 1px 0 rgba(255,255,255,.2);
  transition: background .15s, box-shadow .15s, transform .12s ease;
}
.entry-login:hover {
  background: linear-gradient(180deg, #54e29a, #3bd585);
  box-shadow: 0 9px 26px -8px rgba(52,209,126,.62), inset 0 1px 0 rgba(255,255,255,.25);
}
.entry-login:active { transform: scale(.985); box-shadow: 0 4px 14px -8px rgba(52,209,126,.5); }
.entry-login svg { width: 19px; height: 19px; }

/* quick action tiles */
.hub-list { display: flex; flex-direction: column; gap: 8px; }
.hub-tile {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; text-decoration: none; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  font: inherit; text-align: left; width: 100%;
  transition: border-color .15s, background .15s, transform .12s ease;
}
.hub-tile:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.hub-tile:active { transform: scale(.99); }
@media (prefers-reduced-motion: reduce) {
  .entry-login, .hub-tile, .auth-btn-tg, .auth-submit.is-primary {
    transition: background .15s, border-color .15s, box-shadow .15s;
  }
  .entry-login:active, .hub-tile:active, .auth-btn-tg:active, .auth-submit.is-primary:active {
    transform: none !important;
  }
}
.hub-ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 11px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--text-2);
}
.hub-ico svg { width: 20px; height: 20px; }
.hub-body { flex: 1; min-width: 0; }
.hub-name { font-size: .98rem; font-weight: 520; color: var(--text); }
.hub-sub { margin-top: 2px; font-size: .83rem; color: var(--text-3); }
.hub-arrow { flex: none; color: var(--text-3); }
.hub-arrow svg { width: 18px; height: 18px; }

/* foot note */
.entry-foot {
  display: flex; gap: 9px; align-items: center;
  margin-top: 22px; color: var(--text-3); font-size: .83rem; line-height: 1.5;
}
.entry-foot svg { width: 15px; height: 15px; flex: none; color: var(--accent-text); }

/* ── login modal ── */
.login-panel {
  position: relative; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 18px; padding: 28px 26px; box-shadow: 0 32px 90px rgba(0,0,0,.58);
}
.login-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--text-3); cursor: pointer; transition: color .15s, background .15s;
}
.login-close:hover { color: var(--text); background: rgba(255,255,255,.045); }
.login-close svg { width: 18px; height: 18px; }
.login-title { margin: 0; font-size: 1.3rem; font-weight: 560; letter-spacing: -0.02em; color: var(--text); }
.login-subtitle { margin: 8px 0 22px; color: var(--text-2); font-size: .9rem; line-height: 1.5; }
.lstep[data-login-step="code"] .login-title,
.lstep[data-login-step="code"] .login-subtitle,
.lstep[data-login-step="code"] .field-label {
  text-align: center;
}

.auth-btn-tg {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 48px; border-radius: var(--r-btn);
  background: linear-gradient(180deg, #46d98c, var(--accent));
  color: #052012; font: inherit; font-size: .96rem; font-weight: 560;
  cursor: pointer; border: 1px solid transparent;
  box-shadow: 0 6px 20px -8px rgba(52,209,126,.5), inset 0 1px 0 rgba(255,255,255,.2);
  transition: background .15s, box-shadow .15s, transform .12s ease;
}
.auth-btn-tg:hover {
  background: linear-gradient(180deg, #54e29a, #3bd585);
  box-shadow: 0 9px 26px -8px rgba(52,209,126,.62), inset 0 1px 0 rgba(255,255,255,.25);
}
.auth-btn-tg:active { transform: scale(.985); box-shadow: 0 4px 14px -8px rgba(52,209,126,.5); }
.auth-btn-tg svg { width: 19px; height: 19px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3); font-size: .8rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field { display: grid; gap: 8px; }
.field-label { color: var(--text-2); font-size: .8rem; font-weight: 540; }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; outline: none;
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
  caret-color: var(--accent); transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover { border-color: rgba(255,255,255,.18); }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: #16181c; }
.input::placeholder { color: var(--text-3); }
.input.code { letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; font-size: 1.1rem; font-weight: 560; }

.auth-submit {
  width: 100%; height: 48px; margin-top: 14px; border-radius: var(--r-btn);
  background: transparent; border: 1px solid var(--line-strong); color: var(--text);
  font: inherit; font-size: .95rem; font-weight: 520; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.auth-submit:hover { background: var(--surface); border-color: var(--text-3); }
.auth-submit.is-primary {
  background: linear-gradient(180deg, #46d98c, var(--accent));
  border-color: transparent; color: #052012; font-weight: 560;
  box-shadow: 0 6px 20px -8px rgba(52,209,126,.5), inset 0 1px 0 rgba(255,255,255,.2);
  transition: background .15s, box-shadow .15s, transform .12s ease;
}
.auth-submit.is-primary:hover {
  background: linear-gradient(180deg, #54e29a, #3bd585);
  box-shadow: 0 9px 26px -8px rgba(52,209,126,.62), inset 0 1px 0 rgba(255,255,255,.25);
}
.auth-submit.is-primary:active {
  transform: scale(.985);
  box-shadow: 0 4px 14px -8px rgba(52,209,126,.5);
}

.login-note {
  display: flex; gap: 9px; align-items: center;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--text-3); font-size: .82rem; line-height: 1.5;
}
.login-note svg { width: 15px; height: 15px; flex: none; color: var(--accent-text); }

.login-back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--text-2); font-size: .88rem;
}
.login-back:hover { color: var(--accent-text); }
.login-back svg { width: 16px; height: 16px; }
.login-resend { margin-top: 16px; text-align: center; color: var(--text-3); font-size: .85rem; }
.login-resend button { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; }
.login-resend button:hover { text-decoration: underline; }

.lstep[hidden] { display: none; }

/* login modal overlay (app.js toggles [hidden] + .is-open on [data-login-modal]) */
body.has-modal { overflow: hidden; }
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(4,5,7,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s;
}
.login-overlay[hidden] { display: none; }
.login-overlay.is-open { opacity: 1; }
.login-overlay-backdrop { position: absolute; inset: 0; }
.login-panel { z-index: 1; width: min(420px, calc(100% - 32px)); }
.login-turnstile { margin: 14px 0 0; }
.login-turnstile:empty { margin: 0; }
.login-error { margin: 12px 0 0; color: var(--danger); font-size: .84rem; line-height: 1.4; }
.login-error[hidden] { display: none; }

/* ============================================================
   emergency contact (from contact.html)
   ============================================================ */
.entry {
  position: relative; z-index: 1;
  min-height: 100vh; display: grid; place-items: center;
  padding: 28px 20px;
}
.entry-card { width: 100%; max-width: 460px; }

.entry-back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--text-2); font-size: .9rem; text-decoration: none;
}
.entry-back:hover { color: var(--accent-text); }
.entry-back svg { width: 17px; height: 17px; }

.entry-panel {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 32px 28px;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8), var(--shadow-card);
}
.entry-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(480px 220px at 50% -12%, rgba(52,209,126,.14), transparent 72%);
}
.entry-panel > * { position: relative; }
.entry-title { margin: 0; font-size: 1.5rem; font-weight: 560; letter-spacing: -0.02em; color: var(--text); }
.entry-sub { margin: 9px 0 20px; color: var(--text-2); font-size: .95rem; line-height: 1.55; }
.entry-card-login .entry-title,
.entry-card-login .entry-sub {
  text-align: center;
}
.entry-card-login .entry-sub {
  max-width: 34ch;
  margin: 9px auto 22px;
}

/* contact methods */
.cm-list { display: flex; flex-direction: column; gap: 8px; }
.cm {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; text-decoration: none; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  font: inherit; text-align: left; width: 100%;
  transition: border-color .15s, background .15s, transform .12s ease;
}
.cm:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.cm:active { transform: scale(.99); }
.cm.is-primary { border-color: var(--accent-line); box-shadow: inset 0 0 0 1px var(--accent-line); }
.cm-ico {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 11px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.cm-ico svg { width: 21px; height: 21px; }
.cm-body { flex: 1; min-width: 0; }
.cm-name { font-size: .98rem; font-weight: 520; color: var(--text); }
.cm-sub { margin-top: 2px; font-size: .83rem; color: var(--text-3); }
.cm-arrow { flex: none; color: var(--text-3); }
.cm-arrow svg { width: 18px; height: 18px; }

/* divider */
.cm-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--text-3); font-size: .8rem; }
.cm-divider::before, .cm-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* email form */
.field { display: grid; gap: 8px; }
.field + .field { margin-top: 12px; }
.field-label { color: var(--text-2); font-size: .8rem; font-weight: 540; }
.input, .textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; outline: none;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .95rem;
  caret-color: var(--accent); transition: border-color .15s, box-shadow .15s, background .15s;
}
.input { height: 48px; padding-block: 0; }
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.input:hover, .textarea:hover { border-color: rgba(255,255,255,.18); }
.input:focus, .textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: #16181c; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.cm-submit {
  width: 100%; height: 48px; margin-top: 16px; border-radius: var(--r-btn);
  background: linear-gradient(180deg, #46d98c, var(--accent));
  border: 1px solid transparent; color: #052012;
  font: inherit; font-size: .95rem; font-weight: 560; cursor: pointer;
  box-shadow: 0 6px 20px -8px rgba(52,209,126,.5), inset 0 1px 0 rgba(255,255,255,.2);
  transition: background .15s, box-shadow .15s, transform .12s ease;
}
.cm-submit:hover {
  background: linear-gradient(180deg, #54e29a, #3bd585);
  box-shadow: 0 9px 26px -8px rgba(52,209,126,.62), inset 0 1px 0 rgba(255,255,255,.25);
}
.cm-submit:active {
  transform: scale(.985);
  box-shadow: 0 4px 14px -8px rgba(52,209,126,.5);
}

/* success state */
.cm-success {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 0 4px;
}
.cm-success-ico {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 16px;
  border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.cm-success-ico svg { width: 26px; height: 26px; }
.cm-success h2 { margin: 0; font-size: 1.15rem; font-weight: 560; color: var(--text); }
.cm-success p { margin: 9px 0 0; max-width: 34ch; color: var(--text-2); font-size: .92rem; line-height: 1.5; }
.cm-success p strong { color: var(--text); font-weight: 560; }
.cm-ticket { margin: 14px 0 0; font-size: .82rem; color: var(--text-3); }
.cm-ticket span { color: var(--text-2); font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }

[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cm, .cm-submit { transition: background .15s, border-color .15s, box-shadow .15s; }
  .cm:active, .cm-submit:active { transform: none; }
}

/* ============================================================
   empty state (from subs-empty.html)
   ============================================================ */
.empty {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 40px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8), var(--shadow-card);
}
.empty::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(480px 220px at 50% -12%, rgba(52,209,126,.14), transparent 72%);
}
.empty > * { position: relative; }
.empty-ico {
  width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 22px;
  border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.empty-ico svg { width: 30px; height: 30px; }
.empty h2 {
  margin: 0; font-size: 1.25rem; font-weight: 560; letter-spacing: -0.02em; color: var(--text);
}
.empty p {
  margin: 10px 0 0; max-width: 52ch; color: var(--text-2); font-size: .95rem; line-height: 1.55;
}
.empty-cta { margin-top: 26px; height: 46px; padding: 0 26px; font-size: .98rem; }
.empty-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 22px; padding-top: 20px; width: 100%;
  border-top: 1px solid var(--line);
  color: var(--text-3); font-size: .85rem; line-height: 1.45; justify-content: center;
}
.empty-foot svg { width: 15px; height: 15px; flex: none; }
.empty-foot a { color: var(--accent-text); text-decoration: none; }
.empty-foot a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .empty { padding: 32px 20px; }
  .empty-cta { width: 100%; min-height: 50px; }
}
