@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-chassis: #06070a;
    --panel-bg: #0c0e14;
    --panel-card: #121520;
    --border-metal: #1a2030;
    --border-tech: #252d44;
    --border-glow: #384568;

    --neon-carmine: #ff1754;
    --carmine-glow: rgba(255, 23, 84, 0.45);
    --carmine-dark: #660a22;

    --neon-cyan: #00f2fe;
    --cyan-glow: rgba(0, 242, 254, 0.4);
    --cyan-dark: #005a66;

    --neon-amber: #ffd32a;
    --amber-glow: rgba(255, 211, 42, 0.35);
    --neon-green: #05c46b;
    --green-glow: rgba(5, 196, 107, 0.35);

    --text-main: #edf2f7;
    --text-muted: #8391a3;
    --text-dim: #4d596c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-chassis);
    color: var(--text-main);
}

#main {
    height: 100%;
}

#app-grid {
    display: grid;
    grid-template-columns: 26vw 1fr;
    grid-template-rows: 7.2vh 1fr 3vh;
    height: 100%;
    background-color: var(--bg-chassis);
    background-image: 
        linear-gradient(rgba(26, 32, 48, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 32, 48, 0.2) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* ==========================================================================
   Top Telemetry HUD (Katsuhiro Otomo Laboratory Instrumentation)
   ========================================================================== */
header {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, #0f121a 0%, #090a0f 100%);
    border-bottom: 2px solid var(--border-tech);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5vw;
    font-family: 'Chakra Petch', sans-serif;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.7);
    z-index: 100;
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 0.6vw;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: max-content;
}

.hud-logo {
    width: 2.8vh;
    height: 2.8vh;
    min-width: 22px;
    min-height: 22px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 0 6px var(--carmine-glow));
}

.hud-brand-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.9vh;
    letter-spacing: 0.08em;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
}

.hud-kanji {
    color: var(--neon-carmine);
    text-shadow: 0 0 8px var(--carmine-glow);
    font-weight: 900;
    margin: 0 1px;
}

.hud-sim {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--cyan-glow);
    font-weight: 700;
}

/* Seletor de Especialidades / Abas de Laboratório */
.lab-tabs {
    display: flex;
    gap: 6px;
    background: rgba(8, 10, 15, 0.7);
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-tech);
    margin: 0 1vw;
}

.lab-tab {
    background: #131722;
    color: #8392a5;
    border: 1px solid #23293a;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 1.3vh;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Chakra Petch', sans-serif;
}

.lab-tab:hover {
    background: #1c2233;
    color: #ffffff;
    border-color: var(--neon-cyan);
}

.lab-tab.active {
    background: rgba(0, 242, 254, 0.15);
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.lab-tab.active.pulmo {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.25);
}

.lab-tab.active.nefro {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
    border-color: #f39c12;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.25);
}

/* Pulmo Lab e Espirometria */
.btn-spiro-trigger {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
    border: 1px solid #2ecc71;
    color: #2ecc71;
    padding: 0.8vh 1vw;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.4vh;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 0 6px rgba(46, 204, 113, 0.4);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.15);
    width: 100%;
    margin-bottom: 1vh;
}

.btn-spiro-trigger:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.4) 0%, rgba(0, 242, 254, 0.4) 100%);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
    transform: translateY(-1px);
}

.btn-spiro-trigger.active {
    background: rgba(255, 23, 84, 0.25);
    border-color: var(--neon-carmine);
    color: var(--neon-carmine);
    animation: spiroPulse 1s infinite alternate;
}

@keyframes spiroPulse {
    from { box-shadow: 0 0 4px rgba(255, 23, 84, 0.4); }
    to { box-shadow: 0 0 16px rgba(255, 23, 84, 0.8); }
}

.spiro-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 0.8vh;
}

.spiro-card {
    background: #0d1117;
    border: 1px solid var(--border-tech);
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spiro-card-title {
    font-size: 1.2vh;
    color: var(--text-muted);
    font-family: 'Chakra Petch', sans-serif;
}

.spiro-card-val {
    font-size: 1.6vh;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--neon-cyan);
}

.spiro-diag {
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 1.25vh;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 4px;
}

