/* Map-first controls: direct touch, a persistent profile, options contained by the map. */
.mp #stage .tourbediening { display: contents; }
.mp #stage #overview svg, .mp #stage #expand svg { display: none; }
.mp #stage .kaartopties-kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 700 20px/1.2 var(--mp-kop); }
.mp #stage #kaartopties-dicht { width: 48px; padding: 0; flex: none; }
.mp #stage .kaartopties-in { z-index: 12; width: 360px; max-height: calc(100vh - 160px); overflow-y: auto; box-sizing: border-box; background: var(--mp-wit); color: var(--mp-inkt); }
.mp #stage .kaartopties-in .seg button { flex: 1; }
.mp #stage .map-symbols { font: 400 13px/1.4 var(--mp-tekst); }
.mp #stage .map-symbols > summary { min-height: 36px; padding: 0; background: none; box-shadow: none; border-radius: 0; font-size: 14px; }
.mp #stage .map-symbols .legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.mp #stage .map-symbols .legend > span { font-size: 12px; }
.mp #stage .foot { left: 14px; right: auto; bottom: 14px; width: min(480px, calc(100% - 28px)); max-width: none; background: var(--mp-wit); color: var(--mp-inkt); border: 1px solid var(--mp-lijn); border-radius: 14px; padding: 0 12px; box-sizing: border-box; }
.mp #stage .foot > summary { width: 100%; min-height: 40px; padding: 0; display: flex; align-items: center; gap: 8px; background: transparent; color: var(--mp-inkt); box-sizing: border-box; font: 700 14px/1.25 var(--mp-tekst); border-radius: 0; box-shadow: none; }
.mp #stage .foot > summary::after { content: ''; flex: none; width: 6px; height: 6px; margin: -3px 3px 0; border-bottom: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.mp #stage .foot[open] > summary::after { content: ''; transform: rotate(225deg); margin-top: 3px; }
.mp #stage #map-readout { margin-left: auto; font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; }
.mp #stage .foot .map-details-in { display: flex; flex-direction: column; gap: 6px; margin-top: 0; padding-bottom: 4px; }
.mp #stage .foot .profile { padding: 0; border-radius: 0; box-shadow: none; background: transparent; }
.mp #stage .foot .profile svg { height: 48px; }
.mp #stage .foot .pwrap { min-height: 48px; }
.mp #stage .foot .legend { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--mp-inkt); font-size: 12px; line-height: 1.2; }
.mp #stage .foot .legend .sw { width: 12px; height: 4px; }
.mp #stage .foot .src { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 24px; margin: 0; color: var(--mp-zacht); font: 400 11px/1.3 var(--mp-tekst); }
.mp #stage .foot .src a { color: inherit; text-underline-offset: 2px; }
.mp #stage .kaartopties-in .foot { position: static; width: 100%; padding: 0; border: 0; background: transparent; }
.mp #stage.options-open .kaartopties-in { display: grid; gap: 12px; }
.mp #stage .src { max-width: 100%; }
.mp #stage .replay svg { flex: none; }
@media (max-width: 1023px), (pointer: coarse) and (max-width: 1366px) {
  .mp.mp-parcours .mp-kaartvak { height: clamp(480px, 82svh, 860px); margin-top: 24px; }
  .mp #stage.compact .tools { inset: 0; display: block; pointer-events: none; }
  .mp #stage.compact .tools > *, .mp #stage.compact .tourbediening > * { pointer-events: auto; }
  .mp #stage.compact .tourbediening { position: absolute; inset: auto 0 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(80px, 1fr) 48px; align-items: center; gap: 4px 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--mp-wit); color: var(--mp-inkt); border-top: 1px solid var(--mp-lijn); box-sizing: border-box; }
  .mp #stage.compact .replay, .mp #stage.compact .seg, .mp #stage.compact .kaartopties > summary { background: var(--mp-wit); color: var(--mp-inkt); box-shadow: 0 0 0 1px var(--mp-lijn); font-size: 15px; }
  .mp #stage.compact .replay { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
  .mp #stage.compact #tour { grid-column: 1 / -1; background: var(--mp-blauw); color: var(--mp-blauw-inkt); box-shadow: none; }
  .mp #stage.compact.touraan #tour { grid-column: 2; }
  .mp #stage.compact #tourprev { grid-column: 1; grid-row: 1; }
  .mp #stage.compact #tourpause { grid-column: 3; grid-row: 1; }
  .mp #stage.compact #tournext { grid-column: 4; grid-row: 1; }
  .mp #stage.compact .tourbediening .replay { padding-inline: 6px; font-size: 14px; gap: 6px; white-space: nowrap; }
  .mp #stage.compact .tourstap { padding: 0; box-shadow: none; }
  .mp #stage.compact .tourstap span { display: none; }
  .mp #stage.compact .tourstap svg { width: 22px; height: 22px; }
  .mp #stage.compact .tourstart svg { width: 14px; height: 14px; }
  .mp #stage.compact .tourbalk { display: none; }
  .mp #stage.compact .zoomseg { position: absolute; right: 12px; top: 76px; flex-direction: column; gap: 0; padding: 0; border-radius: 16px; overflow: hidden; }
  .mp #stage.compact .seg button { color: var(--mp-inkt); min-height: 48px; }
  .mp #stage.compact .seg button[aria-pressed="true"] { background: var(--mp-blauw); color: var(--mp-blauw-inkt); }
  .mp #stage.compact #overview, .mp #stage.compact #expand { position: absolute; top: 12px; width: 48px; padding: 0; }
  .mp #stage.compact #overview { right: 72px; }
  .mp #stage.compact #expand { right: 12px; }
  .mp #stage.compact #overview span, .mp #stage.compact #expand span { display: none; }
  .mp #stage.compact #overview svg, .mp #stage.compact #expand svg { display: block; width: 22px; height: 22px; }
  .mp #stage.compact .kaartopties { position: static; }
  .mp #stage.compact .kaartopties > summary { position: absolute; left: 12px; top: 12px; min-height: 48px; padding: 0 14px; font-size: 15px; }
  .mp #stage.compact .kaartopties > summary::after { content: ''; width: 7px; height: 7px; border-bottom: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); margin: -4px 2px 0 6px; }
  .mp #stage.compact .kaartopties[open] > summary { background: var(--mp-blauw); color: var(--mp-blauw-inkt); }
  .mp #stage.compact .kaartopties-in { position: absolute; inset: 8px 8px calc(var(--map-dock-h, 64px) + 8px); width: auto; max-height: none; display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--mp-wit); color: var(--mp-inkt); overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; box-shadow: 0 4px 24px color-mix(in srgb, var(--mp-inkt) 18%, transparent); }
  .mp #stage.compact .kaartopties-in .seg { box-shadow: 0 0 0 1px var(--mp-zacht); flex: none; }
  .mp #stage.compact .kaartopties-in .seg button { flex: 1; font-size: 16px; }
  .mp #stage.compact .foot { left: 8px; right: 8px; bottom: calc(var(--map-dock-h, 64px) + 8px); width: auto; max-width: none; display: block; pointer-events: auto; z-index: 4; }
  .mp #stage.compact .kaartopties-in .foot { position: static; padding: 0; }
  .mp #stage.compact .foot #ptip { display: none; }
  .mp #stage.compact .hint { display: none; }
  .mp #stage.compact .kompas { top: 196px; right: 15px; }
  .mp #stage.compact .tourpop { width: min(280px, calc(100% - 88px)); padding: 10px 12px; font-size: 14px; background: var(--mp-wit); color: var(--mp-inkt); }
  .mp #stage.compact .tourpop p { color: var(--mp-zacht); }
  .mp #stage.compact .tourpop::after { display: none; }
  .mp #stage.compact.groot .kaartopties > summary, .mp #stage.compact.groot #overview, .mp #stage.compact.groot #expand { top: max(12px, env(safe-area-inset-top, 0px)); }
  .mp #stage.compact.groot .zoomseg { top: calc(76px + env(safe-area-inset-top, 0px)); }
  .mp #stage.compact.groot { height: 100dvh; }
}
@media (min-width: 640px) and (max-width: 1023px), (pointer: coarse) and (min-width: 640px) and (max-width: 1366px) {
  .mp #stage.compact .tourbediening { left: 16px; right: auto; bottom: 16px; width: 360px; border: 1px solid var(--mp-lijn); border-radius: 18px; padding: 12px; }
  .mp #stage.compact .foot { left: 16px; right: auto; width: 360px; bottom: calc(var(--map-dock-h, 74px) + 24px); }
  .mp #stage.compact .kaartopties-in { left: auto; right: 12px; width: min(400px, calc(100% - 24px)); bottom: 16px; }
  .mp #stage.compact .kaartopties-in .foot { width: 100%; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .mp #stage.compact.groot .tourbediening { left: 12px; right: auto; bottom: 8px; width: 340px; border-radius: 16px; padding: 8px; }
  .mp #stage.compact.groot .foot { left: 12px; right: auto; width: 340px; bottom: calc(var(--map-dock-h, 64px) + 16px); }
  .mp #stage.compact.groot .kaartopties-in { inset: 8px 12px 8px auto; width: min(400px, calc(100% - 24px)); }
  .mp #stage.compact.groot .kaartopties-in .foot { width: 100%; }
}
@media (max-width: 374px) { .mp #stage.compact .tourbediening { column-gap: 4px; } .mp #stage.compact .tourbediening .replay { font-size: 13px; } .mp #stage.compact .foot .legend { font-size: 11px; gap: 5px 8px; } }

@media (max-height: 500px) and (orientation: landscape) {
  .mp #stage.compact .kaartopties-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; gap: 8px; padding: 12px; }
  .mp #stage.compact .kaartopties-in > .kaartopties-kop, .mp #stage.compact .kaartopties-in > .foot, .mp #stage.compact .kaartopties-in > .map-symbols { grid-column: 1 / -1; }
}
.mp #stage .map-symbols > summary { color: var(--mp-inkt); }
.mp #stage .kaartopties-in .seg { background: var(--mp-bg); box-shadow: 0 0 0 1px var(--mp-zacht); }
.mp #stage .kaartopties-in .seg button { color: var(--mp-inkt); }
.mp #stage .kaartopties-in .seg button[aria-pressed="true"] { background: var(--mp-blauw); color: var(--mp-blauw-inkt); }
.mp #stage #kaartopties-dicht { background: var(--mp-wit); color: var(--mp-inkt); }
