@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-medium.ttf") format("truetype");
  font-weight: 500 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-bold.ttf") format("truetype");
  font-weight: 700 900;
  font-display: swap;
}
:root {
  --bg: #f5f3f0;
  --bg-surface: #eae7e2;
  --surface: #ffffff;
  --fg: #2a2a2a;
  --fg-muted: #6b6b6b;
  --accent: #4a8b7f;
  --accent-hover: #3d7568;
  --accent-subtle: rgba(74, 139, 127, .12);
  --border: #d5d0ca;
  --danger: #c45a5a;
  --danger-subtle: rgba(196, 90, 90, .1);
  --radius: 4px;
  --transition: 150ms ease;
}
[data-theme="dark"] {
  --bg: #141414;
  --bg-surface: #1e1e1e;
  --surface: #242424;
  --fg: #e8e6e3;
  --fg-muted: #8a8a8a;
  --accent: #6ab5a5;
  --accent-hover: #7ec5b5;
  --accent-subtle: rgba(106, 181, 165, .1);
  --border: #2e2e2e;
  --danger: #d46a6a;
  --danger-subtle: rgba(212, 106, 106, .12);
}
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--fg); font: 400 14px/1.6 "JetBrains Mono", ui-monospace, monospace; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-shell { height: 100vh; height: 100dvh; display: flex; overflow: hidden; }
.sidebar { width: 264px; min-height: 0; flex: none; display: flex; flex-direction: column; padding: 26px 17px 20px; border-right: 1px solid var(--border); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 42px; }
.brand-icon { width: 34px; height: 34px; border: 1px solid var(--accent); border-radius: var(--radius); display: flex; justify-content: center; align-items: center; gap: 3px; }
.brand-icon span { width: 3px; background: var(--accent); }
.brand-icon span:nth-child(1) { height: 9px; }
.brand-icon span:nth-child(2) { height: 18px; }
.brand-icon span:nth-child(3) { height: 13px; }
.brand strong { display: block; font-size: 13px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 1px; color: var(--fg-muted); font-size: 9px; letter-spacing: .05em; }
.library-heading, .section-top { display: flex; align-items: center; justify-content: space-between; }
.library-heading { padding: 0 5px 11px; }
.eyebrow { margin: 0 0 5px; color: var(--fg-muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow.accent { color: var(--accent); }
.library-heading h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.03em; }
.library-heading h2 span { display: inline-block; padding: 1px 5px; margin-left: 3px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--fg-muted); font-size: 10px; vertical-align: 1px; }
.icon-button, .theme-button { border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--fg-muted); transition: border-color var(--transition), color var(--transition), background var(--transition); }
.icon-button { width: 29px; height: 29px; font-size: 17px; line-height: 1; }
.icon-button:hover, .theme-button:hover { border-color: var(--accent); color: var(--accent); }
.search-box { height: 37px; display: flex; align-items: center; gap: 7px; padding: 0 10px; margin: 0 2px 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--fg-muted); font-size: 19px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--fg); font-size: 11px; }
.search-box input::placeholder { color: var(--fg-muted); }
.song-list { flex: 1; min-height: 0; overflow-y: auto; }
.song-item { display: flex; align-items: center; gap: 3px; margin-bottom: 5px; padding: 3px; border: 1px solid transparent; border-radius: var(--radius); transition: background var(--transition), border-color var(--transition); }
.song-item:hover { background: var(--bg-surface); }
.song-item.active { background: var(--accent-subtle); border-color: var(--accent); }
.song-select { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; min-height: 48px; padding: 5px; background: transparent; border: 0; text-align: left; color: var(--fg); }
.song-select > span:last-child { min-width: 0; }
.song-art { width: 31px; height: 31px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent); font-size: 14px; font-weight: 700; }
.song-item.active .song-art { border-color: var(--accent); }
.song-name { display: block; max-width: 157px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.song-status { display: block; margin-top: 1px; color: var(--fg-muted); font-size: 9px; }
.song-delete { width: 25px; height: 25px; flex: none; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--fg-muted); font-size: 17px; line-height: 1; }
.song-delete:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-subtle); color: var(--danger); }
.empty-library { padding: 8px 5px; color: var(--fg-muted); font-size: 11px; }
.sidebar-bottom { padding: 15px 2px 0; border-top: 1px solid var(--border); }
.import-button, .extract-button { border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; transition: background var(--transition), border-color var(--transition); }
.import-button:hover:not(:disabled), .extract-button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.import-button:disabled, .extract-button:disabled { opacity: .5; }
.import-button { width: 100%; height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.import-plus { font-size: 17px; line-height: 1; }
.sidebar-bottom p { margin: 11px 3px 0; color: var(--fg-muted); font-size: 9px; }
.main-content { flex: 1; min-width: 0; overflow-y: auto; background: var(--bg); }
.topbar { height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 36px; border-bottom: 1px solid var(--border); }
.breadcrumb { color: var(--fg-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.breadcrumb span { padding: 0 6px; color: var(--border); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.local-pill { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.local-pill span { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.theme-button { min-width: 78px; height: 29px; padding: 0 8px; font-size: 10px; }
.content-wrap { max-width: 1230px; margin: auto; padding: 36px 36px 21px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 0; font-size: clamp(25px, 2.8vw, 36px); line-height: 1.25; letter-spacing: -.055em; }
.page-heading h1 span { color: var(--accent); }
.page-heading p:last-child { margin: 8px 0 0; color: var(--fg-muted); font-size: 11px; }
.model-pill { min-width: 132px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.model-pill span, .model-pill small { display: block; color: var(--fg-muted); font-size: 9px; }
.model-pill strong { display: block; margin: 3px 0; font-size: 11px; }
.song-panel, .mix-panel, .extract-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.song-panel { padding: 21px 24px 22px; }
.section-label { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.section-number { color: var(--accent); }
.source-label, .section-note { color: var(--fg-muted); font-size: 9px; }
.song-title-line { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 23px; }
.song-title-line h2 { margin: 0; overflow-wrap: anywhere; font-size: 21px; letter-spacing: -.045em; }
.song-title-line p { margin: 4px 0 0; color: var(--fg-muted); font-size: 10px; }
.song-badge { flex: none; padding: 5px 8px; border: 1px solid var(--accent); border-radius: var(--radius); color: var(--accent); font-size: 9px; font-weight: 700; }
.transport { display: flex; align-items: center; gap: 14px; }
.play-button { width: 39px; height: 39px; flex: none; display: grid; place-items: center; padding-left: 3px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: #fff; font-size: 15px; }
.play-button:disabled { opacity: .5; }
.transport-body { flex: 1; min-width: 0; }
.transport-label { display: flex; justify-content: space-between; gap: 8px; }
.transport-label strong { font-size: 11px; }
.transport-label span { color: var(--fg-muted); font-size: 9px; }
.seek-line { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--fg-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.seek-line input { width: 100%; height: 3px; appearance: none; border-radius: 0; background: var(--border); }
.seek-line input::-webkit-slider-thumb { width: 11px; height: 11px; appearance: none; border: 0; border-radius: 2px; background: var(--accent); }
.seek-line input::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 2px; background: var(--accent); }
.speed-controls { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--border); }
.speed-controls label, .field-label { color: var(--fg-muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.speed-controls select, .extract-content select { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--fg); }
.speed-controls select { height: 29px; min-width: 104px; padding: 0 6px; font-size: 10px; }
.speed-controls > span { margin-left: auto; color: var(--fg-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(275px, 1fr); gap: 15px; align-items: start; margin-top: 15px; }
.mix-panel, .extract-panel { padding: 20px 22px; }
.mix-intro h2, .extract-content h2 { margin: 19px 0 4px; font-size: 18px; letter-spacing: -.045em; }
.mix-intro p, .extract-content p { margin: 0; color: var(--fg-muted); font-size: 10px; }
.track-list { display: grid; gap: 6px; margin-top: 16px; }
.track-row { min-height: 53px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.track-row.unavailable { opacity: .48; }
.track-row.has-warning { border-color: var(--danger); }
.track-icon { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent); font-size: 14px; }
.track-info { flex: 1; min-width: 0; }
.track-info strong { display: block; font-size: 11px; }
.track-info > span { display: block; margin-top: 1px; color: var(--fg-muted); font-size: 10px; }
.track-meta { margin-top: 3px; color: var(--fg-muted); font-size: 10px; line-height: 1.4; letter-spacing: .01em; }
.track-warning { max-width: 390px; margin-top: 5px; color: var(--danger); font-size: 10px; font-weight: 700; line-height: 1.4; }
.track-warning > span { display: inline-grid; width: 12px; height: 12px; place-items: center; margin-right: 3px; border: 1px solid currentColor; border-radius: 50%; font-size: 8px; }
.track-volume { width: 50px; flex: none; accent-color: var(--accent); }
.solo-button, .clean-button { padding: 4px 5px; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--fg-muted); font-size: 9px; font-weight: 700; }
.solo-button:hover:not(:disabled), .clean-button:hover:not(:disabled), .clean-button[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.clean-panel { margin-top: -1px; padding: 13px; border: 1px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius); background: var(--bg-surface); }
.clean-panel > div:first-child strong { display: block; font-size: 11px; }
.clean-panel > div:first-child span, .clean-panel p { display: block; margin: 3px 0 0; color: var(--fg-muted); font-size: 9px; line-height: 1.5; }
.clean-settings, .clean-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.clean-settings label { color: var(--fg-muted); font-size: 9px; font-weight: 700; }
.clean-settings select { height: 29px; padding: 0 7px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); font-size: 9px; }
.clean-settings button, .clean-preview button { min-height: 29px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); font-size: 9px; font-weight: 700; }
.clean-settings button:hover:not(:disabled), .clean-preview button:hover:not(:disabled), .clean-preview button.active { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
.clean-settings button:disabled, .clean-preview button:disabled { opacity: .45; }
.clean-preview a { margin-left: auto; color: var(--accent); font-size: 9px; text-decoration: none; }
.clean-preview a:hover { text-decoration: underline; }
.track-switch { position: relative; width: 30px; height: 16px; flex: none; }
.track-switch input { position: absolute; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.track-switch span { display: block; width: 100%; height: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-surface); transition: background var(--transition); }
.track-switch span::after { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--fg-muted); content: ""; transition: transform var(--transition); }
.track-switch input:checked + span { border-color: var(--accent); background: var(--accent-subtle); }
.track-switch input:checked + span::after { transform: translateX(14px); background: var(--accent); }
.mix-hint { display: flex; align-items: flex-start; gap: 7px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 9px; }
.hint-dot { width: 6px; height: 6px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.extract-content { margin-top: 20px; }
.extract-symbol { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: var(--radius); color: var(--accent); font-size: 28px; line-height: 1; }
.extract-symbol span { transform: translateY(-3px); }
.extract-content h2 { margin-top: 15px; }
.extract-content p { max-width: 310px; }
.field-label { display: block; margin: 23px 0 7px; }
.extract-content select { width: 100%; height: 37px; padding: 0 9px; font-size: 10px; }
.stem-field-label { margin: 17px 0 7px; }
.stem-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.stem-choices label { display: flex; align-items: center; gap: 7px; min-height: 29px; padding: 5px 7px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); font-size: 10px; cursor: pointer; }
.stem-choices label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.stem-choices input { margin: 0; accent-color: var(--accent); }
.stem-choices .derived-choice { grid-column: 1 / -1; }
.stem-choices small { margin-left: auto; color: var(--fg-muted); font-size: 8px; }
.extract-button { width: 100%; height: 38px; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 0 11px; }
.extract-button span:last-child { font-size: 17px; font-weight: 400; }
.mode-hint { min-height: 30px; margin-top: 8px !important; }
.job-status { min-height: 28px; display: flex; align-items: flex-start; gap: 7px; margin-top: 13px; color: var(--fg-muted); font-size: 9px; overflow-wrap: anywhere; }
.status-dot { width: 6px; height: 6px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.job-status.error { color: var(--danger); }
.job-status.error .status-dot { background: var(--danger); }
.job-status.running .status-dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
footer { padding: 21px 0 0; color: var(--fg-muted); font-size: 9px; letter-spacing: .07em; text-align: center; }
footer span { color: var(--accent); }
@media (max-width: 1060px) {
  .sidebar { width: 237px; }
  .topbar { padding: 0 24px; }
  .content-wrap { padding: 30px 24px 18px; }
  .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .app-shell { height: auto; min-height: 100vh; display: block; overflow: visible; }
  .sidebar { width: 100%; padding: 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 0 18px; }
  .library-heading { padding: 0 0 9px; }
  .search-box { margin: 0 0 10px; }
  .song-list { min-height: 0; max-height: 120px; display: flex; gap: 5px; overflow-x: auto; }
  .song-item { min-width: 180px; width: 180px; margin: 0; }
  .song-name { max-width: 98px; }
  .sidebar-bottom { padding-top: 11px; }
  .sidebar-bottom p { display: none; }
  .main-content { overflow: visible; }
  .topbar { height: 49px; padding: 0 16px; }
  .local-pill { display: none; }
  .content-wrap { padding: 24px 16px 16px; }
  .page-heading { align-items: flex-start; margin-bottom: 18px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p:last-child { line-height: 1.5; }
  .model-pill, .song-badge, .source-label { display: none; }
  .song-panel, .mix-panel, .extract-panel { padding: 16px; }
  .track-row { flex-wrap: wrap; }
  .track-info { flex: 1 1 calc(100% - 50px); }
  .track-volume { flex: 1 1 70px; min-width: 70px; }
  .song-title-line { margin-top: 17px; }
  .song-title-line h2 { font-size: 18px; }
  .lower-grid { gap: 11px; margin-top: 11px; }
  .speed-controls { flex-wrap: wrap; }
  .speed-controls > span { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

[hidden] { display: none !important; }
.view-tabs, .learn-part-tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); }
.view-tabs { margin-top: 16px; }
.view-tabs button, .learn-part-tabs button { padding: 7px 12px; border: 0; border-radius: var(--radius); background: transparent; color: var(--fg-muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; }
.view-tabs button[aria-selected="true"], .learn-part-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.visual-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 19px; }
.visual-heading label { color: var(--fg-muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.visual-heading label span { color: var(--accent); }
.visual-heading select { max-width: 45%; height: 28px; padding: 0 7px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--fg); font-size: 10px; }
.waveform-surface { position: relative; height: 110px; overflow: hidden; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); cursor: crosshair; touch-action: none; }
.waveform-surface:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.waveform-surface svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.waveform-axis { stroke: var(--border); stroke-width: .7; }
.waveform-bars { fill: none; stroke: var(--accent); stroke-width: .8; opacity: .8; }
.waveform-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg-surface); color: var(--fg-muted); font-size: 10px; pointer-events: none; }
.waveform-playhead { position: absolute; z-index: 3; inset: 0 auto 0 0; width: 2px; background: var(--fg); box-shadow: 0 0 7px #0009; pointer-events: none; }
.loop-shade { position: absolute; z-index: 1; inset: 0 auto 0 0; background: #2bc7b533; border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); pointer-events: none; }
.loop-handle { position: absolute; z-index: 4; top: 0; width: 22px; height: 20px; display: grid; place-items: center; transform: translateX(-50%); border: 1px solid #fff; border-radius: 0 0 3px 3px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; cursor: ew-resize; touch-action: none; }
.loop-handle.end { top: auto; bottom: 0; border-radius: 3px 3px 0 0; }
.waveform-hint { display: flex; justify-content: space-between; gap: 8px; margin: 5px 1px 13px; color: var(--fg-muted); font-size: 8px; letter-spacing: .05em; }
#loopIndicator { color: var(--accent); font-weight: 700; }
.time-line { display: flex; justify-content: space-between; margin-top: 7px; color: var(--fg-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.track-row.viewing { border-color: var(--accent); }
.view-button { padding: 4px 5px; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--fg-muted); font-size: 9px; font-weight: 700; }
.view-button:hover:not(:disabled), .track-row.viewing .view-button { border-color: var(--accent); color: var(--accent); }
.learn-panel { margin-top: 15px; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.learn-intro { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-top: 16px; }
.learn-intro h2 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.045em; }
.learn-intro p, .learn-summary p, .learn-caution { margin: 0; color: var(--fg-muted); font-size: 10px; line-height: 1.5; }
.learn-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 17px; }
.learn-layout.guitar { display: block; }
.learn-tools { grid-column: 2; grid-row: 1; min-width: 0; }
.learn-audio { margin-bottom: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.learn-audio-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.learn-audio-choices button { padding: 6px 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--fg-muted); font-size: 9px; font-weight: 700; }
.learn-audio-choices button:hover:not(:disabled), .learn-audio-choices button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
.learn-audio-choices button:disabled { opacity: .45; }
.learn-layout .loop-controls { margin-top: 0; }
.learn-layout:not(.guitar) .loop-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.learn-layout:not(.guitar) .loop-controls .loop-label, .learn-layout:not(.guitar) .loop-controls #loopReadout { grid-column: 1 / -1; }
.learn-layout:not(.guitar) .loop-controls button { min-height: 31px; }
.learn-layout:not(.guitar) .learn-summary { align-items: start; flex-direction: column; }
.learn-layout:not(.guitar) #loopReadout { flex-basis: 100%; margin-left: 0; }
.loop-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 19px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.loop-label { margin-right: 5px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.loop-controls button, #analyzeLearnButton { padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--fg); font-size: 9px; font-weight: 700; }
.loop-controls button:hover:not(:disabled), #analyzeLearnButton:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.loop-controls button:disabled, #analyzeLearnButton:disabled { opacity: .45; }
.loop-controls button.active { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
#loopReadout { margin-left: auto; color: var(--fg-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.learn-focus { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--accent-subtle); color: var(--fg); font-size: 10px; line-height: 1.5; }
.learn-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 17px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius); }
.learn-summary h3 { margin: 5px 0 4px; font-size: 14px; }
.drum-kit-panel { grid-column: 1; grid-row: 1; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.kit-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--fg-muted); font-size: 9px; letter-spacing: .05em; }
.kit-status strong { color: var(--accent); font-size: 10px; font-weight: 700; text-align: right; letter-spacing: 0; }
.drum-kit { position: relative; height: 310px; max-width: 650px; margin: 6px auto 0; background: radial-gradient(ellipse at 50% 70%, var(--accent-subtle), transparent 60%); }
.kit-piece { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 112px; padding: 0; border: 0; background: transparent; color: var(--fg-muted); cursor: pointer; }
.kit-piece:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.kit-surface { display: block; width: 90px; height: 70px; border: 5px solid var(--border); border-radius: 50%; background: radial-gradient(circle at 45% 36%, var(--surface), var(--bg-surface) 65%); box-shadow: 0 8px 0 var(--border), 0 11px 18px #0003; transition: transform .08s, box-shadow .08s, border-color .08s, background .08s; }
.kit-name { font-size: 10px; font-weight: 700; letter-spacing: .09em; }
.kit-hat { left: 9%; top: 16%; }
.kit-hat .kit-surface { width: 104px; height: 35px; border: 3px solid #8d7b52; background: radial-gradient(ellipse, #a69155, #605638); box-shadow: 0 8px 0 #534b35, 0 11px 18px #0003; }
.kit-cymbal { right: 8%; top: 11%; }
.kit-cymbal .kit-surface { width: 122px; height: 37px; border: 3px solid #8d7b52; background: radial-gradient(ellipse, #b7a46e, #63583b); box-shadow: 0 7px 0 #534b35, 0 11px 18px #0003; }
.kit-high-tom { left: 27%; top: 24%; }
.kit-low-tom { left: 46%; top: 24%; }
.kit-floor-tom { right: 7%; top: 54%; }
.kit-snare { left: 16%; top: 58%; }
.kit-kick { left: 44%; top: 54%; width: 130px; }
.kit-kick .kit-surface { width: 120px; height: 120px; border-width: 8px; box-shadow: 0 5px 0 var(--border), 0 12px 22px #0004; }
.kit-piece.lit .kit-surface { transform: scale(1.08); border-color: var(--accent); background: radial-gradient(circle at 45% 36%, #7be8d3, var(--accent) 70%); box-shadow: 0 0 0 5px var(--accent-subtle), 0 0 26px var(--accent); }
.kit-piece.lit .kit-name { color: var(--accent); }
.kit-hat.lit .kit-surface, .kit-cymbal.lit .kit-surface { background: radial-gradient(ellipse, #ffe8a1, #d5a952); border-color: #f4cc77; box-shadow: 0 0 0 5px #d5a95233, 0 0 27px #f4cc77; }
.kit-caption { margin: 8px 0 0; color: var(--fg-muted); font-size: 9px; line-height: 1.5; text-align: center; }
.guitar-board-panel { margin-top: 12px; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.fretboard-scroll { max-width: 100%; overflow-x: auto; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.fretboard { display: grid; width: max-content; grid-template-columns: 68px repeat(21, 44px); }
.fretboard-corner, .fretboard-fret, .fretboard-string { display: grid; place-items: center; min-height: 28px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-surface); color: var(--fg-muted); font-size: 9px; }
.fretboard-string { position: sticky; left: 0; z-index: 2; font-weight: 700; }
.fretboard-cell { position: relative; display: grid; place-items: center; height: 42px; padding: 0; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); color: var(--fg-muted); }
.fretboard-cell::before { position: absolute; inset: 50% 0 auto; height: 1px; background: var(--fg-muted); opacity: .5; content: ""; }
.fretboard-cell:disabled { cursor: default; }
.fret-dot { position: relative; z-index: 1; width: 10px; height: 10px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); transition: transform .08s, background .08s, box-shadow .08s; }
.fretboard-cell.has-note .fret-dot { width: 17px; height: 17px; border-color: var(--accent); background: var(--accent-subtle); }
.fretboard-cell.has-note:hover .fret-dot, .fretboard-cell.lit .fret-dot { transform: scale(1.18); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-subtle), 0 0 13px var(--accent); }
.fretboard-cell.lit { background: var(--accent-subtle); }
.fretboard-cell:focus-visible { z-index: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.learn-guide { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.learn-guide.guitar-guide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.learn-guide-card { min-height: 67px; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.learn-guide-card strong { display: block; color: var(--accent); font-size: 10px; }
.learn-guide-card span { display: block; margin-top: 5px; color: var(--fg-muted); font-size: 9px; line-height: 1.4; }
.learn-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0 11px; }
.learn-filters button { padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg-muted); font-size: 9px; }
.learn-filters button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.learn-events { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.learn-event { display: grid; grid-template-columns: 55px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--fg); text-align: left; }
.learn-event:last-child { border-bottom: 0; }
.learn-event:hover { background: var(--accent-subtle); }
.learn-event .event-time { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; }
.learn-event strong { display: block; font-size: 11px; }
.learn-event small { display: block; margin-top: 3px; color: var(--fg-muted); font-size: 9px; }
.learn-event .event-action { color: var(--fg-muted); font-size: 10px; }
.learn-empty { padding: 20px; color: var(--fg-muted); font-size: 10px; text-align: center; }
.learn-caution { margin-top: 11px; }
@media (max-width: 1180px) {
  .learn-layout:not(.guitar) { display: flex; flex-direction: column; }
  .learn-layout:not(.guitar) .drum-kit-panel { order: 0; width: 100%; }
  .learn-layout:not(.guitar) .learn-tools { order: 1; width: 100%; }
}
@media (max-width: 700px) {
  .waveform-surface { height: 90px; }
  .waveform-hint { font-size: 7px; }
  .drum-kit { height: 280px; }
  .kit-piece { width: 80px; }
  .kit-surface { width: 68px; height: 55px; }
  .kit-hat .kit-surface { width: 77px; height: 29px; }
  .kit-cymbal .kit-surface { width: 86px; height: 30px; }
  .kit-kick { width: 90px; }
  .kit-kick .kit-surface { width: 86px; height: 86px; }
  .kit-hat { left: 0; top: 0; }.kit-cymbal { right: 0; top: 0; }.kit-high-tom { left: 20%; top: 25%; }.kit-low-tom { left: 47%; top: 25%; }.kit-floor-tom { right: 0; top: 52%; }.kit-snare { left: 7%; top: 60%; }.kit-kick { left: 38%; top: 57%; }
  .learn-panel { padding: 16px; }
  .learn-intro { align-items: start; flex-direction: column; }
  .learn-layout { display: flex; flex-direction: column; }
  .learn-layout:not(.guitar) .drum-kit-panel { order: 0; width: 100%; }
  .learn-layout:not(.guitar) .learn-tools { order: 1; width: 100%; }
  .learn-summary { align-items: start; flex-direction: column; }
  .learn-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-guide.guitar-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #loopReadout { flex-basis: 100%; margin-left: 0; }
}
