/* =====================================================================
 * Ettesal mini app — design system + redesign components
 * Loaded after the inline stylesheet, so it may refine existing rules.
 * ===================================================================== */

:root {
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
    --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px; --radius-pill: 999px;
    --fs-xs: .72rem; --fs-sm: .8rem; --fs-md: .9rem; --fs-lg: 1.05rem; --fs-xl: 1.3rem;
    --brand: #8b5cf6; --brand-2: #06b6d4; --accent: #22d3ee;
    --ok: #10b981; --warn: #f59e0b; --danger: #ef4444;
    --surface: rgba(255, 255, 255, .035);
    --surface-2: rgba(255, 255, 255, .06);
    --surface-strong: #0f0f1b;
    --line: var(--border-color);
    --skel-a: rgba(255, 255, 255, .05);
    --skel-b: rgba(255, 255, 255, .11);
    --shadow-1: 0 6px 20px rgba(0, 0, 0, .18);
    --nav-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --cta-bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
}

body.light-theme {
    --surface: rgba(255, 255, 255, .78);
    --surface-2: rgba(15, 23, 42, .045);
    --surface-strong: #ffffff;
    --skel-a: rgba(15, 23, 42, .05);
    --skel-b: rgba(15, 23, 42, .1);
    --shadow-1: 0 6px 18px rgba(15, 23, 42, .07);
}

body { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }

/* Blur is expensive on mid-range Android and barely visible over a 3%
 * surface; keep it only for the two floating bars. */
.glass-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); box-shadow: var(--shadow-1); }
.glass-card:hover { background: var(--surface); }
.lite *, .lite *::before, .lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.lite body::before, .lite body::after { display: none; }
.lite #wc-shortcut-btn { animation: none; }
.lite .header-bar { background: var(--bg-color); }
.lite .bottom-nav { background: var(--drawer-bg); }

/* Utilities that replace the old inline styles */
.stack { display: flex; flex-direction: column; }
.gap-1 { gap: var(--space-1); } .gap-3 { gap: var(--space-3); }
.mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.fw-7 { font-weight: 700; }
.fs-sm { font-size: var(--fs-sm); }
.ltr { direction: ltr; text-align: left; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.screen-head { margin-bottom: var(--space-4); }
.screen-head h2 { font-size: var(--fs-lg); font-weight: 800; margin-bottom: 4px; }
.screen-head p { font-size: .84rem; color: var(--text-muted); line-height: 1.7; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); font-size: .88rem; }
.kv > span:first-child { color: var(--text-muted); }
.kv > span:last-child { font-weight: 700; text-align: left; }
.kv.divided { padding-bottom: var(--space-2); border-bottom: 1px solid var(--line); }
.kv.total { font-size: 1.02rem; padding-top: var(--space-1); }
.kv.total > span:first-child { color: var(--text-color); font-weight: 700; }
.field-label { display: flex; justify-content: space-between; align-items: center; font-size: .86rem; font-weight: 600; color: var(--text-color) !important; margin-bottom: 2px; }
.field-label > span { display: inline-flex; align-items: center; gap: 6px; }
.field-label svg { width: 15px; height: 15px; }
.field-label small { font-weight: 400; color: var(--text-muted); }
.field-hint { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.card-title { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.card-title h3 { font-size: .95rem; font-weight: 700; }
.card-title svg { color: var(--brand); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin: var(--space-5) 0 var(--space-3); }
.section-head h3 { font-size: .98rem; font-weight: 800; }
.section-head p { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.section-head > svg { width: 20px; height: 20px; color: var(--accent); }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; padding: 4px 0; }

/* ---------- Header ---------- */
.header-bar { padding: 12px 16px; top: env(safe-area-inset-top, 0px); gap: 10px; }
.header-title { font-size: 1.12rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); cursor: pointer; padding: 0; }
.icon-btn svg { width: 17px; height: 17px; }
#theme-toggle-btn { width: 36px; height: 36px; padding: 0 !important; border-radius: 11px !important; }
#wallet-badge { height: 36px; padding: 0 12px !important; border-radius: 11px !important; cursor: pointer; font-size: .82rem !important; white-space: nowrap; }

/* ---------- Bottom navigation ---------- */
.bottom-nav { height: calc(var(--nav-h) + var(--safe-b)); padding: 0 6px var(--safe-b); justify-content: space-around; }
.nav-tab { position: relative; border: 0; background: none; font: inherit; font-size: .7rem; font-weight: 700; gap: 3px; border-radius: 14px; }
.nav-tab svg { width: 22px; height: 22px; margin-bottom: 0; transition: transform .25s ease; }
.nav-tab.active { color: var(--accent); text-shadow: none; }
.nav-tab.active svg { transform: translateY(-2px); }
.nav-tab.active::before { content: ''; position: absolute; top: 6px; width: 44px; height: 30px; border-radius: 12px; background: rgba(34, 211, 238, .12); z-index: -1; }
.nav-badge { position: absolute; top: 6px; left: calc(50% - 20px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; line-height: 1; }

/* ---------- Store switch → icon tiles ---------- */
.commerce-store-switch { gap: 8px; padding: 0; border: 0; background: none; }
.commerce-store-btn { flex-direction: column; gap: 6px; padding: 10px 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); font-size: .74rem; }
.commerce-store-btn svg { width: 20px; height: 20px; }
.store-tile-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); transition: all .2s ease; }
.commerce-store-btn.active { background: var(--surface); color: var(--text-color); border-color: rgba(34, 211, 238, .55); box-shadow: 0 0 0 1px rgba(34, 211, 238, .25) inset; }
.commerce-store-btn.active .store-tile-icon { background: var(--primary-gradient); color: #fff; }
#tab-buy.wizard-deep .commerce-store-switch { display: none; }
@media (max-width: 420px) { .commerce-store-btn { font-size: .68rem; padding-inline: 2px; } }

/* ---------- Wizard progress ---------- */
.wizard-progress { margin-bottom: var(--space-5); }
.wizard-progress-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.wizard-progress-top strong { font-size: .92rem; font-weight: 800; }
.wizard-progress-top small { font-size: var(--fs-xs); color: var(--text-muted); }
.wizard-progress-track { height: 6px; border-radius: 6px; background: var(--slider-track-bg); overflow: hidden; }
.wizard-progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--primary-gradient); transition: width .35s ease; }
#wizard-controls { margin-top: var(--space-4); }
#btn-wizard-back { padding: 10px; font-size: .84rem; }

