/* ============================================================
   custom.css
   Global custom styling that is NOT a framework override:
   design tokens (light/dark), base elements, and the e-Vibe
   Bento Grid design-system classes (page header/section, stat
   tiles, surface cards, account/identity shell, phone input,
   wasm boot splash, wallet-card preview, helpers).
   Framework restyling lives in mudblazor-overrides.css /
   bootstrap-overrides.css. Tokens are defined here — reference
   var(--token) everywhere, literals live only in :root below.
   Canonical spec: /09-Design-System.md
   ============================================================ */

:root {
    /* surfaces */
    --bg: #131314;
    --surface: #1E1F22;
    --surface-2: #28292C;
    --surface-3: #303134;
    --surface-translucent: rgba(30, 31, 34, .72); /* floating app bar */
    /* text */
    --text-primary: #E3E3E3;
    --text-secondary: #9AA0A6;
    --text-disabled: #5F6368;
    --on-accent: #FFFFFF;          /* text/icons over the gradient */
    --on-accent-dim: rgba(255, 255, 255, .74);   /* secondary text over the gradient */
    --on-accent-soft: rgba(255, 255, 255, .16);  /* chips/fills over the gradient */
    --nav-active-text: #EAF1FF;
    /* lines */
    --outline: rgba(255, 255, 255, .10);
    --outline-strong: rgba(255, 255, 255, .16);
    /* accent */
    --accent: #A8C7FA;
    --accent-soft: rgba(168, 199, 250, .14);
    --accent-line: rgba(168, 199, 250, .42);
    --grad-from: #4285F4;
    --grad-mid: #9B72CB;
    --grad-to: #D96570;
    --ai-gradient: linear-gradient(90deg, var(--grad-from), var(--grad-mid), var(--grad-to));
    /* ambient canvas glows (iridescent) */
    --glow-violet: rgba(155, 114, 203, .12);
    --glow-blue: rgba(66, 133, 244, .10);
    --glow-rose: rgba(217, 101, 112, .06);
    /* status */
    --success: #6DD58C;
    --warning: #F5C26B;
    --error: #F2B8B5;
    --error-soft: rgba(242, 184, 181, .12);
    --success-soft: rgba(109, 213, 140, .12);
    --warning-soft: rgba(245, 194, 107, .12);
    /* scrollbar */
    --scrollbar: #3A3B3E;
    --scrollbar-hover: #4A4B4F;
    /* scrim over a photographic hero (Join enrollment banner) — theme-agnostic, like --ai-gradient */
    --hero-scrim: linear-gradient(180deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, .5));
    /* shape */
    --radius: 24px;
    --radius-sm: 16px;
    --radius-pill: 999px;
    --radius-input: 10px; /* rounded TOP corners of a filled form input (MudBlazor "Filled" look; flat underlined bottom) */
    /* filled form-input fill (the subtle shaded area, theme-agnostic refs to surface tokens) */
    --field-fill: var(--surface-2);
    --field-fill-hover: var(--surface-3);
    /* shared horizontal inset for data-grid internals (toolbar, edge cells, pager) */
    --grid-inset: 1.25rem;
    /* floating-chrome spacing (responsive — overridden on small screens) */
    --chrome-gap: 16px;
    /* WebAssembly boot splash — wasm-boot.js updates the two --blazor-load-* vars live */
    --blazor-load-percentage: 0%;
    --blazor-load-percentage-text: "";
    --boot-bar-width: min(420px, 76vw);
    --boot-bar-height: 8px;
    --boot-gap: 1.5rem;

    /* Wallet card preview (Add-card form) — faithful Apple Wallet store card + Google Wallet
       loyalty card mocks. Theme-agnostic like --ai-gradient / --on-accent: a phone mock and the
       native wallet chrome look the same whatever the app theme, so these live in :root only.
       --pass-ink / --pass-ink-dim are set per-card inline (computed from the chosen background's
       luminance) and reference the *-light / *-dark tokens below. */
    --wallet-ink-light: #FFFFFF;
    --wallet-ink-light-dim: rgba(255, 255, 255, .72);
    --wallet-ink-dark: #1A1A1A;
    --wallet-ink-dark-dim: rgba(26, 26, 26, .56);
    --wallet-fallback-fill: rgba(127, 127, 127, .26); /* logo / banner placeholder */
    --device-bezel-edge: rgba(127, 127, 127, .30);
    --ios-screen: #000000;          /* Apple Wallet pass sits on a black sheet */
    --pass-scrim: linear-gradient(180deg, rgba(0, 0, 0, .02) 34%, rgba(0, 0, 0, .56));
    --pass-qr-bg: #FFFFFF;
    --pass-qr-ink: #0B0B0C;
    --pass-back-scrim: rgba(0, 0, 0, .08); /* darkening overlay on the Apple back-of-card */
    --device-w: 246px;
    --device-w-compact: 196px;
    --device-radius: 30px;
    --pass-radius: 14px;
    /* Card-builder WYSIWYG editing affordances + edit popovers (theme-agnostic, like the mock above). */
    --overlay-edit-outline: rgba(255, 255, 255, .5); /* hover outline fallback when --pass-ink is unset */
    --overlay-edit-tint: rgba(127, 127, 127, .12);   /* hover tint over an editable region */
    --shadow-popover: 0px 4px 20px rgba(0, 0, 0, .2);
    --shadow-popover-lg: 0 6px 24px rgba(0, 0, 0, .25);
    /* Native wallet / phone-mock OS chrome — fixed platform colours, theme-agnostic like the mock
       tokens above (a device mock looks the same whatever the app theme), so :root only. */
    --ios-status-ink: #FFFFFF;        /* iOS status-bar text + signal/wifi/battery glyphs */
    --pass-link: #0A84FF;             /* iOS system blue — back-of-pass links */
    --pass-danger: #FF3B30;           /* iOS system red — Remove Pass */
    --pass-danger-tint: rgba(255, 59, 48, .15); /* red hover wash on Remove Pass */
    --pass-back-island: rgba(255, 255, 255, .08); /* Remove-Pass pill fill on the dark Apple back */
    --radius-ios-island: 10px;        /* dynamic island pill */
    --radius-ios-island-compact: 8px;
    --radius-pass-pill: 12px;         /* Apple Remove-Pass pill */

    /* legacy aliases (back-compat for any lingering refs) */
    --muted: var(--text-secondary);
    --ink: var(--text-primary);
    --hairline: var(--outline);
}

/* ---------- Light theme: token overrides only ----------
   :root above is the dark default. The early script in App.razor adds .theme-light /
   .theme-dark to <html> from the saved preference (resolving "system" via matchMedia)
   before first paint — so the canvas flips with no flash on every render mode. The MudBlazor
   palette flips in lock-step via the layout's IsDarkMode binding (ThemeService). The gradient,
   radii, --on-accent* (text over the gradient) and shape tokens are theme-agnostic. */
