:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --panel: #fff;
  --panel-2: #f0f3eb;
  --line: #e3e7dc;
  --text: #27392f;
  --muted: #64705f;
  --accent: #285b45;
  --accent-2: #728441;
  --lime: #dcf5ad;
  --good: #37865b;
  --warn: #b38a30;
  --bad: #bf5d4e;
  --wave: #40765a;
  --wave-past: #adc69c;
  --beat-line: #aec0a4;
  --beat-one: #4166ad;
  --playhead: #285b45;
  --radius: 20px;
  --ease-settle: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 3px 12px #233b2903;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
summary,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
summary {
  cursor: pointer;
}
button {
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button {
  border: 0;
}
button,
a,
summary,
input,
select {
  outline-offset: 4px;
}
:focus-visible {
  outline: 3px solid #66964a;
}
[hidden] {
  display: none !important;
}
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
}
button .icon,
a .icon {
  pointer-events: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 20px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  border-radius: 9px;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: none;
}

.button {
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
  transition:
    background 140ms,
    transform 140ms;
}
.button .icon {
  width: 16px;
  height: 16px;
}
.button.primary,
button.primary {
  background: var(--accent);
  color: white;
}
.button.primary:hover,
button.primary:hover {
  background: #1d4835;
}
.button.secondary {
  color: var(--accent);
  background: white;
  border: 1px solid #d9e4cb;
}
.full-width {
  width: 100%;
}
.text-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 5px 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 550;
}
.text-link .icon {
  width: 15px;
  height: 15px;
}
.text-link:hover {
  color: #568043;
}
.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}
.control-label > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.control-label .icon {
  width: 16px;
  height: 16px;
  color: #8e9981;
}
.help-icon {
  background: none;
  color: #98a18d;
  padding: 4px;
  margin: -4px;
  display: grid;
  place-items: center;
}
.help-icon .icon {
  width: 13px;
  height: 13px;
}
#count-help-btn {
  min-width: 28px;
  min-height: 28px;
  margin: -7px -6px -7px 0;
  border-radius: 6px;
}
#count-help-btn:hover,
#count-help-btn[aria-expanded="true"] {
  background: var(--panel-2);
}
#count-help {
  position: fixed;
  z-index: 20;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 8px 28px #233b291c;
  font-size: 12px;
  line-height: 1.65;
}
#count-help > strong {
  font-size: 13px;
  font-weight: 600;
}
#count-help p,
#count-help dd {
  margin: 7px 0 0;
  color: var(--muted);
}
#count-help dl {
  margin: 15px 0;
}
#count-help dt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  font-weight: 600;
}
#count-help dd {
  margin-top: 3px;
}
#count-help .count-help-note {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.seg {
  display: flex;
  padding: 4px;
  background: #f1f4ed;
  border: 1px solid #edf0e8;
  border-radius: 8px;
  gap: 3px;
}
.seg button {
  flex: 1;
  min-height: 34px;
  border-radius: 5px;
  padding: 6px 4px;
  font-size: 12px;
  color: #637357;
  background: transparent;
  white-space: nowrap;
}
.seg button.active {
  background: white;
  color: var(--accent);
  box-shadow: 0 1px 5px #29441b0a;
  font-weight: 550;
}
.seg button:hover:not(.active) {
  background: #e3ebd8;
}
.control-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin-top: 8px;
}
.control-label kbd {
  font-size: 9px;
  padding: 1px 4px;
}
.click-control {
  border-top: 1px solid #eef0e8;
  padding-top: 17px;
  margin: 0;
  cursor: pointer;
  min-height: 39px;
}
.switch {
  appearance: none;
  width: 31px;
  height: 19px;
  border-radius: 12px;
  background: #dfe6d8;
  position: relative;
  cursor: pointer;
  transition: background 140ms;
  margin: 0;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px #0001;
  transition: transform 140ms;
}
.switch:checked {
  background: var(--accent);
}
.switch:checked::after {
  transform: translateX(12px);
}
.nudge-seg {
  margin-top: 0;
}
.nudge-seg button {
  min-height: 38px;
}
.badge {
  font-size: 10px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #637357;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge-engine {
  border-color: #deead2;
  color: #4f7641;
  background: #f2f6eb;
}
#transport {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #eef0e8;
  padding-top: 12px;
}
.play-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
}
.play-button .icon {
  width: 15px;
  height: 15px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border-radius: 8px;
  color: #637357;
}
.icon-btn:hover {
  background: #edf2e5;
  color: var(--accent);
}
.icon-btn .icon {
  width: 17px;
  height: 17px;
}
.timecode {
  font-size: 11px;
  color: #637357;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timecode #elapsed-time {
  color: #577448;
}
.time-divider {
  margin: 0 5px;
  color: #c1c9b8;
}
#song-position {
  width: 100%;
  min-width: 25px;
  accent-color: var(--accent);
  height: 32px;
  cursor: pointer;
}
.play-key {
  color: #637357;
  font-size: 8px;
  white-space: nowrap;
}
.play-key kbd {
  font-size: 8px;
}
#finish-btn {
  padding: 7px 10px;
  min-height: 33px;
  font-size: 10px;
  white-space: nowrap;
}
#progress-wrap {
  height: 24px;
  background: #edf2e5;
  border-radius: 5px;
  margin-top: 12px;
  overflow: hidden;
  position: relative;
}
#progress-bar {
  height: 100%;
  width: 0;
  background: #d5e7bb;
  transition: width 300ms;
}
#progress-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #4d6b39;
  font-size: 9px;
}
#status-line {
  font-size: 11px;
  color: #637357;
  line-height: 1.6;
  margin-top: 10px;
  min-height: 14px;
  overflow-wrap: anywhere;
}
#feedback-area {
  padding: 11px 8px 20px;
}
.meter-track {
  height: 6px;
  position: relative;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    #edddd2,
    #e6e9d2 30%,
    #ecf2e2 45%,
    #ecf2e2 55%,
    #e6e9d2 70%,
    #edddd2
  );
}
.meter-zone {
  position: absolute;
  inset: 0 auto 0 50%;
  width: var(--zone-width, 25%);
  transform: translateX(-50%);
  background: #c2d9a6;
  border-radius: 3px;
}
#meter-needle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: #557649;
  transition:
    left 80ms,
    background 80ms;
}
.meter-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #637357;
  margin-top: 10px;
}
#offset-text {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #637357;
}
.meter-tick {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  opacity: 0.8;
  animation: tickfade 1.5s ease-out forwards;
  pointer-events: none;
}
@keyframes tickfade {
  to {
    opacity: 0;
  }
}
#tapzone {
  width: 100%;
  min-height: 85px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 15px;
  border: 1px solid #dce6cb;
  border-radius: 13px;
  background: #f1f6e9;
  padding: 16px 20px;
  touch-action: none;
  user-select: none;
  transition:
    background 100ms,
    border-color 100ms;
}
#tapzone:hover {
  background: #e9f1dd;
  border-color: #bace9e;
}
#tapzone:active {
  transform: scale(0.995);
}
.tap-icon {
  background: #e2eccf;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--accent);
  display: grid;
  place-items: center;
}
#tap-hint {
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.2px;
}
#tap-hint small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #637357;
  margin-top: 6px;
  letter-spacing: 0;
}
#tap-hint kbd {
  font-size: 9px;
  border-color: #cedbbd;
  color: #5a6e4b;
  background: #f8faf4;
}
.tap-plus {
  margin-left: auto;
  color: #8ea178;
  font-size: 24px;
  font-weight: 300;
}
#tapzone.flash-good {
  background: #d7edc4;
  border-color: #80ab63;
}
#tapzone.flash-warn {
  background: #f1e9cf;
  border-color: #bd9e4d;
}
#tapzone.flash-bad {
  background: #f4ded8;
  border-color: #ce9586;
}
#tapzone[aria-disabled="true"] {
  cursor: default;
}

