:root {
  --blue: #1a73e8;
  --blue-dark: #1557b0;
  --text: #202124;
  --muted: #5f6368;
  --line: #e8eaed;
  --bg: #fff;
  --hover: #f1f3f4;
  --shadow: 0 2px 4px rgba(0,0,0,.2), 0 -1px 0 rgba(0,0,0,.02);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.2);
  --panel-w: 408px;
  font-family: "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--text); }
#map { position: absolute; inset: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 24px; height: 24px; fill: currentColor; }
.hidden { display: none !important; }

.card { background: var(--bg); border-radius: 8px; box-shadow: var(--shadow); }

/* ---------- Search ---------- */
#search-card {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  width: 392px; height: 48px; display: flex; align-items: center;
  padding: 0 4px 0 6px; border-radius: 24px;
}
#search-card.open { border-radius: 24px 24px 0 0; }
#search-input {
  flex: 1; border: 0; outline: 0; font-size: 15px; padding: 0 8px; height: 100%;
  background: transparent; color: var(--text); min-width: 0;
}
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); }
.icon-btn.blue { color: var(--blue); }
.divider { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }

.suggestions {
  position: absolute; top: 48px; left: 0; right: 0; margin: 0; padding: 4px 0 8px;
  list-style: none; background: var(--bg); border-radius: 0 0 24px 24px;
  box-shadow: 0 4px 6px rgba(0,0,0,.2); border-top: 1px solid var(--line);
  max-height: 60vh; overflow-y: auto;
}
.suggestions li { display: flex; align-items: center; gap: 14px; padding: 8px 18px; cursor: pointer; }
.suggestions li:hover, .suggestions li.active { background: var(--hover); }
.suggestions .s-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; flex: none; font-size: 15px; }
.suggestions .s-text { min-width: 0; }
.suggestions .s-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestions .s-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Chips ---------- */
#chips {
  position: absolute; top: 16px; left: 418px; right: 70px; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 4px 6px;
}
#chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 16px; background: var(--bg);
  box-shadow: var(--shadow); font-size: 14px; white-space: nowrap;
}
.chip:hover { background: var(--hover); }
.chip.active { background: #e8f0fe; color: var(--blue); }
body.panel-open #chips { left: calc(var(--panel-w) + 12px); }

/* ---------- Side panel ---------- */
#panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: var(--panel-w); z-index: 15;
  background: var(--bg); box-shadow: var(--shadow-lg); overflow-y: auto;
  animation: slideIn .2s ease-out;
}
@keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } }
#panel-content { padding-top: 72px; }
body.panel-open #search-card { box-shadow: none; border: 1px solid var(--line); }
body.directions-mode #search-card, body.directions-mode #chips { display: none; }
body.directions-mode #panel-content { padding-top: 0; }

