/* IRC lung health blueprint: coalition front end.
   Calm, clinical, neutral. Red is for links and actions only, never for a status. */

:root {
  color-scheme: light;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1a1f24;
  --ink-2: #39424c;
  --muted: #5b6470;
  --line: #e4e1db;
  --line-strong: #bdb9b1;
  --soft: #f0eee9;
  --softer: #f8f7f4;
  --accent: #cb1337;
  --accent-hover: #a50f2c;
  --accent-ink: #ffffff;
  /* Purple marks the overview of all countries (All countries, Compare countries); never a status. */
  --overview: #5a2d82;
  --overview-band: color-mix(in srgb, #5a2d82 10%, #ffffff);
  --focus: #cb1337;
  --error: #8f0d27;
  --error-bg: #fbf0f2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(26, 31, 36, 0.04), 0 4px 16px rgba(26, 31, 36, 0.05);
  --shadow-lg: 0 12px 48px rgba(26, 31, 36, 0.18);
  --page: 52rem;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 600;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1.05rem;
}
h1:focus,
h2:focus {
  outline: none;
}
p {
  margin: 0 0 0.9em;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection {
  background: #f6d3db;
}
small {
  font-size: 0.85em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.lead {
  font-size: 1.08rem;
  color: var(--ink-2);
  max-width: 40em;
}
.eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4em;
}
.eyebrow a {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.h-small {
  font-size: 1rem;
  margin-bottom: 0.4em;
}
.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}
[hidden] {
  display: none !important;
}
.ico {
  flex: none;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

/* ---------- frame */

.skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus {
  top: 8px;
}

.preview-banner {
  margin: 0;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.pb-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  max-width: 72rem;
}
.pb-text {
  margin: 0;
  padding: 5px 0;
  text-align: center;
}
.pb-text b {
  font-weight: 600;
  color: var(--ink);
}
.pb-more {
  display: none;
}

.app-header {
  background: #ffffff;
  border-bottom: 2px solid var(--accent);
  position: relative;
  z-index: 20;
}
/* Sticky only where there is room for it: never on phones or on short screens (200% zoom on a laptop). */
@media (min-width: 720px) and (min-height: 501px) {
  .app-header {
    position: sticky;
    top: 0;
    background: #ffffff;
  }
}
@media (max-width: 719px), (max-height: 500px) {
  html {
    scroll-padding-top: 16px;
  }
}
.app-header .wrap {
  max-width: 72rem;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover {
  color: var(--ink);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-text b {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
}
.brand-text small {
  color: var(--muted);
  font-size: 0.78rem;
}
.nav {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 9px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.nav a:hover {
  background: var(--soft);
  color: var(--ink);
}
.nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--soft);
  box-shadow: inset 0 -2px 0 var(--ink);
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

main {
  flex: 1;
  padding-top: 28px;
  padding-bottom: 64px;
  outline: none;
}
main.enter {
  animation: enter 0.22s var(--ease);
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.app-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 20px 0 28px;
}
.app-footer p {
  margin: 0 0 8px;
  max-width: 44em;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.08s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(203, 19, 55, 0.25);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--soft);
  border-color: transparent;
}
.btn.big {
  min-height: 54px;
  padding: 13px 24px;
  font-size: 1.05rem;
  border-radius: 12px;
}
.btn.small {
  font-size: 0.875rem;
  padding: 8px 14px;
}
.btn .chev {
  transition: transform 0.15s var(--ease);
}
.btn:hover .chev {
  transform: translateX(2px);
}
.linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 4px;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.linkbtn:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 0;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
  flex: none;
}
.icon-btn:hover {
  background: var(--line);
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- status words and tiers: the status scale (P-27) in colour, each with its glyph; tiers stay neutral */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  position: relative;
}
/* A status button is a 44 px tall box around the smaller pill. */
.status-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
}
.status-btn .status {
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.status-btn:hover .status,
.status-btn[aria-expanded='true'] .status {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink);
}
.st-glyph { width: 1em; height: 1em; flex: none; }
.status .st-glyph { margin-left: -3px; }
.status.s-best { background: var(--st-best); border-color: var(--st-best); color: var(--st-best-ink); }
.status.s-min { background: var(--st-min); border-color: var(--st-min); color: var(--st-min-ink); }
.status.s-partly { background: var(--st-partly); border-color: var(--st-partly); color: var(--st-partly-ink); }
.status.s-none { background: var(--st-none); border-color: var(--st-none); color: var(--st-none-ink); }
.status.s-nf { background-color: var(--st-nf); background-image: repeating-linear-gradient(135deg, rgba(118, 118, 118, 0.35) 0 1px, transparent 1px 5px); border-color: var(--st-nf-line); color: var(--st-nf-ink); }
.status.s-nyc { background: var(--surface); border: 1px dashed var(--st-nyc-line); color: var(--st-nyc-ink); }
/* Phase 1: one neutral pill for any finding with a source; not a status colour, so it never reads as a grade. */
.status.s-found { background: var(--surface); border-color: var(--ink-2); color: var(--ink); }
.status .ico {
  font-size: 0.95rem;
  color: var(--ink-2);
}
.status-count {
  font-weight: 600;
  margin-left: 2px;
  font-variant-numeric: tabular-nums;
}
.scope {
  font-size: 0.85rem;
  color: var(--ink-2);
  font-weight: 500;
  margin-left: 4px;
}
.status-summary {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status-summary .status {
  font-size: 0.78rem;
  padding: 1px 9px 1px 7px;
}

.tier {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  position: relative;
  line-height: 1.6;
}
/* The tier is small plain text with a dotted underline: a button for its meaning, never a second pill. */
.tier-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  margin: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.tier-text {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.tier-btn:hover,
.tier-btn[aria-expanded='true'] {
  color: var(--ink);
}

.tip {
  position: absolute;
  z-index: 60;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px 14px 4px;
  font-size: 0.875rem;
  line-height: 1.5;
  animation: pop 0.14s var(--ease);
}
.tip p {
  margin: 0 0 8px;
}
.tip-title {
  color: var(--muted);
  font-size: 0.8rem;
}
.tip-title strong {
  color: var(--ink);
  font-weight: 600;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}

.ai-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.45;
}
.ai-badge {
  flex: none;
  border: 1px solid var(--muted);
  border-radius: 5px;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0 5px;
  line-height: 1.6;
  margin-top: 1px;
  letter-spacing: 0.04em;
}
.preview-note,
.signin-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--ink-2);
  background: var(--soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 16px 0;
}
.preview-note .ico,
.signin-note .ico {
  margin-top: 3px;
  color: var(--muted);
}

/* ---------- start */

.hero {
  padding: 8px 0 8px;
}
.hero h1 {
  font-size: 1.9rem;
  max-width: 18em;
}
.resume {
  margin: 4px 0 8px;
}
.pick {
  margin-top: 24px;
}
.pick-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.pick-head h2 {
  margin: 0;
}
.filter input {
  width: 15rem;
  max-width: 100%;
}
.country-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr));
  gap: 8px;
}
.country-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 12px 14px;
  min-height: 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.country-card:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.cc-name {
  font-weight: 500;
}
.cc-progress {
  grid-row: 2;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.3em;
}
.country-card .chev {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--muted);
  transition: transform 0.15s var(--ease);
}
.country-card:hover .chev,
.area-row:hover .chev,
.link-card:hover .chev {
  transform: translateX(2px);
  color: var(--ink);
}
.no-match {
  margin-top: 12px;
}
.more {
  margin-top: 40px;
}
.link-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.link-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.link-card:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.link-card > .ico:first-child {
  font-size: 1.25rem;
  color: var(--ink-2);
}
.link-card span {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.link-card b {
  font-weight: 500;
}
.link-card small {
  color: var(--muted);
  font-size: 0.85rem;
}
.link-card .chev {
  color: var(--muted);
}

/* ---------- forms */

input[type='text'],
input[type='search'],
input[type='url'],
input[type='email'],
.signin-form select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 46px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:hover,
textarea:hover {
  border-color: var(--ink-2);
}
/* Text fields take a dark focus ring: red is for links and actions, and must not look like an error. */
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}
input[aria-invalid='true'],
textarea[aria-invalid='true'],
.has-error input[type='url'],
.has-error textarea {
  border-color: var(--error);
  border-width: 2px;
}
textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.5;
}
::placeholder {
  color: #858c95;
}
.field {
  margin: 16px 0;
}
.field > label,
.label-like,
fieldset.field > legend {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  padding: 0;
}
.opt {
  font-weight: 400;
  color: var(--muted);
}
.hint {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 6px 0 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.form-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-left: 4px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-weight: 500;
  font-size: 0.92rem;
  margin: 12px 0;
}
.form-error .ico {
  margin-top: 4px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.vh-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.vh-file:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.file-name {
  font-size: 0.875rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.choices {
  display: grid;
  gap: 10px;
  margin: 8px 0 4px;
}
.choices > legend {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 10px;
  padding: 0;
}
.choice {
  position: relative;
  display: block;
  cursor: pointer;
}
.choice input,
.pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choice-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 14px 48px;
  min-height: 64px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  position: relative;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.choice-box::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.choice-box b {
  font-weight: 600;
}
.choice-box small {
  color: var(--muted);
  font-size: 0.875rem;
}
.choice:hover .choice-box {
  border-color: var(--ink-2);
}
.choice input:checked + .choice-box {
  border-color: var(--ink);
  background: var(--softer);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.choice input:checked + .choice-box::before {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 5px var(--ink);
}
.choice input:focus-visible + .choice-box {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.reveal {
  padding: 2px 0 0 0;
  animation: enter 0.18s var(--ease);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  cursor: pointer;
  position: relative;
}
.pill > span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.875rem;
  background: var(--surface);
}
.pill .status {
  padding: 1px 9px;
}
.pill input:checked + span {
  border-color: var(--ink);
  background: var(--softer);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.pill input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- page heads and country home */

.page-head {
  margin-bottom: 20px;
}
.page-head h1 {
  font-size: 2rem;
  margin-bottom: 0.2em;
}
.sub {
  color: var(--muted);
  margin: 0;
}
.crumbs {
  margin: -8px 0 8px;
}
.crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.crumbs a:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.need {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px 12px;
  box-shadow: var(--shadow);
  margin-bottom: 36px;
}
.need-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.need-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 600;
}
.big-num {
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.need-kinds {
  font-size: 1.02rem;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.need-time {
  color: var(--muted);
  font-size: 0.92rem;
}
.need-actions {
  margin: 18px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.done-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 0;
  width: 100%;
}
.wrong-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 8px;
}
.wrong-hint .ico {
  margin-top: 4px;
}
.meter {
  height: 6px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 4px;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--ink-2);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}
.meter-label {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
}

details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 500;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s var(--ease);
  flex: none;
  margin: 0 4px 0 2px;
}
details[open] > summary::before {
  transform: rotate(45deg) translate(-2px, -1px);
}
.qlist {
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.qlist > summary {
  color: var(--ink-2);
}
.qlist-body {
  padding-bottom: 12px;
}
.qlist-area {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 14px 0 4px;
}
.qlist ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.qlist-item {
  display: grid;
  grid-template-columns: 9.5rem 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 8px 8px;
  min-height: 44px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}
.qlist-item:hover {
  background: var(--soft);
  color: var(--ink);
}
.qi-kind {
  font-size: 0.78rem;
  color: var(--muted);
}
.qi-state {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.state-answered .qi-state {
  color: var(--ink);
  font-weight: 500;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
}
.glance > .ai-label {
  margin: 6px 0 14px;
}
.words-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 16px;
  margin: 12px 0 24px;
}
.words-box[open] {
  padding-bottom: 14px;
}
.words-box p {
  font-size: 0.92rem;
  color: var(--ink-2);
}
.word-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.word-list li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 4px 12px;
  align-items: start;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.word-list .status {
  justify-self: start;
}
.group {
  margin-top: 28px;
}
.group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.area-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.area-list li + li {
  border-top: 1px solid var(--line);
}
.area-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s var(--ease);
}
.area-row:hover {
  background: var(--softer);
  color: var(--ink);
}
.area-row:focus-visible {
  outline-offset: -3px;
}
.area-letter {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.88rem;
}
.area-letter.big {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  margin-right: 12px;
  vertical-align: 0.15em;
  border-radius: 11px;
}
.area-letter.small {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
  border-radius: 7px;
}
.area-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.area-title {
  font-weight: 500;
}
.area-meta {
  font-size: 0.84rem;
  color: var(--muted);
}
.area-meta .has-q {
  color: var(--ink);
  font-weight: 500;
}
.area-row .chev {
  align-self: center;
  color: var(--muted);
  transition: transform 0.15s var(--ease);
}
.area-row.unchecked .area-title {
  color: var(--ink-2);
}

/* ---------- area page */

.area-head h1 {
  display: flex;
  align-items: center;
  font-size: 1.85rem;
}
.area-head .lead {
  margin-top: 6px;
}
.measures {
  display: grid;
  gap: 14px;
}
.measure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 10px;
  box-shadow: 0 1px 1px rgba(26, 31, 36, 0.02);
  scroll-margin-top: 90px;
}
.measure.hl {
  animation: flash 2.2s var(--ease);
}
@keyframes flash {
  0%,
  30% {
    box-shadow: 0 0 0 3px var(--ink-2);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.measure-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}
.measure-title {
  font-size: 1.08rem;
  margin: 0 0 10px;
}
.mid {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85em;
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.measure-status {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.finding {
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 42em;
}
.bp {
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.bp > summary {
  font-size: 0.9rem;
  color: var(--ink-2);
}
.bp-lines {
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}
.bp-lines div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 2px 12px;
  font-size: 0.92rem;
}
.bp-lines dt {
  font-weight: 500;
  color: var(--muted);
}
.bp-lines dd {
  margin: 0;
}
.measure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.ask {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin: 8px 0 12px;
  padding: 10px 14px;
  min-height: 48px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.ask:hover {
  border-color: var(--ink);
  background: var(--softer);
  color: var(--ink);
}
.ask.answered {
  border-style: solid;
  border-color: var(--line);
  color: var(--ink-2);
  font-weight: 400;
}
.ask-text {
  display: flex;
  flex-direction: column;
}
.ask-said {
  font-size: 0.85rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.mine .linkbtn {
  margin-top: 2px;
}
.area-start {
  margin: 14px 0 6px;
}
.confirm-ok {
  font-weight: 500;
}
.deleted-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 14px;
}
.steps {
  margin: 0 0 8px;
  padding-left: 1.4em;
}
.steps li {
  margin-bottom: 4px;
}
.any-one {
  font-weight: 500;
  margin: 12px 0 0;
}
.by-area-h {
  margin-top: 18px;
}
.by-area {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.by-area li + li {
  border-top: 1px solid var(--line);
}
.by-area-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  padding: 10px 14px;
  min-height: 52px;
  color: var(--ink);
  text-decoration: none;
}
.by-area-item:hover {
  background: var(--softer);
  color: var(--ink);
}
.ba-title {
  font-weight: 500;
}
.ba-meta {
  grid-column: 1;
  font-size: 0.85rem;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.by-area-item .chev {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--accent);
}
.by-area-item.done .ba-title {
  color: var(--ink-2);
}
.ask-go {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
}
.mine {
  background: var(--softer);
  border-left: 3px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  margin: 8px 0 12px;
  font-size: 0.9rem;
}
.mine-title {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
.area-end {
  margin: 32px 0 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.area-end p {
  margin: 0;
}
.ok-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}
.pager a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  max-width: 48%;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
}
.pager a:hover {
  background: var(--soft);
  color: var(--ink);
}
.pager span {
  display: flex;
  flex-direction: column;
}
.pager small {
  color: var(--muted);
  font-weight: 400;
}
.pager .next {
  margin-left: auto;
  text-align: right;
}

/* ---------- sheet */

dialog.sheet {
  padding: 0;
  border: 0;
  margin: 0 0 0 auto;
  width: min(38rem, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  border-radius: 18px 0 0 18px;
  overflow: hidden;
  animation: slide-in 0.24s var(--ease);
}
dialog.sheet.closing {
  animation: slide-out 0.16s ease-in forwards;
}
dialog.sheet::backdrop {
  background: rgba(20, 24, 28, 0.42);
  animation: fade 0.24s var(--ease);
}
dialog.sheet.closing::backdrop {
  animation: fade 0.16s ease-in reverse forwards;
}
@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@keyframes slide-out {
  to {
    transform: translateX(24px);
    opacity: 0;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.sheet-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sheet-label {
  margin: 0 0 2px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
}
#sheet-title {
  font-size: 1.15rem;
  margin: 0;
}
.sheet-body {
  padding: 16px 20px 32px;
}
/* Save and Cancel stay in view at the foot of the sheet at every width. */
.sheet-foot {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  margin: 0 -20px -32px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  z-index: 2;
}
.ev-status {
  margin-bottom: 4px;
}
.ev-block {
  margin: 18px 0;
}
.ev-block h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 8px;
}
blockquote.quote {
  margin: 0 0 10px;
  padding: 14px 16px;
  background: var(--softer);
  border-left: 3px solid var(--ink-2);
  border-radius: 0 10px 10px 0;
  font-family: var(--serif);
  font-size: 1.04rem;
  line-height: 1.6;
  white-space: pre-line;
}
.ev-part {
  margin: 18px 0 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sheet-body > .ev-part:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.ev-part-h {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 8px;
}
.our-translation {
  margin: 0 0 12px 14px;
}
.tr-label,
.data-h,
.loc-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 4px;
}
blockquote.quote.tr {
  font-family: var(--font);
  font-size: 0.95rem;
  background: var(--surface);
  border-left: 3px dotted var(--line-strong);
}
blockquote.quote.raw {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.tr-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -4px 0 8px;
}
.data-fields {
  margin: 0 0 8px;
  display: grid;
  gap: 2px;
  font-size: 0.95rem;
  background: var(--softer);
  border-radius: 10px;
  padding: 10px 14px;
}
.data-fields div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 8px;
}
.data-fields dt {
  color: var(--muted);
}
.data-fields dd {
  margin: 0;
  font-weight: 500;
}
.data-src {
  font-size: 0.9rem;
  margin: 0 0 6px;
}
.raw-record {
  border-top: 0;
}
.loc-label {
  display: inline;
}
.src-unnamed,
.src-again {
  font-size: 0.9rem;
  color: var(--ink-2);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
}
.source.missing {
  color: var(--ink-2);
}
.gap-mark {
  color: var(--muted);
}
.locator {
  font-size: 0.88rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.sources {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.source {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 6px;
}
.src-title {
  font-weight: 500;
  margin-bottom: 6px;
}
.src-meta {
  margin: 0 0 6px;
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
}
.src-meta div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 8px;
}
.src-meta dt {
  color: var(--muted);
}
.src-meta dd {
  margin: 0;
}
.src-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}
.src-link,
.src-none {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
}
.src-link {
  text-decoration: none;
}
.src-label {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.src-link:hover .src-label {
  text-decoration-thickness: 2px;
}
.src-n {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 2px;
}
.src-link > span:not(.vh) {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.host {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}
.src-none {
  color: var(--muted);
  font-weight: 400;
}
.ev-more {
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.ev-more > summary {
  color: var(--ink-2);
}
.ev-more ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
  color: var(--ink-2);
}
.ev-more li {
  margin-bottom: 6px;
}
.sheet-actions {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 6px;
}
.about {
  font-weight: 500;
  margin-bottom: 6px;
}
.about-status {
  display: inline-block;
  margin-left: 4px;
}
.small-finding {
  font-size: 0.9rem;
  color: var(--ink-2);
  background: var(--softer);
  border-radius: 10px;
  padding: 10px 12px;
}

/* ---------- questions */

.q-progress p {
  margin: 0;
  font-size: 0.9rem;
}
.q-progress .meter {
  margin: 8px 0 18px;
}
.flash {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.9rem;
  animation: enter 0.25s var(--ease);
}
.question {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px 8px;
  box-shadow: var(--shadow);
}
.q-kind {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 8px;
}
.kind-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--softer);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.q-area {
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.question h1 {
  font-size: 1.5rem;
}
.q-ask {
  font-size: 1.1rem;
  color: var(--ink-2);
  font-weight: 500;
}
.note-line {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.q-ctx {
  margin: 18px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.q-ctx .h-small {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.callout {
  background: var(--softer);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
}
.callout-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0 0 4px;
}
.callout p:last-child {
  margin-bottom: 0;
}
.answer-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.q-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.done {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 20px;
  margin: 12px 0 20px;
  box-shadow: var(--shadow);
}

/* ---------- contributions */

.export {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 6px;
  margin-bottom: 24px;
}
.list-count {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.contrib-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.contrib {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px 6px;
}
.contrib-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.contrib-title {
  font-weight: 500;
  margin-bottom: 6px;
}
.contrib-title a {
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}
.contrib-title .muted {
  display: block;
  font-weight: 400;
}
.c-fields {
  margin: 0;
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
}
.c-fields div {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 8px;
}
.c-fields div:has(.c-answer) {
  grid-template-columns: 1fr;
}
.c-fields dt {
  color: var(--muted);
}
.c-fields dd {
  margin: 0;
}
.c-answer {
  font-weight: 600;
}
.c-link {
  overflow-wrap: anywhere;
}
.c-text {
  white-space: pre-wrap;
}
.contrib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 2px;
}
.confirm {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
}
.empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: left;
}
.empty.problem h1 {
  font-size: 1.4rem;
}
.others {
  margin-top: 20px;
}

/* ---------- blueprint and words */

.tiers-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 8px;
  margin-bottom: 20px;
}
.tier-defs,
.defs {
  margin: 0 0 12px;
  display: grid;
  gap: 12px;
}
.tier-defs div,
.defs div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 4px 16px;
  align-items: start;
}
.tier-defs dd,
.defs dd {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-2);
}
.defs.plain dt {
  font-weight: 500;
}
.tier.static {
  font-size: 0.8rem;
}
.bp-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 4px;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--soft);
  border-radius: 12px;
}
.seg label {
  position: relative;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.seg span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.seg input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(26, 31, 36, 0.12);
}
.seg input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.bp-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 8px 0;
  scroll-margin-top: 90px;
}
.bp-area > summary {
  padding: 10px 16px;
  min-height: 60px;
}
.bp-area > summary .area-letter {
  margin-right: 4px;
}
.bp-area-title {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.bp-count {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.82rem;
}
.bp-area-body {
  padding: 0 16px 8px;
}
.bp-area-body .scope {
  color: var(--ink-2);
  font-size: 0.94rem;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.bp-measures {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bp-measures li {
  border-top: 1px solid var(--line);
  padding: 12px 0 2px;
}
.bp-m-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 12px;
}
.bp-m-head h3 {
  font-size: 0.98rem;
  font-weight: 500;
  margin: 0 0 8px;
}

/* ---------- overview */

.ov-summary {
  font-size: 1.02rem;
  font-weight: 500;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cell {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  vertical-align: middle;
}
.cell.on {
  background: var(--ink-2);
  border-color: var(--ink-2);
}
.ov-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ov-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
.ov-table th,
.ov-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.ov-table tbody tr:last-child th,
.ov-table tbody tr:last-child td {
  border-bottom: 0;
}
.ov-table tbody tr:hover {
  background: var(--softer);
}
.ov-table .ov-country {
  text-align: left;
  padding-left: 16px;
  font-weight: 500;
  white-space: nowrap;
}
.ov-table .ov-country a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.ov-table .ov-country a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.ov-area {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
  width: 26px;
}
.ov-area abbr {
  text-decoration: none;
  cursor: help;
}
.ov-words {
  text-align: left !important;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  padding-right: 16px !important;
  padding-left: 12px !important;
}
.ov-list {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ov-list li + li {
  border-top: 1px solid var(--line);
}
.ov-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  color: var(--ink);
  text-decoration: none;
}
a.ov-item:hover {
  background: var(--softer);
  color: var(--ink);
}
.ov-name {
  font-weight: 500;
}
.ov-w {
  font-size: 0.85rem;
  color: var(--ink-2);
}
.ov-areas {
  font-size: 0.8rem;
  color: var(--muted);
}
.cells {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}
.cells .cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.ov-key {
  margin: 20px 0 16px;
}
.ov-partly {
  display: block;
  white-space: normal;
  font-size: 0.75rem;
}
.ov-list .ov-name {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.key-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 2px 16px;
}
.key-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  font-size: 0.9rem;
}

/* ---------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 18px;
  min-height: 48px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.toast:empty {
  display: none;
}
.toast-action {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.toast-action:focus-visible {
  outline-color: #fff;
}

.print-only {
  display: none;
}
.loading {
  padding: 40px 0;
}

/* ---------- wider screens */

@media (min-width: 720px) {
  .wrap {
    padding-left: 24px;
    padding-right: 24px;
  }
  main {
    padding-top: 40px;
  }
  .hero h1 {
    font-size: 2.4rem;
  }
  .page-head h1 {
    font-size: 2.3rem;
  }
  .area-head h1 {
    font-size: 2.05rem;
  }
  .need {
    padding: 28px 30px 14px;
  }
  .question {
    padding: 28px 30px 12px;
  }
  .question h1 {
    font-size: 1.75rem;
  }
  .measure {
    padding: 20px 24px 10px;
  }
  .choices {
    grid-template-columns: 1fr 1fr;
  }
  .choices > legend {
    grid-column: 1 / -1;
  }
}

/* ---------- phones */

@media (max-width: 719px) {
  .header-row {
    min-height: 56px;
    padding-top: 6px;
  }
  .brand-text b {
    font-size: 0.92rem;
  }

  .ov-table-wrap,
  .ov-table + .legend {
    display: none;
  }
  .legend {
    display: none;
  }
  .ov-list {
    display: block;
  }
  dialog.sheet {
    margin: auto 0 0 0;
    width: 100vw;
    height: auto;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    animation-name: slide-up;
  }
  dialog.sheet.closing {
    animation-name: slide-down;
  }
  .sheet-scroll {
    max-height: 92dvh;
  }
  @keyframes slide-up {
    from {
      transform: translateY(32px);
      opacity: 0;
    }
  }
  @keyframes slide-down {
    to {
      transform: translateY(32px);
      opacity: 0;
    }
  }
  .sheet-top {
    padding: 14px 16px 12px;
  }
  .sheet-body {
    padding: 14px 16px 0;
  }
  .sheet-foot {
    margin: 0 -16px;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .qlist-item {
    grid-template-columns: 1fr auto;
  }
  .qi-kind {
    grid-column: 1 / -1;
  }
  .word-list li,
  .tier-defs div,
  .defs div,
  .bp-lines div {
    grid-template-columns: 1fr;
  }
  .word-list li .status,
  .defs dt {
    justify-self: start;
  }
  .bp-m-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .q-nav .btn {
    padding-left: 10px;
    padding-right: 10px;
  }
  .need-actions .btn.big {
    width: 100%;
  }
  .filter,
  .filter input {
    width: 100%;
  }
  .area-head h1 {
    font-size: 1.55rem;
    align-items: flex-start;
  }
  .area-letter.big {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    margin-top: 2px;
  }
  .page-head h1 {
    font-size: 1.8rem;
  }
  .pager a {
    max-width: 50%;
  }
}

@media (max-width: 360px) {
  .brand-text b {
    font-size: 0.88rem;
  }
  .big-num {
    font-size: 2.5rem;
  }
}

/* ---------- round 2: IRC wordmark, phone menu and banner */

.wm-irc {
  flex: none;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  line-height: 1;
  padding-right: 10px;
  border-right: 1px solid var(--line-strong);
}
.menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.menu-btn[aria-expanded='true'] {
  background: var(--soft);
  border-color: var(--ink);
}
.tip a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.how {
  list-style: none;
  padding: 0;
  margin: 4px 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-weight: 500;
  color: var(--ink);
}
.how li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.how-n {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

@media (max-width: 1279px) {
  .header-row {
    flex-wrap: nowrap;
    min-height: 56px;
    padding-top: 0;
  }
  .brand {
    min-width: 0;
  }
  .wm-irc {
    font-size: 1.15rem;
    padding-right: 8px;
  }
  .brand-text b {
    font-size: 0.8rem;
    line-height: 1.25;
  }
  .brand-text small {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
    flex: none;
  }
  .app-header {
    position: relative;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 12px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(26, 31, 36, 0.12);
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 8px 12px;
  }
}
@media (max-width: 719px) {
  .pb-row {
    justify-content: space-between;
    min-height: 44px;
  }
  .pb-text {
    text-align: left;
    padding: 4px 0;
  }
  .pb-long {
    display: none;
  }
  .preview-banner.open .pb-long {
    display: inline;
  }
  .pb-more {
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: 44px;
    padding: 0 6px;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }
}

/* ---------- round 2: country at a glance */

.page-head.with-tools {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.print-btn {
  flex: none;
  min-height: 44px;
}
.drafts-line {
  background: var(--surface);
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 10px 16px;
  margin: 0 0 20px;
  font-size: 0.92rem;
}
.drafts-h {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  margin: 0;
}
.drafts-line ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.drafts-line li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
}
.drafts-line a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}
.skipped-line {
  margin: 4px 0 0;
}
.skipped-line a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.general-row {
  margin: 12px 0 0;
}
.glance-lead {
  color: var(--ink-2);
  margin-bottom: 4px;
}
.codes-note {
  margin: 10px 0 0;
}
.ga-list {
  display: grid;
  gap: 12px;
}
.ga-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 16px 10px;
}
.ga-head {
  margin: 0;
  font-size: 1.02rem;
}
.ga-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  color: var(--ink);
  text-decoration: none;
}
.ga-title .ga-name {
  flex: 1;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.ga-title:hover {
  color: var(--ink);
}
.ga-title:hover .ga-name {
  text-decoration-color: var(--ink);
}
.ga-title .chev {
  color: var(--accent);
}
.ga-meta {
  font-size: 0.84rem;
  color: var(--muted);
  margin: -4px 0 6px 46px;
}
.ga-measures {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  border-top: 1px solid var(--line);
}
.ga-measures li {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  gap: 2px 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.4;
}
.ga-measures li:last-child {
  border-bottom: 0;
}
.ga-measures .mid {
  margin: 0;
}
.ga-m-status {
  justify-self: end;
  text-align: right;
}
.ga-m-status .status {
  font-size: 0.8rem;
  padding: 1px 9px 1px 7px;
}
.ga-m-status .scope {
  display: block;
  font-size: 0.78rem;
  margin: 2px 0 0;
}
.ga-area.unchecked .ga-name {
  color: var(--ink-2);
}
.ga-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-height: 48px;
  margin: 6px 0 2px;
  padding: 8px 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.ga-ask:hover {
  border-color: var(--ink);
  background: var(--softer);
  color: var(--ink);
}
.ga-ask-text {
  flex: 1;
}
.ga-ask-time {
  color: var(--ink-2);
  font-weight: 400;
  font-size: 0.85rem;
}
.ga-ask .chev {
  color: var(--accent);
}
.ga-done {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
}
@media (min-width: 720px) {
  .ga-measures li {
    grid-template-columns: 2.4rem 1fr minmax(8rem, auto);
  }
}
/* On wide screens the areas sit in two columns, wider than the reading column above them. */
@media (min-width: 1240px) {
  .glance .group {
    margin-left: -10rem;
    margin-right: -10rem;
  }
  .ga-list {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
@media (max-width: 719px) {
  .page-head.with-tools {
    flex-direction: column;
    gap: 0;
  }
  .ga-measures li {
    grid-template-columns: 2.2rem 1fr;
  }
  .ga-m-status {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }
  .ga-m-status .scope {
    display: inline;
    margin-left: 4px;
  }
  .ga-meta {
    margin-left: 0;
  }
  .ga-ask {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0 10px;
  }
  .ga-ask-time {
    grid-column: 2;
    grid-row: 2;
  }
  .ga-ask .chev {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

/* ---------- round 2: area page */

.head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.head-row .eyebrow {
  margin: 0;
}
.measure-status {
  gap: 4px 14px;
}
.tier-slot {
  margin-left: auto;
}
.measure-title {
  margin-bottom: 4px;
}
.mine:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- round 2: evidence sheet */

.from-h {
  font-weight: 600;
  font-size: 0.92rem;
  margin: 14px 0 8px;
}
.from-list .src-again {
  margin: 0;
}
.data-rec {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--softer);
}
.data-rec .data-h {
  margin: 0 0 6px;
}
.data-rec .data-fields + .data-fields {
  margin-top: 8px;
}
.quote-note {
  margin-top: 4px;
}
.ev-found {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.src-title.untitled {
  font-style: italic;
  color: var(--ink-2);
}

.q-area {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.key-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 1280px) {
  .app-header .wrap {
    max-width: 80rem;
  }
  .nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .nav a {
    padding: 6px 9px;
  }
}

/* ---------- round 2: forms and contributions */

.any-group {
  border-left: 3px solid var(--line);
  padding-left: 14px;
  margin: 12px 0 0;
}
.any-group.has-error {
  border-left-color: var(--error);
}
.any-group .any-one {
  margin-top: 4px;
}
.q-ask-sub {
  color: var(--ink-2);
  margin-top: -4px;
}
.download-note {
  font-weight: 500;
  margin: 12px 0 0;
}
.ov-key > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
}
@media (max-width: 479px) {
  .c-fields div {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .c-fields div + div {
    margin-top: 4px;
  }
}

/* ---------- motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


/* ---------- round 3 */

/* saved messages: one line where the reader is looking, never over a button */
.flash > p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin: 0;
}
.flash > p > .ico {
  flex: none;
}
.flash > p > span {
  flex: 1;
}
.flash a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}
.flash .flash-sub {
  display: block;
  color: var(--ink-2);
  font-size: 0.86rem;
  margin: -4px 0 2px 24px;
}
.flash .flash-sub a {
  display: inline-block;
  min-height: 44px;
  padding: 12px 0;
  margin: -12px 0;
  line-height: 20px;
}
.flash .flash-sub {
  line-height: 20px;
  margin: 0 0 6px 24px;
}
.saved-where,
.saved-here {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0 4px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.saved-where .ico,
.saved-here .ico {
  flex: none;
  margin-top: 4px;
}
.saved-where a,
.saved-here a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}
.saved-here {
  background: var(--softer);
  border-radius: 10px;
  padding: 2px 12px;
  margin: 14px 0 6px;
}

/* what we need from you: pick an area you know */
.pick-title {
  font-size: 1.3rem;
  margin: 2px 0 4px;
}
.pick-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 8px;
  display: grid;
  gap: 8px;
}
.pick-area,
.pick-done {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 2px 12px;
  min-height: 52px;
  padding: 8px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
}
.pick-area:hover {
  border-color: var(--ink);
  background: var(--softer);
  color: var(--ink);
}
.pick-area .chev {
  color: var(--accent);
}
.pick-done {
  grid-template-columns: auto 1fr auto;
  border-style: dashed;
  border-color: var(--line);
  color: var(--ink-2);
}
.pick-name {
  font-weight: 500;
}
.pick-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 0.88rem;
  white-space: nowrap;
}
.pick-list .area-letter.small .ico {
  font-size: 0.9rem;
}
.need-total {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.need-total .need-kinds {
  font-size: 0.95rem;
}
.need-total .need-actions {
  margin: 10px 0 4px;
}
@media (max-width: 719px) {
  .pick-area,
  .pick-done {
    grid-template-columns: auto 1fr auto;
  }
  .pick-meta {
    grid-column: 2;
    grid-row: 2;
    white-space: normal;
  }
  .pick-area .chev {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .pick-done .pick-meta {
    grid-column: 2;
  }
}

/* at a glance: each measure is a link to it on its area page */
.ga-measures li {
  display: block;
  padding: 0;
}
.ga-m {
  display: grid;
  grid-template-columns: 2.4rem 1fr minmax(8rem, auto) auto;
  gap: 2px 10px;
  align-items: center;
  min-height: 44px;
  padding: 5px 4px 5px 0;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
}
.ga-m:hover {
  background: var(--softer);
  color: var(--ink);
}
.ga-m:hover .ga-m-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ga-m .chev {
  color: var(--accent);
}
.ga-mine {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 0.78rem;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
}
.ga-mlist {
  border-top: 1px solid var(--line);
}
.ga-mlist > summary {
  font-size: 0.92rem;
}
.ga-mlist .ga-measures {
  border-top: 0;
}
.jump {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  margin: 0 0 16px;
}
.jump > summary {
  font-weight: 500;
}
.jump-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.jump-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.jump-list a span:not(.area-letter) {
  flex: 1;
}
.jump-list a .chev {
  color: var(--accent);
}
@media (max-width: 719px) {
  .ga-m {
    grid-template-columns: 2.2rem 1fr auto;
  }
  .ga-m .ga-m-status {
    grid-column: 2;
    grid-row: 2;
  }
  .ga-m .chev {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

/* the evidence sheet: what it supports first, each quote with the source it is in */
.ev-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--ink-2);
}
.ev-summary > span:last-child {
  flex: 1 1 16rem;
}
.ev-summary .muted {
  font-size: 0.85rem;
}
.quote-group {
  margin: 0 0 14px;
}
.ev-summary + .ev-part {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.quote-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 4px;
}
.quote-in {
  font-size: 0.88rem;
  color: var(--ink-2);
  margin: -2px 0 10px;
}
.quote-in .untitled {
  font-style: italic;
}
.research-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin: -2px 0 10px;
}
.rn-label {
  font-weight: 600;
  color: var(--ink-2);
}
.data-rec .quote-in {
  margin-top: 0;
}
/* links inside running text (a measure code such as "R1") keep their size but get a 44 px tall tap area */
.finding a,
.research-note a,
.small-finding a {
  display: inline-block;
  min-height: 44px;
  padding: 12px 3px;
  margin: -12px -3px;
  line-height: 20px;
}

/* your contributions: download at the top as well */
.send-top {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px 4px;
  margin: 8px 0 18px;
}
.send-top .row-actions {
  margin-top: 4px;
}
.export {
  margin-top: 20px;
}
.clear-pick {
  margin-top: 4px;
}

/* all countries: the area letters stay in view while the grid scrolls */
@media (min-width: 720px) {
  .ov-table-wrap {
    overflow: visible;
  }
  .ov-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
    box-shadow: inset 0 -1px 0 var(--line);
  }
}
@media (min-width: 720px) and (min-height: 501px) {
  .ov-table thead th {
    top: var(--header-h, 66px);
  }
}

/* ---------- print: a clean country summary on one or two A4 pages */

@page {
  size: A4;
  margin: 11mm 12mm 12mm;
}
@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 9.5pt;
    line-height: 1.4;
    display: block;
  }
  .preview-banner,
  .app-header,
  .app-footer,
  .skip,
  .toast,
  .tip,
  dialog,
  .screen-only,
  .crumbs,
  .pager,
  .measure-actions,
  .area-end,
  .ask,
  .preview-note,
  .q-nav,
  .bp-tools,
  .resume,
  .filter,
  .btn,
  .linkbtn {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  main {
    padding: 0;
    max-width: none;
    animation: none !important;
  }
  a {
    color: #000;
    text-decoration: none;
  }
  .status,
  .tier {
    border-color: #888;
    background: none;
  }
  .measure,
  .need,
  .question,
  .bp-area,
  .area-list,
  .area-end,
  .tiers-box,
  .ov-table-wrap {
    box-shadow: none;
    border-color: #bbb;
    break-inside: avoid;
  }
  .measure {
    padding: 8pt 10pt;
    margin-bottom: 6pt;
  }
  .area-head h1 {
    font-size: 16pt;
  }
  details > summary::before {
    display: none;
  }
  .print-summary h1 {
    font-size: 15pt;
    margin: 0 0 3pt;
  }
  .p-meta {
    font-size: 8.5pt;
    color: #333;
    margin: 0 0 5pt;
  }
  .p-key {
    font-size: 7.5pt;
    color: #222;
    border: 0.5pt solid #999;
    border-radius: 3pt;
    padding: 4pt 6pt;
    margin-bottom: 7pt;
    line-height: 1.35;
  }
  .p-cols {
    columns: 2;
    column-gap: 6mm;
  }
  .p-area {
    margin-bottom: 5pt;
    break-inside: avoid;
  }
  .p-owner {
    font-size: 8.5pt;
    font-weight: 600;
    margin: 0 0 2pt;
  }
  .p-area-head h1 {
    font-size: 15pt;
    margin: 0 0 3pt;
  }
  .p-area-head {
    margin-bottom: 8pt;
    border-bottom: 0.75pt solid #000;
    padding-bottom: 4pt;
  }
  .area-head .eyebrow,
  .area-head .sub,
  .area-start,
  .flash,
  .ev-more {
    display: none !important;
  }
  .measure {
    break-inside: auto;
  }
  .measure .bp {
    display: none !important;
  }
  .mine {
    display: none !important;
  }
  .area-head .lead {
    font-size: 10pt;
  }
  .measure-title {
    font-size: 11pt;
  }
  .measure .finding {
    font-size: 9.5pt;
  }
  .measure-head {
    break-after: avoid;
  }
  .p-sources {
    font-size: 8pt;
    color: #222;
    margin: 4pt 0;
  }
  .p-src-h {
    font-weight: 600;
    margin: 0 0 1pt;
  }
  .p-sources ol {
    margin: 0;
    padding-left: 12pt;
  }
  .p-url {
    overflow-wrap: anywhere;
  }
  .p-area h2 {
    break-after: avoid;
  }
  .p-area tr {
    break-inside: avoid;
  }
  .p-area h2 {
    font-size: 8.5pt;
    margin: 0 0 2pt;
    padding-bottom: 1pt;
    border-bottom: 0.75pt solid #000;
    letter-spacing: 0;
  }
  .p-area table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7pt;
    line-height: 1.2;
  }
  .p-area td {
    padding: 0.6pt 2pt 0.6pt 0;
    vertical-align: top;
    border-bottom: 0.25pt solid #ccc;
  }
  .p-id {
    width: 5mm;
    color: #555;
  }
  .p-status {
    width: 17mm;
    white-space: nowrap;
    font-weight: 600;
    text-align: right;
  }
  .p-none {
    font-size: 7.3pt;
    color: #444;
    margin: 0;
  }
  .p-foot {
    font-size: 7.5pt;
    color: #444;
    margin-top: 6pt;
    border-top: 0.5pt solid #999;
    padding-top: 3pt;
  }

  /* round 2: one AI label, the status key, measures kept whole, sources once at the end */
  .print-btn,
  .codes-note,
  .drafts-line,
  .menu-btn {
    display: none !important;
  }
  .measure {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .measure-status .tier-btn {
    min-height: 0;
    font-size: 8pt;
  }
  .status-btn {
    min-height: 0;
  }
  .p-cite {
    font-size: 8pt;
    color: #333;
    margin: 2pt 0 0;
  }
  .p-sources-all {
    margin-top: 10pt;
    font-size: 8pt;
    color: #222;
  }
  .p-sources-all h2 {
    font-size: 11pt;
    margin: 0 0 4pt;
    border-bottom: 0.75pt solid #000;
  }
  .p-sources-all ol {
    margin: 0;
    padding-left: 16pt;
  }
  .p-sources-all li {
    margin-bottom: 2pt;
    break-inside: avoid;
  }
  .p-area-head .p-key {
    margin: 6pt 0 0;
  }
  /* the overview: key and grid together on the first page, nothing cut off */
  .ov-key {
    margin: 4pt 0;
  }
  .ov-key > summary {
    min-height: 0;
  }
  .key-list {
    grid-template-columns: repeat(3, 1fr);
    font-size: 7.5pt;
    gap: 0 8pt;
  }
  .key-list li {
    min-height: 0;
    font-size: 7.5pt;
    gap: 4pt;
  }
  .area-letter.small {
    width: auto;
    height: auto;
    background: none;
    font-size: 7.5pt;
  }
  .page-head h1 {
    font-size: 15pt;
  }
  .page-head .lead,
  .ov-summary {
    font-size: 9pt;
  }
  .ov-table-wrap {
    overflow: visible;
    border: 0;
    break-inside: auto !important;
  }
  .area-head h1 {
    display: none;
  }
  .ov-key .h-small {
    font-size: 10pt;
  }
  .ov-table {
    width: 100%;
    font-size: 7.5pt;
  }
  .ov-table th,
  .ov-table td {
    padding: 1.5pt 2pt !important;
  }
  .ov-table tr {
    break-inside: avoid;
  }
  .ov-words {
    white-space: normal !important;
    font-size: 7pt !important;
  }
  .ov-table .ov-country a {
    min-height: 0;
    text-decoration: none;
    color: #000;
  }
  .cell {
    border: 0.5pt solid #555;
    width: 8pt !important;
    height: 8pt !important;
    border-radius: 1.5pt;
  }
  .ov-words {
    width: 48mm;
  }
  .ov-partly {
    font-size: 7pt;
  }
  .cell.on {
    background: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .legend {
    display: block !important;
    font-size: 7.5pt;
  }
  /* the blueprint: areas flow on, measures kept whole */
  .bp-area {
    break-inside: auto !important;
    border: 0;
    margin: 0 0 6pt;
    padding: 0;
  }
  .bp-area > summary {
    padding: 0;
    min-height: 0;
    font-size: 11pt;
    break-after: avoid;
  }
  .bp-area-body {
    padding: 0;
  }
  .bp-measures li {
    break-inside: avoid;
    padding: 3pt 0;
    font-size: 8pt;
  }
  .bp-m-head {
    align-items: baseline;
  }
  .bp-m-head h3 {
    font-size: 9pt;
    margin: 0 0 1pt;
  }
  .bp-m-head .tier-btn {
    min-height: 0;
    font-size: 7.5pt;
  }
  .bp-lines {
    gap: 1pt;
    margin: 0 0 2pt;
  }
  .bp-lines div {
    padding: 0;
    font-size: 8pt;
    line-height: 1.3;
    grid-template-columns: 22mm 1fr;
    gap: 0 4mm;
  }
  .bp-area-body .scope {
    font-size: 8.5pt;
    padding-top: 2pt;
    margin-bottom: 2pt;
  }
  .tier-defs {
    gap: 2pt;
  }
  .tier-defs div {
    grid-template-columns: 30mm 1fr;
    gap: 0 3mm;
  }
  .tier-defs dd,
  .tiers-box p {
    font-size: 8pt;
    margin: 0;
  }
  .tiers-box {
    font-size: 8pt;
    padding: 4pt 6pt;
  }
  .group-title {
    margin-top: 6pt;
  }
}

/* ---------- round 3 print: full width, no screen cues, tiers on the summary, quotes on area prints */
@media print {
  .tier-text {
    text-decoration: none;
  }
  .measure {
    border: 0;
    border-top: 0.75pt solid #999;
    border-radius: 0;
    padding: 6pt 0 4pt;
    margin: 0;
  }
  .measure .finding,
  .area-head .lead,
  .finding {
    max-width: none;
  }
  .finding a {
    display: inline;
    padding: 0;
    margin: 0;
  }
  .wrap,
  main {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }
  .p-tier {
    width: 3mm;
    color: #333;
    font-weight: 600;
  }
  .p-quotes {
    margin: 3pt 0 0;
    font-size: 8.3pt;
    line-height: 1.35;
  }
  .p-q-h {
    font-weight: 600;
    font-size: 7.5pt;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #444;
    margin: 0 0 1pt;
  }
  .p-q {
    margin: 0 0 2pt;
    padding-left: 5pt;
    border-left: 1pt solid #777;
    font-family: var(--serif);
  }
  .p-q-tr,
  .p-q-note {
    margin: 0 0 2pt 5pt;
    color: #333;
  }
  .p-q-src {
    font-family: var(--font);
    color: #444;
    font-size: 7.5pt;
  }
  .gap-mark {
    font-size: inherit;
  }
  .measure {
    break-inside: auto;
    page-break-inside: auto;
  }
  .measure-title,
  .measure-status,
  .measure .finding {
    break-after: avoid;
  }
  .p-q,
  .p-q-tr {
    break-inside: avoid;
  }
}
@media print {
  .key-list a,
  .ov-table .ov-country a {
    min-height: 0 !important;
  }
  .ov-table thead th {
    position: static;
    box-shadow: none;
  }
  .ga-mine,
  .saved-here,
  .saved-where {
    display: none !important;
  }
}

/* ---------- hosted tool: sign-in, saving line, IRC admin */
.signin { max-width: 40rem; padding: 2rem 0 3rem; }
.signin h1 { margin-bottom: 0.75rem; }
.sync { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 40; max-width: min(36rem, calc(100vw - 2rem)); background: #fff8e1; color: #3d2f00; border: 1px solid #e3c766; border-radius: 8px; padding: 0.6rem 0.9rem; font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); }
.sync[hidden] { display: none; }
.footer-links .who { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.footer-links .linkbtn { min-height: 44px; }
.admin-box { background: var(--soft); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 1rem 0 2rem; }
.admin-box select, .admin-box input[type=text] { width: 100%; max-width: 32rem; }
.signin-form { max-width: 32rem; }
.signin-form select { appearance: auto; cursor: pointer; }
.signin-form select:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.made { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.made-url code { display: block; overflow-wrap: anywhere; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.85rem; }
.table-wrap { overflow-x: auto; }
.admin-table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1.5rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.35rem 0.75rem 0.35rem 0; border-top: 1px solid var(--line); }
.admin-table td { font-variant-numeric: tabular-nums; }
.admin-country { border-top: 1px solid var(--line); padding: 0.25rem 0; }
.admin-country summary { min-height: 44px; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.admin-links { list-style: none; padding: 0; margin: 0.25rem 0 0.75rem; }
.admin-links li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0; border-top: 1px dashed var(--line); }
.admin-links li > div:first-child { display: flex; flex-direction: column; }
.admin-links .is-withdrawn b { text-decoration: line-through; }
.admin-act .confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.admin-act .confirm[hidden] { display: none; }

/* ---------- blueprint proposal */

.proposal {
  --pp-gap: 56px;
}
.pp-hero {
  padding: 8px 0 4px;
}
.pp-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.pp-draft {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 1px 10px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink-2);
  background: var(--surface);
}
.pp-hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 0.35em;
  max-width: 18em;
}
.pp-hero .lead {
  font-size: 1.15rem;
}
.pp-facts {
  list-style: none;
  padding: 0;
  margin: 22px 0 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pp-facts li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.pp-facts b {
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.pp-facts span {
  color: var(--ink-2);
  font-size: 0.88rem;
}
.pp-by {
  margin: 0;
}
.pp-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 8px;
  margin: 24px 0 0;
}
.pp-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0 16px;
}
.pp-toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-top: 1px solid var(--line);
}
.pp-toc a > span:not(.pp-step) {
  flex: 1;
}
.pp-toc a:hover > span:not(.pp-step) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pp-toc a .chev {
  color: var(--accent);
}
.pp-step {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
}
.pp-sec {
  margin-top: var(--pp-gap);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.pp-sec > p,
.pp-sec > .pp-points,
.pp-sec > .pp-tiers,
.pp-callout {
  max-width: 44em;
}
.pp-h {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.6rem;
  margin-bottom: 0.7em;
  scroll-margin-top: 90px;
}
.pp-h .pp-step {
  width: 38px;
  height: 38px;
  font-size: 1rem;
}
.pp-callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 18px 4px;
  margin: 18px 0 8px;
}
.pp-callout h3 {
  font-size: 1.02rem;
  margin-bottom: 0.3em;
}
.pp-points {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 0;
}
.pp-points li {
  padding: 10px 0 10px 22px;
  border-top: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
}
.pp-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 1.15em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.pp-points b {
  color: var(--ink);
  font-weight: 600;
}
.pp-tiers {
  margin: 0 0 12px;
  display: grid;
  gap: 0;
}
.pp-tiers > div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 4px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.pp-tiers dd {
  margin: 0;
  color: var(--ink-2);
}
.pp-tiers dd p {
  margin: 0 0 6px;
}
.pp-ab {
  margin: 0;
  padding-left: 1.2em;
}
.pp-ab li {
  margin: 0 0 6px;
}
.pp-ab b {
  color: var(--ink);
  font-weight: 600;
}
#pp-glance-h {
  margin-top: 28px;
  font-size: 1.1rem;
}
.pp-glance-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}
.pp-glance {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.pp-glance th,
.pp-glance td {
  padding: 4px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}
.pp-glance thead th {
  border-top: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding-top: 10px;
  padding-bottom: 8px;
}
.pp-glance .num {
  text-align: right;
  width: 7.5rem;
  font-variant-numeric: tabular-nums;
}
.pp-glance tbody th a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.pp-glance tbody th a:hover span:last-child {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pp-glance tfoot th,
.pp-glance tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--line-strong);
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--softer);
}
.pp-glance-list {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pp-glance-list li + li {
  border-top: 1px solid var(--line);
}
.pp-glance-list a,
.pp-glance-total > span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px;
  color: var(--ink);
  text-decoration: none;
}
.pp-glance-list a > span:last-child,
.pp-glance-total > span {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.pp-glance-list b {
  font-weight: 500;
}
.pp-glance-list small {
  color: var(--muted);
}
.pp-glance-total {
  background: var(--softer);
  border-radius: 0 0 var(--radius) var(--radius);
}
.pp-glance-total b {
  font-weight: 600;
}
@media (max-width: 639px) {
  .pp-glance-wrap {
    display: none;
  }
  .pp-glance-list {
    display: block;
  }
  .pp-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pp-tiers > div {
    grid-template-columns: 1fr;
  }
  .pp-h {
    font-size: 1.35rem;
  }
  .proposal {
    --pp-gap: 40px;
  }
}
.pp-next {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0 0;
}
.pp-next .btn {
  color: var(--accent);
}
.pp-next .btn:hover {
  color: var(--accent-hover);
}

/* the areas, in the proposal */
.proposal .bp-m-head h4 {
  font-size: 0.98rem;
  font-weight: 500;
  margin: 0 0 8px;
}
.proposal .group-title {
  margin-top: 0;
}
.pp-msrc dt {
  font-weight: 500;
}
.pp-msrc dd {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pp-area-notes {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding: 12px 0 8px;
}
.pp-note h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 4px 0 4px;
}
.pp-note p {
  font-size: 0.92rem;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.pp-sources {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--softer);
  margin: 0 0 14px;
}
.pp-sources > summary {
  padding: 4px 12px;
  color: var(--accent);
}
.pp-sources > summary:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pp-sources-body {
  padding: 0 14px 8px;
}
.pp-sources-body > p {
  margin: 0 0 8px;
}
.pp-ref-h {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 14px 0 4px;
  color: var(--ink);
}
.pp-refs {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pp-refs li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0 6px;
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.pp-ref-n {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 4px;
}
.pp-ref-body {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pp-ref-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  vertical-align: middle;
  margin: -12px 0;
  font-weight: 500;
}
.pp-nolink {
  color: var(--muted);
  font-style: italic;
}
.pp-card-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 4px 0 8px;
}

/* the printed cards */
.pp-all {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 8px 0 24px;
}
.pp-dl-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pp-dl-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  min-height: 56px;
}
.pp-dl-list li + li {
  border-top: 1px solid var(--line);
}
.pp-dl-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  font-weight: 500;
}
.pp-dl-title small {
  color: var(--muted);
  font-weight: 400;
}
.pp-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.pp-dl:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 479px) {
  .pp-dl-list li {
    flex-wrap: wrap;
    padding: 8px 14px;
  }
  .pp-dl-title {
    flex-basis: calc(100% - 40px);
  }
  .pp-dl {
    margin-left: 36px;
  }
  .pp-all .btn {
    width: 100%;
  }
}

