/* ==========================================
   QUANTUM NIMBUS CORE DESIGN SYSTEM (VANILLA CSS)
   ========================================== */

:root {
    /* Baseline colors */
    --card-bg: rgba(16, 22, 35, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    
    /* Default theme variables (Disconnected) */
    --primary-glow: #4a5568;
    --primary-glow-rgb: 74, 85, 104;
    --bg-gradient-1: #080c14;
    --bg-gradient-2: #171c26;
    --accent-color: #cbd5e0;
    --device-color: #1a202c;
    --device-ring-glow: 0 0 15px rgba(74, 85, 104, 0.4);
    
    /* Animation constants */
    --transition-speed: 0.5s;
}

/* Theme Skins applied dynamically to body */
body.theme-disconnected {
    --primary-glow: #718096;
    --primary-glow-rgb: 113, 128, 150;
    --bg-gradient-1: #090e17;
    --bg-gradient-2: #182030;
    --accent-color: #cbd5e0;
    --device-color: #242f42;
    --device-ring-glow: 0 0 15px rgba(113, 128, 150, 0.3);
}

body.theme-astro {
    --primary-glow: #a855f7;
    --primary-glow-rgb: 168, 85, 247;
    --bg-gradient-1: #05050f;
    --bg-gradient-2: #1e1136;
    --accent-color: #d8b4fe;
    --device-color: #120b24;
    --device-ring-glow: 0 0 25px rgba(168, 85, 247, 0.8), inset 0 0 12px rgba(168, 85, 247, 0.5);
}

body.theme-frontier {
    --primary-glow: #f59e0b;
    --primary-glow-rgb: 245, 158, 11;
    --bg-gradient-1: #0a0604;
    --bg-gradient-2: #241409;
    --accent-color: #fde68a;
    --device-color: #170e06;
    --device-ring-glow: 0 0 25px rgba(245, 158, 11, 0.8), inset 0 0 12px rgba(245, 158, 11, 0.5);
}

body.theme-nimby {
    --primary-glow: #14b8a6;
    --primary-glow-rgb: 20, 184, 166;
    --bg-gradient-1: #03080e;
    --bg-gradient-2: #0d2a3a;
    --accent-color: #99f6e4;
    --device-color: #0c1c24;
    --device-ring-glow: 0 0 25px rgba(20, 184, 166, 0.8), inset 0 0 12px rgba(20, 184, 166, 0.5);
}

body.theme-warning {
    --primary-glow: #ef4444;
    --primary-glow-rgb: 239, 68, 68;
    --bg-gradient-1: #0f0505;
    --bg-gradient-2: #380a0a;
    --accent-color: #fca5a5;
    --device-color: #240a0a;
    --device-ring-glow: 0 0 30px rgba(239, 68, 68, 0.9), inset 0 0 15px rgba(239, 68, 68, 0.6);
}

/* ==========================================
   GLOBAL RESET & LAYOUT
   ========================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-gradient-1);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-color var(--transition-speed) ease;
}

/* Dynamic Radial Background Glow */
.background-radial-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(var(--primary-glow-rgb), 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
    transition: background var(--transition-speed) ease;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nimbus-symbol {
    font-size: 2.2rem;
    color: var(--primary-glow);
    text-shadow: 0 0 12px var(--primary-glow);
    transition: color var(--transition-speed) ease, text-shadow var(--transition-speed) ease;
}

.logo h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
}

.accent-text {
    color: var(--primary-glow);
    transition: color var(--transition-speed) ease;
}

.badge-container {
    display: flex;
    gap: 0.8rem;
}

.header-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.env-badge {
    background: rgba(255, 255, 255, 0.08);
}

.api-badge {
    background: rgba(var(--primary-glow-rgb), 0.15);
    border-color: rgba(var(--primary-glow-rgb), 0.3);
    color: var(--accent-color);
}

/* ==========================================
   SIMULATOR LAYOUT
   ========================================== */

.simulator-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
    padding: 2rem 4rem;
    z-index: 10;
    flex: 1;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color var(--transition-speed) ease;
}

/* ==========================================
   SMARTPHONE APP MOCKUP
   ========================================== */

.phone-mockup {
    width: 375px;
    height: 720px;
    border-radius: 40px;
    border: 10px solid #2d3748;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #0b0f19;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.phone-notch {
    width: 150px;
    height: 25px;
    background: #2d3748;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 30;
}

.phone-header {
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    z-index: 20;
    background: #0b0f19;
    padding-top: 5px;
}

.phone-screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 1.2rem;
    overflow-y: auto;
    min-height: 0;
}

.phone-screen-content::-webkit-scrollbar {
    display: none; /* Hide scrollbars inside mobile preview */
}

