:root {
  --bg: #04071a; --ink: #f5f7ff; --ink-2: rgba(232,236,255,.72); --ink-3: rgba(232,236,255,.5);
  --accent: #9aa5ff; --glass: rgba(60,72,160,.16); --hair: rgba(255,255,255,.13); --hair-hi: rgba(255,255,255,.22);
  --success: #5fe3a1; --warning: #ffc861; --danger: #ff7a7a;
  --ease: cubic-bezier(.32,.72,0,1); --ease-out: cubic-bezier(.22,1,.36,1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Only <html> gets the colour: a background on <body> would paint over the light layer (.backdrop, z-index -1). */
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body { background: transparent; }
body { color: var(--ink); font: 400 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none; user-select: none; -webkit-user-select: none; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
svg { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.symbols { position: absolute; width: 0; height: 0; }
/* The site's light, a little brighter: glass only reads as glass when there is light behind it. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 70% at 50% -10%, #1f2b78 0%, rgba(4,7,26,0) 62%), linear-gradient(180deg, #0a1034, #060a26 55%, #04071a); }
.orb { position: absolute; border-radius: 50%; }
.orb-a { width: 110vmax; height: 110vmax; left: -45vmax; top: -45vmax; background: radial-gradient(circle, rgba(111,127,245,.55), rgba(111,127,245,0) 62%); }
.orb-b { width: 95vmax; height: 95vmax; right: -50vmax; top: 22vh; background: radial-gradient(circle, rgba(167,120,255,.38), rgba(167,120,255,0) 62%); }
.orb-c { width: 90vmax; height: 90vmax; left: -10vw; bottom: -45vmax; background: radial-gradient(circle, rgba(72,180,255,.24), rgba(72,180,255,0) 62%); }

/* Translucent glass: the background and the content underneath show through, like the reference. */
.glass { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)), var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--hair); border-radius: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 20px 50px -34px rgba(0,0,0,.7); }

/* header: one compact glass pill, like the reference */
.topbar { position: sticky; top: 0; z-index: 5; padding: max(8px, env(safe-area-inset-top)) 14px 8px; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 8px 0 12px; border-radius: 26px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.brand b { color: var(--accent); font-weight: 650; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-style: italic; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(145deg, #aab4ff, #6474f2 60%, #4a58d6); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 16px -6px rgba(108,124,246,.8); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: rgba(255,255,255,.08); border: 1px solid var(--hair); }

.view { padding: 4px 14px calc(100px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.view > * { min-width: 0; animation: rise .45s var(--ease-out) both; }
.view > *:nth-child(2) { animation-delay: .04s; } .view > *:nth-child(3) { animation-delay: .08s; } .view > *:nth-child(4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.skeleton { height: 220px; opacity: .5; } .skeleton.short { height: 110px; }

.page-head { padding: 8px 4px 2px; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.1; font-weight: 750; letter-spacing: -.03em; }
.page-head p { margin: 4px 0 0; font-size: 14px; color: var(--ink-3); }

.card { padding: 16px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08); border: 1px solid var(--hair); color: var(--ink-2); white-space: nowrap; flex: none; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.chip.ok { color: #c9f8df; background: rgba(95,227,161,.12); border-color: rgba(95,227,161,.25); } .chip.ok i { background: var(--success); box-shadow: 0 0 0 3px rgba(95,227,161,.18); }
.chip.warn { color: #ffe7b8; background: rgba(255,200,97,.12); border-color: rgba(255,200,97,.28); } .chip.warn i { background: var(--warning); }
.chip.bad { color: #ffd0d0; background: rgba(255,122,122,.12); border-color: rgba(255,122,122,.28); } .chip.bad i { background: var(--danger); }
.muted { color: var(--ink-3); font-size: 12.5px; }

.head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.head .ico { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid var(--hair); color: var(--accent); }
.head .t { flex: 1; min-width: 0; } .head .t b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.015em; } .head .t span { font-size: 13px; color: var(--ink-3); }
.hero-days { margin: 14px 0 0; display: flex; align-items: baseline; gap: 8px; }
.hero-days b { font-size: 52px; line-height: .9; font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff 30%, #b8c0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-days span { font-size: 18px; font-weight: 600; color: var(--ink-2); }
.hero-title { margin: 10px 0 0; font-size: 22px; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; }
.sub { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.meter { margin-top: 14px; }
.meter .row { font-size: 13px; color: var(--ink-3); } .meter .row b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.track { margin-top: 8px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7d8cff, #b5bdff); transition: width .9s var(--ease-out); }

.btn { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; padding: 0 16px; border-radius: 999px;
  font-size: 15px; font-weight: 650; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; transition: transform .12s ease, background .2s ease, opacity .2s ease; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; }
.btn-primary { color: #070b26; background: linear-gradient(180deg, #b3bbff, #8391fb); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -1px 0 rgba(40,50,140,.35), 0 10px 24px -12px rgba(124,140,255,.9); }
.btn-light { color: #0a0f2e; background: #fff; }
.btn-glass { color: var(--ink); background: rgba(255,255,255,.08); border: 1px solid var(--hair); }
.btn-danger { color: #ffd0d0; background: rgba(255,122,122,.12); border: 1px solid rgba(255,122,122,.28); }
.btn-sm { height: 34px; width: auto; padding: 0 14px; font-size: 13px; flex: none; }
.actions { margin-top: 14px; display: grid; gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* plans */
.periods { display: grid; gap: 8px; }
.period { appearance: none; text-align: left; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--hair); background: rgba(255,255,255,.05); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.period[aria-checked="true"] { border-color: rgba(154,165,255,.7); background: rgba(154,165,255,.12); }
.period .row b { font-size: 15px; font-weight: 700; } .period .row span { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.badge { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #06281a; background: var(--success); vertical-align: 1px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 6px; border-radius: 16px; background: rgba(0,0,0,.22); border: 1px solid var(--hair); }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hair); background: rgba(255,255,255,.08); display: grid; place-items: center; cursor: pointer; }
.stepper button:active { transform: scale(.94); }
.stepper output { text-align: center; } .stepper output b { display: block; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; } .stepper output span { font-size: 12px; color: var(--ink-3); }
.total { margin-top: 14px; display: flex; align-items: baseline; justify-content: space-between; }
.total b { font-size: 28px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* devices */
.device { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; }
.device .ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.07); border: 1px solid var(--hair); }
.device .meta { flex: 1; min-width: 0; }
.device .meta b { display: block; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device .meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addon { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; margin-top: 12px; }
.addon button { padding: 10px 4px; border-radius: 14px; border: 1px solid var(--hair); background: rgba(255,255,255,.06); cursor: pointer; text-align: center; min-width: 0; }
.addon button b { display: block; font-size: 15px; } .addon button span { font-size: 12px; color: var(--ink-2); }
.empty { text-align: center; padding: 22px 16px; }
.empty .ico-big { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: rgba(154,165,255,.14); color: var(--accent); font-size: 22px; }

/* payments */
.pay-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.pay-row + .pay-row { border-top: 1px solid var(--hair); }
.pay-row .t { flex: 1; min-width: 0; } .pay-row .t b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-row .sum { text-align: right; flex: none; } .pay-row .sum b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }

/* bottom “lip”: floating glass pill, the active tab is its own pill */
.tabbar { position: fixed; left: 12px; right: 12px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 5px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)), rgba(40,50,130,.22);
  -webkit-backdrop-filter: blur(18px) saturate(190%); backdrop-filter: blur(18px) saturate(190%);
  border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 16px 40px -18px rgba(0,0,0,.75); }
.tab { appearance: none; border: 0; background: none; cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 1px; height: 52px; margin: 0 4px; border-radius: 22px;
  color: rgba(232,236,255,.6); font-size: 10.5px; font-weight: 600; transition: color .2s ease, background .25s var(--ease); }
.tab svg { width: 21px; height: 21px; }
.tab[aria-selected="true"] { color: #fff; background: rgba(154,165,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 0 0 1px rgba(154,165,255,.25); }

/* sheet */
dialog { width: 100%; max-width: 520px; margin: auto auto 0; padding: 12px 18px max(20px, env(safe-area-inset-bottom)); border: 1px solid var(--hair-hi); border-bottom: 0; border-radius: 28px 28px 0 0; color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)), rgba(20,24,62,.92); -webkit-backdrop-filter: blur(36px) saturate(170%); backdrop-filter: blur(36px) saturate(170%); }
dialog[open] { animation: sheet .45s var(--ease); }
dialog::backdrop { background: rgba(2,4,14,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.grabber { width: 38px; height: 4px; margin: 0 auto 10px; border-radius: 2px; background: rgba(255,255,255,.25); }
.sheet-close { position: absolute; top: 18px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hair); background: rgba(255,255,255,.06); display: grid; place-items: center; cursor: pointer; }
.sheet-title { margin: 6px 0 10px; font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 6px; border: 0; background: none; cursor: pointer; font-size: 16px; font-weight: 550; color: var(--ink-2); text-align: left; }
.menu-item + .menu-item { border-top: 1px solid var(--hair); }
.menu-item svg { width: 20px; height: 20px; color: var(--ink-2); }
#qr { width: min(220px, 60vw); aspect-ratio: 1; margin: 12px auto; padding: 10px; border-radius: 18px; background: #fff; }
#qr canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.spinner { width: 40px; height: 40px; margin: 14px auto; border-radius: 50%; border: 4px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 30; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 550; text-align: center; pointer-events: none;
  background: rgba(24,31,72,.92); border: 1px solid var(--hair-hi); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  opacity: 0; transform: translate(-50%, 10px); transition: opacity .25s ease, transform .4s var(--ease); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { .view > *, dialog[open] { animation: none; } .fill { transition: none; } }
@media (prefers-reduced-transparency: reduce) { .glass, dialog, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: #141a46; } }
