/* ============================================================================
   AI RECEPTIONIST KIOSK — "Front Desk" design system
   Calm clinical palette, large touch targets, one accent colour from the
   hospital theme (--accent), light & dark modes, landscape + portrait totem.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap');

/* ---------------------------------------------------------------- tokens */
.rx-shell {
    --accent: #0d9488;
    --accent-strong: color-mix(in oklab, var(--accent) 82%, #000);
    --accent-soft: color-mix(in oklab, var(--accent) 10%, var(--surface));
    --accent-softer: color-mix(in oklab, var(--accent) 5%, var(--surface));
    --accent-line: color-mix(in oklab, var(--accent) 35%, var(--surface));
    --accent-glow: color-mix(in oklab, var(--accent) 40%, transparent);
    --on-accent: #fff;

    --orb-a: color-mix(in oklab, var(--accent) 70%, #5eead4);
    --orb-b: #38bdf8;
    --orb-c: #a78bfa;

    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-2: #f5f7fa;
    --surface-3: #eaeef3;
    --line: #dfe5ec;
    --line-strong: #c9d2dc;
    --text: #0e1b2a;
    --muted: #536274;
    --subtle: #8796a8;

    --danger: #d92d20;
    --danger-soft: #fdeceb;
    --success: #0f9d58;
    --success-soft: #e6f6ee;
    --warn: #b54708;
    --warn-soft: #fef3e6;
    --listen: #e5484d;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --shadow-md: 0 8px 24px -8px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .05);
    --shadow-lg: 0 30px 60px -20px rgba(16, 24, 40, .25), 0 10px 20px -10px rgba(16, 24, 40, .1);

    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 24px;
    --r-xl: 32px;

    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

    --fs: clamp(15px, calc(0.6vw + 0.6vh), 19px);
    --gutter: clamp(16px, 1.8vw, 36px);

    position: fixed;
    inset: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', 'Noto Sans Gujarati', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: var(--fs);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    isolation: isolate;
}

.rx-shell:lang(gu) { font-family: 'Noto Sans Gujarati', 'Plus Jakarta Sans', system-ui, sans-serif; }
.rx-shell:lang(hi) { font-family: 'Noto Sans Devanagari', 'Plus Jakarta Sans', system-ui, sans-serif; }

.rx-shell.rx-large { --fs: clamp(17px, calc(0.7vw + 0.7vh), 22px); }

.rx-shell.rx-dark {
    --bg: #0a111d;
    --surface: #111a29;
    --surface-2: #162133;
    --surface-3: #1c2940;
    --line: #223049;
    --line-strong: #2e3f5d;
    --text: #e9eef5;
    --muted: #a3b1c4;
    --subtle: #7487a0;
    --danger-soft: #3a1717;
    --success-soft: #0f2e22;
    --warn-soft: #36230f;
    --accent-soft: color-mix(in oklab, var(--accent) 20%, var(--surface));
    --accent-softer: color-mix(in oklab, var(--accent) 10%, var(--surface));
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
}

:where(.rx-shell) *,
:where(.rx-shell) *::before,
:where(.rx-shell) *::after { box-sizing: border-box; }

:where(.rx-shell) button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

:where(.rx-shell) button:disabled { cursor: not-allowed; }
:where(.rx-shell) :focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 3px; }
:where(.rx-shell) img { max-width: 100%; display: block; }

/* ---------------------------------------------------------------- ambient background */
.rx-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.rx-backdrop span {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    animation: rx-drift 28s ease-in-out infinite alternate;
}
.rx-backdrop span:nth-child(1) { width: 55vmax; height: 55vmax; left: -15vmax; top: -20vmax; background: color-mix(in oklab, var(--accent) 22%, transparent); }
.rx-backdrop span:nth-child(2) { width: 45vmax; height: 45vmax; right: -12vmax; top: 10vmax; background: color-mix(in oklab, #38bdf8 16%, transparent); animation-delay: -9s; }
.rx-backdrop span:nth-child(3) { width: 40vmax; height: 40vmax; left: 30vmax; bottom: -25vmax; background: color-mix(in oklab, #a78bfa 12%, transparent); animation-delay: -18s; }
.rx-dark .rx-backdrop span { opacity: .35; }

@keyframes rx-drift {
    to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); }
}

/* ---------------------------------------------------------------- top bar */
.rx-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px var(--gutter);
}

.rx-brand { display: flex; align-items: center; gap: 14px; text-align: left; min-width: 0; }
.rx-brand-logo {
    width: 52px; height: 52px; flex: none;
    display: grid; place-items: center;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 8px;
}
.rx-brand-text { display: flex; flex-direction: column; min-width: 0; }
.rx-brand-name { font-weight: 800; font-size: calc(var(--fs) * 1.12); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-brand-sub { color: var(--muted); font-size: calc(var(--fs) * .8); font-weight: 500; }

.rx-topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.rx-clock {
    display: flex; flex-direction: column; align-items: flex-end;
    padding: 0 14px 0 4px; margin-right: 4px;
    border-right: 1px solid var(--line);
    line-height: 1.15;
}
.rx-clock-time { font-weight: 800; font-size: calc(var(--fs) * 1.25); font-variant-numeric: tabular-nums; }
.rx-clock-time small { font-size: .55em; font-weight: 700; margin-left: 3px; color: var(--muted); }
.rx-clock-date { color: var(--muted); font-size: calc(var(--fs) * .78); font-weight: 600; }

.rx-lang-switch {
    display: flex; padding: 4px; gap: 2px;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}
.rx-lang-switch button {
    min-height: 44px; padding: 0 16px;
    border-radius: 999px;
    font-weight: 700; font-size: calc(var(--fs) * .88);
    color: var(--muted);
    transition: background .25s var(--ease), color .25s var(--ease);
}
.rx-lang-switch button.is-active { background: var(--accent); color: var(--on-accent); }

.rx-pill-btn {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 52px; padding: 0 18px;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    font-weight: 700; font-size: calc(var(--fs) * .88);
    transition: transform .2s var(--ease), background .2s;
}
.rx-pill-btn:active { transform: scale(.96); }
.rx-pill-btn.is-on { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 2px var(--accent-line); }
.rx-pill-danger { color: var(--danger); }
.rx-aa { font-weight: 800; font-size: 1.1em; letter-spacing: -0.04em; }
.rx-aa small { font-size: .7em; }

/* ---------------------------------------------------------------- orb */
.rx-orb {
    --size: 120px;
    position: relative;
    width: var(--size);
    height: var(--size);
    flex: none;
    border-radius: 50%;
    display: block;
}
.rx-orb-xl { --size: clamp(180px, 24vmin, 280px); }
.rx-orb-md { --size: clamp(76px, 9vmin, 104px); }

.rx-orb-core {
    position: absolute; inset: 0; border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, color-mix(in oklab, var(--accent) 35%, #fff) 0%, transparent 42%),
        radial-gradient(circle at 50% 55%, color-mix(in oklab, var(--accent) 85%, #0b1530) 0%, color-mix(in oklab, var(--accent) 45%, #071021) 100%);
    box-shadow:
        0 24px 50px -16px var(--accent-glow),
        inset 0 -12px 28px rgba(0, 0, 0, .35),
        inset 0 6px 16px rgba(255, 255, 255, .25);
    animation: rx-breathe 5s ease-in-out infinite;
}
.rx-orb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.rx-orb-gloss {
    position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
    background: radial-gradient(ellipse 45% 30% at 38% 22%, rgba(255, 255, 255, .55), transparent 70%);
    mix-blend-mode: soft-light;
}

.rx-orb-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    pointer-events: none;
}
[data-voice="speaking"] .rx-orb-ring { animation: rx-ripple 2.4s var(--ease) infinite; }
[data-voice="listening"] .rx-orb-ring { border-color: var(--listen); animation: rx-ripple 1.8s var(--ease) infinite; }
.rx-orb-ring:nth-child(2) { animation-delay: .8s !important; }
.rx-orb-ring:nth-child(3) { animation-delay: 1.6s !important; }
[data-voice="listening"] .rx-orb-ring:nth-child(2) { animation-delay: .6s !important; }
[data-voice="listening"] .rx-orb-ring:nth-child(3) { animation-delay: 1.2s !important; }
[data-voice="thinking"] .rx-orb-core { animation: rx-think 1.6s ease-in-out infinite; }

@keyframes rx-breathe { 50% { transform: scale(1.025); } }
@keyframes rx-think { 50% { transform: scale(.96); filter: brightness(1.15); } }
@keyframes rx-ripple {
    0% { transform: scale(1); opacity: .55; }
    100% { transform: scale(1.75); opacity: 0; }
}

/* ---------------------------------------------------------------- welcome */
.rx-welcome {
    min-height: 0;
    display: grid;
    grid-template-rows: 1fr auto auto;
    align-items: center;
    justify-items: center;
    gap: clamp(16px, 2.6vh, 32px);
    padding: 0 var(--gutter) clamp(20px, 3vh, 40px);
    overflow-y: auto;
    animation: rx-fade-in .6s var(--ease) both;
}

.rx-hero {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 12px;
    max-width: 1000px;
}
.rx-hero .rx-orb { margin-bottom: 10px; transition: transform .3s var(--ease-spring); }
.rx-hero .rx-orb:active { transform: scale(.95); }

.rx-greet-rotator {
    position: relative; height: 1.6em; width: 100%;
    font-weight: 700; color: var(--accent-strong);
    font-size: calc(var(--fs) * 1.05);
    letter-spacing: .02em;
}
.rx-greet-rotator span {
    position: absolute; inset: 0;
    opacity: 0;
    animation: rx-rotate-word 9s infinite;
}
.rx-greet-rotator span:nth-child(2) { animation-delay: 3s; }
.rx-greet-rotator span:nth-child(3) { animation-delay: 6s; }
@keyframes rx-rotate-word {
    0% { opacity: 0; transform: translateY(8px); }
    5%, 28% { opacity: 1; transform: none; }
    33%, 100% { opacity: 0; transform: translateY(-8px); }
}

.rx-hero-title {
    margin: 0;
    font-size: calc(var(--fs) * 2.4);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.12;
    text-wrap: balance;
}
.rx-hero-lead {
    margin: 0;
    color: var(--muted);
    font-size: calc(var(--fs) * 1.15);
    max-width: 44ch;
    text-wrap: balance;
}

.rx-hero-convo {
    display: flex; flex-direction: column; gap: 10px;
    width: min(680px, 100%);
    margin-top: 8px;
}
.rx-hero-convo .rx-bubble { font-size: calc(var(--fs) * 1.1); }

.rx-hero-voice { display: flex; align-items: center; gap: 16px; margin-top: 8px; text-align: left; }

.rx-lang-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(12px, 1.4vw, 22px);
    width: min(1100px, 100%);
}
.rx-lang-card {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: clamp(18px, 2.4vh, 28px) clamp(18px, 1.8vw, 28px);
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    text-align: left;
    overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
    animation: rx-rise .6s var(--ease) both;
}
.rx-lang-card:nth-child(2) { animation-delay: .06s; }
.rx-lang-card:nth-child(3) { animation-delay: .12s; }
.rx-lang-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    box-shadow: inset 0 0 0 2px transparent;
    transition: box-shadow .25s var(--ease);
}
.rx-lang-card:hover::after, .rx-lang-card.is-current::after { box-shadow: inset 0 0 0 2px var(--accent-line); }
.rx-lang-card:active { transform: scale(.97); }
.rx-lang-native { font-size: calc(var(--fs) * 2); font-weight: 800; letter-spacing: -0.01em; }
.rx-lang-en { color: var(--muted); font-weight: 600; }
.rx-lang-cta {
    margin-top: 14px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--accent); color: var(--on-accent);
    font-weight: 700; font-size: calc(var(--fs) * .92);
}

.rx-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: min(1100px, 100%);
}
.rx-quick-btn {
    display: flex; align-items: center; gap: 12px;
    min-height: 72px;
    padding: 12px 18px;
    background: color-mix(in oklab, var(--surface) 75%, transparent);
    backdrop-filter: blur(10px);
    border-radius: var(--r-md);
    box-shadow: inset 0 0 0 1px var(--line);
    font-weight: 700; text-align: left;
    font-size: calc(var(--fs) * .95);
    transition: transform .2s var(--ease), background .2s;
}
.rx-quick-btn:active { transform: scale(.97); background: var(--surface); }
.rx-quick-icon {
    width: 44px; height: 44px; flex: none;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--accent-soft); color: var(--accent-strong);
}
.rx-quick-danger .rx-quick-icon { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- task layout */
.rx-task {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    justify-items: center;
    gap: clamp(14px, 1.4vw, 24px);
    padding: 0 var(--gutter) clamp(14px, 2vh, 24px);
    animation: rx-fade-in .5s var(--ease) both;
}

/* receptionist panel */
.rx-receptionist {
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 14px;
    padding: 20px;
    background: color-mix(in oklab, var(--surface) 70%, transparent);
    backdrop-filter: blur(16px);
    border-radius: var(--r-xl);
    box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}

.rx-rcp-head { display: flex; align-items: center; gap: 14px; }
.rx-rcp-id { flex: 1; min-width: 0; }
.rx-rcp-name { font-weight: 800; font-size: calc(var(--fs) * 1.25); letter-spacing: -0.01em; }
.rx-rcp-role { color: var(--muted); font-size: calc(var(--fs) * .82); font-weight: 600; }

.rx-status {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 6px;
    padding: 4px 12px 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: calc(var(--fs) * .8); font-weight: 700; color: var(--muted);
}
.rx-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
[data-voice="speaking"] .rx-status { color: var(--accent-strong); background: var(--accent-soft); }
[data-voice="speaking"] .rx-status-dot { background: var(--accent); animation: rx-blink 1s infinite; }
[data-voice="listening"] .rx-status { color: var(--listen); background: color-mix(in oklab, var(--listen) 12%, var(--surface)); }
[data-voice="listening"] .rx-status-dot { background: var(--listen); animation: rx-blink .8s infinite; }
[data-voice="thinking"] .rx-status { color: var(--warn); background: var(--warn-soft); }
[data-voice="thinking"] .rx-status-dot { background: var(--warn); animation: rx-blink .5s infinite; }
@keyframes rx-blink { 50% { opacity: .3; } }

.rx-icon-btn {
    width: 52px; height: 52px; flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--muted);
    transition: transform .2s var(--ease), color .2s;
}
.rx-icon-btn:active { transform: scale(.92); color: var(--accent); }

