/* =========================================================
   APPIFY - STYLES

   One light-first stylesheet. Every colour comes from a token
   in :root, and the dark aurora look only overrides those tokens,
   so the theme toggle can never leave a hard-coded colour behind.

   Order matters: tokens, base, layout, components, then the
   responsive and motion blocks at the end, where the last rule
   with a given specificity wins.
   ========================================================= */

/* =========================================================
   1. DESIGN TOKENS
   ========================================================= */

:root {
    color-scheme: light;

    /* surfaces */
    --bg: #eef5fc;
    --bg-glow-a: rgba(94, 165, 250, .30);
    --bg-glow-b: rgba(45, 212, 191, .22);
    --topbar: rgba(255, 255, 255, .78);
    --panel: rgba(255, 255, 255, .82);
    --surface: #ffffff;
    --surface-2: #f2f7fc;
    --surface-3: #e6eff8;

    /* text */
    --text: #0e2233;
    --text-soft: #35566c;
    --muted: #4e6a7d;

    /* lines + accents */
    --line: rgba(16, 96, 145, .16);
    --line-strong: rgba(16, 96, 145, .30);
    --accent: #0b7fd4;
    --accent-bright: #12a5e8;
    --accent-ink: #ffffff;
    --accent-soft: rgba(11, 127, 212, .10);
    --accent-glow: rgba(18, 165, 232, .35);

    /* semantic */
    --ok: #0f9d63;
    --ok-soft: rgba(15, 157, 99, .12);
    --warn: #b4690e;
    --danger: #d92d3c;
    --danger-soft: rgba(217, 45, 60, .12);

    /* elevation */
    --shadow-sm: 0 2px 8px rgba(16, 60, 96, .07);
    --shadow-md: 0 12px 32px rgba(16, 60, 96, .12);
    --shadow-lg: 0 28px 70px rgba(16, 60, 96, .18);
    --ring: 0 0 0 3px rgba(11, 127, 212, .28);

    --radius: 16px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --speed: .22s;
}

[data-theme="dark"] {
    color-scheme: dark;

    --bg: #050b18;
    --bg-glow-a: rgba(77, 53, 140, .40);
    --bg-glow-b: rgba(14, 107, 132, .30);
    --topbar: rgba(8, 14, 31, .86);
    --panel: rgba(8, 16, 30, .72);
    --surface: rgba(14, 26, 46, .88);
    --surface-2: rgba(20, 38, 62, .70);
    --surface-3: rgba(255, 255, 255, .06);

    --text: #effaff;
    --text-soft: #b6cfe0;
    --muted: #8aa7bb;

    --line: rgba(121, 190, 255, .22);
    --line-strong: rgba(121, 190, 255, .40);
    --accent: #35c8ff;
    --accent-bright: #6fe0ff;
    --accent-ink: #00131b;
    --accent-soft: rgba(53, 200, 255, .14);
    --accent-glow: rgba(47, 216, 255, .38);

    --ok: #5bf0bd;
    --ok-soft: rgba(91, 240, 189, .12);
    --warn: #ffc14d;
    --danger: #ff7a86;
    --danger-soft: rgba(255, 122, 134, .14);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-md: 0 14px 38px rgba(0, 3, 18, .45);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
    --ring: 0 0 0 3px rgba(53, 200, 255, .35);
}

/* =========================================================
   2. BASE
   ========================================================= */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse at 14% 6%, var(--bg-glow-a), transparent 46%),
        radial-gradient(ellipse at 88% 58%, var(--bg-glow-b), transparent 52%),
        var(--bg);
    background-attachment: fixed;
    overflow-x: hidden;
    transition: background-color .35s var(--ease), color .35s var(--ease);
}

button,
input,
select {
    font-family: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
}

:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 3px;
}

/* =========================================================
   3. LAYOUT
   ========================================================= */

.app {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 72px;
    padding: 0 30px;
    background: var(--topbar);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(20px);
    transition: background-color .35s var(--ease), border-color .35s var(--ease);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    color: var(--accent-ink);
    font-weight: 900;
    letter-spacing: 1px;
    box-shadow: var(--shadow-sm);
}

.brand-info {
    min-width: 0;
}

.brand-name {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 3px;
}

.brand-subtitle {
    margin-top: 3px;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--muted);
}

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

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--ok);
    white-space: nowrap;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.main {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(350px, 1fr) minmax(430px, 520px);
    min-height: calc(100vh - 72px);
}

