:root {
  --ink: #1d2126;
  --ink-2: #4a525c;
  --ink-3: #7a838e;
  --paper: #f6f4ef;
  --card: #ffffff;
  --line: #e4e0d6;
  --graphite: #23272d;
  --graphite-2: #2f343b;
  --gold: #b8913a;
  --gold-soft: #f3ead6;
  --good: #2e7d4f;
  --good-bg: #e6f2ea;
  --warn: #a86a00;
  --warn-bg: #fbf0d9;
  --bad: #b3261e;
  --bad-bg: #fbe5e3;
  --info: #5a6470;
  --info-bg: #eceef1;
  --radius: 14px;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--paper); }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); background: var(--graphite); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-family: var(--display); font-size: 14px; letter-spacing: .08em; }
.brand span { color: #fff; } .brand b { color: var(--gold); font-weight: 700; margin-left: 6px; }
.langs { display: flex; gap: 4px; }
.langs button { background: none; border: 1px solid transparent; color: #c8cdd3; font: 600 13px 'Manrope', system-ui, sans-serif; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.langs button[aria-pressed="true"] { border-color: var(--gold); color: #fff; }

/* Hero */
.hero { background: var(--graphite); color: #fff; padding: clamp(40px, 8vw, 88px) clamp(16px, 4vw, 40px) clamp(48px, 8vw, 96px); text-align: center; }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; margin: 0 0 14px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 5vw, 52px); line-height: 1.12; margin: 0 auto 16px; max-width: 16ch; }
.lead { color: #c8cdd3; max-width: 46ch; margin: 0 auto 32px; font-size: clamp(16px, 2vw, 18px); }
.form { display: flex; gap: 8px; max-width: 620px; margin: 0 auto; background: #fff; padding: 6px; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.form input { flex: 1; min-width: 0; border: 0; font: 500 17px 'Manrope', system-ui, sans-serif; padding: 12px 14px; outline: none; color: var(--ink); background: transparent; }
.form button { border: 0; background: var(--gold); color: #fff; font: 700 16px 'Manrope', system-ui, sans-serif; padding: 12px 22px; border-radius: 11px; cursor: pointer; white-space: nowrap; }
.form button:hover { background: #a37f2f; }
.form button:disabled { opacity: .6; cursor: wait; }
.err { color: #ffb4ab; margin: 16px 0 0; font-weight: 600; }
@media (max-width: 520px) { .form { flex-direction: column; } .form button { width: 100%; } }

/* Progress */
.progress { max-width: 520px; margin: 48px auto; padding: 0 16px; text-align: center; }
.spinner { width: 44px; height: 44px; margin: 0 auto 20px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress ol { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; display: inline-block; }
.progress li { padding: 6px 0 6px 28px; position: relative; color: var(--ink-3); }
.progress li::before { content: ''; position: absolute; left: 4px; top: 13px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); }
.progress li.active { color: var(--ink); font-weight: 600; }
.progress li.active::before { border-color: var(--gold); background: var(--gold-soft); }
.progress li.done { color: var(--ink-2); }
.progress li.done::before { background: var(--good); border-color: var(--good); }

/* Report */
.report { max-width: 980px; margin: 32px auto 48px; padding: 0 16px; }
.toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.btn { border: 1px solid var(--graphite); background: var(--graphite); color: #fff; font: 700 15px 'Manrope', system-ui, sans-serif; padding: 10px 18px; border-radius: 10px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--graphite); }
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 44px); }
.r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--graphite); padding-bottom: 18px; margin-bottom: 28px; }
.r-head .brand { color: var(--gold); } .r-head .brand span { color: var(--ink); }
.r-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; }
.r-title { font-family: var(--display); font-size: clamp(22px, 3.4vw, 32px); margin: 0; word-break: break-word; }
.r-meta { color: var(--ink-3); font-size: 14px; margin: 6px 0 0; }

.overview { display: grid; grid-template-columns: 210px 1fr; gap: 32px; align-items: center; margin-bottom: 32px; }
@media (max-width: 680px) { .overview { grid-template-columns: 1fr; justify-items: center; } }
.ring { position: relative; width: 190px; height: 190px; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .num { font-family: var(--display); font-size: 52px; font-weight: 700; line-height: 1; }
.ring .lbl { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.cats { display: grid; gap: 12px; width: 100%; }
.cat-row { display: grid; grid-template-columns: 170px 1fr 44px; gap: 12px; align-items: center; font-weight: 600; font-size: 15px; }
@media (max-width: 480px) { .cat-row { grid-template-columns: 1fr 44px; } .cat-row .bar { grid-column: 1 / -1; order: 3; } }
.bar { height: 10px; background: var(--info-bg); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; }
.cat-row b { text-align: right; font-variant-numeric: tabular-nums; }

.s-good { color: var(--good); } .s-warn { color: var(--warn); } .s-bad { color: var(--bad); }
.f-good { background: var(--good); } .f-warn { background: #d99a1e; } .f-bad { background: var(--bad); }

section.block { margin: 36px 0 0; }
h2.h, .group h3 { break-after: avoid; }
.loss-grid, .ideas, .overview { break-inside: avoid; }
h2.h { font-family: var(--display); font-size: 19px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
h2.h::before { content: ''; width: 6px; height: 22px; background: var(--gold); border-radius: 3px; }
.summary { font-size: 17px; color: var(--ink); margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { background: var(--good-bg); color: var(--good); padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.note { background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 12px 0 0; }

.loss-grid { display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: start; }
@media (max-width: 680px) { .loss-grid { grid-template-columns: 1fr; } }
.loss-big { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.loss-big .n { font-family: var(--display); font-size: 64px; font-weight: 700; color: var(--bad); line-height: 1; }
.loss-big .t { font-size: 17px; font-weight: 600; max-width: 24ch; }
.people { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin: 16px 0; max-width: 420px; }
.people i { aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.people i.lost { background: var(--bad); opacity: .85; }
.loss-list { list-style: none; padding: 0; margin: 0 0 14px; }
.loss-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.loss-list b { color: var(--bad); white-space: nowrap; }
.calc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--gold-soft); padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.calc input { width: 90px; font: 700 16px 'Manrope', system-ui, sans-serif; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.calc .res { color: var(--bad); font-size: 18px; }
.small { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
.phone { border: 10px solid var(--graphite); border-radius: 26px; overflow: hidden; background: #000; max-width: 220px; margin: 0 auto; }
.phone img { display: block; width: 100%; }
.phone-cap { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 8px; }

.plan { list-style: none; counter-reset: p; padding: 0; margin: 0; }
.plan li { counter-increment: p; display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.plan li::before { content: counter(p); width: 30px; height: 30px; border-radius: 50%; background: var(--graphite); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.plan .tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--info-bg); color: var(--info); }
.tag.high { background: var(--bad-bg); color: var(--bad); } .tag.medium { background: var(--warn-bg); color: var(--warn); }

.ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.idea { border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 12px; padding: 14px 16px; break-inside: avoid; }
.idea b { display: block; margin-bottom: 4px; }
.idea p { margin: 0; color: var(--ink-2); font-size: 15px; }

.group { margin-top: 24px; break-inside: auto; }
.group h3 { font-size: 16px; margin: 0 0 6px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--graphite); padding-bottom: 6px; }
.row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; text-align: center; align-self: start; }
.pill.ok { background: var(--good-bg); color: var(--good); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.row b { display: block; font-size: 15px; }
.row p { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); }
.row .fix { margin-top: 4px; font-size: 14px; color: var(--ink); }
.passed { display: none; font-size: 13px; color: var(--good); margin: 6px 0 0; }
.row .fix::before { content: '→ '; color: var(--gold); font-weight: 700; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; gap: 6px; } .pill { justify-self: start; } }

.cta { margin-top: 40px; background: var(--graphite); color: #fff; border-radius: var(--radius); padding: 26px 28px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; break-inside: avoid; }
.cta h3 { font-family: var(--display); margin: 0 0 6px; font-size: 20px; color: var(--gold); }
.cta p { margin: 0; color: #d6dade; }
.cta .contacts { font-weight: 700; line-height: 1.9; white-space: nowrap; }
.cta .contacts a { text-decoration: none; }
@media (max-width: 680px) { .cta { grid-template-columns: 1fr; } .cta .contacts { white-space: normal; } }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px clamp(16px, 4vw, 40px); color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }

/* PDF / печать */
@page { size: A4; margin: 14mm 13mm; }
@media print {
  body { background: #fff; font-size: 11.5pt; }
  .top, .hero, .progress, .toolbar, .foot { display: none !important; }
  .report { margin: 0; padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .calc input { border: 0; background: transparent; width: auto; padding: 0; }
  section.block { margin-top: 22px; }
  .row.ok, .row.info { display: none; }
  .row { padding: 6px 0; grid-template-columns: 92px 1fr; }
  .row p, .row b { font-size: 10pt; }
  .row .fix { font-size: 9.5pt; }
  .cta { margin-top: 26px; }
  .passed { display: block !important; }
  .pagebreak { break-before: page; }
  a { text-decoration: none; }
}
