/*
 * TerraOverview — the visual system.
 *
 * One stylesheet for the whole site, because there is one product. Everything here is a token or a
 * component: a page that needs a colour, a size or a space takes it from this file rather than
 * inventing one, which is what keeps twenty pages from looking like twenty projects.
 *
 * The order of the file is the order of the decisions: tokens, then the page frame, then the
 * elements, then the components.
 *
 * The rule the design follows is order before decoration. Nothing here is drawn to make a page look
 * richer. Rank comes from size, weight and space; separation comes from a hairline or a change of
 * ground, not from a box around everything. The palette is the logo's: warm neutral paper, one ink,
 * one terracotta, used only where something is actionable or is the point of the page.
 */

/*
 * Inter (SIL Open Font License 1.1), the variable latin subset, served from this site (UX
 * specification §F.2). `swap` shows the text at once in the system font and changes face when the
 * file arrives; characters outside the subset — arrows, ≈, ◆, ▣ — come from the fallback.
 */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Ink: three weights, and nothing between them. */
  --ink: #1a1d1a;
  --ink-2: #4d554d;
  /* The lightest ink still has to clear 4.5:1 on the official panel, which is the palest ground. */
  --ink-3: #616860;

  /* Ground: the page, a raised surface, a recessed one. */
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f2f2ec;

  --line: #e0e0d7;
  --line-strong: #c8c9bd;

  /* The one accent, from the logo. Interactive, or the point of the page — never decoration. */
  --accent: #a8532c;
  --accent-soft: #f7ece5;

  /*
   * The two halves of every reading, kept apart by ground as well as by label (CLAUDE.md §1): what
   * the source published, and what TerraOverview makes of it. A reader must never have to work out
   * which one they are looking at.
   */
  --official: #f2f4f0;
  --official-line: #dbe0d6;
  --reading: #eef2f7;
  --reading-line: #d4dfeb;

  --warn: #8a5a12;
  --warn-soft: #fbf3e3;

  /* Type. A fluid display size, then four fixed steps; there is no fifth. */
  /* Inter, self-hosted (public/fonts/inter/README.md); the system stack is the fallback while it loads. */
  --font:
    'Inter Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue',
    sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Menlo', monospace;
  --t-display: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem);
  --t-h2: 1.2rem;
  --t-h3: 1rem;
  --t-body: 1rem;
  --t-small: 0.875rem;
  --t-micro: 0.78rem;

  /* Space, on a 4px grid. Every margin and padding in this file is one of these. */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;

  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 999px;

  /* Measure: prose stops here, whatever the window does. */
  --measure: 40rem;
  --page: 74rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9ece7;
    --ink-2: #a9b2a7;
    --ink-3: #8a938a;
    --bg: #131513;
    --surface: #191c19;
    --surface-2: #1e211e;
    --line: #2c302c;
    --line-strong: #3d423d;
    --accent: #d98354;
    --accent-soft: #2a211b;
    /* Far enough from `--surface` to read as a different ground; at #1c1f1b it did not. */
    --official: #22261f;
    --official-line: #373d33;
    --reading: #1a1f26;
    --reading-line: #2a333e;
    --warn: #d3a45f;
    --warn-soft: #241f14;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--t-body) / 1.6 var(--font);
  text-rendering: optimizeLegibility;
}

/* ─── Page frame ─────────────────────────────────────────────────────────── */

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--s5) var(--s8);
}

/*
 * The two-column reading frame: a narrow rail for what identifies and qualifies the content, a wide
 * column for the content itself. The rail is what makes a page look composed rather than stacked —
 * and on a narrow screen it does not shrink, it moves above the content, where its role is the same.
 */
.layout {
  display: grid;
  gap: var(--s5) var(--s7);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 62rem) {
  .layout {
    grid-template-columns: 15rem minmax(0, 1fr);
  }

  .layout > .rail {
    position: sticky;
    top: var(--s5);
  }
}

.prose {
  max-width: var(--measure);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s5);
  padding: var(--s3) 0;
}

/* One row: the name, the three places, the search and the language (audit §L). */
.site-header .bar {
  display: flex;
  align-items: center;
  gap: var(--s3) var(--s5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: none;
}

.brand img {
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s5);
  font-size: var(--t-small);
  margin-right: auto;
}

.site-nav a,
.nav-menu-links a {
  color: var(--ink-2);
  text-decoration: none;
  padding: var(--s1) 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.nav-menu-links a:hover {
  color: var(--ink);
}

.site-nav a[aria-current='page'],
.nav-menu-links a[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-left: auto;
}

.header-search {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--s3);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-search:hover {
  background: #8f4524;
  color: #fff;
}

.header-search-short,
.nav-menu {
  display: none;
}

@media (max-width: 47.99rem) {
  .site-nav,
  .header-search-long {
    display: none;
  }

  .header-search-short {
    display: inline;
  }

  .nav-menu {
    display: block;
    position: relative;
  }

  .site-header .bar,
  .bar-actions {
    gap: var(--s2);
  }

  .brand {
    font-size: 1rem;
  }

  .nav-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    font-size: var(--t-small);
    cursor: pointer;
    list-style: none;
  }

  .nav-menu summary::-webkit-details-marker {
    display: none;
  }

  /* The icon is the control: the disclosure chevron every other summary carries does not belong. */
  .nav-menu > summary::before,
  .nav-menu[open] > summary::before {
    content: none;
  }

  .nav-menu-links {
    position: absolute;
    right: 0;
    top: calc(100% + var(--s2));
    z-index: 40;
    display: flex;
    flex-direction: column;
    min-width: 14rem;
    padding: var(--s2) var(--s4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.12);
  }

  .nav-menu-links a {
    padding: var(--s2) 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/*
 * The language switch. Both languages always visible: a control that hides the alternative is a
 * control nobody finds. The current one is not a link, because there is nowhere for it to go.
 */
.lang {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* A switch that posts (a page with no address of its own) looks exactly like one that links. */
.lang form {
  display: contents;
}

.lang a,
.lang span,
.lang button {
  padding: 0.3rem 0.65rem;
  text-decoration: none;
  color: var(--ink-3);
  line-height: 1.4;
}

.lang button {
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.lang a:hover,
.lang button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.lang [aria-current='true'] {
  background: var(--ink);
  color: var(--bg);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

/*
 * The home page opens on the territory itself. The image is the subject, not decoration: a service
 * that reads terrain shows terrain, and the one it shows is a satellite view in the public domain.
 *
 * Two columns, and that is the image's doing. The peninsula runs diagonally across a nearly square
 * frame, so any wide band cuts the shape everyone recognises — laid beside the words instead of
 * behind them, the whole country survives. Below 52rem there is no room for two, and the image goes
 * back to being a ground with a scrim over it, where only atmosphere is asked of it.
 */
.hero {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius);
  overflow: hidden;
  background: #101a20;
  margin: 0 0 var(--s6);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
}

.hero-body {
  padding: var(--s7) var(--s6);
  align-self: center;
  max-width: 34rem;
}

.hero-figure {
  position: relative;
  min-height: 26rem;
  /* A `figure` carries the browser's own 40px side margins, which left the image short of the
     card's edge and a dark strip beside it. */
  margin: 0;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

/* The seam. The photograph's own sea is nearly this colour, so the two meet without an edge. */
.hero-figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #101a20 0%, rgb(16 26 32 / 0.55) 18%, transparent 55%);
}

/*
 * Fixed light values, not tokens: the ground here is the photograph and the panel beside it, dark
 * in both colour schemes. Ink that followed the theme would vanish in one of them.
 */
.hero h1 {
  color: #ffffff;
  margin-bottom: var(--s4);
  /* The one display size, for the home page's heading (§F.2). */
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero .lead {
  color: #d9e2e0;
  max-width: 32rem;
}

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: min(72vh, 30rem);
    align-items: end;
  }

  .hero-body {
    padding: var(--s6) var(--s4) var(--s5);
    max-width: none;
    z-index: 1;
  }

  /* Now a ground rather than a panel: it fills the card and the words sit on it. */
  .hero-figure {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  .hero-figure::after {
    background: linear-gradient(
      170deg,
      rgb(10 18 24 / 0.3) 0%,
      rgb(10 18 24 / 0.6) 45%,
      rgb(10 18 24 / 0.92) 100%
    );
  }
}

/* ─── Indicators, on the home page ───────────────────────────────────────── */

.indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--t-small);
}

/* An indicator with a source behind it is ink; one without is not pretending to be. */
.indicator-name {
  color: var(--ink-3);
}

.indicator.is-active .indicator-name {
  color: var(--ink);
  font-weight: 600;
}

/* ─── Steps ──────────────────────────────────────────────────────────────── */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s5);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.steps li {
  counter-increment: step;
  border-top: 2px solid var(--accent);
  padding-top: var(--s3);
}

.steps li h3::before {
  content: counter(step);
  display: inline-block;
  min-width: 1.35rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-display);
  line-height: 1.15;
  margin: 0 0 var(--s3);
  font-weight: 650;
}

