/* ==========================================================================
   LEGENDARY SCAN CHAMBER - Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Floating Scan Button
   -------------------------------------------------------------------------- */
.scan-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 90;
    animation: scan-entrance 0.6s cubic-bezier(0, 0, 0.2, 1) 1.5s both;
}

.scan-float .scan-tooltip {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    border: 1px solid rgba(0, 240, 255, 0.15);
}

.scan-float:hover .scan-tooltip {
    opacity: 1;
}

.scan-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00F0FF;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.scan-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
    transform: scale(1.08);
}

.scan-btn svg {
    width: 22px;
    height: 22px;
}

.scan-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.4);
    animation: scan-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes scan-entrance {
    from { opacity: 0; transform: translateY(20px) scale(0.8); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scan-ping {
    0%   { transform: scale(1); opacity: 0.6; }
    70%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Scan Overlay (Fullscreen)
   -------------------------------------------------------------------------- */
.scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: #0B0F1A;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Matrix code rain canvas */
.scan-matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
}

/* Radial vignette over the matrix */
.scan-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    background: radial-gradient(ellipse at center, transparent 30%, #0B0F1A 75%);
    pointer-events: none;
}

/* Scanline effect */
.scan-overlay::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 240, 255, 0.015) 2px,
        rgba(0, 240, 255, 0.015) 4px
    );
    pointer-events: none;
}

.scan-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.scan-open {
    overflow: hidden;
}

/* Hide navigation HUD completely when scan overlay is open */
body.scan-open .hud {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

/* Delay nav reappearing so close click doesn't hit hamburger */
body:not(.scan-open) .hud {
    transition: opacity 0.3s ease 0.3s, visibility 0s 0.3s;
}

.scan-close {
    position: fixed;
    top: max(1.25rem, env(safe-area-inset-top, 0px));
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    z-index: 1110;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.scan-close:hover {
    color: #00F0FF;
    border-color: rgba(0, 240, 255, 0.3);
}

.scan-close svg {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   Scan Container
   -------------------------------------------------------------------------- */
.scan-container {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Courier New', 'Fira Code', monospace;
    color: rgba(0, 240, 255, 0.75);
}

/* --------------------------------------------------------------------------
   Screens
   -------------------------------------------------------------------------- */
.scan-screen {
    display: none;
    animation: scanFadeIn 0.5s ease forwards;
}

.scan-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@keyframes scanFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Intro Screen
   -------------------------------------------------------------------------- */
.scan-intro-title {
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #00F0FF;
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: scanReveal 0.8s ease 0.3s forwards;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.2), 0 0 80px rgba(0, 240, 255, 0.1);
    text-transform: uppercase;
}

.scan-intro-subtitle {
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #00F0FF;
    margin-bottom: 2.5rem;
    min-height: 1.4em;
    border-right: 2px solid #00F0FF;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    letter-spacing: 0.04em;
}

.scan-intro-subtitle.typing {
    animation: typewriter 2s steps(31) 1.2s forwards, blink 0.6s step-end infinite;
}

@keyframes typewriter {
    to { width: 31ch; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Matrix Loading Bar */
.scan-matrix-bar-wrap {
    width: 100%;
    max-width: 360px;
    opacity: 0;
    transition: opacity 0.4s ease;
    margin-bottom: 2.5rem;
}

.scan-matrix-bar-track {
    height: 6px;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.scan-matrix-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.4), #00F0FF);
    border-radius: 2px;
    transition: width 0.08s linear;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.2);
}

.scan-matrix-bar-pct {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(0, 240, 255, 0.4);
    letter-spacing: 0.1em;
    text-align: center;
}

/* Hidden start button (revealed after bar completes) */
.scan-btn-hidden {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    animation: none;
}

@keyframes scanReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

#scanResult .scan-scores,
#scanResult .scan-profile {
    width: 100%;
    max-width: 480px;
}

.scan-btn-primary {
    display: inline-block;
    padding: 1rem 3rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0B0F1A;
    background: #00F0FF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: center;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2), 0 0 40px rgba(0, 240, 255, 0.1);
    text-decoration: none;
}

.scan-btn-primary.no-delay {
    opacity: 1;
    animation: none;
}

.scan-btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.5), 0 0 60px rgba(0, 240, 255, 0.2);
    transform: translateY(-1px);
}

.scan-btn-secondary {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #00F0FF;
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.scan-btn-secondary:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.5);
}

/* --------------------------------------------------------------------------
   Pre-Scan Form
   -------------------------------------------------------------------------- */
.scan-prescan-title {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #00F0FF;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.scan-prescan-sub {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: rgba(0, 240, 255, 0.4);
    margin-bottom: 2rem;
    letter-spacing: 0.03em;
}

