/**
 * Con Edison Network Explorer - Styles
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Header Disclaimer */
.header-disclaimer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.68rem;
    color: #8294ab;
    line-height: 1.5;
}

.header-disclaimer a {
    color: #60a5fa;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.header-disclaimer a:hover {
    color: #93bbfc;
}

/* (handled below with stats bar offset) */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #eee;
    overflow: hidden;
}

/* Kill all transitions during initial state restore */
body.no-transition,
body.no-transition *,
body.no-transition *::before,
body.no-transition *::after {
    transition: none !important;
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    left: 320px;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed #map {
    left: 0;
}

/* Sidebar */
.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid #2d3748;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
}

/* Sidebar collapse toggle button (lives outside sidebar) */
.sidebar-toggle {
    position: absolute;
    top: 12px;
    left: 320px;
    z-index: 1001;
    width: 24px;
    height: 36px;
    border-radius: 0 6px 6px 0;
    background: #16213e;
    border: 1px solid #3b4a5a;
    border-left: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle:hover {
    background: #1e293b;
    color: #fff;
}

.sidebar-toggle svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform 0.3s;
}

/* When collapsed: park button at left edge, flip the arrow */
.sidebar-collapsed .sidebar-toggle {
    left: 0;
    border-left: 1px solid #3b4a5a;
}

.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-bottom: 1px solid #2d3748;
}

.sidebar-header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.sidebar-header .subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ─── Tab Navigation ─── */
.tab-nav {
    display: flex;
    border-bottom: 1px solid #2d3748;
    background: #16213e;
}

.tab-btn {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #94a3b8;
    background: rgba(59, 130, 246, 0.05);
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Tab content panels */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Sections */
.section {
    padding: 15px 20px;
    border-bottom: 1px solid #2d3748;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 12px;
}

/* Layer Controls */
#layer-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.layer-category {
    margin-bottom: 12px;
}

.layer-category-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #3b82f6;
    margin-bottom: 8px;
    padding-left: 2px;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.layer-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.layer-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.layer-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.layer-name {
    font-size: 0.85rem;
    color: #e2e8f0;
    flex: 1;
}

.layer-item.active .layer-name {
    color: #fff;
    font-weight: 500;
}

/* Layer warning badge */
.layer-warning {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.8;
}