@media print {
  .proposal .pp-toc,
  .proposal .pp-next,
  .proposal .pp-card-link,
  .proposal #pp-downloads,
  .proposal .pp-glance-list {
    display: none !important;
  }
  .proposal .pp-glance-wrap {
    display: block !important;
    border-color: #bbb;
  }
  .pp-hero h1 {
    font-size: 20pt;
  }
  .pp-hero .lead {
    font-size: 10.5pt;
  }
  .pp-facts {
    margin: 6pt 0;
    gap: 4pt;
  }
  .pp-facts li {
    padding: 4pt 6pt;
    border-color: #bbb;
  }
  .pp-facts b {
    font-size: 14pt;
  }
  .pp-draft {
    border-color: #888;
  }
  .pp-sec {
    margin-top: 12pt;
    padding-top: 8pt;
    border-color: #bbb;
  }
  .pp-h {
    font-size: 13pt;
    break-after: avoid;
  }
  .pp-h .pp-step,
  .pp-step {
    width: auto;
    height: auto;
    background: none;
    font-size: inherit;
  }
  #pp-areas {
    break-before: page;
  }
  .pp-callout {
    border-color: #bbb;
    padding: 4pt 8pt;
  }
  .pp-points li,
  .pp-tiers > div {
    padding: 3pt 0 3pt 10pt;
    font-size: 8.5pt;
    break-inside: avoid;
  }
  .pp-tiers > div {
    padding-left: 0;
    grid-template-columns: 30mm 1fr;
  }
  .pp-glance {
    font-size: 8pt;
  }
  .pp-glance th,
  .pp-glance td {
    padding: 1pt 4pt;
  }
  .pp-glance tbody th a {
    min-height: 0;
  }
  .pp-glance .area-letter.small {
    display: none;
  }
  .proposal .bp-m-head h4 {
    font-size: 9pt;
    margin: 0 0 1pt;
  }
  .pp-area-notes {
    padding: 2pt 0;
  }
  .pp-note h4 {
    font-size: 8.5pt;
    margin: 2pt 0 1pt;
  }
  .pp-note p,
  .pp-sources-body > p {
    font-size: 8pt;
    margin: 0 0 3pt;
  }
  .pp-sources {
    border: 0;
    background: none;
    margin: 0;
  }
  .pp-sources > summary {
    color: #000;
    min-height: 0;
    padding: 2pt 0;
    font-size: 8.5pt;
    font-weight: 600;
  }
  .pp-sources > summary::before {
    display: none;
  }
  .pp-sources-body {
    padding: 0;
  }
  .pp-ref-h {
    font-size: 7.5pt;
    margin: 3pt 0 1pt;
  }
  .pp-refs li {
    font-size: 7pt;
    line-height: 1.3;
    padding: 1pt 0;
    border: 0;
    grid-template-columns: 6mm 1fr;
    break-inside: avoid;
  }
  .pp-ref-link {
    min-height: 0;
    margin: 0;
  }
  .pp-ref-link .ico {
    display: none;
  }
  .pp-host::after {
    content: ' (' attr(data-url) ')';
  }
}
.proposal .seg span {
  min-height: 44px;
}
@media print {
  .proposal .pp-glance-wrap {
    break-inside: avoid;
  }
}
.admin-box select {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 46px;
}
.admin-box select:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
/* In the hosted tool answers are already with IRC: the "send" box at the top of Your contributions goes. */
body.hosted .send-top { display: none; }

