/* Baxter Maps -- components. */

/* ---------- icon buttons, buttons ---------- */
.ic { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); flex: none; }
.ic:hover { background: var(--hover); }
.ic.blue { color: var(--blue); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 24px; border-radius: 20px; font-weight: 500; font-size: 14px; letter-spacing: .01em; white-space: nowrap; }
.btn svg.i { width: 18px; height: 18px; }
.btn.filled { background: var(--blue); color: var(--on-blue); }
.btn.filled:hover { box-shadow: var(--shadow-1); filter: brightness(1.05); }
.btn.tonal { background: var(--blue-tonal); color: var(--on-tonal); }
.btn.outline { border: 1px solid var(--outline); color: var(--blue); padding: 0 16px; }
.btn.outline:hover { background: var(--hover); }
.btn.text { color: var(--blue); padding: 0 12px; }
.btn.text:hover { background: var(--hover); }
.btn.wide { width: 100%; height: 48px; border-radius: 24px; font-size: 16px; }

/* ---------- search pill ---------- */
.pill-search { height: var(--pill-h); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-2); display: flex; align-items: center; padding: 0 4px 0 6px; gap: 0; }
.pill-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; padding: 0 4px 0 8px; color: var(--text); }
.pill-search input::placeholder { color: var(--text2); }
.pill-search input::-webkit-search-cancel-button { display: none; }
.logo { width: 36px; height: 36px; flex: none; border-radius: 50%; background: url(/icons/icon-192.png) center/28px no-repeat; margin-left: 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #7cacf8; color: #062e6f; font-weight: 500; font-size: 15px; flex: none; margin: 0 4px 0 2px; display: flex; align-items: center; justify-content: center; }
:root[data-theme="dark"] .avatar { background: #0842a0; color: #d3e3fd; }
#q-dir { display: none; }
body.searching #q-logo, body.searching #q-you { display: none; }
body.searching #q-back { display: inline-flex !important; }
@media (min-width: 1024px) and (min-height: 521px) {
  .pill-search { box-shadow: var(--shadow-1); }
  #q-you { display: none; }
  #q-dir { display: inline-flex; }
  #q-logo { display: none; }
  .pill-search { padding-left: 12px; }
  .panel:not([data-view="explore"]) .pill-search, body.searching .pill-search { box-shadow: none; background: var(--field); }
}

/* ---------- category chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 12px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px 0 8px; border-radius: 8px; background: var(--surface); color: var(--text2); box-shadow: var(--shadow-1); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.chip svg.i { width: 18px; height: 18px; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--blue-tonal); color: var(--on-tonal); }
.chip.plain { box-shadow: none; border: 1px solid var(--outline); }

/* ---------- FABs, compass ---------- */
.fab { width: 56px; height: 56px; border-radius: 16px; background: var(--surface); color: var(--text2); box-shadow: var(--shadow-3); display: flex; align-items: center; justify-content: center; }
.fab.blue { background: var(--blue); color: var(--on-blue); }
.fab.small { width: 40px; height: 40px; border-radius: 50%; box-shadow: var(--shadow-2); }
.fab.small svg.i { width: 22px; height: 22px; }
#fab-locate { width: 48px; height: 48px; border-radius: 50%; color: var(--blue); }
#fab-locate.off { color: var(--text2); }
.compass { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-2); display: flex; align-items: center; justify-content: center; }
.compass svg { width: 22px; height: 22px; transition: transform .1s linear; }
@media (min-width: 1024px) and (min-height: 521px) {
  #fab-locate { width: 40px; height: 40px; box-shadow: var(--shadow-1); }
  #fab-layers { width: 64px; height: 64px; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-2); flex-direction: column; justify-content: flex-end; padding-bottom: 4px; font-size: 11px; color: var(--text); }
}

/* ---------- bottom nav (phone) ---------- */
.bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text2); }
.bottomnav .ind { width: 56px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.bottomnav .active { color: var(--text); }
.bottomnav .active .ind { background: var(--blue-tonal); color: var(--on-tonal); }

/* ---------- rail (desktop) ---------- */
.rail-btn { width: 56px; min-height: 56px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text2); font-size: 12px; font-weight: 500; }
.rail-btn:hover { color: var(--text); }
.rail-btn:hover svg.i { background: var(--hover); }
.rail-btn svg.i { width: 56px; height: 32px; padding: 4px 16px; border-radius: 16px; box-sizing: border-box; }
.rail-btn.active svg.i { background: var(--blue-tonal); color: var(--on-tonal); }
#rail-menu { min-height: 48px; margin-bottom: 8px; }

