/* ==========================================================================
   ISPU SINGKAWANG — RESPONSIVE DESIGN & LIGHT MODE DEFAULT SYSTEM
   ========================================================================== */

:root {
    /* Color Palette - Default Light Theme */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --bg-glass-border: rgba(0, 0, 0, 0.08);
    --bg-glass-border-hover: rgba(0, 0, 0, 0.16);
    --bg-glass-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.06);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --primary-accent: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.2);

    /* ISPU Category Standard Colors */
    --ispu-baik: #10b981;
    --ispu-baik-bg: rgba(16, 185, 129, 0.12);
    --ispu-baik-glow: rgba(16, 185, 129, 0.3);

    --ispu-sedang: #2563eb;
    --ispu-sedang-bg: rgba(37, 99, 235, 0.12);
    --ispu-sedang-glow: rgba(37, 99, 235, 0.3);

    --ispu-unhealthy: #d97706;
    --ispu-unhealthy-bg: rgba(217, 119, 6, 0.12);
    --ispu-unhealthy-glow: rgba(217, 119, 6, 0.3);

    --ispu-very-unhealthy: #dc2626;
    --ispu-very-unhealthy-bg: rgba(220, 38, 38, 0.12);
    --ispu-very-unhealthy-glow: rgba(220, 38, 38, 0.3);

    --ispu-dangerous: #9333ea;
    --ispu-dangerous-bg: rgba(147, 51, 234, 0.15);
    --ispu-dangerous-glow: rgba(147, 51, 234, 0.4);

    /* Motion Easing Functions */
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-motion: 0.35s var(--ease-spring);

    /* Radii */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-main: #06080d;
    --bg-card: rgba(14, 20, 32, 0.65);
    --bg-card-hover: rgba(22, 31, 49, 0.85);
    --bg-glass-border: rgba(255, 255, 255, 0.08);
    --bg-glass-border-hover: rgba(255, 255, 255, 0.18);
    --bg-glass-shadow: 0 20px 50px 0 rgba(0, 0, 0, 0.5);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary-accent: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.35);

    --ispu-baik-bg: rgba(16, 185, 129, 0.15);
    --ispu-sedang-bg: rgba(59, 130, 246, 0.15);
    --ispu-unhealthy-bg: rgba(245, 158, 11, 0.15);
    --ispu-very-unhealthy-bg: rgba(239, 68, 68, 0.15);
    --ispu-dangerous-bg: rgba(168, 85, 247, 0.2);
}

/* Global Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-motion), color var(--transition-motion);
}

/* Ambient Canvas Particle Background */
.ambient-light-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

#ambient-particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    animation: floatBlob 18s ease-in-out infinite alternate;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #3b82f6 0%, rgba(59, 130, 246, 0) 70%);
    top: -200px;
    right: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -9s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
    100% { transform: translate(-40px, 80px) scale(0.95); }
}

.ambient-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.5;
}

[data-theme="dark"] .ambient-grid-overlay {
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}

/* Container */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* Headings */
h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Base Card Style with Generous Inner Padding */
.card {
    padding: 2.25rem 2rem;
}

/* Glassmorphism Card Base */
.glass-effect {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    box-shadow: var(--bg-glass-shadow);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-motion), border-color var(--transition-motion), box-shadow var(--transition-motion);
    position: relative;
    overflow: hidden;
}

.glass-effect:hover {
    border-color: var(--bg-glass-border-hover);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .glass-effect:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

/* Card Header Layout */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.3;
    margin: 0;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

.glass-pill {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-glass-border);
    border-radius: 99px;
    transition: all var(--transition-motion);
}

[data-theme="dark"] .glass-pill {
    background: rgba(255, 255, 255, 0.04);
}

.glass-pill:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .glass-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 3D Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Conic Border Glow Animation */
.conic-border-glow {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from 0deg, transparent 0 300deg, var(--primary-accent) 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: rotateConic 6s linear infinite;
    opacity: 0.5;
}

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

