/* @exports: CSS classes used by index.html/app.js: skip, top, brand, mark, tagline, lang, tabs, error, card, site-pick, step, how, field, big, primary, secondary, row, hint, muted, strong, headline, map, bars, bar-row, bar-label, bar-track, bar-fill, fill-clear|cloudy|muddy, bar-value, class-buttons, class-btn, verdict-*, table-wrap, rel-grid, rel (svg), flag, swatch, foot* */
/* @imports: Google Fonts Libre Franklin + Public Sans + IBM Plex Mono (optional; system fonts are the fallback) */
/* @env: (none) */
/* @schema: Light theme only. Design basis: EN 301 549 / WCAG 2.2 AA (text contrast >= 4.5:1, targets >= 48px, visible two-tone focus, reflow at 320px, reduced motion, forced colours), mobile bottom tab bar with safe-area insets. */
/* @schema: Palette: EU blue brand, pale water-blue ground. Only the water classes (--clear, --cloudy, --muddy) and --signal carry data meaning. */
:root {
  color-scheme: light;
  --band: #004494; --band-dark: #00306b; --yellow: #ffd617;
  --accent: #004494; --accent-strong: #00306b; --on-accent: #f4f7f8; --accent-hover: #00306b;
  --ground: #d3dfe5; --panel: #eef2f1; --field: #f5f7f5; --tint: #dfeaef;
  --ink: #0e1e2c; --ink-2: #435667; --rule: #bccbd3; --rule-strong: #7f97a9;
  --clear: #3f93bf; --cloudy: #c7a63c; --muddy: #7a4b2a; --signal: #d4401a;
  --ok-bg: #e1f0e3; --ok-line: #2f7a43; --warn-bg: #fbf0c8; --warn-line: #9a7208; --danger-bg: #fbe3dd; --danger-text: #8a1c0a;
  --foot-bg: #00306b;
  --tile-filter: grayscale(0.7) contrast(0.95) brightness(0.96);
  --strata: linear-gradient(90deg, #3f93bf 0 33.34%, #c7a63c 33.34% 66.67%, #7a4b2a 66.67% 100%);
  --head: "Libre Franklin", system-ui, "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", system-ui, "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow: 0 0 0 1px rgba(14,30,44,0.06), 0 12px 28px -18px rgba(14,30,44,0.4);
  --r: 12px; --r-sm: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--head); font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0.5rem 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--yellow); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: #0e1e2c; padding: 0.75rem 1rem; z-index: 3000; font-weight: 700; }
.skip:focus { left: 0; }