.spiro-diag.normal {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

.spiro-diag.obstrutivo {
    background: rgba(255, 23, 84, 0.15);
    border: 1px solid var(--neon-carmine);
    color: #ff6b81;
}

.spiro-diag.restritivo {
    background: rgba(255, 211, 42, 0.12);
    border: 1px solid var(--neon-amber);
    color: #ffd32a;
}

.spiro-vol-table {
    width: 100%;
    font-size: 1.25vh;
    font-family: 'JetBrains Mono', monospace;
    border-collapse: collapse;
    margin-top: 4px;
}

.spiro-vol-table tr {
    border-bottom: 1px solid #161b22;
}

.spiro-vol-table td {
    padding: 4px 6px;
}

.spiro-vol-table td:last-child {
    text-align: right;
    color: var(--neon-cyan);
    font-weight: bold;
}

.hud-badge {
    font-size: 1.1vh;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 0.2vh 0.4vw;
    border-radius: 2px;
    letter-spacing: 0.05em;
    margin-left: 0.4vw;
    text-shadow: 0 0 4px var(--cyan-glow);
}

.hud-metrics {
    display: flex;
    align-items: center;
    gap: 0.8vw;
    overflow-x: auto;
    flex-shrink: 1;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-tech) transparent;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 0.4vw;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.45vh;
    font-weight: 600;
    color: var(--text-muted);
    background: #08090d;
    border: 1px solid var(--border-tech);
    padding: 0.5vh 0.7vw;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.hud-item span {
    font-family: 'JetBrains Mono', monospace;
    color: var(--neon-cyan);
    font-weight: 700;
    font-size: 1.6vh;
    text-shadow: 0 0 6px var(--cyan-glow);
}

/* ==========================================================================
   Sidebar Controls (Modular Rack Panel)
   ========================================================================== */
aside {
    background: linear-gradient(90deg, rgba(12, 14, 20, 0.96) 0%, rgba(9, 10, 15, 0.98) 100%);
    border-right: 2px solid var(--border-tech);
    padding: 1.6vh 1.2vw;
    display: flex;
    flex-direction: column;
    gap: 1.4vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-tech) var(--bg-chassis);
}

aside::-webkit-scrollbar {
    width: 6px;
}
aside::-webkit-scrollbar-track {
    background: var(--bg-chassis);
}
aside::-webkit-scrollbar-thumb {
    background: var(--border-tech);
    border-radius: 3px;
}
aside::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* Sidebar Top Actions (Tactical Switch & Emergency Hazard Reset) */
.top-buttons {
    display: flex;
    gap: 0.5vw;
    margin-bottom: 0.5vh;
}

