/* =====================================================================
   ReQuestroom public stylesheet (mobile first)
   Depends on tokens.css. Sections:
   1 Fonts  2 Base  3 Page kinds  4 Utilities  5 Buttons  6 Chips, badges
   7 Cards  8 Forms  9 Header  10 App layout  11 Map  12 Sheet
   13 Dialogs  14 Toasts  15 Report tiles  16 Facility details
   17 States  18 Content pages  19 Motion, forced colors
   ===================================================================== */

/* 1 Fonts ------------------------------------------------------------ */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/archivo-black-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/archivo-black-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-surface-alt);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { margin: 0; line-height: var(--lh-snug); }
h1, .display { font-family: var(--font-display); font-weight: 400; line-height: var(--lh-tight); letter-spacing: 0.01em; }
p { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--color-link); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* One focus style everywhere: white gap + ink ring, visible on every background */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.leaflet-container :focus-visible { box-shadow: var(--focus-ring); }

/* 3 Page kinds (A2: mint floor for toilets, light blue for water) ----- */
body[data-kind="toilet"] { --kind-floor: var(--c-mint); --kind-accent: var(--c-pink); }
body[data-kind="water"]  { --kind-floor: var(--c-sky);  --kind-accent: var(--c-blue); }

.tiled {
  background-color: var(--kind-floor);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-position: -1px -1px;
}

/* Elements shown on one page kind only */
body[data-kind="toilet"] [data-kind-only="water"],
body[data-kind="water"] [data-kind-only="toilet"] { display: none !important; }

/* 4 Utilities ---------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-2); top: var(--sp-2);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-ink); color: var(--c-white);
  border-radius: var(--radius-pill);
  font-weight: var(--fw-semibold);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

.stack > * + * { margin-top: var(--sp-3); }
.stack-lg > * + * { margin-top: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }

/* 5 Icons and buttons ------------------------------------------------ */
.icon {
  width: 24px; height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 32px; height: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-press);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast);
  touch-action: manipulation;
  user-select: none;
}
.btn:hover { background: var(--c-pink-50); text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: var(--shadow-press-active); }
.btn:focus-visible { border-radius: var(--radius-pill); box-shadow: var(--shadow-press), var(--focus-ring); }

.btn--primary { background: var(--c-ink); color: var(--c-white); }
.btn--primary:hover { background: var(--c-ink-80); }
.btn--danger { background: var(--color-danger); color: var(--c-white); border-color: var(--c-ink); }
.btn--danger:hover { background: var(--color-danger-hover); }
.btn--danger-outline { color: var(--color-danger); border-color: var(--color-danger); box-shadow: 0 3px 0 var(--color-danger); }
.btn--danger-outline:hover { background: var(--c-pink-50); }
.btn--ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn--ghost:hover { background: rgba(43, 43, 43, 0.06); }
.btn--ghost:active { transform: none; }
.btn--sm { min-height: var(--tap-sm); padding: 0 var(--sp-4); font-size: var(--fs-sm); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: var(--tap); padding: 0; }
.btn--icon.btn--sm { width: var(--tap-sm); }
.btn[aria-pressed="true"], .btn.is-selected { background: var(--c-ink); color: var(--c-white); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Tel links shown as big buttons in the help dialog */
.call-btn { justify-content: flex-start; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); text-align: left; }
.call-btn__number { font-family: var(--font-display); font-size: var(--fs-xl); }
.call-btn__label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); }

