/* MyVoxAccount portal stylesheet (redesign 2026-11-20).
   One stylesheet for every page. Visual language follows voxtypekey.com: Inter, VoxType blue #0052CC, slate text,
   white surfaces with soft borders, the blue-to-violet Premium gradient. Light and dark (system, or the Settings choice
   via html[data-theme]). Class names that the page scripts create (offer cards, meters, notifications, modals, rows)
   are kept exactly, so no script changed for the restyle. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-var.woff2') format('woff2');
}

/* ------------------------------------------------------------------ tokens */
:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --ink: #0f172a;
    --text: #1e293b;
    --muted: #526079;
    --primary: #0052cc;
    --primary-hover: #0047b3;
    --primary-ink: #003d99;
    --primary-soft: #e0ecff;
    --on-primary: #ffffff;
    --link: #0047b3;
    --success: #15803d;
    --success-soft: #dcfce7;
    --success-ink: #166534;
    --warn-bg: #fef3c7;
    --warn-border: #d97706;
    --warn-ink: #78350f;
    --warn-soft: #fffbeb;
    --danger: #b91c1c;
    --danger-hover: #991b1b;
    --danger-soft: #fef2f2;
    --danger-border: #fca5a5;
    --info-soft: #eff6ff;
    --focus: #2563eb;
    --hero: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 48%, #6d28d9 100%);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 20px -8px rgba(15, 23, 42, 0.12);
    --shadow-brand: 0 4px 15px rgba(0, 82, 204, 0.28);
    --overlay: rgba(15, 23, 42, 0.55);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --gutter: 16px;
    --content: 1120px;
    --header-h: 64px;
    /* names the security score script sets as inline strokes */
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-error: #dc2626;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0f172a;
        --surface: #162135;
        --surface-2: #1b283f;
        --surface-3: #22314b;
        --border: #2b3b57;
        --border-strong: #3b4d6d;
        --ink: #f1f5f9;
        --text: #e2e8f0;
        --muted: #a5b4c8;
        --primary: #2563eb;
        --primary-hover: #1d4ed8;
        --primary-ink: #9cc2ff;
        --primary-soft: #1c335a;
        --link: #8ab8ff;
        --success: #4ade80;
        --success-soft: #133a26;
        --success-ink: #86efac;
        --warn-bg: #3a2a0a;
        --warn-border: #d97706;
        --warn-ink: #fde68a;
        --warn-soft: #2e220b;
        --danger: #f87171;
        --danger-hover: #ef4444;
        --danger-soft: #3a1a1f;
        --danger-border: #7f1d1d;
        --info-soft: #172a4a;
        --focus: #8ab8ff;
        --shadow-sm: none;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-brand: 0 4px 15px rgba(0, 0, 0, 0.35);
        --overlay: rgba(2, 6, 23, 0.7);
        --color-success: #4ade80;
        --color-warning: #fbbf24;
        --color-error: #f87171;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --surface: #162135;
    --surface-2: #1b283f;
    --surface-3: #22314b;
    --border: #2b3b57;
    --border-strong: #3b4d6d;
    --ink: #f1f5f9;
    --text: #e2e8f0;
    --muted: #a5b4c8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-ink: #9cc2ff;
    --primary-soft: #1c335a;
    --link: #8ab8ff;
    --success: #4ade80;
    --success-soft: #133a26;
    --success-ink: #86efac;
    --warn-bg: #3a2a0a;
    --warn-border: #d97706;
    --warn-ink: #fde68a;
    --warn-soft: #2e220b;
    --danger: #f87171;
    --danger-hover: #ef4444;
    --danger-soft: #3a1a1f;
    --danger-border: #7f1d1d;
    --info-soft: #172a4a;
    --focus: #8ab8ff;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-brand: 0 4px 15px rgba(0, 0, 0, 0.35);
    --overlay: rgba(2, 6, 23, 0.7);
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-error: #f87171;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.625rem, 3.4vw, 2.125rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3 { font-size: 1.0625rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--primary-ink); }
img, svg { max-width: 100%; }
svg { flex-shrink: 0; }
ul { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary-soft); color: var(--ink); }

.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.text-secondary { color: var(--muted); }
.text-sm { font-size: 0.875rem; }
.text-center { text-align: center; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2rem; }

.skip-link, .skip-to-content {
    position: absolute; left: 12px; top: -60px; z-index: 1000;
    background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px;
    font-weight: 700; text-decoration: none;
}
.skip-link:focus, .skip-to-content:focus { top: 0; color: #fff; }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font-size: 0.9375rem; font-weight: 650; line-height: 1.25; text-decoration: none; text-align: center;
    cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--primary); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1f0a0a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #1f0a0a; } }