.btn-reset-all {
    flex: 1.3;
    background: repeating-linear-gradient(
        -45deg,
        #8b0d2d,
        #8b0d2d 8px,
        #2a040d 8px,
        #2a040d 16px
    );
    color: #ffffff;
    border: 1px solid var(--neon-carmine);
    padding: 1vh 0.6vw;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.4vh;
    letter-spacing: 0.05em;
    cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    box-shadow: 0 0 10px var(--carmine-glow);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-reset-all:hover {
    background: repeating-linear-gradient(
        -45deg,
        #b8123c,
        #b8123c 8px,
        #3b0613 8px,
        #3b0613 16px
    );
    box-shadow: 0 0 18px var(--neon-carmine);
    transform: translateY(-1px);
}

.btn-reset-all:active {
    transform: translateY(1px);
}

.btn-pause {
    flex: 1.3;
    background: repeating-linear-gradient(
        -45deg,
        #7a5a00,
        #7a5a00 8px,
        #261c02 8px,
        #261c02 16px
    );
    color: #ffffff;
    border: 1px solid var(--neon-amber);
    padding: 1vh 0.6vw;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.4vh;
    letter-spacing: 0.05em;
    cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    box-shadow: 0 0 10px var(--amber-glow);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-pause:hover {
    background: repeating-linear-gradient(
        -45deg,
        #a67c00,
        #a67c00 8px,
        #362804 8px,
        #362804 16px
    );
    box-shadow: 0 0 18px var(--neon-amber);
    transform: translateY(-1px);
}

.btn-pause:active {
    transform: translateY(1px);
}

.btn-resume {
    flex: 1.3;
    background: repeating-linear-gradient(
        -45deg,
        #ffd32a,
        #ffd32a 8px,
        #b8860b 8px,
        #b8860b 16px
    );
    color: #000000;
    border: 1px solid #ffeaa7;
    padding: 1vh 0.6vw;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.4vh;
    letter-spacing: 0.05em;
    cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    box-shadow: 0 0 16px var(--amber-glow);
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    white-space: nowrap;
    animation: pulse-amber 1.5s infinite alternate;
}

.btn-resume:hover {
    box-shadow: 0 0 22px var(--neon-amber);
    transform: translateY(-1px);
}

.btn-resume:active {
    transform: translateY(1px);
}

@keyframes pulse-amber {
    0% { box-shadow: 0 0 8px var(--amber-glow); }
    100% { box-shadow: 0 0 22px rgba(255, 211, 42, 0.9); }
}

.btn-about {
    flex: 0.8;
    background: #121624;
    color: var(--text-main);
    border: 1px solid var(--border-tech);
    padding: 1vh 0.5vw;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.35vh;
    cursor: pointer;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-about:hover {
    border-color: var(--neon-carmine);
    color: #ffffff;
    box-shadow: 0 0 10px var(--carmine-glow);
}

/* Accordion Control Group */
.control-group {
    background: #090a10;
    border: 1px solid var(--border-metal);
    border-left: 3px solid var(--border-tech);
    border-radius: 3px;
    margin-bottom: 0.8vh;
    transition: border-color 0.2s;
}

.control-group[open] {
    border-left-color: var(--neon-cyan);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.control-group summary {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.65vh;
    font-weight: 700;
    color: #ffffff;
    padding: 0.9vh 0.8vw;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.03em;
    background: rgba(18, 21, 32, 0.6);
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.control-group[open] summary {
    border-bottom-color: var(--border-metal);
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--cyan-glow);
}

.control-group summary:hover {
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.05);
}

.slider-container {
    padding: 1vh 0.8vw 1.2vh 0.8vw;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.slider-container:last-child {
    border-bottom: none;
}

.compact-checkbox {
    border-bottom: none !important;
    transition: background 0.15s ease;
    border-radius: 2px;
}

.compact-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.45vh;
    margin-bottom: 0.6vh;
    font-family: 'Chakra Petch', sans-serif;
}

.slider-header span:first-child {
    color: var(--text-main);
    font-weight: 600;
}

.slider-val-tag {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.45vh;
    color: var(--neon-cyan);
    text-shadow: 0 0 4px var(--cyan-glow);
}

/* Precision Industrial Faders */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    margin: 0.4vh 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 0.7vh;
    cursor: pointer;
    background: linear-gradient(to right, var(--track-color, var(--neon-cyan)) var(--val, 0%), #141724 var(--val, 0%));
    border-radius: 2px;
    border: 1px solid #20263a;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

input[type=range]::-webkit-slider-thumb {
    height: 1.9vh;
    width: 1.1vh;
    border-radius: 2px;
    background: linear-gradient(180deg, #e0e6ed 0%, #8895a7 50%, #4a5568 100%);
    border: 1px solid #1a202c;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -0.6vh;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 4px var(--cyan-glow);
    position: relative;
}

input[type=range]::-webkit-slider-thumb:hover {
    background: #ffffff;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.slider-actions {
    display: flex;
    gap: 0.4vw;
    margin-top: 0.4vh;
    justify-content: flex-end;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5vh;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--neon-cyan);
}

.btn-step {
    background: #121520;
    border: 1px solid var(--border-tech);
    color: var(--text-main);
    padding: 0.2vh 0.6vw;
    font-size: 1.3vh;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    cursor: pointer;
    clip-path: polygon(3px 0%, 100% 0%, calc(100% - 3px) 100%, 0% 100%);
    transition: all 0.2s;
}

.btn-step:hover {
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 6px var(--cyan-glow);
}

.help-text {
    font-size: 1.35vh;
    line-height: 1.5;
    color: #c5d1e0;
    background: #050608;
    padding: 1vh 0.8vw;
    border-radius: 2px;
    margin-top: 0.8vh;
    display: none;
    border-left: 3px solid var(--neon-amber);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
}

.help-text.show {
    display: block;
}

/* Checkbox (LED indicator style) */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.6vw;
    padding: 0.6vh 0.8vw;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.45vh;
    cursor: pointer;
    color: var(--text-main);
    user-select: none;
}

.checkbox-item input[type=checkbox] {
    accent-color: var(--neon-cyan);
    width: 1.5vh;
    height: 1.5vh;
    cursor: pointer;
}

/* ==========================================================================
   Main Display: CRT Bezel & Phosphor Grid Oscilloscopes
   ========================================================================== */
main {
    grid-column: 2;
    grid-row: 2;
    padding: 1.4vh 1.2vw;
    display: grid;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 1.4vh;
    overflow: hidden;
    height: 100%;
}

.canvas-row-split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.2vw;
    min-height: 0;
    height: 100%;
}

.canvas-wrapper {
    position: relative;
    background: #020305;
    border: 2px solid var(--border-tech);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.95),
        0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Corner industrial screw accents */
.canvas-wrapper::before {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #3a445d;
    box-shadow: -2px 0 0 #1b202c;
    z-index: 5;
    pointer-events: none;
}

/* CRT Scanlines Overlay (Subtle 80s/90s phosphor monitor scanlines) */
.canvas-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.28) 50%
    );
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 4;
}

