/* Shared placement and state. Delivery colors, labels and available modules remain local. */
.jmos-shared-map-shell .map-search-panel {
  left: calc(84px + var(--map-safe-left, 0px)); right: auto;
  top: calc(72px + var(--map-safe-top, 0px));
  width: min(320px, calc(100% - 112px)); max-height: calc(100% - 160px);
  transform: none; opacity: 1; pointer-events: auto;
}
.jmos-shared-map-shell .map-search-panel [hidden] { display: none !important; }
.jmos-shared-map-shell .map-search-panel .map-mobility-control {
  position: static; max-width: none; padding: 10px 0 0; margin-top: 10px;
  border: 0; border-top: 1px solid var(--panel-border); border-radius: 0; box-shadow: none; background: none;
}
.jmos-shared-map-shell [data-module="mobility"] .domain-nav-label {
  position: static; opacity: 1; transform: none; color: inherit; background: none;
  padding: 0; font-size: 10px; box-shadow: none;
}
.map-search-panel #map-results-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0; }
.jmos-shared-map-shell .showcase-panel { max-width: calc(100% - 96px); }
@media (max-width: 1100px) {
  .jmos-shared-map-shell.jmos-detail-open .map-search-panel { visibility: hidden; }
}
@media (max-width: 767px) {
  .jmos-shared-map-shell .map-search-panel { left: 12px; top: calc(58px + var(--map-safe-top, 0px)); width: min(320px, calc(100% - 24px)); max-height: 36dvh; }
  .jmos-shared-map-shell .showcase-panel { max-width: 100%; max-height: 66dvh; }
}

/* Reuse the existing PublicExperience rail/panel; context content stays on the right. */
body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-panel {
  inset: 12px 0 12px auto; width: min(400px, calc(100vw - 84px));
  border-left: 1px solid var(--panel-border); border-right: 0;
  transform: translateX(100%); border-radius: 8px 0 0 8px;
}
body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-panel.is-open { transform: translateX(0); }
body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-handle {
  left: -34px; right: auto; top: 50%; width: 34px; border-radius: 8px 0 0 8px;
}
.jmos-public-panel__body .map-search-panel .map-mobility-control {
  position: static; padding: 10px 0; margin-top: 10px; border: 0; box-shadow: none; background: none;
}
.jmos-public-panel__body .map-search-panel [hidden] { display: none !important; }
@media (max-width: 767px) {
  body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-panel {
    inset: auto 0 0 auto; width: 100%; max-width: 100%; max-height: 66dvh; transform: translateY(100%);
  }
  body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-panel.is-open { transform: translateY(0); }
  body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-handle { top: -34px; left: auto; right: 12px; }
}

/* The existing public calendar renderer mounts into the context pane. */
#module-calendar .filters { display: grid; gap: 10px; }
#module-calendar label { display: grid; gap: 4px; }
#module-calendar input, #module-calendar select { width: 100%; min-width: 0; }
#module-calendar .event-card { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--panel-border); }
#module-calendar .event-image { width: 100%; height: auto; }
#module-calendar .meta { display: grid; gap: 4px; }
#module-calendar .notice.error { color: #a12626; }
#module-calendar .filters { background: none; border: 0; box-shadow: none; }
#module-calendar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
#module-calendar button, #module-calendar .button { padding: 8px 12px; border: 1px solid var(--panel-border); border-radius: 6px; font: inherit; color: inherit; background: var(--panel-bg, #fff); }

