/* Shared styles for the app screens; tokens follow mockup A. Spacing scale: 4/8/12/16/24 px. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #e8e8e8; color: #141414; font: 16px/1.35 system-ui, sans-serif; }
.bar { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; background: #141414; color: #fff; }
.bar h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 800; }
.bar a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; color: #fff; font-weight: 700; }
main { display: grid; gap: 16px; max-width: 560px; margin: 0 auto; padding: 16px; }
.card { display: grid; gap: 16px; padding: 16px; background: #fff; border-radius: 14px; }
.card h2 { margin: 0; font-size: 20px; }
.card p { margin: 0; }
label { display: grid; gap: 4px; font-weight: 700; }
.hint { font-weight: 400; color: #4a4a4a; }
input[type=text], input[type=password], textarea {
  width: 100%; min-height: 52px; padding: 8px 12px; font: inherit; font-size: 18px; font-weight: 400; color: #141414;
  background: #fff; border: 2px solid #8a8a8a; border-radius: 10px;
}
/* Eye button over the right edge of a password field (js/password-toggle.js); it fills the field's inner height. */
.pw-field { position: relative; }
.pw-field input { padding-right: 56px; }
/* The browser's own reveal and clear buttons would show a second eye next to ours. */
.pw-field input::-ms-reveal, .pw-field input::-ms-clear { display: none; }
/* Flush with the field's edge, so no 8 px gap to the field: the usual inline-reveal pattern. Both targets are at least
   48 px, and a near-miss only focuses the field, which is harmless. */
