/* Sobat Transum brand-aligned controls. Transport data, map internals,
   operator identities and route-colored components are deliberately excluded. */
/* The legend and estimation details stay in the DOM for existing map logic,
   while the oversized overlays requested by the user are not displayed. */
.app .map-shell > #legend.map-legend { display: none !important; }
.app .map-shell > #estimateNote.estimate-note { display: none !important; }
.sidebar > .side-foot { display: none !important; }

/* The creator signature lives in the scrollable panel on phones, and in the
   sidebar footer on desktop; it never overlays the map or bottom navigation. */
.sidebar .developer-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--st-ui-muted);
  font-size: 10px;
  line-height: 1.4;
  font-weight: 550;
}
.sidebar .developer-credit--mobile { display: none; }
.sidebar .developer-credit--desktop {
  margin: 0 16px;
  padding: 5px 0 9px;
  border-top: 1px solid var(--st-ui-border);
}
.sidebar .developer-credit a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 7px;
  color: var(--st-ui-blue-text);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}
.sidebar .developer-credit a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sidebar .developer-credit a:focus-visible { outline: 3px solid var(--st-ui-focus); outline-offset: 2px; }
.sidebar .developer-credit svg { width: 14px; height: 14px; flex: none; }

@media (max-width: 820px) {
  .sidebar .developer-credit--desktop { display: none; }
  .sidebar .developer-credit--mobile {
    display: flex;
    margin: 20px 0 4px;
    padding: 6px 0 3px;
    border-top: 1px solid var(--st-ui-border);
  }
  .sidebar .developer-credit--mobile a { min-height: 44px; }
}

/* Preserve map status for assistive technology but remove visual map chrome. */
.map-status-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* The verbose Leaflet attribution is replaced with a collapsible, linked
   source-credit control. Source/licence links remain available on the map. */