/* ---------- compare countries */
/* One hue, darkest for Best practice and lightest for Not in place: never red against green, so nothing reads as
   pass or fail. Not found is hatched and Not yet checked is an empty dashed square, so neither looks like
   Not in place. The app has no dark mode (color-scheme: light), so these have no dark values. Every colour carries
   its word or short word as text; text on each fill passes 4.5:1. */
:root {
  /* Status scale (P-27): blue for in place, orange for short of the minimum; no red or green, so it never reads
     as pass or fail and never clashes with the IRC red. Checked for contrast and colour blindness in
     app/review/visual-research/principles.md. A glyph (full disc to empty ring) carries the order in print. */
  --st-best: #1b4f8a;
  --st-best-ink: #ffffff;
  --st-min: #4c8fcb;
  --st-min-ink: #1a1a1a;
  --st-partly: #d4761f;
  --st-partly-ink: #1a1a1a;
  --st-none: #80310a;
  --st-none-line: #80310a;
  --st-none-ink: #ffffff;
  --st-nf: #f2f2f2;
  --st-nf-hatch: #767676;
  --st-nf-line: #767676;
  --st-nf-ink: #1a1a1a;
  --st-nyc-line: #767676;
  --st-nyc-ink: #4f4f4f;
}
:is(.cmp-tile, .cmp-cell, .cmp-sw) {
  border: 1.5px solid transparent;
}
:is(.cmp-tile, .cmp-cell, .cmp-sw).s-best {
  background: var(--st-best);
  border-color: var(--st-best);
  color: var(--st-best-ink);
}
:is(.cmp-tile, .cmp-cell, .cmp-sw).s-min {
  background: var(--st-min);
  border-color: var(--st-min);
  color: var(--st-min-ink);
}
:is(.cmp-tile, .cmp-cell, .cmp-sw).s-partly {
  background: var(--st-partly);
  border-color: var(--st-partly);
  color: var(--st-partly-ink);
}
:is(.cmp-tile, .cmp-cell, .cmp-sw).s-none {
  background: var(--st-none);
  border-color: var(--st-none-line);
  color: var(--st-none-ink);
}
:is(.cmp-tile, .cmp-cell, .cmp-sw).s-nf {
  background-color: var(--st-nf);
  background-image: repeating-linear-gradient(135deg, var(--st-nf-hatch) 0 1.5px, transparent 1.5px 6px);
  border-color: var(--st-nf-line);
  color: var(--st-nf-ink);
}
:is(.cmp-tile, .cmp-cell, .cmp-sw).s-nyc {
  background: transparent;
  border-style: dashed;
  border-color: var(--st-nyc-line);
  color: var(--st-nyc-ink);
}
@media (forced-colors: active) {
  :is(.cmp-tile, .cmp-cell, .cmp-sw) {
    border-color: CanvasText;
  }
}

