/* Easy AIOU — logged-in student app shell (mobile + desktop)
   Outfit font self-hosted via saas.css @font-face */
@import url("tokens.css");

:root {
    --ea-blue: var(--brand-blue);
    --ea-blue-dark: var(--brand-blue-dark);
    --ea-bg: var(--brand-bg);
    --ea-surface: var(--brand-surface);
    --ea-text: var(--brand-text);
    --ea-muted: var(--brand-muted);
    --ea-border: var(--brand-border);
    --ea-radius: 18px;
    --ea-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body.ea-app {
    margin: 0;
    min-height: 100dvh;
    max-width: 100%;
    overflow-x: hidden;
    font-family: Outfit, Roboto, system-ui, sans-serif;
    color: var(--ea-text);
    background: var(--ea-bg);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(37, 99, 235, 0.12), transparent 55%),
        linear-gradient(180deg, #f8fafc 0%, var(--ea-bg) 40%);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
}

@media (min-width: 769px) {
    body.ea-app { padding-bottom: 24px; }
    body.ea-app.ea-no-nav { padding-bottom: 24px; }
}

/* Top bar */
.ea-top {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ea-border);
}
.ea-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ea-text);
    font-weight: 800;
    font-size: 15px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.ea-brand img, .ea-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}
.ea-mark {
    background: linear-gradient(135deg, var(--ea-blue-dark), var(--ea-blue));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}
.ea-brand-sub { display: none; }
.ea-top-actions { display: flex; align-items: center; gap: 8px; }
.ea-top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--ea-muted);
    -webkit-tap-highlight-color: transparent;
}
.ea-top-link.on, .ea-top-link:hover { color: var(--ea-blue); background: #eff6ff; }
.ea-top-link i { font-size: 18px; }
.ea-top-link span.lbl { display: none; }
@media (min-width: 640px) {
    .ea-top-link span.lbl { display: inline; margin-left: 6px; }
    .ea-brand-sub { display: inline; font-weight: 600; color: var(--ea-muted); font-size: 13px; }
}

/* Page wrap */
.ea-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 14px calc(24px + env(safe-area-inset-bottom));
    overflow-x: hidden;
}
@media (min-width: 769px) {
    .ea-wrap { max-width: 720px; padding-top: 24px; }
}

/* Cards */
.ea-card {
    background: var(--ea-surface);
    border: 1px solid var(--ea-border);
    border-radius: var(--ea-radius);
    padding: 18px 16px;
    margin-bottom: 14px;
    box-shadow: var(--ea-shadow);
}
.ea-card h2, .ea-card h3 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}
.ea-card p { font-size: 14px; color: var(--ea-muted); line-height: 1.55; }

.ea-hero-mini {
    padding: 20px 18px;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--ea-blue-dark) 0%, var(--ea-blue) 55%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.28);
    margin-bottom: 16px;
}
.ea-hero-mini h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.03em; }
.ea-hero-mini p { margin: 0; font-size: 13px; opacity: 0.9; }

/* Buttons */
.ea-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s, box-shadow 0.12s;
}
.ea-btn:active { transform: scale(0.98); }
.ea-btn-primary {
    background: linear-gradient(135deg, var(--ea-blue), #3b82f6);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.ea-btn-ghost {
    background: #fff;
    color: var(--ea-blue);
    border: 1.5px solid var(--ea-border);
}
.ea-btn-block { width: 100%; }

/* Bottom nav */
.ea-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--ea-border);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
    padding-bottom: env(safe-area-inset-bottom);
}
.ea-bottom a, .ea-bottom button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 6px 4px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: #7c8493;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.ea-bottom a i, .ea-bottom button i { font-size: 22px; }
.ea-bottom a.on, .ea-bottom button.on {
    color: var(--ea-blue);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.1), transparent);
}
@media (min-width: 769px) {
    .ea-bottom { display: none !important; }
    body.ea-app { padding-bottom: 24px; }
}
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    /* block for sections — NOT flex nav (display:block kills flex row) */
    .mobile-only:not(.ea-bottom) { display: block !important; }
    nav.ea-bottom.mobile-only,
    .ea-bottom.mobile-only {
        display: flex !important;
        flex-direction: row !important;
    }
}
@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}