/* Layer info link */
.layer-info-icon {
    font-size: 0.65rem;
    color: #64748b;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

.layer-info-icon:hover {
    color: #93bbfc;
    background: rgba(59, 130, 246, 0.15);
}

/* Native browser tooltip enhancement */
.layer-item[title] {
    position: relative;
}

/* Legend */
.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 2px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Collapsible sections */
.section-title.collapsible {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.section-title.collapsible::after {
    content: '▼';
    font-size: 0.6rem;
    transition: transform 0.2s;
}

.section-title.collapsible.collapsed::after {
    transform: rotate(-90deg);
}

.section-content.collapsed {
    display: none;
}

/* About text */
.about-text {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.6;
}

.about-text strong {
    color: #e2e8f0;
}

.about-text a {
    color: #3b82f6;
    text-decoration: none;
}

.about-text a:hover {
    text-decoration: underline;
}

/* API Info */
.api-info {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

.api-info strong {
    color: #e2e8f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.api-info a {
    color: #3b82f6;
    text-decoration: none;
}

.api-info a:hover {
    text-decoration: underline;
}

/* Other APIs list */
.other-apis {
    list-style: none;
    margin-top: 8px;
    padding-left: 0;
}

.other-apis li {
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 2px solid #2d3748;
}

.other-apis a {
    display: block;
    font-size: 0.8rem;
}

.api-note {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}


/* ─── Source Link (citation) ─── */
.source-link {
    font-family: monospace;
    font-size: 0.65rem;
    color: #475569;
    text-decoration: none;
    padding: 1px 5px;
    border: 1px solid #334155;
    border-radius: 3px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.source-link:hover {
    color: #3b82f6;
    border-color: #3b82f6;
}

.source-link-inline {
    display: inline-block;
    font-family: monospace;
    font-size: 0.7rem;
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
}

.source-link-inline:hover {
    color: #3b82f6;
}

/* ─── Section Subtitle ─── */
.section-subtitle {
    font-size: 0.7rem;
    color: #475569;
    font-style: italic;
    margin-bottom: 12px;
}

/* ─── Loading Small ─── */
.loading-small {
    color: #475569;
    font-size: 0.8rem;
    text-align: center;
    padding: 20px 0;
}

.no-data {
    color: #475569;
    font-size: 0.8rem;
    text-align: center;
    padding: 15px 0;
}

/* ─── NWS Project Cards ─── */
.nws-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nws-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 12px;
    transition: border-color 0.2s;
}

.nws-card:hover {
    border-color: #475569;
}

.nws-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.nws-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
}

.nws-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}

.nws-field {
    display: flex;
    flex-direction: column;
}

.nws-label {
    font-size: 0.6rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nws-value {
    font-size: 0.78rem;
    color: #94a3b8;
}

.nws-link {
    display: block;
    margin-top: 8px;
    font-size: 0.72rem;
    color: #3b82f6;
    text-decoration: none;
}

.nws-link:hover {
    text-decoration: underline;
}

/* ─── Notice Cards ─── */
.notices-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notices-count {
    font-size: 0.7rem;
    color: #475569;
    margin-bottom: 8px;
}

.notice-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #2d3748;
    border-left: 3px solid #475569;
    border-radius: 4px;
    padding: 10px 12px;
}

.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.notice-source {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}

.notice-date {
    font-size: 0.65rem;
    color: #475569;
    margin-bottom: 6px;
}

.notice-text {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.5;
    font-style: italic;
}

/* ─── Substation Explorer ─── */
.explorer-controls {
    margin-bottom: 12px;
}

.explorer-select {
    width: 100%;
    padding: 6px 10px;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
}

.explorer-select:focus {
    outline: none;
    border-color: #3b82f6;
}

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

.substation-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 12px;
    transition: border-color 0.2s;
}

.substation-card:hover {
    border-color: #475569;
}

.substation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.substation-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.substation-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
}

.zoom-btn {
    background: none;
    border: 1px solid #334155;
    color: #64748b;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-btn:hover {
    color: #3b82f6;
    border-color: #3b82f6;
}

.substation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.substation-field {
    display: flex;
    flex-direction: column;
}

.sf-label {
    font-size: 0.6rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sf-value {
    font-size: 0.82rem;
    color: #e2e8f0;
    font-weight: 500;
}

.substation-notes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #2d3748;
}

.substation-notes-text {
    font-size: 0.75rem;
    color: #cbd5e1;
    font-style: italic;
    line-height: 1.5;
    margin-top: 4px;
}

/* ─── Constraint Breakdown (in info panel) ─── */
.constraint-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2d3748;
}

.constraint-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.constraint-subtitle {
    font-size: 0.65rem;
    color: #475569;
    font-style: italic;
    margin-bottom: 10px;
}

.constraint-bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.constraint-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.constraint-label {
    font-size: 0.65rem;
    color: #94a3b8;
    width: 110px;
    flex-shrink: 0;
    text-align: right;
}

.constraint-bar-bg {
    flex: 1;
    height: 10px;
    background: #1e293b;
    border-radius: 3px;
    overflow: hidden;
}

.constraint-bar-fill {
    height: 100%;
    background: #64748b;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.constraint-val {
    font-size: 0.65rem;
    color: #94a3b8;
    font-family: monospace;
    width: 42px;
    text-align: right;
    flex-shrink: 0;
}

/* ─── Network Document Links (in info panel) ─── */
.network-links {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2d3748;
}

.network-links-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.network-doc-link {
    display: block;
    font-size: 0.78rem;
    color: #3b82f6;
    text-decoration: none;
    padding: 4px 0;
}

