:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

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

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.hero {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  padding: 40px 0 34px;
  margin-bottom: 26px;
}
.hero h1 { margin: 0 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.hero .sub { margin: 0; color: #cbd5e1; max-width: 640px; font-size: .97rem; }
.hero strong { color: #fff; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 10px; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.note { font-size: .82rem; margin: 6px 0 0; }

/* Input ------------------------------------------------------------------ */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fbfcfe;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #f0f5ff; }
.dropzone p { margin: 2px 0; }
.faux-link { color: var(--primary); text-decoration: underline; }

.file-chip {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 999px;
  padding: 8px 14px; margin: 8px auto 0; max-width: 520px; font-size: .92rem;
}
.file-chip button {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: .95rem; padding: 2px 6px; border-radius: 6px;
}
.file-chip button:hover { background: #e0e7ff; color: var(--text); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

textarea {
  width: 100%; min-height: 190px; resize: vertical;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: .95rem;
  outline: none; background: #fff;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }

.controls { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.counter { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: #dc2626; font-weight: 600; }
.actions { display: flex; gap: 10px; align-items: center; flex: 1; }
.spacer { flex: 1; }

button.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--primary); text-decoration: underline; font-size: .88rem;
}
button.link:hover { color: var(--primary-hover); }

.btn-primary, .btn-secondary {
  border: 1px solid transparent; border-radius: 9px; padding: 9px 18px;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: #f1f5f9; }

.error {
  margin-top: 14px; padding: 11px 14px; border-radius: 9px; font-size: .9rem;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
}

/* Results ------------------------------------------------------------------ */
.score-card { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.gauge-wrap { position: relative; width: 230px; flex-shrink: 0; margin: 0 auto; }
.gauge { width: 100%; display: block; }
#gauge-fg { transition: stroke-dashoffset .8s cubic-bezier(.2, .7, .3, 1), stroke .4s; }
.gauge-num {
  position: absolute; inset: auto 0 0 0; text-align: center;
  font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
}
.gauge-num small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.verdict { flex: 1; min-width: 260px; }
.verdict-label { font-size: 1.35rem; font-weight: 700; margin-bottom: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 13px; font-size: .88rem;
}
.chip b { display: block; font-size: 1.02rem; font-variant-numeric: tabular-nums; }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.feature {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fbfcfe;
}
.feature .f-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.feature .f-label { font-weight: 600; font-size: .92rem; }
.feature .f-value { font-size: .82rem; color: var(--muted); text-align: right; }
.f-bar { height: 7px; background: #e9edf3; border-radius: 99px; margin: 9px 0 7px; overflow: hidden; }
.f-bar > div { height: 100%; border-radius: 99px; transition: width .6s ease; }
.feature .f-detail { font-size: .82rem; color: var(--muted); }

.susp { border-left: 3px solid #f97316; background: #fffaf5; border-radius: 0 9px 9px 0; padding: 10px 14px; margin-bottom: 10px; }
.susp .s-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.susp .s-score { font-size: .8rem; font-weight: 700; color: #c2410c; white-space: nowrap; }
.susp .s-text { margin: 4px 0 0; font-size: .92rem; }
.susp .s-reasons { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.susp-none { color: var(--muted); font-size: .92rem; }

.highlighted { max-height: 560px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; background: #fff; }
.highlighted p { margin: 12px 0; }
.highlighted span { border-radius: 3px; padding: 0 1px; cursor: help; }
.p-badge {
  display: inline-block; margin-right: 8px; padding: 1px 8px;
  border-radius: 99px; color: #fff; font-size: .72rem; font-weight: 700;
  vertical-align: middle; cursor: help; letter-spacing: .02em;
}

.methodology summary { cursor: pointer; font-weight: 600; }
.method-body { margin-top: 12px; font-size: .92rem; color: #334155; }
.method-body ul { margin: 8px 0; padding-left: 20px; }
.method-body li { margin: 3px 0; }

footer { padding: 10px 0 40px; text-align: center; }
