/* nustreads: search screens (header search + type-ahead, home, results page, old taste-run results).
   Loads after app.css (tokens + shared components). SPEC sections 3, 4, 10, 14. */

/* ---------- search box, shared ---------- */
.sx { position: relative; margin: 0; }
.sx-in { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--ink); outline: 0; }
.sx-in::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sx-in::placeholder { color: var(--subdued); opacity: 1; }
.sx-go { flex: none; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; }
.sx-go svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#form[hidden] { display: none !important; }
.sx-go span { white-space: nowrap; }

/* header: one 360 px box, magnifier inside the right end (SPEC 3), small-radius rectangle */
.sx-head { width: 100%; max-width: 360px; }
.sx-head .sx-field { display: flex; align-items: center; height: 32px; background: #fff; border: 1px solid var(--line-input); border-radius: var(--r-ctl, 4px); }
.sx-head .sx-field:focus-within { border-color: var(--line-field); box-shadow: var(--sh-input-focus); }
.sx-head .sx-in { height: 30px; padding: 0 4px 0 8px; font: 400 14px/30px var(--font-sans); }
.sx-head .sx-go { width: 32px; height: 30px; background: none; color: var(--ink); border-radius: 0 var(--r-ctl, 4px) var(--r-ctl, 4px) 0; }
.sx-head .sx-go svg { width: 18px; height: 18px; }
.sx-head .sx-go:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
/* Goodreads keeps the header search on its Search page too */
body.mode-home .top-search { visibility: visible; }

/* big: home and results. A plain rectangle with a dark Search button joined to its right edge. */
.sx-big { max-width: 724px; }
.sx-big .sx-field { display: flex; align-items: stretch; height: 46px; background: #fff; border: 1px solid var(--line-field); border-radius: var(--r-ctl, 4px); }
.sx-big .sx-field:focus-within { border-color: var(--ink-soft); box-shadow: var(--sh-input-focus); }
.sx-big .sx-in { height: 44px; padding: 0 8px 0 14px; font: 400 16px/23px var(--font-sans); }
.sx-clear { flex: none; align-self: center; width: 32px; height: 32px; margin-right: 4px; border: 0; border-radius: var(--r-ctl, 4px); background: none; color: var(--subdued); font: 400 22px/32px var(--font-sans); cursor: pointer; padding: 0; }
.sx-clear:hover { background: var(--bg-hover); color: var(--ink); }
.sx-big .sx-go { gap: 8px; display: inline-flex; align-items: center; height: auto; margin: -1px -1px -1px 0; padding: 0 18px; border-radius: 0 var(--r-ctl, 4px) var(--r-ctl, 4px) 0; background: var(--ink); color: #fff; font: 600 15px/1 var(--font-sans); }
.sx-big .sx-go:hover { background: var(--ink-hover); }
.sx-big .sx-go svg { width: 16px; height: 16px; }
.sx-big .sx-go:focus-visible, .sx-clear:focus-visible { outline: 0; box-shadow: var(--sh-focus); }

/* ---------- type-ahead dropdown (SPEC 4) ---------- */
.sx-pop {
  position: absolute; top: 100%; left: 0; z-index: 120; width: max(100%, 420px); max-height: calc(100vh - 70px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid var(--line-soft); border-top: 0; box-shadow: var(--sh-dropdown);
}
.sx-big .sx-pop { top: 46px; left: 0; right: 0; width: auto; }
.sx-pop.sx-fixed { position: fixed; left: 0; right: 0; width: auto; border-left: 0; border-right: 0; }
.sx-opt { display: block; position: relative; padding: 8px 12px 8px 60px; min-height: 76px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; cursor: pointer; }
.sx-opt:last-child { border-bottom: 0; }
.sx-opt:hover, .sx-opt[aria-selected="true"] { background: var(--bg-hover); text-decoration: none; }
.sx-cv { position: absolute; top: 8px; left: 10px; width: 40px; filter: none; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sx-cv .ph { padding: 3px; }
.sx-cv .ph b { font-size: 6px; -webkit-line-clamp: 5; }
.sx-t { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 14px/20px var(--font-nav); color: var(--ink); }
.sx-t b { font-weight: 700; }
.sx-by { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 12px/18px var(--font-serif); color: var(--ink); }
.sx-av { display: flex; align-items: center; gap: 0; overflow: hidden; white-space: nowrap; font: 400 12px/18px var(--font-sans); color: var(--subdued); }
.sx-av i { flex: none; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--disabled); }
.sx-av.available { color: var(--green-text); }
.sx-av.available i { background: var(--wtr); }
.sx-av.reference { color: var(--author-badge); }
.sx-av.reference i { background: var(--author-badge); }
.sx-av .sx-call { color: var(--subdued); overflow: hidden; text-overflow: ellipsis; }
.sx-av .sx-call::before { content: "·"; margin: 0 5px; }
.sx-group { padding: 10px 12px 2px; font: 600 12px/16px var(--font-sans); color: var(--subdued); }
.sx-author { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 0; padding: 8px 12px; }
.sx-author .sx-t { flex: 1; }
.sx-n { flex: none; font: 400 12px/18px var(--font-sans); color: var(--subdued); }
.sx-fix { min-height: 0; padding: 10px 12px; font: 400 14px/20px var(--font-nav); }
.sx-none { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font: 400 14px/20px var(--font-nav); color: var(--subdued); }
.sx-all { min-height: 38px; padding: 0 12px; font: 400 14px/38px var(--font-nav); color: var(--link-legacy); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- page frame: 772 main + 40 gap + 294 sidebar (SPEC 10) ---------- */
.sx-home { padding: 40px 0 0; }
.view.sx-page { padding-top: 40px; }
.sx-grid { display: grid; grid-template-columns: minmax(0, 772px) 294px; gap: 40px; align-items: start; }
.sx-main { min-width: 0; }
.sx-h1 { padding-bottom: 16px; font: var(--w-head) 36px/46px var(--font-serif); }
.sx-lede { margin: -8px 0 24px; font-size: 16px; line-height: 22px; color: var(--ink-soft); max-width: 60ch; }
.sx-h2 { margin: 0 0 4px; font: 400 20px/28px var(--font-serif); color: var(--ink); }
.sx-side { padding-top: 10px; min-width: 0; }
.sx-sb { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--divider); }
.sx-sb:last-child { border-bottom: 0; }
.sx-sb h2 { margin: 0 0 8px; font: 400 20px/28px var(--font-serif); }
.sx-chev { display: inline-flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; color: var(--ink); font: 600 16px/24px var(--font-sans); cursor: pointer; text-align: left; text-decoration: none !important; }
.sx-chev::after { content: ""; flex: none; width: 7px; height: 7px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.sx-chev:hover { text-decoration: underline !important; }

/* home */
.sx-home .sx-big { margin-bottom: 36px; }
.sx-live { display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--wtr); vertical-align: middle; }
.sx-genres { margin: 0 0 12px; padding: 0; list-style: none; columns: 2; column-gap: 16px; }
.sx-genres li { break-inside: avoid; }
.sx-genres a { display: block; padding: 3px 0; font-size: 14px; line-height: 20px; color: var(--ink); text-decoration: none; }
.sx-genres a:hover { text-decoration: underline; }

/* results */
.sx-page .sx-big { margin-bottom: 8px; }
.sx-fixed-q { margin: 16px 0 0; font-size: 16px; line-height: 24px; color: var(--ink-soft); }
.sx-fixed-q a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.sx-count { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--divider); font-size: 16px; line-height: 23px; color: var(--ink); }
/* one row per book, dense like the reader compare list: small cover | title, by, one meta line | small Want to read */
.sx-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 0 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.sx-rcv { width: 60px; align-self: start; }
.sx-rcv .ph b { font-size: 8px; }
.sx-info { min-width: 0; }
.sx-rt { font: var(--w-head) 18px/24px var(--font-serif); }
.sx-rt a { color: var(--ink); }
.sx-rby { margin: 1px 0 0; font-size: 15px; line-height: 21px; color: var(--ink-soft); }
.sx-rby a { color: var(--ink-soft); }
.sx-where { margin-top: 3px; }
.sx-meta, .sx-copies li { margin: 0; font-size: 14px; line-height: 20px; color: var(--subdued); }
.sx-meta > * + *::before, .sx-copies li > * + *::before { content: "·"; margin: 0 6px; color: var(--subdued); font-weight: 400; }
.sx-meta .sx-st { font-weight: 600; color: var(--subdued); }
.sx-meta .sx-st.available { color: var(--green-text); }
.sx-meta .sx-st.reference { color: var(--author-badge); }
.sx-meta .sx-lib, .sx-copies .sx-lib { color: var(--ink-soft); }
.sx-copies { margin: 0; padding: 0; list-style: none; }
.sx-more { padding: 0; border: 0; background: none; color: var(--ink-soft); font: 400 14px/20px var(--font-sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sx-more:hover { color: var(--ink); }
.sx-meta > .sx-more { margin-left: 8px; white-space: nowrap; }
.sx-meta > .sx-more::before { content: none; }
.sx-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.sx-act[hidden] { display: none; }
@media (min-width: 768px) { .sx-act { flex-direction: column; align-items: stretch; width: 164px; } }
.sx-act .shelf-ctl { display: block; }
.sx-act .shelf-ctl .split { width: 164px; height: 32px; }
.sx-act .split-main { padding: 0 6px 0 12px; font-size: 14px; }
.sx-act .split-arrow { width: 32px; padding: 0; }
.sx-act .split-arrow svg { width: 14px; height: 14px; }
.sx-act .shelf-ctl.compact .split .split-main, .sx-act .shelf-ctl.compact .split .split-arrow { border-width: 1px; }
.sx-act .shelf-ctl.compact .split .split-arrow { border-left: 0; }
.sx-act .split-menu { min-width: 200px; }
.sx-act .split-menu button { padding: 8px 14px; font-size: 14px; }
/* search rows show the filled green Want to Read (Goodreads), outline once shelved */
.sx-act .shelf-ctl.compact .split:not(.on) .split-main, .sx-act .shelf-ctl.compact .split:not(.on) .split-arrow { background: var(--wtr); color: #fff; border: 1px solid var(--wtr-border); }
.sx-act .shelf-ctl.compact .split:not(.on) .split-arrow { border-left: 0; }
.sx-act .shelf-ctl.compact .split:not(.on) .split-main:hover, .sx-act .shelf-ctl.compact .split:not(.on) .split-arrow:hover { background: var(--wtr-hover); }
.sx-btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--green-line); border-radius: var(--r-ctl, 4px); background: transparent; color: rgba(39,28,20,.88);
  font: 600 14px/1 var(--font-sans); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .2s ease-in-out;
}
.sx-btn2:hover { background: rgba(0,0,0,.05); text-decoration: none; }
.sx-btn2:focus-visible { outline: 0; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green-line); }
.sx-btn2:disabled { opacity: .6; cursor: progress; }
.sx-btn2.on::before { content: ""; flex: none; width: 5px; height: 10px; margin: -3px 2px 0 0; border: solid var(--green-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sx-empty { padding: 24px 0; }
.sx-empty h2 { font: var(--w-head) 20px/28px var(--font-serif); margin-bottom: 8px; }
.sx-empty p { margin: 0 0 12px; color: var(--ink-soft); }
.sx-empty ul { margin: 0; padding: 0 0 0 20px; line-height: 28px; }
.sx-empty a { text-decoration: underline; text-underline-offset: 2px; }
.sx-libs, .sx-authors { margin: 0; padding: 0; list-style: none; }
.sx-authors { display: flex; flex-wrap: wrap; gap: 0 16px; }
.sx-libs li { padding: 2px 0; }
.sx-libs button { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 0; border: 0; background: none; color: var(--ink); font: 400 16px/22px var(--font-sans); text-align: left; cursor: pointer; }
.sx-libs button:hover { text-decoration: underline; }
.sx-libs button[aria-pressed="true"] { font-weight: 600; }
.sx-libs .sx-n { font-size: 14px; }
.sx-check { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; cursor: pointer; }
.sx-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--wtr); }

/* results: field chip (old links, author clicks) and Load more */
.sx-chip { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 0; padding: 4px 4px 4px 10px; border: 1px solid var(--divider); border-radius: var(--r-ctl, 4px); font-size: 14px; line-height: 20px; color: var(--ink-soft); }
.sx-chip b { color: var(--ink); font-weight: 600; }
.sx-chip-x { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-ctl, 4px); color: var(--ink); font-size: 18px; line-height: 1; text-decoration: none !important; }
.sx-chip-x:hover { background: var(--bg-hover); }
.sx-more-wrap { display: flex; justify-content: center; margin: 24px 0 0; }
.sx-loadmore { min-width: 200px; }

/* home: cover strips (Goodreads home / genre carousels) */
#homeStrips { min-height: 40px; }
.sx-loading { display: flex; align-items: center; gap: 8px; color: var(--subdued); font-size: 14px; margin: 0 0 32px; }
.sx-strip { margin: 0 0 32px; padding-top: 24px; border-top: 1px solid var(--divider); }
.sx-strip:first-child { border-top: 0; padding-top: 0; }
.sx-strip-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sx-strip-h .sx-h2 a { color: var(--ink); }
.sx-strip-more { font-size: 14px; }
.sx-covers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 18px; margin: 0; padding: 0; list-style: none; }
.sx-covers li:nth-child(n+7) { display: none; }
.sx-card { min-width: 0; display: flex; flex-direction: column; }
.sx-card .cv { width: 100%; margin-bottom: 8px; }
.sx-ct { font: var(--w-head) 14px/19px var(--font-serif); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-ca { margin-top: 2px; font-size: 13px; line-height: 17px; color: var(--ink-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sx-cs { margin-top: 3px; font-size: 12px; line-height: 16px; color: var(--subdued); }
.sx-cs.available { color: var(--green-text); }
.sx-cs::before, .sx-mn.available::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--disabled); }
.sx-cs.available::before, .sx-mn.available::before { background: var(--wtr); }

/* home sidebar: small book rows, people, pitch */
.sx-minis, .sx-people { margin: 0 0 12px; padding: 0; list-style: none; }
.sx-mini { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.sx-mini .cv { width: 50px; }
.sx-mini .ph b { font-size: 7px; }
.sx-mt { display: block; font: var(--w-head) 15px/20px var(--font-serif); color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sx-ma { display: block; font-size: 14px; line-height: 18px; color: var(--ink-soft); margin-top: 2px; }
.sx-mn { display: block; font-size: 13px; line-height: 18px; color: var(--subdued); margin-top: 2px; }
.sx-mn.available { color: var(--green-text); }
.sx-mn .stars { font-size: 13px; }
.sx-people li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; }
.sx-people .av { width: 40px; height: 40px; font-size: 16px; }
.sx-sb-sub { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--divider); }
.sx-sb-p { margin: 0 0 12px; font-size: 14px; line-height: 20px; color: var(--ink-soft); }
.sx-pitch h2 { margin-bottom: 8px; }
.sx-pitch ul { margin: 0 0 16px; padding: 0 0 0 18px; font-size: 15px; line-height: 22px; }
.sx-pitch li { margin-bottom: 4px; }

/* ---------- old taste-run results (#results): Goodreads list rows ---------- */
#results .row { border-bottom: 1px solid var(--divider); }
#results .row h3 { font: var(--w-head) 20px/28px var(--font-serif); }
#results .row .by { font-size: 16px; color: var(--ink); }
#results .who h1 { font: var(--w-head) 36px/46px var(--font-serif); }
#results .tabs-wrap { border-bottom: 1px solid var(--divider); }

/* ---------- narrower screens ---------- */
@media (max-width: 940px) {
  .sx-grid { grid-template-columns: minmax(0, 1fr); }
  .sx-side { padding-top: 0; margin-top: 16px; }
}
/* phone (SPEC 14): 80 px cover at the left, details right, actions under the details */
@media (max-width: 767px) {
  .sx-head { max-width: none; }
  .sx-head .sx-field { height: 40px; }
  .sx-head .sx-in, .sx-head .sx-go { height: 38px; line-height: 38px; }
  .sx-head .sx-in { font-size: 16px; }
  .sx-home, .view.sx-page { padding-top: 20px; }
  .sx-h1 { font-size: 28px; line-height: 38px; padding-bottom: 12px; }
  .sx-big .sx-go span { display: none; }
  .sx-big .sx-go { padding: 0 14px; }
  .sx-count { margin-top: 12px; font-size: 14px; line-height: 20px; }
  .sx-row { grid-template-columns: 52px minmax(0, 1fr); gap: 0 12px; padding: 12px 0; }
  .sx-rcv { width: 52px; grid-row: span 2; }
  .sx-act { grid-column: 2; margin-top: 8px; }
  .sx-act .shelf-ctl .split { width: 150px; }
  .sx-rt { font-size: 16px; line-height: 21px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sx-rby { font-size: 14px; line-height: 19px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .sx-where { margin-top: 2px; }
  .sx-meta, .sx-copies li { font-size: 13px; line-height: 18px; }
  .sx-home .sx-big { margin-bottom: 28px; }
  .sx-desk { display: none !important; }
  .sx-side { margin-top: 0; }
  .sx-side .sx-sb { margin: 0; padding: 24px 0; border-bottom: 0; border-top: 1px solid var(--divider); }
  .sx-covers { display: flex; gap: 14px; overflow-x: auto; margin: 0 -4% 0 0; padding: 0 4% 6px 0; scroll-snap-type: x proximity; scrollbar-width: none; }
  .sx-covers::-webkit-scrollbar { display: none; }
  .sx-covers li, .sx-covers li:nth-child(n+7) { display: flex; flex: none; width: 74px; scroll-snap-align: start; }
  .sx-covers { gap: 10px; }
  .sx-strip { margin-bottom: 20px; padding-top: 16px; }
  .sx-strip-h { margin-bottom: 10px; }
  .sx-strip-h .sx-h2 { font-size: 18px; line-height: 24px; }
  .sx-strip-more { font-size: 13px; gap: 8px; }
  .sx-card .cv { margin-bottom: 6px; }
  .sx-card .ph b { font-size: 8px; }
  .sx-ct { font-size: 12px; line-height: 16px; }
  .sx-ca { margin-top: 1px; font-size: 11px; line-height: 15px; }
  .sx-cs { margin-top: 1px; font-size: 11px; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sx-cs::before { width: 6px; height: 6px; margin-right: 4px; }
}