.network-doc-link:hover {
    text-decoration: underline;
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    background: rgba(26, 26, 46, 0.95);
    border-radius: 12px;
    border: 1px solid #2d3748;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.3s, opacity 0.3s;
}

.info-panel.hidden {
    transform: translateX(400px);
    opacity: 0;
    pointer-events: none;
}

body.chat-open .info-panel {
    right: 440px; /* 420px chat width + 20px gap */
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-bottom: 1px solid #2d3748;
}

.info-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

#info-content {
    padding: 15px 20px;
    max-height: 500px;
    overflow-y: auto;
}

#info-content .placeholder {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px 0;
}

/* Feature Properties Table */
.feature-props {
    width: 100%;
    border-collapse: collapse;
}

.feature-props tr {
    border-bottom: 1px solid #2d3748;
}

.feature-props tr:last-child {
    border-bottom: none;
}

.feature-props td {
    padding: 8px 0;
    font-size: 0.8rem;
    vertical-align: top;
}

.feature-props .prop-name {
    color: #64748b;
    font-weight: 500;
    width: 40%;
    padding-right: 10px;
}

.feature-props .prop-value {
    color: #e2e8f0;
    word-break: break-word;
}

.feature-props .prop-value.highlight {
    color: #3b82f6;
    font-weight: 600;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 320px; /* Don't cover sidebar */
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 500; /* Below sidebar z-index (1000) */
    transition: opacity 0.5s, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .loading-overlay {
    left: 0;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #2d3748;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading-overlay p {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #3b4a5a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a5a6a;
}

/* Leaflet Overrides */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background: #1a1a2e !important;
    color: #e2e8f0 !important;
    border: 1px solid #2d3748 !important;
}

.leaflet-control-zoom a:hover {
    background: #2d3748 !important;
}

.leaflet-control-attribution {
    background: rgba(26, 26, 46, 0.8) !important;
    color: #64748b !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a {
    color: #94a3b8 !important;
}

