:root {
  --navy: #244178;
  --deep-navy: #142d50;
  --orange: #e65718;
  --blue: #3978a3;
  --green: #3f9b3f;
  --purple: #95139c;
  --red: #c91435;
  --ink: #172a49;
  --muted: #64728a;
  --line: #c8d3e1;
  --pale-blue: #e2edf8;
  --pale-violet: #e6e9f8;
  --paper: #ffffff;
  --soft: #f5f8fc;
  --shadow: 0 18px 55px rgba(23, 42, 73, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #eef3f8;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button, input, select { font: inherit; }
[hidden] { display: none !important; }

.site-header {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 54px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .06em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--orange);
  letter-spacing: 0;
  font-size: .72rem;
}
.author { color: var(--muted); font-weight: 700; }

main { width: min(1220px, calc(100% - 32px)); margin: 28px auto 54px; }
.screen {
  background: var(--paper);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 70px);
  box-shadow: var(--shadow);
}
.eyebrow {
  color: var(--orange);
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin: 10px 0 8px;
  color: var(--navy);
  font-size: clamp(2.35rem, 6vw, 5.5rem);
  line-height: .98;
  letter-spacing: .015em;
  text-transform: uppercase;
}
.lead {
  margin: 0;
  color: var(--orange);
  font-size: clamp(1.15rem, 2.4vw, 1.8rem);
  font-weight: 900;
}
.accent-rule { height: 4px; margin: 22px 0 34px; background: var(--navy); }
.accent-rule span { display: block; width: 19%; height: 100%; background: var(--orange); }
.intro-copy { max-width: 950px; font-size: clamp(1.08rem, 2vw, 1.35rem); }

.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 34px 0; }
.quality-grid article { padding: 24px; border-radius: 18px; background: var(--pale-blue); }
.quality-grid span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 15px;
  border-radius: 50%;
  color: white;
  background: var(--orange);
  font-weight: 900;
}
.quality-grid h2 { margin-bottom: 4px; color: var(--navy); font-size: 1.15rem; text-transform: uppercase; }
.quality-grid p { margin: 0; }

