:root {
  color-scheme: light;
  --navy: #182646;
  --muted: #526a78;
  --blue: #115579;
  --blue-hover: #0c4261;
  --ice: #e7f1f5;
  --snow: #f7fbfc;
  --paper: #fff;
  --line: #d1dfe5;
  --focus: #96540c;
  --nav-height: 63px;
  --nav-reserved: calc(var(--nav-height) + env(safe-area-inset-bottom));
  --header-height: 69px;
  --shadow: 0 12px 32px #10263a1b;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.42;
  color: var(--navy);
  background: var(--snow);
  scroll-padding-bottom: calc(var(--nav-reserved) + 6px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; padding-bottom: var(--nav-reserved); }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .55; }
:where(button, input, select, textarea, summary, a):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon {
  display: block;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 10;
  top: 10px;
  left: 10px;
  padding: .75rem 1rem;
  border-radius: 5px;
  transform: translateY(-170%);
  background: var(--paper);
}
.skip-link:focus { transform: translateY(0); }

.app-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 4px 12px;
  padding: max(5px, env(safe-area-inset-top)) 12px 8px;
  color: var(--paper);
  background: var(--navy);
}
.brand {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  min-height: 44px;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.1;
  text-decoration: none;
  font-size: 1.28rem;
  font-weight: 550;
  letter-spacing: -.045em;
}
.brand img { display: block; width: 37px; height: 37px; flex: 0 0 auto; }
.brand strong { font-weight: 780; }
.region-picker {
  display: flex;
  position: relative;
  grid-row: 2;
  grid-column: 1 / -1;
  align-items: center;
  min-width: 0;
  border: 1px solid #7090a2;
  border-radius: 8px;
  padding-left: 12px;
  background: #254356;
}
.region-picker .icon { width: 17px; height: 17px; }
.region-picker::after {
  content: "";
  position: absolute;
  inset-inline-end: 13px;
  width: 7px;
  height: 7px;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.region-picker select {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  padding-inline-end: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--paper);
  font-weight: 650;
  text-overflow: ellipsis;
}
.region-picker option { background: var(--navy); color: var(--paper); }
.header-tools { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; margin-left: auto; }
.header-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 46px;
  min-height: 44px;
  padding: 4px 8px;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: .76rem;
  font-weight: 700;
}
.header-button:hover, .header-button[aria-expanded="true"] { background: #254356; border-color: #7090a2; }
.header-button .icon { width: 18px; height: 18px; }
.app-header :focus-visible { outline-color: #ffd092; }

.app-layout { position: relative; }
.map-shell {
  position: relative;
  display: block;
  --map-height: clamp(max(350px, 14rem), 49svh, max(520px, 14rem));
  height: var(--map-height);
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  background: #e4edf0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 6px;
}
.map-stage { position: absolute; inset: 0; }
.map-canvas { position: absolute; inset: 0; overflow: hidden; }
.map-canvas > svg { width: 100%; height: 100%; display: block; }
.map-info {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  right: 64px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 8px;
  pointer-events: none;
}
.map-heading {
  max-width: 100%;
  padding: 8px 12px;
  background: #fffffff2;
  border-left: 4px solid var(--blue);
  border-radius: 2px 7px 7px 2px;
  box-shadow: 0 2px 10px #10263a18;
  overflow-wrap: anywhere;
}
.map-heading h1 {
  font-size: clamp(1.05rem, 3.4vw, 1.72rem);
  line-height: 1.13;
  letter-spacing: -.035em;
  font-weight: 760;
}
.map-heading p { margin-top: 3px; color: var(--muted); font-size: .72rem; font-weight: 650; }
.map-guidance {
  display: flex;
  flex-direction: column;
  align-items: start;
  min-height: 0;
  max-width: min(380px, 100%);
  padding: 8px 10px;
  border-left: 4px solid var(--blue);
  border-radius: 4px 8px 8px 4px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
  pointer-events: auto;
}
.map-guidance-copy {
  overflow: auto;
  overscroll-behavior: contain;
  min-width: 0;
  max-height: max(3em, calc(43svh - var(--nav-reserved)));
}
.map-guidance-copy:focus-visible { outline: 2px solid var(--focus); }
#guidance-current { font-weight: 740; }
#guidance-departure { display: block; margin-top: 4px; }
#guidance-limit { font-size: .85rem; font-weight: 650; }
#guidance-next { color: var(--muted); font-size: .85rem; }
#guidance-operator-status {
  margin-bottom: 4px;
  color: #7b3515;
  font-size: .84rem;
  font-weight: 700;
}
#guidance-timing {
  margin-top: 6px;
  padding: 5px 7px;
  border-left: 3px solid #9f521e;
  border-radius: 3px;
  background: #fff1e5;
  color: #7b3515;
  font-size: .84rem;
  font-weight: 700;
}
.map-guidance-actions { display: flex; flex: 0 0 auto; gap: 6px; max-width: 100%; margin-top: 6px; }
#stop-guidance { min-width: 0; }
#guidance-warning { display: none; }
.map-actions {
  position: absolute;
  z-index: 2;
  top: 74px;
  right: 10px;
  display: grid;
  gap: 7px;
}
.map-actions button, .panel-heading button {
  display: grid;
  width: 45px;
  height: 45px;
  padding: 0;
  place-items: center;
  border: 1px solid #b3c8d2;
  border-radius: 9px;
  background: var(--paper);
}
.map-actions #map-feature-search {
  position: absolute;
  right: calc(100% + 7px);
  bottom: 0;
  width: max-content;
  max-width: min(11rem, calc(100vw - 170px));
  min-height: 45px;
  height: auto;
  padding: 5px 8px;
  color: var(--blue);
  font-size: .8rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.map-actions > button, .zoom-actions { box-shadow: 0 3px 12px #10263a24; }
.map-actions button:hover, .panel-heading button:hover { background: var(--ice); }
.map-actions button[aria-pressed="true"] { color: var(--paper); background: var(--blue); }
.zoom-actions { border-radius: 9px; }
.zoom-actions button:first-child { border-radius: 9px 9px 0 0; }
.zoom-actions button:last-child { border-radius: 0 0 9px 9px; border-top: 0; }
.zoom-actions button:focus-visible { position: relative; z-index: 1; }

.map-footer {
  display: flex;
  position: absolute;
  z-index: 1;
  right: 62px;
  left: 10px;
  bottom: 8px;
  flex-wrap: wrap;
  align-items: end;
  gap: 5px 8px;
  pointer-events: none;
}
.map-key {
  display: flex;
  align-items: center;
  gap: 4px 10px;
  flex-wrap: wrap;
  padding: 6px 8px;
  color: var(--navy);
  background: #fffffff2;
  border: 1px solid #d7e4e9;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 700;
}
.map-key span { display: inline-flex; gap: 4px; align-items: center; }
.key-line { display: block; width: 12px; height: 3px; border-radius: 4px; }
.key-blue { background: #1768b2; }
.key-red { background: #c32a43; }
.key-black { background: #1d2934; }
.key-lift { height: 0; border-top: 2px dashed #654887; border-radius: 0; }
.map-credit {
  margin-left: auto;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 3px;
  color: #345061;
  background: #fffffff2;
  font-size: .67rem;
  text-align: right;
  pointer-events: auto;
}
#map-status:not(:empty) {
  order: -1;
  display: block;
  flex-basis: 100%;
  width: fit-content;
  max-width: min(80%, calc(100% - 52px));
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--navy);
  font-size: .75rem;
}
#map-alignment-notice:not([hidden]) {
  order: -1;
  flex-basis: 100%;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--navy);
  font-size: .75rem;
}
#map-clock-help {
  pointer-events: auto;
  min-height: 44px;
  max-width: 100%;
  padding: 4px 8px;
}

