/* Arteveldehogeschool look: white and black, square corners, Source Sans / Source Serif,
   logo colours orange #EF7D00, green #5AB031, blue #009AD4 as accents */
:root {
  --ahs-orange: #ef7d00;
  --ahs-green: #5ab031;
  --ahs-blue: #009ad4;

  --bg: #ffffff;
  --panel: #ffffff;
  --surface: #f7f7f7;
  --text: #232429;
  --muted: #5f6066;
  --line: #dedfe4;
  --line-strong: #adaeb3;
  --ink: #000000;
  --ink-text: #ffffff;
  --accent: #008fc6;
  --accent-text: #00729e;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3fa;
  --dest: var(--ahs-orange);
  --dest-soft: rgba(239, 125, 0, .26);
  --start: #4a9e24;
  --error-soft: #fce9e9;
  --map-bg: #eeeff2;
  --plan-room: #ffffff;
  --plan-corridor: #f3f4f9;
  --plan-outdoor: #e7f2e0;
  --plan-street: #e4e5e8;
  --plan-road: #d3d5db;
  --gps: #2a6ef0;
  --gps-ink: #ffffff;
  --plan-service: #f0f0f3;
  --plan-blocked: #d9dadf;
  --plan-wall: #232429;
  --plan-thin: #828388;
  --plan-faint: #c1c2c7;
  --plan-glass: #66b9dd;
  --wall-3d: #c4c5cb;
  --label: #232429;
  --halo: rgba(255, 255, 255, .92);
  --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .08);
  --serif: "Source Serif 4", "Source Serif Pro", Garamond, Georgia, serif;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417; --panel: #18191d; --surface: #222328; --text: #ececee; --muted: #a4a5ab;
    --line: #313238; --line-strong: #55565b; --ink: #ffffff; --ink-text: #000000;
    --accent: #2bb4e8; --accent-text: #5cc6ee; --accent-ink: #001b26; --accent-soft: #10303d;
    --dest: #ff9124; --dest-soft: rgba(255, 145, 36, .26); --start: #6cc43f; --error-soft: #3a1717;
    --map-bg: #0f1013; --plan-room: #1d1e23; --plan-corridor: #17181c; --plan-outdoor: #17221a;
    --plan-street: #121316; --plan-road: #24262c; --gps: #5b9bff; --gps-ink: #001433; --plan-service: #1b1c21; --plan-blocked: #0e0f12; --plan-wall: #d3d4d9;
    --plan-thin: #828388; --plan-faint: #393a3f; --plan-glass: #3f8fb3; --wall-3d: #6d6e75; --label: #dedfe4;
    --halo: rgba(15, 16, 19, .9); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131417; --panel: #18191d; --surface: #222328; --text: #ececee; --muted: #a4a5ab;
  --line: #313238; --line-strong: #55565b; --ink: #ffffff; --ink-text: #000000;
  --accent: #2bb4e8; --accent-text: #5cc6ee; --accent-ink: #001b26; --accent-soft: #10303d;
  --dest: #ff9124; --dest-soft: rgba(255, 145, 36, .26); --start: #6cc43f; --error-soft: #3a1717;
  --map-bg: #0f1013; --plan-room: #1d1e23; --plan-corridor: #17181c; --plan-outdoor: #17221a;
  --plan-street: #121316; --plan-road: #24262c; --gps: #5b9bff; --gps-ink: #001433; --plan-service: #1b1c21; --plan-blocked: #0e0f12; --plan-wall: #d3d4d9;
  --plan-thin: #828388; --plan-faint: #393a3f; --plan-glass: #3f8fb3; --wall-3d: #6d6e75; --label: #dedfe4;
  --halo: rgba(15, 16, 19, .9); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  display: grid;
  grid-template-columns: minmax(330px, 400px) 1fr;
  height: 100vh;
  height: 100dvh;
}

/* ---------- side panel ---------- */
.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 24px 18px calc(24px + var(--safe-l));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: block; height: 40px; width: auto; }
.chip {
  min-width: 44px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); background: transparent; border-radius: 0;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text);
}
.chip:hover { border-color: var(--ink); }