/* Micro Animations for Icons */
.icon-spin-slow { animation: spinSlow 12s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }

.icon-bounce { animation: floatBounce 3s ease-in-out infinite; }
@keyframes floatBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.icon-float { animation: floatSlow 4s ease-in-out infinite alternate; }
@keyframes floatSlow { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(-4px) rotate(8deg); } }

.icon-pulse { animation: iconPulse 2s ease-in-out infinite; }
@keyframes iconPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.8; } }

.motion-rotate-icon:hover i { animation: spinSlow 2s ease-in-out; }

/* Ripple Effect */
.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

[data-theme="dark"] .ripple-wave {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transition: opacity 0.8s var(--ease-spring), transform 0.8s var(--ease-spring);
    will-change: opacity, transform;
}

.scroll-reveal[data-reveal="fade-up"] { transform: translateY(30px); }
.scroll-reveal[data-reveal="fade-right"] { transform: translateX(-30px); }
.scroll-reveal[data-reveal="fade-left"] { transform: translateX(30px); }
.scroll-reveal[data-reveal="zoom"] { transform: scale(0.92); }

.scroll-reveal.reveal-active {
    opacity: 1;
    transform: translate(0) scale(1);
}

.motion-hover-scale {
    transition: transform 0.3s var(--ease-spring);
}

.motion-hover-scale:hover {
    transform: translateY(-3px) scale(1.02);
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--bg-glass-border);
    padding: 0.85rem 0;
}

[data-theme="dark"] .navbar {
    background: rgba(6, 8, 13, 0.8);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 14px var(--primary-glow);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.2rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.brand-title span {
    color: var(--primary-accent);
}

.brand-subtitle {
    font-size: 0.725rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-accent);
    border-radius: 50%;
    display: inline-block;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.live-clock-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
}

.glow-icon {
    color: var(--primary-accent);
}

.status-indicator-badge {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
}

.pulse-ring {
    position: absolute;
    left: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: ripple 1.8s ease-out infinite;
}

.nav-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Motion Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: inherit;
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-motion);
    position: relative;
    overflow: hidden;
}

.motion-btn-glow {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border-color: var(--bg-glass-border);
}

[data-theme="dark"] .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    color: var(--text-primary);
}

/* ==========================================================================
   MAIN CONTENT & CARDS
   ========================================================================== */
.main-content {
    padding-top: 1.75rem;
    padding-bottom: 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Karhutla Banner */
.banner-karhutla {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1), rgba(220, 38, 38, 0.06));
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.5rem;
}

.banner-icon-wrapper { flex-shrink: 0; }

.banner-icon {
    width: 46px;
    height: 46px;
    background: rgba(217, 119, 6, 0.15);
    color: #d97706;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.banner-content { flex: 1; }

.banner-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.2rem;
}

.banner-header h3 { font-size: 0.95rem; }

.badge-mini {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    color: var(--text-muted);
}

[data-theme="dark"] .badge-mini {
    background: rgba(255, 255, 255, 0.06);
}

.banner-content p {
    font-size: 0.825rem;
    color: var(--text-secondary);
}

.banner-level {
    font-size: 0.775rem;
    font-weight: 700;
    padding: 0.4rem 0.95rem;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.level-low {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.level-warning {
    background: rgba(217, 119, 6, 0.15);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.3);
}

/* Station Selector Section */
.section-station-selector {
    background: var(--bg-card);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
}

.selector-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.coord-pill {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.03);
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    border: 1px solid var(--bg-glass-border);
}

[data-theme="dark"] .coord-pill {
    background: rgba(255, 255, 255, 0.03);
}

.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.btn-station {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-motion);
    text-align: left;
}

[data-theme="dark"] .btn-station {
    background: rgba(255, 255, 255, 0.03);
}

.btn-station:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-station:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-station.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(29, 78, 216, 0.08));
    border-color: var(--primary-accent);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.btn-station .st-name { font-size: 0.875rem; font-weight: 700; }
.btn-station .st-sub { font-size: 0.725rem; color: var(--text-muted); }

