/**
 * V3 Initial Load Styles
 * 
 * Welcome sequence and screen size modal with brutalist design
 * All spacing follows 6n system
 */

/* Main container */
.v3-initial-load {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background-color: var(--black);
    overflow: hidden;
    cursor: auto !important; /* Ensure cursor is visible on modal */
    transition: opacity 0.6s ease; /* Add transition for fade out */
}

/* ===== WELCOME SEQUENCE ===== */

.v3-welcome-sequence {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1; /* Start visible immediately */
    /* Removed fadeIn animation for instant visibility */
}

.v3-welcome-sequence.animating {
    animation: welcomePulse 4.2s ease-in-out;
}

/* Grid background layers */
.welcome-grid-layer-1,
.welcome-grid-layer-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.welcome-grid-layer-1 {
    background-image: 
        linear-gradient(0deg, var(--darkest) 1px, transparent 1px),
        linear-gradient(90deg, var(--darkest) 1px, transparent 1px);
    background-size: 48px 48px; /* 6n: 8×6 */
    opacity: 0.15;
    animation: gridDrift 20s linear infinite;
}

.welcome-grid-layer-2 {
    background-image: 
        linear-gradient(0deg, var(--darkest) 1px, transparent 1px),
        linear-gradient(90deg, var(--darkest) 1px, transparent 1px);
    background-size: 96px 96px; /* 6n: 16×6 */
    opacity: 0.1;
    animation: gridDrift 30s linear infinite reverse;
}

/* Logo container */
.welcome-logo-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px; /* 6n: 6×6 */
}

.logo-frame {
    position: relative;
    width: 180px; /* 6n: 30×6 */
    height: 180px; /* 6n: 30×6 */
    border: 2px solid var(--dark); /* Subtle border */
    background-color: var(--black);
    display: flex;
    justify-content: center;
    align-items: center;
    clip-path: polygon(
        12px 0, 100% 0, 100% calc(100% - 12px),
        calc(100% - 12px) 100%, 0 100%, 0 12px
    ); /* 6n: 2×6 corners */
}

/* Logo accent corners */
.logo-accent-corner {
    position: absolute;
    width: 24px; /* 6n: 4×6 */
    height: 24px; /* 6n: 4×6 */
    border: 2px solid var(--dark); /* Subtle accent */
    transition: all 2s ease;
    opacity: 0.6;
}

.logo-accent-corner.tl {
    top: -12px; /* 6n: -2×6 */
    left: -12px; /* 6n: -2×6 */
    border-right: none;
    border-bottom: none;
}

.logo-accent-corner.tr {
    top: -12px; /* 6n: -2×6 */
    right: -12px; /* 6n: -2×6 */
    border-left: none;
    border-bottom: none;
}

.logo-accent-corner.bl {
    bottom: -12px; /* 6n: -2×6 */
    left: -12px; /* 6n: -2×6 */
    border-right: none;
    border-top: none;
}

.logo-accent-corner.br {
    bottom: -12px; /* 6n: -2×6 */
    right: -12px; /* 6n: -2×6 */
    border-left: none;
    border-top: none;
}

/* Logo inner content */
.logo-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Logo image */
.logo-image {
    width: 120px; /* 6n: 20×6 */
    height: auto;
    object-fit: contain;
    filter: brightness(1.2); /* Slightly brighten the logo */
}

/* Scanner lines */
.logo-scanner-h,
.logo-scanner-v {
    position: absolute;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--cyan) 50%, 
        transparent 100%);
    opacity: 0.3;
    pointer-events: none;
}

.logo-scanner-h {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
    animation: scanH 3s ease-in-out infinite;
}

.logo-scanner-v {
    width: 1px;
    height: 100%;
    top: 0;
    left: 50%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--cyan) 50%, 
        transparent 100%);
    animation: scanV 3s ease-in-out infinite 1.5s;
}

/* Welcome text */
.welcome-text {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px; /* 6n: 2×6 */
}

.welcome-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-bold);
    color: var(--white);
    text-transform: lowercase;
    letter-spacing: 3px; /* 6n: 0.5×6 */
}

.welcome-subtitle {
    font-family: var(--font-secondary);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    color: var(--light);
    text-transform: uppercase;
    letter-spacing: 6px; /* 6n: 1×6 */
    opacity: 0.7;
}