.app-brand {
    padding: 0.5rem 0 0.8rem 0;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
    background: #0b0f19;
    z-index: 15;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sub-brand {
    color: var(--primary-glow);
    transition: color var(--transition-speed) ease;
}

/* App Sections Switcher */
.app-section {
    display: none;
    flex-direction: column;
    flex: 1;
}

.app-section.active {
    display: flex;
}

/* Dynamic Fade transitions */
.dynamic-fade {
    animation: appScreenFade 0.4s ease forwards;
}

@keyframes appScreenFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* BLE Pairing screen */
.ble-section {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.ble-pulse-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-glow);
    border-radius: 50%;
    animation: pulseGlow 2s infinite ease-out;
    opacity: 0;
    box-shadow: 0 0 15px var(--primary-glow);
    transition: border-color var(--transition-speed) ease;
}

.pulse-ring:nth-child(2) {
    animation-delay: 0.8s;
}

.pulse-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(var(--primary-glow-rgb), 0.2);
    border: 2px solid var(--primary-glow);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--primary-glow);
    box-shadow: 0 0 20px rgba(var(--primary-glow-rgb), 0.3);
    transition: border-color var(--transition-speed) ease, background var(--transition-speed) ease;
}

@keyframes pulseGlow {
    0% { transform: scale(0.6); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 0; }
}

.ble-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
    font-family: 'Outfit', sans-serif;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-glow) 0%, rgba(var(--primary-glow-rgb), 0.7) 100%);
    border: none;
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    box-shadow: 0 4px 15px rgba(var(--primary-glow-rgb), 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background var(--transition-speed) ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-glow-rgb), 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.status-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.8rem;
}

/* App Interface Panels */
.app-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 1.1rem;
    margin-bottom: 0.9rem;
}

.card-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 1.2px;
    margin-bottom: 0.6rem;
    display: block;
}

/* Authentication Card */
.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.auth-header .card-label {
    margin-bottom: 0;
}

.auth-badge {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 20px;
}

body.theme-astro .auth-badge, 
body.theme-frontier .auth-badge, 
body.theme-nimby .auth-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
}

.cart-details {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.detail-row .label {
    color: var(--text-secondary);
}

.detail-row .value {
    font-weight: 600;
}

.code-text {
    font-family: monospace;
    font-size: 0.75rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent-color);
}

/* Mode Buttons */
.mode-selectors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.7rem 0.2rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mode-btn.active {
    background: rgba(var(--primary-glow-rgb), 0.12);
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px rgba(var(--primary-glow-rgb), 0.2);
}

.mode-icon {
    font-size: 1.2rem;
}

.mode-name {
    font-size: 0.7rem;
    font-weight: 700;
}

.mode-delta {
    font-size: 0.6rem;
    color: var(--text-secondary);
}

/* Telemetry Grid */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.tel-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tel-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.tel-val {
    font-size: 1rem;
    font-weight: 800;
}

.highlight-val {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(var(--primary-glow-rgb), 0.5);
}

/* Simulator configuration controls inside mobile app */
.sys-settings {
    margin-bottom: 1.5rem;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.toggle-title {
    font-size: 0.8rem;
    font-weight: 600;
}

.toggle-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* Custom switch */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3f4451;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-glow);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.secret-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.75rem;
    margin-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.6rem;
}

.secret-row label {
    color: var(--text-secondary);
}

.secret-row input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.4rem;
    color: white;
    font-family: monospace;
    font-size: 0.7rem;
}

.phone-home-indicator {
    width: 120px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px;
    z-index: 30;
}

/* ==========================================
   PHYSICAL VAPE DEVICE MOCKUP
   ========================================== */

.device-mockup {
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 420px;
}

.device-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-transform: uppercase;
}

/* Vape hardware chassis definition */
.device-chassis {
    width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6));
    margin-bottom: 2rem;
}

/* Cartridge Assembly & Mouthpiece */
.cartridge-assembly {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 75px;
    z-index: 15;
}

.mouthpiece-tip {
    width: 28px;
    height: 16px;
    background: #121315;
    border: 2px solid #2d3748;
    border-bottom: none;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    z-index: 10;
    position: relative;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.1);
}

