:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1c1b19;
  background: #faf9f6;
  --muted: #69655f;
  --line: #e9e4dc;
  --accent: #a94317;
  --row-columns: minmax(150px, 1fr) 84px 110px 208px 148px;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; }
button, input, select { font: inherit; color: inherit; }
button, input, select, summary {
  min-height: 40px;
  border: 1px solid #d9d3ca;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: #fff;
}
button, summary { cursor: pointer; }
button:hover:not(:disabled), summary:hover { background: #fff4ec; border-color: #c98b6d; }
button:disabled, input:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #f06427; outline-offset: 2px; }
.container { width: min(calc(100% - 2rem), 1120px); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.2rem; border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 76px; height: auto; mix-blend-mode: multiply; }
.masthead nav a { display: inline-flex; align-items: center; min-height: 44px; }
.masthead nav a:hover { text-decoration: underline; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
nav { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; }
nav a { text-decoration: none; }
main { padding-block: 1rem 2rem; }
h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2rem); letter-spacing: -0.05em; }
h2 { margin: 0; font-size: 1.1rem; }
.eyebrow { margin: 0 0 0.3rem; color: var(--accent); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.intro { margin: 0.25rem 0 0.7rem; color: var(--muted); font-size: 0.85rem; }
.page-heading > .eyebrow { display: none; }
.panel { min-width: 0; padding: 0.8rem; background: #fff; border: 1px solid var(--line); border-radius: 0.7rem; }
.session {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto minmax(140px, 1fr) auto auto; align-items: center; gap: 0.4rem 1rem;
  border-top: 3px solid var(--accent); box-shadow: 0 4px 14px rgb(28 27 25 / 7%);
}
.timer { min-width: 3em; color: #8d3714; font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -0.06em; line-height: 1; text-align: center; }
.session-copy { min-width: 0; }
.session-copy h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-copy .hint { margin: 0.25rem 0 0.4rem; }
.session-controls { display: flex; }
.session-controls button { font-size: 0.8rem; }
.session-preferences { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; }
.session-preferences .check-row { min-height: 28px; font-size: 0.72rem; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
button.primary:hover:not(:disabled) { background: #863410; color: #fff; }
.session[data-urgency="warn"] { background: #fff8d9; border-top-color: #b77e00; }
.session[data-urgency="warn"] .timer { color: #755400; }
.session[data-urgency="urgent"] { background: #fde6e3; border-top-color: #b83131; }
.session[data-urgency="urgent"] .timer { color: #922f32; }
.live-tempo { display: flex; gap: 0.35rem; align-items: center; font-size: 0.75rem; }
.live-tempo button, .live-tempo input { min-height: 32px; padding: 0.25rem 0.45rem; }
.live-tempo input { width: 65px; }
.session-metronome { display: grid; gap: 0.35rem; min-width: 0; }
.beat-display { margin: 0; }
.beat-leds { display: flex; flex-wrap: wrap; gap: 5px; }
.beat-led { width: 10px; height: 10px; border: 1px solid #c6c0b8; border-radius: 50%; background: #e9e4dc; }
.beat-led.is-accent { border-color: var(--accent); }
.beat-led.is-active { background: #27824c; border-color: #1f653b; box-shadow: 0 0 5px #27824c80; }
.beat-led.is-active.is-accent { background: #d85b20; border-color: var(--accent); box-shadow: 0 0 5px #d85b2080; }
.beat-readout { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
button[aria-pressed="true"] { color: #863410; background: #fff0e5; border-color: #c98b6d; }
.status { margin: 0.5rem 0; font-size: 0.82rem; color: var(--muted); }
.status:not([data-error="true"]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
[data-error="true"], .danger, .field-error { color: #a52820; }
.routine-panel { margin-top: 0.75rem; }
.routine-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.routine-picker { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.routine-picker select { width: 240px; max-width: 100%; min-width: 0; font-weight: 700; }
label { font-size: 0.78rem; font-weight: 650; }
summary { font-size: 0.82rem; font-weight: 650; }
.check-row { display: flex; align-items: center; gap: 0.4rem; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: var(--accent); }
.routine-name { width: 240px; min-width: 0; font-weight: 700; }
.exercise-heading { padding-block: 0.45rem; }
.workout-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem; }
.workout-progress button, .routine-actions button, .routine-picker button { font-size: 0.75rem; }
.workout-progress button { min-height: 32px; padding-block: 0.25rem; }
.routine-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#backupStatus { margin: 0.4rem 0 0; }
#backupStatus:empty { margin: 0; }
.hint { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.column-headings { display: grid; grid-template-columns: var(--row-columns); gap: 0.6rem; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; }
.exercise-list { list-style: none; padding: 0; margin: 0; }
.exercise-item { position: relative; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; min-width: 0; scroll-margin-top: 180px; }
.exercise-item:has(.metronome-settings[open]), .exercise-item:has(.row-menu[open]) { z-index: 3; }
.exercise-item[data-state="running"] { border-left-color: var(--accent); background: #fff8f2; }
.exercise-item[data-state="paused"] { border-left-color: #bd8900; background: #fffdf1; }
.exercise-item[data-state="complete"] { border-left-color: #44825c; background: #f5faf6; }
.exercise-grid { display: grid; grid-template-columns: var(--row-columns); align-items: center; gap: 0.6rem; }
.row-field { display: grid; gap: 0.3rem; min-width: 0; }
.row-field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.row-field input { width: 100%; min-width: 0; border-color: transparent; background: transparent; }
.row-field input:hover, .row-field input:focus { border-color: #d9d3ca; background: #fff; }
.description-input { font-weight: 650; }
.row-progress { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.set-values { display: flex; align-items: center; gap: 0.25rem; }
.set-values input { width: 55px; }
.set-values .row-progress { white-space: nowrap; }
.tempo-inputs, .exercise-actions { display: flex; gap: 0.25rem; align-items: center; }
.tempo-inputs input { width: 70px; }
.tempo-inputs span { font-size: 0.7rem; color: var(--muted); }
.tempo-toggle { min-width: 38px; padding-inline: 0.4rem; font-size: 0.72rem; }
.exercise-actions button, .row-menu summary { width: 34px; min-height: 36px; padding: 0.25rem; text-align: center; }
.exercise-actions button { font-size: 1rem; }
.row-menu { position: relative; }
.row-menu summary { list-style: none; font-size: 1rem; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu[open] { z-index: 2; }
.menu-body { position: absolute; right: calc(100% + 8px); top: 0; width: 180px; display: grid; gap: 0.25rem; padding: 0.4rem; background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; box-shadow: 0 6px 20px #0002; }
.menu-body button { width: 100%; font-size: 0.8rem; text-align: left; }
.metronome-settings { position: relative; font-size: 0.75rem; }
.metronome-settings summary { width: 32px; min-height: 36px; padding: 0.35rem; list-style: none; text-align: center; font-size: 1rem; }
.metronome-settings summary::-webkit-details-marker { display: none; }
.settings-fields { position: absolute; z-index: 4; right: 0; top: 42px; width: 270px; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.6rem; background: #fff; box-shadow: 0 6px 20px #0002; }
.settings-fields label:last-child { grid-column: 1 / -1; }
.settings-fields label { display: grid; gap: 0.25rem; }
.settings-fields input[type="range"] { width: 130px; padding: 0; }
.field-error { margin: 0.4rem 0 0; font-size: 0.78rem; }
[aria-invalid="true"] { border-color: #a52820; }
.add-row { display: block; margin: 0.85rem auto 0; width: 42px; height: 42px; padding: 0; border-style: dashed; color: var(--accent); font-size: 1.8rem; line-height: 1; }
.empty-list { padding: 1.3rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 0.6rem; font-size: 0.85rem; }
.planner-help { margin-top: 0.5rem; }
.planner-help > summary { width: fit-content; min-height: 28px; padding: 0.2rem 0; border: 0; background: transparent; color: var(--muted); font-size: 0.72rem; }
.practice-guide { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 2rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.practice-guide h2 { font-size: 1.6rem; letter-spacing: -0.04em; }
.practice-guide h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.practice-guide p, .practice-guide li { color: var(--muted); font-size: 0.87rem; line-height: 1.65; }
.practice-guide p { margin: 0.6rem 0 1rem; }
.practice-guide ol { margin: 0 0 1.5rem; padding-left: 1.3rem; }
.practice-guide li + li { margin-top: 0.65rem; }
.practice-guide strong { color: #1c1b19; }
footer { padding-block: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.footer-inner { flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }
@media (max-width: 950px) {
  :root { --row-columns: minmax(120px, 1fr) 75px 95px 186px 148px; }
  .exercise-grid, .column-headings { gap: 0.4rem; }
  .tempo-inputs span { display: none; }
}
@media (max-width: 860px) {
  .practice-guide { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; margin-top: 1.5rem; }
  .column-headings { display: none; }
  .exercise-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.7fr); gap: 0.65rem; }
  .tempo-inputs span { display: none; }
  .row-field:first-child { grid-column: 1 / -1; }
  .row-field > label { position: static; width: auto; height: auto; clip-path: none; font-size: 0.7rem; color: var(--muted); }
  .exercise-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .exercise-actions button, .row-menu summary { width: 40px; min-height: 40px; }
  .session { gap: 0.6rem; }
  .timer { font-size: 3.5rem; min-width: 2.9em; }
  .session-controls { justify-content: flex-end; }
  .session { grid-template-columns: auto minmax(0, 1fr); }
  .session-metronome { grid-column: 1; grid-row: 2; }
  .session-preferences { grid-column: 1 / -1; }
  .session-copy h2 { font-size: 0.95rem; }
  .session-preferences { gap: 0.15rem 1rem; }
  .exercise-item { scroll-margin-top: 260px; padding-block: 0.65rem; }
  .exercise-grid > .row-field:first-child { grid-column: 1 / -1; }
  .exercise-grid > .row-field:first-child > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .row-field input { border-color: var(--line); background: #fff; }
  .exercise-grid { align-items: start; }
  .tempo-inputs input { width: 58px; }
  .tempo-toggle { min-width: 32px; }
  .exercise-item .metronome-settings { position: absolute; right: 184px; bottom: 0.65rem; }
  .metronome-settings summary { min-height: 40px; width: 36px; }
  .metronome-settings .settings-fields { top: 46px; right: -180px; }
  .settings-fields { right: 0; width: min(270px, calc(100vw - 3rem)); }
  .tempo-inputs { flex-wrap: wrap; }
}
@media (max-width: 440px) {
  .container { width: calc(100% - 1rem); }
  nav { justify-content: flex-end; gap: 0.5rem; }
  .panel { padding: 0.7rem; }
  .routine-picker { width: 100%; }
  .routine-picker select { flex: 1; width: 0; }
  .routine-name { flex: 1; width: 0; }
  .routine-picker { flex-wrap: wrap; gap: 0.35rem; }
  .routine-picker > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .timer { font-size: 2.6rem; }
  .session-copy .eyebrow { font-size: 0.62rem; }
  .live-tempo { gap: 0.25rem; }
  .live-tempo button { font-size: 0.7rem; }
  .live-tempo label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .live-tempo input { width: 58px; }
  .session-preferences .check-row { font-size: 0.68rem; }
  .session-preferences { gap: 0.1rem 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