h2 {
  font-size: var(--t-h2);
  line-height: 1.3;
  margin: 0 0 var(--s3);
  font-weight: 650;
}

h3 {
  font-size: var(--t-h3);
  line-height: 1.4;
  margin: 0 0 var(--s2);
  font-weight: 650;
}

p {
  margin: 0 0 var(--s4);
  max-width: var(--measure);
}

.lead {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: var(--measure);
}

.small {
  font-size: var(--t-small);
  color: var(--ink-2);
}

.micro {
  font-size: var(--t-micro);
  color: var(--ink-3);
}

/* The line above a title that says what kind of thing this page is. */
.eyebrow {
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 650;
  color: var(--accent);
  margin: 0 0 var(--s2);
}

a {
  color: var(--ink);
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line-strong);
}

a:hover {
  text-decoration-color: currentColor;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--s6) 0;
}

/* ─── Page header ────────────────────────────────────────────────────────── */

.page-head {
  margin-bottom: var(--s6);
}

/*
 * The banded header, on the pages that are a destination rather than a step: coverage, the rules,
 * the directory. It carries the hero's ground and none of its photograph — the image belongs to the
 * home page, and repeating it on every page would turn a statement into wallpaper. What the pages
 * share is the dark band, the terracotta eyebrow and the same rhythm, which is enough to read as
 * one product.
 *
 * The flow keeps its plain header. Somebody midway through getting an answer does not need a
 * curtain raised in front of each step.
 */
.page-head-band {
  background: #16211f;
  border-radius: var(--radius);
  padding: var(--s6);
  margin-bottom: var(--s6);
}

.page-head-band h1 {
  color: #ffffff;
}

.page-head-band .lead {
  color: #d3dcd9;
}

.page-head-band .eyebrow {
  /* The accent lifted for a dark ground: #a8532c on #16211f is under 3:1. */
  color: #e08a5c;
}

.page-head-band .breadcrumb,
.page-head-band .breadcrumb a {
  color: #9fada9;
}

.page-head-band .breadcrumb li::after {
  color: #55635f;
}

.page-head-band .breadcrumb a:hover {
  color: #ffffff;
}

.page-head .lead {
  margin-bottom: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  padding: 0;
  margin: 0 0 var(--s3);
  list-style: none;
  font-size: var(--t-micro);
  color: var(--ink-3);
}

.breadcrumb li::after {
  content: '/';
  margin-left: var(--s2);
  color: var(--line-strong);
}

.breadcrumb li:last-child::after {
  content: none;
}

.breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */

.section {
  margin: 0 0 var(--s7);
}

.section:last-child {
  margin-bottom: 0;
}

/* A hairline and a title: the whole of what separates one part of a page from the next. */
.section > .section-head {
  border-top: 1px solid var(--line);
  padding-top: var(--s3);
  margin-bottom: var(--s4);
}

.section > .section-head h2 {
  margin-bottom: var(--s1);
}

.section > .section-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--t-small);
}

/* ─── Rail ───────────────────────────────────────────────────────────────── */

.rail {
  font-size: var(--t-small);
}

.rail > * + * {
  margin-top: var(--s5);
}

.rail h2 {
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  margin-bottom: var(--s2);
  font-weight: 650;
}

/* ─── Data lists ─────────────────────────────────────────────────────────── */

/*
 * A labelled fact. Two columns where there is room for two, stacked where there is not — never the
 * browser's indented default, which reads as something the page forgot to lay out.
 */
.data {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
  gap: var(--s2) var(--s4);
  margin: 0;
  font-size: var(--t-small);
}

.data dt {
  color: var(--ink-3);
}

.data dd {
  margin: 0;
  overflow-wrap: break-word;
}

.data.stacked {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.data.stacked dt {
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.data.stacked dd + dt {
  margin-top: var(--s3);
}

@media (max-width: 34rem) {
  .data:not(.stacked) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .data:not(.stacked) dt {
    font-size: var(--t-micro);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-top: 1px solid var(--line);
    padding-top: var(--s2);
    margin-top: var(--s2);
  }

  .data:not(.stacked) dd {
    padding-bottom: var(--s1);
  }
}

/* ─── Cards and tiles ────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
}

.card > :last-child {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

/* A whole card that is a link: the target is the card, not the four words inside it. */
a.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
  text-decoration: none;
  color: inherit;
}

a.tile:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

a.tile .tile-title {
  font-weight: 600;
  display: block;
}

a.tile .tile-meta {
  display: block;
  color: var(--ink-3);
  font-size: var(--t-micro);
  margin-top: var(--s1);
}

/* ─── Statistics strip ───────────────────────────────────────────────────── */

/*
 * The three or four numbers that answer "what am I looking at" before any list does. They are set
 * large because they are the summary, not because a number looks good large.
 */
.stats {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s4) var(--s5);
  margin: 0 0 var(--s6);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  display: block;
}

.stat-label {
  display: block;
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-top: var(--s1);
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: var(--t-micro);
  font-weight: 600;
  line-height: 1.5;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  /*
   * No `nowrap`. A badge held a class code — "P4", "HPH" — and never needed to break. It now also
   * carries the state a source found at a point, which is a sentence, and on a narrow screen an
   * unbreakable sentence pushed the whole page sideways.
   */
  max-width: 100%;
}

.badge-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.badge-muted {
  color: var(--ink-3);
}

/* ─── Callouts ───────────────────────────────────────────────────────────── */

/*
 * Something the reader has to take in before going on. One rule down the side and a quiet ground:
 * enough to stop the eye, not enough to shout.
 */
