@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #101c26;
  --surface: #172630;
  --surface-raised: #1d303b;
  --surface-deep: #0c1720;
  --line: #34464f;
  --line-soft: #293c47;
  --text: #f0f1e9;
  --muted: #b6c5c8;
  --quiet: #91a6ad;
  --accent: #d6ef9b;
  --accent-dark: #14251d;
  --inner: #96cce7;
  --outer: #c5aff0;
  --danger: #ffb7a6;
  --radius: 16px;
  --clock-color: #d6ef9b;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: radial-gradient(ellipse at 87% 0, #243e3b70 0, transparent 34rem), var(--bg); color: var(--text); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
button, select { -webkit-user-select: none; user-select: none; }
button { color: inherit; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
button:disabled { cursor: not-allowed; opacity: .46; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 0; font-size: 21px; font-weight: 600; letter-spacing: -.035em; line-height: 1.25; }
h3 { margin-bottom: 8px; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
p { margin-bottom: 0; }
kbd { font-family: inherit; font-size: 12px; line-height: 1; }
svg { display: block; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
input[type="range"] { accent-color: var(--accent); height: 20px; cursor: pointer; min-width: 0; }
input[type="number"], select, textarea { color: var(--text); background: var(--surface-deep); border: 1px solid #425661; border-radius: 7px; min-width: 0; }
input[type="number"] { padding: 7px 8px; width: 100%; font-variant-numeric: tabular-nums; }
select { padding: 8px 27px 8px 10px; max-width: 100%; }
textarea { width: 100%; resize: vertical; padding: 12px; font-size: 16px; line-height: 1.6; }
textarea::placeholder { color: #92a7af; opacity: 1; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 18px; background: var(--accent); color: var(--accent-dark); border-radius: 8px; transform: translateY(-200%); font-weight: 600; }
.skip-link:focus { transform: translateY(0); }
.app-shell { max-width: 1352px; padding: 0 36px; margin: 0 auto; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 0 24px; border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 25px; font-weight: 600; letter-spacing: -.06em; line-height: 1.12; }
.brand svg { width: 31px; height: 31px; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; fill: var(--bg); }
.brand-sub { display: block; font-size: 12px; color: var(--muted); letter-spacing: .25em; font-weight: 500; margin-top: 5px; }
.header-nav { display: flex; align-items: center; gap: 25px; font-size: 14px; }
.header-nav a { text-decoration: none; color: #d1dddc;  font-size: 14px; }
.header-nav a:hover { color: var(--accent); }
.header-nav span { margin-left: 5px; color: var(--accent); }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 29px 0 25px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 650; line-height: 1.5; letter-spacing: .16em; margin: 0 0 7px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3.3vw, 43px); line-height: 1.13; font-weight: 400; letter-spacing: -.04em; margin: 0; }
.heading-note { padding-bottom: 3px; font-size: 14px; color: #e7eee7; text-align: right; white-space: nowrap; }
.heading-note span { display: block; color: var(--quiet); font-size: 12px; margin-top: 4px; }
.mode-tabs { display: flex; align-items: stretch; gap: 4px; padding: 4px; background: #0b171f; border: 1px solid var(--line-soft); border-radius: 10px; width: fit-content; max-width: 100%; margin-bottom: 22px; }
.mode-tab { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #b2c3c8; font-size: 14px; font-weight: 550; white-space: nowrap; }
.mode-tab:hover { background: #263941; color: var(--text); }
.mode-tab.is-active { background: var(--accent); color: var(--accent-dark); box-shadow: 0 1px 6px #0002; }
.mode-index { font-size: 12px; opacity: .65; font-variant-numeric: tabular-nums; }
.instrument { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 14px 32px #06101825; }
.instrument-top { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; }
.instrument-top .eyebrow { font-size: 12px; margin-bottom: 4px; }
.instrument-options { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.switch-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.volume-label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.volume-label input { width: 76px; }
.quiet-button { border: 0; background: transparent; padding: 8px 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.quiet-button:hover:not(:disabled) { color: var(--accent); }
.quiet-button kbd { padding: 3px 5px; border: 1px solid #50626b; border-radius: 4px; font-size: 12px; margin-left: 6px; color: #d3dfdf; }
.piano-keys { display: grid; gap: 11px; }
.chord-panel { margin: 0 0 20px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #0b1b2440; }
.chord-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 14px; font-weight: 650; }
.chord-heading output { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.chord-buttons { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.chord-button { --chord-color: var(--accent); display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-bottom: 3px solid var(--chord-color); border-radius: 6px; background: var(--surface); color: var(--text); text-align: left; font: inherit; font-size: 14px; cursor: pointer; user-select: none; touch-action: none; }
.chord-button[data-chord="inner"] { --chord-color: var(--inner); }
.chord-button[data-chord="outer"] { --chord-color: var(--outer); }
.chord-button[data-chord="all"] { --chord-color: #e5d475; }
.chord-button kbd { color: var(--chord-color); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }
.chord-button span { min-width: 0; font-weight: 650; }
.chord-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.chord-button[aria-pressed="true"] { background: var(--chord-color); color: #102127; border-color: var(--chord-color); }
.chord-button[aria-pressed="true"] :is(kbd,small) { color: #253a40; }
.chord-help { margin: 9px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.latch-controls { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.latch-controls button { flex-shrink: 0; font-size: 14px; }
.latch-controls span { color: var(--muted); font-size: 14px; line-height: 1.5; }
#latch-keys[aria-pressed="true"] { background: var(--accent); color: #14252b; border-color: var(--accent); }
.piano-key.is-latched::after { content: ""; position: absolute; top: 12px; right: 9px; width: 7px; height: 7px; border: 2px solid currentColor; border-radius: 50%; }
@media (max-width: 650px) {
  .chord-panel { padding: 11px; }
  .chord-buttons { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chord-button { padding: 10px; gap: 8px; }
  .latch-controls { flex-direction: column; align-items: stretch; gap: 8px; }
}
.key-row { --form-color: var(--accent); display: grid; grid-template-columns: 106px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.key-row[data-form="inner"] { --form-color: var(--inner); }
.key-row[data-form="outer"] { --form-color: var(--outer); }
.key-row-label { display: flex; flex-direction: column; justify-content: center; color: var(--form-color); font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.key-row-label small, .key-row-label > span { color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 3px; }
.key-row-label::before { content: ""; width: 16px; height: 2px; background: var(--form-color); margin-bottom: 9px; }
.key-bank { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 7px; }
.piano-key { --key-color: var(--accent); position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; min-width: 0; min-height: 102px; padding: 12px 9px 11px; text-align: left; border: 1px solid #f8f9e9; border-bottom: 5px solid #9eb285; background: linear-gradient(100deg, #ececde, #faf9ef 55%, #ecebdc); color: #14252b; border-radius: 5px 5px 7px 7px; box-shadow: 0 3px 0 #080e15, inset 0 0 0 1px #fff4; transition: transform 65ms ease, background 80ms, box-shadow 80ms; touch-action: none; user-select: none; -webkit-user-select: none; }
.piano-key[data-form="inner"] { --key-color: var(--inner); border-bottom-color: #76a7c1; }
.piano-key[data-form="outer"] { --key-color: var(--outer); border-bottom-color: #a08dc7; }
.piano-key:hover { background: #fffff7; box-shadow: 0 3px 0 #080e15, 0 0 0 1px var(--key-color); }
.piano-key.is-held, .piano-key.is-playing, .piano-key:active { transform: translateY(3px); background: var(--key-color); border-bottom-width: 2px; box-shadow: 0 0 18px color-mix(in srgb, var(--key-color), transparent 76%); }
.piano-key:focus-visible { outline-offset: 3px; outline-color: var(--key-color); }
.key-shortcut { position: absolute; top: 9px; left: 9px; width: 21px; height: 21px; display: flex; align-items: center; justify-content: center; background: #293e4810; border: 1px solid #2f455b25; border-radius: 4px; color: #45575c; font-size: 12px; font-weight: 650; }
.key-category { font-size: 14px; line-height: 1.15; letter-spacing: -.035em; font-weight: 650; max-width: 100%; overflow-wrap: anywhere; }
.key-note { font-size: 12px; color: #5b6b68; font-weight: 500; letter-spacing: .02em; }
.key-inspector { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); margin-top: 21px; padding-top: 16px; min-height: 51px; }
.inspector-mark { background: #233b3e; border: 1px solid #405451; color: var(--accent); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.key-inspector strong { font-size: 14px; font-weight: 600; }
.key-inspector p { font-size: 14px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
.key-inspector .status-chip { margin-left: auto; white-space: nowrap; }
.status-chip { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border: 1px solid #405251; color: #c5d7ca; background: #263934; border-radius: 20px; font-size: 12px; font-weight: 500; line-height: 1.4; }
.transport-bar { display: flex; gap: 22px; align-items: center; margin-top: 15px; padding: 16px 20px; background: #1e3038; border: 1px solid var(--line); border-radius: 11px; }
.transport-buttons { display: flex; align-items: center; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 7px; min-height: 42px; font-size: 14px; font-weight: 600; border: 1px solid var(--line); line-height: 1.3; }
.button.primary { background: var(--accent); color: var(--accent-dark); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #e4ffab; }
.button.secondary { background: #253a43; color: var(--text); border-color: #52656b; }
.button.secondary:hover:not(:disabled) { background: #314952; border-color: #6c878a; }
.transport-info { border-left: 1px solid #425660; padding-left: 20px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.transport-info output { color: #e1e9e5; font-size: 18px; font-weight: 450; letter-spacing: .03em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.transport-options { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.transport-options label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.transport-options select { font-size: 14px; padding: 7px 20px 7px 8px; max-width: 260px; }
.transport-options .status-chip { white-space: nowrap; }
.mixer-section { padding-top: 35px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading p:not(.eyebrow) { color: var(--muted); font-size: 16px; margin-top: 7px; }
.preset-control { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.preset-control label { color: var(--muted); font-size: 14px; }
.preset-control select { font-size: 14px; min-width: 240px; }
.clock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.clock-card { --clock-color: #d6ef9b; background: #172730; border: 1px solid #3b4d55; border-radius: 12px; padding: 17px; position: relative; overflow: hidden; min-width: 0; transition: border-color 100ms, background 100ms; }
.clock-card[data-index="1"] { --clock-color: #91cfea; }
.clock-card[data-index="2"] { --clock-color: #d3b0ee; }
.clock-card[data-index="3"] { --clock-color: #f1bf8d; }
.clock-card[data-index="4"] { --clock-color: #8fdbc6; }
.clock-card[data-index="5"] { --clock-color: #eca6b8; }
.clock-card::before { content: ""; position: absolute; left: 0; top: 19px; height: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--clock-color); }
.clock-card.is-ticking { border-color: var(--clock-color); background: #233b43; }
.clock-header { display: flex; align-items: center; gap: 8px; min-height: 20px; margin-bottom: 17px; }
.clock-header input { accent-color: var(--clock-color); }
.clock-header h3, .clock-enable > span { color: var(--clock-color); margin: 0; font-size: 14px; font-weight: 600; }
.clock-header label { display: flex; align-items: center; gap: 8px; }
.clock-state { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.clock-ring { width: 40px; height: 40px; color: var(--clock-color); }
.clock-progress { height: 3px; margin-top: 4px; overflow: hidden; background: #31454d; border-radius: 3px; }
.clock-progress > span { display: block; height: 100%; background: var(--clock-color); transform: scaleX(0); transform-origin: left; }
.clock-card:not(.is-enabled) { background: #14232c; }
.clock-card:not(.is-enabled)::before { opacity: .65; }
.clock-card .beat-pattern { margin-top: 16px; }
.clock-fields .phase-field { position: relative; }
.phase-field > span { position: absolute; right: 0; top: 1px; color: #afc1c7; font-size: 12px; }
.clock-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.clock-fields label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.clock-fields input, .clock-fields select { height: 40px; font-size: 14px; width: 100%; padding: 5px 8px; }
.clock-fields input[type="number"] { font-size: 15px; font-weight: 500; color: var(--text); }
.clock-volume { display: flex; align-items: center; gap: 10px; margin: 13px 0 11px; font-size: 14px; color: var(--muted); }
.clock-volume input { flex: 1; width: 100%; accent-color: var(--clock-color); }
.clock-volume output { min-width: 24px; text-align: right; color: #c2d0d3; font-variant-numeric: tabular-nums; }
.beat-pattern { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-height: 29px; }
.beat-dot { width: 29px; height: 29px; padding: 0; flex-shrink: 0; background: #35515b; color: #f0f3ef; border: 1px solid #627e85; border-radius: 50%; font-size: 12px; line-height: 1; font-weight: 600; position: relative; }
.beat-dot[data-value="2"] { background: var(--clock-color); border-color: var(--clock-color); color: #15222a; }
.beat-dot[data-value="0"] { border: 1px dashed #7b929a; background: transparent; color: #afc2c8; }
.beat-dot.is-current { outline: 2px solid var(--clock-color); outline-offset: 3px; background: #e7efeb; color: #15222a; }
.beat-dot:hover { border-color: #f5f6ec; }
.mixer-caption { margin: 13px 0 0; font-size: 14px; color: #a8bdc3; line-height: 1.7; }
.mixer-caption strong { font-weight: 500; color: #d0dedc; }
.reflection-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 30px; }
.panel { background: #14232d; border: 1px solid var(--line); border-radius: 12px; padding: 21px; min-width: 0; }
.panel h2 { font-size: 19px; }
.section-heading.compact { margin-bottom: 17px; }
.recording-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.recording-controls .button { font-size: 14px; padding: 9px 12px; }
.recording-controls .quiet-button { margin-left: auto;  font-size: 14px; }
.phrase-strip { display: flex; align-content: flex-start; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 69px; max-height: 145px; overflow: auto; padding: 13px 0 10px; }
.phrase-strip > p { font-size: 14px; color: var(--quiet); }
.phrase-note { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; font-size: 12px; background: #2d3e3e; border: 1px solid #516252; color: var(--accent); border-radius: 5px; }
.phrase-note[data-form="inner"] { color: var(--inner); border-color: #456172; }
.phrase-note[data-form="outer"] { color: var(--outer); border-color: #665777; }
.phrase-note small { color: #c1ced0; font-size: 12px; }
.small-note { font-size: 14px; color: var(--muted); line-height: 1.7; }
.world-panel > p:not(.eyebrow):not(.small-note) { font-size: 16px; color: #c1d0d1; line-height: 1.65; margin-top: 10px; }
.world-panel label { display: block; color: #d2dcd9; font-size: 14px; margin: 13px 0 7px; }
.world-panel .small-note { margin-top: 6px;  font-size: 14px; }
.guide-section { margin: 37px 0 32px; }
.guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px; margin: 23px 0; }
.guide-grid article { border-top: 1px solid #485b61; padding-top: 16px; }
.guide-number { display: inline-grid; place-items: center; width: 23px; height: 23px; font-family: Georgia, serif; background: #263c3c; color: var(--accent); border: 1px solid #4c6156; border-radius: 50%; font-size: 13px; margin-bottom: 13px; }
.guide-grid h3 { font-size: 16px; font-weight: 600; }
.guide-grid p { font-size: 14px; color: #b5c7ca; line-height: 1.75; }
.guide-grid p + p { margin-top: 9px; }
.technical-guide { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; }
.technical-guide summary { color: #d9e2dc; font-size: 14px; cursor: pointer; }
.technical-guide p { font-size: 14px; line-height: 1.8; color: var(--muted); max-width: 1000px; margin-top: 14px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line-soft); padding: 22px 0 27px; color: #9fb4ba; font-size: 12px; }
footer > span:first-child { color: #cbd8d4; }
footer a { text-decoration: none; }
.footer-dot { padding: 0 5px; color: var(--accent); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #d9efb1; color: #182c24; border: 1px solid #f1ffd6; padding: 12px 20px; box-shadow: 0 8px 32px #0005; border-radius: 10px; max-width: calc(100vw - 28px); width: max-content; z-index: 50; font-size: 14px; font-weight: 550; }

/* The exercise stays on the same instrument: a score above, keys below. */
.practice-panel { padding: 23px; margin-bottom: 18px; border: 1px solid #5a7463; border-radius: var(--radius); background: linear-gradient(135deg, #213831, #182a31 75%); }
.practice-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.practice-header h2 { margin-bottom: 6px; }
.practice-header p { color: #c2d2cd; font-size: 16px; max-width: 690px; }
.practice-settings { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.practice-settings label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 14px; }
.practice-settings select, .practice-settings input { max-width: 175px; height: 40px; font-size: 14px; }
.practice-settings .button { min-height: 40px;  font-size: 14px; }
.practice-body { margin-top: 16px; }
.practice-body h3 { font-size: 15px; }
.practice-body > p { font-size: 16px; color: #cad7d2; }
.premise-list { padding-left: 22px; margin: 13px 0 18px; color: #e3ebe5; font-size: 16px; line-height: 1.7; }
.premise-list li + li { margin-top: 7px; }
.premise-list li::marker { color: var(--accent); font-weight: 600; }
.answer-options { display: flex; align-items: stretch; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.answer-button { min-width: 84px; padding: 10px 18px; min-height: 41px; background: #203740; color: #eef5e7; border: 1px solid #6a8286; border-radius: 7px; font-size: 14px; font-weight: 550; }
.answer-button:hover:not(:disabled) { background: #38514b; border-color: var(--accent); }
.answer-button.correct { background: var(--accent); color: #193123; border-color: var(--accent); opacity: 1; }
.answer-button.incorrect { background: #593c38; color: #ffd3c6; border-color: #e0a497; opacity: 1; }
.game-feedback { padding: 13px 15px; border-radius: 8px; background: #10251f; border-left: 3px solid var(--accent); color: #d8e6d4; font-size: 14px; line-height: 1.65; margin: 15px 0; }
.game-feedback:empty { display: none; }
.game-feedback.incorrect { border-left-color: var(--danger); color: #ffdacd; }
.game-feedback strong { color: #f1f6e5; }
.score-timeline { position: relative; padding: 13px; margin: 16px 0; background: #0e1d26; border: 1px solid #3f555a; border-radius: 9px; overflow: auto; display: grid; gap: 7px; }
.score-event { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #304943; color: var(--accent); border: 1px solid #59795d; border-radius: 5px; padding: 7px 10px; font-size: 14px; min-height: 30px; }
.score-event[data-form="inner"] { background: #2b4350; color: var(--inner); border-color: #527b8d; }
.score-event[data-form="outer"] { background: #3c3650; color: var(--outer); border-color: #6e6093; }
.score-event small { color: #d0ddda; font-size: 12px; white-space: nowrap; }
.performance-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.performance-controls label { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: #c1d0cc; }
.performance-controls input { width: 70px; }
.score-stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; }
.score-stats > div, .score-stats > span { background: #12262a; border: 1px solid #3c5958; border-radius: 7px; padding: 10px 13px; font-size: 14px; color: #c6d7ce; }
.score-stats strong { color: var(--accent); font-size: 18px; display: block; line-height: 1.3; }
.stage-message { font-size: 14px; color: var(--accent); background: #182a2a; padding: 12px 14px; border-radius: 7px; margin: 14px 0; border: 1px solid #4c655a; font-weight: 550; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.world-score { background: #13242c; padding: 16px; border: 1px solid #466163; border-radius: 10px; min-width: 0; }
.world-score h3 { color: #e9f3df; font-size: 16px; }
.world-score > p { font-size: 14px; color: var(--muted); }
.world-events { display: grid; gap: 8px; margin-top: 12px; }
.world-event { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 8px; background: #213b3f; border-left: 3px solid var(--accent); border-radius: 4px; padding: 9px 11px; font-size: 14px; color: #e1ebe2; }
.world-event > kbd { width: 22px; height: 22px; border-radius: 4px; border: 1px solid #6e877b; display: grid; place-items: center; font-size: 12px; color: var(--accent); }
.world-event[data-form="inner"] { border-left-color: var(--inner); }
.world-event[data-form="outer"] { border-left-color: var(--outer); }
.world-event[data-form="inner"] > kbd { color: var(--inner); }
.world-event[data-form="outer"] > kbd { color: var(--outer); }
.event-visual { display: block; position: relative; height: 7px; border-radius: 3px; background: #0e242b; grid-column: 2; margin: 1px 0 2px; }
.event-visual i { display: block; position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.world-event[data-form="inner"] .event-visual i { background: var(--inner); }
.world-event[data-form="outer"] .event-visual i { background: var(--outer); }
.transfer-prompt { margin: 15px 0 6px; padding: 12px 14px; border: 1px dashed #6d8171; border-radius: 8px; font-size: 14px; color: #d9e8d0; line-height: 1.65; }
.world-event small { display: block; color: #b6caca; margin-top: 4px; font-size: 14px; }

@media (min-width: 1200px) {
  .key-category { font-size: 14px; }
}
@media (max-width: 1050px) {
  .app-shell { padding: 0 25px; }
  .key-row { grid-template-columns: 99px minmax(0, 1fr); gap: 10px; }
  .key-bank { gap: 5px; }
  .piano-key { padding-right: 6px; padding-left: 6px; }
  .key-category { font-size: 14px; }
  .key-row-label { font-size: 14px; }
  .key-shortcut { left: 6px; }
  .instrument-options { gap: 13px;  font-size: 14px; }
  .key-inspector .status-chip { display: none; }
  .transport-options { gap: 11px; }
  .transport-bar { gap: 15px; padding: 15px; }
  .transport-options label { flex-direction: column; align-items: flex-start; gap: 4px;  font-size: 14px; }
  .clock-card { padding: 15px; }
  .guide-grid { gap: 20px; }
  .guide-grid h3 { font-size: 16px; }
}
@media (max-width: 850px) {
  .app-shell { padding: 0 20px; }
  .heading-note { display: none;  font-size: 14px; }
  .instrument { padding: 18px; }
  .instrument-top { margin-bottom: 18px; }
  .instrument-options { gap: 13px;  font-size: 14px; }
  .instrument-options .quiet-button { font-size: 14px; }
  .instrument-options .quiet-button kbd { font-size: 12px; }
  .key-row { display: block; }
  .key-row-label { flex-direction: row; align-items: center; justify-content: flex-start; gap: 7px; margin-bottom: 7px; font-size: 14px; }
  .key-row-label small, .key-row-label > span { margin: 0 0 0 auto; font-size: 12px; }
  .key-row-label::before { width: 10px; height: 2px; margin: 0; }
  .key-bank { gap: 6px; }
  .piano-key { min-height: 102px; }
  .key-category { font-size: 14px; }
  .piano-keys { gap: 13px; }
  .clock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clock-card { padding: 18px; }
  .transport-options .status-chip { display: none; }
  .reflection-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px; }
  .guide-grid h3 { font-size: 16px; }
  .guide-grid p { font-size: 14px; }
  .practice-header { flex-direction: column; gap: 15px; }
}
@media (max-width: 650px) {
  .app-shell { padding: 0 15px; }
  .app-header { padding: 20px 0; gap: 12px; }
  .brand { font-size: 24px; }
  .brand svg { width: 29px; }
  .header-nav { font-size: 14px; gap: 14px; }
  .header-nav a:first-child { display: none; }
  .workspace-heading { padding: 24px 0 20px; }
  h1 { font-size: 32px; }
  .eyebrow { font-size: 12px; }
  .mode-tabs { width: 100%; margin-bottom: 18px; }
  .mode-tab { flex: 1; white-space: normal; padding: 10px 5px; gap: 6px; font-size: 14px; }
  .mode-index { display: none; font-size: 12px; }
  .instrument { padding: 16px; border-radius: 12px; }
  .instrument-top { align-items: flex-start; gap: 12px; }
  .instrument-top h2 { font-size: 19px; }
  .instrument-options { flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; font-size: 14px; }
  .instrument-options .volume-label { order: 3; flex-basis: 100%; justify-content: flex-end; font-size: 12px; }
  .volume-label input { width: 82px; }
  .instrument-options .quiet-button { padding: 0;  font-size: 14px; }
  .key-bank { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .piano-key { min-height: 95px; padding: 12px 10px 10px; }
  .key-category { font-size: 14px; }
  .key-shortcut { left: 10px; top: 8px; width: 21px; height: 21px; font-size: 12px; }
  .key-note { font-size: 12px; }
  .piano-keys { gap: 18px; }
  .key-row-label { font-size: 14px; margin-bottom: 9px; }
  .key-inspector { align-items: flex-start; padding-top: 14px; margin-top: 17px; }
  .key-inspector strong { font-size: 14px; }
  .key-inspector p { font-size: 14px; line-height: 1.7; }
  .transport-bar { flex-wrap: wrap; gap: 13px; padding: 14px; }
  .transport-buttons { flex: 1; gap: 6px; }
  .transport-info { margin-left: auto; padding-left: 14px; }
  .transport-options { margin: 0; flex-basis: 100%; padding-top: 11px; border-top: 1px solid #3c535b; }
  .transport-options label { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 10px;  font-size: 14px; }
  .transport-options select { max-width: 240px; font-size: 14px; }
  .button { min-height: 40px; font-size: 14px; padding: 10px 12px; }
  .mixer-section { padding-top: 29px; }
  .section-heading { align-items: flex-start; gap: 14px; }
  .mixer-section > .section-heading { flex-direction: column; }
  .section-heading p:not(.eyebrow) { font-size: 16px; }
  .preset-control { align-items: flex-start; width: 100%; }
  .preset-control select { width: 100%; font-size: 14px; height: 39px; }
  .clock-grid { grid-template-columns: 1fr; gap: 11px; }
  .clock-card { padding: 18px; }
  .clock-header h3, .clock-enable > span { font-size: 14px; }
  .clock-header input { width: 18px; height: 18px; }
  .clock-header { margin-bottom: 18px; }
  .clock-state { font-size: 12px; }
  .clock-fields { column-gap: 16px; row-gap: 13px; }
  .clock-fields label { font-size: 14px; }
  .clock-fields input, .clock-fields select { height: 38px;  font-size: 14px; }
  .clock-fields input[type="number"] { font-size: 17px; }
  .clock-fields select { font-size: 12px; }
  .clock-volume { margin-top: 15px; margin-bottom: 15px; font-size: 14px; }
  .beat-pattern { gap: 8px; }
  .beat-dot { width: 30px; height: 30px; font-size: 12px; }
  .mixer-caption { font-size: 14px; line-height: 1.8; }
  .reflection-grid { margin-top: 25px; gap: 12px; }
  .panel { padding: 18px; }
  .section-heading.compact { align-items: center; gap: 10px; }
  .panel h2 { font-size: 20px; }
  .recording-controls { gap: 8px; }
  .recording-controls .quiet-button { margin-left: 0;  font-size: 14px; }
  .phrase-strip { min-height: 65px; }
  .small-note { font-size: 14px; }
  .world-panel > p:not(.eyebrow):not(.small-note) { font-size: 16px; }
  .world-panel label { font-size: 14px; }
  .world-panel textarea { min-height: 95px; font-size: 16px; }
  .guide-section { margin-top: 29px; }
  .guide-grid { gap: 22px; }
  .guide-grid h3 { font-size: 16px; }
  .guide-grid p { font-size: 14px; }
  .technical-guide summary { font-size: 14px; }
  .technical-guide p { font-size: 14px; }
  footer { font-size: 12px; gap: 13px; flex-wrap: wrap; padding-bottom: 24px; }
  footer > span:nth-child(2) { display: none; }
  .practice-panel { padding: 17px; border-radius: 12px; }
  .practice-header h2 { font-size: 21px; }
  .practice-settings { width: 100%; }
  .practice-settings label { flex: 1; min-width: 95px;  font-size: 14px; }
  .practice-settings select, .practice-settings input { max-width: none; width: 100%;  font-size: 14px; }
  .practice-settings > .button { flex-basis: 100%;  font-size: 14px; }
  .premise-list { padding-left: 19px; font-size: 16px; }
  .answer-options { gap: 7px; }
  .answer-button { min-width: 60px; padding: 11px 13px;  font-size: 14px; }
  .comparison-grid { grid-template-columns: 1fr; gap: 11px; }
  .score-event { font-size: 14px; flex-wrap: wrap; padding: 9px; }
  .score-event small { white-space: normal; }
  .performance-controls .button { flex: 1;  font-size: 14px; }
  .score-stats { gap: 8px; }
  .score-stats > div, .score-stats > span { flex: 1; min-width: 90px; padding: 10px;  font-size: 14px; }
}
@media (max-width: 380px) {
  .app-shell { padding: 0 11px; }
  .mode-tab { font-size: 14px; padding: 10px 3px; }
  .mode-index { display: none; }
  h1 { font-size: 29px; }
  .instrument { padding: 13px; }
  .key-category { font-size: 14px; }
  .key-bank { gap: 6px; }
  .piano-key { padding-right: 7px; padding-left: 8px; }
  .key-shortcut { left: 8px; }
  .guide-grid { grid-template-columns: 1fr; gap: 18px; }
  .guide-grid h3 { font-size: 16px; }
  .guide-grid p { font-size: 14px; }
  .guide-number { float: left; margin: 0 10px 4px 0; }
  .clock-card { padding: 16px; }
  .section-heading.compact .status-chip { font-size: 12px; padding: 4px 6px; }
  .panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