/* ─── Weather Widget ─── */
.weather-widget {
    position: absolute;
    top: 12px;
    left: 332px;
    z-index: 500;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 12px;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .weather-widget {
    left: 12px;
}

.weather-widget.hidden {
    opacity: 0;
    pointer-events: none;
}

.weather-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-icon {
    font-size: 1.4rem;
}

.weather-temp {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
}

.weather-detail {
    font-size: 0.65rem;
    color: #94a3b8;
}

.weather-source {
    font-family: monospace;
    font-size: 0.55rem;
    color: #475569;
    text-decoration: none;
    padding: 1px 4px;
    border: 1px solid #334155;
    border-radius: 3px;
    margin-left: 4px;
    align-self: flex-start;
}

.weather-source:hover {
    color: #60a5fa;
    border-color: #60a5fa;
}

/* ─── Forecast Drawer (bottom slide-up panel) ─── */
.forecast-drawer {
    position: absolute;
    bottom: 0;
    left: 320px;
    right: 0;
    height: 82vh;
    background: rgba(22, 33, 62, 0.97);
    border-top: 2px solid #3b82f6;
    z-index: 900;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .forecast-drawer {
    left: 0;
}

.forecast-drawer.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.forecast-drawer-header {
    padding: 14px 24px 10px;
    border-bottom: 1px solid #2d3748;
    flex-shrink: 0;
}

.forecast-drawer-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forecast-drawer-title-row h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.forecast-drawer-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.locate-map-btn {
    padding: 3px 10px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid #334155;
    border-radius: 5px;
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.locate-map-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #93bbfc;
}

.forecast-drawer-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Year selector (shared by drawer + tab) */
.forecast-year-selector {
    display: flex;
    gap: 4px;
    background: #1e293b;
    border-radius: 6px;
    padding: 2px;
}

.year-btn {
    padding: 4px 12px;
    background: none;
    border: none;
    border-radius: 4px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.year-btn:hover {
    color: #94a3b8;
}

.year-btn.active {
    background: #3b82f6;
    color: #fff;
}

.forecast-drawer-stats {
    display: flex;
    gap: 24px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.forecast-stat {
    display: flex;
    flex-direction: column;
}

.forecast-stat-label {
    font-size: 0.6rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forecast-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
}

.forecast-stat-value.positive {
    color: #f87171;
}

.forecast-stat-value.negative {
    color: #4ade80;
}

.forecast-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.forecast-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 380px;
}

.forecast-dr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
    min-height: 260px;
}

.forecast-chart-sm {
    min-height: 240px !important;
}

.forecast-dr-events {
    flex: 1;
    overflow-y: auto;
    max-height: 320px;
    padding-right: 4px;
}

.dr-evt-mini {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(45, 55, 72, 0.4);
}

.dr-evt-mini:last-child {
    border-bottom: none;
}

.dr-evt-mini-date {
    font-size: 0.65rem;
    color: #64748b;
    font-family: monospace;
    white-space: nowrap;
    min-width: 52px;
}

.dr-evt-mini-body {
    flex: 1;
}

.dr-evt-mini-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.dr-evt-mini-program {
    font-size: 0.68rem;
    font-weight: 700;
    color: #e2e8f0;
}

.dr-evt-mini-type {
    font-size: 0.58rem;
    padding: 0 4px;
    border-radius: 3px;
    border: 1px solid #334155;
    color: #94a3b8;
}

.dr-evt-mini-type.imm {
    border-color: #ef4444;
    color: #fca5a5;
}

.dr-evt-mini-type.cont {
    border-color: #f59e0b;
    color: #fcd34d;
}

.dr-evt-mini-time {
    font-size: 0.6rem;
    color: #64748b;
    font-family: monospace;
    margin-left: auto;
}

.dr-evt-mini-mw {
    font-size: 0.65rem;
    color: #94a3b8;
}

.dr-evt-mini-mw .perf-good { color: #4ade80; }
.dr-evt-mini-mw .perf-mid { color: #f59e0b; }
.dr-evt-mini-mw .perf-bad { color: #ef4444; }

.dr-no-events {
    color: #475569;
    font-size: 0.78rem;
    text-align: center;
    padding: 30px 10px;
    font-style: italic;
}

.forecast-chart-panel {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.forecast-chart-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.chart-year-label {
    color: #3b82f6;
    font-weight: 700;
}

.chart-subtitle {
    font-weight: 400;
    color: #64748b;
    font-size: 0.65rem;
    text-transform: none;
    letter-spacing: 0;
}

.forecast-chart {
    flex: 1;
    min-height: 380px;
}

/* ─── Forecast Tab (sidebar system-wide views) ─── */
.forecast-sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.forecast-sort-label {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

.forecast-tab-chart-section {
    padding: 0 !important;
    border-bottom: none !important;
}

.forecast-tab-chart-container {
    min-height: 500px;
    padding: 0 4px;
}

/* ─── "View Forecast" button in info panel ─── */
.view-forecast-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    letter-spacing: 0.3px;
}

.view-forecast-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.view-forecast-btn .btn-subtitle {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

/* ─── Chat Panel ─── */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
    border: none;
    color: #1a1a2e;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 165, 116, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 28px rgba(212, 165, 116, 0.5);
}

.chat-fab.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chat-fab-text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.5px;
}

.chat-fab-sparkle {
    width: 10px;
    height: 10px;
    fill: currentColor;
    margin-left: 2px;
    margin-bottom: 8px;
    opacity: 0.9;
}

/* Chat panel overlay */
.chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    z-index: 1200;
    background: #1a1a2e;
    border-left: 1px solid #2d3748;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
}

.chat-panel.open {
    transform: translateX(0);
}

/* Chat header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-bottom: 1px solid #2d3748;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #1a1a2e;
    flex-shrink: 0;
}

.chat-header-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.chat-header-subtitle {
    font-size: 0.65rem;
    color: #64748b;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 6px;
}

.chat-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Welcome / empty state */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 20px;
    gap: 16px;
}

.chat-welcome-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #1a1a2e;
}

.chat-disclaimer {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.72rem;
    color: #fca5a5;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 8px;
}

.chat-welcome h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
}

.chat-welcome p {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    max-width: 300px;
}

/* Suggested questions */
.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 340px;
}

