/* Music Studio app layout and pages. Built from the tokens in ds/tokens.css only. */

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: var(--s2) var(--s3); z-index: 10; }
.skip:focus { left: 8px; }

/* Layout: top bar with the brand and navigation; content in a readable column. */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s5); padding: var(--s3) var(--s5);
  background: color-mix(in srgb, var(--hall) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--ink); font: 800 var(--t-md)/1 var(--font-display); letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.nav { display: flex; gap: var(--s1); flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-item { padding: var(--s2) var(--s3); border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: var(--t-sm); white-space: nowrap; }
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item[aria-current='page'] { color: var(--velvet); background: var(--velvet-soft); }
.theme-switch { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.theme-switch:hover { background: var(--surface-2); color: var(--velvet); }
.theme-switch svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.who { display: flex; align-items: center; gap: var(--s2); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: var(--grad-ink); font: 700 var(--t-xs)/1 var(--font-body); }
.who-name { font-size: var(--t-sm); font-weight: 700; }
.main { max-width: 1120px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s8); outline: none; }
.page > h1 { margin-bottom: var(--s5); }
.loading { min-height: 50vh; }
.back { font-size: var(--t-sm); }
.back::before { content: '‹ '; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: var(--s2); padding: var(--s2) var(--s4); }
  .signed-in .nav { order: 3; flex-basis: 100%; }
  .who-name { display: none; }
  .brand { flex: 1; }
  .main { padding: var(--s5) var(--s4) var(--s7); }
}

/* Visitor home */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s7); align-items: center; padding: var(--s5) 0 var(--s7); }
.display { font-size: var(--t-3xl); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; margin-bottom: var(--s5); }
.lede { font-size: var(--t-lg); color: var(--ink-2); margin-bottom: var(--s5); }
.hero-staff .caption { margin-top: var(--s2); }
.band { padding: var(--s7) 0; border-top: 1px solid var(--line); }
.band.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); counter-reset: step; }
.steps li { counter-increment: step; padding-top: var(--s4); border-top: 3px solid var(--velvet); border-image: var(--grad) 1; }
.steps li::before { content: counter(step); display: block; font: 800 var(--t-xl)/1 var(--font-display); color: var(--velvet); margin-bottom: var(--s3); }
.footer { display: flex; gap: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
@media (max-width: 860px) { .hero, .band.split, .steps { grid-template-columns: 1fr; gap: var(--s5); } }

/* The staff */
.staff-wrap { margin: 0; overflow-x: auto; }
.staff { width: 100%; min-width: 620px; height: auto; display: block; }
.staff-hero { min-width: 0; }
.staff-hero .note-label { font-size: 14px; }
.staff-hero .staff-day { font-size: 14px; }
.staff-line { stroke: var(--ink-2); stroke-width: 1; opacity: 0.45; }
.bar-line { stroke: var(--ink-2); stroke-width: 1.2; opacity: 0.55; }
.bar-line.end { stroke-width: 3; opacity: 0.7; }
.staff-day { fill: var(--ink-2); font: 700 13px var(--font-body); }
.staff-key { fill: var(--ink-2); font: 400 12px var(--font-body); }
.ledger { stroke: var(--ink-2); stroke-width: 1; opacity: 0.45; }
.note-head { fill: var(--velvet); }
.note-stem, .note-flag { stroke: var(--velvet); stroke-width: 2; fill: none; }
.note-label { fill: var(--ink); font: 700 12px var(--font-body); }
.note.live .note-head { fill: var(--brass); }
.note.live .note-stem, .note.live .note-flag { stroke: var(--brass); }
.hero-staff .note { opacity: 0; animation: note-in 0.5s ease forwards; }
.hero-staff .note:nth-of-type(2) { animation-delay: 0.15s; } .hero-staff .note:nth-of-type(3) { animation-delay: 0.3s; }
.hero-staff .note:nth-of-type(4) { animation-delay: 0.45s; } .hero-staff .note:nth-of-type(5) { animation-delay: 0.6s; }
.hero-staff .note:nth-of-type(6) { animation-delay: 0.75s; } .hero-staff .note:nth-of-type(7) { animation-delay: 0.9s; }
@keyframes note-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Cards and heads */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.card-head h2 { margin: 0; }
.empty { text-align: left; }
.page > .card, .page > section { margin-bottom: var(--s5); }

/* Next lesson: the one place brass appears when the room is open */
.next { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s5); align-items: center; padding: var(--s5); margin-bottom: var(--s5);
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--velvet); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.next.is-live { border-left-color: var(--brass); }
.next-when { display: grid; gap: 2px; min-width: 9rem; }
.next-day { font: 700 var(--t-sm) var(--font-body); color: var(--ink-2); }
.next-time { font: 650 var(--t-lg) var(--font-display); }
.next-what h2 { margin: 0 0 var(--s1); }
.next-what p { margin: 0; }
.next-act { display: grid; justify-items: end; gap: var(--s2); }
@media (max-width: 700px) { .next { grid-template-columns: 1fr; } .next-act { justify-items: start; } }

.practice { border-left: 3px solid var(--velvet-soft); padding-left: var(--s3); margin-top: var(--s3); }
.practice p { margin-bottom: var(--s1); }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin: 0 0 var(--s5); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); }
.tile dd { margin: var(--s1) 0 0; font: 800 var(--t-2xl)/1 var(--font-display); }

