/* ============================================
   Demo Shared Styles — Secure Labs
   Driver.js gold theme, tour completion CTA,
   role switcher, bar chart tooltips
   ============================================ */

/* ========== PAGE TRANSITION ========== */
body {
    animation: pageEnter 0.36s ease forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========== BASE ========== */
:root {
    --color-bg: #05140A;
    --color-gold: #F4A261;
    --demo-surface-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    --demo-surface-shadow-strong: 0 26px 60px rgba(0, 0, 0, 0.28);
    --demo-transition-fast: 0.18s ease;
    --demo-transition-medium: 0.24s ease;
}

body {
    background-color: var(--color-bg);
    color: #FAF8F3;
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.noise-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========== APP CARD SYSTEM ========== */
.app-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: var(--demo-surface-shadow);
    transition: border-color var(--demo-transition-medium), box-shadow var(--demo-transition-medium), filter var(--demo-transition-fast);
}

.app-card:hover {
    border-color: rgba(96, 165, 250, 0.18);
    filter: brightness(1.15);
}

.stat-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    transition: border-color var(--demo-transition-medium), filter var(--demo-transition-fast), box-shadow var(--demo-transition-medium);
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    filter: brightness(1.25);
}

.input-field {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    padding: 8px 12px;
    font-size: 0.875rem;
    width: 100%;
    outline: none;
    box-sizing: border-box;
}

.input-field:focus {
    border-color: #F4A261;
    box-shadow: 0 0 0 4px rgba(244, 162, 97, 0.18);
}

.input-field::placeholder {
    color: #475569;
}

.btn-green {
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 12px;
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(5, 150, 105, 0.18);
    transition: transform var(--demo-transition-fast), background var(--demo-transition-fast), box-shadow var(--demo-transition-fast);
}

.btn-green:hover {
    background: #047857;
    box-shadow: 0 16px 30px rgba(5, 150, 105, 0.24);
    transform: translateY(-1px);
}

.btn-green:active {
    transform: translateY(0);
}

.btn-green:focus-visible,
.input-field:focus-visible,
.toggle-switch:focus-visible,
.demo-focus-ring:focus-visible {
    outline: 2px solid #F4A261;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(244, 162, 97, 0.18);
}

/* ========== BADGES ========== */
.badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    transition: filter 0.2s ease, transform 0.1s ease;
}

.badge:hover {
    filter: brightness(1.15);
}

.badge-green {
    background: rgba(5, 150, 105, 0.15);
    color: #34d399;
}