/* Progress bar */
.welcome-progress {
    position: absolute;
    bottom: 60px; /* 6n: 10×6 */
    left: 50%;
    transform: translateX(-50%);
    width: 240px; /* 6n: 40×6 */
    height: 6px; /* 6n: 1×6 */
    background-color: var(--dark);
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, 
        var(--cyan) 0%, 
        var(--blue) 20%, 
        var(--purple) 40%, 
        var(--magenta) 60%, 
        var(--pink) 80%, 
        var(--darkblue) 100%);
    transition: width 4.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== SCREEN SIZE MODAL ===== */

.v3-screen-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    cursor: auto !important; /* Ensure cursor is visible */
}

.v3-screen-modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

/* START CLEAN-FIX-PHASE8-MODAL-SINGLE-STRUCTURE */
/* Single responsive structure with fluid width and margin collapse */
/* To revert: Delete this block and restore original lines 269-288 */
.modal-content {
    position: relative;

    /* Fluid width with progressive margin collapse via custom properties */
    width: clamp(
        var(--modal-min-width),
        calc(100vw - var(--modal-margin) * 2),
        var(--modal-max-width)
    );
    --modal-margin: 48px; /* Default ample margins (desktop) - overridden in media queries */

    /* Progressive spacing via custom properties (overridden per breakpoint) */
    --modal-padding-v: 42px;  /* Vertical padding */
    --modal-padding-h: 60px;  /* Horizontal padding */
    --section-gap: 36px;      /* Gap between sections */

    /* Vertical constraints — NO scrolling, content must fit viewport */
    max-height: 96vh;
    overflow: hidden;

    /* Visual styling */
    background-color: var(--black);
    border: 2px solid var(--dark); /* Subtle border */
    z-index: 10;
    clip-path: polygon(
        18px 0, 100% 0, 100% calc(100% - 18px),
        calc(100% - 18px) 100%, 0 100%, 0 18px
    ); /* 6n: 3×6 corners */
    box-shadow:
        0 0 30px rgba(0, 0, 0, 0.5); /* More subtle shadow */
    cursor: auto !important;
}
/* END CLEAN-FIX-PHASE8-MODAL-SINGLE-STRUCTURE */

/* Modal corner accents */
.modal-corner-accent {
    position: absolute;
    width: 30px; /* 6n: 5×6 */
    height: 30px; /* 6n: 5×6 */
    border: 2px solid var(--darkest); /* Very subtle corners */
    transition: all 2s ease;
    opacity: 0.4;
}

.modal-corner-accent.tl {
    top: -6px; /* 6n: -1×6 */
    left: -6px; /* 6n: -1×6 */
    border-right: none;
    border-bottom: none;
}

.modal-corner-accent.tr {
    top: -6px; /* 6n: -1×6 */
    right: -6px; /* 6n: -1×6 */
    border-left: none;
    border-bottom: none;
}

.modal-corner-accent.bl {
    bottom: -6px; /* 6n: -1×6 */
    left: -6px; /* 6n: -1×6 */
    border-right: none;
    border-top: none;
}

.modal-corner-accent.br {
    bottom: -6px; /* 6n: -1×6 */
    right: -6px; /* 6n: -1×6 */
    border-left: none;
    border-top: none;
}

/* Modal scanner lines */
.modal-scanner-h,
.modal-scanner-v {
    position: absolute;
    opacity: 0.2;
    pointer-events: none;
}

.modal-scanner-h {
    width: 100%;
    height: 1px;
    top: 0;
    left: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--cyan) 20%, 
        var(--purple) 50%, 
        var(--magenta) 80%, 
        transparent 100%);
    animation: modalScanH 8s linear infinite;
}

.modal-scanner-v {
    width: 1px;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--pink) 20%, 
        var(--blue) 50%, 
        var(--darkblue) 80%, 
        transparent 100%);
    animation: modalScanV 6s linear infinite;
}

/* Modal sections */
.modal-header {
    padding: 42px 60px; /* 6n: 7×6, 10×6 */
    border-bottom: 1px solid var(--dark);
    text-align: left; /* Left-aligned titles (Brutalist alignment) */
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(0, 247, 255, 0.02) 50%,
        transparent 70%);
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-bold);
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 3px; /* 6n: 0.5×6 */
}