.btn-station .st-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.825rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
}

/* ==========================================================================
   HERO GRID: SPEEDOMETER GAUGE & WEATHER HIGHLIGHTS
   ========================================================================== */
.hero-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.5rem;
}

.card-hero-ispu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.badge-motion {
    font-size: 0.675rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-accent);
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.card-title-group h2 {
    font-size: 1.35rem;
    margin-top: 0.25rem;
}

.update-time-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.live-dot-mini {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

/* ISPU Gauge Display */
.ispu-display-wrapper {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 1.75rem;
    margin: 0.75rem 0;
}

.gauge-container {
    position: relative;
    width: 220px;
    height: 140px;
    display: flex;
    justify-content: center;
}

.gauge-svg { width: 100%; height: 100%; }

.gauge-track { stroke: rgba(0, 0, 0, 0.06); }
[data-theme="dark"] .gauge-track { stroke: rgba(255, 255, 255, 0.06); }

.gauge-fill {
    stroke: var(--ispu-baik);
    transition: stroke-dashoffset 1.2s var(--ease-spring), stroke 0.4s ease;
}

.gauge-center-content {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.ispu-value-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.ispu-unit {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-top: 0.15rem;
}

.ispu-category-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    width: fit-content;
    background: var(--ispu-baik-bg);
    color: var(--ispu-baik);
    border: 1px solid var(--ispu-baik-glow);
    transition: all var(--transition-motion);
}

.category-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.dominant-pollutant-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    width: fit-content;
}

.dominant-pollutant-box .label { color: var(--text-muted); }
.dominant-pollutant-box .val { font-weight: 700; color: var(--primary-accent); }

/* ==========================================================================
   ISPU SCALE LEGEND CONTAINER (RESPONSIVE FIX)
   ========================================================================== */
.ispu-scale-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.scale-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.scale-legend-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    width: 100%;
}

.scale-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    transition: transform var(--transition-motion);
}

[data-theme="dark"] .scale-item {
    background: rgba(255, 255, 255, 0.03);
}

.scale-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.item-baik .scale-color-dot { background: var(--ispu-baik); box-shadow: 0 0 6px var(--ispu-baik); }
.item-sedang .scale-color-dot { background: var(--ispu-sedang); box-shadow: 0 0 6px var(--ispu-sedang); }
.item-unhealthy .scale-color-dot { background: var(--ispu-unhealthy); box-shadow: 0 0 6px var(--ispu-unhealthy); }
.item-very-unhealthy .scale-color-dot { background: var(--ispu-very-unhealthy); box-shadow: 0 0 6px var(--ispu-very-unhealthy); }
.item-dangerous .scale-color-dot { background: var(--ispu-dangerous); box-shadow: 0 0 6px var(--ispu-dangerous); }

.scale-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    overflow: hidden;
}

.scale-range {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-primary);
}