.rx-transcript {
    min-height: 0;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    padding: 6px 4px 6px 0;
    scrollbar-width: none;
    mask-image: linear-gradient(to bottom, transparent 0, #000 28px, #000 100%);
}
.rx-transcript::-webkit-scrollbar { display: none; }
.rx-transcript > :first-child { margin-top: auto; }

.rx-bubble {
    max-width: 92%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: calc(var(--fs) * 1);
    line-height: 1.45;
    animation: rx-pop .4s var(--ease) both;
    text-wrap: pretty;
}
.rx-bubble-assistant {
    align-self: flex-start;
    background: var(--surface);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm);
}
.rx-bubble-assistant:last-of-type { box-shadow: var(--shadow-sm), inset 3px 0 0 var(--accent); }
.rx-bubble-user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--on-accent);
    border-bottom-right-radius: 6px;
}
.rx-hero-convo .rx-bubble-assistant { align-self: center; text-align: center; border-radius: 20px; }
.rx-hero-convo .rx-bubble-user { align-self: center; border-radius: 20px; }

.rx-typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.rx-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); animation: rx-dot 1.2s infinite; }
.rx-typing i:nth-child(2) { animation-delay: .15s; }
.rx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rx-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

.rx-live-caption {
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    font-style: italic;
    color: var(--muted);
    font-size: calc(var(--fs) * 1);
    text-align: right;
    transition: max-height .3s var(--ease), opacity .3s;
}
.rx-live-caption.is-visible { max-height: 4.5em; opacity: 1; }
.rx-live-caption.is-final { color: var(--text); font-style: normal; font-weight: 600; }
.rx-welcome .rx-live-caption { text-align: center; font-size: calc(var(--fs) * 1.2); }

