:root {
  color-scheme: light;
  --ink: #102235;
  --muted: #627086;
  --line: rgba(28, 91, 112, 0.16);
  --panel: rgba(255, 255, 255, 0.9);
  --accent: #187d8b;
  --blue: #2f7df6;
  --green: #31bf78;
  --yellow: #f5b741;
  --red: #e2604f;
  --paper: #eef8fb;
  --shadow: 0 22px 60px rgba(16, 34, 53, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 10%, rgba(100, 214, 231, 0.36), transparent 34%),
    radial-gradient(circle at 80% 0%, rgba(81, 136, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #f7fbfc 0%, #eef8fb 54%, #eaf3ff 100%);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c8d4, #1975f0);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(25, 117, 240, 0.22);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent);
  box-shadow: none;
}

.page-shell {
  display: grid;
  gap: 18px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: grid;
  gap: 10px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero a {
  width: fit-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(24, 125, 139, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 13px;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.hero p {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 82px);
  line-height: 0.98;
}

.hero span {
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 800;
  line-height: 1.45;
}

.setup-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.05fr) minmax(220px, 0.72fr) minmax(220px, 0.72fr);
  gap: 14px;
}

.file-card,
.score-source-card,
.connect-card,
.bpm-card,
.range-card,
.action-card,
.stage-card,
.mini-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.file-card,
.score-source-card,
.connect-card,
.bpm-card,
.range-card,
.action-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.file-card {
  position: relative;
  cursor: pointer;
}

.score-source-card {
  grid-column: span 2;
}

.score-source-card strong {
  color: var(--ink);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.2;
}

.score-source-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.library-picker {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.78fr) minmax(0, 0.78fr) minmax(0, 0.82fr) minmax(86px, 0.64fr);
  gap: clamp(5px, 0.55vw, 8px);
}

.library-picker select {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(24, 125, 139, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.library-picker button,
.upload-score-button {
  min-height: 42px;
  font-size: 14px;
}

.upload-score-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-width: 150px;
  padding: 0 16px;
  border: 1px solid rgba(24, 125, 139, 0.18);
  border-radius: 14px;
  background: rgba(34, 200, 212, 0.12);
  color: var(--accent);
  font-weight: 950;
  cursor: pointer;
}

.upload-score-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-card::after {
  content: "上传";
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(34, 200, 212, 0.13);
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
}

.file-card:hover {
  border-color: rgba(47, 125, 246, 0.36);
  box-shadow: 0 22px 60px rgba(47, 125, 246, 0.18);
}

.file-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-card span,
.connect-card span,
.bpm-card span,
.range-card span,
.stage-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.file-card strong,
.connect-card strong,
.bpm-card strong,
.range-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 850;
}

.bpm-card em {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.bpm-card input,
.bpm-card select,
.range-card input {
  width: 86px;
  border: 0;
  border-bottom: 2px solid rgba(24, 125, 139, 0.28);
  background: transparent;
  color: var(--ink);
  font-size: 30px;
  font-weight: 950;
}

.bpm-card select {
  width: 100%;
  min-height: 38px;
  border-bottom: 0;
  font-size: 22px;
}

.bpm-card em input {
  width: 60px;
  font-size: 18px;
}

.range-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-card input {
  width: 72px;
  font-size: 26px;
}

.range-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 950;
}

.action-card {
  grid-template-columns: 1fr 1fr;
  align-content: center;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.stage-card {
  display: grid;
  gap: 18px;
  min-height: 560px;
  padding: 20px;
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stage-head strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.05;
}

.score-progress {
  display: grid;
  gap: 8px;
  width: min(300px, 38%);
}

.score-progress span {
  justify-self: end;
  color: var(--accent);
}

.score-progress div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 125, 139, 0.14);
}

.score-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #31bf78, #22c8d4, #2f7df6);
  transition: width 180ms ease;
}

.exit-practice-view {
  display: none;
  min-width: 136px;
  padding: 0 16px;
}

.notation-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(47, 125, 246, 0.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 250, 255, 0.72));
}

.notation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notation-head span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
}

