/*
    auth-card.css — login / register form styling, scoped to .auth-surface.
    Ports the standalone login page's look (login.html). Loaded site-wide
    (base_standalone); powers the login surface on the /scene/login/ stage
    (carousel/_login-surface.html) and the upgrade card (.auth-surface).
*/

@property --auth-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@keyframes auth-rotate-treads { to { --auth-angle: 360deg; } }

/* Flip-overlay backdrop — flipShow's default overlay class + the card-back
   click guard (carousel-standalone.js). inset:0 over the live back content;
   the gradient mirrors .flip-back (standalone-carousel.css) so the dark card
   shows through the surface's translucent blue like it does on .flip-front. */
.flip-auth-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--secondary) 16%, #22222a) 0%,
        #22222a 50%
    );
}

.auth-surface {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 1.6rem 1.4rem 1.4rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--secondary) 8%, transparent) 0%,
        color-mix(in srgb, var(--secondary) 3%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--secondary) 15%, transparent);
    border-radius: inherit;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Text master: SAME vmax scale as the card-backs + prompt-card, so the form
       reads at one size everywhere and stays flip-stable. Children size in em off
       this; the × stays fixed chrome. */
    font-size: clamp(11px, 1.5vmax, 13px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.auth-surface .prompt-card-close {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}
.auth-surface .prompt-card-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.auth-surface .login-brand { text-align: center; margin-bottom: 1.2rem; }
/* Upgrade/celebrate blurb — center it like the brand above (a bare <p> would
   otherwise sit left-aligned). The offer's perks list keeps its own layout. */
.auth-surface .upgrade-blurb { text-align: center; }
.auth-surface .login-brand h1 {
    font-family: var(--app-brand-font, 'Brush Script MT', cursive);
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--secondary);
    text-shadow: 0 0 20px color-mix(in srgb, var(--secondary) 30%, transparent);
    margin: 0;
}
.auth-surface .login-brand .subtitle {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.25rem;
}

.auth-surface .form-group { margin-bottom: 0.8rem; }
.auth-surface .form-group label {
    display: block;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.3rem;
}
.auth-surface .form-group input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid color-mix(in srgb, var(--secondary) 18%, transparent);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1em;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-surface .form-group input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--secondary) 50%, transparent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--secondary) 15%, transparent);
}
.auth-surface .form-group input::placeholder { color: rgba(255, 255, 255, 0.25); }

.auth-surface .form-hint { margin-top: 0.35rem; text-align: right; font-size: 0.75em; }
.auth-surface .form-hint a {
    color: color-mix(in srgb, var(--secondary) 55%, transparent);
    text-decoration: none;
    transition: color 0.15s;
}
.auth-surface .form-hint a:hover { color: color-mix(in srgb, var(--secondary) 90%, transparent); }

/* Submit — tread-ringed pill, same as the login page's .login-btn */
.auth-surface .login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.65rem 1.2rem;
    margin-top: 1rem;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--secondary) 30%, #2a2a45) 0%,
        color-mix(in srgb, var(--secondary) 18%, #1a1a2e) 100%);
    border: none;
    border-radius: 999px;
    color: var(--secondary);
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    isolation: isolate;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.5),
        0 0 15px color-mix(in srgb, var(--secondary) 15%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}
.auth-surface .login-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    background: conic-gradient(from var(--auth-angle, 0deg),
        var(--secondary) 0deg 12deg, transparent 12deg 18deg,
        var(--primary) 18deg 30deg, transparent 30deg 36deg,
        var(--secondary) 36deg 48deg, transparent 48deg 54deg,
        var(--primary) 54deg 66deg, transparent 66deg 72deg,
        var(--secondary) 72deg 84deg, transparent 84deg 360deg);
    opacity: 0.5;
    animation: auth-rotate-treads 12s linear infinite;
    pointer-events: none;
    z-index: -1;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 3px;
}
.auth-surface .login-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.5),
        0 0 25px color-mix(in srgb, var(--secondary) 25%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.auth-surface .login-btn:hover::before { opacity: 0.8; animation-duration: 4s; }
.auth-surface .login-btn:active { transform: translateY(2px); }

.auth-surface .login-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    gap: 0.8rem;
}
.auth-surface .login-divider::before,
.auth-surface .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: color-mix(in srgb, var(--secondary) 15%, transparent);
}
.auth-surface .login-divider span {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
}