main.cmp-wide {
  max-width: 72rem;
}
main.cmp-stay.enter {
  animation: none;
}
.cmp-head .lead {
  max-width: 46em;
}

/* The tabs: links, one address each */
.cmp-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line-strong);
  margin: 20px 0 22px;
}
.cmp-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 20px;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 10px 10px 0 0;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  line-height: 1.25;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.cmp-tab:hover {
  background: var(--soft);
  color: var(--ink);
}
.cmp-tab[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
  border-color: var(--line-strong) var(--line-strong) var(--ink);
}

/* Controls */
.cmp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.cmp-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 0 1 19rem;
}
.cmp-field > label {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.cmp-grow {
  flex: 1 1 20rem;
}
.cmp-select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 46px;
  cursor: pointer;
}
.cmp-select:hover {
  border-color: var(--ink-2);
}
.cmp-select:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}
.cmp-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cmp-step {
  min-height: 46px;
}
.cmp-step.is-off {
  color: var(--muted);
  background: var(--soft);
  border-color: var(--line);
  cursor: default;
}
.cmp-hint {
  max-width: 46em;
}
.cmp-open {
  margin: 0;
  display: flex;
  align-items: center;
  min-height: 46px;
}

/* The key */
.cmp-key {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 8px;
}
.cmp-key-h {
  font-size: 0.95rem;
  margin: 0 0 10px;
}
.cmp-key-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 6px;
}
.cmp-key-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.3;
}
.cmp-sw {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}
.cmp-key-note {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 8px;
}
.cmp-key-note strong {
  font-weight: 500;
  color: var(--ink);
}