/* Teachers */
.teacher-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s5); }
.teacher-card { display: flex; gap: var(--s4); align-items: flex-start; }
.teacher-card h3 { margin-bottom: var(--s1); }
.teacher-card p { margin: 0; }
.monogram { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--velvet-soft); color: var(--velvet); font: 800 var(--t-md)/1 var(--font-display); }
.monogram.sm { width: 36px; height: 36px; font-size: var(--t-xs); }
.monogram.lg { width: 88px; height: 88px; font-size: var(--t-xl); }
.profile { display: flex; gap: var(--s5); align-items: center; margin-bottom: var(--s5); }
.profile h1 { margin-bottom: var(--s1); }
.profile p { margin: 0; }
.bio { font-size: var(--t-lg); margin-bottom: var(--s6); }

/* Classes */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.chip { padding: var(--s1) var(--s4); border: 1px solid var(--line); border-radius: var(--r-pill); text-decoration: none; color: var(--ink); font-weight: 700; font-size: var(--t-sm); background: var(--surface); }
.chip.on { background: var(--ink); color: var(--hall); border-color: var(--ink); }
.class-list { display: grid; gap: var(--s4); }
.class-list .card + .card { margin-top: 0; }
.class-head { display: flex; justify-content: space-between; gap: var(--s4); align-items: flex-start; }
.class-head h2, .class-head h3 { margin-bottom: var(--s1); }
.pick-teacher, .sessions, .kids { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.pick-teacher li, .sessions li, .kids li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.grow { flex: 1; min-width: 0; }
.dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); background: var(--surface); color: var(--ink); max-width: 420px; }
.dialog::backdrop { background: rgba(23, 20, 43, 0.45); }
.dialog .close { margin-top: var(--s4); }

/* Booking */
.book { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.book .card + .card { margin-top: 0; }
.book-side { position: sticky; top: 88px; }
.confirm-what { font: 650 var(--t-lg) var(--font-display); margin-bottom: var(--s1); }
.confirm-when { font-weight: 700; margin-bottom: var(--s1); }
@media (max-width: 860px) { .book { grid-template-columns: 1fr; } .book-side { position: static; } }
.days { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s2); margin-bottom: var(--s4); }
.day { flex: none; display: grid; justify-items: center; gap: 2px; min-width: 76px; padding: var(--s3) var(--s2); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.day[aria-selected='true'] { border-color: var(--velvet); background: var(--velvet-soft); }
.day-name { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); }
.day-num { font: 800 var(--t-xl)/1 var(--font-display); }
.day-count { color: var(--ink-2); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s2); }
.time { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 700 var(--t-sm) var(--font-body); cursor: pointer; }
.time:hover { border-color: var(--velvet); }
.time.on { background: var(--velvet); color: var(--velvet-ink); border-color: var(--velvet); }

/* Lessons */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.tab { padding: var(--s3) var(--s4); text-decoration: none; color: var(--ink-2); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--velvet); }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.lesson { display: grid; grid-template-columns: 72px 1fr; gap: var(--s4); padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.lesson.cancelled { opacity: 0.7; }
.lesson-date { display: grid; justify-items: center; align-content: start; padding: var(--s2) 0; border-right: 1px solid var(--line); }
.lesson-dow, .lesson-mon { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); }
.lesson-dnum { font: 800 var(--t-2xl)/1.05 var(--font-display); }
.lesson-title { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.lesson-title h2 { font-size: var(--t-lg); margin: 0; }
.lesson-main > p { margin: var(--s1) 0; }
.lesson-main .btn-row { margin-top: var(--s3); }
.inline-form { margin-top: var(--s4); padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2); }
.inline-form .btn-row { margin-top: var(--s3); }

/* Forms */
.auth { max-width: 460px; margin: var(--s5) auto; }
.form .btn[type='submit'] { margin-right: var(--s2); }
.choice { border: 0; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s2); }
.choice legend { font-weight: 700; font-size: var(--t-sm); margin-bottom: var(--s2); }
.choice-item { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.choice-item:has(input:checked) { border-color: var(--velvet); background: var(--velvet-soft); }
.choice-item input { margin-top: 4px; accent-color: var(--velvet); }
.choice-item span { display: grid; }
.choice-item small { color: var(--ink-2); }
.chips-check { border: 0; padding: 0; margin: 0 0 var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips-check legend { font-weight: 700; font-size: var(--t-sm); margin-bottom: var(--s2); }
.chip-check { display: inline-flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); cursor: pointer; font-size: var(--t-sm); }
.chip-check:has(input:checked) { border-color: var(--velvet); background: var(--velvet-soft); color: var(--velvet); font-weight: 700; }
.chip-check input { accent-color: var(--velvet); }
.check.inline { margin: 0; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 700px) { .grid-3 { grid-template-columns: 1fr; gap: 0; } }
.hours { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.hours-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.hours-row select { width: auto; min-width: 150px; }
.hours-row input { width: 130px; }
.copy { display: flex; gap: var(--s2); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th, .table td { text-align: left; padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { color: var(--ink-2); font-weight: 700; }
.card:has(> .table) { overflow-x: auto; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: var(--s5); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 20;
  background: var(--ink); color: var(--hall); padding: var(--s3) var(--s5); border-radius: var(--r-pill); font-weight: 700; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
