/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #f0f2f5;
  color: #1a1a2e;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Experimental Banner ──────────────────────────────────────────── */
#exp-banner {
  background: #7c3a00;
  color: #ffe8c0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 20px;
  letter-spacing: 0.3px;
}

/* ── Header ───────────────────────────────────────────────────────── */
header {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fire-icon { font-size: 28px; }

h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.subtitle {
  font-size: 12px;
  color: #aab4c8;
  margin-top: 2px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-controls label {
  font-size: 12px;
  color: #aab4c8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#date-picker {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #3a3a5c;
  background: #2a2a4e;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  min-width: 160px;
}

#date-picker:focus { outline: none; border-color: #ff6b35; }

#refresh-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #3a3a5c;
  background: #2a2a4e;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

#refresh-btn:hover { background: #3a3a6e; }

/* ── Layout ───────────────────────────────────────────────────────── */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}

.card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 10px;
  padding: 14px;
}

.card h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7280;
  margin-bottom: 12px;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  background: #f8f9fc;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.stat.alert { background: #fff5f5; }

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.stat.alert .stat-value { color: #d73027; }

.stat-label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 3px;
}

/* Legend */
.legend { display: flex; flex-direction: column; gap: 8px; }

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

/* Model version */
.model-version {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e8ecf0;
  font-size: 11px;
  color: #9ca3af;
}

/* Detail table */
.detail-table { width: 100%; border-collapse: collapse; }

.detail-table tr td {
  padding: 5px 4px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}

.detail-table tr td:first-child {
  color: #6b7280;
  width: 45%;
}

.detail-table tr td:last-child {
  font-weight: 600;
  color: #1a1a2e;
}

/* ── Map ──────────────────────────────────────────────────────────── */
main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map { width: 100%; height: 100%; }

/* ── Loading overlay ──────────────────────────────────────────────── */
#loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 999;
  display: none;
}

#loading-overlay p {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #e5e7eb;
  border-top-color: #d73027;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#smk-map-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
}

smk-display smk-display-layer smk-visible smk-obscured {
    visibility: hidden;
}