.auth-surface .google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.auth-surface .google-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}
.auth-surface .google-btn svg { flex-shrink: 0; }

.auth-surface .login-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.35);
}
.auth-surface .login-footer a {
    color: var(--secondary);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.auth-surface .login-footer a:hover { opacity: 1; }

/* AJAX register: validation errors + the "check your email" success, shown
   inline on the card (prompt-card.js submitRegister). [hidden] until used. */
.auth-surface .auth-card-errors {
    margin: 0 0 1rem;
    padding: 0.55rem 0.75rem;
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--danger);
}
.auth-surface .auth-card-errors > div { margin: 0.12rem 0; }
.auth-surface .auth-card-success {
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: var(--secondary);
    font-size: 1.1em;
    line-height: 1.5;
}
.auth-surface [hidden] { display: none !important; }

/* ── login / register: a SYSTEM-CARD GRID ──────────────────────────────────────────
   header / avatar / body / actions / footer — the middle three are EQUAL sections (1fr)
   so the card reads the same at any size (gallery slots or expanded, portrait/landscape).
   Shared by the slide-in + flip-back (.auth-login-surface rides into both). Swap the body
   for a question + the actions for yes/no and it's a HAL confirm card. */
.auth-surface.auth-login-surface {
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* fill the card width (a rows-only grid would
                                                auto-size the column to content) */
    /* ONE shared grid for EVERY auth card — login / confirm / greeting / upgrade.
       Rows packed top-down like a moving truck: header (title, 1 line) / avatar /
       content (flexes below the avatar) / actions (hug the bottom). NO per-surface
       grid overrides. STANDARDIZED on the card-back vmax ruler: the avatar row is
       content-sized (auto) and the avatar is a vmax clamp below (not a fraction of
       the card), and every text dial is vmax — so avatar + text move together on one
       device-relative ruler and hold a bounded size instead of drifting as the card
       stretches. Tune the avatar (.auth-avatar width) + THE DIAL (.auth-row--fields)
       once, for all of them. Content (1fr) soaks leftover room. */
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    padding: 5px 10px;              /* 5px top/bottom; 10px sides — large card */
    overflow: hidden;
    gap: clamp(3px, 0.5vmax, 8px);  /* one spacing dial (vmax, flip-stable) */
    container-type: size;           /* the confirm/upgrade surfaces still scale their
                                       text off cqh against this container */
}
/* Small card (portrait card on a landscape screen, e.g. desktop) → tighter 5px sides. */
@media (orientation: landscape) {
    .auth-surface.auth-login-surface { padding-left: 5px; padding-right: 5px; }
}
/* The three middle sections: each centers its content, shares one side-padding dial, and
   stays behind its property lines (a 1fr grid track). */
.auth-login-surface .auth-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    gap: clamp(3px, 0.5vmax, 8px);
    padding: 0 clamp(2px, 1vmax, 14px);   /* shared side padding (fields/buttons/avatar) */
}
/* All login content (subtitle + form + Log In + Google) lives in ONE track that HUGS its
   content (the grid row is `auto`), so there is no internal slack to push Google down — the
   avatar's 1fr row above soaks up the leftover room instead. THE DIAL scales the content. */
.auth-login-surface .auth-row--fields {
    justify-content: center;
    font-size: clamp(12px, 1.9vmax, 16px);   /* THE DIAL — vmax (device-relative, flip-stable) like the
                                                card-backs, a notch bigger for the hero form. em children ride it. */
}
.auth-login-surface .auth-row--fields > * { flex: 0 0 auto; }
/* The ONE avatar rule for every auth card — a circle that fills the fixed avatar
   row (--auth-avatar-h), so it's the SAME fraction of the card everywhere. No
   per-surface size override; the knob above is the only dial. */
