:root {
  color-scheme: light;
  --page: #f3f6f4;
  --surface: #fff;
  --ink: #142924;
  --muted: #516761;
  --border: #d9e4df;
  --accent: #08765b;
  --dark: #103b32;
  --mint: #d7f3e8;
  --radius: 16px;
  --shadow: 0 2px 5px #102e2410;
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid #149a77; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.04; letter-spacing: -.052em; }
h2 { font-size: 1.12rem; line-height: 1.35; letter-spacing: -.018em; }
p + p { margin-top: .6rem; }
.shell { width: min(100% - 48px, 1320px); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -8rem; background: white; padding: .8rem; z-index: 2; }
.skip:focus { top: .8rem; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 2.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: 1.1rem; letter-spacing: -.035em; font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand-icon { width: 31px; height: 31px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 8px; border-radius: 8px; background: var(--dark); }
.brand-icon i { width: 3px; height: 7px; border-radius: 1px; background: #b5f3d6; }
.brand-icon i:nth-child(2) { height: 10px; }
.brand-icon i:nth-child(3) { height: 15px; }
.nav { display: flex; align-items: center; gap: .3rem; flex: 1; }
.nav a, .plain { color: var(--muted); padding: .55rem .75rem; border-radius: 8px; font-weight: 650; font-size: .91rem; text-decoration: none; white-space: nowrap; }
.nav a:hover, .plain:hover { color: var(--dark); background: var(--page); }
.nav a[aria-current="page"] { color: #085c48; background: #e6f4ed; }
.plain { border: 0; background: transparent; cursor: pointer; }
.main { padding-block: 2.7rem 3rem; min-height: calc(100vh - 135px); }
.footer { color: var(--muted); border-top: 1px solid var(--border); padding-block: 1rem 1.7rem; display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.6rem; }
.page-heading .muted { margin-top: .6rem; }
.eyebrow { color: var(--accent); margin-bottom: .6rem; font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted, .caption { color: var(--muted); }
.caption { margin-top: .55rem; font-size: .86rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 41px; border-radius: 9px; padding: .56rem .95rem; border: 1px solid transparent; text-decoration: none; font-size: .91rem; font-weight: 700; line-height: 1.3; cursor: pointer; white-space: nowrap; }
.button.primary { background: #087158; color: white; }
.button.primary:hover { background: #075541; }
.button.secondary { background: white; color: var(--ink); border-color: #cddbd4; }
.button.secondary:hover { background: #eaf5ef; border-color: #a3c9b6; }
.button.light { background: #dff7e9; color: #124537; }
.button.light:hover { background: #c4eed8; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.padded { padding: 1.35rem; }
.padded > h2 + p { margin-top: .35rem; }
.padded > p + .button { margin-top: .9rem; }
.main > .panel + .panel { margin-top: 1.05rem; }
.hero, .login-brand { color: #f3fff9; background: radial-gradient(ellipse at 100% 0%, #1b6854, transparent 70%), #11382f; border-radius: var(--radius); }
.hero .eyebrow, .login-brand .eyebrow { color: #b6ead4; }
.hero p, .login-brand p { color: #d3e7dd; }
.empty-hero { padding: clamp(1.5rem, 5vw, 4.5rem); min-height: 280px; }
.empty-hero h2 { font-size: clamp(1.7rem, 3.7vw, 2.8rem); max-width: 22ch; letter-spacing: -.045em; }
.empty-hero p + .button, .empty-hero h2 + p { margin-top: .8rem; }
.notice { margin: 0 0 1.05rem; padding: .78rem 1rem; border: 1px solid #cbded5; border-radius: 10px; background: #eaf4ef; }
.position-grid { margin-top: 1.05rem; }
.chart-grid + .notice { margin-top: 1.05rem; }
.notice.warning, .badge.warning { background: #fff2d9; border-color: #e8ce9c; color: #694800; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .85rem; padding: 1rem; margin-bottom: 1.05rem; }
.filter-bar > div { flex: 1 1 125px; min-width: 0; }
.filter-bar > .field { flex-basis: 190px; }
.filter-bar .errorlist.nonfield { flex: 1 0 100%; }
.filter-bar.history-form { padding: 0; margin: 1rem 0 .55rem; }
label { display: block; margin-bottom: .28rem; color: var(--ink); font-size: .85rem; font-weight: 700; }
input:not([type="checkbox"]):not([type="hidden"]), select {
  width: 100%; min-width: 0; min-height: 41px; border: 1px solid #cbdad2; border-radius: 8px; color: var(--ink); background: #fcfefd; padding: .48rem .65rem;
}
input[type="checkbox"] { margin: 0 .45rem 0 0; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); vertical-align: text-bottom; }
label:has(input[type="checkbox"]) { min-height: 2.6rem; display: flex; align-items: center; margin: 0; }
.helptext { color: var(--muted); font-size: .85rem; margin-top: .28rem; }
.errorlist { color: #9b3321; margin: 0 0 .3rem; padding: 0; list-style: none; font-size: .87rem; }
.metrics { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1rem; margin: 1.05rem 0; }
.metric { padding: 1.3rem; }
.metric h2 { font-size: .86rem; font-weight: 700; }
.metric p:not(.value) { font-size: .86rem; color: var(--muted); }
.metric.hero p { color: #d3e7dd; }
.metric .value { color: var(--ink); font-weight: 750; font-size: clamp(1.75rem, 3vw, 2.65rem); line-height: 1.1; letter-spacing: -.048em; margin-block: .52rem .45rem; overflow-wrap: anywhere; }
.metric .value.compact { font-size: clamp(1.65rem, 2.8vw, 2.28rem); }
.metric.hero .value { color: white; }
.value small { font-size: .45em; font-weight: 600; letter-spacing: .02em; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; }
.panel-title { padding: 1.05rem 1.18rem; display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.panel-title p { color: var(--muted); font-size: .88rem; margin-top: .25rem; }
.badge { display: inline-block; background: #eaf1ee; border: 1px solid transparent; border-radius: 99px; color: #37534b; padding: .16rem .6rem; font-size: .75rem; font-weight: 740; line-height: 1.4; white-space: nowrap; }
.badge.positive { background: #dcf4e8; color: #075d44; }
.chart-box { position: relative; height: 245px; margin: 0 .8rem; }
.chart-panel > .caption { margin: .55rem 1.18rem; }
.chart-data { margin: .7rem 1.18rem 1.15rem; font-size: .86rem; }
summary { color: var(--accent); cursor: pointer; font-weight: 640; }
.chart-data .table-scroll { max-height: 300px; }
.empty { padding: 1.2rem; color: var(--muted); }
.chart-panel > .empty { margin: 0 1.15rem 1.15rem; border: 1px dashed #c9d9d0; border-radius: 10px; min-height: 165px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .91rem; }
th, td { padding: .7rem 1rem; border-top: 1px solid #e5ede8; vertical-align: top; }
thead th { font-size: .75rem; color: var(--muted); font-weight: 750; background: #f7faf8; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.subtle { color: var(--muted); font-weight: 400; font-size: .81rem; }
.pagination { display: flex; justify-content: center; gap: 1rem; padding: .8rem; border-top: 1px solid #e5ede8; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.section-heading, .actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .65rem; }
.actions { justify-content: start; }
.stack { display: grid; gap: 1rem; margin-top: 1rem; }
.guide ol { padding-left: 1.25rem; color: var(--muted); }
.guide li + li { margin-top: .55rem; }
.guide strong { color: var(--ink); }
.coverage { margin-top: .42rem; }
.coverage dl { margin: .4rem 0; font-size: .8rem; }
.coverage dl div { display: flex; justify-content: space-between; gap: .6rem; border-bottom: 1px solid #eef3f0; }
.coverage dd { margin: 0; color: var(--muted); text-align: right; }
progress { display: block; width: calc(100% - 2.4rem); margin: 0 1.2rem .9rem; accent-color: var(--accent); }
.login-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.1rem; max-width: 1000px; margin: 2.6rem auto; }
.login-brand { padding: clamp(1.6rem, 5vw, 3.7rem); min-height: 340px; display: flex; flex-direction: column; justify-content: center; }
.login-brand h1 { font-size: clamp(2rem, 4.2vw, 3.5rem); }
.login-brand h1 + p { margin-top: 1rem; max-width: 35ch; }
.login-panel { padding: clamp(1.4rem, 4vw, 2.7rem); align-content: center; }
.login-panel h2 { font-size: 1.5rem; }
.login-panel p { margin-top: .3rem; }

@media (max-width: 850px) {
  .topbar-inner { gap: .8rem; justify-content: space-between; flex-wrap: wrap; padding-top: .7rem; }
  .nav { order: 3; flex: 1 0 100%; padding-bottom: .6rem; flex-wrap: wrap; }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); }
  .main { padding-top: 1.8rem; }
  .nav { gap: .05rem; }
  .nav a { padding-inline: .47rem; font-size: .82rem; }
  .page-heading { flex-direction: column; align-items: start; }
  .metrics, .split, .login-layout { grid-template-columns: 1fr; gap: .75rem; }
  .metric, .padded { padding: 1rem; }
  .login-layout { margin-top: .4rem; }
  .login-brand { min-height: 220px; }
  .chart-box { height: 225px; }
  .filter-bar { gap: .65rem; }
  .filter-bar > .field { flex-basis: 100%; }
}
