:root {
  --bg: #edf4fb;
  --ink: #13233a;
  --muted: #5c6c82;
  --panel: rgba(255, 255, 255, 0.94);
  --border: rgba(19, 35, 58, 0.08);
  --shadow: 0 24px 60px rgba(33, 63, 108, 0.14);
  --blue: #2a67f6;
}

body.health-dashboard-page {
  background:
    radial-gradient(
      circle at top left,
      rgba(42, 103, 246, 0.12),
      transparent 28%
    ),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 100%);
  color: var(--ink);
}

.glass-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(240px, 270px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.ranking-column {
  position: sticky;
  top: 7rem;
  align-self: start;
  max-height: calc(100vh - 8rem);
  overflow: auto;
  padding-right: 0.25rem;
}

.map-panel,
.detail-panel,
.info-panel {
  border-radius: 2rem;
}

.map-shell {
  position: relative;
  border-radius: 1.75rem;
}

.map-titlebar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}

.map-title {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 900;
  color: #1f4fd6;
}

.map-timestamp {
  font-size: 0.95rem;
  font-weight: 700;
  color: #344861;
  text-align: right;
}

.map-frame {
  min-height: 900px;
}

.ranking-item + .ranking-item {
  border-top: 1px solid rgba(19, 35, 58, 0.08);
}

.ranking-item {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.detail-card {
  position: absolute;
  right: 2rem;
  top: 7rem;
  width: min(680px, calc(100% - 4rem));
  max-height: calc(100% - 9rem);
  overflow: auto;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(19, 35, 58, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #4b5b71;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.95fr);
  gap: 1rem;
  align-items: stretch;
}

.detail-top > * {
  min-width: 0;
}

.meter-card,
.side-metric {
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(245, 248, 253, 0.9);
  border: 1px solid rgba(19, 35, 58, 0.08);
}

.meter-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.meter-shell {
  position: relative;
  width: 220px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meter-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(
    --meter-gradient,
    conic-gradient(
      from 180deg,
      transparent 0deg 90deg,
      #49b86e 90deg 126deg,
      #f0da74 126deg 162deg,
      #f4b942 162deg 198deg,
      #d74b3f 198deg 234deg,
      #7e54c7 234deg 270deg,
      transparent 270deg 360deg
    )
  );
  box-shadow: inset 0 0 0 1px rgba(19, 35, 58, 0.05);
}

.meter-ring::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(19, 35, 58, 0.06);
}

.meter-pointer {
  position: absolute;
  left: 50%;
  bottom: 78px;
  width: 4px;
  height: 64px;
  margin-left: -2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #24415f 0%, #13233a 100%);
  box-shadow: 0 6px 18px rgba(19, 35, 58, 0.18);
  transform: rotate(var(--meter-angle, -90deg));
  transform-origin: center calc(100% - 8px);
}

.meter-pointer::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--meter-color, #49b86e);
  box-shadow: 0 8px 16px rgba(19, 35, 58, 0.16);
}

.meter-pivot {
  position: absolute;
  left: 50%;
  bottom: 72px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #13233a;
  box-shadow: 0 4px 12px rgba(19, 35, 58, 0.16);
}

.meter-center {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 5.9rem;
}

.meter-kicker,
.side-metric-label,
.advice-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.meter-kicker,
.side-metric-label {
  color: #6b7a8f;
}

.meter-value {
  margin-top: 0.35rem;
  font-size: 3.4rem;
  line-height: 1;
  font-weight: 900;
  color: #13233a;
}

.meter-caption {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #344861;
}

.side-metrics {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}

.side-metric {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.side-metric-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.side-metric-value {
  font-size: 2.35rem;
  line-height: 1;
  font-weight: 900;
  color: #13233a;
}

.side-metric-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #52647b;
  min-width: 0;
}

.pollutant-line {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  max-width: 100%;
}

.advice-grid {
  display: grid;
  gap: 0.85rem;
}

.advice-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(245, 248, 253, 0.82);
  border: 1px solid rgba(19, 35, 58, 0.08);
}

.advice-label {
  font-weight: 800;
  color: #2a67f6;
}

.advice-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #344861;
}

.article-copy p {
  text-indent: 4ch;
  line-height: 1.75;
}

.article-copy h3 {
  margin-top: 2.5rem;
}

.risk-level-column {
  min-width: 140px;
}

.info-panel table {
  width: 100%;
  max-width: 42rem;
  margin: 1rem auto;
  border-collapse: collapse;
}

.info-panel th,
.info-panel td {
  border: 1px solid #d1d5db;
  padding: 0.5rem;
  text-align: left;
}

.info-panel thead tr {
  background: #f3f4f6;
}

@media (max-width: 1024px) {
  .map-frame {
    min-height: 720px;
  }

  .page-layout {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
    gap: 1rem;
  }

  .ranking-column {
    top: 6rem;
    max-height: none;
  }

  .detail-card {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 1rem;
  }

  .detail-top {
    grid-template-columns: 1fr;
  }

  .meter-shell {
    width: 200px;
    height: 155px;
  }

  .meter-value {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .ranking-column {
    position: static;
    overflow: visible;
    max-height: none;
    padding-right: 0;
  }

  .map-titlebar {
    position: static;
    padding: 1rem 1rem 0;
    pointer-events: auto;
  }

  .map-frame {
    min-height: 560px;
  }

  .map-title {
    font-size: 1.5rem;
  }

  .advice-row {
    grid-template-columns: 1fr;
  }
}