html.theme-light {
    /* surfaces */
    --bg: #F8F9FA;
    --surface: #FFFFFF;
    --surface-2: #F1F3F4;
    --surface-3: #E8EAED;
    --surface-translucent: rgba(255, 255, 255, .72);
    /* text */
    --text-primary: #1F1F20;
    --text-secondary: #5F6368;
    --text-disabled: #9AA0A6;
    --nav-active-text: #0B57D0;
    /* lines */
    --outline: rgba(0, 0, 0, .10);
    --outline-strong: rgba(0, 0, 0, .16);
    /* accent */
    --accent: #1A73E8;
    --accent-soft: rgba(26, 115, 232, .10);
    --accent-line: rgba(26, 115, 232, .40);
    /* ambient canvas glows (softer on light) */
    --glow-violet: rgba(155, 114, 203, .10);
    --glow-blue: rgba(66, 133, 244, .08);
    --glow-rose: rgba(217, 101, 112, .05);
    /* status */
    --success: #1E8E3E;
    --warning: #F29900;
    --error: #D93025;
    --error-soft: rgba(217, 48, 37, .10);
    --success-soft: rgba(30, 142, 62, .10);
    --warning-soft: rgba(242, 153, 0, .12);
    /* scrollbar */
    --scrollbar: #C7C7C7;
    --scrollbar-hover: #B0B0B0;
}

html, body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: "Google Sans Text", "Inter", system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
}

/* ---------- Static-page theme toggle (MainLayout, no Blazor JS) ----------
   A floating pill that calls js/theme.js cycle(); flips the canvas live via the <html> class. */
.theme-fab {
    position: fixed;
    right: var(--chrome-gap);
    bottom: var(--chrome-gap);
    z-index: 1300;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--surface-translucent);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    backdrop-filter: saturate(150%) blur(14px);
    border: 1px solid var(--outline);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.theme-fab:hover {
    color: var(--text-primary);
    border-color: var(--outline-strong);
}
.theme-fab svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* ---------- Static-page language switcher (MainLayout, no Blazor JS) ----------
   A floating pill matching .theme-fab, built from a native <details> disclosure so it needs no JS/circuit.
   Each option is a full-load link to /api/lang/{code}. Sits just above the theme FAB. */
.lang-fab {
    position: fixed;
    right: var(--chrome-gap);
    bottom: calc(var(--chrome-gap) + 44px + 10px);
    z-index: 1300;
}
.lang-fab > summary {
    list-style: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--surface-translucent);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    backdrop-filter: saturate(150%) blur(14px);
    border: 1px solid var(--outline);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.lang-fab > summary::-webkit-details-marker {
    display: none;
}
.lang-fab > summary:hover {
    color: var(--text-primary);
    border-color: var(--outline-strong);
}
.lang-fab > summary svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.lang-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    margin: 0;
    padding: 6px;
    list-style: none;
    min-width: 12rem;
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lang-menu a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s ease, color .15s ease;
}
.lang-menu a:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}
.lang-menu a.active {
    background: var(--accent-soft);
    color: var(--text-primary);
}
.lang-menu .lang-code {
    min-width: 1.6rem;
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.lang-menu a.active .lang-code {
    color: var(--accent);
}

/* ---------- Brand mark (drawer / shells) ---------- */
.drawer-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.4rem 1.4rem 1.1rem;
}
.drawer-brand .mark {
    width: 36px; height: 36px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--ai-gradient);
    color: var(--on-accent); font-weight: 700; font-size: 1.15rem;
}
.drawer-brand .name {
    font-family: "Outfit", sans-serif; font-weight: 600; font-size: 1.18rem;
    color: var(--text-primary); letter-spacing: -.01em; line-height: 1;
}
.drawer-brand .name b {
    font-weight: 700;
    background: var(--ai-gradient); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.drawer-brand .tag {
    display: block; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase;
    color: var(--text-disabled); margin-top: .3rem;
}

/* section labels inside the drawer */
.nav-section {
    font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
    color: var(--text-disabled); padding: 1.1rem 1.5rem .35rem;
}

/* "Soon" pill on unbuilt links */
.soon {
    margin-left: auto; font-size: .56rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--text-secondary);
    border: 1px solid var(--outline); border-radius: var(--radius-pill); padding: .1rem .42rem;
}

/* ---------- Surface card hover (interactive variant; base lives in mudblazor-overrides) ---------- */
.surface-card.interactive:hover {
    transform: translateY(-2px);
    background: var(--surface-2);
    border-color: var(--outline-strong);
    box-shadow: var(--shadow-bento-hover);
}

/* shared grid toolbar: search grows, filter fixed width, primary action trailing —
   one flat flex row so the first field lines up with the first column (no nested
   MudGrid gutter). Wraps cleanly on small screens. */
.grid-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; width: 100%; }
.grid-toolbar__search { flex: 1 1 16rem; }
.grid-toolbar__filter { flex: 0 1 12rem; }

/* ---------- Inline text utilities ----------
   The recurring two-line data-grid cell (bold primary + muted caption) and small
   meta text. Keeps the literals in the stylesheet — markup stays token-clean. */