kbd {
  display: inline-block;
  border: 1px solid #dfe5d7;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 5px;
  font:
    500 10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: #5a6e4b;
  background: #f7f9f3;
  white-space: nowrap;
}
.guide-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #edf3e2;
  border: 1px solid #dce7cd;
  border-radius: 14px;
  padding: 17px 18px;
  margin-bottom: 22px;
}
.guide-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcebc8;
  font-size: 13px;
  color: var(--accent);
  flex: 0 0 auto;
}
.guide-copy {
  flex: 1;
}
.guide-copy .eyebrow {
  font-size: 7px;
  margin-bottom: 4px;
}
.guide-copy h2 {
  font-size: 14px;
  font-weight: 550;
}
.guide-copy p {
  font-size: 12px;
  line-height: 1.7;
  color: #637357;
  margin-top: 4px;
}
.guide-card .button {
  font-size: 10px;
  min-height: 37px;
  white-space: nowrap;
}
.guide-card .icon-btn {
  width: 24px;
  height: 28px;
}
/* Dialogs are contained, scrollable, and operable by touch or keyboard. */
dialog {
  width: min(590px, calc(100% - 32px));
  max-height: min(90dvh, 950px);
  margin: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 24px 100px #19382924;
  overflow: auto;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #213b2e66;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-size: 29px;
  font-weight: 550;
  line-height: 1.22;
  letter-spacing: -1px;
  margin: 8px 0 12px;
}
.dialog-close {
  position: absolute;
  right: 20px;
  top: 20px;
}
.dialog-intro {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 420px;
}
#source-dialog {
  width: min(625px, calc(100% - 32px));
}
#source-dialog h2 {
  font-size: 40px;
  letter-spacing: -1.5px;
}
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 25px 0;
}
.onboarding-steps > div {
  border-left: 1px solid #dbe5ce;
  padding-left: 12px;
}
.onboarding-steps span {
  display: block;
  font-size: 9px;
  color: #637357;
  margin-bottom: 6px;
}
.onboarding-steps strong {
  font-size: 13px;
  font-weight: 550;
}
.onboarding-steps p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.sample-start {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  width: 100%;
  padding: 19px 17px;
  background: var(--accent);
  color: white;
  border-radius: 13px;
}
.sample-start:hover {
  background: #204c38;
}
.sample-start > span:nth-child(2) {
  flex: 1;
}
.sample-start strong {
  font-size: 14px;
  font-weight: 550;
}
.sample-start small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #c3d5b8;
  line-height: 1.6;
  margin-top: 5px;
}
.sample-play {
  background: #d7f0aa;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.sample-play .icon {
  width: 16px;
  height: 16px;
}
.sample-start > .icon {
  width: 17px;
  height: 17px;
}
.divider-label {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #637357;
  font-size: 8px;
  letter-spacing: 1.4px;
  margin: 25px 0 17px;
}
.divider-label::before,
.divider-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
#source-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.source-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  background: #f5f7f1;
  border: 1px solid #e6ebdf;
  border-radius: 11px;
  padding: 17px 5px;
}
.source-btn > .icon {
  width: 21px;
  height: 21px;
  color: #779360;
  margin-bottom: 3px;
}
.source-btn strong {
  font-weight: 550;
  font-size: 12px;
}
.source-btn small {
  color: #637357;
  font-size: 10px;
}
.source-btn:hover {
  border-color: #b8cc9e;
  background: #edf3e3;
}
#sample-row {
  margin-top: 20px;
}
#sample-row label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
  color: #637357;
}
#sample-select {
  display: block;
  width: 100%;
  height: 43px;
  background: white;
  border: 1px solid #dce4d2;
  color: #5a6e4b;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.source-note {
  color: #637357;
  font-size: 11px;
  line-height: 1.75;
  margin-top: 17px;
}
.dialog-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  color: #637357;
  margin-top: 22px;
}
.dialog-privacy .icon {
  width: 14px;
  height: 14px;
}
.error-message {
  background: #fbede7;
  color: #995141;
  border-radius: 9px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 15px;
}
.shortcut-feature {
  display: flex;
  align-items: center;
  gap: 17px;
  background: #f0f5e8;
  border: 1px solid #e0e9d4;
  border-radius: 12px;
  margin: 22px 0;
  padding: 18px;
}
.shortcut-feature > kbd {
  font-size: 13px;
  padding: 10px 13px;
  background: white;
  color: var(--accent);
}
.shortcut-feature strong {
  font-size: 14px;
  font-weight: 550;
}
.shortcut-feature p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 5px;
}
.dialog-section-title {
  font-size: 10px;
  color: #5a6e4b;
  font-weight: 550;
  margin: 25px 0 12px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}
