body.is-walking {
  overflow: hidden;
}
#stair-arrival {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(340px, calc(100% - 32px));
  max-height: 60dvh;
  overflow: auto;
  padding: 26px 22px;
  border-radius: 20px;
  background: #fffffff5;
  border: 1px solid #d4e2dc;
  box-shadow: 0 12px 40px #17352f40;
  text-align: center;
  pointer-events: auto;
  z-index: 2;
}
#stair-title { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
#stair-floors { margin: 14px 0 22px; font-size: 30px; font-weight: 800; }
#stair-confirm { width: 100%; min-height: 56px; font-size: 22px; }
#hud-extra-panel { z-index: 3; }
@media (max-height: 500px) {
  #stair-arrival { padding: 14px 18px; }
  #stair-floors { margin: 6px 0 12px; font-size: 24px; }
}
.is-walking > header,
.is-walking .walk-panel,
.is-walking .view-controls {
  display: none;
}
.is-walking main {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
  min-height: 0;
  height: 100dvh;
}
.is-walking #scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
#walk-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  color: #153e31;
}
.walk-hud-top,
.walk-hud-bottom {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  max-width: 620px;
  margin: 0 auto;
  padding: 14px 18px;
  border: 1px solid #ffffffa6;
  border-radius: 14px;
  background: #fffffff2;
  box-shadow: 0 6px 24px #193d3520;
  pointer-events: auto;
}
.walk-hud-top {
  top: max(12px, env(safe-area-inset-top));
}
.walk-hud-bottom {
  bottom: max(12px, env(safe-area-inset-bottom));
}
.walk-hud-place {
  display: flex;
  gap: 16px;
  align-items: center;
}
#hud-floor {
  font-size: 42px;
  line-height: 1;
  color: #09694d;
}
.hud-caption {
  font-size: 12px;
  color: #547363;
}
#hud-location {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}
.hud-progress-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
#hud-progress-text {
  flex-shrink: 0;
  font-size: 14px;
}
#hud-progress {
  flex: 1;
  min-width: 0;
}
#hud-destination {
  margin: 8px 0 0;
  font-size: 14px;
  color: #547363;
}
#hud-status {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
}
.hud-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hud-buttons button {
  flex: 1;
  font-size: 14px;
  padding: 10px;
  white-space: nowrap;
}
@media (max-height: 500px) and (min-width: 600px) {
  .walk-hud-top {
    right: auto;
    max-width: 44%;
  }
  .walk-hud-bottom {
    left: auto;
    max-width: 48%;
  }
}
#hud-journey {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
#hud-journey li {
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 6px;
  background: #edf2ef;
  color: #62776d;
}
#hud-journey li[aria-current="step"] {
  background: #09694d;
  color: white;
  font-weight: 700;
}
#hud-journey li.passed {
  color: #09694d;
  background: #d9ebdf;
}
#journey-details {
  margin-top: 10px;
  font-size: 14px;
}
#journey-details summary {
  cursor: pointer;
  padding: 5px 0;
  color: #09694d;
}
#journey-instructions {
  max-height: 22dvh;
  overflow: auto;
  margin: 8px 0;
  padding-left: 24px;
  line-height: 1.9;
}
#journey-settings {
  width: min(500px, calc(100% - 28px));
  max-height: 85dvh;
  border: 0;
  border-radius: 14px;
  padding: 24px;
  color: #193d35;
}
#journey-settings::backdrop {
  background: #0e251ec0;
}
#journey-settings label {
  margin: 14px 0;
}
.walk-floor-switch {
  display: flex;
  gap: 5px;
  align-items: center;
}
.walk-floor-switch button {
  min-width: 44px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
}
.walk-hud-top > .walk-floor-switch {
  margin-bottom: 12px;
}
.walk-hud-top > .walk-floor-switch button {
  flex: 1;
}
@media (max-width: 700px) {
  body > header {
    flex-wrap: wrap;
  }
  body > header > .walk-floor-switch {
    flex-basis: 100%;
  }
  body > header > .walk-floor-switch button {
    flex: 1;
  }
}
.walk-hud-top {
  padding: 12px 16px;
  max-width: 560px;
}
.walk-hud-top .hud-progress-row {
  margin-top: 0;
}
#hud-next-instruction {
  margin: 9px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#hud-controls-toggle {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 5;
  pointer-events: auto;
  box-shadow: 0 3px 14px #193d3520;
  font-size: 14px;
}
#hud-extra-panel {
  position: absolute;
  top: max(140px, calc(env(safe-area-inset-top) + 120px));
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 56px);
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  max-width: 560px;
  margin: 0 auto;
  padding: 18px;
  overflow: auto;
  border-radius: 14px;
  background: #fffffff5;
  box-shadow: 0 6px 24px #193d3530;
  pointer-events: auto;
}
#hud-extra-panel > .walk-floor-switch {
  margin-bottom: 16px;
}
#hud-extra-panel > .walk-floor-switch button {
  flex: 1;
}
#hud-extra-panel .walk-hud-bottom {
  position: static;
  max-width: none;
  margin-top: 14px;
  padding: 14px 0 0;
  background: none;
  box-shadow: none;
  border: 0;
  border-top: 1px solid #d4e2dc;
  border-radius: 0;
}
@media (max-height: 500px) and (min-width: 600px) {
  .walk-hud-top {
    right: auto;
    max-width: 44%;
  }
  #hud-extra-panel {
    top: 12px;
    left: auto;
    max-width: 48%;
  }
}
@media (max-width: 760px) {
  body > header {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  button,
  .walk-floor-switch button,
  header a {
    min-height: 44px;
  }
  header a {
    display: inline-flex;
    align-items: center;
  }
  input {
    font-size: 16px;
  }
  .walk-panel {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .walk-hud-top {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    padding: 10px 12px;
  }
  #hud-controls-toggle {
    min-height: 48px;
    padding: 12px 18px;
  }
  #hud-extra-panel {
    padding: 14px;
    overscroll-behavior: contain;
  }
  .hud-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hud-buttons button {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #journey-settings {
    padding: 18px;
    max-height: calc(
      100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
    overflow: auto;
    overscroll-behavior: contain;
  }
  #journey-details summary {
    min-height: 44px;
    padding: 12px 0;
  }
}

#manual-walk-controls { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 12px 16px; border-radius: 14px; background: #fffffff2; text-align: center; pointer-events: auto; }
#manual-walk-controls p { margin: 0 0 8px; font-size: 14px; }
#manual-walk-controls button { min-width: 90px; min-height: 44px; }