.cell-title { font-weight: 600; color: var(--text-primary); }
.cell-sub { font-size: .82rem; color: var(--text-secondary); line-height: 1.4; }
.cell-strong { font-weight: 700; }
.cell-end { text-align: right; }
/* small muted meta; resets the gradient text-fill so it stays visible inside .gradient-text */
.meta-xs { font-size: .7rem; color: var(--text-secondary); -webkit-text-fill-color: var(--text-secondary); }
/* logo image inside a small grid-cell avatar (cards list) */
.cell-logo { max-width: 1.75rem; max-height: 1.75rem; }
/* compact toolbar filter that still collapses on phones */
.field-w-sm { max-width: 16rem; width: 100%; }
/* read-only link / mid-width field that still collapses on phones */
.field-w-md { max-width: 26rem; width: 100%; }
/* selectable option card (plan picker) — tap target with calm padding */
.pick-card { cursor: pointer; padding: 1.1rem; }
/* "add another" placeholder tile (card-builder tiers) */
.tile-add { min-height: 12.5rem; cursor: pointer; }
/* brand-gradient avatar (user chip, menus) */
.avatar-brand { background: var(--ai-gradient); color: var(--on-accent); font-weight: 700; }
/* camera viewport (scan) — never overflow its column on small screens */
.scan-cam video { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ---------- Full-bleed shell (BlankLayout: Launch, onboarding) ---------- */
.blank-shell { min-height: 100vh; display: flex; flex-direction: column; }
.blank-brand { padding: 1.5rem 2rem; }
.blank-body { flex: 1; display: grid; place-items: center; padding: 1rem 1rem 4rem; }
@media (max-width: 600px) {
    .blank-brand { padding: 1.1rem 1.25rem; }
}
/* hairline divider between stacked rows (e.g. dashboard "get started" steps) */
.row-divider { border-top: 1px solid var(--outline); }
/* image-upload preview (ImageUpload.razor) — caps the preview height, optional banner ratio */
.upload-preview { max-height: 7.5rem; max-width: 100%; }
.upload-preview--banner { aspect-ratio: 3 / 1; }
/* image-upload drop zone (ImageUpload.razor) — Bento drag-and-drop area. The MudFileUpload <input>
   (InputClass="upload-zone-input") is laid transparently over this zone to catch the drop + click,
   so the field root is positioned. */
.upload-field { position: relative; display: block; width: 100%; }
.upload-zone-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .45rem; text-align: center; min-height: 8rem; padding: 1.25rem 1rem;
    border: 2px dashed var(--outline-strong); border-radius: var(--radius-sm);
    background: var(--field-fill); color: var(--text-secondary);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.upload-field:hover .upload-zone { background: var(--field-fill-hover); border-color: var(--accent-line); }
.upload-zone--active { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.upload-zone__icon { color: var(--accent); }
.upload-zone__title { font-weight: 600; color: var(--text-primary); }
.upload-zone--active .upload-zone__title { color: var(--accent); }
.upload-zone__hint { color: var(--text-secondary); }
/* numbered step badge (merchant dashboard onboarding checklist) */
.step-no {
    width: 32px; height: 32px; flex: none; border-radius: var(--radius-pill); display: grid; place-items: center;
    font-family: "Outfit", sans-serif; font-weight: 600; font-size: .95rem;
    background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}

/* stat tiles */
.stat .label {
    font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary);
}
.stat .value {
    font-family: "Outfit", sans-serif; font-weight: 600; font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.1rem); line-height: 1; color: var(--text-primary);
    margin-top: .55rem; letter-spacing: -.02em;
}
.stat .delta { font-size: .78rem; font-weight: 600; margin-top: .5rem; color: var(--text-secondary); }
.stat .delta.up { color: var(--success); }
.stat .icon-chip {
    width: 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
}

/* eyebrow / overline accent */
.eyebrow {
    font-size: .68rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
    color: var(--accent);
}
/* display face (headings) */
.display { font-family: "Outfit", "Google Sans", sans-serif; }
/* text painted with the signature gradient */
.gradient-text {
    background: var(--ai-gradient); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* user menu activator */
.user-chip {
    display: flex; align-items: center; gap: .6rem; cursor: pointer;
    padding: .3rem .55rem .3rem .35rem; border-radius: var(--radius-pill);
    border: 1px solid var(--outline); background: var(--surface);
    transition: border-color .2s ease, background .2s ease;
}
.user-chip:hover { border-color: var(--outline-strong); background: var(--surface-2); }
.user-chip .who { line-height: 1.05; text-align: left; }
.user-chip .who .n { font-weight: 600; font-size: .82rem; color: var(--text-primary); }
.user-chip .who .r { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }

.logout-form { width: 100%; }
.logout-btn {
    all: unset; cursor: pointer; display: flex; align-items: center; gap: .6rem;
    width: 100%; box-sizing: border-box; padding: .55rem 1rem; font-size: .85rem; color: var(--text-primary);
}
.logout-btn:hover { background: var(--error-soft); color: var(--error); }

/* ---------- Page header: accent eyebrow + display title + subtitle ---------- */
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1.75rem;
}
.page-header__eyebrow { margin-bottom: .4rem; }
.page-header__title {
    margin: 0; font-weight: 600; font-size: clamp(1.5rem, 1.15rem + 1.7vw, 1.95rem); line-height: 1.08;
    letter-spacing: -.02em; color: var(--text-primary);
}
.page-header__subtitle {
    margin: .55rem 0 0; max-width: 58ch; color: var(--text-secondary);
    font-size: .95rem; line-height: 1.6;
}
.page-header__actions { display: flex; align-items: center; gap: .6rem; padding-bottom: .15rem; }

/* ---------- Page section: titled surface-card ---------- */
.page-section { padding: 1.5rem 1.6rem; }
.page-section + .page-section { margin-top: 1.25rem; }
.page-section__head {
    display: flex; align-items: flex-start; gap: .85rem;
    padding-bottom: 1.05rem; margin-bottom: 1.15rem;
    border-bottom: 1px solid var(--outline);
}
.page-section__icon {
    flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
}
.page-section__heading { min-width: 0; }
.page-section__title {
    margin: 0; font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; color: var(--text-primary);
}
.page-section__subtitle { margin: .25rem 0 0; font-size: .85rem; color: var(--text-secondary); line-height: 1.5; }
.page-section__actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* ---------- Form group: an accent-eyebrow-labelled cluster of fields in a form/dialog ----------
   Consistent vertical rhythm between groups lives here, so a form never hand-manages top margins
   (the FormGroup component just wraps fields under a .eyebrow label). */
.form-group + .form-group { margin-top: 1.5rem; }
.form-group__label { margin-bottom: .65rem; }
.form-group__hint { margin-top: .4rem; }

/* refined scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: var(--radius-pill); border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); background-clip: content-box; }

/* ============================================================
   Responsive — mobile, tablet, laptop. Fluid type via clamp()
   above; these tighten the floating chrome + spacing on small
   screens. Grids use MudBlazor xs/sm/md/lg breakpoints in markup.
   ============================================================ */

/* tablet & down: smaller floating-chrome gap */
@media (max-width: 960px) {
    :root { --chrome-gap: 12px; }
}

/* phones: drawer/app bar hug the edges a little tighter, calmer padding */
@media (max-width: 600px) {
    :root { --chrome-gap: 8px; }
    .page-section { padding: 1.15rem 1.15rem; }
    .page-header { margin-bottom: 1.25rem; }
    .page-header__actions { width: 100%; }
    .stat .icon-chip { width: 40px; height: 40px; }
    .drawer-brand { padding: 1.1rem 1.1rem .9rem; }
}

/* ============================================================
   Account / MFA — server-rendered (SSR) Identity pages.
   Self-contained on the matte charcoal canvas; tokens only.
   Covers the login-flow auth shell + the account-management
   surface (2FA, authenticator setup, recovery codes).
   ============================================================ */

/* ---------- centered shell for login-flow pages (2fa / recovery) ---------- */
.acc-shell { display: flex; justify-content: center; padding: 2.5rem var(--chrome-gap); }

/* ---------- surface card ---------- */
.acc-card {
    width: 100%; max-width: 460px;
}
.acc-card--wide { max-width: 540px; }
.acc-card {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    padding: 2rem 1.9rem;
}
.acc-card__foot { margin-top: 1.5rem; font-size: .86rem; color: var(--text-secondary); text-align: center; }

/* ---------- brand mark ---------- */
.acc-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.6rem; }
.acc-brand__mark {
    width: 38px; height: 38px; border-radius: var(--radius-sm); flex: none;
    display: grid; place-items: center;
    background: var(--ai-gradient); color: var(--on-accent);
    font-weight: 700; font-size: 1.15rem;
}
.acc-brand__name {
    font-family: "Outfit", sans-serif; font-weight: 600; font-size: 1.12rem;
    color: var(--text-primary); letter-spacing: -.01em;
}

