/* ==========================================================================
   EWS DAS SANGGAI - STYLESHEET
   BWS Kalimantan IV Samarinda - Kementerian Pekerjaan Umum
   Design faithfully recreated from /ewsfo mockups
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Surface & Backgrounds */
  --bg-app: #eef3f8;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-subtle: #f1f5f9;

  /* Typography */
  --font-sans: 'Inter', Helvetica, sans-serif;
  --font-mono: 'Inter', Helvetica, sans-serif;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  /* Brand Colors */
  --pu-blue: #0c3b6d;
  --pu-blue-dark: #072545;
  --pu-blue-light: #e0f2fe;
  --brand-blue: var(--pu-blue);
  --pu-yellow: #f59e0b;
  --pu-yellow-bright: #fbbf24;

  /* Status Levels */
  --status-normal: #10b981;
  --status-normal-bg: #ecfdf5;
  --status-normal-border: #a7f3d0;
  --status-normal-text: #065f46;

  --status-waspada: #eab308;
  --status-waspada-bg: #fefce8;
  --status-waspada-border: #fef08a;
  --status-waspada-text: #854d0e;

  --status-siaga: #f97316;
  --status-siaga-bg: #fff7ed;
  --status-siaga-border: #fed7aa;
  --status-siaga-text: #9a3412;

  --status-awas: #ef4444;
  --status-awas-bg: #fef2f2;
  --status-awas-border: #fecaca;
  --status-awas-text: #991b1b;

  /* Rainfall Intensity */
  --rain-sangat-lebat-bg: #fee2e2;
  --rain-sangat-lebat-text: #b91c1c;
  --rain-lebat-bg: #ffedd5;
  --rain-lebat-text: #c2410c;
  --rain-sedang-bg: #fef3c7;
  --rain-sedang-text: #b45309;
  --rain-ringan-bg: #e0f2fe;
  --rain-ringan-text: #0369a1;
  --rain-tidak-hujan-bg: #f1f5f9;
  --rain-tidak-hujan-text: #64748b;

  /* Chart Colors */
  --chart-rain-actual: #38bdf8;
  --chart-rain-forecast: #c4b5fd;
  --chart-tma-actual: #0284c7;
  --chart-tma-forecast: #f59e0b;

  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);

  /* Dimensions */
  --header-height: 64px;
  --nav-height: 48px;
  --footer-height: 38px;
  --mobile-nav-width: 84px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-app: #0b1120;
  --surface: #131d31;
  --surface-alt: #1a2742;
  --surface-hover: #223254;
  --border: #263654;
  --border-strong: #334b75;
  --border-subtle: #1c2b47;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --pu-blue: #1d4ed8;
  --pu-blue-dark: #0f172a;
  --pu-blue-light: #1e3a8a;

  --status-normal-bg: #064e3b33;
  --status-normal-border: #065f46;
  --status-normal-text: #6ee7b7;

  --status-waspada-bg: #713f1233;
  --status-waspada-border: #854d0e;
  --status-waspada-text: #fde047;

  --status-siaga-bg: #7c2d1233;
  --status-siaga-border: #9a3412;
  --status-siaga-text: #fdba74;

  --status-awas-bg: #7f1d1d33;
  --status-awas-border: #991b1b;
  --status-awas-text: #fca5a5;

  --rain-sangat-lebat-bg: #450a0a;
  --rain-sangat-lebat-text: #fca5a5;
  --rain-lebat-bg: #431407;
  --rain-lebat-text: #fdba74;
  --rain-sedang-bg: #422006;
  --rain-sedang-text: #fde047;
  --rain-ringan-bg: #082f49;
  --rain-ringan-text: #7dd3fc;
  --rain-tidak-hujan-bg: #1e293b;
  --rain-tidak-hujan-text: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

a {
  text-decoration: none;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Main Layout Wrapper */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-app);
  transition: all 0.25s ease;
}

/* ==========================================================================
   TOP HEADER (with IKN Skyline Background)
   ========================================================================== */
.main-header {
  min-height: 128px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 28px 48px 28px;
  position: relative;
  z-index: 30;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.25s ease;
}

.header-skyline-bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/dashboard-skyline.png');
  background-repeat: no-repeat;
  background-position: 78% bottom;
  background-size: cover;
  opacity: 0.78;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s ease;
}

[data-theme="dark"] .header-skyline-bg {
  opacity: 0.24;
  filter: invert(1) hue-rotate(180deg) brightness(0.85);
}

.header-skyline-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.20) 40%,
    rgba(238, 243, 248, 0.35) 75%,
    rgba(238, 243, 248, 0.85) 100%
  );
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .header-skyline-overlay {
  background: linear-gradient(
    to bottom,
    rgba(19, 29, 49, 0.85) 0%,
    rgba(19, 29, 49, 0.25) 40%,
    rgba(11, 17, 32, 0.40) 75%,
    rgba(11, 17, 32, 0.85) 100%
  );
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.pu-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .brand-title {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.brand-divider {
  width: 1px;
  height: 28px;
  background-color: var(--border-strong);
}

.brand-ministry {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.ministry-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.balai-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.live-clock-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  background: none;
  padding: 0;
  border: none;
  box-shadow: none;
}

.live-clock {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .live-clock {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.clock-tz {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .clock-tz {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
  position: relative;
}

.icon-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-main);
}

.badge-counter {
  position: absolute;
  top: 3px;
  right: 3px;
  background-color: var(--status-awas);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface);
}

.mobile-toggle-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  background-color: var(--surface-hover);
  border: 1px solid var(--border);
}

/* ==========================================================================
   DESKTOP TOP NAVIGATION BAR (Centered Floating Island - Rounded, NOT Capsule)
   ========================================================================== */
.top-nav-bar {
  position: relative;
  z-index: 45;
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: -38px auto 2px auto;
  background-color: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  padding: 5px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 36px -4px rgba(12, 59, 109, 0.16), 0 4px 14px -2px rgba(12, 59, 109, 0.06);
  transition: all 0.25s ease;
}

[data-theme="dark"] .top-nav-bar {
  background-color: rgba(19, 29, 49, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(38, 54, 84, 0.90);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.nav-tabs-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  transition: all 0.18s ease;
  white-space: nowrap;
}

[data-theme="dark"] .nav-tab-btn {
  color: #94a3b8;
}

.nav-tab-btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.18s ease;
  stroke: #475569;
}

[data-theme="dark"] .nav-tab-btn svg {
  stroke: #94a3b8;
}

.nav-tab-btn:hover {
  background-color: rgba(241, 245, 249, 0.85);
  color: #0f172a;
}

.nav-tab-btn:hover svg {
  stroke: #0f172a;
}

[data-theme="dark"] .nav-tab-btn:hover {
  background-color: rgba(34, 50, 84, 0.7);
  color: #f1f5f9;
}

[data-theme="dark"] .nav-tab-btn:hover svg {
  stroke: #f1f5f9;
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, #093464 0%, #0c3b6d 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(12, 59, 109, 0.32);
}

.nav-tab-btn.active svg {
  stroke: #ffffff;
}

[data-theme="dark"] .nav-tab-btn.active {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(29, 78, 216, 0.4);
}

/* ==========================================================================
   MOBILE RIGHT NAVIGATION (As in ewsfo/mobile nav.png)
   ========================================================================== */
.mobile-nav-drawer {
  display: none; /* Hidden on desktop by default */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--mobile-nav-width);
  background-color: #ffffff;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
  flex-direction: column;
  z-index: 1000;
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Force mobile preview mode on desktop when toggled */
.force-mobile-preview .main-header {
  min-height: 68px;
  padding: 10px 16px;
  align-items: center;
}

.force-mobile-preview .top-nav-bar {
  display: none !important;
}

.force-mobile-preview .mobile-nav-drawer {
  display: flex !important;
}

.force-mobile-preview .main-content {
  padding-right: calc(var(--mobile-nav-width) + 16px) !important;
}

.force-mobile-preview .beranda-top-grid,
.force-mobile-preview .pos-grid-layout,
.force-mobile-preview .ews-grid-layout,
.force-mobile-preview .neraca-grid-layout {
  grid-template-columns: 1fr !important;
}

.force-mobile-preview .card-peta,
.force-mobile-preview .pos-right-col {
  grid-column: span 1 !important;
}

.force-mobile-preview .sensor-cards-grid,
.force-mobile-preview .pos-bottom-split,
.force-mobile-preview .neraca-kpi-row {
  grid-template-columns: 1fr 1fr !important;
}

[data-theme="dark"] .mobile-nav-drawer {
  background-color: #111a2e;
  border-left-color: var(--border);
}

.mobile-nav-drawer.hidden-mobile {
  transform: translateX(100%);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  list-style: none;
  padding-top: 10px;
}

.mobile-nav-item {
  width: 100%;
}

.mobile-nav-btn {
  width: 100%;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 6px;
  text-align: center;
  color: #334155;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
}

[data-theme="dark"] .mobile-nav-btn {
  color: #cbd5e1;
  border-bottom-color: var(--border-subtle);
}

.mobile-nav-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
  color: inherit;
}

.mobile-nav-btn span {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.15;
  max-width: 72px;
  word-break: break-word;
}

.mobile-nav-btn:hover {
  background-color: #f8fafc;
  color: var(--text-main);
}

/* Active style exactly matches mobile nav.png: solid dark navy fill, white text/icon */
.mobile-nav-btn.active {
  background-color: #083870 !important;
  color: #ffffff !important;
}

.mobile-nav-btn.active svg {
  stroke: #ffffff !important;
}

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 990;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   MAIN DASHBOARD CONTENT
   ========================================================================== */
.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 20px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: padding-right 0.28s ease;
}

/* Card Shell */
.dash-card {
  min-width: 0;
  max-width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.card-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--surface);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon {
  width: 16px;
  height: 16px;
  color: var(--pu-blue);
}