/* 6 Chips and badges ------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--tap-sm);
  padding: 0 var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.chip:hover { background: var(--c-pink-50); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--c-ink); color: var(--c-white); }
.chip__count {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--c-ink); color: var(--c-white);
  font-size: var(--fs-xs);
}
.chip[aria-pressed="true"] .chip__count { background: var(--c-white); color: var(--c-ink); }

.chip-scroller {
  display: flex; gap: var(--sp-2);
  overflow-x: auto; scrollbar-width: none;
  padding: var(--sp-1) var(--sp-1) var(--sp-2);
  margin: calc(var(--sp-1) * -1);
}
.chip-scroller::-webkit-scrollbar { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px;
  padding: 2px 10px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  white-space: nowrap;
}
.badge .icon { width: 16px; height: 16px; }
.badge--ok     { background: var(--status-ok-bg);     color: var(--status-ok-fg);     border-color: var(--status-ok-fg); }
.badge--issue  { background: var(--status-issue-bg);  color: var(--status-issue-fg);  border-color: var(--status-issue-fg); }
.badge--out    { background: var(--status-out-bg);    color: var(--status-out-fg);    border-color: var(--c-ink); }
.badge--closed { background: var(--status-closed-bg); color: var(--status-closed-fg); }
.badge--women  { background: var(--gender-women-bg); }
.badge--men    { background: var(--gender-men-bg); }
.badge--all    { background: var(--gender-all-bg); }
.badge--free   { background: var(--occ-free-bg); color: var(--occ-free-fg); border-color: var(--occ-free-fg); }
.badge--busy   { background: var(--occ-busy-bg); color: var(--occ-busy-fg); }
.badge--full   { background: var(--occ-full-bg); color: var(--occ-full-fg); }
.badge--demo   { background: var(--c-ink); color: var(--c-white); letter-spacing: 0.06em; }

/* 7 Cards -------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
}
.card--tight { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md); }
.card--cream { background: var(--color-surface-alt); }
.card__title { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }

/* Facility row in the list (the whole row is one button) */
.facility-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 72px;
  padding: var(--sp-3) var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-align: left;
}
.facility-row:hover { background: var(--c-pink-50); }
.facility-row__icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: var(--border); border-radius: 12px;
  background: var(--kind-accent);
}
.facility-row__name { display: block; font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.facility-row__meta { display: block; font-size: var(--fs-sm); color: var(--color-text-muted); }
.facility-row__main { display: grid; gap: 2px; min-width: 0; }
.facility-row__badges { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }

/* Leaflet hooks for our markers and controls */
.rq-marker, .rq-you { background: none; border: 0; }
.leaflet-bar .leaflet-locate {
  display: grid; place-items: center;
  width: var(--tap-sm); height: var(--tap-sm);
  border: 0; border-bottom: 1px solid #ccc;
  background: var(--c-white); color: var(--c-ink);
}
.leaflet-bar .leaflet-locate:hover { background: var(--c-pink-50); }
.leaflet-bar .leaflet-locate:focus-visible { box-shadow: inset 0 0 0 3px var(--c-ink); border-radius: 0; }
.leaflet-tooltip.you-label { border: 0; box-shadow: none; }
.leaflet-tooltip-right.you-label::before { border-right-color: var(--c-ink); }
.facility-list { list-style: none; display: grid; gap: var(--sp-2); }

/* 8 Forms -------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--sp-4); }
.field__label { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.field__hint { font-size: var(--fs-sm); color: var(--color-text-muted); }
.field__error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--color-danger); }
.field__error .icon { width: 18px; height: 18px; margin-top: 1px; }
.optional { font-weight: var(--fw-regular); color: var(--color-text-muted); }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--sp-3) var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--fs-md); /* 16px keeps iOS from zooming */
}
.textarea { min-height: 112px; resize: vertical; line-height: var(--lh-body); }
.select {
  appearance: none;
  padding-right: var(--sp-7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B2B2B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-radius: var(--radius-sm); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--color-danger); border-width: 2px; }

/* Checkbox / radio as large rows */
.choice {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
}
.choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--c-ink); flex: none; }
.choice:has(input:checked) { background: var(--c-pink-50); }
.choice:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.choice input:focus-visible { box-shadow: none; }
.choice-group { display: grid; gap: var(--sp-2); border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-group legend { font-weight: var(--fw-semibold); font-size: var(--fs-sm); margin-bottom: var(--sp-2); padding: 0; }

/* Honeypot: hidden from people and assistive tech, still filled by bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }
.form-actions .btn { flex: 1 1 140px; }

/* Switch (role="switch" button) */
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  width: 100%; min-height: var(--tap);
  padding: var(--sp-2) var(--sp-4);
  border: var(--border); border-radius: var(--radius-md);
  background: var(--color-surface);
  text-align: left; font-weight: var(--fw-semibold);
}
.switch__track {
  position: relative; flex: none;
  width: 48px; height: 28px;
  border: var(--border); border-radius: var(--radius-pill);
  background: var(--c-cream);
  transition: background-color var(--dur) var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--c-ink);
  transition: transform var(--dur) var(--ease);
}
.switch[aria-checked="true"] .switch__track { background: var(--c-ink); }
.switch[aria-checked="true"] .switch__track::after { background: var(--c-white); transform: translateX(20px); }