.modal-body {
    padding: 48px 60px; /* 6n: 8×6, 10×6 */
    background-image: 
        linear-gradient(0deg, var(--dark) 1px, transparent 1px),
        linear-gradient(90deg, var(--dark) 1px, transparent 1px);
    background-size: 30px 30px; /* 6n: 5×6 */
    background-position: -1px -1px;
}

.modal-body p {
    margin: 0 0 36px 0; /* 6n: 6×6 */
    font-family: var(--font-secondary);
    font-size: var(--font-size-standard);
    color: var(--light);
    line-height: 1.6;
    text-align: left; /* Left-aligned context subtitle */
}

/* Old .device-status / .status-icon / .status-info / .status-text / .status-subtext
   block removed — replaced by .status-check system in CLEAN-FIX-PHASE8-RESPONSIVE-REBUILD.
   See git history for original (lines 420-482 prior to removal). */

/* Modal footer */
.modal-footer {
    padding: 36px 60px; /* 6n: 6×6, 10×6 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--darkest);
    border-top: 1px solid var(--dark);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer !important;
    gap: 12px; /* 6n: 2×6 */
}

.brutalist-checkbox {
    appearance: none;
    width: 24px; /* 6n: 4×6 */
    height: 24px; /* 6n: 4×6 */
    border: 3px solid var(--dark); /* 6n: 0.5×6 */
    background-color: var(--black);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* START CLEAN-FIX-8A-B8-INITLOAD-CHECKBOX-COLOR
   Checkbox checked color: --purple → --light (matches Enter button hover border-color)
   To revert: Search for CLEAN-FIX-8A-B8-INITLOAD-CHECKBOX-COLOR and delete between START/END */
.brutalist-checkbox:checked {
    background-color: var(--light);
    border-color: var(--light);
}
/* END CLEAN-FIX-8A-B8-INITLOAD-CHECKBOX-COLOR */

.brutalist-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--black);
    font-size: var(--font-size-standard);
    font-weight: var(--font-weight-bold);
}