.place-hero {
  height: 160px; background: linear-gradient(135deg, #e8f0fe, #d2e3fc); display: grid; place-items: center;
  font-size: 64px; margin-top: -72px; padding-top: 72px; box-sizing: content-box;
}
.place-head { padding: 16px 24px 12px; }
.place-head h1 { font-size: 22px; font-weight: 400; margin: 0 0 4px; }
.place-head .cat { color: var(--muted); font-size: 14px; text-transform: capitalize; }

.actions { display: flex; justify-content: space-around; padding: 8px 12px 16px; border-bottom: 1px solid var(--line); }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--blue); width: 72px; }
.action .circ { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #dadce0; display: grid; place-items: center; }
.action.primary .circ { background: var(--blue); color: #fff; border-color: var(--blue); }
.action:hover .circ { background: #e8f0fe; }
.action.primary:hover .circ { background: var(--blue-dark); }
.action svg { width: 20px; height: 20px; }

.info-row { display: flex; gap: 20px; align-items: center; padding: 12px 24px; font-size: 14px; cursor: pointer; }
.info-row:hover { background: var(--hover); }
.info-row .ir-icon { width: 24px; color: var(--blue); flex: none; text-align: center; }
.info-row a { color: inherit; text-decoration: none; word-break: break-all; }
.attribution-note { font-size: 12px; color: var(--muted); padding: 16px 24px; }
.attribution-note a { color: var(--blue); }

/* results list */
.results-head { padding: 0 24px 8px; font-size: 13px; color: var(--muted); }
.result { padding: 14px 24px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 14px; }
.result:hover { background: var(--hover); }
.result .r-name { font-size: 15px; font-weight: 500; }
.result .r-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.result .r-icon { font-size: 22px; width: 28px; text-align: center; }
.empty { padding: 24px; color: var(--muted); font-size: 14px; }

/* ---------- Directions ---------- */
.dir-top { background: var(--bg); padding: 12px 12px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.dir-modes { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.dir-modes .mode { width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; color: var(--muted); }
.dir-modes .mode svg { width: 20px; height: 20px; }
.dir-modes .mode:hover { background: var(--hover); }
.dir-modes .mode.active { background: #e8f0fe; color: var(--blue); }
.dir-modes .close { margin-left: auto; }
.dir-fields { display: flex; align-items: center; gap: 8px; }
.dir-dots { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-left: 8px; }
.dir-dots .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); }
.dir-dots .pin { color: #ea4335; }
.dir-dots .pin svg { width: 16px; height: 16px; }
.dir-dots .vdots { width: 2px; height: 18px; background: repeating-linear-gradient(var(--muted) 0 2px, transparent 2px 6px); }
.dir-inputs { flex: 1; display: flex; flex-direction: column; gap: 8px; position: relative; }
.dir-input-wrap { position: relative; }
.dir-input-wrap input {
  width: 100%; height: 38px; border: 1px solid #dadce0; border-radius: 6px; padding: 0 12px; font-size: 14px; outline: 0;
  background: var(--bg); color: var(--text);
}
.dir-input-wrap input:focus { border-color: var(--blue); border-width: 2px; padding: 0 11px; }
.dir-input-wrap .suggestions { top: 40px; border-radius: 6px; z-index: 5; box-shadow: var(--shadow-lg); border: 0; }
.dir-input-wrap .suggestions li { padding: 8px 12px; }
.swap { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.swap:hover { background: var(--hover); }

.routes { }
.route-card { padding: 16px 24px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 16px; border-left: 4px solid transparent; }
.route-card:hover { background: var(--hover); }
.route-card.active { border-left-color: var(--blue); }
.route-card .rc-icon { color: var(--muted); }
.route-card .rc-main { flex: 1; }
.route-card .rc-via { font-size: 15px; font-weight: 500; }
.route-card .rc-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.route-card .rc-time { text-align: right; }
.route-card .rc-dur { font-size: 15px; font-weight: 500; color: #188038; }
.route-card .rc-dist { font-size: 13px; color: var(--muted); }
.steps-toggle { margin: 8px 24px 0; color: var(--blue); font-size: 14px; font-weight: 500; padding: 8px 0; }
.steps { list-style: none; margin: 0; padding: 0 0 24px; }
.steps li { display: flex; gap: 16px; padding: 10px 24px; font-size: 14px; cursor: pointer; align-items: flex-start; }
.steps li:hover { background: var(--hover); }
.steps .st-icon { width: 24px; font-size: 18px; text-align: center; color: var(--muted); flex: none; }
.steps .st-text { flex: 1; }
.steps .st-dist { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dir-note { font-size: 12px; color: var(--muted); padding: 12px 24px; }
.loading { padding: 24px; color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.spinner { width: 18px; height: 18px; border: 2px solid #dadce0; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Drawer ---------- */
#drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
#drawer {
  position: absolute; top: 0; left: 0; bottom: 0; width: 300px; background: var(--bg); z-index: 41;
  transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
#drawer.open { transform: none; }
.drawer-title { padding: 18px 24px; border-bottom: 1px solid var(--line); }
.logo { font-size: 22px; color: var(--muted); }
.logo b { color: var(--blue); font-weight: 500; }
.drawer-item { display: block; width: 100%; text-align: left; padding: 14px 24px; font-size: 14px; text-decoration: none; color: var(--text); }
.drawer-item:hover { background: var(--hover); }
.drawer-sep { height: 1px; background: var(--line); margin: 8px 0; }
.drawer-foot { margin-top: auto; padding: 16px 24px; font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ---------- Map controls ---------- */
#controls { position: absolute; right: 10px; bottom: 30px; z-index: 10; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ctrl { width: 40px; height: 40px; background: var(--bg); display: grid; place-items: center; color: #666; }
.ctrl:hover { color: var(--text); background: #f8f9fa; }
#locate-btn { border-radius: 8px; box-shadow: var(--shadow); }
#locate-btn.active { color: var(--blue); }
.ctrl-group { border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.ctrl-group .ctrl + .ctrl { border-top: 1px solid var(--line); }

#layers { position: absolute; left: 12px; bottom: 30px; z-index: 10; display: flex; align-items: flex-end; gap: 8px; }
body.panel-open #layers { left: calc(var(--panel-w) + 12px); }
#layer-btn {
  width: 76px; height: 76px; border-radius: 10px; border: 2px solid #fff; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
#layer-thumb { position: absolute; inset: 0; }
#layer-btn span {
  position: absolute; bottom: 0; left: 0; right: 0; color: #fff; font-size: 12px; padding: 14px 0 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); font-weight: 500;
}
#layer-menu { display: flex; gap: 4px; padding: 8px; }
.layer-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); padding: 4px; border-radius: 6px; }
.layer-opt:hover { background: var(--hover); }
.layer-opt.active { color: var(--blue); }
.layer-opt.active .thumb { outline: 2px solid var(--blue); }
.thumb { width: 52px; height: 52px; border-radius: 8px; background-size: cover; }
.t-liberty, #layer-thumb.t-liberty { background: linear-gradient(135deg, #f2efe9 0 40%, #aad3df 40% 55%, #c8e6a5 55% 75%, #f7d9a7 75%); }
.t-bright { background: linear-gradient(135deg, #f8f4f0 0 45%, #a0c8f0 45% 60%, #d8e8c8 60% 80%, #fc8 80%); }
.t-positron { background: linear-gradient(135deg, #fafaf8 0 45%, #d4dadc 45% 60%, #eee 60%); }
.t-dark { background: linear-gradient(135deg, #2b2b2b 0 45%, #1c2733 45% 60%, #3a3a3a 60%); }
.t-satellite { background: radial-gradient(circle at 30% 40%, #5a7a3a, #2f4a22 50%, #1f3550 80%); }

/* ---------- Context menu ---------- */
#ctx-menu { position: absolute; z-index: 50; list-style: none; margin: 0; padding: 6px 0; min-width: 210px; font-size: 14px; }
#ctx-menu li { padding: 9px 16px; cursor: pointer; }
#ctx-menu li:hover { background: var(--hover); }
#ctx-menu .ctx-coords { font-weight: 500; font-size: 13px; }

#measure-badge { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10; padding: 10px 16px; font-size: 14px; display: flex; gap: 12px; align-items: center; }
#measure-badge button { color: var(--blue); font-weight: 500; }

#toast {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: #323232; color: #fff; padding: 12px 20px; border-radius: 4px; font-size: 14px; box-shadow: var(--shadow-lg);
}

/* ---------- Markers ---------- */
.pin-marker { width: 27px; height: 43px; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.pin-marker svg { width: 27px; height: 43px; }
.result-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #ea4335; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: pointer; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600;
}
.start-marker { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid #202124; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.me-marker { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.2), 0 1px 4px rgba(0,0,0,.4); }
.measure-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #202124; }

.maplibregl-ctrl-bottom-right { right: 60px; }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* ---------- Dark UI ---------- */
body.dark-ui {
  --text: #e8eaed; --muted: #9aa0a6; --line: #3c4043; --bg: #202124; --hover: #2d2e31;
}
body.dark-ui .ctrl { color: #bbb; }
body.dark-ui .chip.active, body.dark-ui .dir-modes .mode.active { background: #1e3a5f; color: #8ab4f8; }
body.dark-ui .place-hero { background: linear-gradient(135deg, #1e3a5f, #283c55); }
body.dark-ui #toast { background: #e8eaed; color: #202124; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  :root { --panel-w: 100vw; }
  #search-card { left: 8px; right: 8px; width: auto; top: 8px; }
  #chips { left: 8px !important; right: 8px; top: 64px; }
  #panel { top: auto; height: 55vh; border-radius: 16px 16px 0 0; animation: slideUp .2s ease-out; }
  @keyframes slideUp { from { transform: translateY(30px); opacity: 0; } }
  #panel-content { padding-top: 8px; }
  .place-hero { display: none; }
  body.panel-open #search-card { border: 0; box-shadow: var(--shadow); }
  body.panel-open #layers, body.panel-open #controls { display: none; }
  body.directions-mode #panel { height: 65vh; }
  #layers { left: 8px !important; bottom: 24px; }
  #layer-menu { flex-wrap: wrap; max-width: calc(100vw - 110px); }
}

/* ---------- Suggestion extras ---------- */
.suggestions .s-header { cursor: default; padding: 10px 18px 4px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; justify-content: space-between; }
.suggestions .s-header:hover { background: none; }
.suggestions .s-clear { color: var(--blue); font-size: 12px; text-transform: none; letter-spacing: 0; }
.suggestions .s-name b { font-weight: 600; }
.suggestions .s-text { flex: 1; }
.suggestions .s-dist { font-size: 12px; color: var(--muted); flex: none; margin-left: 8px; }
.suggestions .s-icon.muted { background: transparent; filter: grayscale(1); opacity: .7; }
.suggestions .s-action .s-name { color: var(--blue); }
.suggestions .s-loading { cursor: default; color: var(--muted); font-size: 13px; gap: 10px; }
.suggestions .s-loading:hover { background: none; }
.result .r-main { flex: 1; min-width: 0; }
.result .r-dist { font-size: 12px; color: var(--muted); flex: none; }

/* =========================================================
   Motion: micro-interactions and animations
   ========================================================= */
:root {
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Shared hover / press feedback */
.icon-btn, .chip, .ctrl, .action .circ, .layer-opt, .drawer-item, .result, .route-card, .steps li,
.info-row, .suggestions li, .swap, .dir-modes .mode, #layer-btn, .steps-toggle, #ctx-menu li, .s-clear {
  transition: background-color .15s ease, color .15s ease, box-shadow .2s ease, transform .18s var(--spring), border-color .2s ease, opacity .15s ease;
}
.icon-btn:active, .ctrl:active, .swap:active, .dir-modes .mode:active { transform: scale(.88); }
.chip:active, .layer-opt:active { transform: scale(.94); }
.action:active .circ { transform: scale(.88); }
.action:hover .circ { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(26, 115, 232, .25); }
.result:active, .route-card:active, .suggestions li:active, .info-row:active { transform: scale(.985); }
.chip:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.chip.active { animation: pop .35s var(--spring); }
#directions-btn:hover svg { transform: rotate(-12deg) scale(1.08); }
#directions-btn svg, #menu-btn svg { transition: transform .25s var(--spring); }
#menu-btn:hover svg { transform: scaleX(1.12); }
#zoom-in:hover svg, #zoom-out:hover svg { transform: scale(1.12); }
.ctrl svg { transition: transform .2s var(--spring); }

/* Search card */
#search-card { transition: box-shadow .25s ease, border-radius .15s ease; }
#search-card:focus-within { box-shadow: 0 4px 16px rgba(0, 0, 0, .22); }
#clear-btn:not(.hidden) { animation: spinIn .3s var(--spring); }
#search-input::placeholder { transition: opacity .3s ease; }
#search-input.ph-fade::placeholder { opacity: 0; }

/* Suggestions: drop in, then rows cascade (only when the list is rebuilt) */
.suggestions:not(.hidden) { animation: dropIn .18s var(--ease-out); transform-origin: top; }
.suggestions.animate li { animation: fadeUp .26s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms); }
.suggestions li.active .s-icon { transform: scale(1.08); }
.suggestions .s-icon { transition: transform .2s var(--spring), background-color .15s; }
.suggestions li:hover .s-icon { transform: scale(1.08); }

/* Side panel: open/close + content cross-fade */
#panel.closing { animation: slideOut .18s ease-in forwards; pointer-events: none; }
#panel-content.reveal { animation: fadeIn .22s var(--ease-out); }
.reveal .result,
.reveal .route-card,
.reveal .info-row,
.reveal .action { animation: fadeUp .3s var(--ease-out) both; }
.reveal .action:nth-child(2) { animation-delay: 40ms; }
.reveal .action:nth-child(3) { animation-delay: 80ms; }
.reveal .action:nth-child(4) { animation-delay: 120ms; }
.reveal .result:nth-of-type(2), .reveal .route-card:nth-child(2), .reveal .info-row:nth-of-type(2) { animation-delay: 30ms; }
.reveal .result:nth-of-type(3), .reveal .route-card:nth-child(3), .reveal .info-row:nth-of-type(3) { animation-delay: 60ms; }
.reveal .result:nth-of-type(4), .reveal .info-row:nth-of-type(4) { animation-delay: 90ms; }
.reveal .result:nth-of-type(5), .reveal .info-row:nth-of-type(5) { animation-delay: 120ms; }
.reveal .result:nth-of-type(6), .reveal .info-row:nth-of-type(6) { animation-delay: 150ms; }
.reveal .result:nth-of-type(n+7) { animation-delay: 180ms; }
.reveal .place-hero > span { display: inline-block; animation: heroPop .55s var(--spring) both; animation-delay: 60ms; }
.reveal .place-head { animation: fadeUp .3s var(--ease-out) both; }
.steps li { animation: fadeUp .25s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 12) * 18ms); }
.route-card { position: relative; }
.route-card.active { background: linear-gradient(90deg, rgba(26, 115, 232, .06), transparent 60%); }
.result.hl { background: var(--hover); }
.result .r-icon { transition: transform .25s var(--spring); }
.result:hover .r-icon, .result.hl .r-icon { transform: scale(1.15) rotate(-6deg); }
.action.just-toggled .circ { animation: savePop .5s var(--spring); }
.action.just-toggled .circ svg { animation: pop .5s var(--spring); }

/* Skeleton loaders */
.skel-head { padding: 0 24px 8px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.skel-row { display: flex; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.skel-row .sk-icon { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.skel-row .sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk { background: linear-gradient(90deg, var(--hover) 25%, var(--line) 37%, var(--hover) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
.sk-line { height: 12px; }
.sk-line.w1 { width: 62%; } .sk-line.w2 { width: 86%; } .sk-line.w3 { width: 45%; }

/* Map markers */
.pin-marker { position: relative; }
.pin-marker svg { transform-origin: 50% 100%; animation: pinDrop .55s var(--spring) both; transition: transform .2s var(--spring); }
.pin-marker:hover svg { transform: scale(1.1) translateY(-2px); }
.pin-marker .pin-shadow { position: absolute; left: 50%; bottom: -3px; width: 14px; height: 5px; margin-left: -7px; border-radius: 50%; background: rgba(0, 0, 0, .3); filter: blur(1px); animation: shadowIn .55s var(--spring) both; }
.result-dot { animation: dotPop .4s var(--spring) both; transition: scale .2s var(--spring), background-color .2s; }
.result-dot.hl, .result-dot:hover { scale: 1.35; background: #c5221f; z-index: 2; }
.start-marker { animation: dotPop .4s var(--spring) both; }
.measure-dot { animation: dotPop .3s var(--spring) both; }
.me-marker { position: relative; }
.me-marker::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; background: rgba(26, 115, 232, .35); animation: pulse 2s ease-out infinite; z-index: -1; }
#locate-btn.locating svg { animation: spin 1.2s linear infinite; color: var(--blue); }

/* Floating UI */
#ctx-menu:not(.hidden) { animation: menuIn .16s var(--ease-out); transform-origin: top left; }
#layer-menu:not(.hidden) { animation: menuIn .2s var(--spring); transform-origin: bottom left; }
#layer-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
#layer-btn:active { transform: scale(.95); }
#layer-btn #layer-thumb { transition: transform .4s var(--ease-out); }
#layer-btn:hover #layer-thumb { transform: scale(1.08); }
.layer-opt .thumb { transition: transform .2s var(--spring), outline-color .2s; }
.layer-opt:hover .thumb { transform: scale(1.06); }
#toast:not(.hidden) { animation: toastIn .35s var(--spring); }
#toast.leaving { animation: toastOut .2s ease-in forwards; }
#measure-badge:not(.hidden) { animation: toastIn .3s var(--spring); }
#drawer { transition: transform .32s var(--ease-out); }
#drawer-backdrop:not(.hidden) { animation: fadeIn .25s ease; }
#drawer.open .drawer-item { animation: slideRight .3s var(--ease-out) both; }
#drawer.open .drawer-item:nth-of-type(2) { animation-delay: 30ms; }
#drawer.open .drawer-item:nth-of-type(3) { animation-delay: 60ms; }
#drawer.open .drawer-item:nth-of-type(4) { animation-delay: 90ms; }
#drawer.open .drawer-item:nth-of-type(5) { animation-delay: 120ms; }
#map { transition: filter .3s ease; }
body.style-switching #map { filter: blur(3px) saturate(.8); }

/* Keyframes */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(-24px); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-12px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes savePop { 0% { transform: scale(1); } 35% { transform: scale(.8); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes heroPop { from { opacity: 0; transform: scale(.3) rotate(-15deg); } }
@keyframes spinIn { from { opacity: 0; transform: rotate(-90deg) scale(.5); } }
@keyframes pinDrop { 0% { opacity: 0; transform: translateY(-40px) scale(.9); } 60% { opacity: 1; transform: translateY(0) scaleY(.85) scaleX(1.08); } 100% { transform: none; } }
@keyframes shadowIn { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.2); } 100% { transform: none; } }
@keyframes dotPop { from { opacity: 0; scale: 0; } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes menuIn { from { opacity: 0; transform: scale(.92); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.95); } to { transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (max-width: 640px) {
  #panel.closing { animation: slideDown .2s ease-in forwards; }
  @keyframes slideDown { to { opacity: 0; transform: translateY(40px); } }
}

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .me-marker::after { display: none; }
}
.route-card .rc-arrive { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; }

/* =========================================================
   Place extras: photos, about, weather, nearby, open status
   ========================================================= */
.place-hero.has-photos { height: auto; padding: 0; margin-top: 0; background: none; display: block; font-size: inherit; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 120px 120px; gap: 3px; height: 243px; position: relative; overflow: hidden; }
.hero-grid.n1 { grid-template-columns: 1fr; grid-template-rows: 243px; }
.hero-grid.n2 { grid-template-rows: 243px; }
.hero-grid .main { grid-row: 1 / 3; }
.hero-grid.n2 .side { grid-row: 1 / 3; }
.ph, .strip-ph { padding: 0; border: 0; overflow: hidden; background: var(--hover); cursor: zoom-in; position: relative; }
.ph img, .strip-ph img, .nb-card img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.04); transition: opacity .4s ease, transform .6s var(--ease-out); }
.ph img.loaded, .strip-ph img.loaded, .nb-card img.loaded { opacity: 1; transform: none; }
.ph:hover img.loaded { transform: scale(1.04); }
.ph-count { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.65); color: #fff; border-radius: 16px; padding: 6px 12px; font-size: 13px; backdrop-filter: blur(4px); transition: background .2s, transform .2s var(--spring); }
.ph-count:hover { background: rgba(0,0,0,.8); transform: translateY(-1px); }
.open-badge { display: inline-block; margin-top: 6px; font-size: 14px; font-weight: 500; animation: fadeUp .3s var(--ease-out); }
.open-badge.open { color: #188038; }
.open-badge.soon { color: #e37400; }
.open-badge.closed { color: #d93025; }
.pe-about { padding: 4px 24px 12px; border-bottom: 1px solid var(--line); animation: fadeUp .3s var(--ease-out); }
.pe-desc { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.pe-extract { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0; }
.pe-extract.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pe-about-links { display: flex; gap: 16px; margin-top: 6px; font-size: 13px; }
.pe-about-links a, .pe-more { color: var(--blue); text-decoration: none; font-weight: 500; }
.pe-section { padding: 16px 0 8px; border-top: 1px solid var(--line); animation: fadeUp .35s var(--ease-out); }
.pe-title { font-size: 16px; font-weight: 500; padding: 0 24px 10px; }
.pe-credit { font-size: 11px; color: var(--muted); padding: 6px 24px 0; }
.pe-credit a { color: inherit; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 0 24px 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.strip-ph { flex: none; width: 128px; height: 128px; border-radius: 10px; scroll-snap-align: start; }
.strip-ph:hover img.loaded { transform: scale(1.06); }
.nb-card { flex: none; width: 150px; text-align: left; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); scroll-snap-align: start; transition: transform .2s var(--spring), box-shadow .2s; }
.nb-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.nb-card img { height: 96px; background: var(--hover); }
.nb-name { display: block; font-size: 13px; font-weight: 500; padding: 8px 10px 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nb-sub { display: block; font-size: 11px; color: var(--muted); padding: 0 10px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx { margin: 0 24px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: linear-gradient(135deg, rgba(26,115,232,.06), transparent 70%); }
.wx-main { display: flex; align-items: center; gap: 12px; }
.wx-icon { font-size: 40px; line-height: 1; animation: heroPop .5s var(--spring) both; }
.wx-temp { font-size: 36px; font-weight: 400; }
.wx-text { display: flex; flex-direction: column; font-size: 14px; }
.wx-text small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.wx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.wx-grid div { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.wx-grid b { font-size: 14px; color: var(--text); font-weight: 500; }
.wx-grid b.aqi { color: #fff; border-radius: 6px; padding: 0 6px; align-self: flex-start; }

/* Lightbox */
#lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; animation: fadeIn .2s ease; }
#lightbox figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
#lightbox img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 4px; opacity: 0; transform: scale(.97); transition: opacity .3s ease, transform .35s var(--ease-out); }
#lightbox img.loaded { opacity: 1; transform: none; }
#lightbox figcaption { color: #e8eaed; font-size: 13px; margin-top: 12px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 80vw; text-align: center; }
#lightbox .lb-credit { color: #8ab4f8; text-decoration: none; }
#lightbox .lb-count { color: #9aa0a6; }
.lb-close, .lb-nav { position: absolute; color: #fff; background: rgba(255,255,255,.1); border-radius: 50%; width: 48px; height: 48px; font-size: 28px; display: grid; place-items: center; transition: background .15s, transform .2s var(--spring); }
.lb-close { top: 16px; right: 16px; font-size: 20px; }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.22); transform: scale(1.08); }

/* =========================================================
   Map extras: extra controls, layer toggles, modal, embed
   ========================================================= */
.ctrl.round { border-radius: 8px; box-shadow: var(--shadow); }
.ctrl-text { font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.ctrl.on { color: var(--blue); background: #e8f0fe; }
body.dark-ui .ctrl.on { background: #1e3a5f; color: #8ab4f8; }
#compass-btn svg { transition: transform .1s linear; }
#compass-btn:not(.hidden) { animation: dotPop .3s var(--spring); }
#locate-btn.following { background: var(--blue); color: #fff; }
.me-marker.has-heading::before { content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 22px solid rgba(26,115,232,.35); transform: translate(-50%, -100%) rotate(var(--heading, 0deg)); transform-origin: 50% 100%; }
#layer-menu { flex-wrap: wrap; max-width: 330px; }
.layer-toggles { width: 100%; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.lt-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 4px 4px; }
.lt { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.lt:hover { background: var(--hover); }
.lt input { display: none; }
.lt .sw { width: 30px; height: 18px; border-radius: 9px; background: #bdc1c6; position: relative; transition: background .2s; flex: none; }
.lt .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .25s var(--spring); }
.lt input:checked + .sw { background: var(--blue); }
.lt input:checked + .sw::after { transform: translateX(12px); }
#modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: grid; place-items: center; animation: fadeIn .2s ease; padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: 88vh; overflow: auto; border-radius: 16px; animation: menuIn .25s var(--spring); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 24px; }
.modal-head h2 { font-size: 18px; font-weight: 500; margin: 0; }
.modal-body { padding: 0 24px 24px; font-size: 14px; }
.modal-body .muted { color: var(--muted); }
.code { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--hover); color: var(--text); resize: vertical; }
.modal-actions { display: flex; gap: 8px; margin: 12px 0; }
.btn { padding: 8px 16px; border-radius: 18px; border: 1px solid #dadce0; font-size: 14px; color: var(--blue); text-decoration: none; font-weight: 500; transition: background .15s, transform .15s var(--spring); }
.btn:hover { background: #f1f6fe; }
.btn:active { transform: scale(.95); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-dark); }
.embed-preview { width: 100%; height: 260px; border: 0; border-radius: 10px; background: var(--hover); }
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; }
kbd { font-family: inherit; font-size: 12px; background: var(--hover); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 8px; justify-self: start; }
body.embed #search-card, body.embed #chips, body.embed #drawer, body.embed #layers, body.embed #fs-btn { display: none !important; }
body.embed #panel { width: min(340px, 70vw); }
#embed-open { position: absolute; top: 10px; left: 10px; z-index: 30; padding: 8px 14px; font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 500; border-radius: 18px; }
body.embed.panel-open #embed-open { left: auto; right: 10px; }

/* =========================================================
   Material Symbols (Google's icon set) + category colours
   ========================================================= */
:root { font-family: Roboto, "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
.mi {
  font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'liga'; user-select: none; flex: none;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; overflow: hidden; width: 1em; height: 1em;
}
.mi.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; }
.chip .mi { font-size: 18px; color: var(--muted); }
.chip.active .mi { color: var(--blue); }
.drawer-item { display: flex; align-items: center; gap: 18px; }
.drawer-item .mi { font-size: 22px; color: var(--muted); }
.logo { display: inline-flex; align-items: center; gap: 6px; }
.logo .logo-pin { color: #ea4335; font-size: 28px; }
#ctx-menu li { display: flex; align-items: center; gap: 12px; }
#ctx-menu li .mi { font-size: 20px; color: var(--muted); }
.action .mi { font-size: 20px; }
.ctrl .mi { font-size: 22px; }
.info-row .ir-icon { display: grid; place-items: center; }
.info-row .ir-icon .mi { font-size: 22px; color: var(--blue); }
.steps .st-icon .mi { font-size: 22px; color: var(--text); }
.steps .st-icon .mi.arrive { color: #ea4335; }
.dir-dots .pin .mi { font-size: 18px; color: #ea4335; }
.dir-modes .mode .mi { font-size: 20px; }
.route-card .rc-icon .mi { font-size: 22px; }
.ph-count { display: inline-flex; align-items: center; gap: 6px; }
.ph-count .mi { font-size: 18px; }
.lt .mi { font-size: 18px; color: var(--muted); }
.lb-nav .mi, .lb-close .mi { font-size: 28px; }
#steps-toggle .mi, #back-results .mi { font-size: 20px; }

/* Category colour groups (as in Google Maps) */
:root { --c-food: #e8710a; --c-lodging: #d01884; --c-shop: #1a73e8; --c-health: #d93025; --c-edu: #5f6368;
  --c-nature: #188038; --c-culture: #129eaf; --c-fun: #9334e6; --c-transit: #1967d2; --c-service: #5f6368; --c-place: #5f6368; }
.cat-food { color: var(--c-food); } .cat-lodging { color: var(--c-lodging); } .cat-shop { color: var(--c-shop); } .cat-health { color: var(--c-health); }
.cat-edu { color: var(--c-edu); } .cat-nature { color: var(--c-nature); } .cat-culture { color: var(--c-culture); } .cat-fun { color: var(--c-fun); }
.cat-transit { color: var(--c-transit); } .cat-service { color: var(--c-service); } .cat-place { color: var(--c-place); }
.suggestions .s-icon .mi { font-size: 20px; }
.suggestions .s-icon.muted { background: transparent; filter: none; opacity: 1; color: var(--muted); }
.suggestions .s-icon.saved { color: #f9ab00; }
.suggestions .s-icon.me { color: var(--blue); }
.suggestions .s-action .s-icon { color: var(--blue); }
.r-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); flex: none; }
.r-icon .mi { font-size: 20px; }
.place-hero .mi { font-size: 64px; width: auto; height: auto; overflow: visible; }
.place-hero.g-food { background: linear-gradient(135deg, #fde7d6, #fbd3b4); } .place-hero.g-lodging { background: linear-gradient(135deg, #fbe1ef, #f6c4de); }
.place-hero.g-health { background: linear-gradient(135deg, #fce3e1, #f8c9c5); } .place-hero.g-nature { background: linear-gradient(135deg, #dcf1e2, #bfe5ca); }
.place-hero.g-culture { background: linear-gradient(135deg, #d9f3f6, #b8e8ee); } .place-hero.g-fun { background: linear-gradient(135deg, #efe2fd, #ddc6fb); }
body.dark-ui .place-hero[class*="g-"] { background: linear-gradient(135deg, #2d2e31, #3c4043); }
.wx-icon.mi { font-size: 44px; width: auto; height: auto; overflow: visible; color: #f9ab00; }
.wx-icon.wx-cloud, .wx-icon.wx-foggy { color: #9aa0a6; }
.wx-icon[class*="wx-rain"], .wx-icon.wx-thunderstorm { color: #4285f4; }
.wx-icon.wx-weather_snowy, .wx-icon.wx-ac_unit { color: #8ab4f8; }
.wx-icon.wx-clear_night, .wx-icon.wx-partly_cloudy_night { color: #8a7cd8; }

/* Layers button: fix the preview so it fills the whole tile */
#layer-btn { padding: 0; background: #ddd; }
#layer-thumb { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; background-size: cover; background-position: center; }
#layer-thumb.t-satellite { background-color: #3b4a2f; }
.layer-opt .thumb { background-size: cover; background-position: center; }

/* =========================================================
   Street View
   ========================================================= */
#sv-btn .mi { font-size: 24px; }
#sv-btn.on { background: #fbbc04; color: #202124; }
#sv-btn.loading .mi { animation: pulseIcon 1s ease-in-out infinite; }
@keyframes pulseIcon { 50% { opacity: .35; } }
body.sv-mode #map .maplibregl-canvas { cursor: crosshair; }
#sv-viewer { position: fixed; inset: 0; z-index: 70; background: #111; animation: fadeIn .25s ease; }
#sv-viewer .sv-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
#sv-viewer .sv-img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(1.03); transition: opacity .35s ease, transform .5s var(--ease-out); }
#sv-viewer .sv-img.loaded { opacity: 1; transform: none; }
#sv-viewer .sv-spin { position: absolute; display: none; }
#sv-viewer.loading .sv-spin { display: block; }
#sv-viewer .sv-spin .spinner { width: 36px; height: 36px; border-width: 3px; }
.sv-top { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 6px; padding: 4px 16px 4px 4px; border-radius: 24px; max-width: calc(100vw - 24px); }
.sv-title { min-width: 0; }
.sv-addr { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-date { font-size: 12px; color: var(--muted); }
.sv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; transition: background .15s, transform .2s var(--spring), opacity .2s; }
.sv-nav:hover { background: rgba(0,0,0,.7); transform: translateY(-50%) scale(1.08); }
.sv-nav:active { transform: translateY(-50%) scale(.92); }
.sv-nav.disabled { opacity: 0; pointer-events: none; }
.sv-prev { left: 20px; } .sv-next { right: 20px; }
.sv-nav .mi { font-size: 26px; }
.sv-bottom { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 14px; align-items: center; font-size: 11px; color: #ccc; }
.sv-bottom a { color: #ccc; }
.sv-count { background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 10px; }
/* While Street View is open the map shrinks into a mini-map in the corner (like Google) */
body.sv-open #map { position: fixed; inset: auto auto 16px 16px; width: 280px; height: 180px; z-index: 75; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.5); border: 2px solid #fff; transition: width .3s var(--ease-out), height .3s var(--ease-out); }
body.sv-open #map:hover { width: 360px; height: 240px; }
body.sv-open #search-card, body.sv-open #chips, body.sv-open #panel, body.sv-open #controls, body.sv-open #layers, body.sv-open #embed-open { display: none !important; }
body.sv-open .maplibregl-ctrl-bottom-right, body.sv-open .maplibregl-ctrl-bottom-left { display: none; }
.sv-me { width: 60px; height: 60px; position: relative; pointer-events: none; }
.sv-me .sv-cone { position: absolute; left: 50%; top: 0; width: 0; height: 0; transform: translateX(-50%); border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 30px solid rgba(66,133,244,.45); transform-origin: 50% 100%; rotate: 180deg; }
.sv-me .sv-dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fbbc04; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.sv-card { display: block; position: relative; margin: 12px 24px; width: calc(100% - 48px); height: 150px; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--hover); cursor: pointer; animation: fadeUp .35s var(--ease-out); }
.sv-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s, transform .6s var(--ease-out); }
.sv-card img.loaded { opacity: 1; }
.sv-card:hover img.loaded { transform: scale(1.04); }
.sv-card-label { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; padding: 6px 12px 6px 8px; border-radius: 16px; backdrop-filter: blur(4px); }
.sv-card-label .mi { font-size: 18px; color: #fbbc04; }
.sv-card-label small { opacity: .8; }
@media (max-width: 640px) {
  body.sv-open #map { width: 150px; height: 110px; inset: auto auto 12px 12px; }
  body.sv-open #map:hover { width: 150px; height: 110px; }
  .sv-nav { width: 44px; height: 44px; }
}

/* 360° panoramas */
#pano { position: fixed; inset: 0; z-index: 110; background: #000; animation: fadeIn .25s ease; }
#pano-view, #sv-pano { position: absolute; inset: 0; }
.sv-360 { position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.6); color: #fff; padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 500; }
.sv-360 .mi, .pano-badge .mi, .lb-360 .mi { font-size: 18px; }
.pano-badge { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 12px; padding: 2px 6px; display: grid; place-items: center; }
.lb-360 { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; background: #fff; color: #202124; padding: 10px 18px; border-radius: 22px; font-weight: 500; box-shadow: var(--shadow-lg); transition: transform .2s var(--spring); }
.lb-360:hover { transform: translateX(-50%) scale(1.05); }
.pano-credit { color: #ccc; font-size: 11px; }
.pnlm-load-box { background: rgba(0,0,0,.6) !important; border-radius: 12px !important; }

/* Directions: stops, options, actions */
.dir-fields { align-items: center; }
.dir-row { display: flex; align-items: center; gap: 10px; position: relative; }
.dir-row + .dir-row::before { content: ''; position: absolute; left: 9px; top: -10px; height: 12px; border-left: 2px dotted var(--muted); }
.dir-marker { width: 20px; height: 20px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.dir-marker.from { width: 12px; height: 12px; margin: 0 4px; border-radius: 50%; border: 2px solid var(--muted); }
.dir-marker.stop { border-radius: 50%; background: var(--bg); border: 2px solid var(--text); color: var(--text); width: 18px; height: 18px; }
.dir-marker.to .mi { font-size: 20px; color: #ea4335; }
.dir-row .dir-input-wrap { flex: 1; }
.dir-rm { width: 32px; height: 32px; }
.dir-rm .mi { font-size: 18px; }
.dir-extra { display: flex; gap: 4px; padding: 6px 0 0 26px; flex-wrap: wrap; }
.dir-link { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 16px; }
.dir-link:hover { background: var(--hover); }
.dir-link .mi { font-size: 18px; }
.dir-opts { padding: 4px 0 0 26px; animation: fadeUp .2s var(--ease-out); }
.dir-opts .lt .mi { font-size: 18px; }
.stop-marker { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #202124; color: #202124; font: 700 11px/16px Roboto, sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: grab; animation: dotPop .4s var(--spring) both; }
.dir-actions { display: flex; gap: 8px; padding: 12px 24px 4px; flex-wrap: wrap; }
.dir-actions .btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: var(--bg); }
.dir-actions .btn.primary { background: var(--blue); }
.dir-actions .btn .mi { font-size: 18px; }
.legs { margin: 8px 24px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.leg { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13px; }
.leg + .leg { border-top: 1px solid var(--line); }
.leg-badge { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text); display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.leg-badge .mi { font-size: 16px; color: #ea4335; }
.leg:last-child .leg-badge { border: 0; }
.leg-meta { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dir-elev { margin: 8px 24px; }
.dir-note .mi { font-size: 16px; vertical-align: -3px; }

/* Mobile bottom sheet */
.sheet-handle { display: none; }
@media (max-width: 640px) {
  .sheet-handle { display: grid; place-items: center; position: sticky; top: 0; z-index: 3; height: 22px; background: var(--bg); cursor: grab; touch-action: none; }
  .sheet-handle span { width: 36px; height: 4px; border-radius: 2px; background: #dadce0; }
  #panel { overscroll-behavior: contain; }
  #panel.sheet-full { border-radius: 0; }
}

/* Text for search engines and screen readers only */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
