.site-search-open {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.site-search-open[hidden] { display: none !important; }
.utility .site-search-open { margin-inline-start: auto; }
.site-search-open:hover, .search-close:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
#site-search {
  width: min(35rem, calc(100% - 24px));
  max-height: 80dvh;
  margin: clamp(16px, 12svh, 120px) auto 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface, var(--field));
  color: var(--ink);
  box-shadow: 0 16px 70px #0004;
}
#site-search[open] { display: flex; flex-direction: column; }
#site-search:modal, #site-search::backdrop { overscroll-behavior: contain; }
#site-search::backdrop { background: rgb(9 10 9 / 62%); overflow: hidden; }
.search-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px 22px; }
.search-heading h2 { margin: 0; font: 550 22px/1.2 Inter, system-ui, sans-serif; letter-spacing: -.04em; }
.search-heading form { margin: 0; }
.search-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); }
.search-field { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; margin: 0 20px; color: var(--muted); background: var(--bg, var(--paper)); }
.search-field:focus-within { border-color: var(--muted); }
.search-field input { outline: none; box-shadow: none; background: none; color: var(--ink); border: 0; padding: 12px 0; min-width: 0; width: 100%; font: 400 16px/1.4 Inter, system-ui, sans-serif; }
.search-caption { margin: 0; padding: 18px 22px 8px; color: var(--muted); font: 12px/1.45 Inter, "Segoe UI", system-ui, sans-serif; }
.search-hits { list-style: none; margin: 0; padding: 0 10px 10px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.search-hits a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 12px; min-height: 44px; color: var(--ink); border-radius: 6px; text-decoration: none; }
.search-hits a:hover, .search-hits a:focus-visible { background: var(--bg, var(--paper)); outline-offset: -2px; }
.search-hits a span { font: 500 14px/1.45 Inter, system-ui, sans-serif; }
.search-hits small { color: var(--muted); white-space: nowrap; font: 11px/1.4 Inter, "Segoe UI", system-ui, sans-serif; }
.sample[id]:target { scroll-margin-block-start: 20px; }
@media (min-width: 721px) and (max-width: 880px) {
  .bar { gap: 10px; }
  .bar #nav { gap: 11px; }
}
@media (max-width: 560px) {
  #site-search { margin-top: max(12px, env(safe-area-inset-top)); max-height: calc(100dvh - 28px); }
  .search-hits small { white-space: normal; text-align: end; }
}