/* ---------- list rows (suggestions, results, saved, recents, menus) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 16px; padding: 10px 16px; min-height: 56px; cursor: pointer; }
.row:hover, .row.active { background: var(--hover); }
.row .lead { width: 40px; height: 40px; border-radius: 50%; background: var(--press); color: var(--text2); display: flex; align-items: center; justify-content: center; flex: none; }
.row .lead svg.i { width: 20px; height: 20px; }
.row .lead.plain { background: none; }
.row .body { flex: 1; min-width: 0; }
.row .t1 { font-size: 16px; line-height: 22px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t1 b { font-weight: 500; }
.row .t2 { font-size: 14px; line-height: 20px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .trail { font-size: 12px; color: var(--text2); flex: none; text-align: right; }
.row .trail.btn-ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.row .trail.btn-ic:hover { background: var(--press); }
.sep { height: 1px; background: var(--line); margin: 4px 0; }
.sec-title { font-size: 14px; font-weight: 500; color: var(--text); padding: 16px 16px 4px; }
.sec-title .muted { font-weight: 400; }
.empty { padding: 32px 24px; color: var(--text2); text-align: center; }
.note { padding: 12px 16px; color: var(--text2); font-size: 13px; }

/* results list (Q4): Google's place rows */
.res { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 12px; }
.res:hover, .res.hl { background: var(--surface2); }
.res .body { flex: 1; min-width: 0; }
.res .name { font-size: 16px; font-weight: 500; line-height: 24px; color: var(--text); }
.res .meta { font-size: 14px; line-height: 20px; color: var(--text2); }
.res .meta .dot::before { content: "·"; margin: 0 4px; }
.res .open { color: var(--open); } .res .closed { color: var(--closed); } .res .soon { color: var(--soon); }
.res .go { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-tonal); color: var(--on-tonal); display: flex; align-items: center; justify-content: center; flex: none; align-self: center; }
.res .go svg.i { width: 20px; height: 20px; }
.res-head { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 16px; }
.res-head h2 { margin: 0; font-size: 22px; font-weight: 400; flex: 1; }
.res-filters { display: flex; gap: 8px; padding: 4px 16px 12px; overflow-x: auto; scrollbar-width: none; }
.searcharea { position: absolute; left: 50%; transform: translateX(-50%); z-index: 3; top: calc(8px + var(--sat) + var(--pill-h) + 56px); }
.searcharea .btn { box-shadow: var(--shadow-2); background: var(--surface); color: var(--blue); height: 36px; font-size: 14px; }
@media (min-width: 1024px) and (min-height: 521px) { .searcharea { top: 64px; left: calc(var(--rail-w) + var(--panel-w) + (100vw - var(--rail-w) - var(--panel-w)) / 2); position: fixed; } }
.check { display: flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--text2); font-size: 14px; }

