/* Catalog search: public controls only. Retrieval and the index stay on Lambda. */
.catalog-page-search { display: flex; align-items: center; width: min(640px,100%); margin-top: 32px; border: 1px solid #b6bfb8; border-radius: 4px; background: #fff; }
.catalog-page-search input { width: 100%; min-width: 0; border: 0; border-radius: 0; background: transparent; color: #202829; padding: 16px 20px; font: inherit; font-size: 16px; outline: none; }
.catalog-page-search input::placeholder { color: #66706c; }
.catalog-page-search button { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 88px; min-height: 56px; align-self: stretch; border: 0; border-left: 1px solid #d9ddda; border-radius: 0 3px 3px 0; background: transparent; color: #202829; font: inherit; font-size: 14px; cursor: pointer; }
.catalog-page-search svg,.catalog-query svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.catalog-page-search:focus-within,.catalog-query:focus-within { border-color: #28613b; box-shadow: 0 0 0 1px #28613b; }
.catalog-page-search button:hover,.catalog-query button:hover { background: #edf2eb; }
.catalog-page-search button:focus-visible,.catalog-query button:focus-visible { outline: 2px solid #28613b; outline-offset: -5px; }
.catalog-open { overflow: hidden; }
.catalog-dialog { width: min(1480px,calc(100% - 48px)); max-width: none; height: calc(100dvh - 48px); max-height: none; padding: 0; margin: auto; border: 0; background: #fff; color: #202829; }
.catalog-dialog[open] { display: flex; flex-direction: column; }
.catalog-dialog::backdrop { background: #10201999; }
.catalog-dialog button,.catalog-dialog input { font: inherit; }
.catalog-dialog button { cursor: pointer; }
.catalog-top { display: flex; align-items: center; gap: 32px; padding: 20px 24px; border-bottom: 1px solid #d9ddda; flex-shrink: 0; }
.catalog-top h2 { font-size: 18px; font-weight: 400; letter-spacing: -.025em; flex-shrink: 0; }
.catalog-query { display: flex; width: min(540px,100%); margin: 0 auto; border: 1px solid #b6bfb8; border-radius: 4px; }
.catalog-query input { border: 0; border-radius: 0; min-width: 0; width: 100%; padding: 12px 16px; outline: none; background: transparent; color: #202829; font-size: 15px; }
.catalog-query button { min-width: 44px; min-height: 44px; background: transparent; color: #202829; border: 0; border-left: 1px solid #d9ddda; border-radius: 0 3px 3px 0; display: grid; place-items: center; }
.catalog-close { border: 0; background: #fff; min-width: 44px; height: 44px; font-size: 30px !important; font-weight: 300; line-height: 1; color: #202829; }
.catalog-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(280px,36%) minmax(0,1fr); }
.catalog-results { overflow: auto; padding: 24px; border-right: 1px solid #d9ddda; }
.catalog-status { font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.catalog-list { list-style: none; margin: 0; padding: 0; }
.catalog-list li { border-top: 1px solid #d9ddda; }
.catalog-result { display: block; text-align: left; width: 100%; padding: 24px 12px; border: 0; background: #fff; color: #202829; transition: background .15s; }
.catalog-result:hover { background: #f5f6f4; }
.catalog-result[aria-pressed=true] { background: #edf2eb; box-shadow: inset 2px 0 #28613b; }
.catalog-result-kind { display: block; color: #535d59; font-size: 11px; margin-bottom: 12px; }
.catalog-result-title { display: block; font-size: 19px; font-weight: 400; line-height: 1.45; letter-spacing: -.025em; }
.catalog-result-excerpt { display: block; color: #535d59; font-size: 12px; line-height: 1.75; margin-top: 16px; overflow-wrap: anywhere; }
.catalog-result-source { display: block; color: #535d59; font-size: 11px; margin-top: 16px; }
.catalog-preview { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #f3f4f1; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 24px; background: #fff; border-bottom: 1px solid #d9ddda; }
.catalog-preview-title { font-size: 16px; font-weight: 400; line-height: 1.5; }
.catalog-preview-links { display: flex; flex-wrap: wrap; gap: 16px; flex-shrink: 0; }
.catalog-preview-links a { font-size: 12px; color: #202829; text-decoration: underline; text-underline-offset: 4px; min-height: 32px; display: inline-flex; align-items: center; }
.catalog-preview-links a[hidden] { display: none; }
.catalog-pager { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 4px 16px; font-size: 12px; border-bottom: 1px solid #d9ddda; background: #fff; }
.catalog-pager button { min-width: 44px; height: 36px; border: 0; background: transparent; font-size: 18px; color: #202829; }
.catalog-pager button:disabled { color: #8b9490; cursor: default; }
.catalog-preview-status { font-size: 13px; text-align: center; padding: 16px; }
.catalog-preview-status:empty { display: none; }
.catalog-paper-scroll { flex: 1; min-height: 0; overflow: auto; padding: 16px 0; }
.catalog-paper { position: relative; margin: 0 auto; background: #fff; }
.catalog-paper canvas { display: block; max-width: none; }
.catalog-highlights { position: absolute; inset: 0; pointer-events: none; }
.catalog-hit { position: absolute; background: #ffe04d77; outline: 1px solid #ba8f28; mix-blend-mode: multiply; }
.catalog-evidence { padding: 16px 24px; background: #fff; border-top: 1px solid #d9ddda; max-height: 180px; overflow: auto; flex-shrink: 0; }
.catalog-evidence:empty { display: none; }
.catalog-evidence h4 { font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.catalog-passage { display: block; text-align: left; padding: 5px 0; width: 100%; border: 0; background: none; color: #535d59; font-size: 12px !important; line-height: 1.65; overflow-wrap: anywhere; }
.catalog-passage:hover { color: #202829; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1180px) {
  .catalog-dialog { width: calc(100% - 24px); height: calc(100dvh - 24px); }
}
@media (max-width: 760px) {
  .catalog-dialog { width: 100%; height: 100dvh; }
  .catalog-top { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .catalog-top h2 { flex: 1; font-size: 16px; }
  .catalog-query { order: 3; width: 100%; }
  .catalog-query input { font-size: 16px; }
  .catalog-body { grid-template-columns: 1fr; grid-template-rows: minmax(130px,28%) minmax(420px,1fr); overflow: auto; }
  .catalog-results { padding: 12px 16px; border-right: 0; border-bottom: 1px solid #d9ddda; }
  .catalog-status { margin-bottom: 12px; }
  .catalog-result { padding: 16px 12px; }
  .catalog-result-title { font-size: 17px; }
  .catalog-result-excerpt { display: none; }
  .catalog-result-source { margin-top: 8px; }
  .catalog-result-kind { margin-bottom: 8px; }
  .catalog-toolbar { padding: 10px 16px; flex-wrap: wrap; gap: 4px 16px; }
  .catalog-preview-title { font-size: 14px; }
  .catalog-evidence { max-height: 110px; padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .catalog-result { transition: none; } }