.chat-suggestion-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #2d3748;
    border-radius: 10px;
    padding: 10px 14px;
    color: #94a3b8;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.chat-suggestion-btn:hover {
    border-color: #d4a574;
    color: #e2e8f0;
    background: rgba(212, 165, 116, 0.06);
}

/* Message bubbles */
.chat-msg {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    animation: chatMsgIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chat-msg.user {
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-top: 2px;
}

.chat-msg.assistant .chat-msg-avatar {
    background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
    color: #1a1a2e;
}

.chat-msg.user .chat-msg-avatar {
    background: #3b82f6;
    color: #fff;
}

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.6;
    max-width: calc(100% - 42px);
    overflow-wrap: break-word;
}

.chat-msg.assistant .chat-msg-bubble {
    background: rgba(30, 41, 59, 0.7);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-msg-bubble {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Markdown styling within bubbles */
.chat-msg-bubble p {
    margin: 0 0 8px 0;
}

.chat-msg-bubble p:last-child {
    margin-bottom: 0;
}

.chat-msg-bubble strong {
    color: #fff;
    font-weight: 600;
}

.chat-msg-bubble code {
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
}

.chat-msg-bubble pre {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    margin: 8px 0;
}

.chat-msg-bubble pre code {
    background: none;
    padding: 0;
}

.chat-msg-bubble ul, .chat-msg-bubble ol {
    margin: 6px 0;
    padding-left: 18px;
}

.chat-msg-bubble li {
    margin: 3px 0;
}

.chat-msg-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
    font-size: 0.75rem;
}

.chat-msg-bubble th,
.chat-msg-bubble td {
    border: 1px solid #334155;
    padding: 5px 8px;
    text-align: left;
}

.chat-msg-bubble th {
    background: rgba(0, 0, 0, 0.2);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.chat-msg-bubble td {
    color: #e2e8f0;
}

.chat-msg-bubble h1, .chat-msg-bubble h2, .chat-msg-bubble h3, .chat-msg-bubble h4 {
    color: #fff;
    margin: 12px 0 6px 0;
    font-size: 0.88rem;
    font-weight: 600;
}

.chat-msg-bubble h1:first-child, .chat-msg-bubble h2:first-child, .chat-msg-bubble h3:first-child {
    margin-top: 0;
}

.chat-msg-bubble blockquote {
    border-left: 3px solid #d4a574;
    padding-left: 10px;
    margin: 8px 0;
    color: #94a3b8;
    font-style: italic;
}

.chat-msg-bubble a {
    color: #60a5fa;
    text-decoration: none;
}

.chat-msg-bubble a:hover {
    text-decoration: underline;
}

.chat-msg-bubble hr {
    border: none;
    border-top: 1px solid #334155;
    margin: 10px 0;
}

/* AI disclaimer */
.chat-msg-disclaimer {
    width: 100%;
    font-size: 0.65rem;
    color: #64748b;
    margin-top: -2px;
    padding-left: 34px;
    font-style: italic;
    opacity: 0.7;
}

/* Typing indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.chat-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    animation: typingPulse 1.4s ease-in-out infinite;
}

.chat-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-typing-label {
    font-size: 0.7rem;
    color: #475569;
}

/* Chat input area */
.chat-input-area {
    padding: 12px 16px 16px;
    border-top: 1px solid #2d3748;
    background: rgba(22, 33, 62, 0.5);
    flex-shrink: 0;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input::placeholder {
    color: #475569;
}

.chat-input:focus {
    border-color: #d4a574;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
    border: none;
    color: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(212, 165, 116, 0.3);
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.chat-input-hint {
    font-size: 0.6rem;
    color: #334155;
    text-align: center;
    margin-top: 6px;
}

/* ─── Demand Response Section (Info Panel) ─── */
.dr-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2d3748;
}

.dr-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.dr-summary-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.dr-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dr-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f59e0b;
}

.dr-stat-value.dr-low {
    color: #ef4444;
}

.dr-stat-label {
    font-size: 0.6rem;
    color: #64748b;
    text-transform: uppercase;
}

.dr-program-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dr-program-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    padding: 3px 0;
}

.dr-program-name {
    color: #94a3b8;
    flex-shrink: 0;
}

.dr-program-val {
    color: #e2e8f0;
    text-align: right;
    font-family: monospace;
    font-size: 0.68rem;
}

.dr-source-note {
    margin-top: 8px;
    font-size: 0.6rem;
    color: #475569;
    font-style: italic;
}

/* ─── DR Tab (Sidebar) ─── */
.dr-system-summary {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #2d3748;
    border-radius: 8px;
    margin-bottom: 12px;
    justify-content: space-around;
}

.dr-sys-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dr-sys-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f59e0b;
}