.scale-name {
    font-size: 0.675rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Weather Card */
.card-weather {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.weather-main-highlight {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    margin-bottom: 1.15rem;
}

[data-theme="dark"] .weather-main-highlight {
    background: rgba(255, 255, 255, 0.03);
}

.weather-temp-group {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.weather-big-icon {
    font-size: 2.75rem;
    color: #d97706;
}

.temp-val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.temp-condition {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.weather-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--bg-glass-border);
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .weather-item {
    background: rgba(255, 255, 255, 0.02);
}

.weather-item i {
    font-size: 1.1rem;
    color: var(--primary-accent);
    width: 20px;
    text-align: center;
}

.w-label { font-size: 0.675rem; color: var(--text-muted); }
.w-val { font-size: 0.825rem; font-weight: 700; }

.singkawang-info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.775rem;
    color: var(--text-secondary);
}

.singkawang-info-box i {
    color: var(--primary-accent);
    margin-top: 0.1rem;
}

/* ==========================================================================
   POLLUTANTS GRID
   ========================================================================== */
.section-pollutants {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.section-title-group h2 { font-size: 1.4rem; }
.section-title-group p { font-size: 0.85rem; color: var(--text-secondary); }

.pollutant-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.card-pollutant {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.1rem;
}

.pol-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pol-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
}

.pol-fullName {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.pol-subindex {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
}

.pol-value-group {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.pol-conc {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.pol-unit {
    font-size: 0.775rem;
    color: var(--text-muted);
    font-weight: 600;
}

.pol-progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pol-progress-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 99px;
    overflow: hidden;
}

[data-theme="dark"] .pol-progress-track {
    background: rgba(255, 255, 255, 0.08);
}

.pol-progress-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 1s var(--ease-spring);
}

.pol-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* ==========================================================================
   DUAL COLUMN SECTION: TREND CHART & MAP
   ========================================================================== */
.section-dual-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1.5rem;
}

.card-chart, .card-map {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.chart-legend-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chart-legend-mini .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-baik { background: var(--ispu-baik); }
.dot-sedang { background: var(--ispu-sedang); }
.dot-unhealthy { background: var(--ispu-unhealthy); }

.chart-container {
    position: relative;
    width: 100%;
    height: 250px;
}

/* SVG Interactive Map */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--bg-glass-border);
}

[data-theme="dark"] .map-wrapper {
    background: rgba(0, 0, 0, 0.3);
}

.singkawang-svg-map { width: 100%; height: 100%; }

.radar-line {
    transform-origin: 200px 150px;
    animation: radarSweep 8s linear infinite;
}

@keyframes radarSweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.dist-polygon {
    fill: rgba(226, 232, 240, 0.8);
    stroke: rgba(0, 0, 0, 0.15);
    stroke-width: 1.5;
    cursor: pointer;
    transition: fill 0.3s var(--ease-spring), stroke 0.3s var(--ease-spring);
}

[data-theme="dark"] .dist-polygon {
    fill: rgba(30, 41, 59, 0.6);
    stroke: rgba(255, 255, 255, 0.15);
}

.district-group:hover .dist-polygon {
    fill: rgba(37, 99, 235, 0.25);
    stroke: var(--primary-accent);
}

.district-group.active .dist-polygon {
    fill: rgba(37, 99, 235, 0.4);
    stroke: var(--primary-accent);
    stroke-width: 2.5;
}

.dist-marker-bg {
    fill: #10b981;
    stroke: #ffffff;
    stroke-width: 2;
    transition: all 0.3s var(--ease-spring);
}

.active-pin {
    stroke-width: 3;
    animation: pinPulse 2s infinite;
}

@keyframes pinPulse {
    0% { r: 16px; }
    50% { r: 19px; }
    100% { r: 16px; }
}

.dist-marker-text {
    fill: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
    pointer-events: none;
}

.dist-label {
    fill: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
}

.map-footer-info {
    font-size: 0.775rem;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   HEALTH ADVISORY CARDS
   ========================================================================== */
.section-health-advisory {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.health-advisory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.health-card {
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    padding: 1.6rem 1.5rem;
}

.h-card-content {
    flex: 1;
    min-width: 0;
}

.h-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.h-card-icon.general { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.h-card-icon.sensitive { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.h-card-icon.sport { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.h-card-icon.mask { background: rgba(147, 51, 234, 0.12); color: #9333ea; }

.h-card-content h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.h-card-content p { font-size: 0.825rem; color: var(--text-secondary); line-height: 1.45; }

/* ==========================================================================
   CALCULATOR & REFERENCE TABLE
   ========================================================================== */
.badge-accent {
    font-size: 0.725rem;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-accent);
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    font-weight: 700;
}

.calculator-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.15rem;
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.glass-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-motion);
}

[data-theme="dark"] .glass-input {
    background: rgba(255, 255, 255, 0.04);
}

.glass-input:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input { padding-right: 4.5rem; }

.unit-tag {
    position: absolute;
    right: 1rem;
    font-size: 0.775rem;
    color: var(--text-muted);
    font-weight: 700;
    pointer-events: none;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.calc-result-display {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

[data-theme="dark"] .calc-result-display {
    background: rgba(255, 255, 255, 0.02);
}

.result-placeholder { color: var(--text-muted); font-size: 0.85rem; }
.placeholder-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.35; }

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.calc-ispu-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.calc-category-tag {
    font-size: 0.9rem;
    font-weight: 800;
    padding: 0.4rem 1.15rem;
    border-radius: var(--radius-sm);
}

.calc-formula-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Reference Table (Comfortable Spacing Fix) */
.section-reference-table {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-glass-border);
}

.table-ispu-ref {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.table-ispu-ref th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bg-glass-border);
}

[data-theme="dark"] .table-ispu-ref th {
    background: rgba(255, 255, 255, 0.04);
}

.table-ispu-ref td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bg-glass-border);
    color: var(--text-primary);
}

.badge-cat {
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.cat-baik { background: var(--ispu-baik-bg); color: var(--ispu-baik); }
.cat-sedang { background: var(--ispu-sedang-bg); color: var(--ispu-sedang); }
.cat-unhealthy { background: var(--ispu-unhealthy-bg); color: var(--ispu-unhealthy); }
.cat-very-unhealthy { background: var(--ispu-very-unhealthy-bg); color: var(--ispu-very-unhealthy); }
.cat-dangerous { background: var(--ispu-dangerous-bg); color: var(--ispu-dangerous); }

.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.dot-green { background: var(--ispu-baik); }
.dot-blue { background: var(--ispu-sedang); }
.dot-yellow { background: var(--ispu-unhealthy); }
.dot-red { background: var(--ispu-very-unhealthy); }
.dot-purple { background: var(--ispu-dangerous); }

/* Footer */
.footer {
    border-top: 1px solid var(--bg-glass-border);
    padding-top: 3rem;
    padding-bottom: 2rem;
    margin-top: 2.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.6rem;

    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand p { font-size: 0.825rem; color: var(--text-muted); }

.footer-links h4, .footer-emergency h4 {
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.825rem;
    text-decoration: none;
    transition: color var(--transition-motion);
}

.footer-links a:hover { color: var(--primary-accent); }

.footer-emergency p {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--bg-glass-border);
    padding-top: 1.25rem;
    font-size: 0.775rem;
    color: var(--text-muted);
}

.dev-tag a {
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-motion);
}

.dev-tag a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.hidden { display: none !important; }

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE BREAKPOINTS (FIXED PADDING & MARGINS)
   ========================================================================== */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; }
    .section-dual-grid { grid-template-columns: 1fr; }
    .calculator-body { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: 1.75rem; }
    .scale-legend-container { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .card { padding: 1.25rem; }

    /* Navbar Responsive */
    .navbar { padding: 0.65rem 0; }
    .navbar-container { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
    .brand-title { font-size: 1.05rem; }
    .brand-subtitle { display: none; }
    .brand-logo { width: 38px; height: 38px; font-size: 1.1rem; }

    .nav-controls { gap: 0.35rem; }
    .live-clock-badge { display: none; }
    .status-indicator-badge { font-size: 0.65rem; padding: 0.25rem 0.55rem; }

    .nav-actions-group .btn { padding: 0.35rem 0.65rem; font-size: 0.75rem; }
    .btn-text-responsive { display: none; }

    /* Scale Legend Grid for Mobile */
    .scale-legend-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .scale-item {
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }

    .scale-range { font-size: 0.7rem; }
    .scale-name { font-size: 0.65rem; }

    /* Hero Center Display */
    .ispu-display-wrapper {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 1.25rem;
    }

    .gauge-container { width: 200px; height: 130px; }
    .ispu-value-number { font-size: 3.2rem; }

    .category-badge-large { margin: 0 auto; font-size: 1.05rem; }
    .dominant-pollutant-box { margin: 0 auto; }

    /* Banner Mobile */
    .banner-karhutla { flex-direction: column; text-align: center; gap: 0.85rem; padding: 1.15rem; }
    .banner-header { justify-content: center; }

    .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 400px) {
    .scale-legend-container { grid-template-columns: 1fr 1fr; }
    .station-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   OFFICIAL FORMAL REPORT PDF PRINT STYLES
   ========================================================================== */
.print-only-header, .print-only-footer {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Space Grotesk', 'Inter', sans-serif !important;
        font-size: 10pt !important;
        line-height: 1.4 !important;
    }

    /* Hide Web Navigation & Non-report Interactive Elements */
    .navbar,
    .ambient-light-container,
    .section-station-selector,
    .nav-controls,
    .btn,
    .radar-line,
    #ambient-particle-canvas,
    .conic-border-glow,
    .calc-form,
    .form-actions,
    .map-footer-info,
    .footer {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
        gap: 1.25rem !important;
    }

    /* Formal Print Header */
    .print-only-header {
        display: block !important;
        margin-bottom: 1.5rem;
    }

    .print-header-top {
        display: flex;
        align-items: center;
        gap: 1.25rem;
    }

    .print-emblem {
        font-size: 2.75rem;
        color: #1e3a8a;
    }

    .print-header-title {
        flex: 1;
        text-align: center;
    }

    .print-header-title h2 {
        font-size: 12pt;
        font-weight: 800;
        letter-spacing: 0.05em;
        margin: 0;
        color: #0f172a;
    }

    .print-header-title h1 {
        font-size: 15pt;
        font-weight: 800;
        color: #1e3a8a;
        margin: 0.15rem 0;
    }

    .print-header-title p {
        font-size: 8.5pt;
        margin: 0;
        color: #475569;
    }

    .print-divider {
        border-bottom: 3px double #1e3a8a;
        margin: 0.65rem 0 1rem 0;
    }

    .print-doc-title {
        text-align: center;
        margin-bottom: 0.85rem;
    }

    .print-doc-title h3 {
        font-size: 12pt;
        font-weight: 800;
        text-decoration: underline;
        margin: 0;
        color: #0f172a;
    }

    .print-doc-title p {
        font-size: 8.5pt;
        font-style: italic;
        margin: 0.2rem 0 0 0;
        color: #475569;
    }

    .print-meta-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
        margin-bottom: 1rem;
    }

    .print-meta-table td {
        padding: 0.4rem 0.6rem;
        border: 1px solid #cbd5e1;
        background: #f8fafc;
    }

    /* Formal Card Layout for PDF Print */
    .card, .glass-effect {
        background: #ffffff !important;
        border: 1px solid #94a3b8 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        padding: 1.25rem !important;
        border-radius: 8px !important;
        page-break-inside: avoid;
    }

    .hero-grid, .section-dual-grid, .calculator-body {
        display: grid !important;
        grid-template-columns: 1.5fr 1fr !important;
        gap: 1rem !important;
    }

    .pollutant-cards-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.65rem !important;
    }

    .card-pollutant {
        border: 1px solid #cbd5e1 !important;
        padding: 0.75rem !important;
        page-break-inside: avoid;
    }

    .table-ispu-ref {
        border: 1px solid #475569 !important;
    }

    .table-ispu-ref th, .table-ispu-ref td {
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        padding: 0.5rem 0.65rem !important;
        font-size: 8.5pt !important;
    }

    .table-ispu-ref th {
        background: #e2e8f0 !important;
    }

    .banner-karhutla {
        border: 1px solid #d97706 !important;
        background: #fffbeeb0 !important;
        page-break-inside: avoid;
    }

    /* Formal Print Signature Box */
    .print-only-footer {
        display: block !important;
        margin-top: 2rem;
        page-break-inside: avoid;
    }

    .print-sig-box {
        margin-left: auto;
        width: 280px;
        text-align: center;
        font-size: 9.5pt;
    }

    .sig-role {
        margin-top: 0.3rem;
        line-height: 1.35;
    }

    .sig-space {
        height: 55px;
    }

    .sig-name {
        font-size: 10pt;
    }

    .sig-nip {
        font-size: 8.5pt;
        color: #475569;
    }
}