.rx-voice-bar {
    display: flex; align-items: center; gap: 14px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.rx-mic {
    position: relative;
    width: 72px; height: 72px; flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 10px 24px -8px var(--accent-glow);
    transition: transform .25s var(--ease-spring), background .25s;
}
.rx-welcome .rx-mic { width: 80px; height: 80px; }
.rx-mic:active { transform: scale(.92); }
.rx-mic::before, .rx-mic::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--listen); opacity: 0; pointer-events: none;
}
.rx-mic.is-on { background: var(--listen); box-shadow: 0 10px 24px -8px color-mix(in oklab, var(--listen) 60%, transparent); }
.rx-mic.is-on::before { animation: rx-ripple 1.6s var(--ease) infinite; }
.rx-mic.is-on::after { animation: rx-ripple 1.6s var(--ease) .8s infinite; }
.rx-mic-stop { width: 22px; height: 22px; border-radius: 6px; background: currentColor; }

.rx-mic-text { display: flex; flex-direction: column; min-width: 0; }
.rx-mic-text strong { font-size: calc(var(--fs) * 1.05); font-weight: 800; }
.rx-mic-text span { color: var(--muted); font-size: calc(var(--fs) * .85); }

/* workspace */
.rx-workspace {
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.rx-stepper {
    display: flex; align-items: center; gap: 12px;
    padding: 18px clamp(20px, 2.4vw, 40px);
    border-bottom: 1px solid var(--line);
}
.rx-step { display: flex; align-items: center; gap: 10px; flex: none; }
.rx-step-dot {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--surface-3); color: var(--subtle);
    font-weight: 800; font-size: calc(var(--fs) * .88);
    transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s;
}
.rx-step-label { font-weight: 700; color: var(--subtle); font-size: calc(var(--fs) * .92); transition: color .35s; }
.rx-step.is-active .rx-step-dot { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.rx-step.is-active .rx-step-label { color: var(--text); }
.rx-step.is-done .rx-step-dot { background: var(--accent-soft); color: var(--accent-strong); }
.rx-step.is-done .rx-step-label { color: var(--muted); }
.rx-step-line { flex: 1; height: 2px; min-width: 16px; background: var(--line); border-radius: 2px; position: relative; overflow: hidden; }
.rx-step-line::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.rx-step-line.is-done::after { transform: scaleX(1); }

.rx-stage {
    min-height: 0;
    overflow-y: auto;
    padding: clamp(20px, 3vh, 40px) clamp(20px, 2.6vw, 48px);
    display: flex; flex-direction: column; gap: clamp(16px, 2.2vh, 26px);
    animation: rx-stage-in .5s var(--ease) both;
    scrollbar-width: thin;
}

.rx-workspace-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px clamp(14px, 1.6vw, 28px);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}
.rx-foot-right { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- typography */
.rx-stage-head { display: flex; flex-direction: column; gap: 6px; }
.rx-center { align-items: center; text-align: center; justify-content: center; }
.rx-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--accent-strong);
    font-weight: 800;
    font-size: calc(var(--fs) * .78);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.rx-eyebrow-success { color: var(--success); }
.rx-h2 { margin: 0; font-size: calc(var(--fs) * 1.85); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.rx-lead { margin: 0; color: var(--muted); font-size: calc(var(--fs) * 1.05); text-wrap: pretty; }

/* ---------------------------------------------------------------- buttons */
.rx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 60px;
    padding: 0 26px;
    border-radius: var(--r-md);
    font-weight: 700;
    font-size: calc(var(--fs) * 1.02);
    transition: transform .2s var(--ease), background .2s, box-shadow .2s, opacity .2s;
    white-space: nowrap;
}
.rx-btn:active:not(:disabled) { transform: scale(.97); }
.rx-btn:disabled { opacity: .45; }
.rx-btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 24px -12px var(--accent-glow); }
.rx-btn-primary:hover:not(:disabled) { background: var(--accent-strong); }
.rx-btn-secondary { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.rx-btn-ghost { background: transparent; color: var(--muted); padding: 0 16px; min-height: 52px; }
.rx-btn-ghost:active { background: var(--surface-3); }
.rx-btn-lg { min-height: 70px; padding: 0 34px; font-size: calc(var(--fs) * 1.12); }
.rx-btn-xl { min-height: 80px; padding: 0 44px; font-size: calc(var(--fs) * 1.25); border-radius: var(--r-lg); }
.rx-btn-sm { min-height: 44px; padding: 0 16px; font-size: calc(var(--fs) * .88); border-radius: var(--r-sm); }

.rx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rx-actions-sticky {
    position: sticky; bottom: calc(-1 * clamp(20px, 3vh, 40px));
    margin: 0 calc(-1 * clamp(20px, 2.6vw, 48px)) calc(-1 * clamp(20px, 3vh, 40px));
    padding: 16px clamp(20px, 2.6vw, 48px);
    background: linear-gradient(to top, var(--surface) 70%, transparent);
    justify-content: flex-end;
}

.rx-link {
    align-self: flex-start;
    padding: 10px 4px;
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--accent-line);
}
.rx-ml-auto { margin-left: auto; }

