:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #59666b;
  --line: #d7e0df;
  --soft: #f3f6f4;
  --panel: #ffffff;
  --accent: #12645f;
  --accent-2: #a25b18;
  --bad: #a11d35;
  --good: #17643b;
  --shadow: 0 20px 60px rgba(15, 35, 34, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #f6f8f6;
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); color: var(--accent); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 4vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 850; letter-spacing: 0; }
.app { max-width: 1120px; margin: 0 auto; padding: clamp(12px, 3vw, 22px); }
.search-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(10px, 2vw, 14px);
  box-shadow: 0 1px 0 rgba(12, 31, 29, .04);
}
textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px;
  color: var(--ink);
  background: #fff;
}
textarea:focus, input:focus { outline: 2px solid rgba(22,108,103,.22); border-color: var(--accent); }
.controls {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto minmax(190px, 250px) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.segmented input, .toggle input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block;
  min-height: 38px;
  text-align: center;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: #dfeee8; color: #0c4f4b; }
.toggle {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  font-weight: 750;
}
.toggle:has(input:checked) { background: #fff0df; border-color: #d49b62; color: var(--accent-2); }
.depth {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.depth span { font-weight: 600; color: #6d7480; }
#submit { min-height: 40px; background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 750; }
.status, .intent { margin: 12px 0; color: var(--muted); }
.intent {
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  background: #eef6f3;
  border-radius: 4px;
}
.intent summary { cursor: pointer; color: var(--ink); font-weight: 750; }
.provider { display: inline-block; margin: 0 6px 6px 0; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.provider.on { color: var(--good); border-color: #a8d6bc; }
.provider.off { color: var(--muted); }
.section-title {
  margin: 24px 0 8px;
  font-size: 13px;
  letter-spacing: 0;
  color: #343943;
  font-weight: 850;
}
.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.title {
  color: #154f8b;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 760;
  text-decoration: none;
}
.title:hover { text-decoration: underline; }
.meta { margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.snippet { margin: 8px 0 4px; max-width: 850px; }
.why { margin: 0; color: #3f4852; font-size: 13px; }
.badges { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  padding: 3px 6px;
  border-radius: 4px;
  background: #eef1f4;
  color: #3b424c;
  font-size: 11px;
  font-weight: 780;
}
.actions { display: grid; gap: 6px; align-content: start; }
.actions button { padding: 6px 8px; font-size: 12px; color: var(--muted); }
.hidden { display: none; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
  background:
    linear-gradient(135deg, rgba(18, 100, 95, .10), transparent 38%),
    linear-gradient(315deg, rgba(162, 91, 24, .12), transparent 34%),
    #f4f7f5;
}
.login-shell { width: min(430px, 100%); }
.login-box {
  display: grid;
  gap: 15px;
  padding: clamp(20px, 6vw, 30px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-box h1 { margin: 0; font-size: clamp(28px, 8vw, 42px); line-height: 1; letter-spacing: 0; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.login-copy { margin: 10px 0 2px; color: var(--muted); max-width: 32ch; }
.login-box label { display: grid; gap: 5px; font-weight: 700; }
.login-box input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fbfcfc;
}
.login-box button { min-height: 44px; background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.login-box button:disabled { opacity: .72; cursor: wait; }
.error {
  min-height: 20px;
  color: var(--bad);
  margin: 0;
  font-weight: 750;
}
.error:not(:empty) {
  padding: 9px 10px;
  border: 1px solid rgba(161, 29, 53, .28);
  border-radius: 6px;
  background: #fff4f6;
}

@media (max-width: 820px) {
  .controls { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented span { font-size: 12px; padding: 10px 4px; }
}
