@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/golos-text-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #eef0f7;
  --ink: #14163a;
  --indigo: #4b3bff;
  --rec: #ff5a36;
  --line: #c5c9e0;
  --block: #ffffff;
  --muted: #565a86;
  --paper-dim: #b4b8d8;
  --tick: rgba(238, 240, 247, 0.26);
  --panel-line: rgba(238, 240, 247, 0.28);
  --radius: 16px;
  --gap: 20px;
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-text);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 560px;
  margin: 0 auto;
  padding: 32px max(16px, env(safe-area-inset-right)) 72px max(16px, env(safe-area-inset-left));
}

.page--wide {
  max-width: 1120px;
}

h1 {
  margin: 0 0 12px;
  font: 700 clamp(1.7rem, 6.4vw, 2.6rem) / 1.08 var(--font-display);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

h2,
.block-title {
  margin: 0;
  font: 600 1rem/1.3 var(--font-text);
}

.block {
  padding: 20px;
  background: var(--block);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.block > * + * {
  margin-top: 14px;
}

label {
  display: block;
  font-weight: 600;
}

.block > label + .field,
.block > .block-title + .reading {
  margin-top: 10px;
}

.field {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: 400 1rem/1.4 var(--font-text);
}

.field--age {
  width: 7.5rem;
  min-height: 72px;
  font: 600 2.5rem/1 var(--font-display);
}

.field[aria-invalid="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.field[readonly] {
  color: var(--muted);
}

.reading {
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.65;
}

.panel {
  padding: 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
}

.panel :focus-visible {
  outline-color: var(--paper);
}

.timeline {
  display: block;
  width: 100%;
  height: 112px;
}

.timer {
  margin: 14px 0 0;
  font: 500 1.125rem/1.2 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.btn {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 20px;
  padding: 14px 20px;
  background: var(--indigo);
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  font: 600 1.0625rem/1.2 var(--font-text);
  cursor: pointer;
  transition: background-color 0.12s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.panel[data-state="recording"] .btn {
  background: var(--rec);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.btn--inline {
  display: inline-block;
  width: auto;
  margin-top: 0;
  padding: 12px 18px;
  white-space: nowrap;
}

.btn--small {
  min-height: 36px;
  padding: 6px 12px;
  border-width: 1px;
  font-size: 0.875rem;
}

.note {
  margin: 14px 0 0;
  color: var(--paper-dim);
  font-size: 0.875rem;
}

.message {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  font-weight: 500;
}

.message:empty {
  display: none;
}

.message--light {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.result h2 {
  font: 600 1.125rem/1.25 var(--font-display);
  margin-bottom: 4px;
}

.result h2:focus {
  outline: none;
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.row--real {
  border-top: 2px solid var(--ink);
}

.row-label {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.row--real .row-label {
  font-weight: 600;
}

.row-value {
  flex: none;
  text-align: right;
}

.num {
  font: 600 2rem/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.unit {
  margin-left: 0.3em;
  font-weight: 500;
}

.range {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.875rem;
}

.fail {
  color: var(--muted);
}

.bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.bar h1 {
  margin-bottom: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.stack > .message {
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.stat {
  padding: 14px 16px;
  background: var(--block);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.stat dt {
  color: var(--muted);
  font-size: 0.9375rem;
}

.stat dd {
  margin: 6px 0 0;
  font: 600 1.75rem/1.1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  min-width: 6.5rem;
  border-bottom: 2px solid var(--ink);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
  vertical-align: bottom;
}

td {
  white-space: nowrap;
}

.cell-num {
  font-variant-numeric: tabular-nums;
}

.miss {
  display: inline-block;
  padding: 2px 8px;
  background: var(--rec);
  color: var(--ink);
  border-radius: 6px;
  font-weight: 600;
}

.none {
  color: var(--muted);
}

.empty {
  margin: 0;
}

@media (max-width: 639px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) {
  .page {
    padding-top: 56px;
  }
}

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