.rx-spinner {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: rx-spin .8s linear infinite;
}
@keyframes rx-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- option tiles */
.rx-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.rx-options-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.rx-option {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    min-height: 210px;
    padding: 24px;
    text-align: left;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: inset 0 0 0 1.5px var(--line);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.rx-option:hover { box-shadow: inset 0 0 0 2px var(--accent-line); }
.rx-option:active { transform: scale(.98); }
.rx-option.is-featured {
    background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%);
    box-shadow: inset 0 0 0 2px var(--accent-line), var(--shadow-sm);
}
.rx-option-icon {
    width: 60px; height: 60px; flex: none;
    display: grid; place-items: center;
    border-radius: 18px;
    background: var(--accent-soft); color: var(--accent-strong);
    margin-bottom: auto;
}
.rx-option.is-featured .rx-option-icon { background: var(--accent); color: var(--on-accent); }
.rx-option-tag {
    position: absolute; top: 20px; right: 20px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent); color: var(--on-accent);
    font-size: calc(var(--fs) * .72); font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.rx-option-title { font-size: calc(var(--fs) * 1.25); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.rx-option-desc { color: var(--muted); font-size: calc(var(--fs) * .95); }

.rx-option-row { flex-direction: row; align-items: center; min-height: 0; gap: 18px; padding: 20px 24px; }
.rx-option-row .rx-option-icon { margin: 0; }
.rx-option-row .rx-option-tag { position: static; align-self: flex-start; margin-bottom: 4px; }
.rx-option-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rx-option-arrow { color: var(--subtle); flex: none; }
.rx-option.is-featured .rx-option-arrow { color: var(--accent); }

.rx-note {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 16px 18px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--muted);
    font-size: calc(var(--fs) * .88);
}
.rx-note > svg { flex: none; color: var(--accent); margin-top: 2px; }
.rx-note-warn { background: var(--warn-soft); color: var(--warn); }
.rx-note-warn > svg { color: var(--warn); }

/* ---------------------------------------------------------------- face scanner */
.rx-scanner {
    position: relative;
    width: min(560px, 100%);
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: radial-gradient(circle at 50% 40%, #1d2b44, #0a1120);
    box-shadow: var(--shadow-lg);
}
.rx-scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); z-index: 1; }
.rx-scanner-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .25); }
.rx-scanner-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.rx-scanner-frame ellipse {
    fill: none;
    stroke: color-mix(in oklab, var(--accent) 60%, #fff);
    vector-effect: non-scaling-stroke;
    animation: rx-dash 6s linear infinite;
}
.rx-scanner-frame { filter: drop-shadow(0 0 8px var(--accent-glow)); }
.rx-scanner-frame ellipse { stroke-width: 3px; stroke-dasharray: 14 10; }
@keyframes rx-dash { to { stroke-dashoffset: -240; } }
.rx-scanner-beam {
    position: absolute; left: 12%; right: 12%; height: 3px; z-index: 3;
    background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 50%, #fff), transparent);
    box-shadow: 0 0 20px 4px var(--accent-glow);
    animation: rx-beam 2.2s ease-in-out infinite;
}
@keyframes rx-beam { 0%, 100% { top: 14%; } 50% { top: 82%; } }
.rx-scanner-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255, 255, 255, .15); z-index: 4; }
.rx-scanner-progress span { display: block; height: 100%; background: var(--accent); transition: width .12s linear; }

/* ---------------------------------------------------------------- keypad & digits */
.rx-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 3vw, 56px); align-items: center; }
.rx-split > div:first-child { display: flex; flex-direction: column; gap: 22px; }

.rx-digits { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.rx-digits-prefix { font-weight: 700; color: var(--muted); font-size: calc(var(--fs) * 1.4); margin-right: 8px; }
.rx-digit {
    width: clamp(30px, 3.2vw, 48px);
    height: clamp(48px, 6.4vh, 66px);
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1.5px var(--line);
    font-size: calc(var(--fs) * 1.7);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: background .2s, box-shadow .2s, transform .2s var(--ease-spring);
}
.rx-digit.is-filled { background: var(--accent-softer); box-shadow: inset 0 0 0 1.5px var(--accent-line); animation: rx-pop .3s var(--ease-spring); }
.rx-digit.is-caret { box-shadow: inset 0 0 0 2.5px var(--accent); }
.rx-digit.is-caret::after { content: ""; width: 2px; height: 50%; background: var(--accent); animation: rx-blink 1s steps(1) infinite; }
.rx-digit.rx-gap { margin-left: 10px; }

.rx-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rx-key {
    min-height: clamp(64px, 8.4vh, 88px);
    display: grid; place-items: center;
    border-radius: var(--r-md);
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--line), 0 2px 0 var(--line);
    font-size: calc(var(--fs) * 1.7);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: transform .12s var(--ease), background .15s;
}
.rx-key:active { transform: translateY(2px) scale(.97); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.rx-key-muted { font-size: calc(var(--fs) * 1); color: var(--muted); }
.rx-key-accent { background: var(--accent); color: var(--on-accent); font-size: calc(var(--fs) * 1.05); box-shadow: none; }
.rx-keypad-inline { max-width: 520px; width: 100%; align-self: center; }

.rx-demo { display: flex; align-items: center; gap: 8px; font-size: calc(var(--fs) * .8); color: var(--subtle); }
.rx-demo span { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.rx-demo button { padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- form + keyboard */
.rx-form { display: grid; grid-template-columns: 1.4fr 1fr 0.6fr; gap: 14px; }
.rx-field {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    min-height: 84px;
    padding: 14px 18px;
    background: var(--surface-2);
    border-radius: var(--r-md);
    box-shadow: inset 0 0 0 1.5px var(--line);
    text-align: left;
    transition: box-shadow .2s, background .2s;
}
.rx-field-wide { grid-column: 1 / -1; }
.rx-field-seg { grid-column: 1 / -1; }
.rx-field.is-active { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--accent), 0 0 0 6px var(--accent-soft); }
.rx-field-label { color: var(--muted); font-size: calc(var(--fs) * .8); font-weight: 700; letter-spacing: .02em; }
.rx-field-value { font-size: calc(var(--fs) * 1.35); font-weight: 700; color: var(--subtle); min-height: 1.3em; }
.rx-field.is-filled .rx-field-value { color: var(--text); }
.rx-field.is-active .rx-field-value::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -0.15em; background: var(--accent); animation: rx-blink 1s steps(1) infinite; }
.rx-field.is-active:not(.is-filled) .rx-field-value { color: var(--subtle); }

.rx-seg { display: flex; gap: 8px; width: 100%; }
.rx-seg button {
    flex: 1; min-height: 52px;
    border-radius: var(--r-sm);
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    font-weight: 700;
    transition: background .2s, color .2s, box-shadow .2s;
}
.rx-seg button.is-active { background: var(--accent); color: var(--on-accent); box-shadow: none; }

.rx-keyboard {
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px;
    border-radius: var(--r-lg);
    background: var(--surface-3);
    animation: rx-rise .35s var(--ease) both;
}
.rx-kb-row { display: flex; gap: 8px; justify-content: center; }
.rx-kb-key {
    flex: 1 1 0; max-width: 84px;
    min-height: clamp(54px, 6.8vh, 70px);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 2px 0 var(--line-strong);
    font-size: calc(var(--fs) * 1.3); font-weight: 700;
    transition: transform .1s, background .1s;
}
.rx-kb-key:active { transform: translateY(2px); box-shadow: none; background: var(--accent-soft); }
.rx-kb-wide { max-width: 150px; flex-grow: 1.6; font-size: calc(var(--fs) * .95); display: grid; place-items: center; }
.rx-kb-space { max-width: 420px; flex-grow: 5; font-size: calc(var(--fs) * .95); }
.rx-kb-next { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* ---------------------------------------------------------------- patient & doctor */
.rx-avatar {
    width: 64px; height: 64px; flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-soft), color-mix(in oklab, var(--accent) 22%, var(--surface)));
    color: var(--accent-strong);
    font-weight: 800; font-size: calc(var(--fs) * 1.15);
    overflow: hidden;
}
.rx-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rx-avatar-lg { width: 80px; height: 80px; font-size: calc(var(--fs) * 1.5); }