.help-inline-link { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: var(--space-5); padding: 12px; border-radius: var(--radius-md); border: 1px dashed var(--line); background: none; color: var(--text-muted); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.help-inline-link svg { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Quick plans ---------- */
.plan-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 380px) { .plan-row { grid-template-columns: 1fr; } }
.plan-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 142px; padding: 14px 12px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); font: inherit; text-align: right; cursor: pointer; overflow: hidden; }
.plan-card.skel { border: 0; }
.plan-card.tone-violet { background: linear-gradient(160deg, rgba(139, 92, 246, .16), var(--surface) 70%); border-color: rgba(139, 92, 246, .35); }
.plan-card.tone-cyan { background: linear-gradient(160deg, rgba(6, 182, 212, .14), var(--surface) 70%); border-color: rgba(6, 182, 212, .3); }
.plan-card.tone-green { background: linear-gradient(160deg, rgba(16, 185, 129, .14), var(--surface) 70%); border-color: rgba(16, 185, 129, .3); }
.plan-badge { font-size: .62rem; font-weight: 800; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--primary-gradient); color: #fff; margin-bottom: 4px; }
.plan-card.tone-green .plan-badge { background: linear-gradient(135deg, #10b981, #0891b2); }
.plan-name { font-size: .84rem; font-weight: 800; }
.plan-spec { font-size: .68rem; color: var(--text-muted); line-height: 1.6; }
.plan-price { margin-top: auto; display: flex; flex-direction: column; font-size: .82rem; }
.plan-price s { font-size: .66rem; color: var(--danger); opacity: .85; }
.plan-price b { font-weight: 800; color: var(--accent); }
.plan-cta { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 800; color: var(--text-muted); }
.plan-cta svg { width: 13px; height: 13px; }
#quick-plans .section-head { margin-top: 0; }
.vpn-or-divider { display: flex; align-items: center; gap: 10px; margin: var(--space-5) 0 var(--space-2); color: var(--text-muted); font-size: .75rem; font-weight: 700; }
.vpn-or-divider::before, .vpn-or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Chips and segmented controls ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; margin-bottom: var(--space-4); }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }
.chip.active { color: #fff; border-color: transparent; background: var(--primary-gradient); }
.chip em { font-style: normal; font-size: .6rem; padding: 1px 6px; border-radius: 6px; background: rgba(245, 158, 11, .18); color: var(--warn); }
.chip.active em { background: rgba(255, 255, 255, .22); color: #fff; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 4px; border: 0; border-radius: 10px; background: none; color: var(--text-muted); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.seg button svg { width: 15px; height: 15px; }
.seg button.active { background: var(--surface-strong); color: var(--text-color); box-shadow: var(--shadow-1); }

/* ---------- Step 4: presets, epsilon, sticky CTA ---------- */
.preset-label { font-size: .78rem; color: var(--text-muted); margin: 4px 0 8px; font-weight: 600; }
.traffic-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.traffic-preset { position: relative; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; }
.traffic-preset small { display: block; font-size: .62rem; font-weight: 500; color: var(--text-muted); }
.traffic-preset.active { border-color: var(--accent); background: rgba(34, 211, 238, .1); }
.traffic-preset .pop { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: .56rem; padding: 1px 6px; border-radius: 6px; background: var(--primary-gradient); color: #fff; white-space: nowrap; }
.epsilon-block-title { font-size: .86rem; font-weight: 700; margin: 0 0 8px; }
#epsilon-duration-chips { margin-bottom: var(--space-4); }
.option-card .check-mark { color: var(--ok); visibility: hidden; }
.option-card.selected .check-mark { visibility: visible; }
.sticky-cta { position: sticky; bottom: var(--cta-bottom); z-index: 40; display: flex; align-items: center; gap: 12px; margin-top: var(--space-4); padding: 10px 10px 10px 14px; border-radius: 18px; border: 1px solid rgba(34, 211, 238, .3); background: var(--drawer-bg); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.sticky-cta-price { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sticky-cta-price small { font-size: .68rem; color: var(--text-muted); }
.sticky-cta-price > span { font-weight: 800; font-size: 1.02rem; color: var(--ok); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sticky-cta-price s { color: var(--danger); font-size: .74rem; font-weight: 500; }
.sticky-cta .btn { width: auto; flex-shrink: 0; padding: 12px 18px; }
.sticky-cta.stack-cta { flex-direction: column; align-items: stretch; padding: 12px; }
.sticky-cta.stack-cta .btn { width: 100%; }

/* ---------- Step 5: deficit card ---------- */
.deficit-card { border-radius: 18px; padding: 14px; margin-bottom: var(--space-4); border: 1px solid rgba(245, 158, 11, .45); background: linear-gradient(160deg, rgba(245, 158, 11, .12), transparent 70%); }
.deficit-head { display: flex; gap: 12px; align-items: center; }
.deficit-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; background: rgba(245, 158, 11, .16); color: var(--warn); }
.deficit-head strong { display: block; font-size: 1rem; font-weight: 800; }
.deficit-head small { font-size: .74rem; color: var(--text-muted); line-height: 1.7; }
.deficit-note { font-size: .72rem; color: var(--text-muted); margin-top: 8px; line-height: 1.7; }
.btn-secondary-pay { background: transparent; border: 1px solid var(--border-color-hover); color: var(--text-color); box-shadow: none; }

/* ---------- Success ---------- */
.success-hero { text-align: center; padding: 10px 6px 4px; }
.success-icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; color: var(--ok); background: rgba(16, 185, 129, .12); border: 2px solid var(--ok); animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.success-icon svg { width: 40px; height: 40px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-hero h2 { font-size: 1.3rem; font-weight: 800; color: var(--ok); margin-bottom: 6px; }
.success-hero p { font-size: .86rem; color: var(--text-muted); margin-bottom: var(--space-4); }
.success-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: var(--space-4); }
.success-meta > div { padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: right; }
.success-meta small { display: block; font-size: .68rem; color: var(--text-muted); }
.success-meta b { font-size: .86rem; overflow-wrap: anywhere; }
.success-actions { display: flex; gap: 10px; margin-top: var(--space-4); }

/* ---------- Service cards ---------- */
#services-list-container { gap: 10px; }
.svc-card { --lvl: var(--ok); position: relative; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); cursor: pointer; overflow: hidden; }
.svc-card::before { content: ''; position: absolute; inset: 0 0 0 auto; width: 3px; background: var(--lvl); opacity: .9; }
.svc-card.lvl-warn { --lvl: var(--warn); border-color: rgba(245, 158, 11, .4); }
.svc-card.lvl-danger { --lvl: var(--danger); border-color: rgba(239, 68, 68, .4); }
.svc-card.hidden { display: none; }
.svc-row { display: flex; align-items: center; gap: 12px; }
.svc-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--accent); }
.svc-icon svg { width: 20px; height: 20px; }
.svc-main { flex: 1; min-width: 0; }
.svc-title { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .92rem; min-width: 0; }
.svc-title bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-tag { flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: rgba(139, 92, 246, .15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, .25); }
.svc-sub { display: flex; align-items: center; gap: 4px; font-size: .72rem; color: var(--text-muted); margin-top: 2px; min-width: 0; }
.svc-sub svg { width: 12px; height: 12px; flex-shrink: 0; }
.svc-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-usage { margin-top: 12px; }
.svc-bar { height: 7px; border-radius: 7px; background: var(--slider-track-bg); overflow: hidden; }
.svc-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--ok), var(--accent)); transition: width .5s ease; }
.lvl-warn .svc-bar > span { background: var(--warn); }
.lvl-danger .svc-bar > span { background: var(--danger); }
.svc-bar.is-loading { background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 200% 100%; animation: skel 1.3s linear infinite; }
.svc-bar.is-infinite > span { background: repeating-linear-gradient(45deg, var(--ok), var(--ok) 8px, var(--accent) 8px, var(--accent) 16px); }
.svc-usage-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: .74rem; }
.svc-usage-text { color: var(--text-color); font-weight: 600; }
.svc-days { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.lvl-warn .svc-days { color: var(--warn); }
.lvl-danger .svc-days { color: var(--danger); }
.svc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.svc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 4px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; min-width: 0; }
.svc-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.lvl-warn .svc-btn-renew, .lvl-danger .svc-btn-renew { background: linear-gradient(135deg, #10b981, #059669); color: #fff; border-color: transparent; }

/* ---------- Orders hub ---------- */
.orders-block-title { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; font-size: .86rem; font-weight: 800; }
.orders-block-title small { font-weight: 500; color: var(--text-muted); font-size: .72rem; }
#orders-store-section { margin-top: var(--space-5); }
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.order-ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.order-ico svg { width: 18px; height: 18px; }
.t-accounts { color: #a78bfa !important; } .t-sms { color: #f472b6 !important; } .t-telegram { color: #38bdf8 !important; } .t-vpn { color: #22d3ee !important; }
.order-main { flex: 1; min-width: 0; }
.order-main strong { display: block; font-size: .86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-main > small { font-size: .7rem; color: var(--text-muted); }
.order-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.order-side b { font-size: .78rem; }
.order-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.order-extra code { font-size: .78rem; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); }
.order-extra .order-code { color: var(--ok); font-weight: 800; letter-spacing: .08em; }
.order-extra.muted { font-size: .72rem; color: var(--text-muted); }
.search-wrap { position: relative; margin-bottom: var(--space-3); }
.search-wrap svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search-wrap .input-control { padding: 10px 38px 10px 14px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 30px 18px; border-radius: 20px; border: 1px dashed var(--line); background: var(--surface); }
.empty-state.small { padding: 22px 14px; }
.empty-icon { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(6, 182, 212, .18)); color: var(--accent); }
.empty-state.small .empty-icon { width: 52px; height: 52px; border-radius: 16px; }
.empty-icon svg { width: 34px; height: 34px; }
.empty-state h4 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.empty-state p { font-size: .82rem; color: var(--text-muted); line-height: 1.8; margin-bottom: var(--space-4); }
.empty-actions { display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin: 0 auto; }

/* ---------- Home ---------- */
.home-greet { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--space-4); }
.home-greet small { font-size: .76rem; color: var(--text-muted); }
.home-greet h2 { font-size: 1.25rem; font-weight: 800; }
.home-wallet { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); font: inherit; cursor: pointer; }
.home-wallet > svg { width: 18px; height: 18px; color: var(--accent); }
.home-wallet > svg:last-child { width: 15px; height: 15px; padding: 2px; border-radius: 6px; background: var(--primary-gradient); color: #fff; }
.home-wallet span { display: flex; flex-direction: column; text-align: right; }
.home-wallet small { font-size: .62rem; color: var(--text-muted); }
.home-wallet b { font-size: .8rem; }
.home-pending { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: var(--space-4); border-radius: 16px; border: 1px solid rgba(139, 92, 246, .4); background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(6, 182, 212, .08)); }
.home-pending.ready { border-color: rgba(16, 185, 129, .5); background: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(6, 182, 212, .06)); }
.home-pending-icon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.home-pending-copy { flex: 1; min-width: 0; }
.home-pending-copy strong { display: block; font-size: .84rem; }
.home-pending-copy small { font-size: .7rem; color: var(--text-muted); line-height: 1.6; }
.home-pending-actions { display: flex; align-items: center; gap: 4px; }
.home-pending-actions .btn { width: auto; padding: 8px 12px; font-size: .76rem; }
.home-pending-x { border: 0; background: none; color: var(--text-muted); padding: 6px; cursor: pointer; }
.home-pending-x svg { width: 16px; height: 16px; }

