/* OD-LAYOUT-PRIMITIVES v1 — put this @layer first; product CSS outside the layer always wins. */
@layer od-layout {
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }
  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
/* /OD-LAYOUT-PRIMITIVES v1 */

/* Design tokens — Drainage Services Department visual language */
:root {
  --bg: #ffffff; --surface: #f0f0f0; --fg: #212529; --muted: #6c757d; --border: #cccccc;
  --accent: #126e82; --accent-2: #04669f; --accent-hover: #0f5f71;
  --accent-soft: rgba(18,110,130,.10);
  --risk-low: #1f7d52; --risk-moderate: #8f6400; --risk-high: #b5520c; --risk-severe: #b3261e;
  --risk-low-wash: rgba(31,125,82,.16); --risk-moderate-wash: rgba(143,100,0,.16);
  --risk-high-wash: rgba(181,82,12,.16); --risk-severe-wash: rgba(179,38,30,.16);
  --radius: 8px; --gap: 8px;
  --dur: .3s; --ease-out: cubic-bezier(.2,.8,.2,1);
  --shadow-1: 0 1px 2px rgba(33,37,41,.08); --shadow-2: 0 6px 22px rgba(33,37,41,.16);
  --appbar-h: 58px; --tabbar-h: 58px; --panel-w: 380px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.57; -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent-2); }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* App frame: header / workspace / mobile tab bar */
#app { --panel-h: 44%; position: relative; height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; }
#app.panel-expanded { --panel-h: 84%; }

.appbar { display: flex; align-items: center; gap: 10px; min-height: var(--appbar-h); padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); z-index: 30; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--radius); background: var(--accent); color: #fff; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark--dsd { position: relative; overflow: hidden; border-radius: 0; background: transparent; }
.brand-mark--dsd img { position: absolute; top: 0; left: 0; width: auto; max-width: none; height: 34px; }
.brand-text { min-width: 0; }
.brand-title { display: block; font-size: 16px; font-weight: 700; }
.brand-sub { display: block; font-size: 11.5px; color: var(--muted); }
.appnav { display: none; align-items: center; gap: 2px; margin-left: 14px; }
.navlink { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--fg); font-size: 14px; font-weight: 700; cursor: pointer; transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out); }
.navlink svg { width: 18px; height: 18px; }
.navlink:hover { background: var(--surface); }
.navlink[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.workspace { position: relative; display: flex; flex-direction: column; min-height: 0; }
.maparea { position: absolute; inset: 0; background: #e8ebec; }
#map { position: absolute; inset: 0; }
#app[data-view="map"] .maparea { display: block; }

/* Panel: bottom sheet on mobile, side panel on wide screens */
.panel { position: absolute; left: 0; right: 0; bottom: 0; height: var(--panel-h); min-height: 0; display: flex; flex-direction: column;
  background: var(--bg); border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -6px 22px rgba(33,37,41,.16); transition: height var(--dur) var(--ease-out); z-index: 20; }
#app[data-view="map"] .panel { display: flex; }
#app:not([data-view="map"]) .panel { display: flex; }
.panel-handle { display: none; }
.view { display: none; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.view.is-active { display: flex; }
.view-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg); }
.view-head h1 { font-size: 19px; }
.view-head .sub { font-size: 12.5px; color: var(--muted); }
.view-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; }
.view-scroll--flush { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 15px; font-weight: 700;
  line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { background: #fff; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--quiet { background: transparent; border-color: var(--border); color: var(--fg); }
.btn--quiet:hover { background: var(--surface); }
.btn--compact { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 999px; }
.btn--compact svg { width: 15px; height: 15px; }
.btn--block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; flex: none;
  border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--fg); cursor: pointer; transition: background var(--dur) var(--ease-out); }