.rx-patient-card {
    display: flex; align-items: center; gap: 22px;
    padding: 18px 22px;
    border-radius: var(--r-lg);
    background: var(--surface-2);
}
.rx-patient-meta { display: flex; flex-wrap: wrap; gap: 10px 36px; }
.rx-patient-meta div { display: flex; flex-direction: column; }
.rx-patient-meta span { color: var(--muted); font-size: calc(var(--fs) * .78); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rx-patient-meta strong { font-size: calc(var(--fs) * 1.15); font-variant-numeric: tabular-nums; }

.rx-chips {
    display: flex; gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    margin: 0 -2px;
    scrollbar-width: none;
    flex: none;
}
.rx-chips::-webkit-scrollbar { display: none; }
.rx-chip {
    flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 52px; padding: 0 20px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    font-weight: 700; font-size: calc(var(--fs) * .95);
    white-space: nowrap;
    transition: background .2s, color .2s, box-shadow .2s;
}
.rx-chip.is-active { background: var(--text); color: var(--surface); box-shadow: none; }
.rx-chip-count { padding: 1px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .82em; }
.rx-chip.is-active .rx-chip-count { background: color-mix(in oklab, var(--surface) 20%, transparent); color: inherit; }

.rx-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.rx-doc {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 18px;
    text-align: left;
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    transition: transform .2s var(--ease), box-shadow .2s;
}
.rx-doc:hover { box-shadow: inset 0 0 0 2px var(--accent-line), var(--shadow-sm); }
.rx-doc:active { transform: scale(.98); background: var(--accent-softer); }
.rx-doc-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rx-doc-name { font-weight: 800; font-size: calc(var(--fs) * 1.12); letter-spacing: -0.01em; }
.rx-doc-spec { color: var(--accent-strong); font-weight: 700; font-size: calc(var(--fs) * .92); }
.rx-doc-qual { color: var(--muted); font-size: calc(var(--fs) * .82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-doc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rx-doc-fee { font-weight: 800; font-size: calc(var(--fs) * 1.05); font-variant-numeric: tabular-nums; }

.rx-tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: calc(var(--fs) * .76); font-weight: 700;
}
.rx-tag-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rx-tag-success { background: var(--success-soft); color: var(--success); }
.rx-tag-muted { color: var(--subtle); }

.rx-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted); border-radius: var(--r-lg); background: var(--surface-2); }

.rx-doc-banner {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 18px;
    border-radius: var(--r-lg);
    background: var(--surface-2);
}
.rx-doc-banner .rx-avatar { width: 56px; height: 56px; }

/* ---------------------------------------------------------------- scheduling */
.rx-dates { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; flex: none; }
.rx-dates::-webkit-scrollbar { display: none; }
.rx-date {
    flex: none;
    width: 100px; min-height: 108px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    transition: background .2s, color .2s, transform .2s var(--ease);
}
.rx-date:active { transform: scale(.96); }
.rx-date-dow { font-size: calc(var(--fs) * .78); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rx-date-day { font-size: calc(var(--fs) * 1.9); font-weight: 800; line-height: 1.05; }
.rx-date-mon { font-size: calc(var(--fs) * .82); font-weight: 600; color: var(--muted); }
.rx-date.is-active { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 24px -12px var(--accent-glow); }
.rx-date.is-active span { color: inherit; }

.rx-slot-group { display: flex; flex-direction: column; gap: 10px; }
.rx-slot-title { font-weight: 800; color: var(--muted); font-size: calc(var(--fs) * .82); text-transform: uppercase; letter-spacing: .08em; }
.rx-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.rx-slot {
    min-height: 58px;
    border-radius: var(--r-sm);
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    font-weight: 700; font-variant-numeric: tabular-nums;
    transition: background .2s, color .2s, transform .15s;
}
.rx-slot:active:not(:disabled) { transform: scale(.96); }
.rx-slot.is-active { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.rx-slot:disabled { color: var(--subtle); text-decoration: line-through; background: var(--surface-2); }

.rx-slot-skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.rx-slot-skeleton span {
    height: 58px; border-radius: var(--r-sm);
    background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
    background-size: 200% 100%;
    animation: rx-shimmer 1.2s infinite;
}
@keyframes rx-shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- review */
.rx-summary {
    display: flex; flex-direction: column;
    border-radius: var(--r-lg);
    box-shadow: inset 0 0 0 1.5px var(--line);
    overflow: hidden;
}
.rx-summary-row { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.rx-summary-row > div { display: flex; flex-direction: column; min-width: 0; }
.rx-summary-icon { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); }
.rx-summary-label { color: var(--muted); font-size: calc(var(--fs) * .78); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rx-summary-row strong { font-size: calc(var(--fs) * 1.2); }
.rx-summary-row small { color: var(--muted); font-size: calc(var(--fs) * .88); }
.rx-summary-total {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 22px;
    background: var(--surface-2);
    color: var(--muted); font-weight: 600;
}
.rx-summary-total strong { color: var(--text); font-size: calc(var(--fs) * 1.6); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- confirmation + ticket */
.rx-done { display: grid; align-content: center; grid-template-columns: 1fr auto; gap: clamp(20px, 3vw, 56px); align-items: center; flex: 1; }
.rx-done-msg { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }

.rx-check { width: 76px; height: 76px; }
.rx-check circle { fill: var(--success-soft); stroke: var(--success); stroke-width: 2.5; stroke-dasharray: 152; stroke-dashoffset: 152; animation: rx-draw .7s var(--ease) forwards; }
.rx-check path { fill: none; stroke: var(--success); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: rx-draw .45s .5s var(--ease) forwards; }
@keyframes rx-draw { to { stroke-dashoffset: 0; } }

.rx-sent {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--success-soft); color: var(--success);
    font-weight: 700; font-size: calc(var(--fs) * .9);
}

.rx-countdown {
    --p: 100;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--on-accent) calc(var(--p) * 1%), color-mix(in oklab, var(--on-accent) 25%, transparent) 0);
    font-size: calc(var(--fs) * .78); font-weight: 800;
}
.rx-countdown span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); }