.home-hero { --lvl: var(--ok); position: relative; padding: 16px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(139, 92, 246, .14), rgba(6, 182, 212, .06) 55%, var(--surface)); box-shadow: var(--shadow-1); overflow: hidden; }
.home-hero.lvl-warn { --lvl: var(--warn); border-color: rgba(245, 158, 11, .45); }
.home-hero.lvl-danger { --lvl: var(--danger); border-color: rgba(239, 68, 68, .45); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-id { min-width: 0; }
.hero-id small { font-size: .68rem; color: var(--text-muted); }
.hero-id h3 { display: flex; align-items: center; gap: 6px; font-size: 1.02rem; font-weight: 800; min-width: 0; }
.hero-id h3 bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-loc { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; color: var(--text-muted); }
.hero-loc svg { width: 12px; height: 12px; }
.hero-body { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.hero-ring { position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--slider-track-bg); stroke-width: 9; }
.ring-fill { fill: none; stroke: var(--lvl); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring-ok .ring-fill { stroke: url(#ring-grad-ok); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-center b { font-size: 1.45rem; font-weight: 900; line-height: 1.1; }
.ring-center small { font-size: .66rem; color: var(--text-muted); }
.hero-stats { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats small { font-size: .66rem; color: var(--text-muted); }
.hero-stats b { font-size: .8rem; font-weight: 700; line-height: 1.6; }
.hero-alert { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 14px; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .4); background: color-mix(in srgb, var(--lvl) 14%, transparent); border: 1px solid color-mix(in srgb, var(--lvl) 40%, transparent); font-size: .78rem; font-weight: 600; }
.hero-alert > svg { width: 18px; height: 18px; color: var(--lvl); flex-shrink: 0; }
.hero-alert > span { flex: 1; min-width: 160px; line-height: 1.7; }
.hero-alert .btn { width: auto; padding: 8px 14px; font-size: .78rem; background: linear-gradient(135deg, #10b981, #059669); box-shadow: none; }
.hero-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; }
.hero-actions svg { width: 20px; height: 20px; color: var(--accent); }
.hero-actions span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hero-more { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 10px; padding: 8px; border: 0; background: none; color: var(--text-muted); font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; }
.hero-more svg { width: 15px; height: 15px; }
.skel-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 280px; justify-content: center; }

.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-svc { --lvl: var(--ok); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); font: inherit; text-align: right; cursor: pointer; }
.mini-svc.lvl-warn { --lvl: var(--warn); } .mini-svc.lvl-danger { --lvl: var(--danger); }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lvl); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lvl) 18%, transparent); flex-shrink: 0; }
.mini-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-copy b { font-size: .84rem; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.mini-copy small { font-size: .7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.home-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: var(--space-4); }
.home-widget { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); font: inherit; text-align: right; cursor: pointer; min-width: 0; }
.home-widget > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.home-widget b { font-size: .8rem; }
.home-widget small { font-size: .66rem; color: var(--text-muted); line-height: 1.5; }
.home-widget-icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; }
.w-club .home-widget-icon { background: rgba(245, 158, 11, .14); color: #fbbf24; }
.w-invite .home-widget-icon { background: rgba(139, 92, 246, .16); color: #a78bfa; }
.store-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.store-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); font: inherit; cursor: pointer; min-width: 0; }
.store-tile b { font-size: .74rem; }
.store-tile small { font-size: .6rem; color: var(--text-muted); text-align: center; line-height: 1.4; }
.store-tile .store-tile-icon { width: 42px; height: 42px; border-radius: 14px; }
.store-tile svg { width: 21px; height: 21px; }

