:root {
  --bg: #f4f6f9; --card: #ffffff; --text: #1d2433; --muted: #6b7280; --line: #e3e7ee;
  --accent: #1f4e78; --accent-2: #2e75b6; --ok: #2e7d32; --warn: #b45309; --bad: #b91c1c;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
a { color: var(--accent-2); }
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 18px; color: var(--muted); font-size: 14px; }
.topbar .brand { font-weight: 600; color: var(--text); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card + .card { margin-top: 16px; }
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=tel], input[type=email], input[type=url], input[type=password], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid #cfd6e0; border-radius: 8px; font: inherit; background: #fff;
}
textarea { min-height: 180px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 12px 0; }
.check input { margin-top: 5px; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #163a5a; }
.btn.secondary { background: #e9eef5; color: var(--text); }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.error { background: #fdecec; color: var(--bad); border: 1px solid #f5c2c2; padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.notice { background: #fff7e6; color: var(--warn); border: 1px solid #f6d9a3; padding: 10px 12px; border-radius: 8px; margin: 0 0 14px; }
.ok { color: var(--ok); } .bad { color: var(--bad); }

/* Прогресс и таймер */
.progress { height: 6px; background: #e3e7ee; border-radius: 3px; overflow: hidden; margin: 6px 0 18px; }
.progress > div { height: 100%; background: var(--accent-2); transition: width .3s; }
.qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 22px; color: var(--accent); min-width: 72px; text-align: right; }
.timer.low { color: var(--bad); }
.timerbar { height: 4px; background: #e3e7ee; border-radius: 2px; margin: 8px 0 16px; overflow: hidden; }
.timerbar > div { height: 100%; background: var(--accent-2); }
.timerbar.low > div { background: var(--bad); }

/* Вопрос */
.context { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 0 0 16px; white-space: pre-wrap; }
.context img { max-width: 100%; max-height: 340px; width: auto; height: auto; display: block; margin: 8px auto 0; }
.question { font-size: 18px; font-weight: 600; margin: 0 0 14px; white-space: pre-wrap; }
.options { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid #cfd6e0; border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; }
.opt:hover { border-color: var(--accent-2); }
.opt input { margin-top: 4px; }
.opt .lbl { font-weight: 700; color: var(--accent); min-width: 20px; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale label { flex: 1; min-width: 44px; text-align: center; border: 1px solid #cfd6e0; border-radius: 8px; padding: 10px 0; cursor: pointer; font-weight: 600; margin: 0; }
.scale input { display: none; }
.scale input:checked + span { display: block; background: var(--accent); color: #fff; border-radius: 6px; margin: -10px 0; padding: 10px 0; }
.scale-hint { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; }
.actions { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.noselect { -webkit-user-select: none; user-select: none; }
.wordcount { color: var(--muted); font-size: 13px; text-align: right; }

/* Таблицы HR */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:hover td { background: #f8fafc; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e9eef5; color: #374151; }
.pill.ok { background: #e3f3e5; color: var(--ok); }
.pill.bad { background: #fdecec; color: var(--bad); }
.pill.warn { background: #fff3dc; color: var(--warn); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } .card { padding: 18px; } h1 { font-size: 20px; } }
.bar { height: 8px; background: #e3e7ee; border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent-2); }
code.link { display: block; background: #f3f4f6; padding: 10px 12px; border-radius: 8px; word-break: break-all; font-size: 14px; }
.copybox { white-space: pre-wrap; background: #f3f4f6; padding: 12px; border-radius: 8px; font-size: 14px; }
.nav a { margin-right: 16px; }