/* =========================================================
   4. STAGE + TELEMETRY
   ========================================================= */

.robot-section {
    position: relative;
    min-width: 0;
    min-height: 500px;
}

.robot-container {
    position: absolute;
    inset: 0;
}

.robot-info {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

.robot-name {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--accent);
    text-shadow: 0 2px 18px var(--accent-glow);
}

.robot-status {
    margin-top: 5px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--muted);
}

.stage-hud {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 172px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

.hud-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hud-chip {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--line-strong);
    border-radius: 20px;
}

.hud-fps {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.hud-meter label {
    display: block;
    margin-bottom: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--muted);
}

.meter-track {
    height: 5px;
    overflow: hidden;
    background: var(--surface-3);
    border-radius: 3px;
}

.meter-fill {
    width: 20%;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), #22c58b);
    transition: width .18s cubic-bezier(.4, 0, .2, 1);
}

.view-buttons {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 5;
    display: flex;
    gap: 6px;
}

.view-buttons button {
    padding: 7px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease),
        background-color var(--speed) var(--ease);
}

.view-buttons button:hover {
    color: var(--accent);
    border-color: var(--line-strong);
}

.view-buttons button.active {
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    border-color: transparent;
    box-shadow: 0 4px 14px var(--accent-glow);
}

/* =========================================================
   5. ASSISTANT PANEL + CONSOLE
   ========================================================= */

.assistant-panel {
    padding: 25px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    background: var(--panel);
    border-left: 1px solid var(--line);
    backdrop-filter: blur(20px);
    transition: background-color .35s var(--ease), border-color .35s var(--ease);
}

.console-window {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    transition: background-color .35s var(--ease), border-color .35s var(--ease);
}

.console-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.console-dots {
    display: flex;
    gap: 5px;
}

.console-dots i {
    width: 8px;
    height: 8px;
    background: var(--line-strong);
    border-radius: 50%;
}

.console-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
}

.console-hint {
    margin-left: auto;
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--muted);
}

.console-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

/* =========================================================
   6. SPEECH BUBBLE
   ========================================================= */

.speech-card {
    position: relative;
    padding: 18px 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.speech-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent);
}

.speech-label .dot {
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

.assistant-message {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    overflow-wrap: anywhere;
}

.assistant-message.is-streaming::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    vertical-align: text-bottom;
    background: var(--accent);
    animation: caret 1s steps(2, jump-none) infinite;
}

@keyframes caret {
    50% { opacity: 0; }
}

.user-message {
    min-height: 20px;
    margin: 0 3px;
    font-size: 12px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* =========================================================
   7. SERVICES
   ========================================================= */

.service-panel {
    margin-top: 2px;
}

.panel-title {
    margin-bottom: 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--muted);
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.service-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px;
    overflow: hidden;
    text-align: left;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease),
        background-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.service-button::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

.service-button:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.service-button:hover::before {
    opacity: .5;
}

.service-icon {
    flex: none;
    font-size: 25px;
    transition: transform .25s var(--ease);
}

.service-content {
    flex: 1;
    min-width: 0;
}

.service-content strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.service-content small {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: var(--muted);
}