.checkbox-label {
    font-family: var(--font-secondary);
    font-size: var(--font-size-small);
    color: var(--light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Button */
.brutalist-button {
    padding: 18px 48px; /* 6n: 3×6, 8×6 */
    background-color: var(--black);
    color: var(--white);
    border: 2px solid var(--dark); /* Subtle border */
    font-family: var(--font-primary);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 3px; /* 6n: 0.5×6 */
    cursor: pointer !important;
    transition: all 0.3s var(--ease-out);
    clip-path: polygon(
        6px 0, 100% 0, 100% calc(100% - 6px),
        calc(100% - 6px) 100%, 0 100%, 0 6px
    ); /* 6n: 1×6 corners */
}

.brutalist-button:hover {
    background-color: var(--darkest);
    border-color: var(--light);
    color: var(--white);
    transform: translate(-3px, -3px); /* 6n: -0.5×6 */
    box-shadow: 
        6px 6px 0 var(--dark); /* 6n: 1×6 */
}

.brutalist-button:active {
    transform: translate(0, 0);
    box-shadow: none;
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes welcomePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes gridDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(48px, 48px); } /* 6n: 8×6 */
}

@keyframes scanH {
    0%, 100% { top: 20%; opacity: 0; }
    50% { top: 80%; opacity: 0.3; }
}

@keyframes scanV {
    0%, 100% { left: 20%; opacity: 0; }
    50% { left: 80%; opacity: 0.3; }
}

@keyframes modalScanH {
    0% { top: -1px; }
    100% { top: calc(100% + 1px); }
}

@keyframes modalScanV {
    0% { left: -1px; }
    100% { left: calc(100% + 1px); }
}

/* START CLEAN-FIX-PHASE8-RESPONSIVE-REBUILD */
/* ============================================
   PHASE 8A: V3INITIALLOAD RESPONSIVE REBUILD
   ============================================

   Strategy: HEIGHT-FIRST responsive (not width-first).
   The modal's main constraint is vertical space.

   Height Tiers:
   - COMFORTABLE (≥700px): Full spacing, descriptions visible
   - STANDARD (550-699px): Reduced spacing, descriptions hidden
   - COMPACT (400-549px): Minimal spacing, reduced type
   - LANDSCAPE: orientation:landscape + short height → horizontal layout

   Width Handling: Fluid clamp() on .modal-content (base styles)
   with simple margin adjustments at narrow widths.

   Icon System: CSS-drawn device-specific icons with glow effects.

   To revert: Search for CLEAN-FIX-PHASE8-RESPONSIVE-REBUILD
   and delete everything between START and END markers.
   Also revert V3InitialLoad.js icon template changes.
   ============================================ */

/* ============================================
   SECTION 1: STATUS CHECK ICON SYSTEM
   ============================================
   CSS-drawn device-specific icons replacing text ✓/×.
   All icons use percentage-based dimensions for auto-scaling.
   ============================================ */

/* --- Status Check Base (replacing old .device-status) --- */
.status-check {
    display: flex;
    align-items: center;
    gap: 18px; /* 6n: 3×6 */
    padding: 18px; /* 6n: 3×6 */
    background-color: var(--darkest);
    border: 1px solid var(--dark);
    margin-bottom: 12px; /* 6n: 2×6 */
    clip-path: polygon(
        6px 0, 100% 0, 100% calc(100% - 6px),
        calc(100% - 6px) 100%, 0 100%, 0 6px
    ); /* 6n: 1×6 corners */
    transition: border-color 0.3s var(--ease-out);
}

.status-check:last-child {
    margin-bottom: 0;
}

/* Passed state: accent border hint */
.status-check.status-passed {
    border-color: var(--dark);
}

/* Failed/accommodated state: warm subtle background */
.status-check.status-failed {
    background-color: var(--darkest);
    opacity: 0.95;
}

/* --- Icon Container --- */
.status-check-icon {
    width: 54px; /* 6n: 9×6 */
    height: 54px; /* 6n: 9×6 */
    min-width: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid;
    border-radius: 0; /* Brutalist: no rounding */
    flex-shrink: 0;
    position: relative;
    transition: box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

/* Passed icon colors by type */
.status-check.status-passed .status-check-icon[data-type="device"] {
    color: var(--cyan);
    border-color: var(--cyan);
}

.status-check.status-passed .status-check-icon[data-type="engagement"] {
    color: var(--pink);
    border-color: var(--pink);
}

.status-check.status-passed .status-check-icon[data-type="connection"] {
    color: var(--blue);
    border-color: var(--blue);
}

/* Failed/accommodated icon colors — warm, encouraging */
.status-check.status-failed .status-check-icon {
    color: var(--warm);
    border-color: var(--warm);
}

/* --- Icon Shape Base --- */
.status-check-icon .icon-shape {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* START CLEAN-FIX-8A-B8-INITLOAD-ICONS
   Selected: D2 Heavy Frame (device), E2 Crosshair + E5 Tap (engagement), C3 Five Bars (connection)
   Changes: 3px borders, full-opacity sensor bars, weighted crosshair, 5-bar connection
   To revert: Search for CLEAN-FIX-8A-B8-INITLOAD-ICONS and delete everything between START and END markers,
   then restore original from git history (commit ff641a7) */

/* === DEVICE ICONS — D2 Heavy Frame === */

/* XL: Desktop Monitor — heavy landscape rectangle + bold stand */
.status-check-icon[data-type="device"][data-device="xl"] .icon-shape {
    width: 60%;
    height: 48%;
    border: 3px solid currentColor; /* D2: heavy frame (was 2px) */
    background: transparent;
}

.status-check-icon[data-type="device"][data-device="xl"] .icon-shape::before {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 16%; /* D2: bolder stand (was 12%) */
    height: 24%;
    background: currentColor;
}

.status-check-icon[data-type="device"][data-device="xl"] .icon-shape::after {
    content: '';
    position: absolute;
    bottom: -48%;
    left: 50%;
    transform: translateX(-50%);
    width: 56%; /* D2: wider base (was 50%) */
    height: 3px; /* D2: heavier base (was 2px) */
    background: currentColor;
}

/* LG: Laptop — heavy screen + angular keyboard base */
.status-check-icon[data-type="device"][data-device="lg"] .icon-shape {
    width: 56%;
    height: 40%;
    border: 3px solid currentColor; /* D2: heavy frame (was 2px) */
    background: transparent;
}

.status-check-icon[data-type="device"][data-device="lg"] .icon-shape::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 72%;
    height: 4px; /* D2: heavier keyboard (was 3px) */
    background: currentColor;
    clip-path: polygon(4% 0, 96% 0, 100% 100%, 0% 100%);
}

/* MD: Tablet — heavy portrait rectangle + bold sensor bar */
.status-check-icon[data-type="device"][data-device="md"] .icon-shape {
    width: 42%;
    height: 56%;
    border: 3px solid currentColor; /* D2: heavy frame (was 2px) */
    background: transparent;
}

.status-check-icon[data-type="device"][data-device="md"] .icon-shape::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 3px; /* D2: heavier sensor bar (was 2px), full opacity (was 0.6) */
    background: currentColor;
}

/* SM: Large Phone — heavy narrower portrait + bold sensor bar */
.status-check-icon[data-type="device"][data-device="sm"] .icon-shape {
    width: 34%;
    height: 56%;
    border: 3px solid currentColor; /* D2: heavy frame (was 2px) */
    background: transparent;
}

.status-check-icon[data-type="device"][data-device="sm"] .icon-shape::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24%;
    height: 3px; /* D2: heavier sensor bar (was 2px), full opacity (was 0.5) */
    background: currentColor;
}

