#poi-open, #poi-detail {
  position: fixed;
  left: calc(var(--ui-gap) + var(--safe-left));
  bottom: calc(var(--ui-gap) + var(--safe-bottom));
}
#poi-detail {
  bottom: calc(var(--ui-gap) + var(--safe-bottom) + 56px);
  width: min(340px, calc(100% - 2 * var(--ui-gap) - var(--safe-left) - var(--safe-right)));
  max-height: 48dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 12px 16px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--edge), 0 8px 24px rgb(0 0 0 / 16%);
}
#poi-detail .dialog-heading { align-items: start; margin: 0; gap: 8px; }
#poi-name { margin: 4px 0; font-size: 20px; overflow-wrap: anywhere; }
#poi-dismiss { margin: -6px -10px 0 0; }
#poi-detail p { margin: 2px 0 6px; color: var(--muted); font-size: 14px; }
#poi-detail a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); font-size: 14px; font-weight: 600; text-underline-offset: 3px; }
#poi-dialog[open] { display: flex; flex-direction: column; }
#poi-dialog {
  --poi-offset: clamp(12px, 12dvh, 96px);
  margin-block-start: var(--poi-offset);
  max-height: min(540px, calc(var(--poi-viewport, 100dvh) - var(--poi-offset) - 16px - var(--safe-top) - var(--safe-bottom)));
}
#poi-query { flex: none; }
#poi-status { margin: 12px 0 0; font-size: 13px; }
#poi-source-note { margin-top: 2px; color: var(--muted); font-size: 12px; }
#poi-results {
  min-height: 0;
  margin: 8px -8px 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
#poi-results:empty { display: none; }
#poi-results li + li { border-top: 1px solid #d8dccf; }
.poi-result {
  display: grid;
  width: 100%;
  gap: 3px;
  min-height: 48px;
  padding: 10px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  line-height: 1.3;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: pan-y;
}
.poi-result strong { font-size: 15px; font-weight: 650; }
.poi-result small { color: var(--muted); font-size: 13px; }
.poi-result:focus-visible { outline: 2px solid var(--line); outline-offset: -2px; background: var(--accent); }
@media (hover: hover) {
  .poi-result:hover { background: var(--accent); }
}
@media (max-width: 650px) {
  #poi-dialog { --poi-offset: 12px; }
}
@media (max-width: 380px) {
  #poi-open { padding-inline: 10px; }
  #poi-open svg { display: none; }
}