.rx-ticket {
    width: clamp(300px, 26vw, 420px);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: rx-print 1.1s var(--ease) both;
    transform-origin: top center;
}
@keyframes rx-print {
    0% { clip-path: inset(0 0 100% 0); transform: translateY(-24px); }
    100% { clip-path: inset(0 0 0 0); transform: none; }
}
.rx-ticket-top {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 26px 20px 22px;
    background: linear-gradient(150deg, var(--accent), color-mix(in oklab, var(--accent) 60%, #1e3a8a));
    color: #fff;
    text-align: center;
}
.rx-ticket-label { font-size: calc(var(--fs) * .78); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.rx-ticket-number { white-space: nowrap; font-size: calc(var(--fs) * 3.6); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rx-ticket-sub { font-weight: 600; opacity: .9; }
.rx-ticket-perf {
    height: 22px; position: relative;
    background: radial-gradient(circle at 0 50%, var(--bg) 11px, transparent 12px) left / 50% 100% no-repeat,
                radial-gradient(circle at 100% 50%, var(--bg) 11px, transparent 12px) right / 50% 100% no-repeat;
}
.rx-ticket-perf::after { content: ""; position: absolute; left: 20px; right: 20px; top: 50%; border-top: 2px dashed var(--line-strong); }
.rx-ticket-body { display: flex; gap: 16px; align-items: center; padding: 6px 22px 22px; }
.rx-ticket-body dl { flex: 1; margin: 0; display: grid; gap: 10px; }
.rx-ticket-body dl div { display: flex; flex-direction: column; }
.rx-ticket-body dt { color: var(--muted); font-size: calc(var(--fs) * .72); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rx-ticket-body dd { margin: 0; font-weight: 800; }
.rx-ticket-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 132px; flex: none; text-align: center; font-size: calc(var(--fs) * .7); color: var(--muted); font-weight: 600; }
.rx-ticket-qr svg { width: 120px; height: 120px; padding: 6px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- help */
.rx-help { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; margin: auto; max-width: 760px; }
.rx-help-pulse {
    width: 104px; height: 104px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--danger-soft); color: var(--danger);
    animation: rx-help-pulse 1.8s ease-in-out infinite;
}
@keyframes rx-help-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--danger) 30%, transparent); }
    50% { box-shadow: 0 0 0 22px transparent; }
}
.rx-help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; text-align: left; }
.rx-help-card { display: flex; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); }
.rx-help-card > svg { flex: none; color: var(--accent); }
.rx-help-card div { display: flex; flex-direction: column; gap: 4px; }
.rx-help-card span { color: var(--muted); }
.rx-help-card-danger { background: var(--danger-soft); }
.rx-help-card-danger > svg, .rx-help-card-danger strong { color: var(--danger); }
.rx-help-phone { color: var(--text) !important; font-size: calc(var(--fs) * 1.4); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- overlays */
.rx-overlay {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center;
    padding: var(--gutter);
    background: rgba(8, 15, 30, .45);
    backdrop-filter: blur(8px);
    animation: rx-fade-in .25s var(--ease) both;
}
.rx-sheet {
    width: min(980px, 100%);
    max-height: 88vh;
    display: flex; flex-direction: column; gap: 16px;
    padding: clamp(20px, 2.4vw, 36px);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: rx-sheet-in .45s var(--ease) both;
}
.rx-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rx-way-list { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.rx-way { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); }
.rx-way-floor {
    width: 108px; flex: none;
    padding: 8px 6px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent-strong);
    text-align: center; font-weight: 800; font-size: calc(var(--fs) * .78);
}
.rx-way-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rx-way-body strong { font-size: calc(var(--fs) * 1.05); }
.rx-way-room { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-strong); font-weight: 700; font-size: calc(var(--fs) * .88); }
.rx-way-dir { color: var(--muted); font-size: calc(var(--fs) * .88); }
.rx-way-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.rx-overlay-soft { background: rgba(8, 15, 30, .3); }
.rx-idle {
    width: min(560px, 100%);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 36px;
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: rx-sheet-in .4s var(--ease-spring) both;
}
.rx-idle-count {
    width: 88px; height: 88px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-strong);
    font-size: calc(var(--fs) * 2.2); font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.rx-toast {
    position: fixed; left: 50%; bottom: 32px; z-index: 60;
    transform: translateX(-50%);
    padding: 14px 22px;
    border-radius: 999px;
    background: var(--text); color: var(--surface);
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    animation: rx-toast 3.2s var(--ease) both;
}
@keyframes rx-toast {
    0% { opacity: 0; transform: translate(-50%, 16px); }
    10%, 85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, 8px); }
}

/* ---------------------------------------------------------------- motion */
@keyframes rx-fade-in { from { opacity: 0; } }
@keyframes rx-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes rx-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes rx-stage-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes rx-sheet-in { from { opacity: 0; transform: translateY(28px) scale(.98); } }

