:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1f2d3d;
  --muted: #6b7a8d;
  --line: #dfe5ee;
  --blue: #2f5fa8;
  --blue-dark: #244a83;
  --accent: #e0812e;
  --ok: #2e8b57;
  --warn: #c9502f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.top {
  background: var(--blue);
  color: #fff;
  padding: 14px 0;
}
.top .wrap { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 600; letter-spacing: .02em; }
.sub { color: #c9d8ef; font-size: 14px; }
.nav { margin-left: auto; display: flex; gap: 18px; }
.nav a { color: #dbe6f7; text-decoration: none; font-size: 14px; }
.nav a:hover { color: #fff; text-decoration: underline; }

.mic {
  margin-top: 8px;
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.mic::before { content: "🎤 "; }
.mic:hover { border-color: var(--blue); }
.mic.rec {
  background: #fdeee6;
  border-color: var(--accent);
  color: #a5501a;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .62; } }
.foot { color: var(--muted); font-size: 13px; padding: 30px 0 50px; }

h1 { font-size: 27px; margin: 28px 0 10px; }
h2 { font-size: 20px; margin: 34px 0 6px; }
p.lead { color: var(--muted); margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  margin: 18px 0;
}
.rules { padding-left: 20px; margin: 12px 0 0; }
.rules li { margin-bottom: 7px; }

label.field { display: block; margin: 18px 0 6px; font-weight: 600; }
input[type=text], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fdfefe;
}
textarea { min-height: 92px; resize: vertical; }
input[type=text]:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,95,168,.12);
}

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 13px 26px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--blue-dark); }
.btn.big { font-size: 17px; padding: 15px 34px; }

.block-head {
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin: 38px 0 4px;
}
.block-head h2 { margin: 0; }
.block-head .hint { color: var(--muted); font-size: 14px; }

.q { margin: 22px 0; }
.q .num { color: var(--accent); font-weight: 700; margin-right: 6px; }
.q .text { font-weight: 600; }

.sticky {
  position: sticky;
  bottom: 0;
  background: rgba(244,246,250,.95);
  border-top: 1px solid var(--line);
  padding: 14px 0;
  margin-top: 30px;
  backdrop-filter: blur(4px);
}
.sticky .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0; }
.counter { color: var(--muted); font-size: 14px; }

.score-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.score-big { font-size: 42px; font-weight: 700; line-height: 1; }
.badge {
  display: inline-block; border-radius: 20px; padding: 5px 14px;
  font-size: 14px; font-weight: 600;
}
.badge.ok { background: #e4f3ea; color: var(--ok); }
.badge.no { background: #fbe9e4; color: var(--warn); }

.row {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.row:first-of-type { border-top: 0; }
.row .rq { font-weight: 600; }
.row .ra { color: var(--muted); font-size: 14px; margin: 6px 0; white-space: pre-wrap; }
.row .rc { font-size: 14px; }
.pill {
  float: right; margin-left: 12px;
  border-radius: 6px; padding: 2px 9px; font-size: 13px; font-weight: 700;
}
.pill.p1 { background: #e4f3ea; color: var(--ok); }
.pill.p05 { background: #fdf2e0; color: #a5691a; }
.pill.p0 { background: #fbe9e4; color: var(--warn); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }

.note { background: #fdf6ec; border: 1px solid #f0dcc0; border-radius: 8px; padding: 14px 16px; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--blue);
  animation: spin 1s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media print {
  .top, .foot, .btn { display: none; }
  .card { border: 0; padding: 0; }
}