/* Map */
.cmp-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 32px;
  align-items: start;
}
@media (min-width: 960px) {
  .cmp-map-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }
}
.cmp-m-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.cmp-m-title .mid {
  font-size: 1rem;
  margin: 0;
}
.cmp-coverage {
  color: var(--ink-2);
  font-size: 0.92rem;
  margin: 0 0 14px;
}
.cmp-tiles {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 6px;
  max-width: 46rem;
}
.cmp-tile-li {
  grid-column: var(--x);
  grid-row: var(--y);
  min-width: 0;
}
.cmp-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  padding: 8px 8px 7px;
  border-radius: 10px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.cmp-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 31, 36, 0.16);
  text-decoration: none;
}
.cmp-tile:hover,
.cmp-tile:focus-visible {
  color: inherit;
}
.cmp-tile.s-best:hover,
.cmp-tile.s-min:hover {
  color: #ffffff;
}
.cmp-tile.s-nyc:hover {
  color: var(--st-nyc-ink);
}
.cmp-tile.s-partly:hover,
.cmp-tile.s-none:hover,
.cmp-tile.s-nf:hover {
  color: var(--ink);
}
.cmp-t-code {
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.02em;
}
.cmp-t-name {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.cmp-t-word {
  font-size: 0.68rem;
  line-height: 1.2;
}
.cmp-t-short {
  display: none;
}
.cmp-tile.s-nf .cmp-t-name,
.cmp-tile.s-nf .cmp-t-word,
.cmp-tile.s-nf .cmp-t-code,
.cmp-tile.s-nf .cmp-t-short {
  background: var(--st-nf);
  border-radius: 3px;
  padding: 0 2px;
  margin: 0 -2px;
  align-self: flex-start;
}
@media (max-width: 719px) {
  .cmp-tile {
    padding: 3px;
    justify-content: center;
    align-items: center;
    border-radius: 7px;
  }
  .cmp-t-name,
  .cmp-t-word {
    display: none;
  }
  .cmp-t-code {
    font-size: 0.9rem;
  }
  .cmp-t-short {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.1;
  }
  .cmp-tile.s-nf .cmp-t-code,
  .cmp-tile.s-nf .cmp-t-short {
    align-self: center;
  }
}
.cmp-scope-note {
  margin: 0 0 6px;
}
.cmp-side {
  display: grid;
  gap: 12px;
  align-content: start;
}
.cmp-bp {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2px 16px;
}
.cmp-bp > summary {
  font-size: 0.92rem;
}
.cmp-bp .bp-lines div {
  grid-template-columns: 1fr;
}
.cmp-side > p {
  margin: 0;
}
.cmp-list {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.cmp-list-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 34rem;
  font-size: 0.92rem;
  margin: 4px 0 8px;
}
.cmp-list-table th,
.cmp-list-table td {
  text-align: left;
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.cmp-list-table th[scope='row'] {
  font-weight: 500;
}
.cmp-list-table th[scope='row'] a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}
.cmp-list-table td {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
}

/* Grid */
.cmp-dl {
  display: flex;
  align-items: flex-end;
}
.cmp-dl .btn {
  min-height: 46px;
}
.cmp-pick {
  flex: 1 1 19rem;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.cmp-pick > summary {
  min-height: 46px;
  padding: 0 12px;
}
.cmp-pick-body {
  padding: 0 12px 10px;
}
.cmp-pick-body .hint {
  margin: 0 0 6px;
}
.cmp-pick-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0 12px;
}
.cmp-pick-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.cmp-pick-list input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
  cursor: pointer;
}
.cmp-pick-list input:disabled,
.cmp-pick-list input:disabled + label {
  cursor: not-allowed;
}
.cmp-pick-list input:disabled + label {
  color: var(--muted);
}
.cmp-pick-list label {
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.3;
}
.cmp-readout {
  min-height: 2.8em;
  margin: 0 0 8px;
  padding: 8px 12px;
  background: var(--soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.cmp-readout strong {
  color: var(--ink);
  font-weight: 600;
}
.cmp-readout .dot {
  color: var(--muted);
}
.cmp-readout .cmp-sw,
.cmp-list-table .cmp-sw {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}
.cmp-readout .cmp-sw {
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px;
}
.cmp-grid-box {
  position: relative; /* keeps the screen-reader text in the cells inside the scrolling box */
  overflow: auto;
  max-height: min(72vh, 780px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overscroll-behavior: contain;
}
.cmp-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}
.cmp-grid th,
.cmp-grid td {
  padding: 0;
}
.cmp-grid thead th {
  position: sticky;
  background: var(--surface);
  z-index: 2;
  font-weight: 500;
}
.cmp-gh1 th {
  top: 0;
  height: 40px;
  box-shadow: 0 -4px 0 var(--surface); /* covers the hairline above the sticky header as rows scroll under it */
  border-bottom: 1px solid var(--line);
}
.cmp-gh2 th {
  top: 40px;
  height: 30px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.cmp-grid thead th.cmp-corner {
  left: 0;
  top: 0;
  z-index: 4;
  text-align: left;
  vertical-align: bottom;
  padding: 0 12px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-2);
  min-width: 8.5rem;
}
.cmp-gh-area {
  text-align: left;
  padding: 0 6px !important;
}
.cmp-gh-area-in {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 0;
  min-width: 100%;
  overflow: hidden;
}
.cmp-gh-area-t {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
  font-size: 0.8rem;
}
.cmp-grid th.cmp-gh-area,
.cmp-grid .cmp-first {
  border-left: 2px solid var(--line-strong);
}
.cmp-gc {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  text-align: left;
  border-right: 1px solid var(--line);
  font-weight: 500;
}
.cmp-gc a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.cmp-gc a:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cmp-grid tbody tr:hover .cmp-gc {
  background: var(--softer);
}
.cmp-grid td {
  padding: 3px;
  border-bottom: 1px solid var(--soft);
}
.cmp-grid tbody tr:last-child td,
.cmp-grid tbody tr:last-child th {
  border-bottom: 0;
}
.cmp-cell {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 36px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
}
.cmp-cell:hover {
  text-decoration: none;
  box-shadow: 0 0 0 2px var(--ink);
}
.cmp-cell.s-best:hover,
.cmp-cell.s-min:hover {
  color: #ffffff;
}
.cmp-cell.s-partly:hover,
.cmp-cell.s-none:hover,
.cmp-cell.s-nf:hover {
  color: var(--ink);
}
.cmp-cell.s-nyc:hover {
  color: var(--st-nyc-ink);
}
.cmp-cell.s-nf span[aria-hidden] {
  background: var(--st-nf);
  padding: 1px 3px;
  border-radius: 3px;
}
.cmp-cell:focus-visible {
  outline-offset: 0;
}
.cmp-grid-key {
  margin-top: 16px;
}
.cmp-grid-key .cmp-key-list {
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}
@media (max-width: 719px) {
  .cmp-grid thead th.cmp-corner {
    min-width: 7rem;
  }
  .cmp-gc a {
    white-space: normal;
    line-height: 1.2;
    max-width: 7.5rem;
  }
}

/* Country profile */
.cmp-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 32px;
  align-items: start;
}
@media (min-width: 960px) {
  .cmp-profile-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }
  .cmp-profile-layout .cmp-side {
    position: sticky;
    top: calc(var(--header-h, 64px) + 16px);
  }
}
.cmp-p-name {
  font-size: 1.5rem;
  margin: 4px 0 4px;
}
.cmp-parea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 10px;
  margin: 0 0 14px;
}
.cmp-parea-h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  margin: 0 0 10px;
}
.cmp-prows {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 24px;
}
@media (min-width: 720px) {
  .cmp-prows {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.cmp-plabel {
  font-size: 0.9rem;
  margin: 0 0 6px;
}
.cmp-psub {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
}
.cmp-chips {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 6px;
}
.cmp-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: 'sw text' 'sw word';
  align-items: center;
  gap: 0 10px;
  min-height: 44px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--softer);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.cmp-chip:hover {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--ink);
}
.cmp-chip .cmp-sw {
  grid-area: sw;
  height: 32px;
}
.cmp-chip-text {
  grid-area: text;
  font-size: 0.9rem;
  font-weight: 500;
}
.cmp-chip:hover .cmp-chip-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cmp-chip-word {
  grid-area: word;
  font-size: 0.8rem;
  color: var(--ink-2);
}
.cmp-pnone {
  margin: 0 0 8px;
}
.cmp-pnyc {
  margin: 4px 0 8px;
}
.cmp-parea-nyc {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
}
.cmp-nyc-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--ink-2);
}
.cmp-country-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0 16px;
}
.cmp-country-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (max-width: 719px) {
  .cmp-tabs {
    gap: 2px;
  }
  .cmp-tab {
    flex: 1 1 0;
    padding: 8px 6px;
    font-size: 0.92rem;
  }
  .cmp-field,
  .cmp-grow,
  .cmp-pick {
    flex: 1 1 100%;
  }
  .cmp-steps .btn {
    flex: 1 1 0;
  }
}