/* ---------- place sheet (P1-P3) ---------- */
.place { padding: 4px 0 16px; }
.place-head { padding: 0 16px 0 24px; display: flex; gap: 8px; align-items: flex-start; }
.place-head h1 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 400; flex: 1; min-width: 0; }
.place-sub { padding: 2px 24px 0; color: var(--text2); font-size: 14px; }
.place-sub .open { color: var(--open); } .place-sub .closed { color: var(--closed); } .place-sub .soon { color: var(--soon); }
.actions { display: flex; gap: 8px; overflow-x: auto; padding: 12px 24px 12px; scrollbar-width: none; }
.actions::-webkit-scrollbar { display: none; }
.actions .btn { height: 36px; padding: 0 16px; flex: none; font-size: 14px; }
.actions .btn.outline { color: var(--blue); }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tab { flex: 1; height: 48px; font-weight: 500; color: var(--text2); position: relative; max-width: 140px; }
.tab.on { color: var(--blue); }
.tab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }
.info-row { display: flex; gap: 24px; align-items: flex-start; padding: 12px 24px; color: var(--text); font-size: 14px; line-height: 20px; cursor: default; }
.info-row svg.i { color: var(--blue); margin-top: -2px; }
.info-row.link { cursor: pointer; }
.info-row.link:hover { background: var(--hover); }
.info-row .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.info-row .sub { color: var(--text2); }
.week { margin-top: 6px; display: grid; grid-template-columns: 96px 1fr; gap: 2px 8px; color: var(--text2); }
.week .today { color: var(--text); font-weight: 500; }
.about { padding: 8px 24px 16px; }
.about h3 { font-size: 16px; font-weight: 500; margin: 12px 0 6px; }
.about .facts { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text2); }
.about .facts span { display: inline-flex; align-items: center; gap: 6px; }
.about .facts svg.i { width: 18px; height: 18px; color: var(--open); }
.hero { width: calc(100% - 32px); height: 180px; object-fit: cover; display: block; margin: 4px 16px 0; border-radius: 12px; }
.credit { font-size: 11px; color: var(--muted); padding: 2px 24px 8px; }
.credit a { color: inherit; }
.deps { padding: 0 16px; }
.dep { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.dep .time { width: 64px; font-variant-numeric: tabular-nums; font-weight: 500; }
.dep .rt { color: var(--open); font-size: 12px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 4px; font-size: 13px; font-weight: 500; color: #fff; background: #5f6368; line-height: 1; }

/* ---------- directions (D1-D6) ---------- */
.dir-head { padding: 8px 8px 0; background: var(--surface); position: sticky; top: 0; z-index: 2; }
.dir-top { display: flex; align-items: flex-start; gap: 4px; }
.endpoints { flex: 1; display: flex; gap: 12px; min-width: 0; }
.endpoints .dots { display: flex; flex-direction: column; align-items: center; padding: 18px 0 0; width: 16px; }
.dots .from { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--text2); }
.dots .line { width: 2px; height: 22px; margin: 4px 0; background: repeating-linear-gradient(var(--outline) 0 3px, transparent 3px 6px); }
.dots svg.i { width: 18px; height: 18px; color: #ea4335; }
.endpoints .inputs { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.endpoints input { height: 44px; border-radius: 8px; border: 1px solid var(--outline); background: var(--surface); padding: 0 12px; font-size: 15px; outline: 0; width: 100%; color: var(--text); }
.endpoints input:focus { border: 2px solid var(--blue); padding: 0 11px; }
.modes { display: flex; gap: 4px; overflow-x: auto; padding: 10px 0 8px 36px; scrollbar-width: none; }
.modes::-webkit-scrollbar { display: none; }
.mode { height: 32px; padding: 0 12px 0 8px; border-radius: 16px; display: inline-flex; align-items: center; gap: 6px; color: var(--text2); font-size: 14px; font-weight: 500; flex: none; }
.mode svg.i { width: 20px; height: 20px; }
.mode.on { background: var(--blue-tonal); color: var(--on-tonal); }
.mode:hover:not(.on) { background: var(--hover); }
.mode .d:empty { display: none; }
.dir-opts { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px 36px; flex-wrap: wrap; }
.dir-opts select, .dir-opts input { height: 32px; border-radius: 8px; border: 1px solid var(--outline); background: var(--surface); color: var(--text); padding: 0 8px; font-size: 13px; }
.itins { border-top: 8px solid var(--surface2); }
.itin { padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: 24px 1fr auto; gap: 0 16px; position: relative; }
.itin:hover { background: var(--surface2); }
.itin.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.itin .mi { color: var(--text2); padding-top: 2px; }
.itin .via { font-size: 16px; line-height: 22px; font-weight: 500; }
.itin .note2 { color: var(--text2); font-size: 14px; }
.itin .dur { font-size: 16px; font-weight: 500; text-align: right; white-space: nowrap; }
.itin .dur.green { color: var(--open); }
.itin .km { font-size: 14px; color: var(--text2); text-align: right; }
.itin .chain { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 6px; color: var(--text2); }
.itin .chain svg.i { width: 18px; height: 18px; }
.itin .chain .arrow { font-size: 11px; color: var(--muted); }
.itin .links { grid-column: 2 / 4; display: flex; gap: 8px; margin-top: 8px; }
.itin .links .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.sailings { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sailing { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--outline); font-size: 13px; color: var(--text2); display: inline-flex; align-items: center; }
.sailing.on { border-color: var(--blue); background: var(--blue-tonal); color: var(--on-tonal); font-weight: 500; }
.startbar { position: sticky; bottom: 0; padding: 12px 16px calc(12px + var(--sab)); background: var(--surface); box-shadow: 0 -1px 0 var(--line); display: flex; gap: 8px; z-index: 2; }
.startbar .btn { flex: 1; height: 48px; border-radius: 24px; font-size: 15px; }
.status { padding: 24px 16px; color: var(--text2); text-align: center; }
.warns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.warn { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; background: #fef7e0; color: #7a4a00; }
.warn.incident, .warn.closure { background: #fce8e6; color: #a50e0e; }
:root[data-theme="dark"] .warn { background: #4a3a14; color: #fdd663; }
:root[data-theme="dark"] .warn.incident, :root[data-theme="dark"] .warn.closure { background: #5c2321; color: #f6aea9; }

/* route detail: step list */
.route-sum { padding: 4px 16px 12px 20px; }
.route-sum .big { font-size: 22px; line-height: 28px; }
.route-sum .big b { font-weight: 400; color: var(--open); }
.route-sum .sub { color: var(--text2); }
.steps { list-style: none; margin: 0; padding: 0 0 8px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; padding: 12px 16px 0 20px; }
.step svg.i { color: var(--text2); }
.step .txt { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.step .txt .d { color: var(--text2); font-size: 13px; }
.leg { display: grid; grid-template-columns: 56px 24px 1fr; gap: 0 8px; padding: 0 16px 0 8px; }
.leg .t { font-size: 13px; color: var(--text2); padding-top: 10px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.leg .bar { position: relative; }
.leg .bar::before { content: ""; position: absolute; left: 9px; top: 16px; bottom: -14px; width: 6px; border-radius: 3px; background: var(--c, var(--outline)); }
.leg.walk .bar::before { width: 0; left: 10px; border-left: 4px dotted var(--muted); background: none; }
.leg .bar .pt { position: absolute; left: 4px; top: 10px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c, var(--muted)); }
.leg .body { padding: 8px 0 16px; min-width: 0; }
.leg .name { font-size: 15px; font-weight: 500; }
.leg .info { color: var(--text2); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.leg .info svg.i { width: 18px; height: 18px; }
.leg.end .bar::before { display: none; }
.leg .ol { margin: 6px 0 0; padding: 0; list-style: none; color: var(--text2); font-size: 13px; }
.leg .ol li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.leg .ol li svg.i { width: 18px; height: 18px; }
.warn-list { padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.warn-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; padding: 8px 10px; border-radius: 8px; background: #fef7e0; color: var(--text); }
.warn-row.incident, .warn-row.closure { background: #fce8e6; }
:root[data-theme="dark"] .warn-row { background: #4a3a14; }
:root[data-theme="dark"] .warn-row.incident, :root[data-theme="dark"] .warn-row.closure { background: #5c2321; }
.warn-row svg.i { width: 20px; height: 20px; color: #f29900; }
.warn-row.incident svg.i, .warn-row.closure svg.i { color: #d93025; }

/* ---------- view headers (You, Saved, Timeline...) ---------- */
.vhead { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.vhead h2 { margin: 0 0 0 4px; font-size: 22px; font-weight: 400; flex: 1; }
.you-card { display: flex; align-items: center; gap: 16px; padding: 12px 24px 16px; }
.you-card .avatar { width: 48px; height: 48px; font-size: 22px; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 12px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-weight: 500; }
.tile svg.i { color: var(--blue); }
.tile:hover { background: var(--hover); }
.data-ages { padding: 4px 16px 12px; }
.data-ages .row { min-height: 40px; }
.warnrow { color: var(--closed); }

/* ---------- layers sheet ---------- */
.layers-sheet { position: absolute; z-index: 9; inset: 0; }
.layers-sheet .scrim { position: absolute; inset: 0; background: var(--scrim); }
.layers-card { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 28px 28px 0 0; padding: 8px 0 calc(16px + var(--sab)); box-shadow: var(--shadow-3); }
.layers-card .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 4px 16px 8px; }
.lay { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.lay .sw { width: 56px; height: 56px; border-radius: 12px; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; background: var(--surface2); color: var(--text2); }
.lay.on .sw { border-color: var(--blue); color: var(--blue); }
.lay.on { color: var(--blue); font-weight: 500; }
.radios { display: flex; gap: 8px; padding: 4px 16px; }
@media (min-width: 1024px) and (min-height: 521px) {
  .layers-card { left: calc(var(--rail-w) + 16px); right: auto; bottom: 100px; width: 360px; border-radius: 12px; }
  body:not(.view-explore) .layers-card { left: calc(var(--rail-w) + var(--panel-w) + 16px); }
  .layers-sheet .scrim { background: transparent; }
}

/* ---------- drawer (desktop ☰) ---------- */
.drawer { position: absolute; inset: 0; z-index: 12; }
.drawer .scrim { position: absolute; inset: 0; background: var(--scrim); }
.drawer-card { position: absolute; left: 0; top: 0; bottom: 0; width: 320px; background: var(--surface); box-shadow: var(--shadow-3); padding: 12px 0; overflow-y: auto; animation: slidein .25s var(--ease); }
@keyframes slidein { from { transform: translateX(-100%); } }
.drawer-card .brand { display: flex; align-items: center; gap: 12px; padding: 8px 20px 12px; font-size: 20px; }
.drawer-card .brand img { width: 32px; height: 32px; }

/* ---------- context menu (C3) ---------- */
.ctxmenu { position: absolute; z-index: 11; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-3); padding: 6px 0; min-width: 240px; }
.ctxmenu button { display: flex; width: 100%; text-align: left; padding: 8px 16px; font-size: 14px; gap: 12px; align-items: center; }
.ctxmenu button:hover { background: var(--hover); }
.ctxmenu .coords { font-weight: 500; }
.ctxmenu svg.i { width: 20px; height: 20px; color: var(--text2); }

/* ---------- markers on the map ---------- */
.marker-pin { width: 27px; height: 43px; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.marker-pin svg { width: 27px; height: 43px; }
.marker-small { width: 18px; height: 18px; border-radius: 50%; background: #ea4335; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.marker-from { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #1f1f1f; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.bubble { background: var(--surface); color: var(--text); border-radius: 8px; box-shadow: var(--shadow-2); padding: 4px 8px; font-size: 13px; line-height: 16px; cursor: pointer; white-space: nowrap; border: 2px solid transparent; }
.bubble b { font-weight: 500; display: flex; align-items: center; gap: 4px; }
.bubble b svg.i { width: 16px; height: 16px; }
.bubble .sub { color: var(--text2); font-size: 11px; }
.bubble.on { color: var(--blue); border-color: var(--blue); }
.bubble.on .sub { color: var(--blue); }

/* ---------- dialog, toast, offline ---------- */
.ask { position: absolute; inset: 0; z-index: 30; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 24px; }
.ask-card { width: 100%; max-width: 360px; padding: 24px 24px 12px; display: flex; flex-direction: column; gap: 16px; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-3); }
.ask-title { font-size: 20px; line-height: 26px; }
.ask-card input { height: 48px; border: 1px solid var(--outline); border-radius: 4px; padding: 0 14px; font-size: 16px; outline: 0; background: var(--surface); }
.ask-card input:focus { border: 2px solid var(--blue); padding: 0 13px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 4px; }
.toast { position: absolute; bottom: calc(var(--bottomnav-h) + var(--sab) + 88px); left: 50%; transform: translateX(-50%); background: #303030; color: #f2f2f2; padding: 12px 16px; border-radius: 4px; z-index: 40; font-size: 14px; box-shadow: var(--shadow-2); max-width: calc(100% - 32px); }
body.sheet-open .toast { bottom: calc(var(--sheet-h) + 16px); }
.offline { position: absolute; top: 0; left: 0; right: 0; z-index: 20; background: #303030; color: #fff; text-align: center; padding: calc(4px + var(--sat)) 8px 4px; font-size: 13px; }

/* ---------- login (X4) ---------- */
.login { position: absolute; inset: 0; z-index: 50; background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; padding: 36px 32px 28px; border-radius: 28px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 601px) { .login { background: var(--ground); } .login-card { background: var(--surface); box-shadow: var(--shadow-1); } }
.login-logo { width: 48px; height: 48px; }
.login-card h1 { margin: 8px 0 0; font-size: 32px; line-height: 40px; font-weight: 400; }
.login-card p { margin: 0 0 12px; font-size: 16px; }
.field { position: relative; display: block; }
.field input { width: 100%; height: 56px; border: 1px solid var(--outline); border-radius: 4px; padding: 16px 16px 0; font-size: 16px; outline: 0; background: var(--surface); color: var(--text); }
.field span { position: absolute; left: 12px; top: 17px; padding: 0 4px; font-size: 16px; color: var(--text2); background: var(--surface); transition: all .15s var(--ease); pointer-events: none; }
.field input:focus { border: 2px solid var(--blue); }
.field input:focus + span, .field input:not(:placeholder-shown) + span { top: -9px; font-size: 12px; color: var(--blue); }
.field input { padding-top: 0; }
.login-err { color: var(--closed); font-size: 14px; }
.login-row { display: flex; justify-content: flex-end; margin-top: 12px; }

/* ---------- navigation (N1-N6) ---------- */
body.navigating .panel, body.navigating .rail, body.navigating .bottomnav, body.navigating .fabs, body.navigating .compass, body.navigating .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group, body.navigating .maplibregl-user-location-dot, body.navigating .maplibregl-user-location-accuracy-circle, body.navigating .searcharea { display: none !important; }
.nav { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav-top { position: absolute; top: calc(8px + var(--sat)); left: 8px; right: 8px; background: #0f5a2e; color: #fff; border-radius: 16px; box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 16px; padding: 16px 20px; max-width: 520px; }
:root[data-theme="dark"] .nav-top { background: #0d4a26; }
.nav-top.transit { background: #0b57d0; }
.nav-icon { width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 52px; height: 52px; fill: #fff; }
.nav-main { min-width: 0; }
.nav-dist { font-size: 32px; font-weight: 500; line-height: 38px; }
.nav-text { font-size: 20px; line-height: 26px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-text b { font-weight: 500; }
.nav-lanes { position: absolute; top: calc(8px + var(--sat) + 96px); left: 8px; background: #0a4523; border-radius: 0 0 14px 14px; padding: 6px 14px 8px; display: flex; gap: 2px; box-shadow: var(--shadow-1); }
.nav-lanes .lane { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; opacity: .38; }
.nav-lanes .lane.go { opacity: 1; }
.nav-lanes svg { width: 26px; height: 26px; fill: #fff; }
.nav-then { position: absolute; top: calc(8px + var(--sat) + 96px); left: 8px; background: #0a4523; color: #fff; border-radius: 0 0 14px 14px; padding: 8px 16px; font-size: 15px; box-shadow: var(--shadow-1); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-lanes:not([hidden]) + .nav-then { top: calc(8px + var(--sat) + 140px); border-radius: 0 0 14px 14px; }
.nav-then svg { width: 20px; height: 20px; fill: #fff; flex: none; }
.nav-warn { position: absolute; top: calc(8px + var(--sat) + 150px); left: 8px; right: 8px; max-width: 520px; background: #f9ab00; color: #1f1f1f; border-radius: 12px; padding: 8px 14px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-1); }
.nav-warn svg { width: 20px; height: 20px; fill: currentColor; }
.nav-side { position: absolute; right: 12px; top: calc(8px + var(--sat) + 190px); display: flex; flex-direction: column; gap: 12px; }
.nav-round { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--text2); box-shadow: var(--shadow-2); display: flex; align-items: center; justify-content: center; }
.nav-round.off { color: var(--closed); }
.nav-recenter { position: absolute; bottom: calc(112px + var(--sab)); left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--blue); border-radius: 20px; height: 40px; padding: 0 16px 0 12px; box-shadow: var(--shadow-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.nav-recenter svg.i { width: 20px; height: 20px; }
.nav-bottom { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 12px; padding: 16px 16px calc(16px + var(--sab)); }
@media (min-width: 601px) { .nav-bottom { left: 8px; right: auto; width: 480px; bottom: 8px; border-radius: 24px; padding-bottom: 16px; } .nav-top { max-width: 480px; } }
.nav-x { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--outline); color: var(--text2); display: flex; align-items: center; justify-content: center; flex: none; }
.nav-x:hover { background: var(--hover); }
.nav-eta { flex: 1; text-align: center; }
.nav-eta-dur { font-size: 28px; line-height: 34px; font-weight: 500; color: var(--open); }
.nav-eta-sub { font-size: 15px; color: var(--text2); }
.nav-arrive { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-3); padding: 20px 24px calc(20px + var(--sab)); }
@media (min-width: 601px) { .nav-arrive { left: 8px; right: auto; width: 480px; bottom: 8px; border-radius: 24px; } }
.nav-arrive h2 { margin: 0 0 4px; font-size: 22px; font-weight: 400; }
.nav-arrive .row2 { display: flex; gap: 8px; margin-top: 16px; }
.nav-arrive .row2 .btn { flex: 1; }
body.navigating .toast { bottom: auto; top: calc(160px + var(--sat)); }
.marker-nav { width: 48px; height: 48px; }
.marker-nav svg { width: 48px; height: 48px; }

/* speed pair */
.nav-speed { position: absolute; left: 12px; bottom: calc(112px + var(--sab)); display: flex; align-items: flex-end; gap: 10px; }
.speed-now { width: 60px; height: 60px; border-radius: 50%; background: #fff; color: #3c4043; border: 2px solid #dadce0; box-shadow: 0 1px 3px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; transition: border-color .3s, color .3s; }
.speed-now span { font-size: 22px; font-weight: 500; }
.speed-now small { font-size: 9px; color: #5f6368; margin-top: 3px; }
.speed-now.over { border-color: #d93025; color: #d93025; }
.speed-now.over small { color: #d93025; }
.speed-sign { width: 52px; height: 62px; border-radius: 8px; background: #fff; color: #202124; border: 3px solid #202124; box-shadow: 0 1px 3px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.speed-sign small { font-size: 7.5px; font-weight: 700; letter-spacing: .03em; margin-bottom: 3px; }
.speed-sign span { font-size: 24px; font-weight: 700; }
.speed-limit-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.speed-cap { font-size: 10px; font-weight: 600; background: #fbbc04; color: #202124; border-radius: 4px; padding: 2px 5px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
:root[data-theme="dark"] .speed-now { background: #303134; color: #e8eaed; border-color: #5f6368; }
:root[data-theme="dark"] .speed-now small { color: #9aa0a6; }
:root[data-theme="dark"] .speed-now.over { border-color: #f28b82; color: #f28b82; }

/* ---------- timeline ---------- */
.tl-head { display: flex; align-items: center; gap: 2px; padding: 8px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.tl-head input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tl-date-btn { flex: 1; text-align: center; font-size: 18px; font-weight: 500; height: 40px; border-radius: 20px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.tl-date-btn:hover { background: var(--hover); }
.tl-stats { display: flex; justify-content: center; gap: 28px; padding: 0 16px 12px; font-size: 14px; }
.tl-stats span { display: inline-flex; align-items: center; gap: 6px; }
.tl-stats svg.i { width: 20px; height: 20px; color: var(--text2); }
.tl-list { border-top: 1px solid var(--line); }
.tl-row { display: grid; grid-template-columns: 40px 1fr 40px; gap: 0 12px; padding: 0 12px; cursor: pointer; }
.tl-row:hover { background: var(--hover); }
.tl-row .bar { position: relative; }
.tl-row .bar::before { content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-row.visit .bar .pt { position: absolute; left: 0; top: 14px; width: 40px; height: 40px; border-radius: 50%; background: var(--c, #78909c); color: #fff; display: flex; align-items: center; justify-content: center; }
.tl-row.visit .bar .pt svg.i { width: 22px; height: 22px; }
.tl-row.move .bar .pt { position: absolute; left: 0; top: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text2); display: flex; align-items: center; justify-content: center; color: var(--text); }
.tl-row.move .bar .pt svg.i { width: 22px; height: 22px; }
.tl-row .body { padding: 14px 0 16px; min-width: 0; }
.tl-row .name { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row .info, .tl-row .when { font-size: 14px; color: var(--text2); font-variant-numeric: tabular-nums; }
.tl-row .more { align-self: start; margin-top: 10px; width: 40px; height: 40px; margin-right: -8px; display: flex; align-items: center; justify-content: center; color: var(--text2); border-radius: 50%; }
.tl-row .more:hover { background: var(--press); }

/* ---------- road-condition popup ---------- */
.rd-pop { font: 13px/1.4 Roboto, system-ui, sans-serif; color: #1f1f1f; }
.rd-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.rd-sev { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 10px; background: #fef7e0; color: #7a4a00; }
.rd-sev.major { background: #fce8e6; color: #a50e0e; }
.rd-desc { max-height: 140px; overflow: auto; }
.rd-when { margin-top: 6px; font-size: 11.5px; color: #5f6368; }
:root[data-theme="dark"] .maplibregl-popup-content { background: #2d2e30; color: #e3e3e3; }
:root[data-theme="dark"] .rd-pop { color: #e3e3e3; }
:root[data-theme="dark"] .maplibregl-popup-tip { border-top-color: #2d2e30; }

/* ---------- MapLibre controls ---------- */
.maplibregl-ctrl-group { box-shadow: var(--shadow-1) !important; border-radius: 8px !important; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
@media (min-width: 1024px) and (min-height: 521px) { .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: block; } }
.maplibregl-ctrl-bottom-left { left: 0; bottom: calc(var(--bottomnav-h) + var(--sab)); }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--bottomnav-h) + var(--sab)); }
body.sheet-open .maplibregl-ctrl-bottom-right, body.sheet-open .maplibregl-ctrl-bottom-left { bottom: var(--sheet-h); }
@media (min-width: 1024px) and (min-height: 521px) {
  .maplibregl-ctrl-bottom-left { left: calc(var(--rail-w) + 96px); bottom: 0; }
  body:not(.view-explore) .maplibregl-ctrl-bottom-left { left: calc(var(--rail-w) + var(--panel-w) + 96px); }
  body.sheet-open .maplibregl-ctrl-bottom-right, body.sheet-open .maplibregl-ctrl-bottom-left { bottom: 0; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-scale { border-color: var(--text2); color: var(--text2); background: rgba(255,255,255,.7); font-size: 10px; height: 16px; line-height: 12px; }
:root[data-theme="dark"] .maplibregl-ctrl-scale { background: rgba(31,31,31,.7); }
:root[data-theme="dark"] .maplibregl-ctrl-group { background: var(--surface); }
:root[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: var(--line); }
:root[data-theme="dark"] .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) hue-rotate(180deg); }
:root[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(31,31,31,.8); color: var(--muted); }
:root[data-theme="dark"] .maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-user-location-dot, .maplibregl-user-location-dot::after { width: 18px; height: 18px; background: #1a73e8; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(26,115,232,.25), 0 2px 6px rgba(0,0,0,.35); }
.maplibregl-user-location-dot::before { display: none; }
.maplibregl-user-location-dot::after { content: none; }
.maplibregl-user-location-accuracy-circle { background: rgba(26,115,232,.12); border: 1px solid rgba(26,115,232,.25); }
.maplibregl-ctrl-geolocate { display: none !important; }