.home-welcome { padding: 20px 16px; border-radius: 22px; border: 1px solid rgba(139, 92, 246, .35); background: radial-gradient(120% 90% at 100% 0%, rgba(139, 92, 246, .25), transparent 60%), radial-gradient(100% 80% at 0% 100%, rgba(6, 182, 212, .2), transparent 60%), var(--surface); }
.welcome-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; color: var(--accent); padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(34, 211, 238, .1); }
.welcome-badge svg { width: 14px; height: 14px; }
.home-welcome h2 { font-size: 1.2rem; font-weight: 900; margin: 12px 0 6px; line-height: 1.6; }
.home-welcome p { font-size: .82rem; color: var(--text-muted); line-height: 1.9; }
.welcome-actions { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-4); }

/* ---------- Sheets ---------- */
.sheet-modal { position: fixed; inset: 0; z-index: 400; }
.sheet-modal[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .25s ease; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; padding: 10px 18px calc(22px + var(--safe-b)); border-radius: 24px 24px 0 0; background: var(--drawer-bg); border-top: 1px solid var(--line); transform: translateY(100%); transition: transform .28s cubic-bezier(.3, .9, .3, 1); }
.sheet-modal.open .sheet-backdrop { opacity: 1; }
.sheet-modal.open .sheet-panel { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; margin: 0 auto 12px; background: var(--border-color-hover); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: var(--space-4); }
.sheet-head h3 { font-size: 1.02rem; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sheet-head h3 svg { color: var(--accent); flex-shrink: 0; }
.sheet-head h3 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sheet-open { overflow: hidden; }
@media (min-width: 640px) { .sheet-panel { max-width: 600px; margin: 0 auto; } }
.qr-body { display: grid; place-items: center; padding: 14px; border-radius: 18px; background: #fff; max-width: 300px; margin: 0 auto; }
.qr-body svg { width: 100%; height: auto; }
.qr-hint { text-align: center; font-size: .78rem; color: var(--text-muted); margin-top: 12px; line-height: 1.8; }

/* FAQ inside the help sheet */
.faq-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq-item:last-child { border-bottom: 0; padding-bottom: 0; }
.faq-question { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .88rem; }
.faq-icon { width: 16px; height: 16px; flex-shrink: 0; transition: transform .2s; }
.faq-answer { margin-top: 10px; font-size: .83rem; line-height: 1.8; color: var(--text-muted); }
.faq-stack { display: flex; flex-direction: column; gap: 12px; }
.faq-banner { padding: 8px 10px; border-radius: 10px; font-weight: 800; }
.faq-banner.cyan { color: #22d3ee; background: rgba(34, 211, 238, .08); }
.faq-banner.green { color: #10b981; background: rgba(16, 185, 129, .08); }
.faq-indent { margin-right: 8px; margin-top: 4px; }
.faq-loc { border-radius: 12px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-2); }
.faq-loc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.faq-loc-list { font-size: .78rem; line-height: 1.7; color: var(--text-color); }
.faq-pill { font-size: .72rem; color: #4ade80; background: rgba(74, 222, 128, .1); padding: 2px 6px; border-radius: 6px; }
.faq-note { font-size: .78rem; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }

/* ---------- Connection guide ---------- */
.cg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.cg-kind { font-size: .7rem; font-weight: 700; color: var(--accent); }
.cg-head h3 { font-size: 1rem; font-weight: 800; }
.cg-progress-wrap { width: 110px; text-align: left; }
.cg-progress { height: 6px; border-radius: 6px; background: var(--slider-track-bg); overflow: hidden; }
.cg-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--accent)); transition: width .3s ease; }
.cg-progress-label { font-size: .64rem; color: var(--text-muted); }
.cg-platforms { margin-bottom: 14px; }
.cg-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.cg-steps .skel-block { height: 96px; border-radius: 16px; }
.cg-step { display: flex; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s; }
.cg-step.done { border-color: rgba(16, 185, 129, .45); }
.cg-check { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border-color-hover); background: none; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 2px; }
.cg-check svg { width: 15px; height: 15px; }
.cg-step.done .cg-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.cg-step-body { flex: 1; min-width: 0; }
.cg-step-body h4 { font-size: .9rem; font-weight: 800; margin-bottom: 4px; }
.cg-step-body p { font-size: .78rem; color: var(--text-muted); line-height: 1.8; }
.cg-apps { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cg-app { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font: inherit; text-align: right; cursor: pointer; }
.cg-app.primary { border-color: rgba(34, 211, 238, .45); }
.cg-app-name { font-size: .84rem; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.cg-app-name em { font-style: normal; font-size: .6rem; padding: 1px 6px; border-radius: 6px; background: var(--primary-gradient); color: #fff; }
.cg-app small { grid-column: 1; font-size: .68rem; color: var(--text-muted); }
.cg-app svg { grid-row: 1 / span 2; grid-column: 2; width: 18px; height: 18px; color: var(--accent); }
.cg-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cg-btn { padding: 11px 12px; font-size: .82rem; }
.cg-btn svg { width: 17px; height: 17px; }
.cg-btn-primary { background: var(--primary-gradient); color: #fff; border: 0; }
.cg-creds { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cg-cred { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); font-size: .76rem; }
.cg-cred span { color: var(--text-muted); flex-shrink: 0; }
.cg-cred code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.cg-mini { flex-shrink: 0; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text-color); font: inherit; font-size: .7rem; font-weight: 700; cursor: pointer; }
.cg-done { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 16px; background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .4); }
.cg-done svg { width: 28px; height: 28px; color: var(--ok); flex-shrink: 0; }
.cg-done strong { display: block; font-size: .9rem; }
.cg-done small { font-size: .72rem; color: var(--text-muted); }
.cg-error { padding: 16px; text-align: center; font-size: .82rem; color: var(--text-muted); }
.success-guide { text-align: right; margin-top: var(--space-2); }
.success-guide .cg { padding: 14px; border-radius: 20px; border: 1px solid rgba(139, 92, 246, .3); background: var(--surface); }

/* ---------- Drawers ---------- */
.drawer { padding: 20px 18px calc(22px + var(--safe-b)); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.1rem; font-weight: 800; }
.drawer-head small { font-size: .76rem; color: var(--text-muted); }
.drawer-close { width: auto !important; padding: 6px 12px !important; font-size: .82rem !important; }
.drawer-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: var(--space-4); }
.drawer-quick .btn { padding: 12px; font-size: .84rem; }
.btn-renew { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 14px rgba(16, 185, 129, .25); }
.cfg-card { padding: 14px; margin-bottom: 10px; }
.cfg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.cfg-head > span:first-child { font-size: .86rem; font-weight: 700; color: #a78bfa; display: flex; align-items: center; gap: 6px; }
.cfg-head svg { width: 16px; height: 16px; }
.cfg-note { font-size: .75rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.7; }
.cfg-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; font-size: .8rem; }
.cfg-row code { overflow-wrap: anywhere; }
.cfg-actions { display: flex; gap: 8px; }
.cfg-actions .btn { padding: 9px; font-size: .8rem; }
.btn-sm { width: auto !important; padding: 6px 12px !important; font-size: .78rem !important; }
.loc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.loc-grid .btn { padding: 8px 10px; font-size: .8rem; font-weight: 600; }
.charge-context { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); font-size: .78rem; line-height: 1.8; }
.charge-context svg { width: 16px; height: 16px; color: var(--warn); flex-shrink: 0; margin-top: 3px; }
.charge-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.preset-charge-btn { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-color); font: inherit; cursor: pointer; }
.preset-charge-btn small { font-size: .6rem; color: var(--warn); font-weight: 700; }
.preset-charge-btn b { font-size: 1rem; font-weight: 800; }
.preset-charge-btn span { font-size: .64rem; color: var(--text-muted); }
.preset-charge-btn.active { border-color: var(--accent); background: rgba(34, 211, 238, .1); }
#custom-charge-input { font-size: 1.1rem; text-align: center; font-weight: 700; }
.extend-deficit { font-size: .76rem; color: var(--warn); margin: -6px 0 12px; line-height: 1.7; }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-avatar { width: 60px; height: 60px; flex-shrink: 0; border-radius: 50%; background: var(--primary-gradient); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.4rem; font-weight: 800; }
.profile-head h2 { font-size: 1.1rem; font-weight: 800; }
.profile-wallet { margin-top: var(--space-3); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(6, 182, 212, .1)); }
.profile-wallet h2 { font-size: 1.35rem; font-weight: 800; margin-top: 2px; color: var(--accent); }
.profile-wallet .btn { width: auto; padding: 10px 16px; font-size: .84rem; }
.settings-list { margin-top: var(--space-3); padding: 4px 14px; }
.settings-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text-color); font: inherit; text-align: right; cursor: pointer; }
.settings-row:last-child { border-bottom: 0; }
.settings-row > svg:first-child { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.settings-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settings-row b { font-size: .86rem; }
.settings-row small { font-size: .7rem; color: var(--text-muted); }
.settings-row > svg:last-child { width: 16px; height: 16px; color: var(--text-muted); }
.settings-row.static { cursor: default; flex-wrap: wrap; }
.settings-row.static .seg { width: 100%; }
.invite-row { display: flex; gap: 8px; }
.invite-row .input-control { font-size: .78rem; }
.invite-row .btn { width: auto; padding: 0 14px; }
.profile-grid .glass-card { padding: 14px; text-align: center; }
.profile-grid span { font-size: .76rem; color: var(--text-muted); }
.profile-grid h2 { font-size: 1.25rem; font-weight: 800; margin-top: 4px; }
.profile-grid h2.small { font-size: .86rem; }

/* ---------- Skeletons ---------- */
.skel { position: relative; overflow: hidden; background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 200% 100%; animation: skel 1.3s linear infinite; border-radius: 12px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-line { display: block; height: 12px; border-radius: 6px; }
.skel-line.w40 { width: 40%; } .skel-line.w55 { width: 55%; } .skel-line.w70 { width: 70%; }
.skel-circle { width: 110px; height: 110px; border-radius: 50%; }
.skel-row { height: 64px; border-radius: 16px; margin-bottom: 8px; }
.skel-card { height: 132px; border-radius: 18px; margin-bottom: 10px; }
.skel-option { height: 74px; border-radius: 18px; margin-bottom: 12px; }
.skel-text { color: transparent !important; background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 200% 100%; animation: skel 1.3s linear infinite; border-radius: 6px; }
.skeleton-stack { padding: 4px 0; }
.lite .skel, .lite .skel-text, .lite .svc-bar.is-loading { animation: none; }

/* ---------- Pull to refresh ---------- */
.ptr-indicator { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 56px); left: 50%; z-index: 60; width: 38px; height: 38px; margin-top: -40px; border-radius: 50%; display: grid; place-items: center; background: var(--drawer-bg); border: 1px solid var(--line); color: var(--accent); box-shadow: var(--shadow-1); opacity: 0; transform: translate(-50%, 0); transition: opacity .15s; pointer-events: none; }
.ptr-indicator svg { width: 18px; height: 18px; transition: transform .2s; }
.ptr-indicator.armed svg { transform: rotate(180deg); }
.ptr-indicator.spinning svg { animation: spin .8s linear infinite; }

/* Loyalty back link */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--space-3); padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.back-link svg { width: 15px; height: 15px; }