.notice {
  border: 1px solid var(--official-line);
  border-left: 3px solid var(--ink-3);
  border-radius: var(--radius-sm);
  background: var(--official);
  padding: var(--s3) var(--s4);
  margin: 0 0 var(--s4);
  max-width: var(--measure);
  font-size: var(--t-small);
}

.notice > :last-child {
  margin-bottom: 0;
}

.notice-warn {
  border-color: var(--warn);
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: var(--s6) var(--s5);
  color: var(--ink-2);
  max-width: var(--measure);
}

.empty > :last-child {
  margin-bottom: 0;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.scroll-x {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}

thead th {
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  font-weight: 650;
  white-space: nowrap;
}

th,
td {
  text-align: left;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

/*
 * In the summary table, the source's value and our reading of it share a cell: the value is the
 * source speaking, in its own language and its own terms, and under it in smaller type is what
 * TerraOverview makes of that value, in the reader's language. Same separation as the detail
 * sections, in the space a table cell allows.
 */
/*
 * The sentence under a value that TerraOverview computed rather than read: what was calculated,
 * over how many ensemble members, and a link to the versioned method. Smaller than the value and
 * in the muted ink, because it qualifies the number rather than competing with it.
 */
.derivation {
  font-size: var(--t-micro);
  color: var(--ink-3);
  margin: var(--s2) 0 0;
}

/*
 * The basemap credit MapLibre draws inside the canvas.
 *
 * Left unstyled it is MapLibre's own light chrome, which on this site's dark theme is a pale band
 * with pale text on it: present, and unreadable, which is the one thing an attribution may not be.
 * So it is painted with the page's own tokens in both themes, and kept to a single line.
 */
/*
 * Scoped through `.hazard-map` on purpose, and it is not decoration.
 *
 * `report-map.js` injects MapLibre's stylesheet at runtime, so it lands after this file and wins
 * every tie. A single-class rule here is simply ignored — which is what happened the first time,
 * and the box stayed white on a dark page. Two classes beat one.
 */
.hazard-map .maplibregl-ctrl-attrib,
.hazard-map .maplibregl-ctrl-attrib.maplibregl-compact {
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
}

.hazard-map .maplibregl-ctrl-attrib a {
  color: var(--ink-2);
}

/* The button that opens the credit: legible in both themes, and clearly a control. */
.hazard-map .maplibregl-ctrl-attrib-button {
  background-color: var(--surface);
}

/* MapLibre draws its own glyph in a fixed dark colour; invert it where the ground is dark. */
:root[data-theme='dark'] .hazard-map .maplibregl-ctrl-attrib-button,
:root:not([data-theme='light']) .hazard-map .maplibregl-ctrl-attrib-button {
  filter: invert(1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .hazard-map .maplibregl-ctrl-attrib-button {
    filter: none;
  }
} /*
 * The source's own value, set as a quotation: monospace on a tint, with a rule down the left.
 * A reader can tell at a glance which words are the publisher's and which are ours, before
 * reading either — the two used to differ only by the size of the type.
 */
.finding .raw {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--t-small);
  line-height: 1.5;
  background: var(--surface-2);
  border-left: 3px solid var(--ink-3);
  padding: var(--s3);
  margin: 0 0 var(--s3);
  overflow-wrap: anywhere;
}

.finding .raw .label {
  display: block;
  font-family: inherit;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--ink-3);
  margin: 0 0 var(--s2);
}

.finding .interpretation .label {
  display: block;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 650;
  margin: 0 0 var(--s2);
}

.summary-source {
  display: block;
  font-size: var(--t-micro);
  color: var(--ink-3);
  margin-top: 0.15rem;
}

tbody tr:hover {
  background: var(--surface-2);
}

/* ─── Forms and buttons ──────────────────────────────────────────────────── */

label {
  font-size: var(--t-small);
  color: var(--ink-2);
}

input[type='text'],
input[type='search'],
input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-body);
}

input::placeholder {
  color: var(--ink-3);
}

.button,
button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  /* No `nowrap`: a long label on a narrow screen has to wrap, or it pushes the page sideways. */
  max-width: 100%;
}

.button:hover,
button:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  margin: var(--s5) 0 0;
}

/*
 * Fields on a grid, each with its label above it. Three fields side by side on a phone are three
 * fields whose labels nobody can read, so the grid collapses to one column on its own.
 */
.form-grid {
  display: grid;
  gap: var(--s3) var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
  max-width: 46rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-width: 0;
}

.form-grid .actions {
  margin: 0;
  grid-column: 1 / -1;
}

form.search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: stretch;
  margin: 0 0 var(--s5);
  max-width: var(--measure);
}

form.search input {
  flex: 1 1 16rem;
}

form.confirm .actions {
  grid-column: 1 / -1;
  margin: 0;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
  margin: 0 0 var(--s4);
  max-width: var(--measure);
}

legend {
  font-size: var(--t-small);
  font-weight: 600;
  padding: 0 var(--s2);
}

.check {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  font-size: var(--t-small);
  color: var(--ink-2);
  max-width: var(--measure);
}

.check input {
  margin-top: 0.3rem;
}

/* ─── Findings: the official half and our reading ────────────────────────── */

.finding {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s5);
  margin: 0 0 var(--s4);
}

.finding > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  margin-bottom: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}

.finding .official,
.finding .interpretation {
  border-radius: var(--radius-sm);
  padding: var(--s4);
}

.finding .official {
  background: var(--official);
  border: 1px solid var(--official-line);
}

.finding .interpretation {
  background: var(--reading);
  border: 1px solid var(--reading-line);
  margin-top: var(--s3);
}

.finding .label {
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 650;
  color: var(--ink-3);
  margin: 0 0 var(--s2);
}

.finding .value {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 var(--s2);
}

.finding .confidence,
.finding .coverage,
.no-interpretation {
  color: var(--ink-2);
  font-size: var(--t-small);
  margin: 0 0 var(--s2);
}

.finding .confidence:last-child,
.finding .coverage:last-child {
  margin-bottom: 0;
}

/*
 * Provenance sits inside a `details` because it is always available and rarely the reason someone
 * opened the page: every field stays on the page, one click away rather than four lines down.
 */
.provenance {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
  gap: var(--s1) var(--s4);
  font-size: var(--t-micro);
  margin: var(--s3) 0 0;
}

.provenance dt {
  color: var(--ink-3);
}

.provenance dd {
  margin: 0;
  overflow-wrap: break-word;
}

@media (max-width: 34rem) {
  .provenance {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .provenance dt {
    margin-top: var(--s2);
  }
}

/*
 * The half of a preview card that says what the report holds. It carries the interpretation panel's
 * ground so the reader learns where the reading will appear, and a dashed edge so it is legible as
 * a placeholder rather than as a value that failed to load.
 */
.interpretation.locked {
  border-style: dashed;
  color: var(--ink-2);
}

.limitations,
.checklist {
  margin: 0;
  padding-left: 1.1rem;
  font-size: var(--t-small);
  color: var(--ink-2);
}

.limitations li,
.checklist li {
  margin-bottom: var(--s2);
}

.limitations li:last-child,
.checklist li:last-child {
  margin-bottom: 0;
}

.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  padding-left: 1.35rem;
  position: relative;
}