@media print {
  .cmp-tabs,
  .cmp-controls,
  .cmp-hint,
  .cmp-readout,
  .cmp-list {
    display: none !important;
  }
  .cmp-grid-box {
    max-height: none;
    overflow: visible;
  }
  :is(.cmp-tile, .cmp-cell, .cmp-sw) {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
.cmp-key-line {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.85rem;
}
.cmp-key-line li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cmp-key-line .cmp-sw {
  width: 34px;
  height: 22px;
  font-size: 0.68rem;
}

/* ---------- compare countries: the map */
/* A real map: countries filled by status, other land a warm grey, sea a pale blue-grey. Shapes are defined once
   (geo.js) and reused. Every fill comes from the status tokens above, so the palette lives in one place. */
:root {
  --geo-sea: #f3f5f6;
  --geo-land: #dedbd3;
  --geo-border: #ffffff;
  --geo-grat: #e6eaed;
  --geo-nyc: #ffffff;
}
.geo-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.geo-hatch-bg { fill: var(--st-nf); }
.geo-hatch-line { stroke: var(--st-nf-hatch); stroke-width: 1.6; }
.geo { display: block; width: 100%; height: auto; }
.geo-sea { fill: var(--geo-sea); }
.geo-grat { fill: none; stroke: var(--geo-grat); stroke-width: 0.6; }
.geo-land { fill: var(--geo-land); stroke: var(--geo-border); stroke-width: 0.7; }
.geo-c { fill: var(--geo-nyc); stroke: var(--geo-border); stroke-width: 0.9; cursor: pointer; outline: none; }
.geo-c use { transition: fill 0.25s var(--ease), opacity 0.2s var(--ease); }
.geo-c.s-best { fill: var(--st-best); }
.geo-c.s-min { fill: var(--st-min); }
.geo-c.s-partly { fill: var(--st-partly); }
.geo-c.s-none { fill: var(--st-none); }
.geo-c.s-nf { fill: url(#geo-hatch); stroke: var(--st-nf-line); stroke-width: 1; }
.geo-c.s-nyc { fill: var(--geo-nyc); stroke: var(--st-nyc-line); stroke-dasharray: 3 2.5; stroke-width: 1; }
.geo-main .geo-c { stroke-width: calc(0.9px / var(--zoom, 1)); }
.geo-c:hover use, .geo-c:focus-visible use, .geo-c.is-picked use { stroke: var(--ink); stroke-width: 2.4; stroke-dasharray: none; }
.geo-main .geo-c:hover use, .geo-main .geo-c:focus-visible use, .geo-main .geo-c.is-picked use { stroke-width: calc(2.4px / var(--zoom, 1)); }
.geo-c:focus-visible use { stroke: var(--focus); stroke-width: 3; }
.geo-c.is-picked use { stroke: var(--ink); stroke-width: 3; }
.geo-c.is-dim use { opacity: 0.18; }
.geo-label {
  font: 600 13px/1 var(--font);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  paint-order: stroke;
  stroke-width: 3px;
  stroke-linejoin: round;
  letter-spacing: 0.02em;
}
.geo-main .geo-label { font-size: calc(16px / var(--zoom, 1)); stroke-width: calc(3.5px / var(--zoom, 1)); }
.geo-c.s-best .geo-label { fill: var(--st-best-ink); stroke: var(--st-best); }
.geo-c.s-min .geo-label { fill: var(--st-min-ink); stroke: var(--st-min); }
.geo-c.s-partly .geo-label { fill: var(--st-partly-ink); stroke: var(--st-partly); }
.geo-c.s-none .geo-label { fill: var(--st-none-ink); stroke: var(--st-none); }
.geo-c.s-nf .geo-label, .geo-c.s-nyc .geo-label { fill: var(--ink); stroke: rgba(255, 255, 255, 0.92); }
.geo-c.is-dim .geo-label { opacity: 0.25; }
.geo-inset-frame { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }

.cmp-switch { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 2px; margin: 0 0 18px; flex-wrap: wrap; }
.cmp-switch-b { padding: 7px 16px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.92rem; min-height: 36px; display: inline-flex; align-items: center; }
.cmp-switch-b:hover { color: var(--ink); background: var(--softer); }
.cmp-switch-b[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cmp-mhead { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 6px 0 10px; }
.cmp-mhead .cmp-m-title { margin: 0; }
.cmp-tier { display: inline-block; font-size: 0.8rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 10px; background: var(--surface); }
.cmp-tier.small { font-size: 0.72rem; padding: 1px 8px; }

/* How many countries have each status on this measure */
.cmp-spread { margin: 0 0 16px; }
.cmp-spread-h { margin: 0 0 6px; font-size: 0.82rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-spread-bar { display: flex; gap: 3px; height: 34px; }
.cmp-spread.is-still .cmp-spread-bar { height: 18px; gap: 2px; }
.cmp-seg { flex-basis: 0; min-width: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font: 600 0.9rem/1 var(--font); padding: 0; cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.cmp-spread.is-still .cmp-seg { min-width: 14px; border-radius: 3px; font-size: 0.68rem; cursor: inherit; }
button.cmp-seg:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
button.cmp-seg[aria-pressed='true'] { outline: 3px solid var(--ink); outline-offset: 2px; }
.cmp-seg.s-best { background: var(--st-best); color: var(--st-best-ink); border: 1.5px solid var(--st-best); }
.cmp-seg.s-min { background: var(--st-min); color: var(--st-min-ink); border: 1.5px solid var(--st-min); }
.cmp-seg.s-partly { background: var(--st-partly); color: var(--st-partly-ink); border: 1.5px solid var(--st-partly); }
.cmp-seg.s-none { background: var(--st-none); color: var(--st-none-ink); border: 1.5px solid var(--st-none-line); }
.cmp-seg.s-nf { background-color: var(--st-nf); background-image: repeating-linear-gradient(135deg, var(--st-nf-hatch) 0 1.5px, transparent 1.5px 6px); color: var(--st-nf-ink); border: 1.5px solid var(--st-nf-line); }
.cmp-seg.s-nyc { background: transparent; color: var(--st-nyc-ink); border: 1.5px dashed var(--st-nyc-line); }
.cmp-spread-note { margin: 6px 0 0; }

/* The map card */
.geo-fig { margin: 0; }
.geo-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--geo-sea); border: 1px solid var(--line); box-shadow: var(--shadow); touch-action: pan-y; }
.geo-stage.is-zoomed { cursor: grab; touch-action: none; }
.geo-stage.is-dragging { cursor: grabbing; }
.geo-stage.is-narrow .geo-label { display: none; }
.geo-inset { position: absolute; top: 12px; right: 12px; width: 30%; max-width: 300px; border: 1.5px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--geo-sea); box-shadow: var(--shadow); }
.geo-inset .geo-label { font-size: 15px; }
.geo-zoom { position: absolute; top: 12px; left: 12px; display: grid; gap: 6px; }
.geo-zb { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 1.3rem/1 var(--font); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.geo-zb:hover { background: var(--softer); }
.geo-zb svg { width: 18px; height: 18px; }
.geo-key { position: absolute; left: 12px; bottom: 12px; display: grid; gap: 5px; background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 0.8rem; color: var(--ink); box-shadow: var(--shadow); }
.geo-key span { display: flex; align-items: center; gap: 8px; }
.geo-key .cmp-sw { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.geo-stage.is-narrow .geo-key { display: none; }
.geo-key-flat { position: static; display: flex; flex-wrap: wrap; gap: 8px 18px; box-shadow: none; background: none; border: 0; padding: 0; margin: 0 0 16px; }
.geo-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 0.85rem; display: grid; gap: 4px; max-width: 240px; box-shadow: var(--shadow-lg); }
.geo-tip b { font-weight: 600; font-size: 0.95rem; }
.geo-tip-s { display: flex; align-items: center; gap: 8px; }
.geo-tip-s .cmp-sw { width: 14px; height: 14px; border-radius: 3px; border-color: rgba(255, 255, 255, 0.6); }
.geo-tip-go { color: #c9d3dc; font-size: 0.78rem; }
.geo-fig figcaption { margin-top: 8px; }

/* Beside the map */
.geo-side { display: grid; gap: 16px; }
.geo-pick, .geo-found, .geo-asks { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.geo-pick-h { font-weight: 600; margin: 0 0 4px; }
.geo-pick p { margin: 0; }
.geo-found { border-top: 6px solid var(--line-strong); }
.geo-found.s-best { border-top-color: var(--st-best); }
.geo-found.s-min { border-top-color: var(--st-min); }
.geo-found.s-partly { border-top-color: var(--st-partly); }
.geo-found.s-none { border-top-color: var(--st-none-line); }
.geo-found.s-nf { border-top-color: var(--st-nf-line); }
.geo-found-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.geo-found-h { margin: 0; font-size: 1.35rem; }
.geo-found-h:focus { outline: none; }
.geo-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--ink-2); }
.geo-close:hover { background: var(--soft); }
.geo-found-status { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 8px 0 10px; flex-wrap: wrap; }
.geo-found-status .cmp-sw { min-width: 38px; height: 26px; border-radius: 6px; font-size: 0.75rem; display: inline-grid; place-items: center; padding: 0 6px; }
.geo-found-status .scope { font-weight: 400; color: var(--muted); }
.geo-finding p { margin: 0 0 12px; line-height: 1.55; }
.geo-found-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.geo-asks-h { font-weight: 600; margin: 0 0 8px; font-size: 0.95rem; }
.geo-asks dl { margin: 0; display: grid; gap: 10px; }
.geo-asks dt { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.88rem; }
.geo-asks dt .cmp-sw { width: 14px; height: 14px; border-radius: 3px; }
.geo-asks dd { margin: 2px 0 0 22px; font-size: 0.88rem; color: var(--ink-2); line-height: 1.5; }
.geo-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* The whole area: one small map per measure */
.cmp-area-lead { margin: 0 0 10px; }
.geo-minis { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.geo-mini-link { display: grid; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; height: 100%; align-content: start; transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease); }
.geo-mini-link:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: var(--ink); }
.geo-mini-h { font-weight: 600; font-size: 0.95rem; line-height: 1.35; }
.geo-mini-h .mid { color: var(--muted); font-weight: 500; margin-right: 4px; }
.geo-mini { border-radius: 8px; border: 1px solid var(--line); }
.geo-mini .geo-c { cursor: inherit; stroke-width: 0.8; }
.geo-mini .geo-c.s-nf { fill: url(#geo-hatch); }

@media (forced-colors: active) {
  .geo-c { forced-color-adjust: none; }
}
@media print {
  .geo-zoom, .geo-tip, .cmp-spread-note, .geo-tools { display: none; }
}

/* ---------- a country's pages wear its flag (js/flags.js)
   A stripe of the flag's colours under the header and the flag beside the country's name, on a plain white band.
   Nothing else takes the flag's colours: the page and the cards stay neutral, so the flag never competes with the
   status colours or with IRC red. A flag colour says whose page it is, never a status. */
body.flagged .app-header {
  border-bottom-color: transparent;
}
body.flagged .app-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 6px;
  background: var(--flag-stripe);
  box-shadow: 0 1px 0 rgba(26, 31, 36, 0.12);
}
.country-band {
  background: var(--surface);
  box-shadow: 0 0 0 100vmax var(--surface);
  border-bottom: 1px solid var(--line);
  clip-path: inset(0 -100vmax);
  margin-top: -28px;
  padding-top: 32px;
  padding-bottom: 20px;
  margin-bottom: 28px;
}
.country-band .sub,
.country-band .eyebrow,
.country-band .eyebrow a {
  color: var(--ink-2);
}
.country-title {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.flag-big {
  flex: none;
  width: 1.6em;
  height: 1.2em;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(26, 31, 36, 0.14);
  object-fit: cover;
}
.flag-mini {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(26, 31, 36, 0.16);
  margin-right: 0.45em;
  vertical-align: -2px;
  object-fit: cover;
}
@media print {
  body.flagged .app-header::after,
  .flag-mini {
    display: none;
  }
  .country-band {
    background: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 20px;
  }
}

/* ---------- country page: at a glance (P-27) */
.fp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 18px 0 22px; box-shadow: var(--shadow); }
.fp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px 24px; flex-wrap: wrap; }
.fp-h { margin: 0; font-size: 1.1rem; }
.fp-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--ink-2); }
.fp-key li { display: flex; align-items: center; gap: 6px; }
.fp-lead { margin: 8px 0 14px; max-width: 46rem; }
.fp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fp-row { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 4px 16px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--softer); }
.fp-area { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 0.9rem; font-weight: 500; line-height: 1.3; }
.fp-area:hover { color: var(--accent); }
.fp-strip { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.fp-tier { display: inline-flex; gap: 3px; }
.fp-sq { width: 24px; height: 34px; border-radius: 4px; display: inline-grid; place-items: center; border: 1.5px solid transparent; transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease); }
.fp-sq .st-glyph { width: 13px; height: 13px; }
a.fp-sq:hover, a.fp-sq:focus-visible { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); outline: none; }
.fp-sq.is-key { width: 18px; height: 18px; border-radius: 4px; }
.fp-sq.is-key .st-glyph { width: 11px; height: 11px; }
.fp-sq.s-best { background: var(--st-best); border-color: var(--st-best); color: var(--st-best-ink); }
.fp-sq.s-min { background: var(--st-min); border-color: var(--st-min); color: var(--st-min-ink); }
.fp-sq.s-partly { background: var(--st-partly); border-color: var(--st-partly); color: var(--st-partly-ink); }
.fp-sq.s-none { background: var(--st-none); border-color: var(--st-none); color: var(--st-none-ink); }
.fp-sq.s-nf { background-color: var(--st-nf); background-image: repeating-linear-gradient(135deg, rgba(118, 118, 118, 0.45) 0 1px, transparent 1px 4px); border-color: var(--st-nf-line); color: var(--st-nf-ink); }
.fp-sq.s-nyc { background: var(--surface); border: 1.5px dashed var(--st-nyc-line); color: var(--st-nyc-ink); }
.fp-unchecked { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 0.88rem; margin: 12px 0 0; }
.fp-unchecked .st-glyph { margin-top: 3px; }
.fp-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 14px; margin-top: 18px; }
.fp-list { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--softer); border-top: 5px solid var(--line-strong); }
.fp-list.s-best { border-top-color: var(--st-best); }
.fp-list.s-none { border-top-color: var(--st-none); }
.fp-list.s-nf { border-top-color: var(--st-nf-line); }
.fp-list-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 0.92rem; }
.fp-list.s-best .fp-list-h .st-glyph { color: var(--st-best); }
.fp-list.s-none .fp-list-h .st-glyph { color: var(--st-none); }
.fp-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.88rem; }
.fp-list a { color: var(--ink); text-decoration: none; }
.fp-list a:hover { color: var(--accent); text-decoration: underline; }
.fp-list .mid { color: var(--muted); font-weight: 500; margin-right: 2px; }
.fp-list p { margin: 0; }
.fp-note { margin: 14px 0 0; }
@media (max-width: 640px) {
  .fp { padding: 16px; }
  .fp-row { grid-template-columns: 1fr; }
  .fp-sq { width: 24px; height: 36px; }
}
@media print {
  .fp { box-shadow: none; break-inside: avoid; }
}

