@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #263039;
  --muted: #75808a;
  --paper: #eef0f2;
  --white: #fff;
  --line: #d8dde1;
  --red: #d93632;
  --red-dark: #b72927;
  --red-soft: #f8e4e3;
  --green: #4d9a62;
  --amber: #edaa36;
  font-family: 'DM Sans', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; background: #eef0f2; }
.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #eef0f2; }
.company-setup { display: none; }
.company-setup.is-visible { display: grid; }
.login-card { width: min(100%, 390px); padding: 34px; border: 1px solid #d4dade; border-top: 4px solid var(--red); border-radius: 3px; background: #fff; box-shadow: 0 7px 24px rgba(40,50,58,.14); }
.login-mark { display: grid; width: 42px; height: 42px; margin-bottom: 22px; place-items: center; border-radius: 3px; color: #fff; background: var(--red); font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 800; }
.login-kicker { color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.login-card h1 { margin: 8px 0 9px; font-size: 29px; }
.login-card p { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-form { display: grid; gap: 7px; }
.login-form.is-hidden { display: none; }
.login-form label { margin-top: 6px; color: #56636b; font-size: 12px; font-weight: 700; }
.login-form input { height: 40px; padding: 0 11px; border: 1px solid #d3dadd; border-radius: 2px; outline: 0; color: var(--ink); background: #fff; font-size: 13px; }
.login-form input:focus { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.login-form button { height: 40px; margin-top: 12px; border: 0; border-radius: 2px; color: #fff; background: var(--red); font-size: 13px; font-weight: 700; }
.login-form button:hover { background: var(--red-dark); }
.login-message { min-height: 16px; color: var(--red); font-size: 11px; }
.login-switch { display: block; margin: 18px auto 0; padding: 0; border: 0; color: var(--red); background: transparent; font-size: 12px; font-weight: 700; }
.login-switch:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-shell.is-locked { display: none; }
.topbar { position: sticky; z-index: 3000; top: 0; display: flex; height: 48px; align-items: center; gap: 18px; padding: 0 14px; color: #fff; background-color: #347e4d; background-image: radial-gradient(circle at 20px 12px, rgba(255,255,255,.08) 0 2px, transparent 3px), radial-gradient(circle at 54px 31px, rgba(20,65,35,.14) 0 8px, transparent 9px); background-size: 72px 42px; box-shadow: 0 1px 4px rgba(30, 48, 35, .22); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; color: #fff; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; text-decoration: none; }
.brand small { display: block; margin-top: 1px; color: rgba(255,255,255,.72); font-family: 'DM Sans', sans-serif; font-size: 8px; letter-spacing: 1.5px; }
.brand-mark { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid rgba(255,255,255,.6); border-radius: 3px; color: #fff; background: rgba(255,255,255,.12); font-size: 10px; }
.top-menu-dropdown { position: absolute; z-index: 3000; top: 50%; left: 270px; flex: 0 0 auto; margin-left: 0; transform: translateY(-50%); }
.top-menu-dropdown summary { min-width: 74px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; color: #fff; background: rgba(0,0,0,.1); font-size: 12px; font-weight: 700; list-style: none; cursor: pointer; }
.top-menu-dropdown summary::-webkit-details-marker { display: none; }
.top-menu-dropdown summary::after { margin-left: 8px; content: '▾'; font-size: 11px; }
.connection-status { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; color: rgba(255,255,255,.84); font-size: 9px; font-weight: 700; white-space: nowrap; }
.top-menu { position: absolute; z-index: 2000; top: 45px; left: 0; display: grid; min-width: 170px; gap: 2px; padding: 6px; border: 1px solid #245f38; border-radius: 2px; background: #245f38; box-shadow: 0 4px 10px rgba(20,50,28,.24); }
.top-menu-item { padding: 8px 10px; border: 0; border-left: 3px solid transparent; color: rgba(255,255,255,.9); background: transparent; text-align: left; font-size: 13px; }
.top-menu-item:hover, .top-menu-item.is-active { border-left-color: #fff; color: #fff; background: rgba(0,0,0,.12); }
.top-menu-item { text-decoration: none; }
.search-box { display: flex; width: min(230px, 20vw); height: 28px; align-items: center; gap: 6px; margin-left: auto; padding: 0 8px; border: 1px solid rgba(0,0,0,.16); border-radius: 2px; color: #76808a; background: #fff; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.top-metrics { display: flex; align-items: stretch; gap: 5px; margin-left: auto; padding: 3px; border: 1px solid rgba(255,255,255,.22); border-radius: 4px; background: rgba(112, 18, 24, .24); }
.top-metrics div { min-width: 82px; padding: 5px 9px 4px; border: 1px solid rgba(255,255,255,.14); border-radius: 3px; background: rgba(255,255,255,.1); }
.top-metrics div:first-child { min-width: 118px; background: rgba(255,255,255,.16); }
.top-metrics span, .top-metrics small { display: block; color: rgba(255,255,255,.72); font-size: 9px; font-weight: 600; line-height: 1.1; }
.top-metrics strong { display: block; margin: 3px 0 1px; color: #fff; font-family: 'Manrope', sans-serif; font-size: 16px; line-height: 1; }
.top-metrics div:first-child strong { color: #fff0ad; }
.top-metrics small { color: rgba(255,255,255,.82); font-size: 9px; }
.clock-block { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.82); font-size: 9px; font-weight: 700; letter-spacing: .8px; white-space: nowrap; }
.clock-block strong { margin-left: 4px; color: #fff; font-family: 'Manrope', sans-serif; font-size: 16px; letter-spacing: 0; }
.clock-label { margin-left: 5px; color: rgba(255,255,255,.66); font-size: 8px; letter-spacing: .8px; }
.wall-clock { color: rgba(255,255,255,.84); font-family: 'Manrope', sans-serif; font-size: 11px; letter-spacing: .2px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #a9e4aa; box-shadow: 0 0 0 3px rgba(169,228,170,.2); }
.speed-controls { display: flex; gap: 2px; margin-left: 0; }
.real-time-badge { margin-left: auto; padding: 5px 8px; border: 1px solid rgba(255,255,255,.45); border-radius: 2px; color: #fff; background: rgba(0,0,0,.1); font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.speed-button { padding: 5px 7px; border: 1px solid rgba(255,255,255,.28); border-radius: 2px; color: rgba(255,255,255,.82); background: transparent; font-size: 10px; font-weight: 700; }
.speed-button:hover, .speed-button.is-active { border-color: #fff; color: var(--red); background: #fff; }
.workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, .82fr); min-height: calc(100vh - 54px); }
.app-nav { display: none; }
.map-section { position: relative; min-width: 0; padding: 12px 10px 10px 12px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 8px; }
.section-heading.compact { align-items: center; margin-bottom: 8px; }
.kicker { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
h1, h2 { margin: 3px 0 0; font-family: 'Manrope', sans-serif; line-height: 1; }
h1 { font-size: 20px; } h2 { font-size: 15px; }
.map-hint { color: var(--muted); font-size: 11px; }
.map { min-height: 410px; height: calc(100vh - 315px); border: 1px solid #cbd3d8; border-radius: 2px; overflow: hidden; background: #c9d5cc; box-shadow: 0 1px 2px rgba(30,45,55,.06); }
.leaflet-container { font-family: 'DM Sans', sans-serif; }
.leaflet-control-zoom a { color: #26343e !important; }
.bus-marker { display: grid; width: 34px; height: 34px; place-items: center; border: 2px solid #fff; border-radius: 7px; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.32); font-size: 22px; line-height: 1; }
.event-marker { display: grid; width: 24px; height: 24px; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #e49d2f; box-shadow: 0 0 0 3px rgba(228,157,47,.18), 0 2px 5px rgba(0,0,0,.32); font-size: 13px; font-weight: 800; }
.stop-marker { display: block; width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; background: #2876a6; box-shadow: 0 1px 4px rgba(0,0,0,.38); }
.depot-map-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #347e4d; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-size: 23px; font-weight: 700; line-height: 1; }
.placement-marker { display: block; width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50% 50% 50% 4px; background: #e3ae35; box-shadow: 0 2px 6px rgba(0,0,0,.42); transform: rotate(-45deg); animation: placement-pulse 1.4s ease-in-out infinite; }
.placement-marker--depot { background: #347e4d; }
@keyframes placement-pulse { 50% { box-shadow: 0 0 0 6px rgba(227,174,53,.24), 0 2px 6px rgba(0,0,0,.42); } }
.bus-detail { position: absolute; z-index: 1000; right: 25px; bottom: 190px; width: 225px; padding: 12px; border: 1px solid var(--line); border-radius: 2px; background: rgba(255,255,255,.97); box-shadow: 0 3px 12px rgba(35,45,50,.2); }
.bus-detail.is-hidden { display: none; }
.bus-detail h3 { margin: 0 0 10px; font-family: 'Manrope', sans-serif; font-size: 15px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-grid span, .detail-grid strong { display: block; } .detail-grid span { color: var(--muted); font-size: 10px; } .detail-grid strong { margin-top: 2px; font-size: 12px; }
.bottom-dock { display: grid; grid-template-columns: 1fr 1fr; height: 190px; margin-top: 10px; border: 1px solid var(--line); background: #fff; box-shadow: 0 1px 2px rgba(30,45,55,.06); }
.dock-panel { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); background: #fff; overflow: hidden; }
.dock-panel:last-child { border-right: 0; }
.dock-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.dock-action, .radio-toggle { padding: 4px 7px; border: 1px solid #d5dce0; border-radius: 2px; color: #63717a; background: #fff; font-size: 9px; }
.dock-action:hover, .radio-toggle:hover { border-color: var(--red); color: var(--red); }
.dock-tabs { display: flex; gap: 2px; margin: -1px -12px 7px; padding: 0 12px; border-bottom: 1px solid #edf0f1; }
.dock-tab { padding: 5px 7px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 10px; }
.dock-tab.is-active, .dock-tab:hover { border-bottom-color: var(--red); color: var(--red); }
.dock-list { display: grid; max-height: 115px; gap: 4px; overflow: auto; }
.dock-buy-form { display: grid; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf0f1; }
.dock-buy-title strong, .dock-buy-title small { display: block; } .dock-buy-title strong { font-size: 11px; } .dock-buy-title small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.dock-buy-form input, .dock-buy-form select { width: 100%; height: 27px; padding: 0 6px; border: 1px solid #d5dce0; border-radius: 2px; color: var(--ink); background: #fff; font-size: 10px; }
.dock-buy-form .form-row { gap: 4px; } .dock-buy-form .primary-button { height: 27px; }
.dock-bus { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 7px; padding: 5px 6px; border: 1px solid #e8ecee; border-radius: 2px; color: var(--ink); font-size: 10px; }
.dock-bus-icon { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 2px; color: #fff; background: var(--red); font-size: 10px; }
.dock-bus small, .activity-feed small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.dock-bus em { color: var(--green); font-size: 9px; font-style: normal; font-weight: 700; }
.activity-feed { display: grid; gap: 9px; padding-top: 2px; }
.activity-feed > div { display: grid; grid-template-columns: 8px 1fr auto; align-items: start; gap: 7px; }
.activity-feed span { min-width: 0; font-size: 10px; } .activity-feed time { color: #9ca6ac; font-size: 9px; white-space: nowrap; }
.activity-dot { width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: var(--red); } .activity-dot--green { background: var(--green); } .activity-dot--amber { background: var(--amber); }
.radio-toggle { color: var(--green); border-color: #b9d5bf; }
.radio-empty { display: flex; height: 125px; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #eef7fb; }
.radio-icon { color: #4c95b3; font-size: 25px; } .radio-empty p { margin: 5px 0 2px; color: #4c95b3; font-size: 11px; } .radio-empty small { max-width: 170px; color: #7d9daa; font-size: 9px; line-height: 1.35; }
.side-panel { display: flex; flex-direction: column; border-left: 1px solid #cdd3d7; background: #fafafa; overflow: auto; }
.control-panel { flex: 0 0 auto; padding: 13px 12px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.vehicle-live-tools { display: flex; align-items: center; gap: 7px; }
.vehicle-live-label { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.control-filters { display: flex; gap: 3px; margin: 0 -12px 8px; padding: 0 12px; border-bottom: 1px solid #edf0f1; }
.control-filter { padding: 5px 7px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 10px; }
.control-filter:hover, .control-filter.is-active { border-bottom-color: var(--red); color: var(--red); }
.control-bus-list { display: grid; gap: 5px; max-height: 235px; overflow: auto; }
.control-bus { padding: 8px; border: 1px solid #e0e5e7; border-left: 3px solid var(--green); border-radius: 2px; background: #fff; }
.control-bus--depot { border-left-color: #9aa5ab; }
.control-bus--delayed, .control-bus--defective { border-left-color: var(--red); }
.control-bus-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.control-bus-name { font-size: 12px; font-weight: 700; }
.control-bus-status { color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.control-bus--depot .control-bus-status { color: #7b878e; }
.control-bus--delayed .control-bus-status, .control-bus--defective .control-bus-status { color: var(--red); }
.control-bus-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.control-bus-progress { height: 3px; margin-top: 7px; border-radius: 3px; background: #e8ecee; overflow: hidden; }
.control-bus-progress span { display: block; height: 100%; background: var(--green); }
.events-panel { flex: 0 0 auto; min-height: 540px; padding: 13px 12px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.event-list { display: grid; gap: 7px; max-height: none; overflow: visible; }
.event-card { padding: 9px 10px; border: 1px solid #e3c9a0; border-left: 3px solid #e3a337; border-radius: 2px; background: #fffdf8; }
.event-card--high { border-color: #e4b5b3; border-left-color: var(--red); background: #fffafa; }
.event-card--low { border-color: #c9dfce; border-left-color: var(--green); background: #fbfffb; }
.event-card.is-selected { outline: 2px solid var(--red); }
.event-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.event-title { color: var(--ink); font-size: 12px; font-weight: 700; }
.event-severity { color: #b87813; font-size: 9px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.event-card--high .event-severity { color: var(--red); }
.event-card--low .event-severity { color: var(--green); }
.event-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.event-description { margin: 6px 0; color: #66727a; font-size: 11px; line-height: 1.35; }
.event-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.event-actions button { padding: 4px 6px; border: 1px solid #d4dade; border-radius: 2px; color: #5d6970; background: #fff; font-size: 10px; }
.event-actions button:hover { border-color: var(--red); color: var(--red); }
.count-badge { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 2px; color: #fff; background: var(--red); font-size: 10px; font-weight: 700; }
.metrics-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 1px; border-bottom: 1px solid var(--line); background: var(--line); }
.metric-card { min-height: 78px; padding: 11px 10px; background: #fff; } .metric-card span, .metric-card small { display: block; color: var(--muted); font-size: 10px; } .metric-card strong { display: block; margin: 8px 0 3px; color: var(--ink); font-family: 'Manrope', sans-serif; font-size: 17px; } .metric-card--balance strong { color: var(--green); font-size: 17px; }
.panel-section { padding: 15px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.depot-dialog { width: min(460px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 3px; color: var(--ink); box-shadow: 0 12px 40px rgba(30,40,48,.24); }
.depot-dialog::backdrop { background: rgba(26,34,39,.48); }
.depot-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.depot-dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: #fff; font-size: 21px; line-height: 1; }
.depot-dialog-close:hover { border-color: var(--red); color: var(--red); }
.route-builder-panel.is-hidden { display: none; }
.tool-form { padding: 11px 0; border-bottom: 1px solid #edf0f1; } .tool-form:last-of-type { border-bottom: 0; padding-bottom: 0; }
.form-title { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; } .form-title strong, .form-title small { display: block; } .form-title strong { font-size: 12px; } .form-title small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.tool-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 2px; color: #fff; background: var(--red); font-size: 15px; } .route-icon { font-size: 13px; } .bus-icon { font-size: 11px; }
.tool-form input, .tool-form select { width: 100%; height: 29px; margin-bottom: 6px; padding: 0 7px; border: 1px solid #d5dce0; border-radius: 2px; outline: 0; color: var(--ink); background: #fff; font-size: 11px; } .tool-form input:focus, .tool-form select:focus { border-color: var(--red); }
.tool-form input[type='color'] { width: 35px; padding: 2px; } .form-row { display: flex; gap: 5px; } .form-row > * { min-width: 0; flex: 1; }
.primary-button { width: 100%; height: 29px; border: 0; border-radius: 2px; color: #fff; background: var(--red); font-size: 11px; font-weight: 700; } .primary-button:hover { background: var(--red-dark); }
.secondary-button { width: 100%; height: 27px; margin-bottom: 6px; border: 1px solid #d5dce0; border-radius: 2px; color: #69767d; background: #fff; font-size: 11px; font-weight: 600; } .secondary-button:hover { border-color: var(--red); color: var(--red); }
.stop-choices { display: grid; max-height: 88px; gap: 4px; margin-bottom: 7px; overflow: auto; } .stop-choice { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; } .stop-choice input { width: 13px; height: 13px; margin: 0; accent-color: var(--red); }
.action-message { min-height: 14px; margin: 8px 0 0; color: var(--green); font-size: 11px; }
.fleet-section { padding-top: 12px; }
.fleet-list { display: grid; gap: 6px; } .fleet-card { padding: 9px; border: 1px solid #dfe4e7; border-radius: 2px; background: #fff; } .fleet-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .fleet-name { font-size: 12px; font-weight: 700; } .status { color: var(--green); font-size: 9px; font-weight: 700; text-transform: uppercase; } .status--maintenance, .status--defective { color: var(--red); } .fleet-meta { display: flex; justify-content: space-between; margin: 6px 0; color: var(--muted); font-size: 10px; } .condition-bar { height: 3px; margin: 4px 0 8px; border-radius: 3px; background: #e8ecee; overflow: hidden; } .condition-bar span { display: block; height: 100%; background: var(--green); } .fleet-actions { display: flex; gap: 4px; } .fleet-actions select, .fleet-actions button { height: 25px; border: 1px solid #d5dce0; border-radius: 2px; color: var(--muted); background: #fff; font-size: 10px; } .fleet-actions select { min-width: 0; flex: 1; } .fleet-actions button { padding: 0 6px; } .fleet-actions button:hover { border-color: var(--red); color: var(--red); }
.empty-state { padding: 12px 0; color: var(--muted); font-size: 11px; }
.top-menu-item { font-size: 14px; font-weight: 600; }
.clock-block { font-size: 11px; }
.clock-block strong { font-size: 18px; }
.clock-label, .real-time-badge { font-size: 9px; }
.map-hint { font-size: 12px; }
h1 { font-size: 24px; } h2 { font-size: 17px; }
.event-title { font-size: 14px; }
.event-meta { font-size: 12px; }
.event-description { font-size: 13px; line-height: 1.45; }
.event-actions button { font-size: 11px; font-weight: 600; }
.metric-card span, .metric-card small { font-size: 11px; }
.metric-card strong { font-size: 19px; }
.form-title strong { font-size: 14px; }
.form-title small, .tool-form input, .tool-form select { font-size: 12px; }
.primary-button { font-size: 13px; font-weight: 700; }
.stop-choice { font-size: 13px; }
.action-message { font-size: 13px; }
.fleet-name { font-size: 14px; }
.fleet-meta, .fleet-actions select, .fleet-actions button { font-size: 12px; }
.dock-heading strong { font-size: 14px; }
.dock-action, .radio-toggle, .dock-tab { font-size: 10px; }
.dock-bus { font-size: 12px; }
.dock-bus small, .activity-feed small { font-size: 11px; }
.activity-feed span { font-size: 12px; }
.radio-empty p { font-size: 13px; }
@media (max-width: 1200px) { .search-box { width: 170px; } .top-metrics { gap: 8px; } .workspace { grid-template-columns: minmax(0, 1.8fr) minmax(320px, .9fr); } }
@media (max-width: 1100px) { .bottom-dock { grid-template-columns: 1fr 1fr; } }
@media (max-width: 850px) { .topbar { height: auto; min-height: 54px; flex-wrap: wrap; padding: 7px 10px; } .top-menu { top: 42px; } .search-box { margin-left: auto; } .clock-block { margin-left: 0; } .top-metrics { order: 3; width: 100%; justify-content: flex-end; margin-left: 0; padding-top: 5px; } .workspace { display: block; } .side-panel { border-top: 1px solid var(--line); border-left: 0; overflow: visible; } .events-panel { min-height: 0; } .map-section { padding: 10px; } .map { height: 440px; min-height: 440px; } .bottom-dock { height: auto; grid-template-columns: 1fr; } .dock-panel { min-height: 155px; border-right: 0; border-bottom: 1px solid var(--line); } .dock-panel:last-child { border-bottom: 0; } .dock-panel--radio { display: block; } }
@media (max-width: 500px) { .brand small, .search-box { display: none; } .topbar { gap: 8px; } .top-metrics { justify-content: space-between; } .speed-button[data-speed='10'] { display: none; } }
@media (max-width: 520px) { .top-menu-dropdown { left: 180px; } }

.top-menu-dropdown summary { min-width: 82px; padding: 9px 11px; font-size: 14px; }
.top-menu-item { padding: 10px 11px; font-size: 14px; }
.top-metrics { gap: 5px; }
.top-metrics div { min-width: 82px; padding-left: 9px; }
.top-metrics div:first-child { min-width: 118px; }
.top-metrics span, .top-metrics small { font-size: 10px; }
.top-metrics strong { margin: 3px 0; font-size: 17px; }
.clock-label, .real-time-badge { font-size: 10px; }
.clock-block strong { font-size: 19px; }
.topbar { height: 54px; gap: 9px; padding: 0 10px; background-size: 86px 54px; }
.brand { flex-basis: 31px; }
.brand > span:last-child { display: none; }
.brand-mark { width: 28px; height: 28px; }
.top-menu-dropdown summary { min-width: 66px; padding: 7px 9px; font-size: 12px; }
.top-menu-item { padding: 10px 11px; font-size: 14px; }
.search-box { width: min(220px, 22vw); height: 26px; }
.top-metrics { gap: 0; margin-left: 0; padding: 0; border: 0; background: transparent; }

body { height: 100dvh; overflow: hidden; }
.app-shell { display: flex; height: 100%; min-height: 0; flex-direction: column; overflow: hidden; }
.topbar { flex: 0 0 auto; }
.workspace { min-height: 0; flex: 1 1 auto; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.map-section { display: flex; min-height: 0; flex-direction: column; overflow: hidden; }
.section-heading { flex: 0 0 auto; }
.map { height: auto; min-height: 0; flex: 1 1 auto; }
.bottom-dock { height: 160px; flex: 0 0 160px; }
.side-panel { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.event-marker { display: none; }
@media (max-width: 850px) {
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(240px, 43%) minmax(0, 1fr); }
  .map-section { height: 100%; padding: 10px; }
  .map { height: auto; min-height: 0; flex: 1 1 auto; }
  .bottom-dock { display: none; }
  .side-panel { height: 100%; min-height: 0; overflow-y: auto; }
  .bus-detail { right: 12px; bottom: 12px; }
}
.top-metrics div { min-width: 72px; padding: 3px 10px; border: 0; border-left: 1px solid rgba(255,255,255,.25); border-radius: 0; background: transparent; }
.top-metrics div:first-child { min-width: 106px; background: transparent; }
.top-metrics strong { font-size: 15px; }