.checklist li::before {
  content: '';
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.45rem;
  height: 0.25rem;
  border-left: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}

/* ─── Disclosure ─────────────────────────────────────────────────────────── */

details {
  border-top: 1px solid var(--line);
  padding: var(--s3) 0 0;
  margin: 0 0 var(--s3);
}

details > summary {
  cursor: pointer;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex: none;
}

details[open] > summary::before {
  transform: rotate(45deg);
}

details > summary:hover {
  color: var(--ink);
}

details > *:not(summary) {
  margin-top: var(--s3);
}

/* ─── Directory: a long alphabetical list made scannable ─────────────────── */

.alpha {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: 0 0 var(--s6);
  padding: 0;
  list-style: none;
}

.alpha a,
.alpha span {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
  background: var(--surface);
}

/* A letter that leads somewhere is ink; one that leads nowhere is grey. The two must not look
   alike, or the whole strip reads as disabled. */
.alpha a {
  color: var(--ink);
}

.alpha a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.alpha span {
  color: var(--ink-3);
  opacity: 0.45;
}

.alpha a[aria-current='page'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.alpha a[aria-current='page'] .alpha-count {
  color: var(--bg);
  opacity: 0.7;
}

.alpha-count {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1.1;
}

/*
 * Names in columns. A single column of five hundred entries is a page nobody reads to the end; in
 * columns the same list is scanned in seconds, and the browser decides how many columns fit.
 */
.name-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 4 12rem;
  column-gap: var(--s5);
}

.name-list li {
  break-inside: avoid;
  padding: 0.15rem 0;
  font-size: var(--t-small);
}

.name-list a {
  text-decoration: none;
  color: var(--ink);
}

.name-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.name-list .count {
  color: var(--ink-3);
  font-size: var(--t-micro);
  margin-left: var(--s1);
}

/* ─── Candidate results ──────────────────────────────────────────────────── */

.candidates {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  max-width: var(--measure);
}

.candidates li + li {
  border-top: 1px solid var(--line);
}

.candidates a {
  display: block;
  padding: var(--s3) var(--s4);
  text-decoration: none;
  color: inherit;
}

.candidates a:hover {
  background: var(--surface-2);
}

.candidates .candidate-name {
  font-weight: 600;
}

.candidates .candidate-meta {
  display: block;
  color: var(--ink-3);
  font-size: var(--t-micro);
}

/* ─── Map ────────────────────────────────────────────────────────────────── */

#map {
  height: min(60vh, 26rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 var(--s3);
  background: var(--surface-2);
}

/* ─── Hazard maps in the report ──────────────────────────────────────────── */

.hazard-map {
  margin: var(--s4) 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.hazard-map .map-frame {
  height: min(55vh, 22rem);
  background: var(--surface-2);
}

/* A swatch for a class that has no colour: absence is a legend entry too, and an entry nobody can
   see is not one. */
.swatch[style*='transparent'] {
  background: repeating-linear-gradient(
    45deg,
    var(--surface-2) 0 3px,
    var(--line) 3px 4px
  ) !important;
}

.swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  flex: none;
  border: 1px solid rgb(0 0 0 / 0.15);
  transform: translateY(0.1rem);
}

/* The marker, not a class: drawn as the map draws it so the legend matches the picture. */
.swatch-point {
  border-radius: 50%;
  background: #3b7fb5;
  border-color: #24557a;
}

.hazard-map figcaption {
  padding: 0 var(--s4) var(--s3);
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  margin-top: var(--s8);
  border-top: 1px solid var(--line);
  padding-top: var(--s5);
  color: var(--ink-3);
  font-size: var(--t-micro);
}

.site-footer .data {
  font-size: var(--t-micro);
  margin-bottom: var(--s4);
}

.site-footer p {
  margin: 0;
  max-width: 52rem;
}

/* The contact line stands off the disclaimer above it. */
.site-footer p + p {
  margin-top: var(--s2);
}

.site-footer a {
  color: var(--ink-2);
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */

.stack > * + * {
  margin-top: var(--s4);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  align-items: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-nav,
  .lang,
  .actions {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ─── The one search field ────────────────────────────────────────────────── */

/*
 * An address or a pair of coordinates, with suggestions under it. The popup is anchored to the row
 * that holds the field and the button, so on a phone it spans the full width rather than the width
 * of the input alone (audit AC-D6), and it sits below the field rather than fixed to the bottom of
 * the screen, where an open keyboard would cover it.
 */
.search-field {
  max-width: 36rem;
}

.search-field.is-hero {
  margin-top: var(--s5);
}

.search-label {
  display: block;
  font-size: var(--t-small);
  font-weight: 600;
  margin: 0 0 var(--s2);
}

.search-row {
  position: relative;
  display: flex;
  gap: var(--s2);
}

.search-row input {
  flex: 1 1 auto;
  min-width: 0;
  /* At least 16px: below that iOS zooms the page when the field takes focus. */
  font-size: max(1rem, 16px);
}

.search-field.is-hero .search-row input {
  border-color: transparent;
  box-shadow: 0 2px 18px rgb(0 0 0 / 0.3);
}

.search-field .search-row > button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.search-field .search-row > button:hover {
  background: #8f4524;
  border-color: #8f4524;
}

.suggest-popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.2);
  overflow: hidden;
  text-align: left;
}

.suggest-popup [role='listbox'] {
  list-style: none;
  margin: 0;
  padding: var(--s1) 0;
  max-height: min(55vh, 24rem);
  overflow-y: auto;
}

.suggest-popup [role='listbox']:empty {
  display: none;
}

.suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--s3);
  align-items: center;
  /* 44px: a row a thumb can hit without landing on the next one. */
  min-height: 44px;
  padding: var(--s2) var(--s3);
  cursor: pointer;
}

.suggestion[aria-selected='true'] {
  background: var(--surface-2);
}

.suggestion-main {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.suggestion-place {
  font-weight: 400;
  color: var(--ink-3);
}

.suggestion-main mark {
  background: var(--accent-soft);
  color: inherit;
  border-radius: 2px;
}

.suggestion-tag {
  font-size: var(--t-micro);
  font-weight: 600;
  padding: 1px var(--s2);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* The precision is information, never an alarm: neutral inks, dark for the building, light for the street. */
.tag-house-number,
.tag-coordinates {
  background: var(--ink-2);
  color: var(--surface);
}

.tag-street {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
}

.suggestion-note {
  grid-column: 1 / -1;
  font-size: var(--t-micro);
  color: var(--ink-3);
}

.suggest-none {
  margin: 0;
  padding: var(--s3);
  font-size: var(--t-small);
  color: var(--ink-2);
}

.suggest-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s4);
  padding: var(--s1) var(--s3);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.link-button,
.link-button:hover {
  /* Read as a link, so aligned as text: a button centres its label, which on two lines looks lost. */
  text-align: left;
  background: none;
  border: 0;
  padding: var(--s2) 0;
  min-height: 44px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.search-microcopy {
  margin: var(--s2) 0 0;
  font-size: var(--t-micro);
  color: var(--ink-3);
}

.search-alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s5);
  margin-top: var(--s2);
}

.search-alternatives details {
  font-size: var(--t-small);
}