/* XS: Small Phone — heavy narrowest portrait + bold sensor bar */
.status-check-icon[data-type="device"][data-device="xs"] .icon-shape {
    width: 30%;
    height: 52%;
    border: 3px solid currentColor; /* D2: heavy frame (was 2px) */
    background: transparent;
}

.status-check-icon[data-type="device"][data-device="xs"] .icon-shape::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20%;
    height: 3px; /* D2: heavier sensor bar (was 2px), full opacity (was 0.5) */
    background: currentColor;
}

/* === ENGAGEMENT ICONS — E2 Crosshair (Mouse) + E5 Tap (Touch) === */

/* Mouse/Trackpad: Heavy Crosshair — 3px strokes matching D2 weight */
.status-check-icon[data-type="engagement"][data-status="passed"] .icon-shape {
    width: 44%;
    height: 44%;
}

.status-check-icon[data-type="engagement"][data-status="passed"] .icon-shape::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px; /* Matches D2 heavy frame weight */
    background: currentColor;
    transform: translateY(-50%);
}

.status-check-icon[data-type="engagement"][data-status="passed"] .icon-shape::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 3px; /* Matches D2 heavy frame weight */
    height: 100%;
    background: currentColor;
    transform: translateX(-50%);
}

/* Touch: Solid Tap Square — blunt, direct indicator */
.status-check-icon[data-type="engagement"][data-status="failed"] .icon-shape {
    width: 28%;
    height: 28%;
    background: currentColor;
}

/* === CONNECTION ICONS === */

/* Signal Bars Container */
.status-check-icon[data-type="connection"] .icon-shape {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 56%;
    height: 60%;
}

.status-check-icon[data-type="connection"] .icon-shape .signal-bar {
    flex: 1;
    background: currentColor;
    display: block;
    transition: opacity 0.3s var(--ease-out);
}

/* Fast: All 5 bars active, ascending (C3) */
.status-check-icon[data-type="connection"][data-status="passed"] .icon-shape .signal-bar:nth-child(1) { height: 20%; }
.status-check-icon[data-type="connection"][data-status="passed"] .icon-shape .signal-bar:nth-child(2) { height: 40%; }
.status-check-icon[data-type="connection"][data-status="passed"] .icon-shape .signal-bar:nth-child(3) { height: 60%; }
.status-check-icon[data-type="connection"][data-status="passed"] .icon-shape .signal-bar:nth-child(4) { height: 80%; }
.status-check-icon[data-type="connection"][data-status="passed"] .icon-shape .signal-bar:nth-child(5) { height: 100%; }

