/* Global Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Instrument Sans', 'Segoe UI', Roboto, sans-serif;
    user-select: none;
}

:root {
    --ui-duration-short: 0.18s;
    --ui-duration-normal: 0.32s;
    --ui-duration-long: 0.5s;
    --ui-duration-instant: 0.08s;
}

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #2c2f33;
    /* base abu-abu */
    background-image: radial-gradient(circle at center, transparent 10%, #0c0d0f 100%);
    background-size: 100% 100%;
    background-position: center center;
    color: #f5f5f5;
}

/* Three.js Container */
#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Dark Vignette Overlay for readability in the top-left */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(circle at 0% 0%, rgba(10, 10, 12, 0.95) 0%, rgba(10, 10, 12, 0.5) 40%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.4) 100%);
}

/* Control Panel Container (Glassmorphism UI) */
#ui-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    background: rgba(26, 26, 26, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    z-index: 10;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all var(--ui-duration-normal) ease;
}

/* Header & Pulse */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: #ff4400;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 68, 0, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 68, 0, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(255, 68, 0, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 68, 0, 0);
    }
}

.panel-desc {
    font-size: 0.85rem;
    color: #aaaaaa;
    line-height: 1.4;
    font-weight: 300;
}

/* Control Button & Interactive Elements */
.control-section {
    margin: 8px 0;
}

.control-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888888;
    margin-bottom: 10px;
    font-weight: 600;
}

.btn-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-group .btn {
    flex: 1;
    padding: 10px 4px;
    font-size: 0.78rem;
}

.btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--ui-duration-short) cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* Button Active State (Clipping Enabled) */
.btn.active {
    background: rgba(255, 68, 0, 0.15);
    border-color: rgba(255, 68, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 68, 0, 0.1);
}

.btn.active .btn-icon {
    color: #ff4400;
    filter: drop-shadow(0 0 4px rgba(255, 68, 0, 0.6));
}

/* Stats Dashboard */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.stat-label {
    color: #888888;
    font-weight: 400;
}

.stat-value {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.text-red {
    color: #ff5533;
    text-shadow: 0 0 8px rgba(255, 85, 51, 0.2);
}

.text-blue {
    color: #33aaff;
    text-shadow: 0 0 8px rgba(51, 170, 255, 0.2);
}

.text-green {
    color: #00cc66;
    text-shadow: 0 0 8px rgba(0, 204, 102, 0.2);
}

.text-dim {
    color: #777777 !important;
    text-shadow: none !important;
}



/* Navigation Guide Box */
.instructions {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 12px;
}

.instructions h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cccccc;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.instructions ul {
    list-style: none;
    font-size: 0.75rem;
    color: #999999;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 2px;
}

.instructions li strong {
    color: #dddddd;
}

/* Responsive UI Adjustment */
@media (max-width: 480px) {
    #ui-container {
        width: calc(100% - 40px);
        bottom: 20px;
        top: auto;
    }

    #detail-popup {
        width: calc(100% - 40px) !important;
        top: 20px !important;
        right: 20px !important;
        left: 20px !important;
        transform: translateY(-30px) !important;
    }
}

/* Component Detail Popup (Glassmorphism Sidebar) */

/* Unified Popup Design: borderless, semi-transparent, blurred */
#detail-popup,
.info-popup-card {
    position: absolute;
    width: 320px;
    background: rgba(12, 12, 14, 0.48);
    backdrop-filter: blur(12px) saturate(125%);
    -webkit-backdrop-filter: blur(12px) saturate(125%);
    border: none;
    border-radius: 14px;
    padding: 20px;
    z-index: 10;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ui-duration-normal) ease, transform var(--ui-duration-normal) cubic-bezier(0.2, 1, 0.2, 1);
}

#detail-popup {
    top: 20px;
    right: 20px;
    transform: translateX(30px);
}

.popup-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ff4400;
    font-weight: 600;
}

#popup-content {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.5px;
}

.popup-desc {
    font-size: 0.85rem;
    color: #aaaaaa;
    line-height: 1.5;
    font-weight: 300;
}

/* Thermodynamic Panel Overlay (Backdrop) */
#thermo-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ui-duration-long) cubic-bezier(0.4, 0, 0.2, 1);
}

#thermo-panel.active {
    opacity: 1;
    pointer-events: auto;
}

/* Premium Content Modal Container */
.thermo-content {
    position: relative;
    width: calc(100% - 40px);
    max-width: 650px;
    background: rgba(26, 26, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: scale(0.9);
    transition: transform var(--ui-duration-long) cubic-bezier(0.34, 1.56, 0.64, 1);
}

#thermo-panel.active .thermo-content {
    transform: scale(1);
}

/* Close Button (X Cross) */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color var(--ui-duration-short) ease, transform var(--ui-duration-short) ease;
}

.close-btn:hover {
    color: #ffffff;
    transform: scale(1.15);
}

.close-btn:active {
    transform: scale(0.9);
}

#thermo-panel .panel-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #ffffff;
    text-transform: uppercase;
}

.thermo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888888;
    font-weight: 600;
}

