@import url("/shared/theme.css");
:root { --sheet-height: 0px; }
@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib.maplibregl-compact { background: #1e1f20cc; color: var(--subtle); }
  .maplibregl-ctrl-attrib a { color: var(--subtle); }
  .maplibregl-ctrl-attrib-button { background-color: transparent; filter: invert(0.85); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--map-background); color: var(--text);
  font: 15px/1.4 var(--font); overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
.icon { flex: none; width: 20px; height: 20px; fill: currentColor; }
#map { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.maplibregl-canvas:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

#sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column;
  height: calc(100% - 24px - var(--safe-top)); transform: translateY(calc(100% - 140px)); will-change: transform; touch-action: none;
  background: var(--surface); border-radius: 28px 28px 0 0;
  box-shadow: 0 -1px 3px #3c404326, 0 -4px 14px #3c40431f; padding: 0 16px calc(12px + var(--safe-bottom)); }
#sheet .grab { flex: none; height: 24px; margin: 0 -16px; touch-action: none; cursor: grab; display: flex;
  align-items: center; justify-content: center; }
#sheet .grab::before { content: ""; width: 32px; height: 4px; border-radius: 2px; background: var(--outline); }

.search-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.place-pane { display: none; flex-direction: column; flex: 0 1 auto; margin: 0 -16px; min-height: 0; }
.place-head { flex: none; display: flex; align-items: flex-start; gap: 8px; padding: 0 16px 4px 8px; }
.place-head .titles { flex: 1; min-width: 0; padding-top: 4px; }
.place-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 4px; }
.back { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--muted);
  display: flex; align-items: center; justify-content: center; }
.back:hover { background: var(--hover); }
.back, .links :is(a, button) { position: relative; }
.back::after { content: ""; position: absolute; inset: -4px; }
.links :is(a, button)::after { content: ""; position: absolute; inset: -4px 0; }
.back svg { width: 24px; height: 24px; fill: currentColor; }
body.selecting .search-pane { display: none; }
body.selecting .place-pane { display: flex; }

#searchbar { flex: none; display: flex; align-items: center; gap: 4px; height: 48px; background: var(--surface-low);
  border-radius: 24px; padding: 0 4px 0 16px; }
#searchbar > svg { flex: none; width: 20px; height: 20px; color: var(--subtle); }
#searchbar > .icon { fill: var(--subtle); }
#searchbar > .back { display: none; margin-left: -12px; }
body.listing #searchbar > .back { display: flex; }
body.listing #searchbar > svg { display: none; }
#search { flex: 1; min-width: 0; height: 100%; font: inherit; font-size: 16px; padding: 0 8px; border: 0; background: none;
  outline: none; color: var(--text); }
#searchbar:has(.keyboard-focus) { outline: 2px solid var(--primary); outline-offset: -2px; }
#search::placeholder { color: var(--subtle); }
#search::-webkit-search-cancel-button { display: none; }
#clear { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; color: var(--subtle);
  display: none; align-items: center; justify-content: center; }
#clear:hover { background: var(--surface-high); }
body.has-query #clear { display: flex; }

#chips { flex: none; display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
#chips::-webkit-scrollbar { display: none; }
#chips button { display: flex; align-items: center; gap: 6px; white-space: nowrap; height: 32px; border: 1px solid var(--outline);
  border-radius: 8px; padding: 0 12px; background: var(--surface); font-size: 14px; font-weight: 500; color: var(--muted); }
#chips button .icon { width: 18px; height: 18px; }
#chips button i { width: 9px; height: 9px; border-radius: 50%; }
#chips button:hover { background: var(--hover); }
#chips button.on { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--on-primary-soft); }
body.listing #chips { display: none; }

#results { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 12px -16px 0; border-top: 1px solid var(--line);
  overscroll-behavior: contain; }
