/* K5 (Desktop R4, 21 Nov): the /search/ page at >= 1024 px (frame desktop-r4/shots/G-search-states.jpg,
   states 2-8 + 10-11 are this one page's island states; state 1/9 are the desktop header panel, C7's surface).
   CSS first on the EXISTING markup of website/pages/search.mjs (M13-M16): every word is the live page's — the
   frame's row subtitle "· uses 20 credits" needs the credits config wired into the static build (it is not:
   the rows keep the live "13 chapters" subtitle; noted BLOCKED in the PR). Nothing here matches unless
   desktop_r4 is ON (html[data-dr4]) AND the window is >= 1024 px: the phone page and the flag-OFF desktop are
   byte for byte today's. No copy is typed. Layout: a centred 640 px column for the bar, suggestions, empty and
   no-results cards; RESULTS go two-column — the tab stack (240 px) left, the groups right — with taller cards
   and pill actions, per the frame. */
@media (min-width: 1024px) {
  /* release the phone's centred 430 column (search.css's own >=761px rule) — the R4 page is full width */
  html[data-dr4] .pg:has(.se) { max-width: none; margin-inline: 0; border-inline: 0; background: var(--r4-paper); }
  html[data-dr4] body:has(.se) { background: var(--r4-paper); }
  html[data-dr4] .se-top { max-width: 692px; margin: 40px auto 0; padding: 0; }
  html[data-dr4] .se-top .se-back { display: none; } /* the frame drops the phone back arrow; the desktop chrome carries navigation */
  html[data-dr4] .se-bar { height: 52px; border-radius: 26px; border-color: var(--r4-line); box-shadow: none; background: var(--r4-card); }
  html[data-dr4] .se-bar:focus-within { border-color: var(--r4-acc); box-shadow: 0 0 0 3px rgb(194 65 12 / .12); }
  html[data-dr4] .se-bar input { font-size: 16px; }

  /* the body column: 640 for suggestions, empty and no-results; results go wide (below) */
  html[data-dr4] main.se { --se-gutter: 0px; max-width: 692px; margin: 0 auto; padding-bottom: 64px; } /* desktop keeps its own column: the phone gutter is for the phone layout */
  html[data-dr4] .se-sec:first-of-type { padding-top: 28px; }
  html[data-dr4] .se-card { border-radius: 16px; border-color: var(--r4-line); background: var(--r4-card); box-shadow: var(--r4-shadow); }
  html[data-dr4] .se-row { min-height: 68px; }
  html[data-dr4] .se-row:has(.se-cov) { min-height: 84px; }
  html[data-dr4] .se-t { font-size: 16px; line-height: 22px; }
  html[data-dr4] .se-s { font-size: 14px; line-height: 20px; }
  html[data-dr4] .se-h2 { color: var(--r4-acc); }

  /* results: the tab stack moves to its own left column; the groups fill the rest */
  html[data-dr4] main.se:has(.se-tabs) { max-width: calc(1200px + 2 * var(--r4-gutter)); box-sizing: border-box; }
  html[data-dr4] #se-sug:has(.se-tabs) { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
  html[data-dr4] .se-tabs { flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--r4-line); border-radius: 14px; background: var(--r4-card); box-shadow: var(--r4-shadow); }
  html[data-dr4] .se-tab { justify-content: space-between; width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: none; font-size: 15px; text-align: left; }
  html[data-dr4] .se-tab:hover { background: var(--r4-sel); }
  html[data-dr4] .se-tab-on { background: var(--r4-sel); }
  html[data-dr4] .se-res [role="tabpanel"] { padding-top: 0; }
  html[data-dr4] .se-res .se-sec:first-child { padding-top: 0; }
  html[data-dr4] .se-res .se-sec { padding: 0 0 24px; }
  html[data-dr4] .se-res .se-card { padding: 8px; }
  html[data-dr4] .se-res .se-row { min-height: 92px; padding: 12px 16px; gap: 18px; }
  html[data-dr4] .se-res .se-t { font-size: 18px; line-height: 26px; }
  html[data-dr4] .se-res .se-s { font-size: 14px; }
  html[data-dr4] .se-res .se-row:has(.se-cov) { min-height: 108px; }
  html[data-dr4] .se-res .se-cov { width: 48px; height: 64px; border-radius: 8px; }
  html[data-dr4] .se-res .se-ring img { width: 56px; height: 56px; }
  html[data-dr4] .se-res .se-tico, html[data-dr4] .se-res .se-sig { width: 56px; height: 56px; }
  /* actions become the frame's pills: filled marigold for Chat/Read (guide/reading rows), outlined for Open (tool rows — the rows with the icon disc). The action is a span inside the row link (or the row's disabled button): the row is the target. */
  html[data-dr4] .se-res .se-act { min-width: 88px; min-height: 44px; padding: 0 20px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
  html[data-dr4] .se-res .se-row:not(:has(.se-tico)) .se-act { background: var(--r4-pri); color: var(--r4-on-pri); }
  html[data-dr4] .se-res .se-row:not(:has(.se-tico)):hover .se-act { filter: brightness(1.05); }
  html[data-dr4] .se-res .se-row:has(.se-tico) .se-act { border: 1.5px solid var(--r4-line); color: var(--r4-ink2); background: var(--r4-card); }
  html[data-dr4] .se-res .se-row:has(.se-tico):hover .se-act { border-color: var(--r4-ring); }
  html[data-dr4] .se-res .se-row .se-act:disabled { cursor: not-allowed; }

  /* no-results and the empty state stay centred cards */
  html[data-dr4] body.se-state-none main.se, html[data-dr4] main.se:has([data-se-state="none"]:not([hidden])) { max-width: 692px; }
  html[data-dr4] [data-se-state="none"] .se-card { max-width: 480px; margin: 0 auto; }
  html[data-dr4] .se-all { font-size: 15px; }
  html[data-dr4] .se:lang(hi) .se-h2 { letter-spacing: 0; } /* [ENG-401] Hindi reset */

  /* ENG-1054 (N1) verification pass against the BUILT markup + frame G-search-states */
  html[data-dr4] .se-bar input:focus, html[data-dr4] .se-bar input:focus-visible { outline: 0; box-shadow: none; } /* the pill carries the focus ring (:focus-within), not a second ring on the input */
  html[data-dr4] .se-chips, html[data-dr4] .se-chips-wrap { margin-inline: 0; gap: 10px 12px; } /* Recent and Popular chips start on the heading's left edge, not 5 / 19 px in */
  html[data-dr4] .se-none-chips { margin: 20px 0 0; justify-content: center; }
  html[data-dr4] .se .se-none-cta { width: max-content; margin: 24px auto 0; padding: 0 32px; background: var(--r4-pri); color: var(--r4-on-pri); box-shadow: var(--r4-shadow); } /* "Ask a guide" is the marigold pill of the frame, centred in its card */
  html[data-dr4] main.se:has(.se-tabs) { padding-inline: var(--r4-gutter); } /* results: the same 40 px gutter as the header, not edge to edge */
  html[data-dr4] #se-sug:has(.se-tabs) { padding-top: 24px; } /* air between the bar and the first group heading */
}