.how-to { margin: 38px 0 30px; }
.how-to h2, .section-heading h2 { color: var(--navy); font-size: clamp(1.65rem, 3vw, 2.5rem); text-transform: uppercase; }
.how-to ol { display: grid; gap: 14px; padding: 0; list-style: none; counter-reset: steps; }
.how-to li { position: relative; min-height: 38px; padding: 6px 0 0 52px; counter-increment: steps; }
.how-to li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  background: var(--navy);
  font-weight: 900;
}
.start-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 22px;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 900;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(23, 42, 73, .14); }
.button:focus-visible, input:focus-visible { outline: 4px solid rgba(57, 120, 163, .25); outline-offset: 2px; }
.button-primary { color: white; background: var(--orange); }
.button-secondary { color: var(--navy); border-color: var(--navy); background: white; }
.button-light { color: var(--navy); background: white; }
.device-note { margin: 16px 0 0; color: var(--muted); font-size: .88rem; }
.method-note { margin: 30px 0 0; padding: 20px 24px; border-radius: 16px; background: var(--pale-violet); }
.participant-card { margin: 34px 0 22px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.participant-card legend { padding: 0 8px; color: var(--navy); font-size: 1.15rem; font-weight: 900; text-transform: uppercase; }
.participant-card > p { margin-bottom: 16px; color: var(--muted); }
.participant-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 14px; }
.participant-fields label { display: grid; gap: 6px; color: var(--navy); font-weight: 900; }
.participant-fields select { width: 100%; min-height: 48px; padding: 10px 40px 10px 12px; border: 2px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
.participant-fields select:focus-visible { outline: 4px solid rgba(57, 120, 163, .25); outline-offset: 2px; border-color: var(--blue); }
.participant-note { margin: 14px 0 0 !important; font-size: .88rem; }
.participant-error { margin: 12px 0 0 !important; color: var(--red) !important; font-weight: 900; }

.test-screen { padding-top: 36px; }
.test-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.test-topbar h1 { font-size: clamp(2rem, 4vw, 3.8rem); }
.timer-panel {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: grid;
  min-width: 148px;
  padding: 12px 18px;
  border: 2px solid var(--navy);
  border-radius: 16px;
  color: var(--navy);
  background: rgba(255, 255, 255, .96);
  text-align: center;
}
.timer-panel span { font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.timer-panel strong { font-variant-numeric: tabular-nums; font-size: 2rem; line-height: 1.1; }
.timer-panel small { color: var(--muted); }
.timer-panel.time-reached { color: var(--orange); border-color: var(--orange); }
.five-minute-notice { margin: -12px 0 24px; padding: 14px 18px; border-left: 6px solid var(--orange); background: #fff1e8; }
.test-instruction { margin-bottom: 26px; color: var(--muted); }
.task-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.task-column { padding: 8px 14px; border-right: 1px solid var(--line); }
.task-column:last-child { border-right: 0; }
.task-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-height: 55px;
  border-bottom: 1px solid #dae2ec;
  cursor: text;
}
.task-row:last-child { border-bottom: 0; }
.task-number { color: var(--orange); font-weight: 900; }
.task-content {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.task-expression { color: #141d2a; font-size: clamp(.9rem, 1.35vw, 1.08rem); font-weight: 700; white-space: nowrap; }
.task-row input {
  flex: 1 1 58px;
  width: 58px;
  min-width: 42px;
  max-width: 92px;
  padding: 8px 5px;
  border: 0;
  border-bottom: 2px solid #aebdd0;
  border-radius: 0;
  color: var(--navy);
  background: transparent;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}
.task-row:focus-within { background: var(--pale-blue); }
.task-row:focus-within input { border-color: var(--orange); }
.finish-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; padding: 20px 22px; border-radius: 16px; background: var(--pale-violet); }
.finish-panel div { display: grid; }
.finish-panel span { color: var(--muted); }

.result-screen > h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); }
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; padding: 28px; border-radius: 20px; background: var(--pale-blue); }
.score-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: 150px;
  height: 150px;
  border: 10px solid var(--navy);
  border-radius: 50%;
  color: var(--navy);
}
.score-ring strong { font-size: 3.5rem; line-height: .85; }
.score-ring span { font-weight: 900; }
.result-hero[data-tone="green"] .score-ring { color: var(--green); border-color: var(--green); }
.result-hero[data-tone="orange"] .score-ring { color: var(--orange); border-color: var(--orange); }
.result-hero[data-tone="red"] .score-ring { color: var(--red); border-color: var(--red); }
.result-kicker { margin: 0 0 6px; color: var(--navy); font-size: clamp(1.45rem, 3vw, 2.3rem); font-weight: 900; text-transform: uppercase; }
.result-summary > p:not(.result-kicker) { font-size: 1.08rem; }
.result-facts { display: flex; flex-wrap: wrap; gap: 10px; }
.result-facts span { padding: 8px 12px; border-radius: 8px; background: white; }
.time-card { display: grid; grid-template-columns: 22px 1fr; gap: 18px; margin: 22px 0 50px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 16px; }
.time-dot { width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--navy); }
.time-card[data-tone="green"] .time-dot { background: var(--green); }
.time-card[data-tone="orange"] .time-dot { background: var(--orange); }
.time-card[data-tone="red"] .time-dot { background: var(--red); }
.time-card span, .section-heading span, .product-card span { color: var(--orange); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.time-card h2 { margin: 2px 0; color: var(--navy); text-transform: uppercase; }
.time-card p { margin: 0; }
.comparison-section { margin: 0 0 50px; }
.chart-frame { padding: 12px 12px 4px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.results-chart { display: block; width: 100%; height: auto; }
.chart-grid { stroke: #dce4ee; stroke-width: 1; }
.chart-axis { stroke: var(--ink); stroke-width: 2; }
.chart-label, .chart-tick { fill: var(--ink); font-family: Arial, Helvetica, sans-serif; }
.chart-label { font-size: 18px; font-weight: 900; }
.chart-tick { font-size: 14px; }
.chart-trend { stroke: var(--orange); stroke-width: 3; opacity: .7; }
.chart-point { fill: var(--navy); opacity: .22; }
.chart-point-current-halo { fill: white; stroke: var(--orange); stroke-width: 3; }
.chart-point-current { fill: var(--orange); }
.chart-current-label { fill: var(--orange); font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: 900; }
.statistics-note { margin: 10px 4px 0; color: var(--muted); font-size: .9rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 2px 0 0; }
.section-heading > p { max-width: 400px; margin: 0; color: var(--muted); text-align: right; }
.skills-grid { display: grid; gap: 14px; }
.skill-card { display: grid; grid-template-columns: 68px 1fr; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; }
.skill-badge { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; color: white; background: var(--skill-color); font-size: 1.5rem; font-weight: 900; }
.skill-title-row { display: flex; justify-content: space-between; gap: 18px; }
.skill-title-row h3 { margin-bottom: 1px; color: var(--skill-color); font-size: 1.35rem; text-transform: uppercase; }
.skill-title-row p { margin: 0; color: var(--muted); }
.skill-title-row > strong { color: var(--skill-color); font-size: 2rem; white-space: nowrap; }
.skill-title-row > strong span { font-size: 1rem; }
.skill-status { display: inline-block; margin: 12px 0 8px; padding: 4px 8px; border-radius: 5px; color: white; background: var(--skill-color); font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.skill-content > p { margin-bottom: 12px; }
.train-line { padding: 12px 14px; border-radius: 10px; background: var(--pale-blue); }
.train-line strong { color: var(--orange); text-transform: uppercase; }
.mistakes-section { margin-top: 50px; }
.mistakes-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mistake-item {
  display: grid;
  grid-template-columns: 1.35fr 1.1fr .75fr;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.mistake-expression, .mistake-correct { display: flex; align-items: center; padding: 12px 14px; }
.mistake-expression { font-weight: 900; }
.mistake-answer {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-left: 5px solid var(--skill-color);
  color: var(--skill-color);
  background: var(--soft);
  background: color-mix(in srgb, var(--skill-color) 11%, white);
}
.mistake-answer > span:last-child { color: var(--ink); }
.mistake-skill-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  background: var(--skill-color);
  font-size: .78rem;
  font-weight: 900;
}
.perfect-result { grid-column: 1 / -1; padding: 20px; border-radius: 12px; color: #215f25; background: #e8f7e8; font-weight: 900; }
.principle { margin: 50px 0 18px; padding: 20px 24px; border-radius: 16px; background: var(--pale-violet); }
.principle strong { color: var(--orange); font-size: 1.1rem; text-transform: uppercase; }
.principle p { margin: 6px 0 0; }
.product-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px; border-radius: 18px; color: white; background: var(--navy); }
.product-card span { color: #ffb38e; }
.product-card h2 { margin: 3px 0; font-size: 1.55rem; }
.product-card p { margin: 0; }
.result-actions { margin-top: 18px; }

footer { display: flex; justify-content: space-between; gap: 24px; width: min(1220px, calc(100% - 32px)); margin: 0 auto 40px; color: var(--muted); font-size: .82rem; }

@media (max-width: 1050px) {
  .task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-column:nth-child(2) { border-right: 0; }
  .task-column:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .mistakes-list { grid-template-columns: 1fr; }
}

@media (max-width: 740px) {
  body { background: white; }
  .site-header { padding: 0 16px; }
  .author { font-size: .84rem; }
  main { width: 100%; margin: 0; }
  .screen { padding: 28px 18px 44px; border-radius: 0; box-shadow: none; }
  h1 { font-size: clamp(2.25rem, 12vw, 3.8rem); }
  .quality-grid { grid-template-columns: 1fr; gap: 10px; }
  .quality-grid article { display: grid; grid-template-columns: 50px 1fr; column-gap: 12px; padding: 18px; }
  .quality-grid span { grid-row: 1 / 3; margin: 0; }
  .quality-grid h2 { align-self: end; }
  .start-actions .button, .result-actions .button { width: 100%; }
  .participant-fields { grid-template-columns: 1fr; }
  .test-topbar { align-items: center; }
  .test-topbar h1 { max-width: 220px; font-size: 1.6rem; line-height: 1.02; }
  .timer-panel { min-width: 116px; padding: 9px 12px; }
  .timer-panel strong { font-size: 1.65rem; }
  .task-board { grid-template-columns: 1fr; border-radius: 12px; }
  .task-column, .task-column:nth-child(2) { padding: 5px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .task-column:last-child { border-bottom: 0; }
  .task-row { grid-template-columns: 2rem minmax(0, 1fr); min-height: 62px; }
  .task-content { gap: 5px; }
  .task-expression { font-size: 1.05rem; }
  .task-row input { flex-basis: 64px; max-width: 86px; }
  .finish-panel, .product-card, .section-heading { align-items: stretch; flex-direction: column; }
  .finish-panel { display: flex; }
  .finish-panel .button, .product-card .button { width: 100%; }
  .result-hero { grid-template-columns: 1fr; text-align: center; }
  .score-ring { width: 134px; height: 134px; margin: auto; }
  .result-facts { justify-content: center; }
  .chart-frame { margin: 0 -6px; }
  .section-heading > p { text-align: left; }
  .skill-card { grid-template-columns: 46px 1fr; gap: 12px; padding: 16px 14px; }
  .skill-badge { width: 44px; height: 44px; font-size: 1.1rem; }
  .skill-title-row { display: block; }
  .skill-title-row > strong { display: block; margin-top: 8px; }
  .mistake-item { grid-template-columns: 1fr; }
  footer { flex-direction: column; width: auto; margin: 0; padding: 20px 18px 30px; background: var(--soft); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .site-header, footer, .start-actions, .result-actions, .product-card { display: none !important; }
  body, main, .screen { width: 100%; margin: 0; padding: 0; background: white; box-shadow: none; }
}
