/* Local Resilience Profile (CRLI launch candidate). Builds on ici-foundation.css tokens. Light only; coverage is shown by
   shape and words, never by a red-to-green scale; nothing on the page reads as a score. */

.crl-page .crl-hero { padding-block: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 2.5vw, 1.75rem); }
.crl-page .crl-hero h1 { max-width: 22ch; margin: 0; }
.crl-page .crl-hero .lead { margin: 0.75rem 0 0; }
.crl-page .crl-tool { padding-block: 0 clamp(2.5rem, 5vw, 4rem); }

/* search */
.crl-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1rem, 2.5vw, 1.5rem); box-shadow: 0 1px 2px rgba(10, 42, 66, 0.05); }
.crl-search { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.crl-field { flex: 1 1 18rem; min-width: 0; }
.crl-field-country { flex: 0 1 11rem; }
.crl-field label { display: block; font-weight: 600; margin-bottom: 0.3rem; color: var(--ink); }
.crl-field input, .crl-field select { width: 100%; font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--body); }
.crl-field input:focus-visible, .crl-field select:focus-visible { outline: 2px solid var(--action); outline-offset: 1px; }
.crl-try { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.8rem 0 0; font-size: 0.88rem; color: var(--muted); }
.crl-try button { font: 600 0.85rem/1 var(--font-body); color: var(--action); background: var(--wash); border: 1px solid var(--rule); border-radius: 999px; padding: 0.4rem 0.7rem; cursor: pointer; }
.crl-try button:hover { border-color: var(--action); }
.crl-try button:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.crl-help { margin: 0.6rem 0 0; font-size: 0.86rem; color: var(--muted); max-width: var(--measure); }
.crl-msg { min-height: 1.4em; margin: 0.75rem 0 0; color: var(--ink); font-weight: 500; }
.crl-choices { margin-top: 0.75rem; }
.crl-choices fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.75rem 1rem; background: var(--surface); }
.crl-choices legend { font-weight: 600; color: var(--ink); padding: 0 0.3rem; }
.crl-choice { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.35rem 0; cursor: pointer; }
.crl-held { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--wash); padding: 1rem 1.1rem; max-width: var(--measure); }
#crl-result:not(:empty) { margin-top: 1.25rem; }

/* explainer before a lookup */
.crl-explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.75rem 0 0; }
.crl-explain > div { border-top: 2px solid var(--ink); padding-top: 0.75rem; min-width: 0; }
.crl-explain h2 { font-size: 1.02rem; margin: 0 0 0.35rem; }
.crl-explain p { margin: 0; font-size: 0.92rem; }

/* result frame */
.crl-result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.crl-result > *, .crl-cat-body > *, .crl-layer, .crl-cats > * { min-width: 0; }
.crl-result h2 { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem); margin: 0 0 0.5rem; }
.crl-k { margin: 0; font: 600 0.74rem/1.2 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--logo-slate-text); }
.crl-fine { font-size: 0.84rem; color: var(--muted); margin: 0.3rem 0 0; }
.crl-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; }
@media (max-width: 47.99rem) { .crl-top { grid-template-columns: 1fr; } }
.crl-location, .crl-status { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; min-width: 0; }
.crl-location { border-top: 3px solid var(--ink); }
.crl-status { background: var(--wash); }
.crl-status p { margin: 0.35rem 0 0; font-size: 0.92rem; }
.crl-where { margin: 0.35rem 0 0; font-size: 1.15rem; color: var(--ink); overflow-wrap: anywhere; }
.crl-precision { margin: 0.5rem 0 0; font-size: 0.92rem; }
.crl-chip { display: inline-block; font: 600 0.72rem/1.5 var(--font-body); letter-spacing: 0.03em; text-transform: uppercase; color: var(--logo-slate-text); border: 1px solid var(--rule); border-radius: 999px; padding: 0 0.5rem; vertical-align: 0.1em; }
.crl-chip--point { color: var(--ink); border-color: var(--ink); }
.crl-actions { margin-top: 0.75rem !important; }