.slider-header .value-display {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

/* Premium Range Sliders Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

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

/* Chrome, Safari, Edge, Opera Track */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: background var(--ui-duration-short) ease;
}

input[type="range"]:hover::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.25);
}

/* Chrome, Safari, Edge, Opera Thumb */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    /* Vertically center thumb on 4px track */
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform var(--ui-duration-instant) ease, box-shadow var(--ui-duration-instant) ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(0.95);
}

/* Firefox Track */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: background var(--ui-duration-short) ease;
}

input[type="range"]:hover::-moz-range-track {
    background: rgba(255, 255, 255, 0.25);
}

/* Firefox Thumb */
input[type="range"]::-moz-range-thumb {
    border: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform var(--ui-duration-instant) ease, box-shadow var(--ui-duration-instant) ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

input[type="range"]:active::-moz-range-thumb {
    transform: scale(0.95);
}

/* Calculation Displays */
.calculation-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.calc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.calc-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888888;
    font-weight: 600;
}

.calc-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.calc-unit {
    font-size: 0.8rem;
    font-weight: 400;
    color: #aaaaaa;
    margin-left: 2px;
}

.text-orange {
    color: #ff5533;
    text-shadow: 0 0 8px rgba(255, 85, 51, 0.3);
}

.pulse-orange {
    background-color: #ff5533 !important;
    box-shadow: 0 0 0 0 rgba(255, 85, 51, 0.7);
}

/* Boiler Specifications Styling inside Thermodynamics Modal */
.spec-container {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spec-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ff9f0a;
    /* Apple system orange */
    font-weight: 700;
}

.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 8px 12px;
}

.spec-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888888;
    font-weight: 500;
}

.spec-val {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
}

/* Responsive specs */
@media (max-width: 600px) {
    .spec-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Chart Canvas Container */
.chart-container {
    width: 100%;
    height: 140px;
    margin-top: 4px;
    position: relative;
}

#efficiencyCurve {
    width: 100% !important;
    height: 100% !important;
}

/* Adjust layout on mobile */
@media (max-width: 600px) {
    .thermo-content {
        width: calc(100% - 20px);
        padding: 20px 16px;
        gap: 12px;
    }

    .thermo-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chart-container {
        height: 120px;
    }
}

/* Circular Info Button & Information Popup */
.info-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(20, 20, 22, 0.85) 0%, rgba(20, 20, 22, 0.45) 60%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
    transition: all var(--ui-duration-short) cubic-bezier(0.4, 0, 0.2, 1);
}

.info-btn:hover {
    background: linear-gradient(135deg, rgba(20, 20, 22, 0.95) 0%, rgba(20, 20, 22, 0.55) 60%, rgba(0, 0, 0, 0) 100%);
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.info-btn:active {
    transform: scale(0.95);
}

/* Bottom Left Controls Layout Container */
.bottom-left-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 12px;
    z-index: 10;
}

/* Bottom Center Controls Layout Container */
.bottom-center-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

/* Circular Bottom Buttons (View Toggle / Explode / Thermo) */
.view-toggle-btn,
.explode-btn,
.thermo-btn,
.reset-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(20, 20, 22, 0.85) 0%, rgba(20, 20, 22, 0.45) 60%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
    transition: all var(--ui-duration-short) cubic-bezier(0.4, 0, 0.2, 1);
}

.view-toggle-btn {
    position: relative;
    overflow: visible;
}

.view-toggle-btn:hover,
.explode-btn:hover,
.thermo-btn:hover,
.reset-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 60%, rgba(0, 0, 0, 0) 100%);
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(255, 159, 10, 0.2);
}

.view-toggle-btn:active,
.explode-btn:active,
.thermo-btn:active,
.reset-btn:active {
    transform: scale(0.95);
}

.view-toggle-btn.active,
.explode-btn.active,
.thermo-btn.active {
    background: linear-gradient(135deg, rgba(255, 159, 10, 0.22) 0%, rgba(255, 159, 10, 0.15) 60%, rgba(0, 0, 0, 0) 100%);
    color: #ff9f0a;
}

.view-icon {
    pointer-events: none;
    z-index: 2;
}

/* Circular Arc Slider Layers */
.arc-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ui-duration-normal) ease;
    z-index: 3;
}

.view-toggle-btn.active .arc-slider {
    opacity: 1;
    transition-delay: 0.1s;
}

.view-toggle-btn.active .arc-slider .arc-hitbox,
.view-toggle-btn.active .arc-slider .arc-thumb {
    pointer-events: auto;
}

.arc-thumb {
    cursor: grab;
    transition: r var(--ui-duration-short) cubic-bezier(0.4, 0, 0.2, 1);
}

.arc-thumb:active {
    cursor: grabbing;
    r: 5;
}

.info-popup-card {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 320px;
    padding: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform-origin: calc(100% - 22px) calc(100% + 38px);
    transform: translateY(28px) scale(0.96);
}

/* Hero Title Panel (Apple/Glassmorphism style) */
#hero-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    max-width: 620px;
    border: none;
    border-radius: 0;
    padding: 40px;
    z-index: 10;
    box-shadow: none;
    transition: opacity var(--ui-duration-normal) ease, transform var(--ui-duration-normal) ease;
    overflow: hidden;
}

#hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 10, 12, 0.95) 0%, rgba(10, 10, 12, 0.80) 24%, rgba(10, 10, 12, 0.45) 48%, rgba(10, 10, 12, 0.18) 68%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%), linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%), linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    mask-composite: intersect;
    -webkit-mask-composite: destination-in;
    pointer-events: none;
    z-index: -1;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 18px;
}

.hero-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-weight: 400;
    margin-top: 10px;
}

@media (max-width: 480px) {
    #hero-panel {
        width: calc(100% - 48px);
        left: 24px;
        top: 24px;
        padding: 32px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-desc {
        font-size: 0.85rem;
    }
}

/* Cross-Section Panel (Apple Liquid Glassmorphism) */
.cross-section-panel-card {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translate(-50%, 20px) scale(0.95);
    transform-origin: bottom center;
    width: calc(100% - 40px);
    max-width: 580px;
    background: rgba(15, 15, 18, 0.45);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 20px;
    z-index: 10;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ui-duration-normal) cubic-bezier(0.25, 1, 0.5, 1);
}

.cross-section-panel-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

.sliders-wrapper {
    display: flex;
    flex-direction: row;
    gap: 24px;
    justify-content: space-between;
}

.slider-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
    transition: opacity 0.25s ease;
}

.slider-row.disabled {
    opacity: 0.25;
}

.slider-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.axis-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Color badges for axes matching 3D standards */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    color: #ffffff;
}

.badge-x {
    background-color: #ff453a; /* iOS Red */
    box-shadow: 0 0 6px rgba(255, 69, 58, 0.4);
}

.badge-y {
    background-color: #30d158; /* iOS Green */
    box-shadow: 0 0 6px rgba(48, 209, 88, 0.4);
}

.badge-z {
    background-color: #0a84ff; /* iOS Blue */
    box-shadow: 0 0 6px rgba(10, 132, 255, 0.4);
}

.axis-val-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
}

.slider-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Custom styles for range slider inside the drawer */
.slider-control-group input[type="range"] {
    flex: 1;
}

/* Axis Toggle Button */
.axis-toggle-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.axis-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

.axis-toggle-btn.active {
    background: rgba(255, 159, 10, 0.2);
    border-color: rgba(255, 159, 10, 0.4);
    color: #ff9f0a;
    box-shadow: 0 0 8px rgba(255, 159, 10, 0.25);
}

/* Specific colors for active toggles matching the axes colors */
#row-clip-x .axis-toggle-btn.active {
    background: rgba(255, 69, 58, 0.2);
    border-color: rgba(255, 69, 58, 0.4);
    color: #ff453a;
    box-shadow: 0 0 8px rgba(255, 69, 58, 0.25);
}

#row-clip-y .axis-toggle-btn.active {
    background: rgba(48, 209, 88, 0.2);
    border-color: rgba(48, 209, 88, 0.4);
    color: #30d158;
    box-shadow: 0 0 8px rgba(48, 209, 88, 0.25);
}

#row-clip-z .axis-toggle-btn.active {
    background: rgba(10, 132, 255, 0.2);
    border-color: rgba(10, 132, 255, 0.4);
    color: #0a84ff;
    box-shadow: 0 0 8px rgba(10, 132, 255, 0.25);
}

/* Specific color styling for the range sliders track/thumb dynamically when active */
#row-clip-x:not(.disabled) input[type="range"]::-webkit-slider-runnable-track {
    background: rgba(255, 69, 58, 0.2);
}
#row-clip-y:not(.disabled) input[type="range"]::-webkit-slider-runnable-track {
    background: rgba(48, 209, 88, 0.2);
}
#row-clip-z:not(.disabled) input[type="range"]::-webkit-slider-runnable-track {
    background: rgba(10, 132, 255, 0.2);
}

#row-clip-x:not(.disabled) input[type="range"]::-webkit-slider-thumb {
    background: #ff453a;
    box-shadow: 0 0 8px rgba(255, 69, 58, 0.5);
}
#row-clip-y:not(.disabled) input[type="range"]::-webkit-slider-thumb {
    background: #30d158;
    box-shadow: 0 0 8px rgba(48, 209, 88, 0.5);
}
#row-clip-z:not(.disabled) input[type="range"]::-webkit-slider-thumb {
    background: #0a84ff;
    box-shadow: 0 0 8px rgba(10, 132, 255, 0.5);
}

/* Disabled sliders should have standard styles and look unclickable */
.slider-row.disabled input[type="range"] {
    pointer-events: none;
}

@media (max-width: 600px) {
    #cross-section-panel {
        width: calc(100% - 40px) !important;
        left: 50% !important;
        transform: translate(-50%, 20px) scale(0.95) !important;
        bottom: 80px !important;
    }
    #cross-section-panel.active {
        transform: translate(-50%, 0) scale(1) !important;
    }
    .sliders-wrapper {
        flex-direction: column;
        gap: 12px;
    }
}