:root {
  --bg: #1e1e1e;
  --surface: #212226;
  --surface-hover: #26272c;
  --border: #2c2c30;
  --text: #e8e8e4;
  --muted: #9a9a96;
  --mint: #dcf8e9;
  --cream: #f6f6da;
  --sky: #cde2ff;
  --lavender: #eae8f6;
  --coral: #ffd4cc;
  --font-sans: -apple-system, 'SF Pro Display', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.glow {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
}
.glow-a {
  top: -25%; left: -12%; width: 70%; height: 70%;
  background: radial-gradient(circle, rgba(234, 232, 246, 0.07), transparent 70%);
  animation: floatGlow 18s ease-in-out infinite;
}
.glow-b {
  right: -18%; bottom: -30%; width: 65%; height: 65%;
  background: radial-gradient(circle, rgba(205, 226, 255, 0.06), transparent 70%);
  animation: floatGlow 22s ease-in-out infinite reverse;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(-6%, -4%) scale(1); }
  50% { transform: translate(4%, 3%) scale(1.08); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.text-gradient {
  background: linear-gradient(100deg, #eae8f6, #f6f6da, #dcf8e9, #cde2ff, #eae8f6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 7s ease-in-out infinite;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px 0 0;
}
header .brand { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
header a { color: var(--muted); text-decoration: none; font-size: 13px; }
header a:hover { color: var(--text); }

.hero { padding: 56px 0 36px; animation: fadeUp 0.7s ease both; }
.hero h1 {
  margin: 0;
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.hero p {
  margin: 20px 0 0;
  max-width: 660px;
  color: var(--muted);
  font-size: 16px;
}
.hero .kicker {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.editor-head .label { font-size: 13px; color: var(--muted); }
.samples { display: flex; gap: 8px; flex-wrap: wrap; }

textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  background: #1a1b1e;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  tab-size: 4;
}
textarea:focus { outline: none; border-color: #3a3b41; }

input[type='text'] {
  width: 100%;
  background: #1a1b1e;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
}
input[type='text']:focus { outline: none; border-color: #3a3b41; }

.btn {
  border: 0;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(100deg, #eae8f6, #dcf8e9, #cde2ff);
  color: #1a1a1a;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

.stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  padding: 14px 4px 0;
}
.stats b { color: var(--text); font-weight: 600; }

.verdict {
  margin-top: 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 22px;
  animation: fadeUp 0.4s ease both;
}
.verdict.hit { border-color: rgba(255, 212, 204, 0.35); background: rgba(255, 212, 204, 0.05); }
.verdict.miss { border-color: rgba(220, 248, 233, 0.3); background: rgba(220, 248, 233, 0.04); }
.verdict h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.01em; }
.verdict p { margin: 0; color: var(--muted); font-size: 14.5px; }

.finding {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.finding-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #1a1a1a;
}
.pill.critical, .pill.high { background: var(--coral); }
.pill.medium { background: var(--cream); }
.pill.low { background: var(--sky); }
.tag {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.loc { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.claim { font-size: 15px; margin-bottom: 12px; }

.chain { display: flex; flex-direction: column; gap: 0; margin: 12px 0; }
.chain-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 5px 0;
  border-left: 2px solid var(--border);
  padding-left: 14px;
  position: relative;
}
.chain-step::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}
.chain-step.hit::before { background: var(--coral); box-shadow: 0 0 0 3px rgba(255, 212, 204, 0.15); }
.chain-step.hit { border-left-color: var(--coral); }
.chain-step.hit .cd { color: var(--coral); }
.chain-step .ln { color: var(--muted); min-width: 34px; text-align: right; }
.chain-step .cd { color: var(--text); word-break: break-word; }

ul.why { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
ul.why li { margin: 5px 0; }
code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #1a1b1e;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}

.rejected { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.rejected .hdr { color: var(--text); font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.rejected div.item { padding: 3px 0; }

.question {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
}

.abstain {
  margin-top: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--muted);
}

.report { margin-top: 22px; }
.report label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.notice {
  margin-top: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 14px;
}
.notice.ok { border-color: rgba(220, 248, 233, 0.35); color: var(--mint); }
.notice.err { border-color: rgba(255, 212, 204, 0.35); color: var(--coral); }


.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

table.subs { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 16px; }
table.subs th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--border); }
table.subs td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.subs tr:hover { background: var(--surface-hover); }
pre.code {
  background: #1a1b1e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin: 10px 0 0;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px 64px; }
  .loc { margin-left: 0; width: 100%; }
}

label.btn { display: inline-flex; align-items: center; }