.badge-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-gray {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

/* ========== DRIVER.JS GOLD THEME ========== */
.driver-popover.securegate-demo-popover {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(244, 162, 97, 0.8);
    border-radius: 14px;
    color: #FAF8F3;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    max-width: 340px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.driver-popover.securegate-demo-popover .driver-popover-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    font-style: italic;
    color: #FAF8F3;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.driver-popover.securegate-demo-popover .driver-popover-description {
    font-size: 0.83rem;
    color: rgba(250, 248, 243, 0.62);
    line-height: 1.65;
    margin-top: 6px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.driver-popover.securegate-demo-popover .driver-popover-progress-text {
    font-size: 0.68rem;
    color: rgba(244, 162, 97, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.driver-popover.securegate-demo-popover .driver-popover-next-btn {
    background: #F4A261;
    color: #05140A;
    border: none;
    border-radius: 999px;
    padding: 7px 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.driver-popover.securegate-demo-popover .driver-popover-next-btn:hover {
    background: #e8944f;
    transform: translateY(-1px);
}

.driver-popover.securegate-demo-popover .driver-popover-prev-btn {
    background: transparent;
    color: rgba(244, 162, 97, 0.55);
    border: 1px solid rgba(244, 162, 97, 0.18);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.driver-popover.securegate-demo-popover .driver-popover-prev-btn:hover {
    background: rgba(244, 162, 97, 0.1);
    color: #F4A261;
}

.driver-popover.securegate-demo-popover .driver-popover-close-btn {
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.2s;
}

.driver-popover.securegate-demo-popover .driver-popover-close-btn:hover {
    color: rgba(255, 255, 255, 0.75);
}

/* Arrow colors — match gradient background */
.driver-popover.securegate-demo-popover .driver-popover-arrow-side-left {
    border-left-color: #0f2918;
}

.driver-popover.securegate-demo-popover .driver-popover-arrow-side-right {
    border-right-color: #0f2918;
}

.driver-popover.securegate-demo-popover .driver-popover-arrow-side-top {
    border-top-color: #0f2918;
}

.driver-popover.securegate-demo-popover .driver-popover-arrow-side-bottom {
    border-bottom-color: #091a0d;
}

/* Highlighted element ring */
.driver-active-element {
    box-shadow:
        0 0 0 2px rgba(244, 162, 97, 0.45),
        0 0 0 6px rgba(244, 162, 97, 0.07) !important;
    border-radius: 10px;
}

.driver-overlay {
    background: transparent !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========== ROLE SWITCHER PILL BAR ========== */
.role-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(5, 20, 10, 0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    padding: 4px 6px;
}

.role-switcher a {
    text-decoration: none;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.3s ease, background 0.3s ease;
    white-space: nowrap;
}

.role-switcher a:hover {
    color: rgba(255, 255, 255, 0.7);
}

.role-switcher a.active {
    color: #05140A;
    background: #F4A261;
    font-weight: 600;
}

/* ========== TOUR COMPLETION CARD ========== */
.completion-card {
    display: none;
    background: rgba(5, 20, 10, 0.62);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(244, 162, 97, 0.22);
    border-radius: 24px;
    box-shadow: var(--demo-surface-shadow-strong), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 30px;
    text-align: center;
    max-width: 480px;
    margin: 36px auto 0;
    animation: completionFadeIn 0.42s ease-out forwards;
}

.completion-card.visible {
    display: block;
}

@keyframes completionFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.completion-card .completion-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(5, 150, 105, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.completion-card .completion-icon .material-symbols-outlined {
    font-size: 28px;
    color: #34d399;
}

.completion-card h3 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.2;
}

.completion-card p {
    color: #94a3b8;
    font-size: 0.875rem;
    margin: 0 0 24px;
    line-height: 1.5;
}

.completion-card .cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.completion-card .cta-row+.cta-row {
    margin-top: 12px;
}

.completion-card .cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 22px;
    background: #F4A261;
    color: #05140A;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 0 16px 30px rgba(244, 162, 97, 0.16);
    transition: transform var(--demo-transition-fast), box-shadow var(--demo-transition-fast), background var(--demo-transition-fast);
}

.completion-card .cta-primary:hover {
    background: #e8944f;
    box-shadow: 0 20px 36px rgba(244, 162, 97, 0.2);
    transform: translateY(-1px);
}

.completion-card .cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 22px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: color var(--demo-transition-medium), border-color var(--demo-transition-medium), background var(--demo-transition-medium), transform var(--demo-transition-fast);
}

.completion-card .cta-secondary:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(244, 162, 97, 0.5);
    transform: translateY(-1px);
}

.completion-card button.cta-secondary {
    font-family: inherit;
    cursor: pointer;
}

.completion-card .cta-primary:focus-visible,
.completion-card .cta-secondary:focus-visible {
    outline: 2px solid #F4A261;
    outline-offset: 3px;
}

/* ========== SHARED ROLE PAGE FRAMING ========== */
.demo-frame-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 20px 16px;
    display: flex;
    justify-content: center;
}

.demo-frame-nav__inner {
    width: min(100%, 980px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 999px;
    background: rgba(5, 20, 10, 0.72);
    border: 1px solid rgba(244, 162, 97, 0.14);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.demo-frame-nav__back,
.demo-frame-nav__brand,
.demo-frame-nav__action,
.demo-embedded-header__action {
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.demo-frame-nav__back,
.demo-frame-nav__brand {
    text-decoration: none;
}

.demo-frame-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
    white-space: nowrap;
}

.demo-frame-nav__back:hover,
.demo-frame-nav__brand:hover {
    color: #F4A261;
}

.demo-frame-nav__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.demo-frame-nav__brand {
    color: #FAF8F3;
    font-family: 'Instrument Serif', serif;
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1;
}

.demo-frame-nav__role {
    margin: 0;
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.demo-frame-nav__action,
.demo-embedded-header__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid rgba(244, 162, 97, 0.24);
    background: rgba(244, 162, 97, 0.12);
    color: #F4A261;
    min-height: 40px;
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.demo-frame-nav__action:hover,
.demo-embedded-header__action:hover {
    background: rgba(244, 162, 97, 0.18);
    border-color: rgba(244, 162, 97, 0.32);
    transform: translateY(-1px);
}

.demo-role-main {
    padding-top: 108px;
}

.demo-embedded-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(5, 20, 10, 0.92);
    border-bottom: 1px solid rgba(244, 162, 97, 0.1);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.demo-embedded-header__action {
    flex-shrink: 0;
}

.demo-embedded-header__action--secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.72);
}

.demo-embedded-header__action--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.demo-embedded-header__label {
    min-width: 0;
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
}

.demo-frame-nav__back:focus-visible,
.demo-frame-nav__brand:focus-visible,
.demo-frame-nav__action:focus-visible,
.demo-embedded-header__action:focus-visible {
    outline: 2px solid #F4A261;
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .demo-frame-nav {
        padding: 12px;
    }

    .demo-frame-nav__inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            'back action'
            'meta meta';
        border-radius: 24px;
        padding: 12px 14px;
    }

    .demo-frame-nav__back {
        grid-area: back;
    }

    .demo-frame-nav__meta {
        grid-area: meta;
        text-align: left;
    }

    .demo-frame-nav__action {
        grid-area: action;
        justify-self: end;
        padding-inline: 12px;
    }

    .demo-frame-nav__brand {
        font-size: 1.2rem;
    }

    .demo-role-main {
        padding-top: 118px;
    }

    .demo-embedded-header {
        padding-inline: 12px;
    }

    .demo-embedded-header__label {
        font-size: 10px;
    }

    .demo-embedded-header__action {
        padding-inline: 12px;
        font-size: 9px;
    }
}

/* ========== BAR CHART TOOLTIP ========== */
.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    position: relative;
    height: 100%;
}

.bar-wrapper .bar {
    background: linear-gradient(to top, #059669, #34d399);
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease, filter 0.2s ease;
    width: 100%;
    cursor: pointer;
}

.bar-wrapper:hover .bar {
    filter: brightness(1.2);
}

.bar-wrapper .bar-tooltip {
    position: absolute;
    top: -8px;
    transform: translateY(-100%);
    background: #0a1f10;
    color: #F4A261;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(244, 162, 97, 0.3);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.bar-wrapper:hover .bar-tooltip {
    opacity: 1;
}

/* ========== INTERACTIVE TOGGLE ========== */
.toggle-switch {
    appearance: none;
    border: none;
    padding: 0;
    background: transparent;
    width: 40px;
    height: 24px;
    display: inline-block;
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.toggle-switch.on {
    background: #059669;
}

.toggle-switch.off {
    background: #475569;
}

.toggle-switch .toggle-knob {
    position: absolute;
    top: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch.on .toggle-knob {
    left: 18px;
}

.toggle-switch.off .toggle-knob {
    left: 2px;
}

/* ========== TOGGLE TOAST ========== */
.toggle-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0a1f10;
    border: 1px solid rgba(244, 162, 97, 0.3);
    color: #34d399;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 9999px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toggle-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== QR SCANNER SUCCESS STATE ========== */
.scan-success-card {
    text-align: center;
    padding: 24px;
    animation: scanSuccessFade 0.5s ease-out forwards;
}

@keyframes scanSuccessFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scan-success-card .success-check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(5, 150, 105, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.scan-success-card .success-check .material-symbols-outlined {
    font-size: 32px;
    color: #34d399;
}

/* ========== OTP FILL ANIMATION ========== */
@keyframes otpBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.otp-box.animating {
    animation: otpBounce 0.35s ease-out forwards;
}

@keyframes verifyPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(5, 150, 105, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
    }
}

.verify-pulse {
    animation: verifyPulse 1s ease-out 1;
}

@media (prefers-reduced-motion: reduce) {
    html,
    html.scroll-smooth {
        scroll-behavior: auto !important;
    }

    body,
    .completion-card,
    .scan-success-card,
    .otp-box.animating,
    .verify-pulse,
    .scan-line,
    .animate-pulse {
        animation: none !important;
    }

    .app-card,
    .stat-card,
    .btn-green,
    .badge,
    .role-switcher a,
    .driver-popover.securegate-demo-popover .driver-popover-next-btn,
    .driver-popover.securegate-demo-popover .driver-popover-prev-btn,
    .driver-popover.securegate-demo-popover .driver-popover-close-btn,
    .completion-card .cta-primary,
    .completion-card .cta-secondary,
    .demo-frame-nav__back,
    .demo-frame-nav__brand,
    .demo-frame-nav__action,
    .demo-embedded-header__action,
    .bar-wrapper .bar,
    .bar-wrapper .bar-tooltip,
    .toggle-switch,
    .toggle-knob,
    .toggle-toast {
        transition: none !important;
    }

    .app-card:hover,
    .stat-card:hover,
    .badge:hover,
    .bar-wrapper:hover .bar {
        filter: none;
    }

    .btn-green:hover,
    .btn-green:active,
    .completion-card .cta-primary:hover,
    .completion-card .cta-secondary:hover,
    .demo-frame-nav__action:hover,
    .demo-embedded-header__action:hover {
        transform: none;
    }

    .toggle-toast,
    .toggle-toast.show {
        transform: translateX(-50%) !important;
    }
}

/* ========== PHONE-NATIVE MODE (body.phone-native) ========== */
body.phone-native {
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 390px;
    margin: 0 auto;
}

body.phone-native .demo-role-main {
    padding-top: 6px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

body.phone-native .app-card {
    border-radius: 10px;
    padding: 12px !important;
    margin-bottom: 10px !important;
}

/* Force 2-col grid on phone (overrides md: breakpoint classes) */
body.phone-native [class*="md:grid-cols-4"],
body.phone-native [class*="md:grid-cols-3"] {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Hide role switcher in embedded mode */
body.phone-native .role-switcher {
    display: none !important;
}

/* Completion card tighter padding */
body.phone-native .completion-card {
    margin: 20px 0 0;
    padding: 20px;
}

/* ── Title bar: tighter in phone context ── */
body.phone-native #app-main>div:first-child {
    margin-bottom: 14px !important;
}

body.phone-native #app-main>div:first-child h1 {
    font-size: 0.72rem !important;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.phone-native #app-main>div:first-child p {
    font-size: 0.65rem !important;
}

/* ── Stat cards: tighter number sizes on phone ── */
body.phone-native .stat-card .text-2xl {
    font-size: 1.35rem !important;
}

/* ── Section headings: slightly smaller on phone ── */
body.phone-native .app-card h2 {
    font-size: 0.78rem !important;
}

/* ── Reduce table cell padding on phone ── */
body.phone-native table td,
body.phone-native table th {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.demo-embedded-header__action .material-symbols-outlined {
    font-size: 13px;
}