.cartridge-chamber {
    width: 75px;
    height: 115px;
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Oil Liquid inside cart */
.liquid-fluid {
    width: 100%;
    height: 75%;
    background: linear-gradient(to bottom, #d69e2e 0%, #b7791f 100%);
    border-radius: 2px;
    transition: height 2s ease, opacity var(--transition-speed) ease, background var(--transition-speed) ease;
    opacity: 0; /* Hidden by default when disconnected */
}

/* Display different liquid types based on theme */
body.theme-astro .liquid-fluid {
    opacity: 0.75;
    background: linear-gradient(to bottom, #8b5cf6 0%, #5b21b6 100%);
}

body.theme-frontier .liquid-fluid {
    opacity: 0.75;
    background: linear-gradient(to bottom, #f59e0b 0%, #92400e 100%);
}

body.theme-nimby .liquid-fluid {
    opacity: 0.65;
    background: linear-gradient(to bottom, #2dd4bf 0%, #115e59 100%);
}

body.theme-warning .liquid-fluid {
    opacity: 0.8;
    background: linear-gradient(to bottom, #f87171 0%, #991b1b 100%);
}

/* Smoke vapor simulation particles */
.vapor-clouds-smoke {
    position: absolute;
    bottom: 16px; /* Exits from the top of the mouthpiece tip */
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 20;
    pointer-events: none;
    overflow: visible;
}

/* Base style for individual cloud particles */
.cloud-particle {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.4) 30%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

/* Staggered particle animations for a rich, high-density cloud ejection */
.vapor-clouds-smoke.puffing .p1 { animation: vaporDrift1 1.8s infinite ease-out; animation-delay: 0s; }
.vapor-clouds-smoke.puffing .p2 { animation: vaporDrift2 1.8s infinite ease-out; animation-delay: 0.35s; }
.vapor-clouds-smoke.puffing .p3 { animation: vaporDrift3 1.8s infinite ease-out; animation-delay: 0.7s; }
.vapor-clouds-smoke.puffing .p4 { animation: vaporDrift1 1.8s infinite ease-out; animation-delay: 1.05s; }
.vapor-clouds-smoke.puffing .p5 { animation: vaporDrift2 1.8s infinite ease-out; animation-delay: 1.4s; }

@keyframes vaporDrift1 {
    0% {
        bottom: 0px;
        width: 12px;
        height: 12px;
        opacity: 0;
        transform: translateX(-50%) scale(1);
        filter: blur(1px);
    }
    15% {
        opacity: 0.85;
    }
    100% {
        bottom: 130px;
        width: 130px;
        height: 90px;
        opacity: 0;
        transform: translateX(-75%) scale(2.4); /* drifts left */
        filter: blur(10px);
    }
}

@keyframes vaporDrift2 {
    0% {
        bottom: 0px;
        width: 12px;
        height: 12px;
        opacity: 0;
        transform: translateX(-50%) scale(1);
        filter: blur(1px);
    }
    15% {
        opacity: 0.9;
    }
    100% {
        bottom: 145px;
        width: 140px;
        height: 95px;
        opacity: 0;
        transform: translateX(-25%) scale(2.6); /* drifts right */
        filter: blur(10px);
    }
}

@keyframes vaporDrift3 {
    0% {
        bottom: 0px;
        width: 12px;
        height: 12px;
        opacity: 0;
        transform: translateX(-50%) scale(1);
        filter: blur(1px);
    }
    15% {
        opacity: 0.85;
    }
    100% {
        bottom: 160px;
        width: 150px;
        height: 100px;
        opacity: 0;
        transform: translateX(-50%) scale(2.8); /* drifts straight up and expands larger */
        filter: blur(12px);
    }
}

.cartridge-connector {
    width: 40px;
    height: 10px;
    background: #4a5568;
    position: absolute;
    bottom: 0;
}

/* Walnut/Wood grip accent band */
.accent-band {
    width: 140px;
    height: 28px;
    background: linear-gradient(to bottom, #7a4a28 0%, #4a2812 100%);
    border: 2px solid #2d3748;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    position: relative;
}

.accent-band::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(180deg, transparent, transparent 4px, rgba(0,0,0,0.12) 4px, rgba(0,0,0,0.12) 6px);
    pointer-events: none;
    border-radius: 2px;
}

.wood-grain-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: rgba(255,255,255,0.8);
    letter-spacing: 2.5px;
    text-indent: 2.5px;
    display: inline-block;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Solid Metal Core Chassis */
.device-core {
    width: 140px;
    background: var(--device-color);
    border: 3px solid #4a5568;
    border-top: none;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    padding: 1.1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    transition: background var(--transition-speed) ease;
}

/* High contrast OLED display */
.oled-screen {
    width: 116px;
    height: 90px;
    background: #000;
    border: 2px solid #2d3748;
    border-radius: 8px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.6rem;
    color: #00f0ff;
    text-shadow: 0 0 5px #00f0ff;
    box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.2);
}

.oled-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 0.58rem;
    padding: 0 2px;
}

.oled-main {
    text-align: center;
    margin: 1px 0;
}

.oled-temp-display {
    font-size: 1.4rem;
    font-weight: bold;
    display: inline-flex;
    justify-content: center;
    align-items: flex-start;
    line-height: 1;
}

.oled-unit {
    font-size: 0.7rem;
    margin-left: 2px;
    margin-top: 1px;
}

.oled-target-sub {
    font-size: 0.52rem;
    opacity: 0.8;
    margin-top: 2px;
}

.oled-indicator-dots {
    text-align: center;
    font-size: 0.5rem;
    color: #00ff66;
    text-shadow: 0 0 4px #00ff66;
    letter-spacing: 0.2px;
}

/* Dynamic LED Control Ring */
.led-ring-outer {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1.5px solid #2d3748;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.led-ring-outer:active {
    transform: scale(0.95);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.led-ring-outer[disabled] {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed !important;
}

.led-ring-outer:not([disabled]):hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.led-ring-inner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 4px solid var(--primary-glow);
    box-shadow: var(--device-ring-glow);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    position: relative;
}

/* Glowing overlay effect */
.led-glow-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
}

/* Flashing warning animation for counterfeit */
body.theme-warning .led-ring-inner {
    animation: flashRed 1s infinite alternate;
}

@keyframes flashRed {
    0% { border-color: #ef4444; box-shadow: 0 0 10px #ef4444; }
    100% { border-color: #7f1d1d; box-shadow: 0 0 30px #ef4444, inset 0 0 10px #ef4444; }
}

/* Green toxic skull vapor clouds for counterfeit cartridge warning state */
body.theme-warning .vapor-clouds-smoke {
    background: none;
}
body.theme-warning .cloud-particle {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M20,20 L80,80 M20,80 L80,20' stroke='%2310b981' stroke-width='12' stroke-linecap='round'/><circle cx='20' cy='20' r='8' fill='%2310b981'/><circle cx='80' cy='80' r='8' fill='%2310b981'/><circle cx='20' cy='80' r='8' fill='%2310b981'/><circle cx='80' cy='20' r='8' fill='%2310b981'/><circle cx='50' cy='45' r='22' fill='%2310b981'/><rect x='38' y='55' width='24' height='16' rx='4' fill='%2310b981'/><circle cx='42' cy='43' r='5' fill='%23000000'/><circle cx='58' cy='43' r='5' fill='%23000000'/><polygon points='50,49 47,56 53,56' fill='%23000000'/><line x1='45' y1='63' x2='45' y2='71' stroke='%23000000' stroke-width='2'/><line x1='50' y1='63' x2='50' y2='71' stroke='%23000000' stroke-width='2'/><line x1='55' y1='63' x2='55' y2='71' stroke='%23000000' stroke-width='2'/></svg>") no-repeat center;
    background-size: contain;
    border-radius: 0;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

/* Manual Take Puff button */
.puff-button-container {
    width: 100%;
    padding: 0 12px;
}

.puff-btn {
    width: 100%;
    background: #2d3748;
    color: #718096;
    border: 2px solid #4a5568;
    border-radius: 12px;
    padding: 0.8rem 0.2rem;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.puff-btn:not(:disabled) {
    background: #000;
    color: var(--accent-color);
    border-color: var(--primary-glow);
    box-shadow: 0 4px 12px rgba(var(--primary-glow-rgb), 0.25);
    cursor: pointer;
}

.puff-btn:not(:disabled):hover {
    box-shadow: 0 6px 18px rgba(var(--primary-glow-rgb), 0.4);
    transform: scale(1.02);
}

.puff-btn:not(:disabled):active {
    transform: scale(0.98);
}

.puff-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Simulator controls console */
.console-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 1.2rem;
    width: 100%;
    margin-top: 1rem;
}

.console-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    font-family: 'Outfit', sans-serif;
}

.console-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.cartridge-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.cart-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: white;
    padding: 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.cart-btn:hover {
    background: rgba(255,255,255,0.1);
}

.cart-btn.active {
    background: var(--primary-glow);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(var(--primary-glow-rgb), 0.3);
    font-weight: bold;
}

.custom-nfc-input {
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.console-sublabel {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.nfc-input-row {
    display: flex;
    gap: 0.5rem;
}

#input-nfc-payload {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.6rem;
    color: white;
    font-family: monospace;
    font-size: 0.75rem;
    transition: all 0.3s;
}

#input-nfc-payload:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 8px rgba(var(--primary-glow-rgb), 0.2);
}

.btn-nfc-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    padding: 0 1rem;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nfc-action:hover {
    background: var(--primary-glow);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(var(--primary-glow-rgb), 0.3);
}

.developer-settings {
    margin-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Warning Modal Overlay for PWA Phone Screen */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 40;
    display: none; /* Managed by JS */
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeInModal 0.3s ease-out forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #110808;
    border: 2px solid #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
    border-radius: 24px;
    padding: 1.5rem;
    text-align: center;
    max-width: 320px;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpModal {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.warning-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.8rem;
    animation: pulseWarning 1s infinite alternate;
}

@keyframes pulseWarning {
    0% { transform: scale(1); text-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
    100% { transform: scale(1.1); text-shadow: 0 0 15px rgba(239, 68, 68, 0.9); }
}

.modal-content h3 {
    font-family: 'Outfit', sans-serif;
    color: #fca5a5;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
}

.warning-text {
    font-size: 0.75rem;
    color: #e2e8f0;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    text-align: left;
}

.warning-benefits {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    padding: 0.9rem;
    margin-bottom: 1.4rem;
    text-align: left;
    font-size: 0.75rem;
    line-height: 1.4;
}

.warning-benefits strong {
    color: #fca5a5;
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.warning-benefits ul {
    list-style-type: none;
    margin-top: 0.4rem;
}

.warning-benefits li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 0.4rem;
    color: #cbd5e0;
}

.warning-benefits li:last-child {
    margin-bottom: 0;
}

.warning-benefits li::before {
    content: "•";
    color: #ef4444;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-warning-action {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.btn-warning-action:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-secondary-action {
    background: transparent;
    color: #a0aec0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.7rem;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-action:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================
   FOOTER STYLE
   ========================================== */

.simulator-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 10;
}

/* ==========================================
   TAB NAVIGATION & WELLNESS / MASCOT STYLING
   ========================================== */

/* Tab Views */
.tab-view {
    display: none;
    flex-direction: column;
    width: 100%;
}

.tab-view.active {
    display: flex;
    animation: appScreenFade 0.4s ease forwards;
}

/* Bottom Navigation Bar */
.app-nav-bar {
    display: none; /* Managed by JS, shown when BLE active */
    height: 64px;
    background: rgba(11, 15, 25, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 25;
    display: none; /* Hidden by default until BLE active */
    justify-content: space-around;
    align-items: center;
    padding: 0.3rem 1.2rem 1.1rem 1.2rem;
}

.app-nav-bar.active {
    display: flex;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    font-size: 0.7rem;
    gap: 0.2rem;
    transition: color 0.3s ease, transform 0.2s ease;
    width: 80px;
}

.nav-btn:hover {
    color: var(--text-primary);
}

.nav-btn.active {
    color: var(--primary-glow);
    font-weight: 700;
}

.nav-icon {
    font-size: 1.25rem;
}

/* Mascot Card Display */
.mascot-card {
    text-align: center;
    padding: 0.8rem 1.1rem;
}

.mascot-display {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 135px;
    margin-bottom: 0.4rem;
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 65%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 65%, rgba(0, 0, 0, 0) 100%);
}

/* NIMBY Character SVG */
.nimby-character {
    width: 100%;
    height: 100%;
    max-height: 130px;
    animation: floatMascot 4s ease-in-out infinite;
    transform-origin: center;
}

/* Spech Bubble */
.nimby-speech-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    transition: border-color var(--transition-speed) ease;
}

/* Dynamic gradient transitions in CSS */
#cloudGrad stop:first-child {
    stop-color: #ffffff;
    transition: stop-color 0.8s ease;
}

#cloudGrad stop:last-child {
    stop-color: #cbd5e1;
    transition: stop-color 0.8s ease;
}

/* Mascot Animations & States */

/* Float animation base */
@keyframes floatMascot {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

/* Sleeping State */
.nimby-character.sleeping {
    animation: slowBreathe 6s ease-in-out infinite;
}

@keyframes slowBreathe {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(0.97) translateY(2px); }
    100% { transform: scale(1) translateY(0); }
}

.nimby-zzz {
    opacity: 0;
}

.nimby-character.sleeping .nimby-zzz {
    opacity: 1;
}

.zzz {
    fill: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    opacity: 0;
    animation: zzzFloat 4s infinite linear;
}

.z1 { animation-delay: 0s; font-size: 14px; }
.z2 { animation-delay: 1.3s; font-size: 18px; }
.z3 { animation-delay: 2.6s; font-size: 22px; }

@keyframes zzzFloat {
    0% { transform: translate(0, 10px) scale(0.5); opacity: 0; }
    30% { opacity: 0.7; }
    70% { opacity: 0.7; }
    100% { transform: translate(15px, -30px) scale(1.1); opacity: 0; }
}

/* Hide inactive face features */
.nimby-character.sleeping .eye-happy,
.nimby-character.sleeping .eye-angry,
.nimby-character.sleeping .eye-toxic,
.nimby-character.sleeping .mouth-happy,
.nimby-character.sleeping .mouth-angry,
.nimby-character.sleeping .mouth-toxic,
.nimby-character.sleeping .mouth-puff,
.nimby-character.sleeping .nimby-lightning,
.nimby-character.sleeping .nimby-sun,
.nimby-character.sleeping .nimby-toxic-steam {
    display: none;
}

/* Happy State */
.nimby-character.happy {
    animation: happyBounce 2s ease-in-out infinite;
}

@keyframes happyBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.02); }
}

.nimby-character.happy .eye-sleep,
.nimby-character.happy .eye-angry,
.nimby-character.happy .eye-toxic,
.nimby-character.happy .mouth-sleep,
.nimby-character.happy .mouth-angry,
.nimby-character.happy .mouth-toxic,
.nimby-character.happy .mouth-puff,
.nimby-character.happy .nimby-zzz,
.nimby-character.happy .nimby-lightning,
.nimby-character.happy .nimby-sun,
.nimby-character.happy .nimby-toxic-steam {
    display: none;
}

/* Puffing / Vaporizing State */
.nimby-character.puffing {
    animation: puffBreathe 1.2s ease-in-out infinite;
}

@keyframes puffBreathe {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.06); }
    70% { transform: scale(0.98); }
}