.search-alternatives details[open] {
  flex-basis: 100%;
  /* Narrower than three 11rem columns: the municipality field was cut (2026-09-15). */
  min-width: 0;
}

/* The street on its own row, then a narrow house number beside a wide municipality. */
.search-alternatives .form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.search-alternatives .form-grid > .field:first-child,
.search-alternatives .form-grid > .actions {
  grid-column: 1 / -1;
}

.search-alternatives summary {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.search-alternatives form {
  margin-top: var(--s3);
  padding: var(--s4);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-coordinates-form {
  max-width: 24rem;
}

.search-coordinates-form .micro {
  margin: var(--s2) 0 0;
}

/* On the photograph: light text, in both colour schemes, like the heading above it. */
.search-field.is-hero .search-label {
  color: #ffffff;
}

.search-field.is-hero .search-microcopy {
  color: #d9e2e0;
}

.search-field.is-hero .search-alternatives summary {
  color: #ffffff;
}

/* ─── Semantic tokens and the one primary action (audit §N.2, §N.3) ────────── */

/*
 * Colours that mean one thing each, defined once. Availability and synthesis use them; nothing else
 * does, and the terracotta stays for the one action a page asks for.
 */
:root {
  --success: #1b7f4e;
  --neutral-state: #8a8a85;
  --amber: #b8730a;
  --brick: #9e2b1b;
  --sabbia: #f6efe4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --success: #5fbf8c;
    --neutral-state: #a3a39d;
    --amber: #e0a44a;
    --brick: #e07a64;
    --sabbia: #2a241c;
  }
}

:root[data-theme='dark'] {
  --success: #5fbf8c;
  --neutral-state: #a3a39d;
  --amber: #e0a44a;
  --brick: #e07a64;
  --sabbia: #2a241c;
}

.button-primary,
.button.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  min-height: 48px;
  padding: 0.7rem 1.3rem;
  font-size: var(--t-body);
}

.button-primary:hover,
.button.button-primary:hover {
  background: #8f4524;
  border-color: #8f4524;
}

.button-primary:disabled {
  background: var(--line-strong);
  border-color: var(--line-strong);
  color: var(--ink-3);
  cursor: not-allowed;
}

/* ─── Step bar ────────────────────────────────────────────────────────────── */

.stepbar {
  margin: 0 0 var(--s4);
}

.stepbar-count {
  margin: 0 0 var(--s2);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stepbar ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepbar li {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--t-small);
  color: var(--ink-3);
}

.stepbar-mark {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: var(--t-micro);
  font-weight: 600;
}

.stepbar li.is-done {
  color: var(--ink-2);
}

.stepbar li.is-done .stepbar-mark {
  background: var(--ink-2);
  border-color: var(--ink-2);
  color: var(--surface);
}

.stepbar li.is-current {
  color: var(--ink);
  font-weight: 600;
}

.stepbar li.is-current .stepbar-mark {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 36rem) {
  /* On a phone only the current step keeps its name: three names on one line would wrap to three. */
  .stepbar li:not(.is-current) .stepbar-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ─── Confirmation: map and panel ─────────────────────────────────────────── */

.confirm-layout {
  display: grid;
  gap: var(--s5);
  align-items: start;
}

@media (min-width: 64rem) {
  .confirm-layout {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

#map.confirm-map {
  height: 520px;
  margin: 0;
}

@media (max-width: 64rem) {
  #map.confirm-map {
    /* 55 % of the screen at most: the panel and the action must still be reachable (AC-E6). */
    height: 55vh;
    min-height: 16rem;
  }
}

.confirm-map-column .notice {
  margin: 0 0 var(--s3);
}

.confirm-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.point-card {
  margin: 0;
  display: grid;
  gap: var(--s1);
}

.point-card dt {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.point-card dt:not(:first-child) {
  margin-top: var(--s3);
}

.point-card dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
}

.point-address {
  font-size: var(--t-h3);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.point-coordinates {
  font-family: var(--mono);
  font-size: var(--t-small);
}

.point-card .link-button {
  min-height: 0;
  padding: 0;
  font-size: var(--t-small);
}

.confirm-panel .micro {
  margin: 0;
}

.confirm-cta .button-primary {
  width: 100%;
}

.manual-coordinates summary {
  cursor: pointer;
  font-size: var(--t-small);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.manual-coordinates .form-grid {
  margin-top: var(--s3);
}

@media (max-width: 48rem) {
  /*
   * The action is on screen at all times on a phone (AC-E6). Fixed to the bottom rather than
   * sticky: the panel sits below a map that fills most of the screen, and a sticky element cannot
   * stick while its own container is still below the fold.
   */
  .confirm-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
  }

  body:has(.confirm-cta) {
    padding-bottom: 6rem;
  }
}

/* The marker every map uses: a terracotta pin with a white rim, visible on the beige basemap. */
.point-marker {
  width: 28px;
  height: 36px;
  cursor: grab;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M14 1C7 1 1.5 6.4 1.5 13.3 1.5 22.6 14 35 14 35s12.5-12.4 12.5-21.7C26.5 6.4 21 1 14 1z' fill='%23a8532c' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='14' cy='13.5' r='4.5' fill='%23fff'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.35));
}

.point-marker:active {
  cursor: grabbing;
}

.locate-button {
  background: no-repeat center / 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3'/%3E%3C/svg%3E") !important;
}

/*
 * An element the markup or a script hides stays hidden, whatever display its class gives it: the
 * inline errors, the copy buttons and the sticky links all start hidden and are shown by a script.
 */
[hidden] {
  display: none !important;
}

/* ─── Preview: the table of categories and the order (audit §F, §G) ───────── */

.preview-head {
  margin-bottom: var(--s4);
}

.preview-head h1 {
  margin-bottom: var(--s2);
}

.preview-title-lead {
  display: block;
  font-size: var(--t-h2);
  font-weight: 500;
  color: var(--ink-2);
}

.point-line {
  margin: 0;
  font-size: var(--t-small);
  color: var(--ink-2);
}

.point-line .point-coordinates {
  font-family: var(--mono);
}

.point-edit {
  margin-left: var(--s2);
  white-space: nowrap;
}

.preview-layout {
  display: grid;
  gap: var(--s6);
  align-items: start;
}

@media (min-width: 64rem) {
  /* Table and form side by side, so the eight rows and the action share one screen (AC-F1). */
  .preview-layout {
    grid-template-columns: minmax(0, 8fr) minmax(0, 5fr);
    gap: var(--s5);
  }

  .order-block {
    position: sticky;
    top: var(--s4);
  }
}

.availability-summary {
  margin: 0 0 var(--s2);
  font-size: 1.125rem;
  font-weight: 600;
}

.availability-table {
  font-size: var(--t-small);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
}

.availability-table th,
.availability-table td {
  padding: var(--s2) var(--s3);
  vertical-align: middle;
}

/*
 * The category wraps rather than widening the table: «Dinamica della costa (erosione e
 * avanzamento)» on one line pushed the table past its column and under the order form.
 */
.availability-category {
  font-weight: 600;
  min-width: 9rem;
}

.availability-state {
  white-space: nowrap;
}

/* The state is an icon and a word, never a colour alone (AC-F2). */
.state-icon {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: var(--s1);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: -0.2em;
}

.is-available .state-icon {
  background: var(--success);
  color: #fff;
}

.is-available .availability-state {
  color: var(--success);
  font-weight: 600;
}

.is-unavailable .state-icon {
  border: 2px solid var(--neutral-state);
  color: var(--neutral-state);
}

.is-unavailable .availability-state {
  color: var(--ink-3);
}

.availability-contents {
  color: var(--ink-2);
}

.availability-note {
  margin: var(--s3) 0 var(--s2);
}

.availability-definitions {
  margin: 0 0 var(--s3);
  font-size: var(--t-small);
}

.availability-definitions summary {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.availability-definitions dl {
  margin: var(--s3) 0 0;
}

.availability-definitions dt {
  font-weight: 600;
}

.availability-definitions dd {
  margin: 0 0 var(--s3);
  color: var(--ink-2);
}

@media (max-width: 48rem) {
  /* A card per category, two lines each, and nothing that scrolls sideways (audit §F.3, §M). */
  .availability-table,
  .availability-table tbody,
  .availability-table tr,
  .availability-table th,
  .availability-table td {
    display: block;
  }

  .availability-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .availability-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s1) var(--s3);
    padding: var(--s3);
    border-bottom: 1px solid var(--line);
  }

  .availability-table tbody tr:last-child {
    border-bottom: 0;
  }

  .availability-table th,
  .availability-table td {
    padding: 0;
    border: 0;
  }

  .availability-contents {
    grid-column: 1 / -1;
  }

  /* On a phone the name and the state share one row: both wrap rather than widen the page. */
  .availability-category {
    min-width: 0;
  }

  .availability-state {
    white-space: normal;
    text-align: right;
  }
}

.order-block {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--s4) var(--s5);
}

