/* Top bar search (#1477), lifted from mockups/1477-search.html: the top bar button, and the box
   components/modal.html draws as modal_id="search" (modal_class="pl-search",
   modal_backdrop_class="pl-search-backdrop", headless). static/js/search.js fills the body. */
.pl-search-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem; background: none; border: 1px solid var(--hub-border); color: var(--hub-text-muted); cursor: pointer; padding: 0.35rem 0.6rem 0.35rem 0.5rem; border-radius: 8px; font: inherit; font-size: 0.8125rem; }
.pl-search-btn:hover { color: var(--hub-text); border-color: var(--hub-border-strong); }
.pl-search-btn__keys { font-size: 0.6875rem; padding: 0.05rem 0.35rem; border: 1px solid var(--hub-border-strong); border-radius: 4px; }

.pl-search-backdrop { align-items: flex-start; padding-top: 12vh; }
.pl-search { width: min(640px, calc(100vw - 2rem)); background: var(--hub-card-bg); border: 1px solid var(--hub-card-border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.45); overflow: hidden; }
.pl-search__field { display: flex; align-items: center; gap: 0.75rem; padding: 0.95rem 1.1rem; border-bottom: 1px solid var(--hub-border); }
.pl-search__field svg { color: var(--hub-text-muted); flex: none; }
.pl-search__input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--hub-text); font: inherit; font-size: 1.125rem; }
.pl-search__esc { font-size: 0.6875rem; color: var(--hub-text-muted); padding: 0.1rem 0.4rem; border: 1px solid var(--hub-border-strong); border-radius: 4px; background: none; cursor: pointer; }
.pl-search__list { list-style: none; margin: 0; padding: 0.5rem; max-height: min(60vh, 460px); overflow-y: auto; }
.pl-search__item { display: block; padding: 0.7rem 0.8rem; border-radius: 10px; color: var(--hub-text); text-decoration: none; }
.pl-search__item + .pl-search__item { margin-top: 0.15rem; }
.pl-search__item:hover, .pl-search__item[aria-selected="true"] { background: var(--hub-blue-soft); }
.pl-search__title { font-weight: 600; font-size: 0.9375rem; }
.pl-search__title mark { background: none; color: var(--hub-link); font-weight: 700; }
.pl-search__where { margin-top: 0.15rem; font-size: 0.75rem; color: var(--hub-text-muted); }
.pl-search__what { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--hub-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-search__because { margin-top: 0.3rem; font-size: 0.6875rem; color: var(--hub-text-muted); }
.pl-search__because b { color: var(--hub-text); font-weight: 600; }
.pl-search__empty { padding: 2rem 1.25rem; text-align: center; color: var(--hub-text-muted); }
.pl-search__empty p { margin: 0 0 0.75rem; }
.pl-search__foot { display: flex; gap: 1rem; padding: 0.6rem 1.1rem; border-top: 1px solid var(--hub-border); font-size: 0.6875rem; color: var(--hub-text-muted); }

@media (max-width: 640px) {
  .pl-search-btn { border: none; padding: 0.4rem; }
  /* Clipped, not removed: the button keeps "Search" as its name on a phone (#1477). */
  .pl-search-btn__label, .pl-search-btn__keys { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .pl-search-backdrop { padding-top: 0; }
  .pl-search { width: 100vw; border-radius: 0 0 14px 14px; border-top: none; }
  .pl-search__foot { display: none; }
  .pl-search__list { max-height: calc(100vh - 140px); }
}

/* Seat the design in components/modal.html: the box sizes itself, the body is the design. */
.pl-modal.pl-search { max-width: none; max-height: none; }
.pl-search .pl-modal__body { padding: 0; }
.pl-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.pl-search__empty .pl-btn { margin-top: 0.25rem; }
@media (max-width: 640px) {
  .pl-search-backdrop { padding: 0; }
}