.rx-stagger > * { animation: rx-rise .5s var(--ease) both; }
.rx-stagger > :nth-child(2) { animation-delay: .05s; }
.rx-stagger > :nth-child(3) { animation-delay: .1s; }
.rx-stagger > :nth-child(4) { animation-delay: .15s; }
.rx-stagger > :nth-child(5) { animation-delay: .2s; }
.rx-stagger > :nth-child(6) { animation-delay: .25s; }
.rx-stagger > :nth-child(n+7) { animation-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
    .rx-shell *, .rx-shell *::before, .rx-shell *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------------------------------------------------------------- portrait totem / narrow */
@media (orientation: portrait), (max-width: 1000px) {
    .rx-task {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
    }
    .rx-receptionist {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        padding: 14px 16px;
        gap: 10px;
    }
    .rx-rcp-head { grid-column: 1 / 2; }
    .rx-voice-bar { grid-column: 2 / 3; grid-row: 1; padding: 0; background: none; box-shadow: none; }
    .rx-voice-bar .rx-mic-text { display: none; }
    .rx-transcript { grid-column: 1 / -1; max-height: 9.5em; mask-image: none; }
    .rx-transcript .rx-bubble:not(:nth-last-child(-n+2)) { display: none; }
    .rx-live-caption { grid-column: 1 / -1; }

    .rx-lang-cards { grid-template-columns: 1fr; }
    .rx-lang-card { flex-direction: row; align-items: center; gap: 16px; }
    .rx-lang-cta { margin: 0 0 0 auto; }
    .rx-quick { grid-template-columns: 1fr 1fr; }

    .rx-split { grid-template-columns: 1fr; }
    .rx-done { grid-template-columns: 1fr; justify-items: center; }
    .rx-done-msg { align-items: center; text-align: center; }
    .rx-ticket { width: min(460px, 100%); }
    .rx-step-label { display: none; }
    .rx-step.is-active .rx-step-label { display: inline; }
    .rx-clock { display: none; }
}

@media (max-width: 760px) {
    .rx-topbar { flex-wrap: wrap; }
    .rx-pill-btn span:not(.rx-aa) { display: none; }
    .rx-form { grid-template-columns: 1fr 1fr; }
    .rx-help-grid { grid-template-columns: 1fr; }
    .rx-doc-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- print: receipt only */
.rx-print-area { display: none; }

@media print {
    body * { visibility: hidden !important; }
    .rx-shell { position: static; display: block; background: #fff; }
    .rx-print-area, .rx-print-area * { visibility: visible !important; }
    .rx-print-area { display: block !important; position: absolute; left: 0; top: 0; width: 80mm; }
}

/* ---------------------------------------------------------------- fast walk-in */
.rx-quick-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 24px -12px var(--accent-glow); }
.rx-quick-primary .rx-quick-icon { background: color-mix(in oklab, #fff 22%, transparent); color: #fff; }
.rx-quick-primary:active { background: var(--accent-strong); }

.rx-doc-banner-compact { padding: 10px 14px; }
.rx-doc-banner-compact .rx-avatar { width: 48px; height: 48px; font-size: calc(var(--fs) * .95); }

.rx-form-quick { grid-template-columns: 1fr 1fr; }
.rx-field-hero { min-height: 104px; }
.rx-field-hero .rx-field-value { font-size: calc(var(--fs) * 2); letter-spacing: -0.01em; }

/* photo capture */
.rx-photo { width: min(520px, 100%); }
.rx-photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: 0; transition: opacity .2s; }
.rx-photo.is-frozen .rx-photo-preview { opacity: 1; z-index: 2; }
.rx-photo.is-frozen .rx-scanner-frame { opacity: 0; }
.rx-photo-count {
    position: absolute; inset: 0; z-index: 5;
    display: grid; place-items: center;
    color: #fff;
    font-size: calc(var(--fs) * 7);
    font-weight: 800;
    text-shadow: 0 6px 30px rgba(0, 0, 0, .45);
    animation: rx-count .8s var(--ease) both;
}
@keyframes rx-count { from { opacity: 0; transform: scale(1.6); } 30% { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.85); } }
.rx-photo-flash { position: absolute; inset: 0; z-index: 6; background: #fff; animation: rx-flash .5s ease-out both; pointer-events: none; }
@keyframes rx-flash { from { opacity: .95; } to { opacity: 0; } }

/* ============================================================================
   Single-column kiosk + bottom voice dock (portrait friendly)
   ============================================================================ */
.rx-workspace { width: min(1180px, 100%); }
.is-task .rx-stage { align-items: stretch; }

/* boot screen: neutral, no hospital colours until settings are loaded */
.rx-boot {
    position: fixed; inset: 0;
    display: grid; place-items: center;
    background: #f4f6f8;
}
@media (prefers-color-scheme: dark) { .rx-boot { background: #0b111b; } }
.rx-boot-spinner {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(100, 116, 139, .2);
    border-top-color: rgba(100, 116, 139, .75);
    animation: rx-spin .8s linear infinite;
}

/* voice dock */
.rx-dock {
    position: relative;               /* no z-index: the aurora joins the shell's stacking context */
    padding: 6px var(--gutter) clamp(12px, 2vh, 22px);
}
.rx-aurora-canvas {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: clamp(260px, 48vh, 620px);
    z-index: -1;                      /* behind the cards, above the page background */
    pointer-events: none;
}
.rx-dock-bar {
    position: relative;
    display: flex; align-items: center; gap: 16px;
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 12px 14px 12px 12px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--surface) 82%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .35), inset 0 0 0 1px color-mix(in oklab, var(--line) 70%, transparent);
}
.rx-dock .rx-mic { width: 68px; height: 68px; }
.rx-dock-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rx-dock-status {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: calc(var(--fs) * .74); font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted);
}
[data-voice="speaking"] .rx-dock-status { color: var(--accent-strong); }
[data-voice="listening"] .rx-dock-status { color: var(--listen); }
[data-voice="thinking"] .rx-dock-status { color: var(--warn); }
[data-voice="speaking"] .rx-dock-status .rx-status-dot { background: var(--accent); animation: rx-blink 1s infinite; }
[data-voice="listening"] .rx-dock-status .rx-status-dot { background: var(--listen); animation: rx-blink .8s infinite; }
[data-voice="thinking"] .rx-dock-status .rx-status-dot { background: var(--warn); animation: rx-blink .5s infinite; }

.rx-dock-say {
    font-size: calc(var(--fs) * 1.12);
    font-weight: 600;
    line-height: 1.35;
    max-height: 4.1em;
    overflow: hidden;
    text-wrap: pretty;
    animation: rx-say-in .45s var(--ease) both;
}
.rx-dock-hint { color: var(--muted); font-weight: 500; }
.rx-dock-thinking { padding: 4px 0; }
.rx-dock-thinking .rx-typing { padding: 6px 0; }
@keyframes rx-say-in { from { opacity: 0; transform: translateY(6px); filter: blur(2px); } }

/* the visitor's words, live, as they speak */
.rx-dock-caption {
    display: none;
    font-size: calc(var(--fs) * 1.2);
    font-weight: 600;
    color: var(--listen);
    line-height: 1.3;
}
.rx-dock-caption.is-visible { display: block; animation: rx-say-in .25s var(--ease) both; }
.rx-dock-caption:not(.is-final)::after {
    content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 4px; vertical-align: -0.12em;
    background: currentColor; animation: rx-blink 1s steps(1) infinite;
}
.rx-dock-caption.is-final { color: var(--text); }
.rx-dock-caption.is-visible ~ .rx-dock-say { display: none; }

.rx-mic-bars { display: flex; align-items: center; gap: 4px; height: 26px; }
.rx-mic-bars i { width: 4px; height: 100%; border-radius: 2px; background: currentColor; animation: rx-bars 1s ease-in-out infinite; }
.rx-mic-bars i:nth-child(2) { animation-delay: .15s; }
.rx-mic-bars i:nth-child(3) { animation-delay: .3s; }
.rx-mic-bars i:nth-child(4) { animation-delay: .45s; }
@keyframes rx-bars { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* welcome: hero is centred, dock sits under it */
.is-welcome .rx-welcome { padding-bottom: 8px; }

/* confirmation */
.rx-done-token {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 14px 22px;
    border-radius: var(--r-lg);
    background: var(--accent-soft);
}
.rx-done-token span { font-size: calc(var(--fs) * .8); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); }
.rx-done-token strong { font-size: calc(var(--fs) * 3.6); font-weight: 900; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.rx-done-token em { font-style: normal; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: calc(var(--fs) * 1.2); color: var(--accent-strong); }

.rx-slip-wrap { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.rx-slip-slot {
    width: calc(100% + 28px); max-width: 360px; height: 14px;
    border-radius: 10px;
    background: linear-gradient(#1f2937, #374151);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, .5);
    position: relative; z-index: 2;
}
.rx-slip {
    margin-top: -7px;
    max-width: 320px;
    width: 100%;
    max-height: 62vh;
    overflow: hidden;
    background: #fff;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .35);
    transform-origin: top center;
    animation: rx-slip-print 1.4s cubic-bezier(.3, .7, .3, 1) both;
    -webkit-mask-image: linear-gradient(#000 calc(100% - 10px), transparent);
            mask-image: linear-gradient(#000 calc(100% - 10px), transparent);
}
.rx-slip .token-slip { width: 100% !important; }
@keyframes rx-slip-print {
    0% { clip-path: inset(0 0 100% 0); transform: translateY(-30px); }
    100% { clip-path: inset(0 0 0 0); transform: none; }
}

@media (orientation: portrait), (max-width: 1000px) {
    .rx-dock-bar { border-radius: var(--r-xl); }
    .rx-done-token { align-items: center; }
    .rx-slip { max-height: 40vh; }
}

/* form submit lives in the always-visible card footer */
.rx-foot-right { align-items: center; }
.rx-workspace-foot .rx-btn-primary { min-height: 60px; padding: 0 30px; }
.rx-workspace-foot .rx-btn-primary:not(:disabled) { animation: rx-ready .5s var(--ease-spring) both; }
@keyframes rx-ready { from { transform: scale(.94); } }
@media (max-height: 1000px) and (orientation: landscape) {
    .rx-kb-key { min-height: clamp(44px, 5.8vh, 62px); }
    .rx-keyboard { padding: 10px; gap: 6px; }
    .rx-kb-row { gap: 6px; }
    .rx-field-hero { min-height: 84px; }
}


/* privacy note when presence detection (auto-greet) uses the camera */
.rx-camera-note {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--surface) 70%, transparent);
    color: var(--muted);
    font-size: calc(var(--fs) * .78);
    font-weight: 600;
}
.rx-camera-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }

/* What the receptionist is saying, revealed word by word in step with her voice */
.rx-dock-speech {
    display: none;
    font-size: calc(var(--fs) * 1.12);
    font-weight: 600;
    line-height: 1.38;
    max-height: 4.2em;
    overflow: hidden;
}
.rx-dock-speech.is-visible { display: block; }
.rx-dock-speech.is-remark { font-style: italic; color: var(--accent-strong); }
/* Words fade in softly as they are spoken; each fade overlaps the next, so the line flows rather than ticks. */
.rx-dock-speech .w {
    opacity: 0;
    filter: blur(4px);
    display: inline-block;
    transform: translateY(6px);
    transition:
        opacity .5s cubic-bezier(.22, .8, .3, 1),
        filter .55s cubic-bezier(.22, .8, .3, 1),
        transform .55s cubic-bezier(.22, .8, .3, 1);
    white-space: pre;
}
.rx-dock-speech .w.on { opacity: 1; filter: blur(0); transform: none; }
.rx-dock-speech.is-visible ~ .rx-dock-say { display: none; }
.rx-dock-caption.is-visible ~ .rx-dock-speech { display: none; }
@media (prefers-reduced-motion: reduce) { .rx-dock-speech .w { transition: none; filter: none; transform: none; } }

/* ---------------------------------------------------------------- system status pill */
.rx-sys-wrap { position: relative; }
.rx-sys {
    display: inline-flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 14px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--muted);
}
.rx-sys-item { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; }
.rx-sys-item i {
    position: absolute; right: -3px; bottom: -2px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 2px var(--surface);
}
.rx-sys-item[data-state="on"] i, .rx-sys-row[data-state="on"] i { background: #16a34a; }
.rx-sys-item[data-state="active"] i, .rx-sys-row[data-state="active"] i { background: #16a34a; animation: rx-sys-pulse 1.2s ease-out infinite; }
.rx-sys-item[data-state="warn"] i, .rx-sys-row[data-state="warn"] i { background: #f59e0b; }
.rx-sys-item[data-state="error"] i, .rx-sys-row[data-state="error"] i { background: #dc2626; }
.rx-sys-item[data-state="error"] { color: #dc2626; }
.rx-sys-item[data-state="active"], .rx-sys-item[data-state="on"] { color: var(--text); }
@keyframes rx-sys-pulse { 0% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 2px rgba(22, 163, 74, .5); } 100% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 9px rgba(22, 163, 74, 0); } }

.rx-sys-pop {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 40;
    width: min(380px, 90vw);
    padding: 8px;
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    display: none;
}
.rx-sys-pop.is-open { display: grid; gap: 2px; animation: rx-say-in .2s var(--ease) both; }
.rx-sys-row { display: grid; grid-template-columns: 12px 92px 1fr; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 12px; font-size: calc(var(--fs) * .82); }
.rx-sys-row + .rx-sys-row { border-top: 1px solid var(--line); }
.rx-sys-row i { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.rx-sys-row strong { font-weight: 800; }
.rx-sys-row span { color: var(--muted); line-height: 1.35; }
@media (max-width: 760px) { .rx-sys { padding: 0 10px; gap: 6px; } }

/* "Remember me next time?" (returning-patient recognition consent) */
.rx-consent {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    align-items: center;
    width: 100%;
    max-width: 560px;
    padding: 14px 16px;
    border-radius: var(--r-lg);
    background: var(--accent-softer);
    box-shadow: inset 0 0 0 1.5px var(--accent-line);
    animation: rx-rise .45s var(--ease) both;
}
.rx-consent-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--accent); color: var(--on-accent); }
.rx-consent-text { display: flex; flex-direction: column; gap: 2px; }
.rx-consent-text strong { font-size: calc(var(--fs) * 1.05); }
.rx-consent-text span { color: var(--muted); font-size: calc(var(--fs) * .82); line-height: 1.35; }
.rx-consent-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