.nimby-character.puffing .eye-sleep,
.nimby-character.puffing .eye-angry,
.nimby-character.puffing .eye-toxic,
.nimby-character.puffing .mouth-sleep,
.nimby-character.puffing .mouth-happy,
.nimby-character.puffing .mouth-angry,
.nimby-character.puffing .mouth-toxic,
.nimby-character.puffing .nimby-zzz,
.nimby-character.puffing .nimby-lightning,
.nimby-character.puffing .nimby-sun,
.nimby-character.puffing .nimby-toxic-steam {
    display: none;
}

/* Angry / Overuse State */
.nimby-character.angry {
    animation: angryShaking 0.22s linear infinite, floatMascot 4s ease-in-out infinite;
}

@keyframes angryShaking {
    0% { transform: translateX(0); }
    25% { transform: translateX(-1px) rotate(-0.5deg); }
    75% { transform: translateX(1px) rotate(0.5deg); }
    100% { transform: translateX(0); }
}

.nimby-character.angry #cloudGrad stop:first-child {
    stop-color: #64748b;
}

.nimby-character.angry #cloudGrad stop:last-child {
    stop-color: #334155;
}

.nimby-character.angry .nimby-lightning {
    animation: lightningFlash 1.6s infinite step-end;
}

@keyframes lightningFlash {
    0%, 100% { opacity: 0; }
    15%, 55% { opacity: 1; }
    20%, 60% { opacity: 0; }
    65% { opacity: 1; }
}