/* ---------- Small pieces referenced from markup ---------- */
.wallet-chip { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.wallet-chip svg { width: 16px; height: 16px; color: var(--accent); }
.nav-badge[hidden] { display: none; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.spinner-sm { display: inline-block; width: 16px; height: 16px; border-width: 2px; vertical-align: middle; }
.price-old { color: var(--danger); font-size: .78rem; margin-left: 6px; font-weight: 500; }
.price-now { font-weight: 800; color: var(--accent); }
#summary-price s { color: var(--danger); font-size: .8rem; font-weight: 500; margin-left: 6px; }
.skel-center { margin: 0 auto 16px; }
.extend-list { max-height: 280px; overflow-y: auto; margin-bottom: 12px; }
#wizard-controls:not(.hidden) { display: flex; }
#wizard-controls .btn { flex: 1; }
.optional-fields { padding: 12px 14px; }
.optional-fields summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .86rem; font-weight: 700; }
.optional-fields summary::-webkit-details-marker { display: none; }
.optional-fields summary svg { width: 17px; height: 17px; color: var(--accent); }
.optional-fields summary span { flex: 1; }
.optional-fields summary small { font-weight: 500; color: var(--text-muted); font-size: .72rem; }
.optional-fields summary .optional-chevron { color: var(--text-muted); transition: transform .2s; }
.optional-fields[open] summary .optional-chevron { transform: rotate(180deg); }
.cfg-loc { border-color: rgba(56, 189, 248, .25); }
.cfg-loc .cfg-head > span:first-child { color: #38bdf8; }
.usage-remaining-inline { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.option-card h3 { font-size: .95rem; }

.sticky-cta .deficit-card { margin: 0; padding: 10px 12px; border-radius: 14px; }
.sticky-cta .deficit-icon { width: 34px; height: 34px; border-radius: 11px; }
.sticky-cta .deficit-head strong { font-size: .9rem; }
.sticky-cta .deficit-note { margin-top: 4px; font-size: .68rem; }
#quick-plans:not(.hidden) { margin-bottom: var(--space-6); }
#tab-services > .screen-head h2 { display: none; }

/* Fallbacks for WebViews without color-mix() */
.home-hero.lvl-danger .hero-alert { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); }
@supports (background: color-mix(in srgb, red 10%, transparent)) {
    .home-hero.lvl-danger .hero-alert { background: color-mix(in srgb, var(--lvl) 14%, transparent); border-color: color-mix(in srgb, var(--lvl) 40%, transparent); }
}

/* --- UX pass 2026-10-25 --- */
.hero-actions.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.renew-hint { color: var(--error-color, #ef4444); font-weight: 700; }
.link-btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; }
input, select, textarea { font-size: max(16px, 1em); }
.plan-price { gap: 1px; }
.plan-off { align-self: flex-start; font-style: normal; font-size: .64rem; font-weight: 800; color: #fff; background: #ef4444; border-radius: 999px; padding: 1px 7px; margin: 2px 0; }
.plan-spec { overflow-wrap: anywhere; line-height: 1.55; }
@media (max-width: 420px) {
  .plan-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
  .plan-row::-webkit-scrollbar { display: none; }
  .plan-card { flex: 0 0 62%; scroll-snap-align: start; }
}
.icon-btn, #help-btn, #theme-toggle-btn { min-width: 44px; min-height: 44px; }
.hero-more, .mini-svc, .home-widget { min-height: 44px; }
:focus-visible { outline: 2px solid var(--accent, #06b6d4); outline-offset: 2px; }