.notation-head strong {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.notation-scroll {
  position: relative;
  height: clamp(430px, 55vh, 640px);
  overflow: auto;
  border-radius: 18px;
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px rgba(16, 34, 53, 0.08);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.staff-wrap {
  position: relative;
  min-width: 1120px;
  min-height: 390px;
  padding: 14px 18px 8px;
}

.notation-scroll.is-musicxml .staff-wrap {
  min-width: 100%;
  min-height: 100%;
  padding: 18px 24px 26px;
}

.staff-notation {
  min-height: 360px;
}

.staff-notation svg {
  width: 100%;
  min-height: 350px;
}

.notation-scroll.is-musicxml .staff-notation {
  min-height: 100%;
}

.notation-scroll.is-musicxml .staff-notation svg {
  display: block;
  width: 100%;
  max-width: 1480px;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0 auto;
}

.staff-notation .osmd-cursor,
.staff-notation .OSMDCursor,
.staff-notation [id*="cursor" i],
.staff-notation [class*="cursor" i] {
  opacity: 0 !important;
  pointer-events: none !important;
}

.staff-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  color: var(--muted);
  font-size: 24px;
  font-weight: 900;
}

.staff-cursor {
  display: none !important;
  opacity: 0 !important;
  position: absolute;
  top: 34px;
  bottom: 28px;
  left: 62px;
  width: 6px;
  border-radius: 999px;
  background: #2f7df6;
  box-shadow: 0 0 0 8px rgba(47, 125, 246, 0.12), 0 0 24px rgba(47, 125, 246, 0.42);
  transform: translateX(0);
  transition: transform 120ms linear;
  pointer-events: none;
}

.timeline-fallback {
  display: none;
}

.notation-cursor {
  display: none !important;
  opacity: 0 !important;
}

.notation-scroll.is-fallback .staff-wrap {
  display: none;
}

.notation-scroll.is-fallback .timeline-fallback {
  display: none;
}

#scoreNotation {
  display: none;
  width: max(1180px, 100%);
  height: clamp(360px, 42vh, 520px);
}

.measure-line {
  stroke: rgba(24, 125, 139, 0.34);
  stroke-width: 2.6;
}

.beat-guide-line {
  stroke: rgba(47, 125, 246, 0.12);
  stroke-width: 1.2;
}

.pitch-guide-line {
  stroke: rgba(16, 34, 53, 0.08);
  stroke-width: 1;
}

.pitch-guide-line.is-c {
  stroke: rgba(24, 125, 139, 0.18);
  stroke-width: 1.8;
}

.pitch-label {
  fill: rgba(98, 112, 134, 0.82);
  font-size: 14px;
  font-weight: 900;
}

.notation-measure-label {
  fill: #187d8b;
  font-size: 20px;
  font-weight: 950;
}

.notation-beat-label {
  fill: rgba(98, 112, 134, 0.92);
  font-size: 16px;
  font-weight: 900;
}

.notation-note {
  fill: #1b6fdc;
  stroke: rgba(16, 34, 53, 0.38);
  stroke-width: 1.8;
  transition: fill 160ms ease, transform 160ms ease;
}

.notation-note.is-active {
  fill: #ffd957;
  stroke: #7a5510;
}

.notation-note.is-ok {
  fill: #31bf78;
  stroke: #12613e;
}

.notation-note.is-review {
  fill: #f5b741;
  stroke: #895b11;
}

.notation-note.is-error {
  fill: #e2604f;
  stroke: #7e2d23;
}

.notation-note.is-played {
  fill: #22c8d4;
  stroke: #0c6471;
}

.notation-cursor {
  stroke: #2f7df6;
  stroke-width: 5.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(47, 125, 246, 0.45));
}

.notation-empty {
  fill: rgba(98, 112, 134, 0.82);
  font-size: 24px;
  font-weight: 900;
}

.note-label {
  fill: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  font-weight: 950;
  pointer-events: none;
}

.countdown-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: rgba(16, 34, 53, 0.58);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(12px);
}

.countdown-layer.is-hidden {
  display: none;
}

.countdown-layer span {
  font-size: 18px;
  font-weight: 900;
}

.countdown-layer strong {
  font-size: clamp(96px, 18vw, 220px);
  line-height: 0.9;
}

.countdown-layer em {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 22px;
  font-style: normal;
  font-weight: 850;
}

.is-performance-mode .countdown-layer {
  inset: auto 22px 22px auto;
  width: min(320px, calc(100vw - 44px));
  min-height: 160px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 24px;
  background: rgba(16, 34, 53, 0.86);
  box-shadow: 0 20px 60px rgba(16, 34, 53, 0.26);
  pointer-events: none;
}

.is-performance-mode .countdown-layer strong {
  font-size: clamp(58px, 8vw, 110px);
}