.card-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Chart Header Period Selector (Matches screenshot) */
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.chart-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.chart-period-selector {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chart-period-label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .chart-period-label {
  color: #94a3b8;
}

.chart-period-pill-group {
  display: inline-flex;
  align-items: center;
  background-color: #e8edf3;
  padding: 3px;
  border-radius: 9999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .chart-period-pill-group {
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.chart-period-btn {
  border: none;
  background: transparent;
  color: #334155;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  line-height: 1.2;
}

[data-theme="dark"] .chart-period-btn {
  color: #cbd5e1;
}

.chart-period-btn:hover:not(.active) {
  color: #0f172a;
}

[data-theme="dark"] .chart-period-btn:hover:not(.active) {
  color: #ffffff;
}

.chart-period-btn.active {
  background-color: #0070ba;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1.5px 4px rgba(0, 112, 186, 0.35);
}

/* EWS trend horizon buttons; the chart marks the phase boundaries. */
.ews-metric-selector,
.ews-horizon-selector {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background-color: #e8edf3;
  border-radius: 9999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .ews-metric-selector,
[data-theme="dark"] .ews-horizon-selector {
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ews-metric-trigger,
.ews-horizon-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: #334155;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .ews-metric-trigger,
[data-theme="dark"] .ews-horizon-trigger { color: #cbd5e1; }
.ews-metric-trigger:hover:not(.active),
.ews-horizon-trigger:hover:not(.active) { color: #0f172a; }
[data-theme="dark"] .ews-metric-trigger:hover:not(.active),
[data-theme="dark"] .ews-horizon-trigger:hover:not(.active) { color: #ffffff; }
.ews-metric-trigger.active,
.ews-horizon-trigger.active {
  background-color: #0070ba;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1.5px 4px rgba(0, 112, 186, 0.35);
}
.ews-metric-trigger { min-width:54px; justify-content:center; }
.ews-horizon-trigger { min-width:88px; flex-direction:column; gap:1px; padding:5px 13px; }
.ews-horizon-trigger strong { font-size:11px; line-height:1.1; }.ews-horizon-trigger small { font-size:8px; font-weight:700; line-height:1.1; opacity:.82; }
.ews-full-trend-card[data-chart-metric="tma"] .chart-legend-entry[data-series="rain"],
.ews-full-trend-card[data-chart-metric="rain"] .chart-legend-entry[data-series="tma"] { display:none; }
/* Pulsing Live Dot */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--status-normal);
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-normal);
  border-radius: 999px;
  position: relative;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background-color: var(--status-normal);
  opacity: 0.6;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* A pos whose real latest reading is old (device hasn't reported recently) —
   same dot, muted gray instead of the pulsing green "live" look, no ping
   animation, so it doesn't visually claim to be real-time when it isn't. */
.live-dot.live-dot-stale,
.live-dot.live-dot-stale::after {
  background-color: var(--text-muted);
}
.live-dot.live-dot-stale::after {
  animation: none;
  opacity: 0;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* ==========================================================================
   BERANDA - 3 COLUMN TOP GRID
   ========================================================================== */
.beranda-top-grid {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  /* Zero minimums let all three cards shrink to the available viewport width. */
  grid-template-columns: minmax(0, 1.95fr) minmax(0, 0.78fr) minmax(0, 1.25fr);
  gap: 14px;
  align-items: stretch;
}

.beranda-top-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* Beranda situational dashboard */
.beranda-data-bridge { display: none !important; }
.situation-dashboard { display: grid; gap: 14px; min-width: 0; }
.situation-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.situation-kpi {
  --situation-accent: #10b981;
  display: grid;
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--situation-accent) 32%, #dbe7f0);
  border-left: 4px solid var(--situation-accent);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff 55%, color-mix(in srgb, var(--situation-accent) 10%, #fff));
  box-shadow: 0 5px 16px rgba(31, 75, 109, 0.12);
  padding: 12px 14px;
}
.situation-kpi.watch { --situation-accent: #eab308; }
.situation-kpi.alert { --situation-accent: #f97316; }
.situation-kpi.danger { --situation-accent: #ef4444; }
.situation-kpi-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--situation-accent) 13%, #fff); color: var(--situation-accent); font-size: 27px; font-weight: 900; }
.situation-kpi div { min-width: 0; }
.situation-kpi small { display: block; color: #526681; font-size: 10px; font-weight: 800; }
.situation-kpi strong { display: flex; min-width: 0; align-items: center; gap: 7px; overflow: hidden; margin-top: 2px; color: #0b2142; font-size: 17px; font-weight: 900; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.situation-kpi strong em { border-radius: 999px; background: color-mix(in srgb, var(--situation-accent) 18%, #fff); padding: 3px 7px; color: color-mix(in srgb, var(--situation-accent) 78%, #0f172a); font-size: 9px; font-style: normal; }
.situation-kpi p { overflow: hidden; margin: 4px 0 0; color: #61758a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.situation-main-grid { display: grid; min-width: 0; grid-template-columns: minmax(235px, .82fr) minmax(440px, 2.1fr) minmax(250px, .9fr); gap: 14px; align-items: stretch; }
.situation-main-grid > * { min-width: 0; }
.situation-card-title { display: flex; align-items: center; gap: 7px; border-bottom: 1px solid #dbe7f0; padding: 11px 13px; color: #0b3063; }
.situation-card-title > span { color: #0785cf; font-size: 19px; font-weight: 900; }
.situation-card-title > strong { font-size: 13px; font-weight: 900; }
.situation-priority { overflow: hidden; }
.situation-priority-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 8px; border-radius: 8px; background: #edf4f9; padding: 3px; }
.situation-priority-tabs button { border: 0; border-radius: 6px; background: transparent; padding: 6px 3px; color: #64748b; cursor: pointer; font: inherit; font-size: 9px; font-weight: 800; text-align: center; }
.situation-priority-tabs button:hover:not(.active) { background: #dfeaf2; color: #244765; }
.situation-priority-tabs button:focus-visible { outline: 2px solid #38a9e6; outline-offset: 1px; }
.situation-priority-tabs .active { background: #087bbd; box-shadow: 0 2px 6px #087bbd45; color: #fff; }
.situation-priority-list { display: grid; gap: 7px; padding: 0 8px 9px; }
.situation-priority-empty { margin: 12px 4px; color: #64748b; font-size: 9px; text-align: center; }
.situation-priority-list button { display: grid; width: 100%; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid #dce8f1; border-radius: 10px; background: #f9fcfe; padding: 8px; text-align: left; }
.situation-priority-list button:hover { border-color: #79bde1; background: #eef8fe; }
.situation-priority-list button > i { width: 7px; height: 100%; min-height: 44px; border-radius: 999px; background: #10b981; }
.situation-priority-list button > i.watch { background: #eab308; }
.situation-priority-list button > i.alert { background: #f97316; }
.situation-priority-list button > i.danger { background: #ef4444; }
.situation-priority-list button > span { min-width: 0; }
.situation-priority-list strong, .situation-priority-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.situation-priority-list strong { color: #16365a; font-size: 10.5px; }
.situation-priority-list small { margin-top: 2px; color: #60758a; font-size: 8px; }
.situation-priority-list em { border-radius: 999px; padding: 4px 7px; background: #dcfce7; color: #087a45; font-size: 8px; font-style: normal; font-weight: 900; }
.situation-priority-list em.watch { background: #fef9c3; color: #8a6500; }
.situation-priority-list em.alert { background: #ffedd5; color: #b54708; }
.situation-priority-list em.danger { background: #fee2e2; color: #b91c1c; }
.situation-priority-list .situation-subdas-card { --subdas-accent:var(--status-normal); --subdas-soft:var(--status-normal-bg); --subdas-border:var(--status-normal-border); --subdas-text:var(--status-normal-text); display:grid; min-width:0; min-height:132px; grid-template-columns:minmax(0,1fr); align-items:stretch; gap:7px; overflow:hidden; border-color:#d7e5ef; border-radius:13px; background:linear-gradient(120deg,#fff 58%,color-mix(in srgb,var(--subdas-soft) 55%,#fff)); padding:8px; box-shadow:0 4px 10px #315c7a14; }
.situation-priority-list .situation-subdas-card.watch { --subdas-accent:var(--status-waspada); --subdas-soft:var(--status-waspada-bg); --subdas-border:var(--status-waspada-border); --subdas-text:var(--status-waspada-text); }.situation-priority-list .situation-subdas-card.alert { --subdas-accent:var(--status-siaga); --subdas-soft:var(--status-siaga-bg); --subdas-border:var(--status-siaga-border); --subdas-text:var(--status-siaga-text); }.situation-priority-list .situation-subdas-card.danger { --subdas-accent:var(--status-awas); --subdas-soft:var(--status-awas-bg); --subdas-border:var(--status-awas-border); --subdas-text:var(--status-awas-text); }
.situation-priority-list .situation-subdas-card:hover { border-color:var(--subdas-border); background:linear-gradient(120deg,#fff 50%,color-mix(in srgb,var(--subdas-soft) 80%,#fff)); box-shadow:0 6px 15px color-mix(in srgb,var(--subdas-accent) 14%,transparent); }
.subdas-priority-overview { display:grid; min-width:0; grid-template-columns:39px minmax(62px,.9fr) minmax(0,1.45fr); gap:7px; align-items:center; }
.subdas-priority-landscape { position:relative; display:block; width:39px; height:39px; overflow:hidden; border-radius:50%; background:radial-gradient(26px 18px at 22% 55%,#2d8d8a 0 48%,transparent 50%),radial-gradient(30px 22px at 73% 58%,#4eb468 0 48%,transparent 50%),linear-gradient(#bceaff 0 47%,#55c8f2 48% 100%); box-shadow:inset 0 0 0 1px #fff9; }
.subdas-priority-landscape::before { position:absolute; right:-3px; bottom:2px; left:-3px; height:13px; border-radius:50% 50% 35% 35%; background:#69d2f3; content:""; transform:rotate(-8deg); }.subdas-priority-landscape::after { position:absolute; right:7px; bottom:0; width:19px; height:13px; border-left:3px solid #e8fbff; border-radius:50%; content:""; transform:rotate(18deg); }.subdas-priority-landscape i { position:absolute; z-index:1; top:9px; left:5px; width:11px; height:6px; border-radius:50%; background:#fff9; }
.subdas-priority-identity { display:grid; min-width:0; justify-items:start; gap:5px; }
.situation-priority-list .subdas-priority-identity > strong { width:100%; color:#10214b; font-size:10px; font-weight:900; line-height:1.15; white-space:normal; }
.situation-priority-list .subdas-priority-identity > em { display:flex; align-items:center; gap:4px; border:1px solid var(--subdas-border); border-radius:999px; background:var(--subdas-soft); padding:3px 7px; color:var(--subdas-text); font-size:7px; }.subdas-priority-identity > em span { font-size:7px; }
.subdas-priority-rain { display:grid; min-width:0; grid-template-columns:25px minmax(0,1fr); gap:4px; align-items:center; border-left:1px solid #c9dce9; padding-left:7px; }
.subdas-priority-rain > i { color:#0797dc; font-size:21px; font-style:normal; }
.subdas-priority-rain > span { display:grid; min-width:0; gap:2px; }.subdas-priority-rain b { color:#17365b; font-size:7px; }.situation-priority-list .subdas-priority-rain strong { overflow:visible; border-radius:999px; background:#dff4fd; padding:3px 5px; color:#10214b; font-size:9px; font-weight:900; white-space:nowrap; }.situation-priority-list .subdas-priority-rain strong small { display:inline; margin:0; color:#3d5d81; font-size:5.5px; }.subdas-priority-rain strong em { padding:0 1px; background:transparent; color:#668098; font-size:7px; }.situation-priority-list .subdas-priority-rain > span > small { margin:0; color:#64748b; font-size:5.8px; line-height:1.2; white-space:normal; }
.subdas-priority-details { display:grid; min-width:0; grid-template-columns:1.25fr .85fr .85fr; align-items:stretch; border:1px solid #dceaf3; border-radius:10px; background:#fff9; box-shadow:0 3px 8px #315c7a0d; padding:5px 2px; }
.subdas-priority-detail { display:grid; min-width:0; grid-template-columns:18px minmax(0,1fr); gap:3px; align-items:center; border-right:1px solid #c9dce9; padding:1px 5px; }.subdas-priority-detail:last-child { border-right:0; }.subdas-priority-detail > i { color:#0797dc; font-size:15px; font-style:normal; }.subdas-priority-detail > span { display:grid; min-width:0; gap:1px; }.subdas-priority-detail b { color:#36546f; font-size:6px; }.situation-priority-list .subdas-priority-detail strong { color:#10214b; font-size:8.5px; font-weight:900; }.situation-priority-list .subdas-priority-detail small { margin:0; color:#64748b; font-size:5.4px; }.situation-priority-list .subdas-priority-detail em { justify-self:start; overflow:hidden; max-width:100%; border-radius:999px; background:#d6f2fc; padding:2px 5px; color:#075985; font-size:6px; text-overflow:ellipsis; white-space:nowrap; }
.situation-rain-list { gap:7px; }
.situation-priority-list .situation-rain-card { --rain-accent:#18aae2; position:relative; display:block; min-height:98px; overflow:hidden; border-color:#d4e4ef; border-radius:13px; background:linear-gradient(110deg,#fff 54%,color-mix(in srgb,var(--rain-accent) 6%,#f8fbfd)); padding:8px 9px 9px; box-shadow:0 4px 10px #315c7a17; }
.situation-priority-list .situation-rain-card::before { position:absolute; inset:0 auto 0 0; width:5px; border-radius:13px 0 0 13px; background:var(--rain-accent); content:""; }
.situation-priority-list .situation-rain-card:hover,.situation-priority-list .situation-rain-card.active { border-color:color-mix(in srgb,var(--rain-accent) 76%,#cbd5e1); background:linear-gradient(110deg,#fff 48%,color-mix(in srgb,var(--rain-accent) 10%,#f8fbfd)); box-shadow:0 5px 13px color-mix(in srgb,var(--rain-accent) 19%,transparent); }
.situation-priority-list .situation-rain-card.light { --rain-accent:#18aae2; }.situation-priority-list .situation-rain-card.watch { --rain-accent:#f59e0b; }.situation-priority-list .situation-rain-card.alert { --rain-accent:#f97316; }.situation-priority-list .situation-rain-card.danger { --rain-accent:#ef4444; }.situation-priority-list .situation-rain-card.dry,.situation-priority-list .situation-rain-card.muted { --rain-accent:#94a3b8; }
.rain-summary-head { display:grid; min-width:0; grid-template-columns:15px minmax(0,1fr) auto; gap:5px; align-items:center; border-bottom:1px solid #e1ebf2; padding:0 1px 5px; }
.rain-summary-head > i { width:11px; height:11px; border-radius:50%; background:#16a34a; box-shadow:0 0 0 3px #dcfce7,0 1px 4px #16a34a66; }
.rain-summary-head > i.offline { background:#94a3b8; box-shadow:0 0 0 3px #e2e8f0; }
.situation-priority-list .rain-summary-head > strong { min-width:0; overflow:hidden; color:#0b1f42; font-size:10.5px; font-weight:900; text-overflow:ellipsis; white-space:nowrap; }
.situation-priority-list .rain-summary-head > small { margin:0; color:#587594; font-size:7px; font-weight:800; }
.rain-summary-content { display:grid; min-width:0; grid-template-columns:minmax(0,1fr) 1px minmax(0,1fr) 42px; gap:5px; align-items:center; padding-top:6px; }
.rain-summary-separator { width:1px; height:46px; background:#cbdbe7; }
.rain-summary-metric { display:grid; min-width:0; grid-template-columns:22px minmax(0,1fr); gap:4px; align-items:start; }
.rain-summary-metric > svg { width:21px; height:24px; margin-top:3px; fill:none; stroke:#079bdc; stroke-linecap:round; stroke-linejoin:round; stroke-width:2.2; }
.rain-summary-metric > svg text { fill:#078bc9; stroke:none; font-size:7px; font-weight:900; text-anchor:middle; }
.rain-summary-metric > span { display:grid; min-width:0; gap:1px; }
.rain-summary-metric b { overflow:hidden; color:#142b4e; font-size:7px; font-weight:900; text-overflow:ellipsis; white-space:nowrap; }
.situation-priority-list .rain-summary-metric strong { display:block; overflow:visible; color:#10214b; font-size:11.5px; font-weight:900; line-height:1.05; white-space:nowrap; }
.situation-priority-list .rain-summary-metric strong small { display:inline; margin:0; color:#3d5d81; font-size:6px; font-weight:800; }
.rain-summary-metric em { justify-self:start; overflow:hidden; max-width:100%; margin-top:2px; border-radius:999px; background:#d7f4fd; padding:2px 5px; color:#075985; font-size:6.5px; font-style:normal; font-weight:900; line-height:1.1; text-overflow:ellipsis; white-space:nowrap; }
.rain-summary-metric em.dry,.rain-summary-metric em.muted { background:#e2e8f0; color:#475569; }.rain-summary-metric em.watch { background:#fef3c7; color:#a16207; }.rain-summary-metric em.alert { background:#ffedd5; color:#c2410c; }.rain-summary-metric em.danger { background:#fee2e2; color:#b91c1c; }
.rain-summary-weather { display:grid; min-width:0; place-items:center; }
.rain-summary-weather img { width:42px; height:42px; object-fit:contain; }
.situation-priority-list .situation-rain-all { display: flex; min-height: 28px; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; background: #e4f4fd; padding: 6px 8px; color: #075b9e; font-size: 8.5px; font-weight: 900; text-align: center; }
.situation-priority-list .situation-rain-all:hover { border: 0; background: #caebfb; }
.situation-rain-all span { font-size: 13px; line-height: .7; }
.situation-tma-list { gap: 7px; }
.situation-priority-list .situation-tma-card { --tma-priority-accent: var(--status-normal); --tma-priority-soft: var(--status-normal-bg); --tma-priority-border: var(--status-normal-border); --tma-priority-text: var(--status-normal-text); position: relative; display: grid; min-height: 124px; grid-template-columns: minmax(0, 1fr); align-items: stretch; overflow: hidden; gap: 7px; border-color: var(--tma-priority-border); border-radius: 13px; background: linear-gradient(112deg, #fff 45%, color-mix(in srgb, var(--tma-priority-soft) 72%, #fff)); padding: 9px 8px 9px 11px; box-shadow: 0 4px 10px #315c7a17; }
.situation-priority-list .situation-tma-card::before { position: absolute; inset: 0 auto 0 0; width: 5px; border-radius: 13px 0 0 13px; background: var(--tma-priority-accent); content: ""; }
.situation-priority-list .situation-tma-card:hover { border-color: var(--tma-priority-accent); background: linear-gradient(112deg, #fff 40%, color-mix(in srgb, var(--tma-priority-soft) 90%, #fff)); box-shadow: 0 5px 13px color-mix(in srgb, var(--tma-priority-accent) 18%, transparent); }
.situation-priority-list .situation-tma-card.watch { --tma-priority-accent: var(--status-waspada); --tma-priority-soft: var(--status-waspada-bg); --tma-priority-border: var(--status-waspada-border); --tma-priority-text: var(--status-waspada-text); }
.situation-priority-list .situation-tma-card.alert { --tma-priority-accent: var(--status-siaga); --tma-priority-soft: var(--status-siaga-bg); --tma-priority-border: var(--status-siaga-border); --tma-priority-text: var(--status-siaga-text); }
.situation-priority-list .situation-tma-card.danger { --tma-priority-accent: var(--status-awas); --tma-priority-soft: var(--status-awas-bg); --tma-priority-border: var(--status-awas-border); --tma-priority-text: var(--status-awas-text); }
.situation-priority-list .situation-tma-card.muted { --tma-priority-accent: #94a3b8; --tma-priority-soft: #f1f5f9; --tma-priority-border: #cbd5e1; --tma-priority-text: #475569; }
.situation-tma-head { display: grid; min-width: 0; grid-template-columns: 11px minmax(0, 1fr) auto; gap: 5px; align-items: center; border-bottom: 1px solid #e1ebf2; padding: 0 1px 5px; }
.situation-tma-head > i { width: 10px; height: 10px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px #dcfce7, 0 1px 4px #16a34a66; }
.situation-tma-head > i.offline { background: #94a3b8; box-shadow: 0 0 0 3px #e2e8f0; }
.situation-priority-list .situation-tma-head strong { min-width: 0; overflow: hidden; color: #0b1f42; font-size: 10.5px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.situation-priority-list .situation-tma-head small { margin: 0; color: #587594; font-size: 7px; font-weight: 800; }
.situation-tma-metrics { display: grid; min-width: 0; grid-template-columns: 1.25fr 1fr .85fr; align-items: stretch; }
.situation-tma-metric { display: grid; min-width: 0; grid-template-columns: 22px minmax(0, 1fr); gap: 3px; align-items: center; border-right: 1px solid #c9dce9; padding: 2px 5px; color: #0797dc; text-align: center; }
.situation-tma-metric:first-child { padding-left: 2px; }
.situation-tma-metric:last-child { border-right: 0; padding-right: 0; }
.situation-tma-metric.primary { position: relative; isolation: isolate; overflow: hidden; border-radius: 8px 0 0 8px; background: color-mix(in srgb, var(--tma-priority-soft) 50%, #f7fcff); }
.situation-tma-metric.primary::before { position: absolute; z-index: -1; right: -8px; bottom: -8px; left: -8px; height: 12px; background: radial-gradient(12px 6px at 12px 0, color-mix(in srgb, var(--tma-priority-accent) 12%, transparent) 98%, transparent 100%) 0 0/24px 12px repeat-x; opacity: .58; content: ""; }
.situation-tma-metric > span { display: grid; min-width: 0; gap: 1px; }
.situation-tma-metric > span > b { color: #284765; font-size: 7px; font-weight: 900; }
.situation-priority-list .situation-tma-metric strong { overflow: visible; color: #10214b; font-size: 10px; font-weight: 900; line-height: 1.05; white-space: nowrap; }
.situation-priority-list .situation-tma-metric.primary strong { font-size: 13px; }
.situation-priority-list .situation-tma-metric strong small { display: inline; margin: 0; color: #3d5d81; font-size: 7px; }
.situation-tma-gauge { position: relative; display: grid; width: 15px; height: 31px; align-content: space-around; border-right: 3px solid currentColor; border-left: 3px solid currentColor; font-style: normal; }
.situation-tma-gauge::before, .situation-tma-gauge::after { position: absolute; right: -6px; left: -6px; height: 3px; background: currentColor; content: ""; }
.situation-tma-gauge::before { top: 0; }.situation-tma-gauge::after { bottom: 0; }
.situation-tma-gauge b { width: 7px; height: 2px; justify-self: end; background: currentColor; }
.situation-tma-elevation-icon, .situation-tma-debit-icon { color: #0797dc; font-size: 21px; font-style: normal; font-weight: 900; line-height: 1; }
.situation-tma-footer { display: grid; min-width: 0; grid-template-columns: minmax(74px, .9fr) minmax(0, 1.6fr); gap: 7px; align-items: stretch; }
.situation-priority-list .situation-tma-footer > em { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--tma-priority-border); border-radius: 999px; background: var(--tma-priority-soft); padding: 4px 5px; color: var(--tma-priority-text); font-size: 7px; font-weight: 900; white-space: nowrap; }
.situation-priority-list .situation-tma-footer > em span { font-size: 8px; }
.situation-tma-trend { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 4px; border-radius: 999px; background: #e8f5fc; padding: 4px 6px; color: #075985; text-align: center; }
.situation-tma-trend.rising { background: #fff0f0; color: #dc2626; }
.situation-tma-trend.falling { background: #ecfdf3; color: #16a34a; }
.situation-priority-list .situation-tma-trend strong { color: inherit; font-size: 8px; }
.situation-tma-trend b { color: #102b55; font-size: 8.5px; font-weight: 900; white-space: nowrap; }
.situation-priority-list .situation-tma-trend small { margin: 0; color: #64748b; font-size: 6px; }
.situation-priority-list .situation-tma-all { display: flex; min-height: 28px; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; background: #e4f4fd; padding: 6px 8px; color: #075b9e; font-size: 8.5px; font-weight: 900; text-align: center; }
.situation-priority-list .situation-tma-all:hover { border: 0; background: #caebfb; }
.situation-tma-all span { font-size: 13px; line-height: .7; }
.beranda-situation-map { position: relative; min-height: 480px; }
.beranda-situation-map .map-canvas-container { min-height: 385px; }
.beranda-situation-map .map-legend-bar { padding: 6px 9px; font-size: 8.5px; }
.beranda-situation-map .legend-items { gap: 5px; }
.das-meteogram { position: absolute; z-index: 720; right: 9px; bottom: 34px; left: 9px; display: flex; flex-direction: column; align-items: stretch; filter: drop-shadow(0 5px 14px rgba(15, 39, 68, .22)); pointer-events: none; }
#ews-hazard-meteogram-root .das-meteogram { bottom:8px; }
.das-meteogram-handle { display: grid; min-height: 29px; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; align-self: center; gap: 6px; border: 1px solid rgba(2, 132, 199, .45); border-bottom: 0; border-radius: 10px 10px 0 0; background: rgba(248, 253, 255, .96); padding: 5px 11px; color: #075985; box-shadow: 0 -2px 8px rgba(15, 39, 68, .1); cursor: pointer; pointer-events: auto; }
.das-meteogram:not(.is-open) .das-meteogram-handle { border-bottom: 1px solid rgba(2, 132, 199, .45); border-radius: 999px; }
.das-meteogram-handle > span { font-size: 13px; line-height: 1; }
.das-meteogram-handle strong { font-size: 9.5px; white-space: nowrap; }
.das-meteogram-handle small { overflow: hidden; color: #64748b; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.das-meteogram-panel { max-height:0; overflow:hidden; visibility:hidden; border:0 solid rgba(2,132,199,.45); border-radius:9px; background:rgba(255,255,255,.96); opacity:0; backdrop-filter:blur(10px); transform:translateY(14px); transition:max-height .28s ease,opacity .2s ease,transform .28s ease,visibility 0s linear .28s,border-width 0s linear .28s; pointer-events:none; }
.das-meteogram.is-open .das-meteogram-panel { max-height:220px; visibility:visible; border-width:1px; opacity:1; transform:translateY(0); transition:max-height .28s ease,opacity .2s ease,transform .28s ease; pointer-events:auto; }
@media (prefers-reduced-motion:reduce) { .das-meteogram-panel { transition:none!important; } }
.das-meteogram-summary { display: grid; grid-template-columns: auto minmax(120px, 1.5fr) repeat(3, minmax(72px, 1fr)) auto; align-items: center; gap: 8px; border-bottom: 1px solid #dceaf3; padding: 7px 9px; }
.das-meteogram-summary > span { min-width: 0; }
.das-meteogram-summary > span:not(.das-meteogram-current-icon) { padding-left: 8px; border-left: 1px solid #e2e8f0; }
.das-meteogram-current-icon { font-size: 25px; line-height: 1; }
.das-meteogram-summary small, .das-meteogram-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.das-meteogram-summary small { color: #64748b; font-size: 7px; font-weight: 700; }
.das-meteogram-summary strong { margin-top: 2px; color: #12385c; font-size: 10px; }
.das-meteogram-summary strong em { color: #0284c7; font-size: 7.5px; font-style: normal; }
.das-meteogram-summary a { border-radius: 999px; background: #e7f5fd; padding: 4px 7px; color: #0369a1; font-size: 7.5px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.das-meteogram-actions { display:flex; align-items:center; justify-content:flex-end; gap:5px; }
.das-meteogram-actions a:first-child { background:#0369a1; color:#fff; }
.das-meteogram-actions>em { border-radius:999px; background:#e0f2fe; padding:4px 7px; color:#075985; font-size:7.5px; font-style:normal; font-weight:800; white-space:nowrap; }
.das-meteogram-freshness { grid-column:1 / -1; justify-self:end; padding-right:2px; color:#15803d!important; white-space:normal!important; }
.das-meteogram-freshness.is-stale { color:#b45309!important; }
.das-meteogram-strip { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #7dd3fc transparent; scrollbar-width: thin; }
.das-meteogram-strip > button { position: relative; display: grid; min-width: 49px; height: 65px; flex: 1 0 49px; grid-template-rows: 10px 11px 20px 12px; place-items: center; border: 0; border-right: 1px solid #e7eef4; background: transparent; padding: 3px 3px 4px; color: #31506f; cursor: pointer; }
.das-meteogram-strip > button:hover { background: #f0f9ff; }
.das-meteogram-strip > button.active { background: #e0f2fe; box-shadow: inset 0 -3px #0284c7; }
.das-meteogram-strip button small { min-height: 9px; color: #0369a1; font-size: 6.5px; font-weight: 800; }
.das-meteogram-strip time { color: #526b84; font-size: 7px; font-weight: 750; }
.das-meteogram-strip i { font-size: 17px; font-style: normal; line-height: 1; }
.das-meteogram-strip b { color: #173c62; font-size: 8px; }
.das-meteogram-strip button > span { position: absolute; right: 3px; bottom: 4px; width: 3px; height: 30px; overflow: hidden; border-radius: 3px; background: #dbeafe; }
.das-meteogram-strip button > span em { position: absolute; right: 0; bottom: 0; left: 0; border-radius: 3px; background: #38bdf8; }
.das-meteogram-slider { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; align-items: center; gap: 8px; border-top: 1px solid #e2e8f0; padding: 5px 9px; color: #64748b; font-size: 7px; font-weight: 750; }
.das-meteogram-slider input { width: 100%; height: 3px; accent-color: #0284c7; cursor: ew-resize; }
.das-meteogram-slider output { color: #075985; font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-theme="dark"] .das-meteogram-handle, [data-theme="dark"] .das-meteogram-panel { border-color: rgba(56, 189, 248, .55); background: rgba(15, 35, 56, .96); }
[data-theme="dark"] .das-meteogram-summary strong, [data-theme="dark"] .das-meteogram-strip b { color: #e0f2fe; }
[data-theme="dark"] .das-meteogram-strip > button { border-color: #27445f; color: #cbd5e1; }
[data-theme="dark"] .das-meteogram-strip > button.active { background: #123f5b; }
@media (max-width: 820px) {
  .das-meteogram { right: 5px; bottom: 37px; left: 5px; }
  .das-meteogram-summary { grid-template-columns: auto minmax(105px, 1fr) repeat(2, minmax(58px, .7fr)); }
  .das-meteogram-summary > span:nth-of-type(4) { display: none; }
  .das-meteogram-summary a { display: none; }
  .das-meteogram-summary .das-meteogram-actions { display:flex; padding-left:6px; }
  .das-meteogram-summary .das-meteogram-actions a:first-child { display:inline-flex; }
  .das-meteogram-summary .das-meteogram-actions { grid-column:1 / -1; justify-self:end; border-left:0; }
  .das-meteogram-handle { max-width: calc(100% - 12px); }
  .das-meteogram-slider { grid-template-columns: auto minmax(80px, 1fr); }
  .das-meteogram-slider output { display: none; }
}
.situation-reasons { display:flex; min-height:0; flex-direction:column; overflow:hidden; }
.situation-reason-list { display: grid; padding: 4px 10px 10px; }
.situation-reason-list > div { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 66px; border-bottom: 1px solid #e5edf3; }
.situation-reason-list > div:last-child { border-bottom: 0; }
.situation-reason-list > div::before { position: absolute; top: -1px; bottom: -1px; left: 15px; width: 2px; background: #dce8ef; content: ""; }
.situation-reason-list i { position: relative; z-index: 1; display: grid; width: 31px; height: 31px; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #0787d1; box-shadow: 0 0 0 1px #c9e2ef; color: #fff; font-size: 15px; font-style: normal; }
.situation-reason-list .muted i { background: #94a3b8; }
.situation-reason-list strong, .situation-reason-list small { display: block; }
.situation-reason-list strong { color: #17365b; font-size: 10.5px; }
.situation-reason-list small { margin-top: 3px; color: #667b8e; font-size: 8.5px; line-height: 1.3; }
.situation-reason-list .muted small { color: #94a3b8; }
.peak-development-chart { min-width:0; margin:auto 10px 10px; border-top:1px solid #dce8ef; padding-top:9px; }
.peak-development-heading { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:7px; padding:0 1px 6px; }.peak-development-heading strong { min-width:0; color:#12365f; font-size:10px; font-weight:900; }.peak-development-heading strong span { margin-right:4px; color:#0787d1; font-size:14px; }.peak-development-heading em { overflow:hidden; max-width:46%; border-radius:999px; background:#eaf4fa; padding:4px 7px; color:#315879; font-size:6.5px; font-style:normal; font-weight:850; text-overflow:ellipsis; white-space:nowrap; }
.peak-development-legend { display:flex; justify-content:center; gap:12px; padding-bottom:3px; color:#405b76; font-size:6px; font-weight:750; }.peak-development-legend span { display:flex; align-items:center; gap:4px; }.peak-development-legend span::before { display:block; width:13px; height:4px; border-radius:2px; background:#38bdf8; content:""; }.peak-development-legend .rain::before { height:7px; border-radius:1px; background:#7dd3fc99; }.peak-development-legend .forecast::before { height:0; border-top:2px dashed #1689df; background:transparent; }
.peak-development-chart svg { display:block; width:100%; height:auto; max-height:270px; overflow:visible; font-family:var(--font-sans); }.peak-development-chart .axis-line { stroke:#9db4c7; stroke-width:.7; }.peak-development-chart .grid-line { stroke:#dce8f0; stroke-width:.55; }.peak-development-chart .axis-title { fill:#274966; font-size:6px; font-weight:900; }.peak-development-chart .axis-unit,.peak-development-chart .axis-label { fill:#617b91; font-size:5.2px; }.peak-development-chart .rain-bar { fill:#6dc8fa; opacity:.78; }.peak-development-chart .threshold-line { stroke-width:.8; stroke-dasharray:4 3; }.peak-development-chart .threshold-label { font-size:4.8px; font-weight:850; paint-order:stroke; stroke:#fff; stroke-width:2px; stroke-linejoin:round; }.peak-development-chart .tma-line { fill:none; stroke:#087bc1; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }.peak-development-chart .tma-line.forecast { stroke:#1689df; stroke-dasharray:5 3; }.peak-development-chart .observed-point { fill:#087bc1; }.peak-development-chart .forecast-point { fill:#fff; stroke:#1689df; stroke-width:1.2; }.peak-development-chart .current-point { fill:#10214b; stroke:#fff; stroke-width:1.1; }.peak-development-chart .peak-point { fill:#ef4444; stroke:#fff; stroke-width:1.2; }.peak-development-chart .peak-guide { stroke:#1689df; stroke-width:.8; stroke-dasharray:3 2; opacity:.55; }.peak-development-chart .callout-label,.peak-development-chart .peak-label { fill:#075985; font-size:5.1px; font-weight:850; paint-order:stroke; stroke:#fff; stroke-width:2.4px; stroke-linejoin:round; }.peak-development-chart .callout-value { fill:#10214b; font-size:5.8px; font-weight:900; paint-order:stroke; stroke:#fff; stroke-width:2.4px; }.peak-development-chart .peak-label { fill:#b91c1c; }.peak-development-chart .time-label { fill:#173c62; font-size:5.3px; font-weight:850; }.peak-development-chart .date-label { fill:#64748b; font-size:4.8px; }.peak-development-empty { display:grid; min-height:150px; place-items:center; margin:auto 10px 10px; border-top:1px solid #dce8ef; padding:18px; color:#7890a5; font-size:8px; text-align:center; }
.situation-bottom-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, .8fr); gap: 14px; }
.situation-timeline, .situation-telemetry { overflow: hidden; }
.telemetry-basis { margin: 0; border-top: 1px solid #e2e8f0; padding: 7px 12px 0; color: #64748b; font-size: 8.5px; font-weight: 650; }
.situation-timeline-track { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 18px 15px 16px; }
.situation-timeline-track::before { position: absolute; top: 34px; right: 11%; left: 11%; height: 3px; background: linear-gradient(90deg, #10b981, #eab308, #ef4444, #94a3b8); content: ""; }
.situation-timeline-track > div { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; }
.situation-timeline-track i { position: relative; z-index: 1; display: grid; width: 34px; height: 34px; place-items: center; border: 4px solid #fff; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 1px #bde8d2; color: #fff; font-size: 15px; font-style: normal; font-weight: 900; }
.situation-timeline-track .watch i { background: #eab308; }
.situation-timeline-track .danger i { background: #ef4444; }
.situation-timeline-track .muted i { background: #94a3b8; }
.situation-timeline-track strong { color: #17365b; font-size: 9.5px; }
.situation-timeline-track span { color: #64748b; font-size: 8px; }
.situation-telemetry > div:last-child { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 12px; }
.situation-telemetry > div:last-child > span { --telemetry-tone:var(--status-normal); display: grid; min-height: 92px; place-items: center; align-content: center; border:1px solid var(--status-normal-border); border-radius: 10px; background: var(--status-normal-bg); color: var(--status-normal-text); text-align: center; }
.situation-telemetry > div:last-child > span.watch { --telemetry-tone:var(--status-waspada); border-color:var(--status-waspada-border); background:var(--status-waspada-bg); color:var(--status-waspada-text); }
.situation-telemetry > div:last-child > span.danger { --telemetry-tone:var(--status-awas); border-color:var(--status-awas-border); background:var(--status-awas-bg); color:var(--status-awas-text); }
.situation-telemetry i { display: grid; width: 28px; height: 28px; place-items: center; border:2px solid color-mix(in srgb,var(--telemetry-tone) 30%,#fff); border-radius: 50%; background:var(--telemetry-tone); box-shadow:0 3px 7px color-mix(in srgb,var(--telemetry-tone) 25%,transparent); color:#fff; font-style: normal; }
.situation-telemetry i svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:2.4; }
.situation-telemetry strong { margin-top: 4px; font-size: 18px; }
.situation-telemetry small { font-size: 8px; font-weight: 800; }
@media (max-width: 1250px) {
  .situation-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .situation-main-grid { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.8fr); }
  .situation-reasons { grid-column: 1 / -1; }
  .situation-reason-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .situation-reason-list > div { grid-template-columns: 28px minmax(0, 1fr); border: 0; }
  .situation-reason-list > div::before { display: none; }
  .situation-reason-list i { width: 28px; height: 28px; }
}
@media (max-width: 850px) {
  .situation-kpis, .situation-main-grid, .situation-bottom-grid { grid-template-columns: minmax(0, 1fr); }
  .situation-reasons { grid-column: auto; }
  .situation-reason-list { grid-template-columns: minmax(0, 1fr); }
  .situation-timeline-track { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .situation-timeline-track::before { display: none; }
}
@media (max-width: 520px) {
  .situation-kpis { grid-template-columns: minmax(0, 1fr); }
  .situation-kpi { grid-template-columns: 38px minmax(0, 1fr); padding: 10px; }
  .situation-kpi-icon { width: 34px; height: 34px; font-size: 21px; }
  .situation-kpi strong { font-size: 14px; }
  .situation-telemetry > div:last-child { grid-template-columns: minmax(0, 1fr); }
}

/* Column 1: Status Sub-DAS Table */
.table-responsive {
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.subdas-table {
  font-size: 10.5px;
  text-align: left;
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  height: 100%;
  flex: 1;
  border-collapse: collapse;
}

.subdas-table th:nth-child(1), .subdas-table td:nth-child(1) { width: 4%; }
.subdas-table th:nth-child(2), .subdas-table td:nth-child(2) { width: 19%; }
.subdas-table th:nth-child(3), .subdas-table td:nth-child(3) { width: 7%; }
.subdas-table th:nth-child(4), .subdas-table td:nth-child(4) { width: 11%; }
.subdas-table th:nth-child(5), .subdas-table td:nth-child(5) { width: 8%; }
.subdas-table th:nth-child(6), .subdas-table td:nth-child(6) { width: 11%; }
.subdas-table th:nth-child(7), .subdas-table td:nth-child(7) { width: 7%; }
.subdas-table th:nth-child(8), .subdas-table td:nth-child(8) { width: 8%; }
.subdas-table th:nth-child(9), .subdas-table td:nth-child(9) { width: 14%; }
.subdas-table th:nth-child(10), .subdas-table td:nth-child(10) { width: 11%; }

.subdas-table thead {
  flex-shrink: 0;
}

.subdas-table th {
  background-color: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  padding: 7px 3px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subdas-table tbody {
  height: 100%;
}

.subdas-table tbody tr {
  height: 16.666%;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.subdas-table td {
  padding: 5px 3px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
  overflow: hidden;
}

.subdas-table tr:last-child td {
  border-bottom: none;
}

.subdas-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.subdas-table tbody tr.selected {
  background-color: #e0f2fe44;
}

.col-center {
  text-align: center;
}

.col-right {
  text-align: right;
}

.subdas-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2.5px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-status-awas {
  background-color: #ef4444;
  color: #ffffff;
}

.badge-status-siaga {
  background-color: #f97316;
  color: #ffffff;
}

.badge-status-waspada {
  background-color: #eab308;
  color: #ffffff;
}

.badge-status-normal {
  background-color: #10b981;
  color: #ffffff;
}

.badge-status-no-data {
  background-color: #94a3b8;
  color: #ffffff;
}

.badge-ch-sangat-lebat {
  background-color: var(--rain-sangat-lebat-bg);
  color: var(--rain-sangat-lebat-text);
}

.badge-ch-lebat {
  background-color: var(--rain-lebat-bg);
  color: var(--rain-lebat-text);
}

.badge-ch-sedang {
  background-color: var(--rain-sedang-bg);
  color: var(--rain-sedang-text);
}

.badge-ch-ringan {
  background-color: var(--rain-ringan-bg);
  color: var(--rain-ringan-text);
}

.badge-ch-tidak-hujan {
  background-color: var(--rain-tidak-hujan-bg);
  color: var(--rain-tidak-hujan-text);
}

.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.font-bold {
  font-weight: 700;
}

/* Primary Telemetry Metrics in Sub-DAS Table */
.subdas-table td.td-ch {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subdas-table td.td-tma,
.subdas-table td:nth-child(7) {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Secondary Metric: Perubahan / Tren */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.subdas-trend-delta {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.trend-indicator .trend-icon {
  width: 10.5px;
  height: 10.5px;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.trend-indicator span.trend-icon {
  width: auto;
  height: auto;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.trend-indicator.trend-up {
  color: #16a34a;
}

.trend-indicator.trend-down {
  color: #dc2626;
}

.trend-indicator.trend-flat {
  color: #5f6b7c;
}

[data-theme="dark"] .trend-indicator.trend-up {
  color: #4ade80;
}

[data-theme="dark"] .trend-indicator.trend-down {
  color: #f87171;
}

[data-theme="dark"] .trend-indicator.trend-flat {
  color: #94a3b8;
}

.trend-arrow {
  font-weight: 700;
  font-size: 13px;
}

.trend-arrow.trend-up,
.station-list-item .trend-up {
  color: var(--status-siaga);
}

.trend-arrow.trend-down,
.station-list-item .trend-down {
  color: var(--status-normal);
}

.trend-arrow.trend-flat,
.station-list-item .trend-flat {
  color: var(--text-muted);
}

/* Column 2: Peringatan Aktif */
.alerts-card {
  align-self: start;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.alerts-list {
  position: relative;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: clamp(300px, 52vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
  justify-content: flex-start;
}

.alerts-list:focus-visible { outline: 2px solid var(--pu-blue); outline-offset: -2px; }

.alerts-scroll-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
}

.alerts-scroll-controls button {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.alerts-scroll-controls button:hover { background: var(--surface-hover); }

.alert-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.alert-count {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.alert-count--muted { background: #edf2f7; color: #475569; }

.alert-item {
  --alert-accent: #0c3b6d;
  --alert-ink: #0c3b6d;
  --alert-soft: #eff6ff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--alert-accent);
  border-radius: 9px;
  padding: 11px 12px;
  background: var(--alert-soft);
  flex: 0 0 auto;
  min-width: 0;
}

.alert-item--awas { --alert-accent: #b91c1c; --alert-ink: #991b1b; --alert-soft: #fff1f2; }
.alert-item--siaga { --alert-accent: #c2410c; --alert-ink: #9a3412; --alert-soft: #fff7ed; }
.alert-item--waspada { --alert-accent: #a16207; --alert-ink: #713f12; --alert-soft: #fffbeb; }
.alert-item--normal { --alert-accent: #047857; --alert-ink: #065f46; --alert-soft: #ecfdf5; }
.alert-item--hidden { --alert-accent: #64748b; --alert-ink: #334155; --alert-soft: #f1f5f9; }
[data-theme="dark"] .alert-item--awas { --alert-ink: #fecaca; --alert-soft: #3a1a25; }
[data-theme="dark"] .alert-item--siaga { --alert-ink: #fed7aa; --alert-soft: #38251e; }
[data-theme="dark"] .alert-item--waspada { --alert-ink: #fde68a; --alert-soft: #3a321d; }
[data-theme="dark"] .alert-item--normal { --alert-ink: #a7f3d0; --alert-soft: #153629; }
[data-theme="dark"] .alert-item--hidden { --alert-ink: #cbd5e1; --alert-soft: #1e293b; }
[data-theme="dark"] .alert-count--muted { background: #334155; color: #cbd5e1; }

.alert-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.alert-level {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--alert-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
}

.alert-target-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.alert-source {
  display: inline-block;
  margin-top: 7px;
  color: var(--alert-ink);
  font-size: 10px;
  font-weight: 700;
}

.alert-desc-text {
  margin: 5px 0 9px;
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.4;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.alert-desc-text strong { color: var(--alert-ink); }

.alert-guidance {
  margin: 0;
  padding: 7px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 10.5px;
  line-height: 1.35;
}

.alert-guidance strong { color: var(--alert-ink); }

.alert-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 9px;
}

.alert-timestamp {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.alert-details-link {
  color: var(--pu-blue);
  font-size: 10.5px;
  font-weight: 800;
  text-decoration: none;
}

.alert-details-link:hover,
.alert-details-link:focus-visible { text-decoration: underline; }
[data-theme="dark"] .alert-details-link { color: #93c5fd; }

.alert-empty {
  margin: 0;
  padding: 24px 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

/* Column 3: Peta Pos Real-Time */
.card-peta {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.map-canvas-container {
  flex: 1;
  min-height: 280px;
  width: 100%;
  position: relative;
  background-color: #e5edf5;
}

.real-map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

/* North-arrow overlay — shared by every Leaflet map on the portal. Fixed
   "up is north" indicator, not a live compass, since none of these maps
   rotate. Default corner is top-left; add --right where that corner is
   already occupied by a map's own toolbar (e.g. a fullscreen button). */
.map-compass {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 500;
  width: 28px;
  height: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.map-compass--right { left: auto; right: 8px; }
.map-compass--bottom-left { top: auto; bottom: 8px; }
.map-compass-arrow { font-size: 8px; color: #38bdf8; margin-bottom: -1px; }

/* Peta Prediksi Banjir Spasial memiliki meteogram yang naik dari bawah.
   North arrow selalu ditempatkan di atas handle/panel tersebut. */
.hazard-map-box > .map-compass--bottom-left {
  bottom: 50px;
  transition: bottom .28s ease;
}
.hazard-map-box:has(.das-meteogram.is-open) > .map-compass--bottom-left {
  bottom: min(252px, calc(100% - 36px));
}
@media (prefers-reduced-motion: reduce) {
  .hazard-map-box > .map-compass--bottom-left { transition: none; }
}

.map-card-header {
  min-width: 0;
  max-width: 100%;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1100;
}

.map-header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-action-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.map-header-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  opacity: 0.85;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.map-header-btn:hover {
  background-color: var(--surface-hover);
  color: var(--pu-blue);
  border-color: var(--border-subtle);
  opacity: 1;
}

[data-theme="dark"] .map-header-btn {
  color: #e2e8f0;
}

[data-theme="dark"] .map-header-btn:hover {
  color: #38bdf8;
  background-color: #334155;
  border-color: #475569;
}

/* Button Active states from Screenshots */
/* Screenshot 1: Basemap Active -> Bold blue border highlight */
.map-header-btn.basemap-active {
  border: 2px solid #0052cc !important;
  border-radius: 8px !important;
  color: #0052cc !important;
  background-color: transparent !important;
  opacity: 1;
}

[data-theme="dark"] .map-header-btn.basemap-active {
  border: 2px solid #38bdf8 !important;
  color: #38bdf8 !important;
}

/* Screenshot 2: Layers Pin Active -> Light blue background pill/box */
.map-header-btn.layers-active {
  background-color: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  border-radius: 8px !important;
  color: #0284c7 !important;
  opacity: 1;
}

[data-theme="dark"] .map-header-btn.layers-active {
  background-color: #0c4a6e !important;
  border-color: #0284c7 !important;
  color: #38bdf8 !important;
}

.map-header-btn.active {
  color: var(--pu-blue);
  background-color: var(--surface-alt);
  border-color: var(--border);
}

[data-theme="dark"] .map-header-btn.active {
  color: #38bdf8;
  background-color: #1e293b;
  border-color: #334155;
}

/* Map Header Floating Popups */
.map-popup-card {
  position: absolute;
  top: calc(100% + 8px);
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
  z-index: 1200;
  animation: mapPopupFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mapPopupFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .map-popup-card {
  background-color: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.45);
}

/* Basemap Switcher Popup (Screenshot 1) */
.basemap-popup {
  left: -80px;
  padding: 10px 12px;
  width: max-content;
}

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

.basemap-opt-card {
  background: transparent;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 5px 6px 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 82px;
  box-sizing: border-box;
}

.basemap-opt-card:hover {
  border-color: #cbd5e1;
  background-color: #f8fafc;
}

.basemap-opt-card.active {
  border: 2.5px solid #0052cc;
  background-color: #ffffff;
}

[data-theme="dark"] .basemap-opt-card {
  border-color: #334155;
}

[data-theme="dark"] .basemap-opt-card:hover {
  background-color: #273549;
  border-color: #475569;
}

[data-theme="dark"] .basemap-opt-card.active {
  border: 2.5px solid #38bdf8;
  background-color: #1e293b;
}

.basemap-thumb-box {
  width: 70px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.basemap-thumb-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.basemap-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-top: 6px;
  letter-spacing: -0.01em;
}

.basemap-opt-card.active .basemap-label {
  color: #0052cc;
  font-weight: 700;
}

[data-theme="dark"] .basemap-label {
  color: #94a3b8;
}

[data-theme="dark"] .basemap-opt-card.active .basemap-label {
  color: #38bdf8;
}

/* Layer Control Popup (Screenshot 2) */
.layer-control-popup {
  left: -110px;
  padding: 14px 16px 14px 16px;
  width: 275px;
  box-sizing: border-box;
}

.layer-control-header {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8da2bb;
  text-transform: uppercase;
  margin-bottom: 12px;
}

[data-theme="dark"] .layer-control-header {
  color: #64748b;
}

.layer-control-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layer-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.layer-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layer-icon-box {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Row 1 icon: 4 dots side-by-side */
.layer-icon-box.icon-tma {
  display: flex;
  align-items: center;
  gap: 3px;
}

.dot-tma {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  display: inline-block;
}

.dot-tma.dot-green { background-color: #16a34a; }
.dot-tma.dot-yellow { background-color: #eab308; }
.dot-tma.dot-orange { background-color: #f97316; }
.dot-tma.dot-red { background-color: #dc2626; }

/* Row 2 icon: Orange circle with rain cloud */
.layer-icon-box.icon-pch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #ea8f38;
}

/* Row 3 icon: Dashed blue square */
.layer-icon-box.icon-das {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.das-dashed-box {
  width: 24px;
  height: 24px;
  border: 2px dashed #2563eb;
  border-radius: 6px;
  background-color: #eff6ff;
  box-sizing: border-box;
  display: block;
}

[data-theme="dark"] .das-dashed-box {
  background-color: rgba(37, 99, 235, 0.15);
  border-color: #3b82f6;
}

.layer-text-box {
  display: flex;
  flex-direction: column;
}

.layer-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.layer-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
  line-height: 1.2;
}

[data-theme="dark"] .layer-name {
  color: #f8fafc;
}

[data-theme="dark"] .layer-desc {
  color: #94a3b8;
}

/* Switch Toggle (iOS style from Screenshot 2) */
.layer-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.layer-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.layer-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-switch input:checked + .layer-slider {
  background-color: #0b3b6d;
}

.layer-switch input:checked + .layer-slider::before {
  transform: translateX(20px);
}

[data-theme="dark"] .layer-slider {
  background-color: #475569;
}

[data-theme="dark"] .layer-switch input:checked + .layer-slider {
  background-color: #0284c7;
}

.map-header-divider {
  width: 1px;
  height: 18px;
  background-color: var(--border);
  margin: 0 4px;
  display: inline-block;
  opacity: 0.8;
}

.map-header-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
  letter-spacing: 0.04em;
  margin-left: 12px;
}

.map-header-live .live-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #16a34a;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.map-control-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.map-control-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-main);
}

.map-floating-tools {
  position: absolute;
  right: 10px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 400;
}

.map-legend-bar {
  padding: 8px 12px;
  background-color: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.legend-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-label {
  font-weight: 700;
  color: var(--text-main);
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.legend-dot.legend-triangle {
  width: 10px;
  height: 8.66px;
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.dot-normal { background-color: var(--status-normal); }
.dot-waspada { background-color: var(--status-waspada); }
.dot-siaga { background-color: var(--status-siaga); }
.dot-awas { background-color: var(--status-awas); }

/* ==========================================================================
   BERANDA - BOTTOM PREDIKSI DUAL CHART
   ========================================================================== */
.forecast-chart-card {
  width: 100%;
}

/* BMKG village forecast matrix below the Beranda TMA/rainfall chart. */
.bmkg-forecast-card {
  width: 100%;
  margin-top: 14px;
  overflow: hidden;
}

.bmkg-forecast-header {
  gap: 12px;
}

.bmkg-forecast-header .card-title-group {
  min-width: 0;
}

.bmkg-forecast-header .card-title-group > div {
  min-width: 0;
}

.bmkg-source-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #eff6ff;
  padding: 6px 10px;
  color: #075985;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.bmkg-source-badge:hover {
  border-color: #0284c7;
  background: #e0f2fe;
}

.bmkg-forecast-state {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.bmkg-forecast-error {
  color: #b91c1c;
}

.bmkg-forecast-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fbfe;
  padding: 9px 14px;
}

.bmkg-forecast-toolbar > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.bmkg-forecast-toolbar > p strong {
  color: var(--text-main);
}

.bmkg-day-tabs {
  display: flex;
  gap: 6px;
}

.bmkg-day-tabs button {
  display: flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  padding: 5px 9px;
  color: #475569;
  cursor: pointer;
}

.bmkg-day-tabs button strong {
  font-size: 10.5px;
}

.bmkg-day-tabs button span {
  font-size: 9px;
}

.bmkg-day-tabs button.active {
  border-color: #0284c7;
  background: #0284c7;
  color: white;
  box-shadow: 0 3px 8px rgba(2, 132, 199, .2);
}

.bmkg-day-insights {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: white;
}

.bmkg-day-insights > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #dbe7f0;
  border-radius: 999px;
  background: #f8fafc;
  padding: 5px 10px;
  color: #52657d;
  font-size: 9.5px;
  white-space: nowrap;
}

.bmkg-day-insights > span i {
  color: #0284c7;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.bmkg-day-insights > span b {
  color: #0f3f70;
}

.bmkg-day-insights > span.has-rain {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #075985;
}

.bmkg-summary-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #7dd3fc #e2e8f0;
  scrollbar-width: thin;
}

.bmkg-summary-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-main);
  font-size: 10px;
}

.bmkg-summary-table th,
.bmkg-summary-table td {
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
}

.bmkg-summary-table thead th {
  background: #eaf6fd;
  padding: 7px 8px;
  color: #0c4a6e;
  text-align: center;
}

.bmkg-summary-table thead th:first-child {
  width: 22%;
  min-width: 190px;
  padding-left: 14px;
  text-align: left;
}

.bmkg-summary-table thead th:not(:first-child) {
  width: 19.5%;
}

.bmkg-summary-table thead th > span,
.bmkg-summary-table thead th > strong,
.bmkg-summary-table thead th > small {
  display: inline-block;
}

.bmkg-summary-table thead th > span {
  margin-right: 5px;
  font-size: 13px;
}

.bmkg-summary-table thead th > strong {
  font-size: 10.5px;
}

.bmkg-summary-table thead th > small {
  margin-left: 5px;
  color: #66809a;
  font-size: 8px;
  font-weight: 650;
}

.bmkg-summary-table tbody > tr:not(.bmkg-detail-row):nth-of-type(even) th,
.bmkg-summary-table tbody > tr:not(.bmkg-detail-row):nth-of-type(even) td {
  background: #fbfdff;
}

.bmkg-summary-table tbody > tr.is-expanded th,
.bmkg-summary-table tbody > tr.is-expanded td {
  border-top-color: #7dd3fc;
  background: #f0f9ff;
}

.bmkg-summary-table tbody th {
  padding: 0;
  background: white;
  text-align: left;
}

.bmkg-area-toggle {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 8px 10px 8px 14px;
  color: #0f294a;
  cursor: pointer;
  text-align: left;
}

.bmkg-area-toggle:hover strong {
  color: #0369a1;
}

.bmkg-area-toggle > span {
  min-width: 0;
}

.bmkg-area-toggle strong,
.bmkg-area-toggle small {
  display: block;
}

.bmkg-area-toggle strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bmkg-area-toggle small {
  margin-top: 4px;
  color: #688099;
  font-size: 8.5px;
  font-weight: 650;
}

.bmkg-area-toggle > i {
  color: #0284c7;
  font-size: 16px;
  font-style: normal;
  line-height: 1;
  transition: transform .2s ease;
}

.bmkg-area-toggle[aria-expanded="true"] > i {
  transform: rotate(180deg);
}

.bmkg-summary-table tbody td {
  background: white;
  padding: 7px 9px;
}

.bmkg-period-cell {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
}

.bmkg-period-weather {
  flex: 0 0 auto;
  font-size: 21px;
  line-height: 1;
}

.bmkg-period-cell > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.bmkg-period-cell strong,
.bmkg-period-cell small,
.bmkg-period-cell div > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bmkg-period-cell strong {
  color: #163a60;
  font-size: 10px;
}

.bmkg-period-cell.is-rain strong {
  color: #0369a1;
}

.bmkg-period-cell small {
  color: #7b8ea4;
  font-size: 8px;
  font-weight: 650;
}

.bmkg-period-cell div > span {
  color: #415a73;
  font-size: 9px;
  font-weight: 650;
}

.bmkg-period-cell div > span b {
  color: #b4c2d0;
  font-weight: 500;
}

.bmkg-period-empty {
  display: grid;
  min-height: 48px;
  place-content: center;
  color: #b5c2cf;
  text-align: center;
}

.bmkg-period-empty span {
  font-size: 14px;
}

.bmkg-period-empty small {
  font-size: 8px;
}

.bmkg-summary-table .bmkg-detail-row > td {
  border-top: 0;
  border-right: 0;
  background: #f0f9ff;
  padding: 10px 14px 13px;
}

.bmkg-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.bmkg-detail-heading strong {
  color: #0c4a6e;
  font-size: 10.5px;
}

.bmkg-detail-heading span {
  color: #64748b;
  font-size: 8.5px;
}

.bmkg-detail-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 7px;
}

.bmkg-detail-timeline > p {
  margin: 4px 0;
  color: #64748b;
}

.bmkg-detail-point {
  display: grid;
  gap: 3px;
  border: 1px solid #cbddeb;
  border-radius: 8px;
  background: white;
  padding: 7px 8px;
  color: #65798e;
  font-size: 8px;
  line-height: 1.25;
}

.bmkg-detail-point.is-rain {
  border-color: #7dd3fc;
  background: #f8fdff;
}

.bmkg-detail-point time {
  color: #0369a1;
  font-size: 9px;
  font-weight: 800;
}

.bmkg-detail-point b {
  color: #334e68;
}

.bmkg-detail-weather {
  display: flex;
  min-height: 23px;
  align-items: center;
  gap: 5px;
  color: #122f50;
}

.bmkg-detail-weather i {
  font-size: 18px;
  font-style: normal;
}

.bmkg-detail-weather strong {
  font-size: 9px;
}

.bmkg-forecast-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  color: var(--text-muted);
  font-size: 9.5px;
}

.bmkg-forecast-footer span:first-child {
  flex: 1;
}

.bmkg-complete {
  color: #047857;
  font-weight: 750;
}

.bmkg-partial-warning {
  color: #b45309;
  font-weight: 750;
}

@media (max-width: 820px) {
  .bmkg-forecast-header,
  .bmkg-forecast-toolbar,
  .bmkg-forecast-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .bmkg-forecast-toolbar > p {
    white-space: normal;
  }

  .bmkg-day-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .bmkg-day-tabs button {
    flex: 0 0 auto;
  }

  .bmkg-day-insights {
    overflow-x: auto;
  }

  .bmkg-day-insights > span {
    flex: 0 0 auto;
  }
}

.chart-wrapper {
  padding: 10px 14px 4px 14px;
  position: relative;
}

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

.chart-legend-bottom {
  padding: 8px 14px 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 10.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

.chart-legend-entry {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-color-box {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.legend-line-sample {
  width: 18px;
  height: 2px;
}

.legend-dashed-sample {
  width: 18px;
  height: 2px;
  border-top: 2px dashed;
}

.legend-whisker-sample {
  position: relative;
  width: 1.5px;
  height: 11px;
  margin: 0 3.5px;
  background: #64748b;
  opacity: .75;
}
.legend-whisker-sample::before,
.legend-whisker-sample::after {
  content: "";
  position: absolute;
  left: -3px;
  width: 8px;
  height: 1.5px;
  background: #64748b;
}
.legend-whisker-sample::before { top: 0; }
.legend-whisker-sample::after { bottom: 0; }

/* ==========================================================================
   VIEW 2: POS HIDROLOGI
   ========================================================================== */
.pos-grid-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
}

.pos-left-col {
  width: 310px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* On the river scheme tab, show the DAS overview before the sub-DAS list. */
#pos-left-skema-info { order: 5; }
#pos-left-skema-sungai { order: 6; }

.pos-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pos-center-col,
.pos-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Pos Left Cards */
.mini-map-box {
  height: 269px;
  width: 100%;
  position: relative;
}

.pos-quick-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}

.quick-stat-box {
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.qs-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.qs-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 2px;
}

.qs-unit {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

.tma-gradient-gauge {
  height: 10px;
  border-radius: 999px;
  background: var(--pda-ambang-gradient, transparent);
  position: relative;
  margin: 14px 6px 6px 6px;
}

.pda-ambang-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.pda-ambang-legend span::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 2px;
  background: var(--legend-color);
}

.pda-ambang-legend span:nth-child(1) { --legend-color: #16a34a; }
.pda-ambang-legend span:nth-child(2) { --legend-color: #eab308; }
.pda-ambang-legend span:nth-child(3) { --legend-color: #f97316; }
.pda-ambang-legend span:nth-child(4) { --legend-color: #ef2626; }

.gauge-needle {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 18px;
  background-color: #0f172a;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.gauge-needle::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #0f172a;
}

/* Pos Center Col: Station List */
.station-search-box {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.input-with-icon {
  position: relative;
  flex: 1;
}

.input-with-icon input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface-alt);
  color: var(--text-main);
  font-size: 11.5px;
  outline: none;
}

.input-with-icon input:focus {
  border-color: var(--pu-blue);
  background-color: var(--surface);
}

.input-with-icon svg {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}

.station-filters-bar {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-chip {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background-color: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.filter-chip.active {
  background-color: var(--pu-blue);
  color: #fff;
  border-color: var(--pu-blue);
}

.station-scroll-list {
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.station-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.station-list-item:hover {
  background-color: var(--surface-hover);
}

.station-list-item.active {
  background-color: #e0f2fe66;
  border-left: 3px solid var(--pu-blue);
}

/* Pos Right Col */
.sensor-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sensor-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sensor-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sensor-card-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sensor-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.sensor-status-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  align-self: flex-start;
  margin-top: 2px;
}

.tag-success {
  background-color: var(--status-normal-bg);
  color: var(--status-normal-text);
  border: 1px solid var(--status-normal-border);
}

.tag-warning {
  background-color: var(--status-siaga-bg);
  color: var(--status-siaga-text);
  border: 1px solid var(--status-siaga-border);
}

.tag-danger {
  background-color: var(--status-awas-bg);
  color: var(--status-awas-text);
  border: 1px solid var(--status-awas-border);
}

.tag-neutral {
  background-color: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.pos-subnav-card {
  overflow: hidden;
  border: 1px solid #b7d7ef;
  background: #e7f3ff;
  box-shadow: 0 3px 0 rgba(82, 151, 201, 0.18), 0 8px 18px rgba(12, 72, 119, 0.12);
}

.subtab-buttons-bar {
  display: flex;
  gap: 6px;
  padding: 6px 10px 7px;
  background: linear-gradient(180deg, #f4faff 0%, #dfeffd 100%);
  border-bottom: 1px solid #b8d8ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  overflow: hidden;
  align-items: center;
}

.subtab-buttons-scroll {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 3px 5px;
  scrollbar-color: #a9cce8 transparent;
  scrollbar-width: thin;
}

.subtab-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: #185b91;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #b7d5eb;
  box-shadow: 0 2px 0 rgba(77, 138, 184, 0.18), 0 4px 8px rgba(36, 95, 143, 0.08);
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.subtab-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  stroke: currentColor;
}

.subtab-btn:hover {
  color: #075a98;
  background-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(77, 138, 184, 0.19), 0 6px 11px rgba(36, 95, 143, 0.14);
}

.subtab-btn:focus-visible {
  outline: 3px solid #f2b84b;
  outline-offset: 2px;
}

.subtab-btn.active {
  background: linear-gradient(180deg, #168fce 0%, #076cad 100%);
  color: #ffffff !important;
  border-color: #075d99;
  box-shadow: 0 2px 0 #075486, 0 6px 11px rgba(5, 91, 151, 0.27);
  transform: translateY(-1px);
}

.subtab-btn.active svg {
  stroke: currentColor;
}

[data-theme="dark"] .pos-subnav-card {
  border-color: #315b7d;
  background: #142b43;
  box-shadow: 0 3px 0 rgba(6, 23, 40, 0.85), 0 8px 18px rgba(0, 0, 0, 0.27);
}

[data-theme="dark"] .subtab-buttons-bar {
  background: linear-gradient(180deg, #203c58 0%, #162e47 100%);
  border-bottom-color: #315b7d;
  box-shadow: inset 0 1px 0 rgba(125, 179, 220, 0.12);
}

[data-theme="dark"] .subtab-btn {
  color: #c3e5fb;
  background: #25445f;
  border-color: #406b8a;
  box-shadow: 0 2px 0 rgba(4, 20, 35, 0.68), 0 4px 8px rgba(0, 0, 0, 0.19);
}

[data-theme="dark"] .subtab-btn:hover {
  color: #ffffff;
  background: #31597a;
}

[data-theme="dark"] .subtab-btn.active {
  background: linear-gradient(180deg, #138fc9 0%, #075e9b 100%);
  color: #ffffff !important;
  border-color: #2fa4dd;
  box-shadow: 0 3px 0 #064975, 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Metric Strip Containers */
.pos-top-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: stretch;
}

.pos-top-metric-strip > .sensor-card {
  min-height: 104px;
  box-sizing: border-box;
}

.pos-metrics-5col {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px;
}

.pasut-top-sensor-card {
  padding: 8px 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#pos-metrics-pasang-surut > .pasut-top-sensor-card:nth-child(4) { order: 5; }
#pos-metrics-pasang-surut > .pasut-top-sensor-card:nth-child(5) { order: 4; }

/* Tab Panes */
.pos-tab-pane {
  display: none;
}

.pos-tab-pane.active {
  display: block;
}

.pos-tab-grid {
  display: grid;
  grid-template-columns: 285px 1fr;
  gap: 14px;
  align-items: start;
}

.pda-kala-ulang-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.pda-kala-ulang-grid > div {
  min-width: 0;
}

.pda-kala-ulang-grid > div:nth-child(-n + 4) {
  grid-column: span 3;
}

.pda-kala-ulang-grid > div:nth-child(n + 5) {
  grid-column: span 4;
}

.pda-kala-ulang-grid > div:nth-child(5) {
  grid-column: 1 / span 4;
}

.pda-kala-ulang-grid > div:nth-child(6) {
  grid-column: 5 / span 4;
}

.pda-kala-ulang-grid > div:nth-child(7) {
  grid-column: 9 / span 4;
}

.pos-tab-stations {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pos-tab-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.pos-bottom-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Pos Hidrologi Curah Hujan Card Height Alignment */
#pch-daftar-pos-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

#pch-stations-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  container-type: inline-size;
  container-name: pch-station-list;
}

.pda-list-trend {
  display: flex;
  min-width: 58px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  white-space: nowrap;
}
.pda-list-trend-icon { font-size: 14px; font-weight: 800; line-height: 1; }
.pda-list-trend-delta { font-family: var(--font-mono); font-size: 9px; font-weight: 700; }
.pda-list-trend-flat { color: #0284c7; font-size: 14px; font-weight: 800; line-height: 1; }
.pda-list-trend-flat-value { color: #0284c7; }
.pda-list-reading { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pda-list-tma { font-size: 10px; font-weight: 700; font-family: var(--font-mono); white-space: nowrap; }
.pda-list-status { padding: 2px 6px; font-size: 8px; line-height: 1.2; }
.pda-list-last-seen { display: block; margin-top: 2px; color: var(--text-muted); font-size: 9px; }

.pch-station-row {
  position: relative;
  isolation: isolate;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(94px, 112px) minmax(108px, 128px);
  gap: 9px;
  align-items: center;
  min-height: 0;
  height: auto;
  margin: 7px 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  overflow: hidden;
}

.pch-station-row.pch-rain-active {
  background: color-mix(in srgb, var(--pch-card-rain-color, #38bdf8) 9%, #fff);
  border-color: color-mix(in srgb, var(--pch-card-rain-color, #38bdf8) 58%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pch-card-rain-color, #38bdf8) 15%, transparent), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.pch-station-row.pch-rain-active::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.88;
  filter: saturate(1.35) contrast(1.08);
  background-image:
    radial-gradient(ellipse 5px 6px at 18% 16%, rgba(14, 165, 233, 0.34) 8%, rgba(56, 189, 248, 0.2) 48%, transparent 100%),
    radial-gradient(ellipse 4px 5px at 67% 38%, rgba(2, 132, 199, 0.3) 8%, rgba(56, 189, 248, 0.16) 48%, transparent 100%),
    radial-gradient(ellipse 6px 7px at 39% 73%, rgba(14, 165, 233, 0.26) 8%, rgba(125, 211, 252, 0.16) 50%, transparent 100%),
    radial-gradient(ellipse 4px 5.5px at 87% 61%, rgba(2, 132, 199, 0.28) 8%, rgba(56, 189, 248, 0.16) 50%, transparent 100%),
    radial-gradient(ellipse 5px 6px at 78% 10%, rgba(14, 165, 233, 0.26) 8%, rgba(125, 211, 252, 0.16) 50%, transparent 100%),
    radial-gradient(ellipse 4px 5px at 9% 91%, rgba(2, 132, 199, 0.24) 8%, rgba(56, 189, 248, 0.14) 50%, transparent 100%),
    radial-gradient(ellipse 5px 6px at 47% 27%, rgba(14, 165, 233, 0.26) 8%, rgba(125, 211, 252, 0.16) 50%, transparent 100%),
    radial-gradient(ellipse 4px 5px at 29% 49%, rgba(2, 132, 199, 0.28) 8%, rgba(56, 189, 248, 0.16) 50%, transparent 100%),
    radial-gradient(ellipse 6px 7px at 94% 29%, rgba(14, 165, 233, 0.23) 8%, rgba(125, 211, 252, 0.15) 50%, transparent 100%),
    radial-gradient(ellipse 4px 5.5px at 59% 88%, rgba(2, 132, 199, 0.26) 8%, rgba(56, 189, 248, 0.15) 50%, transparent 100%),
    radial-gradient(ellipse 5px 6px at 6% 37%, rgba(14, 165, 233, 0.23) 8%, rgba(125, 211, 252, 0.15) 50%, transparent 100%),
    radial-gradient(ellipse 4px 5px at 72% 56%, rgba(2, 132, 199, 0.25) 8%, rgba(56, 189, 248, 0.15) 50%, transparent 100%),
    radial-gradient(ellipse 5px 6px at 36% 9%, rgba(14, 165, 233, 0.24) 8%, rgba(125, 211, 252, 0.15) 50%, transparent 100%);
  background-size: 220px 180px, 260px 180px, 300px 180px, 240px 180px, 280px 180px, 320px 180px, 270px 180px, 310px 180px, 230px 180px, 290px 180px, 250px 180px, 330px 180px, 240px 180px, 300px 180px;
  background-position: 0 0, 18px 24px, 42px 55px, 66px 82px, 98px 37px, 126px 108px, 146px 18px, 168px 70px, 194px 112px, 216px 46px, 236px 132px, 258px 29px, 278px 94px, 298px 58px;
  animation: pch-card-rain-fall 1.65s linear infinite;
}

.pch-station-row.pch-rain-active::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  border: 2px solid var(--pch-card-rain-color, #38bdf8);
  border-radius: inherit;
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--pch-card-rain-color, #38bdf8) 28%, transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: pch-card-rain-pulse 1.65s ease-in-out infinite;
}

.pch-station-row.pch-rain-active > * {
  position: relative;
  z-index: 1;
}

@keyframes pch-card-rain-fall {
  to { background-position: 0 180px, 18px 204px, 42px 235px, 66px 262px, 98px 217px, 126px 288px, 146px 198px, 168px 250px, 194px 292px, 216px 226px, 236px 312px, 258px 209px, 278px 274px, 298px 238px; }
}

@keyframes pch-card-rain-pulse {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.72; }
}

@media (prefers-reduced-motion: reduce) {
  .pch-station-row.pch-rain-active::before,
  .pch-station-row.pch-rain-active::after { animation: none; }
  .pch-station-row.pch-rain-active::after { opacity: 0.35; }
}

.pch-station-row.active {
  border-left: 3px solid var(--pu-blue);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

.pch-station-row.pch-rain-active.active {
  background: color-mix(in srgb, var(--pch-card-rain-color, #38bdf8) 9%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pch-card-rain-color, #38bdf8) 15%, transparent), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.pch-station-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.pch-station-live-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.pch-station-live-dot.is-stale {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.pch-station-name-wrap { min-width: 0; }
.pch-rain-now {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  border: 1px solid color-mix(in srgb, var(--pch-card-rain-color, #0284c7) 55%, #fff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pch-card-rain-color, #0284c7) 14%, #fff);
  padding: 2px 6px 2px 4px;
  color: color-mix(in srgb, var(--pch-card-rain-color, #0284c7) 78%, #0f172a);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.pch-rain-now svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pch-rain-cloud { fill: rgba(14, 165, 233, 0.14); }
.pch-rain-drop { animation: pch-rain-fall 0.8s ease-in infinite; }
.pch-rain-drop.drop-two { animation-delay: 0.18s; }
.pch-rain-drop.drop-three { animation-delay: 0.36s; }

@keyframes pch-rain-fall {
  0% { opacity: 0.25; transform: translateY(-2px); }
  55% { opacity: 1; }
  100% { opacity: 0.25; transform: translateY(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .pch-rain-drop { animation: none; }
}

.pch-station-name-wrap .st-name {
  display: block;
  min-width: 0;
  overflow: visible;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
  visibility: visible;
  opacity: 1;
}
.pch-station-time {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.pch-station-current,
.pch-station-accumulation {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  box-sizing: border-box;
}

.pch-station-metric-label {
  color: var(--text-muted);
  font-size: 8.5px;
  line-height: 1.15;
}

.pch-station-current > strong,
.pch-station-accumulation > strong {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.pch-station-current > strong small,
.pch-station-accumulation > small {
  color: var(--text-muted);
  font-family: inherit;
  font-size: 9px;
  font-weight: 500;
}

.pch-station-accumulation .pch-station-unit-badge {
  vertical-align: super;
  margin-left: 3px;
  padding: 2px 4px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-family: var(--font-sans);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pch-station-accumulation {
  min-height: 0;
  padding: 6px 4px;
  border-radius: 9px;
  background: #eff6ff;
  color: #2563eb;
}
.pch-station-accumulation > strong { color: #2563eb; }
.pch-station-accumulation .badge,
.pch-station-current .badge {
  max-width: 100%;
  padding: 2px 7px;
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
}
.pch-station-rain-bar {
  display: block;
  width: 62%;
  max-width: 72px;
  height: 4px;
  margin: 1px auto;
  border-radius: 999px;
}
.pch-rain-badge { color: #fff; }
.pch-rain-none { background: #8d99ae; }
.pch-rain-light { background: #7ec8e3; color: #0f172a; }
.pch-rain-moderate { background: #f4a261; color: #0f172a; }
.pch-rain-heavy { background: #f77f00; color: #fff; }
.pch-rain-extreme { background: #e63946; color: #fff; }
.pch-rain-unknown { background: #e2e8f0; color: #475569; }

@container pch-station-list (max-width: 450px) {
  .pch-station-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 4px 6px;
    min-height: 0;
    padding: 6px 7px;
  }
  .pch-station-identity { grid-column: 1 / -1; }
  .pch-station-current, .pch-station-accumulation { min-height: 0; padding: 5px 3px; }
  .pch-station-current > strong, .pch-station-accumulation > strong { font-size: 14px; }
  .pch-station-metric-label { font-size: 8px; white-space: nowrap; }
}

#pch-bottom-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

#pch-kontrol-isohyet-card,
#pch-peta-isohyet-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

#pch-kontrol-isohyet-card > .card-header .card-title {
  font-size: 9.5px;
}

#pch-kontrol-isohyet-card > .card-header .card-subtitle {
  font-size: 9px;
}

#pch-peta-isohyet-card > .card-header .card-title {
  font-size: 9.5px;
}

#pch-peta-isohyet-card > .card-header .card-subtitle {
  font-size: 9px;
}

#pch-trend-chart-card .pch-trend-chart-canvas {
  height: 210px;
}

#pch-kontrol-isohyet-card .isohyet-map-box,
#pch-peta-isohyet-card .isohyet-map-box {
  height: 340px;
}

#pch-kontrol-isohyet-card .isohyet-map-box,
#pch-peta-isohyet-card .isohyet-map-box {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Pos Hidrologi Duga Air Card Height Alignment */
#pda-daftar-pos-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

#pda-stations-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.pda-station-row {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  margin: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.pda-station-row.pda-alert-active {
  border-color: color-mix(in srgb, var(--pda-alert-color, #eab308) 62%, #fff);
  background: color-mix(in srgb, var(--pda-alert-color, #eab308) 10%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pda-alert-color, #eab308) 16%, transparent), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.pda-station-row.pda-alert-active::before {
  position: absolute;
  z-index: 0;
  inset: -70% -20%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--pda-alert-color, #eab308) 30%, transparent) 0 12%, transparent 13% 24%, color-mix(in srgb, var(--pda-alert-color, #eab308) 20%, transparent) 25% 31%, transparent 32% 100%);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: pda-card-alert-wave 2s ease-out infinite;
}

.pda-station-row.pda-alert-active::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  border: 2px solid var(--pda-alert-color, #eab308);
  border-radius: inherit;
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--pda-alert-color, #eab308) 26%, transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: pda-card-alert-border 1.65s ease-in-out infinite;
}

.pda-station-row.pda-alert-active > * {
  position: relative;
  z-index: 1;
}

.pda-station-row.pda-alert-active.active {
  background: color-mix(in srgb, var(--pda-alert-color, #eab308) 10%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pda-alert-color, #eab308) 16%, transparent), 0 4px 12px rgba(15, 23, 42, 0.1);
}

@keyframes pda-card-alert-wave {
  0% { opacity: 0.8; transform: scale(0.35); }
  70% { opacity: 0.24; }
  100% { opacity: 0; transform: scale(1.2); }
}

@keyframes pda-card-alert-border {
  0%, 100% { opacity: 0.16; }
  50% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .pda-station-row.pda-alert-active::before,
  .pda-station-row.pda-alert-active::after { animation: none; }
  .pda-station-row.pda-alert-active::before { display: none; }
  .pda-station-row.pda-alert-active::after { opacity: 0.35; }
}

.pda-station-card {
  display: block;
  width: auto;
  padding: 9px;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--pda-alert-color, #0284c7) 38%, #fff);
  background: color-mix(in srgb, var(--pda-alert-color, #0284c7) 7%, #fff);
  box-sizing: border-box;
}

.pda-station-card:hover,
.pda-station-card.active {
  border-color: color-mix(in srgb, var(--pda-alert-color, #0284c7) 68%, #fff);
  background: color-mix(in srgb, var(--pda-alert-color, #0284c7) 11%, #fff);
}

.pda-card-heading { display: grid; gap: 8px; }
.pda-card-title-wrap { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.pda-card-title { min-width: 0; overflow: hidden; color: #0f172a; font-size: 12px; font-weight: 850; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.pda-card-time { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; color: #526681; font-size: 8px; white-space: nowrap; }
.pda-card-time svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.pda-card-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12); }
.pda-card-live-dot.is-stale { background: #94a3b8; box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14); }

.pda-card-middle {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 44px minmax(82px, 1.05fr);
  gap: 6px;
  align-items: center;
}

.pda-card-status {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px solid color-mix(in srgb, var(--pda-alert-color, #0284c7) 58%, #fff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pda-alert-color, #0284c7) 9%, #fff);
  padding: 5px 6px;
  color: color-mix(in srgb, var(--pda-alert-color, #0284c7) 84%, #0f172a);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}
.pda-card-status svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.pda-water-gauge {
  position: relative;
  width: 40px;
  height: 49px;
  margin: 0 auto;
  border-right: 2px solid #b9d7e8;
  border-bottom: 2px solid #b9d7e8;
  border-left: 4px solid #34516a;
  border-radius: 0 0 9px 5px;
  background: rgba(255, 255, 255, 0.65);
  overflow: hidden;
}
.pda-gauge-ruler { position: absolute; z-index: 3; inset: 0 auto 0 0; width: 10px; background: repeating-linear-gradient(to bottom, transparent 0 6px, #64748b 6px 8px, transparent 8px 12px); }
.pda-gauge-water { position: absolute; right: 0; bottom: 0; left: 0; height: var(--pda-water-level, 0%); min-height: 0; background: linear-gradient(180deg, #38bdf8, #0ea5e9); transition: height 0.4s ease; }
.pda-gauge-water::before,
.pda-gauge-water::after { position: absolute; top: -7px; left: -8px; width: 130%; height: 13px; border-radius: 45%; background: #7dd3fc; content: ""; animation: pda-water-wave 2.2s ease-in-out infinite alternate; }
.pda-gauge-water::after { top: -3px; left: -20px; background: #0ea5e9; opacity: 0.72; animation-delay: -1.1s; }
.pda-gauge-water i,
.pda-gauge-water b { display: none; }

.pda-card-trend {
  display: grid;
  grid-template-columns: 17px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, currentColor 7%, #fff);
  padding: 5px 6px;
}
.pda-card-trend > span { grid-row: 1 / 3; font-size: 18px; font-weight: 900; line-height: 1; }
.pda-card-trend > strong { display: flex; flex-direction: column; font-size: 9px; line-height: 1.05; }
.pda-card-trend > strong b { margin-top: 3px; color: #0f172a; font-size: 10px; }
.pda-card-trend > small { margin-top: 3px; color: #475569; font-size: 7px; }
.pda-card-trend.trend-rise { color: #dc2626; }
.pda-card-trend.trend-fall { color: #16a34a; }
.pda-card-trend.trend-steady { color: #075985; }

.pda-card-metrics { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 5px; margin-top: 8px; }
.pda-card-metric {
  display: flex;
  min-width: 0;
  min-height: 62px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--pda-alert-color, #0284c7) 24%, #e2e8f0);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 6px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
}
.pda-card-metric > span { display: flex; align-items: center; gap: 3px; color: #334155; font-size: 7.5px; white-space: nowrap; }
.pda-card-metric > span svg { width: 13px; height: 13px; fill: none; stroke: #0ea5e9; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.pda-card-metric > strong { margin-top: 4px; color: #0f172a; font-family: var(--font-mono); font-size: 11px; font-weight: 850; line-height: 1.15; letter-spacing: -0.03em; white-space: nowrap; }
.pda-card-metric > strong small { font-size: 8px; }
.pda-card-tma > i { display: block; height: 4px; margin-top: 5px; border-radius: 999px; background: var(--pda-alert-color, #0284c7); }
.pda-card-tma > small { margin-top: 4px; overflow: hidden; color: color-mix(in srgb, var(--pda-alert-color, #0284c7) 76%, #0f172a); font-size: 6.5px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

@keyframes pda-water-wave {
  from { transform: translateX(-5px) rotate(-2deg); }
  to { transform: translateX(8px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pda-gauge-water::before,
  .pda-gauge-water::after { animation: none; }
}

@media (max-width: 460px) {
  .pda-card-title-wrap { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pda-card-middle { grid-template-columns: 1fr 62px 1.1fr; gap: 6px; }
  .pda-card-status { padding: 6px; font-size: 10px; }
  .pda-card-status svg { width: 18px; height: 18px; }
  .pda-card-metrics { grid-template-columns: 1fr; }
  .pda-card-metric { min-height: 70px; }
}

#pda-bottom-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

#pda-penampang-card,
#pda-cctv-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

#pda-penampang-card {
  border-radius: 12px;
}

#pda-penampang-card > .card-header {
  padding: 12px 14px;
}

#pda-penampang-card .card-title {
  color: var(--text-main);
  font-size: 15px;
  letter-spacing: 0.015em;
}

#pda-penampang-card .river-cross-diagram {
  flex: 1;
  height: auto;
  min-height: 0;
  width: 100%;
  position: relative;
}

.river-cross-source {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.river-cross-empty {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

#pda-cctv-card .pda-cctv-stream-box {
  flex: 1;
  height: auto;
  min-height: 0;
  width: 100%;
  position: relative;
}

/* Keep the surveyed profile wide while this PDA has no usable CCTV frames. */
#pda-bottom-split.cctv-collapsed {
  grid-template-columns: minmax(0, 1fr) 58px;
}

#pda-bottom-split > #pda-penampang-card {
  min-width: 0;
}

#pda-cctv-card .pda-cctv-collapsed-rail {
  display: none;
}

.pda-cctv-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pda-cctv-collapse-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: pointer;
}

.pda-cctv-collapse-button[hidden] { display: none; }
.pda-cctv-collapse-button:hover { background: var(--surface-hover); color: var(--text-main); }
.pda-cctv-collapse-button svg { width: 16px; height: 16px; }

#pda-cctv-card.cctv-collapsed .card-header,
#pda-cctv-card.cctv-collapsed .pda-cctv-stream-box {
  display: none !important;
}

#pda-cctv-card.cctv-has-stream .pda-cctv-stream-box > svg,
#pda-cctv-card.cctv-has-stream #pda-cctv-feed-msg {
  display: none;
}

#pda-cctv-card .pda-cctv-stream-box video,
#pda-cctv-card .pda-cctv-stream-box img[data-cctv-live-stream] {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#pda-cctv-card.cctv-collapsed .pda-cctv-collapsed-rail {
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 6px;
  border: 0;
  color: var(--text-muted);
  border-left: 3px solid #94a3b8;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

#pda-cctv-card.cctv-collapsed .pda-cctv-collapsed-rail:hover { background: var(--surface-hover); }
#pda-cctv-card .pda-cctv-collapsed-rail:focus-visible,
.pda-cctv-collapse-button:focus-visible {
  outline: 2px solid var(--pu-blue);
  outline-offset: -3px;
}

#pda-cctv-card.cctv-collapsed.cctv-pos-online .pda-cctv-collapsed-rail {
  border-left-color: #16a34a;
}

#pda-cctv-card.cctv-collapsed.cctv-pos-offline .pda-cctv-collapsed-rail {
  border-left-color: #ef4444;
}

.pda-cctv-rail-title,
.pda-cctv-rail-status {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pda-cctv-rail-title {
  color: var(--text-main);
  font-size: 13px;
}

.pda-cctv-rail-status {
  font-size: 10px;
}

.pda-cctv-rail-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #94a3b8;
}

#pda-cctv-card.cctv-pos-online .pda-cctv-rail-status { color: #16a34a; }
#pda-cctv-card.cctv-pos-online .pda-cctv-rail-dot { background: #16a34a; }
#pda-cctv-card.cctv-pos-offline .pda-cctv-rail-status { color: #ef4444; }
#pda-cctv-card.cctv-pos-offline .pda-cctv-rail-dot { background: #ef4444; }

@media (max-width: 992px) {
  #pda-bottom-split:not(.cctv-collapsed) {
    grid-template-columns: minmax(0, 1fr);
  }

  #pda-bottom-split.cctv-collapsed {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  #pda-penampang-card .river-cross-diagram {
    flex: 0 0 300px;
    min-height: 300px;
  }

  #pda-cctv-card:not(.cctv-collapsed) .pda-cctv-stream-box {
    min-height: 180px;
  }
}

/* Floating Top Controller inside Isohyet Maps */
.isohyet-floating-top-ctrl {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  pointer-events: auto;
}

.isohyet-floating-top-ctrl::-webkit-scrollbar {
  display: none;
}

.isohyet-pill-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  color: #334155;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  font-family: inherit;
}

.isohyet-pill-btn:hover {
  background: #ffffff;
  color: #0284c7;
  border-color: #bae6fd;
  transform: translateY(-1px);
}

.isohyet-pill-btn.is-date {
  gap: 5px;
}

.isohyet-date-icon,
.isohyet-date-icon svg {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.isohyet-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.isohyet-pill-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.isohyet-period-loading {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ews-nowcast-forecast-action {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
}
.ews-nowcast-forecast-action > div { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.ews-nowcast-forecast-action strong { color: var(--text-main); font-size: 11px; font-weight: 750; }
.ews-nowcast-forecast-action > div > span { color: var(--text-muted); font-size: 10px; }
.ews-nowcast-forecast-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #0b4b83;
  border-radius: 7px;
  padding: 9px 12px;
  background: #0b3a70;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.ews-nowcast-forecast-action a:hover { background: #12528f; transform: translateY(-1px); }
.ews-nowcast-forecast-action a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.isohyet-data-empty {
  margin: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #475569;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  font-size: 11px;
  font-weight: 650;
}

.rainfall-isohyet-overlay {
  mix-blend-mode: multiply;
}

#chips-isohyet-prediksi .isohyet-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

[data-theme="dark"] .isohyet-pill-btn {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .isohyet-pill-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #38bdf8;
  border-color: #38bdf8;
}

[data-theme="dark"] .isohyet-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* Bottom Legend Strip (Kriteria mm) */
.isohyet-bottom-legend-strip {
  display: grid;
  grid-template-columns: 78px repeat(5, 1fr);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-card);
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}

.legend-header-cell {
  background: #cbd5e1;
  color: #0f172a;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4px;
  line-height: 1.15;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .legend-header-cell {
  background: #334155;
  color: #f8fafc;
  border-right-color: rgba(255, 255, 255, 0.08);
}

.legend-col-item {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  min-width: 0;
}

.legend-col-item:last-child {
  border-right: none;
}

[data-theme="dark"] .legend-col-item {
  border-right-color: rgba(255, 255, 255, 0.06);
}

.legend-val-bar {
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
  font-weight: 700;
  padding: 0 2px;
  white-space: nowrap;
}

.legend-desc-lbl {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 8px;
  font-weight: 600;
  background: #ffffff;
  color: #1e293b;
  padding: 0 1px;
  line-height: 1.1;
}

[data-theme="dark"] .legend-desc-lbl {
  background: #1e293b;
  color: #cbd5e1;
}

/* Curah Hujan Specifics */
.skala-intensitas-bar {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(to right, #8d99ae 0%, #7ec8e3 25%, #f4a261 50%, #f77f00 75%, #e63946 100%);
  margin: 10px 0 6px 0;
  border: 1px solid rgba(0,0,0,0.08);
  position: relative;
}

.skala-intensitas-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 17px;
  background-color: #0f172a;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.skala-intensitas-marker::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #0f172a;
}

.skala-intensitas-labels {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.kala-ulang-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 11px;
}

.kala-ulang-table th,
.kala-ulang-table td {
  padding: 5px 6px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.kala-ulang-table th {
  background-color: var(--surface-alt);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
}

.kala-ulang-table td {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
}

/* Kala Ulang Hujan Modern Grid Cards (Matches Reference Mockup) */
.kala-ulang-grid-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}

.ku-period-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ku-period-heading {
  color: var(--text-main);
  font-size: 9px;
  font-weight: 700;
}

.ku-period-heading span {
  color: var(--text-muted);
  font-weight: 500;
}

.ku-period-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.ku-period-grid > .ku-box:nth-child(-n + 4) {
  grid-column: span 3;
}

.ku-period-grid > .ku-box:nth-child(n + 5) {
  grid-column: span 4;
}

.ku-period-grid > .ku-box:nth-child(5) {
  grid-column: 1 / span 4;
}

.ku-period-grid > .ku-box:nth-child(6) {
  grid-column: 5 / span 4;
}

.ku-period-grid > .ku-box:nth-child(7) {
  grid-column: 9 / span 4;
}

.ku-period-grid .ku-box {
  min-height: 42px;
  gap: 3px;
}

.ku-grid-header {
  display: grid;
  grid-template-columns: 32px repeat(7, minmax(0, 1fr));
  gap: 3px;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.ku-col-label {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ku-grid-row {
  display: grid;
  grid-template-columns: 32px repeat(7, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.ku-box {
  background-color: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 1px;
  min-height: 44px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  overflow: hidden;
}

.ku-box:hover {
  border-color: var(--pu-blue);
  transform: translateY(-1px);
}

.ku-box-lead {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  background-color: var(--surface-hover);
  padding: 5px 1px;
}

.ku-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  white-space: nowrap;
}

.ku-unit {
  font-size: 7.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

[data-theme="dark"] .ku-box {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .ku-box:hover {
  border-color: #60a5fa;
  background-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .ku-box-lead {
  color: #e2e8f0;
}

[data-theme="dark"] .ku-num {
  color: #f8fafc;
}

[data-theme="dark"] .ku-unit {
  color: #94a3b8;
}

.isohyet-legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 8px;
}

.isohyet-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 3px;
  background-color: var(--surface-alt);
}

.isohyet-swatch {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.isohyet-map-box {
  height: 270px;
  width: 100%;
  position: relative;
  background-color: #0f172a;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

#pos-left-tren-kritis {
  display: flex;
  flex-direction: column;
}

/* Tren Kritis Alert List */
.tren-kritis-list {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 10px;
  padding: 10px;
  flex: 1;
  min-height: 0;
}

.tren-kritis-item {
  border: 1px solid var(--border);
  background-color: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 11px 11px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.tren-kritis-item:hover {
  background-color: var(--surface);
  border-color: var(--pu-blue);
}

.tren-kritis-item.active {
  background-color: var(--surface);
  border-color: #0284c7;
  box-shadow: 0 0 0 1px #0284c7;
}

.tren-kritis-item.status-awas {
  border-left: 3.5px solid #ef4444;
}

.tren-kritis-item.status-siaga {
  border-left: 3.5px solid #f97316;
}

.tren-kritis-item.status-waspada {
  border-left: 3.5px solid #eab308;
}

.tren-kritis-item.status-normal {
  border-left: 3.5px solid #0284c7;
}

.tren-kritis-item.status-stale {
  border-left: 3.5px solid #94a3b8;
}

.tren-kritis-main {
  flex: 1;
  min-width: 0;
}

.tren-kritis-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.tren-kritis-icon {
  font-size: 9.5px;
  flex-shrink: 0;
}

.tren-kritis-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tren-kritis-meta {
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tren-kritis-sub {
  font-size: 8.5px;
  color: var(--text-muted);
  opacity: 0.8;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tren-kritis-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 1px;
  margin-left: 6px;
  text-align: right;
}

.tren-sparkline {
  display: block;
}

.tren-val-diff {
  font-size: 11px;
}

.tren-trend-lbl {
  font-size: 8.5px;
  line-height: 1.1;
}

.tren-time-lbl {
  font-size: 8px;
  line-height: 1.1;
}
#pos-left-tren-kritis .card-title { font-size:15px!important; }
#pos-left-tren-kritis > div:last-child { font-size:11px!important; }
#pos-left-tren-kritis .tren-kritis-list { flex:0 0 auto; }
#pos-left-tren-kritis .tren-kritis-item { flex:0 0 auto; min-height:76px; }
#pos-left-tren-kritis .tren-kritis-icon { font-size:13px; }
#pos-left-tren-kritis .tren-kritis-name { flex:1; min-width:0; font-size:14px; }
#pos-left-tren-kritis .tren-kritis-head .badge { flex-shrink:0; }
#pos-left-tren-kritis .tren-kritis-meta { font-size:12px; }
#pos-left-tren-kritis .tren-kritis-sub { font-size:11px; }
#pos-left-tren-kritis .tren-val-diff { font-size:14px; }
#pos-left-tren-kritis .tren-trend-lbl { font-size:11px; }
#pos-left-tren-kritis .tren-time-lbl { font-size:10px; }

/* Pasang Surut station cards */
#pos-left-tren-kritis .pasut-priority-list { display: grid; min-height: 0; flex: 1 1 auto; grid-template-columns: minmax(0,1fr); grid-auto-rows: minmax(0,1fr); justify-content: stretch; gap: 6px; overflow: hidden; padding: 6px; }
#pos-left-tren-kritis .pasut-priority-card { --pasut-card-accent: #18aae2; position: relative; isolation:isolate; display:flex; width:100%; min-width:0; min-height:0; flex-direction:column; box-sizing:border-box; overflow:hidden; border:1.5px solid color-mix(in srgb,var(--pasut-card-accent) 40%,#fff); border-left-width:1.5px; border-radius:14px; background:linear-gradient(135deg,#fff 30%,color-mix(in srgb,var(--pasut-card-accent) 8%,#fff)); box-shadow:0 5px 12px #23476412; padding:8px; }
#pos-left-tren-kritis .pasut-priority-card:hover, #pos-left-tren-kritis .pasut-priority-card.active { border-color: color-mix(in srgb,var(--pasut-card-accent) 65%,#fff); background: linear-gradient(135deg,#fff 27%,color-mix(in srgb,var(--pasut-card-accent) 11%,#fff)); box-shadow: 0 9px 22px #23476420,0 0 0 1px color-mix(in srgb,var(--pasut-card-accent) 13%,transparent); }
.pasut-card-heading { display: grid; min-width: 0; grid-template-columns: minmax(92px,1.15fr) 64px 62px; gap: 4px; align-items: center; }
.pasut-card-title-wrap { min-width: 0; }
#pos-left-tren-kritis .pasut-card-title-wrap .tren-kritis-name { display:block; overflow:hidden; color:#0b1f42; font-size:11.5px; font-weight:900; letter-spacing:-.02em; text-overflow:ellipsis; white-space:nowrap; }
.pasut-card-time { display:flex; align-items:center; gap:4px; margin-top:3px; color:#587594; font-size:7.8px; font-weight:700; white-space:nowrap; }
.pasut-card-time i { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px #16a34a1c; }
.pasut-card-time i.stale { background: #94a3b8; box-shadow: 0 0 0 3px #94a3b824; }
.pasut-card-phase { display:inline-flex; max-width:100%; align-items:center; gap:3px; overflow:hidden; margin-top:6px; border:1px solid color-mix(in srgb,var(--pasut-card-accent) 56%,#fff); border-radius:999px; background:color-mix(in srgb,var(--pasut-card-accent) 11%,#fff); padding:4px 6px; color:color-mix(in srgb,var(--pasut-card-accent) 80%,#0f172a); font-size:7.8px; font-weight:900; text-overflow:ellipsis; white-space:nowrap; }
.pasut-card-phase svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.pasut-card-scene { position: relative; width: 64px; height: 58px; overflow: hidden; border-radius: 9px; }
.pasut-scene-cloud { position: absolute; z-index: 2; display: block; height: 8px; border-radius: 999px; background: #b9e4f7; }
.pasut-scene-cloud::before, .pasut-scene-cloud::after { position: absolute; bottom: 2px; border-radius: 50%; background: inherit; content: ""; }
.pasut-scene-cloud::before { left: 10px; width: 11px; height: 11px; }
.pasut-scene-cloud::after { right: 8px; width: 15px; height: 15px; }
.pasut-scene-cloud.one { top: 8px; right: 1px; width: 33px; }
.pasut-scene-cloud.two { top: 15px; left: 2px; width: 25px; }
.pasut-scene-birds { position: absolute; z-index: 3; top: 22px; right: 3px; color: #275476; font-size: 9px; letter-spacing: 3px; transform: rotate(-6deg); }
.pasut-lighthouse { position: absolute; z-index: 5; bottom: 10px; left: 14px; width: 11px; height: 34px; border: 1.5px solid #38536a; background: repeating-linear-gradient(to bottom,#f8fafc 0 7px,#ef4444 7px 13px); clip-path: polygon(22% 0,78% 0,100% 100%,0 100%); }
.pasut-lighthouse::before { position: absolute; top: -7px; left: -3px; width: 15px; height: 7px; border: 2px solid #38536a; border-radius: 5px 5px 0 0; background: #dff4fd; content: ""; }
.pasut-lighthouse::after { position: absolute; top: -12px; left: 4px; width: 2px; height: 6px; background: #38536a; content: ""; }
.pasut-lighthouse i, .pasut-lighthouse b { position: absolute; left: 4px; width: 3px; height: 5px; background: #29465d; }
.pasut-lighthouse i { top: 8px; }.pasut-lighthouse b { top: 25px; }
.pasut-scene-rock { position: absolute; z-index: 4; bottom: 5px; left: 0; width: 34px; height: 12px; border-radius: 60% 45% 0 0; background: linear-gradient(145deg,#cbd5e1,#64748b); }
.pasut-scene-waves { position: absolute; z-index: 3; right: 0; bottom: 4px; width: 49px; height: 18px; border-radius: 50% 0 0; background: repeating-radial-gradient(ellipse at 7px 2px,#38bdf8 0 4px,#0ea5e9 5px 8px,#7dd3fc 9px 12px); }
.pasut-card-trend { display: grid; min-width: 0; justify-items: center; border-radius: 9px; background: #eaf6fd; padding: 4px 2px; color: #075985; text-align: center; }
.pasut-card-trend.rising { background: #fff0f0; color: #dc2626; }.pasut-card-trend.falling { background: #ecfdf3; color: #16a34a; }.pasut-card-trend.unknown { color: #64748b; }
.pasut-card-trend strong { color:inherit; font-size:9px; font-weight:900; white-space:nowrap; }.pasut-card-trend b { margin-top:1px; color:#0f1f3d; font-size:9px; white-space:nowrap; }.pasut-card-trend small { margin-top:1px; color:#526681; font-size:6.3px; white-space:nowrap; }
.pasut-card-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; margin-top:auto; padding-top:8px; }
.pasut-card-metrics > div { display:flex; min-width:0; min-height:57px; flex-direction:column; align-items:center; justify-content:center; border:1px solid color-mix(in srgb,var(--pasut-card-accent) 18%,#e2e8f0); border-radius:9px; background:#ffffffd6; box-shadow:0 2px 6px #24445c0b; padding:5px 3px; text-align:center; }
.pasut-card-metrics > div > span { display:flex; min-width:0; align-items:center; gap:3px; color:#139dd9; font-size:9px; }.pasut-card-metrics > div > span b { overflow:hidden; color:#29465f; font-size:6.5px; text-overflow:ellipsis; white-space:nowrap; }
.pasut-card-metrics > div > strong { margin-top:3px; color:#0b1f42; font-size:12px; font-weight:900; white-space:nowrap; }.pasut-card-metrics > div > small { margin-top:2px; color:#526681; font-size:6.5px; line-height:1.15; }
.pasut-card-level > i { position: relative; display: block; width: 88%; height: 3px; overflow: hidden; margin-top: 2px; border-radius: 999px; background: color-mix(in srgb,var(--pasut-card-accent) 17%,#e2e8f0); }.pasut-card-level > i > b { position: absolute; inset: 0 auto 0 0; width: var(--pasut-level,0%); border-radius: inherit; background: var(--pasut-card-accent); }
#pos-left-tren-kritis .pasut-priority-card.tone-danger { --pasut-card-accent:#ef4444; }#pos-left-tren-kritis .pasut-priority-card.tone-watch { --pasut-card-accent:#eab308; }#pos-left-tren-kritis .pasut-priority-card.tone-unknown { --pasut-card-accent:#94a3b8; }

/* Kualitas Air station cards */
#pos-left-kualitas-air { display:flex; min-height:0; flex-direction:column; }
#pos-left-kualitas-air .wq-priority-list { display:grid; min-height:0; flex:1 1 auto; grid-template-columns:minmax(0,1fr); grid-auto-rows:auto; align-content:space-between; justify-content:stretch; gap:7px; overflow:visible; padding:7px; }
#pos-left-kualitas-air .wq-priority-card { --wq-card-accent:#18aae2; position:relative; isolation:isolate; display:block; width:100%; min-width:0; min-height:0; box-sizing:border-box; overflow:hidden; border:1.5px solid color-mix(in srgb,var(--wq-card-accent) 40%,#fff); border-radius:15px; background:linear-gradient(135deg,#fff 26%,color-mix(in srgb,var(--wq-card-accent) 8%,#fff)); box-shadow:0 5px 13px #23476414; padding:6px 8px; }
#pos-left-kualitas-air .wq-priority-card:hover,#pos-left-kualitas-air .wq-priority-card.active { border-color:color-mix(in srgb,var(--wq-card-accent) 66%,#fff); background:linear-gradient(135deg,#fff 24%,color-mix(in srgb,var(--wq-card-accent) 11%,#fff)); box-shadow:0 7px 17px #2347641d,0 0 0 1px color-mix(in srgb,var(--wq-card-accent) 12%,transparent); }
.wq-card-heading { display:block; min-width:0; }
.wq-card-title-wrap { display:grid; min-width:0; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; column-gap:5px; align-items:center; }
#pos-left-kualitas-air .wq-card-title-wrap .tren-kritis-name { display:block; min-width:0; overflow:hidden; color:#0b1f42; font-size:12.5px; font-weight:900; letter-spacing:-.02em; text-overflow:ellipsis; white-space:nowrap; }
.wq-card-time { display:flex; grid-column:1 / -1; grid-row:2; align-items:center; gap:4px; margin-top:1px; color:#587594; font-size:8px; font-weight:700; white-space:nowrap; }
.wq-card-time i { width:9px; height:9px; flex:none; border-radius:50%; background:#16a34a; box-shadow:0 0 0 3px #16a34a1c; }
.wq-card-time i.stale { background:#94a3b8; box-shadow:0 0 0 3px #94a3b824; }
.wq-card-status { display:inline-flex; grid-column:2; grid-row:1; max-width:145px; align-items:center; justify-content:center; gap:4px; margin:0; border:1.5px solid color-mix(in srgb,var(--wq-card-accent) 62%,#fff); border-radius:999px; background:color-mix(in srgb,var(--wq-card-accent) 13%,#fff); padding:4px 7px; color:color-mix(in srgb,var(--wq-card-accent) 84%,#0f172a); font-size:9px; font-weight:900; line-height:1.1; white-space:nowrap; }
.wq-card-status svg { width:13px; height:13px; flex:none; fill:none; stroke:currentColor; stroke-width:2.2; }
.wq-card-scene { display:none; }
.wq-sun { position:absolute; top:8px; right:18px; width:14px; height:14px; border-radius:50%; background:#facc15; box-shadow:0 0 10px #facc1575; }
.wq-hill { position:absolute; border-radius:50% 50% 0 0; background:#9bdcf2; }
.wq-hill.back { right:4px; bottom:25px; width:75px; height:35px; }.wq-hill.front { right:0; bottom:20px; width:62px; height:27px; background:#65c13e; }
.wq-lake { position:absolute; right:0; bottom:0; width:78%; height:26px; border-radius:50% 0 0; background:repeating-linear-gradient(172deg,#26b9e8 0 5px,#71d4ef 6px 10px,#e1f8ff 11px 12px); }
.wq-tree { position:absolute; z-index:3; bottom:21px; width:7px; height:20px; border-radius:50% 50% 25% 25%; background:#3fb429; box-shadow:0 5px 0 -2px #70411f; }
.wq-tree::after { position:absolute; bottom:-5px; left:3px; width:2px; height:7px; background:#70411f; content:""; }.wq-tree.one { right:9px; transform:scale(1.15); }.wq-tree.two { right:39px; transform:scale(.82); }.wq-tree.three { right:62px; transform:scale(.65); }
.wq-solar-mast { position:absolute; z-index:5; bottom:15px; left:26px; width:3px; height:39px; background:#285b78; }.wq-solar-mast::after { position:absolute; top:-4px; left:7px; width:2px; height:45px; background:#285b78; content:""; }
.wq-solar-panel { position:absolute; z-index:6; top:12px; left:7px; width:36px; height:16px; border:2px solid #246487; background:repeating-linear-gradient(90deg,#2277a4 0 7px,#8dd4ee 8px 9px); transform:skew(-19deg); }
.wq-sensor-box { position:absolute; z-index:6; bottom:7px; left:16px; width:27px; height:17px; border-radius:3px 3px 0 0; background:linear-gradient(90deg,#8db7b8,#d9f2ed); box-shadow:0 3px 0 #658a8d; }
.wq-card-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:3px; }
.wq-card-metric { display:flex; min-width:0; min-height:39px; flex-direction:column; align-items:center; justify-content:flex-start; border:1px solid color-mix(in srgb,var(--wq-card-accent) 15%,#e2e8f0); border-radius:8px; background:#ffffffcf; box-shadow:0 2px 7px #24445c0b; padding:2px; text-align:center; }
.wq-card-metric > span { display:flex; min-width:0; align-items:center; gap:3px; color:#263b57; font-size:8.3px; font-weight:800; white-space:nowrap; }.wq-card-metric > span i { color:#0ea5e9; font-size:9px; font-style:normal; font-weight:900; }
.wq-card-metric > strong { overflow:hidden; max-width:100%; margin-top:1px; color:#081b3a; font-size:12px; font-weight:900; text-overflow:ellipsis; white-space:nowrap; }.wq-card-metric.metric-wqi > strong,.wq-card-metric.metric-ip > strong { font-size:14px; }.wq-card-metric > strong small { color:#385271; font-size:6.5px; font-weight:700; }
.wq-card-metric > b { position:relative; display:block; width:88%; height:3px; overflow:hidden; margin-top:auto; border-radius:999px; background:color-mix(in srgb,var(--wq-card-accent) 16%,#e2e8f0); }.wq-card-metric > b > i { position:absolute; inset:0 auto 0 0; border-radius:inherit; background:var(--wq-card-accent); }
#pos-left-kualitas-air .wq-priority-card.tone-danger { --wq-card-accent:#ef4444; }#pos-left-kualitas-air .wq-priority-card.tone-unknown { --wq-card-accent:#94a3b8; }
.wq-list-footer { margin-top:auto; border-top:1px solid var(--border-subtle); color:var(--text-muted); }
.wq-regulation-note { display:flex; flex-direction:column; gap:1px; padding:6px 12px; border-bottom:1px solid var(--border-subtle); background:linear-gradient(90deg,#effaf6,#f8fafc); color:#275c50; font-size:7.5px; font-weight:800; line-height:1.25; }
.wq-regulation-note small { color:#64748b; font-size:7px; font-weight:700; }
.wq-list-updated { display:flex; align-items:center; justify-content:space-between; padding:7px 12px; font-size:9px; }

@media (max-width:992px) {
  #pos-left-kualitas-air .wq-priority-list { flex:0 0 auto; grid-auto-rows:auto; align-content:start; overflow:visible; }
  #pos-left-kualitas-air .wq-priority-card { min-height:0; }
}

/* ==========================================================
   PASANG SURUT 48-HOUR & 3-COLUMN LAYOUT
   ========================================================== */
.pasut-layout-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pasut-top-chart-card {
  grid-column: 1 / span 2;
  grid-row: 1;
  overflow: hidden;
}

.pasut-top-chart-card .card-header {
  min-height: 58px;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.07), transparent);
}

#pasut-chart-datum-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
}

#pasut-tide-chart-canvas {
  width: 100%;
  height: 250px;
}

/* Datum Switcher (LAT vs MSL) */
.pasut-datum-switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 7px 5px 12px;
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.08);
}

.pasut-datum-switch-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pasut-datum-switch {
  display: inline-flex;
  align-items: center;
  background: var(--surface-hover);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

.pasut-datum-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  user-select: none;
}

.pasut-datum-btn .datum-code {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.pasut-datum-btn .datum-desc {
  font-size: 9.5px;
  font-weight: 500;
  opacity: 0.85;
}

.pasut-datum-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.45);
}

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

.pasut-datum-btn.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff !important;
  border-color: #0284c7;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.35);
}

.pasut-datum-btn.active .datum-code {
  color: #ffffff;
}

.pasut-datum-btn.active .datum-desc {
  opacity: 0.95;
  color: #e0f2fe;
}

.pasut-bottom-grid {
  display: contents;
}

#pasut-dataran-card { grid-column: 1; grid-row: 2; }
#pasut-prediksi-card { grid-column: 3; grid-row: 1; }
.pasut-summary-card { grid-column: 2; grid-row: 2; }
.pasut-additional-card { grid-column: 3; grid-row: 2; }

.pasut-section-header {
  padding: 10px 14px;
}

.pasut-section-header .card-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.25px;
}

#pasut-prediksi-card .pasut-prediksi-body {
  padding: 7px 10px 10px;
}

#pasut-forecast-source-note,
.pasut-info-note {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(2, 132, 199, 0.14);
  border-radius: 9px;
  background: rgba(2, 132, 199, 0.07);
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.pasut-summary-body,
.pasut-additional-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
}

.pasut-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.pasut-summary-stats > div,
.pasut-info-tile {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-alt);
}

.pasut-summary-stats span,
.pasut-info-tile span {
  display: block;
  color: var(--text-muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.25px;
  text-transform: uppercase;
}

.pasut-summary-stats strong,
.pasut-info-tile strong {
  display: block;
  margin-top: 3px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 14px;
}

.pasut-summary-stats small,
.pasut-info-tile small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pasut-mini-bars {
  display: flex;
  height: 62px;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-top: 1px solid var(--border-subtle);
}

.pasut-mini-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  background: #0ea5e9;
  opacity: 0.82;
}

.pasut-mini-bar.negative { background: #f97316; }

.pasut-additional-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pasut-additional-body .pasut-info-note {
  grid-column: 1 / -1;
  margin-top: 0;
}

.pasut-bottom-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* 1. DAFTAR POS PASUT */
.pasut-station-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 10px 10px 10px;
  overflow-y: auto;
  flex: 1;
}

.pasut-station-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pasut-station-item:hover {
  background-color: var(--surface-hover);
  border-color: #38bdf8;
}

.pasut-station-item.active {
  background-color: rgba(2, 132, 199, 0.06);
  border-color: #0284c7;
  box-shadow: 0 0 0 1px #0284c7;
}

.pasut-item-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pasut-item-info {
  flex: 1;
  min-width: 0;
}

.pasut-item-name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pasut-item-sub {
  font-size: 8.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.pasut-item-status {
  flex-shrink: 0;
  margin: 0 4px;
}

.pasut-item-val {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.pasut-trend-up {
  color: #ef4444;
  font-weight: 800;
  font-size: 10px;
}

.pasut-trend-down {
  color: #0284c7;
  font-weight: 800;
  font-size: 10px;
}

.pasut-item-time {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-left: 4px;
}

.pasut-item-menu {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
}

/* 2. DATARAN PASANG SURUT */
.pasut-dataran-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pasut-datum-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 8px;
}

.pasut-datum-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 10px;
  line-height: 1.3;
  text-align: left;
}

.pasut-datum-table th,
.pasut-datum-table td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--border-subtle);
}

.pasut-datum-table thead th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}

.pasut-datum-table tbody th {
  width: 20%;
  color: var(--text-main);
  font-weight: 800;
}

.pasut-datum-table td:nth-child(2) {
  width: 25%;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}

.pasut-datum-table td:last-child {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.pasut-datum-table tbody tr:last-child th,
.pasut-datum-table tbody tr:last-child td {
  border-bottom: 0;
}

.pasut-levels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.pasut-level-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
}

.pasut-level-code {
  width: 36px;
  font-weight: 700;
  font-size: 10px;
  color: var(--text-muted);
}

.pasut-level-bar-wrap {
  width: 75px;
  height: 7px;
  background-color: var(--surface-alt);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pasut-level-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.pasut-level-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.pasut-level-bullet {
  font-size: 11px;
  line-height: 1;
}

.pasut-level-num {
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  white-space: nowrap;
}

.pasut-level-desc {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pasut-range-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
  margin-top: auto;
}

.pasut-range-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.pasut-range-visual-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pasut-range-svg-box {
  flex: 1;
  height: 52px;
}

.pasut-range-dimension {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pasut-dimension-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 50px;
}

.dim-arrow-up {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 4px solid #0284c7;
}

.dim-arrow-down {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid #0284c7;
}

.dim-line {
  width: 1.5px;
  flex: 1;
  background: #0284c7;
}

.pasut-dimension-val {
  font-size: 11.5px;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* 3. PREDIKSI PASUT & RIWAYAT EKSTREM */
.pasut-prediksi-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pasut-pred-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.pasut-pred-table th {
  text-align: left;
  padding: 4px 6px;
  font-size: 8.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.pasut-pred-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 10px;
}

.pasut-date-sub {
  font-size: 8px;
  color: var(--text-muted);
  margin-top: 1px;
  font-weight: normal;
}

.pasut-type-cell {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 9.5px;
  color: #0284c7;
}

.pasut-type-cell.pasut-type-high { color: #ef4444; }
.pasut-type-cell.pasut-type-low { color: #0284c7; }

.pasut-ekstrem-section {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
}

.pasut-ekstrem-title {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.pasut-ekstrem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pasut-ekstrem-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pasut-ekstrem-arrow {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.pasut-ekstrem-lbl {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.pasut-ekstrem-val {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-top: 1px;
}

.pasut-ekstrem-sub {
  font-size: 8.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Leaflet Pin Pill on Map */
.custom-pasut-pin {
  background: transparent !important;
  border: none !important;
}

.pasut-pin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 2px 7px 2px 3px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.pasut-pin-pill:hover,
.pasut-pin-pill.selected {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.45), 0 3px 8px rgba(0, 0, 0, 0.5);
  z-index: 1000 !important;
}

.pasut-pin-badge-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--pin-accent, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.pasut-pin-pill-title {
  font-size: 9.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

/* Parameter Grid (Klimatologi & Kualitas Air) */
.params-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 10px;
}

.param-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.param-card:hover {
  border-color: var(--pu-blue);
  box-shadow: var(--shadow-sm);
}

.param-card.active {
  border-color: #ef4444;
  background-color: var(--surface-alt);
  box-shadow: 0 0 0 1.5px #ef4444;
}

.param-card.active-green {
  border-color: #10b981;
  background-color: var(--surface-alt);
  box-shadow: 0 0 0 1.5px #10b981;
}

.param-card-header {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.param-card-val {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.1;
  margin-top: 2px;
}

.param-card-unit {
  font-size: 10.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-muted);
  margin-left: 2px;
}

.param-card-bar {
  height: 3px;
  border-radius: 999px;
  margin-top: 6px;
  background-color: var(--border-subtle);
  overflow: hidden;
}

.param-card-bar-fill {
  height: 100%;
  border-radius: 999px;
}

/* Kualitas Air — Parameter Utama / Pendukung card grids. Built by
   renderKualitasAirParamCards() in app.js from the real wqParams object
   pos-hidrologi-inject.ts computes per pos (value, baku mutu range text,
   status, gauge marker %, sparkline) — these are layout/visual rules only,
   no demo numbers live here. */
.wq-params-section-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px 2px 14px;
}

.wq-params-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.wq-params-section-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.wq-params-utama-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px 14px 12px 14px;
}

.wq-param-utama-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wq-param-utama-card:hover {
  box-shadow: var(--shadow-sm);
}

.wq-param-utama-card.active-green {
  border-color: #10b981;
  box-shadow: 0 0 0 1.5px #10b981;
}

.wq-param-utama-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wq-param-utama-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

.wq-param-icon {
  width: 21px;
  height: 21px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wq-param-icon svg {
  width: 12px;
  height: 12px;
}

.wq-param-utama-valrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.wq-param-utama-val {
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1;
}

.wq-param-utama-val .wq-param-unit {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-muted);
  margin-left: 3px;
}

.wq-param-sparkline {
  flex-shrink: 0;
  display: block;
}

.wq-param-range-text {
  font-size: 9.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.wq-param-gauge {
  height: 6px;
  border-radius: 999px;
  position: relative;
  margin: 1px 0;
}

.wq-param-gauge-marker {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--surface);
  border: 3px solid var(--text-main);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.5px var(--surface);
}

.wq-param-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  align-self: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
}

.wq-param-status.wq-status-ok {
  background-color: var(--status-normal-bg, #ecfdf5);
  color: #16a34a;
}

.wq-param-status.wq-status-exceed {
  background-color: var(--status-awas-bg, #fef2f2);
  color: #dc2626;
}

.wq-param-status.wq-status-neutral {
  background-color: var(--surface-alt);
  color: var(--text-muted);
}

.wq-params-pendukung-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(104px, 1fr);
  gap: 8px;
  padding: 10px 14px 14px 14px;
  overflow-x: auto;
}

.wq-param-sup-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wq-param-sup-card:hover {
  border-color: var(--pu-blue);
  box-shadow: var(--shadow-sm);
}

.wq-param-sup-card.active-green {
  border-color: #10b981;
  box-shadow: 0 0 0 1.5px #10b981;
}

.wq-param-sup-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.wq-param-sup-val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.1;
}

.wq-param-sup-range {
  font-size: 9.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.wq-param-sup-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  align-self: center;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.wq-param-sup-status.wq-status-ok {
  background-color: var(--status-normal-bg, #ecfdf5);
  color: #16a34a;
}
.wq-param-sup-status.wq-status-exceed {
  background-color: var(--status-awas-bg, #fef2f2);
  color: #dc2626;
}
.wq-param-sup-status.wq-status-neutral {
  background-color: var(--surface-alt);
  color: var(--text-muted);
}

.wq-param-sup-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================================================
   MODERN KLIMATOLOGI SENSOR WIDGETS (Matching Reference Design)
   ========================================================================== */
.iklim-widgets-container {
  display: grid;
  grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.iklim-top-row {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 14px;
  min-height: 0;
}

.iklim-top-subgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
}

.iklim-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
}

.iklim-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.iklim-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.iklim-card.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
  background-color: #ffffff;
}

.iklim-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iklim-icon {
  width: 17px;
  height: 17px;
  color: #2563eb;
  stroke: #2563eb;
  flex-shrink: 0;
}

.iklim-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: -0.01em;
}

.iklim-card-val-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 14px;
}

.iklim-card-val {
  font-size: 27px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
  letter-spacing: -0.02em;
}

.iklim-card-unit {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

/* Arah Angin & Compass Card */
.iklim-wind-card {
  align-items: stretch;
  text-align: center;
}

.iklim-compass-wrap {
  position: relative;
  width: 175px;
  height: 175px;
  margin: 6px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iklim-compass-dial {
  position: relative;
  width: 100%;
  height: 100%;
}

.iklim-compass-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.compass-ring-bg {
  fill: #f8fafc;
}

.compass-ring-outer {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 1.5;
  stroke-dasharray: 3, 3;
}

.compass-ring-inner {
  fill: #ffffff;
  stroke: #cbd5e1;
  stroke-width: 1;
}

.compass-center-dot {
  fill: #94a3b8;
}

.compass-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  fill: #64748b;
  text-anchor: middle;
  dominant-baseline: middle;
  user-select: none;
}

.compass-n {
  fill: #ef4444;
  font-weight: 800;
  font-size: 13px;
}

.iklim-compass-needle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.needle-svg {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.25));
}

.iklim-wind-footer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.iklim-wind-deg {
  font-size: 25px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.iklim-wind-sep {
  font-size: 22px;
  font-weight: 300;
  color: #cbd5e1;
}

.iklim-wind-spd {
  font-size: 24px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.iklim-unit {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-left: 2px;
  text-transform: lowercase;
}

/* Dark Mode Support for Klimatologi */
[data-theme="dark"] .iklim-card {
  background-color: var(--surface);
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .iklim-card.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
  background-color: var(--surface);
}

[data-theme="dark"] .iklim-card-title {
  color: #cbd5e1;
}

[data-theme="dark"] .iklim-card-val,
[data-theme="dark"] .iklim-wind-deg,
[data-theme="dark"] .iklim-wind-spd {
  color: #f8fafc;
}

[data-theme="dark"] .iklim-card-unit,
[data-theme="dark"] .iklim-unit {
  color: #94a3b8;
}

[data-theme="dark"] .iklim-wind-sep {
  color: #475569;
}

[data-theme="dark"] .compass-ring-bg {
  fill: #1e293b;
}

[data-theme="dark"] .compass-ring-outer {
  stroke: #334155;
}

[data-theme="dark"] .compass-ring-inner {
  fill: #0f172a;
  stroke: #334155;
}

[data-theme="dark"] .compass-label {
  fill: #94a3b8;
}

@media (max-width: 1100px) {
  .iklim-widgets-container { grid-template-rows:none; height:auto!important; }
  .iklim-top-row {
    grid-template-columns: 1fr;
  }
  .iklim-bottom-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .iklim-top-subgrid {
    grid-template-columns: 1fr;
  }
  .iklim-bottom-row {
    grid-template-columns: 1fr;
  }
}

/* Klimatologi Full-Width Bottom Chart (Memanjang Kanan Kiri Penuh) */
#pos-bottom-klimatologi {
  width: 100%;
  margin-top: 14px;
  animation: fadeInChart 0.3s ease-out;
}

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

/* Staff-gauge TMA illustration — see renderTmaGaugeIllustration() in
   app.js, which builds the SVG itself; this just sizes its container. */
#pda-top-gauge svg {
  display: block;
}

/* Cross Section Diagram */
.river-cross-diagram {
  height: 180px;
  width: 100%;
  position: relative;
  background-color: var(--surface);
  border-radius: var(--radius-sm);
}

/* CCTV selected camera with side and bottom thumbnails */
.cctv-tab-content {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 2fr);
  align-items: stretch;
  gap: 14px;
}
.cctv-stations-card,
.cctv-wall-card { min-width: 0; }
.cctv-stations-card { display: flex; flex-direction: column; }
.cctv-station-scroll { max-height: min(68vh, 680px); }

.cctv-matrix-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  min-width: 0;
}

.cctv-primary-slot { grid-column:1 / span 4; grid-row:1; min-width:0; height:clamp(300px,48vh,540px); }
.cctv-secondary-rail { grid-column:5; grid-row:1; display:flex; min-width:0; flex-direction:column; gap:10px; }
.cctv-bottom-strip { grid-column:1 / -1; display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; min-width:0; width:100%; }
#cctv-matrix-grid.has-no-secondary .cctv-primary-slot { grid-column:1 / -1; }
#cctv-matrix-grid.has-no-secondary .cctv-secondary-rail { display:none; }

.cctv-feed-card {
  position:relative;
  display:block;
  width:100%;
  min-width:0;
  height:100%;
  overflow:hidden;
  padding:0;
  border:1px solid #334155;
  border-radius:var(--radius-sm);
  background:linear-gradient(145deg,#15263b 0%,#2b405b 48%,#111c2c 100%);
  color:#fff;
  text-align:left;
  cursor:pointer;
  box-shadow:var(--shadow-md);
}
.cctv-feed-card:hover,.cctv-feed-card:focus-visible { border-color:var(--pu-blue); outline:2px solid color-mix(in srgb,var(--pu-blue) 45%,transparent); outline-offset:1px; }
.cctv-feed-main { min-height:300px; }
.cctv-feed-small { aspect-ratio:16 / 9; min-height:96px; }
.cctv-secondary-rail .cctv-feed-small { flex:1 1 0; height:auto; min-height:0; aspect-ratio:auto; }
.cctv-bottom-strip .cctv-feed-small { height:auto; }
.cctv-feed-header { position:absolute; z-index:1; top:10px; right:10px; left:12px; display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.cctv-feed-name { overflow:hidden; color:#fff; font-size:12px; font-weight:800; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; text-shadow:0 1px 3px rgba(0,0,0,.7); }
.cctv-feed-main .cctv-feed-name { font-size:17px; }
.cctv-feed-status { flex:none; padding:4px 7px; border-radius:6px; background:#059669; color:#fff; font-size:9px; font-weight:800; }
.cctv-feed-status.is-offline { background:#dc2626; }
.cctv-feed-location { position:absolute; z-index:1; top:34px; left:12px; max-width:75%; overflow:hidden; color:rgba(255,255,255,.78); font-size:10px; text-overflow:ellipsis; white-space:nowrap; text-shadow:0 1px 3px rgba(0,0,0,.7); }
.cctv-feed-main .cctv-feed-location { top:36px; font-size:12px; }
.cctv-feed-preview { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; background:radial-gradient(ellipse at 50% 58%,rgba(109,145,174,.48),transparent 58%),linear-gradient(180deg,rgba(9,19,33,.12),rgba(7,14,25,.4)); color:rgba(255,255,255,.72); }
.cctv-feed-preview svg { width:32px; height:32px; fill:none; stroke:currentColor; stroke-width:1.4; }
.cctv-feed-main .cctv-feed-preview svg { width:48px; height:48px; }
.cctv-feed-preview>span { font-size:9px; text-align:center; }
.cctv-feed-footer { position:absolute; right:0; bottom:0; left:0; display:flex; justify-content:space-between; gap:6px; padding:18px 10px 8px; background:linear-gradient(transparent,rgba(4,10,18,.8)); color:rgba(255,255,255,.8); font-size:8px; }
.cctv-feed-main .cctv-feed-footer { padding:28px 14px 12px; font-size:10px; }
.cctv-feed-empty { grid-column:1/-1; display:grid; min-height:240px; place-items:center; color:var(--text-muted); }

@media (max-width:900px) {
  .cctv-tab-content { grid-template-columns:minmax(0,1fr); }
  .cctv-station-scroll { max-height:320px; }
  .cctv-matrix-grid { grid-template-columns:minmax(0,1fr); }
  .cctv-primary-slot { grid-column:1 / -1; height:clamp(260px,42vh,420px); }
  .cctv-secondary-rail { grid-column:1 / -1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .cctv-secondary-rail .cctv-feed-small { flex:none; height:auto; min-height:90px; aspect-ratio:16 / 9; }
  .cctv-bottom-strip { grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); }
}

/* Skema Sungai Topological Diagram */
.skema-diagram-box {
  width: 100%;
  height: 480px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  padding: 10px;
}

.skema-topology-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skema-topology-toggle {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: pointer;
}

.skema-topology-toggle:hover {
  border-color: var(--pu-blue);
  color: var(--pu-blue);
}

.skema-topology-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}

.skema-topology-toggle[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

#skema-topology-body[hidden] {
  display: none;
}

.skema-tma-date-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 14px 0;
}

.skema-tma-date-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.skema-tma-date-btn > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.skema-tma-date-btn.active {
  border-color: color-mix(in srgb, var(--date-color) 35%, white);
  background: color-mix(in srgb, var(--date-color) 10%, white);
  color: var(--date-color);
}

.skema-tma-date-btn.active > span {
  background: var(--date-color);
}

.skema-tma-date-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.skema-tma-profile-chart {
  width: 100%;
  height: 310px;
  padding: 8px 10px 12px;
  overflow-x: auto;
}

.skema-tma-profile-empty {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 640px) {
  .skema-tma-date-controls { gap: 5px; padding: 10px 10px 0; }
  .skema-tma-date-btn { min-height: 30px; padding: 5px 8px; font-size: 10px; }
  .skema-tma-profile-chart { height: 280px; padding-right: 4px; padding-left: 4px; }
}

/* ==========================================================================
   VIEW 3: EWS (EARLY WARNING SYSTEM)
   ========================================================================== */
.ews-grid-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}
.ews-left-column { display:flex; min-height:0; height:100%; flex-direction:column; gap:14px; }
.ews-left-column > .dash-card:first-child { flex:0 0 auto; }

.ews-station-tables { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; min-width:0; }
.ews-tma-table-card,.ews-rain-table-card { min-width:0; }
.ews-tma-table-scroll { width:100%; min-width:0; overflow:hidden; }
.ews-tma-table-card .ews-tma-table-scroll { container:ews-tma / inline-size; }
.ews-tma-table,.ews-rain-table { width:100%; min-width:0; table-layout:fixed; border-collapse:collapse; text-align:left; }
.ews-rain-table-card .ews-tma-table-scroll { overflow-x:hidden; container:ews-rain / inline-size; }
.ews-rain-table { min-width:0; }
.ews-tma-table th:nth-child(1),.ews-tma-table td:nth-child(1) { width:4%; }
.ews-tma-table th:nth-child(2),.ews-tma-table td:nth-child(2) { width:20%; }
.ews-tma-table th:nth-child(3),.ews-tma-table td:nth-child(3) { width:10%; }
.ews-tma-table th:nth-child(4),.ews-tma-table td:nth-child(4) { width:10%; }
.ews-tma-table th:nth-child(5),.ews-tma-table td:nth-child(5) { width:9%; }
.ews-tma-table th:nth-child(6),.ews-tma-table td:nth-child(6) { width:12%; }
.ews-tma-table th:nth-child(7),.ews-tma-table td:nth-child(7) { width:9%; }
.ews-tma-table th:nth-child(8),.ews-tma-table td:nth-child(8) { width:9%; }
.ews-tma-table th:nth-child(9),.ews-tma-table td:nth-child(9) { width:9%; }
.ews-tma-table th:nth-child(10),.ews-tma-table td:nth-child(10) { width:8%; }
.ews-rain-table th:nth-child(1),.ews-rain-table td:nth-child(1) { width:4%; }
.ews-rain-table th:nth-child(2),.ews-rain-table td:nth-child(2) { width:22%; }
.ews-rain-table th:nth-child(3),.ews-rain-table td:nth-child(3) { width:9%; }
.ews-rain-table th:nth-child(4),.ews-rain-table td:nth-child(4) { width:12%; }
.ews-rain-table th:nth-child(5),.ews-rain-table td:nth-child(5) { width:16%; }
.ews-rain-table th:nth-child(6),.ews-rain-table td:nth-child(6) { width:9%; }
.ews-rain-table th:nth-child(7),.ews-rain-table td:nth-child(7) { width:9%; }
.ews-rain-table th:nth-child(8),.ews-rain-table td:nth-child(8) { width:9%; }
.ews-rain-table th:nth-child(9),.ews-rain-table td:nth-child(9) { width:10%; }
.ews-rain-table th { padding:8px 2px; border-bottom:1px solid var(--border); color:var(--text-muted); font-size:11px; line-height:1.2; font-weight:700; letter-spacing:.01em; text-align:center; text-transform:uppercase; overflow-wrap:anywhere; }
.ews-rain-table th:nth-child(2) { text-align:left; }
.ews-rain-table td { padding:8px 2px; border-bottom:1px solid var(--border-subtle); color:var(--text-main); font-size:12px; text-align:center; vertical-align:middle; overflow-wrap:anywhere; }
.ews-rain-table tbody tr:last-child td { border-bottom:0; }
.ews-rain-table td:nth-child(2) { text-align:left; }
.ews-rain-table td:nth-child(3),.ews-rain-table td:nth-child(4) { font-weight:700; }
.ews-rain-table .ews-tma-station-name { font-size:13px; }
.ews-rain-table .ews-tma-subdas { font-size:11px; }
.ews-rain-value { font-family:var(--font-mono); white-space:nowrap; }
.ews-rain-period { display:block; margin-top:2px; color:var(--text-muted); font-family:var(--font-sans); font-size:10px; line-height:1.15; white-space:normal; }
.ews-rain-intensity { display:inline-block; max-width:100%; border-radius:999px; padding:4px 6px; font-size:11px; line-height:1.2; white-space:normal; }
.ews-rain-intensity-none { background:#f1f5f9; color:#64748b; }
.ews-rain-intensity-light { background:#e0f2fe; color:#0284c7; }
.ews-rain-intensity-moderate { background:#fef3c7; color:#b45309; }
.ews-rain-intensity-heavy { background:#ffedd5; color:#c2410c; }
.ews-rain-intensity-extreme { background:#fee2e2; color:#b91c1c; }
.ews-rain-intensity-unknown { background:#f1f5f9; color:#64748b; }
.ews-rain-probability { display:inline-flex; align-items:center; gap:4px; font-family:var(--font-mono); font-size:12px; font-weight:700; white-space:nowrap; }
.ews-rain-probability::before { content:"●"; font-size:9px; }
.ews-rain-probability-low { color:#10b981; }
.ews-rain-probability-medium { color:#eab308; }
.ews-rain-probability-high { color:#ef4444; }
.ews-rain-probability-sup { display:inline-block; margin-left:3px; padding:0 4px; border-radius:999px; background:rgba(100,116,139,.12); font-family:var(--font-mono); font-size:9px; font-weight:800; line-height:1.6; vertical-align:super; white-space:nowrap; }
.ews-rain-table-card { position:relative; overflow:hidden; }
.ews-tma-table-card { position:relative; overflow:hidden; }
.ews-rain-table tbody tr.ews-rain-row,.ews-tma-table tbody tr.ews-tma-row { cursor:pointer; transition:background-color .15s ease; }
.ews-rain-table tbody tr.ews-rain-row:hover,.ews-rain-table tbody tr.ews-rain-row:focus,.ews-tma-table tbody tr.ews-tma-row:hover,.ews-tma-table tbody tr.ews-tma-row:focus { outline:none; background:color-mix(in srgb,var(--pu-blue) 9%,var(--surface)); }
@container ews-rain (max-width:680px) {
  .ews-rain-table,.ews-rain-table tbody { display:block; width:100%; }
  .ews-rain-table thead { display:none; }
  .ews-rain-table tbody tr.ews-rain-row { position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:8px; padding:9px; border:1px solid var(--border); border-radius:9px; }
  .ews-rain-table tbody tr.ews-rain-row td { display:block; width:auto; min-width:0; padding:5px 6px; border:1px solid var(--border-subtle); border-radius:5px; background:var(--surface-alt); text-align:left; }
  .ews-rain-table tbody tr.ews-rain-row td::before { display:block; margin-bottom:2px; color:var(--text-muted); font-family:var(--font-sans); font-size:10px; line-height:1.15; content:attr(data-label); }
  .ews-rain-table tbody tr.ews-rain-row td:nth-child(1) { position:absolute; top:9px; right:9px; padding:0; border:0; background:none; }
  .ews-rain-table tbody tr.ews-rain-row td:nth-child(1)::before,.ews-rain-table tbody tr.ews-rain-row td:nth-child(2)::before { display:none; }
  .ews-rain-table tbody tr.ews-rain-row td:nth-child(2) { grid-column:1 / -1; padding:0 26px 4px 0; border:0; background:none; }
  .ews-rain-table tbody tr.ews-rain-row td:nth-child(9) { grid-column:1 / -1; padding:3px 1px 0; border:0; background:none; }
  .ews-rain-table tbody tr.ews-rain-row td:nth-child(9)::before { display:inline; margin-right:5px; }
}
@container ews-rain (max-width:360px) {
  .ews-rain-table tbody tr.ews-rain-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.ews-rain-detail-panel { position:absolute; z-index:8; inset:0; display:flex; flex-direction:column; overflow:auto; background:var(--surface); transform:translateX(101%); visibility:hidden; transition:transform .32s cubic-bezier(.2,.8,.2,1),visibility .32s; }
.ews-rain-detail-panel.is-open { transform:translateX(0); visibility:visible; }
.ews-rain-detail-header { position:sticky; top:0; z-index:1; display:flex; flex:none; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px; border-bottom:1px solid var(--border-subtle); background:var(--surface); box-shadow:0 2px 8px rgba(15,23,42,.04); }
.ews-rain-detail-header h3 { margin:3px 0 0; color:var(--text-main); font-size:16px; }
.ews-rain-detail-header p { margin:3px 0 0; color:var(--text-muted); font-size:11px; }
.ews-rain-detail-kicker { color:var(--pu-blue); font-size:9px; font-weight:800; letter-spacing:.08em; }
.ews-rain-detail-header>button { display:grid; width:32px; height:32px; flex:none; place-items:center; border:1px solid var(--border); border-radius:7px; background:var(--surface); color:var(--text-main); font-size:22px; line-height:1; cursor:pointer; }
.ews-rain-detail-header>button:hover { background:var(--surface-hover); color:var(--pu-blue); }
.ews-rain-detail-content { display:flex; flex:1; flex-direction:column; gap:14px; padding:16px 18px; }
.ews-rain-detail-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; }
.ews-rain-detail-metric { min-width:0; padding:11px 12px; border:1px solid var(--border); border-radius:9px; background:var(--surface-alt); }
.ews-rain-detail-metric span { display:block; color:var(--text-muted); font-size:9px; font-weight:700; text-transform:uppercase; }
.ews-rain-detail-metric strong { display:block; margin-top:5px; color:var(--text-main); font-family:var(--font-mono); font-size:17px; }
.ews-rain-detail-metric strong.ews-rain-probability { display:inline-flex; margin-top:5px; }
.ews-rain-detail-metric em { display:block; margin-top:4px; color:var(--text-muted); font-size:9px; font-style:normal; line-height:1.3; }
.ews-rain-detail-metric small { margin-left:3px; color:var(--text-muted); font-family:var(--font-sans); font-size:10px; }
#ews-rain-detail-summary { grid-template-columns:repeat(6,minmax(104px,1fr)); gap:6px; overflow-x:auto; padding-bottom:2px; }
#ews-rain-detail-summary .ews-rain-detail-metric { padding:8px 7px; border-radius:7px; }
#ews-rain-detail-summary .ews-rain-detail-metric--observed { background:color-mix(in srgb,#0891b2 12%,var(--surface)); border-color:color-mix(in srgb,#0891b2 38%,var(--border)); }
#ews-rain-detail-summary .ews-rain-detail-metric--observed span { color:color-mix(in srgb,#0891b2 75%,var(--text-main)); }
#ews-rain-detail-summary .ews-rain-detail-metric--forecast { background:color-mix(in srgb,#7c3aed 7%,var(--surface)); border-color:color-mix(in srgb,#7c3aed 22%,var(--border)); }
#ews-rain-detail-summary .ews-rain-detail-metric--forecast span { color:color-mix(in srgb,#7c3aed 70%,var(--text-main)); }
#ews-rain-detail-summary .ews-rain-detail-metric span { font-size:8px; line-height:1.25; overflow-wrap:anywhere; }
#ews-rain-detail-summary .ews-rain-detail-metric strong { margin-top:4px; font-size:14px; }
#ews-rain-detail-summary .ews-rain-detail-metric em { font-size:8px; }
#ews-rain-detail-summary .ews-rain-observed-intensity { font-size:9px; font-weight:700; }
#ews-rain-detail-summary .ews-rain-observed-intensity-none,
#ews-rain-detail-summary .ews-rain-observed-intensity-unknown { color:var(--text-muted); }
#ews-rain-detail-summary .ews-rain-observed-intensity-light { color:#0284c7; }
#ews-rain-detail-summary .ews-rain-observed-intensity-moderate { color:#b45309; }
#ews-rain-detail-summary .ews-rain-observed-intensity-heavy { color:#c2410c; }
#ews-rain-detail-summary .ews-rain-observed-intensity-extreme { color:#b91c1c; }
#ews-rain-detail-summary .ews-rain-detail-metric small { font-size:9px; }
#ews-rain-detail-summary .ews-rain-probability-sup { font-size:8px; }
.ews-rain-chart-card { display:flex; min-height:240px; flex:1; flex-direction:column; gap:8px; padding:14px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
.ews-rain-chart-card h4 { margin:0; color:var(--text-main); font-size:13px; }
.ews-rain-chart-card>div:first-child span { color:var(--text-muted); font-size:10px; }
.ews-rain-detail-chart { position:relative; min-height:180px; flex:1; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
.ews-rain-detail-chart::-webkit-scrollbar { display:none; }
.ews-rain-detail-chart svg { display:block; width:100%; height:340px; min-height:180px; overflow:hidden; }
.ews-chart-hit-rect { fill:transparent; cursor:crosshair; }
.ews-chart-crosshair { stroke:var(--text-muted); stroke-width:1; stroke-dasharray:3 3; pointer-events:none; }
.ews-chart-tooltip { display:none; position:absolute; top:8px; z-index:5; min-width:160px; max-width:230px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--surface); box-shadow:0 4px 14px rgba(15,23,42,.16); font-size:11px; pointer-events:none; }
.ews-chart-tooltip-time { margin-bottom:5px; color:var(--text-muted); font-size:10px; font-weight:700; }
.ews-chart-tooltip-row { display:flex; align-items:center; gap:6px; padding:1.5px 0; }
.ews-chart-tooltip-key { width:12px; height:2px; flex:none; border-radius:1px; }
.ews-chart-tooltip-name { flex:1; min-width:0; overflow:hidden; color:var(--text-muted); text-overflow:ellipsis; white-space:nowrap; }
.ews-chart-tooltip-value { flex:none; color:var(--text-main); font-family:var(--font-mono); font-weight:700; }
.ews-rain-chart-grid { stroke:var(--border); stroke-dasharray:3 4; }
.ews-rain-chart-axis-label { fill:var(--text-muted); font:10px var(--font-sans); }
.ews-rain-chart-axis-title { fill:var(--text-muted); font:600 11px var(--font-sans); }
.ews-rain-chart-legend { fill:var(--text-main); font:11px var(--font-sans); }
.ews-rain-chart-bar { fill:#2f70b5; }
.ews-rain-chart-forecast-bar { fill:#0ea5e9; opacity:.78; }
.ews-rain-accumulated-line { fill:none; stroke:#07851b; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.ews-rain-forecast-accumulated-line { fill:none; stroke:#07851b; stroke-width:3; stroke-dasharray:7 5; stroke-linecap:round; stroke-linejoin:round; }
.ews-rain-ensemble-whisker { stroke:#64748b; stroke-width:1.5; opacity:.75; }
.ews-rain-ensemble-whisker line { stroke:#64748b; stroke-width:1.5; opacity:.75; }
.ews-rain-ensemble-cap { fill:#64748b; opacity:.75; }
.ews-rain-navigator { display:flex; flex-direction:column; gap:3px; margin:0 48px 2px 48px; padding-top:2px; }
.ews-rain-navigator-axis { display:flex; justify-content:center; align-items:center; position:relative; min-height:16px; color:var(--text-muted); font-size:10px; }
.ews-rain-navigator-axis span:last-child { position:absolute; right:0; font-size:9px; }
.ews-rain-navigator-track { position:relative; height:42px; overflow:hidden; border:1px solid var(--border); background:var(--surface-alt); cursor:crosshair; touch-action:none; }
.ews-rain-navigator-track svg { position:absolute; inset:0; width:100%; height:100%; }
.ews-rain-navigator-baseline { stroke:var(--border); stroke-width:1; }
.ews-rain-navigator-line { fill:none; stroke:#79aefa; stroke-width:2; vector-effect:non-scaling-stroke; }
.ews-rain-navigator-selection { position:absolute; top:0; bottom:0; left:0; right:0; border:1px solid rgba(59,130,246,.65); background:rgba(99,128,246,.18); cursor:grab; }
.ews-rain-navigator-selection:active { cursor:grabbing; }
.ews-rain-navigator-selection button { position:absolute; top:50%; width:10px; height:28px; padding:0; border:1px solid #94a3b8; border-radius:2px; background:var(--surface); color:#94a3b8; transform:translateY(-50%); cursor:ew-resize; }
.ews-rain-navigator-selection button:first-child { left:-1px; }
.ews-rain-navigator-selection button:last-child { right:-1px; }
.ews-rain-navigator-selection button::after { content:"Ⅱ"; display:block; font-size:9px; line-height:26px; text-align:center; }
.ews-rain-navigator-labels { display:flex; justify-content:space-between; gap:4px; color:var(--text-muted); font-size:9px; }
.ews-rain-navigator-labels span { overflow:hidden; max-width:20%; white-space:nowrap; text-overflow:ellipsis; }
.beranda-chart-navigator { margin-bottom:10px; }
.ews-rain-chart-baseline { stroke:var(--border); stroke-width:1; }
.ews-rain-history-line { fill:none; stroke:#0284c7; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.ews-rain-history-point { fill:var(--surface); stroke:#0284c7; stroke-width:2.5; }
.ews-tma-history-line { stroke:#b91c1c; }
.ews-tma-history-point { stroke:#b91c1c; }
.ews-tma-detail-forecast-line { fill:none; stroke:#7c3aed; stroke-width:2.8; stroke-dasharray:6 4; stroke-linecap:round; stroke-linejoin:round; }
.ews-tma-navigator-line { fill:none; stroke:#b91c1c; stroke-width:2; stroke-dasharray:4 2; vector-effect:non-scaling-stroke; }
.ews-tma-detail-legend { gap:8px; padding:4px 0 6px; border-top:0; font-size:9.5px; }
.ews-tma-combined-chart-card { min-height:520px; padding:10px 12px 12px; border-radius:14px; box-shadow:0 8px 24px rgba(15,23,42,.06); }
.ews-tma-combined-chart-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:2px 4px 0; }
.ews-tma-combined-chart-heading h4 { font-size:15px; }
.ews-tma-combined-chart-card .ews-rain-detail-chart { min-height:470px; }
.ews-tma-combined-chart-card .ews-rain-detail-chart svg { height:590px; min-width:760px; }
.ews-tma-combined-chart-card .ews-rain-chart-bar { fill:#38bdf8; }
.ews-tma-combined-chart-card .ews-tma-rain-hatched { fill:url(#ews-tma-rain-hatch); stroke:#38bdf8; stroke-width:1; opacity:1; }
.ews-tma-section-title rect { fill:var(--surface); stroke:var(--border); stroke-width:1; filter:drop-shadow(0 2px 4px rgba(15,23,42,.08)); }
.ews-tma-section-title text { fill:var(--text-main); font:700 16px var(--font-sans); }
.ews-tma-chart-divider { stroke:var(--border-subtle); stroke-width:1; }
.ews-tma-actual-line { fill:none; stroke:#0874dc; stroke-width:3.5; stroke-linecap:round; stroke-linejoin:round; }
.ews-tma-actual-point { fill:#0874dc; stroke:var(--surface); stroke-width:1.5; }
.ews-tma-forecast-point { fill:var(--surface); stroke:#7c3aed; stroke-width:2.5; }
.ews-tma-now-line { stroke:#1595e7; stroke-width:1.8; stroke-dasharray:7 6; }
.ews-tma-now-point { fill:#0874dc; stroke:var(--surface); stroke-width:3; }
.ews-tma-threshold-label { fill:#fff; font:700 11px var(--font-sans); }
.ews-tma-current-callout rect { fill:var(--surface); stroke:#0874dc; stroke-width:1.5; }
.ews-tma-current-callout text { fill:var(--text-main); font:700 11px var(--font-sans); text-anchor:middle; }
.ews-tma-current-callout text.value { fill:#0f2856; font:800 17px var(--font-sans); }
.ews-tma-peak-callout rect,.ews-tma-peak-callout path { fill:var(--surface); stroke:#ef4444; stroke-width:1.5; }
.ews-tma-peak-callout text { fill:var(--text-main); font:700 10px var(--font-sans); text-anchor:middle; }
.ews-tma-peak-callout text.value { fill:#0f2856; font:800 18px var(--font-sans); }
.ews-tma-peak-point { fill:var(--surface); stroke:#7c3aed; stroke-width:4; }
.ews-tma-now-label rect { fill:#0759a9; }
.ews-tma-now-label text { fill:#fff; font:700 10px var(--font-sans); text-anchor:middle; }
.ews-tma-time-label { fill:var(--text-main); font:10px var(--font-sans); }
.legend-now-sample { display:inline-block; width:15px; height:14px; border-left:2px dashed #1595e7; }
#ews-tma-chart-navigator { display:none; }
@media (max-width:720px) {
  .ews-tma-combined-chart-heading { align-items:flex-start; flex-direction:column; gap:2px; }
  .ews-tma-combined-chart-card .ews-rain-detail-chart { overflow-x:auto; }
}
.ews-rain-chart-empty { display:grid; min-height:180px; place-items:center; color:var(--text-muted); font-size:12px; }
@media (max-width: 640px) {
  .ews-rain-navigator { margin-right:8px; margin-left:8px; }
  .ews-rain-navigator-axis span:last-child { display:none; }
  .ews-rain-navigator-track { height:36px; }
}
.pch-trend-chart-canvas { width:100%; height:286px; }
.pch-trend-main { position:relative; width:100%; height:210px; }
.pch-trend-main .ews-chart-tooltip { top:52px; }
.pch-trend-hover-dot { fill:#07851b; stroke:var(--surface); stroke-width:2; pointer-events:none; }
.pch-trend-navigator { position:relative; width:100%; height:76px; padding-top:1px; }
.pch-trend-navigator-axis-labels { position:relative; height:29px; overflow:hidden; color:var(--text-muted); font-family:var(--font-mono); font-size:10px; }
.pch-trend-navigator-axis-labels span { position:absolute; bottom:0; max-width:13%; overflow:hidden; transform:translateX(-50%) rotate(-24deg); transform-origin:bottom left; white-space:nowrap; }
.pch-trend-navigator-caption { position:relative; height:15px; color:var(--text-muted); font-size:9px; line-height:15px; text-align:center; }
.pch-trend-navigator-caption span { position:absolute; right:0; overflow:hidden; max-width:55%; white-space:nowrap; text-overflow:ellipsis; }
.pch-trend-navigator-track { position:relative; height:30px; overflow:hidden; border:1px solid var(--border); background:var(--surface-alt); cursor:crosshair; touch-action:none; }
.pch-trend-navigator-track svg { position:absolute; inset:0; width:100%; height:100%; }
.pch-trend-navigator-baseline { stroke:var(--border-strong); stroke-width:1; }
.pch-trend-navigator-line { fill:none; stroke:#79aefa; stroke-width:2; vector-effect:non-scaling-stroke; }
.pch-trend-navigator-selection { position:absolute; top:0; bottom:0; left:0; right:0; border:1px solid rgba(59,130,246,.65); background:rgba(99,128,246,.18); cursor:grab; }
.pch-trend-navigator-selection:active { cursor:grabbing; }
.pch-trend-navigator-selection button { position:absolute; top:50%; width:9px; height:24px; padding:0; border:1px solid #94a3b8; border-radius:2px; background:var(--surface); transform:translateY(-50%); cursor:ew-resize; }
.pch-trend-navigator-selection button:first-child { left:-1px; }
.pch-trend-navigator-selection button:last-child { right:-1px; }
.pch-trend-navigator-selection button::after { content:"Ⅱ"; display:block; color:#94a3b8; font-size:8px; line-height:22px; text-align:center; }
.ews-rain-detail-updated { margin:0; color:var(--text-muted); font-size:10px; }
.ews-tma-table th { padding:9px 2px; border-bottom:1px solid var(--border); color:var(--text-muted); font-size:11px; line-height:1.2; font-weight:700; letter-spacing:.01em; text-transform:uppercase; white-space:normal; overflow-wrap:anywhere; }
.ews-forecast-time { display:block; margin-top:3px; color:var(--text-muted); font-size:9px; font-style:italic; font-weight:400; letter-spacing:0; text-transform:none; white-space:nowrap; }
.ews-tma-table td { padding:10px 2px; border-bottom:1px solid var(--border-subtle); color:var(--text-main); font-size:12px; vertical-align:middle; overflow-wrap:anywhere; }
.ews-tma-table th:first-child,.ews-tma-table td:first-child { padding-left:10px; }
.ews-tma-table tbody tr:last-child td { border-bottom:0; }
.ews-tma-index { width:24px; color:var(--text-muted)!important; font-family:var(--font-mono); }
.ews-tma-station-name,.ews-tma-subdas { display:block; }
.ews-tma-station-name { font-size:13px; line-height:1.25; font-weight:700; }
.ews-tma-subdas { margin-top:2px; color:var(--text-muted); font-size:11px; line-height:1.2; }
.ews-tma-number,.ews-tma-peak,.ews-tma-updated { font-family:var(--font-mono); white-space:normal; overflow-wrap:normal; }
.ews-tma-trend-up,.ews-tma-trend-down,.ews-tma-trend-flat { font-family:var(--font-mono); font-weight:700; white-space:normal; }
.ews-tma-trend-up { color:#d97706!important; }
.ews-tma-trend-down { color:#059669!important; }
.ews-tma-trend-flat { color:var(--text-muted)!important; }
.ews-tma-peak,.ews-tma-updated { color:var(--text-muted)!important; }
.ews-tma-table td.ews-tma-updated,.ews-rain-table td.ews-tma-updated { font-size:11px; font-style:italic; }
.ews-tma-table .badge { max-width:100%; padding:3px 4px; font-size:10px; text-align:center; white-space:normal; overflow-wrap:anywhere; }
.ews-tma-status-unknown { background:#e2e8f0; color:#475569; }
.ews-tma-empty { padding:28px!important; color:var(--text-muted)!important; text-align:center; }
@container ews-tma (max-width:680px) {
  .ews-tma-table,.ews-tma-table tbody { display:block; width:100%; }
  .ews-tma-table thead { display:none; }
  .ews-tma-table tbody tr.ews-tma-row { position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:8px; padding:9px; border:1px solid var(--border); border-radius:9px; }
  .ews-tma-table tbody tr.ews-tma-row td { display:block; width:auto; min-width:0; padding:5px 6px; border:1px solid var(--border-subtle); border-radius:5px; background:var(--surface-alt); text-align:left; }
  .ews-tma-table tbody tr.ews-tma-row td::before { display:block; margin-bottom:2px; color:var(--text-muted); font-family:var(--font-sans); font-size:10px; line-height:1.15; content:attr(data-label); }
  .ews-tma-table tbody tr.ews-tma-row td:nth-child(1) { position:absolute; top:9px; right:9px; padding:0; border:0; background:none; }
  .ews-tma-table tbody tr.ews-tma-row td:nth-child(1)::before,.ews-tma-table tbody tr.ews-tma-row td:nth-child(2)::before { display:none; }
  .ews-tma-table tbody tr.ews-tma-row td:nth-child(2) { grid-column:1 / -1; padding:0 26px 4px 0; border:0; background:none; }
  .ews-tma-table tbody tr.ews-tma-row td:nth-child(10) { grid-column:span 2; padding:3px 1px 0; border:0; background:none; }
  .ews-tma-table tbody tr.ews-tma-row td:nth-child(10)::before { display:inline; margin-right:5px; }
}
@container ews-tma (max-width:360px) {
  .ews-tma-table tbody tr.ews-tma-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ews-tma-table tbody tr.ews-tma-row td:nth-child(10) { grid-column:auto; }
}
.ews-tma-table-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; border-top:1px solid var(--border-subtle); color:var(--text-muted); font-size:10px; }
.ews-rain-table-footer-info { display:flex; flex-direction:column; gap:3px; min-width:0; line-height:1.4; }
.ews-tma-pagination { display:flex; align-items:center; gap:8px; color:var(--text-main); }
.ews-tma-pagination button { display:grid; place-items:center; width:30px; height:30px; border:0; border-radius:8px; background:var(--surface-hover); color:var(--text-main); font-size:19px; line-height:1; cursor:pointer; }
.ews-tma-pagination button:disabled { opacity:.45; cursor:default; }

.ews-spatial-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: stretch;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px;
}
.ews-prediction-card { min-width:0; }
.ews-prediction-card-header { flex-wrap:wrap; gap:8px; }
.ews-model-filters { display:flex; flex-wrap:wrap; gap:4px; }
.ews-spatial-map-column { display:flex; min-width:0; height:100%; flex-direction:column; gap:12px; }
.ews-spatial-map-card { min-width:0; flex:1 1 auto; overflow:hidden; border-radius:var(--radius-sm); }
.ews-spatial-map-card .hazard-map-box { height:100%; min-height:290px; }
.ews-warning-detail {
  --warning-dark:#0c3b6d;
  --warning-main:#1663a5;
  box-sizing:border-box;
  min-width:0;
  height:100%;
  overflow:visible;
  border:1px solid var(--warning-main);
  border-radius:11px;
  background:var(--surface);
  box-shadow:0 5px 16px rgba(15,23,42,.08);
}
.ews-warning-detail.status-awas { --warning-dark:#a30814; --warning-main:#b91c1c; }
.ews-warning-detail.status-siaga { --warning-dark:#9a3412; --warning-main:#c2410c; }
.ews-warning-detail.status-waspada { --warning-dark:#92400e; --warning-main:#b45309; }
.ews-warning-detail.status-normal { --warning-dark:#065f46; --warning-main:#047857; }
.ews-warning-detail.is-hidden { --warning-dark:#334155; --warning-main:#64748b; }
.ews-warning-detail.is-hidden .ews-warning-detail-body > :not(.ews-warning-technical-note) { visibility:hidden; }
.ews-warning-technical-note { display:none; }
.ews-warning-detail.is-hidden .ews-warning-technical-note { position:absolute; inset:8px; display:flex; align-items:center; gap:12px; overflow:auto; padding:18px; color:#334155; }
.ews-warning-technical-icon { display:grid; width:32px; height:32px; flex:none; place-items:center; border-radius:50%; background:#e2e8f0; color:#334155; font-weight:800; }
.ews-warning-technical-note h4 { margin:0 0 5px; font-size:15px; line-height:1.25; }
.ews-warning-technical-note p { margin:0 0 7px; font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
.ews-warning-technical-note small { color:#64748b; font-size:10px; line-height:1.4; }
[data-theme="dark"] .ews-warning-detail.is-hidden .ews-warning-technical-note { color:#e2e8f0; }
[data-theme="dark"] .ews-warning-technical-icon { background:#334155; color:#e2e8f0; }
.ews-warning-detail-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  min-height:38px;
  padding:6px 10px;
  border-radius:10px 10px 0 0;
  background:linear-gradient(115deg,var(--warning-dark),var(--warning-main));
  color:#fff;
}
.ews-warning-detail-header .card-title { display:flex; align-items:center; gap:6px; color:#fff; font-size:13px; letter-spacing:.01em; }
.ews-warning-detail-header svg { width:17px; height:17px; flex:none; }
.ews-warning-detail .ews-warning-category { flex:none; padding:4px 6px; border:1px solid rgba(255,255,255,.4); border-radius:6px; background:rgba(255,255,255,.16); color:#fff; font-size:9px; font-weight:800; letter-spacing:.04em; text-align:center; text-transform:uppercase; }
.ews-warning-detail-body { position:relative; display:grid; gap:7px; padding:8px; }
.ews-warning-summary {
  display:grid;
  grid-template-columns:30px auto minmax(0,1fr);
  align-items:center;
  gap:7px;
  min-width:0;
  padding:9px;
  border:1px solid rgba(255,255,255,.32);
  border-radius:11px;
  background:linear-gradient(115deg,var(--warning-dark),var(--warning-main));
  color:#fff;
  box-shadow:0 3px 8px rgba(15,23,42,.11);
}
.ews-warning-summary-symbol { display:grid; width:29px; height:29px; place-items:center; border:2px solid currentColor; border-radius:50%; font-size:20px; font-weight:800; line-height:1; }
.ews-warning-level { padding-right:9px; border-right:1px solid rgba(255,255,255,.5); font-size:clamp(20px,1.7vw,27px); font-weight:800; line-height:1; letter-spacing:.03em; }
.ews-warning-summary-copy { min-width:0; }
.ews-warning-location { overflow-wrap:anywhere; font-size:clamp(11px,1vw,14px); font-weight:800; line-height:1.2; }
.ews-warning-summary-copy p { display:inline-block; max-width:100%; margin:3px 0 0; padding:3px 5px; border-radius:5px; background:rgba(255,255,255,.92); color:var(--warning-dark); font-size:10px; font-weight:700; line-height:1.25; }
.ews-warning-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.ews-warning-metric { display:flex; min-width:0; flex-direction:column; align-items:flex-start; padding:9px; border:1px solid #c4dcfa; border-radius:9px; background:linear-gradient(135deg,#f9fcff,#e8f1ff); }
.ews-warning-metric-label { display:flex; align-items:center; gap:5px; padding:2px 7px 2px 2px; border-radius:20px; background:#0c3b6d; color:#fff; font-size:10px; font-weight:800; line-height:1.2; text-transform:uppercase; }
.ews-warning-metric-label svg { width:18px; height:18px; padding:2px; border-radius:50%; background:#e8f1ff; color:#0c3b6d; }
.ews-warning-metric strong { display:block; margin:5px 0 4px; color:#0f3056; font-family:var(--font-mono); font-size:clamp(16px,1.5vw,22px); line-height:1.15; overflow-wrap:anywhere; }
.ews-warning-metric-tma>strong { color:#bd1421; }
.ews-warning-metric p { margin:auto 0 0; padding-top:5px; border-top:1px solid #c4d8ee; color:#254766; font-size:10px; line-height:1.25; }
.ews-warning-metric small { display:block; width:100%; margin-top:5px; padding:4px 6px; border-radius:6px; background:rgba(58,125,201,.12); color:#123b67; font-size:10px; font-weight:700; line-height:1.25; }
.ews-warning-info { min-width:0; overflow:hidden; border:1px solid #f8d8a3; border-radius:9px; background:linear-gradient(120deg,#fff6e5,#fffbf4); }
.ews-warning-info-content { display:flex; align-items:center; gap:8px; min-width:0; padding:7px 9px 8px; }
.ews-warning-info-icon { display:grid; width:30px; height:30px; flex:none; place-items:center; border-radius:8px; background:#fff0d3; color:#bf6908; }
.ews-warning-info-icon svg { width:20px; height:20px; }
.ews-warning-info-copy { min-width:0; flex:1; }
.ews-warning-info-label { display:inline-block; max-width:100%; padding:4px 10px; border-radius:0 0 9px 0; background:#a95b05; color:#fff; font-size:10px; font-weight:800; line-height:1.2; text-transform:uppercase; }
.ews-warning-info-copy>strong { display:block; margin:0; color:#1e293b; font-size:14px; font-weight:800; line-height:1.2; }
.ews-warning-info p { margin:2px 0 0; color:#5a4a33; font-size:10px; line-height:1.25; }
.ews-warning-duration { border-color:#dbc9fa; background:linear-gradient(120deg,#f7f0ff,#eee8ff); }
.ews-warning-duration .ews-warning-info-icon { background:#e9dafa; color:#5727a0; }
.ews-warning-duration .ews-warning-info-label { background:#5727a0; }
.ews-warning-duration .ews-warning-info-copy>strong { color:#3f1e80; }
.ews-warning-duration p { color:#604b89; }
.ews-warning-duration-note { flex:none; padding:4px 6px; border:1px solid #d4bff4; border-radius:7px; color:#604b89; font-size:9px; line-height:1.2; text-align:center; }
.ews-warning-duration-note strong { color:#3f1e80; font-size:9.5px; }
.ews-warning-recommendation { overflow:hidden; border:1px solid #b5e2c3; border-radius:9px; background:linear-gradient(120deg,#ecfff0,#f6fff8); }
.ews-warning-recommendation-title { display:inline-block; max-width:100%; padding:4px 10px; border-radius:0 0 9px 0; background:#087344; color:#fff; font-size:10px; font-weight:800; line-height:1.2; text-transform:uppercase; }
.ews-warning-recommendation-content { display:flex; align-items:center; gap:8px; padding:7px 9px 8px; }
.ews-warning-recommendation-content>span { display:grid; width:30px; height:30px; flex:none; place-items:center; border-radius:50%; background:#d1fae5; color:#087344; font-size:18px; font-weight:800; }
.ews-warning-recommendation-content strong { color:#064e3b; font-size:12px; line-height:1.2; }
.ews-warning-recommendation-content p { margin:2px 0 0; color:#335b4c; font-size:10px; line-height:1.25; }
[data-theme="dark"] .ews-warning-metric { border-color:#285178; background:linear-gradient(135deg,#172d47,#1a3656); }
[data-theme="dark"] .ews-warning-metric strong { color:#e5f2ff; }
[data-theme="dark"] .ews-warning-metric-tma>strong { color:#fda4af; }
[data-theme="dark"] .ews-warning-metric p { border-color:#395b7b; color:#b6d2ed; }
[data-theme="dark"] .ews-warning-metric small { color:#c8e3fa; }
[data-theme="dark"] .ews-warning-inundation { border-color:#775422; background:linear-gradient(120deg,#3b2a1a,#332b23); }
[data-theme="dark"] .ews-warning-inundation .ews-warning-info-copy>strong { color:#fff3dc; }
[data-theme="dark"] .ews-warning-inundation p { color:#e3c99f; }
[data-theme="dark"] .ews-warning-duration { border-color:#5b4484; background:linear-gradient(120deg,#302544,#2d2541); }
[data-theme="dark"] .ews-warning-duration p { color:#d8c7f7; }
[data-theme="dark"] .ews-warning-duration .ews-warning-info-copy>strong,
[data-theme="dark"] .ews-warning-duration-note strong { color:#e6d9fc; }
[data-theme="dark"] .ews-warning-duration-note { color:#d8c7f7; }
[data-theme="dark"] .ews-warning-recommendation { border-color:#255a43; background:linear-gradient(120deg,#143629,#173a2e); }
[data-theme="dark"] .ews-warning-recommendation-content strong { color:#d8fce8; }
[data-theme="dark"] .ews-warning-recommendation-content p { color:#b3dfc9; }

.radar-map-box {
  height: 290px;
  width: 100%;
  position: relative;
  background-color: #0f172a;
}

.ews-nowcast-controls { display:flex; gap:8px; padding:9px 11px 6px; border-top:1px solid var(--border-subtle); }
.ews-nowcast-controls label { display:flex; flex:1; min-width:0; flex-direction:column; gap:3px; color:var(--text-muted); font-size:9px; font-weight:700; }
.ews-nowcast-controls label[hidden] { display:none; }
.ews-nowcast-controls select { width:100%; min-width:0; padding:5px 6px; border:1px solid var(--border-subtle); border-radius:5px; background:var(--bg-card,#fff); color:var(--text-main); font-size:11px; }
.ews-nowcast-playback { display:flex; align-items:center; gap:8px; padding:2px 11px 6px; color:var(--text-muted); font-size:9px; }
.ews-nowcast-playback[hidden] { display:none; }
.ews-nowcast-playback button { min-width:72px; padding:4px 8px; border:1px solid #0284c7; border-radius:5px; background:#e0f2fe; color:#075985; font-family:inherit; font-size:10px; font-weight:700; cursor:pointer; }
.ews-nowcast-playback button[aria-pressed="true"] { background:#0284c7; color:#fff; }
.ews-nowcast-playback button:disabled { opacity:.5; cursor:not-allowed; }
.ews-nowcast-wind-options { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:3px 8px; padding:2px 11px 5px; color:var(--text-muted); font-size:9px; }
.ews-nowcast-wind-options[hidden] { display:none; }
.ews-nowcast-wind-options label { display:inline-flex; align-items:center; gap:4px; color:var(--text-main); font-weight:700; cursor:pointer; }
.ews-nowcast-wind-options input { margin:0; accent-color:#0284c7; }
.ews-wind-motion-canvas { position:absolute; inset:0; z-index:450; pointer-events:none; }
.ews-nowcast-legend { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center; padding:2px 11px 6px; color:var(--text-muted); font-size:9px; }
.ews-nowcast-legend span { display:inline-flex; align-items:center; gap:3px; }
.ews-nowcast-legend i { display:inline-block; width:9px; height:9px; border-radius:2px; border:1px solid rgba(0,0,0,.12); }
.ews-nowcast-status { min-height:35px; padding:5px 11px 9px; color:var(--text-muted); font-size:9px; line-height:1.35; }

.hazard-map-box {
  height: 290px;
  width: 100%;
  position: relative;
  isolation: isolate;
  container-type: size;
}

.hazard-times-floating {
  position: absolute;
  top: 10px;
  bottom: auto;
  right: 10px;
  display: flex;
  width: 76px;
  width: clamp(64px, min(17cqw, 18cqh), 96px);
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  z-index: 400;
}

/* Saat meteogram naik dari bawah, rail dipadatkan lagi supaya ketiga
   thumbnail tetap berada di area peta yang tidak tertutup panel. */
.hazard-map-box:has(.das-meteogram.is-open) .hazard-times-floating {
  width: 60px;
  width: clamp(56px, min(12cqw, 12cqh), 72px);
  gap: 3px;
}

.ews-map-expand { position:absolute; z-index:450; top:10px; left:10px; display:flex; align-items:center; gap:6px; border:1px solid rgba(255,255,255,.75); border-radius:6px; padding:7px 9px; background:rgba(255,255,255,.94); color:#0c3b6d; box-shadow:var(--shadow-sm); font-size:10px; font-weight:700; cursor:pointer; }
.ews-map-expand:hover { background:#fff; transform:translateY(-1px); }
.ews-map-expand svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.hazard-thumb-card {
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1.35 / 1;
  min-height: 0;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.hazard-thumb-card:hover,
.hazard-thumb-card.active { transform: translateX(-2px); border-color: var(--pu-blue); }
.hazard-thumb-card:focus-visible { outline: 2px solid var(--pu-blue); outline-offset: 2px; }

.ews-full-trend-card { grid-column:1 / -1; min-width:0; overflow:hidden; border:1px solid var(--border); border-radius:16px; background:var(--surface); box-shadow:0 7px 22px #254a6814; }
.ews-full-trend-card .chart-card-header { flex-wrap:nowrap; }
.ews-full-trend-card .card-title-group { display:grid; min-width:0; grid-template-columns:auto minmax(0,1fr); gap:1px 8px; }.ews-full-trend-card .card-icon { grid-row:1 / 3; align-self:center; width:22px; height:22px; color:#087bc1; }.ews-full-trend-card .card-title { overflow:hidden; font-size:15px; font-weight:900; letter-spacing:0; text-overflow:ellipsis; text-transform:none; white-space:nowrap; }
.ews-full-trend-card .card-subtitle { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ews-full-trend-card .chart-header-actions { flex:0 0 auto; gap:8px; margin-left:auto; flex-wrap:nowrap; }
.ews-trend-content { display:grid; min-width:0; grid-template-columns:205px minmax(0,1fr); align-items:stretch; padding:12px 12px 0; }
.ews-trend-summary { display:grid; align-content:stretch; gap:8px; border-right:1px solid var(--border-subtle); padding:4px 12px 10px 0; }
.ews-trend-summary-item { display:grid; min-width:0; grid-template-columns:44px minmax(0,1fr); gap:9px; align-items:center; border:1px solid #dcebf4; border-radius:13px; background:linear-gradient(110deg,#f8fcff,#eaf7fd); padding:10px; color:#0797dc; box-shadow:0 3px 9px #315c7a0d; }.ews-trend-summary-item > i { display:grid; width:40px; height:40px; place-items:center; border-radius:10px; background:#dff4fd; font-size:24px; font-style:normal; }.ews-trend-summary-item > span { display:grid; min-width:0; gap:3px; }.ews-trend-summary-item small { color:#17365b; font-size:8px; font-weight:850; }.ews-trend-summary-item strong { color:#10214b; font-size:16px; font-weight:900; white-space:nowrap; }.ews-trend-summary-item em { overflow:hidden; color:#526d87; font-size:8px; font-style:normal; font-weight:750; text-overflow:ellipsis; white-space:nowrap; }.ews-trend-summary-item.peak { border-color:#fecaca; background:linear-gradient(110deg,#fff,#fff1f2); color:#ef4444; }.ews-trend-summary-item.peak > i { background:#fee2e2; }.ews-trend-summary-item.peak strong { color:#dc2626; }
.ews-trend-chart-area { min-width:0; padding:4px 4px 0 10px; }
#ews-hulu-chart-canvas,
#beranda-dual-chart { width:100%; height:390px; }
.ews-chart-grid { fill: none; stroke: var(--border-subtle); stroke-width: 1; }
.ews-chart-grid path:last-child { opacity: .45; }
.ews-rain-area { fill: rgba(14,165,233,.12); }
.ews-rain-line { fill: none; stroke: #0ea5e9; stroke-width: 2; stroke-dasharray: 4 3; }
.ews-tma-line { fill: none; stroke: #ef4444; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ews-tma-dot { fill: #ef4444; stroke: var(--surface); stroke-width: 2; }
.ews-chart-labels { fill: var(--text-muted); font: 8px var(--font-sans); text-anchor: middle; }
.ews-chart-legend { display:flex; align-items:center; gap:10px; color:var(--text-muted); font-size:9px; white-space:nowrap; }
.ews-chart-legend span { display:flex; align-items:center; gap:4px; }
.ews-chart-legend i { width:12px; height:2px; display:inline-block; background:#ef4444; }
.ews-chart-legend span+span i { background:#0ea5e9; border-top:1px dashed #0ea5e9; }
@media (max-width:700px) {
  .ews-full-trend-card .chart-card-header { align-items:flex-start; flex-direction:column; }
  .ews-full-trend-card .card-title-group { width:100%; flex-wrap:wrap; }
  .ews-full-trend-card .card-subtitle { max-width:100%; white-space:normal; }
  .ews-full-trend-card .chart-header-actions { width:100%; margin-left:0; justify-content:space-between; flex-wrap:wrap; }
  .ews-trend-content { grid-template-columns:minmax(0,1fr); }
  .ews-trend-summary { grid-template-columns:repeat(2,minmax(0,1fr)); border-right:0; border-bottom:1px solid var(--border-subtle); padding:0 0 10px; }
  .ews-trend-summary-item { min-height:82px; }
  .ews-trend-chart-area { padding:8px 0 0; }
}
.ews-flood-detail { position:fixed; inset:0; z-index:10020; display:none; align-items:flex-start; justify-content:center; padding:210px 20px 20px; background:rgba(2,12,27,.65); backdrop-filter:blur(3px); }
.ews-flood-detail.active { display:flex; }
.ews-flood-detail-card { width:min(1000px,88vw); height:min(760px,calc(100dvh - 240px)); display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--border); border-radius:14px; background:var(--surface); box-shadow:0 24px 70px rgba(0,0,0,.35); }
.ews-flood-detail-card>header { position:relative; z-index:1; display:flex; flex:0 0 auto; align-items:center; justify-content:space-between; gap:16px; min-height:86px; padding:14px 22px; border-bottom:1px solid var(--border-subtle); border-left:4px solid #ef4444; }
.ews-flood-detail-heading { display:flex; align-items:center; gap:10px; }
.ews-flood-detail-heading h2 { margin:0; color:var(--text-main); font-size:14px; }
.ews-flood-detail-card header p { margin:4px 0 0; color:var(--text-muted); font-size:10px; }
.ews-flood-detail-card header button { position:relative; z-index:2; display:flex; flex:0 0 32px; align-items:center; justify-content:center; width:32px; height:32px; border:1px solid var(--border); border-radius:7px; background:var(--surface); color:var(--text-main); font-size:22px; line-height:1; cursor:pointer; }
.ews-flood-detail-card header button:hover { background:var(--surface-hover); color:var(--pu-blue); }
.ews-flood-map-area { position:relative; display:flex; flex:1 1 auto; min-height:0; overflow:hidden; }
.ews-detail-map-toolbar { margin-left:auto; }
.ews-flood-map-area:fullscreen { width:100vw; height:100vh; min-height:100vh; background:var(--surface); }
.ews-flood-detail-card #map-ews-flood-detail { position:relative; inset:auto; z-index:0; flex:1 1 auto; width:100%; height:auto; min-height:0; }
@media (max-width:700px) { .ews-flood-detail { padding:150px 12px 12px; } .ews-flood-detail-card { width:96vw; height:calc(100dvh - 180px); } .ews-flood-detail-card>header { min-height:72px; padding:10px 13px; flex-wrap:wrap; } .ews-flood-detail-card>header>div:first-child { flex:1 1 auto; } .ews-detail-map-toolbar { order:3; margin:0 auto; } .ews-flood-detail-card header button { order:2; } }
.timeline-stops button { border:0; padding:0; background:none; color:var(--text-muted); font:inherit; font-size:inherit; cursor:pointer; white-space:nowrap; }
.timeline-stops button.active { color:var(--pu-blue); font-weight:800; }
.timeline-reset-btn { background-color:var(--surface-container, #64748b); }

.hazard-thumb-tag {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  background-color: #ef4444;
  color: #fff;
  width: 100%;
  text-align: center;
}

.hazard-thumb-tag.t3 { background-color: #f97316; }
.hazard-thumb-tag.t6 { background-color: #eab308; }
.hazard-thumb-tag.normal { background-color: #22c55e; }
.hazard-thumb-tag.hidden { background-color:#64748b; }
.hazard-thumb-empty { margin: 0; padding: 8px; color: #fff; font-size: 10px; text-align: center; }

.hazard-thumb-img {
  width: 100%;
  height: auto;
  min-height: 25px;
  flex: 1 1 auto;
  border-radius: 2px;
  margin-top: 2px;
  background: radial-gradient(circle, rgba(239,68,68,0.7) 0%, rgba(245,158,11,0.3) 60%, transparent 90%);
}

.prob-gauge-container {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
}

.circular-gauge {
  width: 72px;
  height: 72px;
  position: relative;
  flex-shrink: 0;
}

/* Timeline Scrubber */
.timeline-scrubber-card {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.timeline-info {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.timeline-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.timeline-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.timeline-track-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-stops {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-slider {
  width: 100%;
  accent-color: var(--pu-blue);
  cursor: pointer;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background-color: var(--pu-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(12, 59, 109, 0.3);
  transition: transform 0.15s ease;
}

.play-btn:hover {
  transform: scale(1.06);
}

/* ==========================================================================
   VIEW 4: NERACA AIR
   ========================================================================== */
.neraca-legacy-hidden { display:none!important; }
.neraca-reference-layout { display:grid; height:calc(100vh - 120px); min-height:690px; max-height:950px; grid-template-columns:minmax(270px,.78fr) minmax(0,2.22fr); gap:14px; align-items:stretch; }
.neraca-reservoir-card { min-width:0; }
.neraca-reservoir-header>div { min-width:0; }
.neraca-reservoir-header .card-title { overflow-wrap:anywhere; }
.neraca-reservoir-header .badge { display:inline-block; margin-top:4px; padding:3px 7px; background:#e0f2fe; color:#0369a1; font-size:9px; font-weight:700; border-radius:5px; }
.neraca-reset-selection { border:0; border-radius:6px; padding:2px 8px; background:var(--surface-hover); color:var(--text-muted); font-size:20px; cursor:pointer; }
.neraca-gauge-area { display:flex; flex-direction:column; align-items:center; padding:14px 10px; }
.neraca-gauge { position:relative; width:min(68%,190px); min-width:145px; height:245px; overflow:hidden; border:3px solid #64748b; border-radius:15px; background:var(--surface-alt); box-shadow:inset 0 2px 8px rgba(0,0,0,.1); }
.neraca-gauge-fill { position:absolute; inset:auto 0 0; background:linear-gradient(180deg,#34d399,#059669); transition:height .7s ease,background .3s ease; }
.neraca-gauge-fill.deficit { background:linear-gradient(180deg,#fbbf24,#d97706); }
.neraca-gauge-fill.critical { background:linear-gradient(180deg,#f87171,#dc2626); }
.neraca-gauge-wave { position:absolute; top:-9px; left:-10%; width:120%; height:20px; border-radius:50%; background:rgba(255,255,255,.38); animation:neraca-wave 3s ease-in-out infinite; }
@keyframes neraca-wave { 50% { transform:translateY(-4px) scaleY(1.15); } }
.neraca-gauge-mark { position:absolute; z-index:1; left:0; right:0; padding:2px 4px; border-top:1px dashed rgba(100,116,139,.7); color:var(--text-muted); background:color-mix(in srgb,var(--surface) 72%,transparent); font-size:8px; font-weight:700; }
.neraca-mark-overflow { top:0; border-color:#ef4444; color:#ef4444; }
.neraca-mark-nominal { top:50%; }
.neraca-mark-dead { bottom:5%; border-color:#ef4444; color:#ef4444; }
.neraca-gauge-value { position:absolute; z-index:2; inset:0; display:grid; place-items:center; color:#fff; font-size:24px; font-weight:800; text-shadow:0 1px 4px #1e293b; }
.neraca-gauge-caption { margin-top:9px; color:var(--text-muted); font-size:10px; text-align:center; }
.neraca-selected-metrics { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding:0 12px 12px; }
.neraca-selected-metrics>div { min-width:0; padding:7px; border:1px solid var(--border-subtle); border-radius:7px; background:var(--surface-alt); }
.neraca-selected-metrics span,.neraca-selected-metrics strong { display:block; }
.neraca-selected-metrics span { color:var(--text-muted); font-size:9px; }
.neraca-selected-metrics strong { margin-top:3px; color:var(--text-main); font-size:11px; overflow-wrap:anywhere; }
.neraca-selected-metrics strong.normal,.neraca-selected-metrics strong.is-normal { color:#059669; }
.neraca-selected-metrics strong.deficit { color:#d97706; }
.neraca-selected-metrics strong.critical { color:#dc2626; }
.neraca-capacity-curve { display:flex; flex:1 1 auto; min-height:220px; flex-direction:column; padding:9px 12px 12px; border-top:1px solid var(--border-subtle); }
.neraca-capacity-curve h4 { margin:0 0 4px; color:var(--text-muted); font-size:9px; text-transform:uppercase; letter-spacing:.06em; }
.neraca-capacity-curve>div { flex:1; min-height:175px; }
.neraca-capacity-curve svg { display:block; width:100%; height:100%; overflow:visible; }
.neraca-curve-grid { stroke:var(--text-muted); stroke-width:.75; opacity:.2; }
.neraca-curve-label { fill:var(--text-main); font:8px var(--font-sans); }
.neraca-curve-elev-label,.neraca-curve-axis-title { fill:var(--text-muted); font-weight:600; }
.neraca-curve-volume-label,.neraca-curve-tick-volume,.neraca-curve-axis-volume { fill:#b91c1c; stroke:#b91c1c; }
.neraca-curve-volume-label,.neraca-curve-area-label { font-weight:700; }
.neraca-curve-area-label,.neraca-curve-tick-area,.neraca-curve-axis-area { fill:#2563eb; stroke:#2563eb; }
.neraca-curve-axis-volume,.neraca-curve-axis-area,.neraca-curve-axis-side { stroke-width:1; opacity:.55; }
.neraca-curve-axis-side { stroke:var(--text-muted); }
.neraca-curve-tick-volume,.neraca-curve-tick-area { stroke-width:1; }
.neraca-curve-area { fill:none; stroke:#3b82f6; stroke-width:2; }
.neraca-curve-volume { fill:none; stroke:#b91c1c; stroke-width:2; }
.neraca-reference-right { display:grid; min-width:0; min-height:0; grid-template-rows:auto minmax(0,1fr); gap:14px; }
.neraca-reference-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.neraca-reference-kpi { display:flex; min-width:0; min-height:112px; flex-direction:column; justify-content:space-between; gap:6px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); box-shadow:var(--shadow-sm); }
.neraca-reference-kpi>span { display:flex; align-items:center; justify-content:space-between; gap:5px; color:var(--text-muted); font-size:10px; font-weight:700; }
.neraca-reference-kpi>strong { color:var(--text-main); font-size:20px; line-height:1.15; }
.neraca-reference-kpi>strong small { color:var(--text-muted); font-size:10px; }
.neraca-reference-kpi>small { color:var(--text-muted); font-size:9px; }
.neraca-reference-kpi.is-critical { border-left:3px solid #ef4444; }
.neraca-reference-kpi.is-critical>strong { color:#dc2626; }
.neraca-reference-kpi.is-warning { border-left:3px solid #f97316; }
.neraca-reference-kpi.is-warning>strong { color:#ea580c; }
.neraca-reference-kpi>span b { padding:3px 6px; border-radius:5px; background:#fee2e2; color:#b91c1c; font-size:8px; }
.neraca-kpi-progress { height:5px; overflow:hidden; border-radius:99px; background:var(--surface-hover); }
.neraca-kpi-progress i { display:block; height:100%; border-radius:inherit; background:#059669; }
.neraca-status-counts { display:flex; flex-direction:column; gap:4px; }
.neraca-status-counts span { display:flex; align-items:center; gap:5px; color:var(--text-muted); font-size:9px; }
.neraca-status-counts i,.neraca-map-legend i { width:7px; height:7px; flex:none; border-radius:50%; background:#059669; }
.neraca-status-counts .is-deficit i,.neraca-map-legend .is-deficit i { background:#d97706; }
.neraca-status-counts .is-critical i,.neraca-map-legend .is-critical i { background:#dc2626; }
.neraca-status-counts b { margin-left:auto; color:var(--text-main); }
.neraca-assets-card { display:flex; height:100%; min-height:0; flex-direction:column; }
.neraca-assets-header { flex-wrap:wrap; gap:8px; }
.neraca-assets-heading { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.neraca-assets-heading>div { display:flex; gap:4px; }
.neraca-assets-heading .badge { font-size:8px; }
.neraca-search { position:relative; display:flex; align-items:center; min-width:190px; }
.neraca-search svg { position:absolute; left:8px; width:13px; height:13px; color:var(--text-muted); }
.neraca-search input { width:100%; height:30px; padding:4px 26px; border:1px solid var(--border); border-radius:6px; outline:none; background:var(--surface); color:var(--text-main); font:inherit; font-size:10px; }
.neraca-search input:focus { border-color:var(--pu-blue); box-shadow:0 0 0 2px color-mix(in srgb,var(--pu-blue) 14%,transparent); }
.neraca-search button { position:absolute; right:6px; border:0; background:transparent; color:var(--text-muted); font-size:16px; cursor:pointer; }
.neraca-assets-content { display:flex; flex:1; min-height:0; overflow:hidden; }
.neraca-assets-list { width:260px; flex:none; display:flex; flex-direction:column; gap:7px; overflow:auto; padding:9px; border-right:1px solid var(--border-subtle); }
.neraca-asset-item { display:flex; flex-direction:column; gap:6px; padding:9px; border:1px solid var(--border); border-radius:8px; background:var(--surface-alt); color:var(--text-main); text-align:left; cursor:pointer; }
.neraca-asset-item:hover,.neraca-asset-item.selected { border-color:var(--pu-blue); background:color-mix(in srgb,var(--pu-blue) 8%,var(--surface)); }
.neraca-asset-item-top,.neraca-asset-item-top>span:first-child { display:flex; align-items:center; justify-content:space-between; gap:5px; }
.neraca-asset-item-top>span:first-child { min-width:0; justify-content:flex-start; }
.neraca-asset-item-top strong { overflow:hidden; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.neraca-asset-kind { display:grid; width:20px; height:18px; flex:none; place-items:center; border-radius:4px; background:color-mix(in srgb,var(--pu-blue) 12%,transparent); color:var(--pu-blue); font-size:8px; font-style:normal; font-weight:800; }
.neraca-asset-status { flex:none; padding:3px 5px; border-radius:99px; font-size:8px; font-weight:700; text-transform:uppercase; }
.neraca-asset-status.normal { background:#d1fae5; color:#047857; }
.neraca-asset-status.deficit { background:#fef3c7; color:#b45309; }
.neraca-asset-status.critical { background:#fee2e2; color:#b91c1c; }
.neraca-asset-progress { display:block; height:5px; overflow:hidden; border-radius:99px; background:var(--surface-hover); }
.neraca-asset-progress i { display:block; height:100%; border-radius:inherit; background:#059669; }
.neraca-asset-progress i.deficit { background:#d97706; }
.neraca-asset-progress i.critical { background:#dc2626; }
.neraca-asset-item-meta { display:flex; justify-content:space-between; gap:5px; color:var(--text-muted); font-size:8px; }
.neraca-empty-list { padding:20px 8px; color:var(--text-muted); font-size:10px; text-align:center; }
.neraca-assets-map { position:relative; display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; }
.neraca-map-title { display:flex; justify-content:space-between; gap:8px; padding:8px 10px; border-bottom:1px solid var(--border-subtle); color:var(--text-muted); font-size:9px; font-weight:700; }
.neraca-map-title span { font-weight:400; }
.neraca-map-toolbar { position:relative; z-index:650; display:flex; flex:none; align-items:center; padding:3px; border:1px solid var(--border); border-radius:8px; background:var(--surface); box-shadow:0 2px 8px rgba(15,23,42,.18); }
.neraca-map-toolbar.is-floating { position:absolute; top:10px; left:10px; }
.neraca-map-toolbar>button { display:grid; width:34px; height:34px; flex:none; place-items:center; border:0; border-radius:5px; background:transparent; color:var(--text-main); cursor:pointer; }
.neraca-map-toolbar>button:hover,.neraca-map-toolbar>button[aria-pressed="false"] { background:var(--surface-hover); color:var(--pu-blue); }
.neraca-map-toolbar>button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.neraca-map-toolbar>i { width:1px; height:23px; margin:0 3px; background:var(--border); }
.neraca-map-layer-popup { position:absolute; z-index:660; top:calc(100% + 7px); left:0; display:flex; width:220px; flex-direction:column; gap:10px; padding:12px; border:1px solid var(--border); border-radius:9px; background:var(--surface); box-shadow:0 8px 24px rgba(15,23,42,.2); color:var(--text-main); font-size:11px; }
.neraca-map-layer-popup[hidden] { display:none; }
.neraca-map-layer-popup strong,.neraca-map-layer-popup>span { color:var(--text-muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.neraca-map-layer-popup label { display:flex; align-items:center; gap:8px; cursor:pointer; }
.neraca-map-layer-popup input { accent-color:var(--pu-blue); }
.neraca-map-layer-popup select { width:100%; padding:6px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text-main); }
.neraca-assets-map .real-map { flex:1; min-height:0; }
.neraca-map-legend { position:absolute; z-index:500; right:9px; bottom:9px; display:flex; flex-direction:column; gap:6px; padding:8px; border:1px solid var(--border); border-radius:7px; background:var(--surface); box-shadow:var(--shadow-sm); }
.neraca-map-legend span { display:flex; align-items:center; gap:5px; color:var(--text-main); font-size:9px; }
.neraca-assets-footer { display:flex; justify-content:space-between; gap:8px; padding:8px 11px; border-top:1px solid var(--border-subtle); color:var(--text-muted); font-size:9px; }
.neraca-grid-layout {
  display: grid;
  grid-template-columns: 290px 1fr 1fr;
  gap: 14px;
}

/* Realistic Water Tank graphic */
.water-tank-wrapper {
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.water-tank-container {
  width: 160px;
  height: 220px;
  border: 3px solid #64748b;
  border-radius: 12px;
  position: relative;
  background-color: #f8fafc;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

[data-theme="dark"] .water-tank-container {
  background-color: #0f172a;
}

.water-tank-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68.2%;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.water-wave {
  position: absolute;
  top: -8px;
  left: 0;
  width: 200%;
  height: 16px;
  background: radial-gradient(circle at 50% 100%, transparent 6px, #38bdf8 7px);
  animation: wave 3s linear infinite;
}

@keyframes wave {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.tank-level-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: none;
}

.tank-pct-huge {
  font-size: 22px;
  line-height: 1;
}

.tank-vol-sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.95;
}

.tank-threshold-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1.5px dashed;
  pointer-events: none;
}

.line-spill {
  top: 0%;
  border-color: #ef4444;
}

.line-normal {
  top: 50%;
  border-color: #3b82f6;
}

.line-dead {
  bottom: 8%;
  border-color: #ef4444;
}

/* Neraca KPI row */
.neraca-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.neraca-kpi-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-value-huge {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0 2px 0;
  font-family: var(--font-mono);
}

.kpi-progress-bar {
  height: 6px;
  background-color: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.kpi-bar-fill {
  height: 100%;
  background-color: #10b981;
  border-radius: 999px;
}

/* ==========================================================================
   BOTTOM SYSTEM FOOTER
   ========================================================================== */
.main-footer {
  height: var(--footer-height);
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 11px;
  color: var(--text-muted);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.02);
  z-index: 40;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.footer-brand-title {
  font-weight: 700;
  color: var(--pu-blue);
}

.footer-divider {
  color: var(--border-strong);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-copyright-short {
  display: none; /* Shown only on mobile — see the 768px breakpoint below */
}

/* ==========================================================================
   RESPONSIVENESS & MOBILE LAYOUT (Matching mobile nav.png)
   ========================================================================== */
@media (max-width: 1200px) {
  .neraca-reference-layout { grid-template-columns:minmax(250px,.8fr) minmax(0,1.7fr); }
  .neraca-reference-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .beranda-top-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .beranda-top-grid > .dash-card:first-child { grid-column: 1 / -1; }
  .card-peta {
    grid-column: auto;
  }
  .pos-grid-layout {
    grid-template-columns: 1fr 1fr;
  }
  .pos-right-col {
    grid-column: span 2;
  }
  .ews-grid-layout {
    grid-template-columns: minmax(250px, .8fr) minmax(0, 1.4fr);
  }
  .neraca-grid-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .neraca-reference-layout { height:auto; min-height:0; max-height:none; grid-template-columns:1fr; }
  .neraca-reservoir-card { grid-row:auto; }
  .neraca-reference-right { grid-template-rows:auto 620px; }
  .neraca-assets-map { min-height:360px; }
  .neraca-assets-map .real-map { min-height:320px; }
  .main-header {
    min-height: 68px;
    padding: 10px 16px;
    align-items: center;
  }

  /* On mobile/tablet, the right-side nav is standard or accessible via toggle */
  .top-nav-bar {
    display: none; /* Hide top desktop navigation tabs */
  }

  .mobile-nav-drawer {
    display: flex; /* Show right-side navigation drawer on mobile */
  }

  .mobile-toggle-btn {
    display: flex;
  }

  /* Make room for right mobile navigation */
  .main-content {
    padding-right: calc(var(--mobile-nav-width) + 12px);
  }

  .beranda-top-grid {
    grid-template-columns: 1fr;
  }
  .card-peta {
    grid-column: span 1;
  }

  .pos-grid-layout {
    grid-template-columns: 1fr;
  }
  .pos-right-col {
    grid-column: span 1;
  }

  .sensor-cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pos-metrics-5col {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .pasut-bottom-grid {
    grid-template-columns: 1fr;
  }

  .pos-bottom-split {
    grid-template-columns: 1fr;
  }

  .ews-grid-layout {
    grid-template-columns: 1fr;
  }
  .ews-left-column { height:auto; }
  .ews-warning-detail { height:auto; overflow:visible; }
  .ews-warning-detail-body { height:auto; grid-template-rows:none; }
  .ews-station-tables { grid-template-columns:1fr; }

  .neraca-grid-layout {
    grid-template-columns: 1fr;
  }

  .neraca-kpi-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .neraca-assets-content { flex-direction:column; }
  .neraca-assets-list { width:100%; max-height:270px; border-right:0; border-bottom:1px solid var(--border-subtle); }
  .neraca-assets-map { min-height:360px; }
  .neraca-assets-footer { flex-direction:column; }
  .ews-spatial-layout { grid-template-columns:minmax(0, 3fr) minmax(0, 2fr); }
}

@media (max-width: 600px) {
  .neraca-reference-kpis { grid-template-columns:1fr 1fr; }
  .ews-rain-detail-content { padding:12px; }
  .ews-rain-detail-summary { grid-template-columns:1fr 1fr; gap:7px; }
  .ews-rain-detail-metric { padding:9px; }
  .ews-rain-detail-metric strong { font-size:15px; }
  .neraca-assets-header { align-items:stretch; }
  .neraca-assets-heading { justify-content:space-between; }
  .neraca-search { min-width:100%; }
  .neraca-map-title { flex-direction:column; }
  .ews-spatial-layout { grid-template-columns:1fr; }
  .ews-warning-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ews-warning-detail { height:auto; overflow:visible; }
  .ews-warning-detail-body { height:auto; grid-template-rows:none; }
  .ews-warning-recommendation { overflow:visible; }
}

@media (max-width: 1100px) {
  .pasut-layout-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pasut-top-chart-card { grid-column: 1 / -1; grid-row: auto; }
  #pasut-prediksi-card { grid-column: 1 / -1; grid-row: auto; }
  #pasut-dataran-card { grid-column: 1; grid-row: auto; }
  .pasut-summary-card { grid-column: 2; grid-row: auto; }
  .pasut-additional-card { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 680px) {
  .pasut-layout-container { grid-template-columns: minmax(0, 1fr); }
  .pasut-top-chart-card,
  #pasut-prediksi-card,
  #pasut-dataran-card,
  .pasut-summary-card,
  .pasut-additional-card { grid-column: 1; grid-row: auto; }
  .pasut-datum-switch-container { width: 100%; justify-content: space-between; }
  .pasut-datum-btn .datum-desc { display: none; }
  #pasut-tide-chart-canvas { height: 230px; }
  .pasut-pred-table { min-width: 520px; }
  #pasut-prediksi-card .pasut-prediksi-body { overflow-x: auto; }
}

@media (max-width: 768px) {
  .main-header {
    padding: 0 12px;
  }

  .brand-ministry {
    display: none; /* Keep header compact on mobile */
  }

  .live-clock-wrapper {
    display: none;
  }

  .main-content {
    padding: 10px 12px;
    padding-right: calc(var(--mobile-nav-width) + 8px);
    gap: 10px;
  }

  .main-footer {
    height: auto;
    min-height: var(--footer-height);
    padding: 8px 12px;
    gap: 8px;
  }

  .footer-left,
  .footer-right {
    white-space: normal;
    flex-wrap: wrap;
    gap: 6px;
  }

  .footer-copyright-full {
    display: none;
  }

  .footer-copyright-short {
    display: inline;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-nav-width: 72px;
  }

  .mobile-nav-btn {
    min-height: 72px;
    padding: 8px 4px;
  }

  .mobile-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .mobile-nav-btn span {
    font-size: 9.5px;
  }
}

/* ==========================================================================
   GEOSPATIAL & SUB-DAS MAP LAYERS STYLES
   ========================================================================== */
.subdas-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  font-family: var(--font-sans) !important;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.subdas-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92) !important;
}

.subdas-tooltip-name {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 2px;
  color: #38bdf8;
}

.subdas-tooltip-meta {
  font-size: 10px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

/* Station Custom Icons */
.beranda-pda-marker {
  background: transparent;
  border: 0;
}

.beranda-pda-pin {
  position: relative;
  width: 26px;
  height: 26px;
}

.beranda-pda-pin-pulse,
.beranda-pda-pin-core {
  position: absolute;
  left: 3px;
  top: 4.34px;
  width: 20px;
  height: 17.32px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.beranda-pda-pin-pulse {
  background: var(--pin-color);
  pointer-events: none;
  transform-origin: 50% 62%;
  animation: beranda-pda-triangle-pulse 2.5s ease-out infinite;
}

.beranda-pda-marker-bahaya .beranda-pda-pin-pulse {
  animation-name: beranda-pda-bahaya-pulse;
  animation-duration: 1.8s;
}

.beranda-pda-marker-bahaya .beranda-pda-pin-pulse-secondary {
  animation-delay: -0.9s;
}

.beranda-pda-pin-core {
  background: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.beranda-pda-pin-core::after {
  content: '';
  position: absolute;
  left: 3.46px;
  top: 4px;
  width: 13.08px;
  height: 11.32px;
  background: var(--pin-color);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.beranda-pda-pin.selected .beranda-pda-pin-core {
  transform: scale(1.2);
  transform-origin: 50% 62%;
  filter: drop-shadow(0 0 4px var(--pin-color)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

@keyframes beranda-pda-triangle-pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

@keyframes beranda-pda-bahaya-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .beranda-pda-pin-pulse,
  .beranda-pda-marker-bahaya .beranda-pda-pin-pulse { animation: none; opacity: 0.25; }
  .beranda-pda-marker-bahaya .beranda-pda-pin-pulse-secondary { opacity: 0; }
}

.station-pin-wrap {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.station-pin-halo {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  opacity: 0.25;
  animation: ping 2.5s infinite;
}

.station-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.station-pin-diamond {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* PCH Rainfall Weather Icons */
.custom-pch-icon-marker {
  background: transparent !important;
  border: none !important;
}

.pch-pin-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.pch-pin-no-data {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.25);
}

.pch-pin-wrap.pch-marker-raining::before,
.pch-pin-wrap.pch-marker-raining::after {
  position: absolute;
  z-index: -1;
  width: 30px;
  height: 30px;
  border: 2px solid var(--pch-rain-color, #0284c7);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 5px color-mix(in srgb, var(--pch-rain-color, #0284c7) 45%, transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: pch-marker-rain-wave 2s ease-out infinite;
}

.pch-pin-wrap.pch-marker-raining { isolation: isolate; }
.pch-pin-wrap.pch-marker-raining .pch-pin-img { position: relative; z-index: 1; }
.pch-pin-wrap.pch-marker-raining::after { animation-delay: 0.9s; }

@keyframes pch-marker-rain-wave {
  0% { transform: scale(0.45); opacity: 0.9; }
  70% { opacity: 0.35; }
  100% { transform: scale(2.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pch-pin-wrap.pch-marker-raining::before,
  .pch-pin-wrap.pch-marker-raining::after { animation: none; opacity: 0.45; }
}

.pch-pin-wrap:hover {
  transform: scale(1.22);
  z-index: 1000 !important;
}

.pch-pin-img {
  pointer-events: auto;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  filter: drop-shadow(0 1.5px 3px rgba(0, 0, 0, 0.25));
}

.isohyet-pch-pin .pch-pin-img,
.isohyet-pch-pin .pch-pin-no-data {
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 3.5px var(--pch-rain-color), 0 2px 6px rgba(0, 0, 0, 0.28);
}

/* Custom Weather MarkerCluster Badge */
.custom-pch-cluster-marker {
  background: transparent !important;
  border: none !important;
}

.pch-cluster-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pch-cluster-badge:hover {
  transform: scale(1.15);
  z-index: 1000 !important;
}

.pch-cluster-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35);
  display: block;
}

.pch-cluster-count {
  position: absolute;
  top: -5px;
  right: -7px;
  background: #0284c7;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* GIS Portal Styles */
.gis-toolbar {
  padding: 10px 14px;
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gis-toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gis-toolbar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gis-toolbar-divider {
  width: 1px;
  height: 22px;
  background-color: var(--border);
}

.btn-group-sm {
  display: inline-flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.gis-basemap-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background-color: var(--surface);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gis-basemap-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.gis-basemap-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-main);
}

.gis-basemap-btn.active {
  background-color: var(--brand-blue);
  color: #ffffff;
}

.gis-layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  user-select: none;
  transition: all 0.15s ease;
}

.gis-layer-toggle:hover {
  border-color: var(--brand-blue);
}

.gis-layer-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--brand-blue);
}

.gis-inspector-box {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
  width: 290px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  font-size: 11px;
  transition: all 0.2s ease;
}

.gis-inspector-header {
  padding: 8px 12px;
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-main);
}

.gis-inspector-content {
  padding: 10px 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gis-inspector-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.gis-inspector-row:last-child {
  border-bottom: none;
}

.gis-inspector-val {
  font-weight: 600;
  color: var(--text-main);
}

.gis-footer-bar {
  padding: 8px 14px;
  background-color: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.gis-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gis-meta-label {
  color: var(--text-muted);
}

.gis-meta-val {
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   MINI MAP POS HIDROLOGI CUSTOM PINS & POPUPS
   ========================================================================== */

/* Active / Selected Pin Glow Animation */
.station-pin-wrap.selected .station-pin-dot {
  transform: scale(1.35);
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 14px currentColor;
}

.station-pin-wrap.selected .station-pin-halo {
  animation: ping 1.2s infinite;
  opacity: 0.55;
}

.pch-pin-wrap.selected img,
.pch-pin-wrap.selected .pch-pin-no-data {
  box-shadow: 0 0 0 3px #ffffff, 0 0 12px rgba(2, 132, 199, 0.9);
  transform: scale(1.3);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* Pasang Surut Pin */
.custom-pasut-pin {
  background: transparent !important;
  border: none !important;
}

.pasut-pin-wrap {
  position: relative;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0284c7;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.45);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
}

.pasut-pin-wrap:hover,
.pasut-pin-wrap.selected {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.35), 0 3px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000 !important;
}

/* Klimatologi Pin */
.custom-klimatologi-pin {
  background: transparent !important;
  border: none !important;
}

.klim-pin-wrap {
  position: relative;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.45);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
}

.klim-pin-wrap:hover,
.klim-pin-wrap.selected {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.35), 0 3px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000 !important;
}

/* Kualitas Air Pin */
.custom-kualitas-pin {
  background: transparent !important;
  border: none !important;
}

.kualitas-pin-wrap {
  position: relative;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d9488;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.45);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
}

.kualitas-pin-wrap:hover,
.kualitas-pin-wrap.selected {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.35), 0 3px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000 !important;
}

/* CCTV Pin */
.custom-cctv-pin {
  background: transparent !important;
  border: none !important;
}

.cctv-pin-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 2px solid #ffffff;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.45);
  color: #38bdf8;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
}

.cctv-pin-wrap:hover,
.cctv-pin-wrap.selected {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.4), 0 3px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000 !important;
}

.cctv-pin-live-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border: 1.5px solid #ffffff;
  border-radius: 999px;
  animation: ping 1.4s infinite;
}

/* Mini Map Popups */
.mini-map-popup {
  font-family: var(--font-sans);
  min-width: 170px;
  padding: 3px 1px;
}

.mini-map-popup-title {
  font-weight: 700;
  font-size: 11.5px;
  color: #0f172a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 3px;
}

.mini-map-popup-row {
  font-size: 10.5px;
  color: #475569;
  margin-bottom: 2.5px;
  display: flex;
  justify-content: space-between;
}

.mini-map-popup-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Portal layouts: keep dashboard views inside the available viewport. */
@media (max-width: 992px) {
  .pos-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .pos-grid-layout > *,
  .pos-main-wrapper,
  .pos-left-col,
  .pos-tab-grid,
  .pos-tab-content {
    min-width: 0;
    width: 100%;
  }

  .pos-left-col { flex-shrink: 1; }
  .pos-tab-grid { grid-template-columns: minmax(0, 1fr); }
  .pos-tab-stations { min-width: 0; }
  .pos-top-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-top-metric-strip.pos-metrics-5col { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ews-spatial-layout { grid-template-columns: minmax(0, 1fr); }
  .ews-warning-detail { height: auto; overflow: visible; }
  .ews-warning-detail-body { height: auto; grid-template-rows: none; }
  .ews-warning-recommendation { overflow: visible; }
  .neraca-reference-layout { height: auto; min-height: 0; max-height: none; grid-template-columns: minmax(0, 1fr); }
  .neraca-reference-right { grid-template-rows: auto minmax(380px, 55vh); }
  .card-header { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 600px) {
  .main-header { min-height: 58px; }
  .header-left { min-width: 0; }
  .brand-title { max-width: 42vw; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .header-right { min-width: 0; }
  /* padding-right set separately (not via the shorthand above, which would
     clobber it) to keep reserving calc(var(--mobile-nav-width) + 8px) for
     the fixed mobile-nav-drawer — this block used to flatten it back to
     8px, letting card content render underneath the drawer. */
  .main-content { min-width: 0; padding: 8px 8px 12px; gap: 9px; }
  .main-content { padding-right: calc(var(--mobile-nav-width) + 8px); }
  .beranda-top-grid,
  .neraca-grid-layout,
  .pos-bottom-split,
  .pasut-bottom-grid,
  .ews-station-tables { grid-template-columns: minmax(0, 1fr); }
  .pos-top-metric-strip,
  .pos-top-metric-strip.pos-metrics-5col { grid-template-columns: minmax(0, 1fr) !important; }
  .pos-top-metric-strip > .sensor-card { min-height: 0; }
  .subtab-buttons-bar { padding: 5px 6px 6px; }
  .subtab-buttons-scroll { gap: 5px; }
  .subtab-btn { flex: 0 0 auto; min-height: 30px; padding: 5px 8px; font-size: 10.5px; }
  .subtab-btn svg { width: 13px; height: 13px; }
  .card-header { padding: 9px 10px; }
  .card-title { font-size: 12px; }
  .pos-tab-grid { gap: 9px; }
  .pos-tab-stations,
  .pos-tab-content { gap: 9px; }
  .cctv-tab-content { gap: 9px; }
  .cctv-matrix-grid { gap: 8px; padding: 8px; }
  .cctv-primary-slot { height: clamp(220px, 42vh, 340px); }
  .cctv-secondary-rail { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cctv-secondary-rail .cctv-feed-small { min-height: 118px; aspect-ratio: 16 / 9; }
  .cctv-bottom-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cctv-feed-name { max-width: 100%; font-size: 10px; }
  .cctv-feed-status { padding: 3px 5px; font-size: 8px; }
  .cctv-feed-footer { font-size: 7px; }
  .cctv-feed-main .cctv-feed-name { font-size: 14px; }
  .ews-spatial-layout { padding: 8px; gap: 9px; }
  .ews-warning-metrics,
  .ews-rain-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ews-model-filters { max-width: 100%; overflow-x: auto; }
  .hazard-map-box,
  .radar-map-box { height: 250px; }
  .neraca-reference-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neraca-reference-right { grid-template-rows: auto minmax(340px, 52vh); }
  .neraca-assets-header { align-items: stretch; }
  .neraca-search { min-width: 0; width: 100%; }
  .neraca-assets-content { flex-direction: column; }
  .neraca-assets-list { width: 100%; max-height: 220px; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .neraca-assets-map { min-height: 320px; }
  .neraca-assets-footer { flex-direction: column; }
  .sensor-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-responsive { max-width: 100%; }
}

@media (max-width: 380px) {
  .brand-title { max-width: 34vw; font-size: 13px; }
  .mobile-nav-btn span { font-size: 8px; }
  .cctv-bottom-strip { grid-template-columns: minmax(0, 1fr); }
  .neraca-reference-kpis,
  .ews-rain-detail-summary { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1200px) {
  .ews-spatial-layout { grid-template-columns:minmax(0,1fr); }
  .ews-spatial-map-column { height:auto; }
  .ews-spatial-map-card { flex:none; }
  .ews-spatial-map-card .hazard-map-box { height:clamp(250px,45vw,420px); min-height:0; }
  .ews-warning-detail { height:auto; overflow:visible; }
}

@media (max-width: 480px) {
  .ews-warning-detail-header { flex-wrap:wrap; }
  .ews-warning-summary { grid-template-columns:29px minmax(0,1fr); gap:7px; padding:8px; }
  .ews-warning-level { border-right:0; }
  .ews-warning-summary-copy { grid-column:1 / -1; }
  .ews-warning-metrics { grid-template-columns:minmax(0,1fr); }
  .ews-warning-duration .ews-warning-info-content { flex-wrap:wrap; }
  .ews-warning-duration-note { margin-left:38px; }
}