.auth-login-surface .auth-avatar {
    aspect-ratio: 1;
    /* SCALES WITH THE CARD: cqw = 1% of the card WIDTH (the auth-surface is a size
       container). 40cqw = 40% of the card, so the avatar stays the same PROPORTION at
       every card size — big chat card, mid (URL shown), small gallery slot — leaving
       proportionate room for the content beside it. This is the clean card-relative
       ruler; the old balloon came from sizing off card HEIGHT via a grid row. One
       number retunes every HAL avatar; the layouts around it get fixed next. */
    width: 55cqw;
    max-width: 90%;                /* still never overflow a narrow card */
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--secondary) 25%, #1a1a2e);
    background-image: var(--auth-hero);   /* the card's front image, via flipAuth */
    background-size: cover;
    background-position: center;
    border: 2px solid color-mix(in srgb, var(--secondary) 70%, transparent);
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.4),
        0 0 16px color-mix(in srgb, var(--secondary) 22%, transparent);
}
/* (The old mobile-portrait avatar shrink is gone — it patched the 1fr-soak balloon,
   which the fixed --auth-avatar-h row now prevents structurally. One size, one knob.) */
/* Header = the brand, centered. Give it a cqh size so the brand SCALES with the
   card (it was a fixed em off the default, so it stayed tiny on big cards while the
   rest grew). The .auth-brand em below rides this. */
.auth-login-surface .auth-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(15px, 2.8vmax, 24px);   /* vmax, matching the standardized dial (hero brand) */
}
.auth-login-surface .auth-brand {
    min-width: 0;
    /* font-family (--brand-font) + weight from .brand-cursive; size for the card here. */
    font-size: 1.6em;
    /* Themed off the character's hair slot (flip-back inherits --slot-1), brightened to
       stay legible on any hair color. */
    color: color-mix(in srgb, var(--secondary) 70%, white);
    text-shadow: 0 0 20px color-mix(in srgb, var(--secondary) 35%, transparent);
    margin: 0;
}
.auth-login-surface .login-subtitle {
    text-align: center;
    font-size: 0.8em;               /* em off the cluster dial */
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}
/* Kill the fixed 0.8rem form-group margin — that was the big gap between fields that
   never scaled; the cluster's gap (vmax) handles spacing now. */
.auth-login-surface .form-group { margin-bottom: 0; }
/* Field font AND box scale aggressively with the CARD (cqh), so the fields really shrink
   on a small card instead of bottoming out at the device-relative master size. */
.auth-login-surface .form-group input {
    font-size: 1em;                 /* em off the cluster dial */
    padding: 0.35em 0.7em;          /* em → box scales with the dial */
}
/* The placeholder is the field's only label, so let it read a touch stronger. */
.auth-login-surface .form-group input::placeholder { color: rgba(255, 255, 255, 0.4); }
/* The form fills the body row. */
.auth-login-surface form { display: flex; flex-direction: column; gap: clamp(3px, 0.5vmax, 7px); width: 100%; }
/* Both bubbles hug their text but share ONE width — the Google button's natural size —
   so they line up instead of the Google one stretching full width. Same font-size means
   the em min-width resolves to the same px for both; fit-content stops the stretch;
   centered in their (flex form / block body) parents. */
.auth-login-surface .login-btn,
.auth-login-surface .google-btn {
    width: fit-content;
    min-width: 11em;                       /* em off the cqh font below → scales with the card */
    align-self: center;
    margin: 0 auto;                 /* 0 top/bottom kills the base .login-btn margin-top:1rem
                                       (the dead air above Log In); auto L/R centers */
    font-size: 1em;                 /* em off the cluster dial → scales with the card */
    padding: 0.4em 0.9em;
}
.auth-login-surface .login-btn {
    /* Match the Google button's text treatment — caps + wide spacing made "LOG IN" read
       bigger than "Google Sign In" at the same font-size. */
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 600;
    /* Theme the fill/text/glow off the character's hair slot (brightened for legibility). */
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--secondary) 35%, #2a2a45) 0%,
        color-mix(in srgb, var(--secondary) 22%, #1a1a2e) 100%);
    color: color-mix(in srgb, var(--secondary) 75%, white);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.5),
        0 0 15px color-mix(in srgb, var(--secondary) 18%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}