.keys-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}
.keys-grid kbd {
  justify-self: end;
}
.keys-grid span {
  color: #637357;
  line-height: 1.5;
}
#keys-dialog > .control-hint {
  margin-top: 27px;
}
.help-steps {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 25px 0;
}
.help-steps > div {
  display: flex;
  align-items: flex-start;
  gap: 17px;
}
.help-steps > div > span {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eaf2de;
  color: #5a6e4b;
  font-size: 11px;
}
.help-steps h3 {
  font-size: 15px;
  font-weight: 550;
  margin: 3px 0 7px;
}
.help-steps p,
.help-body p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.85;
}
.help-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.help-body {
  margin-top: 27px;
}
.help-body details {
  border-top: 1px solid var(--line);
  padding: 15px 0;
}
.help-body summary {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}
.help-body p {
  margin-top: 10px;
}
dialog .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid #edf0e7;
  font-size: 13px;
}
dialog .row > span {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
dialog .row input[type="range"] {
  width: 115px;
  accent-color: var(--accent);
}
dialog input[type="checkbox"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
}
dialog .row output {
  min-width: 68px;
  font-size: 10px;
  color: #637357;
}
dialog button:not(.button):not(.icon-btn):not(.sample-start):not(.source-btn) {
  background: #eff4e6;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 39px;
  font-size: 11px;
}
#settings-dialog > .button {
  margin-top: 21px;
}
#settings-dialog > .small {
  margin: 16px 0;
  line-height: 1.8;
}
#calib-dialog p {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 16px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 10px;
}
.big-number {
  font-size: 64px;
  text-align: center;
  font-weight: 650;
  margin: 16px 0;
}
#report-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(430px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 20px 0 0 20px;
  border-right: 0;
  z-index: 20;
  box-shadow: -20px 0 100px #19382922;
}
#report-dialog[open] {
  animation: drawer-in 180ms ease-out;
}
@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
#report-body .score-big {
  text-align: center;
  font-size: 72px;
  color: var(--accent);
  font-weight: 550;
  letter-spacing: -4px;
  margin: 26px 0 5px;
}
#report-body .score-sub {
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
  text-align: center;
  margin-bottom: 23px;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 24px;
}
.stat {
  background: #f2f6ea;
  padding: 14px;
  border-radius: 10px;
}
.stat .v {
  font-size: 17px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.stat .k {
  font-size: 9px;
  color: #637357;
  margin-top: 6px;
  line-height: 1.6;
}
#report-body h3 {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin: 17px 0 9px;
}
#report-body canvas {
  width: 100%;
  height: 90px;
  background: #f6f8f1;
  border-radius: 8px;
}
#report-body .review-btn {
  width: 100%;
  margin: 19px 0;
  line-height: 1.7;
}
#report-close {
  margin-top: 21px;
}