.service-arrow {
    flex: none;
    margin-left: auto;
    font-size: 16px;
    line-height: 1;
    color: var(--accent);
    opacity: .6;
    transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.service-button:hover .service-arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* The chosen service stays visible and clearly framed. */

.service-button.selected {
    transform: translateY(-2px);
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    border-color: transparent;
    box-shadow: 0 10px 26px var(--accent-glow);
}

.service-button.selected::before {
    opacity: 0;
}

.service-button.selected .service-content small,
.service-button.selected .service-arrow {
    color: var(--accent-ink);
    opacity: .85;
}

.service-button.selected .service-icon {
    transform: scale(1.12);
}

/* =========================================================
   8. BOOKING
   ========================================================= */

.booking-panel {
    margin-top: 10px;
    padding: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.booking-panel label {
    display: block;
    margin: 11px 0 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--muted);
}

.booking-panel input,
.booking-panel select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.booking-panel input:focus,
.booking-panel select:focus {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.booking-panel input[readonly] {
    background: var(--surface-3);
    color: var(--text-soft);
}

/* =========================================================
   9. CONTROLS
   ========================================================= */

.controls {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.mic-button {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    border-radius: 14px;
    box-shadow: 0 8px 22px var(--accent-glow);
    transition: filter var(--speed) var(--ease), transform var(--speed) var(--ease),
        background var(--speed) var(--ease);
}

.mic-button:hover {
    filter: brightness(1.06);
}

.mic-button.listening {
    background: linear-gradient(135deg, #ff5f72, #ff9a61);
    animation: micPulse 1.1s infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 95, 114, .45); }
    50% { box-shadow: 0 0 26px 6px rgba(255, 95, 114, .28); }
}

.secondary-button {
    height: 52px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
        border-color var(--speed) var(--ease);
}

.secondary-button:hover {
    color: var(--accent);
    border-color: var(--line-strong);
}

.mic-status {
    min-height: 14px;
    margin-top: 10px;
    font-size: 11px;
    text-align: center;
    color: var(--muted);
}

.mic-status.is-ai {
    color: var(--accent);
    font-weight: 700;
}

/* =========================================================
   10. TEXT CHAT
   ========================================================= */

.chat-row {
    display: flex;
    gap: 8px;
}

.chat-row input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.chat-row input:focus {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.chat-row input::placeholder {
    color: var(--muted);
    opacity: .75;
}

.send-button {
    padding: 12px 18px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    border-radius: 12px;
    box-shadow: 0 6px 18px var(--accent-glow);
    transition: filter var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.send-button:hover {
    filter: brightness(1.07);
}

/* =========================================================
   11. WIZARD
   ========================================================= */

.wizard-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 14px;
}

.wizard-step {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 10px;
    overflow: hidden;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    white-space: nowrap;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease),
        border-color var(--speed) var(--ease);
}

.wizard-step i {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0;
    background: var(--surface-3);
    border-radius: 50%;
    transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.wizard-step.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--line-strong);
}

.wizard-step.active i {
    color: var(--accent-ink);
    background: var(--accent);
}

.wizard-step.done {
    color: var(--ok);
    background: var(--ok-soft);
    border-color: transparent;
}

.wizard-step.done i {
    color: #fff;
    background: var(--ok);
}

.wizard-pane {
    animation: wizard-in .32s var(--ease) both;
}

@keyframes wizard-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.99);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.wizard-nav {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.wizard-nav .confirm-button {
    flex: 1;
    width: auto;
    margin-top: 0;
}

.wizard-back {
    height: 46px;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease),
        transform var(--speed) var(--ease);
}

.wizard-back:hover {
    color: var(--accent);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

/* =========================================================
   12. BUTTONS
   ========================================================= */

.confirm-button {
    width: 100%;
    height: 46px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    border-radius: 12px;
    box-shadow: 0 8px 20px var(--accent-glow);
    transition: filter var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.confirm-button:hover {
    filter: brightness(1.07);
}

/* =========================================================
   13. CONFIRMATION CARD (inline, not a modal)
   ========================================================= */

.confirmation {
    display: block;
}

.confirmation-card {
    width: 100%;
    padding: 24px;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    animation: wizard-in .34s var(--ease) both;
}

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    background: var(--ok);
    border-radius: 50%;
    box-shadow: 0 8px 20px var(--ok-soft);
}

.confirmation-card h2 {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 900;
}

.confirmation-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-soft);
    overflow-wrap: anywhere;
}