.iconbtn:hover { background: var(--surface); }
.iconbtn svg { width: 22px; height: 22px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1.2; border: 1px solid var(--border); background: #fff; color: var(--fg); white-space: nowrap; }
button.chip { cursor: pointer; }
.chip svg { width: 14px; height: 14px; flex: none; }
.chip--low { background: var(--risk-low-wash); border-color: rgba(31,125,82,.45); color: var(--risk-low); }
.chip--moderate { background: var(--risk-moderate-wash); border-color: rgba(143,100,0,.45); color: var(--risk-moderate); }
.chip--high { background: var(--risk-high-wash); border-color: rgba(181,82,12,.45); color: var(--risk-high); }
.chip--severe { background: var(--risk-severe-wash); border-color: rgba(179,38,30,.45); color: var(--risk-severe); }
.chip--info { background: var(--accent-soft); border-color: rgba(18,110,130,.4); color: var(--accent); }
.chip--muted { background: var(--surface); color: var(--muted); }
.chip--status::before { content: ''; width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.chip--status--active { background: var(--accent-soft); border-color: rgba(18,110,130,.4); color: var(--accent); }
.chip--status--resolved { background: var(--risk-low-wash); border-color: rgba(31,125,82,.45); color: var(--risk-low); }

/* Cards, lists, misc */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.rowcard { display: block; width: 100%; text-align: left; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; cursor: pointer; transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out); }
.rowcard:hover { background: var(--surface); }
.rowcard--split { display: block; padding: 0; }
.rowcard--split .rowcard__open { display: block; width: 100%; padding: 12px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rowcard--split .rowcard__actions { display: flex; gap: 8px; padding: 0 12px 12px; }
.rowcard .rc-head { display: flex; align-items: flex-start; gap: 10px; }
.rc-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--radius); background: var(--surface); color: var(--accent); }
.rc-icon svg { width: 20px; height: 20px; }
.rc-title { display: block; font-size: 15.5px; font-weight: 700; }
.rc-sub { display: block; font-size: 13px; color: var(--muted); }
.rowcard .rc-meta { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.action-text { color: var(--fg); }
.rc-chev { display: inline-flex; margin-left: auto; flex: none; color: var(--muted); }
.rc-chev svg { width: 20px; height: 20px; }
.rc-thumb { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: var(--radius);
  overflow: hidden; background: var(--surface); }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rail--wrap { flex-wrap: wrap; overflow-x: visible; }
.rail::-webkit-scrollbar { display: none; }
.mediacard { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color var(--dur) var(--ease-out); }
.mediacard:hover { border-color: var(--accent); }
.mediacard .mc-media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface); }
.mediacard .mc-body { display: block; padding: 12px; }
.mediacard .mc-title { display: block; font-size: 15.5px; font-weight: 700; }
.mediacard .mc-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.article-hero { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); border-radius: var(--radius); }
.prose p { margin: 0 0 12px; }
.prose h3 { font-size: 16px; margin: 18px 0 8px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.note { display: flex; gap: 9px; padding: 11px 12px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.note svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 2px; }
.note p { font-size: 13.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.stat-box { background: var(--surface); border-radius: var(--radius); padding: 10px 12px; }
.stat-box .sb-val { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-box .sb-key { display: block; font-size: 12.5px; color: var(--muted); }
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 12px; padding: 11px 0; }
.step + .step { border-top: 1px solid var(--border); }
.step .st-n { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.step .st-t { display: block; font-size: 14.5px; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv dt { font-size: 13.5px; color: var(--muted); }
.kv dd { margin: 0; font-size: 14.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend--drainage { align-items: center; gap: 12px; margin-top: 10px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.lg-line { width: 18px; height: 0; border-top-width: 3px; border-top-style: solid; }
.lg-line--storm { color: #1015ff; }
.lg-line--foul { color: #be0000; }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #1015ff; }
.lg-square { width: 12px; height: 12px; border: 2px solid #be0000; }
.lg-ring { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #b5520c; background: rgba(181, 82, 12, .22); }
.lg-marker { width: 13px; height: 13px; border-radius: 50%; background: #7b4fa8; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #7b4fa8; }

/* Document preview */
.doc-preview { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 14px; }
.doc-head { display: flex; align-items: center; gap: 8px; }
.doc-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; background: #b3261e; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.doc-meta { font-size: 12.5px; color: var(--muted); }
.doc-title { margin: 10px 0 4px; font-size: 16px; line-height: 1.35; }
.doc-preview .kv { display: block; padding: 7px 0; }
.doc-preview .kv dt { font-size: 12px; }
.doc-preview .kv dd { margin-top: 2px; text-align: left; font-size: 14.5px; }
.doc-lines { display: grid; gap: 7px; margin-top: 14px; }
.doc-lines span { display: block; height: 8px; border-radius: 4px; background: var(--surface); }
.doc-lines span:nth-child(2) { width: 84%; }
.doc-lines span:nth-child(3) { width: 66%; }
.doc-lines span:nth-child(4) { width: 92%; }
.doc-lines span:nth-child(5) { width: 48%; }
.badge-sample { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.meta { font-size: 13px; color: var(--muted); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* Layer switches */
.layer-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.layer-row + .layer-row { margin-top: 8px; }
.layer-row .lr-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--radius); background: var(--surface); color: var(--accent); }
.layer-row .lr-icon svg { width: 19px; height: 19px; }
.layer-row .lr-title { display: block; font-size: 15px; font-weight: 700; }
.layer-row .lr-sub { display: block; font-size: 12.5px; color: var(--muted); }
.switch { position: relative; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background var(--dur) var(--ease-out); }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease-out); }
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(20px); }
.switch input:focus-visible ~ .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Map overlays: location alert + route banner */
.toast, .route-banner { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 1100; }
.toast { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--risk-high); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 12px; }
.toast[hidden], .route-banner[hidden] { display: none; }
.route-banner { display: flex; align-items: center; gap: 10px; background: var(--accent-2); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 10px 12px; }
.route-banner .rb-title { display: block; font-size: 15px; font-weight: 700; }
.route-banner .rb-sub { display: block; font-size: 12.5px; opacity: .92; }
.route-banner .btn--end { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.6); color: #fff; min-height: 38px; padding: 0 12px; font-size: 13px; }
.route-banner .btn--end:hover { background: rgba(255,255,255,.28); }

/* Mobile tab bar */
.tabbar { display: flex; align-items: stretch; height: var(--tabbar-h); background: var(--bg); border-top: 1px solid var(--border); z-index: 30; }
.tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px;
  border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; transition: color var(--dur) var(--ease-out); }
.tab svg { width: 23px; height: 23px; }
.tab:hover { color: var(--fg); }
.tab[aria-current="page"] { color: var(--accent); }
.tab-ind { display: block; width: 18px; height: 3px; border-radius: 999px; background: var(--accent); opacity: 0; }
.tab[aria-current="page"] .tab-ind { opacity: 1; }

/* Bottom sheet / dialog */
.sheet-host { position: absolute; inset: 0; z-index: 2000; visibility: hidden; pointer-events: none; }
.sheet-host.open { visibility: visible; pointer-events: auto; }
.sheet-host .scrim { position: absolute; inset: 0; background: rgba(33,37,41,.42); opacity: 0; transition: opacity var(--dur) var(--ease-out); }
.sheet-host.open .scrim { opacity: 1; }
.sheet-host .sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90%; display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -10px 34px rgba(33,37,41,.28);
  transform: translateY(102%); transition: transform var(--dur) var(--ease-out); }
.sheet-host.open .sheet { transform: translateY(0); }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { font-size: 18px; }
.sheet-head .sh-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 14px; min-height: 0; }
.sheet-actions { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.sheet-actions[hidden] { display: none; }
.sheet-actions .btn { flex: 1 1 0; }

/* Local data startup state */
.load-state { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 18px; background: var(--bg); }
.load-state[hidden] { display: none; }
.load-state__panel { display: flex; align-items: center; gap: 14px; width: min(440px, 100%); padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1); }
.load-state__panel h1 { font-size: 18px; }
.load-state__panel p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.load-state.is-error .load-state__panel { border-left: 4px solid var(--risk-high); }

/* Optional language switch for the two multilingual features */
.language-control { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.language-control[hidden] { display: none; }
.language-control select { max-width: 150px; min-height: 38px; padding: 0 28px 0 9px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--fg); font: inherit; font-size: 13px; }

/* Exploration and daily challenge */
.feature-section { margin-top: 18px; }
.feature-section:first-child { margin-top: 0; }
.facility-list { display: flex; flex-direction: column; gap: 10px; }
.facility-card { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.facility-card__title { font-size: 15px; font-weight: 700; }
.facility-card__head { display: flex; align-items: flex-start; gap: 8px; }
.facility-card__head .chip { flex: none; }
.facility-card__copy { margin-top: 9px; font-size: 13.5px; }
.facility-card__access { margin-top: 7px; color: var(--muted); font-size: 13px; }
.facility-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.facility-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.facility-card__actions .btn { flex: 1 1 auto; }
.feature-status { margin-top: 9px; color: var(--muted); font-size: 13px; }
.feature-status:empty { display: none; }
.feature-status[data-state="success"] { color: var(--risk-low); }
.feature-status[data-state="error"] { color: var(--risk-severe); }
.feature-score { font-variant-numeric: tabular-nums; }
.mascot-prompt { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.mascot-prompt img { width: 48px; height: 66px; flex: none; object-fit: contain; }
.mascot-prompt p { font-weight: 700; }
.quiz-card { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.quiz-question { margin-bottom: 12px; font-size: 17px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; text-align: left; cursor: pointer; }
.quiz-option:hover { background: var(--surface); }
.quiz-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.quiz-option:disabled { cursor: default; }
.quiz-actions { margin-top: 12px; }
.quiz-result { margin-top: 12px; padding: 11px 12px; border-left: 4px solid var(--accent); background: var(--surface); }
.quiz-result[data-correct="true"] { border-left-color: var(--risk-low); }
.quiz-result[data-correct="false"] { border-left-color: var(--risk-high); }
.quiz-result p + p { margin-top: 5px; }

/* Local report demonstration */
.report-gate .section-title { margin-bottom: 7px; }
.report-form:not([hidden]) { display: grid; gap: 14px; }
.report-fieldset { min-width: 0; margin: 0; padding: 12px 0; border: 0; border-top: 1px solid var(--border); }
.report-fieldset:first-child { padding-top: 0; border-top: 0; }
.report-fieldset legend { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 10px; padding: 0; font-size: 14px; font-weight: 700; }
.report-fieldset .section-number { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.report-fieldset label { display: block; margin: 10px 0 5px; font-size: 13px; font-weight: 700; }
.report-fieldset input[type="text"],
.report-fieldset input[type="tel"],
.report-fieldset input[type="file"] { display: block; width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--fg); font: inherit; font-size: 14px; }
.report-fieldset input[type="file"] { padding: 6px; background: var(--surface); font-size: 13px; }
.report-fieldset textarea { display: block; width: 100%; min-height: 120px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--fg); font: inherit; font-size: 14px; resize: vertical; }
.report-pin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.report-pin__status { font-size: 12.5px; color: var(--muted); }
.report-fieldset input[type="file"]::file-selector-button { min-height: 30px; margin-right: 8px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--fg); font: inherit; font-weight: 700; }
.report-fieldset .field-help { margin-top: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.report-fieldset .field-error:not([hidden]) { margin-top: 5px; color: var(--risk-severe); font-size: 13px; }
.report-photo-preview:not([hidden]) { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 10px; }
.report-photo-preview img { display: block; width: 100%; max-height: 180px; border-radius: var(--radius); background: var(--surface); object-fit: cover; }
.report-photo-preview .btn { min-height: 40px; }
.report-form > .btn { margin-top: 2px; }
.report-receipt .section-title { margin: 12px 0 5px; }
.report-reference { margin: 4px 0 12px; color: var(--accent); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.report-receipt .kv { margin-top: 12px; }
.demo-profile .kv { margin-top: 12px; }
.demo-profile > .meta { margin-top: 10px; }
.report-entry .meta { margin: 0; }

/* Map markers (Leaflet divIcons) */
.mk { display: grid; place-items: center; }
.mk-landmark { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; color: #fff; box-shadow: 0 1px 4px rgba(33,37,41,.38); }
.mk-landmark svg { width: 18px; height: 18px; }
.mk--shelter { background: var(--accent); }
/* Monitoring points carry the GeoInfo Map (AM/FM Database) drainage symbol:
   teal disc, white ring and the white pipe glyph. */
.mk--camera { background: #17808d; border-width: 3px; }
.mk--camera svg { width: 20px; height: 20px; stroke-width: 2.1; }
.mk--unit { background: var(--accent); border-width: 3px; }
.mk--unit svg { width: 18px; height: 18px; }
.mk--pin { background: var(--accent); border-width: 3px; }
.mk--pin svg { width: 18px; height: 18px; }
.mk--gauge { background: var(--risk-moderate); }
.mk--upload { background: #7b4fa8; }
.mk-you { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent); }
.leaflet-marker-icon:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.leaflet-container { font: inherit; background: #e8ebec; }
.leaflet-control-attribution { font-size: 11px; }
.leaflet-control-zoom a { color: var(--fg); }

/* Message delivery panel at the top of the flooding management view */
.deliver { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); background: #fff; padding: 12px; margin-bottom: 14px; }
.deliver__head { display: flex; align-items: flex-start; gap: 10px; }
.deliver__icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--radius); background: var(--surface); color: var(--accent); }
.deliver__icon svg { width: 20px; height: 20px; }
.deliver__title { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.deliver__sub { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.deliver__actions { margin-top: 10px; }


/* Map legend for the point symbols, shown at the top left of the map */
.maplegend { background: rgba(255,255,255,.95); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 8px 10px; font-size: 11.5px; line-height: 1.45; color: var(--fg); }
.maplegend__row { display: flex; align-items: center; gap: 7px; }
.maplegend__row + .maplegend__row { margin-top: 4px; }
.maplegend__dot { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(33,37,41,.3); }
.maplegend__dot--shelter { background: var(--accent); }
.maplegend__dot--camera { background: #17808d; }
.maplegend__dot--upload { background: #7b4fa8; }
.maplegend__label { white-space: nowrap; }

/* Wide screens: side panel beside a persistent map */
@media (min-width: 768px) {
  .appnav { display: flex; }
  .tabbar { display: none; }
  #app { grid-template-rows: auto minmax(0,1fr); }
  .workspace { flex-direction: row; }
  .maparea { position: relative; inset: auto; flex: 1 1 auto; min-width: 0; display: block !important; }
  .panel { position: relative; inset: auto; height: auto; width: var(--panel-w); flex: 0 0 var(--panel-w); border-top: 0;
    border-left: 1px solid var(--border); border-radius: 0; box-shadow: none; transition: none; }
  .panel-handle { display: none !important; }
  #app:not([data-view="map"]) .maparea { display: block; }
}
@media (max-width: 767px) {
  .brand-mark--dsd img { left: -5px; }
  .language-control { margin-left: auto; }
  .language-control span { display: none; }
  .language-control select { width: 92px; max-width: 116px; min-height: 36px; font-size: 12px; }
  .tab { font-size: 10px; }
  .tab svg { width: 21px; height: 21px; }
  .facility-card__actions .btn { flex-basis: 100%; }
  .view-scroll { scrollbar-width: none; -ms-overflow-style: none; }
  .view-scroll::-webkit-scrollbar { display: none; }
  #app:not([data-view="map"]) .maparea { display: none; }
  #app:not([data-view="map"]) .panel { inset: 0; height: auto; border-radius: 0; border-top: 0; }
  /* The warnings view keeps the map so the risk areas and points stay visible. */
  #app[data-view="warnings"] .maparea { display: block; height: 42%; bottom: auto; }
  #app[data-view="warnings"] .panel { inset: 42% 0 0 0; height: auto; border-radius: var(--radius) var(--radius) 0 0; border-top: 1px solid var(--border); }
  #app[data-view="map"] .panel-handle { display: flex; }
  #app[data-view="map"] .leaflet-bottom { bottom: calc(var(--panel-h) + 6px); transition: bottom var(--dur) var(--ease-out); }
  #app[data-view="map"] { --panel-h: 44%; }
  #app[data-view="map"].panel-expanded { --panel-h: 84%; }
}
.panel-handle { align-items: center; justify-content: center; width: 100%; min-height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.panel-handle span { display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--border); }
@media (min-width: 768px) { .sheet-host .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -46%); width: min(560px, 92vw); border-radius: var(--radius); } .sheet-host.open .sheet { transform: translate(-50%, -50%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