/* Limited: First 2 solid, last 3 dimmed (C3 — encouraging, not failure) */
.status-check-icon[data-type="connection"][data-status="failed"] .icon-shape .signal-bar:nth-child(1) { height: 20%; }
.status-check-icon[data-type="connection"][data-status="failed"] .icon-shape .signal-bar:nth-child(2) { height: 40%; }
.status-check-icon[data-type="connection"][data-status="failed"] .icon-shape .signal-bar:nth-child(3) { height: 60%; opacity: 0.25; }
.status-check-icon[data-type="connection"][data-status="failed"] .icon-shape .signal-bar:nth-child(4) { height: 80%; opacity: 0.25; }
.status-check-icon[data-type="connection"][data-status="failed"] .icon-shape .signal-bar:nth-child(5) { height: 100%; opacity: 0.25; }
/* END CLEAN-FIX-8A-B8-INITLOAD-ICONS */

/* START CLEAN-FIX-8A-B8-INITLOAD-GLOW
   Two-level glow: box (.status-check-icon) + shape (.icon-shape)
   Box: outer 18px/0.12, inner 30px/0.18 — ambient container halo
   Shape: outer drop-shadow 36px/0.06 (silhouette), inner 30px/0.02 (screen-glow)
   To revert: Search for CLEAN-FIX-8A-B8-INITLOAD-GLOW and delete between START/END,
   then restore original from git history (commit ff641a7) */

/* === GLOW EFFECTS — BOX LEVEL (.status-check-icon container) === */
/* Outer box-shadow: ambient halo from container border */
/* Inner box-shadow: inward glow filling dark interior */

/* Device: Cyan Box Glow (6n: 18px=3×6, 30px=5×6) */
.status-check.status-passed .status-check-icon[data-type="device"] {
    box-shadow:
        0 0 18px rgba(var(--cyan-rgb), 0.12),
        inset 0 0 30px rgba(var(--cyan-rgb), 0.18);
}

/* Engagement: Pink Box Glow */
.status-check.status-passed .status-check-icon[data-type="engagement"] {
    box-shadow:
        0 0 18px rgba(var(--pink-rgb), 0.12),
        inset 0 0 30px rgba(var(--pink-rgb), 0.18);
}

/* Connection: Blue Box Glow */
.status-check.status-passed .status-check-icon[data-type="connection"] {
    box-shadow:
        0 0 18px rgba(var(--blue-rgb), 0.12),
        inset 0 0 30px rgba(var(--blue-rgb), 0.18);
}

/* === GLOW EFFECTS — SHAPE LEVEL (.icon-shape silhouette) === */
/* Outer: filter: drop-shadow follows rendered pixels (crosshair lines, device border, signal bars) */
/* Inner: box-shadow inset for shapes with visible boxes (device frame screen-glow) */

/* Device: Cyan Shape Glow (6n: 36px=6×6, 30px=5×6) */
.status-check.status-passed .status-check-icon[data-type="device"] .icon-shape {
    filter: drop-shadow(0 0 36px rgba(var(--cyan-rgb), 0.06));
    box-shadow: inset 0 0 30px rgba(var(--cyan-rgb), 0.02);
}

/* Engagement: Pink Shape Glow */
.status-check.status-passed .status-check-icon[data-type="engagement"] .icon-shape {
    filter: drop-shadow(0 0 36px rgba(var(--pink-rgb), 0.06));
    box-shadow: inset 0 0 30px rgba(var(--pink-rgb), 0.02);
}

/* Connection: Blue Shape Glow */
.status-check.status-passed .status-check-icon[data-type="connection"] .icon-shape {
    filter: drop-shadow(0 0 36px rgba(var(--blue-rgb), 0.06));
    box-shadow: inset 0 0 30px rgba(var(--blue-rgb), 0.02);
}

/* All failed/accommodated states: no glow on either level */
.status-check.status-failed .status-check-icon {
    box-shadow: none;
}
.status-check.status-failed .status-check-icon .icon-shape {
    box-shadow: none;
    filter: none;
}
/* END CLEAN-FIX-8A-B8-INITLOAD-GLOW */

/* --- Status Check Info --- */
.status-check-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.status-check-label {
    font-family: var(--font-primary);
    font-size: var(--font-size-standard);
    font-weight: var(--font-weight-bold);
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px; /* 6n: 1×6 */
}