.nimby-character.angry .eye-sleep,
.nimby-character.angry .eye-happy,
.nimby-character.angry .eye-toxic,
.nimby-character.angry .mouth-sleep,
.nimby-character.angry .mouth-happy,
.nimby-character.angry .mouth-toxic,
.nimby-character.angry .mouth-puff,
.nimby-character.angry .nimby-zzz,
.nimby-character.angry .nimby-sun,
.nimby-character.angry .nimby-toxic-steam {
    display: none;
}

/* Toxic / Counterfeit State */
.nimby-character.toxic {
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.45));
    animation: toxicWobble 4s ease-in-out infinite;
}

@keyframes toxicWobble {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-3px) rotate(-1.5deg); }
}

.nimby-character.toxic #cloudGrad stop:first-child {
    stop-color: #a7f3d0;
}

.nimby-character.toxic #cloudGrad stop:last-child {
    stop-color: #064e3b;
}

.nimby-character.toxic .toxic-skull {
    animation: toxicSkullFloat 3s infinite ease-in-out;
    transform-origin: center;
}

.nimby-character.toxic .toxic-skull.left {
    animation-delay: 0s;
}

.nimby-character.toxic .toxic-skull.right {
    animation-delay: 1.5s;
}

@keyframes toxicSkullFloat {
    0% { transform: translateY(15px) scale(0.6); opacity: 0; }
    30% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-20px) scale(1.2); opacity: 0; }
}

