:root {
  --bg: #faf9f6;
  --card-bg: #ffffff;
  --border: #e8e0d0;
  --text: #2c2416;
  --text-muted: #8a7a60;
  --accent: #c07a1a;
  --accent-light: #f5e8d0;
  --blue: #2a7abf;
  --green: #3a8a3a;
  --red: #b83030;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { background: var(--bg); color: var(--text); min-height: 100vh; }

header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 24px 20px 20px;
}
.header-inner { max-width: 860px; margin: 0 auto; }
header h1 { font-size: 2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.icon { font-size: 1.8rem; }
header .subtitle { color: var(--text-muted); margin-top: 6px; font-size: 0.95rem; line-height: 1.5; }

main { max-width: 860px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.tab-bar { display: flex; gap: 8px; }
.tab {
  padding: 8px 24px; border-radius: 24px; border: 2px solid var(--border);
  background: var(--card-bg); color: var(--text-muted); font-size: 1rem;
  cursor: pointer; font-weight: 600; transition: all .15s;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.2rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px; color: var(--text);
}
.icon-small { font-size: 1.1rem; }

/* Situation */
.situation { background: var(--accent-light); border-color: #d9b87a; }
.situation-text { font-size: 1rem; line-height: 1.6; color: var(--text); }

/* Stats */
.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.stat { text-align: center; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-value.blue { color: var(--blue); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-unit { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.stat-normal { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.trend { font-size: 2.5rem; }

/* Charts */
.chart-wrap { position: relative; height: 200px; margin-bottom: 16px; }

/* Info box */
.info-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
  font-size: 0.85rem; line-height: 1.7; color: var(--text-muted);
}
.info-box strong { color: var(--text); }

/* Map */
.map-desc { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 12px; }
#map { height: 380px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }

/* Tips */
.tips h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.tips ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tips li { padding-left: 20px; position: relative; font-size: 0.92rem; color: var(--text-muted); line-height: 1.5; }
.tips li::before { content: "•"; position: absolute; left: 6px; color: var(--accent); }

footer {
  text-align: center; padding: 20px;
  font-size: 0.8rem; color: var(--text-muted);
  border-top: 1px solid var(--border); margin-top: 8px;
}
footer a { color: var(--text-muted); }

/* Loader */
.loading { opacity: .5; }
.skeleton { background: linear-gradient(90deg, #f0e8d8 25%, #e8dcc8 50%, #f0e8d8 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; height: 1em; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

@media (max-width: 600px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-row .stat:last-child { grid-column: span 2; }
  .stat-value { font-size: 1.6rem; }
}

.map-fetched {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.map-legend {
  background: white;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #e8e0d0);
  font-size: 0.82rem;
  line-height: 1.6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.stat-value.accent-color { color: var(--accent); }

/* Om datan */
.om-datan details summary {
  cursor: pointer;
  padding: 4px 0;
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.om-datan details summary::-webkit-details-marker { display: none; }
.om-datan details[open] summary { margin-bottom: 16px; }
.om-datan-content { display: flex; flex-direction: column; gap: 12px; font-size: 0.88rem; line-height: 1.6; color: var(--text-muted); }
.om-datan-content h4 { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-top: 4px; }
.om-datan-content p, .om-datan-content li { color: var(--text-muted); }
.om-datan-content a { color: var(--accent); }
.om-datan-content ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.om-datan-content .note { font-size: 0.8rem; font-style: italic; }
.status-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.status-table th, .status-table td { padding: 5px 10px; border: 1px solid var(--border); text-align: left; }
.status-table th { background: var(--bg); font-weight: 600; color: var(--text); }
.s-red    { color: #b83030; font-weight: 600; }
.s-orange { color: #c07a1a; font-weight: 600; }
.s-green  { color: #3a8a3a; font-weight: 600; }
.s-blue   { color: #2a7abf; font-weight: 600; }
.s-dblue  { color: #1a5a8f; font-weight: 600; }

/* Situation card */
.situation-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; color: var(--text); border: none; }
.situation-text { font-size: 0.95rem; line-height: 1.6; color: var(--text); margin-bottom: 18px; }

/* Health bar */
.health-bar-wrap { margin-bottom: 18px; }
.health-bar-labels { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 5px; }
.health-bar-bg { height: 10px; background: #e0d8c8; border-radius: 10px; overflow: hidden; }
.health-bar-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #b83030 0%, #c07a1a 25%, #3a8a3a 60%, #2a7abf 100%); transition: width .6s ease; }

/* Situation stats row */
.situation-stats { display: flex; gap: 24px; border-top: 1px solid var(--border); padding-top: 14px; }
.sstat { text-align: left; }
.sstat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.sstat-value { font-size: 1.1rem; font-weight: 700; color: var(--text); }