.is-performance-mode .countdown-layer em {
  font-size: 16px;
}

.score-lane {
  display: none !important;
  align-items: stretch;
  gap: 12px;
  min-height: 270px;
  overflow-x: auto;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.54)),
    repeating-linear-gradient(90deg, rgba(47, 125, 246, 0.08) 0 1px, transparent 1px 68px);
  -webkit-overflow-scrolling: touch;
}

.score-event {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  flex: 0 0 clamp(128px, 16vw, 190px);
  min-height: 210px;
  padding: 18px 14px;
  border: 2px solid rgba(24, 125, 139, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8e8, #f0ddaa);
  color: #543c17;
  text-align: center;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.score-event small {
  color: rgba(84, 60, 23, 0.72);
  font-weight: 900;
}

.score-event strong {
  font-size: 25px;
}

.score-event span {
  color: rgba(84, 60, 23, 0.78);
  font-size: 13px;
  font-weight: 900;
}

.score-event.is-active {
  border-color: rgba(47, 125, 246, 0.78);
  background: linear-gradient(180deg, #fffad4, #ffd957);
  box-shadow: 0 0 0 7px rgba(47, 125, 246, 0.14), 0 20px 50px rgba(47, 125, 246, 0.22);
  transform: translateY(-6px);
}

.score-event.is-ok {
  border-color: rgba(49, 191, 120, 0.78);
  background: linear-gradient(180deg, #e9ffe7, #a9e99d);
}

.score-event.is-review {
  border-color: rgba(245, 183, 65, 0.82);
  background: linear-gradient(180deg, #fff4dc, #ffca72);
}

.score-event.is-error {
  border-color: rgba(226, 96, 79, 0.82);
  background: linear-gradient(180deg, #ffe9e5, #ff9b8c);
}

.feedback-board {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 18px;
  border-radius: 20px;
  background: #102235;
  color: #fff;
}

.feedback-main {
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 950;
  line-height: 1.12;
}

.feedback-sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.mini-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.mini-panel h2 {
  margin: 0;
  font-size: 20px;
}

.mini-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.live-keys {
  min-height: 72px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(47, 125, 246, 0.1);
  color: var(--blue);
  font-size: 30px;
  font-weight: 950;
}

.recent-notes {
  display: grid;
  gap: 6px;
  max-height: 168px;
  overflow: auto;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.stats-grid div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(24, 125, 139, 0.08);
  text-align: center;
}

.stats-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stats-grid dd {
  margin: 0;
  color: var(--accent);
  font-size: 28px;
  font-weight: 950;
}

.route-events {
  display: grid;
  gap: 8px;
  max-height: 150px;
  overflow: auto;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.route-events li:first-child {
  color: var(--accent);
}

.result-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(16, 34, 53, 0.58);
  backdrop-filter: blur(12px);
}

.result-layer.is-hidden {
  display: none;
}

.result-card {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: auto;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(24, 125, 139, 0.18);
  border-radius: 28px;
  background: linear-gradient(180deg, #fffdf4, #f6fbfd);
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(16, 34, 53, 0.28);
}

.result-card > span {
  display: inline-grid;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(24, 125, 139, 0.1);
  color: var(--accent);
  font-weight: 950;
}

.result-card h2 {
  margin: 0 0 10px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
}

.result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
}

.result-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.result-body section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(24, 125, 139, 0.14);
}

.priority-section {
  align-content: start;
}

.result-body h3 {
  margin: 0;
  color: var(--accent);
  font-size: 20px;
}

.report-category {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(238, 248, 251, 0.72);
}

.report-category h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.result-body ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.result-body li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.result-body li button {
  min-height: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(47, 125, 246, 0.1);
  color: var(--blue);
  font-size: 13px;
}

.secondary-detail-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(24, 125, 139, 0.16);
}

.secondary-detail-panel p {
  font-size: 14px;
  line-height: 1.45;
}

.secondary-detail-list {
  gap: 6px;
}

.secondary-detail-item {
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
}

.secondary-detail-item span {
  font-size: 14px;
}

.issue-playback-card {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(35, 150, 156, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.issue-playback-card summary {
  cursor: pointer;
  color: var(--accent);
}

.issue-score-spot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.issue-score-spot span {
  color: var(--muted);
}

.issue-score-spot strong,
.issue-score-spot em {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 93, 93, 0.12);
  color: #a32929;
  font-style: normal;
}

.issue-playback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.result-body .issue-playback-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(35, 150, 156, 0.12);
  color: var(--accent);
  font-size: 13px;
}

.issue-playback-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

body.is-performance-mode {
  overflow-x: hidden;
  overflow-y: auto;
}

.is-performance-mode .page-shell {
  width: 100vw;
  max-width: none;
  min-height: auto;
  padding: 12px 14px 24px;
}

.is-performance-mode .hero,
.is-performance-mode .setup-panel,
.is-performance-mode .side-panel,
.is-performance-mode .score-lane {
  display: none;
}

.is-performance-mode .practice-grid {
  grid-template-columns: 1fr;
  min-height: auto;
}

.is-performance-mode .stage-card {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: auto;
  padding: 12px;
}

.is-performance-mode .stage-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 28vw) auto;
  align-items: center;
  min-height: 0;
  padding: 6px 8px;
}

.is-performance-mode .stage-head > div:first-child {
  min-width: 0;
}

.is-performance-mode .stage-head strong {
  font-size: clamp(22px, 2.4vw, 36px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.is-performance-mode .score-progress {
  width: 100%;
}

.is-performance-mode .exit-practice-view {
  display: inline-grid;
  place-items: center;
}

.practice-control-bar {
  display: none;
}

.is-performance-mode .practice-control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(24, 125, 139, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(236, 252, 255, 0.96), rgba(255, 255, 255, 0.92));
  box-shadow: 0 16px 34px rgba(24, 125, 139, 0.12);
}

.practice-control-bar span {
  display: block;
  color: #187d8b;
  font-size: 14px;
  font-weight: 950;
}

.practice-control-bar strong {
  display: block;
  margin-top: 2px;
  color: #102235;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.15;
}

.practice-control-bar button {
  flex: 0 0 auto;
  min-width: 180px;
  min-height: 58px;
  font-size: 22px;
}

.is-performance-mode .notation-panel {
  min-height: 0;
  padding: 12px;
}

.is-performance-mode .notation-scroll {
  height: clamp(340px, 54vh, 620px);
  min-height: 300px;
}

.is-performance-mode .notation-scroll.is-musicxml .staff-wrap {
  width: 100%;
  min-height: 0;
  padding: 10px 14px 20px;
}

.is-performance-mode .notation-scroll.is-musicxml .staff-notation {
  display: flex;
  justify-content: center;
  min-height: 0;
}

.is-performance-mode .notation-scroll.is-musicxml .staff-notation svg {
  display: block;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
}

.is-performance-mode .feedback-board {
  min-height: 82px;
  grid-template-columns: minmax(220px, 0.38fr) 1fr;
  align-items: center;
  padding: 14px 18px;
}

.is-performance-mode .feedback-main {
  font-size: clamp(22px, 2.6vw, 38px);
}

.is-performance-mode .feedback-sub {
  font-size: clamp(15px, 1.5vw, 20px);
}

@media (max-width: 980px) {
  .page-shell {
    padding: 16px;
  }

  .setup-panel,
  .practice-grid {
    grid-template-columns: 1fr;
  }

  .score-source-card {
    grid-column: 1 / -1;
  }

  .library-picker {
    grid-template-columns: 1fr;
  }

  .stage-card {
    min-height: auto;
  }

  .score-progress {
    width: 100%;
  }

  .is-performance-mode .page-shell {
    padding: 10px;
  }

  .is-performance-mode .stage-head {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .is-performance-mode .score-progress {
    width: 100%;
  }

  .is-performance-mode .exit-practice-view {
    justify-self: start;
  }

  .is-performance-mode .notation-scroll {
    height: clamp(300px, 50vh, 560px);
    min-height: 280px;
  }

  .is-performance-mode .feedback-board {
    grid-template-columns: 1fr;
  }

  .result-body {
    grid-template-columns: 1fr;
  }
}

html[lang="en"] .page-shell {
  width: min(1500px, 100%);
}

html[lang="en"] .setup-panel {
  grid-template-columns:
    minmax(240px, 1.12fr)
    minmax(250px, 1.08fr)
    minmax(210px, 0.72fr)
    minmax(180px, 0.58fr);
  gap: 12px;
}

html[lang="en"] .file-card,
html[lang="en"] .connect-card,
html[lang="en"] .bpm-card,
html[lang="en"] .range-card,
html[lang="en"] .action-card,
html[lang="en"] .mini-panel {
  border-radius: 18px;
}

html[lang="en"] .file-card,
html[lang="en"] .connect-card,
html[lang="en"] .bpm-card,
html[lang="en"] .range-card,
html[lang="en"] .action-card {
  padding: 16px;
}

html[lang="en"] .file-card strong,
html[lang="en"] .connect-card strong,
html[lang="en"] .range-card strong {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: clamp(18px, 1.5vw, 22px);
}

html[lang="en"] .range-card strong {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

html[lang="en"] .range-card input {
  width: 100%;
  min-width: 0;
  font-size: clamp(15px, 1.35vw, 18px);
  text-align: center;
}

html[lang="en"] .connect-card button,
html[lang="en"] .action-card button {
  min-width: 0;
  padding-inline: 12px;
}

html[lang="en"] .practice-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
}

html[lang="en"] .mini-panel p,
html[lang="en"] .recent-notes,
html[lang="en"] .route-events {
  line-height: 1.32;
}

@media (max-width: 1180px) {
  html[lang="en"] .setup-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[lang="en"] .action-card {
    grid-column: 1 / -1;
  }
}

.family-flow {
  display: none;
}

body.family-audience {
  background: #f4fafb;
}

body.family-audience .page-shell {
  width: min(920px, 100%);
}

body.family-audience .hero {
  padding: 24px clamp(20px, 5vw, 40px);
}

body.family-audience .hero > p,
body.family-audience .hero > span {
  display: none;
}

body.family-audience .hero h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 5vw, 46px);
}

body.family-audience .family-flow {
  display: grid;
  gap: 18px;
  width: min(680px, calc(100% - 32px));
  margin: 24px auto 0;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(24, 125, 139, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 34, 53, 0.08);
}

.family-flow-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.family-flow-head > div {
  display: grid;
  gap: 5px;
}

.family-flow-head span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.family-flow-head strong {
  font-size: clamp(22px, 4vw, 30px);
}

.family-back-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(24, 125, 139, 0.22);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 22px;
}

.family-flow-track {
  height: 5px;
  overflow: hidden;
  background: #dcebed;
}

.family-flow-track i {
  display: block;
  width: 33.333%;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.family-flow > p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.5;
}

.family-flow > button:last-child {
  min-height: 52px;
  font-size: 18px;
}

body.family-audience .setup-panel {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
  min-width: 0;
  margin-top: 14px;
}

body.family-audience .setup-panel > * {
  display: none;
  min-height: 250px;
  padding: clamp(22px, 5vw, 36px);
  border-radius: 8px;
}

body.family-audience .score-source-card {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 680px;
}

body.family-audience .score-source-card > *,
body.family-audience .library-picker,
body.family-audience .library-picker > * {
  min-width: 0;
  max-width: 100%;
}

body.family-audience[data-family-step="1"] .score-source-card,
body.family-audience[data-family-step="2"] .connect-card,
body.family-audience[data-family-step="3"] .range-card {
  display: grid;
}

body.family-audience .setup-panel > * > span:first-child {
  display: none;
}

body.family-audience .library-picker {
  grid-template-columns: minmax(0, 1fr);
}

body.family-audience .library-picker select,
body.family-audience .library-picker button,
body.family-audience .upload-score-button,
body.family-audience .connect-card button {
  min-height: 50px;
  font-size: 16px;
}

body.family-audience .practice-grid {
  display: none;
  grid-template-columns: minmax(0, 1fr);
}

body.family-audience.family-stage-active .hero,
body.family-audience.family-stage-active .family-flow,
body.family-audience.family-stage-active .setup-panel {
  display: none;
}

body.family-audience.family-stage-active .practice-grid {
  display: grid;
  margin-top: 0;
}

body.family-audience .side-panel,
body.family-audience .score-lane,
body.family-audience .feedback-board,
body.family-audience .stage-head .score-progress {
  display: none;
}

body.family-audience .stage-card {
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 700px) {
  body.family-audience .page-shell {
    padding: 0;
    overflow-x: clip;
  }

  body.family-audience .hero,
  body.family-audience .family-flow,
  body.family-audience .setup-panel,
  body.family-audience .score-source-card {
    width: 100%;
    max-width: 100%;
  }

  body.family-audience .hero {
    border-radius: 0;
  }

  body.family-audience .family-flow {
    margin-top: 12px;
    padding: 18px 16px;
  }

  body.family-audience .setup-panel > * {
    min-height: 0;
    padding: 18px 14px;
  }
}