.nimby-character.toxic .eye-sleep,
.nimby-character.toxic .eye-happy,
.nimby-character.toxic .eye-angry,
.nimby-character.toxic .mouth-sleep,
.nimby-character.toxic .mouth-happy,
.nimby-character.toxic .mouth-angry,
.nimby-character.toxic .mouth-puff,
.nimby-character.toxic .nimby-zzz,
.nimby-character.toxic .nimby-lightning,
.nimby-character.toxic .nimby-sun {
    display: none;
}

/* Sunny / Nootropic State */
.nimby-character.sunny {
    animation: happyBounce 2.5s ease-in-out infinite;
}

.nimby-character.sunny #cloudGrad stop:first-child {
    stop-color: #fffbeb;
}

.nimby-character.sunny #cloudGrad stop:last-child {
    stop-color: #fef3c7;
}

.nimby-character.sunny .nimby-sun {
    animation: sunBounce 3s ease-in-out infinite;
}

@keyframes sunBounce {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(1px, -3px); }
}

.nimby-character.sunny .sun-rays {
    animation: sunSpinning 20s linear infinite;
    transform-origin: 150px 40px;
}

@keyframes sunSpinning {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nimby-character.sunny .eye-sleep,
.nimby-character.sunny .eye-angry,
.nimby-character.sunny .eye-toxic,
.nimby-character.sunny .mouth-sleep,
.nimby-character.sunny .mouth-angry,
.nimby-character.sunny .mouth-toxic,
.nimby-character.sunny .mouth-puff,
.nimby-character.sunny .nimby-zzz,
.nimby-character.sunny .nimby-lightning,
.nimby-character.sunny .nimby-toxic-steam {
    display: none;
}


/* Wellness Analytics Container Layout */
.stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.2rem 0;
}