/* coverage strip */
.crl-summary-sentence { margin: 0 0 0.75rem; font-size: 1rem; max-width: var(--measure); }
.crl-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr)); gap: 0.5rem; }
.crl-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.5rem; align-items: center; height: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.crl-tile:hover { border-color: var(--action); }
.crl-tile:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.crl-tile .crl-tile-mark { grid-row: 1 / span 2; }
.crl-tile-name { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.crl-tile-state { font-size: 0.76rem; color: var(--muted); }
.crl-tile-mark { display: inline-block; width: 0.95rem; height: 0.95rem; border-radius: 50%; border: 2px solid var(--logo-teal); box-sizing: border-box; flex: 0 0 auto; }
.crl-cov--evidence .crl-tile-mark { background: var(--logo-teal); }
.crl-cov--partial .crl-tile-mark { background: linear-gradient(90deg, var(--logo-teal) 50%, transparent 50%); }
.crl-cov--limited .crl-tile-mark { background: radial-gradient(circle, var(--logo-teal) 28%, transparent 30%); }
.crl-cov--none .crl-tile-mark { border-style: dashed; border-color: var(--logo-slate); }
.crl-cov--none.crl-tile { background: var(--wash); }
.crl-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.75rem 0 0; font-size: 0.8rem; color: var(--muted); }
.crl-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }

