:root {
  --paper: #f5f2ea;
  --panel: rgba(251, 249, 243, 0.96);
  --panel-solid: #fbf9f3;
  --ink: #173c39;
  --ink-soft: #60736e;
  --line: #dcd9cd;
  --lake: #5f8f91;
  --accent: #c35f45;
  --accent-dark: #a84c35;
  --gold: #a88d55;
  --shadow: 0 18px 55px rgba(25, 47, 42, 0.14);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { font-family: var(--body); color: var(--ink); background: #e8eee9; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }
button { color: inherit; touch-action: manipulation; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.38; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.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; }
#amap-container { position: fixed; inset: 0; }
.eyebrow { margin: 0; font-size: 9px; line-height: 1.5; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }

.topbar { position: fixed; z-index: 50; top: 20px; left: 22px; right: 22px; display: flex; align-items: center; gap: 18px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar-brand { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.topbar-title { display: grid; gap: 2px; padding: 4px 0; text-shadow: 0 1px 12px rgba(255,255,255,0.9); }
.topbar-title strong { font-family: var(--display); font-size: 18px; letter-spacing: 0.02em; }
.topbar-title .eyebrow { font-size: 7px; }
.icon-button, .route-entry { min-height: 46px; border: 1px solid rgba(23,60,57,0.13); background: var(--panel); box-shadow: 0 8px 30px rgba(27,54,48,0.09); }
.icon-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 46px; padding: 0 13px; border-radius: 12px; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 1px; background: var(--ink); content: ""; }
.menu-icon { position: relative; }
.menu-icon::before { position: absolute; top: -5px; }
.menu-icon::after { position: absolute; top: 5px; }
.button-word { font-size: 12px; }
.search-wrap { position: relative; flex: 1 1 520px; width: min(520px, 100%); max-width: 560px; margin: 0 auto; }
.search-wrap input { width: 100%; height: 50px; padding: 0 44px 0 43px; color: var(--ink); background: var(--panel); border: 1px solid rgba(23,60,57,0.14); border-radius: 14px; box-shadow: 0 8px 30px rgba(27,54,48,0.1); font-size: 14px; outline-offset: 2px; }
.search-wrap input::placeholder { color: #74857f; }
.search-symbol { position: absolute; z-index: 1; left: 18px; top: 18px; width: 13px; height: 13px; border: 1.5px solid var(--ink-soft); border-radius: 50%; pointer-events: none; }
.search-symbol::after { content: ""; position: absolute; right: -5px; bottom: -4px; width: 6px; height: 1.5px; background: var(--ink-soft); transform: rotate(45deg); }
.search-key { position: absolute; right: 17px; top: 13px; color: var(--ink-soft); font-family: var(--display); font-size: 18px; }
#search-results { position: absolute; top: 58px; left: 0; right: 0; max-height: 340px; overflow-y: auto; padding: 7px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.search-result { display: flex; width: 100%; min-height: 48px; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 12px; border: 0; border-bottom: 1px solid #e8e4da; border-radius: 8px; background: transparent; text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #ecefe8; }
.search-result small { color: var(--ink-soft); white-space: nowrap; }
.route-entry { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 88px; padding: 0 16px; border-radius: 12px; font-size: 13px; }
.route-symbol { color: var(--accent); font-size: 20px; }

.sidebar { position: fixed; z-index: 60; top: 20px; bottom: 20px; left: 22px; width: 330px; display: flex; flex-direction: column; padding: 24px 22px 18px; overflow-y: auto; background: var(--panel); border: 1px solid rgba(23,60,57,0.12); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(18px); transform: translateX(calc(-100% - 32px)); visibility: hidden; transition: transform 0.22s ease, visibility 0.22s; }
.sidebar.open { transform: translateX(0); visibility: visible; }
.brand-block { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding-bottom: 22px; }
.brand-block h1 { margin: 7px 0 6px; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.04em; white-space: nowrap; }
.brand-subtitle { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.brand-mark { position: relative; width: 42px; height: 42px; border: 1px solid var(--ink); border-radius: 50%; }
.brand-mark span { position: absolute; left: 8px; top: 8px; width: 24px; height: 24px; border: 1px solid var(--lake); border-radius: 50%; border-top-color: transparent; transform: rotate(25deg); }
.brand-mark i { position: absolute; left: 19px; top: 4px; width: 1px; height: 32px; background: var(--accent); transform: rotate(28deg); }
.sidebar-close { top: -10px !important; right: -8px !important; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tab { min-height: 44px; padding: 12px 4px; border: 0; background: transparent; color: var(--ink-soft); font-size: 12px; }
.tab.active { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }
.tab-panel { display: none; padding-top: 20px; }
.tab-panel.active { display: block; }
.editorial-note { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 0 0 18px; }
.editorial-note p { margin: 0; font-family: var(--display); font-size: 14px; line-height: 1.9; color: #36534e; }
.note-index { padding-top: 3px; font-family: var(--display); font-size: 20px; color: var(--accent); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.section-heading span { font-size: 12px; font-weight: 600; }
.section-heading small { font-size: 9px; letter-spacing: 0.06em; color: var(--ink-soft); }
.quick-routes, .route-presets { display: grid; gap: 7px; }
.quick-route, .route-preset { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 10px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; }
.quick-route:hover, .route-preset:hover { border-color: var(--line); background: #eef0e9; }
.quick-route .index, .route-preset .index { font-family: var(--display); color: var(--accent); font-size: 14px; }
.quick-route strong, .route-preset strong { display: block; font-size: 12px; font-weight: 500; }
.quick-route small, .route-preset small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.quick-route .arrow, .route-preset .arrow { color: var(--accent); }
.landmark-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.landmark-button { min-height: 78px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.35); text-align: left; }
.landmark-button:hover { border-color: var(--lake); }
.landmark-button strong { display: block; font-family: var(--display); font-size: 15px; font-weight: 600; }
.landmark-button small { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 10px; }
.sidebar-footer { display: flex; align-items: flex-start; gap: 8px; margin-top: auto; padding-top: 20px; color: var(--ink-soft); }
.sidebar-footer p { margin: 0; font-size: 9px; line-height: 1.7; }
.status-dot { flex: 0 0 auto; width: 5px; height: 5px; margin-top: 5px; border-radius: 50%; background: var(--lake); }

.category-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.category-filter { min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 20px; background: transparent; color: var(--ink-soft); font-size: 11px; }
.category-filter.active { border-color: var(--ink); color: var(--ink); background: #e6ece5; }
.place-list { margin-top: 12px; }
.place-item { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 12px 4px; border: 0; border-bottom: 1px solid #e5e2d8; background: transparent; text-align: left; }
.place-item:hover { color: var(--accent); }
.place-item strong { font-size: 12px; font-weight: 500; }
.place-item small { color: var(--ink-soft); font-size: 10px; }

.primary-button, .secondary-button { min-height: 44px; padding: 10px 14px; border-radius: 10px; font-size: 12px; transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: #f8f5ec; }
.primary-button:hover { background: #28534e; }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,0.32); }
.secondary-button:hover { border-color: var(--ink-soft); }
.primary-button:active, .secondary-button:active { transform: scale(0.985); }
.full-button { width: 100%; }
.text-button { min-height: 36px; padding: 6px 0; border: 0; background: transparent; color: var(--ink-soft); font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
.form-note { margin: 10px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }

.map-tools { position: fixed; z-index: 34; top: 88px; right: 22px; display: grid; gap: 8px; }
.tool-button { width: 64px; min-height: 53px; padding: 8px 5px; border: 1px solid rgba(23,60,57,0.13); border-radius: 12px; background: var(--panel); box-shadow: 0 8px 25px rgba(27,54,48,0.08); }
.tool-button span { display: block; font-family: var(--display); font-size: 13px; }
.tool-button small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 8px; }
.tool-button.active { border-color: var(--lake); background: #e8f0eb; }
.north-symbol { position: relative; }
.north-symbol::before { content: ""; display: block; width: 0; height: 0; margin: 0 auto 2px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid var(--accent); }

.floating-card { position: fixed; z-index: 38; padding: 22px; background: var(--panel); border: 1px solid rgba(23,60,57,0.14); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.floating-card h2 { margin: 8px 0 12px; font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.35; }
.floating-card p:not(.eyebrow):not(.form-note) { color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.card-close { position: absolute; z-index: 2; top: 10px; right: 11px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-family: var(--display); font-size: 23px; }
.card-close:hover { background: rgba(23,60,57,0.06); }
.info-card { left: 22px; bottom: 24px; width: 350px; max-height: calc(100dvh - 110px); overflow-y: auto; }
#info-facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; }
#info-facts dt { color: var(--ink-soft); }
#info-facts dd { margin: 0; text-align: right; }
.card-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; }
.place-actions + .text-button { display: block; margin: 6px auto -6px; }

.route-builder { top: 88px; left: 22px; width: 370px; }
.route-builder h2 { margin-bottom: 20px; }
.route-form { position: relative; display: grid; gap: 9px; }
.route-field { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); text-align: left; }
.route-field:hover, .route-field.choosing { border-color: var(--lake); }
.route-field small, .route-field strong { display: block; }
.route-field small { margin-bottom: 4px; color: var(--ink-soft); font-size: 9px; }
.route-field strong { max-width: 225px; overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.route-field em { color: var(--ink-soft); font-size: 10px; font-style: normal; }
.endpoint-dot { width: 9px; height: 9px; border: 2px solid; border-radius: 50%; }
.start-dot { border-color: var(--lake); }
.end-dot { border-color: var(--accent); }
.swap-button { position: absolute; z-index: 1; right: 44px; top: 51px; width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--accent); font-size: 17px; }
.route-picker { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #f4f3ec; }
.route-picker input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; color: var(--ink); }
#route-picker-hint { margin: 8px 2px; font-size: 9px; }
#route-picker-results { max-height: 190px; overflow-y: auto; }
.route-picker-result { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 42px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 11px; }
.route-picker-result small { color: var(--ink-soft); font-size: 9px; }

.route-card { top: 88px; bottom: 24px; left: 22px; width: 380px; display: flex; flex-direction: column; overflow: hidden; }
#route-overview-content { display: flex; min-height: 0; max-height: 100%; flex-direction: column; }
.route-card h2 { padding-right: 24px; font-size: 22px; }
.route-metrics { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 16px; }
.route-metrics strong { font-family: var(--display); font-size: 30px; color: var(--accent); }
.route-metrics span { color: var(--ink-soft); font-size: 12px; }
.route-metrics .route-mode { margin-left: auto; padding: 4px 7px; border: 1px solid var(--line); border-radius: 20px; font-size: 9px; }
.route-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.route-details { min-height: 0; margin-top: 2px; overflow-y: auto; overscroll-behavior: contain; }
#route-steps { margin: 0; padding: 0; list-style: none; }
#route-steps li { position: relative; padding-left: 30px; }
#route-steps li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 37px; bottom: -4px; width: 1px; background: var(--line); }
.route-step { position: relative; display: block; width: 100%; min-height: 52px; padding: 9px 8px 9px 0; border: 0; border-radius: 8px; background: transparent; color: #39554f; text-align: left; font-size: 11px; line-height: 1.65; }
.route-step:hover { background: rgba(95,143,145,0.08); }
.route-step.active { color: var(--ink); background: #e8efea; }
.step-index { position: absolute; left: -30px; top: 10px; width: 22px; color: var(--accent); font-family: var(--display); font-size: 13px; text-align: center; }
.route-step small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.sheet-toggle { display: none; }

.guide-controls { min-height: 0; overflow-y: auto; }
.guide-heading { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 10px; }
.guide-heading small { margin-left: auto; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(195,95,69,0.12); }
.guide-controls h2 { margin-top: 20px; font-size: 22px; }
#guide-distance { margin: 0 0 20px; }
.guide-actions { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 7px; }
.guide-controls > .text-button { display: block; margin: 12px auto 0; }

.map-toast { position: fixed; z-index: 90; left: 50%; bottom: 34px; max-width: min(440px, calc(100vw - 32px)); padding: 11px 16px; transform: translateX(-50%); border-radius: 10px; background: rgba(23,60,57,0.94); color: #fff; box-shadow: var(--shadow); font-size: 12px; line-height: 1.6; text-align: center; pointer-events: none; }
.map-caption { position: fixed; z-index: 30; left: 50%; bottom: 12px; display: flex; gap: 18px; transform: translateX(-50%); color: rgba(23,60,57,0.7); font-size: 9px; letter-spacing: 0.05em; white-space: nowrap; pointer-events: none; }
.campus-icp { position: fixed; z-index: 31; right: 12px; bottom: 5px; font-size: 8px; opacity: 0.62; }
.campus-icp a { color: var(--ink); text-decoration: none; }
.campus-noscript { position: fixed; z-index: 110; inset: 35% 20%; padding: 24px; background: var(--paper); text-align: center; }
.campus-label { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 8px; color: var(--ink); background: rgba(250,248,241,0.94); border: 0; border-bottom: 1px solid rgba(23,60,57,0.35); border-radius: 5px; box-shadow: 0 3px 12px rgba(24,48,42,0.09); font-size: 11px; white-space: nowrap; cursor: pointer; }
.campus-label::before { content: none; }
.campus-label.major { font-family: var(--display); font-size: 13px; font-weight: 600; }
.campus-label:not(.major) { padding: 3px 6px; font-size: 10px; }
.place-icon { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 16px; height: 16px; color: var(--lake); }
.place-icon svg { display: block; width: 100%; height: 100%; }
.major .place-icon { width: 18px; height: 18px; }
.campus-label.destination { color: var(--accent); border-bottom-color: var(--accent); }
.destination .place-icon { color: var(--accent); }
.campus-label.transit { border-bottom-color: var(--lake); background: rgba(239,246,241,0.96); }
.campus-label.bicycle { border-bottom-color: var(--gold); background: rgba(250,246,232,0.97); }
.bicycle .place-icon { color: var(--gold); }
.campus-label.metro { border-bottom-color: var(--accent); background: rgba(250,241,235,0.96); }
.metro .place-icon { color: var(--accent); }
.campus-label.food .place-icon { color: var(--accent); }
.campus-label.zone { border: 1px solid rgba(23,60,57,0.22); background: rgba(236,241,232,0.95); }
.campus-label.unverified { color: #53645f; border-bottom-style: dashed; }
.road-label { color: rgba(45,72,65,0.62); font-family: var(--display); font-size: 11px; letter-spacing: 0.18em; white-space: nowrap; text-shadow: 0 1px 4px #f2f3ec; pointer-events: none; }
.route-endpoint { min-width: 42px; padding: 7px 10px; border: 2px solid rgba(255,255,255,0.85); border-radius: 9px; color: white; background: var(--accent); box-shadow: 0 5px 18px rgba(80,40,30,0.18); font-size: 11px; text-align: center; }
.route-endpoint.start { background: var(--lake); }

.loading-screen { position: fixed; z-index: 100; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper); transition: opacity 0.55s ease, visibility 0.55s; }
.loading-screen.done { opacity: 0; visibility: hidden; }
.loading-screen h2 { margin: 10px 0; font-family: var(--display); font-size: 32px; font-weight: 500; }
.loading-screen > p:last-of-type { color: var(--ink-soft); font-size: 12px; }
.loading-art { position: relative; width: 100px; height: 100px; margin-bottom: 25px; border: 1px solid var(--line); border-radius: 50%; animation: slow-spin 14s linear infinite; }
.loading-art span { position: absolute; inset: 18px; border: 2px solid var(--lake); border-top-color: transparent; border-radius: 50%; }
.loading-art i { position: absolute; left: 49px; top: 9px; width: 1px; height: 80px; background: var(--accent); transform: rotate(32deg); }
.loading-art b { position: absolute; left: 45px; top: 45px; width: 10px; height: 10px; background: var(--ink); border-radius: 50%; }
.loading-line { width: 160px; height: 1px; margin-top: 20px; overflow: hidden; background: var(--line); }
.loading-line span { display: block; width: 50%; height: 100%; background: var(--accent); animation: loading 1.4s ease-in-out infinite; }
.retry-button { min-width: 128px; margin-top: 18px; }
#loading-detail { max-width: min(520px, calc(100vw - 48px)); line-height: 1.8; text-align: center; }

@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(200%); } }

@media (max-width: 1100px) {
  .topbar-title { display: none; }
}

@media (max-width: 900px) {
  .topbar { top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; gap: 8px; }
  .icon-button { min-width: 44px; min-height: 46px; padding: 0 12px; }
  .button-word { display: none; }
  .search-wrap { flex: 1 1 auto; width: auto; margin: 0; }
  .search-wrap input { height: 46px; padding-left: 38px; padding-right: 12px; border-radius: 12px; font-size: 13px; }
  .search-symbol { left: 16px; top: 16px; }
  .search-key { display: none; }
  #search-results { top: 52px; max-height: min(48dvh, 360px); }
  .route-entry { min-width: 52px; min-height: 46px; padding: 0 10px; }
  .route-entry > span:last-child { display: none; }
  .sidebar { top: auto; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; height: min(72dvh, 620px); padding: 20px 18px; border-radius: 18px; transform: translateY(calc(100% + 24px)); transition: transform 0.2s ease, visibility 0.2s; }
  .sidebar.open { transform: translateY(0); }
  .brand-block { grid-template-columns: 34px 1fr; padding-bottom: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark span { left: 6px; top: 6px; width: 20px; height: 20px; }
  .brand-mark i { left: 16px; top: 3px; height: 27px; }
  .brand-block h1 { font-size: 23px; }
  .map-tools { top: calc(68px + env(safe-area-inset-top)); right: 10px; gap: 7px; }
  .tool-button { width: 46px; min-height: 44px; padding: 6px 3px; border-radius: 11px; }
  .tool-button small { display: none; }
  .floating-card { backdrop-filter: blur(16px); }
  .info-card { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-height: 52dvh; padding: 18px; }
  .info-card h2 { font-size: 22px; }
  #info-description { max-height: 54px; overflow-y: auto; }
  #info-facts { margin: 10px 0; padding: 9px 0; }
  .route-builder { top: auto; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-height: 76dvh; padding: 20px 18px; overflow-y: auto; }
  .route-builder h2 { font-size: 22px; }
  .route-field { min-height: 60px; }
  .route-field strong { max-width: calc(100vw - 180px); }
  .route-card { top: auto; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-height: 70dvh; padding: 17px 16px 14px; border-radius: 18px; }
  .sheet-toggle { display: flex; align-items: center; justify-content: center; width: 64px; height: 18px; margin: -12px auto 5px; padding: 0; border: 0; background: transparent; }
  .sheet-toggle span { width: 34px; height: 4px; border-radius: 4px; background: #c8cec7; }
  .route-card h2 { margin: 5px 0 6px; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .route-metrics { margin: 0 0 12px; }
  .route-metrics strong { font-size: 27px; }
  .route-actions .primary-button, .route-actions .secondary-button { min-height: 46px; }
  .route-card:not(.expanded) .route-details { display: none; }
  .route-card.expanded #route-overview-content { height: 100%; }
  .route-card.expanded .route-details { flex: 1; }
  .route-card.guiding { max-height: 45dvh; }
  .guide-controls h2 { margin-top: 14px; font-size: 20px; }
  .guide-actions button { min-height: 46px; padding-left: 8px; padding-right: 8px; }
  .map-caption { left: 12px; bottom: calc(4px + env(safe-area-inset-bottom)); transform: none; font-size: 8px; }
  .map-caption span:last-child { display: none; }
  .map-toast { bottom: calc(30px + env(safe-area-inset-bottom)); }
  body.route-active .map-toast, body.guide-active .map-toast { bottom: calc(210px + env(safe-area-inset-bottom)); }
  .campus-icp { display: none; }
  .amap-scalecontrol { bottom: 22px !important; }
}

@media (max-width: 370px) {
  .topbar { left: 7px; right: 7px; gap: 6px; }
  .icon-button { min-width: 42px; padding: 0 10px; }
  .route-entry { min-width: 46px; padding: 0 8px; }
  .route-metrics .route-mode { display: none; }
  .route-card { padding-left: 14px; padding-right: 14px; }
}

@media (max-height: 560px) and (orientation: landscape) and (max-width: 950px) {
  .topbar { top: 7px; }
  .map-tools { top: 62px; right: 8px; grid-template-columns: repeat(2, 44px); }
  .route-card { top: 64px; bottom: 8px; left: 8px; right: auto; width: 330px; max-height: none; }
  .route-card:not(.expanded) .route-details { display: block; }
  .route-card.expanded #route-overview-content { height: auto; }
  .route-card.guiding { max-height: none; }
  .sheet-toggle { display: none; }
  .route-builder, .info-card { top: 64px; bottom: 8px; left: 8px; right: auto; width: 330px; max-height: none; }
  .sidebar { top: 64px; bottom: 8px; left: 8px; right: auto; width: 330px; height: auto; transform: translateX(calc(-100% - 20px)); }
  body.route-active .map-toast, body.guide-active .map-toast { bottom: 20px; left: 68%; }
}

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