:root {
  color-scheme: dark;
  --bg: #070b13;
  --surface: #101827;
  --surface-2: #151f31;
  --border: #26344a;
  --text: #f5f8fc;
  --muted: #94a3b8;
  --accent: #7c82ff;
  --accent-2: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -10%, rgba(124, 130, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 86% 8%, rgba(34, 211, 238, 0.09), transparent 30rem),
    var(--bg);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px max(20px, calc((100vw - 1420px) / 2));
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(7, 11, 19, 0.82);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: white;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.3);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.eyebrow.accent { color: #9fa4ff; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 999px;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.09);
  font-size: 12px;
  font-weight: 650;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

main { width: min(1420px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 72px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 34px;
}
.hero h2 {
  max-width: 860px;
  margin: 6px 0 14px;
  font-size: clamp(32px, 4vw, 55px);
  line-height: 1.03;
  letter-spacing: -0.047em;
}
.hero-copy { max-width: 820px; margin: 0; color: #b1bfd2; font-size: 16px; }
.method-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(16, 24, 39, 0.72);
}
.method-card > span { font-size: 12px; font-weight: 750; color: #c4b5fd; text-transform: uppercase; letter-spacing: .08em; }
.method-card ol { margin: 10px 0 0; padding-left: 21px; color: #b1bfd2; font-size: 13px; }
.method-card li + li { margin-top: 5px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.panel {
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 20px;
  background: rgba(16, 24, 39, 0.82);
  box-shadow: var(--shadow);
}
.config-panel { position: sticky; top: 94px; padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-heading h3, .guide h3 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }

label { display: block; margin: 17px 0 7px; color: #d9e2ef; font-size: 12px; font-weight: 700; }
.optional { color: var(--muted); font-weight: 500; }
.label-row { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.label-row label { margin-bottom: 7px; }
.label-row span { margin-bottom: 7px; color: var(--muted); font-size: 11px; }
input[type="url"], input[type="text"], textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  color: var(--text);
  background: #09101c;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input[type="url"], input[type="text"] { height: 45px; padding: 0 13px; }
textarea { min-height: 156px; padding: 12px 13px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 130, 255, 0.13); }
.field-help, .privacy-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
code { padding: 1px 4px; border-radius: 4px; color: #c4b5fd; background: #20283a; }

.toggle-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1220;
  cursor: pointer;
}
.toggle-row input { margin-top: 3px; accent-color: var(--accent); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 2px; color: var(--muted); font-weight: 450; line-height: 1.35; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  color: white;
  font-weight: 720;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button.primary {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  background: linear-gradient(115deg, #696ff2, #159fba);
  box-shadow: 0 14px 30px rgba(78, 86, 223, .25);
}
.button.secondary {
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid var(--border);
  color: #dce7f5;
  background: #182235;
  font-size: 12px;
}
.button-icon { font-size: 10px; }

.results-column { min-width: 0; display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats article { min-height: 94px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16, 24, 39, .76); }
.stats span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.stats strong { display: block; margin-top: 5px; font-size: 27px; letter-spacing: -.04em; }
.stats .good strong { color: var(--good); }
.stats .warn strong { color: var(--warn); }
.stats .bad strong { color: var(--bad); }

.results-panel { min-height: 390px; padding: 22px; overflow: hidden; }
.muted { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.empty-state { display: grid; place-items: center; min-height: 260px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--border); border-radius: 50%; color: var(--accent-2); font-size: 26px; background: #0c1422; }
.empty-state strong { margin-top: -36px; color: #dce6f5; }
.empty-state p { margin-top: -45px; font-size: 13px; }
.hidden { display: none !important; }

.notice { margin: -5px 0 16px; padding: 11px 13px; border: 1px solid rgba(251, 191, 36, .25); border-radius: 10px; color: #fde68a; background: rgba(180, 83, 9, .1); font-size: 12px; }
.result-list { display: grid; gap: 11px; }
.result-card { border: 1px solid var(--border); border-radius: 14px; background: #0b1220; overflow: hidden; }
.result-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; }
.kind-pill, .verdict {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.kind-pill { color: #bae6fd; background: rgba(14, 165, 233, .12); }
.result-url { min-width: 0; }
.result-url a { display: block; overflow: hidden; color: #e7edf7; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.result-url a:hover { color: var(--accent-2); text-decoration: underline; }
.result-url p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.verdict.current, .verdict.consistent { color: #a7f3d0; background: rgba(16, 185, 129, .13); }
.verdict.stale, .verdict.error { color: #fecdd3; background: rgba(244, 63, 94, .13); }
.verdict.different, .verdict.marker-missing, .verdict.unverifiable, .verdict.limited { color: #fde68a; background: rgba(245, 158, 11, .13); }
.result-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.metric { padding: 10px 12px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { display: block; overflow: hidden; margin-top: 2px; color: #dce6f5; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
details { border-top: 1px solid var(--border); }
summary { padding: 9px 14px; color: #aebbd0; cursor: pointer; font-size: 11px; font-weight: 700; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; padding: 0 14px 14px; }
.detail { min-width: 0; color: var(--muted); font-size: 10px; }
.detail b { color: #dce6f5; }
.detail code { display: block; overflow: hidden; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; }

.guide { padding: 20px 22px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin-top: 15px; }
.guide-grid p { margin: 0; color: var(--muted); font-size: 12px; }
.guide-grid strong { color: #dce6f5; }
.legend { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.legend.current, .legend.consistent { background: var(--good); }
.legend.stale { background: var(--bad); }
.legend.review { background: var(--warn); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(410px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #e8eef8;
  background: #182235;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1060px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .workspace { grid-template-columns: 1fr; }
  .config-panel { position: static; }
}

@media (max-width: 720px) {
  .topbar { min-height: 64px; padding-inline: 16px; }
  .status-chip { display: none; }
  main { width: min(100% - 28px, 1420px); padding-top: 34px; }
  .hero h2 { font-size: 35px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-main { grid-template-columns: auto minmax(0, 1fr); }
  .verdict { grid-column: 2; justify-self: start; }
  .result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { border-bottom: 1px solid var(--border); }
  .guide-grid, .details-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
