:root {
  color-scheme: light;
  --bg: #f3f1eb;
  --surface: #fbfaf7;
  --surface-strong: #ffffff;
  --ink: #17201c;
  --muted: #747d78;
  --faint: #aeb5b1;
  --line: rgba(23, 32, 28, 0.1);
  --line-strong: rgba(23, 32, 28, 0.2);
  --accent: #2f7861;
  --accent-soft: rgba(47, 120, 97, 0.11);
  --accent-line: rgba(47, 120, 97, 0.38);
  --low: #557bb4;
  --high: #bf6d51;
  --button: #17201c;
  --button-ink: #f8f7f2;
  --celebrate: #79bfa0;
  --notation-paper: #fdfcf8;
  --notation-ink: #26312c;
  --notation-line: rgba(38, 49, 44, 0.34);
  --notation-faint: rgba(38, 49, 44, 0.16);
  --shadow: 0 14px 36px rgba(42, 48, 44, 0.07);
  --radius: 22px;
  --font:
    Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -18%, var(--accent-soft), transparent 36rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--accent-line);
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(12px + env(safe-area-inset-top))
    16px
    calc(12px + env(safe-area-inset-bottom));
}

[hidden] {
  display: none !important;
}

.topbar,
.topbar-actions,
.brand,
.listening-status,
.note-line,
.deviation-line,
.graph-heading,
.deviation-axis,
.section-label,
.reference-notes,
.note-button {
  display: flex;
  align-items: center;
}

.topbar {
  min-height: 42px;
  justify-content: space-between;
}

.brand {
  gap: 9px;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.16em;
}

