html, body { margin: 0; padding: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2933; }
#map { position: absolute; left: 400px; top: 0; right: 0; bottom: 0; }
#sidebar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 400px;
  overflow-y: auto; padding: 14px 16px; box-sizing: border-box;
  background: #fafbfc; border-right: 1px solid #d3d8de;
}
#sidebar header h1 { font-size: 16px; margin: 0 0 2px; }
#sidebar h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #4a5568; margin: 14px 0 6px; }
#sidebar section { border-top: 1px solid #e1e4e8; padding-top: 6px; }
#sidebar section.tab { border-top: none; }
#sidebar label { display: block; font-size: 13px; line-height: 22px; cursor: pointer; }
#sidebar label input { margin-right: 6px; }
.muted { color: #6b7280; }
.small { font-size: 11px; line-height: 1.45; }
.tag { display: inline-block; background: #1f2933; color: #fff; font-size: 9px; padding: 2px 6px; border-radius: 3px; vertical-align: middle; margin-left: 4px; letter-spacing: .04em; }
.hidden { display: none; }

/* cross-modal alerts banner */
#cross-alerts { border-top: none; }
.alert-card {
  border-left: 3px solid #d62728;
  background: #fff6f5;
  padding: 6px 8px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.35;
  border-radius: 0 3px 3px 0;
  cursor: pointer;
}
.alert-card.peak-med  { border-left-color: #c5a300; background: #fffdf2; }
.alert-card.peak-high { border-left-color: #ff8800; background: #fff7ed; }
.alert-card.peak-crit { border-left-color: #b21f1f; background: #ffece8; }
.alert-card.tier-jagung {
  border-left-color: #b21f1f; background: #fff;
  border: 2px solid #d62728; box-shadow: 0 1px 4px rgba(214,39,40,0.3);
  animation: pulse-jagung 2s infinite;
}
@keyframes pulse-jagung {
  0%, 100% { box-shadow: 0 1px 4px rgba(214,39,40,0.3); }
  50%      { box-shadow: 0 1px 8px rgba(214,39,40,0.7); }
}
.alert-card.tier-jagung .alert-title { color: #b21f1f; }

/* Jagung × Karhutla joint card */
.jagung-card {
  border-left: 4px solid #2ca02c;
  background: #f6fbf6;
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
  margin: 6px 0;
}
.jagung-card.alert-high { border-left-color: #ff8800; background: #fff7ed; }
.jagung-card.alert-crit { border-left-color: #b21f1f; background: #fff;
  border: 1px solid #d62728;
}
.jagung-headline { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.jagung-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px;
  font-size: 11px; line-height: 1.45;
}
.jagung-grid b { color: #1f2933; }
.jagung-grid .alert-level-monitoring { color: #2ca02c; font-weight: 700; }
.jagung-grid .alert-level-incident   { color: #c66100; font-weight: 700; }
.jagung-grid .alert-level-crisis     { color: #b21f1f; font-weight: 700; }
.alert-crit { background: #ffece8; color: #b21f1f; }
.alert-card .alert-title { font-weight: 600; color: #1f2933; font-size: 12px; }
.alert-card .alert-modals { display: inline-block; margin-left: 6px; font-size: 10px; color: #6b7280; }
.alert-card .alert-detail { font-size: 10px; color: #4a5568; margin-top: 2px; }
.alert-card[aria-expanded="true"] .alert-members { display: block; }
.alert-members { display: none; margin-top: 4px; padding-left: 10px; font-size: 10px; }
.alert-members li { padding: 1px 0; color: #4a5568; }

/* cross-modal today */
#cross-summary .cross-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
#cross-summary .cross-row-3 { grid-template-columns: 1fr 1fr 1fr; }
#cross-summary .cross-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.cross-card { background: #fff; border: 1px solid #e1e4e8; border-radius: 4px; padding: 4px 6px; }
.cross-label { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin-bottom: 2px; }
.cross-line { font-size: 10px; line-height: 1.3; }
.cross-line b { color: #1f2933; }

/* freight bar */
#detail-fr .bar { display: flex; gap: 1px; font-size: 10px; margin: 4px 0; }
#detail-fr .bar span { padding: 2px 4px; color: #fff; font-weight: 600; }
#detail-fr .bar span.w { background: #4a6fa5; }
#detail-fr .bar span.h { background: #c66100; }
#detail-fr .bar span.b { background: #b21f1f; }
#detail-fr .bar span.g { background: #6b7280; }
#detail-fr ul.blist, #detail-fr ul.polres { list-style: none; padding: 0; margin: 4px 0; font-size: 11px; }
#detail-fr ul.blist li { padding: 2px 0; border-bottom: 1px dashed #e6e9ed; }
#detail-fr ul.polres li { padding: 1px 0; color: #4a5568; }

/* river bar */
#detail-rv .bar { display: flex; gap: 1px; font-size: 10px; margin: 4px 0; }
#detail-rv .bar span { padding: 2px 4px; color: #fff; font-weight: 600; }
#detail-rv .bar span.w { background: #4a6fa5; }
#detail-rv .bar span.h { background: #b21f1f; }
#detail-rv .bar span.s { background: #6b7280; }
#detail-rv .bar span.t { background: #c66100; }
#detail-rv ul.hlist { list-style: none; padding: 0; margin: 4px 0; font-size: 11px; }
#detail-rv ul.hlist li { padding: 2px 0; border-bottom: 1px dashed #e6e9ed; }
#detail-rv ul.hlist li.off { color: #9aa1ab; font-style: italic; }

/* tab nav */
.tabs { display: flex; gap: 4px; border-top: 1px solid #e1e4e8; padding-top: 10px; }
.tab-btn { flex: 1; padding: 6px 8px; font-size: 12px; background: #eef0f3; border: 1px solid transparent; border-radius: 4px 4px 0 0; cursor: pointer; color: #4a5568; }
.tab-btn.active { background: #fff; border-color: #d3d8de; border-bottom-color: #fff; color: #1f2933; font-weight: 600; }

.legend { list-style: none; padding: 0; margin: 4px 0; font-size: 12px; }
.legend li { line-height: 20px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
table th, table td { padding: 3px 5px; text-align: left; border-bottom: 1px solid #eee; }
table th { color: #6b7280; font-weight: 500; }
tr.r-low td:last-child { color: #2ca02c; font-weight: 600; }
tr.r-med td:last-child { color: #c5a300; font-weight: 600; }
tr.r-high td:last-child { color: #c66100; font-weight: 600; }
tr.r-crit td:last-child { color: #b21f1f; font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f2f4f7; }

#detail-kh dl, #detail-pl dl { font-size: 12px; margin: 6px 0; display: grid; grid-template-columns: 110px 1fr; gap: 2px 8px; }
#detail-kh dt, #detail-pl dt { color: #6b7280; }
#detail-pl .spark { width: 100%; height: 48px; display: block; margin: 8px 0 4px; }
.drivers { font-size: 11px; padding-left: 16px; margin: 4px 0; }

ul.cal { list-style: none; padding: 0; margin: 0; font-size: 11px; }
ul.cal li { padding: 3px 0; border-bottom: 1px dashed #e6e9ed; line-height: 1.35; }
ul.cal li .when { color: #6b7280; }
ul.cal li .country { display: inline-block; font-size: 9px; padding: 0 4px; border-radius: 2px; background: #eef0f3; color: #4a5568; margin-left: 4px; }

footer.muted { margin-top: 16px; font-size: 10px; line-height: 1.5; }

/* karhutla symbology */
.hotspot-tip, .bmkg-tip { font-size: 11px; }
