*{box-sizing:border-box} html,body{margin:0;height:100%;overflow:hidden;font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;background:#07111f;color:#edf4ff}.topbar{height:76px;background:#0b1728;border-bottom:1px solid #203752;display:flex;align-items:center;justify-content:space-between;padding:12px 18px;gap:16px}.topbar h1{margin:0;font-size:22px}.topbar p{margin:2px 0 0;color:#9eb3cc}.actions{display:flex;gap:8px;align-items:center}.actions input{width:min(34vw,360px);background:#14243a;border:1px solid #2c4664;border-radius:14px;color:white;padding:12px 14px;font-size:15px}.actions button,#planRoute,#cancelRoute{border:0;background:#ffd447;color:#10151f;font-weight:800;border-radius:14px;padding:11px 14px;cursor:pointer}main{height:calc(100vh - 76px);display:grid;grid-template-columns:380px 1fr}.sidebar{overflow:auto;padding:14px;background:#0c1728;border-right:1px solid #26384d}.card{background:linear-gradient(180deg,#12233a,#0d1b2e);border:1px solid #263d59;border-radius:20px;padding:16px;margin-bottom:14px;box-shadow:0 12px 28px rgba(0,0,0,.15)}.card h2,.card h3{margin:0 0 10px}.card p{color:#afc0d3;margin:.35rem 0}.small{font-size:14px}.badges{display:flex;gap:7px;flex-wrap:wrap}.badge{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;border-radius:999px;color:#fff;font-weight:900;border:2px solid rgba(255,255,255,.9);box-shadow:0 2px 6px rgba(0,0,0,.28);padding:0 8px}.badge.gray{color:#111}.arrivals{display:flex;flex-direction:column;gap:9px}.arrival{display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:center;background:#1a2c46;border-radius:15px;padding:10px}.arrival small{display:block;color:#aebbd0}.eta{font-size:22px;font-weight:900;color:#ffd447}.eta.now{color:#6cf58b}.muted{color:#aebbd0}.sidebar select{max-width:48%;background:#182941;color:#fff;border:1px solid #304a68;border-radius:10px;padding:8px;margin:3px}.route-buttons{display:flex;gap:8px;margin-top:8px}.route-buttons button{flex:1}.route-result{margin-top:12px;color:#b8c8dc;line-height:1.45}.map-shell{position:relative;overflow:hidden;background:#9fc7df;touch-action:none;cursor:grab;user-select:none}.map-shell.dragging{cursor:grabbing}.map-wrap{position:absolute;left:0;top:0;width:1791px;height:2048px;transform-origin:0 0;will-change:transform}.map-wrap img,.map-wrap svg{position:absolute;left:0;top:0;width:1791px;height:2048px}.map-wrap img{pointer-events:none}.map-wrap svg{pointer-events:auto}.station-hit{pointer-events:all}.station-hit *{pointer-events:all}.hit-circle{fill:transparent;stroke:transparent;stroke-width:0;cursor:pointer;pointer-events:all}.station-hit:hover .hit-circle,.station-hit.selected-hit .hit-circle{fill:rgba(255,212,71,.18);stroke:rgba(255,212,71,.95)}body.edit .hit-circle{fill:rgba(0,184,255,.14);stroke:rgba(0,184,255,.85)}.route-line{fill:none;stroke-width:10;stroke-linecap:round;stroke-linejoin:round;opacity:.75;filter:drop-shadow(0 2px 4px rgba(0,0,0,.4))}.toast{position:absolute;right:14px;bottom:14px;background:rgba(12,23,40,.9);border:1px solid #29435e;border-radius:14px;padding:12px 14px;color:#d9e7f7}.debug-label{font:14px sans-serif;fill:#fff;paint-order:stroke;stroke:#000;stroke-width:4px;pointer-events:none}@media(max-width:850px){.topbar{height:auto;align-items:flex-start;flex-direction:column}.actions{width:100%}.actions input{width:100%}main{height:calc(100vh - 126px);grid-template-columns:1fr}.sidebar{position:absolute;z-index:5;left:10px;right:10px;bottom:10px;max-height:42vh;border:1px solid #26384d;border-radius:18px}.map-shell{height:100%}}

#editToggle{background:#34d399!important;color:#04130d!important}#editPanel{position:fixed;z-index:50;top:88px;right:16px;width:340px;max-height:calc(100vh - 110px);overflow:auto;background:#0b1728;border:1px solid #365677;border-radius:18px;box-shadow:0 18px 50px rgba(0,0,0,.45);padding:14px;display:none}body.editor-on #editPanel{display:block}.edit-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.edit-head button{background:#203752;color:#fff;border:0;border-radius:10px;font-size:22px;width:34px;height:34px;cursor:pointer}#editPanel label{display:block;color:#b9cce0;font-size:13px;margin:9px 0 4px}#editPanel input,#editPanel textarea{width:100%;background:#14243a;border:1px solid #2c4664;color:#fff;border-radius:10px;padding:9px;font-size:14px}#editPanel textarea{height:92px;resize:vertical}.xyrow{display:grid;grid-template-columns:1fr 1fr;gap:8px}.edit-buttons{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}.edit-buttons button{border:0;background:#ffd447;color:#10151f;font-weight:800;border-radius:10px;padding:9px 10px;cursor:pointer}.edit-buttons button:nth-child(3),#deleteStation{background:#ff6b6b;color:#1c0909}.edit-help{font-size:12px!important;color:#9eb3cc!important;line-height:1.35}.editor-on .hit-circle{fill:rgba(0,184,255,.18)!important;stroke:rgba(0,184,255,.95)!important}.editor-on .station-hit.selected-hit .hit-circle{fill:rgba(255,212,71,.35)!important;stroke:#ffd447!important}@media(max-width:850px){#editPanel{left:10px;right:10px;top:86px;width:auto;max-height:48vh}}
.edit-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}.edit-tabs button{border:1px solid #2c4664;background:#14243a;color:#cfe2f5;border-radius:10px;padding:9px;font-weight:800;cursor:pointer}.edit-tabs button.active{background:#ffd447;color:#10151f;border-color:#ffd447}#editPanel select{width:100%;background:#14243a;border:1px solid #2c4664;color:#fff;border-radius:10px;padding:9px;font-size:14px}#editPanel input[type=color]{height:38px;padding:3px}

#cancelRoute{background:#26384d;color:#edf4ff}
.route-start .hit-circle,.route-end .hit-circle{fill:rgba(255,212,71,.28);stroke:rgba(255,212,71,.95)}

.route-search-hit .hit-circle{fill:var(--routeColor,#8c8c8c)!important;stroke:none!important;stroke-width:0!important;opacity:.95!important}.route-search-line{display:none}.route-station-ring{display:none!important;pointer-events:none}.train-icon{pointer-events:none;filter:drop-shadow(0 2px 4px rgba(0,0,0,.45))}.train-icon text{font:800 9px Inter,Arial,sans-serif;fill:white;paint-order:stroke;stroke:rgba(0,0,0,.55);stroke-width:2px}.route-view{--routeColor:#ffd447}.route-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}.route-head small{display:block;color:#aebbd0}.route-count{font-weight:800;color:var(--routeColor);margin:8px 0}.route-station-list{list-style:none;margin:10px 0 0 0;padding:0;position:relative}.route-station-list:before{content:"";position:absolute;left:13px;top:8px;bottom:8px;width:6px;border-radius:999px;background:var(--routeColor);box-shadow:0 0 10px color-mix(in srgb,var(--routeColor),transparent 45%)}.route-station-list li{position:relative;margin:0 0 8px 0}.route-station-list button{width:100%;display:grid;grid-template-columns:30px 1fr;gap:10px;align-items:center;text-align:left;background:#182941;color:#edf4ff;border:1px solid #304a68;border-radius:13px;padding:9px 10px;cursor:pointer}.route-station-list button:hover{border-color:var(--routeColor)}.route-dot{width:18px;height:18px;border-radius:999px;background:#0c1728;border:5px solid var(--routeColor);z-index:1}.route-station-list small{display:block;color:#aebbd0;margin-top:2px}.arrivals .route-view{width:100%}.arrivals .route-station-list{max-height:42vh;overflow:auto;padding-right:4px}.route-result{max-height:18vh;overflow:auto;padding-right:4px}


/* Mobile app layout patch: keep station hitboxes unchanged, but reserve screen space
   so the zoomed-out map fits above the bottom station GUI. */
@media (max-width:850px){
  html,body{height:100dvh;overflow:hidden}
  .topbar{position:relative;z-index:30;height:auto;min-height:0;padding:14px 16px;gap:12px}
  .topbar h1{font-size:28px;line-height:1.1}
  .topbar p{font-size:19px;line-height:1.2}
  .actions{display:grid;grid-template-columns:1fr auto auto auto auto;gap:10px;width:100%}
  .actions input{width:100%;min-width:0;font-size:18px;padding:15px 16px;border-radius:16px}
  .actions button{min-width:54px;min-height:50px;font-size:17px;border-radius:16px}
  main{display:block;height:calc(100dvh - var(--topbar-h,150px));position:relative;overflow:hidden}
  .map-shell{position:relative;height:calc(100dvh - var(--topbar-h,150px) - var(--sidebar-h,42dvh) - 10px);min-height:190px;width:100%;overflow:hidden;touch-action:none}
  .sidebar{position:fixed;z-index:25;left:10px;right:10px;bottom:10px;max-height:min(42dvh,390px);overflow:auto;border:1px solid #26384d;border-radius:22px;padding:14px;background:#0c1728}
  .card{border-radius:20px;padding:16px;margin-bottom:14px}
}