.order-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin: 0 0 var(--s2);
}

.price-tag {
  font-size: var(--t-micro);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--s1) var(--s2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
}

.order-lead {
  margin: 0 0 var(--s3);
  font-size: var(--t-small);
}

.order-contents-title {
  margin: 0 0 var(--s1);
  font-size: var(--t-micro);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.order-contents {
  margin: 0 0 var(--s3);
  font-size: var(--t-micro);
  line-height: 1.45;
}

.order-contents li {
  margin-bottom: var(--s1);
}

.order-form .micro {
  line-height: 1.4;
}

.order-form {
  display: grid;
  gap: var(--s3);
}

.order-email input {
  font-size: 1rem;
}

.order-terms {
  display: grid;
  gap: var(--s1);
}

.order-terms .micro {
  padding-left: calc(1rem + var(--s3));
}

.field-error {
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--warn);
}

[aria-invalid='true'] {
  border-color: var(--warn);
  outline-color: var(--warn);
}

.order-cta {
  display: grid;
  gap: var(--s2);
}

.order-cta .button-primary {
  width: 100%;
}

.button-primary.is-busy::after {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: var(--s2);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: busy 0.8s linear infinite;
}

@keyframes busy {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button-primary.is-busy::after {
    animation: none;
  }
}

.order-sticky {
  display: none;
}

@media (max-width: 48rem) {
  .order-sticky {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    margin: 0;
    padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
  }

  .order-sticky .button-primary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--s2);
    width: 100%;
    text-decoration: none;
  }

  body:has(.order-sticky) {
    padding-bottom: 6rem;
  }
}

.preview-limitations {
  margin-top: var(--s6);
}

/* ─── Report ready (audit §G.2) ───────────────────────────────────────────── */

.ready-banner {
  position: relative;
  margin: 0 0 var(--s5);
  padding: var(--s4) var(--s6) var(--s4) var(--s5);
  border: 1px solid var(--success);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
}

.ready-text {
  margin: 0 0 var(--s1);
  font-weight: 600;
}

.ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  margin: var(--s3) 0;
}

.ready-actions > .button,
.ready-actions > .button-primary {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin: 0;
}

.ready-dismiss {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 1.4rem;
  cursor: pointer;
}

