:root {
  --bg: #f6f7f9;
  --card: #fff;
  --ink: #16202c;
  --muted: #5d6b7a;
  --line: #e3e7ec;
  --accent: #1f6feb;
  --accent-ink: #fff;
  --problem: #c2410c;
  --problem-bg: #fff4ec;
  --strength: #15803d;
  --strength-bg: #eefaf2;
  --neutral-bg: #f1f4f8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
header.top { background: #fff; border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--accent); }
footer { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }

.hero { padding: 56px 0 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.12; margin: 0 0 14px; letter-spacing: -.02em; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 640px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin: 18px 0; }
.card h2 { margin: 0 0 6px; font-size: 21px; }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; font: inherit; padding: 11px 13px; border: 1px solid #cfd6de; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid rgba(31, 111, 235, .25); border-color: var(--accent); }
textarea { min-height: 160px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 20px; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid #c9d8f5; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.error { color: var(--problem); margin-top: 10px; font-size: 14px; }

.cands { display: grid; gap: 10px; margin-top: 14px; }
.cand { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.cand:hover, .cand.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12); }
.cand b { display: block; }
.cand .muted { font-size: 13px; }
/* шаг «Это ваша компания?» */
.cand2 { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; display: grid; gap: 4px; }
.cand2.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12); }
.cand2 .head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cand2 .t { font-size: 17px; }
.cand2 .legal { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--neutral-bg); font-size: 14px; }
.cand2 .legal.warn { background: var(--problem-bg); color: var(--problem); }
.cand2 .how { margin-top: 6px; font-size: 13px; }
.cand2 .ok { color: var(--strength); }
.cand2 .warn { color: var(--problem); }
.cand2 .confirm { margin-top: 10px; }
.cand2 .innrow label { margin-top: 0; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline input { max-width: 220px; }
.notes p { margin: 0 0 6px; }
.cand2 .sug { display: grid; gap: 6px; margin-top: 8px; }
.cand2 .sugg { padding: 8px 12px; }
.cand2 .sugg .muted { font-size: 13px; }

.q { padding: 16px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q .qt { font-weight: 600; margin-bottom: 10px; }
.q .qb { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-btn { border: 1px solid #cfd6de; border-radius: 999px; padding: 7px 14px; background: #fff; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); }
.opt-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.progress { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--neutral-bg); color: var(--muted); font-size: 13px; }
.pill.ok { background: var(--strength-bg); color: var(--strength); }
.pill.err { background: var(--problem-bg); color: var(--problem); }
.pill.run::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.summary p { margin: 6px 0; font-size: 16px; }
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 760px) { .modules { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .modules { grid-template-columns: 1fr; } }
.mod { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.mod:hover, .mod.sel { border-color: var(--accent); }
.mod h4 { margin: 0 0 4px; font-size: 15px; }
.mod .muted { font-size: 13px; }
.mod .cnt { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

.finding { border-left: 3px solid var(--line); padding: 10px 14px; margin: 10px 0; background: #fff; border-radius: 0 10px 10px 0; }
.finding.problem { border-left-color: var(--problem); background: var(--problem-bg); }
.finding.strength { border-left-color: var(--strength); background: var(--strength-bg); }
.finding.neutral { background: var(--neutral-bg); }
.finding.sub { margin-left: 22px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; background: #fff; border: 1px solid var(--line); margin-right: 6px; vertical-align: 1px; }
.tag.fact { color: #0f5132; border-color: #b7e0c7; }
.tag.conclusion { color: #1e3a8a; border-color: #c7d4f7; }
.tag.hypothesis { color: #7c2d12; border-color: #f3cfb4; }
.conf { font-size: 12px; color: var(--muted); }
.src { font-size: 12px; color: var(--muted); margin-top: 6px; }
.src a { color: var(--muted); }
.recs { padding-left: 20px; }
.recs li { margin: 8px 0; }
.locked { border: 1px dashed #c9d8f5; background: #f7faff; border-radius: 12px; padding: 18px; margin-top: 14px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
.modal-bg.on { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; max-width: 460px; width: 100%; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 6px; margin: 20px 0 0; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tier { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; border-radius: 6px; padding: 2px 6px; }
.tier.A { background: #dcfce7; color: #166534; }
.tier.B { background: #fef9c3; color: #854d0e; }
.tier.C { background: #f1f5f9; color: #475569; }
.hidden { display: none !important; }
