:root {
  --bg: #11100f;
  --panel: #1a1816;
  --card: #211e1b;
  --text: #f3eee5;
  --muted: #aaa196;
  --line: #3a342f;
  --accent: #c49a52;
  --accent2: #e8c887;
  --danger: #b55353;
  --ok: #6e9d78;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:16px/1.45 system-ui,-apple-system,Segoe UI,sans-serif; }
button,input { font:inherit; }
.wrap { width:min(1050px, calc(100% - 28px)); margin:0 auto; padding:28px 0 60px; }
header { display:flex; gap:20px; justify-content:space-between; align-items:flex-start; margin-bottom:24px; }
h1 { margin:4px 0 6px; font-size:clamp(1.8rem,5vw,3rem); letter-spacing:-.04em; }
h2,h3,p { margin-top:0; }
.eyebrow { color:var(--accent2); font-size:.78rem; letter-spacing:.18em; font-weight:800; margin:0; }
.muted { color:var(--muted); }
.small { font-size:.88rem; }
.teacher-link { color:var(--text); text-decoration:none; border:1px solid var(--line); padding:10px 14px; border-radius:10px; }
.panel,.sessionbar,.track-card,.teacher-row { background:var(--panel); border:1px solid var(--line); border-radius:14px; }
.panel { padding:18px; display:grid; gap:14px; max-width:620px; }
label { display:grid; gap:6px; color:var(--muted); font-weight:650; }
input { width:100%; min-height:46px; border:1px solid var(--line); border-radius:10px; background:#0e0d0c; color:var(--text); padding:10px 12px; outline:none; }
input:focus { border-color:var(--accent); box-shadow:0 0 0 3px #c49a5222; }
button { min-height:44px; border:0; border-radius:10px; padding:10px 14px; font-weight:800; background:var(--accent); color:#17120b; cursor:pointer; }
button:hover { filter:brightness(1.06); }
button:disabled { opacity:.45; cursor:not-allowed; filter:none; }
button.secondary { background:#2c2824; color:var(--text); border:1px solid var(--line); }
button.danger { background:var(--danger); color:white; }
.error { color:#ef9191; min-height:1.2em; margin:0; }
.sessionbar { margin-bottom:16px; padding:14px 16px; display:flex; gap:14px; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.trackgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
.track-card { padding:16px; display:grid; gap:12px; min-width:0; }
.track-top { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.badge { font-size:.75rem; font-weight:800; padding:4px 8px; border-radius:999px; background:#2c2824; color:var(--muted); }
.badge.mine { background:#27442e; color:#c7e8ce; }
.badge.locked { background:#442727; color:#efc5c5; }
audio { width:100%; min-width:0; }
.claim { width:100%; }
.fullbox { border-top:1px solid var(--line); padding-top:12px; }
.buttonrow { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.teacher-controls input { max-width:260px; }
.teacher-list { display:grid; gap:10px; }
.teacher-row { padding:14px; display:flex; justify-content:space-between; gap:14px; align-items:center; flex-wrap:wrap; }
.teacher-row .meta { min-width:0; }
.teacher-row strong { display:block; }
dialog { border:1px solid var(--line); border-radius:14px; background:var(--panel); color:var(--text); max-width:460px; width:calc(100% - 32px); }
dialog::backdrop { background:#0009; }
.dialog-card { display:grid; gap:14px; }
.dialog-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
@media (max-width:600px) {
  .wrap { width:min(100% - 20px,1050px); padding-top:18px; }
  header { align-items:center; }
  .teacher-link { padding:9px 11px; }
  .trackgrid { grid-template-columns:1fr; }
  .sessionbar { align-items:flex-start; }
}

.music-manager { margin-top:26px; }
.section-heading { margin:0 0 12px; }
.section-heading h2 { margin:4px 0 5px; font-size:1.35rem; }
.session-heading { margin-top:30px; }
.upload-panel { max-width:none; margin-bottom:12px; }
.upload-panel input[type="file"] { padding:9px; }
.library-list { margin-top:12px; }
.library-row { display:grid; grid-template-columns:minmax(190px,.9fr) minmax(260px,1.2fr) minmax(220px,320px) auto; align-items:center; }
.library-meta { overflow:hidden; }
.original-name { display:block; color:var(--accent2); overflow-wrap:anywhere; margin-top:2px; }
.compact-button { justify-self:end; }
.sample-editor { display:grid; gap:8px; min-width:0; }
.sample-editor-top { display:flex; justify-content:space-between; gap:12px; align-items:baseline; flex-wrap:wrap; }
.sample-editor input[type="range"] { width:100%; min-height:auto; padding:0; accent-color:var(--accent); }
.sample-save { justify-self:start; }
.sample-preview { display:grid; gap:6px; min-width:0; }
.empty-state { border:1px dashed var(--line); border-radius:14px; color:var(--muted); padding:18px; }
@media (max-width:980px) {
  .library-row { grid-template-columns:1fr 1fr; align-items:stretch; }
  .sample-preview { grid-column:1 / -1; }
}
@media (max-width:760px) {
  .library-row { grid-template-columns:1fr; align-items:stretch; }
  .sample-preview { grid-column:auto; }
  .compact-button { justify-self:stretch; }
}