.status-check-description {
    font-family: var(--font-secondary);
    font-size: var(--font-size-small);
    color: var(--light);
    opacity: 0.8;
    line-height: 1.4;
}

/* ============================================
   SECTION 2: HEIGHT-FIRST RESPONSIVE SYSTEM
   ============================================
   Primary axis: viewport HEIGHT (does content fit?)
   Secondary axis: viewport WIDTH (margin/padding tuning)
   ============================================ */

/* --- Use CSS custom properties for responsive spacing --- */
.modal-header {
    padding: var(--modal-padding-v) var(--modal-padding-h);
}

.modal-body {
    padding: var(--section-gap) var(--modal-padding-h);
}

.modal-footer {
    padding: var(--section-gap) var(--modal-padding-h);
}

/* --- WIDTH TIER: Narrow screens (reduce margins/padding) --- */
@media (max-width: 599px) {
    .modal-content {
        --modal-margin: 18px; /* 6n: 3×6 */
        --modal-padding-v: 24px; /* 6n: 4×6 */
        --modal-padding-h: 24px; /* 6n: 4×6 */
        --section-gap: 18px; /* 6n: 3×6 */
    }

    /* Welcome splash: scale down logo */
    .logo-frame {
        width: 120px; /* 6n: 20×6 */
        height: 120px;
    }

    .logo-image {
        width: 84px; /* 6n: 14×6 */
    }

    .welcome-logo-container {
        gap: 24px; /* 6n: 4×6 */
    }

    .welcome-progress {
        width: 180px; /* 6n: 30×6 */
        bottom: 36px; /* 6n: 6×6 */
    }

    /* Modal title: strong visual weight maintained, left-aligned (inherits from base) */
    .modal-header h2 {
        font-size: var(--font-xs-huge); /* 2rem/32px — bold presence */
        letter-spacing: 2px;
    }

    .modal-body p {
        font-size: var(--font-xs-standard);
        margin-bottom: 18px; /* 6n: 3×6 */
    }

    /* Footer: stack vertically */
    .modal-footer {
        flex-direction: column-reverse;
        gap: 12px; /* 6n: 2×6 */
    }

    .brutalist-button {
        width: 100%;
        padding: 18px 24px; /* 6n: 3×6, 4×6 */
        text-align: center;
    }

    /* Icon containers: slightly smaller */
    .status-check-icon {
        width: 48px; /* 6n: 8×6 */
        height: 48px;
        min-width: 48px;
    }
}

/* --- WIDTH TIER: SM screens (600-767px) --- */
@media (min-width: 600px) and (max-width: 767px) {
    .modal-content {
        --modal-margin: 36px; /* 6n: 6×6 */
        --modal-padding-v: 30px; /* 6n: 5×6 */
        --modal-padding-h: 36px; /* 6n: 6×6 */
        --section-gap: 24px; /* 6n: 4×6 */
    }

    .modal-header h2 {
        font-size: var(--font-sm-huge); /* 2.25rem/36px */
        letter-spacing: 2px;
    }

    .logo-frame {
        width: 144px; /* 6n: 24×6 */
        height: 144px;
    }

    .logo-image {
        width: 96px; /* 6n: 16×6 */
    }
}

/* --- HEIGHT TIER: STANDARD (550-699px) — Reduce spacing, KEEP descriptions visible --- */
@media (max-height: 699px) {
    .modal-content {
        --modal-padding-v: 18px; /* 6n: 3×6 */
        --section-gap: 12px; /* 6n: 2×6 */
    }

    /* Keep "System compatibility check:" visible — reduce margin */
    .modal-body p {
        margin-bottom: 12px; /* 6n: 2×6 (reduced from 36px) */
    }

    /* Keep descriptions visible — reduce line-height for space */
    .status-check-description {
        font-size: var(--font-size-specialized);
        line-height: 1.2;
    }

    .status-check {
        padding: 12px; /* 6n: 2×6 */
        margin-bottom: 6px; /* 6n: 1×6 */
    }

    .modal-footer {
        padding: 12px var(--modal-padding-h); /* 6n: 2×6 */
    }
}