/* Map menu: only search plus configured context tabs. Categories stay in the panel. */
body[data-jmos-public-experience="map"] .jmos-public-rail {
  inset: calc(12px + env(safe-area-inset-top)) auto auto 12px;
  width: auto; max-width: calc(100vw - 24px); height: 52px;
  padding: 4px; flex-direction: row; border: 1px solid var(--panel-border);
  border-radius: 8px; overflow: visible;
}
body[data-jmos-public-experience="map"] .jmos-public-rail__group {
  display: flex; flex: 0 0 auto; flex-direction: row; gap: 4px; padding: 0;
}
body[data-jmos-public-experience="map"] .jmos-public-rail .jmos-public-action {
  flex: 0 0 44px; width: 44px; height: 44px;
}
body[data-jmos-public-experience="map"] .jmos-public-rail .jmos-public-action__label {
  inset: calc(100% + 8px) auto auto 0; transform: none;
}
body[data-jmos-public-experience="map"] .jmos-public-panel {
  inset: calc(76px + env(safe-area-inset-top)) auto 12px 12px;
  width: min(370px, calc(100vw - 24px)); height: auto;
}
body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-panel {
  top: calc(76px + env(safe-area-inset-top)); max-height: calc(100dvh - 88px - env(safe-area-inset-top));
}
.jmos-public-map-filters { margin-top: 16px; }
.jmos-public-map-filters details { padding: 12px 0; border-top: 1px solid var(--panel-border); }
.jmos-public-map-filters summary { cursor: pointer; font-weight: 600; }
.jmos-public-map-filters details > div { margin-top: 12px; }
@media (max-width: 767px) {
  body[data-jmos-public-experience="map"] .jmos-public-panel {
    inset: auto 0 0; width: 100%; max-height: calc(100dvh - 88px - env(safe-area-inset-top));
  }
  body[data-jmos-public-experience="map"] .jmos-shared-map-shell .showcase-panel {
    top: auto; max-height: 66dvh;
  }
}
.jmos-public-map-filters .regional-tour-panel {
  position: static; inset: auto; width: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
}
@media (max-width: 767px) {
  body[data-jmos-public-experience="map"] .map-userbar { top: calc(76px + env(safe-area-inset-top)); }
}

/* Delivery-selected vertical rail; other deliveries keep their current layout. */
body[data-jmos-map-navigation-layout="vertical"] .jmos-public-rail {
  inset: calc(12px + env(safe-area-inset-top)) auto auto 12px;
  width: 60px; height: auto; max-height: calc(100dvh - 24px - env(safe-area-inset-top));
  flex-direction: column; align-items: center;
}
body[data-jmos-map-navigation-layout="vertical"] .jmos-public-rail__group { flex-direction: column; }
body[data-jmos-map-navigation-layout="vertical"] .jmos-public-rail__logo { margin: 0 0 6px; min-height: 48px; }
body[data-jmos-map-navigation-layout="vertical"] .jmos-public-rail .jmos-public-action__label {
  inset: 50% auto auto calc(100% + 12px); transform: translateY(-50%);
}
body[data-jmos-map-navigation-layout="vertical"] .jmos-public-panel {
  inset: calc(12px + env(safe-area-inset-top)) auto 12px 84px;
  width: min(370px, calc(100vw - 96px)); max-height: none;
}
body[data-jmos-map-navigation-layout="vertical"] .map-userbar { top: calc(12px + env(safe-area-inset-top)); max-width: calc(100vw - 96px); }
@media (max-width: 767px) {
  body[data-jmos-map-navigation-layout="vertical"] .jmos-public-panel {
    inset: auto 12px 12px 84px; width: calc(100vw - 96px); max-height: 66dvh;
  }
}

/* On-demand timetable in the existing Mobility register. */
#module-mobility label {display:block;font-weight:600;margin:12px 0;}
#module-mobility select, #module-mobility .jmos-directions button {min-height:48px;width:100%;font:inherit;padding:10px;margin:4px 0;}
#module-mobility .jmos-directions button[aria-pressed="true"] {outline:3px solid currentColor;outline-offset:-3px;}
#module-mobility .jmos-departures {list-style:none;padding:0;}
#module-mobility .jmos-departures li {padding:12px 0;border-bottom:1px solid #aaa;}
#module-mobility .jmos-departures strong {font-size:1.4em;margin-right:12px;}
