/* Styles for the search page. Colors are tokens so dark mode only swaps them.
 * Theme rules: no data-theme on <html> = "auto" (follow the system setting);
 * data-theme="light" / "dark" = forced by the switch (see theme.js).
 * --logo is the UC Irvine logo color: the official blue on light pages, white
 * on dark ones (UCI brand rule: white logos only on dark backgrounds). */
:root {
  color-scheme: light;
  --bg: #ffffff; --fg: #1f2328; --muted: #6a737d; --link: #0b5cad;
  --card: #f6f8fa; --border: #d0d7de; --accent: #0064a4; --logo: #2b5597;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14181d; --fg: #e6edf3; --muted: #8b949e; --link: #6cb6ff;
    --card: #1c2128; --border: #30363d; --accent: #4493d8; --logo: #ffffff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14181d; --fg: #e6edf3; --muted: #8b949e; --link: #6cb6ff;
  --card: #1c2128; --border: #30363d; --accent: #4493d8; --logo: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }

/* Header: logo and the "Search" title on the left, theme switch on the right.
 * UCI brand rules: keep a clear zone around the logo about as wide as its
 * "U" (about 24px at 28px tall), never lock other text or art onto it, and
 * never show it smaller than 3/16 inch (about 18px tall). So "Search" sits a
 * full clear zone away, in the page's own text color, as a separate title. */
.top { display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.title { display: flex; align-items: center; gap: 24px; }
.brand { display: block; color: var(--logo); line-height: 0; }
.logo { display: block; height: 28px; width: auto; }
.product { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1; color: var(--fg); }
.theme-switch { display: inline-flex; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; }
.theme-switch button { padding: 6px 12px; font-size: .85rem; border-radius: 0;
  background: transparent; color: var(--muted); }
.theme-switch button + button { border-left: 1px solid var(--border); }
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
footer { max-width: 760px; margin: 0 auto; padding: 0 16px 32px;
  color: var(--muted); font-size: .8rem; }

/* Hidden on screen but still read by screen readers: the visible title is
 * just "Search" (the logo says UCI), while screen readers hear "UCI Search". */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
form { display: flex; gap: 8px; }
input[type=search] {
  flex: 1; min-width: 0; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--fg);
}
button {
  padding: 10px 16px; font-size: 1rem; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; cursor: pointer;
}
#status { color: var(--muted); font-size: .9rem; margin: 12px 0; }
#results { list-style: none; margin: 0; padding: 0; }
.result {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
}
.result a.title { color: var(--link); font-size: 1.1rem; text-decoration: none; overflow-wrap: anywhere; }
.result a.title:hover { text-decoration: underline; }
/* "[1] Score: 1.3754", the same line search.py prints. */
.meta { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.url { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; margin: 2px 0 6px; }
/* The page's own excerpt, then the AI summary in its own box: a tinted panel
 * with an accent bar on the left, so nobody mistakes model text for the page. */
.excerpt { margin: 0 0 8px; overflow-wrap: anywhere; }
.summary { margin: 0; padding: 8px 10px; overflow-wrap: anywhere;
  border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0;
  background: var(--card); /* fallback for browsers without color-mix() */
  background: color-mix(in srgb, var(--accent) 8%, transparent); }
.summary.pending, .summary.none { color: var(--muted); border-left-color: var(--border); }
.label { display: block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent); margin-bottom: 2px; }
.pending .label, .none .label { color: var(--muted); }
