:root {
  color-scheme: light;
  font-family: "Sen", Inter, ui-sans-serif, system-ui, sans-serif;
  --ink: #333;
  --muted: #686868;
  --paper: #fff;
  --surface: #fff;
  --soft: #f7f7f7;
  --primary: #bf0000;
  --primary-dark: #9f0000;
  --accent: #e30000;
  --complementary: #f0b247;
  --line: #ddd;
  --focus: #f0b247;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--primary); }
button, input, select { font: inherit; }
.topbar { min-height: 60px; padding: 0 max(4vw, 1rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #eee; background: #fff; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 1rem; font-weight: 800; }
.brand small { margin-top: .2rem; color: var(--muted); font-size: .68rem; font-weight: 500; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px 0; background: var(--primary); color: white; font-weight: 800; }
.source-link { font-size: .84rem; font-weight: 700; text-underline-offset: 3px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; }
.ui-language { width: auto; min-width: 68px; padding: .48rem .65rem; font-size: .82rem; font-weight: 800; }
main { width: min(1160px, 92vw); margin: 0 auto; }
.hero { padding: 2.25rem 0 1.35rem; max-width: 850px; }
.eyebrow { margin: 0 0 .4rem; color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0 0 .65rem; font-size: clamp(1.8rem, 3.2vw, 2.55rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h2 { margin: 0 0 .7rem; font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 800; line-height: 1.2; }
.lead { max-width: 800px; margin: 0; font-size: .98rem; line-height: 1.55; color: var(--muted); }
.answer-panel { margin-bottom: 1.2rem; padding: clamp(1.1rem, 2.5vw, 1.6rem); border: 1px solid #e4c7c7; border-left: 4px solid var(--primary); border-radius: 0 20px; background: #fffafa; }
.panel-copy { margin: -.25rem 0 1rem; color: var(--muted); line-height: 1.5; }
.answer-composer { display: grid; grid-template-columns: 1fr 150px auto; align-items: end; gap: .65rem; }
.answer-composer textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid #cfcfcf; border-radius: 8px; padding: .72rem .9rem; font: inherit; color: var(--ink); }
.answer-language { color: var(--muted); font-size: .78rem; }
.answer-language select { margin-top: .35rem; }
.answer-result { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px dashed #c7a7a7; border-radius: 14px 0; background: white; }
.answer-result h3, .answer-result h4 { margin: 0 0 .65rem; }
.answer-result h4 { margin-top: 1rem; }
.answer-result p { white-space: pre-wrap; line-height: 1.62; }
.answer-result ol { margin: 0; padding-left: 1.4rem; }
.answer-result li { margin: .45rem 0; line-height: 1.4; }
.search-panel { padding: clamp(1.1rem, 2.5vw, 1.6rem); border: 1px dashed #cfcfcf; border-top: 4px solid var(--primary); border-radius: 20px 0; background: var(--soft); color: var(--ink); }
label { display: block; font-weight: 750; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
input, select { width: 100%; border: 1px solid #cfcfcf; border-radius: 8px; padding: .72rem .9rem; background: white; color: var(--ink); }
.composer input { min-height: 48px; font-size: 1rem; }
button { border: 0; border-radius: 30px; padding: .72rem 1.5rem; background: var(--primary); color: white; font-weight: 750; cursor: pointer; transition: background .2s ease; }
button:hover { background: var(--primary-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.filters { margin-top: .85rem; color: var(--muted); }
.filters summary { width: fit-content; cursor: pointer; font-weight: 750; }
.filter-grid { margin-top: .85rem; display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; }
.filter-grid label { font-size: .78rem; color: var(--muted); }
.filter-grid input, .filter-grid select { margin-top: .35rem; }
.results-section { padding: 2.7rem 0 4rem; min-height: 360px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.result-count { color: var(--muted); font-weight: 750; }
.status { min-height: 1.5rem; color: var(--muted); }
.results { display: grid; gap: .8rem; }
.result-card { padding: clamp(1rem, 2.5vw, 1.4rem); border: 1px dashed #ccc; border-radius: 20px 0; background: var(--surface); }
.result-card h3 { margin: .55rem 0 .85rem; font-size: clamp(1.08rem, 1.8vw, 1.3rem); font-weight: 750; line-height: 1.3; }
.result-card h3 a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.badges { display: flex; flex-wrap: wrap; gap: .45rem; }
.badge { padding: .26rem .55rem; border-radius: 20px; background: #fbe7e7; color: var(--primary-dark); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.badge-muted { background: #f1f1f1; color: var(--muted); }
.metadata { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .88rem; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.snippet { margin: .9rem 0; line-height: 1.58; color: #505050; }
mark { background: #ffe1a8; color: inherit; padding: .05em .12em; }
.open-link { font-weight: 850; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.secondary { border: 1px solid var(--primary); background: white; color: var(--primary); }
.secondary:hover { background: #fff3f3; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem max(4vw, 1rem); border-top: 4px solid var(--primary); background: #fafafa; color: var(--muted); font-size: .8rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .answer-composer { grid-template-columns: 1fr 150px; }
  .answer-composer textarea { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .topbar { min-height: 56px; }
  .topbar-actions { gap: .45rem; }
  .source-link { max-width: 100px; text-align: right; font-size: .72rem; }
  .ui-language { min-width: 60px; padding: .4rem .5rem; }
  .hero { padding: 1.5rem 0 1rem; }
  .composer { grid-template-columns: 1fr; }
  .composer button { width: 100%; }
  .answer-composer { grid-template-columns: 1fr; }
  .answer-composer textarea { grid-column: auto; }
  .answer-composer button { width: 100%; }
  .filter-grid { grid-template-columns: 1fr; }
  .results-heading, footer { align-items: flex-start; flex-direction: column; }
  .metadata { grid-template-columns: 1fr; gap: .08rem; }
  .metadata dd { margin-bottom: .45rem; }
  .pagination { flex-wrap: wrap; }
}