@media (min-width: 64rem) {
  /*
   * On a wide screen the ticks already say which step this is; the count stays for screen readers
   * and for phones, where the three names wrap and the count is the quicker read.
   */
  .stepbar-count {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .order-lead {
    margin-bottom: var(--s2);
  }

  .order-form {
    gap: var(--s2);
  }
}

/* ─── Report by category (audit §H, §I, §N.3; ADR 0021) ───────────────────── */

.report-head {
  margin-bottom: var(--s5);
}

.report-head h1 {
  margin-bottom: var(--s2);
}

.report-summary {
  margin: 0 0 var(--s5);
}

.report-summary h2,
.category-card h2,
.report-section h2 {
  margin: 0 0 var(--s2);
}

.summary-subtitle {
  margin: 0 0 var(--s2);
  font-size: var(--t-micro);
  color: var(--ink-2);
  max-width: var(--measure);
}

.summary-overview {
  margin: 0 0 var(--s2);
  font-weight: 600;
  font-size: var(--t-small);
}

/*
 * The two voices (audit §I.4). What the source published: white ground, a solid grey border,
 * square corners, monospace values. What TerraOverview makes of it: sand ground, a dashed
 * terracotta border, round corners, sans type. The same pair everywhere the two appear.
 */
.synthesis-tag {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.source-tag {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.synthesis-box,
.computed-box {
  background: var(--sabbia);
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  padding: var(--s3) var(--s4);
  margin: 0 0 var(--s3);
}

.source-box {
  background: var(--surface);
  border: 1px solid #c9c7c1;
  border-radius: 2px;
  padding: var(--s3) var(--s4);
  margin: 0 0 var(--s3);
}

.box-label {
  margin: 0 0 var(--s2);
}

.box-footer {
  margin: var(--s2) 0 0;
  font-size: var(--t-micro);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.synthesis-level {
  margin: 0 0 var(--s1);
}

.synthesis-text {
  margin: 0 0 var(--s1);
}

.synthesis-headline {
  margin: var(--s1) 0 0;
  font-size: 1.125rem;
}

.source-class {
  margin: 0 0 0.15rem;
  font-weight: 600;
}

.source-value {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  word-break: normal;
  overflow-wrap: anywhere;
}

.source-sentence {
  margin: 0;
}

.source-distance {
  margin: var(--s1) 0 0;
}

.source-reading + .source-reading {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

.format-note,
.source-notes {
  font-size: var(--t-small);
}

.format-note {
  margin-top: var(--s2);
}

.format-note summary,
.source-notes summary,
details.technical summary {
  cursor: pointer;
  color: var(--accent);
}

.source-notes ul {
  margin: var(--s2) 0 0;
  padding-left: 1.1rem;
  color: var(--ink-2);
}

.source-notes li {
  margin-bottom: var(--s2);
}

/* Levels: a mark and a word; the colour only repeats them (audit §I.3, operator's decision). */
.level {
  font-weight: 700;
  white-space: nowrap;
}

.level-relevant {
  color: var(--brick);
}

.level-present {
  color: var(--amber);
}

.level-scenario,
.level-unavailable {
  color: var(--neutral-state);
}

.level-none,
.level-context {
  color: var(--ink-2);
}

.summary-table {
  font-size: var(--t-small);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
}

.summary-table th,
.summary-table td {
  padding: 6px var(--s3);
  line-height: 1.35;
}

.summary-table .col-synthesis {
  color: var(--accent);
}

.summary-category {
  font-weight: 600;
  min-width: 9rem;
}

.summary-category a {
  color: var(--ink);
}

td.summary-synthesis {
  background: var(--sabbia);
  border-left: 1.5px dashed var(--accent);
}

.summary-phrase {
  display: block;
  color: var(--ink-2);
}

.summary-source-name {
  display: block;
  color: var(--ink-3);
}

.summary-quote {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.summary-quote.is-computed {
  font-family: var(--font);
}

.summary-note {
  color: var(--ink-2);
}

.summary-see-all {
  font-size: var(--t-micro);
  white-space: nowrap;
}

.summary-precision {
  white-space: nowrap;
  color: var(--ink-2);
}

.summary-legend {
  margin: var(--s2) 0 0;
}

.legend-synthesis,
.legend-source {
  display: inline-block;
  margin-right: var(--s3);
}

@media (max-width: 48rem) {
  /* A card per category, three lines, nothing that scrolls sideways (audit §M, AC-H7). */
  .summary-table,
  .summary-table tbody,
  .summary-table tr,
  .summary-table th,
  .summary-table td {
    display: block;
  }

  .summary-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .summary-table tr {
    padding: var(--s3);
    border-bottom: 1px solid var(--line);
  }

  .summary-table tbody tr:last-child {
    border-bottom: 0;
  }

  .summary-table th,
  .summary-table td {
    padding: 0;
    border: 0;
  }

  td.summary-synthesis {
    margin: var(--s1) 0;
    padding: var(--s2);
    border: 1.5px dashed var(--accent);
    border-radius: 6px;
  }

  .summary-precision::before {
    content: attr(data-label);
    color: var(--ink-3);
  }
}

/* The chips: every card one tap away, and the one being read marked. */
.report-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 calc(-1 * var(--s2)) var(--s5);
  padding: var(--s2);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}

.report-nav ul {
  display: flex;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.report-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: var(--t-small);
  color: var(--ink-2);
  text-decoration: none;
}

.report-nav a[aria-current='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.category-card {
  margin: 0 0 var(--s5);
  scroll-margin-top: 4rem;
}

.report-section {
  margin: 0 0 var(--s6);
  scroll-margin-top: 4rem;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s3);
  margin: 0 0 var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--line);
}

.chip {
  font-size: var(--t-micro);
  padding: 2px var(--s2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  white-space: nowrap;
}

.computed-table-wrap {
  overflow-x: auto;
}

.computed-table {
  font-size: var(--t-small);
  background: transparent;
}

.computed-table caption {
  caption-side: top;
  text-align: left;
  font-size: var(--t-micro);
  color: var(--ink-2);
  padding-bottom: var(--s1);
}

.computed-table th,
.computed-table td {
  padding: var(--s1) var(--s3) var(--s1) 0;
  border-bottom: 1px solid rgb(165 80 43 / 0.2);
}

.computed-line {
  margin: 0 0 var(--s1);
}

.hazard-map .swatch-point {
  background: var(--accent) !important;
  border-color: #fff !important;
}

.swatch-radius {
  border: 1.5px dashed #1a1d1a !important;
  background: transparent !important;
  border-radius: 50% !important;
}

.back-to-summary {
  position: fixed;
  right: var(--s4);
  bottom: calc(var(--s4) + env(safe-area-inset-bottom));
  z-index: 25;
  margin: 0;
}

.back-to-summary a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s3);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.12);
  font-size: var(--t-small);
  text-decoration: none;
}

details.technical {
  font-size: var(--t-small);
}

details.technical dl {
  margin-top: var(--s3);
}

/* Wide screens: level and phrase, source and value, each on one line where they fit (AC-I1). */
@media (min-width: 48.01rem) {
  .summary-table th:nth-child(1) {
    width: 14%;
  }

  .summary-table th:nth-child(2) {
    width: 38%;
  }

  .summary-table th:nth-child(4) {
    width: 16%;
  }

  .summary-phrase {
    display: inline;
  }

  .summary-phrase::before {
    content: ' — ';
  }

  .summary-source-name {
    display: inline;
  }

  .summary-source-name::after {
    content: ': ';
  }
}

@media (max-width: 48rem) {
  .summary-precision {
    white-space: normal;
  }
}

/* ─── Footer links and versions (audit §L) ─────────────────────────────── */

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin: 0 0 var(--s3);
  font-size: var(--t-small);
}

.footer-links a {
  color: var(--ink-2);
}

.site-footer > p {
  margin-bottom: var(--s3);
}

.footer-versions {
  margin: 0 0 var(--s4);
}

.footer-versions summary {
  cursor: pointer;
  color: var(--ink-2);
}

.footer-versions .data {
  margin-top: var(--s3);
}

/* The source behind each category and the year of its update (audit §L). */
.indicator-source {
  display: block;
  margin-top: var(--s1);
  font-size: var(--t-micro);
  color: var(--ink-3);
}

@media (max-width: 22.5rem) {
  /* On the narrowest phones the name yields to the search: the mark stays and still names the link. */
  .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Declared gaps: one disclosure each, the gap named on it (audit §L). */
details.gap {
  border-bottom: 1px solid var(--line);
  padding: var(--s3) 0;
  max-width: var(--measure);
}

details.gap summary {
  cursor: pointer;
}

details.gap p {
  margin: var(--s2) 0 0;
  color: var(--ink-2);
  font-size: var(--t-small);
}

/* ═══ UX specification v1/v2 — feedback, funnel, states ═══════════════════ */

/* System states (§F.1; docs/design-system.md): never for a reading of the data. */
:root {
  --critical: #9e2b1b;
  --info: #27598f;
  --shadow-elevated: 0 12px 32px rgb(26 29 26 / 0.12);
  --header-h: 57px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --critical: #d97762;
    --info: #7fa8d4;
    --shadow-elevated: 0 12px 32px rgb(0 0 0 / 0.45);
  }
}

.icon {
  display: inline-block;
  flex: none;
  vertical-align: -0.2em;
}

/* Work in progress; still under reduced motion. */
.spinner {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.2em;
  animation: busy 0.8s linear infinite;
  flex: none;
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.6;
  }
}

/* ─── Header: sticky, and quieter in the flow (§G.1) ───────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
  background: rgb(250 249 245 / 0.92);
  box-shadow: 0 0 0 100vmax rgb(250 249 245 / 0.92);
  clip-path: inset(0 -100vmax);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgb(19 21 19 / 0.92);
    box-shadow: 0 0 0 100vmax rgb(19 21 19 / 0.92);
  }
}

.site-header.is-funnel .bar-actions {
  margin-left: auto;
}

.nav-menu-links {
  box-shadow: var(--shadow-elevated);
}

/* Anchors land below the sticky header. */
[id] {
  scroll-margin-top: calc(var(--header-h) + var(--s3));
}

.report-nav {
  top: var(--header-h);
}

.category-card,
.report-section {
  scroll-margin-top: calc(var(--header-h) + 3.5rem);
}

/* ─── Step bar (§H) ─── */

.stepbar-count-name {
  display: none;
}

@media (max-width: 48rem) {
  .stepbar ol {
    display: none;
  }

  .stepbar-count-name {
    display: inline;
  }

  .stepbar-count {
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
  }
}