@media (max-width: 760px) {
  dialog {
    padding: 27px 24px;
    max-height: calc(100dvh - 32px);
    border-radius: 19px;
  }
  .dialog-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
  dialog h2 {
    font-size: 26px;
    padding-right: 15px;
  }
  #source-dialog h2 {
    font-size: 34px;
  }
  .dialog-intro {
    font-size: 11px;
  }
  .onboarding-steps {
    margin: 23px 0;
    gap: 7px;
  }
  .onboarding-steps > div {
    padding-left: 9px;
  }
  .onboarding-steps strong {
    font-size: 10px;
  }
  .onboarding-steps p {
    font-size: 9px;
  }
  .sample-start {
    padding: 16px 13px;
    gap: 10px;
  }
  .sample-start strong {
    font-size: 12px;
  }
  .sample-start small {
    font-size: 9px;
  }
  .sample-play {
    width: 32px;
    height: 32px;
  }
  .sample-start > .icon {
    display: none;
  }
  .divider-label {
    font-size: 7px;
    gap: 10px;
    letter-spacing: 1px;
  }
  #source-bar {
    gap: 6px;
  }
  .source-btn {
    padding: 15px 3px;
    gap: 7px;
  }
  .source-btn strong {
    font-size: 9px;
  }
  .source-btn small {
    font-size: 8px;
  }
  .source-btn > .icon {
    width: 20px;
    height: 20px;
  }
  #sample-select {
    font-size: 16px;
  }
  #sample-row label {
    font-size: 10px;
  }
  .source-note {
    font-size: 9px;
  }
  .dialog-privacy {
    font-size: 8px;
  }
  .shortcut-feature {
    padding: 15px;
    gap: 12px;
  }
  .shortcut-feature > kbd {
    padding: 9px;
    font-size: 10px;
  }
  .shortcut-feature strong {
    font-size: 11px;
  }
  .shortcut-feature p {
    font-size: 9px;
  }
  .keys-grid {
    font-size: 10px;
    gap: 13px 10px;
  }
  .keys-grid kbd {
    font-size: 9px;
  }
  dialog .row {
    font-size: 11px;
    flex-wrap: wrap;
    gap: 10px;
  }
  dialog .row input[type="range"] {
    width: 105px;
  }
  #report-dialog {
    border-radius: 0;
  }
}

