:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --primary: #123b73;
  --primary-2: #1d5fa7;
  --border: #d9e1ec;
  --green: #16803c;
  --yellow: #af7500;
  --red: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary-2); text-decoration: none; }
.topbar { height: 68px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; color: var(--primary); font-size: 20px; }
.brand span { font-weight: 500; color: var(--muted); }
nav { display: flex; gap: 18px; }
.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 22px; align-items: stretch; margin-bottom: 22px; }
.hero h1, h1 { font-size: 38px; line-height: 1.1; margin: 10px 0 12px; color: var(--primary); }
h2 { margin-top: 0; color: var(--primary); }
.lead { font-size: 18px; line-height: 1.6; color: #344054; max-width: 760px; }
.lead-small { font-size: 17px; line-height: 1.55; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #eaf2ff; color: var(--primary); font-size: 13px; font-weight: 700; }
.card, .hero-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 22px; box-shadow: 0 8px 30px rgba(21, 45, 80, .06); }
.hero-card { font-size: 16px; }
.narrow { max-width: 640px; margin: 30px auto; }
.form label { display: flex; flex-direction: column; gap: 7px; font-weight: 700; }
.form input { width: 100%; padding: 12px 13px; border: 1px solid var(--border); border-radius: 12px; font-size: 15px; background: #fff; }
.form small { color: var(--muted); font-weight: 400; line-height: 1.35; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.consents { margin: 18px 0; display: grid; gap: 10px; color: #344054; }
.consents label { flex-direction: row; font-weight: 500; }
.consents input { width: auto; }
.button { border: 0; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; background: var(--primary); color: white; border-radius: 12px; font-weight: 800; cursor: pointer; font-size: 15px; }
.button.secondary { background: #eef2f7; color: var(--primary); }
.alert { padding: 14px 16px; border-radius: 14px; margin: 16px 0; }
.alert.error { background: #fff1f0; color: var(--red); border: 1px solid #ffc9c2; }
.mock-sms { padding: 18px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 14px; margin: 18px 0; }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; }
.result-head { background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 24px; display: flex; justify-content: space-between; align-items: center; }
.result-head h1 { margin-bottom: 4px; }
.segment { font-size: 28px; font-weight: 900; padding: 16px 20px; border-radius: 18px; background: #eef2f7; }
.result-head.зеленый .segment { background: #dcfae6; color: var(--green); }
.result-head.желтый .segment { background: #fff4d6; color: var(--yellow); }
.result-head.красный .segment { background: #ffe4e0; color: var(--red); }
.metric { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.metric span { display: block; color: var(--muted); margin-bottom: 8px; }
.metric strong { font-size: 24px; color: var(--primary); }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ok { color: var(--green); font-weight: 800; }
pre { white-space: pre-wrap; word-break: break-word; background: #0b1220; color: #d1e7ff; padding: 16px; border-radius: 14px; overflow: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 760px) {
  .hero, .grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 14px 18px; flex-direction: column; gap: 10px; align-items: flex-start; }
  .hero h1, h1 { font-size: 30px; }
  .result-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}
.report-matrix th, .report-matrix td { min-width: 150px; }
.report-matrix th:nth-child(4), .report-matrix td:nth-child(4),
.report-matrix th:nth-child(5), .report-matrix td:nth-child(5) { min-width: 240px; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eef2f7; color: var(--primary); font-size: 12px; font-weight: 800; }
.status-available, .status-completed { background: #dcfae6; color: var(--green); }
.status-manual-review, .status-partial { background: #fff4d6; color: var(--yellow); }
.status-failed, .status-unavailable { background: #ffe4e0; color: var(--red); }
.status-not-requested { background: #eef2f7; color: var(--muted); }
.admin-lifecycle { min-width: 320px; }
.admin-lifecycle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.admin-lifecycle-card { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #fbfcff; }
.admin-lifecycle-card small { overflow-wrap: anywhere; }
.compact-list p { margin: 0 0 6px; }
.kv-list { grid-template-columns: minmax(120px, .8fr) minmax(140px, 1fr); gap: 6px 10px; margin: 0; font-size: 13px; }
.kv-list dt { overflow-wrap: anywhere; }
.kv-list dd { font-weight: 600; overflow-wrap: anywhere; }
code { background: #eef2f7; border-radius: 6px; padding: 2px 5px; }

.quiz-shell { max-width: 620px; margin: 0 auto; display: grid; gap: 16px; }
.quiz-header h1 { margin: 10px 0 0; font-size: 30px; line-height: 1.2; }
.quiz-subtitle { margin: 0; color: #344054; font-size: 16px; line-height: 1.55; }
.quiz-progress { margin-top: 12px; display: grid; gap: 8px; }
.quiz-progress__text { font-weight: 700; color: var(--primary); font-size: 15px; line-height: 1.4; }
.quiz-progress__bar-wrap { width: 100%; height: 14px; background: #e8edf5; border-radius: 999px; overflow: hidden; border: 1px solid #d7e1ef; }
.quiz-progress__bar { height: 100%; width: 10%; background: var(--primary-2); transition: width .22s ease; }
.quiz-steps { min-height: 260px; display: grid; }
.quiz-step { display: none; gap: 14px; align-content: start; padding: 2px 0 4px; }
.quiz-step.is-active { display: grid; animation: quiz-step-enter .22s ease-out both; }
.quiz-step-title { margin: 0; font-size: 23px; line-height: 1.3; color: var(--primary); }
.quiz-note { margin: 0; color: #475467; font-size: 16px; line-height: 1.55; max-width: 60ch; }
.quiz-note-final { font-size: 17px; color: #1f2937; }
.quiz-actions { display: grid; gap: 10px; margin-top: 2px; }
.quiz-actions .button { width: 100%; min-height: 50px; font-size: 16px; }
.quiz-btn-video { background: #eef2f7; color: var(--primary); border: 1px solid #d5deea; font-weight: 700; }
.quiz-btn-next { background: var(--primary); color: #fff; font-weight: 800; }
.quiz-actions-final { margin-top: 8px; }
.quiz-btn-wa { background: #128c7e; color: #fff; min-height: 54px; font-size: 17px; font-weight: 900; box-shadow: 0 8px 20px rgba(18, 140, 126, .22); }
.quiz-shell .button:focus-visible { outline: 3px solid #7ea8df; outline-offset: 2px; }
.house-variants h2 { font-size: 20px; margin-bottom: 12px; }
.house-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.house-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fbfcff; pointer-events: none; user-select: none; }
.house-card h3 { margin: 0 0 6px; color: var(--primary); }
.house-card p { margin: 0; color: #475467; }
@keyframes quiz-step-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 760px) {
  .quiz-header h1 { font-size: 34px; }
  .quiz-step-title { font-size: 26px; }
  .quiz-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiz-actions-final { grid-template-columns: minmax(0, 1fr); max-width: 360px; }
  .house-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