/* 9 Header ------------------------------------------------------------- */
.app-header {
  position: relative;
  z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  min-height: var(--header-h);
  padding: var(--sp-2) var(--gutter);
  padding-top: max(var(--sp-2), env(safe-area-inset-top));
  background: var(--color-header);
  border-bottom: var(--border);
}

.brand {
  display: flex; align-items: center; gap: var(--sp-2);
  min-width: 0;
  min-height: var(--tap-sm);
  color: var(--c-ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__text { display: grid; min-width: 0; }
.brand__name { font-family: var(--font-display); font-size: 1.125rem; line-height: 1.05; white-space: nowrap; }
.brand__tag { display: none; font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-header__actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.app-header .btn { box-shadow: none; }
.app-header .btn:active { transform: none; }
.header-feedback { display: none; }

/* Toilets / Water toggle: two links, the current one filled with ink */
.kind-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--c-white);
}
.kind-toggle__item {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: var(--tap-sm); height: var(--tap-sm);
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--c-ink);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.kind-toggle__item:hover { background: var(--c-pink-50); text-decoration: none; }
.kind-toggle__item[aria-current="page"] { background: var(--c-ink); color: var(--c-white); }
.kind-toggle__item:focus-visible { border-radius: var(--radius-pill); }
/* Label is visually hidden on small phones but still read by screen readers */
.kind-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 400px) {
  .brand__tag { display: block; }
}
@media (min-width: 560px) {
  .kind-toggle__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .kind-toggle__item { padding: 0 var(--sp-4) 0 var(--sp-3); }
}

/* 10 App layout --------------------------------------------------------
   Mobile: header / map (list and sheet overlay it) / action bar.
   Desktop (>= 900px): header / [action bar + list panel | map]. */
.app-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "map" "bar";
  min-height: 0;
}

.map-wrap { grid-area: map; position: relative; min-height: 0; background: var(--c-cream); }
.map { position: absolute; inset: 0; }

/* Overlay controls on top of the map */
.map-ui {
  position: absolute; z-index: var(--z-map-ui);
  display: flex; gap: var(--sp-2); align-items: center;
  pointer-events: none;
}
.map-ui > * { pointer-events: auto; }
.map-ui--top { top: var(--sp-3); left: var(--sp-3); right: var(--sp-3); justify-content: space-between; align-items: flex-start; }
.map-ui .btn, .map-ui .chip { box-shadow: var(--shadow-float); }
.map-ui__group { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
/* The bar's rounded top overlaps the map by one radius: lift Leaflet's bottom controls */
.map-wrap .leaflet-bottom { bottom: var(--radius-lg); }

/* View switch (map / list), mobile only */
.view-switch { display: inline-flex; padding: 3px; gap: 2px; border: var(--border); border-radius: var(--radius-pill); background: var(--c-white); box-shadow: var(--shadow-float); }
.view-switch button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; min-width: 44px; padding: 0 var(--sp-3);
  border: 0; border-radius: var(--radius-pill); background: transparent;
  font-weight: var(--fw-semibold); font-size: var(--fs-sm);
}
.view-switch button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-white); }

