/* Bus-specific controls layered on the same workspace, type scale and surfaces as Trip. */
.bus-workspace{flex:1;min-height:0}
.bus-workspace .brand-mark{width:28px;height:28px;border-radius:8px;font-size:19px}
.bus-workspace .sidebar-scroll{overflow-y:auto;scrollbar-width:none}
.bus-workspace .editor-column{overflow-y:auto;scrollbar-width:none}
.bus-workspace .sidebar-footer{flex-direction:column;align-items:flex-start;gap:5px}
.bus-workspace .sidebar-footer .legal-links{display:grid;gap:1px;margin:0;text-align:left;font-size:9px;line-height:1.45;color:var(--subtle)}
.bus-workspace .sidebar-footer .legal-links a:hover{color:var(--accent)}
.bus-search-form{margin-top:17px}
.bus-search-form .search-row{display:flex;gap:5px}
.bus-search-form :is(#searchCity,.search-city){width:52px;flex:none}
.bus-search-form :is(#lineQuery,.search-query){min-width:0;flex:1}
.bus-search-form .button{padding:8px 11px;font-size:11px}
.inline-status{font-size:11px;line-height:1.7;color:var(--muted);margin-top:9px;overflow-wrap:anywhere}
.inline-status:empty{display:none}
.inline-status.error{color:var(--danger)}
.inline-status.success{color:var(--accent)}
.line-results{max-height:290px;overflow:auto;scrollbar-width:none;margin-top:8px}
.result-card{display:flex;align-items:center;gap:10px;width:100%;padding:10px 2px;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;transition:background .18s,border-color .18s}
.result-card:hover,.result-card:focus-visible{background:var(--paper);outline:none}
.result-card>div{min-width:0;flex:1}
.result-card strong{display:block;font-size:13px;font-weight:550;line-height:1.5;overflow-wrap:anywhere}
.result-card small{display:block;color:var(--muted);font-size:10px;line-height:1.5;margin-top:3px;overflow-wrap:anywhere}
.route-thumb{width:44px;height:44px;flex:none;padding:3px;border-radius:7px;background:var(--surface-subtle)}
.route-thumb polyline{fill:none;stroke:var(--route-color,var(--accent));stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}
.route-thumb.directional line{fill:none;stroke:var(--route-color,var(--accent));stroke-width:3.5;stroke-linecap:butt}
.route-thumb .direction-start{fill:var(--route-color,var(--accent));stroke:none}
.route-list{display:grid;gap:12px}
.route-card{position:relative;min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:9px;transition:background .15s,border-color .15s,box-shadow .15s}
.route-card.selected{border-color:var(--route-color);background:color-mix(in srgb,var(--route-color) 5%,var(--surface))}
.route-card.is-hidden .route-open{opacity:.45}
.route-card-head{display:flex;align-items:center;gap:6px;padding:11px 11px 7px}
.route-open{display:flex;align-items:center;gap:9px;flex:1;min-width:0;padding:0;background:transparent;text-align:left}
.route-open>div{flex:1;min-width:0}
.route-open strong{display:block;font-size:12px;font-weight:550;line-height:1.55;overflow-wrap:anywhere}
.route-open small{display:block;margin-top:3px;color:var(--muted);font-size:10px;line-height:1.5;overflow-wrap:anywhere}
.route-open .city-badge{margin-left:4px;font-size:9px}
.route-card .route-thumb{width:35px;height:39px;padding:2px}
.drag-handle{padding:4px;color:var(--subtle);background:transparent;cursor:grab;font-size:16px;letter-spacing:-3px}
.drag-handle:active{cursor:grabbing}
.route-ends{padding:0 12px 7px;color:var(--muted);font-size:10px;line-height:1.6;overflow-wrap:anywhere}
.route-card-tools{display:flex;align-items:center;gap:15px;padding:5px 12px 10px;border-top:1px solid var(--line-soft)}
.route-card-tools button{padding:3px 0;background:transparent;color:var(--muted);font-size:11px}
.route-card-tools button:hover{color:var(--accent);text-decoration:underline}
.route-card-tools .remove-route{margin-left:auto}
.route-card input[type=color]{width:17px;height:17px;padding:0;border:0;border-radius:50%;overflow:hidden;background:transparent;cursor:pointer}
.route-card input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.route-card input[type=color]::-webkit-color-swatch{border:0;border-radius:50%}
.route-card input[type=checkbox],.batch-tools input{width:15px;height:15px;accent-color:var(--accent)}
.route-ghost{opacity:.3}.route-chosen{box-shadow:0 3px 12px #00000012}
.batch-tools{display:flex;align-items:center;justify-content:space-between;margin:0 0 14px;font-size:11px}
.batch-tools label{display:flex;align-items:center;gap:7px}
.batch-tools button{font-size:11px}
.bus-empty{display:grid;place-items:center;padding:34px 10px;text-align:center;color:var(--muted);line-height:1.8}
.bus-empty svg{width:35px;height:35px;margin-bottom:14px;stroke:var(--accent);fill:none;stroke-width:1.5}
.bus-empty strong{font-size:13px;font-weight:500;color:var(--ink)}
.bus-empty p{max-width:210px;margin-top:7px;font-size:11px}
.selection-panel{margin-top:17px;padding-top:15px;border-top:1px solid var(--line);animation:small-reveal .2s ease both}
.selection-panel h2{font-size:14px}.muted-copy{font-size:11px;line-height:1.7;color:var(--muted)}
.stop-selects{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}
.stop-selects label{display:grid;gap:6px;min-width:0;color:var(--muted);font-size:10px}
.stop-selects select{padding:8px 5px;font-size:11px;text-overflow:ellipsis}
.selection-stops{list-style:none;max-height:235px;overflow:auto;scrollbar-width:none;margin:11px 0;padding:4px 0}
.selection-stops li{margin:0;padding:0}.selection-stops button{display:flex;align-items:center;gap:10px;width:100%;padding:8px;background:transparent;border-radius:6px;text-align:left;color:var(--muted);font-size:11px;transition:background .18s,color .18s}
.selection-stops button:hover,.selection-stops button.hovered{background:var(--accent-pale)}
.selection-stops button span{display:grid;place-items:center;flex:none;width:21px;height:21px;border:1px solid var(--line);border-radius:50%;background:var(--surface);font-size:9px}
.selection-stops li.in-range button{color:var(--ink)}
.selection-stops li.endpoint button span{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.selection-stops small{margin-left:auto;color:var(--accent);font-size:9px}
.selection-summary{padding-top:9px;color:var(--accent);font-size:11px;line-height:1.6}
.line-appearance{margin-top:20px;padding-top:17px;border-top:1px solid var(--line)}
.line-appearance h2{font-size:14px}.line-appearance .text-button{font-size:11px}
.color-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px;color:var(--muted);font-size:11px}
.custom-color{display:flex;align-items:center;gap:7px}.custom-color input[type=color]{width:28px;height:27px;padding:3px}.custom-color input[type=text],#routeColorText{width:80px;padding:6px;font-size:11px;text-transform:uppercase}
.route-color-swatches{display:flex;flex-wrap:wrap;gap:8px}.route-color-swatch{display:grid;place-items:center;width:22px;height:22px;padding:0;border:3px solid var(--surface);border-radius:50%;background:var(--swatch);box-shadow:0 0 0 1px var(--line);transition:transform .18s,box-shadow .18s}.route-color-swatch:hover{transform:translateY(-2px)}.route-color-swatch[aria-pressed=true]{box-shadow:0 0 0 2px var(--accent)}.route-color-swatch svg{width:14px;height:14px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.style-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 10px;color:var(--muted);font-size:11px}
.segmented{display:flex;gap:2px;padding:3px;border:1px solid var(--line);border-radius:7px;background:var(--paper)}.segmented button{display:flex;align-items:center;gap:6px;padding:6px 9px;border-radius:4px;background:transparent;color:var(--muted);font-size:10px}.segmented button[aria-pressed=true]{background:var(--surface);box-shadow:0 1px 3px #0001;color:var(--accent)}.segmented i{width:17px;border-top:2px solid}.segmented .dashed{border-top-style:dashed}
.range-pair{display:grid;grid-template-columns:1fr 1fr;gap:16px}.range-row{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:4px 8px;margin:13px 0;color:var(--muted);font-size:11px}.range-row output{grid-column:2;text-align:right;font-size:10px;font-variant-numeric:tabular-nums}.range-row input[type=range]{grid-column:1/-1;width:100%;height:18px;padding:0;accent-color:var(--accent);box-shadow:none}.line-sample{display:flex;align-items:center;height:25px;padding:0 3px}.line-sample i{display:block;width:100%;border-top:6px solid var(--accent);transition:border-color .2s,border-width .2s}
.edit-route-meta{margin:15px 0;color:var(--muted);font-size:11px;line-height:1.8}.edit-order{display:flex;gap:8px}.edit-order .button{flex:1;font-size:11px}.station-details{margin-top:18px}.station-details summary{display:flex;justify-content:space-between;color:var(--ink);font-size:12px;cursor:pointer}.station-details summary span{color:var(--muted);font-size:10px}
.map-fallback .text-button{display:block;margin-top:12px}.map-point-details{position:absolute;z-index:35;right:18px;bottom:18px;max-width:280px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);box-shadow:0 3px 15px #0002;font-size:11px;line-height:1.6}
.bus-app .map-point-details>strong{line-height:1.4}
.bus-app .map-point-details p{line-height:1.4;margin:3px 0 0}
.bus-station{width:10px;height:10px;border:2px solid var(--route-color);border-radius:50%;background:#fff;transition:transform .18s,box-shadow .18s}.bus-station.hovered{transform:scale(1.6);box-shadow:0 0 0 4px color-mix(in srgb,var(--route-color) 18%,transparent)}.bus-station.endpoint{width:13px;height:13px;border-width:3px}.station-label{padding:3px 6px;border-radius:4px;background:var(--surface);color:var(--ink);box-shadow:0 1px 4px #0002;white-space:nowrap;font-size:11px}.map-route-label{padding:4px 7px;border:2px solid #fff;border-radius:6px;box-shadow:0 1px 4px #0002;white-space:nowrap;font-size:11px;font-weight:550}
.old-bus-link{color:var(--accent)}
.bus-list-compact .sidebar .sidebar-scroll{padding-top:16px;padding-bottom:16px}.bus-list-compact .sidebar .trip-head{padding:16px}.bus-list-compact .sidebar .trip-stats{margin-top:15px;padding-top:13px}.bus-list-compact .sidebar .timeline-section{padding-top:18px}.bus-list-compact .sidebar .section-heading{margin-bottom:11px}.bus-list-compact .sidebar .route-list{gap:7px}.bus-list-compact .sidebar .route-card-head{padding-top:8px}.bus-list-compact .sidebar .route-ends{padding-bottom:5px}.bus-list-compact .sidebar .route-card-tools{padding-bottom:7px}
/* Phone panels have their own sizing; desktop keeps the shared Trip template. */
.bus-workspace>.map-panel{isolation:isolate}
.bus-app .topbar .brand-mark{width:28px;height:28px;font-size:17px;letter-spacing:-.06em;border-radius:8px}
.bus-workspace .editor-column>#addFooter{margin:0 20px 18px}
.undo-bar{position:fixed;z-index:190;bottom:20px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:16px;width:max-content;max-width:calc(100% - 28px);padding:10px 14px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:0 4px 20px #0002;font-size:12px}
.undo-bar>span{min-width:0;overflow-wrap:anywhere}.undo-bar>button{min-height:36px;background:transparent;flex:none}
.bus-app .modal{overscroll-behavior:contain}
@media(max-width:900px){
  html:has(.bus-app),.bus-app{height:100%;overflow:hidden}
  .bus-app .app-shell{height:100vh;height:var(--bus-viewport-height,100dvh);overflow:hidden}
  .bus-app .topbar{height:calc(56px + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));gap:8px}
  .bus-app .brand{font-size:13px;gap:7px;white-space:nowrap}
  .bus-app .save-state,.bus-app .old-bus-link{display:none}
  .bus-app .topbar-actions{gap:5px}
  .bus-app .topbar-actions .button{min-width:44px;min-height:44px;padding:9px;font-size:12px}
  .bus-app .settings-entry{justify-content:center}
  .bus-app .settings-entry span{display:none}
  .bus-workspace{height:auto;min-height:0;overflow:hidden;grid-template-columns:minmax(0,1fr);grid-template-rows:clamp(160px,30dvh,280px) 48px minmax(0,1fr)}
  .bus-workspace>.map-panel{grid-column:1;grid-row:1;min-height:0}
  .bus-workspace>.sidebar,.bus-workspace>.editor-column{grid-column:1;grid-row:3;min-height:0;min-width:0;border:0;overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}
  .bus-workspace>.sidebar{display:flex}
  .bus-workspace>.editor-column{display:flex;flex-direction:column}
  .bus-workspace[data-mobile-pane=editor]>.sidebar,.bus-workspace[data-mobile-pane=list]>.editor-column{display:none}
  .bus-workspace .sidebar-scroll,.bus-workspace .editor{min-height:0;min-width:0;flex:1;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:18px max(16px,env(safe-area-inset-right)) 18px max(16px,env(safe-area-inset-left));scroll-padding-block:18px}
  .bus-workspace .editor{animation:small-reveal .2s ease both}
  .bus-workspace .editor-column>#addFooter{flex:none;margin:0;padding:10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));gap:5px;border-top:1px solid var(--line);background:var(--surface);box-shadow:0 -4px 16px #00000006}
  .bus-workspace #appendFeedback{margin:0;font-size:12px}
  .bus-workspace .sidebar-footer{flex:none;padding:6px 16px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:center}
  .bus-workspace .sidebar-footer .legal-links{justify-self:end;font-size:9px;line-height:1.6}
  .bus-workspace .editor-heading h1{font-size:18px}
  .bus-workspace .editor-heading .section-kicker{display:none}
  .bus-workspace .editor-index{font-size:24px}
  .bus-workspace .editor-heading{align-items:center}
  .bus-workspace input:not([type=checkbox]):not([type=color]):not([type=range]),.bus-workspace select{font-size:16px;min-height:44px}
  .bus-workspace .trip-title{font-size:22px}
  .bus-search-form{margin-top:14px}
  .bus-search-form :is(#searchCity,.search-city){width:68px;padding:9px 7px}
  .bus-search-form :is(#lineQuery,.search-query){padding:9px 8px}
  .bus-search-form .button{font-size:13px;padding:8px 12px;min-height:44px}
  .bus-workspace .text-button{min-height:40px;font-size:12px}
  .bus-workspace .section-heading{gap:12px;margin-bottom:12px}
  .bus-workspace .append-option{min-height:46px;padding:10px 0;font-size:13px}
  .bus-workspace .append-option input{width:18px;height:18px}
  .bus-workspace .line-results,.bus-workspace .selection-stops{max-height:none;overflow:visible}
  .result-card{padding:12px 4px;min-height:72px}
  .result-card strong{font-size:14px}.result-card small{font-size:12px}
  .bus-workspace .selection-panel{margin-top:10px;padding-top:10px}
  .bus-workspace .selection-panel h2{min-width:0;overflow-wrap:anywhere}
  .bus-workspace .selection-stops button{min-height:44px;font-size:13px;padding:9px 6px}
  .bus-workspace .selection-stops button span{width:24px;height:24px;font-size:10px}
  .bus-workspace .selection-stops small{flex:none;font-size:11px}
  .bus-workspace .muted-copy,.bus-workspace .inline-status,.bus-workspace .selection-summary{font-size:12px}
  .bus-workspace .line-appearance{margin-top:14px;padding-top:12px}
  .bus-workspace .color-heading,.bus-workspace .style-row,.bus-workspace .range-row{font-size:12px}
  .bus-workspace .custom-color input[type=color]{width:40px;height:40px}
  .bus-workspace #routeColorText{width:104px;font-size:16px}
  .bus-workspace .route-color-swatches{gap:2px}
  .bus-workspace .route-color-swatch{width:40px;height:40px;border:9px solid var(--surface);box-shadow:none;background-clip:padding-box}
  .bus-workspace .route-color-swatch[aria-pressed=true]{outline:1px solid var(--accent);outline-offset:-5px}
  .bus-workspace .segmented button{min-height:40px;font-size:12px;padding:8px 12px}
  .bus-workspace .range-row input[type=range]{height:32px}
  .bus-workspace .route-card-tools{gap:12px;padding:3px 10px}
  .bus-workspace .route-card-tools button{min-width:44px;min-height:44px;font-size:12px}
  .bus-workspace .route-card input[type=color]{width:28px;height:28px}
  .bus-workspace .drag-handle{min-width:40px;min-height:44px;touch-action:none}
  .bus-workspace .route-open strong{font-size:14px}.bus-workspace .route-open small,.bus-workspace .route-ends{font-size:12px}
  .bus-workspace .trip-head{padding:16px}.bus-workspace .trip-head .trip-stats{margin-top:8px;padding-top:10px}
  .bus-workspace .trip-head .trip-title{min-height:32px;margin-bottom:3px}
  .bus-workspace .trip-head .section-kicker{margin-bottom:5px}
  .bus-workspace .trip-head .text-button{min-height:32px}
  .bus-workspace .trip-meta-row{flex-wrap:wrap}.bus-workspace #citySummary{overflow-wrap:anywhere;min-width:0;flex:1}
  .bus-workspace .map-topbar{top:10px;right:max(10px,env(safe-area-inset-right));left:10px}
  .bus-workspace .map-control{min-height:44px;padding:9px 12px}
  .bus-workspace .map-panel.is-fullscreen{height:100vh;height:var(--bus-viewport-height,100dvh);z-index:80}
  .bus-workspace .map-panel.is-fullscreen .map-topbar{top:calc(10px + env(safe-area-inset-top))}
  .bus-workspace .map-point-details{left:12px;right:62px;bottom:32px;max-width:none;max-height:95px;overflow:auto;padding:8px 10px}
  .bus-workspace .map-fallback{top:15%;left:12px;right:12px;padding:12px}
  .bus-app .modal-root{padding:12px}
  .bus-app .modal{max-height:calc(var(--bus-viewport-height,100dvh) - 24px);padding:20px;width:100%}
  .bus-app .modal-close{min-width:44px;min-height:44px;font-size:22px}
  .bus-app .modal-actions .button{min-height:44px}
  .bus-app .settings-root{padding:0}
  .bus-app .settings-root .modal{height:var(--bus-viewport-height,100dvh);max-height:var(--bus-viewport-height,100dvh);width:min(480px,100%);padding:0}
  .bus-app .settings-header{flex:none;padding:calc(16px + env(safe-area-inset-top)) 20px 0}
  .bus-app .settings-header .modal-head{margin-bottom:16px}
  .bus-app .settings-body{padding:6px 20px 20px;overscroll-behavior:contain}
  .bus-app .settings-footer{flex:none;padding:12px 20px calc(12px + env(safe-area-inset-bottom));flex-wrap:wrap}
  .bus-app .settings-footer a{margin-left:auto;min-height:32px;display:flex;align-items:center}
  .bus-app .settings-body select,.bus-app .settings-body input:not([type=checkbox]):not([type=color]){font-size:16px;min-height:44px}
  .bus-app .theme-color-options{gap:10px}
  .bus-app .theme-color-option{width:36px;height:36px}
  .bus-app .toast{bottom:calc(82px + env(safe-area-inset-bottom));font-size:13px}
  .bus-app .undo-bar{bottom:calc(14px + env(safe-area-inset-bottom))}
  .mobile-keyboard .bus-workspace{grid-template-rows:88px 44px minmax(0,1fr)}
}
@media(max-width:900px) and (max-height:450px) and (orientation:portrait){
  .bus-workspace{grid-template-rows:96px 44px minmax(0,1fr)}
}
/* In a short landscape viewport keep the map beside, rather than above, the panel. */
@media(max-width:900px) and (max-height:500px) and (orientation:landscape){
  .bus-workspace{grid-template-columns:minmax(0,1fr) minmax(320px,1fr);grid-template-rows:46px minmax(0,1fr)}
  .bus-workspace>.map-panel{grid-column:1;grid-row:1/-1}
  .bus-workspace>.sidebar,.bus-workspace>.editor-column{grid-column:2;grid-row:2}
}
@media(prefers-reduced-motion:reduce){.result-card,.route-card,.route-color-swatch,.line-sample i{transition:none}}
/* Search by line or by boarding point, in the same editor. */
.search-mode{width:max-content;margin-bottom:10px}
.search-mode button{min-width:66px;justify-content:center;font-size:12px;transition:background .2s,color .2s,box-shadow .2s}
.station-result{padding:12px 0;border-bottom:1px solid var(--line-soft);border-radius:7px;transition:background .2s;animation:small-reveal .22s ease both}
.station-result.hovered,.station-result:focus-within{background:var(--accent-pale)}
.station-result-head{display:flex;align-items:center;gap:9px;width:100%;padding:3px 5px;background:transparent;text-align:left;color:var(--ink)}
.station-result-head>span:nth-child(2){flex:1;min-width:0}
.station-result-head strong{display:block;font-size:13px;line-height:1.5;font-weight:550;overflow-wrap:anywhere}
.station-result-head small{display:block;font-size:10px;color:var(--muted);margin-top:2px}
.station-number{flex:none;display:inline-grid;place-items:center;width:25px;height:25px;background:var(--accent-pale);border:1px solid var(--line);color:var(--accent);border-radius:50%;font-size:11px;font-variant-numeric:tabular-nums}
.station-chevron{font-size:22px;color:var(--muted);padding-right:3px;transition:transform .2s}
.station-result-head:hover .station-chevron{transform:translateX(2px)}
.station-line-chips{display:flex;flex-wrap:wrap;gap:5px;margin:10px 5px 0}
.station-line-chip{padding:3px 6px;max-width:100%;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--muted);font-size:10px;line-height:1.45;overflow-wrap:anywhere}
.station-result-head:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:5px}
.station-context{margin-top:12px;animation:small-reveal .22s ease both}
.station-context>button{font-size:11px;margin-bottom:7px}
.station-context>div{display:flex;align-items:center;gap:8px}
.station-context strong{min-width:0;flex:1;font-size:13px;font-weight:550;overflow-wrap:anywhere}
.station-context>div>button{font-size:11px;flex:none}
.more-stations{display:block;width:100%;margin:8px 0;font-size:11px;min-height:32px}
.route-placeholder{display:grid;place-items:center}
.route-placeholder svg{width:23px;height:23px;fill:none;stroke:var(--muted);stroke-width:1.5}
.result-card.is-loading{cursor:wait;opacity:.6}.result-card.load-failed small:last-child{color:var(--danger)}
.search-station-marker{position:relative;display:grid;place-items:center;width:32px;height:32px;padding:0;overflow:visible;background:transparent;border:0;cursor:pointer;color:var(--ink);font-family:inherit}
.search-station-dot{display:grid;place-items:center;width:25px;height:25px;border:2px solid var(--surface);border-radius:50%;background:var(--accent);color:var(--on-accent);font-size:11px;font-weight:600;box-shadow:0 1px 6px #0003;transition:transform .22s cubic-bezier(.2,.8,.2,1),box-shadow .22s}
.search-station-label{position:absolute;bottom:calc(100% + 9px);left:50%;width:max-content;max-width:230px;padding:9px 11px;text-align:left;border:1px solid var(--line);border-radius:8px;background:var(--surface);box-shadow:0 4px 18px #0002;opacity:0;visibility:hidden;transform:translate(-50%,5px);transition:opacity .2s,transform .2s,visibility .2s;pointer-events:none;white-space:normal}
.search-station-label strong{display:block;font-size:12px;margin-bottom:4px;font-weight:600}
.search-station-label>span{display:block;font-size:11px;line-height:1.7;color:var(--muted);overflow-wrap:anywhere}
.search-station-marker.active .search-station-dot{transform:scale(1.25);box-shadow:0 0 0 5px color-mix(in srgb,var(--accent) 16%,transparent),0 2px 7px #0003}
.search-station-marker.active .search-station-label{opacity:1;visibility:visible;transform:translate(-50%,0)}
.search-station-marker:focus-visible{outline:none}.search-station-marker:focus-visible .search-station-dot{outline:2px solid var(--ink);outline-offset:3px}
@media(max-width:900px){
  .search-mode{margin-bottom:9px}
  .bus-workspace .search-mode button{min-width:80px;min-height:40px;font-size:13px}
  .station-result{padding:12px 0}
  .station-result-head{min-height:44px}.station-result-head strong{font-size:14px}.station-result-head small{font-size:12px}
  .station-number{width:28px;height:28px;font-size:12px}
  .station-line-chips{gap:7px;margin-top:9px}
  .station-line-chip{padding:4px 7px;font-size:11px}
  .station-context strong{font-size:14px}.station-context>button{margin-bottom:2px}
  .search-station-marker{width:40px;height:40px}.search-station-dot{width:28px;height:28px;font-size:12px}
  .search-station-label{max-width:200px;bottom:calc(100% + 4px);padding:6px 9px}
  .search-station-label>span{font-size:10px;line-height:1.5}
}
@media(prefers-reduced-motion:reduce){.station-result,.station-context{animation:none}.search-mode button,.station-result,.station-chevron,.search-station-dot,.search-station-label{transition:none}}

/* Desktop: a stationary editor with an overlaid route drawer from the left edge. */
.route-drawer-toggle{display:none}
@media(min-width:901px){
  .bus-workspace{position:relative;overflow:hidden;--drawer-width:338px;grid-template-columns:338px minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
  .bus-workspace>.editor-column{grid-column:1;grid-row:1}
  .bus-workspace>.editor-column .editor{padding-left:38px}
  .bus-workspace>.editor-column>#addFooter{margin-left:38px}
  .bus-workspace>.map-panel{grid-column:2;grid-row:1}
  .bus-workspace>.sidebar{position:absolute;inset:0 auto 0 0;width:var(--drawer-width);z-index:50;transform:translateX(-100%);visibility:hidden;pointer-events:none;border-right:1px solid var(--line);transition:transform .28s cubic-bezier(.22,.8,.25,1),visibility 0s .28s}
  .bus-workspace[data-drawer-open=true]>.sidebar{transform:translateX(0);visibility:visible;pointer-events:auto;box-shadow:12px 0 32px #00000018;transition-delay:0s}
  .bus-workspace>.route-drawer-toggle{position:absolute;left:0;top:50%;z-index:51;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:28px;min-height:152px;padding:12px 3px;transform:translateY(-50%);border:1px solid var(--accent-border);border-left:0;border-radius:0 10px 10px 0;background:var(--surface);color:var(--accent);box-shadow:3px 0 12px #0000000d;cursor:pointer;transition:transform .28s cubic-bezier(.22,.8,.25,1),background .18s,box-shadow .18s}
  .bus-workspace[data-drawer-open=true]>.route-drawer-toggle{transform:translate(var(--drawer-width),-50%);background:var(--accent-pale);box-shadow:5px 0 16px #00000012}
  .route-drawer-toggle:hover{background:var(--accent-pale);box-shadow:4px 0 16px #0000001a}
  .route-drawer-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  .route-drawer-toggle svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .28s}
  .route-drawer-toggle[aria-expanded=true] svg{transform:rotate(180deg)}
  .drawer-toggle-label{writing-mode:vertical-rl;letter-spacing:3px;font-size:11px;font-weight:550;line-height:1}
  .drawer-route-count{display:grid;place-items:center;min-width:19px;min-height:19px;padding:2px;border-radius:6px;background:var(--accent-pale);font-size:9px;font-variant-numeric:tabular-nums}
}
@media(min-width:901px) and (max-width:1100px){.bus-workspace{grid-template-columns:326px minmax(0,1fr);--drawer-width:326px}}
@media(min-width:1600px){.bus-workspace{grid-template-columns:360px minmax(0,1fr);--drawer-width:360px}}
@media(prefers-reduced-motion:reduce){.bus-workspace>.sidebar,.bus-workspace>.route-drawer-toggle,.route-drawer-toggle svg{transition:none}}

.drawer-toolbar{display:flex;justify-content:flex-end;flex:none;padding:10px 18px 0}
.drawer-pin{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:1px solid transparent;border-radius:6px;font-size:11px}
.drawer-pin svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round;transform:rotate(35deg)}
.drawer-pin[aria-pressed=true]{color:var(--accent);background:var(--accent-pale);border-color:var(--accent-border)}
.drawer-pin[aria-pressed=true] svg{transform:none}
/* Keep the range action aligned with the search mode control. */
.search-tools{display:flex;align-items:stretch;gap:8px;margin-bottom:10px}
.search-tools .search-mode{flex:none;margin:0}
.bus-workspace .search-tools .search-mode button{min-width:58px;min-height:32px;font-size:12px;justify-content:center}
.map-stations-control{flex:1;min-width:0}
.bus-workspace .map-stations-button{width:100%;min-height:32px;padding:6px 8px;justify-content:center;font-size:12px;white-space:nowrap;transition:background .2s,color .2s}
.map-stations-button svg{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.map-stations-button:hover{background:var(--surface);color:var(--accent)}
.map-stations-button:active{background:var(--accent-pale)}
.station-retry{margin:8px 0}
.bus-station{cursor:pointer}
@media(max-width:900px){.drawer-toolbar{display:none}.bus-workspace .search-tools button{min-height:40px;font-size:12px}.bus-workspace .search-tools .search-mode button{min-width:58px;padding:8px 10px}}
@media(prefers-reduced-motion:reduce){.map-stations-button{transition:none}}

/* Compact phone workspace; desktop geometry and controls remain unchanged. */
.mobile-editor-toolbar,.mobile-drawer-backdrop{display:none}
@media(max-width:900px){
  .bus-app .topbar{height:calc(40px + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(4px,env(safe-area-inset-right)) 0 max(4px,env(safe-area-inset-left));gap:4px}
  .bus-app .brand{font-size:0;gap:0;flex:none;padding:0 4px}
  .bus-app .topbar .brand-mark{width:26px;height:26px;font-size:17px;border-radius:6px}
  .bus-app .topbar-actions{display:flex;flex:1;gap:3px}
  .bus-app .topbar-actions .button{flex:1;min-width:0;min-height:34px;padding:5px 8px;font-size:12px;border-radius:4px;justify-content:center}
  .bus-app .topbar-actions .old-bus-link{display:none}
  .bus-app .settings-entry span{display:inline}
  .bus-app .bus-workspace{position:relative;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:36px minmax(80px,1fr) clamp(352px,54.4%,448px)}
  .bus-workspace>.map-panel{grid-column:1;grid-row:2;min-height:0}
  .bus-workspace>.editor-column{grid-column:1;grid-row:3;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
  .bus-app .bus-workspace[data-mobile-pane=map],.bus-app .bus-workspace[data-mobile-pane=list]{grid-template-rows:36px minmax(0,1fr) 0}
  .bus-workspace[data-mobile-pane=map]>.editor-column,.bus-workspace[data-mobile-pane=list]>.editor-column{display:none}
  .bus-workspace>.sidebar{position:absolute;grid-area:1 / 1 / -1 / -1;inset:36px auto 0 0;width:min(360px,calc(100% - 36px));display:flex!important;z-index:54;transform:translateX(-100%);visibility:hidden;pointer-events:none;border-right:1px solid var(--line);transition:transform .22s ease,visibility 0s .22s}
  .bus-workspace[data-mobile-pane=list]>.sidebar{transform:translateX(0);visibility:visible;pointer-events:auto;box-shadow:6px 0 20px #0002;transition-delay:0s}
  .bus-workspace>.mobile-drawer-backdrop{position:absolute;inset:36px 0 0;z-index:53;display:none;background:#0003;border:0;border-radius:0}
  .bus-workspace[data-mobile-pane=list]>.mobile-drawer-backdrop{display:block}
  .bus-workspace .mobile-editor-toolbar{display:flex;flex:none;border-bottom:1px solid var(--line);min-height:32px;padding:0 6px;gap:4px;background:var(--surface)}
  .mobile-editor-toolbar button{flex:1;min-height:32px;padding:4px;background:transparent;color:var(--muted);font-size:12px;border-radius:0}
  .mobile-editor-toolbar button[aria-pressed=true]{color:var(--accent);background:var(--accent-pale)}
  .bus-workspace .editor{padding:6px 8px;animation:none;scroll-padding-block:6px}
  .bus-workspace .editor-column>#addFooter{padding:4px 8px;gap:0;box-shadow:none}
  .bus-workspace #addRoute{min-height:34px;padding:5px;font-size:13px;border-radius:4px}
  .bus-workspace #appendFeedback:empty{display:none}
  .bus-workspace #appendFeedback{font-size:11px;line-height:1.4}
  .bus-workspace #addPane>.editor-heading{display:none}
  .bus-workspace .editor-heading h1{font-size:15px}
  .bus-workspace .editor-heading{margin-bottom:6px}
  .bus-workspace .line-appearance{display:none}
  .bus-workspace[data-mobile-style=true] .line-appearance{display:block;margin:0;padding:0;border:0}
  .bus-workspace[data-mobile-style=true] #addPane,.bus-workspace[data-mobile-style=true] #editPane{display:none}
  .bus-workspace input:not([type=checkbox]):not([type=color]):not([type=range]),.bus-workspace select{min-height:36px;padding:5px 7px;font-size:16px}
  .bus-search-form{margin:0}
  .bus-search-form :is(#searchCity,.search-city){width:60px;padding:5px}
  .bus-search-form :is(#lineQuery,.search-query){padding:5px 7px}
  .bus-search-form .button{min-height:36px;padding:5px 10px;font-size:12px}
  .bus-workspace .search-tools{margin-bottom:5px;gap:5px}
  .bus-workspace .search-tools .segmented{padding:1px;border-radius:4px}
  .bus-workspace .search-tools .search-mode{flex:1}
  .bus-workspace .search-tools .search-mode button{flex:1;min-width:0;min-height:32px;padding:4px 8px;font-size:12px}
  .bus-workspace .search-tools .map-stations-button{min-height:32px;padding:4px 6px;font-size:12px}
  .bus-workspace .append-option{min-height:30px;padding:4px 0;font-size:12px}
  .bus-workspace .append-option input{width:16px;height:16px}
  .bus-workspace .text-button{min-height:32px;font-size:12px}
  .bus-workspace .section-heading{margin-bottom:4px;gap:6px}
  .bus-workspace .section-heading h2{font-size:13px}
  .bus-workspace .inline-status{margin-top:3px;font-size:11px}
  .bus-workspace .line-results{margin-top:3px}
  .bus-workspace .result-card{min-height:52px;padding:5px 2px;gap:7px}
  .bus-workspace .result-card strong{font-size:13px;line-height:1.35}
  .bus-workspace .result-card small{font-size:11px;margin-top:2px;line-height:1.4}
  .bus-workspace .result-card .route-thumb{width:34px;height:34px}
  .bus-workspace .selection-panel{margin-top:3px;padding-top:3px}
  .bus-workspace .selection-summary{padding-top:3px;font-size:11px}
  .bus-workspace .stop-selects{margin-top:5px;gap:5px}
  .bus-workspace .stop-selects label{gap:3px}
  .bus-workspace .selection-stops{margin:5px 0;padding:0}
  .bus-workspace .selection-stops button{min-height:34px;font-size:12px;padding:4px;gap:7px}
  .bus-workspace .selection-stops button span{width:21px;height:21px}
  .bus-workspace .color-heading{margin:0;gap:5px}
  .bus-workspace .custom-color input[type=color]{width:34px;height:32px;padding:2px}
  .bus-workspace #routeColorText{width:98px;min-height:32px}
  .bus-workspace .route-color-swatches{display:grid;grid-template-columns:repeat(9,1fr);gap:0;margin:3px 0}
  .bus-workspace .route-color-swatch{width:100%;height:32px;border-width:6px;max-width:36px;justify-self:center}
  .bus-workspace .style-row{margin:4px 0;gap:5px}
  .bus-workspace .segmented button{min-height:30px;padding:4px 10px;font-size:12px}
  .bus-workspace .range-pair{gap:12px}
  .bus-workspace .range-row{margin:3px 0;gap:0 4px}
  .bus-workspace .range-row input[type=range]{height:28px}
  .bus-workspace .line-sample{height:12px}
  .bus-workspace .other-name-field{margin-top:4px;gap:3px}
  .bus-workspace .edit-route-meta{margin:4px 0;font-size:11px}
  .bus-workspace .edit-order{gap:5px}
  .bus-workspace .edit-order .button{min-height:32px;padding:4px}
  .bus-workspace .station-details{margin-top:8px}
  .bus-workspace .sidebar .sidebar-scroll{padding:8px}
  .bus-workspace .sidebar .trip-head{padding:8px 10px;border-radius:5px}
  .bus-workspace .sidebar .trip-title{font-size:17px;min-height:30px;padding:0}
  .bus-workspace .sidebar .trip-stats{margin-top:4px;padding-top:5px}
  .bus-workspace .sidebar .stat strong{font-size:17px}
  .bus-workspace .sidebar .stat span{margin-top:1px;font-size:9px}
  .bus-workspace .sidebar .timeline-section{padding:8px 0 0}
  .bus-workspace .sidebar .route-list{gap:5px}
  .bus-workspace .sidebar .route-card-head{padding:5px 7px 2px}
  .bus-workspace .route-card .route-thumb{height:28px;width:28px}
  .bus-workspace .route-open strong{font-size:13px}
  .bus-workspace .route-open small,.bus-workspace .route-ends{font-size:11px;line-height:1.35}
  .bus-workspace .route-ends{padding:2px 8px 4px}
  .bus-workspace .route-card-tools{padding:0 6px;gap:5px;justify-content:space-between}
  .bus-workspace .route-card-tools button{flex:1;min-height:34px;min-width:0;font-size:11px}
  .bus-workspace .route-card input[type=color]{width:26px;height:26px}
  .bus-workspace .drag-handle{min-width:32px;min-height:34px}
  .bus-workspace .sidebar-footer{padding:3px 8px;gap:4px}
  .bus-workspace .map-topbar{top:6px;right:6px;left:6px}
  .bus-workspace .map-control{min-height:32px;padding:5px 8px;font-size:11px}
  .bus-workspace .station-result{padding:5px 0}
  .bus-workspace .station-result-head{min-height:34px}
  .bus-workspace .station-result-head strong{font-size:13px}
  .bus-workspace .station-result-head small{font-size:11px}
  .bus-workspace .station-line-chips{gap:4px;margin-top:4px}
  .bus-workspace .station-line-chip{padding:2px 4px;font-size:10px}
  .bus-workspace .station-context{margin-top:4px}
  .bus-app .settings-header{padding:calc(6px + env(safe-area-inset-top)) 12px 0}
  .bus-app .settings-header .modal-head{margin-bottom:6px}
  .bus-app .settings-header h2{font-size:18px}
  .bus-app .settings-body{padding:0 12px 10px}
  .bus-app .preference-section{padding-top:10px}
  .bus-app .preference-row{padding:9px 0;gap:8px}
  .bus-app .preference-row small{margin-top:2px;font-size:10px}
  .bus-app .settings-footer{padding:4px 12px calc(4px + env(safe-area-inset-bottom))}
  .bus-app .map-style-options{gap:5px;margin:7px 0}
  .bus-app .map-swatch{height:38px}
  .bus-app .map-style-option strong{margin:4px 0}
  .bus-app .settings-body select{min-height:36px}
  .mobile-keyboard .bus-workspace{grid-template-rows:36px 64px minmax(0,1fr)}
}
@media(max-width:900px) and (max-height:500px) and (orientation:landscape){
  .bus-app .bus-workspace{grid-template-columns:minmax(0,1fr) minmax(300px,44%);grid-template-rows:34px minmax(0,1fr)}
  .bus-workspace>.map-panel{grid-column:1;grid-row:2}
  .bus-workspace>.editor-column{grid-column:2;grid-row:2}
  .bus-app .bus-workspace[data-mobile-pane=map],.bus-app .bus-workspace[data-mobile-pane=list]{grid-template-columns:minmax(0,1fr);grid-template-rows:34px minmax(0,1fr)}
  .bus-workspace>.sidebar{top:34px}
  .bus-workspace>.mobile-drawer-backdrop{top:34px}
}
/* Phone typography and alignment: one control size, one list size. */
@media(max-width:900px){
  .bus-app .topbar{padding-inline:max(6px,env(safe-area-inset-left)) max(6px,env(safe-area-inset-right));gap:6px}
  .bus-app .topbar-actions{gap:4px}
  .bus-app .topbar-actions .button{font-size:13px;font-weight:500;border-radius:6px;min-height:32px}
  .bus-app .brand{padding:0 2px}
  .bus-workspace .mobile-editor-toolbar{padding:4px 8px;gap:4px;min-height:38px;background:var(--surface-subtle)}
  .mobile-editor-toolbar button{font-size:13px;line-height:1.4;min-height:28px;padding:4px 6px;border-radius:5px}
  .mobile-editor-toolbar button[aria-pressed=true]{font-weight:600}
  .bus-workspace .editor{padding:6px 10px}
  .bus-workspace .editor-column>#addFooter{padding:5px 10px;background:var(--surface)}
  .bus-workspace #addRoute{font-size:14px;font-weight:600;border-radius:6px;min-height:34px}
  .bus-workspace .search-tools{gap:6px;margin-bottom:6px}
  .bus-workspace .search-tools .segmented{padding:2px;border-radius:6px}
  .bus-workspace .search-tools .search-mode button,.bus-workspace .search-tools .map-stations-button{font-size:14px;line-height:20px;min-height:30px;padding:4px 6px;border-radius:4px}
  .bus-workspace .search-tools .search-mode{flex:1}
  .bus-workspace .search-tools .map-stations-control{flex:1.1}
  .bus-search-form .search-row{gap:6px;align-items:center}
  .bus-workspace input:not([type=checkbox]):not([type=color]):not([type=range]),.bus-workspace select,.bus-search-form .button{font-size:14px;font-weight:400;line-height:20px;height:36px;min-height:36px;padding:7px 8px;border-radius:6px}
  .bus-search-form :is(#searchCity,.search-city){width:60px;padding:7px 6px;text-align:center}
  .bus-search-form :is(#lineQuery,.search-query){padding:7px 8px}
  .bus-search-form .button{font-weight:500;flex:none;padding-inline:12px}
  .bus-workspace .append-option{min-height:30px;padding:5px 0;gap:7px}
  .bus-workspace .append-option span{font-size:13px;line-height:20px}
  .bus-workspace .inline-status{font-size:12px;line-height:18px;margin-top:4px}
  .bus-workspace .line-results{margin-top:2px}
  .bus-workspace .result-card{min-height:48px;padding:5px 0;gap:8px;border-radius:0}
  .bus-workspace .result-card .route-thumb{width:28px;height:28px;padding:2px;border-radius:4px}
  .bus-workspace .result-card>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 8px;align-items:baseline}
  .bus-workspace .result-card strong,.bus-workspace .result-card small{font-size:13px;line-height:19px;margin:0;letter-spacing:0}
  .bus-workspace .result-card strong{font-weight:600;grid-column:1;grid-row:1}
  .bus-workspace .result-card small:first-of-type{grid-column:1/-1;grid-row:2;color:var(--muted)}
  .bus-workspace .result-card small:last-of-type{grid-column:2;grid-row:1;white-space:nowrap;color:var(--muted)}
  .bus-workspace .section-heading{min-height:30px;align-items:center;margin-bottom:2px}
  .bus-workspace .section-heading h2,.bus-workspace .section-heading .text-button{font-size:14px;line-height:20px}
  .bus-workspace .selection-panel{padding-top:4px;margin-top:3px}
  .bus-workspace .selection-panel .muted-copy,.bus-workspace .selection-summary{font-size:13px;line-height:20px}
  .bus-workspace .stop-selects{gap:8px;margin-top:8px}
  .bus-workspace .stop-selects label{font-size:14px;line-height:20px;gap:4px;color:var(--ink)}
  .bus-workspace .stop-selects select{font-size:14px;line-height:20px;padding:6px;height:36px}
  .bus-workspace .selection-stops{margin-top:8px}
  .bus-workspace .selection-stops button{min-height:34px;font-size:14px;line-height:20px;gap:8px;padding:5px 2px}
  .bus-workspace .selection-stops button span{width:22px;height:22px;font-size:12px;font-variant-numeric:tabular-nums}
  .bus-workspace .selection-stops small{font-size:12px;line-height:20px}
  .bus-workspace .line-appearance .color-heading,.bus-workspace .line-appearance .style-row,.bus-workspace .line-appearance .range-row,.bus-workspace .line-appearance .range-row output{font-size:14px;line-height:20px}
  .bus-workspace .line-appearance .section-heading{margin-bottom:5px}
  .bus-workspace .custom-color{gap:6px}
  .bus-workspace #routeColorText{height:32px;min-height:32px;font-size:14px;width:96px;padding:5px 6px}
  .bus-workspace .custom-color input[type=color]{width:32px;height:32px;border-radius:5px}
  .bus-workspace .route-color-swatches{margin:4px 0;gap:2px}
  .bus-workspace .route-color-swatch{height:30px;max-width:30px;border:5px solid var(--surface-subtle);border-radius:50%}
  .bus-workspace .route-color-swatch[aria-pressed=true]{outline-offset:-2px}
  .bus-workspace .style-row{margin:4px 0 6px}
  .bus-workspace .style-row .segmented{padding:2px;border-radius:6px}
  .bus-workspace .style-row .segmented button{font-size:14px;line-height:20px;padding:4px 10px;min-height:28px}
  .bus-workspace .range-pair{gap:16px}
  .bus-workspace .range-row{gap:2px 4px;margin:0}
  .bus-workspace .range-row input[type=range]{height:28px;margin:0}
  .bus-workspace .line-sample{display:none}
  .bus-workspace .other-name-field,.bus-workspace .edit-order .button,.bus-workspace .station-details summary{font-size:14px;line-height:20px}
  .bus-workspace .edit-route-meta{font-size:13px;line-height:20px;margin:5px 0}
  .bus-workspace .route-open strong,.bus-workspace .route-open small,.bus-workspace .route-ends,.bus-workspace .route-card-tools button{font-size:13px;line-height:19px}
  .bus-workspace .route-open .city-badge{font-size:11px}
  .bus-workspace .route-card{border-radius:7px}
  .bus-workspace .route-card-head{gap:6px}
  .bus-workspace .route-open{gap:7px}
  .bus-workspace .station-result-head strong,.bus-workspace .station-result-head small,.bus-workspace .station-context strong{font-size:13px;line-height:19px}
  .bus-workspace .station-line-chip{font-size:12px;line-height:18px;border-radius:4px}
  .bus-workspace .map-control{font-size:12px}
}

.bus-workspace .legal-credit{display:flex;align-items:center;flex-wrap:wrap;gap:2px 8px}
.bus-workspace .legal-credit .creator-link{color:var(--accent)}
@media(max-width:900px){
  .bus-app .brand{display:flex;gap:6px;font-size:13px;font-weight:600;letter-spacing:-.3px;padding:0;white-space:nowrap}
  .bus-app .topbar-actions{flex:0 0 auto;margin-left:auto;gap:3px}
  .bus-app .topbar-actions .button{flex:none;min-width:40px;min-height:32px;padding:5px 7px;font-size:13px}
  .bus-app .settings-entry{gap:4px}
  .bus-workspace .sidebar-footer .legal-links{font-size:9px}
}

@media(max-width:900px) and (max-height:450px) and (orientation:portrait){
  .bus-app .bus-workspace{grid-template-rows:36px 64px minmax(0,1fr)}
  .bus-app .bus-workspace[data-mobile-pane=map],.bus-app .bus-workspace[data-mobile-pane=list]{grid-template-rows:36px minmax(0,1fr) 0}
}
@media(max-width:900px) and (prefers-reduced-motion:reduce){.bus-workspace>.sidebar{transition:none}}

/* One map-view action controls the workspace and banner. */
.mobile-list-entry,.touch-preview{display:none}
.result-row,.station-result-actions{display:contents}
.bus-app .bus-workspace{transition:none}
.bus-workspace>.editor-column{transition:none;min-width:0}
.bus-workspace .map-panel.is-fullscreen{position:relative;inset:auto;height:100%;width:auto;z-index:auto}
@media(min-width:901px){
  .bus-app .bus-workspace[data-map-only=true]{grid-template-columns:0px minmax(0,1fr)}
  .bus-workspace[data-map-only=true]>.editor-column{opacity:0;visibility:hidden;pointer-events:none;transition:none}
  .bus-workspace[data-map-only=true]>.sidebar,.bus-workspace[data-map-only=true]>.route-drawer-toggle{visibility:hidden;pointer-events:none;opacity:0}
}
@media(max-width:900px){
  .bus-app .brand{font-size:12px;gap:4px}
  .bus-app .topbar{gap:4px}
  .bus-app .topbar-actions{gap:2px}
  .bus-app .topbar-actions .button{min-width:0;padding:5px;font-size:12px}
  .bus-app .topbar-actions .mobile-list-entry{display:inline-flex;gap:4px;background:var(--accent);color:var(--on-accent,#fff);border:1px solid var(--accent);font-weight:600}
  .mobile-list-entry[aria-expanded=true]{box-shadow:inset 0 0 0 1px currentColor}
  .bus-app .bus-workspace,.bus-app .bus-workspace[data-mobile-pane=list]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) clamp(352px,54.4%,448px)}
  .bus-app .bus-workspace[data-map-only=true]{grid-template-rows:minmax(0,1fr) 0px}
  .bus-workspace>.map-panel{grid-column:1;grid-row:1}
  .bus-workspace>.editor-column,.bus-workspace[data-mobile-pane=map]>.editor-column,.bus-workspace[data-mobile-pane=list]>.editor-column{display:flex;grid-column:1;grid-row:2;overflow:hidden}
  .bus-workspace[data-map-only=true]>.editor-column{opacity:0;visibility:hidden;pointer-events:none;transition:none}
  .bus-workspace>.sidebar,.bus-workspace>.mobile-drawer-backdrop{top:0}
  .bus-workspace .map-panel.is-fullscreen .map-topbar{top:6px}
  .bus-workspace .result-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line-soft)}
  .bus-workspace .result-row>.result-card{flex:1;min-width:0;border-bottom:0}
  .bus-workspace .result-card>div{gap:0 4px}
  .bus-workspace .result-card strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bus-workspace .touch-preview{display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:36px;min-width:44px;padding:6px;border:1px solid var(--accent-border);border-radius:6px;background:var(--accent-pale);color:var(--accent);font-size:13px;line-height:20px;font-weight:500}
  .bus-workspace .touch-preview[aria-pressed=true]{background:var(--accent);color:var(--on-accent,#fff);border-color:var(--accent)}
  .bus-workspace .station-result-actions{display:flex;align-items:center;gap:8px}
  .bus-workspace .station-result-head{flex:1;min-width:0}
  .mobile-keyboard .bus-workspace{grid-template-rows:64px minmax(0,1fr)}
}
@media(max-width:360px){
  .bus-app .settings-entry span{display:none}
  .bus-app .topbar-actions .settings-entry{min-width:30px}
}
@media(max-width:900px) and (max-height:450px) and (orientation:portrait){
  .bus-app .bus-workspace{grid-template-rows:64px minmax(0,1fr)}
  .bus-app .bus-workspace[data-map-only=true]{grid-template-rows:minmax(0,1fr) 0px}
}
@media(max-width:900px) and (max-height:500px) and (orientation:landscape){
  .bus-app .bus-workspace,.bus-app .bus-workspace[data-mobile-pane=list]{grid-template-columns:minmax(0,1fr) minmax(300px,44%);grid-template-rows:minmax(0,1fr)}
  .bus-workspace>.map-panel{grid-column:1;grid-row:1}
  .bus-workspace>.editor-column,.bus-workspace[data-mobile-pane=map]>.editor-column,.bus-workspace[data-mobile-pane=list]>.editor-column{grid-column:2;grid-row:1}
  .bus-app .bus-workspace[data-map-only=true]{grid-template-columns:minmax(0,1fr) 0px;grid-template-rows:minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){.bus-app .bus-workspace,.bus-workspace>.editor-column{transition:none}}

/* Keep layout changes out of the animation loop; JavaScript animates transforms. */
.bus-app .app-shell{--bus-banner-height:64px;position:relative;overflow:hidden;padding-top:var(--bus-banner-height)}
.bus-app .app-shell>.topbar{position:absolute;inset:0 0 auto;z-index:60;height:var(--bus-banner-height)}
.bus-app .app-shell[data-map-only=true]{padding-top:0}
.bus-app .app-shell[data-map-only=true]>.topbar{transform:translateY(-100%);visibility:hidden;pointer-events:none}
.bus-app .is-map-switching>.topbar{visibility:visible;will-change:transform}
.bus-app .is-map-switching .bus-workspace{overflow:visible}
.bus-app .is-map-switching .map-panel{overflow:visible}
.bus-app .is-map-switching #routeEditor{position:fixed;z-index:55;visibility:visible;opacity:1;pointer-events:none;will-change:transform;min-height:0;min-width:0}
@media(max-width:900px){
  .bus-app .app-shell{--bus-banner-height:calc(40px + env(safe-area-inset-top))}
  .bus-app .bus-workspace[data-map-only=true] .map-topbar{top:calc(6px + env(safe-area-inset-top));right:max(6px,env(safe-area-inset-right))}
}

/* A stable map behind the workspace: panels reveal it without moving its camera. */
.bus-app .app-shell>#mapcontainer{position:absolute;inset:0;z-index:0}
.bus-app .bus-workspace{position:relative;z-index:1;pointer-events:none}
.bus-app .bus-workspace>.map-panel{background:transparent;pointer-events:none}
.bus-workspace>.editor-column:not([inert]),.bus-workspace>.route-drawer-toggle:not([inert]),.bus-workspace>.mobile-drawer-backdrop{pointer-events:auto}
.bus-workspace .map-fallback{pointer-events:auto}
#mapcontainer .amap-scalecontrol,#mapcontainer .amap-logo,#mapcontainer .amap-copyright{translate:var(--map-inset-left,0px) calc(-1 * var(--map-inset-bottom,0px))}
#mapcontainer .amap-toolbar{translate:calc(-1 * var(--map-inset-right,0px)) calc(-1 * var(--map-inset-bottom,0px))}
#mapcontainer .anchorBL{translate:var(--map-inset-left,0px) calc(-1 * var(--map-inset-bottom,0px))}
#mapcontainer .anchorBR{translate:calc(-1 * var(--map-inset-right,0px)) calc(-1 * var(--map-inset-bottom,0px))}
@media(max-width:900px){
  .bus-app .topbar-actions .button:not(.old-bus-link){display:inline-flex;align-items:center;line-height:18px}
}

/* Inline schedules share the existing compact type scale. */
.selection-title{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;min-width:0}
.selection-title h2{margin:0;min-width:0;overflow-wrap:anywhere}
.route-direction-row{padding:0 12px 7px;display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 8px}
.route-direction-row .route-ends{padding:0}
.bus-app .timetable-toggle{display:inline-flex;align-items:center;justify-content:center;gap:3px;min-height:26px;padding:2px 0;border:0;background:transparent;color:var(--accent);font-size:11px;font-weight:500;line-height:18px;white-space:nowrap}
.timetable-toggle:hover{text-decoration:underline;text-underline-offset:3px}
.timetable-toggle:disabled{color:var(--muted);cursor:wait}
.timetable-toggle svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.6;transition:transform .2s ease}
.timetable-toggle[aria-expanded=true] svg{transform:rotate(180deg)}
.timetable-panel{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .22s ease,opacity .18s ease}
.timetable-panel[data-open=true]{grid-template-rows:1fr;opacity:1}
.timetable-clip{min-height:0;overflow:hidden}
.timetable-content{margin:0 0 10px;padding:10px;background:var(--surface-subtle);border:1px solid var(--line-soft);border-radius:6px;text-align:left}
.route-card .timetable-content{margin:0 10px 10px;background:var(--paper)}
.timetable-source{font-size:10px;line-height:16px;color:var(--muted)}
.timetable-direction{font-size:11px;line-height:18px;margin:2px 0 7px;color:var(--ink);overflow-wrap:anywhere}
.timetable-group+.timetable-group{margin-top:9px;padding-top:9px;border-top:1px solid var(--line-soft)}
.timetable-times{display:grid;grid-template-columns:repeat(auto-fill,minmax(46px,1fr));gap:5px}
.timetable-times span{padding:4px 2px;border-radius:4px;background:var(--surface);border:1px solid var(--line-soft);color:var(--ink);font-size:12px;line-height:18px;font-variant-numeric:tabular-nums;text-align:center}
.timetable-note{font-size:12px;line-height:1.7;white-space:pre-line;margin:0;color:var(--ink)}
.timetable-note+.timetable-times,.timetable-times+.timetable-note{margin-top:6px}
.timetable-footnote{font-size:10px;line-height:16px;margin:8px 0 0;color:var(--muted)}
.timetable-error{color:var(--danger)}
.timetable-panel.without-motion{transition:none}
@media(max-width:900px){
  .bus-app .timetable-toggle{min-height:30px;font-size:12px;line-height:20px}
  .bus-workspace .selection-title h2{font-size:14px;line-height:20px}
  .timetable-direction,.timetable-note,.timetable-times span{font-size:13px;line-height:20px}
  .timetable-source,.timetable-footnote{font-size:11px;line-height:17px}
}
@media(prefers-reduced-motion:reduce){.timetable-panel,.timetable-toggle svg{transition:none}}

/* Shared visual rules for Bus. Layout and interaction breakpoints stay above. */
.bus-app{--bus-text:13px;--bus-small:13px;--bus-caption:12px;--bus-control:36px;--bus-radius:6px;font-size:var(--bus-text);line-height:1.45}
.bus-app button,.bus-app input,.bus-app select{letter-spacing:0}
.bus-app :is(.button,.text-button,.map-control,.timetable-toggle){font-size:var(--bus-small);font-weight:500;line-height:20px;border-radius:var(--bus-radius)}
.bus-app :is(.text-button,.map-control,.timetable-toggle){display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:32px;padding:5px 9px;border:1px solid var(--line);background:var(--surface);color:var(--ink);white-space:nowrap;text-decoration:none}
.bus-app :is(.text-button,.map-control,.timetable-toggle):hover:not(:disabled){background:var(--accent-pale);border-color:var(--accent-border);color:var(--accent);text-decoration:none}
.bus-app :is(.button,.text-button,.map-control,.timetable-toggle):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.bus-app .danger,.bus-app .text-button.danger{color:var(--danger)}
.bus-app .button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:var(--bus-control);padding:7px 12px}
.bus-app .button-primary{background:var(--accent);color:var(--on-accent)}
.bus-app .button-dark{background:var(--solid);color:var(--on-solid)}
.bus-app .topbar-actions{gap:6px}
.bus-app .save-state{font-size:var(--bus-caption);margin-right:6px}
.bus-app .topbar-actions .button{line-height:20px}
.bus-workspace>.editor-column,.bus-workspace>.sidebar{background:var(--surface)}
.bus-workspace .editor{padding-top:18px;padding-bottom:18px;padding-right:18px}
.bus-workspace .editor-heading{min-height:28px;align-items:center;gap:8px;margin-bottom:0}
.bus-workspace .editor-heading h1{font-size:17px;line-height:25px;letter-spacing:0;font-weight:600}
.bus-workspace .editor-index{display:none}
.bus-workspace .section-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:32px;margin-bottom:10px}
.bus-workspace .section-heading .text-button{font-size:var(--bus-small);line-height:20px;min-height:26px;padding:2px 6px}
.bus-workspace .edit-order .button{font-size:var(--bus-small);line-height:20px}
.bus-workspace .section-heading h2{font-size:14px;line-height:22px;font-weight:600;letter-spacing:0}
.bus-workspace :is(.muted-copy,.edit-route-meta,.selection-summary,.color-heading,.style-row,.range-row,.range-row output,.other-name-field,.stop-selects label){font-size:var(--bus-text);line-height:20px}
.bus-workspace :is(.inline-status,.bus-empty p){font-size:var(--bus-small);line-height:20px}
.bus-workspace .inline-status{margin-top:6px}
.bus-workspace input:not([type=checkbox]):not([type=color]):not([type=range]):not(.trip-title),.bus-workspace select{height:var(--bus-control);min-height:var(--bus-control);padding:7px 9px;font-size:var(--bus-text);line-height:20px;border-radius:var(--bus-radius)}
.bus-search-form{margin-top:12px}
.bus-workspace .search-row{gap:6px;align-items:stretch}
.bus-workspace .search-row :is(#searchCity,.search-city){width:56px;flex:none;text-align:center;padding-inline:5px}
.bus-workspace .search-row :is(#lineQuery,.search-query){padding-inline:8px}
.bus-workspace .search-row .button{padding-inline:10px;font-size:var(--bus-text)}
.bus-workspace .search-tools{gap:8px;margin-bottom:8px;align-items:stretch}
.bus-workspace .search-tools .search-mode{flex:1;margin:0}
.bus-workspace .search-tools .map-stations-control{flex:1.08}
.bus-workspace .segmented{padding:2px;gap:2px;border-radius:var(--bus-radius);background:var(--paper);border-color:var(--line)}
.bus-workspace .segmented button{display:flex;align-items:center;justify-content:center;min-height:30px;padding:4px 8px;font-size:var(--bus-small);line-height:20px;border-radius:4px;color:var(--muted)}
.bus-workspace .segmented button[aria-pressed=true]{background:var(--surface);color:var(--accent);font-weight:600;box-shadow:0 0 0 1px var(--line)}
.bus-workspace .search-tools .search-mode button{flex:1;min-width:0;min-height:30px;font-size:var(--bus-small);padding:4px 8px}
.bus-workspace .search-tools .map-stations-control{padding:0;background:var(--surface);border-color:var(--line)}
.bus-workspace .search-tools .map-stations-button{min-height:34px;font-size:var(--bus-small);padding:6px;color:var(--ink);border-radius:var(--bus-radius)}
.bus-workspace .map-stations-button:hover{background:var(--accent-pale);color:var(--accent)}
.bus-workspace .append-option{min-height:36px;padding:8px 0;gap:8px;border-bottom:0}
.bus-workspace .append-option input{width:16px;height:16px;margin:0;flex:none}
.bus-workspace .append-option span{font-size:var(--bus-small);line-height:20px}
.bus-workspace .line-results{margin-top:4px}
.bus-workspace .result-row{border-color:var(--line-soft)}
.bus-workspace .result-card{min-height:60px;padding:7px 4px;gap:9px;border-radius:0}
.bus-workspace .result-card .route-thumb{width:44px;height:44px;padding:1px;border-radius:4px}
.bus-workspace .result-card>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 6px;align-items:baseline}
.bus-workspace .result-card :is(strong,small){font-size:var(--bus-small);line-height:20px;margin:0;letter-spacing:0}
.bus-workspace .result-card strong{grid-column:1;grid-row:1;font-size:var(--bus-text);font-weight:600}
.bus-workspace .result-card small:first-of-type{grid-column:1/-1;grid-row:2;color:var(--muted)}
.bus-workspace .result-card small:last-of-type{grid-column:2;grid-row:1;white-space:nowrap;color:var(--muted);font-size:var(--bus-caption)}
.bus-workspace .result-card:hover,.bus-workspace .result-card:focus-visible{background:var(--accent-pale)}
.bus-workspace .selection-panel{padding-top:12px;margin-top:8px;border-color:var(--line)}
.bus-workspace .selection-title{gap:6px 8px}
.bus-workspace #selectedDirection{margin:0 0 4px;font-size:var(--bus-small);line-height:20px}
.bus-workspace .selection-summary{font-size:var(--bus-caption);line-height:20px;padding-top:4px;color:var(--muted)}
.bus-workspace .stop-selects{gap:8px;margin-top:8px}
.bus-workspace .stop-selects label{gap:4px;color:var(--ink);font-size:var(--bus-small)}
.bus-workspace .stop-selects select{padding-inline:6px}
.bus-workspace .selection-stops{margin:8px 0;padding:0}
.bus-workspace .selection-stops button{min-height:36px;padding:6px 4px;gap:8px;font-size:var(--bus-text);line-height:20px;border-radius:4px}
.bus-workspace .selection-stops button span{width:22px;height:22px;font-size:var(--bus-caption)}
.bus-workspace .selection-stops small{font-size:var(--bus-caption);line-height:20px}
.bus-workspace .line-appearance{margin-top:18px;padding-top:14px}
.bus-workspace .line-appearance .section-heading{margin-bottom:8px}
.bus-workspace .color-heading{margin:0 0 8px;color:var(--ink)}
.bus-workspace .custom-color{gap:6px}
.bus-workspace .custom-color input[type=color]{width:32px;height:32px;padding:3px;border-radius:var(--bus-radius)}
.bus-workspace #routeColorText{width:94px;height:32px;min-height:32px;padding:5px 7px;font-size:var(--bus-small);line-height:20px}
.bus-workspace .route-color-swatches{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px;margin:0 0 8px}
.bus-workspace .route-color-swatch{width:24px;height:24px;max-width:none;justify-self:center;border:3px solid var(--surface);border-radius:50%;background-clip:padding-box;box-shadow:0 0 0 1px var(--line);outline:none}
.bus-workspace .route-color-swatch[aria-pressed=true]{box-shadow:0 0 0 2px var(--accent);outline:none}
.bus-workspace .style-row{margin:8px 0 12px;color:var(--ink)}
.bus-workspace .range-pair{gap:16px}
.bus-workspace .range-row{gap:4px 6px;margin:0;color:var(--ink)}
.bus-workspace .range-row output{font-size:var(--bus-small);color:var(--muted)}
.bus-workspace .range-row input[type=range]{height:24px;margin:0}
.bus-workspace .line-sample{height:20px;padding:0;margin-top:8px}
.bus-workspace .editor-column>#addFooter{margin-right:18px;padding-top:12px}
.bus-workspace #addRoute{font-size:var(--bus-text);line-height:20px;min-height:38px;padding:8px 12px;border-radius:var(--bus-radius)}
.bus-workspace .other-name-field{margin-top:12px;gap:4px}
.bus-workspace .edit-route-meta{font-size:var(--bus-small);margin:8px 0}
.bus-workspace .edit-order{gap:8px}
.bus-workspace .station-details{margin-top:12px}
.bus-workspace .station-details summary{font-size:var(--bus-text);line-height:20px;min-height:32px;align-items:center}
.bus-workspace .station-details summary span{font-size:var(--bus-caption)}
.bus-workspace .station-result{padding:8px 0;border-radius:0}
.bus-workspace .station-result-head{padding:4px;gap:8px}
.bus-workspace .station-result-head strong,.bus-workspace .station-context strong{font-size:var(--bus-text);line-height:20px;font-weight:600}
.bus-workspace .station-result-head small{font-size:var(--bus-caption);line-height:18px;margin-top:2px}
.bus-workspace .station-number{width:26px;height:26px;font-size:var(--bus-caption)}
.bus-workspace .station-line-chips{gap:4px;margin:6px 4px 0}
.bus-workspace .station-line-chip{font-size:var(--bus-caption);line-height:18px;padding:2px 6px;border-radius:4px}
.bus-workspace .station-context{margin-top:8px}
.bus-workspace .station-context>button{margin-bottom:6px}
.bus-workspace .more-stations{display:flex;width:100%}
.bus-workspace .sidebar .sidebar-scroll{padding:12px}
.bus-workspace .drawer-toolbar{padding:8px 12px 0}
.bus-workspace .drawer-pin{min-height:26px;font-size:var(--bus-small);padding:2px 6px}
.bus-workspace .drawer-pin[aria-pressed=true]{background:var(--accent-pale);border-color:var(--accent-border);color:var(--accent)}
.bus-workspace .sidebar .trip-head{padding:12px;border-radius:var(--bus-radius);border:1px solid var(--line);background:var(--surface-subtle);color:var(--ink);box-shadow:none}
.bus-workspace #mapTitle.trip-title{height:32px;min-height:32px;padding:0 0 4px;margin:0 0 8px;border-bottom:1px solid var(--line);border-radius:0;font-size:18px;line-height:26px;letter-spacing:0;color:var(--ink);background:transparent}
.bus-workspace .trip-head .trip-title::placeholder{color:var(--muted)}
.bus-workspace .trip-head .text-button{color:var(--ink);min-height:26px;padding:2px 6px}
.bus-workspace .trip-head .trip-meta-row{font-size:var(--bus-small);line-height:20px;gap:8px;color:var(--muted)}
.bus-workspace .trip-head .trip-stats{display:grid;grid-template-columns:1fr 1.3fr 1fr;gap:8px;margin:10px 0 0;padding:10px 0 0;border-color:var(--line)}
.bus-workspace .trip-head .stat strong{font-size:18px;line-height:24px;font-weight:600}
.bus-workspace .trip-head .stat small,.bus-workspace .trip-head .stat span{font-size:var(--bus-caption);line-height:18px;color:var(--muted)}
.bus-workspace .trip-head .stat span{margin:2px 0 0}
.bus-workspace .sidebar .timeline-section{padding:12px 0 0}
.bus-workspace .sidebar .section-heading{margin-bottom:8px}
.bus-workspace .sidebar .route-list{gap:12px}
.bus-workspace .route-card{border-radius:var(--bus-radius);box-shadow:none}
.bus-workspace .sidebar .route-card-head{padding:12px 12px 8px;gap:8px}
.bus-workspace .route-card .route-thumb{width:30px;height:30px;padding:2px}
.bus-workspace .route-open{gap:8px}
.bus-workspace .route-open strong{font-size:var(--bus-text);font-weight:600;line-height:20px}
.bus-workspace .route-open small{font-size:var(--bus-small);line-height:20px;margin-top:2px}
.bus-workspace .route-open .city-badge{font-size:var(--bus-caption);margin-left:0;padding:0 4px;border-radius:3px}
.bus-workspace .drag-handle{min-height:32px;min-width:24px;padding:4px;letter-spacing:0}
.bus-workspace .route-direction-row{padding:0 12px 10px;gap:4px 8px;align-items:center}
.bus-workspace .route-direction-row .route-ends{padding:0;font-size:var(--bus-small);line-height:20px}
.bus-workspace .route-card-tools{gap:6px;justify-content:flex-start;padding:7px 12px;border-color:var(--line-soft)}
.bus-workspace .route-card-tools button{display:inline-flex;align-items:center;justify-content:center;min-height:30px;min-width:0;flex:1;padding:3px 6px;border:1px solid var(--line);border-radius:4px;font-size:var(--bus-small);line-height:20px;background:var(--surface);color:var(--ink)}
.bus-workspace .route-card-tools button:hover{background:var(--accent-pale);border-color:var(--accent-border);text-decoration:none}
.bus-workspace .route-card-tools .remove-route{margin-left:0;color:var(--danger)}
.bus-workspace .route-card input[type=color]{width:24px;height:24px;flex:none;margin-right:2px;box-shadow:0 0 0 1px var(--line)}
.bus-workspace .sidebar-footer{gap:6px;padding:10px 12px;background:var(--surface);border-top:1px solid var(--line)}
.bus-workspace .sidebar-footer .legal-links{font-size:10px;line-height:16px}
.bus-workspace .legal-credit{gap:2px 8px}
.bus-workspace .batch-tools{font-size:var(--bus-small);margin-bottom:8px}
.bus-list-compact .bus-workspace .sidebar .route-list{gap:6px}
.bus-list-compact .bus-workspace .sidebar .route-card-head{padding-top:6px;padding-bottom:4px}
.bus-list-compact .bus-workspace .sidebar .route-direction-row{padding-bottom:6px}
.bus-list-compact .bus-workspace .sidebar .route-card-tools{padding-top:4px;padding-bottom:4px}
.bus-app .timetable-toggle{color:var(--accent);border-color:var(--accent-border);background:var(--accent-pale);font-size:var(--bus-small);min-height:24px;padding:1px 5px;gap:3px;border-radius:4px}
.bus-app .timetable-toggle:disabled{color:var(--muted)}
.bus-app .timetable-content{padding:10px;margin-bottom:8px;border-radius:var(--bus-radius);background:var(--surface-subtle)}
.bus-app .route-card .timetable-content{margin:0 10px 8px}
.bus-app .timetable-note,.bus-app .timetable-times span{font-size:var(--bus-text);line-height:20px}
.bus-app .timetable-times{gap:6px;grid-template-columns:repeat(auto-fill,minmax(48px,1fr))}
.bus-app .timetable-times span{padding:4px 2px}
.bus-app .timetable-footnote{font-size:var(--bus-caption);line-height:18px;margin-top:8px}
.bus-app .settings-header{padding:20px 20px 0}
.bus-app .settings-header .modal-head{margin-bottom:16px;align-items:center}
.bus-app .settings-header h2{font-size:18px;line-height:26px}
.bus-app .settings-body{padding:0 20px 16px}
.bus-app .preference-section{padding-top:16px}
.bus-app .preference-section h3{font-size:var(--bus-small);line-height:20px;letter-spacing:0;margin:0 0 4px;color:var(--ink)}
.bus-app .preference-row{padding:10px 0;gap:12px}
.bus-app .preference-row strong{font-size:var(--bus-text);line-height:20px}
.bus-app .preference-row small{font-size:var(--bus-caption);line-height:18px;margin-top:3px}
.bus-app .settings-body select{min-height:36px;font-size:var(--bus-text);line-height:20px;padding:6px 8px}
.bus-app .map-style-options{gap:8px;margin:8px 0}
.bus-app .map-style-option{border-radius:var(--bus-radius)}
.bus-app .map-swatch{height:48px}
.bus-app .map-style-option strong{font-size:var(--bus-small);line-height:20px;margin:6px 0 2px}
.bus-app .settings-footer{font-size:var(--bus-caption);line-height:20px;padding:12px 20px}
.bus-app .theme-custom{font-size:var(--bus-small)}
@media(min-width:901px){
  .bus-app .topbar-actions .mobile-list-entry{display:none}
  .bus-workspace .editor-column>.editor{padding-left:38px}
  .bus-workspace .map-topbar .map-control{min-height:36px}
  .bus-workspace .drawer-toggle-label{font-size:12px;letter-spacing:2px}
  .bus-workspace .drawer-route-count{font-size:11px}
}
@media(max-width:900px){
  .bus-app .topbar-actions .button{min-height:32px;padding:5px;gap:4px;font-size:12px;line-height:20px}
  .bus-app .topbar-actions{gap:3px}
  .bus-app .topbar-actions .mobile-list-entry{border-color:var(--accent);color:var(--on-accent);background:var(--accent)}
  .bus-workspace .mobile-editor-toolbar{padding:4px 10px;gap:6px;min-height:38px;background:var(--surface-subtle)}
  .bus-workspace .mobile-editor-toolbar button{min-height:30px;padding:4px 8px;font-size:var(--bus-small);line-height:20px;border:1px solid transparent;border-radius:4px}
  .bus-workspace .mobile-editor-toolbar button[aria-pressed=true]{border-color:var(--accent-border);background:var(--surface);color:var(--accent)}
  .bus-workspace .editor{padding:10px 12px}
  .bus-workspace .search-tools{gap:6px;margin-bottom:6px}
  .bus-workspace .bus-search-form{margin-top:0}
  .bus-workspace .append-option{padding:6px 0;min-height:32px}
  .bus-workspace .line-results{margin-top:2px}
  .bus-workspace .result-card{min-height:58px;padding:6px 2px}
  .bus-workspace .result-card>div{gap:0 6px}
  .bus-workspace .result-card small:last-of-type{font-size:12px}
  .bus-workspace .touch-preview{min-height:34px;min-width:44px;padding:6px;font-size:var(--bus-small);line-height:20px;border-color:var(--accent-border);border-radius:var(--bus-radius)}
  .bus-workspace .selection-panel{margin-top:4px;padding-top:8px}
  .bus-workspace .section-heading{margin-bottom:8px}
  .bus-workspace .selection-title h2{font-size:14px;line-height:22px}
  .bus-workspace .selection-summary{padding-top:2px}
  .bus-workspace .selection-stops button{min-height:36px}
  .bus-workspace .editor-column>#addFooter{margin:0;padding:8px 12px;background:var(--surface)}
  .bus-workspace #addRoute{min-height:36px;padding:7px 10px}
  .bus-workspace[data-mobile-style=true] .line-appearance{margin:0;padding:0;border:0}
  .bus-workspace .route-color-swatches{gap:1px}
  .bus-workspace .route-color-swatch{width:32px;height:32px;border-width:6px;box-shadow:none}
  .bus-workspace .route-color-swatch[aria-pressed=true]{box-shadow:inset 0 0 0 1px var(--surface);outline:1px solid var(--accent);outline-offset:-3px}
  .bus-workspace .sidebar .sidebar-scroll{padding:12px}
  .bus-workspace .sidebar .trip-head{padding:10px}
  .bus-workspace #mapTitle.trip-title{font-size:17px}
  .bus-workspace .route-card-tools button{min-height:32px}
  .bus-workspace .drag-handle{min-height:36px;min-width:32px}
  .bus-workspace .sidebar-footer{padding:6px 10px;grid-template-columns:auto minmax(0,1fr)}
  .bus-workspace .sidebar-footer .legal-links{font-size:10px;line-height:15px}
  .bus-workspace .sidebar-footer .text-button{padding:5px 6px;font-size:12px}
  .bus-workspace .map-control{min-height:32px;padding:5px 9px}
  .bus-workspace .station-result{padding:6px 0}
  .bus-app .settings-header{padding:calc(12px + env(safe-area-inset-top)) 16px 0}
  .bus-app .settings-header .modal-head{margin-bottom:12px}
  .bus-app .settings-body{padding:0 16px 12px}
  .bus-app .settings-footer{padding:8px 16px calc(8px + env(safe-area-inset-bottom))}
  .bus-app .settings-body select{font-size:16px}
}

.bus-app .modal:not(.settings-root .modal){border-radius:8px}
.bus-app .modal-head h2{font-size:18px;line-height:26px}
.bus-app .modal-copy{font-size:14px;line-height:22px}
.bus-app .import-summary{font-size:13px;line-height:20px}
.bus-app .modal-actions{gap:8px}
.bus-app .modal-close{display:grid;place-items:center;width:32px;height:32px;min-width:32px;min-height:32px;padding:0;font-size:22px;line-height:1;border:1px solid var(--line);background:var(--surface);border-radius:6px}
@media(max-width:900px){.bus-app .modal-close{width:44px;height:44px;min-width:44px;min-height:44px}}

/* Stationary top strips reveal the same route list vertically. */
.bus-workspace{--list-strip-height:38px}
.bus-workspace>#routeDrawerToggle,.bus-workspace>#mobileListButton{position:absolute;inset:0 auto auto 0;z-index:56;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:7px;width:var(--drawer-width,338px);height:var(--list-strip-height);min-height:0;padding:6px 12px;border:0;border-left:3px solid transparent;border-bottom:1px solid var(--line);border-radius:0;background:color-mix(in srgb,var(--accent) 5%,var(--surface));color:var(--ink);box-shadow:none;transform:none;pointer-events:auto;transition:background .2s ease,color .2s ease,border-color .2s ease,transform .24s ease,opacity .2s ease,visibility 0s}
.bus-workspace>#mobileListButton{display:none}
.bus-workspace .list-top-strip .drawer-toggle-label{writing-mode:horizontal-tb;letter-spacing:0;font-size:13px;line-height:20px;font-weight:600}
.bus-workspace .list-top-strip .drawer-route-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;min-height:20px;padding:0 5px;font-size:11px;line-height:18px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--muted);transition:background .2s,color .2s}
.bus-workspace .list-top-strip .drawer-toggle-state{margin-left:auto;font-size:12px;line-height:20px}
.bus-workspace .list-top-strip svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transform:none;transition:transform .24s ease}
.bus-workspace>#routeDrawerToggle[aria-expanded=true],.bus-workspace>#mobileListButton[aria-expanded=true]{transform:none;background:var(--accent-pale);color:var(--accent);border-color:var(--accent-border);box-shadow:none}
.bus-workspace .list-top-strip[aria-expanded=true] .drawer-chevron{transform:rotate(180deg)}
.bus-workspace .list-top-strip[aria-expanded=true] .drawer-route-count{background:var(--accent);color:var(--on-accent)}
.bus-workspace>.list-top-strip:hover{background:var(--accent-pale);color:var(--accent)}
.bus-workspace>.list-top-strip:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.bus-workspace>.sidebar{inset:var(--list-strip-height) auto 0 0;transform:translateY(calc(-100% - var(--list-strip-height)));transition:transform .26s cubic-bezier(.22,.8,.25,1),visibility 0s .26s;box-shadow:none}
.bus-workspace[data-drawer-open=true]>.sidebar{transform:translateY(0);transition-delay:0s;box-shadow:4px 8px 20px #00000010}
.bus-workspace>.editor-column{background:var(--surface)}
.bus-workspace .back-to-add{gap:5px;min-height:26px;padding:2px 6px;font-size:12px}
.bus-workspace .back-to-add svg{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.bus-workspace .line-appearance{background:var(--surface-subtle);padding:12px;border:1px solid var(--line-soft);border-radius:6px}
.bus-workspace .line-appearance .section-heading{margin-bottom:10px}
.bus-workspace .selection-panel{background:var(--surface-subtle);border:1px solid var(--line-soft);padding:10px;border-radius:6px}
.bus-workspace .route-card-tools{background:var(--surface-subtle);border-radius:0 0 6px 6px}
.bus-workspace .sidebar{background:var(--paper)}
.bus-workspace .sidebar .trip-head{background:var(--surface);border-color:var(--line-soft)}
.bus-workspace .station-line-chip{background:var(--surface-subtle)}
.bus-workspace .route-card .route-thumb{background:var(--surface-subtle)}
.bus-workspace .result-card .route-thumb{background:var(--surface-subtle)}
.bus-workspace .editor-column>#addFooter{background:var(--surface)}
@media(min-width:901px){
  .bus-workspace>.editor-column{padding-top:var(--list-strip-height)}
  .bus-workspace>.editor-column .editor{padding-left:18px}
  .bus-workspace>.editor-column>#addFooter{margin-left:18px}
}
@media(max-width:900px){
  .bus-app .topbar .brand{font-size:13px;gap:5px}
  .bus-workspace>#routeDrawerToggle{display:none}
  .bus-workspace>#mobileListButton{display:flex;width:100%;padding-inline:12px}
  .bus-workspace>.map-panel{margin-top:var(--list-strip-height)}
  .bus-workspace>.sidebar{inset:var(--list-strip-height) 0 auto;grid-area:auto;width:100%;height:calc(100% - 64px);max-height:720px;border-right:0;border-bottom:1px solid var(--line);border-radius:0 0 8px 8px;transform:translateY(calc(-100% - var(--list-strip-height)));transition:transform .26s cubic-bezier(.22,.8,.25,1),visibility 0s .26s}
  .bus-workspace[data-mobile-pane=list]>.sidebar{transform:translateY(0);transition-delay:0s;box-shadow:0 8px 20px #00000018}
  .bus-workspace>.mobile-drawer-backdrop{inset:var(--list-strip-height) 0 0;background:#0002}
  .bus-workspace .selection-panel{margin-top:8px;padding:10px}
  .bus-workspace .line-appearance,.bus-workspace[data-mobile-style=true] .line-appearance{padding:10px;background:var(--surface-subtle);border:1px solid var(--line-soft);border-radius:6px}
  .bus-workspace .line-appearance :is(.color-heading,.style-row,.range-row,.range-row output){font-size:13px}
  .bus-workspace .route-color-swatch{width:28px;height:28px;border-width:4px}
  .bus-workspace[data-map-only=true]>.map-panel{margin-top:0}
}
.bus-workspace[data-map-only=true]>.list-top-strip{transform:translateY(-100%);opacity:0;visibility:hidden;pointer-events:none;transition:transform .24s ease,opacity .2s ease,visibility 0s .24s}
.bus-workspace[data-map-only=true]>.sidebar{visibility:hidden;pointer-events:none}
@media(prefers-reduced-motion:reduce){.bus-workspace>.list-top-strip,.bus-workspace>.sidebar,.bus-workspace .list-top-strip svg{transition:none}}

.bus-workspace .list-top-strip .drawer-list-icon{width:18px;height:18px;color:var(--accent);stroke-width:1.7;transform:none;flex:none}
.bus-workspace .list-top-strip .drawer-indicator{display:grid;place-items:center;width:24px;height:24px;border:1px solid var(--line);border-radius:5px;background:var(--surface);transition:background .2s,border-color .2s}
.bus-workspace .list-top-strip .drawer-chevron{width:16px;height:16px}
.bus-workspace .list-top-strip[aria-expanded=true] .drawer-indicator{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.bus-workspace .list-top-strip[aria-expanded=true] .drawer-route-count{border-color:var(--accent-border)}

/* Keep provider comparison and direction selection inside the existing schedule. */
.bus-app .timetable-providers{display:flex;gap:5px;margin-bottom:8px}
.bus-app .timetable-providers button,.bus-app .timetable-candidate>button,.bus-app .timetable-retry button{font:inherit;font-size:12px;line-height:18px;min-height:26px;padding:3px 7px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--ink)}
.bus-app .timetable-providers button{flex:1}
.bus-app .timetable-providers button[aria-pressed=true]{background:var(--accent-pale);color:var(--accent);border-color:var(--accent-border)}
.bus-app .timetable-source-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}
.bus-app .timetable-source,.bus-app .timetable-reference{font-size:11px;line-height:17px;color:var(--muted)}
.bus-app .timetable-link{border:0;padding:2px 0;min-height:24px;background:transparent;color:var(--accent);font-size:11px;line-height:17px;text-decoration:underline;text-underline-offset:3px}
.bus-app .timetable-footnote{margin-top:3px}
.bus-app .timetable-reference{margin:5px 0 8px;overflow-wrap:anywhere}
.bus-app .timetable-candidates{display:grid;gap:6px;max-height:320px;overflow-y:auto;overscroll-behavior:contain}
.bus-app .timetable-candidate{display:grid;gap:3px;padding:8px;border:1px solid var(--line);border-radius:5px;background:var(--surface);font-size:12px;line-height:18px;overflow-wrap:anywhere}
.bus-app .timetable-candidate>button{justify-self:end;color:var(--accent);background:var(--accent-pale);border-color:var(--accent-border)}
.bus-app .timetable-candidate details,.bus-app .timetable-match-info{font-size:11px;line-height:18px;color:var(--muted)}
.bus-app .timetable-match-info{margin-bottom:7px;overflow-wrap:anywhere}
.bus-app .timetable-candidate summary,.bus-app .timetable-match-info summary{cursor:pointer}
.bus-app .timetable-candidate details p,.bus-app .timetable-match-info p{margin:4px 0;line-height:1.7;overflow-wrap:anywhere}
.bus-app .timetable-retry{display:flex;gap:6px;margin-top:6px}
.bus-app [data-timetable] button:focus-visible,.bus-app .timetable-find input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:900px){.bus-app .timetable-providers button,.bus-app .timetable-candidate>button,.bus-app .timetable-retry button{min-height:32px}.bus-app .timetable-link{min-height:28px}}

/* Queries append independent provider results in a fixed order. */
.bus-app .timetable-providers button{color:var(--accent);background:var(--accent-pale);border-color:var(--accent-border)}
.bus-app .timetable-source-section+.timetable-source-section{border-top:1px solid var(--line);margin-top:10px;padding-top:10px}
.bus-app .timetable-source-section>.timetable-source-row{margin:0 0 6px;min-height:20px}
.bus-app .timetable-source-section>.timetable-source-row:has(>.timetable-link){margin-top:-3px}
.bus-app .timetable-source-results:empty{display:none}
.bus-app .timetable-providers:has(+.timetable-source-results:empty){margin-bottom:0}
.bus-app .timetable-candidate{display:block;padding:0;overflow:hidden}
.bus-app .timetable-candidate .result-row{display:flex;align-items:center;gap:5px;border:0;padding:0 7px}
.bus-app .timetable-candidate .result-card{flex:1;min-width:0;border:0}
.bus-app .timetable-match-reason{display:block;padding:0 8px 4px}
.bus-app .timetable-candidate>details{padding:0 8px 6px}
.bus-app .timetable-candidate .touch-preview{min-width:40px;padding:4px;min-height:32px;font-size:12px}
.bus-app .bus-workspace .drawer-toolbar{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;gap:8px}
.bus-app .drawer-toolbar #clearButton{min-height:26px;font-size:13px;line-height:20px;padding:2px 6px;color:var(--danger)}
.bus-app .app-shell{--legal-height:44px;--legal-width:338px}
.bus-app .bus-legal-footer{position:absolute;z-index:65;bottom:0;left:0;width:var(--legal-width);height:var(--legal-height);display:flex;align-items:center;padding:5px 18px;border-top:1px solid var(--line);border-right:1px solid var(--line);background:var(--surface);color:var(--muted);pointer-events:auto}
.bus-app .bus-legal-footer .legal-links{display:grid;gap:0;font-size:10px;line-height:16px;white-space:normal}
.bus-app .bus-legal-footer .legal-credit{display:flex;align-items:center;flex-wrap:wrap;gap:0 8px}
.bus-app .bus-legal-footer a:hover{color:var(--accent);text-decoration:underline}
.bus-app .bus-workspace>.editor-column,.bus-app .bus-workspace>.sidebar{padding-bottom:var(--legal-height)}
@media(min-width:1600px){.bus-app .app-shell{--legal-width:360px}}
@media(min-width:901px) and (max-width:1100px){.bus-app .app-shell{--legal-width:326px}}
@media(max-width:900px){
  .bus-app .app-shell{--legal-width:100%;--legal-height:calc(42px + env(safe-area-inset-bottom))}
  .bus-app .bus-legal-footer{padding:4px 12px calc(4px + env(safe-area-inset-bottom));justify-content:center;border-right:0}
  .bus-app .bus-legal-footer .legal-links{font-size:10px;line-height:16px;text-align:center}
  .bus-app .bus-legal-footer .legal-credit{justify-content:center}
  .bus-app .bus-workspace .drawer-toolbar .drawer-pin{display:none}
  .bus-app .bus-workspace>.sidebar{height:calc(100% - var(--list-strip-height) - var(--legal-height));max-height:none;padding-bottom:0}
  .bus-app .bus-workspace .drawer-toolbar{padding:6px 12px}
}
@media(max-width:900px) and (max-height:500px) and (orientation:landscape){
  .bus-app .bus-workspace>.editor-column{padding-bottom:var(--legal-height)}
}
@media(min-width:901px){
  .bus-app .bus-workspace>.editor-column{display:flex;flex-direction:column;overflow:hidden}
  .bus-app .bus-workspace>.editor-column>.editor{flex:1;min-height:0;overflow-y:auto}
  .bus-app .bus-workspace>.editor-column>#addFooter{flex:none;margin-bottom:8px}
}

/* Match lookup uses the same search controls and route layout as Add Line. */
.bus-app .bus-workspace .sidebar .sidebar-scroll{padding-top:0}
.bus-app .timetable-source{font-size:12px;line-height:18px;font-weight:600;color:var(--ink)}
.bus-app .bus-search-form.timetable-find{margin-top:9px}
.bus-workspace .search-row .button{height:var(--bus-control);min-height:var(--bus-control)}
.bus-app .timetable-candidate{transition:background .18s,border-color .18s}
.bus-app .timetable-candidate:hover,.bus-app .timetable-candidate:focus-within{background:var(--accent-pale);border-color:var(--accent-border)}
.bus-app .timetable-candidate .result-card:hover,.bus-app .timetable-candidate .result-card:focus-visible{background:transparent}
@media(prefers-reduced-motion:reduce){.bus-app .timetable-candidate{transition:none}}

/* Matching uses the same line/station controls, cards and station context as Add Line. */
.bus-app .bus-search-form.timetable-find{margin:8px 0}
.bus-app .timetable-search-slot .search-tools{gap:6px}
.bus-app .timetable-search-slot .search-tools .search-mode button{min-width:0}
.bus-app .timetable-matching.station-search-active>.timetable-candidates{display:none}
.bus-app .timetable-station-results{max-height:320px;overflow-y:auto;overscroll-behavior:contain}
.bus-app .timetable-search-slot .station-context{padding:8px}
.bus-app .timetable-search-slot .station-context>div{flex-wrap:wrap;gap:4px}
.bus-app .timetable-matching.station-search-active>.timetable-note{display:none}

/* Quiet comparison borders retain contrast in both themes. */
.bus-app .timetable-times .timetable-agree{border:1px solid #26915b;box-shadow:0 0 4px #26915b33}
.bus-app .timetable-times .timetable-differ{border:1px solid #d95a52;box-shadow:0 0 4px #d95a5233}
.preview-endpoint{display:block;width:14px;height:14px;background:#fff;border:3px solid #20915b;border-radius:50%;box-shadow:0 0 0 2px #fff,0 1px 5px #0005}
.preview-endpoint.end{border-color:#d94c43}

/* Phone controls share existing rows; the map and editor split the remaining height. */
.bus-app .mobile-style-button{display:none}
@media(max-width:900px){
  .bus-app .app-shell{--legal-height:calc(34px + env(safe-area-inset-bottom))}
  .bus-app .bus-workspace,.bus-app .bus-workspace[data-mobile-pane=list]{--list-strip-height:0px;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr);padding-bottom:var(--legal-height)}
  .bus-app .bus-workspace[data-map-only=true]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 0px}
  .bus-app .bus-workspace>.map-panel{grid-column:1;grid-row:1;margin-top:0}
  .bus-app .bus-workspace>.editor-column,.bus-app .bus-workspace[data-mobile-pane=list]>.editor-column,.bus-app .bus-workspace[data-mobile-pane=map]>.editor-column{grid-column:1;grid-row:2;padding-bottom:0}
  .bus-app .bus-workspace>.sidebar{top:0;height:calc(100% - var(--legal-height))}
  .bus-app .topbar-actions .mobile-list-entry{display:inline-flex;align-items:center;gap:4px;flex:none;background:var(--accent);border:1px solid var(--accent);color:var(--on-accent,#fff);border-radius:5px;transition:background .18s,box-shadow .18s}
  .bus-app .mobile-list-entry .drawer-list-icon,.bus-app .mobile-list-entry .drawer-route-count,.bus-app .mobile-list-entry .drawer-toggle-state{display:none}
  .bus-app .mobile-list-entry .drawer-toggle-label{font-size:12px;line-height:20px;letter-spacing:0}
  .bus-app .mobile-list-entry .drawer-indicator{display:flex;align-items:center;width:12px;height:16px;margin:0;background:none;border:0;box-shadow:none}
  .bus-app .mobile-list-entry .drawer-chevron{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.8;transition:transform .22s}
  .bus-app .mobile-list-entry[aria-expanded=true]{background:color-mix(in srgb,var(--accent) 75%,#000);box-shadow:inset 0 0 0 1px #ffffff60}
  .bus-app .mobile-list-entry[aria-expanded=true] .drawer-chevron{transform:rotate(180deg)}
  .bus-app .segment-controls{display:flex;align-items:center;justify-content:space-between;gap:8px}
  .bus-app .segment-controls .append-option{margin:0}
  .bus-app .mobile-style-button{display:inline-flex;align-items:center;justify-content:center;min-height:30px;margin-left:auto;padding:4px 10px;font-size:12px;line-height:20px;border:1px solid var(--accent-border);border-radius:4px;background:var(--accent-pale);color:var(--accent)}
  .bus-app .mobile-style-button[aria-pressed=true]{background:var(--accent);color:var(--on-accent,#fff)}
  .bus-app .bus-workspace[data-mobile-style=true] #addPane:not(.hidden),.bus-app .bus-workspace[data-mobile-style=true] #editPane:not(.hidden){display:block}
  .bus-app .bus-workspace[data-mobile-style=true] #addPane>:not(.segment-controls),.bus-app .bus-workspace[data-mobile-style=true] #editPane>:not(.editor-heading):not(.edit-order){display:none}
  .bus-app .bus-workspace .selection-panel>#addFooter{position:static;display:flex;margin:8px 0 0;padding:8px 0 0;border-top:1px solid var(--line-soft);background:transparent;box-shadow:none}
  .bus-app .bus-workspace #addFooter #appendFeedback{display:none}
  .bus-app .bus-legal-footer{padding:3px 8px calc(3px + env(safe-area-inset-bottom))}
  .bus-app .bus-legal-footer .legal-links{display:flex;flex-wrap:wrap;justify-content:center;column-gap:8px;font-size:10px;line-height:14px}
  .bus-app .bus-legal-footer .legal-credit{display:contents}
  .bus-app .bus-legal-footer .legal-links a{white-space:nowrap}
  .bus-app .bus-legal-footer .creator-link{order:1;flex-basis:100%}
}
@media(max-width:360px){
  .bus-app .topbar .brand{font-size:12px;gap:3px}
  .bus-app .topbar-actions{gap:2px}
  .bus-app .topbar-actions .button{padding-inline:4px}
}

/* iOS must not zoom when a field receives focus; keep all phone form values consistent. */
@media(max-width:900px){
  .bus-app .bus-workspace input:not([type=checkbox]):not([type=color]):not([type=range]),.bus-app .bus-workspace select,.bus-app .modal-root input:not([type=checkbox]):not([type=color]):not([type=range]),.bus-app .modal-root select{font-size:16px}
}

.bus-app .timetable-bounds{display:flex;flex-wrap:wrap}
.bus-app .timetable-bounds span{white-space:nowrap;padding-inline:6px}

/* List actions stay alongside the controls they affect. */
.bus-app .list-management-actions{display:flex;align-items:center;gap:5px;flex:none}
.bus-app .list-management-actions .text-button{min-height:28px;padding:3px 5px;font-size:12px;line-height:20px}
.bus-app .list-management-actions #clearButton{color:var(--danger)}
.bus-app .bus-workspace>.drawer-pin{position:absolute;pointer-events:auto;z-index:57;left:calc(var(--drawer-width,338px) - 156px);top:5px;width:80px;height:28px;min-height:28px;padding:3px 5px;font-size:12px;line-height:20px;border-radius:4px}
.bus-app .bus-workspace>.drawer-pin:disabled{opacity:.4;cursor:default}
.bus-app .bus-workspace[data-map-only=true]>.drawer-pin{visibility:hidden;pointer-events:none}

.bus-app .touch-quick-add{display:none}
@media(max-width:900px){
  .bus-app .app-shell{--legal-height:calc(20px + env(safe-area-inset-bottom))}
  .bus-app .bus-legal-footer .creator-link{display:none}
  .bus-app .bus-workspace>.drawer-pin{display:none}
  .bus-app .bus-workspace{--bus-control:32px}
  .bus-app .bus-workspace .editor{padding:6px 10px}
  .bus-app .bus-workspace .search-tools{margin-bottom:4px}
  .bus-app .bus-workspace .bus-search-form{margin:0}
  .bus-app .bus-workspace .bus-search-form input:not([type=checkbox]):not([type=color]):not([type=range]){font-size:var(--bus-small);line-height:20px;min-height:32px;height:32px;padding-block:4px}
  .bus-app .bus-workspace .search-tools .search-mode button,.bus-app .bus-workspace .search-tools .map-stations-button{font-size:var(--bus-small);min-height:30px;padding-block:4px}
  .bus-app .segment-controls{margin:2px 0}
  .bus-app .segment-controls .append-option{padding:3px 0;min-height:28px}
  .bus-app .bus-workspace .inline-status{margin:4px 0;line-height:18px}
  .bus-app .bus-workspace .inline-status:empty{margin:0}
  .bus-app .bus-workspace .result-row{gap:4px}
  .bus-app .bus-workspace .result-card{min-height:48px;padding:4px 0;gap:6px}
  .bus-app .bus-workspace .result-card .route-thumb{width:40px;height:40px}
  .bus-app .bus-workspace .result-card :is(strong,small){line-height:18px}
  .bus-app .bus-workspace :is(.touch-preview,.touch-quick-add,.mobile-style-button){display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;height:32px;min-height:32px;padding:5px 7px;border:1px solid var(--accent-border);border-radius:4px;font-size:12px;line-height:20px;background:var(--accent-pale);color:var(--accent)}
  .bus-app .bus-workspace .touch-quick-add{background:var(--accent);border-color:var(--accent);color:var(--on-accent,#fff)}
  .bus-app .bus-workspace .search-row .button{border-radius:4px;padding-block:5px}
  .bus-app .bus-workspace .touch-preview[aria-pressed=true]{background:var(--accent);color:var(--on-accent,#fff)}
  .bus-app .bus-workspace[data-mobile-style=true] .segment-choice{display:none}
  .bus-app .mobile-style-button svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
  .bus-app .bus-workspace .line-appearance{margin-top:4px;padding:8px}
}

/* The viewport is fixed; only the list, editor and dialogs scroll. */
@media(min-width:901px){
  html:has(.bus-app),body.bus-app{height:100%;overflow:hidden;overscroll-behavior:none}
  .bus-app .app-shell{height:100dvh;max-height:100dvh;min-height:0}
  .bus-app .bus-workspace{min-height:0}
  .bus-app .bus-workspace>.map-panel{min-height:0}
  .bus-app .bus-workspace .sidebar .sidebar-scroll{padding-top:12px}
  .bus-app .bus-workspace .sidebar-scroll,.bus-app .bus-workspace .editor{overscroll-behavior-y:contain}
}

/* Startup view and optional township boundaries. */
.bus-app .startup-settings{margin:12px 0 16px;padding:12px;border:1px solid var(--line);border-radius:6px;background:var(--surface-subtle)}
.bus-app .startup-heading h4{margin:0;font-size:var(--bus-text);line-height:20px;font-weight:600}
.bus-app #startupValue{margin-top:8px;padding:8px 10px;border:1px solid var(--line-soft);border-radius:4px;background:var(--surface);font-size:var(--bus-text);line-height:20px;color:var(--accent);overflow-wrap:anywhere}
.bus-app .startup-settings .modal-copy{margin:6px 0 10px;font-size:var(--bus-caption);line-height:18px}
.bus-app .startup-city-form,.bus-app .startup-actions{display:grid;grid-template-columns:minmax(0,1fr) 88px;align-items:stretch;gap:8px;margin:8px 0 0}
.bus-app .startup-city-form input,.bus-app .startup-city-form button,.bus-app .startup-actions button{box-sizing:border-box;width:100%;min-width:0;height:36px;min-height:36px;padding:6px 8px;font-size:var(--bus-text);line-height:20px;margin:0;white-space:nowrap}
.bus-app .startup-city-form input{background:var(--surface)}
.bus-app .boundary-threshold{margin:0 0 6px;padding:10px 12px;border:1px solid var(--line-soft);border-radius:6px;background:var(--surface-subtle);min-width:0}
.bus-app .boundary-threshold-heading,.bus-app .boundary-threshold-scale{display:flex;align-items:center;justify-content:space-between;gap:12px}
.bus-app .boundary-threshold-heading{font-size:var(--bus-text);line-height:20px}
.bus-app .boundary-threshold output{color:var(--accent);font-variant-numeric:tabular-nums}
.bus-app .settings-body #townshipMinZoom{display:block;width:100%;height:28px;min-height:28px;padding:0;margin:4px 0;accent-color:var(--accent);border:0;box-shadow:none;background:transparent;cursor:pointer}
.bus-app .boundary-threshold-scale{font-size:var(--bus-caption);line-height:18px;color:var(--muted)}
.bus-app .boundary-threshold:disabled{opacity:.5}
.bus-app .boundary-threshold:disabled input{cursor:default}
@media(max-width:900px){
  .bus-app .settings-body #startupCity{font-size:var(--bus-text);min-height:36px}
}
.bus-app .startup-status{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.5}
.bus-app .startup-status:empty{display:none}
.bus-app .startup-matches{display:grid;gap:4px}
.bus-app .startup-matches:not(:empty){margin-top:6px}
.bus-app .startup-match{min-height:36px;padding:6px 8px;text-align:left;border:1px solid var(--line);border-radius:4px;background:var(--surface)}
.bus-app .startup-match:hover,.bus-app .startup-match:focus-visible{border-color:var(--accent-border);background:var(--accent-pale)}
.bus-app .startup-picker-map{position:relative;height:clamp(170px,53dvh,540px);margin-top:10px;overflow:hidden;border:1px solid var(--line);border-radius:6px}
.bus-app #startupMap{position:absolute;inset:0}
.bus-app .startup-crosshair{position:absolute;z-index:12;top:50%;left:50%;width:24px;height:24px;transform:translate(-50%,-50%);border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 2px #265746,0 2px 7px #0006;pointer-events:none}
.bus-app .startup-crosshair::after{content:'';position:absolute;inset:7px;border-radius:50%;background:#265746;outline:1px solid #fff}
.bus-app .township-legend{position:absolute;z-index:31;top:18px;left:12px;display:flex;align-items:center;gap:6px;padding:4px 7px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--muted);font-size:11px;line-height:16px;pointer-events:auto}
.bus-app .township-legend[hidden]{display:none}
.bus-app .township-legend a{text-decoration:underline;text-underline-offset:2px}
.bus-app .township-name{display:block;padding:0 3px;border-radius:3px;background:#ffffffe0;color:#4a2c77;font:600 12px/18px system-ui,sans-serif;white-space:nowrap;pointer-events:none}
.bus-app .city-boundary-name{color:#161616;font-weight:700}
@media(max-width:900px){
  .bus-app .township-legend{top:6px;left:6px;max-width:calc(100% - 115px);flex-wrap:wrap;column-gap:5px;row-gap:0}
  .bus-app .map-panel.is-fullscreen .township-legend{top:calc(6px + env(safe-area-inset-top))}
}