/* The waveform is the studio: a single, wide surface on every screen. */
.app-header {
  max-width: 1440px;
  margin: auto;
  padding: 22px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: var(--lime);
}
.brand-mark .icon {
  width: 24px;
  height: 24px;
}
.brand-name {
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
}
.brand-dot {
  color: #77a358;
}
.brand-name small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 450;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-item {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.nav-item .icon {
  width: 18px;
  height: 18px;
}
.nav-item:hover {
  background: #e9eee2;
  color: var(--accent);
}
.workspace {
  max-width: 1440px;
  margin: auto;
  padding: 8px 44px 30px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.studio-card {
  min-width: 0;
  padding: 26px 30px 24px;
}
.track-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.track-info {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
#track-title {
  font-size: clamp(20px, 2.1vw, 27px);
  line-height: 1.3;
  font-weight: 550;
  letter-spacing: -0.7px;
  overflow-wrap: anywhere;
}
#new-song-btn {
  flex: 0 0 auto;
}
#new-song-btn kbd {
  margin-left: 6px;
}
.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}
#mode-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f1f4ed;
  border-radius: 10px;
}
.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.mode-btn .icon {
  width: 16px;
  height: 16px;
}
.mode-btn kbd {
  font-size: 9px;
  background: transparent;
}
.mode-btn.active {
  color: var(--accent);
  background: white;
  font-weight: 600;
  box-shadow: 0 1px 5px #27392f0a;
}
.mode-btn:hover:not(.active) {
  background: #e6eddd;
}
#count-area {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 13px;
}
#count-display {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 550;
  background: #edf3e4;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
#count-display.one {
  background: var(--accent);
  color: var(--lime);
}
#count-display.countdown {
  font-size: 19px;
}
#mode-description {
  margin: 14px 0 22px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
