/* g1-v48 round s (11-14, his #194144146): search design C. Top-bar trigger, overlay, results page, story/detail pages. ds-v02 tokens, no colour. Prefix sr-. */

/* ---------- top-bar trigger: icon on phone, box from 768 px; the bar height and robot are untouched ---------- */
.hdr .sr-btn { flex: 0 0 var(--tap); display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; border-radius: var(--r-pill); }
.hdr .sr-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.hdr .sr-bt, .hdr .sr-bk { display: none; }
.hdr .sr-btn:hover { background: var(--state-hover); }
@media (max-width: 599px) {
  /* 390: the bar has no room for a 5th 44 px target beside the robot, so the icon takes the theme button's slot (Light / Dark / Newspaper stay in the menu) */
  .hdr .v35-theme { display: none; }
  .hdr .sr-btn { margin-left: 0; }
}
@media (min-width: 600px) { .hdr .sr-btn { margin-left: 8px; } }
@media (min-width: 768px) {
  .hdr .sr-btn { display: flex; align-items: center; gap: 8px; flex: 0 1 280px; width: 280px; min-width: 0; height: var(--tap); padding: 0 14px; background: var(--surface); border: var(--b-hair); border-radius: var(--r-md); color: var(--ink-2); text-align: left; }
  .hdr .sr-bt { display: inline; flex: 1; font-size: var(--t-label-size); }
  .hdr .sr-bk { display: inline-block; font: var(--t-caption-size)/1 var(--font-ui); color: var(--ink-3); border: var(--b-hair); border-radius: var(--r-sm); padding: 3px 7px; background: var(--paper); }
}
@media (min-width: 1024px) {
  .hdr .sr-btn { margin-left: auto; }
  .hdr .v35-theme { margin-left: 8px; }
}
/* on the results page the page has its own field, so the bar box shrinks to an icon (one field on screen) */
body.sr-on .hdr .sr-btn { width: var(--tap); flex: 0 0 var(--tap); padding: 0; border: 0; background: none; justify-content: center; }
body.sr-on .hdr .sr-bt, body.sr-on .hdr .sr-bk { display: none; }

