/* Atlas Indoor — styles. Layout principles follow the surveyed reference map (floating panel, round map controls);
   all values are re-created here, no copied stylesheet. */
:root {
  --accent: #2266ff;
  --accent-ink: #1b47c9;
  --ink: #343d43;
  --text: #4a4e57;
  --muted: #6c6c6c;
  --tile: #f2f2f2;
  --line: #e7e9ee;
  --ok: #01884c;
  --alert: #cf4148;
  --warn: #b45309;
  --bg-map: #eef1f5;
  --radius-panel: 24px;
  --radius: 8px;
  --shadow-panel: 0 4px 60px 6px rgba(83, 83, 83, 0.16);
  --shadow-fab: 0 2px 12px 1px rgba(160, 160, 170, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font: 14px/1.4 var(--font); color: var(--text); background: var(--bg-map); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #111; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { flex: none; display: block; }

/* boot */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: #fff; z-index: 50; transition: opacity .3s; }
body:not(.loading) .boot { opacity: 0; pointer-events: none; }
.spinner { width: 44px; height: 44px; border: 4px solid #d9e3ff; border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- map ---------------- */
#app { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.map.dragging { cursor: grabbing; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ground { fill: var(--bg-map); }
.apron { fill: #e6eaf0; }
.runway { fill: #d5dbe3; }
.runway-mark { stroke: #fff; stroke-width: 0.6; stroke-dasharray: 6 5; }
.road { stroke: #fff; stroke-width: 7; fill: none; }
.road.thin { stroke-width: 4; }
.walkway { stroke: #cfd8e3; stroke-width: 3; }
.parkade { fill: #e2e6ec; stroke: #c9d2de; stroke-width: 0.6; }
.site-label { font: 600 7px var(--font); fill: #8a94a3; text-anchor: middle; }
.footprint { fill: #e3e8ef; }
.floor { fill: #fbfcfd; }
.floor-edge { fill: none; stroke: #b9c4d2; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.space { stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; transition: fill .2s, opacity .2s; }
.poi-space { cursor: pointer; }
.poi-space.hl { filter: saturate(1.8) brightness(.96); }
.poi-space.sel { stroke: var(--accent); stroke-width: 2; }
.route-casing { fill: none; stroke: #fff; stroke-width: 9; stroke-linejoin: round; stroke-linecap: round; }
.route-line { fill: none; stroke: var(--accent-ink); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.route-line.faded { stroke: #8fa8e8; }
.route-flow { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 1.6; stroke-dasharray: 2 10; stroke-linecap: round; animation: flow 1s linear infinite; }
.route-active { fill: none; stroke: var(--accent-ink); stroke-width: 6.5; stroke-linejoin: round; stroke-linecap: round; }
@keyframes flow { to { stroke-dashoffset: -12; } }
@media (prefers-reduced-motion: reduce) { .route-flow { animation: none; } }

/* markers */
.markers { position: absolute; inset: 0; pointer-events: none; }
.mk { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; padding: 0; background: none; will-change: transform; }
.mk[hidden] { display: none; }
.mk-poi { display: flex; align-items: center; gap: 4px; margin: -13px 0 0 -13px; }
.mk-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.18); transition: transform .15s; }
.mk-lbl { font-size: 12px; font-weight: 600; color: var(--c); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; }
.mk.no-label .mk-lbl { visibility: hidden; }
.mk-poi:hover .mk-dot, .mk-poi:focus-visible .mk-dot { transform: scale(1.12); }
.mk.dim { opacity: .32; }
.mk.sel { z-index: 3; }
.mk.sel .mk-dot { width: 40px; height: 40px; margin: -7px; box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(0,0,0,.28); }
.mk.sel .mk-dot svg { width: 22px; height: 22px; }
.mk.sel .mk-lbl { font-size: 14px; margin-left: 15px; color: var(--ink); }
.mk.hl .mk-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 5px color-mix(in srgb, var(--c) 30%, transparent); }
.mk-gate { margin: -11px 0 0 -20px; }
.mk-pill { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px 0 5px; border-radius: 6px; background: #f6c644;
  color: #2b2b2b; font-size: 11.5px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.2); white-space: nowrap; }
.map[data-tier="0"] .mk-pill svg { display: none; }
.map[data-tier="0"] .mk-pill { height: 18px; font-size: 10px; padding: 0 5px; }
.mk-gate.sel .mk-pill { height: 30px; font-size: 14px; padding: 0 10px 0 8px; box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(0,0,0,.3); }
.mk-conn { margin: -9px 0 0 -9px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #5b6675;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); pointer-events: none; }
.mk-num { display: none; }
.mk.numbered .mk-num { display: grid; place-items: center; position: absolute; left: -10px; top: -12px; width: 18px; height: 18px; border-radius: 50%;
  background: #111; color: #fff; font-size: 11px; font-weight: 700; }
.mk-route.start { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 4px solid var(--accent-ink); }
.mk-route.pill { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 6px; margin: -14px 0 0 -20px; border-radius: 14px;
  background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.22); white-space: nowrap; }
.mk-route.pill.conn svg { color: var(--accent); }
.mk-route.pill.small { padding: 0 6px; margin-left: -14px; }
.mk-route.pill.sec svg { color: var(--alert); }

/* keyboard map mode */
.map-focus { position: absolute; inset: 0; pointer-events: none; }
.detect-square { position: absolute; left: 0; top: 0; width: 220px; height: 220px; border: 3px solid var(--accent); border-radius: 6px; display: none; pointer-events: none; }
.map.kb .detect-square { display: block; }
.kb-card { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: #fff; border-radius: 16px; box-shadow: var(--shadow-panel);
  padding: 12px 16px; min-width: 300px; max-width: 520px; z-index: 6; }
.kb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; font-size: 13px; }
.kb-grid b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #111; color: #fff; font-size: 11px; }
.kb-card p { margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* level toast */
.level-toast { position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 12px); opacity: 0; transition: .25s; pointer-events: none;
  background: #3a3f47; color: #fff; padding: 7px 14px; border-radius: 8px; font-size: 13px; display: flex; gap: 10px; align-items: center; z-index: 4; }
.level-toast.show { opacity: 1; transform: translate(-50%, 0); }
.level-toast .sep { width: 1px; height: 14px; background: rgba(255,255,255,.4); }

/* ---------------- map controls ---------------- */
.round { display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: none; flex: none; }
.fab { width: 48px; height: 48px; background: #fff; color: #111; border: 0; box-shadow: var(--shadow-fab); display: grid; place-items: center; }
.round.fab { border-radius: 50%; }
.ctrl-top { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 5; }
.building span { color: #d12f2f; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.floors { display: flex; flex-direction: column; gap: 4px; padding: 4px; background: #fff; border-radius: 26px; box-shadow: var(--shadow-fab); }
.floor { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #f1f2f5; color: #111; font-weight: 600; font-size: 13px; transition: background .15s; }
.floor.on { background: var(--accent); color: #fff; }
.ctrl-bottom { position: fixed; right: 20px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 5; }
.zoom { display: flex; flex-direction: column; box-shadow: var(--shadow-fab); border-radius: 24px; overflow: hidden; }
.zoom .fab { box-shadow: none; border-radius: 0; }
.zoom .fab + .fab { border-top: 1px solid var(--line); }
.brand { position: fixed; left: 20px; bottom: 16px; font-size: 15px; color: #4b5563; z-index: 1; letter-spacing: .01em; }
.brand b { color: var(--accent); }

/* explore panel */
.explore { position: fixed; top: 20px; right: 84px; width: 300px; max-height: calc(100% - 40px); overflow: auto; background: #fff;
  border-radius: 20px; box-shadow: var(--shadow-panel); padding: 16px; z-index: 6; }
.bld-badge { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #f6f7f9; color: #d12f2f; font-weight: 800; font-size: 13px; flex: none; }
.row.bld { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; width: 100%; text-align: left; }

/* toast */
.toast { position: fixed; left: 50%; top: 20px; transform: translate(-50%, -10px); background: #222; color: #fff; padding: 9px 16px; border-radius: 10px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 20; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- panel ---------------- */
.panel { position: fixed; left: 20px; top: 20px; width: 360px; max-height: calc(100% - 40px); background: #fff; border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel); z-index: 5; display: flex; flex-direction: column; }
.panel-body { padding: 20px; overflow: auto; overscroll-behavior: contain; }
.sheet-handle { display: none; }

.search-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.search-box, .search-input { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--tile); color: var(--muted); }
.search-box span { font-weight: 500; font-size: 16px; }
.search-input { padding: 0 6px; color: var(--ink); }
.search-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; font-weight: 500; }
.search-input input::-webkit-search-cancel-button { display: none; }
.search-input.slim { height: 40px; margin: 10px 0 6px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; color: var(--ink); }
.round.outline { width: 44px; height: 44px; border: 2px solid #d8d8d8; background: #fff; color: #111; }
.round.ghost { width: 36px; height: 36px; color: var(--ink); }
.round.grey { background: #e7e7e7; color: #111; }
.round.sm { width: 26px; height: 26px; }

.card { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: var(--radius); background: var(--tile); margin-bottom: 10px; }
.card > span:first-of-type { flex: 1; display: flex; flex-direction: column; }
.card b { font-weight: 600; color: var(--text); font-size: 14px; }
.card small { color: #606060; font-size: 12px; font-weight: 500; }
.card.saved { background: #eaf0ff; color: var(--accent); }
.card.myflight { background: #eaf0ff; color: #14286b; align-items: flex-start; }
.card.myflight > span { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card.myflight.fs-warn { background: #fff4e0; } .card.myflight.fs-alert { background: #fde8e8; }
.card.install { background: #f1f5ff; color: var(--accent); }
.card.car { background: #eef7ee; color: #14532d; align-items: flex-start; }
.card.car > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; } .card.car .btn-row { margin-top: 6px; flex-wrap: wrap; }
.card.flight .als { display: flex; gap: 4px; }
.al { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 9.5px; font-weight: 700; flex: none; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tile { display: flex; gap: 8px; border-radius: var(--radius); color: var(--text); font-weight: 500; font-size: 14px; }
.tile svg { color: var(--muted); }
.tile.big { flex-direction: column; justify-content: space-between; height: 77px; padding: 12px; background: var(--tile); }
.tile.small { align-items: center; height: 43px; padding: 0 13px; background: #fff; border: 1px solid var(--tile); }
.tile:hover { filter: brightness(.97); }
.fine { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; margin: 12px 0 0; }

.head { display: flex; align-items: center; gap: 6px; margin: -6px 0 8px -8px; }
.head-title { flex: 1; font-size: 17px; font-weight: 600; color: var(--ink); margin: 0; }
.grow { flex: 1; }
.sec { font-size: 14px; font-weight: 600; color: #111; margin: 16px 0 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; border: 0; background: none; width: 100%; text-align: left; }
.row:hover, .row:focus-visible { background: #f5f6f8; }
.row.static:hover { background: none; }
.row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-title { font-weight: 600; color: var(--ink); font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-sub { color: var(--muted); font-size: 12px; font-weight: 500; margin: 0; }
.row.sub { padding: 8px; }
.row.sub .row-title { flex: 1; font-weight: 500; }
.row.lang { justify-content: space-between; color: var(--accent); }
.logo { width: var(--s); height: var(--s); border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: calc(var(--s) * .34); flex: none; letter-spacing: .02em; }
.logo.gate { background: #fff4cf; color: #8a6a00; }
.empty { color: var(--muted); padding: 14px 8px; margin: 0; }

.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; letter-spacing: .01em; }
.tag-new { color: #177439; background: #e3f5e9; }
.tag-soon { color: #943e00; background: #fdeedd; }
.tag-closed { color: #c80000; background: #fde5e5; }
.tag-popup { color: #7528c3; background: #f1e6fc; }
.tag-promoted { color: #2148cd; background: #e5ebfd; }
.tag-relocated { color: #4b5563; background: #eceef1; }
.tag-now { color: #fff; background: var(--ok); }

.deal { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.deal b { color: var(--ink); }
.deal p { margin: 0; color: var(--text); }
.deal a { color: var(--accent); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }

/* profile */
.cover { height: 128px; margin: -20px -20px 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); color: rgba(255,255,255,.35); }
.prof-top { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cover + .prof-top { margin-top: -22px; }
.cover + .prof-top .logo { box-shadow: 0 0 0 3px #fff; }
.prof-title { font-size: 20px; font-weight: 600; color: var(--ink); margin: 8px 0 2px; line-height: 1.25; }
.prof-sub { margin: 0 0 12px; font-size: 14px; font-weight: 500; color: var(--text); }
.open.ok { color: var(--ok); font-weight: 600; }
.open.no { color: var(--alert); font-weight: 600; }
.open-next { color: var(--muted); }
.btn-row { display: flex; gap: 10px; margin: 4px 0 12px; }
.btn { height: 44px; border-radius: var(--radius); border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; padding: 0 16px; }
.btn.primary { background: var(--accent); color: #fff; flex: 1; }
.btn.secondary { background: var(--tile); color: var(--accent); flex: 1; }
.btn.sm { height: 36px; flex: none; }
.btn.wide { width: 100%; }
.btn.outline { background: #fff; border: 1px solid var(--line); color: var(--ink); margin: 8px 0; }
.btn.disabled { opacity: .35; pointer-events: none; }
.box { background: #f7f8fa; border-radius: 12px; padding: 10px 12px; margin: 6px 0 12px; }
.box-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.flight-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 8px; }
.flight-row + .flight-row { border-top: 1px solid var(--line); }
.fl-main { flex: 1; display: flex; flex-direction: column; }
.fl-main b { font-size: 15px; color: var(--text); }
.fl-main small, .fl-side small { font-size: 12px; color: var(--text); font-weight: 500; }
.fl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.fs { font-size: 11px; font-weight: 700; color: #fff; padding: 1px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .02em; }
.fs-ok { background: var(--ok); }
.fs-alert { background: var(--alert); }
.fs-warn { background: var(--warn); }
.fs-muted { background: #8b93a1; }
.sect { margin: 6px 0 10px; }
.hours-toggle { display: flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; }
.hours-full { margin: 6px 0 0; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line); color: var(--text); }
.desc { margin: 8px 0; color: var(--text); }
.link { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 0; }
.link.center { display: block; margin: 6px auto; }
.contact { display: flex; gap: 8px; margin: 8px 0; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--tile); border: 0; font-weight: 500; color: var(--ink); }
.group-list { margin-top: 8px; }
.tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tabs [role=tab] { border: 0; background: none; padding: 6px 0; font-size: 14px; color: var(--text); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs [aria-selected=true] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.carousel-wrap { position: relative; }
.carousel { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.mini { flex: none; width: 100px; height: 96px; border-radius: 12px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; scroll-snap-align: start; }
.mini span:last-child { font-size: 12px; font-weight: 600; color: #293035; text-align: center; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px; }
.scroll-btn { position: absolute; right: 0; top: 34px; width: 28px; height: 28px; background: #909090; color: #fff; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 32px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-panel); padding: 6px; z-index: 3; min-width: 170px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-weight: 500; color: var(--text); }
.menu button:hover { background: #f3f4f6; }

/* directions */
.dir-fields { display: flex; align-items: center; gap: 6px; }
.dir-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dir-field { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--radius); background: var(--tile); font-weight: 600; color: var(--ink); }
.dir-field svg { color: var(--muted); }
.dir-field.empty { color: var(--muted); font-weight: 500; }
.dir-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; color: #111; }
.switch { width: 52px; height: 30px; border-radius: 15px; border: 0; background: #d4d7dd; position: relative; transition: background .2s; }
.switch .knob { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: #555; transition: left .2s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true] .knob { left: 25px; color: var(--accent); }
.summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-left: 4px solid var(--accent); padding: 10px 12px; border-radius: 0 10px 10px 0; background: #f7f8fa; }
.mins { font-size: 16px; color: var(--ink); }
.chip-line { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12px; color: var(--text); font-weight: 500; }
.chip-line svg { color: var(--alert); }
.progress { position: relative; height: 6px; background: #e4e7ec; border-radius: 3px; margin: 10px 4px 14px; }
.progress > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; transition: width .3s; }
.progress i { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 2px solid #c3c9d3; }
.progress i.on { border-color: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; gap: 12px; padding: 10px; border-radius: 10px; align-items: flex-start; }
.step b { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.step small { color: var(--muted); font-size: 12px; }
.step-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--tile); color: var(--ink); flex: none; }
.step.active { background: var(--accent); }
.step.active b, .step.active small { color: #fff; }
.step.active .step-ic { background: rgba(255,255,255,.2); color: #fff; }
.step-nav { display: flex; gap: 10px; margin-top: 12px; position: sticky; bottom: -20px; background: #fff; padding: 10px 0; }

/* ---------------- mobile: bottom sheet ---------------- */
@media (max-width: 719px) {
  .panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: none; border-radius: var(--radius-panel) var(--radius-panel) 0 0;
    transition: height .25s ease; }
  .panel[data-sheet="min"] { height: 132px; }
  .panel[data-sheet="mid"] { height: 52%; }
  .panel[data-sheet="max"] { height: calc(100% - 12px); }
  .sheet-handle { display: grid; place-items: center; height: 22px; border: 0; background: none; flex: none; touch-action: none; cursor: ns-resize; }
  .sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: #cfd3da; }
  .panel-body { padding-top: 4px; flex: 1; }
  .ctrl-top { top: 12px; right: 10px; }
  .ctrl-bottom { left: 10px; right: auto; bottom: auto; top: 12px; }
  .fab { width: 44px; height: 44px; }
  .floor { width: 36px; height: 36px; }
  .brand { display: none; }
  .explore { right: 10px; left: 10px; width: auto; top: 12px; }
  .kb-card { display: none; }
  .level-toast { bottom: auto; top: 14px; }
  .cover { height: 96px; }
}

/* ================= V2 additions ================= */
.map .maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-top-right { top: 0; right: 80px; }
.mk-route { pointer-events: auto; }
.mk-route.start { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--accent-ink); }
.mk-route.pill { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 6px; border-radius: 14px; border: 0;
  background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.22); white-space: nowrap; }
.mk-route.pill.conn svg, .mk-route.pill.bld svg { color: var(--accent); }
.mk-route.pill.small { padding: 0 6px; }
.mk-route.pill.sec svg { color: var(--alert); }
.mk-route.pill.way svg { color: #16a34a; }
.here-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(34,102,255,.25); animation: pulse 1.8s infinite; }
.here-wrap { position: relative; width: 18px; height: 18px; }
.here-wrap .here-dot { position: absolute; inset: 0; }
.here-cone { position: absolute; left: 50%; bottom: 50%; width: 46px; height: 40px; transform: translateX(-50%); display: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(34,102,255,.45), rgba(34,102,255,0) 70%); clip-path: polygon(50% 100%, 0 0, 100% 0); }
.here-wrap.has-heading .here-cone { display: block; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(34,102,255,.08); } }
.fab.txt { font-weight: 800; font-size: 13px; color: #111; }
.fab.on { color: var(--accent); }
#compass svg { transition: transform .1s linear; }
body.picking .map { cursor: crosshair; }
body.picking .map::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 4px var(--accent); pointer-events: none; }
.ctrl-bottom { gap: 8px; }
.wide-tile { width: 100%; justify-content: center; margin-bottom: 4px; }
.sep-line { height: 1px; background: var(--line); margin: 6px 0 10px; }
.row.bld.on { border-color: var(--accent); }
.live { color: var(--ok); vertical-align: middle; display: inline-block; }
.rv-card { position: relative; display: block; width: 100%; border: 0; padding: 0; border-radius: 12px; overflow: hidden; margin: 4px 0 12px; background: #eee; }
.rv-card canvas { display: block; width: 100%; height: 150px; }
.rv-badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; gap: 6px; align-items: center; background: #fff; border-radius: 16px; padding: 5px 10px; font-weight: 600; font-size: 12px; color: var(--ink); }
.modal { position: fixed; inset: 0; background: rgba(15,20,30,.45); display: grid; place-items: center; z-index: 40; }
.modal-card { max-height: calc(100dvh - 24px); overflow: auto; }
/* The edit bar lives outside #app: it steps back while a dialog is open so it never covers the dialog's buttons. */
body:has(#modal:not([hidden])) .edit-bar { z-index: 0; opacity: .4; pointer-events: none; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 20px; padding: 18px 20px; width: min(420px, calc(100% - 24px)); box-shadow: var(--shadow-panel); }
.rv-modal { width: min(980px, calc(100% - 24px)); }
.rv-view { width: 100%; height: auto; border-radius: 12px; cursor: grab; touch-action: none; display: block; }
.qr { display: grid; place-items: center; padding: 10px; }
.qr svg { width: 240px; height: 240px; }
.center { text-align: center; justify-content: center; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { background: #eef3ff; }
.radio span { display: flex; flex-direction: column; }
.radio b { color: var(--accent); }
.radio small { color: var(--muted); }
.time-row { display: flex; align-items: center; justify-content: space-between; padding: 10px; font-weight: 600; }
.time-row input { font-size: 16px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.dir-line { display: flex; align-items: center; gap: 4px; }
.dir-line .dir-field { flex: 1; min-width: 0; }
.add-stop { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0 4px; }
.chip-line.blue svg { color: var(--accent); }
.chat { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; background: #f2f4f7; }
.msg p { margin: 0; }
.msg a { display: block; margin-top: 6px; color: var(--accent); font-weight: 600; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; }
.chat-form { display: flex; gap: 8px; margin: 8px 0; }
.chat-form input { flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 19px; padding: 0 14px; }
.btn-chip { background: #fff; cursor: pointer; }
@media (max-width: 719px) {
  .ctrl-bottom { flex-direction: column; }
  .maplibregl-ctrl-top-right { right: 56px; }
}
@media print {
  .ctrl-top, .ctrl-bottom, .brand, .sheet-handle, .step-nav { display: none !important; }
  .panel { position: static; box-shadow: none; width: auto; max-height: none; }
}

/* ---------------- V3: gaps vs reference ---------------- */
.panel { position: fixed; }
.panel-body { position: relative; }
/* Profile: header stays on top while scrolling, with a compact title. */
.prof-top.sticky { position: sticky; top: -20px; z-index: 3; background: #fff; margin-left: -20px; margin-right: -20px; padding: 8px 20px; }
.cover + .prof-top.sticky { background: transparent; }
.mini-title { font-weight: 600; font-size: 15px; color: var(--ink); opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel.scrolled .prof-top.sticky { background: #fff; box-shadow: 0 6px 10px -8px rgba(0,0,0,.25); }
.panel.scrolled .mini-title { opacity: 1; }
.panel.scrolled .prof-top.sticky .logo { --s: 32px !important; box-shadow: none; }
.scroll-more { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: 34px; height: 34px; background: var(--accent); color: #fff;
  border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.25); z-index: 4; display: grid; place-items: center; }
.scroll-more[hidden] { display: none; }
a.link-chip { text-decoration: none; cursor: pointer; }
a.link-chip:hover { border-color: #9aa3ae; background: #f7f8fa; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin: 12px -20px 4px; padding: 0 20px 6px; }
.gallery > * { flex: 0 0 78%; scroll-snap-align: start; margin: 0; }
.gallery .photo { border-radius: 12px; overflow: hidden; background: #eee; }
.gallery canvas { display: block; width: 100%; height: 150px; object-fit: cover; }
/* Flight detail */
.airline-line { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 8px 0 14px; }
.fl-facts { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: 8px; margin-bottom: 16px; }
.fl-facts small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.fl-facts b { font-size: 14px; font-weight: 600; }
.gate-pill { display: inline-flex; align-items: center; gap: 4px; background: #F6C644; color: #2b2b2b; border-radius: 5px; padding: 1px 6px; font-size: 12px; font-weight: 700; }
.btn.wide + .btn.wide { margin-top: 10px; }
/* Progress with event icons */
.progress.ev { margin: 18px 10px 18px; height: 6px; }
.progress.ev i { width: 20px; height: 20px; margin: -10px 0 0 -10px; display: grid; place-items: center; background: #fff; border: 1.5px solid #c3c9d3; color: #4a4e57; }
.progress.ev i.start { width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #9aa3ae; }
.progress.ev i.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress.ev i.cur { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px #dbe6ff; }
.step-origin { display: flex; align-items: center; gap: 12px; padding: 6px 12px 8px; font-size: 15px; }
.step-origin .dot { width: 10px; height: 10px; border-radius: 50%; background: #c3c9d3; margin: 0 6px 0 4px; }
@media print { .scroll-more, .gallery { display: none !important; } }

[hidden] { display: none !important; }
.week { border-collapse: collapse; margin: 6px 0 0; font-size: 13px; width: 100%; }
.week th { text-align: left; font-weight: 500; color: var(--muted); padding: 3px 0; width: 45%; }
.week td { padding: 3px 0; }
.week tr.today th, .week tr.today td { color: var(--ink); font-weight: 700; }
.approx-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.week td:empty::after { content: '—'; color: var(--muted); }

/* ---------------- edit mode ---------------- */
.edit-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #1f2937; color: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 13px; max-width: calc(100% - 24px); }
.edit-bar b { display: inline-flex; align-items: center; gap: 6px; }
.edit-bar button { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 9px; padding: 6px 10px; background: #374151; color: #fff; font: inherit; cursor: pointer; }
.edit-bar button:hover:not([disabled]) { background: #4b5563; }
.edit-bar button[disabled] { opacity: .45; cursor: default; }
.edit-bar button[aria-pressed="true"] { background: var(--accent); }
.edit-count { color: #cbd5e1; }
.edit-status.saved { color: #86efac; } .edit-status.error, .edit-status.local { color: #fca5a5; } .edit-status.pending { color: #fde68a; }
.edit-status.field { color: #93c5fd; }
.edit-count.field-sent { color: #86efac; } .edit-count.field-pending { color: #fdba74; }
.edit-bar .grow { flex: 1; }
@media (min-width: 720px) { body.editing .level-toast { bottom: 24px; } }
@media (max-width: 719px) { body.editing .level-toast { top: calc(64px + env(safe-area-inset-top, 0px)); } }
@media (max-width: 719px) { body.surveying .level-toast { top: calc(196px + env(safe-area-inset-top, 0px)); bottom: auto; } } /* under the survey panel */
/* Desktop: every tool in one bar. Phone: one compact row, the other tools under "More". */
.edit-bar .edit-main, .edit-bar .edit-more { display: contents; }
.edit-bar .edit-more-btn { display: none; }
@media (max-width: 719px) {
  .edit-bar { left: 8px; right: 8px; transform: none; max-width: none; top: calc(8px + env(safe-area-inset-top, 0px)); gap: 6px; padding: 6px 8px; flex-wrap: nowrap; }
  .edit-bar .lbl, .edit-bar .edit-status.idle, .edit-bar .edit-status.saved, .edit-bar .edit-status.field { display: none; }
  .edit-bar .edit-count { white-space: nowrap; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
  .edit-bar .edit-count.field-pending .cnt-n, .edit-bar .edit-count.field-pending .cnt-sep, .edit-bar .edit-count.field-sent .cnt-n, .edit-bar .edit-count.field-sent .cnt-sep { display: none; }
  .edit-bar .edit-main { display: flex; gap: 6px; flex: none; }
  .edit-bar .edit-main button { height: 34px; padding: 0 9px; white-space: nowrap; }
  .edit-bar .edit-more-btn { display: inline-flex; }
  .edit-bar .edit-more-btn[aria-expanded="true"] { background: var(--accent); }
  .edit-bar .edit-more { display: none; }
  .edit-bar.open { flex-wrap: wrap; }
  .edit-bar.open .edit-more { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; padding-top: 6px; border-top: 1px solid #374151; }
  .edit-bar.open .edit-more button { height: 36px; }
  body.editing .ctrl-top { top: calc(env(safe-area-inset-top, 0px) + 58px); }
}
body.adding .maplibregl-canvas { cursor: crosshair !important; }
.edit-form { border: 2px dashed #93b4ff; border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: #f6f9ff; }
.edit-form label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0; }
.edit-form input:not([type=checkbox]), .edit-form select { display: block; width: 100%; margin-top: 3px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; color: var(--ink); background: #fff; }
.edit-form label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
.edit-hint { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #1d4ed8; margin: 0 0 4px; }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.edit-form textarea { display: block; width: 100%; margin-top: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; color: var(--ink); background: #fff; resize: vertical; }
.edit-form fieldset { border: 1px solid #c7d6fb; border-radius: 10px; padding: 6px 10px 8px; margin: 10px 0; }
.edit-form legend { font-size: 12px; font-weight: 600; color: var(--ink); padding: 0 4px; }
.edit-form [hidden] { display: none !important; }
.hours-week { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.edit-form input[aria-invalid="true"] { border-color: #dc2626; background: #fff1f2; }
.edit-error { font-size: 12px; color: #b91c1c; margin: 4px 0 0; }
.edit-tags { margin: 10px 0; } .edit-tags summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.tag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; max-height: 220px; overflow: auto; padding: 4px 0; }
.tag-grid label.check { margin: 3px 0; font-size: 12px; }
body.drawing .maplibregl-canvas { cursor: crosshair !important; }
/* Position QR codes and scanner */
.pos-qr-print { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; }
.pos-qr-print .qr svg { width: 220px; height: 220px; display: block; margin: 0 auto; }
.scan-video { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; }
@media print {
  body.print-qr > main > *:not(#modal), body.print-qr #modal .head, body.print-qr #modal .btn-row, body.print-qr #modal .fine:not(.pos-qr-print .fine) { display: none !important; }
  body.print-qr #modal { position: static; background: none; } body.print-qr .modal-card { box-shadow: none; max-width: none; }
  body.print-qr .pos-qr-print { border: 0; } body.print-qr .pos-qr-print .qr svg { width: 9cm; height: 9cm; }
}
/* Display comfort: dark theme (whole-page inversion keeping hues), high contrast, larger text */
html.theme-dark { filter: invert(0.92) hue-rotate(180deg); background: #fff; }
html.contrast { --ink: #000; --text: #111; --muted: #2b2b2b; --line: #7b8290; --tile: #e9ebef; }
html.contrast .tile, html.contrast .card, html.contrast .btn.secondary, html.contrast .row { outline: 1px solid #7b8290; outline-offset: -1px; }
html.contrast a, html.contrast .link { text-decoration: underline; }
html.contrast :focus-visible { outline: 3px solid #000 !important; outline-offset: 2px; }
html.text-lg .panel-body, html.text-lg .modal-card, html.text-lg .toast, html.text-lg .level-toast { zoom: 1.18; }
.seg { display: flex; gap: 4px; background: var(--tile); border-radius: 10px; padding: 3px; margin: 4px 0 10px; }
.seg button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.seg button[aria-checked="true"] { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); font-weight: 600; }
/* Trains and buses, journey time */
.departures { list-style: none; margin: 4px 0; padding: 0; }
.departures li { display: grid; grid-template-columns: 82px 44px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.departures .line { display: inline-flex; justify-content: center; align-items: center; min-width: 34px; height: 24px; border-radius: 6px; background: #14286b; color: #fff; font-weight: 700; font-size: 13px; }
.departures .line.rail { background: #0e7490; }
.travel-time { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.travel-time input { display: block; width: 120px; height: 36px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; color: var(--ink); }
.stats-list { margin: 4px 0 10px; padding-left: 22px; font-size: 13px; }
.stats-list li { padding: 3px 0; } .stats-list li span { display: inline-block; min-width: 70%; } .stats-list b { float: right; }
/* Broadcast messages */
.broadcast { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.broadcast span { display: flex; flex-direction: column; gap: 2px; } .broadcast small { opacity: .8; font-size: 12px; }
.broadcast.info { background: #e8f0ff; color: #14286b; }
.broadcast.warning { background: #fff4e0; color: #7c2d12; }
.broadcast.alert { background: #b91c1c; color: #fff; font-weight: 600; }
body.kiosk .broadcast { font-size: 18px; }
/* Live closures */
.closures { border-radius: var(--radius); background: #fdecec; color: #7f1d1d; padding: 10px 12px; margin-bottom: 10px; }
.closures p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 6px; font-size: 13px; }
.closures p span { display: flex; flex-direction: column; } .closures small { color: #991b1b; font-size: 12px; }
.closure-note { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #991b1b; background: #fdecec; border-radius: 8px; padding: 6px 8px; }
/* Reports */
.report-link { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.report-form fieldset { border: 0; padding: 0; margin: 8px 0; }
.report-form legend { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.report-form .radio-line { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.report-form label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0; }
.report-form textarea { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; color: var(--ink); resize: vertical; }
.report-list { list-style: none; margin: 6px 0; padding: 0; max-height: 60vh; overflow: auto; }
.report-item { display: grid; grid-template-columns: 24px 1fr; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.report-item .ri-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.report-item .ri-text small { color: var(--muted); }
.report-item .ri-act { grid-column: 2; display: flex; gap: 6px; }
.report-item.resolved, .report-item.rejected { opacity: .6; }
.edit-bar button.has-reports { background: #b45309; }
.edit-bar .bar-select { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #cbd5e1; }
.edit-bar .bar-select select { height: 30px; border-radius: 6px; border: 0; padding: 0 6px; font: inherit; color: #111; }
/* Kiosk (?kiosk=<place>): touch screen in the terminal */
body.kiosk { user-select: none; -webkit-user-select: none; }
body.kiosk .menu-wrap, body.kiosk #fullscreen, body.kiosk .card.install { display: none !important; }
body.kiosk .panel { font-size: 17px; }
body.kiosk .row, body.kiosk .tile, body.kiosk .btn { min-height: 52px; }
body.kiosk .fab { width: 52px; height: 52px; }
.kiosk-head { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--radius); background: #14286b; color: #fff; }
.kiosk-head b { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.kiosk-head span { display: flex; align-items: center; gap: 6px; font-size: 14px; } .kiosk-head small { opacity: .8; }
.kiosk-qr { display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; margin: 12px 0; padding: 12px; border: 2px solid #c7d6fb; border-radius: var(--radius); background: #f6f9ff; }
.kiosk-qr .qr svg { width: 132px; height: 132px; display: block; }
.edit-form .btn-row { flex-wrap: wrap; }
.edit-handle { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: grab; }
.edit-handle:active { cursor: grabbing; }
@media print { .edit-bar { display: none !important; } }

/* Mobile turn-by-turn: the reduced sheet shows only the current step and the arrows. */
@media (max-width: 719px) {
  .panel[data-sheet="min"]:has(.steps) .steps li:not(:has(> .step.active)),
  .panel[data-sheet="min"]:has(.steps) .step-origin,
  .panel[data-sheet="min"]:has(.steps) .head,
  .panel[data-sheet="min"]:has(.steps) .row-sub,
  .panel[data-sheet="min"]:has(.steps) .prof-title,
  .panel[data-sheet="min"]:has(.steps) .progress { display: none; }
  .panel[data-sheet="min"]:has(.steps) { height: 196px; }
  .panel[data-sheet="min"]:has(.steps) .steps { margin: 0; }
  .panel[data-sheet="min"]:has(.steps) .step-nav { margin-top: 6px; }
}
.beta { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: #fde68a; color: #78350f; font-size: 10px; font-weight: 700; letter-spacing: .03em; vertical-align: 1px; }

/* About */
.about-p { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.panel .fine a { color: var(--accent); }

/* Kiosk alert (broadcast message of severity 'alert') */
.kiosk-alert { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #b91c1c; color: #fff; text-align: center; padding: 40px; }
.kiosk-alert p { font-size: 34px; font-weight: 700; line-height: 1.3; max-width: 900px; margin: 20px auto; }
.kiosk-alert small { font-size: 18px; opacity: .85; }

/* Field survey kit (?survey=1) */
.survey-panel { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top, 0px)); width: min(560px, calc(100% - 20px));
  background: #10233f; color: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.3); font-size: 13px; }
.survey-panel .sv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.survey-panel .sv-head b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.survey-panel .sv-state { color: #cbd5e1; } .survey-panel .sv-state.rec { color: #fca5a5; font-weight: 700; }
.survey-panel .sv-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; color: #cbd5e1; }
.survey-panel .sv-stats b { color: #fff; }
.survey-panel .sv-calib { margin: 6px 0; background: #f6c644; color: #1d1a0f; border-radius: 8px; padding: 6px 8px; }
.survey-panel .sv-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.survey-panel button { height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: #33415a; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.survey-panel button.primary { background: #2266ff; }
body:has(#modal:not([hidden])) .survey-panel { display: none; }
@media (min-width: 720px) { body.surveying .level-toast { bottom: 24px; } }
@media (max-width: 719px) {
  /* The survey panel covers the top of the screen: the floor selector moves below it (checking the floor matters). */
  body.surveying .ctrl-top { top: calc(env(safe-area-inset-top, 0px) + 186px); }
  .survey-panel button { height: 32px; padding: 0 10px; }
}

/* Optional field notes and photos */
.edit-form fieldset.edit-notes { border-color: #c7d6fb; }
.edit-notes .note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.edit-notes .note-list:empty { display: none; }
.note-item { display: grid; gap: 4px; border: 1px solid #c7d6fb; border-radius: 10px; padding: 6px 8px; background: #fff; font-size: 13px; }
.note-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.note-thumbs:empty { display: none; }
.note-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f3f4f6; }
.note-form textarea { display: block; width: 100%; margin-top: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; color: var(--ink); resize: vertical; }
.note-form label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0; }
.note-form .note-photo input { display: block; width: 100%; margin-top: 4px; font-size: 13px; }

/* PC: import of field batches (review) and field notes list */
.fi-body { max-height: 60vh; overflow: auto; margin: 8px 0; }
.fi-list, .fn-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.fi-line { border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 13px; }
.fi-line label { display: flex; gap: 8px; align-items: baseline; }
.fi-conflict { background: #fff7e6; padding: 6px 8px; border-radius: 8px; border-bottom: 0; }
.fi-opts { display: grid; gap: 4px; margin: 6px 0 0 24px; }
.fi-opt { display: flex; gap: 6px; align-items: baseline; }
.fi-sub { font-size: 13px; margin: 10px 0 4px; }
.fi-note { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.fn-item { display: grid; gap: 4px; border: 1px solid #c7d6fb; border-radius: 10px; padding: 8px; background: #fff; font-size: 13px; }
.fn-act { display: flex; gap: 6px; }
.fn-done { margin-top: 10px; }
.fn-done summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