/* ---------- the header menu in three groups (app.js renderHeader)
   Overview first, in purple; the work on one country in the country's colours; reference pages last and quieter.
   Wide screens: one row, the groups set apart. Narrower: the menu panel, each group under its own small label. */
.nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-label {
  display: none;
}
.nav-overview a {
  color: var(--overview);
}
.nav-overview a:hover,
.nav-overview a[aria-current='page'] {
  color: var(--overview);
  background: var(--overview-band);
}
.nav-overview a[aria-current='page'] {
  box-shadow: inset 0 -2px 0 var(--overview);
}
.nav-work {
  background: var(--soft);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 2px;
}
.nav-work a {
  color: var(--ink);
  font-weight: 600;
}
.nav-work a:hover,
.nav-work a[aria-current='page'] {
  background: var(--surface);
}
.nav-info a {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.84rem;
}
@media (min-width: 1280px) {
  .nav {
    gap: 10px;
    flex-wrap: nowrap;
  }
  .nav-info {
    border-left: 1px solid var(--line);
    padding-left: 8px;
  }
}
@media (max-width: 1279px) {
  .nav-group {
    flex-direction: column;
    align-items: stretch;
    padding: 4px 0 8px;
  }
  .nav-group + .nav-group {
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  .nav-work + .nav-group,
  .nav-group + .nav-work {
    border-top: 0;
  }
  .nav-work {
    padding: 4px 4px 6px;
    margin: 4px 0;
  }
  .nav-label {
    display: block;
    padding: 4px 12px 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .nav-overview .nav-label {
    color: var(--overview);
  }
  .nav-work .nav-label {
    color: var(--ink-2);
  }
}

/* ---------- the overview pages (All countries, Compare countries) wear purple, as a country's pages wear its flag */
.overview-band {
  background: var(--overview-band);
  box-shadow: 0 0 0 100vmax var(--overview-band);
  clip-path: inset(0 -100vmax);
  border-bottom: 3px solid var(--overview);
  margin-top: -28px;
  padding-top: 28px;
  padding-bottom: 4px;
  margin-bottom: 28px;
}
.overview-band .page-head {
  margin-bottom: 16px;
}
.overview-band h1 {
  color: var(--overview);
}
.overview-band .lead {
  color: var(--ink-2);
}
.overview-eyebrow {
  color: var(--overview);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 0 0 4px;
}
@media print {
  .overview-band {
    background: none;
    box-shadow: none;
    border: 0;
    margin: 0;
    padding: 0;
  }
}
.nav a.nav-country {
  justify-content: flex-start;
}

/* ---------- compare countries: overview matrix */
.cmp-ov-lead { max-width: 52rem; margin: 0 0 12px; color: var(--ink-2); }
.cmp-panel-overview .ovm-wrap { width: fit-content; max-width: calc(100vw - 32px); margin-left: 50%; transform: translateX(-50%); }
.ovm-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); max-height: 80vh; }
.ovm-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ovm { border-collapse: separate; border-spacing: 0; font-size: 0.85rem; min-width: max-content; }
.ovm th, .ovm td { padding: 0; }
.ovm thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); vertical-align: bottom; }
.ovm-corner { position: sticky; left: 0; z-index: 3 !important; text-align: left; padding: 8px 12px !important; font-weight: 500; color: var(--muted); }
.ovm-area a { display: grid; grid-template-rows: 8.6rem auto; justify-items: center; align-items: end; gap: 6px; padding: 10px 2px 8px; color: var(--ink); text-decoration: none; width: 100%; }
.ovm-area a:hover .ovm-area-name { color: var(--accent); }
.ovm-area-name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.72rem; font-weight: 500; line-height: 1.15; max-height: 8.6rem; white-space: normal; text-align: left; color: var(--ink-2); }
.ovm-country { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; border-right: 1px solid var(--line); white-space: nowrap; }
.ovm-country a { display: block; padding: 5px 12px 5px 12px; color: var(--ink); text-decoration: none; font-weight: 500; }
.ovm-country a:hover { color: var(--accent); }
.ovm tbody tr:nth-child(even) th, .ovm tbody tr:nth-child(even) td { background: var(--softer); }
.ovm tbody tr:hover th, .ovm tbody tr:hover td { background: #eef2f6; }
.ov-cell-m { border-left: 1px solid var(--line); }
.ov-strip { display: flex; gap: 1.5px; padding: 6px 6px; min-height: 30px; align-items: center; justify-content: center; border-radius: 6px; }
.ov-strip:hover, .ov-strip:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); outline: none; }
.ov-strip.is-unchecked::before { content: ''; display: block; width: 100%; min-width: 34px; height: 14px; border: 1.5px dashed var(--st-nyc-line); border-radius: 3px; opacity: 0.55; }
.ov-sq { width: 6px; height: 18px; border-radius: 1.5px; flex: none; }
.ov-sq.s-best { background: var(--st-best); }
.ov-sq.s-min { background: var(--st-min); }
.ov-sq.s-partly { background: var(--st-partly); }
.ov-sq.s-none { background: var(--st-none); }
.ov-sq.s-nf { background-color: var(--st-nf); background-image: repeating-linear-gradient(135deg, var(--st-nf-hatch) 0 1px, transparent 1px 3px); box-shadow: inset 0 0 0 1px var(--st-nf-line); }
.ov-sq.s-nyc { background: transparent; box-shadow: inset 0 0 0 1px var(--st-nyc-line); }
.cmp-ov-note { margin-top: 10px; }