.scan-form-group {
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.scan-form-group label {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #00F0FF;
    margin-bottom: 0.4rem;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
    text-align: center;
}

.scan-form-group input,
.scan-form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #00F0FF;
    text-align: center;
    text-align-last: center;
    -webkit-text-align: center;
    direction: ltr;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.scan-form-group input:focus,
.scan-form-group select:focus {
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.scan-form-group input::placeholder {
    color: rgba(0, 240, 255, 0.2);
}

.scan-form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2300F0FF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.scan-form-group select option {
    background: #0B0F1A;
    color: #fff;
    text-align: center;
}

/* City Autocomplete */
.scan-autocomplete {
    position: relative;
    width: 100%;
}

.scan-autocomplete-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d1220;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 20;
}

.scan-autocomplete-list.open {
    display: block;
}

.scan-autocomplete-item {
    padding: 0.7rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: rgba(0, 240, 255, 0.65);
    cursor: pointer;
    text-align: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.05);
    transition: background 0.15s, color 0.15s;
}

.scan-autocomplete-item:last-child {
    border-bottom: none;
}

.scan-autocomplete-item:hover,
.scan-autocomplete-item.highlighted {
    background: rgba(0, 240, 255, 0.08);
    color: #00F0FF;
}

/* --------------------------------------------------------------------------
   Progress Bar
   -------------------------------------------------------------------------- */
.scan-progress {
    margin-bottom: 2rem;
}

.scan-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.scan-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00F0FF, #00eaff);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.scan-progress-text {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(0, 240, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   Question Screen
   -------------------------------------------------------------------------- */