.btn-danger:hover { background: var(--danger-hover); }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 0.875rem; }
.btn:disabled, .btn[disabled] {
    background: var(--surface-3); color: var(--muted); border-color: var(--border); box-shadow: none; cursor: not-allowed;
}
.link-text { font-weight: 650; text-decoration: none; color: var(--link); }
.link-text:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink); margin-bottom: 6px; }
.form-input {
    width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input::placeholder { color: var(--muted); opacity: 0.85; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }
.form-input[readonly] { background: var(--surface-2); color: var(--muted); }
select.form-input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.form-input-sm { width: auto; min-width: 160px; }
.form-hint { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.form-row { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; font-size: 0.9rem; }
.checkbox-wrapper { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.checkbox-wrapper input, .ack-row input, .offer-ack input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.password-input-wrapper { position: relative; }
.password-input-wrapper .form-input { padding-right: 48px; }
.password-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.password-toggle:hover { color: var(--ink); background: var(--surface-3); }
.password-toggle svg { width: 20px; height: 20px; }

.toggle-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: none; }
.toggle-switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle-slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background-color .15s ease; }
.toggle-slider::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .15s ease; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------------ app header + section nav */
.app-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.app-header-inner {
    max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter); height: var(--header-h);
    display: flex; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.02em; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand:hover { color: var(--ink); }
.section-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav-link {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 999px;
    color: var(--muted); font-weight: 600; font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
}
.nav-link svg { width: 18px; height: 18px; }
.nav-link:hover { color: var(--ink); background: var(--surface-3); }
.nav-link[aria-current="page"] { color: var(--primary-ink); background: var(--primary-soft); }
.nav-short { display: none; }
.account-chip { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; }
.user-details { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.user-name { font-weight: 650; font-size: 0.875rem; color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-plan { font-size: 0.75rem; color: var(--muted); }
.user-plan:empty { display: none; }

@media (max-width: 1040px) {
    .nav-link .nav-long { display: none; }
    .nav-link .nav-short { display: inline; }
    .user-details { display: none; }
}
@media (max-width: 760px) {
    :root { --header-h: 56px; }
    /* backdrop-filter would make the header the containing block of the fixed tab bar: drop it on phones */
    .app-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
    .user-details { display: none; }
    .section-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0;
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
        background: var(--surface); border-top: 1px solid var(--border);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 16px -8px rgba(15, 23, 42, 0.18);
    }
    .nav-link { flex-direction: column; gap: 2px; border-radius: 12px; font-size: 0.75rem; min-height: 54px; padding: 6px 4px; justify-content: center; }
    .nav-link svg { width: 22px; height: 22px; }
    .account-chip { margin-left: auto; }
    body.has-tabbar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------------ page frame */
.page { max-width: var(--content); margin: 0 auto; padding: 28px var(--gutter) 48px; }
.page:focus { outline: none; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 6px; }
.page-lead { color: var(--muted); margin: 0; max-width: 62ch; }
.stack { display: grid; gap: 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.section-title h2 { font-size: 1.25rem; }
@media (min-width: 768px) { :root { --gutter: 24px; } .page { padding-top: 36px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }

.app-footer { width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--content) - 2 * var(--gutter)); margin: 0 auto; padding: 24px 0 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.875rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.app-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    position: relative; background: none; border: 0; padding: 12px 16px; min-height: 48px; cursor: pointer;
    font-weight: 650; font-size: 0.9375rem; color: var(--muted); white-space: nowrap; border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--ink); background: var(--surface-3); }
.tab[aria-selected="true"] { color: var(--primary-ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
:root[data-theme="dark"] .tab[aria-selected="true"]::after { background: var(--primary-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab[aria-selected="true"]::after { background: var(--primary-ink); } }
.tab-panel:focus { outline: none; }
.tab-panel { display: grid; gap: 20px; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
@media (min-width: 768px) { .card { padding: 24px; } }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-title { font-size: 1.0625rem; font-weight: 700; color: var(--ink); margin: 0; }
.card-sub { color: var(--muted); font-size: 0.9rem; margin: -8px 0 16px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); grid-column: 1 / -1; }

/* ------------------------------------------------------------------ status badges */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 650; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.status-badge.connected { background: var(--success-soft); color: var(--success-ink); }
.status-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

/* ------------------------------------------------------------------ Dashboard: plan hero (the one loud element) */
.plan-hero {
    position: relative; overflow: hidden; color: #fff; background: var(--hero);
    border-radius: 24px; padding: 24px 20px; box-shadow: 0 18px 40px -22px rgba(29, 78, 216, 0.65);
}
.plan-hero::after {
    content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.16), transparent); pointer-events: none;
}
.plan-hero > * { position: relative; z-index: 1; }
.plan-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.plan-hero-kicker { font-weight: 650; color: #dbe5ff; font-size: 0.9375rem; }
.plan-hero h2 { color: #fff; font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 8px; }
.plan-hero .text-secondary, .plan-hero p { color: #e0e7ff; }
.plan-hero #currentPlanDescription { max-width: 60ch; font-size: 1.0625rem; margin: 0; }
.plan-hero .plan-badge { background: rgba(255, 255, 255, 0.18) !important; color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }
.plan-status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; background: rgba(255, 255, 255, 0.95); color: #1e3a8a; }
.plan-status-chip:empty { display: none; }
.billing-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 20px 0 0; }
.billing-item { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.billing-label { font-size: 0.8125rem; color: #c7d2fe; font-weight: 600; }
.billing-value { font-size: 1.0625rem; font-weight: 750; color: #fff; overflow-wrap: anywhere; }
.plan-hero .billing-note { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(15, 23, 42, 0.28); color: #fff; font-size: 0.9375rem; }
.billing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.billing-actions:empty { display: none; }
.plan-hero .btn-secondary { background: #fff; color: #1e3a8a; border-color: #fff; }
.plan-hero .btn-secondary:hover { background: #eef2ff; color: #1e3a8a; }
.plan-hero .billing-actions .text-secondary { color: #e0e7ff; }
.plan-hero :focus-visible { outline-color: #fff; }
.plan-hero-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; }
.plan-hero-links a { color: #fff; font-weight: 650; }
@media (min-width: 768px) { .plan-hero { padding: 32px; } }

.plan-badge {
    display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700;
    background: var(--primary-soft) !important; color: var(--primary-ink);
}

/* "Plans are being updated" */
.plans-updating-notice { background: var(--info-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.plans-updating-notice h3 { margin: 0 0 4px; font-size: 1rem; }

/* ------------------------------------------------------------------ Premium offers (built by subscription.js) */
.offers-area { scroll-margin-top: calc(var(--header-h) + 16px); }
.offers-head { margin: 0 0 14px; }
.offers-head h2 { margin: 0 0 4px; }
.offers-head p { margin: 0; color: var(--muted); }
.early-panel { border: 2px solid var(--primary); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 14px; background: var(--surface); box-shadow: var(--shadow-brand); }
.early-panel p { margin: 0; }
.early-seats { font-weight: 750; color: var(--primary-ink); }
.early-ends { font-size: 0.9rem; color: var(--muted); margin-top: 4px !important; }
.seats-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.seats-bar span { display: block; height: 100%; background: var(--primary); }
.trial-line { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--success-soft); color: var(--success-ink); font-weight: 600; }
.trial-warning { border: 2px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 14px; }
.trial-warning strong { display: block; font-size: 1rem; margin-bottom: 4px; color: var(--warn-ink); }
.trial-warning p { margin: 0; color: var(--warn-ink); }

.offer-cards { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
@media (min-width: 900px) {
    .offer-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .offer-cards.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .offer-cards.n1 { grid-template-columns: minmax(0, 420px); }
}
.offer-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px;
    display: flex; flex-direction: column; gap: 8px; min-width: 0; box-shadow: var(--shadow);
}
.offer-card.early { border: 2px solid var(--primary); box-shadow: var(--shadow-brand); }
.offer-card.selected { border: 2px solid var(--warn-border); box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.22); }
.offer-card.gone { background: var(--surface-2); box-shadow: none; opacity: 0.85; }
.offer-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.offer-label { font-weight: 700; font-size: 1.0625rem; color: var(--ink); }
.offer-badge { font-size: 0.8125rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--success-soft); color: var(--success-ink); }
.offer-big { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--ink); margin: 2px 0 0; letter-spacing: -0.025em; }
.offer-billed { margin: 0; font-size: 0.9rem; color: var(--muted); }
.offer-terms { font-size: 0.875rem; color: var(--muted); margin: 0; }
.offer-note { margin: 0; font-size: 0.9rem; font-weight: 650; color: var(--primary-ink); }
.offer-trial { margin: 0; font-size: 0.9rem; color: var(--text); }
.offer-action { margin-top: auto; display: grid; gap: 8px; padding-top: 8px; }
.offer-action .btn { width: 100%; white-space: normal; }
.offer-small { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.offer-ack { display: flex; gap: 8px; align-items: flex-start; font-size: 0.875rem; color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: 10px; padding: 10px; cursor: pointer; }
.offer-gone { margin: 0; font-weight: 650; color: var(--muted); }
.offer-price { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.ack-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 0.9rem; }

/* Free / Premium plan cards (built by subscription.js) */
.plans-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .plans-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.plan-card.current { border-color: var(--primary); }
.plan-card-header { padding: 20px 20px 4px; }
.plan-card-header h3 { font-size: 1.125rem; margin: 0 0 4px; }
.plan-card-header p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.plan-card-header.proplus h3 { color: var(--primary-ink); }
.plan-card-price { padding: 8px 20px 0; }
.price-amount { font-size: 1.75rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.plan-features { list-style: none; padding: 12px 20px; margin: 0; display: grid; gap: 8px; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; color: var(--text); }
.plan-features svg { width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: var(--success); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fair-use { padding: 12px 20px 0; font-size: 0.9rem; color: var(--muted); }
.fair-use p { margin: 0; }
.offer-list { list-style: none; margin: 0; padding: 0 20px 20px; display: grid; gap: 12px; }
.plan-card > .offer-terms { padding: 0 20px 20px !important; }
.plan-card .plan-select-btn { margin: auto 20px 20px; width: auto; }

.facts-list { margin: 0; padding: 0 0 0 1.15rem; color: var(--text); display: grid; gap: 8px; font-size: 0.9375rem; }
.facts-list li::marker { color: var(--primary); }

/* ------------------------------------------------------------------ meters (built by account.js) */
.usage-overview { display: grid; gap: 18px; }
.usage-item { min-width: 0; }
.usage-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.usage-label { font-weight: 650; color: var(--ink); }
.usage-value { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; font-size: 0.9375rem; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--primary); min-width: 0; transition: width .4s ease; }
.progress-fill.ai { background: #7c3aed; }
.progress-fill.warning { background: #d97706; }
.progress-fill.danger { background: #dc2626; }
.meter-note { margin: 6px 0 0; }
@media (min-width: 900px) { .usage-overview.is-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

/* Dashboard usage snapshot */
.snapshot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.snapshot-head h2 { font-size: 1.25rem; }
.snapshot-meta { color: var(--muted); font-size: 0.9rem; margin: 2px 0 0; }
.snap-plan:empty { display: none; }
.snap-plan { display: inline-flex; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); font-size: 0.8125rem; font-weight: 700; margin-left: 6px; vertical-align: 2px; }
.snap-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
@media (min-width: 760px) { .snap-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.snap-figure { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.snap-figure .stat-value { font-size: 1.5rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.snap-figure .stat-label { font-size: 0.8125rem; color: var(--muted); }
.snap-apps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.snap-apps li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9375rem; flex-wrap: wrap; }
.snap-apps .platform-name { font-weight: 600; color: var(--ink); }
.snap-apps .platform-usage { color: var(--muted); font-variant-numeric: tabular-nums; }

.two-col { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }

/* "Your apps" list (dashboard.js) */
.platforms-list { display: grid; gap: 0; }
.platform-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.platform-item:last-child { border-bottom: 0; }
.platform-item-info { display: flex; flex-direction: column; min-width: 0; }
.platform-item-name { font-weight: 650; color: var(--ink); }
.platform-item-link { font-size: 0.875rem; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.data-table th { text-align: left; font-size: 0.8125rem; font-weight: 650; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; overflow-wrap: break-word; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:first-child { font-weight: 600; color: var(--ink); }
.data-table td.text-center { text-align: center; font-weight: 400; color: var(--muted); padding: 24px 10px; }
.data-table.num td:not(:first-child), .data-table.num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .data-table { font-size: 0.875rem; } .data-table th, .data-table td { padding-left: 6px; padding-right: 6px; } }

/* Dictionary */
.dict-add-form { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: end; }
.dict-add-form label { display: block; }
.dict-add-form .field-label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink); margin-bottom: 6px; }
@media (min-width: 760px) { .dict-add-form { grid-template-columns: 1fr 1fr auto; } }
.dict-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.dict-tools .form-input { max-width: 260px; }

.reset-info { display: flex; gap: 14px; align-items: flex-start; }
.reset-info svg { width: 24px; height: 24px; color: var(--primary); margin-top: 2px; }
.reset-info-text strong { color: var(--ink); }
.reset-info-text p { margin: 2px 0 0; }

/* ------------------------------------------------------------------ settings */
.settings-section { display: grid; gap: 0; }
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-item:first-child { padding-top: 0; }
.setting-item:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-name { font-weight: 650; color: var(--ink); }
.setting-description { font-size: 0.875rem; color: var(--muted); }
@media (max-width: 520px) { .setting-item.stack-sm { flex-direction: column; align-items: stretch; } }
.profile-edit { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .profile-edit { grid-template-columns: auto 1fr; } .form-row { grid-template-columns: 1fr 1fr; } }
.avatar-edit { position: relative; width: 88px; height: 88px; border-radius: 50%; overflow: hidden; }
.avatar-large { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: block; background: var(--surface-3); }
.avatar-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: rgba(15, 23, 42, 0.55); color: #fff; font-size: 0.75rem; font-weight: 650; border: 0; opacity: 0; cursor: pointer; transition: opacity .15s ease;
}
.avatar-overlay svg { width: 20px; height: 20px; }
.avatar-edit:hover .avatar-overlay, .avatar-overlay:focus-visible { opacity: 1; }
.connected-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account-provider { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); }
.account-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.account-email { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.info-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.info-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info-label { font-size: 0.8125rem; color: var(--muted); }
.info-value { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }

.danger-zone { border-color: var(--danger-border); }
.danger-zone .card-title { color: var(--danger); }
.danger-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.danger-info { min-width: 0; flex: 1 1 280px; }
.danger-info strong { color: var(--ink); }
.danger-info p { margin: 4px 0 0; }
.warning-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--danger-soft); border: 1px solid var(--danger-border); color: var(--text); margin-bottom: 14px; }
.warning-box svg { width: 22px; height: 22px; color: var(--danger); margin-top: 2px; }
.warning-box strong { color: var(--ink); }
.warning-box p { margin: 4px 0; }
.warning-box ul { padding-left: 1.1rem; margin: 4px 0 0; }
.delete-plan-effect { border: 2px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.delete-plan-effect p, .delete-plan-effect .text-secondary, .delete-plan-effect strong { color: var(--warn-ink); margin: 0; }

/* ------------------------------------------------------------------ security */
.security-score { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.score-circle { position: relative; width: 112px; height: 112px; flex: none; }
.score-circle svg { width: 112px; height: 112px; }
.score-circle .score-track { stroke: var(--surface-3); }
.score-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-value > span:first-child { font-size: 1.75rem; font-weight: 800; color: var(--ink); line-height: 1; }
.score-label { font-size: 0.75rem; color: var(--muted); }
.score-details { flex: 1 1 240px; min-width: 0; }
.score-details h2 { margin-bottom: 4px; }
.score-checklist { display: grid; gap: 6px; margin-top: 12px; }
.check-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9375rem; }
.check-item svg { width: 18px; height: 18px; }
.check-item.done { color: var(--text); }
.check-item.done svg { color: var(--success); }
.info-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); color: var(--text); font-size: 0.9rem; }
.info-box svg { width: 20px; height: 20px; color: var(--primary-ink); margin-top: 1px; }
.info-box p { margin: 0; }
.login-history, .devices-list { display: grid; gap: 0; }
.login-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.login-item:last-child { border-bottom: 0; }
.login-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.login-icon svg { width: 20px; height: 20px; }
.login-details { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.login-device { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.login-info { font-size: 0.875rem; color: var(--muted); }
.security-features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .security-features { grid-template-columns: 1fr 1fr; } }
.security-feature { display: flex; gap: 12px; align-items: flex-start; }
.security-feature-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.security-feature-icon svg { width: 20px; height: 20px; }
.security-feature-content h3 { margin: 0 0 2px; }
.security-feature-content p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.tips-list { display: grid; gap: 14px; }
.tip-item { display: flex; gap: 12px; align-items: flex-start; }
.tip-mark { width: 22px; height: 22px; color: var(--success); flex: none; margin-top: 1px; }
.tip-content strong { color: var(--ink); }
.tip-content p { margin: 2px 0 0; font-size: 0.9rem; color: var(--muted); }
.password-strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 0.8125rem; color: var(--muted); }
.password-strength:empty { display: none; }
.strength-bar { height: 6px; border-radius: 999px; flex: 1; background: var(--surface-3); position: relative; overflow: hidden; }
.strength-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.strength-bar.weak::after { width: 33%; background: #dc2626; }
.strength-bar.medium::after { width: 66%; background: #d97706; }
.strength-bar.strong::after { width: 100%; background: #16a34a; }

/* ------------------------------------------------------------------ modals (markup + App.confirm) */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal-overlay { align-items: center; padding: 24px; } }
.modal {
    width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--surface); color: var(--text);
    border-radius: 20px 20px 0 0; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45); border: 1px solid var(--border);
}
@media (min-width: 640px) { .modal { border-radius: 20px; } }
.modal-sm { max-width: 420px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-header h3 { font-size: 1.125rem; }
.modal-close { width: 44px; height: 44px; margin: -8px -10px -8px 0; border: 0; background: none; border-radius: 10px; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
.modal-body { padding: 8px 20px 12px; }
.modal-body p { margin: 0 0 10px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 20px 20px; }
.modal-confirm .modal-header { padding-bottom: 0; }
@media (max-width: 420px) { .modal-footer .btn { flex: 1 1 auto; } }

/* ------------------------------------------------------------------ notifications (App.showNotification) */
.notification-container { position: fixed; z-index: 300; right: 16px; left: 16px; top: calc(var(--header-h) + 12px); display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.notification {
    pointer-events: auto; width: 100%; max-width: 420px; display: flex; align-items: flex-start; gap: 10px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: 12px; padding: 12px 8px 12px 14px; box-shadow: 0 12px 30px -12px rgba(15, 23, 42, 0.35);
    animation: note-in .2s ease-out;
}
.notification-success { border-left-color: #16a34a; }
.notification-error { border-left-color: #dc2626; }
.notification-warning { border-left-color: #d97706; }
.notification-icon svg { width: 20px; height: 20px; display: block; }
.notification-success .notification-icon { color: #16a34a; }
.notification-error .notification-icon { color: #dc2626; }
.notification-warning .notification-icon { color: #d97706; }
.notification-info .notification-icon { color: var(--primary-ink); }
.notification-message { flex: 1; font-size: 0.9375rem; padding-top: 1px; overflow-wrap: anywhere; }
.notification-close { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 8px; flex: none; }
.notification-close:hover { background: var(--surface-3); color: var(--ink); }
.notification-exit { opacity: 0; transform: translateY(-6px); transition: opacity .25s ease, transform .25s ease; }
@keyframes note-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ loading */
.loading-overlay { position: fixed; inset: 0; z-index: 250; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); background: color-mix(in srgb, var(--bg) 80%, transparent); color: var(--ink); font-weight: 600; }
.loading-overlay p { margin: 0; }
.loading-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ public pages: sign in */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header-inner { max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter); min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; text-decoration: none; font-size: 0.9375rem; }
.site-header nav a:hover { color: var(--ink); background: var(--surface-3); }
@media (max-width: 420px) { .site-header nav .hide-xs { display: none; } }

.signin-hero { background: var(--hero); color: #fff; }
.signin-hero-inner { max-width: var(--content); margin: 0 auto; padding: 40px var(--gutter) 48px; display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .signin-hero-inner { grid-template-columns: minmax(0, 1fr) 440px; padding: 72px var(--gutter); gap: 56px; } }
.signin-copy h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; letter-spacing: -0.035em; margin: 0 0 14px; }
.signin-copy p { color: #e0e7ff; font-size: 1.0625rem; max-width: 52ch; }
.signin-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.signin-points li { display: flex; gap: 10px; align-items: flex-start; color: #fff; font-weight: 550; }
.signin-points svg { width: 20px; height: 20px; color: #a7f3d0; margin-top: 2px; }

.auth-card { background: var(--surface); color: var(--text); border-radius: 24px; padding: 24px 20px; box-shadow: 0 30px 60px -30px rgba(2, 6, 23, 0.6); border: 1px solid var(--border); }
@media (min-width: 480px) { .auth-card { padding: 32px 28px; } }
.auth-card-header { margin-bottom: 18px; }
.auth-card-header h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.auth-card-header p { color: var(--muted); margin: 0; }
.btn-social { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font-weight: 650; cursor: pointer; }
.btn-social:hover { background: var(--surface-2); border-color: var(--primary); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.875rem; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; margin-bottom: 18px; }
.auth-tab { min-height: 40px; border: 0; background: none; border-radius: 9px; font-weight: 650; color: var(--muted); cursor: pointer; }
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-panel { display: none; }
.auth-panel.active { display: block; }

.landing-section { max-width: var(--content); margin: 0 auto; padding: 48px var(--gutter); }
.landing-section > h2 { font-size: 1.5rem; margin-bottom: 6px; }
.landing-section > p { color: var(--muted); margin-bottom: 24px; max-width: 60ch; }
.feature-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.feature-card h3 { margin: 12px 0 6px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.feature-icon-box { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-ink); }
.feature-icon-box svg { width: 22px; height: 22px; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer-inner { max-width: var(--content); margin: 0 auto; padding: 28px var(--gutter); display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; color: var(--muted); font-size: 0.9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------------------ result pages (payment success / cancelled) */
.payment-result-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }
@media (min-height: 700px) { .payment-result-page { align-items: center; } }
.payment-result-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 32px 24px; text-align: center; box-shadow: var(--shadow); }
.payment-logo img { width: 48px; height: 48px; border-radius: 12px; }
.success-icon, .cancelled-icon { width: 64px; height: 64px; border-radius: 50%; margin: 18px auto 14px; display: flex; align-items: center; justify-content: center; }
.success-icon { background: var(--success-soft); color: var(--success); }
.cancelled-icon { background: var(--warn-bg); color: var(--warn-ink); }
.success-icon svg, .cancelled-icon svg { width: 32px; height: 32px; }
.payment-result-card h1 { font-size: 1.625rem; margin-bottom: 8px; }
.payment-result-card .subtitle { color: var(--muted); margin-bottom: 20px; }
.payment-result-card .plan-info { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 20px; }
.payment-result-card .plan-name { font-weight: 800; font-size: 1.125rem; color: var(--ink); }
.payment-result-card .plan-detail { color: var(--muted); font-size: 0.9375rem; }
.redirect-notice, .support-link { color: var(--muted); font-size: 0.9rem; margin: 16px 0 0; }
.countdown { font-weight: 700; color: var(--ink); }
.action-buttons { display: grid; gap: 10px; }

/* ------------------------------------------------------------------ guest pages (welcome.html, link-purchase.html) and the app sign-in hand-off (auth-handoff.html, hx-) */
.gx-page, .hx-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.gx-card, .hx-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 24px; padding: 28px 22px; max-width: 560px; width: 100%; box-shadow: var(--shadow); overflow: hidden; }
@media (min-width: 480px) { .gx-card, .hx-card { padding: 32px 28px; } }
.hx-card { max-width: 480px; }
.gx-card::before, .hx-card::before { content: ""; display: block; height: 6px; margin: -32px -28px 24px; background: var(--hero); }
@media (max-width: 479px) { .gx-card::before, .hx-card::before { margin: -28px -22px 22px; } }
.gx-logo, .hx-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-bottom: 20px; color: var(--ink); letter-spacing: -0.01em; }
.gx-logo img, .hx-logo img { width: 40px; height: 40px; border-radius: 10px; }
.gx-card h1, .hx-card h1 { font-size: 1.625rem; margin: 0 0 10px; color: var(--ink); }
.gx-card p, .hx-card p { margin: 0 0 12px; color: var(--text); line-height: 1.55; }
.gx-email { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.gx-when { background: var(--success-soft); border: 1px solid #16a34a; color: var(--success-ink) !important; border-radius: 12px; padding: 10px 12px; font-weight: 650; }
.gx-warn { background: var(--warn-bg); border: 2px solid var(--warn-border); color: var(--warn-ink); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.gx-warn p, .gx-warn strong { color: var(--warn-ink); }
.gx-apps { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.gx-apps a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 650; background: var(--surface); }
.gx-apps a:hover { border-color: var(--primary); background: var(--surface-2); }
.gx-small { font-size: 0.9rem; color: var(--muted) !important; }
.gx-btn, .hx-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; box-shadow: var(--shadow-brand); }
.gx-btn:hover, .hx-btn:hover { background: var(--primary-hover); color: #fff; }
.gx-btn[disabled], .hx-btn[disabled] { opacity: 0.6; cursor: wait; }
.gx-link { background: none; border: 0; color: var(--link); text-decoration: underline; font: inherit; cursor: pointer; padding: 8px 0; min-height: 44px; }
.gx-spinner, .hx-spinner { width: 28px; height: 28px; border: 3px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; margin: 8px 0 16px; }

.hx-card a:not(.hx-btn) { color: var(--link); }
.hx-card strong { color: var(--ink); overflow-wrap: anywhere; }
.hx-card p { margin: 0 0 14px; }

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ small additions */
#plans, #billing-facts, .tab-panel { scroll-margin-top: calc(var(--header-h) + 16px); }
.stack > .page-head { margin-bottom: 0; }
.snap-figure .platform-usage { font-weight: 700; color: var(--ink); font-size: 1rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
a.snap-link { text-decoration: none; color: inherit; }
a.snap-link:hover { border-color: var(--primary); }
a.snap-link .stat-label { color: var(--link); font-weight: 600; }

/* Dictionary words on phones: one block per word (word + remove button, then "sounds like" and who added it) */
.dict-table td .btn { white-space: nowrap; }
@media (max-width: 560px) {
    .dict-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .dict-table, .dict-table tbody { display: block; }
    .dict-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--border); }
    .dict-table tbody tr:last-child { border-bottom: 0; }
    .dict-table td { border: 0; padding: 0; }
    .dict-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .dict-table td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 0.875rem; }
    .dict-table td:nth-child(2):not(:empty)::before { content: "Sounds like: "; }
    .dict-table td:nth-child(2):empty { display: none; }
    .dict-table td:nth-child(3) { grid-column: 1; grid-row: 3; font-size: 0.8125rem; }
    .dict-table td:nth-child(4) { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
    .dict-table td[colspan] { grid-column: 1 / -1; grid-row: auto; }
}

/* very small phones (320-380 px): logo mark only, tighter header */
@media (max-width: 380px) {
    .brand span { display: none; }
    .app-header-inner { gap: 8px; }
}
a.btn[href^="mailto:"] { overflow-wrap: anywhere; white-space: normal; max-width: 100%; }

/* Dictionary: saved state + sync status (2026-11-21) */
.dict-save { margin: 10px 0 0; font-size: 0.9rem; font-weight: 600; min-height: 1.4em; }
.dict-save[data-state="saving"] { color: var(--muted); }
.dict-save[data-state="ok"] { color: var(--success-ink); }
.dict-save[data-state="error"] { color: var(--danger); }
.dict-sync { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--success-soft); border: 1px solid transparent; }
.dict-sync-icon { width: 22px; height: 22px; color: var(--success-ink); }
.dict-sync-text { flex: 1 1 220px; margin: 0; color: var(--success-ink); font-weight: 600; font-size: 0.9375rem; }
.dict-sync[data-state="busy"] { background: var(--surface-2); border-color: var(--border); }
.dict-sync[data-state="busy"] .dict-sync-icon, .dict-sync[data-state="busy"] .dict-sync-text { color: var(--muted); }
.dict-sync[data-state="error"] { background: var(--danger-soft); border-color: var(--danger-border); }
.dict-sync[data-state="error"] .dict-sync-icon, .dict-sync[data-state="error"] .dict-sync-text { color: var(--danger); }
.dict-apps { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); }
.dict-apps h3 { font-size: 0.9375rem; margin: 0 0 8px; }
.dict-apps ul { margin: 0 0 8px; padding-left: 1.1rem; display: grid; gap: 4px; }
.dict-apps strong { color: var(--ink); font-weight: 650; }
.dict-apps p { margin: 0; }

/* ------------------------------------------------------------------ larger header (owner, 2026-11-21): closer to voxtypekey.com */
:root { --header-h: 76px; }
.app-header-inner { gap: 20px; }
.brand { gap: 12px; font-size: 1.3125rem; font-weight: 800; letter-spacing: -0.025em; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.section-nav { gap: 6px; }
.nav-link { min-height: 46px; padding: 10px 18px; font-size: 1rem; gap: 9px; }
.nav-link svg { width: 20px; height: 20px; }
.user-avatar { width: 38px; height: 38px; }
.user-name { font-size: 0.9375rem; }
.user-plan { font-size: 0.8125rem; }
.account-chip .btn-sm { min-height: 42px; font-size: 0.9375rem; }
@media (max-width: 1040px) {
    .app-header-inner { gap: 12px; }
    .nav-link { padding: 10px 14px; }
}
@media (max-width: 760px) {
    :root { --header-h: 64px; }
    .brand { font-size: 1.1875rem; gap: 10px; }
    .brand img { width: 36px; height: 36px; border-radius: 10px; }
    .user-avatar { width: 34px; height: 34px; }
    .section-nav { padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
    .nav-link { min-height: 60px; padding: 6px 4px; font-size: 0.8125rem; font-weight: 650; gap: 3px; }
    .nav-link svg { width: 24px; height: 24px; }
    body.has-tabbar { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
    .brand span { display: inline; font-size: 1.0625rem; }
    .brand img { width: 32px; height: 32px; }
    .app-header-inner { gap: 6px; }
    .account-chip { gap: 6px; }
    .account-chip .btn-sm { padding: 8px 8px; }
}
@media (min-width: 761px) and (max-width: 900px) {
    .brand { font-size: 1.1875rem; }
    .brand img { width: 40px; height: 40px; }
    .nav-link { padding: 10px 12px; }
    .nav-link svg { display: none; }
}

/* ------------------------------------------------------------------ phone first pass (owner, 2026-11-21): 44 px targets, 16 px inputs,
   no text under 13 px, stacked tables, dialogs with sticky actions, nothing under the tab bar */
.btn-sm { min-height: 44px; }
.notification-close { width: 44px; height: 44px; }
.password-toggle { width: 44px; height: 44px; right: 2px; }
.toggle-switch input { inset: -8px -6px; width: auto; height: auto; }
.user-plan, .score-label { font-size: 0.8125rem; }
.app-footer a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.plan-hero-links a, .quick-links .link-text { display: inline-flex; align-items: center; min-height: 44px; }
.offer-ack { min-height: 44px; }
.offer-ack input, .checkbox-wrapper input, .ack-row input { width: 22px; height: 22px; }
.checkbox-wrapper { min-height: 44px; align-items: center; }
.form-input, select.form-input, input[type="search"].form-input { font-size: 16px; }

/* dialogs: the body scrolls, the actions stay on screen */
.modal { display: flex; flex-direction: column; max-height: calc(100dvh - 12px); overflow: hidden; }
@media (min-width: 640px) { .modal { max-height: calc(100dvh - 48px); } }
.modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; min-height: 0; }
.modal-header, .modal-footer { flex: none; }
@media (max-width: 639px) {
    .modal-footer { display: grid; grid-template-columns: 1fr 1fr; }
    .modal-footer .btn { width: 100%; min-height: 48px; }
}

/* usage by app: one card per app on phones */
@media (max-width: 560px) {
    .app-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .app-table, .app-table tbody { display: block; }
    .app-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
    .app-table tbody tr:last-child { border-bottom: 0; }
    .app-table td { border: 0; padding: 0; text-align: left !important; display: flex; flex-direction: column; font-size: 1rem; }
    .app-table td:first-child { grid-column: 1 / -1; font-size: 1rem; }
    .app-table td:nth-child(n+2)::before { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }
    .app-table td:nth-child(2)::before { content: "Live min"; }
    .app-table td:nth-child(3)::before { content: "Quick min"; }
    .app-table td:nth-child(4)::before { content: "AI uses"; }
    .app-table td[colspan] { grid-column: 1 / -1; }
    .app-table td[colspan]::before { content: none; }
    .dict-tools .form-input { max-width: none; flex: 1 1 100%; }
    .dict-add-form .btn { width: 100%; min-height: 48px; }
    .dict-sync .btn { flex: 1 1 100%; min-height: 48px; }
    .dict-table td:nth-child(4) .btn { min-height: 44px; }
}

/* export */
.export-box { padding: 4px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.export-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.export-head .btn { flex: none; }
@media (max-width: 560px) { .export-head .btn { width: 100%; min-height: 48px; } }
.export-included-title { font-size: 0.9375rem; margin: 16px 0 8px; }
.export-included { margin: 0 0 12px; padding-left: 1.15rem; display: grid; gap: 4px; font-size: 0.9375rem; }
.export-included li::marker { color: var(--primary); }
.quick-links { align-items: center; }
.brand { min-height: 44px; }
.account-chip .btn-sm { min-height: 44px; }
.avatar-overlay { font-size: 0.8125rem; }
@media (hover: none) { .avatar-overlay { opacity: 1; background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, 0.65) 46%); justify-content: flex-end; padding-bottom: 8px; } .avatar-overlay svg { display: none; } }