/* ---------- top bar ---------- */
.top { background: var(--band); color: #f4f7f8; padding: 0 max(1.25rem, calc((100% - 1160px) / 2)); display: grid; grid-template-columns: auto 1fr auto; column-gap: 2rem; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.25); }
.brand { grid-column: 1; display: flex; gap: 0.7rem; align-items: center; padding: 0.7rem 0; }
.mark { width: 26px; height: 26px; flex: none; }
.brand h1 { margin: 0; font-size: 1.3rem; line-height: 1; color: #f4f7f8; }
.tabs { grid-column: 2; grid-row: 1; display: flex; align-self: stretch; gap: 0.25rem; }
.tabs button { min-height: 60px; padding: 0 1.1rem; border: 0; border-bottom: 4px solid transparent; margin-bottom: -4px; background: transparent; color: rgba(255,255,255,0.85); font: 600 0.98rem var(--head); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: #f4f7f8; background: rgba(255,255,255,0.1); }
.tabs button[aria-selected="true"] { color: #f4f7f8; border-bottom-color: var(--yellow); }
.lang { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.lang label { color: rgba(255,255,255,0.85); font-weight: 600; }
.lang select { width: auto; min-height: 44px; padding: 0 0.6rem; background: rgba(255,255,255,0.1); color: #f4f7f8; border: 1px solid rgba(255,255,255,0.5); border-radius: 8px; font-size: 0.9rem; font-weight: 600; }
.lang option { color: #0e1e2c; background: #f5f7f5; }
.top :focus-visible { outline-color: #f4f7f8; box-shadow: 0 0 0 6px var(--band-dark); }

main { max-width: 1160px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }

/* ---------- panels ---------- */
.card { margin: 0 0 1.5rem; padding: 1.6rem; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); }
.card h2 { margin: 0 0 0.75rem; font-size: 1.3rem; line-height: 1.2; color: var(--accent-strong); }
p.what { margin: 0 0 1rem; max-width: 64ch; font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); }
p.read { margin: 0 0 1rem; padding: 0.7rem 0.9rem; font-size: 0.88rem; line-height: 1.5; color: var(--ink-2); background: var(--tint); border-left: 4px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
p.read strong { color: var(--accent-strong); }
.hint, .muted { color: var(--ink-2); }
.hint { font-size: 0.92rem; margin: 0 0 0.6rem; }
.strong { font-weight: 700; }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
label { font: 700 0.85rem var(--head); color: var(--ink); }
input, select { width: 100%; min-height: 52px; padding: 0 0.9rem; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--rule-strong); border-radius: var(--r-sm); }
select { cursor: pointer; }
input:hover, select:hover { border-color: var(--accent); }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0.75rem 0; }
button.big { min-height: 52px; padding: 0 1.5rem; font: 700 0.98rem var(--head); border-radius: var(--r-sm); border: 2px solid var(--accent); cursor: pointer; transition: background-color 0.15s, color 0.15s, transform 0.1s; }
button.big:active:not(:disabled) { transform: scale(0.985); }
button.big:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--on-accent); }
button.secondary { background: transparent; color: var(--accent); }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.secondary:hover:not(:disabled) { background: var(--tint); }

/* ---------- report: intro, location, steps ---------- */
#panel-citizen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; align-items: start; }
#panel-citizen > .card { margin: 0 0 1.5rem; }
.how { grid-column: 1 / -1; margin: 0 0 2rem; }
.tagline { margin: 0 0 1.5rem; max-width: 24ch; text-wrap: balance; font: 700 clamp(1.9rem, 4.2vw, 3rem)/1.08 var(--head); letter-spacing: -0.03em; color: var(--ink); }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; counter-reset: s; }
.how li { counter-increment: s; display: grid; gap: 0.3rem; padding-top: 0.9rem; border-top: 2px solid var(--accent); font-size: 0.95rem; color: var(--ink-2); line-height: 1.5; }
.how li strong { font: 700 1.05rem var(--head); color: var(--ink); }
.how li strong::before { content: counter(s); display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-right: 0.6rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 0.82rem var(--head); }

.site-pick { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 2rem; align-content: start; }
.site-pick > h2 { grid-column: 1 / -1; font-size: 1.6rem; }
.site-pick > :not(h2):not(.map) { grid-column: 1; }
.site-pick > .map { grid-column: 2; grid-row: 2 / span 7; margin: 0; height: 100%; min-height: 420px; }
#gps-btn { width: 100%; }
#loc-selected { margin: 0.9rem 0 0; font: 700 1.05rem var(--head); }
#loc-selected:not(:empty) { padding: 0.6rem 0.85rem; background: var(--tint); border-left: 5px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
#sites-status { margin: 0.4rem 0 0; font: 400 0.78rem var(--mono); }
.step { height: 100%; }
#saved-section { grid-column: 1 / -1; height: auto; }

/* ---------- expectation ---------- */
.headline { font: 700 1.6rem/1.18 var(--head); letter-spacing: -0.02em; margin: 0 0 1.1rem; color: var(--ink); }
.bars { display: grid; gap: 0.7rem; margin-bottom: 1rem; }
.bar-row { display: grid; grid-template-columns: 4.5rem 1fr 3.2rem; gap: 0.7rem; align-items: center; }
.bar-label { font: 700 0.9rem var(--head); text-transform: capitalize; }
.bar-track { height: 1.1rem; background: var(--tint); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.fill-clear { background: var(--clear); } .fill-cloudy { background: var(--cloudy); } .fill-muddy { background: var(--muddy); }
.bar-value { text-align: right; font: 500 0.9rem var(--mono); font-variant-numeric: tabular-nums; }
#expect-rain { font-size: 0.95rem; margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--rule); }
#expect-support { font-size: 0.86rem; }

/* ---------- observation ---------- */
.class-buttons { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.class-btn { --w: var(--rule); display: grid; align-content: start; gap: 0.1rem; padding: 0 0 0.85rem; text-align: left; font: inherit; color: var(--ink); background: var(--field); border: 2px solid var(--rule); border-radius: var(--r); cursor: pointer; overflow: hidden; transition: border-color 0.15s, transform 0.1s; }
.class-btn::before { content: ""; height: 4.4rem; margin-bottom: 0.6rem; background: var(--w); }
.class-btn[data-class="clear"] { --w: var(--clear); } .class-btn[data-class="cloudy"] { --w: var(--cloudy); } .class-btn[data-class="muddy"] { --w: var(--muddy); }
.class-btn:hover:not(:disabled) { border-color: var(--accent); }
.class-btn:active:not(:disabled) { transform: scale(0.985); }
.class-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.class-btn strong { font: 700 1.08rem var(--head); text-transform: capitalize; padding: 0 0.8rem; }
.class-btn small { color: var(--ink-2); font-size: 0.85rem; line-height: 1.4; padding: 0 0.8rem; }

/* ---------- verdict / saved ---------- */
.verdict-box { padding: 0.9rem 1.1rem; margin-bottom: 0.6rem; background: var(--field); border: 1px solid var(--rule-strong); border-left: 6px solid var(--accent); border-radius: var(--r-sm); }
.verdict-box p { margin: 0.2rem 0; }
.verdict-consistent { background: var(--ok-bg); border-color: var(--ok-line); }
.verdict-surprise { background: var(--warn-bg); border-color: var(--warn-line); }
.verdict-plausible { border-left-color: var(--accent); }
#change-options { margin-top: 0.6rem; }
#saved-text { font: 500 0.92rem var(--mono); padding: 0.7rem 0.9rem; background: var(--tint); border-left: 5px solid var(--ok-line); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
#validator-result { margin: 0.6rem 0; }

.error { max-width: 1160px; margin: 1rem auto 0; padding: 0.85rem 1.1rem; background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-text); border-left-width: 6px; border-radius: var(--r-sm); display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.error p { margin: 0; overflow-wrap: anywhere; }
.error button { min-height: 48px; padding: 0 1rem; font: 700 0.9rem var(--head); cursor: pointer; background: transparent; color: inherit; border: 2px solid currentColor; border-radius: 8px; }

/* ---------- maps ---------- */
.map { height: 420px; margin: 0.75rem 0; border-radius: var(--r); background: var(--tint); overflow: hidden; box-shadow: 0 0 0 1px var(--rule-strong); }
#panel-watchlist .map { height: 480px; }
.leaflet-tile-pane { filter: var(--tile-filter); }
.leaflet-container { font-family: var(--body); }
.leaflet-bar { border-radius: 8px !important; box-shadow: none !important; border: 1px solid var(--rule-strong) !important; overflow: hidden; }
.leaflet-bar a { background: var(--field); color: var(--ink); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }
.leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-popup-content { margin: 0.6rem 0.8rem; font-size: 0.9rem; }

/* ---------- watchlist / proof ---------- */
#panel-watchlist > .card:first-child h2, #panel-proof > .card:first-child h2 { font-size: 1.9rem; line-height: 1.12; color: var(--ink); }
#panel-watchlist > .card:first-child > p, #panel-proof > .card:first-child > p[data-i18n] { max-width: 62ch; }
#watch-meta, #watch-status { font: 400 0.8rem var(--mono); margin: 0.4rem 0 0; }
#recheck-list ul { margin: 0.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
#recheck-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
#recheck-list li::before { content: ""; display: inline-block; width: 0.65rem; height: 0.65rem; margin-right: 0.6rem; background: var(--signal); border-radius: 50%; }
#proof-summary { padding: 0.8rem 1rem; margin: 1rem 0; background: var(--tint); border-left: 6px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
#proof-extra { margin-top: 1rem; }

.table-wrap { overflow-x: auto; border-radius: var(--r-sm); background: var(--field); box-shadow: 0 0 0 1px var(--rule); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.93rem; }
caption { text-align: left; font: 700 0.95rem var(--head); padding: 0.75rem 0.9rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font: 700 0.72rem var(--head); text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent-strong); background: var(--tint); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--tint); }
td.num, th.num { white-space: nowrap; text-align: right; font: 500 0.87rem var(--mono); font-variant-numeric: tabular-nums; }
.flag { font-weight: 700; color: var(--signal); }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.45rem; vertical-align: middle; border-radius: 50%; }

.rel-grid { display: grid; gap: 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0.75rem 0 1rem; }
svg.rel { display: block; width: 100%; height: auto; max-width: 440px; margin: 0 auto; }
svg.rel text { fill: var(--ink-2); font: 11px var(--mono); }
svg.rel .axis { stroke: var(--rule-strong); stroke-width: 1; fill: var(--field); }
svg.rel .diag { stroke: var(--ink-2); stroke-dasharray: 4 4; fill: none; }
svg.rel .curve { stroke: var(--accent); stroke-width: 2; fill: none; }
svg.rel circle { fill: var(--clear); fill-opacity: 0.8; stroke: var(--accent-strong); stroke-width: 1; }
figure { margin: 0; }
figcaption { font: 700 0.9rem var(--head); text-align: center; }

pre { overflow-x: auto; background: var(--field); border-radius: var(--r-sm); box-shadow: 0 0 0 1px var(--rule); padding: 0.75rem 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; font: 0.82rem var(--mono); }
code { background: var(--tint); padding: 0.1rem 0.3rem; border-radius: 4px; overflow-wrap: anywhere; font: 0.88em var(--mono); }
pre code { padding: 0; background: transparent; }
details summary { cursor: pointer; font: 700 1.1rem var(--head); color: var(--accent-strong); min-height: 52px; display: flex; align-items: center; }
#proof-limits { padding-left: 1.2rem; max-width: 70ch; }
#proof-limits li { margin-bottom: 0.5rem; }
#replay-out { margin-top: 1rem; max-width: 560px; }

/* ---------- footer ---------- */
.foot { background: var(--foot-bg); color: rgba(255,255,255,0.8); padding: 2.25rem max(1.25rem, calc((100% - 1160px) / 2)) 2rem; border-top: 4px solid; border-image: var(--strata) 1; font-size: 0.88rem; }
.foot-built { margin: 0 0 1.5rem; font: 700 1.2rem/1.25 var(--head); color: #f4f7f8; letter-spacing: -0.01em; }
.foot h2 { margin: 0 0 0.6rem; font: 700 0.7rem var(--head); text-transform: uppercase; letter-spacing: 0.1em; color: var(--yellow); }
.foot-partners { list-style: none; margin: 0 0 1.75rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.foot-partners li { padding: 0.4rem 0.8rem; border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; color: #f4f7f8; font-weight: 600; font-size: 0.85rem; }
.foot-data { list-style: none; margin: 0 0 1.75rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; font-size: 0.85rem; }
.foot-data strong { color: #f4f7f8; }
.foot-eu { display: flex; gap: 1rem; align-items: flex-start; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.18); }
.foot-eu svg { width: 54px; height: 36px; flex: none; }
.foot-eu p { margin: 0; max-width: 78ch; font-size: 0.78rem; line-height: 1.5; }
.foot-eu p.strong { font: 700 0.95rem var(--head); color: #f4f7f8; margin-bottom: 0.2rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .rel-grid { grid-template-columns: 1fr; }
  #panel-citizen { display: block; }
  .how { margin-bottom: 1.5rem; }
  .how ol { grid-template-columns: 1fr; gap: 1rem; }
  .site-pick { display: block; }
  .site-pick > .map { height: 340px; min-height: 0; margin: 0.75rem 0; }
  .step { height: auto; }
}
/* phones: tabs become a bottom tab bar, as in native apps */
@media (max-width: 700px) {
  html { font-size: 16px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .top { grid-template-columns: 1fr auto; padding: 0 1rem; padding-top: env(safe-area-inset-top, 0px); }
  .brand { padding: 0.8rem 0; }
  .lang { grid-column: 2; }
  .lang label { display: none; }
  .tabs { position: fixed; z-index: 1500; left: 0; right: 0; bottom: 0; grid-column: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--band); border-top: 1px solid rgba(255,255,255,0.25); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabs button { min-height: 64px; padding: 0 0.25rem; margin: 0; border-bottom: 0; border-top: 4px solid transparent; font-size: 0.85rem; white-space: normal; line-height: 1.2; }
  .tabs button[aria-selected="true"] { border-top-color: var(--yellow); }
  main { padding: 1.25rem 0.85rem 2rem; }
  .card { padding: 1.15rem; }
  .tagline { font-size: 1.9rem; }
  .map, #panel-watchlist .map { height: 300px; }
  .site-pick > h2, #panel-watchlist > .card:first-child h2, #panel-proof > .card:first-child h2 { font-size: 1.5rem; }
  .bar-row { grid-template-columns: 4rem 1fr 2.9rem; gap: 0.5rem; }
  .row > button.big { flex: 1 1 100%; }
  .foot { padding-left: 1rem; padding-right: 1rem; }
}
@media (prefers-reduced-motion: no-preference) { .bar-fill { transition: width 0.4s ease; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) {
  .card, .class-btn, .verdict-box, .map, .table-wrap { border: 1px solid CanvasText; box-shadow: none; }
  .tabs button[aria-selected="true"] { border-color: Highlight; }
}
@media print { .top, .tabs, .map, button, .foot { display: none !important; } body { background: #f5f7f5; padding: 0; } }
