:root {
  color-scheme: dark;
  --background: #222223;
  --text: #f3f2ef;
  --muted: #c2bfba;
  --rule: #494847;
  --outline: #757371;
  --link: #e6d5b4;
  --focus: #f5c977;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, sans-serif;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: .2em; }
:focus-visible, section:focus { outline: 2px solid var(--focus); outline-offset: 4px; }
p, ul { margin: 0 0 .8rem; }
p:last-child, ul:last-child { margin-bottom: 0; }
code { color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: .95em; }
section { scroll-margin-top: 1rem; }

.timer {
  width: min(26rem, 100% - 2rem);
  margin: clamp(2.25rem, 6vw, 4.35rem) auto 0;
  text-align: center;
}
h1 { margin: 0 0 1.45rem; font-size: 1.55rem; line-height: 1.2; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
#setup { text-align: left; }
.duration-label { display: block; margin-bottom: .3rem; font-size: .9rem; font-weight: 600; }
.start-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: .5rem; }
input, button { font: inherit; }
#duration, .time-input, button { min-height: 44px; border: 1px solid var(--outline); border-radius: .25rem; }
#duration, .time-input {
  width: 100%;
  padding: .45rem .75rem;
  border-color: #fff;
  background: #fff;
  color: #181818;
}
#duration[aria-invalid="true"], .time-input[aria-invalid="true"] { border-color: #dc826e; }
button { padding: .35rem .65rem; background: transparent; color: var(--text); cursor: pointer; }
button:hover:not(:disabled) { background: #333333; }
button:disabled, fieldset:disabled label { opacity: .65; cursor: default; }
.primary { border-color: #cecbc4; background: #30302f; font-weight: 650; }
.primary:hover:not(:disabled) { background: #43423f; }
.hint, .options, .message { color: var(--muted); font-size: .875rem; }
#duration-hint { margin: .55rem 0 .8rem; }
.presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem; }
.presets button { padding-inline: .2rem; font-size: .875rem; }
.options, .run-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; }
.options { align-items: center; margin-top: .75rem; }
.options > * { min-height: 44px; display: inline-flex; align-items: center; }
.sound-option { gap: .4rem; cursor: pointer; }
.sound-option input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--link); }
.rehearsal-setup { margin-top: .55rem; }
.rehearsal-option { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; }
.cue-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.rehearsal-readout { margin-top: .75rem; }
.rehearsal-readout .hint { font-variant-numeric: tabular-nums; }
.cue-phase { margin-bottom: .15rem; color: var(--link); font-weight: 650; }
.text-button { border-color: transparent; color: var(--link); font-size: inherit; }
.options a { padding-inline: .25rem; }
.message { margin: .4rem 0 .75rem; }
.message:empty { margin: 0; }
#duration-error, #cue-error { color: #ffb6a7; }
.timer-status { color: var(--text); font-weight: 600; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#readout > .hint { margin: 0; }
#countdown {
  font-size: clamp(3.1rem, 15vw, 5.4rem);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: 1.15;
  margin: .12rem 0 .3rem;
}
.run-actions { margin-top: .9rem; gap: .5rem; }
.run-actions button { min-width: 5.5rem; }

.reading, .site-footer { width: min(39rem, 100% - 2rem); margin-inline: auto; }
.reading { margin-top: clamp(3rem, 8vw, 5rem); color: var(--muted); }
.reading section { border-top: 1px solid var(--rule); padding-top: 1.15rem; margin-top: 1.4rem; }
h2, h3 { color: var(--text); line-height: 1.25; }
h2 { margin: 0 0 .55rem; font-size: 1.17rem; }
h3 { margin: 1.2rem 0 .32rem; font-size: 1rem; }
ul { padding-left: 1.25rem; }
.examples li + li { margin-top: .45rem; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  border-top: 1px solid var(--rule);
  margin-top: 1.65rem;
  padding-block: .55rem 1rem;
  font-size: .875rem;
}
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