/* =========================================================
   14. AI STATUS + THEME
   ========================================================= */

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 5px 11px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    white-space: nowrap;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.ai-badge .dot {
    flex: none;
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.ai-badge.is-offline {
    color: var(--muted);
}

.ai-badge.is-busy .dot {
    animation: caret .8s steps(2, jump-none) infinite;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 17px;
    line-height: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.theme-toggle:hover {
    transform: translateY(-1px) rotate(-8deg);
    border-color: var(--line-strong);
}

.hidden {
    display: none !important;
}

/* =========================================================
   15. TOUCH, FOCUS AND MOTION PREFERENCES
   ========================================================= */

.service-button,
.mic-button,
.secondary-button,
.send-button,
.confirm-button,
.wizard-back,
.view-buttons button,
.theme-toggle {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.service-button:active,
.mic-button:active,
.secondary-button:active,
.send-button:active,
.confirm-button:active,
.wizard-back:active,
.view-buttons button:active,
.theme-toggle:active {
    transform: scale(.985);
}

.service-button.selected:active {
    transform: translateY(-2px) scale(.99);
}

/* Hover effects only apply where a real pointer exists. */

@media (hover: none) {

    .service-button:hover,
    .service-button.selected {
        transform: none;
    }

    .service-button:hover::before {
        opacity: 0;
    }

    .service-button.selected::before {
        opacity: 0;
    }

    .service-button:hover .service-arrow {
        transform: none;
        opacity: .6;
    }

    .mic-button:hover {
        filter: none;
    }

    .wizard-back:hover {
        transform: none;
    }

    .view-buttons button:hover,
    .theme-toggle:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .wizard-pane,
    .confirmation-card {
        animation: none;
    }

}

/* =========================================================
   16. RESPONSIVE
   ========================================================= */

/* --- tablet + phone: one column, sticky top bar --- */

@media (max-width: 900px) {

    .main {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .robot-section {
        height: clamp(280px, 44vh, 420px);
        min-height: 280px;
    }

    .assistant-panel {
        padding: 16px 14px calc(22px + env(safe-area-inset-bottom, 0px));
        overflow: visible;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    /* Sticky bar + notch padding, no expensive blur. */

    .topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        height: auto;
        min-height: 58px;
        padding:
            calc(9px + env(safe-area-inset-top, 0px))
            calc(14px + env(safe-area-inset-right, 0px))
            9px
            calc(14px + env(safe-area-inset-left, 0px));
        background: var(--topbar);
        backdrop-filter: none;
    }

    .console-window {
        border-radius: 18px;
    }

    .console-body {
        gap: 12px;
        padding: 14px;
    }

    .speech-card {
        padding: 15px;
    }

    .booking-panel {
        padding: 15px;
    }

    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .service-button {
        min-height: 78px;
        padding: 10px;
        gap: 9px;
    }

    .service-icon {
        font-size: 22px;
    }

    .service-content strong {
        font-size: 12px;
    }

    .service-content small {
        margin-top: 3px;
        font-size: 11px;
    }

    .robot-name {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .robot-info {
        bottom: 18px;
    }

}

/* --- hide the meters on small screens, keep the chip --- */

@media (max-width: 560px) {

    .stage-hud {
        width: auto;
        padding: 9px 11px;
    }

    .hud-meter {
        display: none;
    }

    .view-buttons button {
        padding: 6px 7px;
        font-size: 9px;
    }

}

/* --- small phones --- */

@media (max-width: 500px) {

    .console-hint {
        display: none;
    }

    .wizard-steps {
        gap: 5px;
    }

    .wizard-step {
        padding: 7px;
        gap: 5px;
        font-size: 8px;
        letter-spacing: 1px;
    }

    .wizard-step i {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }

    .wizard-nav {
        gap: 6px;
    }

    .wizard-back {
        padding: 0 12px;
        letter-spacing: 1px;
    }

    .brand-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 13px;
    }

    .brand-name {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .brand-subtitle {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .online-status {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .service-button {
        min-height: 64px;
    }

    .assistant-message {
        font-size: 14px;
    }

    .controls {
        flex-direction: column;
        gap: 8px;
    }

    .secondary-button {
        width: 100%;
    }

    .send-button {
        padding: 12px 14px;
        letter-spacing: 1px;
    }

    .stage-hud {
        top: 10px;
        left: 10px;
    }

    .view-buttons {
        right: 8px;
        bottom: 8px;
        gap: 4px;
    }

    .view-buttons button {
        padding: 6px 8px;
        font-size: 9px;
        letter-spacing: 1px;
    }

}

@media (max-width: 430px) {

    .brand-subtitle {
        display: none;
    }

    .ai-badge {
        padding: 6px;
    }

    .ai-badge span {
        display: none;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

}

/* --- phone on its side: keep the stage from eating the screen --- */

@media (max-width: 900px) and (max-height: 520px) {

    .robot-section {
        height: 240px;
        min-height: 220px;
    }

}

/* --- desktop: wider console, roomier padding --- */

@media (min-width: 1280px) {

    .main {
        grid-template-columns: minmax(420px, 1fr) minmax(460px, 560px);
    }

    .assistant-panel {
        padding: 28px 30px;
    }

}

/* --- large desktop --- */

@media (min-width: 1700px) {

    .main {
        grid-template-columns: minmax(560px, 1fr) minmax(520px, 640px);
    }

    .assistant-message {
        font-size: 16px;
    }

    .service-button {
        min-height: 80px;
    }

}

/* --- short desktop windows (laptops): keep the robot visible --- */

@media (min-width: 901px) and (max-height: 700px) {

    .robot-section {
        min-height: 420px;
    }

    .assistant-panel {
        padding: 18px;
    }

}