/* Sub-page content (profile, plan, pay) */
.ea-subhead {
    font-size: 13px;
    color: var(--ea-muted);
    margin: -8px 0 16px;
    line-height: 1.5;
}
.ea-list-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--ea-surface);
    border: 1px solid var(--ea-border);
    text-decoration: none;
    color: var(--ea-text);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    transition: transform 0.12s, box-shadow 0.12s;
}
.ea-list-link:active { transform: scale(0.99); }
.ea-list-link i { color: var(--ea-blue); width: 22px; text-align: center; font-size: 18px; }
.ea-list-link span { flex: 1; }
.ea-list-link small { color: var(--ea-muted); font-weight: 600; font-size: 12px; }

/* ═══ Settings hub (/profile) ═══ */
.ea-settings {
    padding-top: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.set-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--ea-blue-dark) 0%, var(--ea-blue) 60%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.28);
    margin-bottom: 16px;
    max-width: 100%;
    overflow: hidden;
}
.set-hero > div:last-child {
    flex: 1;
    min-width: 0;
}
.set-avatar {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    display: grid;
    place-items: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}
.set-avatar img { width: 100%; height: 100%; object-fit: cover; }
.set-hero h1 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 2px;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.set-hero p {
    margin: 0;
    font-size: 12px;
    opacity: 0.88;
    font-family: ui-monospace, monospace;
}
.set-chip {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 11px;
    font-weight: 700;
}

.set-bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
    width: 100%;
    max-width: 100%;
}
.set-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-height: 96px;
    min-width: 0;
    max-width: 100%;
    padding: 14px 14px 12px;
    border-radius: 18px;
    border: 1px solid var(--ea-border);
    background: var(--ea-surface);
    box-shadow: var(--ea-shadow);
    text-decoration: none;
    color: var(--ea-text);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s, box-shadow 0.12s;
}
.set-tile:active { transform: scale(0.98); }
.set-tile i {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
    background: #eff6ff;
    color: var(--ea-blue);
}
.set-tile b { font-size: 15px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.set-tile span { font-size: 11px; color: var(--ea-muted); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.set-tile-plan {
    grid-column: 1 / -1;
    min-height: 88px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    border: none;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 45%, #fbbf24 100%);
    color: #78350f;
    box-shadow: 0 12px 32px rgba(251, 191, 36, 0.35);
}
.set-tile-plan i {
    background: rgba(255, 255, 255, 0.55);
    color: #b45309;
    width: 48px;
    height: 48px;
    font-size: 22px;
    flex-shrink: 0;
}
.set-tile-plan .set-plan-body { flex: 1; min-width: 0; overflow: hidden; }
.set-tile-plan b { font-size: 17px; color: #78350f; display: block; overflow-wrap: anywhere; }
.set-tile-plan span { color: #92400e; display: block; overflow-wrap: anywhere; font-size: 10px; line-height: 1.35; }
.set-tile-plan .set-plan-arrow {
    color: #b45309;
    font-size: 18px;
    opacity: 0.85;
    flex-shrink: 0;
}

.set-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
}
.set-pills::-webkit-scrollbar { display: none; }
.set-pill {
    flex-shrink: 0;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--ea-border);
    background: var(--ea-surface);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--ea-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.set-pill.on {
    background: var(--ea-blue);
    border-color: var(--ea-blue);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.set-panel { display: none; animation: setIn 0.22s ease; }
.set-panel.on { display: block; }
@keyframes setIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.set-group {
    background: var(--ea-surface);
    border: 1px solid var(--ea-border);
    border-radius: var(--ea-radius);
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.set-group-head {
    padding: 14px 16px 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ea-muted);
}
.set-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--ea-border);
    max-width: 100%;
}
.set-row-action .set-btn {
    margin-left: auto;
    flex-shrink: 0;
}
.set-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--ea-blue);
    display: grid;
    place-items: center;
    font-size: 15px;
    flex-shrink: 0;
}
.set-row-body { flex: 1; min-width: 0; }
.set-row-body label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ea-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.set-row-body .val {
    font-size: 15px;
    font-weight: 700;
    color: var(--ea-text);
    word-break: break-word;
}
.set-row-body .hint {
    font-size: 12px;
    color: var(--ea-muted);
    margin-top: 4px;
    line-height: 1.45;
}