.dr-sys-label {
    font-size: 0.55rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dr-rank-row {
    padding: 8px 0;
    border-bottom: 1px solid rgba(45, 55, 72, 0.5);
    cursor: pointer;
    transition: background 0.15s;
}

.dr-rank-row:hover {
    background: rgba(59, 130, 246, 0.05);
}

.dr-rank-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.dr-rank-num {
    font-size: 0.65rem;
    color: #475569;
    width: 18px;
    text-align: right;
    flex-shrink: 0;
}

.dr-rank-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    flex: 1;
}

.dr-tier2-badge {
    background: #ef4444;
    color: #fff;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 700;
}

.dr-rank-subzone {
    font-size: 0.6rem;
    color: #64748b;
    font-family: monospace;
}

.dr-rank-bar-bg {
    height: 4px;
    background: #1e293b;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 3px;
}

.dr-rank-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dr-rank-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #64748b;
}

.dr-cov-low {
    color: #ef4444 !important;
}

.dr-cov-med {
    color: #f59e0b !important;
}

.dr-cov-ok {
    color: #4ade80 !important;
}

/* ─── DR Event Timeline ─── */
.dr-event-day {
    margin-bottom: 12px;
}

.dr-event-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(45, 55, 72, 0.5);
}

.dr-event-card {
    background: rgba(30, 41, 59, 0.4);
    border-left: 3px solid #475569;
    border-radius: 0 4px 4px 0;
    padding: 6px 10px;
    margin-bottom: 4px;
}

.dr-event-card.dr-evt-csrp {
    border-left-color: #3b82f6;
}

.dr-event-card.dr-evt-dlrp {
    border-left-color: #ef4444;
}

.dr-event-card.dr-evt-dlm {
    border-left-color: #8b5cf6;
}

.dr-event-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.dr-event-program {
    font-size: 0.68rem;
    font-weight: 700;
    color: #e2e8f0;
}

.dr-event-type {
    font-size: 0.6rem;
    color: #94a3b8;
    padding: 0 4px;
    border: 1px solid #334155;
    border-radius: 3px;
}

.dr-event-type.dr-evt-imm {
    border-color: #ef4444;
    color: #fca5a5;
}

.dr-event-type.dr-evt-cont {
    border-color: #f59e0b;
    color: #fcd34d;
}

.dr-event-time {
    font-size: 0.6rem;
    color: #64748b;
    font-family: monospace;
    margin-left: auto;
}

.dr-event-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
}

.dr-event-networks {
    color: #94a3b8;
}

.dr-event-mw {
    color: #64748b;
    font-family: monospace;
}