.row { display: flex; align-items: center; gap: 16px; padding: 10px 20px; min-height: 56px; cursor: pointer; }
.row:hover { background: var(--hover); }
.row:active { background: var(--surface-high); }
.row i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row small { flex: none; color: var(--subtle); font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#results .empty { padding: 16px 20px; color: var(--subtle); }

.place-pane h2 { margin: 0 0 4px; font-size: 22px; font-weight: 400; line-height: 28px; }
.place-pane .kind { display: flex; align-items: center; gap: 6px; color: var(--subtle); font-size: 14px; }
.place-pane .kind i { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.place-pane .detail { margin-top: 8px; font-size: 14px; color: var(--muted); }
.place-pane .detail:empty { display: none; }
.place-pane .about { margin-top: 12px; font-size: 14px; color: var(--muted); white-space: pre-line; line-height: 1.5; }
.place-pane .about:empty { display: none; }
.links { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.links:empty { display: none; }
.links a, .links button { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--outline); background: var(--surface);
  color: var(--primary); font-weight: 500; font-size: 14px; text-decoration: none; }
.links :is(a, button):hover { background: var(--hover); }
.links :is(a, button):first-child { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.links .icon { width: 18px; height: 18px; }

#side { position: fixed; right: 12px; bottom: calc(var(--sheet-height) + 16px); z-index: 2; display: flex;
  flex-direction: column; align-items: flex-end; gap: 12px; }
.stack { display: flex; flex-direction: column; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.stack button { width: 40px; height: 40px; border: 0; background: none; font-size: 18px; font-weight: 500; color: var(--muted);
  display: flex; align-items: center; justify-content: center; }
.stack button:hover { background: var(--hover); }
.stack button + button { border-top: 1px solid var(--line); }
.stack button[aria-pressed="true"] { background: var(--primary-soft); color: var(--on-primary-soft); }
.stack svg { width: 20px; height: 20px; }
.fab { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; color: var(--muted); }
.fab:hover { background: var(--hover); }
.fab .icon { width: 24px; height: 24px; }
#pill { position: fixed; left: 50%; bottom: calc(var(--sheet-height) + 16px); transform: translateX(-50%); z-index: 1;
  background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 500; padding: 6px 14px;
  border-radius: 999px; pointer-events: none; white-space: nowrap; }
#side, #pill { transition: opacity .15s, visibility .15s; }
body.sheet-high #side, body.sheet-high #pill, body.selecting #pill { visibility: hidden; opacity: 0; }

#credit { position: fixed; left: 10px; top: calc(6px + var(--safe-top)); z-index: 1; font-size: 10px; color: var(--subtle);
  text-decoration: none; }

#toast { position: fixed; left: 50%; bottom: calc(var(--sheet-height) + 24px); z-index: 4; transform: translate(-50%, 8px);
  background: var(--toast); color: var(--on-toast); font-size: 14px; padding: 12px 16px; border-radius: 4px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.badge { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--hue-fill, var(--surface-high)); color: var(--hue-text, var(--muted)); font-style: normal; font-weight: 600; font-size: 14px; }