.set-field {
    padding: 0 16px 14px;
    border-top: 1px solid var(--ea-border);
    max-width: 100%;
}
.set-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ea-muted);
    margin: 12px 0 6px;
}
.set-field input {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--ea-border);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    background: #f8fafc;
}
.set-field input:focus {
    outline: none;
    border-color: var(--ea-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.set-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--ea-border);
    max-width: 100%;
}
.set-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    max-width: 100%;
}
.set-btn-primary {
    background: linear-gradient(135deg, var(--ea-blue), #3b82f6);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}
.set-btn-ghost {
    background: #f1f5f9;
    color: var(--ea-text);
}
.set-btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.set-btn-block { width: 100%; }

.set-group.danger {
    border-color: #fecaca;
    background: #fffbfb;
}
.set-group.danger .set-group-head { color: #dc2626; }
.set-msg {
    display: none;
    margin: 12px 16px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}
.set-msg.ok { display: block; background: #dcfce7; color: #166534; }
.set-msg.err { display: block; background: #fee2e2; color: #991b1b; }

@media (max-width: 400px) {
    .set-row { flex-wrap: wrap; }
    .set-row-action .set-btn { width: 100%; margin-left: 0; margin-top: 4px; }
    .ea-wrap { padding-left: 12px; padding-right: 12px; }
    .set-bento { grid-template-columns: 1fr; }
    .set-tile-plan { grid-column: 1; }
}

/* Scrape overlay: hide chrome */
body.scrape-hold .ea-bottom,
body.scrape-hold .bottom-nav { display: none !important; }

/* PWA + screenshot protect (profile loads without style.css) */
body.ss-protect-open { overflow: hidden; }
#ss-protect-modal {
    display: none; position: fixed; inset: 0; z-index: 99999;
    background: rgba(15, 23, 42, 0.72); align-items: center; justify-content: center; padding: 24px;
}
#ss-protect-modal.show { display: flex; }
.ss-protect-card {
    width: min(420px, 100%); background: #fff; border-radius: 16px;
    padding: 28px 24px 22px; text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); border-top: 5px solid #dc2626;
}
.ss-protect-icon {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
    background: #fef2f2; color: #dc2626; display: flex; align-items: center; justify-content: center;
}
.ss-protect-card h2 { font-size: 20px; font-weight: 800; color: #0f172a; margin: 0 0 10px; }
.ss-protect-card p { font-size: 14px; line-height: 1.5; color: #475569; margin: 0 0 20px; }
.ss-protect-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 100%;
    border: 0; border-radius: 10px; padding: 12px 16px; font-size: 15px; font-weight: 700;
    color: #fff; background: #dc2626; cursor: pointer; min-height: 44px;
}

#pwa-install {
    display: none; position: fixed; left: 12px; right: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 9998;
}
#pwa-install.show { display: block; }
.pwa-install-card {
    background: #10245c; color: #fff; border-radius: 16px; padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}
.pwa-install-copy { flex: 1; min-width: 0; }
.pwa-install-copy strong { display: block; font-size: 14px; }
.pwa-install-copy span { display: block; font-size: 12px; color: #bfdbfe; line-height: 1.35; }
.pwa-install-btn {
    border: 0; background: #fff; color: #1e3a8a; font-weight: 800;
    border-radius: 10px; padding: 10px 14px; cursor: pointer; flex-shrink: 0; min-height: 44px;
}
.pwa-install-x {
    border: 0; background: transparent; color: #93c5fd; font-size: 22px;
    cursor: pointer; line-height: 1; min-width: 44px; min-height: 44px;
}
#pwa-ios {
    display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
    z-index: 99991; align-items: center; justify-content: center; padding: 20px;
}
#pwa-ios.show { display: flex; }
.pwa-ios-card {
    background: #fff; border-radius: 16px; padding: 22px; max-width: 360px; width: 100%;
}
.pwa-ios-card h3 { margin: 0 0 10px; font-size: 18px; }
.pwa-ios-card p { margin: 0 0 16px; font-size: 14px; color: #475569; line-height: 1.5; }
.pwa-ios-close {
    width: 100%; min-height: 44px; border: 0; border-radius: 10px;
    background: #2563eb; color: #fff; font-weight: 700; cursor: pointer;
}
@media (min-width: 769px) {
    #pwa-install { bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* ═══ Auth flow (/login) — landing-aligned layout ═══ */
html:has(body.ea-auth-fit),
html:has(body.auth-page) {
    height: auto;
    overflow: auto;
}

body.ea-app.ea-auth-fit,
body.ea-app.auth-page {
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

body.auth-page .auth-top,
body.ea-auth-fit .auth-top {
    flex-shrink: 0;
}

body.auth-page .auth-viewport,
body.ea-auth-fit .auth-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 14px 0;
    overflow: visible;
    position: relative;
}

.auth-wrap {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 0 36px;
}

.auth-progress-rail {
    flex-shrink: 0;
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
    text-align: center;
}

.auth-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}

.auth-dot {
    width: 28px;
    height: 4px;
    border-radius: 99px;
    background: #e2e8f0;
    transition: background 0.35s, width 0.35s, box-shadow 0.35s;
}
.auth-dot.on {
    background: rgba(37, 99, 235, 0.35);
}
.auth-dot.cur {
    width: 40px;
    background: var(--ea-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.auth-progress-label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ea-muted);
}

.auth-flow-card {
    flex: 0 1 auto;
    max-height: 100%;
    padding: 18px 16px 16px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 0 0 1px rgba(37, 99, 235, 0.04),
        0 20px 50px rgba(15, 23, 42, 0.1);
}

.auth-flow-card .step {
    display: none;
    flex-direction: column;
    min-height: 0;
}
.auth-flow-card .step.active {
    display: flex;
    flex: 1;
    animation: authStepIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes authStepIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-flow-card .login-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.auth-flow-card .auth-cta {
    margin-top: auto;
    padding-top: 10px;
    flex-shrink: 0;
}

.auth-panel-head {
    padding: 0 0 12px;
    flex-shrink: 0;
}
.auth-panel-head--tight {
    padding-bottom: 10px;
}
.auth-panel-head h1,
.auth-panel-head h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 3px;
    color: var(--ea-text);
    line-height: 1.15;
}
.auth-panel-head p {
    margin: 0;
    font-size: 13px;
    color: var(--ea-muted);
    line-height: 1.4;
}

.auth-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
    font-size: 10px;
    color: var(--ea-muted);
    text-align: center;
    line-height: 1.35;
    pointer-events: none;
    opacity: 0.85;
}

.auth-footnote {
    margin: 8px 0 0;
    font-size: 12px;
    text-align: center;
    color: var(--ea-muted);
    flex-shrink: 0;
}
.auth-footnote a {
    color: var(--ea-blue);
    font-weight: 700;
    text-decoration: none;
}

.wa-compact {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 0;
}
.wa-roll-hint {
    margin: 0;
    font-size: 12px;
    color: var(--ea-muted);
    text-align: center;
}

/* Compact controls inside viewport-fit card */
body.ea-auth-fit .auth-flow-card .form-group,
body.auth-page .auth-flow-card .form-group {
    margin-bottom: 10px;
}
body.ea-auth-fit .auth-flow-card .field-label,
body.auth-page .auth-flow-card .field-label {
    margin-bottom: 5px;
    font-size: 12px;
}
body.ea-auth-fit .input-wrapper input,
body.auth-page .input-wrapper input {
    height: 48px;
    font-size: 16px;
    border-radius: 12px;
}
body.ea-auth-fit .login-btn,
body.auth-page .login-btn {
    min-height: 48px;
    font-size: 15px;
    padding: 12px 16px;
}
body.ea-auth-fit .pin-row,
body.auth-page .pin-row {
    margin: 4px 0 10px;
    gap: 8px;
}
body.ea-auth-fit .pin-row input,
body.auth-page .pin-row input {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 12px;
}
body.ea-auth-fit .otp-row input,
body.auth-page .otp-row input {
    height: 48px;
    font-size: 18px;
}
body.ea-auth-fit .auth-gate-hero,
body.auth-page .auth-gate-hero {
    padding: 14px 16px;
    margin-bottom: 10px;
}
body.ea-auth-fit .auth-gate-hero h1,
body.auth-page .auth-gate-hero h1 {
    font-size: 18px;
    margin-bottom: 2px;
}
body.ea-auth-fit .auth-gate-hero p,
body.auth-page .auth-gate-hero p {
    font-size: 12px;
}
body.ea-auth-fit .auth-mode-btn,
body.auth-page .auth-mode-btn {
    min-height: 58px;
    padding: 12px 14px;
    border-radius: 14px;
}
body.ea-auth-fit .auth-mode-icon,
body.auth-page .auth-mode-icon {
    width: 40px;
    height: 40px;
    font-size: 17px;
}
body.ea-auth-fit .auth-mode-text strong,
body.auth-page .auth-mode-text strong {
    font-size: 15px;
}
body.ea-auth-fit .auth-mode-text small,
body.auth-page .auth-mode-text small {
    font-size: 11px;
}
body.ea-auth-fit .auth-gate-dock,
body.auth-page .auth-gate-dock {
    gap: 8px;
}
body.ea-auth-fit .auth-link-row,
body.auth-page .auth-link-row {
    margin-top: 6px;
}
body.ea-auth-fit .auth-text-link,
body.auth-page .auth-text-link {
    font-size: 13px;
    padding: 4px 8px;
}
body.ea-auth-fit .error-message,
body.auth-page .error-message {
    margin-bottom: 10px;
    padding: 10px 12px;
    font-size: 12px;
    flex-shrink: 0;
}

body.ea-app .login-btn {
    border-radius: 14px;
    font-family: inherit;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}
body.ea-app .login-btn:not(.wa) {
    background: linear-gradient(135deg, var(--ea-blue), #3b82f6);
}
body.ea-app .login-btn.wa {
    background: linear-gradient(135deg, #0f7a6e, #128c7e);
    box-shadow: 0 8px 20px rgba(18, 140, 126, 0.28);
}

/* Short phones — extra squeeze */
@media (max-height: 700px) {
    body.ea-auth-fit .auth-wrap {
        padding-bottom: 28px;
    }
    body.ea-auth-fit .auth-panel-head h1,
    body.ea-auth-fit .auth-panel-head h2 {
        font-size: 18px;
    }
    body.ea-auth-fit .auth-panel-head p {
        font-size: 12px;
    }
    body.ea-auth-fit .auth-gate-hero {
        padding: 10px 14px;
        margin-bottom: 8px;
    }
    body.ea-auth-fit .auth-mode-btn {
        min-height: 52px;
    }
    body.ea-auth-fit .input-wrapper input,
    body.ea-auth-fit .login-btn {
        min-height: 44px;
        height: 44px;
    }
    body.ea-auth-fit .pin-row input {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* Desktop — centered glass card, still no page scroll */
@media (min-width: 769px) {
    body.ea-auth-fit .auth-wrap {
        max-width: 420px;
        padding-bottom: 40px;
    }
    body.ea-auth-fit .auth-flow-card {
        padding: 22px 20px 18px;
    }
}

/* Portal dashboard — plan badge + user meta in unified top bar */
.ea-top-portal .ea-portal-meta {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}
.ea-portal-user { text-align: center; min-width: 0; }
.ea-portal-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ea-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ea-portal-id {
    font-size: 11px;
    font-weight: 600;
    color: var(--ea-muted);
    font-family: ui-monospace, Consolas, monospace;
}
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    text-decoration: none;
    white-space: nowrap;
}
.plan-badge.paid { background: #ecfdf5; color: #047857; border: 1px solid #86efac; }
.plan-badge.trial { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.plan-badge.pending { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.plan-badge.expired { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.plan-badge.free { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.ea-top-settings { min-width: 44px; min-height: 44px; justify-content: center; }
@media (max-width: 768px) {
    .ea-top-portal .plan-badge { display: none; }
}

/* Toast — profile, subscribe, plan */
.ea-toast-wrap {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(92vw, 360px);
    pointer-events: none;
}
.ea-toast {
    padding: 12px 16px;
    border-radius: 12px;
    background: #059669;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    animation: eaToastIn 0.22s ease;
}
.ea-toast.err { background: #dc2626; }
@keyframes eaToastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.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;
}