/* Progress ring graphic */
.stat-circle-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 90px;
}

.progress-ring {
    transform: rotate(-90deg);
    transform-origin: center;
}

.progress-ring__circle-bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.progress-ring__circle {
    stroke-dasharray: 214;
    stroke-dashoffset: 214;
    transition: stroke-dashoffset 0.4s ease, stroke var(--transition-speed) ease;
    transform-origin: 40px 40px;
}

.progress-text {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translate(-50%, -64%);
    display: flex;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.progress-text .divider {
    color: rgba(255, 255, 255, 0.25);
    margin: 0 1px;
}

.progress-text #stat-puffs-curr {
    color: var(--text-primary);
}

.progress-text #stat-puffs-limit {
    color: var(--text-secondary);
}

.circle-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toxins statistics box */
.stat-toxins-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toxins-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toxins-val {
    font-size: 1.3rem;
    font-weight: 800;
}

.toxins-desc {
    font-size: 0.58rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Supplement log styles */
.supplement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.supplement-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.supplement-badge.badge-pending {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

.supplement-badge.badge-taken {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}

.supplement-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 0.8rem;
}

.btn-supplement {
    background: linear-gradient(135deg, var(--primary-glow) 0%, rgba(var(--primary-glow-rgb), 0.75) 100%);
    border: none;
    color: white;
    padding: 0.6rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s, background var(--transition-speed) ease;
    box-shadow: 0 4px 12px rgba(var(--primary-glow-rgb), 0.2);
}

.btn-supplement:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(var(--primary-glow-rgb), 0.3);
}

.btn-supplement:active:not(:disabled) {
    transform: translateY(0);
}

.btn-supplement:disabled {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================
   NEW SIMULATOR ENHANCEMENTS
   ========================================== */

/* Historical Puff Chart Styles */
.history-card {
    padding-bottom: 1.4rem;
}

.weekly-chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-bar {
    fill: var(--primary-glow);
    opacity: 0.8;
    rx: 4px;
    ry: 4px;
    transition: fill var(--transition-speed) ease, height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), y 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
    cursor: pointer;
}

.chart-bar:hover {
    opacity: 1;
    fill: var(--accent-color);
}

.chart-bar.over-limit {
    fill: #ef4444 !important;
}

.chart-bar.warning-limit {
    fill: #f59e0b !important;
}

.chart-label-text {
    font-size: 8px;
    font-weight: 600;
    fill: var(--text-secondary);
    text-anchor: middle;
}

.chart-value-text {
    font-size: 8px;
    font-weight: 700;
    fill: var(--text-primary);
    text-anchor: middle;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(2px);
}

.chart-bar-group:hover .chart-value-text {
    opacity: 1;
    transform: translateY(0);
}

/* Limit threshold reference line */
.chart-limit-line {
    stroke: rgba(239, 68, 68, 0.4);
    stroke-dasharray: 3 3;
    stroke-width: 1.5;
}

.chart-limit-text {
    font-size: 7px;
    fill: #fca5a5;
    font-weight: 700;
}

/* Custom Profile Creator Elements */
.custom-profiles-card {
    transition: all 0.3s ease;
}