/* ---------- header (icon + eyebrow + title + subtitle) ---------- */
.acc-head { margin-bottom: 1.6rem; }
.acc-head__icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    display: grid; place-items: center; margin-bottom: 1.1rem;
    background: var(--accent-soft); color: var(--accent);
}
.acc-eyebrow {
    display: block; font-size: .68rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
    color: var(--accent); margin-bottom: .5rem;
}
.acc-title {
    margin: 0; font-family: "Outfit", sans-serif; font-weight: 600;
    font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.6rem); line-height: 1.12;
    letter-spacing: -.02em; color: var(--text-primary);
}
.acc-subtitle { margin: .6rem 0 0; max-width: 56ch; color: var(--text-secondary); font-size: .92rem; line-height: 1.6; }
.acc-head__meta { margin-top: 1rem; }

/* ---------- form fields ---------- */
.acc-form { display: flex; flex-direction: column; gap: 1.1rem; }
.acc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.acc-field { display: flex; flex-direction: column; gap: .45rem; }
.acc-field > .acc-badge, .acc-field > .acc-btn--sm { align-self: flex-start; }
.acc-label { font-size: .8rem; font-weight: 600; color: var(--text-secondary); }
/* Filled look (mirrors the MudBlazor "Filled" variant the client app uses): a subtly
   shaded box, rounded only at the top, flat underlined bottom. The underline is an inset
   box-shadow (not a border) so the 1px→2px accent transition on focus causes no reflow. */
.acc-input {
    width: 100%; box-sizing: border-box;
    background: var(--field-fill); color: var(--text-primary);
    border: none; border-radius: var(--radius-input) var(--radius-input) 0 0;
    box-shadow: inset 0 -1px 0 0 var(--outline-strong);
    padding: .8rem .95rem; font-size: .95rem; font-family: inherit;
    transition: background .18s ease, box-shadow .18s ease;
}
.acc-input::placeholder { color: var(--text-disabled); }
.acc-input:hover { background: var(--field-fill-hover); box-shadow: inset 0 -1px 0 0 var(--text-secondary); }
.acc-input:focus {
    outline: none; background: var(--field-fill);
    box-shadow: inset 0 -2px 0 0 var(--accent);
}
.acc-input--code { font-size: 1.4rem; letter-spacing: .4em; text-align: center; font-weight: 600; }

/* ---------- phone field: country picker fused with the national number into one control ----------
   Global (here, not a per-page/scoped sheet) so the PhoneNumberInput control renders IDENTICALLY
   everywhere it's reused — the public Join page and the admin account dialogs. */
.phone-input {
    display: flex; align-items: stretch; width: 100%; box-sizing: border-box;
    background: var(--field-fill); border: none;
    border-radius: var(--radius-input) var(--radius-input) 0 0;
    box-shadow: inset 0 -1px 0 0 var(--outline-strong);
    transition: background .18s ease, box-shadow .18s ease;
}
.phone-input:hover { background: var(--field-fill-hover); box-shadow: inset 0 -1px 0 0 var(--text-secondary); }
.phone-input:focus-within {
    background: var(--field-fill);
    box-shadow: inset 0 -2px 0 0 var(--accent);
}
/* Country picker (progressive enhancement). The combo wrapper is the segment; it holds the no-JS native
   <select>, plus the JS-revealed flag trigger and the search popover. */
.phone-combo { position: relative; flex: 0 0 auto; display: flex; align-items: stretch; border-right: 1px solid var(--outline); }
.phone-input:focus-within .phone-combo { border-right-color: var(--outline-strong); }
.phone-input__flag { font-size: 1.2rem; line-height: 1; }
.phone-input__chev { color: var(--text-secondary); font-size: .65rem; }

/* No-JS fallback: the native select styled as a compact segment. */
.phone-combo__native {
    border: none; outline: none; background: transparent; color: var(--text-primary);
    font-family: inherit; font-size: 1rem; /* >=16px: no iOS zoom */ font-weight: 600;
    padding-inline: .95rem .7rem; max-width: 9.5rem; cursor: pointer;
}
.phone-combo__native option { color: var(--text-primary); background: var(--surface); }

/* JS-enhanced trigger: just the flag + chevron. */
.phone-combo__trigger {
    display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
    border: none; background: transparent; padding-inline: .95rem .8rem; height: 100%;
}
.phone-combo__trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-radius: var(--radius-sm); }

