@font-face {
  font-family: Merriweather;
  src: url('/assets/Merriweather-Regular.ttf') format('truetype');
  font-display: swap;
}
:root {
  --paper: #f5f2ee;
  --white: #fff;
  --ink: #151513;
  --muted: #4b5654;
  --teal: #075653;
  --pale: #dceee9;
  --line: #c9cdca;
  --serif: Merriweather, Georgia, serif;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, legend { font-family: var(--serif); line-height: 1.22; }
h1 { margin: .35em 0 .65em; font-size: clamp(2rem, 5vw, 3.35rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.65rem); margin: 0 0 .8rem; }
h3 { margin-top: 2rem; }
a, .link { color: var(--teal); font-weight: 650; text-underline-offset: .2em; }
a:hover, .link:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.wrap { width: min(91%, 1320px); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.bar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; }
.brand img { width: 75px; height: auto; }
nav { display: flex; align-items: center; gap: 1rem; }
nav a { text-decoration: none; }
.shell { padding: clamp(1.25rem, 3.5vw, 2.25rem) 0 3rem; }
.crumb { margin: 0; font-size: .9rem; }
.crumb span { margin-inline: .4rem; }
.layout { display: grid; grid-template-columns: minmax(0, 2.35fr) minmax(260px, 1fr); gap: 1.15rem; align-items: start; }
.card, dialog { border: 1px solid var(--line); border-radius: 9px; background: var(--white); padding: clamp(1rem, 2.5vw, 1.75rem); }
.catalog { max-width: 760px; }
.muted { color: var(--muted); font-size: .9rem; }
button, .button { font: inherit; font-weight: 680; min-height: 44px; cursor: pointer; border-radius: 7px; padding: .55rem .95rem; }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.primary { color: var(--white); background: var(--teal); border: 1px solid var(--teal); }
.primary:hover:enabled, .button:hover { background: #093e3d; text-decoration: none; }
.outline { color: var(--teal); background: var(--white); border: 1px solid var(--teal); }
.outline:hover:enabled { background: var(--pale); }
.link { border: 0; background: none; padding-inline: .25rem; }
button:disabled { cursor: default; opacity: .48; }
.status { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.status-line { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
#timer { font-variant-numeric: tabular-nums; color: var(--teal); font-weight: 750; }
progress { display: block; width: 100%; height: .55rem; margin-top: .65rem; border: 0; border-radius: 10px; overflow: hidden; background: #e4e6e5; }
progress::-webkit-progress-bar { background: #e4e6e5; }
progress::-webkit-progress-value { background: var(--teal); }
progress::-moz-progress-bar { background: var(--teal); }
fieldset { padding: 0; margin: 0; border: 0; min-inline-size: 0; }
legend { padding: 0; margin: 0 0 1.15rem; font-size: clamp(1.38rem, 3vw, 2.08rem); font-weight: 700; }
.options { display: grid; gap: .55rem; }
.option { display: flex; align-items: center; gap: .8rem; padding: .65rem .85rem; min-height: 49px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.option:hover { border-color: var(--teal); }
.option:has(input:checked) { background: var(--pale); border-color: var(--teal); }
.option input { flex: 0 0 auto; margin: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }
.actions { display: flex; justify-content: space-between; gap: .45rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mode { color: var(--teal); font-weight: 650; margin: 0 0 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.question-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .45rem; }
.question-grid button { padding: .25rem; border: 1px solid var(--line); color: var(--ink); background: var(--white); min-width: 0; }
.question-grid button.done { background: var(--pale); }
.question-grid button[aria-current] { border: 2px solid var(--teal); }
.legend { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.legend span { height: .9rem; width: .9rem; border-radius: 3px; display: inline-block; }
.done-marker { background: var(--pale); border: 1px solid #8da7a0; }
.current-marker { border: 2px solid var(--teal); margin-left: .35rem; }
.mobile { display: none; }
dialog { color: var(--ink); width: min(92vw, 440px); max-height: 88dvh; }
dialog::backdrop { background: #202a28a0; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.dialog-head h2 { margin: 0; }
.dialog-head { margin-bottom: .8rem; }
.dialog-actions { justify-content: end; }
.result { max-width: 920px; }
.score { font: 700 2rem var(--serif); margin-bottom: .25rem; color: var(--teal); }
details { border-top: 1px solid var(--line); padding-block: .7rem; }
summary { cursor: pointer; font-weight: 650; }
@media (max-width: 700px) {
  .bar { min-height: 68px; }
  .brand img { width: 60px; }
  .layout { display: block; }
  .desktop-grid, .desktop { display: none; }
  .exercise { padding: 0; border: 0; background: transparent; }
  .status { background: var(--white); padding: .85rem; border: 1px solid var(--line); border-radius: 8px; }
  .mobile { display: block; width: 100%; margin-top: .75rem; }
  .option { background: var(--white); }
  .actions { position: sticky; bottom: 0; background: var(--paper); padding-bottom: max(.45rem, env(safe-area-inset-bottom)); }
}
