:root {
  --bg: #f4f6fb;
  --bg-grad: #eef2fb;
  --panel: #ffffff;
  --elev: #f7f9fc;
  --line: #e3e8f0;
  --line-strong: #d2dae6;
  --text: #1b2430;
  --muted: #687385;
  --faint: #97a1b2;
  --accent: #2f6bff;
  --accent-soft: #e7eeff;
  --good: #16a34a;
  --bad: #dc2626;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20,30,50,.04), 0 8px 24px rgba(20,30,50,.06);
  --max: 920px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 50% -8%, var(--bg-grad) 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main { max-width: var(--max); margin: 0 auto; padding: 26px 20px 64px; }

.masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 18px; margin-bottom: 24px;
}
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.brand span { vertical-align: middle; }
.date { color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }

/* Panels */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.05rem; margin: 0 0 16px; letter-spacing: -.01em; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.chart-caption { color: var(--faint); font-size: .82rem; }

/* Hero */
.hero {
  display: flex; gap: 30px; align-items: center; flex-wrap: wrap;
  background:
    radial-gradient(420px 200px at 12% 0%, var(--accent-soft) 0%, transparent 70%),
    var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.gauge { position: relative; width: 168px; height: 168px; flex: 0 0 auto; }
.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--line-strong); stroke-width: 11; }
.gauge-fill {
  fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1), stroke .6s ease;
}
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score { font-size: 3.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score-of { color: var(--faint); font-size: .85rem; margin-top: 2px; }

.hero-text { flex: 1 1 280px; min-width: 240px; }
.emoji { font-size: 2.3rem; line-height: 1; }
.label { font-size: 2rem; margin: 6px 0 6px; font-weight: 800; letter-spacing: -.02em; }
.delta { color: var(--muted); font-size: .95rem; min-height: 1.2em; font-weight: 600; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* Charts (shared) */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; touch-action: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font-size: 12px; }
.chart .area { fill: url(#chartGrad); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.chart .hot { fill: transparent; cursor: pointer; }
.chart .cursor { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .marker { fill: var(--accent); }

.chart-tip {
  position: absolute; transform: translate(-50%, -120%); pointer-events: none;
  background: var(--text); color: #fff; padding: 6px 9px; border-radius: 8px;
  font-size: .78rem; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.18);
  z-index: 3;
}
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-tip .tip-date { color: #c9d2e3; display: block; font-size: .72rem; }

/* Dimensions */
.dimensions { display: grid; gap: 14px; }
.dim { display: grid; grid-template-columns: 132px 1fr 38px; align-items: center; gap: 12px; }
.dim-name { color: var(--muted); font-size: .9rem; }
.dim-bar { height: 9px; background: var(--elev); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.dim-bar > i { display: block; height: 100%; border-radius: 99px; width: 0; transition: width 1s ease; }
.dim-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .95rem; }

/* Regions */
.regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 12px; }
.region {
  background: var(--elev); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 14px 13px; position: relative; overflow: hidden;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.region:hover, .region:focus-visible {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: var(--line-strong); outline: none;
}
.region::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--region);
}
.region-name { font-size: .8rem; color: var(--muted); }
.region-val { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.region-cta { font-size: .72rem; color: var(--accent); margin-top: 4px; font-weight: 600; opacity: 0; transition: opacity .12s ease; }
.region:hover .region-cta, .region:focus-visible .region-cta { opacity: 1; }

/* Summary */
.summary { color: #36414f; }
.summary p { margin: 0 0 12px; }
.summary p:last-child { margin-bottom: 0; }

/* Drivers */
.drivers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.driver {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  padding: 12px 14px; background: var(--elev); border: 1px solid var(--line); border-radius: 12px;
}
.driver .arrow { font-size: 1.05rem; line-height: 1.45; font-weight: 700; }
.driver.up .arrow { color: var(--good); }
.driver.down .arrow { color: var(--bad); }
.driver a { color: var(--text); text-decoration: none; font-weight: 600; }
.driver a:hover { text-decoration: underline; color: var(--accent); }
.driver .meta { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.tag {
  display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .4px;
  background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 99px; margin-left: 6px;
}

/* Footer */
.footer { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 20px; }
.sources { color: var(--muted); font-size: .82rem; margin-bottom: 12px; }
.sources b { color: var(--text); font-weight: 700; }
.disclaimer { color: var(--muted); font-size: .82rem; }
.disclaimer a { color: var(--accent); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22,30,45,.45); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px;
  z-index: 50; overflow-y: auto; animation: fade .15s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(20,30,50,.28); width: 100%; max-width: 680px;
  padding: 26px 26px 24px; position: relative; animation: pop .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal-close {
  position: absolute; top: 14px; right: 14px; border: none; background: var(--elev);
  width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; line-height: 1; color: var(--muted);
  cursor: pointer; transition: background .12s ease;
}
.modal-close:hover { background: var(--line); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.modal-eyebrow { color: var(--accent); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.modal-title { margin: 2px 0 0; font-size: 1.5rem; letter-spacing: -.02em; }
.modal-score { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.modal-legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; margin: 4px 0 18px; }
.modal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.modal-legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.modal-subhead { font-size: 1rem; margin: 4px 0 12px; }
.modal .drivers .driver { background: var(--panel); }

@media (max-width: 560px) {
  .dim { grid-template-columns: 100px 1fr 34px; }
  .label { font-size: 1.6rem; }
  .hero { padding: 24px; }
  .modal { padding: 22px 18px; }
  .modal-title { font-size: 1.3rem; }
}