/* Action bar: the "Nearest" buttons, in the thumb zone */
.bar {
  grid-area: bar;
  position: relative;
  z-index: var(--z-bar);
  padding: var(--sp-3) var(--gutter);
  padding-bottom: max(var(--sp-3), env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: calc(var(--radius-lg) * -1);
}
.bar__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); min-height: var(--tap-sm); }
.bar__title { font-family: var(--font-display); font-size: var(--fs-lg); line-height: var(--lh-tight); }
.bar__buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.bar__buttons--single { grid-template-columns: 1fr; }
.bar__buttons .btn { padding: 0 6px; min-height: 52px; gap: 6px; }
.bar__buttons:not(.bar__buttons--single) .btn { font-size: 0.9375rem; }
.nearest-btn .icon { width: 20px; height: 20px; }

/* List panel: overlays the map on mobile when "List" is chosen */
.panel {
  grid-area: map;
  position: relative;
  z-index: var(--z-panel);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--tap) + var(--sp-5)) var(--gutter) calc(var(--radius-lg) + var(--sp-4));
}
.panel__section + .panel__section { margin-top: var(--sp-5); }
.panel__title { font-family: var(--font-display); font-size: var(--fs-xl); margin-bottom: var(--sp-3); }
.app:not([data-view="list"]) .panel { display: none; }

@media (min-width: 900px) {
  :root { --header-h: 68px; --gutter: var(--sp-5); }
  .brand__mark { width: 44px; height: 44px; }
  .brand__name { font-size: 1.375rem; }
  .header-feedback { display: inline-flex; }
  .map-feedback, .view-switch { display: none !important; }

  .app {
    grid-template-columns: var(--panel-w) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "bar map" "panel map";
  }
  .app .panel, .app:not([data-view="list"]) .panel {
    display: block;
    grid-area: panel;
    padding: var(--sp-4) var(--gutter) var(--sp-6);
    border-right: var(--border);
  }
  .map-wrap .leaflet-bottom { bottom: 0; }
  .bar {
    margin: 0;
    border-top: 0;
    border-right: var(--border);
    border-bottom: var(--border);
    border-radius: 0;
    padding: var(--sp-4) var(--gutter);
  }
}

/* 11 Map ---------------------------------------------------------------- */
.leaflet-container { font-family: var(--font-body); font-size: var(--fs-sm); background: var(--c-cream); }
/* Softer tiles so markers stand out, in the chart's pastel mood */
.leaflet-tile-pane { filter: saturate(0.65) contrast(0.96); }
.leaflet-control-attribution { font-size: 11px; background: rgba(255, 255, 255, 0.85) !important; border-top-left-radius: 8px; }
.leaflet-control-attribution a { color: var(--c-ink); }
.leaflet-bar { border: var(--border) !important; border-radius: var(--radius-md) !important; overflow: hidden; box-shadow: var(--shadow-float) !important; }
.leaflet-bar a { width: var(--tap-sm) !important; height: var(--tap-sm) !important; line-height: var(--tap-sm) !important; color: var(--c-ink) !important; font-size: 22px !important; }
.leaflet-bar a:focus-visible { box-shadow: inset 0 0 0 3px var(--c-ink); border-radius: 0; }
/* Our own controls replace Leaflet's top-left zoom; keep its layout from moving */
.leaflet-top.leaflet-left { display: none; }

/* Facility marker: a white tile like the chart cards, status shown by a corner badge + shape */
.marker {
  position: relative;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 2px solid var(--c-ink);
  border-radius: 14px;
  background: var(--c-white);
  color: var(--c-ink);
  box-shadow: 0 3px 0 var(--c-ink);
  transition: transform var(--dur-fast) var(--ease);
}
.marker .icon { width: 24px; height: 24px; }
.marker::after { /* pointer tip */
  content: ""; position: absolute; left: 50%; bottom: -8px;
  width: 12px; height: 12px;
  background: inherit;
  border-right: 2px solid var(--c-ink); border-bottom: 2px solid var(--c-ink);
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}
.marker__badge {
  position: absolute; top: -9px; right: -9px;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 2px solid var(--c-ink); border-radius: 50%;
  font-size: 12px; font-weight: var(--fw-bold); line-height: 1;
}
.marker__badge .icon { width: 13px; height: 13px; stroke-width: 3; }
.marker--issue .marker__badge { background: var(--c-peach); color: var(--c-brick); }
.marker--out { background: var(--c-cream); }
.marker--out > .icon { opacity: 0.55; }
.marker--out .marker__badge { background: var(--c-brick); color: var(--c-white); }
.marker--closed { background: var(--c-cream); }
.marker--closed .marker__badge { background: var(--c-white); }
.marker.is-selected { background: var(--c-ink); color: var(--c-white); transform: scale(1.12); }
.marker.is-selected::after { background: var(--c-ink); }
.leaflet-marker-icon:focus-visible { box-shadow: none; }
.leaflet-marker-icon:focus-visible .marker { box-shadow: var(--focus-ring); }