.planner {
  background: var(--paper);
  padding: 20px 16px 25px;
  scroll-margin-top: 8px;
}
.planner-content { max-width: 560px; margin: 0 auto; min-width: 0; }
.planner-title { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.planner-title .icon { color: var(--blue); }
.planner-title h2 {
  font-size: clamp(1.36rem, 6vw, 1.67rem);
  line-height: 1.1;
  letter-spacing: -.038em;
  font-weight: 760;
}
.waypoints {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--snow);
}
.waypoint {
  position: relative;
  display: flex;
  min-height: 61px;
  align-items: center;
  gap: 12px;
  margin: 0 11px;
}
.waypoint + .waypoint { border-top: 1px solid var(--line); }
.waypoint-mark { display: grid; z-index: 1; place-items: center; flex: 0 0 22px; width: 22px; }
.waypoint-from::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 3px solid var(--blue);
  border-radius: 50%;
  background: var(--paper);
}
.waypoint-to { color: var(--blue); }
.waypoint-to .icon { width: 19px; height: 19px; }
.waypoint-field {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
}
.waypoint-field > span { display: block; }
.waypoint-field select {
  display: block;
  width: 100%;
  min-height: 40px;
  margin: -4px 0 0 -3px;
  padding: 0 0 0 3px;
  border: 0;
  border-radius: 3px;
  color: var(--navy);
  background: transparent;
  font-size: 1rem;
  font-weight: 650;
  text-overflow: ellipsis;
}
.control-group { border: 0; min-width: 0; padding: 0; margin: 15px 0 0; }
.control-group legend { margin: 0 0 6px; padding: 0; font-size: .85rem; font-weight: 720; }
.mode-grid, .split-fields, .checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mode-grid button, .layer-buttons button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--navy);
  font-size: .82rem;
  font-weight: 680;
  text-align: center;
}
.mode-grid [data-mode="loop"] { grid-column: 1 / -1; }
.mode-grid button:hover, .layer-buttons button:hover, .secondary-button:hover { background: var(--ice); }
.mode-grid button[aria-pressed="true"], .layer-buttons button[aria-pressed="true"] {
  color: #0b496b;
  background: var(--ice);
  border-color: #7ba7be;
  box-shadow: inset 0 -2px #7ba7be;
}
.route-options { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 14px; }
.route-options[open] { padding-bottom: 11px; }
.route-options summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  list-style-type: none;
  color: var(--blue);
  font-size: .85rem;
  font-weight: 690;
}
.route-options summary::-webkit-details-marker { display: none; }
.route-options .icon { width: 18px; height: 18px; }
.chevron { margin-left: auto; }
.route-options[open] .chevron { transform: rotate(180deg); }
.field { display: block; min-width: 0; font-weight: 650; }
.field.waypoint { display: flex; }
.split-fields .field, #panel-drawer .field { font-size: .85rem; }
.field input:not([type="checkbox"]), .field select, .field textarea,
#panel-content :is(input:not([type="checkbox"]), select, textarea) {
  display: block;
  max-width: 100%;
}
.split-fields :is(select, input), #panel-drawer :is(select, input:not([type="checkbox"]), textarea) {
  width: 100%;
  min-height: 44px;
  margin-top: 3px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--navy);
  font-size: 1rem;
}
.checkbox-grid { gap: 0 8px; }
.checkbox-grid label { display: flex; align-items: center; min-height: 40px; gap: 5px; font-size: .84rem; }
.checkbox-grid input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 51px;
  margin-top: 13px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--paper);
  background: var(--blue);
  font-weight: 740;
}
.primary-button:hover { background: var(--blue-hover); }
#route-summary:empty, .route-steps:empty { display: none; }
#route-summary:not(:empty) { margin-top: 15px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 0 6px 6px 0; background: var(--ice); }
.route-closed { color: #64258f; font-weight: 700; }
#route-preview { margin-top: 8px; }
#route-round-trip { margin-top: 8px; border-top: 1px solid var(--line); }
:is(#route-preview, #route-round-trip) summary { min-height: 44px; padding-block: 10px; color: var(--blue); font-weight: 700; cursor: pointer; }
#return-stop-minutes { margin-top: 4px; }
#return-trip-status { display: grid; gap: 5px; margin-top: 8px; }
#prepare-return { justify-self: start; }
.route-preview-steps small { display: block; color: var(--muted); }
.route-preview-steps small.route-closed { color: #64258f; }
#map-preview { margin-block: 4px 7px; pointer-events: auto; }
#route-steps small { display: block; color: var(--muted); margin-top: 2px; }
.route-warning { margin-top: 5px; color: var(--muted); font-size: .8rem; }
.guidance { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.guidance .secondary-button { justify-content: start; padding-inline: 10px; }
#guide-screen-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 4px 3px;
  font-size: .82rem;
  font-weight: 600;
}
#guide-screen-on { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
#guide-screen-status { flex-basis: 100%; }
.route-steps { margin: 9px 0 0; padding-left: 1.3rem; }
.route-steps li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.map-layers { margin-top: 19px; }
.layer-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-buttons button { padding-inline: 9px; }
.layer-dot { width: 8px; height: 8px; border-radius: 50%; background: #1d6bab; }
.layer-lifts { background: #654887; }
.layer-services { background: #526a78; }

.app-nav {
  position: fixed;
  right: 0;
  left: 0;
  z-index: 3;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: var(--nav-height);
  padding: 4px 5px max(4px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.app-nav :is(a, button) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 49px;
  padding: 4px 0;
  color: #294d63;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: center;
  text-decoration: none;
  font-size: clamp(.61rem, 2.45vw, .78rem);
  font-weight: 700;
}
.app-nav span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
.app-nav :is(a, button):hover, .app-nav [aria-expanded="true"], .app-nav [aria-current] { background: var(--ice); color: var(--blue); }

.panel-drawer {
  --panel-padding: 12px;
  position: fixed;
  display: flex;
  flex-direction: column;
  z-index: 4;
  right: 10px;
  bottom: calc(var(--nav-reserved) + 8px);
  left: 10px;
  max-height: min(65svh, 520px, calc(100dvh - var(--nav-reserved) - 16px));
  overflow: hidden;
  border: 1px solid #b7ccd6;
  border-radius: 13px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--panel-padding) var(--panel-padding) 8px;
}
.panel-heading h2 { min-width: 0; font-size: 1.35rem; line-height: 1.15; letter-spacing: -.025em; overflow-wrap: anywhere; }
.panel-heading button { flex: 0 0 auto; }
#panel-scroll {
  min-height: 0;
  padding: 3px var(--panel-padding) var(--panel-padding);
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scroll-padding-block: 6px;
}
#panel-content p + :is(button, a), #panel-content a + p:not(:empty) { margin-top: 8px; }
#panel-content a { display: inline-block; }
#panel-content p + p { margin-top: 8px; }
#panel-content a { color: var(--blue); font-weight: 680; }
#panel-content button:not(.primary-button) {
  min-height: 44px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--snow);
  color: var(--blue);
  font-weight: 650;
  overflow-wrap: anywhere;
}
#panel-content button:not(.primary-button):hover { background: var(--ice); }
#panel-content form label { display: block; margin-bottom: 8px; }
#panel-content ul { padding-left: 1.25rem; }
#panel-content li + li { margin-top: 6px; }
.offline-panel { display: grid; gap: 12px; }
.offline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.offline-transfer {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.offline-transfer progress {
  inline-size: 100%;
  block-size: .875rem;
  accent-color: var(--blue);
}
.offline-readiness {
  padding: 9px 11px;
  border-inline-start: 3px solid #607b8a;
  background: var(--snow);
}
.offline-readiness[data-state="ready"] { border-inline-start-color: #278169; }
.offline-readiness:is([data-state="incomplete"], [data-state="shell-unavailable"]) {
  border-inline-start-color: #996f2e;
}
.web-install {
  margin-block-start: 16px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--line);
}
.web-install summary { min-height: 44px; padding-block: 10px; cursor: pointer; }
.web-install ol { padding-inline-start: 1.3em; }

@media (max-width: 340px) {
  .header-button { padding-inline: 4px; }
  .header-button .icon { display: none; }
  .map-key { gap: 4px 6px; padding-inline: 5px; }
  .map-footer { gap: 4px; }
}
@media (min-width: 660px) {
  .app-header {
    grid-template-columns: minmax(165px, 1fr) minmax(200px, 340px) minmax(165px, 1fr);
    min-height: var(--header-height);
    gap: 16px;
    padding: max(7px, env(safe-area-inset-top)) 18px 7px;
  }
  .brand { font-size: 1.45rem; }
  .brand img { width: 43px; height: 43px; }
  .region-picker { grid-row: auto; grid-column: auto; }
  .header-button { font-size: .84rem; }
}
@media (min-width: 850px) {
  :root { scroll-padding-bottom: 6px; }
  body { height: 100dvh; padding-bottom: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .app-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(318px, 29vw, 420px); min-height: 0; }
  .map-shell { height: 100%; border-bottom: 0; }
  .map-info { top: 19px; left: 20px; right: 70px; }
  .map-heading { padding: 9px 14px; }
  .map-heading p { font-size: .83rem; }
  .map-actions { top: 105px; right: 16px; }
  .map-footer { right: 68px; bottom: 12px; left: 16px; }
  .map-key { padding: 8px 10px; font-size: .78rem; }
  .key-line { width: 16px; }
  .planner { overflow: auto; padding: 23px 18px; border-left: 1px solid var(--line); scrollbar-gutter: stable; }
  .app-nav { position: static; grid-template-columns: repeat(6, minmax(82px, 106px)); justify-content: center; gap: 14px; }
  .app-nav :is(a, button) { display: flex; align-items: center; justify-content: center; gap: 5px; }
  .app-nav .icon { width: 18px; height: 18px; }
  .panel-drawer { right: calc(clamp(318px, 29vw, 420px) + 13px); left: auto; width: min(410px, calc(100vw - 350px)); --panel-padding: 14px; }
}
@media (min-width: 850px) and (max-height: 500px) {
  :root { scroll-padding-bottom: calc(var(--nav-reserved) + 6px); }
  body { grid-template-rows: max-content minmax(min-content, 1fr) max-content; }
  .map-shell { display: grid; height: auto; grid-template-rows: minmax(max(168px, 10.5rem), 1fr) auto; }
  .map-stage { position: relative; }
  .map-footer {
    position: static;
    padding: 6px 10px;
    align-items: center;
    background: var(--snow);
  }
  #map-status:not(:empty) { max-width: 100%; }
  .planner { contain: size; }
  .app-nav { position: sticky; }
}
@media (max-height: 500px) {
  .map-info:has(.map-guidance:not([hidden])) .map-heading {
    position: absolute;
    clip-path: inset(50%);
  }
  .map-info { left: max(12px, env(safe-area-inset-left)); right: calc(64px + env(safe-area-inset-right)); }
  .map-actions { right: calc(10px + env(safe-area-inset-right)); }
  .map-guidance {
    max-width: min(520px, 100%);
    max-height: min(100%, calc(100dvh - var(--nav-reserved) - 26px));
    scroll-margin-top: max(8px, env(safe-area-inset-top));
  }
  .map-guidance-copy { flex: 1 1 auto; min-height: 0; max-height: none; }
  #guidance-warning {
    display: grid;
    flex: 0 0 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border-color: #bf895c;
    color: #7b3515;
    background: #fff1e5;
  }
}
@media (max-width: 480px) and (max-height: 420px) {
  .panel-drawer {
    --panel-padding: 8px;
    max-height: calc(100dvh - var(--nav-reserved) - 16px);
  }
  .panel-heading h2 { font-size: 1rem; line-height: 1.2; }
}
@media (max-width: 480px) and (max-height: 320px) {
  .panel-drawer {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
  }
}
@media (min-width: 550px) and (max-height: 500px) {
  .map-actions {
    top: 54px;
    grid-template-columns: repeat(3, 45px);
    grid-template-rows: repeat(2, 45px);
    align-items: start;
  }
  .map-actions .zoom-actions { grid-area: 1 / 3 / span 2; }
  #map-reset { grid-area: 1 / 2; }
  .map-info { right: calc(165px + env(safe-area-inset-right)); }
}

@media (max-width: 849px) {
  .app-nav {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    padding-left: max(5px, env(safe-area-inset-left));
    padding-right: max(5px, env(safe-area-inset-right));
  }
  .app-nav :is(a, button) {
    flex: 1 0 auto;
    min-width: 44px;
    min-height: 44px;
    gap: 2px;
    padding: 2px 4px;
    line-height: 1.05;
  }
  .app-nav .icon { width: 17px; height: 17px; }
  .app-nav span { white-space: nowrap; }
}

@media (max-width: 480px), (max-width: 849px) and (max-height: 500px) {
  .map-shell {
    display: grid;
    height: auto;
    grid-template-rows: var(--map-height) auto;
  }
  .map-stage { position: relative; }
  .map-footer {
    position: static;
    align-items: center;
    padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
    background: var(--snow);
    pointer-events: auto;
  }
  #map-status:not(:empty) { max-width: 100%; }
}

@media (min-width: 1200px) {
  .app-header { padding-inline: 22px; }
  .planner { padding: 27px 23px; }
}
@media (hover: none) {
  a, button { -webkit-tap-highlight-color: #11557925; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.activity-card {
  margin-block: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--snow);
}
.activity-card > button { margin: 6px 5px 0 0; }
.ski-session-timing summary {
  min-height: 44px;
  padding-block: 10px;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}
.ski-session-timing :is(ol, ul) { padding-inline-start: 1.35rem; }
.recorded-wait-review { margin-block: 10px 14px; }
.recorded-wait-review .community-list { border-inline-start: 3px solid var(--line); padding-inline-start: 10px; }
.recorded-wait-review select:disabled { appearance: none; }
.history-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.history-scopes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.history-scopes button[aria-pressed="true"] { color: var(--paper); background: var(--blue); border-color: var(--blue); }
.history-transfer-status { padding: 9px 11px; border-radius: 8px; background: var(--ice); color: var(--navy); }
#history-account { scroll-margin-top: 14px; }
.private-track-map { position: relative; min-height: 190px; height: min(34svh, 290px); margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.private-track-map .ski-map-scale { bottom: 8px; }
.private-track-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px; }
.private-track-credit { font-size: .78rem; color: var(--muted); }
.account-recovery { margin-top: 10px; border-top: 1px solid var(--line); }
.account-erasure { margin-top: 10px; border-top: 1px solid var(--line); }
.account-erasure summary { min-height: 44px; padding-block: 10px; font-weight: 700; cursor: pointer; }
.account-erasure-address { overflow-wrap: anywhere; font-weight: 700; }
.account-erasure button[type="submit"] { color: #8c253f; border-color: #b77b89; }
.account-recovery summary { padding-block: 12px; color: var(--blue); cursor: pointer; font-weight: 700; }
.account-recovery form { margin-top: 10px; }
.account-recovery input[readonly] { font-family: monospace; }
.share-card-preview {
  display: block;
  width: min(100%, 28svh, 260px);
  height: auto;
  margin: 0 auto 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.share-card-options { display: grid; gap: 5px; min-width: 0; margin: 0 0 10px; padding: 0; border: 0; }
.share-card-options legend { padding: 0; margin-bottom: 7px; font-weight: 700; }
#panel-content .share-card-options label { margin-bottom: 0; }
 
.share-card-options > label:has(input) { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.share-card-options input[type=checkbox] { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; }
.community-form { display: grid; gap: 10px; margin-block: 12px; }
.community-form .field { display: grid !important; gap: 4px; margin: 0 !important; }
.community-form textarea { resize: vertical; }
.community-form :is(input,textarea,select) { max-width: 100%; }
.community-form input[type=file] { padding: 7px; font-size: .82rem; }
.community-area { font-weight: 700; margin-bottom: 8px; }
.community-list { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 12px; }
.community-list h3 { margin-bottom: 4px; }
.community-ranking { margin: 10px 0 10px 25px; }
.preset-circuits { padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.preset-circuits > p { font-size: .83rem; color: var(--muted); margin-bottom: 6px; }
.circuit-dot { display: inline-block; vertical-align: middle; width: 9px; height: 9px; margin-right: 5px; border-radius: 100%; }
.circuit-dot.orange { background: #c25517; }
.circuit-dot.green { background: #17724c; }

.share-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 12px; }
#panel-content .share-card-actions button:first-child { background: var(--blue); color: var(--paper); }

.route-timing:not(:empty) { margin-block: 9px; padding: 8px 10px; border-inline-start: 3px solid var(--line); background: var(--snow); }
.route-timing p, .route-timing small { display: block; margin-top: 4px; }
.route-timing-risk { border-inline-start-color: #9f521e !important; }
.route-personal { font-weight: 650; color: var(--blue); margin-top: 5px; }

.waypoint-item { display: grid; grid-template-columns: minmax(0,1fr) 48px; align-items: center; }
.waypoint-item + .waypoint-item { border-top: 1px solid var(--line); }
.waypoint-search { min-height: 44px; min-width: 44px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--blue); }
.waypoint-search:is(:hover,:focus-visible) { background: var(--ice); }
.waypoint-search .icon { width: 20px; height: 20px; }
.map-feature-sections { margin-block: 8px; }
.map-feature-sections summary { min-height: 44px; padding: 8px 0; cursor: pointer; }
.map-feature-sections ul { margin: 0; padding-inline-start: 1.25em; }
.map-feature-sections li + li { margin-top: 8px; }

.waypoint-results { display: grid; gap: 5px; margin-top: 7px; }
.waypoint-results button { justify-content: start; text-align: left; }
.stop-suggestions { margin-top: 8px; }
.waypoint-results .stop-choice { display: grid; gap: 2px; justify-items: start; }
#lift-waits { margin-top: 12px; }
.lift-webcam-action { margin-top: 4px; }
.lift-waits-list { padding: 0; margin: 6px 0; list-style: none; }
.lift-waits-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lift-waits-list small { grid-column: 1 / -1; color: var(--muted); }
.lift-wait-time { font-variant-numeric: tabular-nums; font-weight: 720; }
.stop-choice small, .stop-note { color: var(--muted); }
.stop-note { margin-top: 8px; }
.webcam-preview {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: .75rem;
}