/* --- HEIGHT TIER: COMPACT (400-549px) — Minimal spacing, hide descriptions --- */
@media (max-height: 549px) {
    .modal-content {
        --modal-padding-v: 12px; /* 6n: 2×6 */
        --modal-padding-h: 18px; /* 6n: 3×6 */
        --section-gap: 6px; /* 6n: 1×6 */
    }

    /* Hide text content to reclaim vertical space */
    .modal-body p {
        display: none; /* Hide "System compatibility check:" */
    }

    .status-check-description {
        display: none; /* Hide check subtitles */
    }

    .modal-header h2 {
        font-size: var(--font-xs-huge); /* 2rem/32px */
        letter-spacing: 1px;
    }

    .status-check-icon {
        width: 42px; /* 6n: 7×6 */
        height: 42px;
        min-width: 42px;
    }

    .status-check-label {
        font-size: var(--font-size-small);
        letter-spacing: 1px;
    }

    /* Footer compact */
    .modal-footer {
        padding: 6px var(--modal-padding-h); /* 6n: 1×6 */
    }

    .brutalist-button {
        padding: 12px 24px; /* 6n: 2×6, 4×6 */
    }

    .checkbox-label {
        font-size: var(--font-size-specialized);
    }

    /* Welcome splash: smaller */
    .logo-frame {
        width: 96px; /* 6n: 16×6 */
        height: 96px;
    }

    .logo-image {
        width: 66px; /* 6n: 11×6 */
    }

    .welcome-logo-container {
        gap: 18px; /* 6n: 3×6 */
    }

    .welcome-progress {
        bottom: 24px; /* 6n: 4×6 */
        width: 144px; /* 6n: 24×6 */
    }
}

/* --- LANDSCAPE MODE: Horizontal layout for short+wide screens --- */
@media (orientation: landscape) and (max-height: 500px) {
    .modal-content {
        --modal-padding-v: 12px; /* 6n: 2×6 */
        --modal-padding-h: 24px; /* 6n: 4×6 */
        --section-gap: 6px; /* 6n: 1×6 */
        max-height: 90vh;
        /* Wider modal for landscape */
        --modal-max-width: 720px; /* 6n: 120×6 */
    }

    .modal-header {
        padding: 12px 24px; /* 6n: 2×6, 4×6 */
    }

    .modal-header h2 {
        font-size: var(--font-sm-huge); /* 2.25rem/36px — maintain visual weight */
        letter-spacing: 2px;
    }

    /* Status checks: horizontal row */
    .modal-body {
        padding: 6px 24px; /* 6n: 1×6, 4×6 */
    }

    .modal-body p {
        display: none; /* Hide label in landscape */
    }

    .status-check-description {
        display: none; /* Hide descriptions in landscape */
    }

    /* Lay out status checks horizontally */
    .modal-body {
        display: flex;
        flex-wrap: wrap;
        gap: 6px; /* 6n: 1×6 */
    }

    .status-check {
        flex: 1 1 30%;
        min-width: 0;
        margin-bottom: 0;
        padding: 12px; /* 6n: 2×6 */
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px; /* 6n: 1×6 */
    }

    .status-check-icon {
        width: 42px; /* 6n: 7×6 */
        height: 42px;
        min-width: 42px;
    }

    .status-check-label {
        font-size: var(--font-size-small);
        letter-spacing: 1px;
    }

    /* Footer: horizontal, compact */
    .modal-footer {
        padding: 6px 24px; /* 6n: 1×6, 4×6 */
        flex-direction: row;
        gap: 12px; /* 6n: 2×6 */
    }

    .brutalist-button {
        padding: 12px 24px; /* 6n: 2×6, 4×6 */
        flex: 1;
    }

    .checkbox-label {
        font-size: var(--font-size-specialized);
    }

    /* Welcome splash: landscape compact */
    .logo-frame {
        width: 96px; /* 6n: 16×6 */
        height: 96px;
    }

    .logo-image {
        width: 66px; /* 6n: 11×6 */
    }

    .welcome-logo-container {
        gap: 12px; /* 6n: 2×6 */
        flex-direction: row;
    }

    .welcome-text {
        text-align: left;
    }

    .welcome-progress {
        bottom: 12px; /* 6n: 2×6 */
        width: 180px; /* 6n: 30×6 */
    }
}

/* END CLEAN-FIX-PHASE8-RESPONSIVE-REBUILD */