/* ── 3D Visualization ── */

.viz3d-fab {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #60a5fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px rgba(96,165,250,0.2);
    transition: all 0.2s;
}
.viz3d-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(96,165,250,0.3), 0 0 0 1px rgba(96,165,250,0.4);
}
.viz3d-fab-text {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.5px;
}
.viz3d-fab-icon {
    display: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Overlay (full-screen, above everything) */
.viz3d-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #0a0a1a;
    display: flex;
    flex-direction: column;
}
.viz3d-canvas {
    flex: 1;
    position: relative;
}
.viz3d-canvas canvas { border-radius: 0; }
.viz3d-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 16px;
    font-weight: 500;
}
.viz3d-error { color: #f87171; }

/* Top bar */
.viz3d-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(10,10,26,0.9) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}
.viz3d-top-bar > * { pointer-events: auto; }
.viz3d-title {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.viz3d-title-icon { font-size: 20px; }
.viz3d-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(15,23,42,0.8);
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.viz3d-close:hover { background: rgba(239,68,68,0.2); color: #f87171; border-color: rgba(239,68,68,0.3); }

/* HUD (bottom controls) */
.viz3d-hud {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px 20px;
    background: linear-gradient(0deg, rgba(10,10,26,0.95) 0%, rgba(10,10,26,0.7) 60%, transparent 100%);
    z-index: 2;
}
.viz3d-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.viz3d-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15,23,42,0.7);
    color: #e2e8f0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.viz3d-ctrl-btn:hover { background: rgba(30,41,59,0.9); border-color: rgba(96,165,250,0.3); }
.viz3d-play-btn { width: 44px; font-size: 18px; }
.viz3d-speed-btn { width: auto; padding: 0 10px; font-size: 12px; font-weight: 600; font-family: monospace; }

.viz3d-timeline {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.viz3d-scrubber {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    outline: none;
    cursor: pointer;
}
.viz3d-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #60a5fa;
    border: 2px solid #0f172a;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(96,165,250,0.4);
}
.viz3d-scrubber::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #60a5fa;
    border: 2px solid #0f172a;
    cursor: pointer;
}
.viz3d-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.viz3d-time-label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
}
.viz3d-stats-label {
    font-size: 12px;
    color: #94a3b8;
    font-family: monospace;
    white-space: nowrap;
}

/* Legend */
.viz3d-legend {
    position: absolute;
    top: 70px;
    right: 24px;
    background: rgba(15,23,42,0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 16px;
    z-index: 2;
    min-width: 140px;
}
.viz3d-legend-title {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.viz3d-legend-bar {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #0044ff, #00ccff, #ffff00, #ff8800, #ff0000);
    margin-bottom: 4px;
}
.viz3d-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #64748b;
}
.viz3d-legend-item {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #94a3b8;
}
.viz3d-legend-dr .viz3d-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff2d6f;
    box-shadow: 0 0 8px rgba(255,45,111,0.7);
    animation: viz3d-pulse 1.5s ease-in-out infinite;
}
@keyframes viz3d-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* Responsive */
@media (max-width: 768px) {
    .disclaimer-content {
        padding: 8px 12px;
    }
    
    .disclaimer-text {
        font-size: 0.7rem;
        line-height: 1.4;
    }

    .sidebar {
        width: 100% !important;
        height: auto;
        max-height: 40vh;
        position: relative;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    #map {
        left: 0;
        top: 40vh;
        height: 60vh;
    }
    
    .info-panel {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 20px;
        top: auto;
        max-height: 50vh;
    }
    
    .info-panel.hidden {
        transform: translateY(100%);
    }
    
    .forecast-drawer {
        left: 0;
        height: 55vh;
    }
    
    .forecast-chart-grid,
    .forecast-dr-row {
        grid-template-columns: 1fr;
    }
    
    .chat-panel {
        width: 100%;
    }
    
    .chat-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}
