/* Layout: the estate map fills the screen; a search bar floats on top and a bottom sheet (a side panel on wide
   screens) carries search, the route and the steps. During a walk a turn-by-turn card takes over the top. */
:root {
  --paper: #F0EBE3;          /* brand cream: sheets, cards */
  --paper-2: #F7F4EE;        /* raised rows */
  --ink: #2F2F2C;            /* text */
  --ink-2: #5E5B53;          /* secondary text */
  --line: #D8D1C2;           /* hairlines */
  --blue: #436092;           /* brand blue: primary actions, route */
  --blue-ink: #FFFFFF;       /* text on blue */
  --blue-deep: #2F4770;      /* pressed / navigation card lower band */
  --gold: #A37407;           /* brand gold: destination, "you are here" ring */
  --gold-ink: #7E5A05;       /* gold for small text (4.5:1 on cream) */
  --gold-soft: #F3E6C4;
  --charcoal: #4A4A47;
  --sage: #DDE0CA;
  --warn: #9A4A12;           /* cautions (text) */
  --warn-bg: #F6E3D3;
  --ok: #3F6B3A;
  --ok-bg: #DDE8D6;
  --focus: #1F5FD6;
  --shadow: 0 6px 24px rgba(30, 32, 40, .18), 0 1px 3px rgba(30, 32, 40, .12);
  /* map */
  --m-outside: #EFEDE6; --m-outwoods: #E2E3D5; --m-lawn: #E3E6CF; --m-woods: #C6CDAB; --m-woods-line: #ADB78E;
  --m-drive: #FFFFFF; --m-drive-edge: #CFC8B7; --m-pave: #EAE5DB; --m-pave-edge: #CFC8B7; --m-walk: #FFFFFF; --m-walk-edge: #D7CFBD;
  --m-steps: #A37407; --m-pool: #8DB3D0; --m-tennis: #A9BC92; --m-court: #C7A68C; --m-brook: #A8BDD3; --m-terrace: #DCD8CF;
  --m-stay: #436092; --m-event: #4A4A47; --m-event2: #5B5A55; --m-play: #66784F; --m-lobby: #A37407; --m-minor: #CBC6B9; --m-minor2: #DDD8CC;
  --m-bstroke: #FFFFFF; --m-open: #E9EDF4; --m-open-line: #9DB0D2; --m-label: #3B3B37; --m-label-halo: rgba(255,255,255,.92);
  --m-route: #2E5BB8; --m-route-case: #FFFFFF; --m-route-dim: #8EA6D6; --m-boundary: #BDB7A2;
  --font-display: "THE Serif", "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-ui: "THE Sans", "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs: 1;                   /* text-size multiplier (Settings) */
  --radius: 14px;
  --sheet-w: 404px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1D222B; --paper-2: #252B36; --ink: #ECE7DD; --ink-2: #B5AE9F; --line: #3A4251;
    --blue: #7F9DD6; --blue-ink: #10151E; --blue-deep: #2A3B5C; --gold: #D9A53A; --gold-ink: #E2B652; --gold-soft: #3D3320;
    --charcoal: #C9C5BB; --sage: #3A4033; --warn: #F0B07A; --warn-bg: #3E2A1C; --ok: #A9D39C; --ok-bg: #22321F; --focus: #8DB4FF;
    --shadow: 0 6px 24px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
    --m-outside: #1E211D; --m-outwoods: #232821; --m-lawn: #283024; --m-woods: #33402C; --m-woods-line: #3E4C35;
    --m-drive: #4B4E54; --m-drive-edge: #2D3035; --m-pave: #3A3C40; --m-pave-edge: #2B2D31; --m-walk: #5A5C61; --m-walk-edge: #34363A;
    --m-steps: #D9A53A; --m-pool: #3E6C8F; --m-tennis: #45583A; --m-court: #6B5240; --m-brook: #4D6B8A; --m-terrace: #44464B;
    --m-stay: #46638F; --m-event: #5E5D58; --m-event2: #6B6A64; --m-play: #5A6E45; --m-lobby: #B58421; --m-minor: #4A4843; --m-minor2: #55524C;
    --m-bstroke: #1E211D; --m-open: #2C3442; --m-open-line: #5F769E; --m-label: #E8E4DA; --m-label-halo: rgba(20,22,26,.9);
    --m-route: #8FB0F0; --m-route-case: #10141B; --m-route-dim: #4F6491; --m-boundary: #4E5246;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1D222B; --paper-2: #252B36; --ink: #ECE7DD; --ink-2: #B5AE9F; --line: #3A4251;
  --blue: #7F9DD6; --blue-ink: #10151E; --blue-deep: #2A3B5C; --gold: #D9A53A; --gold-ink: #E2B652; --gold-soft: #3D3320;
  --charcoal: #C9C5BB; --sage: #3A4033; --warn: #F0B07A; --warn-bg: #3E2A1C; --ok: #A9D39C; --ok-bg: #22321F; --focus: #8DB4FF;
  --shadow: 0 6px 24px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
  --m-outside: #1E211D; --m-outwoods: #232821; --m-lawn: #283024; --m-woods: #33402C; --m-woods-line: #3E4C35;
  --m-drive: #4B4E54; --m-drive-edge: #2D3035; --m-pave: #3A3C40; --m-pave-edge: #2B2D31; --m-walk: #5A5C61; --m-walk-edge: #34363A;
  --m-steps: #D9A53A; --m-pool: #3E6C8F; --m-tennis: #45583A; --m-court: #6B5240; --m-brook: #4D6B8A; --m-terrace: #44464B;
  --m-stay: #46638F; --m-event: #5E5D58; --m-event2: #6B6A64; --m-play: #5A6E45; --m-lobby: #B58421; --m-minor: #4A4843; --m-minor2: #55524C;
  --m-bstroke: #1E211D; --m-open: #2C3442; --m-open-line: #5F769E; --m-label: #E8E4DA; --m-label-halo: rgba(20,22,26,.9);
  --m-route: #8FB0F0; --m-route-case: #10141B; --m-route-dim: #4F6491; --m-boundary: #4E5246;
  color-scheme: dark;
}
/* high-contrast option (Settings) */
:root.hc { --ink: #000; --ink-2: #222; --line: #555; --paper: #FFFFFF; --paper-2: #F2F2F2; --blue: #1D3F7A; --gold-ink: #5C4103; --m-route: #0B2E8A; --m-route-case: #FFFF00; --warn: #7A2E00; }
@media (prefers-color-scheme: dark) { :root.hc:not([data-theme="light"]) { --ink: #FFF; --ink-2: #EEE; --paper: #000; --paper-2: #111; --line: #AAA; --blue: #A9C3FF; --m-route: #FFE14D; --m-route-case: #000; --warn: #FFB27A; } }
:root.hc[data-theme="dark"] { --ink: #FFF; --ink-2: #EEE; --paper: #000; --paper-2: #111; --line: #AAA; --blue: #A9C3FF; --m-route: #FFE14D; --m-route-case: #000; --warn: #FFB27A; }

@font-face { font-family: "THE Sans"; src: url(fonts/albert-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "THE Sans"; src: url(fonts/albert-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "THE Sans"; src: url(fonts/albert-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "THE Sans"; src: url(fonts/albert-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "THE Serif"; src: url(fonts/dmserif-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--m-outside); color: var(--ink);
  font-family: var(--font-ui); font-size: calc(16px * var(--fs)); line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow: hidden; overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill { fill: currentColor; stroke: none; }

#app { position: fixed; inset: 0; }

/* ------------------------------------------------------------------ map */
#map { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--m-outside); }
#map svg { width: 100%; height: 100%; display: block; }
#map text { font-family: var(--font-ui); pointer-events: none; }
.m-blabel { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; fill: var(--m-label); paint-order: stroke; stroke: var(--m-label-halo); stroke-width: 3.5px; stroke-linejoin: round; }
.m-vlabel { font-weight: 600; font-style: italic; fill: var(--m-label); paint-order: stroke; stroke: var(--m-label-halo); stroke-width: 3px; stroke-linejoin: round; opacity: .9; }
.m-mlabel { font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--m-label-halo); stroke-width: 4px; stroke-linejoin: round; }
.m-building { cursor: pointer; }
.zoom-ctl { position: absolute; right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.map-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.map-btn[aria-pressed="true"] { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.north { position: absolute; left: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow); font-size: 11px; font-weight: 700; color: var(--ink-2); }
.scale-note { position: absolute; left: 56px; z-index: 3; font-size: calc(12px * var(--fs)); color: var(--ink-2); background: color-mix(in srgb, var(--paper) 88%, transparent); padding: 3px 8px; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
.scale-note i { display: inline-block; height: 6px; border: 2px solid var(--ink-2); border-top: 0; }

/* ------------------------------------------------------------------ top search bar */
.topbar { position: absolute; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; gap: 8px; align-items: stretch; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 6px 0 8px; min-height: 52px; }
.brand-btn { border: 0; background: none; padding: 4px; display: grid; place-items: center; border-radius: 10px; }
.brand-btn img { height: 34px; width: auto; display: block; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: calc(17px * var(--fs)); padding: 12px 2px; outline: none; }
.search input::placeholder { color: var(--ink-2); }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.icon-btn { border: 0; background: transparent; min-width: 44px; min-height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }

/* ------------------------------------------------------------------ sheet */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--paper); color: var(--ink);
  border-radius: 18px 18px 0 0; box-shadow: 0 -4px 24px rgba(20, 22, 30, .18); display: flex; flex-direction: column;
  height: calc(100% - 74px - env(safe-area-inset-top, 0px)); transform: translateY(calc(100% - var(--peek, 190px))); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  padding-bottom: env(safe-area-inset-bottom, 0px); will-change: transform; }
.sheet[data-state="half"] { transform: translateY(46%); }
.sheet[data-state="full"] { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grab { flex: none; display: grid; place-items: center; height: 36px; margin-bottom: -6px; border: 0; background: transparent; width: 100%; touch-action: none; cursor: grab; }
.grab::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 24px; -webkit-overflow-scrolling: touch; }
.view[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }

/* wide screens: sheet becomes a left panel */
@media (min-width: 900px) {
  .sheet { left: 12px; right: auto; top: calc(74px + env(safe-area-inset-top, 0px)); bottom: 12px; width: var(--sheet-w); height: auto; border-radius: 18px; transform: none !important; }
  .grab { display: none; }
  .sheet-body { padding-top: 14px; }
  .topbar { right: auto; width: var(--sheet-w); }
  #nav { left: calc(var(--sheet-w) + 24px) !important; right: 12px !important; max-width: 560px; }
}

/* ------------------------------------------------------------------ type */
.eyebrow { font-size: calc(12px * var(--fs)); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); margin: 0; }
.eyebrow.warn-text { color: var(--warn); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.h-display { font-family: var(--font-display); font-weight: 400; font-size: calc(27px * var(--fs)); line-height: 1.12; color: var(--blue); }
:root[data-theme="dark"] .h-display { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .h-display { color: var(--ink); } }
.h-sec { font-family: var(--font-display); font-weight: 400; font-size: calc(20px * var(--fs)); color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: calc(14px * var(--fs)); }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ home */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.from-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); min-height: 52px; text-align: left; width: 100%; }
.from-row .lbl { font-size: calc(12px * var(--fs)); color: var(--ink-2); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.from-row .val { font-weight: 600; }
.from-row .pin-here { color: var(--gold); flex: none; }
.dot-here { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 25%, transparent); flex: none; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper-2); text-align: left; min-height: 72px; font-weight: 600; font-size: calc(14px * var(--fs)); line-height: 1.2; }
.quick button .ico { color: var(--blue); }
.cats { display: flex; flex-direction: column; gap: 4px; }
.cat > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 700; min-height: 48px; }
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary .ico { transition: transform .2s; color: var(--ink-2); }
.cat[open] > summary .ico { transform: rotate(180deg); }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 4px; min-height: 56px; }
.item:hover { background: color-mix(in srgb, var(--blue) 6%, transparent); }
.item .t { font-weight: 600; }
.item .s { font-size: calc(14px * var(--fs)); color: var(--ink-2); }
.item .grow { flex: 1; min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--fs)); font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.sf { background: var(--ok-bg); color: var(--ok); }
.badge.nosf { background: var(--warn-bg); color: var(--warn); }
.badge.ada { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.mode { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.mode button { border: 0; background: transparent; padding: 8px 4px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: calc(13px * var(--fs)); font-weight: 600; color: var(--ink-2); }
.mode button + button { border-left: 1px solid var(--line); }
.mode button[aria-pressed="true"] { background: var(--blue); color: var(--blue-ink); }
.note { font-size: calc(14px * var(--fs)); color: var(--ink-2); }
.callbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }
.callbar a { color: var(--blue); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.here-banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.here-banner .ico { color: var(--gold); }

/* ------------------------------------------------------------------ route preview */
.dest-head { display: flex; gap: 10px; align-items: flex-start; }
.dest-head .grow { flex: 1; min-width: 0; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.summary .big { font-size: calc(26px * var(--fs)); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.summary .bits { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: calc(13px * var(--fs)); font-weight: 600; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink); }
.chip .ico { width: 18px; height: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--warn-bg); color: var(--ink); }
.alert .ico { color: var(--warn); margin-top: 1px; }
.alert b { color: var(--warn); }
.alert a { color: var(--blue); font-weight: 700; }
.warns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.warns li { display: flex; gap: 8px; align-items: flex-start; font-size: calc(14px * var(--fs)); color: var(--ink); }
.warns li .ico { width: 18px; height: 18px; color: var(--warn); margin-top: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper-2); font-weight: 700; color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); font-size: calc(18px * var(--fs)); }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.step .si { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.step.k-steps .si, .step.k-stairs .si { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.step.k-arrive .si { background: var(--gold); color: #fff; }
.step .st { font-weight: 600; }
.step .ss { font-size: calc(14px * var(--fs)); color: var(--ink-2); }
.step .caution { color: var(--warn); display: flex; gap: 6px; align-items: flex-start; }
.step .caution .ico { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.step .sd { font-size: calc(13px * var(--fs)); color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 2px; }
.step.current { background: color-mix(in srgb, var(--blue) 9%, transparent); border-radius: 10px; }
.step .staff { margin-top: 6px; font-size: 12px; color: var(--ink-2); background: var(--paper-2); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 8px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ navigation */
#nav { position: absolute; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 7; }
.nav-card { background: var(--blue); color: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
:root[data-theme="dark"] .nav-card { background: #2B4675; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav-card { background: #2B4675; } }
:root.hc .nav-card { background: #000; }
.nav-main { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 14px 14px 12px; align-items: center; }
.nav-ico { width: 56px; height: 56px; display: grid; place-items: center; position: relative; }
.nav-ico .ico { width: 48px; height: 48px; stroke-width: 2.3; }
.nav-dist { font-size: calc(15px * var(--fs)); font-weight: 600; opacity: .9; font-variant-numeric: tabular-nums; }
.nav-text { font-size: calc(22px * var(--fs)); font-weight: 700; line-height: 1.22; text-wrap: balance; }
.nav-sub { font-size: calc(14px * var(--fs)); opacity: .92; margin-top: 4px; }
.nav-then { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(0,0,0,.18); font-size: calc(14px * var(--fs)); }
.nav-then .ico { width: 18px; height: 18px; }
.nav-status { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: calc(13px * var(--fs)); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.arrow-wrap { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; transition: transform .2s; }
.nav-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; box-shadow: 0 -4px 20px rgba(20,22,30,.12); }
.nav-bar button { min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: calc(12px * var(--fs)); font-weight: 700; }
.nav-bar button.primary { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.nav-bar button[disabled] { opacity: .4; }
@media (min-width: 900px) { .nav-bar { left: calc(var(--sheet-w) + 24px); right: 12px; bottom: 12px; border-radius: 16px; border: 1px solid var(--line); max-width: 560px; } }

/* ------------------------------------------------------------------ dialogs */
dialog { border: 0; padding: 0; border-radius: 18px; background: var(--paper); color: var(--ink); width: min(560px, calc(100% - 24px)); max-height: calc(100% - 40px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 18, 24, .45); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 8px 18px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 14px 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.dlg-body > * { flex-shrink: 0; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 48px; flex-wrap: wrap; }
.set label { font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--paper-2); padding: 8px 12px; min-height: 44px; min-width: 44px; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--blue); color: var(--blue-ink); }
.switch { appearance: none; width: 56px; height: 34px; border-radius: 16px; background: var(--line); position: relative; flex: none; border: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch:checked { background: var(--blue); }
.switch:checked::after { transform: translateX(22px); }
.dlg-body.prose { gap: 0; }
.prose p { margin: 0 0 10px; max-width: 62ch; }
.prose h3 { font-family: var(--font-display); font-weight: 400; font-size: calc(18px * var(--fs)); margin: 16px 0 4px; }
.prose .set { margin-top: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: calc(14px * var(--fs)); }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 20; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
.staff-flag { position: absolute; right: 12px; bottom: calc(200px + env(safe-area-inset-bottom, 0px)); z-index: 4; background: #7A2E00; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; letter-spacing: .06em; }
.places-list .item .t { font-weight: 600; }