/* Tread-ring takes the slot colors too — hair (slot-1) + eyes (slot-2). */
.auth-login-surface .login-btn::before {
    background: conic-gradient(from var(--auth-angle, 0deg),
        var(--primary) 0deg 12deg, transparent 12deg 18deg,
        var(--secondary) 18deg 30deg, transparent 30deg 36deg,
        var(--primary) 36deg 48deg, transparent 48deg 54deg,
        var(--secondary) 54deg 66deg, transparent 66deg 72deg,
        var(--primary) 72deg 84deg, transparent 84deg 360deg);
}
.auth-login-surface .google-btn { gap: 5px; }   /* between the logo and the word */
/* Logo scales with the button (was a hardcoded 18px holding the button's height up). */
.auth-login-surface .google-btn svg { width: 1.15em; height: 1.15em; }
/* Footer sits tight under the cluster — drop the base 1rem margin-top (that gap). */
.auth-login-surface .login-footer { margin-top: 0; }
/* Divider spans the buttons' width, centered, in the actions row. */
.auth-login-surface .login-divider { width: 11em; max-width: 100%; margin: 0.1em auto; }

/* ── confirm surface: a destructive-confirm HAL card on the shared grid shell ──────
   Uses the ONE shared grid (no grid override) — avatar (the knob) up top, the
   question in the flexing content row below it, buttons hugging the bottom. Only
   the content STYLING is confirm-specific below. */
/* The message + buttons scale with the card off a cqh dial. Cap kept modest so the
   LARGER slide-in prompt cards (which hit the cap) don't read oversized, while the
   smaller gallery-stage card stays below it and scales freely. */
.auth-confirm-surface .auth-row--message,
.auth-confirm-surface .confirm-actions {
    font-size: clamp(10px, 3cqh, 16px);
}
/* Buttons = the grid's footer row: a centered flex row. On the SLIDE-IN card the
   form also carries .prompt-card-form (for prompt-card.js), whose old rule made it
   position:absolute/inset:0/column — reset that so it stays the buttons track.
   The bottom margin lifts the buttons off the card's edge on EVERY confirm card
   (delete / discard / greeting / ask-name) — they were resting on the border with
   a roomy 1fr message row above; the space comes out of that row, not new height. */
.auth-confirm-surface .confirm-actions {
    position: static;
    inset: auto;
    padding: 0;
    flex-direction: row;
    align-items: center;
    margin-bottom: clamp(8px, 2vmax, 16px);
}
.auth-confirm-surface .confirm-question {
    text-align: center;
    font-size: 1.05em;              /* em off the cqh dial → scales with the card */
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    max-width: 22em;
}
/* Usage HAL surface — the tier/usage readout centered in the message row. Reuses
   the .tier-info-block grid (chat-input.css); here it's free of the chat layout's
   left-shift margins, so cap + center it and let it scale off the cqh dial. */
.auth-usage-surface .auth-row--message {
    font-size: clamp(10px, 3cqh, 16px);
}
.auth-usage-surface .tier-info-block {
    width: min(22em, 100%);
    margin: 0 auto;
    font-size: 1em;                 /* off the row's cqh dial, not the fixed 0.7rem */
}
.auth-usage-surface .tier-info-grid {
    justify-content: center;
    gap: 0.4em 1.4em;
}
/* Voice HAL surface — voice / speed / volume as full-width TITLED pills stacked in
   a column. Reuses the chat voice-pill chrome (dark fill from .cast-scene-voice-wrap;
   all three sit inside it now, so volume matches). Each pill fills the line: title
   in a fixed left column, control taking the rest. */
.auth-tts-surface .auth-row--message {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: clamp(10px, 3cqh, 16px);
}
.auth-tts-surface .cast-scene-voice-wrap {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.45em;
    width: min(22em, 100%);
    margin: 0;
}
.auth-tts-surface .cast-scene-voice-wrap .cast-scene-voice-pill,
.auth-tts-surface .cast-scene-voice-wrap .cast-scene-voice-speed-pill {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 0.6em;
}
/* Titles share a fixed left column so the controls line up across all three. */
.auth-tts-surface .cast-scene-voice-wrap .cast-scene-voice-pill-label {
    flex: 0 0 auto;
    width: 3.6em;
    opacity: 0.6;
}
/* Voice select2 + the slider strips fill the pill after the title (were collapsing
   to their content, leaving the pill 2/3 empty). */