.scan-pillar-label {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #00F0FF;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.scan-question {
    font-size: 1.05rem;
    font-weight: 400;
    color: rgba(0, 240, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 1.75rem;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.scan-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.scan-option {
    padding: 1rem 1.25rem;
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 4px;
    color: rgba(0, 240, 255, 0.6);
    font-size: 0.85rem;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.scan-option:hover {
    background: rgba(0, 240, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.35);
    color: #00F0FF;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    transform: translateY(-1px);
}

.scan-option.selected {
    background: rgba(0, 240, 255, 0.1);
    border-color: #00F0FF;
    color: #00F0FF;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), inset 0 0 15px rgba(0, 240, 255, 0.05);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* --------------------------------------------------------------------------
   Loading Screen
   -------------------------------------------------------------------------- */
.scan-loading {
    text-align: center;
    padding: 4rem 0;
}

.scan-loading-icon {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(0, 240, 255, 0.15);
    border-top-color: #00F0FF;
    border-radius: 50%;
    animation: scanSpin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes scanSpin {
    to { transform: rotate(360deg); }
}

.scan-loading-text {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: rgba(0, 240, 255, 0.5);
    letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Result Screen
   -------------------------------------------------------------------------- */
.scan-result-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #00F0FF;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4), 0 0 40px rgba(0, 240, 255, 0.15);
}

.scan-result-subtitle {
    font-size: 0.8rem;
    color: rgba(0, 240, 255, 0.35);
    margin-bottom: 2rem;
    letter-spacing: 0.04em;
}

/* Score Grid with Donut Charts (5 items: 3 top + 2 bottom centered) */
.scan-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.scan-score-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 110px;
    flex: 0 0 auto;
}

.scan-score-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.scan-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.scan-score-ring-bg {
    fill: none;
    stroke: rgba(0, 240, 255, 0.06);
    stroke-width: 4;
}

.scan-score-ring-fill {
    fill: none;
    stroke: #00F0FF;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

.scan-score-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #00F0FF;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.scan-score-pillar {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #00F0FF;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.scan-score-label {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: rgba(0, 240, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Profile Section */
.scan-profile {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    margin-bottom: 2.5rem;
}

.scan-profile.visible {
    opacity: 1;
    transform: translateY(0);
}

.scan-profile-label {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(0, 240, 255, 0.4);
    margin-bottom: 0.5rem;
}

.scan-profile-name {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #00F0FF;
    margin-bottom: 1rem;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.5), 0 0 30px rgba(0, 240, 255, 0.2), 0 0 60px rgba(0, 240, 255, 0.1);
}

.scan-profile-summary {
    font-size: 0.82rem;
    line-height: 1.8;
    color: rgba(0, 240, 255, 0.5);
    margin-bottom: 1.5rem;
    text-align: center;
}

.scan-focus-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(0, 240, 255, 0.5);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.scan-focus-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.scan-focus-list li {
    padding: 0.75rem 1rem;
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
    color: rgba(0, 240, 255, 0.55);
    line-height: 1.5;
    text-align: center;
}

.scan-focus-list li::before {
    content: '> ';
    color: #00F0FF;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

/* Result Actions */
.scan-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 320px;
}

.scan-actions .scan-btn-primary,
.scan-actions .scan-btn-secondary {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .scan-container {
        padding: 2rem 1rem;
        min-height: 100dvh;
    }

    .scan-intro-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }

    .scan-intro-subtitle {
        font-size: clamp(0.65rem, 2.8vw, 0.8rem);
    }

    /* Scale typewriter to fit small screens */
    .scan-intro-subtitle.typing {
        animation: typewriter-mobile 2s steps(31) 1.2s forwards, blink 0.6s step-end infinite;
    }

    @keyframes typewriter-mobile {
        to { width: min(31ch, 90vw); }
    }

    .scan-matrix-bar-wrap {
        max-width: 280px;
    }

    .scan-result-title {
        font-size: clamp(1.1rem, 5vw, 1.6rem);
        letter-spacing: 0.08em;
    }

    .scan-result-subtitle {
        font-size: 0.72rem;
    }

    .scan-profile-name {
        font-size: clamp(1.1rem, 5vw, 1.5rem);
    }

    .scan-profile-summary {
        font-size: 0.78rem;
        line-height: 1.7;
    }

    .scan-actions {
        max-width: 280px;
    }

    .scan-btn-primary {
        padding: 0.85rem 2rem;
        font-size: 0.85rem;
    }

    .scan-float {
        bottom: 24px;
        left: -22px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .scan-float.scan-expanded {
        left: 0;
    }

    .scan-btn {
        width: 44px;
        height: 44px;
        border-radius: 0 50% 50% 0;
        padding-left: 20px;
        padding-right: 8px;
    }

    .scan-float.scan-expanded .scan-btn {
        border-radius: 50%;
        padding-left: 0;
        padding-right: 0;
        width: 48px;
        height: 48px;
    }

    .scan-float .scan-tooltip {
        display: none;
    }

    .scan-float .scan-pulse {
        border-radius: 0 50% 50% 0;
    }

    .scan-float.scan-expanded .scan-pulse {
        border-radius: 50%;
    }

    .scan-close {
        top: 0.75rem;
        right: 0.75rem;
    }

    /* Score grid: force 3+2 layout on all phone sizes */
    .scan-scores,
    #scanResult .scan-scores {
        gap: 0.75rem 0.5rem;
        width: calc(3 * 85px + 2 * 0.5rem) !important;
    }

    .scan-score-row {
        width: 85px;
    }

    .scan-score-ring {
        width: 70px;
        height: 70px;
    }

    .scan-score-ring-text {
        font-size: 0.95rem;
    }

    .scan-score-pillar {
        font-size: 0.58rem;
        letter-spacing: 0.1em;
    }

    .scan-score-label {
        font-size: 0.52rem;
    }

    /* Form touch targets */
    .scan-form-group input,
    .scan-form-group select {
        padding: 0.85rem 1rem;
        font-size: 16px; /* Prevents iOS zoom on focus */
        text-align: center;
        text-align-last: center;
        -webkit-text-align: center;
    }

    .scan-prescan-title {
        font-size: 1.1rem;
    }

    /* Question options: bigger touch targets */
    .scan-option {
        padding: 0.9rem 1rem;
        font-size: 0.82rem;
    }

    .scan-question {
        font-size: 0.95rem;
    }

    .scan-progress {
        margin-bottom: 1.5rem;
    }

    /* Tip/focus section */
    .scan-focus-list li {
        font-size: 0.75rem;
        padding: 0.65rem 0.85rem;
    }

    .scan-focus-title {
        font-size: 0.65rem;
    }
}

/* Short viewport fix (small iPhone SE height, landscape, etc.) */
@media (max-height: 700px) {
    .scan-container {
        padding: 3rem 1rem 1.5rem;
    }

    .scan-intro-subtitle {
        margin-bottom: 1.25rem;
    }

    .scan-matrix-bar-wrap {
        margin-bottom: 1.25rem;
    }

    .scan-prescan-sub {
        margin-bottom: 1.25rem;
    }

    .scan-form-group {
        margin-bottom: 0.85rem;
    }

    .scan-progress {
        margin-bottom: 1.25rem;
    }

    .scan-result-subtitle {
        margin-bottom: 1.25rem;
    }

    .scan-scores {
        margin-bottom: 1.5rem;
    }

    .scan-profile {
        margin-bottom: 1.5rem;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .scan-intro-title {
        font-size: 1.5rem;
    }

    .scan-score-row {
        width: 75px;
    }

    .scan-score-ring {
        width: 60px;
        height: 60px;
    }

    .scan-score-ring-text {
        font-size: 0.85rem;
    }

    .scan-scores,
    #scanResult .scan-scores {
        gap: 0.5rem 0.35rem;
        width: calc(3 * 75px + 2 * 0.35rem) !important;
    }

    .scan-score-pillar {
        font-size: 0.52rem;
    }
}