.pw-toggle { position: absolute; right: 2px; bottom: 2px; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; color: #141414; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.pw-toggle:focus-visible { outline-offset: -3px; }
fieldset { display: flex; gap: 8px; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 4px; font-weight: 700; }
.radio { display: flex; flex: 1; align-items: center; gap: 8px; min-height: 52px; padding: 0 12px; border: 2px solid #8a8a8a; border-radius: 10px; font-weight: 700; }
.radio input { width: 24px; height: 24px; margin: 0; accent-color: #141414; }
.btn-primary, .btn-ghost {
  display: flex; align-items: center; justify-content: center; width: 100%; padding: 8px 16px;
  font: inherit; color: #141414; text-align: center; text-decoration: none; border-radius: 14px; cursor: pointer;
}
.btn-primary { min-height: 60px; font-size: 19px; font-weight: 800; background: #ffd60a; border: 2px solid #141414; }
.btn-ghost { min-height: 52px; font-weight: 700; background: #fff; border: 2px solid #8a8a8a; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.row-actions { display: flex; gap: 8px; }
.row-actions .btn-ghost { min-height: 48px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #0050d0; outline-offset: 2px; }
.error { margin: 0; color: #b00020; font-weight: 700; }
.error:empty, .status:empty { display: none; }
.status { margin: 0; font-weight: 700; }
.users { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.users li { display: grid; gap: 8px; padding: 12px; border: 2px solid #d0d0d0; border-radius: 10px; }
.users .who { font-weight: 700; }
.users .meta { color: #4a4a4a; }
.users li.off { background: #f2f2f2; }
.users li.off .who { color: #4a4a4a; }
dialog { width: min(92vw, 420px); padding: 16px; border: 0; border-radius: 14px; }
dialog::backdrop { background: rgb(0 0 0 / .5); }
dialog form { display: grid; gap: 16px; }
dialog form :is(h2, p) { margin: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Noodtoegang */
.qr { width: 240px; max-width: 100%; margin: 0 auto; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.code-big { font: 800 32px/1.2 ui-monospace, monospace; letter-spacing: .1em; text-align: center; }

.pick { flex-direction: column; }
.scan-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #141414; border-radius: 10px; }

/* Plattegrond-editor */
main.wide { max-width: 1200px; }
.stack { display: grid; gap: 16px; }
.floors, .zone-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.floors li { display: grid; gap: 8px; padding: 12px; border: 2px solid #d0d0d0; border-radius: 10px; }
.floor-link { display: grid; align-content: center; min-height: 48px; color: #141414; font-size: 20px; font-weight: 800; }
.floor-link .meta { color: #4a4a4a; font-size: 16px; font-weight: 400; }
.zone-list .btn-ghost { justify-content: flex-start; min-height: 48px; text-align: left; }
.zone-list .btn-ghost[aria-pressed=true] { border-color: #0050d0; box-shadow: inset 0 0 0 2px #0050d0; }
.btn-ghost:disabled { color: #6a6a6a; border-color: #c4c4c4; cursor: default; }
input[type=file] { width: 100%; min-height: 48px; font: inherit; font-weight: 400; }
input[type=file]::file-selector-button { min-height: 48px; margin-right: 12px; padding: 0 16px; font: inherit; font-weight: 700; background: #fff; border: 2px solid #8a8a8a; border-radius: 10px; }
details.card:not([open]) { gap: 0; }
summary { display: flex; align-items: center; min-height: 48px; font-size: 20px; font-weight: 800; cursor: pointer; }
summary:focus-visible { outline: 3px solid #0050d0; outline-offset: 2px; }
.zoom-row { display: flex; align-items: center; gap: 8px; }
.zoom-row .btn-ghost { width: 56px; min-height: 48px; font-size: 24px; }
.zoom-row span { min-width: 56px; font-weight: 700; text-align: center; }
/* touch-action: pinch and pan stay, double-tap zoom goes, so quick corner taps are not swallowed. */
.plan-wrap { max-height: 70vh; overflow: auto; background: #fff; border: 2px solid #8a8a8a; border-radius: 10px; touch-action: manipulation; }
.plan { display: block; height: auto; }
.zone { cursor: pointer; outline: none; }
.zone polygon { fill: rgb(255 214 10 / .25); stroke: #1a1a1a; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.zone.is-selected polygon, .zone:focus-visible polygon { stroke: #0050d0; stroke-width: 4px; }
.zone-label { fill: #141414; font-weight: 700; text-anchor: middle; dominant-baseline: middle; stroke: #fff; paint-order: stroke; pointer-events: none; }
.is-drawing .zone { pointer-events: none; }
.is-drawing { cursor: crosshair; }
.draw-line { fill: none; stroke: #0050d0; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.draw-close { stroke: #0050d0; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.draw-dot { fill: #0050d0; stroke: #fff; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.draw-first { fill: #fff; stroke: #0050d0; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.draw-ghost { fill: none; stroke: #8a8a8a; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.draw-bar { position: sticky; bottom: 0; display: grid; gap: 12px; padding: 12px; background: #fff; border-radius: 14px; box-shadow: 0 -2px 12px rgb(0 0 0 / .2); }
.draw-bar p { margin: 0; }

/* Kaart */
:root {
  --geel: #ffd60a; --on-geel: #1a1a1a;
  --oranje: #f57c00; --on-oranje: #1a1a1a;
  --groen: #2e7d32; --on-groen: #fff;
}
/* Side insets: a phone in landscape keeps header, plan and tabs clear of the notch (portrait insets are 0). The insets go
   through --sl, --sr and --sb so the landscape rail and the harness (which cannot fake env()) use the same values. */
.map-app {
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --sb: env(safe-area-inset-bottom, 0px);
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden; padding: 0 var(--sr) 0 var(--sl); background: #141414;
}
.map-head { padding: 8px 12px 12px; background: #141414; color: #fff; }
.head-row { display: flex; align-items: center; gap: 8px; }
.head-row h1 { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 20px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.count { margin: 0; font-size: 20px; font-weight: 800; white-space: nowrap; }
.count small, .total { font-size: 16px; font-weight: 400; color: #d6d6d6; }
.menu-btn, .stream-btn { flex: none; width: 48px; height: 48px; font: inherit; font-size: 24px; color: #fff; background: #2b2b2b; border: 0; border-radius: 12px; cursor: pointer; }
/* "Wijzigingen en berichten": the unread count sits inside the button's own box, so it never covers the menu button. */
.stream-btn { position: relative; display: flex; align-items: center; justify-content: center; padding: 0; }
.stream-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: 2px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 13px; font-weight: 800; line-height: 20px; color: #141414; text-align: center; background: var(--geel); border-radius: 10px; }
.progress { height: 8px; margin-top: 8px; overflow: hidden; background: #3a3a3a; border-radius: 4px; }
.progress i { display: block; height: 100%; background: #4caf50; transform-origin: left; transition: transform .3s; }
.total { margin: 4px 0 0; }
.offline { margin: 0; padding: 8px 12px; font-weight: 700; color: #141414; background: var(--geel); }
/* Phones use overlay scrollbars; hiding them here keeps the plan sizing exact on desktop too. */
main.scroller { display: block; flex: 1; max-width: none; margin: 0; padding: 0; overflow: auto; background: #e8e8e8; overscroll-behavior: contain; scrollbar-width: none; }
main.scroller::-webkit-scrollbar { display: none; }
#map { display: block; }
.empty { margin: 16px; }
.map-foot { position: relative; padding: 8px 8px calc(8px + var(--sb)); background: #141414; }
.foot-row { display: flex; gap: 8px; }
.tabs { display: flex; flex: 1; gap: 8px; overflow-x: auto; }
.tab {
  flex: 1 1 0; min-width: 64px; min-height: 60px; padding: 4px 8px; overflow: hidden;
  font: inherit; font-size: 18px; font-weight: 800; line-height: 1.1; color: #fff; white-space: nowrap; text-overflow: ellipsis;
  background: #2b2b2b; border: 0; border-radius: 12px; cursor: pointer;
}
.tab small { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: #d6d6d6; }
.tab[aria-pressed=true] { color: #141414; background: #fff; }
.tab[aria-pressed=true] small { color: #444; }
.melding { min-height: 60px; padding: 0 16px; font: inherit; font-size: 18px; font-weight: 800; background: var(--geel); border: 0; border-radius: 12px; }
.toast-region { position: absolute; left: 8px; right: 8px; bottom: 100%; margin-bottom: 8px; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 16px; font-weight: 700; color: #fff; background: #141414; border-radius: 12px; box-shadow: 0 2px 12px rgb(0 0 0 / .3); }
.toast button { flex: none; min-height: 48px; padding: 0 16px; font: inherit; font-weight: 800; color: #141414; background: var(--geel); border: 0; border-radius: 10px; cursor: pointer; }
.map-foot :focus-visible, .map-head :focus-visible, .sheet :focus-visible { outline: 3px solid #4d9bff; outline-offset: 2px; }
/* Only in the landscape rail (below); hidden elsewhere, so portrait keeps its header and tabs. */
.fs-btn, .tab-sum { display: none; }
.sheet :focus-visible { outline-color: #0050d0; }

dialog.sheet { width: 100%; max-width: 560px; margin: auto auto 0; padding: 8px 16px calc(16px + var(--sb)); overflow-y: auto; overscroll-behavior: contain; border-radius: 18px 18px 0 0; }
/* More below the fold (index.html sets .more): a shadow along the bottom edge, above the content, so a sheet that
   scrolls never looks cut off. Zero height; only the sheet's row gap below the last item, and only while it is set. */
.sheet.more::after { content: ''; grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 1; height: 0; margin: -12px -16px 0; box-shadow: 0 0 16px 12px rgb(0 0 0 / .25); pointer-events: none; }
/* Wide and tall enough (desktop, tablet landscape): a panel at the top right, under the header (110 px tall)
   and level with the menu button, scrolling on its own. Phones, also in landscape, keep the bottom sheet. */
@media (min-width: 900px) and (min-height: 600px) {
  dialog.sheet { width: 420px; max-height: calc(100dvh - 130px); margin: 0; inset: 118px 12px auto auto; padding-bottom: 16px; border-radius: 18px; }
}
.sheet { display: grid; gap: 12px; }
.sheet:not([open]) { display: none; }
.sheet p { margin: 0; }
.sheet-head { position: sticky; top: -8px; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: #fff; }
.sheet h2 { margin: 8px 0 0; font-size: 24px; }
.close { flex: none; width: 48px; height: 48px; font: inherit; font-size: 28px; background: #eee; border: 0; border-radius: 12px; cursor: pointer; }
.pill { justify-self: start; padding: 4px 12px; font-weight: 700; border: 2px solid #141414; border-radius: 999px; }
.pill[data-s=geel] { background: var(--geel); }
.pill[data-s=oranje] { background: var(--oranje); }
.pill[data-s=groen] { color: var(--on-groen); background: var(--groen); }
.sheet .meta { color: #444; }
.actions { display: grid; gap: 8px; }
.act { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 8px 16px; font: inherit; font-size: 19px; font-weight: 800; color: #141414; border: 2px solid #141414; border-radius: 14px; cursor: pointer; }
.act.oranje { background: var(--oranje); }
.act.groen { color: var(--on-groen); background: var(--groen); }
.act.ghost { min-height: 52px; font-size: 16px; font-weight: 700; background: #fff; border-color: #8a8a8a; }
.act:disabled { opacity: .6; cursor: wait; }

/* Zones with a status (the map); the editor's zones have no data-s and keep the rules above. */
.zone[data-s] .zfill { fill-opacity: .38; stroke: none; }
.zone[data-s=geel] .zfill { fill: var(--geel); }
.zone[data-s=oranje] .zfill { fill: var(--oranje); }
.zone[data-s=groen] .zfill { fill: var(--groen); fill-opacity: .42; }
.zone[data-s] .zhatch { fill: url(#hatch); fill-opacity: .55; stroke: none; }
.hatch-line { fill: #7a3e00; }
.zone[data-s] .zline { fill: none; stroke: #1a1a1a; stroke-width: 2px; }
.zone[data-s]:focus-visible .zline { stroke: #0050d0; stroke-width: 5px; stroke-dasharray: none; }
.zlabel { pointer-events: none; }
.zlabel rect { stroke: #1a1a1a; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.zlabel[data-s=geel] rect { fill: var(--geel); }
.zlabel[data-s=oranje] rect { fill: var(--oranje); }
.zlabel[data-s=groen] rect { fill: var(--groen); }
.zlabel text { fill: var(--on-geel); text-anchor: middle; }
.zlabel[data-s=groen] text { fill: var(--on-groen); }
.zname { font-weight: 700; }
.zstat { font-weight: 500; }

/* Meldingen */
.melding { flex: none; display: flex; align-items: center; gap: 8px; min-width: 112px; color: #141414; cursor: pointer; }
.melding b { font-size: 26px; line-height: 1; }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 8px; font: inherit; font-weight: 800; color: #141414; text-align: center; background: #fff; border: 2px solid #141414; border-radius: 14px; cursor: pointer; }
.sheet h2 .ico { vertical-align: -6px; }
.hint-bar { position: absolute; left: 0; right: 0; bottom: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; font-weight: 700; color: #141414; background: var(--geel); box-shadow: 0 -2px 12px rgb(0 0 0 / .3); }
.hint-bar button { flex: none; min-height: 48px; padding: 0 16px; font: inherit; font-weight: 700; color: #141414; background: #fff; border: 2px solid #141414; border-radius: 10px; cursor: pointer; }
.hint-bar button:disabled { opacity: .6; cursor: wait; }
.hint-bar :focus-visible { outline-color: #0050d0; }
body.placing #map { cursor: crosshair; }
body.placing #scroller { outline: 4px solid var(--geel); outline-offset: -4px; }
.confirm { font-weight: 700; }
.act.danger { color: #fff; background: #b00020; border-color: #b00020; }
.issue { cursor: pointer; outline: none; }
.issue-hit { fill: transparent; }
.issue-dot { stroke: #1a1a1a; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.issue:focus-visible .issue-dot { stroke: #0050d0; stroke-width: 6px; }
.issue-cap { font-weight: 700; fill: #fff; text-anchor: middle; }
.issue-cap-bg { fill: #1a1a1a; }

/* Geschiedenis */
.rounds { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rounds > li { border: 2px solid #d0d0d0; border-radius: 10px; }
.rounds summary { display: list-item; padding: 12px; font-size: 18px; font-weight: 700; }
.menu-zelden { border-top: 1px solid #c4c4c4; }
.menu-zelden summary { display: list-item; padding: 12px 0; font-size: 16px; font-weight: 700; }
.menu-zelden .btn-ghost { margin-top: 12px; }
.rounds .meta { display: block; color: #4a4a4a; font-size: 16px; font-weight: 400; }
.log { display: grid; gap: 8px; margin: 0; padding: 0 12px 12px; list-style: none; }
.log li { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.log time { color: #4a4a4a; font-variant-numeric: tabular-nums; }
/* A message on the history page: the text wraps, the remove step sits under it. */
.msg-line span { overflow-wrap: anywhere; }
.msg-line-actions { display: grid; grid-column: 1 / -1; gap: 8px; }
.msg-line-actions .msg-remove { justify-self: start; margin: 0; }
.msg-line-actions .actions { grid-template-columns: 1fr 1fr; }
/* The map's change list: two lines per row, place | time over code | name, so each part scans as a column. */
.sheet .log { gap: 0; padding: 0; }
.log li.entry { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid #d0d0d0; }
.entry time { text-align: right; }
.entry .code { justify-self: start; font-weight: 700; }
.entry .code[data-s] { padding: 0 8px; border-radius: 6px; }
.entry .code[data-s=geel] { background: var(--geel); }
.entry .code[data-s=oranje] { background: var(--oranje); }
.entry .code[data-s=groen] { color: var(--on-groen); background: var(--groen); }
.entry .by { text-align: right; color: #444; }

/* Wijzigingen en berichten. Message rows are bubbles among the change rows; a beheer message is an inverted card with
   the word "Beheer" and bold text, so it stands out without colour. */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: flex; flex: 1; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; font-weight: 700; border: 2px solid #8a8a8a; border-radius: 10px; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: #141414; }
.composer { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 8px; }
.composer > :not(textarea, .btn-send) { grid-column: 1 / -1; }
.composer textarea { min-height: 0; resize: none; }
.composer .meta:empty, #msg-status:empty, #log-error:empty { display: none; }
/* Read by screen readers, not shown. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn-send { min-height: 52px; padding: 0 16px; font: inherit; font-weight: 800; color: #141414; background: var(--geel); border: 2px solid #141414; border-radius: 14px; cursor: pointer; }
.btn-send:disabled { color: #4a4a4a; background: #eee; border-color: #8a8a8a; cursor: default; }
.log li.msg { grid-template-columns: 1fr; gap: 4px; margin: 6px 0; padding: 8px 12px; background: #fff; border: 2px solid #8a8a8a; border-radius: 4px 14px 14px 14px; }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.msg-head time { margin-left: auto; color: #4a4a4a; font-variant-numeric: tabular-nums; }
.msg-text { overflow-wrap: anywhere; }
.msg .role { padding: 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #141414; background: var(--geel); border-radius: 6px; }
.log li.msg.beheer { color: #fff; background: #141414; border-color: #141414; }
.msg.beheer .msg-text { font-size: 18px; font-weight: 700; }
.msg.beheer time { color: #d6d6d6; }
.msg.removed .msg-text { font-style: italic; font-weight: 400; color: #4a4a4a; }
.msg.beheer.removed .msg-text { color: #d6d6d6; }
.msg .error { color: #b00020; }
.msg.beheer .error { color: #ff9a9a; }
.msg.beheer .confirm { color: #fff; }
.msg.beheer :focus-visible { outline-color: #4d9bff; }
/* Remove: a 48 px ghost icon button (the bin), no fill or border; the glyph is #4a4a4a on white (8.9:1) and #d6d6d6 on the
   black beheer card (13:1). */
.msg-remove { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: -8px -8px -8px 0; padding: 0; color: #4a4a4a; background: none; border: 0; border-radius: 10px; cursor: pointer; }
.msg-remove svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.msg.beheer .msg-remove { color: #d6d6d6; }
.msg .actions { grid-template-columns: 1fr 1fr; }
.msg .act { min-height: 48px; font-size: 16px; }
.msg .not-sent { color: #b00020; }
.msg.beheer .not-sent { color: #ff9a9a; }
/* The menu: one part per purpose, separated by a rule. */
.menu-part { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid #c4c4c4; }
.menu-part h3 { margin: 0; font-size: 16px; font-weight: 800; color: #444; }

/* Privacy */
main > p { margin: 0; }
.link { display: inline-flex; align-items: center; min-height: 48px; color: #141414; font-weight: 700; }
.card ul:not([class]) { margin: 0; padding-left: 20px; }
.card ul:not([class]) li + li { margin-top: 8px; }

/* Niet verstuurd: the alert line and "Opnieuw versturen", the primary action of the sheet, toast or hint bar it sits in.
   In the toast the retry keeps the toast's own yellow button. */
.not-sent { display: grid; gap: 8px; color: #b00020; font-weight: 700; }
.retry, .hint-bar .retry { color: #fff; background: #141414; border-color: #141414; }
#hint-text { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* A phone in landscape: header and bottom bar become one rail on the right, so the plan gets the full height.
   .map-app is a grid: the plan in column 1, the rail in column 2. The head spans rows 1-2 and the scroller rows 2-3;
   items spanning the flexible row 2 do not size the auto rows, so row 1 is exactly the offline line (0 when hidden) and
   row 3 exactly the foot. The head clips: its status lines sit at its bottom and give way first. Rail inside: 148 px
   between 8 px paddings; row 1 holds Volledig scherm, the stream and the menu (44 px each, 8 px apart), or the stream and
   the menu (70 px each) where the phone cannot go full screen; the tabs are two 70 px columns. The notch can be on either side: --sl pads the plan, --sr the rail's
   right edge, whose dark background runs to the screen edge. Tablets and desktop (taller) keep the layout above. */
@media (orientation: landscape) and (max-height: 500px) {
  .map-app { display: grid; grid-template-columns: minmax(0, 1fr) calc(164px + var(--sr)); grid-template-rows: auto minmax(0, 1fr) auto; padding: 0 0 0 var(--sl); }
  .offline { grid-area: 1 / 1; }
  main.scroller { grid-area: 2 / 1 / 4 / 2; }
  .map-head { position: relative; grid-area: 1 / 2 / 3 / 3; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 4px 8px; align-content: start; min-height: 0; overflow: hidden; padding: 8px calc(8px + var(--sr)) 0 8px; }
  .head-row { display: contents; }
  .fs-btn { grid-area: 1 / 1 / 2 / 3; display: flex; align-items: center; justify-content: center; width: auto; height: 48px; padding: 0; color: #fff; background: #2b2b2b; border: 0; border-radius: 12px; cursor: pointer; }
  .fs-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .fs-btn[aria-pressed=true] .fs-on, .fs-btn:not([aria-pressed=true]) .fs-off { display: none; }
  .stream-btn { grid-area: 1 / 3 / 2 / 5; width: auto; }
  .menu-btn { grid-area: 1 / 5 / 2 / 7; width: auto; }
  .fs-btn[hidden] + .stream-btn { grid-area: 1 / 1 / 2 / 4; }
  .fs-btn[hidden] ~ .menu-btn { grid-area: 1 / 4 / 2 / 7; }
  .head-row h1 { grid-column: 1 / -1; margin-top: 4px; font-size: 16px; line-height: 20px; }
  .count { grid-column: 1 / -1; font-size: 16px; line-height: 18px; white-space: normal; }
  .count small { font-size: 14px; }
  .progress { grid-column: 1 / -1; height: 6px; margin: 2px 0 0; }
  /* "Hele gebouw" stays for screen readers; on screen the Totaal tile in the tab grid carries it. */
  .total { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* The foot is capped below the menu row; with many floors the tab grid scrolls (5 px inside for focus rings), so
     "+ Melding" and the menu always stay on screen. */
  .map-foot { grid-area: 3 / 2; display: flex; flex-direction: column; max-height: calc(100dvh - 64px); padding: 8px calc(8px + var(--sr)) calc(8px + var(--sb)) 8px; }
  .foot-row { flex-direction: column; min-height: 0; }
  .tabs { display: grid; flex: 0 1 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 48px; gap: 8px; min-height: 0; margin: -5px; padding: 5px; overflow: hidden auto; }
  .tab { min-width: 0; min-height: 48px; padding: 4px; font-size: 16px; }
  .tab small { margin-top: 2px; font-size: 13px; }
  /* The tile is a size container: with large text "Totaal" shrinks to it instead of running past the border. */
  .tab-sum { container-type: inline-size; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; overflow: hidden; font-size: 14px; font-weight: 800; line-height: 1.1; color: #fff; white-space: nowrap; border: 2px solid #6a6a6a; border-radius: 12px; }
  .tab-sum span { font-size: min(14px, 25cqi); }
  .tab-sum small { margin-top: 2px; font-size: 13px; font-weight: 400; color: #d6d6d6; }
  .tab-sum:nth-child(odd) { grid-column: 1 / -1; }
  /* With large text the "+" wraps above the word, so the label never runs out of the button. */
  .melding { flex-wrap: wrap; justify-content: center; gap: 0 8px; width: 100%; min-width: 0; min-height: 56px; padding: 4px 8px; line-height: 1.1; }
  /* Toast and placing hint: a compact box in the plan's bottom-right corner, beside the rail. */
  .toast-region, .hint-bar { left: auto; right: calc(100% + 8px); bottom: calc(8px + var(--sb)); width: max-content; margin: 0; }
  .toast-region { max-width: min(360px, 60vw); }
  .hint-bar { max-width: min(420px, 60vw); border-radius: 12px; box-shadow: 0 2px 12px rgb(0 0 0 / .3); }
  /* Sheets: wider and lower, so the zone and melding sheets fit without scrolling; pill and last change share a row,
     actions sit side by side, the four melding types in one row. */
  dialog.sheet { grid-template-columns: auto 1fr; max-width: min(720px, calc(100% - 2 * max(var(--sl), var(--sr)))); max-height: calc(100dvh - 8px); padding: 4px 16px calc(8px + var(--sb)); gap: 8px 12px; }
  .sheet > * { grid-column: 1 / -1; }
  .sheet > .pill { grid-column: 1; align-self: center; }
  .sheet > .pill + .meta { grid-column: 2; align-self: center; }
  .sheet h2 { margin-top: 10px; font-size: 20px; }
  .sheet .actions { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .sheet .not-sent { grid-template-columns: 1fr auto; align-items: center; }
  .types { grid-template-columns: repeat(4, 1fr); }
  .type { gap: 4px; min-height: 72px; padding: 8px 4px; }
  .type .ico { width: 32px; height: 32px; }
  /* The message field one row high (the rows attribute cannot be set from CSS: this is its height), so the newest
     item shows when the stream opens on a 280 px screen. */
  .composer textarea { height: 52px; }
}
/* A very short landscape screen (a phone browser tab): the floor count line and bar go (the pressed tab shows the
   floor's count; the line stays for screen readers) and "+ Melding" drops to 48 px, so the rail fits 280 px. */
@media (orientation: landscape) and (max-height: 319px) {
  .count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .progress { display: none; }
  .melding { min-height: 48px; }
}
