:root {
  --bg: #faf9f7;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #6b645c;
  --line: #e7e2da;
  --accent: #1c1917;
  --low: #1a7f4b;
  --mid: #b45309;
  --high: #b91c1c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 28px auto 20px;
  padding: 0 20px;
}

.brand { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.mark { font-style: italic; }

.badge {
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 3px 10px;
  border-radius: 999px;
}

main { max-width: 960px; margin: 0 auto; padding: 0 20px 64px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  padding: 22px;
  margin-bottom: 16px;
}

.card h2 { font-size: 1rem; margin: 0 0 14px; }

.hidden { display: none !important; }

/* ---- input card ---- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }

.tab {
  appearance: none; background: none; border: none; cursor: pointer;
  font: inherit; color: var(--muted);
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

textarea#paste-input {
  width: 100%; min-height: 340px; resize: vertical;
  font: inherit; font-size: 0.95rem;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fcfbf9; color: var(--ink);
}
textarea#paste-input:focus, .card :focus-visible {
  outline: 2px solid #a8a29e; outline-offset: 1px;
}

label#dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 340px; justify-content: center; text-align: center;
  border: 2px dashed var(--line); border-radius: 10px;
  background: #fcfbf9; cursor: pointer; padding: 16px;
}
label#dropzone.dragover { border-color: var(--accent); background: #f3efe8; }
.dz-main { font-weight: 600; }
.dz-sub { color: var(--muted); font-size: 0.85rem; }
.dz-file { margin-top: 10px; font-size: 0.9rem; color: var(--low); font-weight: 600; word-break: break-all; }

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

button.primary {
  appearance: none; cursor: pointer;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600;
  padding: 11px 22px; border-radius: 10px; border: none;
}
button.primary:hover { filter: brightness(1.15); }
button.primary:disabled { opacity: 0.55; cursor: wait; }

.message { font-size: 0.9rem; }
.message.error { color: var(--high); }
.message.notice { background: #fffbeb; border: 1px solid #fde68a; padding: 12px 14px; border-radius: 10px; color: #7c5e0b; }

/* ---- verdict ---- */

.verdict-main { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.score {
  font-size: 3.4rem; font-weight: 750; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}

.chip {
  display: inline-block;
  font-size: 0.82rem; font-weight: 650;
  padding: 4px 12px; border-radius: 999px;
}
.chip.low  { color: var(--low);  background: #e7f4ec; }
.chip.mid  { color: var(--mid);  background: #fdf3e3; }
.chip.high { color: var(--high); background: #fdeaea; }

.stats { margin-top: 8px; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }

.disclaimer {
  max-width: 960px; margin: -4px auto 18px; padding: 0 8px;
  color: var(--muted); font-size: 0.78rem;
}

/* ---- signals ---- */

.signal-row {
  display: grid;
  grid-template-columns: minmax(170px, 220px) 1fr;
  gap: 4px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.signal-row:first-child { border-top: none; }

.sig-label { font-weight: 600; font-size: 0.92rem; }
.sig-weight { display: block; color: var(--muted); font-weight: 400; font-size: 0.75rem; }

.bar-track { height: 8px; background: #efedea; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34a56d, #e8b23c 55%, #dc4a4a); transition: width 0.5s ease; }
.sig-detail { color: var(--muted); font-size: 0.78rem; margin-top: 5px; }

/* ---- paragraphs ---- */

.legend { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.75rem; margin-bottom: 14px; }
.legend-bar { flex: 0 0 160px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, hsl(130,60%,92%), #f5d67b 55%, hsl(4,65%,88%)); }

.para {
  padding: 10px 12px; border-radius: 8px; margin-bottom: 6px;
  font-size: 0.9rem; position: relative; cursor: default;
  border: 1px solid transparent;
}
.para:hover { border-color: var(--line); }
.para-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.flag {
  font-size: 0.72rem; color: #9a3412; background: #fff7ed;
  border: 1px solid #fed7aa; padding: 1px 8px; border-radius: 999px;
}

@media (max-width: 640px) {
  .signal-row { grid-template-columns: 1fr; }
  .score { font-size: 2.6rem; }
}