/* ---------- shared bits ---------- */
body.sr-lock { overflow: hidden; }
.sr-field { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 14px; background: var(--surface); border: var(--b-hair); border-radius: var(--r-md); flex: 1; min-width: 0; color: var(--ink-2); }
.sr-field:focus-within { border-color: var(--ink); background: var(--paper); }
.sr-field svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.sr-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-size: 18px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.sr-field input::-webkit-search-cancel-button { display: none; }
.sr-field input::placeholder { color: var(--ink-3); }
.sr-clr { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-pill); color: var(--ink-2); cursor: pointer; flex: none; }
.sr-clr:hover { background: var(--state-hover); }
.sr-clr svg { width: 20px; height: 20px; }
.sr-chip { flex: none; min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: var(--r-pill); border: var(--b-control); background: var(--paper); color: var(--ink); font: var(--w-semibold) var(--t-label-size)/1 var(--font-ui); white-space: nowrap; cursor: pointer; }
.sr-chip small { color: var(--ink-3); font-size: var(--t-caption-size); font-weight: var(--w-regular); }
.sr-chip[aria-pressed=true] { background: var(--inverse-bg); color: var(--inverse-ink); border-color: var(--inverse-bg); }
.sr-chip[aria-pressed=true] small { color: inherit; opacity: .8; }
.sr-chip.zero { opacity: var(--state-disabled-opacity); }
.sr-th { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; background: var(--surface); flex: none; display: block; overflow: hidden; }
.sr-th svg.tl { width: 100%; height: 100%; display: block; }
.tl rect { fill: var(--surface); stroke: var(--line); }
.tl g, .tl path { stroke: var(--ink-2); fill: none; stroke-width: 1.6; }
.tl text { fill: var(--ink-3); font: 600 9px var(--font-ui); text-anchor: middle; stroke: none; }
.sr-row { display: flex; gap: 12px; align-items: center; min-height: var(--tap); padding: 10px 12px; border-radius: var(--r-md); margin: 0 -12px; color: var(--ink); text-decoration: none; }
.sr-row:hover, .sr-row:focus-visible { background: var(--state-hover); }
.sr-tx { display: block; min-width: 0; flex: 1; }
.sr-ti { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: var(--w-semibold) var(--t-label-size)/var(--t-label-lh) var(--font-ui); }
.sr-mt { display: block; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-ds { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--ink-2); margin-top: 2px; }
.sr-ty { display: inline-block; font-weight: var(--w-semibold); color: var(--ink); border: var(--b-hair); border-radius: var(--r-pill); padding: 0 7px; margin-right: 6px; font-size: 12px; line-height: 17px; }
.sr-ls { list-style: none; margin: 0; padding: 0; }
.sr-grp { margin-top: var(--s-3); }
.sr-gh { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); margin: 0; font: var(--w-semibold) var(--t-caption-size)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.sr-gh button { text-transform: none; letter-spacing: 0; font: var(--w-semibold) var(--t-label-size)/1 var(--font-ui); color: var(--ink); min-height: var(--tap); padding: 0 4px; border: 0; background: none; cursor: pointer; }
.sr-gh button:hover { text-decoration: underline; }
.sr-more { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--tap); border: var(--b-control); border-radius: var(--r-pill); margin-top: var(--s-3); font: var(--w-semibold) var(--t-label-size)/1 var(--font-ui); background: var(--paper); color: var(--ink); cursor: pointer; }
.sr-more:hover { background: var(--state-hover); }
.sr-stat { margin: 0; padding: 4px 0 2px; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--ink-2); }
.sr-stat b { color: var(--ink); }
.sr-es h3 { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); margin: var(--s-2) 0 0; font: var(--w-semibold) var(--t-caption-size)/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.sr-es h3 button { text-transform: none; letter-spacing: 0; font-size: var(--t-label-size); color: var(--ink-2); min-height: var(--tap); padding: 0 4px; border: 0; background: none; cursor: pointer; }
.sr-rec { display: flex; align-items: center; border-radius: var(--r-md); }
.sr-rec:hover { background: var(--state-hover); }
.sr-rec .q { flex: 1; display: flex; align-items: center; gap: 12px; min-height: var(--tap); text-align: left; padding: 0 4px; min-width: 0; border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; }
.sr-rec .q span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-rec .q svg { width: 20px; height: 20px; color: var(--ink-3); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sr-rec .x { width: var(--tap); height: var(--tap); display: grid; place-items: center; color: var(--ink-3); border: 0; background: none; cursor: pointer; }
.sr-rec .x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sr-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-empty { padding: var(--s-4) 0; }
.sr-empty h3 { margin: 0 0 6px; font: var(--t-headline-w) var(--t-headline-size)/var(--t-headline-lh) var(--font-display); }
.sr-empty p { margin: 0; color: var(--ink-2); }
mark { background: none; color: inherit; font-weight: var(--w-semibold); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sr-ans { margin-top: var(--s-2); border: var(--b-hair); border-radius: var(--r-md); padding: 16px; background: var(--paper); }
.sr-ans .al { font: var(--w-semibold) 12px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.sr-ans p { margin: 0; font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.sr-ans .src2 { min-height: var(--tap); display: inline-flex; align-items: center; font-size: var(--t-caption-size); color: var(--ink-2); margin-top: 4px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; border: 0; background: none; cursor: pointer; padding: 0; }
.sr-ans .cite { list-style: none; margin: 4px 0 0; padding: 0; }
.sr-ans .cite a { display: flex; align-items: center; padding: 10px 0; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); border-top: var(--b-hair); min-height: var(--tap); color: var(--ink); text-decoration: none; }
.sr-ans .alts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: var(--t-caption-size); color: var(--ink-3); }
.sr-ans .alt { min-height: var(--tap); padding: 0 14px; border: var(--b-control); border-radius: var(--r-pill); font: var(--t-label-size) var(--font-ui); color: var(--ink); background: var(--paper); cursor: pointer; }

/* ---------- overlay: full-screen sheet on phone, centred panel on desktop ---------- */
.sr-ov { position: fixed; inset: 0; z-index: 90; }
.sr-back { position: absolute; inset: 0; background: var(--scrim); }
.sr-panel { position: absolute; inset: 0; background: var(--raised); color: var(--ink); display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-top: var(--safe-t, 0px); }
.sr-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 12px; flex: none; }
.sr-cancel { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 10px; font: var(--w-semibold) var(--t-label-size)/1 var(--font-ui); border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.sr-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 10px; scrollbar-width: none; flex: none; }
.sr-chips::-webkit-scrollbar { display: none; }
.sr-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 24px; }
.sr-foot { display: none; }
.sr-foot.on { display: flex; align-items: center; justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: var(--b-hair); flex: none; }
.sr-foot .hint { display: none; }
.sr-foot .all { width: 100%; min-height: var(--tap); padding: 0 14px; font: var(--w-semibold) var(--t-label-size)/1 var(--font-ui); color: var(--ink); border-radius: var(--r-pill); border: var(--b-control); background: var(--paper); cursor: pointer; }
.sr-foot .all:hover { background: var(--state-hover); }
.sr-foot kbd { font: inherit; border: var(--b-hair); border-radius: var(--r-sm); padding: 1px 6px; background: var(--paper); margin: 0 2px; }
@media (min-width: 768px) {
  .sr-panel { inset: auto; left: 50%; top: 9vh; transform: translateX(-50%); width: min(680px, calc(100vw - 48px)); height: auto; max-height: 78vh; border-radius: var(--r-md); box-shadow: 0 8px 40px rgba(0,0,0,.28); border: var(--b-hair); overflow: hidden; padding-top: 0; }
  .sr-head { padding: 12px 12px 8px 16px; }
  .sr-chips { padding: 2px 16px 10px; }
  .sr-foot.on { justify-content: space-between; background: var(--paper-deep); font-size: var(--t-caption-size); color: var(--ink-3); padding: 10px 16px; }
  .sr-foot .hint { display: inline; }
  .sr-foot .all { width: auto; }
}
.sr-ov .sr-th { width: 56px; height: 56px; }
@keyframes srFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes srUp { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes srPop { from { opacity: 0; transform: translateX(-50%) scale(.97); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
.sr-ov:not([hidden]) .sr-back { animation: srFade .18s ease-out; }
.sr-ov:not([hidden]) .sr-panel { animation: srUp .18s ease-out; }
@media (min-width: 768px) { .sr-ov:not([hidden]) .sr-panel { animation: srPop .18s cubic-bezier(.2,.8,.2,1); } }
.sr-page { animation: srFade .2s ease-out; }
@media (prefers-reduced-motion: reduce) { .sr-ov *, .sr-page, .sr-ov { animation: none !important; transition: none !important; } }

/* ---------- results page: type filter = chip row on phone, quiet column on the right from 1000 px ---------- */
.sr-page { min-width: 0; }
.sr-pf { display: flex; align-items: center; margin: 0 0 var(--s-2); }
.sr-types { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; }
.sr-types::-webkit-scrollbar { display: none; }
.sr-filt { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; color: var(--ink-2); font-size: var(--t-label-size); }
.sr-filt[hidden] { display: none; }
.sr-filt b { color: var(--ink); font-weight: var(--w-semibold); }
.sr-filt button { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border: 0; background: none; cursor: pointer; font-size: 22px; color: var(--ink-2); }
@media (min-width: 768px) { .sr-types { margin: 0 calc(var(--gutter-wide) * -1); padding-inline: var(--gutter-wide); } }
@media (min-width: 1000px) {
  .sr-page { display: grid; grid-template-columns: minmax(0, 1fr) 172px; column-gap: 40px; align-items: start; }
  .sr-page > * { grid-column: 1; }
  .sr-page > .sr-types { grid-column: 2; grid-row: 1 / span 6; position: sticky; top: 12px; flex-direction: column; overflow: visible; margin: 0; padding: 12px 0 0; gap: 2px; }
  .sr-types .sr-chip { justify-content: space-between; width: 100%; border-color: transparent; border-radius: var(--r-md); }
  .sr-types .sr-chip[aria-pressed=true] { border-color: var(--inverse-bg); }
}

/* ---------- story / detail pages opened from a result ---------- */
.sr-badge { display: inline-block; font: var(--w-semibold) 12px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; border: var(--b-control); border-radius: var(--r-pill); padding: 6px 10px; margin-bottom: var(--s-2); }
.sr-doc .kn { border: var(--b-hair); border-radius: var(--r-md); padding: 12px 16px; margin: var(--s-3) 0; display: flex; gap: 12px; align-items: baseline; }
.sr-doc .kn b { font-size: var(--t-headline-size); font-weight: var(--w-heavy); }
.sr-doc .kn span { color: var(--ink-2); }
.sr-doc ul { padding-left: 22px; margin: var(--s-3) 0; }
.sr-doc li { margin: 6px 0; }
.sr-doc h3 { margin: var(--s-4) 0 var(--s-2); font: var(--t-headline-w) var(--t-headline-size)/var(--t-headline-lh) var(--font-display); }
.sr-doc p { margin: var(--s-3) 0; }
.sr-doc .pic { width: 100%; aspect-ratio: var(--ar-card); max-height: 40dvh; object-fit: cover; border-radius: var(--r-md); margin: var(--s-3) 0; display: block; background: var(--surface); }
.sr-skel { height: 14px; background: var(--surface); border-radius: var(--r-sm); margin: 0 0 12px; }
.sr-field input:focus, .sr-field input:focus-visible { outline: none; box-shadow: none; }

/* floating search trigger (shown after the top bar scrolls away) */
.sr-fab { position: fixed; right: 14px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 28; width: var(--tap); height: var(--tap); display: grid; place-items: center; padding: 0; border: var(--b-control); border-radius: var(--r-pill); background: var(--paper); color: var(--ink); box-shadow: var(--sh-2); cursor: pointer; }
.sr-fab[hidden] { display: none; }
.sr-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
body.has-player .sr-fab { bottom: calc(var(--tabbar-h) + var(--player-bar-h) + var(--safe-b) + 14px); }
@media (min-width: 768px) { .sr-fab { bottom: 20px; right: 20px; } body.has-player .sr-fab { bottom: calc(var(--player-bar-h) + 20px); } }

/* 1117search (his #194144306): the wide top-bar search matches the chips: pill shape and a clear outline */
@media (min-width: 768px) { .hdr .sr-btn { border-radius: 999px; border: 1px solid var(--line-strong); } }
