:root {
  color-scheme: dark;
  --ink: #eef2ff;
  --muted: #aeb9d5;
  --line: #2d3960;
  --panel: #101a33;
  --panel-strong: #162244;
  --accent: #75e6ba;
  --accent-ink: #06251d;
  --danger: #ffb4b4;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 10% -5%, #233d75, transparent 32rem), #071126; font: 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
.shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 88px; }
.hero, .results-head, .actions { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.hero { margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: 8px; font-size: 1.25rem; }
.subtitle, .hint, .provider-status { color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--panel), transparent 4%); box-shadow: 0 22px 70px #0005; }
.login-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); gap: 32px; padding: 34px; }
.login-form, .search-card { display: grid; gap: 12px; }
.search-card { padding: 30px; }
label, legend { font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--ink); background: #0a1329; }
textarea { resize: vertical; min-height: 88px; }
fieldset { margin: 12px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); }
legend { padding: 0 8px 0 0; }
.options { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; }
.options label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; }
.options input { width: auto; accent-color: var(--accent); }
.hint { max-width: 700px; margin: 13px 0 0; font-size: .9rem; }
.button { border: 0; border-radius: 10px; padding: 12px 18px; color: var(--accent-ink); background: var(--accent); font-weight: 800; cursor: pointer; }
.button:hover { filter: brightness(1.08); }
.button:disabled { cursor: wait; opacity: .7; }
.secondary { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.count-label { display: grid; grid-template-columns: auto 74px; align-items: center; gap: 9px; color: var(--muted); }
.count-label select { padding: 8px; }
.error { min-height: 1.5em; margin: 0; color: var(--danger); font-weight: 600; }
.results-head { margin: 42px 0 18px; align-items: center; }
.provider-status { margin: 0; text-align: right; font-size: .9rem; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.result { display: flex; flex-direction: column; gap: 12px; min-height: 230px; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.source { align-self: flex-start; padding: 4px 8px; border-radius: 99px; color: var(--accent); background: #183c39; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.result a { color: var(--ink); font-size: 1.05rem; font-weight: 800; text-decoration-color: #658ccf; text-underline-offset: 3px; }
.excerpt { margin: 0; color: var(--muted); font-size: .93rem; }
.meta { margin-top: auto; color: #8392b8; font-size: .78rem; }
.empty { padding: 22px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); }
.hidden { display: none !important; }

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1060px); padding-top: 35px; }
  .login-card { grid-template-columns: 1fr; padding: 24px; }
  .hero, .results-head, .actions { align-items: stretch; flex-direction: column; }
  .provider-status { text-align: left; }
}