/* "You are here" (geolocation or QR spot) */
.you-dot {
  width: 22px; height: 22px;
  border: 3px solid var(--c-white); border-radius: 50%;
  background: var(--c-ink);
  box-shadow: 0 0 0 2px var(--c-ink), 0 0 0 10px rgba(43, 43, 43, 0.15);
}
.you-label {
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--c-ink); color: var(--c-white);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); white-space: nowrap;
}

/* Walking route: dashed ink line, as on the prototype map */
.route-line { stroke: var(--c-ink); stroke-dasharray: 2 10; stroke-linecap: round; }

/* 12 Sheet (facility details) --------------------------------------------
   Mobile: bottom sheet over map + bar, two heights (half / full).
   Desktop: fills the left column, the map stays visible. */
.sheet {
  grid-row: 1 / -1;
  grid-column: 1 / -1;
  align-self: end;
  position: relative;
  z-index: var(--z-sheet);
  display: flex; flex-direction: column;
  max-height: 58%;
  background: var(--color-surface);
  border-top: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 30px rgba(43, 43, 43, 0.16);
  transition: max-height var(--dur) var(--ease);
}
.sheet[data-size="full"] { max-height: 100%; border-radius: 0; }
.sheet__grip {
  display: grid; place-items: center;
  width: 100%; height: 28px; flex: none;
  border: 0; background: transparent;
  touch-action: none; cursor: grab;
}
.sheet__grip::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--c-ink); opacity: 0.5; }
.sheet__grip:focus-visible { box-shadow: inset 0 0 0 3px var(--c-ink); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.sheet__head { display: flex; align-items: flex-start; gap: var(--sp-3); padding: 0 var(--gutter) var(--sp-3); flex: none; }
.sheet__titles { flex: 1; min-width: 0; }
.sheet__title { font-family: var(--font-display); font-size: var(--fs-2xl); line-height: var(--lh-tight); text-transform: uppercase; overflow-wrap: anywhere; }
.sheet__subtitle { margin-top: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--color-text-muted); }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4) var(--gutter) var(--sp-6); border-top: var(--border); }
.sheet__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); padding: 0 var(--gutter) var(--sp-4); flex: none; }
.sheet__actions .btn { padding: 0 var(--sp-3); }

@media (min-width: 900px) {
  .sheet {
    grid-row: 1 / -1;
    grid-column: 1 / 2;
    align-self: stretch;
    max-height: none;
    border-top: 0;
    border-right: var(--border);
    border-radius: 0;
    box-shadow: 8px 0 30px rgba(43, 43, 43, 0.12);
  }
  .sheet__grip { display: none; }
  .sheet__head { padding-top: var(--sp-4); }
}

/* 13 Dialogs (native <dialog>): bottom sheet on phones, centered on desktop */
.modal {
  width: 100%;
  max-width: 100%;
  max-height: calc(100dvh - var(--sp-6));
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-top: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-surface);
  color: var(--color-text);
  overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in var(--dur) var(--ease); }