#stage {
  min-width: 0;
}
.waveform-wrap {
  position: relative;
  border-radius: 12px;
  background: #f7f9f3;
  overflow: hidden;
}
#waveform {
  display: block;
  width: 100%;
  height: clamp(260px, 32vh, 400px);
  touch-action: pan-y;
}
#waveform[data-seekable="true"] {
  cursor: grab;
}
#waveform.scrubbing {
  cursor: grabbing;
}
#waveform:focus-visible {
  outline-offset: -3px;
  border-radius: 12px;
}
#waveform-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(270px, calc(100% - 16px));
  padding: 10px 13px;
  border: 1px solid #d9e0d3;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 4px 18px #233b2914;
  font-size: 11px;
  line-height: 1.6;
}
#waveform-tooltip strong,
#waveform-tooltip span {
  display: block;
}
#waveform-tooltip span {
  color: var(--muted);
  margin-top: 2px;
}
#empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  background: linear-gradient(0deg, #f7f9f3d9, #f7f9f3ee);
  padding: 20px;
  text-align: center;
}
#waveform-placeholder {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}
.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
#transport {
  border: 0;
  padding: 16px 0 0;
  gap: 12px;
}
.play-button {
  width: 42px;
  height: 42px;
}
.play-button .icon {
  width: 19px;
  height: 19px;
}
#song-position {
  flex: 1;
}
.timecode {
  font-size: 12px;
}
#restart-btn {
  width: 40px;
  height: 42px;
}
#progress-wrap {
  margin-top: 16px;
}
#status-line.sr-only {
  margin: 0;
}
#count-sub {
  font-size: 11px;
  color: #826b38;
  line-height: 1.6;
  margin-top: 10px;
}
#count-sub:has(> [hidden]):not(:has(> :not([hidden]))) {
  display: none;
}
#music-count {
  margin-right: 14px;
  color: var(--muted);
}
.practice-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 32px;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#feedback-area {
  padding: 4px 0;
}
#tapzone {
  min-height: 68px;
  padding: 12px 18px;
  gap: 12px;
}
#tap-hint {
  font-size: 14px;
}
#tap-hint small {
  margin-top: 4px;
}
.tap-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}
.controls-card {
  padding: 0 20px 22px;
  min-width: 0;
}
#count-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
#practice-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}
#practice-area.controls-collapsed {
  grid-template-columns: minmax(0, 1fr) 52px;
}
#controls-toggle {
  width: 100%;
  min-height: 68px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
}
#controls-toggle:hover {
  color: var(--accent);
}
#controls-toggle .icon {
  width: 18px;
  height: 18px;
}
.controls-collapsed .controls-card {
  padding: 0;
}
.controls-collapsed #controls-toggle {
  justify-content: center;
  min-height: 52px;
}
.controls-collapsed #controls-toggle span {
  display: none;
}
.controls-collapsed #controls-toggle .icon {
  transform: rotate(180deg);
}
#count-mode-seg button,
.nudge-seg button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}
#count-controls kbd {
  font-size: 10px;
  min-width: 20px;
  padding: 2px 4px;
}
.nudge-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.control-group {
  min-width: 0;
}
.control-label {
  margin-bottom: 10px;
}
.metronome-control {
  padding-top: 0;
}
.click-control {
  padding: 0;
  border: 0;
  min-height: 40px;
}
.eyebrow {
  display: block;
  color: #5a6e4b;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.7px;
  line-height: 1.6;
}
body[data-live="true"] #elapsed-time,
body[data-live="true"] .time-divider {
  display: none;
}
#report-dialog {
  padding-bottom: calc(34px + env(safe-area-inset-bottom));
}