/* The country's row of the overview, enlarged: same strips, same order as Compare countries */
.fp-band { list-style: none; margin: 16px 0 6px; padding: 12px; display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 6px; background: var(--softer); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.fp-band-col { display: grid; justify-items: center; gap: 6px; padding: 6px 3px 8px; min-width: 0; border-radius: 8px; text-decoration: none; color: var(--ink); }
.fp-band-col:hover, .fp-band-col:focus-visible { background: var(--surface); box-shadow: 0 0 0 2px var(--ink); outline: none; }
.fp-band .ov-strip { padding: 0; min-height: 44px; gap: 1.5px; justify-content: center; width: 100%; }
.fp-band .ov-sq { flex: 1 1 0; width: auto; min-width: 2px; max-width: 8px; height: 40px; border-radius: 1.5px; }
.fp-band .ov-strip.is-unchecked::before { min-width: 0; width: 100%; height: 40px; }
@media (max-width: 900px) {
  .fp-band { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .fp-band { grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 8px; gap: 4px; }
  .fp-band .ov-sq { height: 32px; }
  .fp-band .ov-strip.is-unchecked::before { height: 32px; }
}


/* The country switcher beside the country's name in the menu (app.js renderHeader); not shown to a coalition reviewer,
   who has one country. Wide screens: a panel under the menu. Narrower: a list that opens inside the menu panel. */
.nav-switch {
  position: relative;
}
.nav-switch > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 40px;
  padding: 6px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.nav-switch > summary::-webkit-details-marker {
  display: none;
}
.nav-switch > summary:hover {
  background: var(--surface);
}
.nav-switch > summary::before {
  transform: rotate(45deg) translate(-2px, -1px);
}
.nav-switch[open] > summary::before {
  transform: rotate(-135deg) translate(-2px, -1px);
}
.nav-switch-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 4px;
}
.nav-switch-list a {
  width: 100%;
  font-weight: 500;
}
@media (min-width: 1280px) {
  .nav-switch:not(.is-shown) .nav-switch-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .nav-switch-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    width: 28rem;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
  }
}
@media (max-width: 1279px) {
  .nav-switch > summary {
    width: 100%;
    justify-content: flex-start;
    padding: 8px 12px;
  }
  .nav-switch-list {
    padding: 0 0 4px;
  }
}
.nav .nav-switch-list a {
  justify-content: flex-start;
}

/* Hover labels on the status squares (js/hover.js) */
.hover-label {
  position: fixed;
  z-index: 60;
  max-width: min(22rem, calc(100vw - 16px));
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(26, 31, 36, 0.2);
}

/* The questions line under the country's name: one click to the Questions page (P-28) */
.q-line {
  margin: 10px 0 0;
}
.q-line .btn {
  gap: 8px;
}

/* ---------- the conversation with the AI reviewer, and IRC's review queue (hosting/AI-REVIEWER.md) */
.thread { border-top: 1px solid var(--line); margin-top: 10px; }
.thread > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 500; color: var(--accent); }
.thread-body { padding-bottom: 8px; }
.thread-status { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; margin: 4px 0 10px; }
.thread-msgs { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.msg { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--surface); }
.msg-ai { background: var(--soft); }
.msg-head { margin: 0 0 4px; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.msg-head .ai-badge { display: inline-block; margin-right: 2px; }
.msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-given { margin: 6px 0 0; font-size: 0.88rem; }
.msg-given > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); }
.thread-form textarea { width: 100%; }
.admin-queue { border-top: 1px solid var(--line); padding: 0.25rem 0; }
.admin-queue summary { min-height: 44px; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.queue-list { list-style: none; padding: 0; margin: 0.25rem 0 0.75rem; display: grid; gap: 12px; }
.queue-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.queue-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0 0 6px; }
.link-email { display: block; }
.email-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.email-form input { flex: 1 1 14rem; max-width: 24rem; }
.email-form .form-error { flex-basis: 100%; margin: 0; }
.marks { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.86rem; }
.marks .mark-no { font-weight: 600; }
.marks .mark-soft { color: var(--muted); }
.eval-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.82rem; margin: 6px 0; }

/* ---------- the WHO workbook view (phase 1, PHASE-1.md) */
.who-not-standard,
.who-staff-flag {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  font-size: 0.92rem;
  max-width: 46em;
}
.who-staff-flag {
  background: var(--surface);
  border: 1px dashed var(--ink-2);
}
.who-section {
  margin-top: 32px;
}
.who-section > h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
}
.who-q {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 12px;
  margin-bottom: 16px;
  scroll-margin-top: 90px;
}
.who-q-title {
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0 0 6px;
}
.who-q-target {
  margin: 0 0 14px;
}
.who-q-body {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) {
  .who-q-body {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
  }
}
.who-m + .who-m {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}
.who-m-title {
  font-size: 1rem;
  margin: 0 0 8px;
}
.who-levels {
  background: var(--soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
}
.who-levels-h {
  font-weight: 600;
  margin: 0 0 8px;
}
.who-levels dl {
  margin: 0 0 8px;
  display: grid;
  gap: 8px;
}
.who-levels dt {
  font-weight: 500;
  color: var(--ink-2);
}
.who-levels dd {
  margin: 0;
}
.who-uncovered ul {
  padding: 0;
  margin: 0;
}
.who-uncovered li {
  list-style: none;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.who-uncovered li p {
  margin: 0 0 4px;
}
@media print {
  .who-q {
    break-inside: avoid-page;
  }
  .who-q .measure-actions,
  .who-q .ask {
    display: none;
  }
}

/* The privacy statement in short, on the sign-in page */
.signin-privacy { margin-top: 2rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.92rem; }
.signin-privacy h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.signin-privacy p { margin: 0 0 0.5rem; line-height: 1.6; }
.signin-privacy p:last-child { margin-bottom: 0; }
/* The 6-digit sign-in code: large, spaced digits, easy to type from a phone or an email beside it. */
.signin-form .code-input {
  max-width: 12rem;
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
}

/* Admin page: every country's pages (IRC only) */
.admin-pages { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.admin-pages li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.admin-pages li b { min-width: 9rem; }