.modal::backdrop { background: rgba(43, 43, 43, 0.45); }
.modal__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--gutter) var(--sp-3);
  background: var(--kind-accent);
  border-bottom: var(--border);
}
.modal__title { font-family: var(--font-display); font-size: var(--fs-2xl); line-height: var(--lh-tight); text-transform: uppercase; }
.modal__subtitle { margin-top: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.modal__body { overflow-y: auto; padding: var(--sp-4) var(--gutter) max(var(--sp-5), env(safe-area-inset-bottom)); }
.modal__head .btn { flex: none; box-shadow: none; }

@keyframes modal-in { from { transform: translateY(24px); opacity: 0; } }

@media (min-width: 640px) {
  .modal {
    width: min(520px, calc(100% - var(--sp-6)));
    margin: auto;
    border: var(--border);
    border-radius: var(--radius-lg);
  }
}

/* Menu list inside a dialog */
.menu-list { list-style: none; display: grid; gap: var(--sp-2); }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: var(--tap);
  padding: var(--sp-2) var(--sp-4);
  border: var(--border); border-radius: var(--radius-md);
  background: var(--color-surface);
  font-weight: var(--fw-semibold); text-align: left; text-decoration: none;
}
.menu-list a:hover, .menu-list button:hover { background: var(--c-pink-50); }

/* 14 Toasts (one polite live region, always in the DOM) ------------------ */
.toasts {
  position: fixed;
  z-index: var(--z-toast);
  left: 50%; top: calc(var(--header-h) + 64px); /* below the Filters / Map-List row */
  transform: translateX(-50%);
  display: grid; gap: var(--sp-2);
  width: min(480px, calc(100% - 2 * var(--gutter)));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--c-white);
  box-shadow: var(--shadow-float);
  font-weight: var(--fw-semibold);
  pointer-events: auto;
  animation: toast-in var(--dur) var(--ease);
}
.toast__text { flex: 1; }
.toast--success { background: var(--status-ok-bg); }
.toast--error { background: var(--c-pink-50); }
.toast--error .icon { color: var(--c-brick); }
.toast .btn { min-height: var(--tap-sm); box-shadow: none; }
@keyframes toast-in { from { transform: translateY(-12px); opacity: 0; } }

/* 15 Report tiles ("What's wrong? one tap is enough") -------------------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 104px;
  padding: var(--sp-3);
  border: var(--border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  text-align: center;
  line-height: var(--lh-snug);
  box-shadow: var(--shadow-press);
}
.tile .icon { width: 28px; height: 28px; }
.tile:hover { background: var(--c-pink-50); }
.tile:active { transform: translateY(2px); box-shadow: var(--shadow-press-active); }
.tile:focus-visible { border-radius: var(--radius-lg); box-shadow: var(--shadow-press), var(--focus-ring); }
.tile[aria-pressed="true"], .tile.is-sent { background: var(--c-ink); color: var(--c-white); }

/* 16 Facility details -------------------------------------------------- */
.detail-badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.detail-section + .detail-section { margin-top: var(--sp-4); }
.detail-section__title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-bold); margin-bottom: var(--sp-3); }

/* Units: "3 seated · 2 squat · 4 urinals" as small tiles (prototype "Stalls") */
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--sp-2); list-style: none; }
.unit {
  display: grid; justify-items: center; gap: 2px;
  padding: var(--sp-3) var(--sp-2);
  border: var(--border); border-radius: var(--radius-md);
  background: var(--c-sky-50);
  text-align: center;
}
.unit__count { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1; }
.unit__label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); }

/* Key/value rows (supplies, water outlets, hours) */
.kv { list-style: none; display: grid; }
.kv li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); min-height: 40px; padding: var(--sp-1) 0; }
.kv li + li { border-top: 1px solid rgba(43, 43, 43, 0.15); }
.kv__key { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-medium); }
.kv__val { font-weight: var(--fw-bold); text-align: right; }
.kv__val--ok { color: var(--status-ok-fg); }
.kv__val--issue { color: var(--status-issue-fg); }

/* Step-by-step directions */
.steps { list-style: none; counter-reset: step; display: grid; gap: var(--sp-3); }
.step { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: var(--sp-3); align-items: start; }
.step::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: var(--border); border-radius: 50%;
  background: var(--kind-accent);
  font-family: var(--font-display);
}
.step__text { padding-top: 6px; }
.step__photo { grid-column: 2; border: var(--border); border-radius: var(--radius-md); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--c-cream); }