.brand-mark {
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.topbar-actions {
  gap: 8px;
}

.listening-status {
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  cursor: default;
  font-family: inherit;
  font-size: 12px;
  font-weight: 620;
}

.listening-status[data-state="error"],
.listening-status[data-state="paused"] {
  cursor: pointer;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.listening-status[data-state="listening"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: breathe 2.2s ease-in-out infinite;
}

.listening-status[data-state="tone"] .status-dot {
  background: var(--high);
}

.listening-status[data-state="error"] .status-dot {
  background: var(--high);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  cursor: pointer;
}

.theme-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.mode-button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mode-button.is-active {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 2px 9px rgba(27, 34, 30, 0.07);
}

.mode-view {
  min-height: 0;
  flex: 1 0 auto;
}

.piano-panel {
  --piano-white-size: 42px;
  --piano-black-size: 25px;
  padding: clamp(16px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf9f3;
}

.piano-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.piano-heading h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  line-height: 1.1;
}

.piano-heading output {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.piano-layout {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.piano-viewport {
  position: relative;
  height: clamp(210px, 26vw, 280px);
  overflow-x: auto;
  overflow-y: hidden;
  border: 8px solid #26302b;
  border-radius: 15px;
  background: #26302b;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.piano-viewport::-webkit-scrollbar {
  display: none;
}

.piano-keys {
  position: relative;
  width: calc(52 * var(--piano-white-size));
  height: 100%;
}

.piano-key {
  position: absolute;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.piano-key-white {
  left: calc(var(--white-index) * var(--piano-white-size));
  bottom: 0;
  width: var(--piano-white-size);
  height: 100%;
  border: 1px solid #c6c9bf;
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
  background: linear-gradient(90deg, #e6e5dd, #fffefa 18% 84%, #e9e9e1);
  box-shadow: inset 0 -7px 0 rgba(62, 73, 64, 0.08);
}

.piano-key-white:hover,
.piano-key-white.is-down {
  background: linear-gradient(90deg, #cde1d4, #e2f0e6 30% 80%, #c8dece);
}

.piano-key-black {
  z-index: 1;
  left: calc(var(--black-index) * var(--piano-white-size) - var(--piano-black-size) / 2);
  top: 0;
  width: var(--piano-black-size);
  height: 62%;
  border: 1px solid #17231f;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(90deg, #19221e, #3b4b42 48%, #1b2520);
  box-shadow: 1px 5px 8px rgba(14, 25, 18, 0.25);
}

.piano-key-black:hover,
.piano-key-black.is-down {
  background: linear-gradient(90deg, #24644c, #43896a 48%, #285c47);
}

.piano-key-label {
  position: absolute;
  right: 4px;
  bottom: 10px;
  left: 4px;
  color: #7f897e;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.piano-range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.piano-range-map {
  position: relative;
  flex: 1;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.piano-range-map:active {
  cursor: grabbing;
}

.piano-map-keys {
  display: flex;
  width: 100%;
  height: 100%;
}

.piano-map-key {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #bac0b7;
  background: #f8f8f2;
}

.piano-map-key.is-c {
  background: #e1ebe0;
}

.piano-range-selection {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 12px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  background: rgba(47, 120, 97, 0.17);
  box-shadow: 0 0 0 1px #faf9f3;
  pointer-events: none;
}

@media (orientation: portrait) {
  .piano-layout {
    --piano-portrait-height: clamp(520px, 82dvh, 900px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 12px;
  }

  .piano-viewport {
    height: var(--piano-portrait-height);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .piano-keys {
    width: 100%;
    height: calc(52 * var(--piano-white-size));
  }

  .piano-key-white {
    left: 0;
    bottom: calc(var(--white-index) * var(--piano-white-size));
    width: 100%;
    height: var(--piano-white-size);
    border-radius: 0 5px 5px 0;
    background: linear-gradient(#e6e5dd, #fffefa 18% 84%, #e9e9e1);
    box-shadow: inset -7px 0 0 rgba(62, 73, 64, 0.08);
  }

  .piano-key-white:hover,
  .piano-key-white.is-down {
    background: linear-gradient(#cde1d4, #e2f0e6 30% 80%, #c8dece);
  }

  .piano-key-black {
    top: auto;
    bottom: calc(var(--black-index) * var(--piano-white-size) - var(--piano-black-size) / 2);
    left: 0;
    width: 61%;
    height: var(--piano-black-size);
    border-radius: 0 5px 5px 0;
    background: linear-gradient(#19221e, #3b4b42 48%, #1b2520);
  }

  .piano-key-black:hover,
  .piano-key-black.is-down {
    background: linear-gradient(#24644c, #43896a 48%, #285c47);
  }

  .piano-key-label {
    right: 16px;
    bottom: 0;
    left: auto;
    line-height: var(--piano-white-size);
  }

  .piano-range-wrap {
    height: var(--piano-portrait-height);
    flex-direction: column-reverse;
    gap: 6px;
  }

  .piano-range-map {
    width: 27px;
    height: auto;
    flex: 1;
  }

  .piano-map-keys {
    flex-direction: column-reverse;
  }

  .piano-map-key {
    border-top: 1px solid #bac0b7;
    border-right: 0;
  }

  .piano-range-selection {
    left: 0;
    width: 100%;
    min-width: 0;
    min-height: 12px;
    height: auto;
  }
}

.tuner-view {
  display: grid;
  grid-template-rows: auto minmax(270px, 1fr) auto;
  gap: 12px;
}

.pitch-summary {
  position: relative;
  display: grid;
  min-height: 114px;
  align-content: center;
  justify-items: center;
  padding: 2px 12px 4px;
  text-align: center;
}

.accuracy-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -56%);
  transition: opacity 220ms ease;
}

.accuracy-effect span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--celebrate);
  border-radius: 50%;
  opacity: 0;
}

.pitch-summary.is-locked .accuracy-effect {
  opacity: 1;
}

.pitch-summary.is-locked .accuracy-effect span {
  animation: accuracy-ring 1.8s ease-out infinite;
}

.pitch-summary.is-locked .accuracy-effect span:nth-child(2) {
  animation-delay: 0.6s;
}

.pitch-summary.is-locked .accuracy-effect span:nth-child(3) {
  animation-delay: 1.2s;
}

.pitch-summary.is-locked .pitch-note {
  color: var(--accent);
  text-shadow: 0 0 28px var(--accent-soft);
}

.pitch-summary.is-locked .deviation-copy::before {
  content: "✓ ";
}

.note-line {
  min-height: 72px;
  justify-content: center;
}

.pitch-note {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  font-weight: 510;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}

.pitch-letter {
  font-size: clamp(68px, 20vw, 88px);
  letter-spacing: -0.065em;
}

.pitch-octave {
  min-width: 0.6em;
  margin-top: 3px;
  margin-left: 5px;
  color: var(--muted);
  font-size: clamp(16px, 4.8vw, 21px);
  font-weight: 620;
  letter-spacing: -0.02em;
}

.deviation-line {
  min-height: 28px;
  justify-content: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.deviation-value {
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.deviation-copy {
  color: var(--muted);
  font-size: 14px;
  font-weight: 580;
}

.deviation-line[data-direction="exact"] .deviation-value {
  color: var(--accent);
}

.deviation-line[data-direction="low"] .deviation-value {
  color: var(--low);
}

.deviation-line[data-direction="high"] .deviation-value {
  color: var(--high);
}

.pitch-message {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.pitch-message:empty,
.helper-message:empty,
.score-message:empty {
  display: none;
}

.pitch-graph {
  display: grid;
  min-height: 270px;
  grid-template-rows: auto auto 1fr;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(
      circle at 50% 104%,
      var(--accent-soft),
      transparent 46%
    ),
    color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pitch-graph.is-locked {
  border-color: var(--accent-line);
  box-shadow:
    var(--shadow),
    0 0 0 1px var(--accent-soft),
    0 14px 42px color-mix(in srgb, var(--accent) 12%, transparent);
}

.section-label {
  justify-content: space-between;
}

.graph-heading h1,
.section-label h1,
.section-label h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.section-label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 580;
}

.deviation-axis {
  justify-content: space-between;
  padding: 12px 11px 8px 31px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.deviation-axis span:nth-child(2) {
  color: var(--accent);
  font-weight: 700;
}

.graph-stage {
  position: relative;
  min-height: 210px;
}

#pitchCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.time-label {
  position: absolute;
  left: 0;
  z-index: 1;
  width: 26px;
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  pointer-events: none;
}

.time-label-now {
  bottom: 7px;
  color: var(--accent);
  font-weight: 700;
}

.graph-empty {
  position: absolute;
  inset: 0 0 0 28px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.graph-empty.is-hidden {
  opacity: 0;
}

.empty-line {
  display: block;
  width: 1px;
  height: 34px;
  background: linear-gradient(transparent, var(--accent), transparent);
}

.reference-section {
  display: grid;
  gap: 8px;
}

.section-label {
  padding: 0 2px;
}

.reference-notes {
  gap: 8px;
}

.note-button {
  min-width: 0;
  height: 50px;
  flex: 1;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.note-button:active {
  transform: scale(0.975);
}

.note-button.is-current {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.note-button.is-playing {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface-strong);
}

.note-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.note-button-label {
  display: inline-flex;
  align-items: flex-start;
  line-height: 1;
}

.note-button-octave {
  margin-top: -1px;
  margin-left: 2px;
  font-size: 9px;
  font-weight: 620;
}

.score-view {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 12px;
  padding-bottom: 4px;
}

.score-library,
.score-import,
.score-player-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.score-library {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.library-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 420px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.library-search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.library-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.library-search input {
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.library-search input::placeholder {
  color: var(--muted);
}

.library-list {
  display: grid;
  gap: 7px;
}

.library-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.library-item.is-practicing {
  border-color: var(--accent-line);
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-strong));
}

.library-item.is-practicing:hover {
  background: color-mix(in srgb, var(--accent) 17%, var(--surface-strong));
}

.library-item div {
  min-width: 0;
}

.library-item-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.library-practicing {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.library-item strong,
.library-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-item strong {
  font-size: 13px;
  font-weight: 680;
}

.library-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.library-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.library-empty {
  margin: 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.score-import {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.score-import.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.score-import h1,
.score-import p {
  margin: 0;
}

.score-import > div {
  min-width: 0;
}

.score-import h1 {
  font-size: 13px;
  font-weight: 720;
}

.score-import p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
  font-weight: 680;
}

.secondary-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--button);
  color: var(--button-ink);
  font-size: 12px;
}

.score-player-panel {
  display: grid;
  gap: 18px;
  padding: 17px;
}

.score-file-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.score-file-heading > div {
  min-width: 0;
}

.score-file-heading h1,
.score-file-heading p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-file-heading h1 {
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.score-file-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.text-button {
  flex: 0 0 auto;
  padding: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
}

.live-score {
  display: grid;
  gap: 8px;
}

.score-notation {
  position: relative;
  display: block;
  min-height: 112px;
  height: 112px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-touch-callout: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--notation-paper);
  color: var(--notation-ink);
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.score-notation.has-lyrics {
  min-height: 142px;
  height: 142px;
}

.score-notation.has-timeline {
  background:
    linear-gradient(
      90deg,
      transparent calc(50% - 9px),
      var(--accent-soft) calc(50% - 9px),
      var(--accent-soft) calc(50% + 9px),
      transparent calc(50% + 9px)
    ),
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      var(--accent-line) calc(50% - 0.5px),
      var(--accent-line) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    ),
    var(--notation-paper);
}

.score-notation::-webkit-scrollbar {
  height: 3px;
}

.score-notation::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.notation-svg {
  display: block;
  max-width: none;
  overflow: visible;
}

.notation-empty {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.notation-part-name,
.notation-measure-number {
  fill: var(--muted);
  font-family: var(--font);
}

.notation-part-name {
  font-size: 10px;
  font-weight: 680;
}

.notation-measure-number {
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.notation-staff-line,
.notation-measure-line,
.notation-ledger-line,
.notation-row-separator {
  shape-rendering: geometricPrecision;
}

.notation-staff-line,
.notation-ledger-line {
  stroke: var(--notation-line);
  stroke-width: 0.8;
}

.notation-measure-line {
  stroke: var(--notation-line);
  stroke-width: 1;
}

.notation-row-separator {
  stroke: var(--line);
  stroke-width: 1;
}

.notation-clef,
.notation-clef-octave,
.notation-accidental {
  fill: var(--notation-ink);
  font-family: "Bravura", "Noto Music", "Segoe UI Symbol", serif;
}

.notation-clef {
  font-size: 34px;
}

.notation-clef-bass {
  font-size: 27px;
}

.notation-clef-octave {
  font-size: 8px;
  font-weight: 700;
}

.notation-accidental {
  font-size: 13px;
  font-weight: 600;
}

.notation-duration {
  stroke: var(--notation-faint);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.notation-note-head {
  fill: var(--notation-ink);
  stroke: var(--notation-ink);
  stroke-width: 1.2;
}

.notation-note-head.is-hollow {
  fill: var(--notation-paper);
  stroke-width: 1.5;
}

.notation-stem,
.notation-flag {
  fill: none;
  stroke: var(--notation-ink);
  stroke-width: 1.15;
  stroke-linecap: round;
}

.notation-event {
  transition: opacity 160ms ease;
}

.notation-event.is-active .notation-note-head {
  fill: var(--accent);
  stroke: var(--accent);
}

.notation-event.is-active .notation-stem,
.notation-event.is-active .notation-flag,
.notation-event.is-active .notation-duration {
  stroke: color-mix(in srgb, var(--accent) 72%, var(--notation-ink));
}

.notation-event.is-active .notation-accidental {
  fill: var(--accent);
}

.notation-lyric {
  fill: color-mix(in srgb, var(--notation-ink) 78%, var(--muted));
  font-family: var(--font);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: -0.01em;
  transition:
    fill 180ms ease,
    font-weight 180ms ease,
    opacity 180ms ease;
}

.notation-lyric.is-active {
  fill: var(--accent);
  font-weight: 740;
}

.measure-navigation {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 3px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.measure-navigation label {
  font-weight: 650;
}

.measure-navigation input {
  width: 46px;
  height: 26px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-size: 10px;
  font-weight: 680;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.measure-navigation input:focus {
  border-color: var(--accent-line);
}

.measure-navigation input:disabled {
  opacity: 0.4;
}

.measure-navigation input::-webkit-inner-spin-button {
  margin: 0;
}

.playback-core {
  position: relative;
  display: grid;
  min-height: 108px;
  place-items: center;
}

.playback-visualizer {
  position: absolute;
  inset: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1.3vw, 6px);
  pointer-events: none;
}

.visualizer-bar {
  width: 3px;
  height: 70px;
  flex: 0 0 3px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--high) 68%, var(--accent)),
    var(--accent) 48%,
    color-mix(in srgb, var(--low) 62%, var(--accent))
  );
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 16%, transparent);
  transform: scaleY(var(--visualizer-level, 0.1));
  transform-origin: center;
  transition:
    background 180ms ease,
    opacity 80ms linear;
  will-change: transform;
}

.play-button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 60px;
  height: 60px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-ink);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(31, 43, 36, 0.15);
}

.play-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.play-button .play-symbol {
  transform: translateX(2px);
}

.play-button .pause-symbol {
  display: none;
}

.play-button.is-playing .play-symbol {
  display: none;
}

.play-button.is-playing .pause-symbol {
  display: block;
}

.seek-control {
  display: grid;
  gap: 7px;
}

.seek-heading {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seek-control label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.loop-button {
  display: inline-flex;
  min-height: 28px;
  padding: 0 9px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 680;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.loop-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.loop-button.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.seek-control input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.part-mixer {
  display: grid;
  gap: 9px;
}

.part-list {
  display: grid;
  gap: 7px;
}

.part-row {
  display: grid;
  grid-template-columns:
    minmax(88px, 0.8fr)
    minmax(64px, 1fr)
    42px;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.part-toggle {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
  touch-action: manipulation;
  user-select: none;
  -webkit-touch-callout: none;
}

.part-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-toggle::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.part-toggle.is-enabled {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.part-toggle.is-enabled::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.part-toggle.is-score-source {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 3px var(--accent-line);
}

.part-volume {
  width: 100%;
  min-width: 0;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  transition: opacity 160ms ease;
}

.part-volume-value {
  color: var(--muted);
  font-size: 9px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  transition:
    color 160ms ease,
    opacity 160ms ease;
}

.part-row.is-boosted .part-volume-value {
  color: var(--accent);
}

.part-row.is-muted .part-volume,
.part-row.is-muted .part-volume-value {
  opacity: 0.52;
}

.score-message {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.score-message[data-state="error"] {
  color: var(--high);
}

.helper-message {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.helper-message[data-state="error"] {
  color: var(--high);
}

.site-footer {
  margin-top: auto;
  padding: 10px 0 2px;
  color: var(--muted);
  font-size: clamp(8.5px, 2.6vw, 9px);
  line-height: 1.55;
  text-align: center;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

@keyframes accuracy-ring {
  0% {
    opacity: 0.45;
    transform: scale(0.55);
  }
  78%,
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

@media (max-height: 730px) {
  .app-shell {
    gap: 8px;
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .tuner-view {
    grid-template-rows: auto minmax(230px, 1fr) auto;
    gap: 8px;
  }

  .pitch-summary {
    min-height: 100px;
  }

  .note-line {
    min-height: 57px;
  }

  .pitch-letter {
    font-size: 56px;
  }

  .pitch-graph {
    min-height: 230px;
    padding-top: 11px;
  }

  .note-button {
    height: 45px;
  }
}

@media (min-width: 600px) {
  .app-shell {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
