:root {
  color-scheme: light;
  --ink: #18242a;
  --muted: #637179;
  --line: #dce3df;
  --paper: #f7f8f4;
  --card: #ffffff;
  --accent: #ba4d2f;
  --accent-dark: #80331f;
  --green: #0f665c;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.6 Georgia, serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 56px 0 80px; }
.hero { max-width: 720px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font: 700 12px/1.2 Arial, sans-serif; letter-spacing: .14em; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1 { font-size: clamp(52px, 9vw, 94px); letter-spacing: -.06em; }
h2 { font-size: 28px; }
.intro { margin: 16px 0 0; color: var(--muted); font-size: 20px; }
.search-panel { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 18px 42px #17332a0b; }
label { display: block; margin-bottom: 10px; font: 700 13px Arial, sans-serif; }
.search-row { display: grid; grid-template-columns: 1fr 220px 110px; gap: 10px; }
input, select { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; color: var(--ink); background: #fbfcfa; }
button { border: 0; border-radius: 10px; padding: 12px 16px; color: #fff; background: var(--green); }
button:hover { background: #0a5048; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 20px 0 48px; }
.stat { display: flex; min-height: 96px; flex-direction: column; justify-content: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; }
.stat strong { font: 700 25px Arial, sans-serif; }
.stat span { color: var(--muted); font: 12px Arial, sans-serif; }
.stat-button { color: var(--ink); background: var(--card); }
.stat-button:hover { color: #fff; background: var(--green); }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
#result-count { color: var(--muted); font: 13px Arial, sans-serif; }
.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.result-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.card-top { display: flex; justify-content: space-between; margin-bottom: 14px; color: var(--muted); font: 12px Arial, sans-serif; }
.tag { color: var(--accent-dark); font-weight: 700; }
.result-card h3 { font-size: 23px; }
.result-card p { display: -webkit-box; overflow: hidden; min-height: 76px; margin: 12px 0 16px; color: #4f5d64; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.result-card button { font: 700 13px Arial, sans-serif; }
.empty { padding: 36px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; }
dialog { width: min(960px, calc(100% - 28px)); max-height: 88vh; padding: 34px; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 24px 80px #071c1680; }
dialog::backdrop { background: #071c1666; }
.close { position: absolute; top: 14px; right: 14px; padding: 2px 10px; font: 26px Arial, sans-serif; background: transparent; color: var(--muted); }
.close:hover { color: var(--ink); background: #edf1ee; }
pre { overflow: auto; max-height: 68vh; margin: 24px 0 0; white-space: pre-wrap; font: 16px/1.8 Georgia, serif; }
mark { padding: 0 .12em; border-radius: 3px; background: #ffe36b; color: inherit; }
@media (max-width: 760px) {
  .shell { padding-top: 34px; }
  .search-row, .results { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-bottom: 34px; }
  .results-head { display: block; }
  #result-count { display: block; margin-top: 8px; }
  dialog { padding: 26px 20px; }
}