/* Search popover: floats under the trigger; search box pinned, list scrolls. */
.phone-combo__panel {
    position: absolute; top: calc(100% + .4rem); inset-inline-start: 0; z-index: 40;
    width: max-content; min-width: 16rem; max-width: min(22rem, 86vw);
    background: var(--surface); border: 1px solid var(--outline-strong); border-radius: var(--radius-sm);
    padding: .5rem; display: flex; flex-direction: column; gap: .4rem;
}
.phone-combo__search {
    width: 100%; box-sizing: border-box; font-family: inherit; font-size: 1rem;
    color: var(--text-primary); background: var(--bg);
    border: 1px solid var(--outline); border-radius: var(--radius-pill); padding: .55rem .9rem;
}
.phone-combo__search:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.phone-combo__search::placeholder { color: var(--text-disabled); }
.phone-combo__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 15rem; }
.phone-combo__option {
    display: flex; align-items: center; gap: .6rem; cursor: pointer;
    padding: .5rem .6rem; border-radius: var(--radius-sm); font-size: .92rem; color: var(--text-primary);
}
.phone-combo__option:hover, .phone-combo__option.is-active { background: var(--accent-soft); color: var(--accent); }
.phone-combo__option[hidden] { display: none; }
.phone-combo__opt-flag { font-size: 1.1rem; line-height: 1; }
.phone-combo__opt-name { flex: 1 1 auto; min-width: 0; }
.phone-combo__opt-code { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.phone-combo__empty { padding: .6rem; color: var(--text-secondary); font-size: .9rem; text-align: center; }

/* National number: frameless — the group owns the frame, divider and focus ring. The vertical rhythm
   (clamp middle term in vh) is the SAME the Join card used — now the field default so the control is
   identical on every form and still scales down on short viewports. */
.phone-input__number {
    flex: 1 1 auto; min-width: 0;
    border: none; outline: none; background: transparent; color: var(--text-primary);
    font-family: inherit; font-size: .95rem; padding: clamp(.5rem, 1.5vh, .8rem) .95rem;
}
.phone-input__number::placeholder { color: var(--text-disabled); }
@media (max-width: 360px) {
    .phone-combo__native, .phone-combo__trigger { padding-inline: .7rem .6rem; }
}

/* ---------- checkbox row ---------- */
.acc-check { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.acc-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.acc-check span { font-size: .9rem; color: var(--text-secondary); }

/* ---------- buttons ---------- */
.acc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .8rem 1.4rem; border-radius: var(--radius-pill);
    font-size: .92rem; font-weight: 600; font-family: inherit;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: filter .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.acc-btn--block { width: 100%; }
.acc-btn--primary { background: var(--ai-gradient); color: var(--on-accent); }
.acc-btn--primary:hover { filter: brightness(1.06); }
.acc-btn--ghost { background: transparent; color: var(--text-primary); border-color: var(--outline-strong); }
.acc-btn--ghost:hover { background: var(--surface-2); border-color: var(--accent-line); }
.acc-btn--danger { background: var(--error-soft); color: var(--error); }
.acc-btn--danger:hover { filter: brightness(1.08); }

/* ---------- inline links ---------- */
.acc-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.acc-link:hover { text-decoration: underline; }

/* ---------- divider ---------- */
.acc-divider {
    display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0;
    color: var(--text-disabled); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
}
.acc-divider::before, .acc-divider::after { content: ""; flex: 1; height: 1px; background: var(--outline); }

/* ---------- alerts ---------- */
.acc-alert {
    display: flex; gap: .7rem; align-items: flex-start;
    border-radius: var(--radius-sm); padding: .9rem 1rem;
    font-size: .88rem; line-height: 1.55; margin-bottom: 1.25rem;
}
.acc-alert__icon { flex: none; margin-top: .05rem; }
.acc-alert > div { min-width: 0; }
.acc-alert p { margin: .35rem 0 0; }
.acc-alert strong { font-weight: 700; }
.acc-alert a { color: inherit; font-weight: 700; text-decoration: underline; }
.acc-alert--success { background: var(--success-soft); color: var(--success); }
.acc-alert--warning { background: var(--warning-soft); color: var(--warning); }
.acc-alert--danger  { background: var(--error-soft);   color: var(--error); }
.acc-alert--info    { background: var(--accent-soft);  color: var(--accent); }

/* validation text */
.acc-validation { color: var(--error); font-size: .82rem; }
.acc-validation:empty { display: none; }

/* ---------- steps (enable authenticator) ---------- */
.acc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.6rem; }
.acc-step { display: flex; gap: 1rem; }
.acc-step__num {
    flex: none; width: 30px; height: 30px; border-radius: var(--radius-pill);
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem;
}
.acc-step__body { min-width: 0; flex: 1; }
.acc-step__body > p:first-child { margin-top: .3rem; }
.acc-step__body p { margin: 0 0 .7rem; color: var(--text-secondary); font-size: .9rem; line-height: 1.6; }

/* ---------- QR + shared secret ---------- */
.acc-qr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; margin: .2rem 0 .4rem; }
.acc-qr { display: inline-block; background: var(--on-accent); padding: .9rem; border-radius: var(--radius-sm); line-height: 0; }
.acc-qr__img { width: 188px; height: 188px; display: block; }
.acc-key-wrap { min-width: 0; }
.acc-key-label { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: .5rem; }
.acc-key {
    display: inline-block; background: var(--bg); border: 1px solid var(--outline);
    border-radius: var(--radius-pill); padding: .55rem 1rem;
    font-family: ui-monospace, "SF Mono", monospace; font-size: .98rem;
    color: var(--text-primary); letter-spacing: .12em; word-break: break-all;
}

/* ---------- recovery codes grid ---------- */
.acc-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: 1.4rem 0; }
.acc-code {
    background: var(--bg); border: 1px solid var(--outline); border-radius: var(--radius-sm);
    padding: .75rem .9rem; text-align: center;
    font-family: ui-monospace, "SF Mono", monospace; font-size: 1rem; font-weight: 600;
    letter-spacing: .06em; color: var(--text-primary);
}

/* ---------- status badge ---------- */
.acc-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    border-radius: var(--radius-pill); padding: .32rem .8rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.acc-badge--on { background: var(--success-soft); color: var(--success); }
.acc-badge--off { background: var(--surface-2); color: var(--text-secondary); }
.acc-badge__dot { width: 7px; height: 7px; border-radius: var(--radius-pill); background: currentColor; }

/* ---------- action rows ---------- */
.acc-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.acc-actions--end { margin-top: 1.5rem; }
.acc-actions--split { justify-content: space-between; align-items: center; }

/* ---------- compact list (passkeys, external logins) ---------- */
.acc-list { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.acc-list__row {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--bg); border: 1px solid var(--outline); border-radius: var(--radius-sm);
    padding: .85rem 1rem;
}
.acc-list__main { min-width: 0; flex: 1; }
.acc-list__name { font-weight: 600; color: var(--text-primary); font-size: .95rem; }
.acc-list__actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.acc-btn--sm { padding: .5rem .95rem; font-size: .84rem; }

/* empty / muted note */
.acc-empty { color: var(--text-secondary); font-size: .92rem; margin: .25rem 0 1.4rem; }

/* ============ Manage shell (nav rail + body) ============ */
.acc-manage { display: grid; grid-template-columns: 248px 1fr; gap: 1.5rem; align-items: start; padding: var(--chrome-gap); }
.acc-manage__head { grid-column: 1 / -1; }
.acc-manage__nav {
    background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius);
    padding: .6rem; position: sticky; top: var(--chrome-gap);
}
.acc-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-nav__link {
    display: block; padding: .6rem .85rem; border-radius: var(--radius-pill);
    color: var(--text-secondary); font-size: .9rem; font-weight: 500; text-decoration: none;
    transition: background .18s ease, color .18s ease;
}
.acc-nav__link:hover { background: var(--surface-2); color: var(--text-primary); }
.acc-nav__link.active { background: var(--accent-soft); color: var(--nav-active-text); font-weight: 600; }
.acc-manage__body { min-width: 0; }

/* nav footer: role-aware portal button + sign-out */
.acc-nav__foot { margin-top: .8rem; padding: .8rem .35rem .35rem; border-top: 1px solid var(--outline); display: flex; flex-direction: column; gap: .4rem; }
.acc-nav__logout { width: 100%; }
.acc-nav__logout-btn {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
    padding: .65rem 1rem; border-radius: var(--radius-pill);
    font-size: .88rem; font-weight: 600; color: var(--text-secondary);
    transition: background .18s ease, color .18s ease;
}
.acc-nav__logout-btn:hover { background: var(--error-soft); color: var(--error); }

/* ---------- content panel (manage pages) ---------- */
.acc-panel {
    background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius);
    padding: 1.85rem 1.9rem;
}
.acc-panel + .acc-panel { margin-top: 1.25rem; }
.acc-panel__title { margin: 0 0 .35rem; font-family: "Outfit", sans-serif; font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; color: var(--text-primary); }
.acc-panel__sub { margin: 0 0 1.35rem; color: var(--text-secondary); font-size: .9rem; line-height: 1.6; }

