:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #5d6679;
  --accent: #3a5bd9;
  --accent-text: #ffffff;
  --border: #dde1ec;
  --link: #1f47c4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --card: #181f30;
    --text: #e6e9f2;
    --muted: #98a1b8;
    --accent: #6f8cff;
    --accent-text: #0f1420;
    --border: #2a3350;
    --link: #8fa8ff;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
#app { min-height: 100vh; display: flex; flex-direction: column; padding: 0 16px; }
.top { max-width: 820px; width: 100%; margin: 0 auto; padding: 20px 0 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
main { max-width: 820px; width: 100%; margin: 0 auto; flex: 1; padding-bottom: 40px; }

.home main { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-bottom: 12vh; }
.tagline { font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.2; margin: 0 0 28px; font-weight: 700; }
.tagline em { font-style: normal; color: var(--accent); }
.searched .tagline { display: none; }

#form { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
#q {
  flex: 1 1 280px; min-width: 0; padding: 14px 18px; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; outline: none;
}
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
#kl { padding: 0 12px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 999px; }
button, #form button {
  font: inherit; font-weight: 600; cursor: pointer; padding: 12px 22px;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 999px;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .6; cursor: default; }

.promises { list-style: none; display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center; padding: 0; margin: 18px 0 0; color: var(--muted); font-size: .9rem; }
.promises li::before { content: "✓ "; color: var(--accent); }
.searched .promises { display: none; }

#status { margin: 18px 0 0; color: var(--muted); text-align: left; }
#status.error { color: #c0392b; }
#results { list-style: none; padding: 0; margin: 8px 0 0; width: 100%; text-align: left; }
#results li { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin: 12px 0; }
.res-host { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-title { display: block; margin: 2px 0 4px; font-size: 1.1rem; font-weight: 600; color: var(--link); text-decoration: none; }
.res-title:hover { text-decoration: underline; }
.res-snippet { margin: 0; color: var(--text); font-size: .95rem; }
.res-actions { margin-top: 8px; font-size: .85rem; }
.res-actions a { color: var(--muted); text-decoration: none; border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }
.res-actions a:hover { color: var(--accent); border-color: var(--accent); }
#more { display: block; margin: 20px auto 0; }

footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px 0 24px; }
.searched footer { display: none; }