/* ─── Search (§G.3, §G.4) ─── */

.search-input {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.search-input input {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 2.5rem;
}

.search-busy {
  position: absolute;
  right: var(--s3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.search-field.is-compact {
  margin-bottom: var(--s4);
}

.suggest-popup {
  box-shadow: var(--shadow-elevated);
}

.candidates a {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--s3);
  align-items: center;
}

.candidates a > :not(.candidate-chevron) {
  grid-column: 1;
  justify-self: start;
}

.candidate-chevron {
  grid-column: 2;
  grid-row: 1 / span 3;
  color: var(--ink-3);
}

.candidate-best {
  justify-self: start;
  font-size: var(--t-micro);
  font-weight: 600;
  color: var(--success);
}

.button-secondary .icon,
.button .icon {
  margin-right: var(--s1);
}

/* ─── Map loading (§G.5, §G.7) ─── */

.map-shell {
  position: relative;
}

.map-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s4);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--t-small);
  text-align: center;
  border-radius: var(--radius);
}

.map-loading.is-failed .spinner {
  display: none;
}

.confirm-map.is-loading,
.map-frame.is-loading {
  opacity: 0;
}

.confirm-map,
.map-frame {
  transition: opacity 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .confirm-map,
  .map-frame {
    transition: none;
  }
}

/* ─── Confirm (§G.5) ─── */

@media (min-width: 64rem) {
  .confirm-layout {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  }
}

.point-status {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin: var(--s3) 0 0;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--t-small);
  color: var(--ink-2);
}

.point-status .icon {
  margin-top: 0.1em;
}

.point-status.is-attention {
  border-color: var(--amber);
  background: var(--warn-soft);
  color: var(--warn);
}

.point-status.is-confirmed {
  border-color: var(--success);
  color: var(--success);
}

.point-reset {
  margin: var(--s1) 0 0;
}

.locate-error {
  margin: var(--s2) 0 0;
  color: var(--warn);
}

.confirm-panel .point-coordinates {
  font-family: var(--mono);
  font-size: var(--t-micro);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.manual-coordinates .link-button .icon {
  margin-right: var(--s1);
}

/* Proposed marker: movable; confirmed: settled. */
.point-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 30px;
  height: 30px;
  border: 2px dashed var(--accent);
  border-radius: 50%;
  transform: translate(-50%, 50%);
  animation: marker-ring 1.8s ease-in-out infinite;
  pointer-events: none;
}

.point-marker.is-confirmed::after {
  border-style: solid;
  animation: marker-close 0.35s ease-out forwards;
}

@keyframes marker-ring {
  50% {
    transform: translate(-50%, 50%) scale(1.25);
    opacity: 0.55;
  }
}

@keyframes marker-close {
  to {
    transform: translate(-50%, 50%) scale(0.45);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .point-marker::after,
  .point-marker.is-confirmed::after {
    animation: none;
  }
}

@media (max-width: 48rem) {
  .confirm-cta {
    box-shadow: var(--shadow-elevated);
  }
}

/* ─── Preview (§G.6) ─── */

.summary-bar {
  display: grid;
  grid-template-columns: repeat(2, auto) 1fr;
  align-items: center;
  gap: var(--s2) var(--s5);
  margin: 0 0 var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary-stat {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: 0;
}

.summary-stat-value {
  font-size: 1.6rem;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-stat-label {
  font-size: var(--t-small);
  color: var(--ink-2);
}

.summary-stat.is-available .icon,
.summary-stat.is-available .summary-stat-value {
  color: var(--success);
}

.summary-stat.is-unavailable .icon,
.summary-stat.is-unavailable .summary-stat-value {
  color: var(--neutral-state);
}

.summary-bar .availability-summary {
  margin: 0;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--ink-2);
}

@media (max-width: 48rem) {
  .summary-bar {
    grid-template-columns: repeat(2, auto);
  }

  .summary-bar .availability-summary {
    grid-column: 1 / -1;
  }
}

.availability-table .state-icon {
  width: 18px;
  height: 18px;
  border: 0;
  background: none;
  vertical-align: -0.25em;
}

.is-available .state-icon {
  color: var(--success);
  background: none;
}

.is-unavailable .state-icon {
  color: var(--neutral-state);
  border: 0;
}

@media (min-width: 64rem) {
  .order-block {
    position: static;
  }
}

.field-error {
  color: var(--critical);
}

[aria-invalid='true'] {
  border-color: var(--critical);
  outline-color: var(--critical);
}

/* Between the order and the report (§G.6). */
.submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--s5);
  background: rgb(250 249 245 / 0.86);
  backdrop-filter: blur(2px);
}

@media (prefers-color-scheme: dark) {
  .submit-overlay {
    background: rgb(19 21 19 / 0.86);
  }
}

.submit-overlay-card {
  max-width: 26rem;
  padding: var(--s5) var(--s6);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
}

.submit-overlay-card .spinner {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent);
}

.submit-overlay-title {
  margin: var(--s3) 0 var(--s1);
  font-weight: 600;
}

.order-sticky {
  box-shadow: var(--shadow-elevated);
}

/* ─── Report (§G.7) ─── */

.example-cta {
  display: grid;
  gap: var(--s3);
  margin-top: var(--s3);
}

.example-cta .button-primary,
.example-end .button-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
}

.ready-text {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
}

.ready-text .icon {
  color: var(--success);
  margin-top: 0.1em;
}

.hazard-map .map-frame {
  border-radius: 0;
}

/* ─── Home (§G.3) ─── */

.trust-strip {
  margin: var(--s4) 0 0;
  padding-top: var(--s3);
  border-top: 1px solid rgb(255 255 255 / 0.18);
  font-size: var(--t-small);
  color: #d3dcd9;
}

.trust-lead {
  font-size: var(--t-micro);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb0ab;
  margin-right: var(--s1);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ─── Coverage, legal, data, curtain ─── */

.gap-icon {
  color: var(--neutral-state);
}

.legal-status {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: 0 0 var(--s4);
  color: var(--ink-3);
}

.button-ghost-critical {
  background: transparent;
  border: 1px solid transparent;
  color: var(--critical);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.button-ghost-critical:hover {
  background: transparent;
  color: var(--critical);
  border-color: var(--critical);
}

.curtain {
  padding-top: var(--s8);
}

.curtain form.search {
  margin-top: var(--s4);
}

/* §G.10 */
.alpha {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--bg);
  padding: var(--s2) 0;
}

@media (max-width: 47.99rem) {
  .site-header .lang a,
  .site-header .lang span,
  .site-header .lang button {
    padding: 0.3rem 0.5rem;
  }

  .header-search {
    padding: 0 var(--s2);
  }

  .brand {
    gap: var(--s1);
    font-size: 0.95rem;
  }

  .brand img {
    width: 26px;
    height: 26px;
  }
}

/* Tabular figures (§F.2). */
body {
  font-feature-settings: 'cv11';
}

table,
.stat-value,
.summary-stat-value,
.point-coordinates,
.summary-precision {
  font-variant-numeric: tabular-nums;
}

/* No zone flagged: the source covers the area and gives the point no class — neutral, as data absent. */
.is-no-zone .state-icon {
  color: var(--neutral-state);
}

.is-no-zone .availability-state {
  color: var(--ink-2);
}