.auth-tts-surface .cast-scene-voice-pill .select2-container {
    flex: 1 1 auto;
    min-width: 0;
}
.auth-tts-surface .cast-scene-voice-wrap .cast-scene-voice-speed-wrap {
    flex: 1 1 auto;
    min-width: 0;
}
.auth-tts-surface .cast-scene-voice-wrap .cast-scene-voice-speed {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;   /* shrink to fit the pill instead of overflowing its edge */
}
/* Activity tester — a short italic line + speaker between the avatar and the pills. */
.auth-tts-surface .tts-tester {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    width: min(22em, 100%);
    margin: 0.25em auto 0.15em;
    font-size: clamp(10px, 2.8cqh, 15px);
}
.auth-tts-surface .tts-tester-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
    opacity: 0.75;
}
.auth-tts-surface .tts-tester-speak {
    flex: 0 0 auto;
    cursor: pointer;
}
/* HAL cards read HAIR (--slot-1) on titles / subject / buttons / fields while the
   surface background + border stay EYES (the site accent). Hair is the more varied,
   character-distinct colour, so it carries the text; eyes frames it. Scoped to
   .auth-confirm-surface so the login card (auth-login-surface WITHOUT confirm) keeps
   its full-eyes treatment. The title line — card_title ("Reset conversation?") or the
   brand fallback — otherwise inherits the eyes .auth-login-surface .auth-brand rule. */
.auth-confirm-surface .auth-brand {
    color: color-mix(in srgb, var(--primary) 70%, white);
    text-shadow: 0 0 20px color-mix(in srgb, var(--primary) 35%, transparent);
}
/* Subject (the character/name caption) above the question — small, hair-tinted. */
.auth-confirm-surface .confirm-subject {
    text-align: center;
    font-size: 0.72em;              /* em off the dial */
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: color-mix(in srgb, var(--primary) 55%, white);
    margin: 0 0 0.35em;
}
/* Optional text input (ask-name / needs-name) — sits in the message row, scales
   off the dial. Form-associated via form="" so it still rides the POST. */
.auth-confirm-surface .prompt-card-input {
    width: 100%;
    max-width: 16em;
    margin-top: 0.6em;
    font-size: 0.95em;              /* em off the dial */
    padding: 0.4em 0.75em;
    text-align: center;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}
.auth-confirm-surface .prompt-card-input::placeholder { color: rgba(255, 255, 255, 0.4); }
/* The confirm/cancel pair as their own row, so the ask-name card can stack an
   "or / Import a card" path beneath it. Other prompt kinds just have this row. */
.auth-confirm-surface .confirm-actions-primary {
    display: flex;
    gap: clamp(6px, 1.4vmax, 16px);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
/* ask-name: stack [Let's go · Cancel] → or → [Import a card] vertically. (The
   footer's bottom margin is shared on the base .confirm-actions rule above.) */
.auth-confirm-surface .confirm-actions--stacked {
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 1.8vmax, 14px);
}
/* "or" separator between building blank and importing — text flanked by rules. */
.auth-confirm-surface .confirm-or {
    display: flex;
    align-items: center;
    gap: 0.6em;
    width: 11em;
    max-width: 100%;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}