/* categories */
.crl-cats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
.crl-cat { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.crl-cat--none { background: var(--wash); }
.crl-cat > summary { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; cursor: pointer; list-style: none; }
.crl-cat > summary::-webkit-details-marker { display: none; }
.crl-cat > summary::after { content: ""; margin-left: auto; width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s ease; flex: 0 0 auto; }
.crl-cat[open] > summary::after { transform: rotate(-135deg); }
.crl-cat > summary:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
.crl-cat-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; min-width: 0; }
.crl-cat-name { font: 600 1.02rem/1.25 var(--font-display); color: var(--ink); }
.crl-cat-cov { font-size: 0.82rem; color: var(--muted); }
.crl-cat-body { padding: 0 1rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
.crl-covers { margin: 0; color: var(--muted); font-size: 0.92rem; }
.crl-layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.crl-layer { border-left: 3px solid var(--logo-teal); padding: 0.1rem 0 0.1rem 0.8rem; min-width: 0; }
.crl-layer--not_available { border-left-color: var(--rule); border-left-style: dashed; }
.crl-layer--area_level_only, .crl-layer--none_recorded, .crl-layer--no_nearby_station { border-left-color: var(--logo-slate); }
.crl-layer-head { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: baseline; }
.crl-role { font-weight: 600; color: var(--ink); }
.crl-state { font-size: 0.78rem; color: var(--logo-slate-text); border: 1px solid var(--rule); border-radius: 999px; padding: 0 0.5rem; }
.crl-state--evidence_available { color: var(--ink); border-color: var(--logo-teal); }
.crl-note { margin: 0.35rem 0 0; font-size: 0.9rem; max-width: var(--measure); }
.crl-gap { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--muted); max-width: var(--measure); }
.crl-src { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }
.crl-table-wrap { overflow-x: auto; margin-top: 0.4rem; }
.crl-readings { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.crl-readings th, .crl-readings td { text-align: left; vertical-align: top; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); }
.crl-readings thead th { background: var(--wash); color: var(--ink); font-weight: 600; font-size: 0.8rem; }
.crl-readings tbody th { font-weight: 500; color: var(--body); }
.crl-sub { display: block; font-size: 0.78rem; color: var(--muted); }
@media (max-width: 40rem) {
  .crl-readings thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .crl-readings, .crl-readings tbody, .crl-readings tr, .crl-readings th, .crl-readings td { display: block; width: 100%; }
  .crl-readings tr { border-bottom: 1px solid var(--rule); padding: 0.4rem 0; }
  .crl-readings th, .crl-readings td { border: 0; padding: 0.15rem 0; }
  .crl-readings td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--logo-slate-text); font-size: 0.78rem; }
}
.crl-mapfig { margin: 0.6rem 0 0; max-width: 34rem; }
.crl-map { display: block; width: 100%; height: auto; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); }
.crl-map-bg { fill: #F4F7F8; }
.crl-map-grid line { stroke: #DCE5E9; stroke-width: 1; }
.crl-map-feature { stroke-width: 1.5; }
.crl-map-feature--floodplain { fill: rgba(0, 96, 122, 0.28); stroke: #00607A; }
.crl-map-feature--study { fill: rgba(84, 116, 138, 0.18); stroke: #54748A; stroke-dasharray: 5 3; }
.crl-map-point circle:first-child { fill: #FFFFFF; stroke: #0A2A42; stroke-width: 2.5; }
.crl-map-point circle:last-child { fill: #0A2A42; }
.crl-map-scale rect { fill: rgba(255, 255, 255, 0.9); }
.crl-map-scale line { stroke: #0A2A42; stroke-width: 2; }
.crl-map-scale text, .crl-map-north text { font: 600 11px/1 var(--font-body, sans-serif); fill: #0A2A42; text-anchor: start; }
.crl-map-north path { fill: #0A2A42; }
.crl-map-north text { text-anchor: middle; }
.crl-mapfig figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; }
.crl-impl, .crl-prep { border-top: 1px solid var(--rule); padding-top: 0.6rem; }
.crl-impl h4, .crl-prep h4 { margin: 0; font-size: 0.95rem; color: var(--ink); }
.crl-impl ul, .crl-prep ul { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; display: grid; gap: 0.3rem; max-width: var(--measure); }
.crl-cite { display: block; font-size: 0.78rem; color: var(--muted); }
.crl-notproof { margin: 0; font-size: 0.86rem; color: var(--body); background: var(--wash); border-radius: var(--radius); padding: 0.5rem 0.75rem; max-width: var(--measure); }
.crl-cat--none .crl-notproof { background: var(--surface); }

/* questions, sources, limits */
.crl-qgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin-top: 0.6rem; }
.crl-qgroup { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.8rem 1rem; background: var(--surface); min-width: 0; }
.crl-qgroup h3 { font-size: 0.95rem; margin: 0; }
.crl-qgroup ul { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; display: grid; gap: 0.35rem; }
.crl-source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.crl-source-list > li { border-left: 2px solid var(--rule); padding-left: 0.8rem; max-width: 52rem; }
.crl-source-name { margin: 0; font-weight: 600; }
.crl-attr { margin: 0.2rem 0 0; font-size: 0.84rem; }
.crl-limits { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.82rem; color: var(--muted); }
.crl-not ul { margin: 0; padding-left: 1.1rem; font-size: 0.92rem; max-width: var(--measure); display: grid; gap: 0.25rem; }
.crl-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; }
.crl-links li { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.75rem 0.9rem; background: var(--surface); }
.crl-links a { font-weight: 600; }
.crl-links span { display: block; font-size: 0.84rem; color: var(--muted); margin-top: 0.2rem; }

/* method page */
.crl-method-page .crl-cat-table td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .crl-cat > summary::after { transition: none; } }

/* printed summary: the short record rendered by renderPrintSummary replaces the full sections on paper */
.crl-print { display: none; }
@media print {
  .masthead, .colophon, .skip-link, .crl-hero, .crl-panel, .crl-explain, .crl-msg, .crl-choices { display: none !important; }
  .crl-result > :not(.crl-print) { display: none !important; }
  .crl-page .crl-tool { padding: 0; }
  #crl-result:not(:empty) { margin: 0; }
  .shell-wide { max-width: none; padding-left: 0; padding-right: 0; }
  .crl-result { display: block; }
  .crl-print { display: block; font-size: 9pt; color: #111; }
  .crl-p-title { font: 700 15pt/1.2 var(--font-display, sans-serif); color: var(--ink); margin: 0 0 3pt; }
  .crl-p-meta { margin: 0 0 6pt; font-size: 8.5pt; }
  .crl-p-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  .crl-p-table th, .crl-p-table td { text-align: left; vertical-align: top; border-bottom: 0.5pt solid #999; padding: 3pt 4pt; }
  .crl-p-table thead th { border-bottom: 1pt solid #333; font-size: 8pt; }
  .crl-p-table tbody th { width: 22%; font-weight: 600; }
  .crl-p-table tr { break-inside: avoid; }
  .crl-p-table td:nth-child(2) { width: 13%; }
  .crl-p-table td:nth-child(4) { width: 18%; font-size: 7.5pt; }
  .crl-p-none td:nth-child(3) { color: #444; }
  .crl-p-where { color: #555; font-size: 7.5pt; }
  .crl-p-note { font-size: 7.5pt; color: #444; margin: 3pt 0 0; }
  .crl-p-h { font-weight: 700; font-size: 10pt; margin: 8pt 0 2pt; break-after: avoid; }
  .crl-p-list, .crl-p-meta, .crl-p-note { max-width: none; }
  .crl-p-list { margin: 0; padding-left: 12pt; font-size: 8pt; columns: 2; column-gap: 14pt; }
  .crl-p-list li { margin: 1pt 0; break-inside: avoid; }
}

/* spacing utilities (inline style attributes are blocked by the site CSP) */
.crl-mt-s { margin-top: 0.75rem; } .crl-mt-m { margin-top: 1rem; } .crl-mt-l { margin-top: 2rem; }

/* contrast on the tinted status panel and empty tiles (axe color-contrast) */
.crl-status .crl-k, .crl-cov--none .crl-tile-state { color: var(--ink); }

/* While the service is held, resilience-profile.js hides the search panel and says so (12 Nov 2026) */
.crl-panel[hidden] { display: none; }
