html, body { margin: 0; height: 100%; font-family: system-ui, Arial, sans-serif; }
#map { width: 100%; height: 100vh; }

#bar {
    position: absolute; top: 10px; left: 50px; z-index: 1000;
    display: flex; gap: 8px; align-items: center;
    background: #fff; padding: 6px 10px; border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0,0,0,.3); font-size: 13px;
}
#bar select { padding: 4px; max-width: 120px; }
#toast {
    position: absolute; z-index: 2000; left: 50%; bottom: 24px; transform: translateX(-50%);
    background: #323232; color: #fff; padding: 10px 14px; border-radius: 8px;
    font-size: 14px; max-width: calc(100% - 40px); text-align: center;
}
#toast[hidden] { display: none; }

#bar button { cursor: pointer; font-size: 18px; border: 0; background: none; }
#alertsBtn { color: #e65100; }
#alertCount { font-size: 12px; font-weight: bold; margin-left: 2px; }
.alert { border-left: 4px solid #e65100; background: #fff3e0; padding: 6px 8px; margin: 8px 0; border-radius: 4px; font-size: 13px; }
.alerttext { white-space: pre-line; margin-top: 4px; }
details.alerts { margin: 8px 0; }
details.alerts summary { cursor: pointer; color: #e65100; font-weight: bold; }

#panel {
    position: absolute; z-index: 1000; right: 10px; top: 10px; bottom: 10px;
    width: 300px; max-width: calc(100% - 20px); overflow-y: auto;
    background: #fff; border-radius: 10px; padding: 12px;
    box-shadow: 0 1px 10px rgba(0,0,0,.35); box-sizing: border-box;
}
#panel[hidden] { display: none; }
#close { display: none; }
#panel h3 { margin: 0 24px 4px 0; display: flex; gap: 8px; align-items: center; }
#back { display: block; width: 100%; margin: 0 0 10px; padding: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; border-radius: 6px; background: #1e88e5; color: #fff; }
.badge { color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 15px; }
.next { background: #e8f5e9; border-left: 4px solid #2e7d32; padding: 8px; margin: 10px 0; border-radius: 4px; }
.next b { font-size: 15px; }
ol.stops { list-style: none; padding: 0; margin: 0; font-size: 13px; }
ol.stops li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid #eee; }
ol.stops li.passed { color: #aaa; }
ol.stops li.current { font-weight: bold; color: #2e7d32; }

.veh {
    display: flex; align-items: center; gap: 3px; white-space: nowrap;
    color: #fff; font-weight: 700; font-size: 12px; line-height: 1;
    border: 2px solid #fff; border-radius: 14px; padding: 3px 7px 3px 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,.5); width: max-content;
}
.veh.sel { outline: 3px solid #ffeb3b; z-index: 9999; }
#nav {
    position: absolute; z-index: 1000; left: 10px; top: 60px;
    width: 320px; max-width: calc(100% - 20px); max-height: calc(100vh - 80px);
    overflow-y: auto; box-sizing: border-box; padding: 10px;
    background: #fff; border-radius: 10px; box-shadow: 0 1px 10px rgba(0,0,0,.35);
}
#nav[hidden] { display: none; }
.navhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.navhead button { border: 0; background: none; font-size: 22px; cursor: pointer; }
#nav .field { position: relative; display: flex; gap: 4px; margin-bottom: 8px; }
#nav .field input { flex: 1; padding: 7px; font-size: 14px; box-sizing: border-box; min-width: 0; }
#fromGps { border: 1px solid #ccc; background: #fff; border-radius: 4px; cursor: pointer; font-size: 16px; }
.sug { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin: 0; padding: 0; list-style: none;
    background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); border-radius: 4px; }
.sug li { padding: 7px 8px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #eee; }
.sug li:hover { background: #e3f2fd; }
#goBtn, #navBack { width: 100%; padding: 8px; font-size: 14px; font-weight: 600; border: 0; border-radius: 6px; background: #1e88e5; color: #fff; cursor: pointer; }
#navBack { background: #607d8b; margin-bottom: 8px; }
#navMsg { font-size: 12px; color: #666; margin: 6px 0; }
.card { border: 1px solid #ddd; border-radius: 8px; padding: 8px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.card:hover, .card.sel { border-color: #1e88e5; background: #f3f9ff; }
.card .parts { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.walk { font-size: 12px; color: #555; }
ol.steps { padding-left: 20px; font-size: 13px; }
ol.steps li { margin-bottom: 10px; }
.me { width: 16px; height: 16px; border-radius: 50%; background: #1e88e5; border: 3px solid #fff; box-shadow: 0 0 0 2px #1e88e5; }

@media (max-width: 600px) {
    #bar { left: 50px; right: 10px; flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
    #count { flex-basis: 100%; }
    #bar select { flex: 1 1 0; min-width: 0; max-width: none; }
    #nav { left: 10px; right: 10px; width: auto; top: 100px; max-height: calc(100vh - 120px); }
    #panel { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-width: none; max-height: 55vh; }
}