.auth-confirm-surface .confirm-or::before,
.auth-confirm-surface .confirm-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}
.auth-confirm-surface .confirm-actions {
    display: flex;
    gap: clamp(6px, 1.4vmax, 16px);
    justify-content: center;
    flex-wrap: wrap;
}
.auth-confirm-surface .confirm-btn {
    width: fit-content;
    min-width: 6em;
    text-align: center;
    font-size: 1em;                 /* em off the dial → scales with the card */
    padding: 0.4em 1.1em;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.12s ease;
}
/* Confirm (primary) — hair-themed pill, same visual language as the login button. */
.auth-confirm-surface .confirm-btn--confirm {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--primary) 35%, #2a2a45) 0%,
        color-mix(in srgb, var(--primary) 22%, #1a1a2e) 100%);
    color: color-mix(in srgb, var(--primary) 78%, white);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.auth-confirm-surface .confirm-btn--confirm:hover { filter: brightness(1.12); }
/* Cancel (keep) — subdued grey, recedes. */
.auth-confirm-surface .confirm-btn--cancel {
    background: color-mix(in srgb, white 8%, #1a1a2e);
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}
.auth-confirm-surface .confirm-btn--cancel:hover {
    color: rgba(255, 255, 255, 0.9);
    background: color-mix(in srgb, white 13%, #1a1a2e);
}
/* Import (alternative) — outlined hair-tint: a peer path to Confirm ("build blank")
   vs importing a card, so it reads as an action, not the grey dismiss. Icon inline. */
.auth-confirm-surface .confirm-btn--import {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: color-mix(in srgb, var(--primary) 10%, #1a1a2e);
    color: color-mix(in srgb, var(--primary) 70%, white);
    border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.auth-confirm-surface .confirm-btn--import:hover {
    filter: brightness(1.12);
    background: color-mix(in srgb, var(--primary) 16%, #1a1a2e);
}
.auth-confirm-surface .confirm-btn--import svg { width: 1em; height: 1em; }
/* Press feedback so a click reads. */
.auth-confirm-surface .confirm-btn:active { transform: translateY(1px); }
/* Avatar sizing is the shared base rule (height:100% of the fixed --auth-avatar-h
   row → a circle at the one consistent size). No per-surface override. */

/* ── greeting-picker: reset-to-a-greeting CHOICE cards (on the confirm shell) ───────
   The preview (the greeting text) is the focal content. It reads left-aligned and
   scrolls in the shared content row if long — no grid override (same avatar knob as
   every card; more text room = change the knob, for all of them). Carries
   .auth-confirm-surface too, so it inherits the disc, dial, subject + buttons. */
.auth-greeting-surface .auth-row--message { justify-content: flex-start; gap: 0.35em; }
.auth-greeting-surface .greeting-preview {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    overflow-y: auto;
    text-align: left;
    font-size: 0.92em;              /* em off the dial — a touch smaller than a question */
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.82);
}
/* linebreaks wraps the greeting in <p>/<br> so the author's paragraphs read as
   prose instead of one collapsed wall. Tight paragraph spacing; no trailing gap. */
.auth-greeting-surface .greeting-preview p { margin: 0 0 0.7em; }
.auth-greeting-surface .greeting-preview p:last-child { margin-bottom: 0; }

/* In-editor greeting EDITOR: the editable textarea fills the message track (the
   read-only preview's scroll, but writable — overrides .prompt-card-input's width cap). */
.auth-greeting-surface .greeting-edit-text {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    resize: none;
    text-align: left;
    font-size: 0.92em;
    line-height: 1.4;
}

/* ── upgrade surface: the Aurora Pro offer on the shared grid shell ─────────────────
   GLOBAL (not inline in the template) because flipShow / presentSubscribeOnCardBack
   extract only the .upgrade-surface div, dropping any sibling <style>. Rows:
   header / avatar / message (the most content — largest track) / action. */
.auth-surface.auth-upgrade-surface {
    /* No grid override — the ONE shared grid + avatar knob. Just a touch more bottom
       padding to lift Subscribe off the border. */
    padding-bottom: clamp(10px, 3cqh, 22px);
}
.auth-upgrade-surface .auth-row--message,
.auth-upgrade-surface .auth-row--action {
    font-size: clamp(10px, 3cqh, 16px);
}
/* (Avatar sizing removed — the upgrade card uses the ONE shared avatar rule /
   --auth-avatar-h knob now, like every other auth card.) */
.auth-upgrade-surface .auth-row--message { gap: 0.3em; }
/* (.upgrade-title removed — the face title lives in the shared header now.) */
.auth-upgrade-surface .upgrade-sub {
    font-size: 0.85em;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}
.auth-upgrade-surface .upgrade-perks {
    list-style: none;
    margin: 0.2em 0 0;
    padding: 0;
    font-size: 0.9em;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
}
.auth-upgrade-surface .upgrade-perks strong { color: color-mix(in srgb, var(--secondary) 70%, white); }
.auth-upgrade-surface .upgrade-blurb {
    font-size: 0.85em;
    line-height: 1.5;
    opacity: 0.85;
    margin: 0;
    max-width: 22em;
}
.auth-upgrade-surface .upgrade-cap-note {
    font-size: 0.85em;
    line-height: 1.4;
    font-weight: 600;
    color: color-mix(in srgb, var(--secondary) 70%, white);
    margin: 0 0 0.2em;
}
/* Subscribe / Manage reuse the login button; keep the Stripe <form> full-width so
   the pill centers in the action track. */
.auth-upgrade-surface .auth-row--action form { display: flex; justify-content: center; width: 100%; }
/* Close × — absolute overlay above the grid. */
.auth-upgrade-surface .prompt-card-close {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    z-index: 3;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    font-size: 1.3rem;
}