@media (max-width: 960px) {
    .acc-manage { grid-template-columns: 1fr; }
    .acc-manage__nav { position: static; }
    .acc-nav { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 600px) {
    .acc-card { padding: 1.5rem 1.25rem; }
    .acc-row { grid-template-columns: 1fr; }
    .acc-panel { padding: 1.4rem 1.25rem; }
    .acc-codes { grid-template-columns: 1fr; }
    .acc-actions .acc-btn { width: 100%; }
    .acc-qr-row { gap: 1rem; }
}

/* ---------- WebAssembly boot splash (post-login loading + role redirect) ---------- */
.wasm-boot {
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem 4rem;
    text-align: center;
}

.wasm-boot__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--boot-gap);
    max-width: 480px;
}

.wasm-boot__mark {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-pill);
    display: grid;
    place-items: center;
    background: var(--ai-gradient);
    color: var(--on-accent);
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1;
}

.wasm-boot__title {
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    color: var(--text-primary);
    margin: 0;
}

.wasm-boot__subtitle {
    font-size: clamp(.9rem, 3vw, 1rem);
    color: var(--text-secondary);
    margin: 0;
    max-width: 36ch;
}

.wasm-boot__bar {
    position: relative;
    width: var(--boot-bar-width);
    height: var(--boot-bar-height);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    overflow: hidden;
}

/* Determinate fill driven live by --blazor-load-percentage (set in wasm-boot.js). */
.wasm-boot__bar::after {
    content: "";
    position: absolute;
    inset: 0;
    transform-origin: left center;
    transform: scaleX(var(--blazor-load-percentage, 0%));
    background: var(--ai-gradient);
    transition: transform .35s ease-out;
}

.wasm-boot__pct {
    font-variant-numeric: tabular-nums;
    font-size: .9rem;
    color: var(--text-secondary);
    min-height: 1.2em;
}

/* The number itself comes from the CSS var so it tracks the real download without round-trips. */
.wasm-boot__pct::before {
    content: var(--blazor-load-percentage-text, "");
}

/* Indeterminate shimmer shown until the first real percentage arrives. */
.wasm-boot__bar--indeterminate::after {
    width: 35%;
    inset: 0 auto 0 0;
    transform: translateX(-120%);
    animation: wasm-boot-slide 1.15s ease-in-out infinite;
}

@keyframes wasm-boot-slide {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

/* ============================================================
   Wallet card preview (Add-card form) — WalletCardPreview.razor
   Two faithful device mocks side by side: an Apple Wallet store
   card (logo + logoText, full-width strip, primary points field,
   secondary reward field, barcode) and a Google Wallet loyalty
   card (circular logo + program/issuer, hero image, points
   module, barcode). Device frames render as minimal phone
   silhouettes with platform status bars (iOS dynamic island,
   Android punch-hole). Flip animation, back-of-card, and all
   layout are CSS-class driven — zero inline style dependency.
   --pass-ink/-dim are set per-card inline from bg luminance.
   ============================================================ */
.wallet-stage {
    display: flex; flex-wrap: wrap; gap: 1.5rem;
    align-items: flex-start; justify-content: center;
}
.wallet-stage--compact { gap: .5rem; flex-wrap: nowrap; align-items: stretch; }

/* ---- device frame: minimal phone silhouette with platform chrome ---- */
.device {
    --current-device-w: var(--device-w);
    width: var(--current-device-w);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.wallet-stage--compact .device {
    --current-device-w: 120px;
}
.device__label {
    align-self: center; display: inline-flex; align-items: center; gap: .4rem;
    font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}
.wallet-stage--compact .device__label { font-size: .52rem; letter-spacing: .08em; }
.device__label .mud-icon-root { font-size: 1rem; }
.wallet-stage--compact .device__label .mud-icon-root { font-size: .8rem; }

/* phone bezel — the outer shell that wraps the screen */
.device__frame {
    border: 2.5px solid var(--device-bezel-edge);
    border-radius: var(--device-radius);
    overflow: hidden;
    position: relative;
    background: var(--ios-screen);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06),
                0 2px 12px rgba(0,0,0,.28);
}

/* side button accents — purely decorative */
.device__frame::before {
    content: "";
    position: absolute;
    right: -4.5px;
    top: 20%;
    width: 2px;
    height: 28px;
    border-radius: 0 2px 2px 0;
    background: var(--device-bezel-edge);
}
.device__frame::after {
    content: "";
    position: absolute;
    left: -4.5px;
    top: 26%;
    width: 2px;
    height: 18px;
    border-radius: 2px 0 0 2px;
    background: var(--device-bezel-edge);
}

/* ---- iOS status bar (dynamic island + time + icons) ---- */
.device__ios-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 4px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    font-size: 9px;
    font-weight: 600;
    color: var(--ios-status-ink);
    position: relative;
    z-index: 5;
}
.device__ios-status__time { letter-spacing: .02em; }
.device__ios-status__island {
    width: 52px;
    height: 14px;
    background: var(--ios-screen);
    border-radius: var(--radius-ios-island);
    position: absolute;
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
}
.wallet-stage--compact .device__ios-status__island { width: 42px; height: 12px; border-radius: var(--radius-ios-island-compact); }
.device__ios-status__icons {
    display: flex;
    align-items: center;
    gap: 3px;
}
.device__ios-status__icons svg { width: 11px; height: 11px; fill: var(--ios-status-ink); }

/* compact variant hides the status bar to save vertical space */
.wallet-stage--compact .device__ios-status { display: none; }
.wallet-stage--compact .device__frame::before,
.wallet-stage--compact .device__frame::after { display: none; }
.wallet-stage--compact .device__frame {
    border-width: 2px;
    border-radius: calc(var(--device-radius) - 6px);
    flex: 1;
}