body.no-scanlines .canvas-wrapper::after {
    display: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.canvas-label {
    position: absolute;
    top: 0.8vh;
    left: 0.8vw;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.35vh;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.8vw;
    z-index: 10;
    background: rgba(10, 12, 18, 0.85);
    padding: 0.3vh 0.6vw;
    border: 1px solid var(--border-tech);
    clip-path: polygon(5px 0%, 100% 0%, calc(100% - 5px) 100%, 0% 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.canvas-label select {
    background: #090a10;
    color: var(--neon-cyan);
    border: 1px solid var(--border-tech);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.3vh;
    padding: 0.2vh 0.4vw;
    cursor: pointer;
}

/* ==========================================================================
   About Modal
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
}

.modal-content {
    background: #090b12;
    color: var(--text-main);
    width: 82vw;
    max-width: 860px;
    max-height: 85vh;
    padding: 24px;
    border: 2px solid var(--border-tech);
    clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.95), 0 0 15px var(--cyan-glow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-tech);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
    font-family: 'Chakra Petch', sans-serif;
    color: #ffffff;
    font-size: 2.2vh;
    letter-spacing: 0.05em;
}

.btn-close-modal {
    background: var(--neon-carmine);
    color: white;
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: bold;
    font-size: 1.5vh;
    clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
    box-shadow: 0 0 8px var(--carmine-glow);
}

.btn-close-modal:hover {
    background: #ff4375;
}

.modal-body {
    overflow-y: auto;
    padding-right: 12px;
    line-height: 1.6;
    font-size: 1.65vh;
}

/* ==========================================================================
   Bottom Status Footer
   ========================================================================== */
footer {
    grid-column: 1 / -1;
    background: #08090d;
    border-top: 1px solid var(--border-metal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5vw;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3vh;
    color: var(--text-muted);
    user-select: none;
    z-index: 5;
}

.footer-item span {
    color: var(--neon-cyan);
    font-weight: 700;
}

/* ==========================================================================
   Mobile Orientation Alert (Caminho 1: Landscape First)
   ========================================================================== */
.orientation-alert {
    display: none;
}

@media (max-width: 820px) and (orientation: portrait) {
    .orientation-alert {
        display: block;
        position: fixed;
        bottom: 24px;
        left: 14px;
        right: 14px;
        background: rgba(9, 11, 18, 0.96);
        border: 1px solid var(--neon-cyan);
        border-radius: 6px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 14px var(--cyan-glow);
        padding: 12px 14px;
        z-index: 9999;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        font-family: 'Chakra Petch', sans-serif;
        animation: alertSlideUp 0.3s ease-out;
    }

    .orientation-alert-content {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .orientation-icon {
        font-size: 1.8rem;
        flex-shrink: 0;
        line-height: 1;
        animation: rotatePhone 2.5s infinite ease-in-out;
    }

    .orientation-text {
        font-size: 0.84rem;
        color: #e0e6ed;
        line-height: 1.35;
        flex: 1;
    }

    .orientation-text strong {
        color: var(--neon-cyan);
        display: block;
        font-size: 0.88rem;
        margin-bottom: 2px;
    }

    .btn-dismiss-alert {
        background: rgba(255, 23, 84, 0.2);
        border: 1px solid var(--neon-carmine);
        color: #ffffff;
        font-family: 'Chakra Petch', sans-serif;
        font-weight: bold;
        font-size: 0.78rem;
        padding: 6px 10px;
        border-radius: 3px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.2s ease;
    }

    .btn-dismiss-alert:hover {
        background: var(--neon-carmine);
    }
}

@keyframes rotatePhone {
    0%, 15% { transform: rotate(0deg); }
    50%, 65% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

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