.map-shell #map .leaflet-control-attribution { display: none !important; }
.map-shell > .map-credits {
  position: absolute;
  z-index: 440;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  background: #fffffff0;
  box-shadow: 0 2px 9px #10205212;
  color: #46556e;
  font-size: 10px;
  line-height: 1.4;
}
.map-shell > .map-credits summary {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  list-style: none;
  border-radius: 8px;
  color: #102052;
  font-size: 17px;
  cursor: pointer;
}
.map-shell > .map-credits summary::-webkit-details-marker { display: none; }
.map-shell > .map-credits summary:focus-visible { outline: 3px solid #148ff5; outline-offset: 2px; }
.map-shell > .map-credits .map-credits-content a { color: #365978; text-decoration: underline; text-underline-offset: 2px; }
.map-shell > .map-credits:not([open]) { padding: 2px; }
.map-shell > .map-credits:not([open]) .map-credits-content { display: none; }

.sidebar {
  --st-control-ink: #102052;
  --st-control-blue: #148ff5;
  --st-control-muted: #67748c;
  --st-control-surface: #fff;
  --st-control-soft: #eef6ff;
  --st-control-border: #c8d9ec;
  --st-control-ease: cubic-bezier(.22, 1, .36, 1);
}

.sidebar .nav-tab { color: #536581; border-radius: 11px; }
.sidebar .nav-tab.active {
  color: var(--st-control-ink);
  background: var(--st-control-surface);
  box-shadow: inset 0 -2px 0 var(--st-control-blue), 0 2px 8px #10205212;
}
.sidebar .nav-tab:not(.active):hover { color: var(--st-control-ink); background: #e8f1fd; }

.sidebar .plan-submit {
  min-height: 44px;
  border-radius: 13px;
  background: var(--st-control-ink);
  color: #fff;
  box-shadow: 0 5px 13px #10205222;
}
.sidebar .plan-submit:hover:not(:disabled) { background: #102052; box-shadow: 0 8px 18px #10205238; }
.sidebar .plan-submit:active:not(:disabled) { transform: scale(.98); }
.sidebar .plan-submit[aria-busy="true"] { position: relative; cursor: progress; color: transparent; }
.sidebar .plan-submit[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: calc(50% - 8px);
  top: calc(50% - 8px);
  border: 2px solid #ffffff70;
  border-top-color: #fff;
  border-radius: 50%;
  animation: st-control-loading .7s linear infinite;
}
@keyframes st-control-loading { to { rotate: 360deg; } }

.sidebar .round-btn,
.sidebar .stage2-filter-arrow,
.sidebar .stage2-search-clear {
  color: var(--st-control-ink);
  background: var(--st-control-surface);
  border-color: var(--st-control-border);
}
.sidebar .round-btn:hover:not(:disabled),
.sidebar .stage2-filter-arrow:hover:not(:disabled),
.sidebar .stage2-search-clear:hover:not(:disabled) {
  color: var(--st-control-ink);
  background: var(--st-control-soft);
  border-color: var(--st-control-blue);
}
.sidebar .stage2-filter-arrow { min-width: 40px; flex-basis: 40px; min-height: 42px; }
.sidebar .stage2-filter-arrow:disabled { opacity: .55; color: var(--st-control-muted); background: #f2f5f9; }
.sidebar :is(.plan-submit, .round-btn, .stage2-search-clear):disabled { opacity: .58; cursor: not-allowed; box-shadow: none; transform: none; }
.sidebar .stage2-search-clear { width: 40px; height: 40px; right: 6px; top: 6px; }
.sidebar .filter-chip:not(.active) { color: var(--st-control-ink); border-color: #dce4ee; }
.sidebar .filter-chip:not(.active):hover { background: var(--st-control-soft); }
.sidebar .search-wrap input:focus { border-color: var(--st-control-blue); box-shadow: 0 0 0 3px #148ff524; }

.map-shell .selected-route-panel .stage2-route-back {
  color: #102052;
  background: #eef6ff;
  border-color: #c8d9ec;
}
.map-shell .selected-route-panel .stage2-route-back:hover { background: #e1efff; }
.sidebar .stage3-sheet-grip { color: var(--st-control-ink); }
.sidebar .stage3-sheet-handle { background: #829fc0; }

.map-shell > .map-controls button {
  color: #102052;
  background: #fffffff2;
  box-shadow: 0 4px 14px #1020521a;
}
.map-shell > .map-controls button:hover:not(:disabled) { color: #102052; background: #eef6ff; }
.map-shell > .map-layer-panel input[type="checkbox"] { accent-color: #102052; }
.map-shell .selected-route-panel .route-focus-close,
.map-shell .selected-route-panel .route-focus-center {
  color: #102052;
  border-color: #c8d9ec;
  background: #fff;
}
.map-shell .selected-route-panel .route-focus-center:hover { color: #102052; background: #eef6ff; }
.mobile-panel-toggle { color: #102052; border-color: #c8d9ec; }
.mobile-panel-toggle:hover { background: #eef6ff; }
.quick-wins-help-dialog .quick-wins-help-close {
  min-width: 44px;
  min-height: 44px;
  color: #102052;
  background: #eef6ff;
  border-color: #c8d9ec;
}
.quick-wins-help-dialog .quick-wins-help-close:hover { background: #e1efff; }

/* Scope keyboard treatment to app controls only; do not target Leaflet,
   SVG, canvas, route markers or other graphical map elements. */
.sidebar :is(button, input, select, summary):focus-visible,
.map-shell > .map-controls button:focus-visible,
.map-shell .selected-route-panel button:focus-visible,
.mobile-panel-toggle:focus-visible,
.quick-wins-help-dialog button:focus-visible {
  outline: 3px solid #148ff5 !important;
  outline-offset: 3px !important;
}
.map-shell > .map-controls button:focus-visible { box-shadow: 0 0 0 4px #e7f3ff !important; }

@media (max-width: 820px) {
  /* Keep small-screen credits compact when expanded. */
  .map-shell > .map-credits[open] { max-width: calc(100vw - 24px); }
  .map-shell > .map-credits .map-credits-content { flex: 1; min-width: 0; }
  .sidebar .stage2-filter-arrow { min-width: 40px; flex-basis: 40px; height: 42px; }
  .sidebar .stage2-search-clear { top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar .plan-submit,
  .sidebar .nav-tab,
  .sidebar .round-btn,
  .sidebar .stage2-filter-arrow,
  .sidebar .stage2-search-clear,
  .mobile-panel-toggle { transition: none !important; }
  .sidebar .plan-submit[aria-busy="true"]::after { animation: none; }
}