#btn-toggle-designer:hover {
    color: var(--text-primary) !important;
}

#btn-save-profile:hover {
    background: var(--accent-color) !important;
    color: black !important;
}

/* Mute Button Active state */
#btn-mute:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Visual Haptics Animation (Screen Shake) */
@keyframes hapticShake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-3px, 1px); }
    20%, 40%, 60%, 80% { transform: translate(3px, -1px); }
}

.haptic-shake {
    animation: hapticShake 0.45s cubic-bezier(.36,.07,.19,.97) both;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==========================================
   HEATING GRAPH & SLIDER SYSTEM (ADVANCED)
   ========================================== */
.temp-graph-container {
    transition: border-color var(--transition-speed) ease;
}

#temp-tuner-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
}

#temp-tuner-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 10px rgba(var(--primary-glow-rgb), 0.8);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

#temp-tuner-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 14px var(--primary-glow);
}

#temp-tuner-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 10px rgba(var(--primary-glow-rgb), 0.8);
    cursor: pointer;
    transition: transform 0.15s ease;
}

#temp-tuner-slider::-moz-range-thumb:hover {
    transform: scale(1.25);
}

/* Hide puff smoke by default for all states except puffing */
.nimby-puff-smoke {
    display: none;
}
.nimby-character.puffing .nimby-puff-smoke {
    display: block;
}

/* Mascot exhaled puffing smoke */
.nimby-character.puffing .nimby-smoke-bubble {
    animation: nimbySmokeFade 1.2s infinite ease-in-out;
    transform-origin: 100px 90px;
}

.nimby-character.puffing .nimby-smoke-bubble:nth-child(2) {
    animation-delay: 0.2s;
}

.nimby-character.puffing .nimby-smoke-bubble:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes nimbySmokeFade {
    0% { transform: scale(0.4); opacity: 0; filter: blur(1px); }
    40% { opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; filter: blur(4px); }
}

/* ==========================================
   HEADER NAV LINKS
   ========================================== */

.header-nav {
    display: flex;
    gap: 1.8rem;
    align-items: center;
}

.nav-link {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.3px;
    position: relative;
    transition: color 0.25s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-glow);
    border-radius: 2px;
    transition: width 0.25s ease, background 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active-page {
    color: var(--accent-color);
}

.nav-link.active-page::after {
    width: 100%;
}

/* ==========================================
   FOOTER WITH SOCIALS
   ========================================== */

.simulator-footer {
    z-index: 10;
    border-top: 1px solid var(--border-color);
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.footer-tagline {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    text-align: center;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.social-link:hover {
    background: rgba(var(--primary-glow-rgb), 0.15);
    border-color: var(--primary-glow);
    box-shadow: 0 0 16px rgba(var(--primary-glow-rgb), 0.25);
    transform: translateY(-2px);
}

.social-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.footer-credit {
    font-size: 0.75rem;
    color: rgba(160, 174, 192, 0.5);
    text-align: center;
}

/* ==========================================
   SHARED INNER-PAGE LAYOUT (about / how-to-use)
   ========================================== */

.page-content {
    max-width: 820px;
    margin: 0 auto;
    padding: 3.5rem 2rem 5rem;
    z-index: 10;
    flex: 1;
}

.page-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--primary-glow);
    margin-bottom: 0.8rem;
    display: block;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin-bottom: 2.5rem;
}

.page-title .accent-text {
    color: var(--primary-glow);
}

.page-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.2rem 2.4rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    margin-bottom: 1.5rem;
}

/* Step cards for How-to-Use */
.step-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.8rem 2.2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    margin-bottom: 1.2rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    border-color: rgba(var(--primary-glow-rgb), 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(var(--primary-glow-rgb), 0.1);
}

.step-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--primary-glow);
    text-shadow: 0 0 12px rgba(var(--primary-glow-rgb), 0.5);
    line-height: 1;
    min-width: 40px;
    opacity: 0.85;
}

.step-body h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
}

.step-body p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.step-body code {
    background: rgba(var(--primary-glow-rgb), 0.12);
    border: 1px solid rgba(var(--primary-glow-rgb), 0.25);
    border-radius: 5px;
    padding: 0.1em 0.4em;
    font-family: monospace;
    font-size: 0.85em;
    color: var(--accent-color);
}

/* About page prose */
.about-prose {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.about-prose p {
    margin-bottom: 1.2rem;
}

.about-prose p:last-child {
    margin-bottom: 0;
}

.about-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.8rem;
}

.about-tag {
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    background: rgba(var(--primary-glow-rgb), 0.1);
    border: 1px solid rgba(var(--primary-glow-rgb), 0.3);
    color: var(--accent-color);
}