.intro { display: flex; flex-direction: column; gap: 2px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.intro h1 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 32px; line-height: 1.15; letter-spacing: -.01em; }

.search { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field[hidden] { display: none; }
.field label { font-size: 15px; font-weight: 700; color: var(--text); }
.field input, .field select {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 0; background: var(--panel);
  outline: none; transition: border-color .15s, box-shadow .15s;
  font-size: 17px;
}
.field select { font-size: 16px; padding-right: 36px; appearance: none; -webkit-appearance: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23828388' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  text-overflow: ellipsis; }
.field input { font-weight: 600; letter-spacing: .02em; }
.field input::placeholder { font-weight: 400; color: var(--muted); letter-spacing: 0; }
.field input:focus, .field select:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 48px; }
.input-go {
  position: absolute; right: 0; top: 0; bottom: 0; width: 50px; display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer; color: var(--text);
}
.input-go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.input-go:hover { color: var(--accent-text); }

.from-row { display: flex; gap: 8px; }
.from-row select { flex: 1; min-width: 0; }
.icon-btn {
  flex: none; height: 52px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--panel); border-radius: 0; cursor: pointer;
  font-size: 15px; font-weight: 600; white-space: nowrap;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn svg .fill { fill: currentColor; stroke: none; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.icon-btn.icon-only { width: 52px; padding: 0; justify-content: center; }
.icon-btn.icon-only svg { width: 24px; height: 24px; }

.quick { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.quick[hidden] { display: none; }
.quick-label { font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 0; cursor: pointer; font-size: 14px; line-height: 1.2;
}
.chips button:hover { border-color: var(--ink); }

.suggest {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 20;
  margin: 0; padding: 0; list-style: none;
  background: var(--panel); border: 1px solid var(--ink); box-shadow: var(--shadow);
  max-height: min(340px, 50vh); overflow-y: auto;
}
.suggest li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px;
  padding: 11px 14px; cursor: pointer; min-height: 44px;
}
.suggest li + li { border-top: 1px solid var(--line); }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface); }
.suggest li[aria-selected="true"] .s-code { text-decoration: underline; text-decoration-color: var(--ahs-orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.suggest .s-code { font-weight: 700; font-variant-numeric: tabular-nums; }
.suggest .s-name { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .s-floor { color: var(--muted); font-size: 13px; }
.suggest .s-empty { display: block; color: var(--muted); cursor: default; }
.suggest .s-empty:hover { background: none; }

.go {
  height: 52px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--ink); color: var(--ink-text); font-weight: 700; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s, opacity .15s;
}
.go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.go:hover svg { transform: translateX(3px); }
.go:disabled { opacity: .55; cursor: progress; }

.message {
  margin: 0; padding: 12px 16px; background: var(--surface); color: var(--text); font-size: 15px;
  border-left: 4px solid var(--ahs-blue);
}
.message.error { background: var(--error-soft); border-left-color: #dc2323; }

.result { display: flex; flex-direction: column; gap: 14px; }
.result[hidden] { display: none; }
.sheet-head { display: flex; flex-direction: column; }
.sheet-grip, .stepnav, .sheet-foot { display: none; }
.dest { background: var(--surface); padding: 18px 12px 18px 20px; border-left: 4px solid var(--dest); display: flex; align-items: flex-start; gap: 8px; }
.dest-text { flex: 1; min-width: 0; }
.dest-close {
  flex: none; width: 40px; height: 40px; margin: -8px -2px 0 0; display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
}
.dest-close:hover { color: var(--text); }
.dest-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.stepnav { align-items: center; gap: 4px; }
.stepnav button {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); border-radius: 0;
}
.stepnav button:disabled { opacity: .35; cursor: default; }
.stepnav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.stepnav-text { flex: 1; min-width: 0; padding: 0 8px; line-height: 1.3; font-weight: 600; }
.stepnav-text small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.dest-code { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: lining-nums tabular-nums; }
.dest-name { color: var(--text); font-weight: 600; margin-top: 2px; }
.dest-meta { color: var(--muted); font-size: 15px; margin-top: 4px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li {
  display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start;
  padding: 10px 8px; cursor: pointer; position: relative;
}
.steps li:hover { background: var(--surface); }
.steps li.active { background: var(--accent-soft); }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 23px; top: 42px; bottom: -10px; width: 2px; background: var(--line);
}
.step-icon {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--panel); border: 1.5px solid var(--line-strong); position: relative; z-index: 1;
}
.step-icon svg { width: 17px; height: 17px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps li.start .step-icon { background: var(--start); border-color: var(--start); }
.steps li.start .step-icon svg { stroke: #fff; }
.steps li.arrive .step-icon { background: var(--dest); border-color: var(--dest); }
.steps li.arrive .step-icon svg { stroke: #fff; }
.steps li.stairs .step-icon { background: var(--accent); border-color: var(--accent); }
.steps li.stairs .step-icon svg { stroke: var(--accent-ink); }
.step-text { padding-top: 4px; line-height: 1.35; }
.step-text small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

.foot { margin-top: auto; color: var(--muted); font-size: 13px; line-height: 1.5; padding-top: 14px; border-top: 1px solid var(--line); }
.credit { display: block; margin-top: 6px; }
.credit a { color: inherit; font-weight: 600; }

/* ---------- map ---------- */
.map-wrap { position: relative; overflow: hidden; background: var(--map-bg); }
.map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; font-family: var(--sans); }
.map.dragging { cursor: grabbing; }
.map-wrap.picking .map { cursor: crosshair; }
.map-wrap.picking { box-shadow: inset 0 0 0 3px var(--ink); }

.fills path { stroke: none; }
.fill-room, .fill-hall { fill: var(--plan-room); }
.fill-corridor, .fill-stair, .fill-unknown { fill: var(--plan-corridor); }
.fill-outdoor { fill: var(--plan-outdoor); }
.fill-street { fill: var(--plan-street); }
.street-side { fill: var(--plan-street); }
.street-road { fill: none; stroke: var(--plan-road); stroke-width: 64; stroke-linejoin: round; }
.street-name { fill: var(--muted); font-weight: 600; letter-spacing: .08em; pointer-events: none; }
.fill-service { fill: var(--plan-service); }
.fill-blocked { fill: var(--plan-blocked); }
.fills path.target { fill: var(--dest-soft); }

[class^="ln-"] { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.ln-walls { stroke: var(--plan-wall); stroke-width: 1.1px; }
.ln-glass { stroke: var(--plan-glass); stroke-width: .8px; }
.ln-doors { stroke: var(--plan-thin); stroke-width: .8px; }
.ln-arcs { stroke: var(--plan-faint); stroke-width: .7px; }
.ln-stairs { stroke: var(--plan-thin); stroke-width: .6px; }
.ln-furniture { stroke: var(--plan-faint); stroke-width: .5px; }
.ln-surround { stroke: var(--plan-faint); stroke-width: .5px; }
.zoomed-out .ln-furniture, .zoomed-out .ln-arcs { display: none; }

.route-casing { fill: none; stroke: var(--panel); stroke-width: 9px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.route-line { fill: none; stroke: var(--accent); stroke-width: 5px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.route-flow {
  fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 2px; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-dasharray: 2 14; animation: flow 1.1s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -16; } }
@media (prefers-reduced-motion: reduce) { .route-flow, .start-ring { animation: none; } }

.lbl { fill: var(--label); paint-order: stroke; stroke: var(--halo); stroke-linejoin: round; pointer-events: none; }
.lbl .code { font-weight: 700; }
.lbl .name { font-weight: 400; opacity: .75; }
.lbl.dest-lbl { fill: var(--text); }

.marker { cursor: default; }
.marker.stair { cursor: pointer; }
.marker.start { cursor: grab; }
.marker.start.dragging { cursor: grabbing; }
.marker.start .hit { fill: transparent; }
.pin-body { fill: var(--dest); stroke: var(--panel); stroke-width: 2; }
.pin-dot { fill: var(--panel); }
.start-dot { fill: var(--start); stroke: var(--panel); stroke-width: 3; }
.start-ring { fill: none; stroke: var(--start); stroke-width: 2; opacity: .5; animation: pulse 1.8s ease-out infinite; transform-origin: center; transform-box: fill-box; }
.here-tag rect { fill: var(--ink); }
.gps-dot { fill: var(--gps); stroke: var(--panel); stroke-width: 3; }
.gps-beam { fill: var(--gps); opacity: .3; }
.gps-tag path { fill: var(--gps); stroke: var(--panel); stroke-width: 1.5; }
.gps-tag text { fill: var(--gps-ink); font-weight: 700; font-size: 12px; }
.gps-accuracy { fill: var(--gps); fill-opacity: .12; stroke: var(--gps); stroke-opacity: .5; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.here-tag text { fill: var(--ink-text); font-weight: 700; font-size: 12px; }
@keyframes pulse { from { transform: scale(.6); opacity: .7; } to { transform: scale(1.8); opacity: 0; } }
.stair-badge rect { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.stair-badge text { fill: var(--accent-ink); font-weight: 700; font-size: 12px; }

.floor-title {
  position: absolute; left: 16px; top: 16px; padding: 8px 14px;
  background: var(--panel); box-shadow: var(--shadow); font-family: var(--serif); font-weight: 700; font-size: 16px; pointer-events: none;
  border-left: 4px solid var(--ahs-green);
}
.pick-banner {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 120px);
  padding: 8px 8px 8px 16px; background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow);
  font-weight: 600; font-size: 15px;
}
.pick-banner[hidden] { display: none; }
.pick-banner button {
  flex: none; min-height: 36px; padding: 0 12px; border: 1px solid currentColor; background: transparent;
  color: inherit; border-radius: 0; cursor: pointer; font-size: 14px; font-weight: 600;
}
.floors {
  position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column;
  background: var(--panel); box-shadow: var(--shadow);
}
.floors button {
  width: 46px; height: 42px; border: 0; border-radius: 0; background: transparent; cursor: pointer;
  font-weight: 700; font-variant-numeric: tabular-nums; position: relative;
}
.floors button + button { border-top: 1px solid var(--line); }
.floors button:hover { background: var(--surface); }
.floors button[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); }
.floors button.on-route::after {
  content: ""; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px;
  background: var(--dest); box-shadow: 0 0 0 2px var(--panel);
}
.zoom {
  position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column;
  background: var(--panel); box-shadow: var(--shadow);
}
.zoom button {
  width: 46px; height: 44px; border: 0; border-radius: 0; background: transparent; cursor: pointer; font-size: 22px; line-height: 1;
  display: grid; place-items: center;
}
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { background: var(--surface); }
.zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.view3d { position: absolute; inset: 0; }
.view3d[hidden] { display: none; }
.view3d canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.view3d canvas:active { cursor: grabbing; }
.v3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.v3d-floor, .v3d-tag { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.v3d-floor {
  margin: -12px 0 0 -8px; padding: 2px 8px; font-size: 13px; font-weight: 700; color: var(--muted);
  background: var(--panel); border-left: 3px solid var(--line-strong); opacity: .85; translate: -100% 0;
}
.v3d-floor.on { color: var(--text); border-left-color: var(--ahs-green); opacity: 1; }
.v3d-tag { padding: 3px 8px; font-size: 13px; font-weight: 700; translate: -50% -100%; margin-top: -6px; }
.v3d-tag.dest { background: var(--dest); color: #fff; }
.v3d-tag.start { background: var(--ink); color: var(--ink-text); margin-top: -14px; }
.map-wrap.is3d .map, .map-wrap.is3d .floor-title { visibility: hidden; }
.zoom .z3d { font-size: 15px; font-weight: 700; }
.zoom .z3d[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); }
.zoom .z3d.busy { opacity: .5; cursor: progress; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--map-bg); transition: opacity .3s; }
.loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ahs-orange); animation: spin .8s linear infinite; }
.loading.done { opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- small screens: full-screen map, search card on top, directions in a bottom sheet ---------- */
@media (max-width: 760px) {
  html, body { overflow: hidden; overscroll-behavior: none; }
  .app { display: block; height: 100vh; height: 100dvh; }
  .panel { display: contents; }
  .map-wrap { position: fixed; inset: 0; }

  .top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    display: flex; flex-direction: column; gap: 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l));
    background: var(--panel); box-shadow: var(--shadow);
  }
  .brand { gap: 8px; }
  .logo { height: 28px; }
  .chip { min-height: 34px; min-width: 40px; }
  .intro, .go, .foot { display: none; }
  .search { gap: 8px; }  .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .field input { height: 48px; }
  .field select, .icon-btn { height: 44px; }
  .quick { margin: 0; flex-direction: row; align-items: center; }
  .quick-label { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-12px - var(--safe-r)); padding-right: 12px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex: none; min-height: 34px; padding: 4px 11px; }
  .has-route .quick { display: none; }

  /* bottom sheet: the peek shows the destination and the current step; drag up for all steps */
  .result {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; gap: 0;
    max-height: calc(100dvh - var(--top-h, 200px) - 16px);
    background: var(--panel); box-shadow: 0 -2px 18px rgba(0, 0, 0, .18);
    transform: translateY(var(--sheet-off, 0px));
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    padding-bottom: var(--safe-b);
  }
  .result.dragging { transition: none; }
  .sheet-head { touch-action: none; padding: 0 calc(12px + var(--safe-r)) 12px calc(12px + var(--safe-l)); gap: 10px; }
  .sheet-grip { display: grid; place-items: center; height: 22px; cursor: grab; }
  .sheet-grip span { width: 40px; height: 4px; background: var(--line-strong); }
  .dest { padding: 10px 6px 10px 14px; }
  .dest-code { display: inline; font-size: 22px; }
  .dest-name { display: inline; margin-left: 6px; }
  .dest-meta { font-size: 14px; margin-top: 2px; }
  .stepnav { display: flex; }
  .sheet-body {
    overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto;
    padding: 0 calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l)); border-top: 1px solid var(--line);
  }
  .steps { padding-top: 6px; }
  .sheet-foot { display: block; margin: 8px 0 12px; color: var(--muted); font-size: 13px; }

  .message {
    position: fixed; z-index: 26; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r));
    bottom: calc(var(--sheet-vis, 0px) + 12px + var(--safe-b)); box-shadow: var(--shadow); background: var(--panel);
  }
  .floor-title { left: 10px; top: calc(var(--top-h, 200px) + 10px); font-size: 15px; padding: 6px 11px; }
  .floors { right: 10px; top: calc(var(--top-h, 200px) + 10px); }
  .floors button { height: 38px; }
  .zoom { right: 10px; bottom: calc(var(--sheet-vis, 0px) + 10px + var(--safe-b)); }
  .pick-banner { left: 10px; right: 66px; bottom: calc(var(--sheet-vis, 0px) + 10px + var(--safe-b)); transform: none; max-width: none; font-size: 14px; }
  .map-wrap.picking { box-shadow: none; }
  .map-wrap.picking::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--ink); pointer-events: none; }
}
/* touch screens zoom with two fingers: keep only the 3D and fit buttons */
@media (hover: none) and (pointer: coarse) {
  #zin, #zout { display: none; }
}
/* phones in landscape: side-by-side, but trim what doesn't fit the height */
@media (max-height: 520px) and (min-width: 761px) {
  .panel { gap: 14px; padding-top: 12px; }
  .intro, .quick { display: none; }
  .logo { height: 32px; }
  .field input, .field select, .icon-btn, .go { height: 46px; }
  .floor-title { left: 10px; top: 10px; font-size: 15px; padding: 6px 11px; }
  .floors { right: 10px; top: 10px; }
  .floors button { height: 36px; }
  .zoom { right: 10px; bottom: 10px; }
  .zoom button:not(#zfit) { display: none; } /* pinch to zoom */
}
@media (max-width: 360px) {
  .icon-btn span { display: none; }
  .icon-btn { width: 52px; justify-content: center; padding: 0; }
}