/* Photo strip */
.photos { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: var(--sp-2); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--sp-2); }
.photos img { scroll-snap-align: start; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border: var(--border); border-radius: var(--radius-md); background: var(--c-cream); }

/* Emergency numbers block, always next to the help button */
.emergency { display: grid; gap: var(--sp-2); }
.notice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border: var(--border); border-radius: var(--radius-md);
  background: var(--c-cream);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.notice--warn { background: var(--c-peach); }
.notice .icon { margin-top: 1px; }

/* 17 States ----------------------------------------------------------- */
.map-empty { height: 100%; align-content: center; }
.map-empty p:not(.empty__title) { background: var(--c-white); border: var(--border); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); }
.empty {
  display: grid; justify-items: center; gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
}
.empty__icon { display: grid; place-items: center; width: 64px; height: 64px; border: var(--border); border-radius: 18px; background: var(--kind-accent); }
.empty__icon .icon { width: 32px; height: 32px; }
.empty__title { font-family: var(--font-display); font-size: var(--fs-xl); }
.empty p { max-width: 36ch; }

.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #e9e9e2 25%, #f6f6f1 50%, #e9e9e2 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton--row { height: 72px; }
@keyframes shimmer { to { background-position: -150% 0; } }

.spinner { width: 22px; height: 22px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .icon { display: none; }

/* 18 Content pages (privacy, not found, install) ------------------------ */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.page__main { padding: var(--sp-5) var(--gutter) var(--sp-7); }
.page__card { max-width: var(--content-max); margin: 0 auto; }
.page__title { font-size: var(--fs-3xl); text-transform: uppercase; margin-bottom: var(--sp-4); }
.prose { line-height: 1.65; }
.prose h2 { font-size: var(--fs-xl); margin: var(--sp-5) 0 var(--sp-2); }
.prose p, .prose ul { margin: 0 0 var(--sp-3); }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: var(--sp-1); }

.site-footer {
  padding: var(--sp-4) var(--gutter) max(var(--sp-4), env(safe-area-inset-bottom));
  border-top: var(--border);
  background: var(--color-surface);
  font-size: var(--fs-sm);
}
.site-footer__inner { max-width: var(--content-max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); justify-content: space-between; align-items: center; }

/* 19 Motion and forced colors ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .btn, .chip, .badge, .card, .tile, .marker, .kind-toggle, .facility-row { border-color: CanvasText; }
  .btn[aria-pressed="true"], .chip[aria-pressed="true"], .kind-toggle__item[aria-current="page"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  :focus-visible { outline: 3px solid Highlight; outline-offset: 2px; }
}

/* 20 Milestone (c): groups, routes, filters, viewer ------------------------ */

/* Building marker with a count of facilities */
.marker__count {
  position: absolute; top: -10px; right: -10px;
  display: grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 5px;
  border: 2px solid var(--c-white); border-radius: var(--radius-pill);
  background: var(--c-ink); color: var(--c-white);
  font-size: 12px; font-weight: var(--fw-bold); line-height: 1;
  box-shadow: 0 0 0 1.5px var(--c-ink);
}
.marker.is-selected .marker__count { background: var(--c-white); color: var(--c-ink); }
.marker__dot {
  position: absolute; bottom: -4px; right: -4px;
  width: 14px; height: 14px; border: 2px solid var(--c-ink); border-radius: 50%;
  background: var(--c-peach);
}
.marker--group { border-radius: 14px 14px 14px 14px; }

.sheet__head .btn--icon[data-sheet-back] { margin-top: 2px; }