/* ---- shared pass shell ---- */
.pass {
    border-radius: var(--pass-radius); overflow: hidden;
    background: var(--pass-bg, var(--ai-gradient));
    color: var(--pass-ink); font-family: "Inter", system-ui, sans-serif;
    cursor: pointer; /* the whole card mock is clickable (opens inline editors) */
}
/* Apple back-of-card: blend the card background into a readable darker scrim */
.pass.pass-apple.pass-face-back { background-color: var(--pass-back-scrim); background-blend-mode: overlay; }
.pass__flabel {
    font-size: .5rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
    color: var(--pass-ink-dim); line-height: 1.3;
}
.wallet-stage--compact .pass__flabel { font-size: .4rem; }
.pass__fvalue {
    font-weight: 600; color: var(--pass-ink); line-height: 1.1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wallet-stage--compact .pass__fvalue { font-size: .55rem; }
.pass__logo-img { height: 22px; width: auto; max-width: 96px; object-fit: contain; display: block; }
.pass__logo-fallback {
    height: 22px; width: 22px; border-radius: 6px; flex: none;
    display: grid; place-items: center; background: var(--wallet-fallback-fill); color: var(--pass-ink-dim);
}
.pass__logo-fallback .mud-icon-root { font-size: .9rem; }
.pass__pill {
    flex: none; display: inline-flex; align-items: center;
    background: var(--wallet-fallback-fill); color: var(--wallet-ink-light);
    border-radius: var(--radius-pill); padding: .12rem .5rem;
    font-size: .56rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.pass__pill--ink { color: var(--pass-ink); }

/* banner band (strip / hero) */
.pass__banner { position: relative; background-size: cover; background-position: center; }
.pass__banner--empty { display: grid; place-items: center; background: var(--wallet-fallback-fill); }
.pass__banner--empty .mud-icon-root { color: var(--pass-ink-dim); font-size: 1.4rem; }

/* barcode block — white rounded backdrop with subtle separator */
.pass__barcode {
    display: flex; flex-direction: column; align-items: center; gap: .3rem;
    padding: .7rem .8rem .85rem;
    border-top: 1px solid rgba(127,127,127,.15);
}
.wallet-stage--compact .pass__barcode { padding: .45rem .5rem .5rem; }
.pass__qr { background: var(--pass-qr-bg); border-radius: 8px; padding: 5px; display: grid; place-items: center; }
.pass__qr .mud-icon-root, .pass__qr svg { color: var(--pass-qr-ink); width: var(--qr-size); height: var(--qr-size); font-size: var(--qr-size); }
.pass__qr img { width: var(--qr-size); height: var(--qr-size); display: block; border-radius: 4px; }
/* PDF417 symbology: a wide strip instead of the square QR box (preview) */
.pass__qr--pdf417 { width: 100%; height: 64px; padding: 8px 16px; }
.pass__qr--pdf417 img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.pass__qr--pdf417 .mud-icon-root, .pass__qr--pdf417 svg { width: 100%; height: 100%; }
.pass__code {
    font-family: ui-monospace, "SF Mono", monospace; font-size: .56rem; letter-spacing: .18em;
    color: var(--pass-ink-dim); text-transform: uppercase;
}
.wallet-stage--compact .pass__code { font-size: .4rem; }

/* ---- flip animation (Apple back-of-card) ---- */
.pass-scene {
    perspective: 1000px;
    width: 100%;
}
.pass-flipper {
    position: relative;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}
.pass-flipper.flipped { transform: rotateY(180deg); }
.pass-face-front,
.pass-face-back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    width: 100%;
}
.pass-face-back {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
}

/* ---- Apple Wallet store card ---- */
.pass-apple {
    --qr-size: 58px;
    display: flex; flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
.wallet-stage--compact .pass-apple { --qr-size: 38px; }

/* top bar: logo + name … store name + ⓘ */
.pass-apple__top {
    display: flex; align-items: center; justify-content: space-between;
    gap: .4rem; padding: .6rem .65rem .5rem;
    width: 100%; overflow: hidden; min-width: 0;
}
.wallet-stage--compact .pass-apple__top { padding: .35rem .45rem .3rem; }
.pass-apple__brand {
    display: flex; align-items: center; gap: .4rem;
    min-width: 0; max-width: 58%; flex: 1 1 auto;
}
.pass-apple__name {
    font-weight: 600; font-size: .82rem; color: var(--pass-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: .01em;
}
.wallet-stage--compact .pass-apple__name { font-size: .58rem; }
.pass-apple__header-field {
    display: flex; flex-direction: column; align-items: flex-end;
    min-width: 0; max-width: 38%; flex: 0 1 auto;
}
.pass-apple__header-field__label {
    font-size: .42rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--pass-ink-dim); line-height: 1;
}
.pass-apple__header-field__value {
    font-size: .78rem; font-weight: 500; color: var(--pass-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.2;
}
.wallet-stage--compact .pass-apple__header-field__value { font-size: .54rem; }

/* ⓘ info / flip button — frosted circle like real iOS wallet */
.pass-apple__info-btn {
    flex: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: grid; place-items: center;
    cursor: pointer;
    font-family: "Georgia", "Times New Roman", serif;
    font-style: italic;
    font-size: .72rem;
    font-weight: 400;
    color: var(--pass-ink);
    line-height: 1;
    transition: background .15s ease;
    margin-left: 4px;
}
.pass-apple__info-btn:hover { background: rgba(255,255,255,.36); }
.wallet-stage--compact .pass-apple__info-btn { width: 18px; height: 18px; font-size: .52rem; }

/* strip (banner image area) — Apple's real 375×123 ratio, scrim for legibility */
.pass-apple__strip {
    aspect-ratio: 375 / 123;
    display: flex; align-items: flex-end; justify-content: flex-start;
    gap: .5rem; padding: .5rem .65rem;
    background-image: var(--pass-scrim), var(--pass-banner);
    background-size: cover; background-position: center;
}
.wallet-stage--compact .pass-apple__strip { padding: .3rem .45rem; }
.pass-apple__strip.pass__banner--empty { display: grid; place-items: center; }

/* primary field (points on the strip) */
.pass-apple__primary { line-height: 1; max-width: 100%; min-width: 0; overflow: hidden; }
.pass-apple__primary .pass__flabel {
    color: var(--wallet-ink-light-dim);
    font-weight: 500; font-size: .5rem; letter-spacing: .06em;
    text-transform: uppercase; margin-bottom: 1px;
}
.pass-apple__primary .v {
    font-size: 1.85rem; font-weight: 200; color: var(--wallet-ink-light);
    line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.wallet-stage--compact .pass-apple__primary .v { font-size: 1.15rem; }

/* points row (no-banner fallback) */
.pass-apple__pointsrow { padding: .45rem .65rem 0; max-width: 100%; min-width: 0; overflow: hidden; }
.wallet-stage--compact .pass-apple__pointsrow { padding: .25rem .45rem 0; }
.pass-apple__pointsrow .v {
    font-size: 1.35rem; font-weight: 300; color: var(--pass-ink);
    line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.wallet-stage--compact .pass-apple__pointsrow .v { font-size: .9rem; }

/* secondary field (reward) */
.pass-apple__secondary { padding: .5rem .65rem; max-width: 100%; min-width: 0; overflow: hidden; }
.wallet-stage--compact .pass-apple__secondary { padding: .3rem .45rem; }
.pass-apple__secondary .pass__flabel {
    font-weight: 500; font-size: .5rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--pass-ink-dim); margin-bottom: 1px;
}
.pass-apple__secondary .pass__fvalue {
    font-size: .82rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wallet-stage--compact .pass-apple__secondary .pass__fvalue { font-size: .58rem; }

/* ---- Apple back-of-card ---- */
.pass-apple-back__header {
    height: 48px;
    position: relative;
    flex: none;
}
.pass-apple-back__done {
    position: absolute; right: 8px; top: 8px; z-index: 10;
    color: var(--pass-ink); font-weight: 600; text-transform: none;
}
.pass-apple-back__content {
    padding: 0 14px 14px;
    overflow-y: auto;
    flex: 1;
}
.pass-apple-back__section.pass-apple-back__section--plain { background: transparent; }
.pass-apple-back__section {
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}
.pass-apple-back__field {
    padding: 10px 14px;
}
.pass-apple-back__field--toggle {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 14px;
}
.pass-apple-back__field--toggle + .pass-apple-back__field--toggle {
    border-top: 1px solid rgba(255,255,255,.05);
}
.pass-apple-back__label {
    font-size: 11px; text-transform: uppercase;
    color: var(--pass-ink-dim); letter-spacing: .5px;
}
.pass-apple-back__label--toggle {
    font-size: 14px; color: var(--pass-ink);
    text-transform: none; letter-spacing: normal; margin: 0;
}
.pass-apple-back__value {
    font-size: 14px; color: var(--pass-ink); word-break: break-word;
    margin-top: 3px;
}
.pass-apple-back__value a {
    color: var(--pass-link); text-decoration: none;
}
.pass-apple-back__remove {
    color: var(--pass-danger); text-align: center; padding: 12px;
    background: var(--pass-back-island); border-radius: var(--radius-pass-pill);
    font-weight: 500; cursor: pointer;
    transition: background .15s ease;
}
.pass-apple-back__remove:hover { background: var(--pass-danger-tint); }

/* ---- shared edit chrome ---- */
.wallet-stage--compact .edit-icon { font-size: 0.85rem !important; }

@media (max-width: 380px) {
    .device { width: 100%; }
}

/* Card-builder dialog: keep the live preview in view while the form scrolls (wide screens only). */
.card-builder__preview { position: sticky; top: 1rem; z-index: 5; }
@media (max-width: 959px) {
    .card-builder__preview { position: static; }
}


/* ============================================================
   Bento Grid — the house layout language.
   A mosaic of rounded, generously-padded tiles of varying sizes
   packed into one grid with a consistent gap. Tiles are the matte
   surface boxes (MudPaper.surface-card / Bootstrap .card / .bento-box);
   this section owns the GRID + span helpers + the floating-tile depth.
   Used by both the client app and public pages.
   ============================================================ */
:root {
    --bento-gap: 1rem;
    --radius-bento: 28px; /* chunkier corner for hero tiles */
    /* soft floating-tile depth — carries the Bento look. Subtle in dark (surface
       contrast does most of the work), gently present in light. */
    --shadow-bento: 0 1px 2px rgba(0, 0, 0, .26), 0 10px 28px rgba(0, 0, 0, .20);
    --shadow-bento-hover: 0 2px 6px rgba(0, 0, 0, .30), 0 16px 38px rgba(0, 0, 0, .26);
}
html.theme-light {
    --shadow-bento: 0 1px 2px rgba(16, 24, 40, .06), 0 10px 28px rgba(16, 24, 40, .08);
    --shadow-bento-hover: 0 2px 6px rgba(16, 24, 40, .08), 0 16px 40px rgba(16, 24, 40, .12);
}
@media (max-width: 600px) {
    :root { --bento-gap: .75rem; }
}

/* The mosaic. 12-column grid, dense auto-placement, even gaps. Tiles default to a
   full row on phones and take their span at sm/md+ via the helpers below. */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(7rem, auto);
    grid-auto-flow: dense;
    gap: var(--bento-gap);
}
.bento-grid > * { grid-column: span 12; min-width: 0; }

/* Column-span helpers (phone = full width; widen from sm, settle at md+). */
@media (min-width: 600px) {
    .bento-3 { grid-column: span 6; }
    .bento-4 { grid-column: span 6; }
    .bento-6 { grid-column: span 6; }
    .bento-8 { grid-column: span 12; }
    .bento-9 { grid-column: span 12; }
}
@media (min-width: 960px) {
    .bento-3 { grid-column: span 3; }
    .bento-4 { grid-column: span 4; }
    .bento-6 { grid-column: span 6; }
    .bento-8 { grid-column: span 8; }
    .bento-9 { grid-column: span 9; }
}
/* Row span for taller hero/feature tiles. */
.bento-tall { grid-row: span 2; }

/* A standalone Bento box for non-framework markup (most boxes are MudPaper.surface-card
   or Bootstrap .card, which already get the box treatment via the override files). */
.bento-box {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-bento);
    padding: 1.5rem 1.6rem;
}

/* ============================================================
   Token utility classes — replace one-off inline styles.
   Applied via a component's Class param (global, so no ::deep
   needed); never write the equivalent as an inline style.
   ============================================================ */
.ico-muted { color: var(--text-secondary); }
.ico-accent { color: var(--accent); }
.ico-success { color: var(--success); }
.ico-error { color: var(--error); }
.ico-on-accent { color: var(--on-accent); }
.text-warning-token { color: var(--warning); }
.measure-46 { max-width: 46ch; }
.w-fit { width: max-content; }
.minw-9 { min-width: 9rem; }
.h-control { height: 2.5rem; }
/* card-list avatar swatch — data-driven bg fed via the injected --swatch custom property */
.cell-swatch { background: var(--swatch, var(--ai-gradient)); color: var(--on-accent); }

/* ---------- Spotlight tile: a Bento box with a fixed accent glow ----------
   Draws the eye to the page's single most actionable tile (merchant "your plan",
   admin "pending applications"). The glow is anchored top-left over the surface. */
.surface-card.spotlight-tile {
    background: radial-gradient(140% 120% at 0% 0%, var(--accent-soft), transparent 60%), var(--surface);
}

/* ---------- Quick-action row: a clickable nav row inside a tile ----------
   The control-room shortcut pattern (admin overview). Icon chip + two-line label +
   trailing chevron; the whole row is the tap target and nudges right on hover. */
.action-list { display: flex; flex-direction: column; gap: .15rem; }
.action-row {
    display: flex; align-items: center; gap: .9rem;
    padding: .85rem .6rem; border-radius: var(--radius-sm);
    color: var(--text-primary); text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
.action-row:hover { background: var(--surface-2); transform: translateX(3px); color: var(--text-primary); }
.action-row + .action-row { border-top: 1px solid var(--outline); }
.action-row__chip {
    width: 42px; height: 42px; flex: none; border-radius: var(--radius-sm);
    display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.action-row__text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.action-row__title { font-weight: 600; color: var(--text-primary); line-height: 1.25; }
.action-row__sub { font-size: .82rem; color: var(--text-secondary); line-height: 1.4; }
.action-row__arrow { color: var(--text-secondary); flex: none; }
.action-row:hover .action-row__arrow { color: var(--accent); }

/* A big focal metric inside a spotlight tile (admin "pending applications"). */
.focal-metric {
    font-family: "Outfit", sans-serif; font-weight: 700; line-height: 1;
    font-size: clamp(2.6rem, 2rem + 3vw, 3.6rem); letter-spacing: -.03em; color: var(--text-primary);
}