.badge .icon { width: 20px; height: 20px; }
.badge img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.badge.mark { color: #ffffff; }
.row i.dot, .place-pane .kind i { background: var(--hue-text, var(--subtle)); }
a.row { color: inherit; text-decoration: none; }
button.row { width: 100%; border: 0; background: none; text-align: left; }
.row .lines { flex: 1; min-width: 0; }
.row .lines b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .lines small { display: block; color: var(--subtle); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.departure { cursor: default; }
.row.departure .lines :is(b, small) { white-space: normal; overflow-wrap: anywhere; }
.row.departure:hover { background: none; }
.row .eta { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.heading { padding: 16px 20px 4px; color: var(--subtle); font-size: 13px; font-weight: 500; }
#menu { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 8px -16px 0; overscroll-behavior: contain; }
#menu .venue-info { margin-top: 8px; padding: 16px 20px 8px; border-top: 1px solid var(--line); }
#menu .venue-info h2 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
#menu .venue-info .when { color: var(--subtle); font-size: 14px; }
#menu .venue-info .hours { margin-top: 8px; color: var(--muted); font-size: 14px; }
#menu .venue-info h3 { margin: 20px 0 0; color: var(--subtle); font-size: 13px; font-weight: 500; }
#menu .venue-info h3 + .links { margin-top: 8px; }
#menu .venue-info .note { margin: 16px 0 0; color: var(--subtle); font-size: 13px; }
.links.plain :is(a, button):first-child { background: var(--surface); border-color: var(--outline); color: var(--primary); }
.list-head { display: none; flex: none; align-items: center; gap: 4px; height: 48px; margin: 0 -8px; }
.list-head h2 { margin: 0; font-size: 20px; font-weight: 400; }
body.listing #menu, body:not(.listing) #results { display: none; }
body.listing:not([data-list="search"]) #searchbar { display: none; }
body.listing:not([data-list="search"]) .list-head { display: flex; }
#results .source { padding: 16px 20px 20px; color: var(--subtle); font-size: 13px; }
#results .source a { color: var(--primary); }
.place-head .photo { flex: none; width: 48px; height: 48px; margin-top: 2px; border-radius: 50%; object-fit: cover; background: var(--surface-high); }
.place-head .photo[hidden] { display: none; }
.place-pane .rows { margin: 12px -20px 0; border-top: 1px solid var(--line); }
.place-pane .rows .heading { padding-top: 12px; }
.place-pane .rows:empty { display: none; }
.place-pane .rows :is(.empty, .source) { padding: 12px 20px; color: var(--subtle); font-size: 13px; }
.place-pane .rows .source a { color: var(--primary); }
.place-pane :is(.detail, .about) { overflow-wrap: anywhere; }
.report-line { padding: 16px 20px 20px; color: var(--subtle); font-size: 13px; }
.place-body > .report-line { padding: 16px 0 8px; }
.report-line button { position: relative; border: 0; padding: 0; background: none; color: var(--primary); font-size: inherit; font-weight: 500; }
.report-line button::after { content: ""; position: absolute; inset: -14px -8px; }
.report { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.report textarea { width: 100%; resize: vertical; border: 1px solid var(--outline); border-radius: 12px; padding: 12px;
  background: var(--surface); color: var(--text); font: inherit; }
.report textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.report .note { color: var(--subtle); font-size: 13px; }
.report .links { margin-top: 0; }
.report button:disabled { opacity: .6; }
.report .links { align-items: center; }
.report-error { color: var(--error); font-size: 14px; font-weight: 500; }
.share-map { display: flex; flex-direction: column; align-items: center; padding: 24px 20px 16px; }
.share-map .qr { width: min(240px, 60vw); aspect-ratio: 1; padding: 12px; border-radius: 12px; background: #ffffff; fill: #000000; }
.share-map .url { margin-top: 12px; color: var(--muted); font-size: 14px; }
.share-map .links { justify-content: center; }
#compass .icon { transition: transform .1s; }
.fab[hidden], .stack[hidden] { display: none; }
#map-status, #page-not-loaded { position: fixed; left: 0; right: 0; top: var(--safe-top); bottom: var(--sheet-height); z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; color: var(--subtle); font-weight: 500; }
#map-status[hidden], #map-status button[hidden], #page-not-loaded[hidden] { display: none; }
:is(#map-status, #page-not-loaded) button { pointer-events: auto; }
body.sheet-high #map-status { visibility: hidden; }
#locate.on { color: var(--primary); }
.maplibregl-ctrl-bottom-right { display: none; }
body.sheet-high .maplibregl-ctrl-top-right { visibility: hidden; }
.maplibregl-ctrl-top-right { top: var(--safe-top); }

@media (pointer: coarse) { #zoom { display: none; } }

@media (min-width: 720px) {
  #sheet { left: 12px; right: auto; top: 12px; bottom: auto; width: 400px; height: auto; max-height: calc(100% - 24px); transform: none;
    border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); }
  #sheet .grab { display: none; }
  body.listing #sheet { height: calc(100% - 24px); }
  body:not(.listing) #results { display: none; }
  #side, #pill { bottom: 24px; }
  body:has(#sheet) :is(#map-status, #page-not-loaded) { left: 424px; }
  #pill { left: calc(50% + 206px); }
  #credit { left: auto; right: 10px; top: auto; bottom: 4px; }
  .maplibregl-ctrl-top-right { top: auto; bottom: 0; }
  .maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 0 10px 10px 0; }
}
.row[data-floor][aria-current="true"] { background: var(--primary-soft); color: var(--on-primary-soft); }
.row[data-floor][aria-current="true"] .badge { background: var(--primary); color: var(--on-primary); }