.panel__tools { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.panel__tools p { background: var(--c-white); border: var(--border); border-radius: var(--radius-pill); padding: 2px 10px; }
.panel__tools p:empty { display: none; }
.panel__filters { display: none; }
@media (min-width: 900px) {
  .panel__filters { display: inline-flex; }
  .map-ui--top .chip[data-open="filters"] { display: none; }
}

/* Route card */
.route-card { border-width: 2px; }
.route-card__walk { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1.2; margin-bottom: var(--sp-1); }
.route-card__label { margin-top: var(--sp-3); margin-bottom: var(--sp-2); font-weight: var(--fw-semibold); }
.route-card .small + .small { margin-top: var(--sp-1); }
.route-line { stroke-dasharray: 1 11; }

.where-note { font-weight: var(--fw-semibold); margin-bottom: var(--sp-2); }
.kv__val--note { font-weight: var(--fw-medium); color: var(--color-text-muted); font-size: var(--fs-sm); }
.access-note { display: flex; gap: var(--sp-2); align-items: flex-start; margin-top: var(--sp-2); }
.amenities { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.amenities .badge { min-height: 32px; font-size: var(--fs-sm); }

/* Clickable photos */
.photos__btn, .step__photo-btn { padding: 0; border: 0; background: none; border-radius: var(--radius-md); scroll-snap-align: start; }
.photos__btn img { width: 100%; }
.step__photo-btn { grid-column: 2; }
.step__photo-btn:focus-visible, .photos__btn:focus-visible { border-radius: var(--radius-md); }
.photos + .btn { margin-top: var(--sp-3); }
.steps + .btn { margin-top: var(--sp-3); }

/* Floor chips in the building card */
.floor-chips { padding-bottom: var(--sp-1); }

/* Filters dialog */
.filter-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.filter-group legend { font-weight: var(--fw-bold); margin-bottom: var(--sp-2); padding: 0; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.filter-actions { position: sticky; bottom: calc(var(--sp-5) * -1); background: var(--c-white); padding: var(--sp-3) 0; margin-bottom: calc(var(--sp-5) * -1); border-top: 1px solid rgba(43, 43, 43, 0.15); }

/* Photo viewer and 360° */
.modal--viewer { max-height: calc(100dvh - var(--sp-4)); }
@media (min-width: 640px) { .modal--viewer { width: min(900px, calc(100% - var(--sp-6))); } }
.viewer { display: grid; gap: var(--sp-3); }
.viewer__figure { margin: 0; display: grid; gap: var(--sp-2); touch-action: pan-y; }
.viewer__figure img { width: 100%; max-height: 62dvh; object-fit: contain; background: var(--c-ink); border-radius: var(--radius-md); }
.viewer__caption { font-weight: var(--fw-semibold); }
.viewer__nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
/* Doubled selector: pannellum.css loads later and sets .pnlm-container { height: 100% } */
.modal__body .pano { position: relative; height: min(62dvh, 520px); border: var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--c-ink); margin-bottom: var(--sp-2); }
.pano-status { display: flex; gap: var(--sp-2); align-items: center; justify-content: center; height: 100%; color: var(--c-white); font-weight: var(--fw-semibold); }

@media (min-width: 900px) { .toasts { top: calc(var(--header-h) + var(--sp-3)); } }

/* 21 Milestone (d): reported problems, report panels ---------------------- */
.issues { border-color: var(--c-brick); }
.issues__list { list-style: none; display: grid; gap: var(--sp-3); }
.issue + .issue { border-top: 1px solid rgba(43, 43, 43, 0.15); padding-top: var(--sp-3); }
.issue__label { font-weight: var(--fw-bold); }
.issue__vote { margin-top: var(--sp-2); display: grid; gap: var(--sp-2); }
.issue__vote .btn { box-shadow: none; }
.issue__thanks { display: flex; gap: var(--sp-1); align-items: center; color: var(--status-ok-fg); font-weight: var(--fw-semibold); }
.report-note { margin-top: var(--sp-3); }
.tile.is-sent::after { content: "✓"; font-weight: var(--fw-bold); }
[data-report-outlets] { margin: var(--sp-2) 0 var(--sp-4); }
.notice--success { background: var(--status-ok-bg); }
.notice--info { background: var(--c-cream); }
.notice:focus-visible { border-radius: var(--radius-md); }

/* Staff check-in */
.staff__h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.staff__tile { width: 100%; }
.tiles form { display: contents; }
.toast { flex-wrap: wrap; }
.toast__text { flex: 1 1 170px; }
