#topbar button { font-family: inherit; }
.drive-tool-toggle { background: rgba(15,44,53,.94); border-color: rgba(112,225,204,.5); }
#driving-tools { position: fixed; top: 66px; right: 16px; width: 316px; max-height: calc(100dvh - 88px); overflow-y: auto; z-index: 55;
  color: #eaf3f5; background: rgba(12,26,36,.96); border: 1px solid #435962; border-radius: 14px; box-shadow: 0 16px 48px #0008;
  padding: 16px; font-size: 13px; backdrop-filter: blur(16px); }
#driving-tools header { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
#driving-tools section { border-top: 1px solid #ffffff17; margin-top: 14px; padding-top: 14px; }
#driving-tools h2 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #c8e6e2; }
#driving-tools p { font-size: 11px; line-height: 1.6; color: #9ab0bc; margin: 7px 0; }
#driving-tools button, #driving-tools select { font: inherit; color: inherit; background: #203845; border: 1px solid #49606d; border-radius: 7px; padding: 7px 9px; cursor: pointer; }
#driving-tools button:hover { background: #32515f; border-color: #79bfbd; }
#driving-tools button:focus-visible, #driving-tools select:focus-visible, #topbar button:focus-visible { outline: 2px solid #77e2c5; outline-offset: 3px; }
#tools-close { font-size: 18px !important; line-height: 1; padding: 3px 7px !important; }
.demo-buttons { display: grid; gap: 6px; }
.demo-buttons button { display: flex; align-items: center; gap: 12px; text-align: left; }
.demo-buttons b { font-size: 18px; color: #76dfca; font-variant-numeric: tabular-nums; }
.demo-buttons span { display: flex; flex: 1; justify-content: space-between; align-items: center; }
.demo-buttons small { color: #a5b9c2; font-size: 10px; }
#driving-tools label { display: flex; align-items: center; gap: 8px; margin: 10px 0; min-height: 28px; }
#driving-tools label > select { flex: 1; min-width: 0; }
#driving-tools input[type=range] { flex: 1; width: 90px; accent-color: #77dbc1; }
#driving-tools input[type=checkbox] { accent-color: #77dbc1; }
#driving-tools output { min-width: 38px; text-align: center; color: #a8e7d9; font-variant-numeric: tabular-nums; }
#driving-tools small, #driving-tools kbd { font-size: 10px; color: #9ab0bc; }
.tool-row { display: flex; gap: 7px; }
.tool-row > button { flex: 1; font-size: 11px !important; }
#city-map { position: absolute; bottom: 60px; left: 18px; width: 252px; border-radius: 14px; overflow: hidden; border: 1px solid #6c9caa55;
  color: #d9ecee; background: #10212f; box-shadow: 0 8px 30px #0005; pointer-events: none; font-variant-numeric: tabular-nums; }
#city-map .map-title { padding: 9px 10px 8px 13px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #122938; border-bottom: 1px solid #91d6d817; }
#city-map .map-title > strong { font-size: 12px; font-weight: 600; letter-spacing: 1px; white-space: nowrap; }
.map-mode-switch { display: inline-flex; padding: 2px; gap: 2px; border-radius: 7px; background: #091b25; }
.map-mode-switch button { color: #8caab6; border: 0; border-radius: 5px; background: transparent; padding: 4px 8px;
  font: 500 10px/1.2 "Microsoft YaHei", sans-serif; cursor: pointer; pointer-events: auto; }
.map-mode-switch button[aria-pressed=true] { color: #b3f4e0; background: #234b50; }
.map-mode-switch button:hover { color: #e7fff7; background: #2b535c; }
.map-mode-switch button:focus-visible { outline: 2px solid #a3f0d9; outline-offset: 2px; }
.map-viewport { position: relative; overflow: hidden; }
#city-map canvas { display: block; width: 100%; height: auto; }
.map-north { position: absolute; top: 8px; right: 9px; display: flex; align-items: center; gap: 3px; color: #c1dbde;
  padding: 3px 5px; border-radius: 5px; background: #10212dd9; font-size: 9px; }
.map-north b { font-weight: 500; }
.map-scale { position: absolute; left: 0; bottom: 7px; width: 100%; color: #acc1c9; font-size: 8px; line-height: 1.4; }
.map-scale i { margin-left: 12px; display: block; height: 4px; border: 1px solid #c1d6dc; border-top: 0; }
.map-scale > span { margin-left: 12px; padding: 1px 3px; border-radius: 2px; background: #10212dc9; }
#city-map .map-caption { padding: 8px 11px 8px 13px; display: flex; align-items: center; gap: 8px; justify-content: space-between;
  background: #112837; border-top: 1px solid #a5d7dd20; }
.map-location { flex: 1; min-width: 0; }
#map-road { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; line-height: 1.6; }
.map-location > span { display: flex; align-items: center; gap: 5px; font-size: 9px; color: #9bb8c4; line-height: 1.6; }
.map-status-dot { flex: 0 0 auto; width: 4px; height: 4px; border-radius: 50%; background: #80d9bc; }
#map-heading { margin-left: auto; color: #aec4cb; }
#city-map[data-status=warning] .map-status-dot { background: #f0a16f; }
#city-map[data-status=observe] .map-status-dot { background: #e2c084; }
.map-speed-limit { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.map-speed-limit b { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #d49b8c; border-radius: 50%;
  background: #e9eeec; color: #243743; font-size: 12px; font-weight: 800; }
.map-speed-limit small { color: #8ca7b1; font-size: 8px; writing-mode: vertical-rl; letter-spacing: 1px; }
.map-legend { display: flex; align-items: center; gap: 9px; padding: 6px 11px 7px 13px; color: #88a5b1; font-size: 8px; border-top: 1px solid #a5d7dd12; }
.map-legend > span { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.map-legend > span:last-child { margin-left: auto; color: #708e9d; }
.map-legend i { display: inline-block; width: 10px; height: 2px; border-radius: 2px; background: #a6bbc4; }
.map-legend .map-key-scenic { background: #d9b478; }
.map-legend .map-key-poi { width: 4px; height: 4px; border-radius: 50%; background: #86e2ce; }
#hint { max-width: calc(100vw - 28px); text-align: center; width: max-content; line-height: 1.6; }
@media (max-width: 760px) {
  #topbar { gap: 5px; top: 8px; right: 8px; max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: flex-end; }
  #topbar .chip { font-size: 11px; padding: 7px 9px; border-radius: 7px; }
  #topbar #sw-a, #topbar #sw-b { display: none; }
  #netdot { top: 54px; font-size: 10px; }
  #driving-tools { right: 8px; top: 76px; width: min(316px, calc(100vw - 16px)); max-height: calc(100dvh - 90px); }
  #city-map { width: 174px; left: 10px; bottom: 65px; border-radius: 10px; }
  #city-map .map-title { padding: 6px 6px 6px 8px; }
  #city-map .map-title > strong { font-size: 10px; letter-spacing: 0; }
  .map-mode-switch button { font-size: 9px; padding: 4px 6px; }
  #city-map .map-caption { padding: 6px 7px 6px 8px; gap: 5px; }
  #map-road { font-size: 10px; }
  .map-location > span { font-size: 8px; gap: 3px; }
  .map-speed-limit b { width: 23px; height: 23px; font-size: 10px; }
  .map-speed-limit small, .map-legend { display: none; }
  .map-north { top: 5px; right: 5px; padding: 2px 3px; font-size: 8px; }
  .map-scale { font-size: 7px; bottom: 4px; }
  #hint { font-size: 10px; bottom: 10px; padding: 5px 9px; letter-spacing: 0; }
  #speedo { top: 90px; right: 12px; left: auto; transform: none; }
  #speedo .v { font-size: 34px; }
  #menu { padding: 80px 15px 20px; }
  #menu h1 { font-size: 22px; letter-spacing: 3px; margin-bottom: 22px; }
  .cards { width: min(480px, 100%); gap: 14px; }
  .card, .card.c4 { width: 100%; padding: 17px 16px; gap: 12px; transform: none; border-radius: 12px; }
  .card:hover { transform: none; }
  .card .name { font-size: 19px; letter-spacing: 1px; }
  .card .sub { font-size: 11px; line-height: 1.5; }
  .card .ico { font-size: 28px; }
  #turnhint { font-size: 16px; width: min(85%, 500px); top: 150px; text-align: center; }
  #perception { top: 95px !important; min-width: 210px !important; font-size: 11px !important; }
}
@media (max-height: 650px) { #menu h1 { margin-bottom: 18px; } .cards { gap: 10px; } .card { padding-top: 14px; padding-bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { #turnhint, #vignette.on { animation: none; } }