@media (max-width: 1100px) {
  .app-header {
    padding: 18px 28px;
  }
  .workspace {
    padding: 6px 28px 26px;
  }
  .studio-card {
    padding: 24px;
  }
  .mode-btn {
    padding: 10px 13px;
  }
  .mode-btn kbd {
    display: none;
  }
  .controls-card {
    padding: 0 18px 20px;
  }
  #count-controls {
    gap: 22px;
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (min-width: 1000px) and (max-width: 1200px) {
  .practice-actions {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
  }
  #transport .play-key {
    display: none;
  }
}
@media (max-width: 999px) {
  #practice-area,
  #practice-area.controls-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  .controls-collapsed .controls-card {
    padding: 0 20px;
  }
  .controls-collapsed #controls-toggle {
    justify-content: space-between;
  }
  .controls-collapsed #controls-toggle span {
    display: inline;
  }
  #controls-toggle .icon {
    transform: rotate(-90deg);
  }
  .controls-collapsed #controls-toggle .icon {
    transform: rotate(90deg);
  }
}
@media (max-width: 760px) {
  .app-header {
    padding: max(13px, env(safe-area-inset-top)) 20px 12px;
    gap: 12px;
  }
  .brand {
    gap: 8px;
  }
  .brand-name {
    font-size: 26px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .main-nav {
    gap: 0;
  }
  .nav-item {
    width: 40px;
    min-height: 42px;
    padding: 10px;
  }
  .nav-item span,
  .desktop-hint {
    display: none !important;
  }
  .workspace {
    padding: 4px 8px calc(24px + env(safe-area-inset-bottom));
  }
  .studio-card {
    padding: 18px 16px 16px;
    border-radius: 17px;
  }
  .track-heading {
    align-items: flex-start;
    gap: 12px;
  }
  #track-title {
    font-size: 18px;
    letter-spacing: -0.4px;
  }
  #new-song-btn {
    min-height: 40px;
    padding: 10px;
  }
  #new-song-btn span {
    display: none;
  }
  #new-song-btn .icon {
    width: 19px;
    height: 19px;
  }
  .studio-toolbar {
    gap: 10px;
    margin-top: 18px;
  }
  #mode-bar {
    flex: 1;
    min-width: 0;
  }
  .mode-btn .icon {
    display: none;
  }
  .mode-btn {
    flex: 1;
    padding: 10px 8px;
    min-height: 40px;
    font-size: 12px;
    gap: 7px;
  }
  #count-area {
    justify-content: center;
    gap: 12px;
  }
  #count-display {
    width: 35px;
    height: 35px;
    font-size: 23px;
    border-radius: 9px;
  }
  #mode-description {
    text-align: center;
    font-size: 11px;
    margin: 11px 0 16px;
  }
  .badge {
    padding: 3px 5px;
    font-size: 10px;
  }
  .waveform-wrap {
    margin-inline: -12px;
  }
  #waveform {
    height: 240px;
  }
  #waveform-placeholder {
    font-size: 13px;
  }
  .empty-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .empty-actions .button {
    font-size: 12px;
  }
  .practice-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    padding-top: 16px;
    margin-top: 16px;
  }
  .meter-labels {
    font-size: 10px;
  }
  #transport #tapzone {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    padding: 8px 10px;
    gap: 7px;
    justify-content: center;
  }
  #transport .tap-icon { width: 22px; height: 22px; }
  #transport #tap-hint { font-size: 12px; white-space: nowrap; }
  #transport #tap-hint small { display: none; }
  #tap-hint {
    font-size: 14px;
  }
  #tap-hint small {
    font-size: 11px;
  }
  #transport {
    gap: 8px;
  }
  .timecode {
    font-size: 10px;
  }
  #song-position {
    min-width: 25px;
  }
  #restart-btn {
    width: 34px;
  }
  #finish-btn {
    padding: 10px 11px;
  }
  #finish-btn .icon {
    display: none;
  }
  body[data-ready="true"] {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  body[data-ready="true"] #transport {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 8;
    background: #ffffffef;
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .controls-card {
    padding: 0 20px 22px;
  }
  #count-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .seg button {
    min-height: 40px;
  }
  .metronome-control {
    padding: 0;
  }
  .control-label {
    font-size: 12px;
  }
  .switch {
    width: 36px;
    height: 22px;
  }
  .switch::after {
    width: 16px;
    height: 16px;
  }
  .switch:checked::after {
    transform: translateX(14px);
  }
  .guide-card {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 10px;
    padding: 15px;
    margin-bottom: 14px;
  }
  .guide-number {
    width: 30px;
    height: 30px;
    font-size: 11px;
    align-self: start;
  }
  .guide-copy h2 {
    font-size: 13px;
  }
  .guide-copy p {
    font-size: 12px;
  }
  #guide-dismiss {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }
  #guide-next {
    grid-column: 2;
    width: fit-content;
    padding: 9px 12px;
    min-height: 40px;
  }
  .dialog-intro {
    font-size: 13px;
  }
  .onboarding-steps strong {
    font-size: 12px;
  }
  .onboarding-steps p {
    font-size: 10px;
  }
  .sample-start strong {
    font-size: 13px;
  }
  .sample-start small {
    font-size: 11px;
  }
  .source-btn strong {
    font-size: 11px;
  }
  .source-btn small {
    font-size: 9px;
  }
  .source-note {
    font-size: 11px;
  }
  .dialog-privacy {
    font-size: 10px;
  }
  .keys-grid {
    font-size: 12px;
  }
  .shortcut-feature strong {
    font-size: 13px;
  }
  .shortcut-feature p {
    font-size: 11px;
  }
  dialog .row {
    font-size: 13px;
  }
}
@media (max-width: 370px) {
  .app-header {
    padding-left: 14px;
    padding-right: 12px;
  }
  .brand-name {
    font-size: 24px;
  }
  .nav-item {
    width: 36px;
  }
  .studio-card {
    padding-left: 12px;
    padding-right: 12px;
  }
  #count-area {
    gap: 9px;
  }
  .waveform-wrap {
    margin-inline: -8px;
  }
  #waveform {
    height: 220px;
  }
  .mode-btn {
    gap: 5px;
  }
  dialog {
    padding: 26px 19px;
  }
}
@media (min-width: 761px) and (max-height: 800px) {
  .app-header {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .studio-card {
    padding-top: 20px;
    padding-bottom: 18px;
  }
  .studio-toolbar {
    margin-top: 18px;
  }
  #mode-description {
    margin-bottom: 14px;
  }
  #waveform {
    height: 250px;
  }
  .practice-actions {
    margin-top: 15px;
    padding-top: 15px;
  }
}
/* A shared, quiet response to pointer and keyboard interaction. */
button:not(:disabled) {
  transition: background-color 180ms var(--ease-settle),
    border-color 180ms var(--ease-settle), color 180ms var(--ease-settle),
    box-shadow 200ms var(--ease-settle), transform 180ms var(--ease-settle);
}
button:not(:disabled):not([aria-disabled="true"]):active {
  transform: translateY(1px) scale(.98);
  transition-duration: 60ms;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button:not(:disabled):hover,
  .play-button:not(:disabled):hover,
  .source-btn:not(:disabled):hover,
  .sample-start:not(:disabled):hover {
    transform: translateY(-1px);
  }
}
#count-display {
  transition: background-color 180ms ease-out, color 180ms ease-out;
}
#controls-toggle .icon {
  transition: transform 240ms var(--ease-settle);
}
#count-controls:not([hidden]),
#guide-card:not([hidden]),
dialog[open] {
  animation: surface-enter 200ms var(--ease-settle);
}
@keyframes surface-enter {
  from { opacity: .6; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#waveform-tooltip:not([hidden]),
#count-help:not([hidden]) {
  animation: surface-enter 150ms var(--ease-settle);
}
#song-position::-webkit-slider-thumb {
  transition: transform 160ms var(--ease-settle), box-shadow 160ms ease-out;
}
#song-position:active::-webkit-slider-thumb {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px #285b4515;
}
#song-position::-moz-range-thumb {
  transition: transform 160ms var(--ease-settle), box-shadow 160ms ease-out;
}
#song-position:active::-moz-range-thumb {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px #285b4515;
}
#tapzone.flash-neutral {
  background: #e5ece6;
  border-color: #aec2b4;
}

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

/* Test mode defers accuracy, while keeping a clear, stable meter in place. */
body[data-mode="test"] .meter-track {
  background: var(--line);
}
body[data-mode="test"] .meter-zone,
body[data-mode="test"] #meter-needle,
body[data-mode="test"] .meter-tick,
body[data-mode="test"] .meter-labels > span:not(#offset-text) {
  visibility: hidden;
}

/* The timeline belongs to the music; the mobile footer stays within thumb reach. */
.waveform-timeline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 6px;
  min-height: 34px;
}
.waveform-timeline .timecode { font-size: 10px; }
.waveform-timeline #song-position { min-width: 0; height: 28px; margin: 0; }
#finish-btn { margin-left: auto; }

.waveform-timeline #song-position { appearance: none; background: transparent; }
#song-position::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--position, 0%), var(--line) var(--position, 0%));
}
#song-position::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
#song-position::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line); }
#song-position::-moz-range-progress { height: 3px; background: var(--accent); }
#song-position::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); }
