  :root{
    --nav-h: 64px;
    --sidebar-width: 232px;
    --light-cyan: #ace1ff;
    --text-dark: #d0faff;
    --text-grey: #6b7280;
    --border: #e5e7eb;
  }
  *{box-sizing:border-box;}
  html,body{
    margin:0;
    height:100%;
    background:#0b1117;
    overscroll-behavior:none;
  }
body{
  overflow-x:hidden;
  background:#0b1117;
}
body.lines-view{ display:flow-root; }
  #map, #map-bg {
    touch-action: none;
    overscroll-behavior: none;
  }
  .app-loader{
    position:fixed;
    inset:0;
    z-index:2000;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(8,12,18,.72);
    backdrop-filter:blur(2px);
    transition:opacity .25s ease, visibility .25s ease;
  }

  .app-loader.hidden{
    opacity:0;
    visibility:hidden;
    pointer-events:none;
  }

  .loader {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bar {
    display: inline-block;
    width: 3px;
    height: 20px;
    background-color: rgba(255, 255, 255, .5);
    border-radius: 10px;
    animation: scale-up4 1s linear infinite;
  }

  .bar:nth-child(2) {
    height: 35px;
    margin: 0 5px;
    animation-delay: .25s;
  }

  .bar:nth-child(3) {
    animation-delay: .5s;
  }

  @keyframes scale-up4 {
    20% {
      background-color: #ffff;
      transform: scaleY(1.5);
    }

    40% {
      transform: scaleY(1);
    }
  }

  #map-bg{
    position:absolute;
    inset:0 0 0 var(--sidebar-width);
    overflow:hidden;
    z-index:0;
    background:#0b1117;
  }
  #map{
    width:100%;
    height:100%;
    background:#0b1117;
  }
  .leaflet-container {
    background:#0b1117;
  }

  header{
    position:fixed;
    inset:0 auto 0 0;
    z-index:1100;
    width:var(--sidebar-width);
    background:#f2f3f5;
    border-radius:0 16px 16px 0;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:14px;
    padding:18px 14px max(16px, env(safe-area-inset-bottom));
    box-shadow:0 8px 28px rgba(0,0,0,.24);
    overflow:hidden;
  }
  .logo{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:none;
    width:100%;
    min-height:54px;
    padding:0 8px;
    user-select:none;
  }
  .logo img{
    display:block;
    width:min(100%, 176px);
    height:50px;
    object-fit:contain;
    user-drag:none;
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;

  }
  header nav{
    display:flex;
    flex:1;
    flex-direction:column;
    gap:4px;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  header nav a{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:12px;
    min-height:42px;
    padding:0 12px;
    border-radius:9px;
    text-decoration:none;
    color:#3a3f4b;
    font-size:15px;
    font-weight:500;
  }
  header nav a img{
    display:block;
    width:26px;
    height:26px;
    flex:none;
    object-fit:contain;
  }
  .mobile-nav-toggle{ display:none; }
  header nav a:hover,
  header nav a:focus-visible{
    background:#dfe5f4;
    color:#1d4ed8;
    outline:none;
  }
  .user-btn{ align-self:center; flex:none; margin-top:auto; }

  .lines-page{
    position:relative;
    z-index:1;
    display:flex;
    flex-direction:column;
    width:calc(100% - var(--sidebar-width));
    max-width:none;
    height:100dvh;
    margin:0 0 0 var(--sidebar-width);
    padding:40px;
    background:#0b1117;
    color:#f2f4f7;
  }
  .lines-page,.lines-page *{ font-family:Arial,Helvetica,sans-serif; }
  .lines-content{ width:100%; max-width:1100px; margin-inline:auto; }
  .lines-page-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    padding:4px 2px 20px;
  }
  .lines-page-heading h1{ margin:0; color:#f8fafc; font-size:clamp(24px, 2.2vw, 32px); font-weight:750; letter-spacing:-.025em; }
  .lines-page-heading p{ margin:7px 0 0; color:#a8b3c5; font-size:14px; }
  .lines-tabs{ display:flex; flex:none; justify-content:safe center; gap:8px; width:100%; overflow-x:auto; border-bottom:1px solid #303a49; }
  .lines-tab{ flex:none; min-height:44px; padding:0 16px; border:0; border-bottom:2px solid transparent; background:transparent; color:#aab4c7; font:inherit; font-size:14px; font-weight:600; text-align:center; cursor:pointer; white-space:nowrap; }
  .lines-tab:hover{ color:#f8fafc; }
  .lines-tab[aria-selected="true"]{ border-bottom-color:#8a97ff; color:#f8fafc; }
  .lines-tab:focus-visible{ outline:2px solid #8a97ff; outline-offset:-2px; }
  .lines-tab-panel{ display:flex; flex:1 1 auto; flex-direction:column; min-height:0; }
  .lines-tab-panel[hidden]{ display:none; }
  .lines-table-wrap{
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    flex:1 1 auto;
    align-self:center;
    width:100%;
    max-width:800px;
    min-height:0;
    overflow:auto;
    margin-top:20px;
    padding:6px 18px 10px;
    border:1px solid #293547;
    border-radius:18px;
    background:linear-gradient(145deg,rgba(20,27,38,.98),rgba(14,19,28,.98));
    color:#f2f4f7;
    box-shadow:0 16px 38px rgba(0,0,0,.2),inset 0 1px rgba(255,255,255,.025);
    scrollbar-color:#50596a transparent;
  }
  .lines-table{ width:100%; max-width:760px; min-width:640px; margin:0 auto; table-layout:fixed; border-collapse:separate; border-spacing:0 9px; text-align:left; }
  .lines-counts-wrap{ align-self:center; width:100%; max-width:800px; margin-inline:auto; }
  .lines-table th:nth-child(1){ width:12%; text-align:center; }
  .lines-table th:nth-child(2),.lines-table th:nth-child(3){ width:21%; }
  .lines-table th:nth-child(4){ width:46%; }
  .lines-table td:nth-child(4){ text-align:left; }
  .lines-table thead{ position:sticky; top:0; z-index:1; }
  .lines-table thead th{ padding:12px 12px; border-bottom:1px solid #344155; background:#182130; color:#94a3b8; font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
  .lines-table thead th:first-child{ border-radius:10px 0 0 10px; }
  .lines-table thead th:last-child{ border-radius:0 10px 10px 0; }
  .lines-table th,.lines-table td{ padding:11px 12px; border-top:1px solid rgba(76,94,119,.44); border-bottom:1px solid rgba(76,94,119,.44); background:inherit; }
  .lines-table tbody th:first-child,.lines-table tbody td:first-child{ border-left:1px solid rgba(76,94,119,.44); border-radius:11px 0 0 11px; }
  .lines-table tbody th:last-child,.lines-table tbody td:last-child{ border-right:1px solid rgba(76,94,119,.44); border-radius:0 11px 11px 0; }
  .lines-table tbody th{ width:auto; color:#f8fafc; font-size:14px; font-weight:700; }
  .lines-table tbody td{ color:#c0cada; font-size:14px; }
  .lines-table tbody tr{ background:linear-gradient(110deg,#182230,#131c28); box-shadow:0 5px 15px rgba(0,0,0,.16); transition:background .16s ease,box-shadow .16s ease; }
  .lines-table tbody tr:hover{ background:linear-gradient(110deg,#202e3e,#192536); box-shadow:0 7px 19px rgba(0,0,0,.24); }
  .lines-table tbody th[scope="row"]{ font-variant-numeric:tabular-nums; }
  .route-actions{ display:flex; align-items:center; justify-content:flex-start; gap:7px; }
  .route-info-button{ display:inline-block; position:relative; padding:10px 25px; border:0; background:#000; color:#fff; font-family:sans-serif; font-size:.9em; text-align:center; cursor:pointer; transition:background-color .15s ease; }
  .route-info-button:hover{ background:teal; color:#fff; }
  .route-info-button:focus-visible{ outline:2px solid #8a97ff; outline-offset:2px; }
  .additional-routes-wrap{ align-self:center; width:100%; max-width:800px; margin-top:20px; padding:0; overflow:visible; border:0; border-radius:0; background:transparent; box-shadow:none; }
  .additional-routes-table{ min-width:0; margin:0 auto; }
  .additional-routes-table th:first-child{ width:12%; }
  .additional-routes-table th:nth-child(2){ width:88%; }
  .additional-routes-table tbody td{ line-height:1.75; overflow-wrap:anywhere; color:#c0cada; }
  .lines-table tr[hidden]{ display:none; }
  .sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  .route-info-dialog{ position:fixed; top:50%; left:calc(50% + 116px); width:min(480px,calc(100vw - var(--sidebar-width) - 28px)); max-height:min(82dvh,700px); margin:0; padding:18px; overflow:auto; transform:translate(-50%,-50%); border:1px solid #3a4351; border-radius:12px; background:#111319; color:#f2f4f7; box-shadow:0 18px 44px rgba(0,0,0,.45); }
  .route-info-dialog::backdrop{ background:rgba(8,10,14,.68); backdrop-filter:blur(2px); }
  .route-info-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
  .route-info-header h2{ margin:0; color:#f8fafc; font-size:20px; }
  .route-info-header button{ width:32px; height:32px; padding:0; border:1px solid #343a47; border-radius:50%; background:#20242d; color:#e8ebf0; font:inherit; font-size:21px; cursor:pointer; }
  .route-info-header button:hover{ background:#2b303b; }
  .route-direction-select-wrap{ display:flex; flex-direction:column; gap:6px; margin-bottom:12px; color:#aab4c7; font-size:12px; }
  .route-direction-select-wrap[hidden]{ display:none; }
  .route-direction-select-wrap select{ width:100%; min-height:40px; padding:0 10px; border:1px solid #414957; border-radius:7px; background:#191d26; color:#f2f4f7; font:inherit; font-size:12px; }
  .route-info-list{ display:flex; flex-direction:column; gap:0; margin:0; padding:0; list-style:none; }
  .route-info-list li{ display:flex; flex-direction:column; gap:3px; min-height:42px; padding:10px 4px; border-bottom:1px solid #29313d; color:#e6ebf2; font-size:13px; }
  .route-info-list li:last-child{ border-bottom:0; }
  .route-info-list strong{ color:#f8fafc; font-size:14px; }
  .route-info-list small{ color:#9ca8bb; font-size:11px; }
  .route-info-status{ margin:0; padding:12px 4px 0; color:#aab4c7; font-size:12px; }
  .route-info-status:empty{ display:none; }

  .user-btn{
    width:38px;
    height:38px;
    border-radius:50%;
    background:#dfe6fb;
    border:none;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    padding:0;
    overflow:hidden;
  }
  .user-btn img{
    width:22px;
    height:22px;
    object-fit:contain;
  }
  .user-btn:hover{ background:#cfd9fb; }

  /* ---------- map chrome (zoom + counter, just for fidelity) ---------- */
  .map-control-stack{
    position:absolute;
    right:16px;
    bottom:16px;
    z-index:10;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }
  .zoom-ctrl{
    position:relative;
    display:flex;
    flex-direction:column;
    border-radius:8px;
    overflow:hidden;
    box-shadow:0 1px 3px rgba(0,0,0,.15);
  }
  .zoom-ctrl button{
    width:34px;
    height:34px;
    background:#fff;
    border:none;
    border-bottom:1px solid var(--border);
    font-size:18px;
    cursor:pointer;
    color:#444;
  }
  .zoom-ctrl button:last-child{ border-bottom:none; }

  .bus-count{
    position:absolute;
    left:calc(var(--sidebar-width) + 16px);
    bottom:16px;
    z-index:10;
    background:#fff;
    padding:8px 14px;
    border-radius:8px;
    font-size:14px;
    color:#111827;
    box-shadow:0 1px 3px rgba(0,0,0,.15);
  }
  .bus-count b{ font-weight:700; color:#111827; }

  .search-backdrop{
    position:fixed;
    inset:0;
    z-index:1160;
    display:flex;
    align-items:flex-end;
    justify-content:center;
    padding:0 14px;
    background:rgba(8,10,14,.62);
    backdrop-filter:blur(2px);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .18s ease, visibility .18s ease;
  }
  .search-backdrop.open{ opacity:1; visibility:visible; pointer-events:auto; }
  .search-panel{
    display:flex;
    flex-direction:column;
    width:min(100%, 720px);
    max-height:min(88dvh, 760px);
    padding:8px 22px 20px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.14);
    border-radius:16px 16px 0 0;
    background:#111319;
    color:#f8fafc;
    box-shadow:0 18px 44px rgba(0,0,0,.4);
    transform:translateY(100%);
    opacity:0;
    transition:transform .35s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
  }
  .search-panel.open{ transform:translateY(0); opacity:1; }
  .search-header{ display:flex; align-items:center; justify-content:space-between; padding:0; }
  .search-field-wrap{ display:flex; align-items:center; gap:10px; margin:0 0 12px; padding:0 12px; border:1px solid #414957; border-radius:10px; background:#1c2028; }
  .search-field-wrap:focus-within{ border-color:#8a97ff; }
  .search-field-wrap img{ width:17px; height:17px; object-fit:contain; opacity:.75; }
  .search-field-wrap input{ width:100%; min-width:0; height:44px; padding:0; border:0; outline:0; background:transparent; color:#f8fafc; font:inherit; font-size:14px; }
  .search-field-wrap input::placeholder{ color:#9aa4b4; }
  .search-results{ max-height:min(55vh, 420px); overflow:auto; overscroll-behavior:contain; padding:0 0 8px; }
  .search-result{ display:flex; align-items:center; gap:11px; width:100%; min-height:56px; padding:8px; border:0; border-radius:9px; background:transparent; color:#f8fafc; text-align:left; cursor:pointer; }
  .search-result:hover,.search-result:focus-visible{ outline:none; background:#202630; }
  .search-result-kind{ flex:none; min-width:56px; padding:5px 7px; border-radius:6px; background:#283a5b; color:#a9caff; font-size:10px; font-weight:700; text-align:center; }
  .search-result-kind.bus{ background:#263149; color:#adc2ff; }
  .search-result-copy{ display:flex; flex-direction:column; gap:3px; min-width:0; }
  .search-result-copy strong{ overflow:hidden; font-size:13px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
  .search-result-copy small{ overflow:hidden; color:#9ca8bb; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
  .search-hint{ margin:0; padding:16px 12px 18px; color:#9ca8bb; font-size:12px; line-height:1.4; }
  .search-backdrop button:focus-visible{ outline:2px solid #8aafff; outline-offset:2px; }

  .map-actions{
    position:absolute;
    left:calc(var(--sidebar-width) + 16px);
    bottom:62px;
    z-index:10;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }
  .map-tool-row{
    display:flex;
    align-items:center;
    gap:8px;
  }
  .map-filter-wrap{ position:relative; }
  .vehicle-filter-panel{
    position:absolute;
    left:0;
    bottom:calc(100% + 8px);
    z-index:20;
    width:min(260px, calc(100vw - 32px));
    padding:14px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:10px;
    background:#171b20;
    color:#f5f5f5;
    box-shadow:0 8px 28px rgba(0,0,0,.38);
  }
  .vehicle-filter-panel[hidden]{ display:none; }
  .vehicle-filter-panel fieldset{ display:grid; gap:9px; margin:0 0 13px; padding:0; border:0; }
  .vehicle-filter-panel fieldset:last-of-type{ margin-bottom:12px; }
  .vehicle-filter-panel legend{ margin-bottom:8px; color:#aeb8c4; font-size:11px; font-weight:700; }
  .vehicle-filter-panel label{ display:flex; align-items:center; gap:9px; min-height:22px; font-size:13px; cursor:pointer; }
  .vehicle-filter-panel input{ width:16px; height:16px; margin:0; accent-color:#48b89a; }
  .vehicle-filter-reset{ width:100%; min-height:34px; border:1px solid rgba(255,255,255,.16); border-radius:6px; background:#252b31; color:#f5f5f5; font:inherit; font-size:12px; cursor:pointer; }
  .vehicle-filter-reset:hover{ background:#303840; }
  .vehicle-filter-panel :focus-visible{ outline:2px solid #48b89a; outline-offset:2px; }
  .map-action,
  .location-button{
    border:0;
    cursor:pointer;
    font:inherit;
    box-shadow:0 2px 8px rgba(0,0,0,.25);
    transition:transform .15s ease, box-shadow .15s ease;
  }
  .map-action:hover{
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(0,0,0,.3);
  }
  .location-button:hover{ background:#f4f4f5; }
  .map-action{
    color:#fff;
    background:#242424;
    min-height:38px;
    padding:0 14px;
    border-radius:10px;
    display:flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    font-weight:700;
  }

  .planner-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 14px;
    background: rgba(9, 10, 12, 0.42);
    backdrop-filter: blur(1px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .planner-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sheet {
    position: relative;
    width: min(100%, 720px);
    max-height: calc(100dvh - 28px);
    padding: 8px 22px 20px;
    overflow: auto;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    background: #111319;
    box-shadow: 0 18px 44px rgba(0,0,0,.4);
    color: #f8fafc;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
    opacity: 0;
  }

  .planner-backdrop.open .sheet {
    transform: translateY(0);
    opacity: 1;
  }

  .handle {
    position: relative;
    display: block;
    width: 100%;
    max-width: 400px;
    height: 24px;
    margin: 0 auto 4px;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    cursor: grab;
    touch-action: none;
  }

  .handle::before {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 5px;
    border-radius: 3px;
    background: #e5e7eb;
    content: "";
    transform: translateY(-50%);
  }

  .handle:active { cursor: grabbing; }

  .sheet.dragging,
  .bus-sheet.dragging {
    transition: none;
  }

  .form {
    display: flex;
    align-items: center;
    justify-content: stretch;
    gap: 14px;
  }

  .fields {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
  }

  .field {
    position: relative;
    height: 44px;
    padding: 0 44px 0 14px;
    border: 1px solid #414957;
    border-radius: 10px;
    background: #1c2028;
    color: #f8fafc;
    font-size: 14px;
    width: 100%;
    outline: none;
    box-shadow: none;
  }

  .field::placeholder {
    color: #9aa4b4;
    opacity: 1;
  }

  .field:focus-visible {
    border-color: #8a97ff;
  }

  .field-wrap {
    position: relative;
  }

  .planner-current-location,
  .planner-map-pick {
    position: absolute;
    top: 50%;
    display:grid;
    place-items:center;
    width:30px;
    height:30px;
    padding:0;
    border:0;
    border-radius:7px;
    background:transparent;
    cursor:pointer;
    transform:translateY(-50%);
  }
  .planner-current-location { right: 38px; }
  .planner-map-pick { right: 7px; }
  .planner-current-location:hover,
  .planner-map-pick:hover { background:#303847; }
  .planner-current-location img,
  .planner-map-pick img {
    width:17px;
    height:17px;
    object-fit: contain;
  }
  .planner-current-location:focus-visible,
  .planner-map-pick:focus-visible { outline:2px solid #8aafff; outline-offset:1px; }
  .planner-suggestions { position:absolute; top:calc(100% + 5px); left:0; right:0; z-index:20; max-height:220px; overflow:auto; padding:5px; border:1px solid #3d4655; border-radius:9px; background:#151922; box-shadow:0 12px 28px rgba(0,0,0,.4); }
  .planner-suggestions[hidden],.planner-map-pick-notice[hidden] { display:none; }
  .planner-stop-suggestion { display:block; width:100%; padding:9px 10px; border:0; border-radius:6px; background:transparent; color:#eef2f7; font:inherit; font-size:12px; text-align:left; cursor:pointer; }
  .planner-stop-suggestion:hover,.planner-stop-suggestion:focus-visible { outline:none; background:#252c38; }
  .planner-suggestion-empty { margin:0; padding:9px 10px; color:#aab4c4; font-size:11px; line-height:1.4; }
  .planner-map-pick-notice { position:fixed; top:calc(var(--nav-h) + 16px); left:50%; z-index:1170; display:flex; align-items:center; gap:14px; width:max-content; max-width:calc(100% - 24px); padding:10px 12px 10px 16px; border:1px solid #3d4655; border-radius:10px; background:#111722; box-shadow:0 10px 28px rgba(0,0,0,.38); color:#eef2f7; font-size:13px; transform:translateX(-50%); }
  .planner-map-pick-notice button { flex:none; padding:6px 9px; border:1px solid #495569; border-radius:6px; background:#252c38; color:#f8fafc; font:inherit; font-size:11px; cursor:pointer; }
  .planner-map-pick-notice button:hover { background:#313b4b; }

  .calendar-icon {
    width: 17px;
    height: 17px;
    object-fit: contain;
    display: block;
  }

  .date {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    width: fit-content;
    padding: 0 10px;
    border: 1px solid #414957;
    border-radius: 10px;
    background: #1c2028;
    color: #d6dbe5;
    font-size: 12px;
    box-shadow: none;
  }

  .date input {
    width: 190px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f8fafc;
    font: inherit;
    color-scheme: dark;
  }
  .date:focus-within { border-color:#709cf1; }

  .swap {
    flex: none;
    width: 42px;
    height: 42px;
    border: 1px solid #414957;
    border-radius: 10px;
    background: #202630;
    display: grid;
    place-items: center;
    cursor: pointer;
  }

  .swap img {
    width: 20px;
    height: 20px;
    object-fit: contain;
  }

  .go {
    display: block;
    margin: 12px 0 0;
    min-width: 190px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #4368ff;
    border-radius: 8px;
    background: #264fe8;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
  }

  .go:disabled { opacity: .65; cursor: wait; }
  .planner-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 16px; }
  .planner-header h2 { margin:0; color:#f8fafc; font-size:30px; font-weight:750; }
  .planner-header button {
    display:grid;
    place-items:center;
    width:32px;
    height:32px;
    padding:0;
    border:1px solid #343a47;
    border-radius:50%;
    background:#20242d;
    color:#e8ebf0;
    font:inherit;
    font-size:21px;
    line-height:1;
    cursor:pointer;
  }
  .planner-header button img {
    display:block;
    width:15px;
    height:15px;
    object-fit:contain;
  }
  .planner-header button:hover { background:#2b303b; }
  .planner-status { min-height:18px; margin:10px 0 0; color:#9ca8bb; font-size:12px; }
  .journey-results { display:flex; flex-direction:column; gap:10px; max-height:min(48vh,360px); overflow:auto; margin:12px 0 0; padding:0; list-style:none; }
  .journey-results[hidden] { display:none; }
  .journey-option { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px 14px; padding:14px; border-radius:12px; background:#1c1e22; color:#eef0f4; }
  .journey-segments { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:8px; min-width:0; }
  .journey-segment { display:flex; align-items:center; gap:6px; min-width:0; color:#c0c4ca; font-size:13px; white-space:nowrap; }
  .journey-segment img { flex:none; width:18px; height:18px; object-fit:contain; }
  .journey-segment.transit { color:#e7e9ee; }
  .journey-segment.transit strong { display:block; color:#f2f4f7; font-size:14px; font-weight:650; }
  .journey-segment.transit small { display:block; margin-top:2px; color:#aeb5c0; font-size:12px; }
  .journey-separator { color:#626b79; font-size:15px; }
  .journey-directions { grid-column:1; display:flex; flex-direction:column; gap:8px; margin:4px 0 0; padding:0; list-style:none; }
  .journey-direction { display:flex; align-items:flex-start; gap:9px; min-width:0; }
  .journey-direction img { flex:none; width:16px; height:16px; margin-top:1px; object-fit:contain; }
  .journey-direction > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
  .journey-direction strong { color:#e9edf3; font-size:12px; font-weight:600; line-height:1.3; }
  .journey-direction small { color:#a3adbd; font-size:11px; line-height:1.35; overflow-wrap:anywhere; }
  .journey-walk-instructions { display:flex; flex-direction:column; gap:3px; margin:5px 0 0; padding-left:16px; color:#bac3d1; font-size:11px; line-height:1.4; }
  .journey-details { grid-column:1; margin:0; color:#9ca8bb; font-size:11px; line-height:1.35; }
  .journey-start { grid-column:2; grid-row:1; display:flex; align-items:center; justify-content:center; gap:7px; min-height:34px; padding:0 12px; border:0; border-radius:7px; background:#264fe8; color:#fff; font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }
  .journey-start img { width:16px; height:16px; object-fit:contain; }
  .planner-header button:focus-visible,.journey-start:focus-visible { outline:2px solid #8aafff; outline-offset:2px; }
  .route-follow-panel { position:fixed; left:50%; bottom:max(18px,env(safe-area-inset-bottom)); z-index:1050; display:flex; align-items:center; justify-content:space-between; gap:20px; width:min(680px,calc(100% - 32px)); padding:14px 16px; border:1px solid #394252; border-radius:12px; background:rgba(17,19,25,.97); box-shadow:0 12px 36px rgba(0,0,0,.36); color:#f8fafc; transform:translateX(-50%); }
  .route-follow-panel[hidden] { display:none; }
  .route-follow-copy { display:flex; align-items:flex-start; gap:14px; min-width:0; }
  .route-follow-live { display:inline-flex; flex:none; align-items:center; gap:7px; margin-top:2px; color:#87f0bd; font-size:11px; font-weight:800; }
  .route-follow-live span { width:8px; height:8px; border-radius:50%; background:#27d17f; box-shadow:0 0 0 4px rgba(39,209,127,.13); }
  .route-follow-instruction { display:flex; flex-direction:column; gap:3px; min-width:0; }
  .route-follow-instruction small { color:#a9b3c2; font-size:10px; font-weight:700; }
  .route-follow-instruction strong { overflow:hidden; color:#f6f8fb; font-size:15px; font-weight:700; text-overflow:ellipsis; }
  .route-follow-instruction > span { color:#b6bfcc; font-size:11px; line-height:1.35; }
  .route-follow-panel > button { flex:none; min-height:36px; padding:0 12px; border:1px solid #485163; border-radius:7px; background:#252b36; color:#edf1f7; font:inherit; font-size:12px; font-weight:600; cursor:pointer; }
  .route-follow-panel > button:hover { background:#303847; }
  .route-follow-panel > button:focus-visible { outline:2px solid #8aafff; outline-offset:2px; }

  .go:focus-visible,
  .date:focus-visible,
  .swap:focus-visible,
  .handle:focus-visible {
    outline: 3px solid #8a97ff;
    outline-offset: 2px;
  }

  .bus-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1120;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .bus-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
  }

  .bus-sheet {
    display: flex;
    flex-direction: column;
    width: min(100%, 720px);
    max-height: min(88dvh, 760px);
    padding: 10px 20px 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    background: #111319;
    box-shadow: 0 -16px 32px rgba(0,0,0,.28);
    color: #f8fafc;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
    pointer-events: auto;
    opacity: 0;
  }

  .bus-backdrop.open .bus-sheet {
    transform: translateY(0);
    opacity: 1;
  }
  .bus-sheet.error-state { min-height:min(430px, 65vh); }
  .bus-sheet.error-state .bus-line-badge,
  .bus-sheet.error-state .bus-plate-badge,
  .bus-sheet.error-state .bus-heading > p,
  .bus-sheet.error-state .bus-tools button:not(#busCloseButton) { display:none; }
  .bus-schedule-backdrop { position:fixed; inset:0; z-index:1190; display:none; align-items:center; justify-content:center; padding:14px; background:rgba(8,10,14,.62); backdrop-filter:blur(2px); }
  .bus-schedule-backdrop.open { display:flex; }
  .bus-schedule-modal { display:flex; flex-direction:column; width:min(560px,100%); max-height:min(84dvh,740px); overflow:hidden; border:1px solid rgba(255,255,255,.14); border-radius:16px; background:#111319; box-shadow:0 18px 44px rgba(0,0,0,.4); color:#f8fafc; animation:pop .18s ease-out; }
  .bus-schedule-modal-header { display:flex; flex:none; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px 12px; }
  .bus-schedule-modal-header small { color:#8f9bb0; font-size:10px; font-weight:700; }
  .bus-schedule-modal-header h2 { margin:4px 0 0; color:#f8fafc; font-size:19px; font-weight:700; }
  .bus-schedule-modal-header button { flex:none; width:32px; height:32px; padding:0; border:0; border-radius:50%; background:#252a34; color:#e8ebf0; font:inherit; font-size:22px; line-height:1; cursor:pointer; }
  .bus-schedule-modal .bus-route-view { max-height:calc(min(84dvh,740px) - 64px); overflow:auto; overscroll-behavior:contain; padding:0 20px 18px; }
  .bus-schedule-modal .bus-section-heading { margin-top:8px; }
  .bus-schedule-modal .bus-stop-list { margin-bottom:0; }
  .bus-schedule-modal button:focus-visible { outline:2px solid #8aafff; outline-offset:2px; }
  .bus-handle { flex: none; width: 110px; height: 38px; margin: 0 auto 6px; background: transparent; }
  .bus-handle::before { right: auto; left: 28px; width: 54px; height: 4px; background: #424754; }
  .bus-sheet-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .bus-sheet-header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:0 0 15px; border-bottom:1px solid #303746; }
  .bus-ticketing-status { width:fit-content; max-width:100%; margin-top:12px; padding:8px 12px; border:1px solid #3d495a; border-radius:8px; background:#1b212c; color:#d5dbe5; font-size:12px; font-weight:650; animation:bus-ticketing-slide-up .24s ease-out both; }
  .bus-ticketing-status.available { border-color:rgba(69,213,154,.35); background:rgba(69,213,154,.1); color:#81e6b2; }
  .bus-ticketing-status[hidden] { display:none; }
  @keyframes bus-ticketing-slide-up { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
  .bus-heading { min-width:0; }
  .bus-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  .bus-title-row h1 { margin:0; font-size:22px; font-weight:700; }
  .bus-line-badge { display:inline-flex; align-items:center; min-height:24px; padding:2px 9px; border-radius:5px; background:linear-gradient(180deg, #122df7 0%, #101f94 100%); color:#fff; font-size:13px; font-weight:700; }
  .bus-plate-badge { display:inline-flex; align-items:stretch; overflow:hidden; border-radius:5px; background:#fff; color:#111; font-size:12px; }
  .bus-plate-badge span { width:5px; background:#2f7dea; }
  .bus-plate-badge b { padding:4px 7px; font-weight:700; }
  .bus-heading > p { margin:7px 0 0; overflow:hidden; color:#aab4c7; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
  .bus-tools { display:flex; flex:none; gap:6px; }
  .bus-tools button { display:grid; place-items:center; width:32px; height:32px; padding:0; border:1px solid #343a47; border-radius:50%; background:#20242d; cursor:pointer; }
  .bus-tools img { display:block; width:16px; height:16px; object-fit:contain; }
  .bus-close-fallback { color:#e8ebf0; font-size:17px; line-height:1; }
  .bus-tools button:hover { background:#2b303b; }
  .bus-tools button[aria-pressed="true"] { border-color:#4da3ff; background:#20334a; }
  .bus-error-view { padding:22px 20px 18px; }
  .bus-error-view[hidden] { display:none; }
  .bus-data-icon { display:grid; place-items:center; width:24px; height:24px; margin:0 0 12px; border-radius:50%; background:#2f7dea; color:#fff; font-size:15px; font-weight:700; line-height:1; }
  .bus-warning-icon { display:block; margin:0 0 12px; color:#f5c518; font-size:30px; line-height:1; }
  .bus-error-view h2 { margin:0 0 8px; color:#f1f2f4; font-size:19px; font-weight:600; }
  .bus-error-view p { max-width:540px; margin:0; color:#9a9a9a; font-size:13px; line-height:1.45; }
  .bus-data-link { display:inline-block; margin-top:14px; color:#8db8ff; font-size:13px; font-weight:600; text-decoration:underline; }
  .bus-section-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:17px 0 12px; }
  .bus-section-heading h2 { margin:0; font-size:17px; font-weight:700; }
  .bus-section-heading span { color:#8f9bb0; font-size:10px; font-weight:700; letter-spacing:.06em; }
  .bus-live-indicator { color:#2f60e9!important; }
  .bus-live-stop-list { display:flex; flex-direction:column; gap:0; margin:0; padding:0; list-style:none; }
  .bus-live-stop { display:grid; grid-template-columns:14px minmax(0,1fr) auto; align-items:center; gap:10px; min-height:58px; padding:9px 0; border-bottom:1px solid #29313d; }
  .bus-live-stop:last-child { border-bottom:0; }
  .bus-live-stop .bus-stop-dot { position:relative; display:block; width:10px; height:10px; margin:0 2px; border:2px solid #28a6d5; border-radius:50%; background:#111319; }
  .bus-live-stop:not(:last-child) .bus-stop-dot::after { position:absolute; top:8px; left:2px; width:2px; height:56px; background:#176589; content:""; }
  .bus-live-stop.next .bus-stop-dot { border-color:#45d59a;  }
  .bus-live-stop-copy { display:flex; flex-direction:column; gap:3px; min-width:0; }
  .bus-live-stop-copy strong { overflow:hidden; color:#edf2f7; font-size:14px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
  .bus-live-stop-copy small { color:#8f9bb0; font-size:11px; }
  .bus-live-eta { color:#c9d5e4; font-size:13px; font-weight:700; white-space:nowrap; }
  .bus-live-eta.late { color:#ff6b6b; }
  .bus-live-eta.early { color:#f4c95d; }
  .bus-live-stop.next .bus-live-eta { color:#81e6b2; }
  .bus-live-view[hidden],.bus-route-view[hidden] { display:none; }
  .bus-expand-button { display:block; width:100%; min-height:34px; padding:7px 10px; border:1px solid #343a47; border-radius:8px; background:transparent; color:#b8c1d0; font:inherit; font-size:12px; font-weight:600; cursor:pointer; }
  .bus-expand-button:hover { border-color:#536174; color:#fff; }
  .bus-expand-button[hidden], .bus-stop[hidden], .bus-route-view[hidden], .bus-info-view[hidden] { display:none; }
  .bus-stop-list { margin:12px 0; padding:0; list-style:none; }
  .bus-stop { position:relative; display:grid; grid-template-columns:18px minmax(0,1fr) auto; column-gap:10px; align-items:start; min-height:54px; padding-bottom:14px; }
  .bus-stop:last-child { min-height:0; padding-bottom:0; }
  .bus-stop:not(:last-child)::before { content:""; position:absolute; top:15px; bottom:0; left:5px; width:2px; background:#343a47; }
  .bus-stop-dot { position:relative; z-index:1; width:12px; height:12px; margin-top:2px; border:2px solid #7b8492; border-radius:50%; background:#111319; }
  .bus-stop.active .bus-stop-dot { border-color:#2f7dea; background:#2f7dea; box-shadow:0 0 0 4px rgba(47,125,234,.2); }
  .bus-stop.past { opacity:.58; }
  .bus-stop-name { color:#f2f4f7; font-size:14px; font-weight:650; line-height:1.3; }
  .bus-stop-meta { margin-top:3px; color:#8f9bb0; font-size:11px; }
  .bus-stop.active .bus-stop-meta { color:#79aef5; }
  .bus-stop-time { padding-top:1px; color:#d7dce5; font-size:13px; font-weight:700; white-space:nowrap; }
  .bus-stop-message { padding:18px 10px; color:#9ca8bb; font-size:13px; text-align:center; }
  .bus-info-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; align-items:stretch; }
  .bus-photo-wrap { width:100%; min-width:0; min-height:160px; aspect-ratio:4/3; overflow:hidden; border-radius:10px; background:#d9dde4; }
  .bus-photo-wrap.missing { display:flex; align-items:center; padding:12px; border:1px dashed #526077; background:transparent; }
  .bus-photo { display:block; width:100%; height:100%; border-radius:inherit; object-fit:cover; }
  .bus-photo[hidden], .bus-photo-fallback[hidden] { display:none; }
  .bus-photo-fallback { display:flex; width:100%; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:16px 12px; border:1px dashed #526077; border-radius:10px; color:#cbd5e1; font-size:12px; text-align:center; }
  .bus-photo-fallback[hidden] { display:none; }
  .photo-contribute-button { display:inline-flex; min-height:36px; align-items:center; justify-content:center; padding:8px 14px; border:1px solid #397fdb; border-radius:8px; background:#2465b5; color:#fff; font:inherit; font-weight:700; text-decoration:none; }
  .photo-contribute-button:hover { background:#2f7dea; }
  .photo-contribute-button:focus-visible { outline:2px solid #8aafff; outline-offset:2px; }
  .bus-info-fields { display:flex; flex-direction:column; gap:12px; margin:0; }
  .bus-info-fields > div { padding-bottom:10px; border-bottom:1px solid #303746; }
  .bus-info-fields dt { color:#aab4c7; font-size:11px; }
  .bus-info-fields dd { margin:4px 0 0; color:#f2f4f7; font-size:13px; font-weight:600; }
  .bus-info-fields .bus-current-line { margin-top:auto; padding:10px 0 0; border:0; }

  .bus-sheet button:focus-visible { outline:2px solid #8aafff; outline-offset:2px; }

  @media (max-width: 560px) {
    .sheet { padding-left: 16px; padding-right: 16px; }
    .search-panel { padding-right:16px; padding-left:16px; }

    .form { gap: 9px; }
    .planner-header h2 { font-size:25px; }
    .fields { grid-template-columns: minmax(0,1fr); }
    .date { grid-column: 1; width:100%; }
    .date input { width:100%; min-width:0; }

    .field { font-size: 15px; }
    .planner-map-pick-notice { top:12px; gap:8px; padding:9px 10px; font-size:12px; }
    .planner-map-pick-notice button { padding:6px 8px; }

    .swap { width: 38px; height: 38px; }

    .swap img { width:18px; height:18px; }

    .go { width: 100%; }
    .journey-option { grid-template-columns:minmax(0,1fr); gap:8px; padding:12px; }
    .journey-segments { gap:5px; }
    .journey-segment { gap:4px; font-size:11px; white-space:normal; }
    .journey-segment img { width:15px; height:15px; }
    .journey-start { grid-column:1; grid-row:auto; justify-self:end; min-height:30px; }
    .route-follow-panel { bottom:max(10px,env(safe-area-inset-bottom)); width:calc(100% - 20px); padding:11px 12px; gap:10px; }
    .route-follow-copy { gap:9px; }
    .route-follow-instruction strong { font-size:13px; }
    .route-follow-panel > button { min-height:34px; padding:0 9px; font-size:11px; }

    .bus-sheet { max-height: min(86dvh, 760px); padding-right:16px; padding-left:16px; }
    .bus-schedule-backdrop { padding:10px; }
    .bus-schedule-modal { width:100%; max-height:88dvh; border-radius:14px; }
    .bus-schedule-modal .bus-route-view { max-height:calc(88dvh - 64px); padding-right:14px; padding-left:14px; }
    .bus-info-layout { grid-template-columns:1fr; gap:14px; }
    .bus-photo-wrap { max-height:180px; min-height:0; aspect-ratio:16/9; }
    .bus-info-fields { display:grid; grid-template-columns:1fr 1fr; column-gap:14px; }
    .bus-info-fields .bus-current-line { margin-top:0; }
  }

  @media (prefers-reduced-motion: reduce) {
    .sheet, .bus-sheet, .bus-ticketing-status {
      transition: none;
      animation: none;
    }
  }
  .map-action img{
    width:18px;
    height:18px;
    object-fit:contain;
    display:block;
  }
  .map-icon-action{
    width:38px;
    height:38px;
    min-height:38px;
    padding:0;
    justify-content:center;
  }
  .favorite-action{
    color:#080808;
    background:#e9e9e9;
  }
  .support-action{
    color:#fff;
    background:#1e58af;
  }
  .support-action span{ color:#648eea; }
  .location-button{
    position:relative;
    right:auto;
    bottom:auto;
    z-index:10;
    width:34px;
    height:34px;
    padding:0;
    border:1px solid rgba(0,0,0,.2);
    border-radius:4px;
    background:#fff;
    color:#374151;
    display:flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    box-shadow:0 1px 5px rgba(0,0,0,.35);
  }
  .location-button img{
    width:17px;
    height:17px;
    object-fit:contain;
    display:block;
  }
  .location-button.loading{ opacity:.55; cursor:wait; }

  .map-context-menu{
    position:fixed;
    z-index:30;
    display:none;
    min-width:205px;
    padding:6px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:10px;
    background:#17191f;
    box-shadow:0 8px 24px rgba(0,0,0,.35);
  }
  .map-context-menu.open{ display:flex; flex-direction:column; }
  .map-context-menu a,
  .map-context-menu button{
    width:100%;
    padding:10px 12px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:#f4f4f5;
    font:inherit;
    font-size:13px;
    text-align:left;
    text-decoration:none;
    cursor:pointer;
  }
  .map-context-menu a:hover,
  .map-context-menu button:hover{
    background:#2b2f39;
  }
  .vehicle-click-card{
    position:fixed;
    z-index:31;
    display:none;
    width:min(416px,calc(100vw - 24px));
    padding:16px;
    border:1px solid rgba(255,255,255,.14);
    border-radius:12px;
    background:#17191f;
    box-shadow:0 10px 30px rgba(0,0,0,.42);
    color:#f4f4f5;
    cursor:pointer;
  }
  .vehicle-click-card.open{ display:block; }
  .vehicle-click-card:focus-visible{ outline:2px solid #a5b4fc; outline-offset:2px; }
  .vehicle-click-card-heading{ display:flex; align-items:center; gap:11px; }
  .vehicle-click-card-line{
    display:grid;
    width:48px;
    height:48px;
    flex:none;
    place-items:center;
    border-radius:11px;
    background:#4f5f9c;
    color:#fff;
    font-size:18px;
    font-weight:700;
  }
  .vehicle-click-card-heading > div{ min-width:0; flex:1; }
  .vehicle-click-card-heading h2{ margin:0; color:#f8fafc; font-size:18px; line-height:1.2; }
  .vehicle-click-card-heading p{ margin:2px 0 0; color:#aab4c7; font-size:13px; font-weight:600; }
  .vehicle-click-card-status{
    display:grid;
    min-width:34px;
    height:24px;
    padding:0 8px;
    place-items:center;
    border-radius:999px;
    background:#657083;
    color:#fff;
    font-size:10px;
    font-weight:800;
    white-space:nowrap;
  }
  .vehicle-click-card-status.late{ background:#b5414d; }
  .vehicle-click-card-status.early{ background:#c77b24; }
  .vehicle-click-card-status.on-time{ background:#25845c; }
  .vehicle-click-card-heading > button{
    display:grid;
    width:28px;
    height:28px;
    flex:none;
    padding:0;
    place-items:center;
    border:0;
    border-radius:7px;
    background:transparent;
    color:#aab4c7;
    font:inherit;
    font-size:21px;
    cursor:pointer;
  }
  .vehicle-click-card-heading > button:hover{ background:#2b2f39; color:#fff; }
  .vehicle-click-card-details{
    display:inline-flex;
    min-height:30px;
    align-items:center;
    gap:8px;
    margin-top:9px;
    padding:0 10px;
    border:1px solid #586bd8;
    border-radius:6px;
    background:#4659c6;
    color:#fff;
    font:inherit;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
  }
  .vehicle-click-card-details:hover{ background:#3b4db4; }
  .vehicle-click-card-details img{ width:14px; height:14px; object-fit:contain; }
  .vehicle-click-card-next{ display:grid; gap:2px; margin:11px 1px 0; color:#d4d8e0; font-size:12px; line-height:1.35; }
  .vehicle-click-card-next strong{ color:#f8fafc; }
  .vehicle-click-card button:focus-visible{ outline:2px solid #a5b4fc; outline-offset:2px; }

  /* ---------- modal ---------- */
  .overlay{
    position:fixed;
    inset:0;
    background:rgba(10,10,14,.55);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:50;
    animation:fadeIn .15s ease-out;
  }
  .overlay.open{ display:flex; }
  @keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }

  .app-install-prompt{
    position:fixed;
    top:16px;
    right:16px;
    z-index:1300;
    width:min(360px,calc(100vw - 32px));
    padding:18px 46px 16px 18px;
    border:1px solid #3b4554;
    border-radius:12px;
    background:#111722;
    box-shadow:0 12px 32px rgba(0,0,0,.42);
    color:#f2f4f7;
  }
  .app-install-prompt[hidden],.app-install-button[hidden]{ display:none; }
  .app-install-prompt h2{ margin:0 0 8px; color:#f8fafc; font-size:17px; font-weight:700; }
  .app-install-prompt p{ margin:0; color:#c2cad6; font-size:13px; line-height:1.5; }
  .app-install-close{ position:absolute; top:8px; right:8px; width:30px; height:30px; padding:0; border:0; border-radius:7px; background:transparent; color:#aab4c7; font:inherit; font-size:22px; cursor:pointer; }
  .app-install-close:hover{ background:#252d3a; color:#fff; }
  .app-install-button{ min-height:36px; margin-top:12px; padding:0 12px; border:1px solid #6574ee; border-radius:7px; background:#4f5fdf; color:#fff; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
  .app-install-button:hover{ background:#4352cb; }
  .app-install-button:focus-visible,.app-install-close:focus-visible{ outline:2px solid #a5b4fc; outline-offset:2px; }

  .cookie-consent{
    position:fixed;
    inset:auto 0 0;
    z-index:1250;
    padding:8px 8px max(8px,env(safe-area-inset-bottom));
  }
  .cookie-consent[hidden]{ display:none; }
  .cookie-consent-card{
    width:min(1280px,100%);
    margin:0 auto;
    padding:20px 24px;
    border:1px solid #394252;
    border-radius:12px;
    background:#111722;
    box-shadow:0 12px 36px rgba(0,0,0,.48);
    color:#f2f4f7;
  }
  .cookie-consent-card h2{ margin:0; color:#f8fafc; font-size:18px; font-weight:650; }
  .cookie-consent-card > p{ max-width:1000px; margin:8px 0 0; color:#aab4c7; font-size:13px; line-height:1.55; }
  .cookie-consent-options{ display:flex; flex-wrap:wrap; gap:8px 24px; margin-top:14px; }
  .cookie-consent-option{ display:flex; align-items:center; gap:8px; min-height:28px; color:#d7deea; font-size:12px; }
  .cookie-consent-option input{ width:16px; height:16px; margin:0; accent-color:#6474ed; }
  .cookie-consent-option input:disabled{ accent-color:#8993a3; }
  .cookie-consent-help{ display:inline-flex; width:18px; height:18px; align-items:center; justify-content:center; border:1px solid #596579; border-radius:50%; color:#b5c0d1; font-size:11px; font-weight:700; cursor:help; }
  .cookie-consent-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
  .cookie-consent-actions button{ min-height:38px; padding:0 15px; border-radius:7px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
  .cookie-consent-save{ border:1px solid #596579; background:#1a2230; color:#d7deea; }
  .cookie-consent-save:hover{ background:#252f40; }
  .cookie-consent-accept{ border:1px solid #596aee; background:#4f5fdf; color:#fff; }
  .cookie-consent-accept:hover{ background:#4352cb; }
  .cookie-consent-actions button:focus-visible,.cookie-consent-option input:focus-visible{ outline:2px solid #a5b4fc; outline-offset:2px; }

  .profile-card{
    width:320px;
    background:#111319;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 20px 50px rgba(0,0,0,.5);
    animation:pop .18s ease-out;
  }
  @keyframes pop{
    from{ transform:scale(.94); opacity:0; }
    to{ transform:scale(1); opacity:1; }
  }

  .card-media{
    position:relative;
    height:150px;
  }
  .card-media img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
  }
  .avatar-badge{
    position:absolute;
    left:16px;
    bottom:-18px;
    width:40px;
    height:40px;
    border-radius:50%;
    background:#dfe6fb;
    border:3px solid #111319;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
  }
  .avatar-badge img{
    width:20px;
    height:20px;
    object-fit:contain;
  }

  .card-body{
    padding:28px 20px 20px 20px;
    color:#fff;
  }
  .card-body h3{
    margin:0 0 10px 0;
    font-size:20px;
    font-weight:700;
  }
  .card-body p{
    margin:0 0 20px 0;
    font-size:13.5px;
    line-height:1.5;
    color:#c7c9d1;
  }
  .card-body .btn-google-signin{
    width:100%;
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    overflow:hidden;
    background:#fff;
    box-shadow:0 1px 2px rgba(0,0,0,.08);
  }
  .card-body .btn-google-signin > div,
  .card-body .btn-google-signin iframe{
    width:100% !important;
    display:block;
  }
  .card-body .btn-google-signin[hidden],.site-auth-signout[hidden]{ display:none; }
  .site-auth-signout{
    display:block;
    width:100%;
    min-height:40px;
    margin-top:12px;
    border:1px solid #3b4554;
    border-radius:9px;
    background:#1a2230;
    color:#e2e8f0;
    font:inherit;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
  }
  .site-auth-signout:hover{ background:#252f40; }
  .site-auth-signout:focus-visible{ outline:2px solid #a5b4fc; outline-offset:2px; }
  .site-auth-username-form{ display:grid; gap:9px; margin-top:14px; }
  .site-auth-username-form[hidden]{ display:none; }
  .site-auth-username-form label{ color:#e2e8f0; font-size:13px; font-weight:600; }
  .site-auth-username-form input{
    width:100%;
    min-height:40px;
    padding:0 10px;
    border:1px solid #3b4554;
    border-radius:8px;
    background:#171b25;
    color:#f8fafc;
    font:inherit;
    font-size:14px;
  }
  .site-auth-username-form button{
    min-height:40px;
    border:0;
    border-radius:8px;
    background:#4658d4;
    color:#fff;
    font:inherit;
    font-size:13px;
    font-weight:650;
    cursor:pointer;
  }
  .site-auth-username-form button:disabled{ opacity:.65; cursor:wait; }
  .site-auth-username-status{ margin:0; color:#ff9aa6; font-size:12px; line-height:1.4; }
  .site-auth-username-status:empty{ display:none; }
  .site-auth-username-form :focus-visible{ outline:2px solid #a5b4fc; outline-offset:2px; }

  .donation-card{
    width:320px;
    max-width:calc(100% - 28px);
    padding:28px 20px 20px;
    border-radius:18px;
    background:#111319;
    color:#fff;
    text-align:center;
    box-shadow:0 20px 50px rgba(0,0,0,.5);
    animation:pop .18s ease-out;
  }
  .donation-card h2{
    margin:0 0 10px;
    font-size:20px;
    font-weight:700;
  }
  .donation-card p{
    margin:0 0 20px;
    font-size:13.5px;
    line-height:1.45;
    color:#c7c9d1;
  }
  .donation-option{
    width:100%;
    padding:12px 0;
    margin-top:10px;
    border:0;
    border-radius:10px;
    background:#e7e9ee;
    color:#111319;
    font-size:14.5px;
    font-weight:600;
    cursor:pointer;
  }
  .donation-option:hover{ background:#d8dbe3; }

  .info-card{
    width:360px;
    max-width:calc(100% - 28px);
    border-radius:18px;
    background:#111319;
    color:#fff;
    box-shadow:0 20px 50px rgba(0,0,0,.5);
    animation:pop .18s ease-out;
  }
  .info-card-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:18px 20px;
    border-bottom:1px solid #303746;
  }
  .info-card-header h2{
    margin:0;
    font-size:20px;
  }
  .info-card-header button{
    width:28px;
    height:28px;
    padding:0;
    border:0;
    background:transparent;
    color:#cbd5e1;
    font:inherit;
    font-size:24px;
    line-height:1;
    cursor:pointer;
  }
  .info-card-header button:hover{ color:#fff; }
  .info-card-body{
    padding:18px 20px 20px;
  }
  .info-card-body p{
    margin:0;
    color:#c7c9d1;
    font-size:13.5px;
    line-height:1.5;
  }
  .info-card-body p + p{ margin-top:14px; }

  .favorites-card{
    display:flex;
    flex-direction:column;
    width:min(420px, calc(100% - 28px));
    max-height:min(720px, calc(100dvh - 28px));
    overflow:hidden;
    border:1px solid #303746;
    border-radius:18px;
    background:#111319;
    color:#f8fafc;
    box-shadow:0 20px 50px rgba(0,0,0,.5);
    animation:pop .18s ease-out;
  }
  .favorites-status{
    margin:0;
    padding:16px 20px;
    color:#aab4c7;
    font-size:13px;
    line-height:1.5;
  }
  .favorites-status:empty{ display:none; }
  .favorites-list{
    display:flex;
    flex-direction:column;
    gap:6px;
    margin:0;
    padding:0 12px 12px;
    overflow-y:auto;
    list-style:none;
  }
  .favorite-stop-entry{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
  }
  .favorite-stop-open{
    flex:1;
    min-width:0;
    min-height:42px;
    padding:9px 12px;
    overflow:hidden;
    border:1px solid #303746;
    border-radius:8px;
    background:#171b25;
    color:#f2f4f7;
    font:inherit;
    font-size:13px;
    text-align:left;
    text-overflow:ellipsis;
    white-space:nowrap;
    cursor:pointer;
  }
  .favorite-stop-open:hover:not(:disabled){ background:#202936; }
  .favorite-stop-open:disabled{ color:#8f99aa; cursor:default; }
  .favorite-stop-remove{
    flex:none;
    width:36px;
    height:36px;
    border:1px solid #343a47;
    border-radius:8px;
    background:#20242d;
    color:#ff8a98;
    font:inherit;
    font-size:22px;
    line-height:1;
    cursor:pointer;
  }
  .favorite-stop-remove:hover{ background:#35242b; }
  .favorite-stop-open:focus-visible,.favorite-stop-remove:focus-visible{
    outline:2px solid #8aafff;
    outline-offset:2px;
  }

  .contribute-page{
    display:grid;
    min-height:calc(100dvh - 68px);
    place-items:center;
    padding-top:92px;
    background:linear-gradient(145deg,#0b1117 0%,#111a28 55%,#0b1117 100%);
    color:#f8fafc;
  }
  .contribute-card{
    width:min(560px,100%);
    min-width:0;
    border:1px solid #303746;
    border-radius:16px;
    background:#111319;
    box-shadow:0 18px 44px rgba(0,0,0,.28);
  }
  .contribute-site{
    min-height:100dvh;
    margin:0;
    background:#0b1117;
    color:#f8fafc;
  }
  .contribute-site-header{
    position:fixed;
    inset:0 0 auto;
    z-index:40;
    display:flex;
    width:100%;
    min-height:68px;
    align-items:center;
    flex-direction:row;
    gap:22px;
    padding:8px clamp(16px,4vw,48px);
    border-bottom:1px solid rgba(148,163,184,.18);
    border-radius:0;
    background:rgba(11,17,23,.94);
    box-shadow:0 8px 26px rgba(0,0,0,.18);
    backdrop-filter:blur(14px);
    overflow:visible;
  }
  .contribute-brand{ display:flex; flex:none; align-items:center; }
  .contribute-brand img{ display:block; width:150px; max-height:42px; object-fit:contain; filter:brightness(0) invert(1); }
  .contribute-site-header nav{ display:flex; flex:1; flex-direction:row; flex-wrap:wrap; justify-content:center; gap:6px; }
  .contribute-site-header nav a{
    padding:9px 12px;
    border-radius:8px;
    color:#cbd5e1;
    font-size:13px;
    font-weight:600;
    text-decoration:none;
  }
  .contribute-site-header nav a:hover,.contribute-site-header nav a[aria-current="page"]{
    background:#1b2635;
    color:#fff;
  }
  .contribute-site-header .user-btn{ flex:none; margin:0; }
  .contribute-back-link{ display:inline-block; margin-bottom:14px; color:#8fd7ff; font-size:13px; text-decoration:none; }
  .contribute-back-link:hover{ text-decoration:underline; }
  .contribute-card h1{
    margin:0;
    font-size:clamp(25px,4vw,32px);
    letter-spacing:-.025em;
  }
  .contribute-intro{ margin:9px 0 24px; color:#aab4c7; font-size:14px; line-height:1.6; }
  .contribute-login-required{
    padding:19px;
    border:1px solid #303d50;
    border-radius:12px;
    background:#151d29;
  }
  .contribute-login-required h2{ margin:0; font-size:17px; }
  .contribute-login-required p{ margin:7px 0 16px; color:#aab4c7; font-size:13px; line-height:1.5; }
  .contribute-login-button{
    min-height:40px;
    padding:0 15px;
    border:1px solid #5569e8;
    border-radius:8px;
    background:#4658d4;
    color:#fff;
    font:inherit;
    font-size:13px;
    font-weight:650;
    cursor:pointer;
  }
  .contribute-login-button:hover{ background:#3d4ebf; }
  .contribute-form[hidden],.contribute-login-required[hidden]{ display:none; }
  .contribute-signed-in{
    margin:0;
    padding:10px 12px;
    border:1px solid #29563e;
    border-radius:8px;
    background:#11251c;
    color:#a7efc0;
    font-size:12px;
  }
  .contribute-form{
    display:grid;
    gap:16px;
  }
  .contribute-form label{
    display:grid;
    gap:7px;
    color:#cbd5e1;
    font-size:13px;
    font-weight:600;
  }
  .contribute-form input,.contribute-form select{
    width:100%;
    min-height:44px;
    padding:9px 11px;
    border:1px solid #3b4554;
    border-radius:8px;
    background:#171b25;
    color:#f8fafc;
    font:inherit;
    font-size:14px;
  }
  .contribute-form input[type="file"]{
    padding:7px;
    font-size:12px;
  }
  .contribute-form input[type="file"]::file-selector-button{
    min-height:28px;
    margin-right:9px;
    padding:4px 9px;
    border:0;
    border-radius:6px;
    background:#2b3442;
    color:#f8fafc;
    cursor:pointer;
  }
  .contribute-form input:focus-visible,.contribute-form select:focus-visible,.contribute-form button:focus-visible{
    outline:2px solid #8aafff;
    outline-offset:2px;
  }
  .contribute-form > button{
    min-height:44px;
    border:0;
    border-radius:8px;
    background:#2f7dea;
    color:#fff;
    font:inherit;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
  }
  .contribute-form > button:hover{ background:#2467c8; }
  .contribute-form > button:disabled{ opacity:.65; cursor:wait; }
  .contribute-status{
    min-height:18px;
    margin:0;
    color:#aab4c7;
    font-size:13px;
    line-height:1.45;
  }
  .contribute-status.error{ color:#ff9aa6; }
  .contribute-status.success{ color:#81e6b2; }
  @media (max-width:560px){
    .contribute-site-header{ gap:5px; padding-inline:10px; }
    .contribute-brand img{ width:82px; }
    .contribute-site-header nav{ min-width:0; flex-wrap:nowrap; justify-content:flex-start; gap:0; overflow-x:auto; scrollbar-width:none; }
    .contribute-site-header nav::-webkit-scrollbar{ display:none; }
    .contribute-site-header nav a{ padding:8px 6px; font-size:11px; }
    .contribute-site-header .user-btn{ width:36px; height:36px; }
    .contribute-page{ padding-top:84px; }
    .contribute-form input[type="file"]{ max-width:100%; font-size:11px; }
  }

  .stop-card{
    width:min(100% - 28px, 390px);
    max-height:min(720px, calc(100vh - 28px));
    overflow:auto;
    border-radius:18px;
    background:#111319;
    color:#f8fafc;
    box-shadow:0 20px 50px rgba(0,0,0,.5);
    animation:pop .18s ease-out;
  }
  .stop-card-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:18px 18px 14px;
    border-bottom:1px solid #303746;
  }
  .stop-card-header small{
    color:#aab4c7;
    font-size:12px;
  }
  .stop-card-header h2{
    margin:4px 0 0;
    font-size:17px;
  }
  .stop-card-tools{ display:flex; gap:8px; }
  .stop-card-tools button{
    width:28px;
    height:28px;
    padding:0;
    border:0;
    background:transparent;
    color:#cbd5e1;
    font:inherit;
    font-size:22px;
    line-height:1;
    cursor:pointer;
  }
  .stop-card-tools button:hover{ color:#fff; }
  #favoriteStopButton{ color:#ff8a98; }
  #favoriteStopButton[aria-pressed="true"]{ color:#ff5369; }
  .favorite-status{
    margin:0;
    padding:0 18px;
    color:#ff9aa6;
    font-size:12px;
  }
  .favorite-status:empty{ display:none; }
  .stop-photo{
    margin:12px;
  }
  .stop-photo.missing{
    margin:0 12px;
  }
  .stop-photo img{
    display:block;
    width:100%;
    max-height:180px;
    border-radius:10px;
    object-fit:cover;
  }
  .stop-photo img[hidden]{
    display:none;
  }
  .stop-report{
    display:flex;
    width:100%;
    min-height:120px;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:16px 12px;
    border:1px dashed #526077;
    border-radius:10px;
    background:transparent;
    color:#cbd5e1;
    font:inherit;
    font-size:12px;
    text-align:center;
  }
  .stop-report[hidden]{
    display:none;
  }
  .stop-card > h3{
    margin:14px 18px 8px;
    color:#aab4c7;
    font-size:11px;
    letter-spacing:.08em;
  }
  .departure-list{ border-top:1px solid #303746; }
  .departure-row{
    display:grid;
    grid-template-columns:38px 1fr auto;
    align-items:center;
    gap:9px;
    min-height:62px;
    padding:9px 14px;
    border-bottom:1px solid #303746;
    background:#171b25;
  }
  .route-badge{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:24px;
    border-radius:4px;
    background:#b8bac0;
    color:#26303e;
    font-size:12px;
    font-weight:700;
  }
  .departure-content{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
  }
  .departure-destination{
    overflow:hidden;
    color:#b9c3d4;
    font-size:11px;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .departure-meta{
    color:#7d8aa5;
    font-size:10px;
    line-height:1.2;
    letter-spacing:.01em;
  }
  .departure-live{
    color:#86efac;
    font-weight:700;
    letter-spacing:.04em;
  }
  .departure-when{
    display:flex;
    justify-content:flex-end;
  }
  .departure-when strong{
    color:#f8fafc;
    font-size:15px;
    text-align:right;
  }
  .departure-empty{
    margin:0;
    padding:24px 18px;
    color:#9ca8bb;
    font-size:13px;
    text-align:center;
  }

  .stop-map-marker-wrapper{
    border:0;
    background:transparent;
  }

  .stop-map-marker{
    display:grid;
    width:26px;
    height:26px;
    margin:3px;
    border:2px solid #f8fbff;
    border-radius:50%;
    background:#2563eb;
    box-shadow:0 2px 5px rgba(0,0,0,.42);
    place-items:center;
    transform:scale(var(--stop-marker-scale, 1));
    transition:transform .15s ease;
  }

  .stop-map-marker.garage-stop-marker{
    border-color:#eb8d57;
    background:#eb8d57;
    box-shadow:0 2px 7px rgba(0,0,0,.48),0 0 0 2px rgba(250,204,21,.22);
  }

  .stop-map-marker img{
    width:17px;
    height:17px;
    object-fit:contain;
  }

  .stop-map-marker-wrapper:hover .stop-map-marker{
    transform:scale(calc(var(--stop-marker-scale, 1) * 1.14));
  }

  @media (prefers-reduced-motion:reduce){
    .stop-map-marker{ transition:none; }
  }

  .vehicle-bus-wrapper{
    background:transparent;
    border:none;
  }

  #map.vehicles-hidden .vehicle-bus-wrapper{
    visibility:hidden;
  }

  .vehicle-bus-marker{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:3px;
    width:84px;
    min-width:84px;
    height:24px;
    margin:10px 5px;
    padding:0 17px 0 5px;
    border-radius:5px;
    background:linear-gradient(180deg, #122df7 0%, #101f94 100%);
    box-shadow:0 3px 6px rgba(10,14,28,.22), inset 0 0 0 1px rgba(255,255,255,.06);
    color:#fff;
    white-space:nowrap;
    outline:none;
    transform:translateY(-1px);
    font-size:12px;
  }

  .vehicle-bus-marker,
  .vehicle-bus-marker * {
    font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  }

  .vehicle-bus-svg{
    width:19px;
    height:14px;
    flex-shrink:0;
  }

  .vehicle-bus-copy{
    display:flex;
    align-items:baseline;
    justify-content:center;
    gap:0;
    min-width:0;
    line-height:1;
    font-weight:700;
    letter-spacing:-.02em;
    color:#f7f9ff;
  }

  .vehicle-bus-route{
    font-size:12px;
    line-height:1;
  }

  .vehicle-bus-plate{
    font-size:10px;
    line-height:1;
    opacity:.95;
  }

  .vehicle-bus-arrow{
    position:absolute;
    right:4px;
    top:50%;
    width:10px;
    height:10px;
    object-fit:contain;
    transform:translateY(-50%) rotate(calc(var(--bus-angle) - 90deg));
    filter:drop-shadow(0 1px 2px rgba(0,0,0,.2));
  }

  @media (max-width:800px){
    .app-install-prompt{ top:calc(max(72px,env(safe-area-inset-top) + 72px)); right:10px; width:min(360px,calc(100vw - 20px)); }
    .cookie-consent-card{ padding:16px; }
    .cookie-consent-options{ gap:6px 14px; }
    .cookie-consent-actions{ justify-content:stretch; }
    .cookie-consent-actions button{ flex:1; }
    .search-backdrop,.planner-backdrop{
      align-items:flex-end;
      padding:0 max(10px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-left));
    }
    .search-panel{ width:100%; max-height:88dvh; }
    .sheet{ width:100%; max-height:88dvh; }
    .search-results{ max-height:calc(88dvh - 110px); }
    header{
      position:relative;
      inset:auto;
      width:auto;
      height:auto;
      min-height:64px;
      margin:max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
      padding:12px 14px;
      flex-wrap:wrap;
      flex-direction:row;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      row-gap:10px;
      overflow:visible;
    }
    .logo{
      order:1;
      width:auto;
      min-height:42px;
      padding:0;
    }
    .logo img{ width:120px; height:44px; }
    .mobile-nav-toggle{
      order:2;
      display:flex;
      flex:none;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      gap:5px;
      width:42px;
      height:42px;
      margin-left:auto;
      padding:0;
      border:1px solid #d5dbe7;
      border-radius:9px;
      background:#f2f3f5;
      cursor:pointer;
    }
    .mobile-nav-toggle span{
      display:block;
      width:19px;
      height:2px;
      border-radius:2px;
      background:#303744;
      transition:transform .18s ease, opacity .18s ease;
    }
    .mobile-nav-toggle[aria-expanded="true"] span:first-child{ transform:translateY(7px) rotate(45deg); }
    .mobile-nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
    .mobile-nav-toggle[aria-expanded="true"] span:last-child{ transform:translateY(-7px) rotate(-45deg); }
    .user-btn{ order:3; margin:0; }
    header nav{
      position:static;
      order:4;
      display:none;
      flex-direction:column;
      gap:4px;
      flex:0 0 100%;
      width:100%;
      max-height:calc(100dvh - 90px);
      padding:8px;
      overflow-y:auto;
      border:1px solid #e0e4eb;
      border-radius:12px;
      background:#f2f3f5;
      box-shadow:0 12px 30px rgba(0,0,0,.24);
    }
    header.menu-open nav{ display:flex; }
    header nav a{
      flex:none;
      width:100%;
      min-height:44px;
      padding:0 12px;
      border-radius:8px;
    }
    header nav a img{ width:24px; height:24px; }
    .mobile-nav-toggle:focus-visible{ outline:2px solid #1d4ed8; outline-offset:2px; }
    #map-bg{ inset:0; }
    .lines-page{ width:calc(100% - 24px); height:calc(100dvh - 112px); margin:16px 12px 20px; padding:20px; }
    .tickets-page{ width:calc(100% - 28px); margin:20px 14px 0; }
    .lines-page-heading{ align-items:stretch; flex-direction:column; gap:14px; padding:0 0 14px; }
    .lines-page-heading h1{ font-size:24px; }
    .lines-page-heading p{ font-size:13px; }
    .lines-tab{ min-height:42px; padding:0 12px; font-size:13px; }
    .lines-table-wrap{ margin-top:16px; padding:6px 10px 8px; border-radius:14px; }
    .lines-table{ min-width:0; }
    .lines-table.additional-routes-table th:first-child{ width:56px; }
    .lines-table.additional-routes-table th:nth-child(2){ width:auto; }
    .additional-routes-wrap{ margin-top:16px; }
    .lines-table th:nth-child(1){ width:12%; }
    .lines-table th:nth-child(2),.lines-table th:nth-child(3){ width:19%; }
    .lines-table th:nth-child(4){ width:50%; }
    .route-actions{ gap:6px; }
    .lines-table th,.lines-table td{ padding:10px 8px; }
    .lines-table thead th{ font-size:10px; }
    .bus-count{
      left:max(10px, env(safe-area-inset-left));
      bottom:max(10px, env(safe-area-inset-bottom));
      padding:7px 11px;
      font-size:13px;
    }
    .map-actions{
      left:max(10px, env(safe-area-inset-left));
      bottom:calc(max(10px, env(safe-area-inset-bottom)) + 48px);
      gap:6px;
    }
    .map-action{
      min-height:36px;
      padding:0 11px;
      font-size:12px;
    }
    .map-control-stack{
      right:max(10px, env(safe-area-inset-right));
      bottom:max(10px, env(safe-area-inset-bottom));
      gap:6px;
    }
    .profile-card{
      width:calc(100% - 28px);
      max-width:320px;
    }
    .route-info-dialog{ left:50%; width:min(480px,calc(100vw - 28px)); }
  }


  @media (max-width:420px){
    .lines-page{ width:calc(100% - 16px); margin:12px 8px 16px; padding:16px; }
    .lines-page-heading h1{ font-size:22px; }
    .lines-tab{ padding:0 10px; font-size:12px; }
    .lines-table-wrap{ padding:5px 7px 7px; border-radius:12px; }
    .lines-table th,.lines-table td{ padding:9px 6px; }
    .route-actions{ flex-wrap:wrap; gap:5px; }
  }

  @media (max-width:560px){
    .lines-page .overflow-x-auto{ margin-top:16px; padding:0; overflow:visible; }
    .additional-routes-wrap{ margin-top:16px; padding:0; border-radius:0; }
    .lines-table{ display:block; min-width:0; border-spacing:0 10px; }
    .lines-table thead{
      position:absolute;
      width:1px;
      height:1px;
      padding:0;
      margin:-1px;
      overflow:hidden;
      clip:rect(0,0,0,0);
      white-space:nowrap;
      border:0;
    }
    .lines-table tbody{ display:grid; width:100%; gap:10px; }
    .lines-table tbody tr{
      display:grid;
      grid-template-areas:"line line" "weekday weekend" "actions actions";
      grid-template-columns:minmax(0,1fr) minmax(0,1fr);
      gap:0 12px;
      padding:10px 14px;
      border:1px solid rgba(76,94,119,.48);
      border-radius:14px;
    }
    .lines-table tbody th,.lines-table tbody td{
      display:block;
      width:auto;
      min-width:0;
      padding:5px 0;
      border:0;
      border-radius:0;
      background:transparent;
    }
    .lines-table tbody th:first-child{ grid-area:line; display:flex; align-items:center; gap:9px; text-align:left; font-size:17px; }
    .lines-table tbody th:first-child::after{ width:7px; height:7px; border-radius:50%; background:#38bdf8; content:""; }
    .lines-table tbody td:nth-child(2){ grid-area:weekday; }
    .lines-table tbody td:nth-child(3){ grid-area:weekend; }
    .lines-table tbody td:nth-child(2)::before,.lines-table tbody td:nth-child(3)::before{
      display:block;
      margin-bottom:3px;
      color:#91a0b5;
      font-size:10px;
      font-weight:700;
      letter-spacing:.06em;
      text-transform:uppercase;
    }
    .lines-table tbody td:nth-child(2)::before{ content:"Делник"; }
    .lines-table tbody td:nth-child(3)::before{ content:"Уикенд"; }
    .lines-table tbody td:nth-child(4){ grid-area:actions; padding-top:9px; border-top:1px solid rgba(76,94,119,.3); }
    .route-actions{ gap:8px; }
    .route-info-button{ min-height:38px; padding:8px 14px; border-radius:8px; font-size:.82em; }
    .additional-routes-table tbody tr{
      grid-template-areas:"route-number route";
      grid-template-columns:42px minmax(0,1fr);
      align-items:start;
      gap:0 10px;
    }
    .additional-routes-table tbody th:first-child{ grid-area:route-number; width:auto; padding-top:8px; }
    .additional-routes-table tbody th:first-child::after{ display:none; }
    .additional-routes-table tbody td:nth-child(2){ grid-area:route; line-height:1.6; }
    .additional-routes-table tbody td:nth-child(2)::before{
      display:block;
      margin-bottom:4px;
      color:#91a0b5;
      font-size:10px;
      font-weight:700;
      letter-spacing:.06em;
      text-transform:uppercase;
      content:"Маршрут";
    }
  }

  @media (prefers-reduced-motion: reduce){
    *,*::before,*::after{
      scroll-behavior:auto !important;
      animation-duration:0.01ms !important;
      animation-iteration-count:1 !important;
      transition-duration:0.01ms !important;
    }
  }

  ::-webkit-scrollbar{  
  width:6px;
    height:6px;
  }

  .stops-page{ padding-bottom:24px; }
  .stops-page .lines-content{ overflow:hidden; }
  .stops-page .lines-page-heading{ align-items:center; }
  .stop-search{
    display:flex;
    align-items:center;
    gap:10px;
    width:min(100%, 340px);
    min-height:44px;
    padding:0 13px;
    border:1px solid #344155;
    border-radius:10px;
    background:#131c28;
  }
  .stop-search img{ width:18px; height:18px; object-fit:contain; opacity:.72; }
  .stop-search input{
    width:100%;
    min-width:0;
    border:0;
    outline:0;
    background:transparent;
    color:#f8fafc;
    font:inherit;
    font-size:14px;
  }
  .stop-search input::placeholder{ color:#8793a7; }
  .stop-search:focus-within{ border-color:#8a97ff; box-shadow:0 0 0 2px rgba(138,151,255,.16); }
  .stops-list-heading{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(140px,.8fr) 150px;
    gap:20px;
    padding:10px 18px;
    color:#8793a7;
    font-size:10px;
    font-weight:700;
    letter-spacing:.1em;
  }
  .stops-list-heading span:first-child{ padding-left:47px; }
  .stops-list-heading span:nth-child(2){ text-align:center; }
  .stops-list{
    display:flex;
    flex:1 1 auto;
    flex-direction:column;
    gap:8px;
    min-height:0;
    margin:0;
    padding:0 6px 12px 0;
    overflow-y:auto;
    list-style:none;
  }
  .stop-row{
    display:grid;
    grid-template-columns:28px 8px minmax(180px,1fr) minmax(140px,.8fr) 150px;
    align-items:center;
    gap:14px;
    min-height:62px;
    padding:10px 16px;
    border:1px solid rgba(76,94,119,.44);
    border-radius:11px;
    background:linear-gradient(110deg,#182230,#131c28);
    box-shadow:0 5px 15px rgba(0,0,0,.16);
    transition:background .16s ease,box-shadow .16s ease;
  }
  .stop-row:hover{ background:linear-gradient(110deg,#202e3e,#192536); box-shadow:0 7px 19px rgba(0,0,0,.24); }
  .stop-position{ color:#c0cada; font-size:14px; font-weight:700; text-align:right; font-variant-numeric:tabular-nums; }
  .stop-marker{ width:7px; height:7px; border-radius:50%; background:#38bdf8; }
  .stop-label{ display:flex; flex-direction:column; gap:3px; min-width:0; }
  .stop-name{ overflow:hidden; color:#f8fafc; font-size:14px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
  .stop-code{ color:#91a0b5; font-size:12px; }
  .stop-routes{ display:flex; flex-wrap:wrap; justify-content:center; gap:5px; }
  .stop-route-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:20px;
    min-height:20px;
    padding:0 5px;
    border-radius:4px;
    background:#2563eb;
    color:#fff;
    font-size:11px;
    font-weight:700;
    line-height:1;
    font-variant-numeric:tabular-nums;
  }
  .stop-no-routes{ color:#91a0b5; font-size:12px; }
  .stop-schedule-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:36px;
    padding:0 9px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:#8fb4ff;
    font:inherit;
    font-size:12px;
    cursor:pointer;
    white-space:nowrap;
  }
  .stop-schedule-button::after{ content:"→"; font-size:17px; line-height:1; }
  .stop-schedule-button:hover{ background:rgba(143,180,255,.1); color:#c1d5ff; }
  .stop-schedule-button:focus-visible{ outline:2px solid #8a97ff; outline-offset:2px; }
  .stops-message{ padding:28px 16px; color:#a8b3c5; text-align:center; }
  .stops-message[hidden],.stops-list[hidden]{ display:none; }
  .route-info-dialog.stop-schedule-dialog{ left:50%; width:min(760px,calc(100vw - 32px)); }
  .stop-departures-wrap{ max-height:60dvh; overflow:auto; }
  .stop-departures-table{ display:table !important; width:100%; min-width:500px; table-layout:fixed; border-collapse:collapse; text-align:left; }
  .stop-departure-bus-column{ width:22%; }
  .stop-departure-destination-column{ width:40%; }
  .stop-departure-time-column{ width:18%; }
  .stop-departure-remaining-column{ width:20%; }
  .stop-departures-table thead{ display:table-header-group !important; }
  .stop-departures-table tbody{ display:table-row-group !important; }
  .stop-departures-table tr{ display:table-row !important; }
  .stop-departures-table th,.stop-departures-table td{ display:table-cell !important; padding:9px 10px; border:1px solid #303746; vertical-align:middle; }
  .stop-departures-table th{ position:sticky; top:0; z-index:1; background:#182130; color:#94a3b8; font-size:11px; font-weight:700; white-space:nowrap; }
  .stop-departures-table td{ color:#c0cada; font-size:13px; }
  .stop-departures-table tbody tr{ background:#171b25; }
  .stop-departures-table tbody tr:nth-child(even){ background:#131923; }
  .stop-departures-table tbody tr.stop-departure-passing{ background:rgba(37,99,235,.16); }
  .stop-departure-bus{ display:inline-flex; align-items:center; gap:7px; }
  .stop-departure-bus img{ width:16px; height:16px; object-fit:contain; }
  .stop-departure-passing .stop-departure-bus img{ animation:stop-bus-passing .8s ease-in-out infinite; }
  @keyframes stop-bus-passing{ 0%,100%{ opacity:1; } 50%{ opacity:.2; } }
  .stop-departure-destination{ max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .stop-departures-table time,.stop-departure-remaining{ white-space:nowrap; font-variant-numeric:tabular-nums; }
  .stop-departures-table time{ color:#f8fafc; font-weight:700; }
  .stop-departure-remaining{ color:#91a0b5 !important; }

  @media (max-width:760px){
    .stops-page .lines-page-heading{ align-items:stretch; }
    .stop-search{ width:100%; }
    .stops-list-heading{ grid-template-columns:minmax(0,1fr) minmax(110px,.65fr) 130px; gap:10px; }
    .stop-row{ grid-template-columns:24px 7px minmax(110px,1fr) minmax(100px,.65fr) 130px; gap:10px; padding:9px 10px; }
    .stop-name{ font-size:13px; }
    .stop-schedule-button{ font-size:11px; }
  }
  @media (max-width:560px){
    .stops-page .lines-content{ overflow:visible; }
    .stops-list-heading{ display:none; }
    .stops-list{ gap:9px; padding:0 0 12px; }
    .stop-row{
      grid-template-areas:"position marker label label" "routes routes routes schedule";
      grid-template-columns:24px 7px minmax(0,1fr) auto;
      gap:6px 9px;
      min-height:76px;
      padding:10px 12px;
    }
    .stop-position{ grid-area:position; }
    .stop-marker{ grid-area:marker; }
    .stop-label{ grid-area:label; }
    .stop-routes{ grid-area:routes; justify-content:flex-start; padding-left:40px; }
    .stop-schedule-button{ grid-area:schedule; min-height:32px; padding:0 5px; }
    .stop-code{ font-size:11px; }
    .route-info-dialog.stop-schedule-dialog{ width:calc(100vw - 28px); }
    .stop-departures-table th,.stop-departures-table td{ padding:8px 6px; font-size:11px; }
    .stop-departures-table th{ font-size:10px; }
    .stop-departure-bus{ gap:4px; }
    .stop-departure-bus img{ width:14px; height:14px; }
  }