/* Charcoal, ivory and brass. Original geometry inspired by darbuka inlay. */
/* Account practice dashboard: the existing instruments and player remain unchanged. */
.practice-dashboard-tabs { display:flex; flex-wrap:wrap; gap:4px; padding:5px; background:#1b1e20; border:1px solid #373b3c; border-radius:12px; }
.practice-dashboard-tabs button { background:transparent; border-color:transparent; padding:10px 15px; }
.practice-dashboard-tabs button[aria-pressed="true"] { background:#363428; color:#f1e8ca; border-color:#665c40; }
.practice-dashboard-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.practice-stat,.practice-dashboard-panel,.practice-achievement { background:#1b1e20; border:1px solid #343a3c; border-radius:14px; padding:22px; min-width:0; }
.practice-stat p { display:flex; align-items:center; gap:8px; color:#b5b5ac; font-size:13px; margin:0 0 12px; }
.practice-stat strong { display:block; font-family:Georgia,serif; font-size:30px; font-weight:400; line-height:1.3; color:#eee9dc; font-variant-numeric:tabular-nums; }
.practice-stat small { display:block; margin-top:9px; color:#b5b5ac; }
.practice-progress-track { height:6px; margin-top:13px; border-radius:8px; background:#343838; overflow:hidden; }
.practice-progress-track > div { height:100%; background:#cdb77a; border-radius:8px; transition:width .2s ease; }
.practice-dashboard-columns { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.practice-dashboard-panel h2,.practice-section-heading h2 { margin:0; font-size:20px; }
.practice-dashboard-panel h3 { margin:0; }
.practice-next { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:18px; }
.practice-next h2 { font-family:Georgia,serif; font-size:34px; font-weight:400; overflow-wrap:anywhere; }
.practice-next p { margin:0; }
.practice-eyebrow { color:#d6c28e; font-size:12px; text-transform:uppercase; letter-spacing:.09em; margin:0 0 12px; }
.practice-section-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:18px; }
.practice-section-heading p { margin:0; }
.practice-quest { display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:12px; align-items:center; padding:18px 0; border-bottom:1px solid #343a3c; }
.practice-quest:last-child { border-bottom:0; padding-bottom:0; }
.practice-quest a { color:#eee9dc; font-weight:500; text-decoration:none; }
.practice-quest a:hover { text-decoration:underline; }
.practice-quest p { margin:5px 0; }
.practice-quest-check { width:26px; height:26px; border-radius:50%; border:1px solid #525b5d; display:flex; align-items:center; justify-content:center; }
.practice-quest-check.complete { background:#353829; color:#d6c28e; border-color:transparent; }
.practice-xp { color:#d6c28e; font-size:12px; white-space:nowrap; }
.practice-week { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:22px; margin-top:18px; }
.practice-week-days { display:flex; justify-content:space-between; gap:5px; }
.practice-week-day { display:flex; flex-direction:column; align-items:center; gap:10px; font-size:12px; color:#b5b5ac; }
.practice-week-day > span:last-child { width:32px; height:32px; border-radius:50%; background:#303536; display:flex; align-items:center; justify-content:center; }
.practice-week-day.complete > span:last-child { color:#d6c28e; background:#363428; }
.practice-goals { margin-top:18px; padding:18px 22px; border:1px solid #343a3c; border-radius:12px; background:#191c1e; }
.practice-goals summary { cursor:pointer; color:#d6c28e; }
.practice-goal-form { display:flex; align-items:end; flex-wrap:wrap; gap:14px; margin-top:18px; }
.practice-goal-form .field { flex:1; min-width:170px; }
.practice-time-zone { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:18px; }
.practice-time-zone p { margin:0; overflow-wrap:anywhere; }
.practice-time-zone button { background:transparent; }
.modal.practice-time-zone-modal { width:min(480px,calc(100% - 32px)); }
.practice-time-zone-modal .modal-actions:empty { display:none; }
.practice-time-zone-form { display:grid; gap:14px; min-width:0; }
.practice-time-zone-form .field,.practice-time-zone-form p { margin:0; min-width:0; }
.practice-time-zone-form select { width:100%; min-width:0; }
.practice-time-zone-form > button { justify-self:start; }
.practice-time-zone-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:8px; }
.practice-calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.practice-calendar-day { display:flex; align-items:center; justify-content:space-between; gap:4px; min-height:48px; padding:9px 12px; background:#222729; color:#b5b5ac; border:1px solid transparent; border-radius:8px; }
.practice-calendar-day.has-practice { background:#303226; color:#e5d4a8; }
.practice-calendar-day.complete { background:#47432c; color:#f0e2bd; }
.practice-calendar-day[aria-pressed="true"] { outline:2px solid #d6c28e; outline-offset:1px; }
.practice-calendar-detail { min-height:24px; margin:16px 0 0; color:#cbc9bf; }
.practice-collection { margin-top:26px; }
.practice-collection-help { margin:-6px 0 12px; }
.practice-collection-legend { display:flex; flex-wrap:wrap; gap:10px 20px; list-style:none; padding:0; margin:0 0 18px; color:#b5b5ac; font-size:12px; }
.practice-collection-legend li { display:flex; align-items:center; gap:7px; }
.practice-collection [data-familiarity="new"] { --rhythm-fill:#1b1e20; --rhythm-edge:#343a3c; }
.practice-collection [data-familiarity="starting"] { --rhythm-fill:#25251f; --rhythm-edge:#494737; }
.practice-collection [data-familiarity="building"] { --rhythm-fill:#2e2e23; --rhythm-edge:#605c3f; }
.practice-collection [data-familiarity="regular"] { --rhythm-fill:#383827; --rhythm-edge:#77704d; }
.practice-collection [data-familiarity="comfortable"] { --rhythm-fill:#283b33; --rhythm-edge:#64816b; }
.practice-familiarity-swatch { width:12px; height:12px; flex-shrink:0; border-radius:3px; background:var(--rhythm-fill); border:1px solid var(--rhythm-edge); }
.practice-rhythm-grid,.practice-achievement-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.practice-rhythm-grid .practice-rhythm { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:14px; text-align:start; background:var(--rhythm-fill); padding:20px; border:1px solid var(--rhythm-edge); border-radius:12px; white-space:normal; }
.practice-rhythm-grid .practice-rhythm:hover { border-color:#cdb77a; }
.practice-rhythm-grid .practice-rhythm:focus-visible { outline:2px solid #d6c28e; outline-offset:3px; }
.practice-rhythm > .ui-icon { width:18px; height:18px; color:var(--accent); }
.practice-rhythm strong { display:block; font:400 23px/1.3 Georgia,serif; overflow-wrap:anywhere; }
.practice-rhythm small { display:block; color:#b5b5ac; margin-top:10px; }
.practice-rhythm small.practice-rhythm-sessions { margin-top:5px; font-size:11px; }
.practice-collection-toggle { margin-top:14px; }
.practice-rhythm-detail { display:grid; gap:18px; }
.practice-rhythm-detail p { margin:0; }
.practice-rhythm-detail > .button { justify-self:start; }
.modal.practice-rhythm-modal { width:min(520px,calc(100% - 32px)); }
.practice-rhythm-modal .modal-actions:empty { display:none; }
.practice-measured { margin-top:20px; }
.practice-measured .button { margin-top:12px; }
.practice-recent { margin-top:20px; }
.practice-recent-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:14px; align-items:center; padding:15px 0; border-bottom:1px solid #343a3c; }
.practice-recent-row a { color:#eee9dc; overflow-wrap:anywhere; }
.practice-session-result { display:block; margin-top:4px; }
.practice-recent-row:last-child { border-bottom:0; padding-bottom:0; }
.practice-achievement { --tier-colour:#b5b5ac; display:flex; flex-direction:column; }
.practice-achievement[data-tier="bronze"] { --tier-colour:#d5ab84; }
.practice-achievement[data-tier="silver"] { --tier-colour:#c4cdd3; }
.practice-achievement[data-tier="gold"] { --tier-colour:#dec588; }
.practice-achievement[data-tier="platinum"] { --tier-colour:#b6d9cc; }
.practice-achievement-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:18px; color:var(--tier-colour); }
.practice-achievement-heading > .ui-icon { width:27px; height:27px; }
.practice-achievement-tier { font-size:12px; }
.practice-achievement h3 { margin:0 0 10px; }
.practice-achievement-description { margin:0 0 18px; }
.practice-achievement-status { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; color:var(--tier-colour); margin:auto 0 0; font-size:13px; }
.practice-achievement.earned .practice-progress-track > div { background:var(--tier-colour); }
.practice-achievement-levels { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; padding:0; margin:18px 0 0; list-style:none; font-size:11px; color:#b5b5ac; }
.practice-achievement-levels li { display:flex; flex-direction:column; align-items:center; gap:6px; }
.practice-achievement-levels li > span { display:flex; align-items:center; justify-content:center; width:22px; height:22px; border:1px solid #535957; border-radius:50%; }
.practice-achievement-levels .ui-icon { width:13px; height:13px; }
.practice-achievement-levels .earned { color:var(--tier-colour); }
.practice-achievement-levels .earned > span { background:#ffffff09; border-color:var(--tier-colour); }
.practice-achievement-levels [aria-current="step"] > span { border-color:#cdb77a; border-style:dashed; }
.practice-dashboard-welcome { display:flex; align-items:flex-start; flex-wrap:wrap; gap:18px; padding:32px; }
.practice-dashboard-welcome h2,.practice-dashboard-welcome p { width:100%; margin:0; }
.practice-dashboard-welcome > .ui-icon { width:32px; height:32px; color:#d6c28e; }
.practice-history-warning { margin:0 0 20px; padding:14px; border:1px solid #7d6947; border-radius:10px; }
@media(max-width:760px) {
  .practice-dashboard-columns,.practice-week { grid-template-columns:1fr; }
  .practice-dashboard-stats { gap:8px; }
  .practice-stat { padding:14px 11px; }
  .practice-stat strong { font-size:23px; }
  .practice-stat p { font-size:12px; gap:5px; flex-wrap:wrap; }
  .practice-stat p .ui-icon { width:15px; height:15px; }
  .practice-stat small { font-size:11px; }
  .practice-rhythm-grid,.practice-achievement-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .practice-dashboard-panel,.practice-achievement { padding:18px; }
  .practice-rhythm-grid .practice-rhythm { padding:15px; }
  .practice-calendar-day { padding:8px 5px; }
  .practice-week-days { max-width:440px; width:100%; }
  .practice-recent-row { grid-template-columns:minmax(0,1fr) auto; }
  .practice-recent-row > a { grid-column:1 / -1; }
}
@media(max-width:420px) {
  .practice-achievement-grid { grid-template-columns:1fr; }
  .practice-dashboard-tabs { width:100%; }
  .practice-dashboard-tabs button { flex:1; padding:10px 7px; font-size:13px; }
  .practice-stat strong { font-size:20px; }
  .practice-stat p .ui-icon { display:none; }
  .practice-calendar { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .practice-rhythm strong { font-size:20px; }
  .practice-rhythm-detail .field { min-width:0; width:100%; }
}
@media(prefers-reduced-motion:reduce) { .practice-progress-track > div { transition:none; } }
/* A compact first-visit notice; the full dialog opens only from Privacy settings. */
.privacy-panel {
  box-sizing: border-box; width: min(600px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  overflow: auto; padding: 24px; border: 1px solid #6b6251; border-radius: 14px;
  background: #1c2022; color: #f1eee7; box-shadow: 0 12px 48px #0008;
  font: 400 14px/1.6 var(--sans, system-ui, sans-serif); text-align: start;
}
.privacy-dialog { margin: auto; }
.privacy-dialog::backdrop { background: #090b0dcc; }
.privacy-notice {
  position: fixed; z-index: 65; inset-inline: 0; margin-inline: auto;
  bottom: calc(var(--transport-height, 0px) + max(18px, env(safe-area-inset-bottom)) + 12px);
  box-sizing: border-box; width: min(1040px, calc(100% - 40px));
  max-height: max(88px, calc(100dvh - var(--transport-height, 0px) - 130px)); overflow: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px;
  padding: 12px 18px; border: 1px solid #6b6251; border-radius: 12px;
  background: #1c2022; color: #f1eee7; box-shadow: 0 4px 20px #0005;
  font: 400 13px/1.6 var(--sans, system-ui, sans-serif); text-align: start;
}
.privacy-notice[hidden] { display: none; }
.privacy-notice p { margin: 0; }
.privacy-notice-copy a { color: #dfc99b; text-decoration: underline; text-underline-offset: 3px; }
.privacy-notice .privacy-actions { margin: 0; gap: 10px; }
.privacy-notice .privacy-choice { min-height: 44px; padding: 8px 12px; }
.privacy-notice .privacy-error { grid-column: 1 / -1; }
.privacy-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 12px; }
.privacy-panel h2 { margin: 0; color: #f1eee7; font-size: 22px; line-height: 1.35; font-weight: 600; }
.privacy-panel p { margin: 0 0 12px; }
.privacy-panel .privacy-close {
  flex: 0 0 44px; width: 44px; min-height: 44px; margin: -10px -10px 0;
  padding: 0; border: 1px solid transparent; background: transparent; color: #f1eee7; font-size: 24px;
}
.privacy-panel .privacy-close:hover { background: #ffffff0d; border-color: #8a7a5b; }
.privacy-panel .privacy-status { color: #dfc99b; font-size: 13px; }
.privacy-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.privacy-choice {
  min-width: 0; min-height: 48px; padding: 11px 14px; border: 1px solid #cbb27e;
  border-radius: 8px; color: #f1eee7; background: #cbb27e12; font: inherit; font-weight: 600;
}
.privacy-choice:hover { border-color: #e5cfa4; color: #fff; background: #cbb27e26; }
:is(.privacy-panel, .privacy-notice) :is(button, a, [tabindex]):focus-visible { outline: 3px solid #dfc99b; outline-offset: 3px; }
.privacy-details { color: #b9b8b2; font-size: 12px; }
.privacy-details p { margin-bottom: 4px; }
.privacy-details a { display: inline-flex; align-items: center; min-height: 36px; color: #dfc99b; text-decoration: underline; text-underline-offset: 3px; }
.privacy-error { color: #ffbbac; font-size: 13px; }
@media (max-width: 760px) {
  .privacy-notice {
    width: calc(100% - 24px); grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 8px;
    bottom: calc(var(--transport-height, 0px) + max(10px, env(safe-area-inset-bottom)) + 10px);
  }
  /* Allow translated labels to wrap without crowding the player on narrow screens. */
  .privacy-notice p { line-height: 1.4; }
  .privacy-notice .privacy-choice { padding: 6px 8px; line-height: 1.3; }
}
@media (max-width: 480px) {
  .privacy-panel { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 20px; font-size: 13px; }
  .privacy-actions { gap: 10px; }
  .privacy-panel .privacy-choice { padding-inline: 8px; }
}
html { scrollbar-gutter: stable; }
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.app-content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.app-content>main { flex: 1; min-width: 0; }
.site-footer {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; flex-shrink: 0; gap: 8px clamp(14px, 3vw, 24px);
  width: 100%; margin: 0; padding: 20px max(24px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  border-top: 1px solid #ffffff0d; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center;
  white-space: normal;
}
.site-footer p { margin: 0; font-size: 11px; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 clamp(12px, 2vw, 20px); }
.site-footer a { display: inline-flex; align-items: center; min-height: 36px; color: inherit; font: inherit; text-decoration: none; }
.site-footer a:hover, .site-footer a[aria-current] { color: var(--accent-hover); }
@media (max-width: 760px) {
  .site-footer { flex-direction: column; gap: 4px; padding: 16px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); font-size: 11px; }
  .site-footer nav { gap: 0 18px; }
  .site-footer a { min-height: 40px; }
}
@media (max-width: 360px) {
  .site-footer { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .site-footer nav { gap: 0 14px; }
}

/* Training modes and listening practice. */
.training-back { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 22px; color: var(--muted); font-size: 13px; text-decoration: none; }
.training-back:hover { color: var(--accent-hover); }
.training-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.training-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color .18s, background .18s; }
.training-card:hover { border-color: var(--accent); background: var(--surface); }
.training-card-art { display: grid; place-items: center; align-self: start; width: 56px; height: 56px; border: 1px solid #cbb27e40; border-radius: 50%; background: radial-gradient(ellipse at center, #cbb27e16, transparent 65%), #171a1c; color: var(--accent); }
/* Keep the circular decoration on the wrapper so the SVG's corners stay visible. */
.training-card-art>.ui-icon { display: block; width: 28px; height: 28px; overflow: visible; }
.training-card-art-reading { color: var(--teal); border-color: #91b9b740; background: radial-gradient(ellipse at center, #91b9b716, transparent 65%), #171a1c; }
.training-card-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.training-card h2 { margin: 2px 0 10px; font: 400 26px/1.2 var(--serif); letter-spacing: -.5px; }
.training-card-description { color: var(--subtle); font-size: 14px; line-height: 1.6; margin: 0 0 12px; }
.training-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.training-card-tags span { padding: 4px 8px; border-radius: 5px; background: #ffffff05; color: var(--muted); font-size: 11px; }
.training-card-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding-top: 6px; margin-top: 16px; color: var(--accent-hover); font-size: 13px; font-weight: 500; }
.training-hub-note { margin: 20px 0 0; color: var(--muted); font-size: 13px; }
.listening-layout { display: grid; grid-template-columns: minmax(0, 1fr) 282px; align-items: start; gap: 26px; }
.listening-workspace { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); scroll-margin-top: 110px; }
.listening-question-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.listening-question-header .training-eyebrow { margin: 0; color: var(--accent); }
.listening-score { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.listening-player { text-align: center; padding: 26px 8px 18px; }
.listening-symbol { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 22px; border-radius: 50%; color: var(--accent); background: var(--green-light); border: 1px solid #cbb27e40; transition: box-shadow .2s; }
.listening-symbol .ui-icon { width: 33px; height: 33px; }
.listening-page.is-playing .listening-symbol { box-shadow: 0 0 0 7px #cbb27e0a, 0 0 0 14px #cbb27e05; }
.listening-player h2 { margin: 0 0 10px; font: 400 clamp(24px, 2.4vw, 32px)/1.25 var(--serif); }
.listening-player>.hint { max-width: 420px; margin: 0 auto; font-size: 12px; line-height: 1.8; }
.listening-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 13px; }
.listening-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.listening-controls .primary { min-width: 155px; }
.listening-player>.listening-status { min-height: 22px; color: var(--muted); font-size: 11px; }
.listening-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.listening-option { display: flex; flex-wrap: wrap; align-items: center; text-align: left; gap: 10px; min-height: 68px; padding: 14px; }
.listening-option-number { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; }
.listening-option-number .ui-icon { width: 17px; height: 17px; }
.listening-option-name { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.listening-option-result { width: 100%; padding-left: 37px; font-size: 10px; }
button.listening-option:disabled { opacity: .65; }
button.listening-option[aria-disabled=true]:not(:disabled) { cursor: default; }
button.listening-option.is-correct, button.listening-option.is-correct:hover { color: #b9d9c2; border-color: #719c7d; background: #26372d; }
button.listening-option.is-incorrect, button.listening-option.is-incorrect:hover { color: var(--danger); border-color: #ad7367; background: #392b29; }
.listening-option.is-correct .listening-option-number, .listening-option.is-incorrect .listening-option-number { color: inherit; border-color: currentColor; }
.listening-feedback { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 9px; background: var(--field); }
.listening-feedback h3 { font-size: 17px; margin: 0 0 8px; font-weight: 550; }
.listening-feedback.is-correct h3 { color: #b9d9c2; }
.listening-feedback p { font-size: 13px; line-height: 1.8; color: var(--subtle); margin: 9px 0; }
.listening-feedback .listening-reveal { color: var(--accent); font-size: 11px; }
.listening-feedback button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 12px; }
.listening-answer-hint { font-size: 11px; line-height: 1.7; margin: 22px 0 0; }
.listening-settings { display: grid; gap: 20px; min-width: 0; }
.listening-settings .training-panel>.field { margin-top: 0; }
.listening-settings .training-panel>.field+.field { margin-top: 18px; }
.listening-settings .training-panel>.hint { margin: 10px 0 22px; }
@media (max-width: 900px) {
  .listening-layout { grid-template-columns: minmax(0, 1fr); }
  .listening-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .training-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .listening-settings { grid-template-columns: minmax(0, 1fr); }
  .training-cards { gap: 12px; }
  .training-card { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .training-card-art { width: 44px; height: 44px; }
  .training-card-art>.ui-icon { width: 24px; height: 24px; }
  .training-card h2 { font-size: 23px; }
  .listening-workspace { padding: 20px 16px; }
  .listening-player { padding-inline: 0; }
  .listening-options { gap: 10px; }
  .listening-option { padding: 12px 10px; gap: 8px; }
  .listening-option-name { font-size: 13px; }
  .listening-option-result { padding-left: 0; }
  .listening-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .listening-controls button { padding: 10px 6px; gap: 5px; font-size: 12px; white-space: normal; }
  .listening-controls .primary { min-width: 0; }
  .listening-controls .ui-icon { width: 16px; height: 16px; flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .training-card, .listening-symbol { transition: none; }
}

/* Hold the beat: give the vertical practice area room while keeping its feedback in view. */
.training-card-art-pulse { color: #c1add0; border-color: #c1add040; background: radial-gradient(ellipse at center, #c1add016, transparent 65%), #171a1c; }
.pulse-route.reading-route .app-content>main { padding-bottom: 0; }
.page.pulse-page { --pulse-space: clamp(10px, calc(10dvh - 60px), 32px); padding-top: 14px; padding-bottom: 10px; }
.pulse-page .training-back { margin-bottom: 10px; font-size: 12px; }
.pulse-page .page-heading { margin-bottom: 12px; }
.pulse-page .page-heading h1 { font-size: clamp(30px, 3vw, 38px); line-height: 1.15; margin-bottom: 6px; }
.pulse-page .page-heading .subtitle { font-size: 13px; line-height: 1.5; margin: 0; }
.pulse-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 20px; }
.pulse-workspace { min-width: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); text-align: center; }
.pulse-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.pulse-heading .training-eyebrow { margin: 0; color: var(--accent); }
.pulse-heading>span:last-child { font-size: 11px; color: var(--muted); }
.pulse-session { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--pulse-space) * 1.5); margin: var(--pulse-space) 0 calc(var(--pulse-space) * 1.2); }
.pulse-session-info, .pulse-tapping { min-width: 0; }
.pulse-tempo { display: flex; justify-content: center; gap: 8px; align-items: baseline; }
.pulse-tempo strong { font: 400 clamp(52px, 7dvh, 72px)/1 var(--serif); color: var(--accent-hover); font-variant-numeric: lining-nums tabular-nums; }
.pulse-tempo span { font-size: 11px; color: var(--subtle); letter-spacing: .1em; }
.pulse-tempo-details { display: grid; justify-content: center; gap: 4px; margin-top: 8px; }
.pulse-gap { margin: 0; color: var(--subtle); font-size: 11px; line-height: 1.5; }
.pulse-stage { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
button.pulse-tap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; width: min(100%, calc(clamp(140px, 20dvh, 196px) + var(--pulse-space) + 16px)); height: auto; aspect-ratio: 1; margin: 0 auto; padding: 14px; border: 1px solid #cbb27e70; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #cbb27e16, #cbb27e05); color: var(--accent-hover); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button.pulse-tap:disabled { opacity: .5; }
button.pulse-tap .ui-icon { width: 24px; height: 24px; }
button.pulse-tap strong { font: 400 30px/1.2 var(--serif); }
button.pulse-tap span { font-size: 11px; color: var(--muted); }
button.pulse-tap.is-tapped { background: #cbb27e30; border-color: var(--accent-hover); box-shadow: 0 0 0 6px #cbb27e10; }
button.pulse-tap.is-counting-in { opacity: 1; }
button.pulse-tap.is-counting-in strong { font-size: clamp(42px, 7dvh, 60px); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.pulse-feedback { min-height: 44px; display: grid; justify-content: center; align-content: start; gap: 8px; margin-top: var(--pulse-space); }
.pulse-feedback strong { font-size: 15px; line-height: 1.3; font-weight: 500; }
.pulse-feedback span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.pulse-feedback[data-timing=on-time] strong { color: #b9d9c2; }
.pulse-feedback[data-timing=early] strong, .pulse-feedback[data-timing=late] strong { color: var(--accent-hover); }
.pulse-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: var(--pulse-space); }
.pulse-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 14px; font-size: 12px; }
.pulse-controls .primary { min-width: 100px; }
.pulse-announcement { font-size: 11px; line-height: 1.6; margin: 0 0 12px; }
.pulse-announcement[hidden], .pulse-results[hidden] { display: none; }
.pulse-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 10px; gap: 12px; }
.pulse-stats>div { display: grid; gap: 4px; }
.pulse-stats span { font-size: 11px; line-height: 1.4; color: var(--subtle); }
.pulse-stats strong { font-size: 22px; line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.pulse-stats small { font-size: 10px; color: var(--muted); line-height: 1.4; }
.pulse-settings { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.pulse-settings>summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 12px; padding: 12px 18px; list-style: none; cursor: pointer; }
.pulse-settings>summary::-webkit-details-marker { display: none; }
.pulse-settings>summary::after { content: '+'; grid-column: 2; grid-row: 1 / 3; color: var(--accent); font-size: 23px; line-height: 1; }
.pulse-settings[open]>summary::after { content: '−'; }
.pulse-settings>summary strong { font: 400 21px/1.2 var(--serif); }
.pulse-settings>summary span { grid-column: 1; color: var(--muted); font-size: 11px; }
.pulse-settings-content { padding: 0 18px 16px; }
.pulse-setting-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pulse-settings-content>.pulse-setting-fields:not(:first-child) { margin-top: 10px; }
.pulse-settings .field { min-width: 0; margin: 0; gap: 5px; }
.pulse-settings .field-label { font-size: 11px; }
.pulse-settings input[type=number], .pulse-settings select { width: 100%; min-height: 38px; padding: 7px 9px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pulse-settings-content>.field { margin-top: 10px; }
.pulse-settings input[type=range] { width: 100%; min-height: 24px; accent-color: var(--accent); }
.pulse-settings-content>.hint { font-size: 10px; line-height: 1.6; margin: 5px 0 0; }
.pulse-plan-note { margin: 12px 0 0; font-size: 11px; line-height: 1.6; color: var(--accent); }
.pulse-tips { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.pulse-tips summary { font-size: 11px; color: var(--subtle); cursor: pointer; }
.pulse-tips p { font-size: 11px; line-height: 1.7; color: var(--muted); margin: 10px 0 0; }
.pulse-results { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); text-align: left; }
.pulse-results summary { font-size: 12px; color: var(--subtle); cursor: pointer; }
.pulse-results-scroll { overflow: auto; max-height: 168px; }
.pulse-results table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.pulse-results caption { text-align: left; color: var(--muted); font-size: 11px; padding-bottom: 8px; }
.pulse-results th, .pulse-results td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.pulse-results th:first-child { text-align: left; }
.pulse-results thead th { color: var(--muted); font-size: 10px; font-weight: 500; }
@media (max-width: 850px) {
  .pulse-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pulse-settings>summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; }
  .pulse-settings>summary strong { font-size: 18px; }
  .pulse-settings>summary span { grid-column: 2; text-align: right; }
  .pulse-settings>summary::after { grid-column: 3; grid-row: 1; }
}
@media (max-width: 540px) {
  .page.pulse-page { padding-top: 14px; padding-bottom: 12px; }
  .pulse-page .training-back { margin-bottom: 8px; }
  .pulse-page .page-heading { margin-bottom: 10px; }
  .pulse-workspace { padding: 20px 18px; }
  .pulse-heading { gap: 6px; }
  .pulse-heading .training-eyebrow { font-size: 11px; }
  .pulse-controls .primary { min-width: 88px; }
  .pulse-controls button { padding-inline: 10px; }
  .pulse-stats { gap: 8px; }
  .pulse-stats strong { font-size: 19px; }
  .pulse-stats small { font-size: 9px; }
}
@media (max-width: 380px) {
  .pulse-settings>summary { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .pulse-settings>summary span { grid-column: 1; text-align: left; }
  .pulse-settings>summary::after { grid-column: 2; grid-row: 1 / 3; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  /* The navigation occupies a second row at these widths. */
  .page.pulse-page { --pulse-space: clamp(6px, calc(10dvh - 66px), 32px); }
}
@media (min-width: 851px) and (max-height: 760px) {
  .pulse-tempo-details { display: flex; flex-wrap: wrap; gap: 4px 12px; }
}
@media (max-height: 680px) {
  .page.pulse-page { --pulse-space: 8px; }
  .pulse-page .training-back { margin-bottom: 6px; }
  .pulse-page .page-heading { margin-bottom: 10px; }
  .pulse-page .page-heading h1 { font-size: 30px; }
  .pulse-workspace { padding-block: 14px; }
  .pulse-tempo strong { font-size: 48px; }
  .pulse-tempo-details { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  button.pulse-tap { width: min(100%, calc(136px + var(--pulse-space))); gap: 4px; }
  button.pulse-tap .ui-icon { width: 20px; height: 20px; }
  button.pulse-tap strong { font-size: 26px; }
}
@media (min-width: 761px) and (max-width: 1100px) and (max-height: 680px) {
  .page.pulse-page { --pulse-space: 4px; }
}

/* Rhythm reading: a quiet music sheet beside the practice settings. */
.training-layout { display: grid; grid-template-columns: minmax(0, 1fr) 282px; align-items: start; gap: 26px; }
.training-workspace, .training-settings { min-width: 0; }
.training-sheet { --score-ink: #302e28; padding: 28px 28px 20px; border-radius: 14px 14px 0 0; color: var(--score-ink); background: #f3eee3; border: 1px solid #dcd4c3; box-shadow: 0 14px 40px #00000018; }
.training-sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.training-eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 500; line-height: 1.5; letter-spacing: 0; }
.training-sheet h2 { margin: 0; font: 400 clamp(23px, 2.4vw, 32px)/1.2 var(--serif); letter-spacing: -.6px; color: var(--score-ink); }
.training-meter { display: grid; justify-items: center; font: 700 27px/.95 var(--notation-font); padding-inline: 12px; }
.training-sheet-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; color: #66604f; font-size: 12px; }
.training-level-badge { color: #51452b; background: #e4dcc8; border: 1px solid #d3c7ac; border-radius: 5px; padding: 4px 8px; font-size: 11px; font-weight: 600; }
.training-score { margin-top: 20px; }
.training-bar { display: flex; align-items: center; min-width: 0; padding-block: 4px; }
.training-bar-number { font-family:var(--notation-font); align-self: center; width: 22px; flex: 0 0 22px; color: #817965; font-size: 10px; font-variant-numeric: tabular-nums; }
.training-bar.is-current .training-bar-number { color: #785814; font-weight: 750; }
.training-staff { font-family:var(--notation-font); display: block; width: 100%; min-width: 0; height: auto; overflow: visible; color: var(--score-ink); }
.training-tuplet { fill: currentColor; font: italic 18px var(--notation-font); }
.training-count { fill: #79705b; font: 14px var(--notation-font); }
.training-cursor { stroke: #9a7132; }
.training-beat-highlight { fill: #ba974a; opacity: .16; }
.training-note.is-current { color: #9b6817; }
.training-sheet-note { font-size: 11px; color: #706754; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #dcd4c3; }
.training-player { padding: 20px 24px 12px; background: var(--paper); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
.training-pulse-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.training-pulse { display: flex; gap: 8px; }
.training-pulse>span { display: grid; place-items: center; width: 30px; height: 30px; font-size: 11px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.training-pulse>span.is-current { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.training-position { color: var(--subtle); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.training-controls { display: flex; gap: 10px; }
.training-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; font-size: 12px; }
.training-controls .ui-icon { width: 17px; height: 17px; }
.training-controls #training-play { min-width: 110px; }
.training-next { margin-left: auto; }
.training-announcement { min-height: 2.7em; margin: 16px 0 0; font-size: 11px; line-height: 1.6; }
.training-settings { display: grid; gap: 18px; }
.training-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 23px; }
.training-panel h2 { margin: 0 0 20px; font: 400 22px/1.25 var(--serif); }
.training-levels { border: 0; min-width: 0; padding: 0; margin: 0; }
.training-levels legend { font-size: 12px; color: var(--subtle); }
.training-levels>.hint { margin: 5px 0 16px; font-size: 11px; }
.training-level { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.training-level+.training-level { border-top: 1px solid var(--line); }
.training-level input { appearance: auto; accent-color: var(--accent); min-height: 0; width: 17px; height: 17px; margin: 3px 0 0; flex-shrink: 0; padding: 0; }
.training-level strong { display: block; font-size: 13px; font-weight: 550; }
.training-level small { display: block; color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 4px; }
.training-level-hint { border-top: 1px solid var(--line); padding-top: 16px; margin: 10px 0 0; font-size: 11px; line-height: 1.7; }
.training-tempo { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.training-tempo .field { display: flex; flex-direction: column-reverse; text-align: center; gap: 5px; margin: 0; }
.training-tempo input { width: 95px; padding: 0; border: 0; background: transparent; color: var(--accent-hover); font-size: 40px; line-height: 1.3; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.training-tempo input::-webkit-inner-spin-button, .training-tempo input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.training-tempo button { width: 37px; min-height: 37px; padding: 0; font-size: 20px; border-radius: 50%; }
.training-panel input[type=range] { width: 100%; accent-color: var(--accent); }
.training-panel>.hint { font-size: 11px; line-height: 1.7; margin: 0 0 22px; }
.training-panel>.field { margin-top: 18px; }
.training-volume-label { display: flex; justify-content: space-between; }
.training-how { padding: 6px 8px; color: var(--muted); }
.training-how p { font-size: 12px; line-height: 1.8; margin: 0; }
.training-shortcuts { color: var(--muted); font-size: 11px; margin: 22px 0 0; text-align: center; line-height: 1.8; }
@media (min-width: 1101px) {
  .training-score { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; margin-block: 28px 16px; }
  .training-count { font-size: 19px; }
}
@media (max-width: 1100px) {
  .training-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
  .training-sheet { padding-inline: 20px; }
  .training-player { padding-inline: 18px; }
  .training-controls { flex-wrap: wrap; }
  .training-controls button { flex: 1 0 calc(50% - 10px); }
}
@media (max-width: 850px) {
  .training-layout { grid-template-columns: minmax(0, 1fr); }
  .training-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .training-how { grid-column: 1 / -1; }
  .training-controls { flex-wrap: nowrap; }
  .training-controls button { flex: 0 1 auto; }
}
@media (max-width: 540px) {
  .training-sheet { padding: 22px 12px 16px; }
  .training-sheet-heading, .training-sheet-meta { margin-inline: 5px; }
  .training-sheet h2 { font-size: 24px; }
  .training-bar-number { width: 15px; flex-basis: 15px; font-size: 9px; }
  .training-bar { padding-block: 9px; }
  .training-count { font-size: 20px; }
  .training-tuplet { font-size: 22px; }
  .training-player { padding-inline: 16px; }
  .training-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .training-controls button { width: 100%; }
  .training-settings { grid-template-columns: minmax(0, 1fr); }
  .training-position { font-size: 11px; }
  .training-panel { padding: 22px; }
  .training-sheet-note { line-height: 1.6; margin-inline: 5px; }
}
/* Paradiddle notation wraps by beat, keeping T/K and hand labels readable on phones. */
.sticking-page .training-back { margin-bottom: 14px; }
.sticking-page .page-heading { margin-bottom: 24px; }
.sticking-page .page-heading h1 { font-size: clamp(32px, 4vw, 44px); }
.sticking-page .training-settings { align-items: start; }
.sticking-page .training-how { grid-column: 1 / -1; }
.paradiddle-setup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-bottom: 20px; }
.paradiddle-setup .field { margin: 0; min-width: 0; }
.paradiddle-setup select { min-width: 0; width: 100%; }
.paradiddle-setup.is-shuffled { grid-template-columns: minmax(0, 1fr); }
.paradiddle-score { margin: 25px 0 12px; container-type: inline-size; }
.paradiddle-bar+.paradiddle-bar { margin-top: 20px; }
.paradiddle-bar-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 16px; color: #706754; font-size: 11px; margin-bottom: 8px; }
.paradiddle-bar.is-current .paradiddle-bar-heading { color: #785814; }
.paradiddle-staff { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.paradiddle-staff.is-dense { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
.paradiddle-beat { font-family:var(--notation-font); display: block; width: 100%; height: auto; min-width: 0; overflow: visible; }
.paradiddle-staff-line { color: #b0a48e; }
.paradiddle-beam { color: #5f594b; }
.paradiddle-note[data-stroke=T], .paradiddle-tak { color: #806027; }
.paradiddle-note[data-stroke=K], .paradiddle-ka { color: #336f70; }
.paradiddle-note-highlight { fill: #bd984c; opacity: 0; }
.paradiddle-note.is-current .paradiddle-note-highlight { opacity: .22; }
.paradiddle-stroke-label { fill: #302e28; font: 600 17px var(--notation-font); }
.paradiddle-count, .paradiddle-hand-label { fill: #69614f; font: 15px var(--notation-font); }
.paradiddle-accent { fill: currentColor; font: 600 20px var(--notation-font); }
.paradiddle-tuplet { fill: currentColor; font: italic 16px var(--notation-font); }
.paradiddle-cursor { color: #9a7132; }
.paradiddle-legend { display: flex; flex-wrap: wrap; gap: 7px 18px; color: #69614f; font-size: 12px; }
.paradiddle-legend .paradiddle-tak::before, .paradiddle-legend .paradiddle-ka::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: currentColor; border-radius: 50%; }
.paradiddle-options-panel>.check { display: flex; justify-content: space-between; gap: 12px; }
.paradiddle-options-panel>.check+.check { margin-top: 18px; }
.sticking-page .training-controls .primary { min-width: 100px; }
.paradiddle-course-end { padding: 16px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.paradiddle-course-end button { font-size: 13px; }
.training-card-art-paradiddles { background: radial-gradient(ellipse at center, #cbb27e20, transparent 65%), #171a1c; }
.training-card-art-rolls { background: radial-gradient(ellipse at center, #8eb9b025, transparent 65%), #171a1c; }
.roll-placement { grid-column: 1 / -1; }
.roll-score { margin: 24px 0 18px; container-type: inline-size; }
.roll-bar+.roll-bar { margin-top: 20px; }
.roll-bar-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; color: #706754; font-size: 11px; line-height: 1.7; }
.roll-bar.is-current .roll-bar-heading { color: #785814; }
.roll-pattern-text { font-family: var(--notation-font); letter-spacing: .04em; overflow-wrap: anywhere; }
.roll-staff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
.roll-beat { font-family:var(--notation-font); display: block; width: 100%; height: auto; min-width: 0; overflow: visible; }
.roll-staff-line { color: #b0a48e; }
.roll-beam { color: #5f594b; }
.roll-note { color: #5f594b; }
.roll-note[data-stroke=T] { color: #806027; }
.roll-note[data-stroke=K] { color: #336f70; }
.roll-note[data-stroke=D] { color: #854a36; }
.roll-note[data-stroke=S] { color: #795781; }
.roll-note-highlight { fill: #bd984c; opacity: 0; }
.roll-note.is-current .roll-note-highlight { opacity: .22; }
.roll-stroke-label { fill: #302e28; font: 600 18px var(--notation-font); }
.roll-count, .roll-hand-label { fill: #69614f; font: 15px var(--notation-font); }
.roll-accent { fill: currentColor; font: 600 20px var(--notation-font); }
.roll-tuplet { fill: currentColor; font: italic 16px var(--notation-font); }
.roll-cursor { color: #9a7132; }
.roll-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.roll-stages button { display: grid; justify-items: center; gap: 8px; padding: 10px 4px; color: #69614f; background: #eae3d7; border: 1px solid #c9bda6; font-size: 12px; }
.roll-stages button[aria-pressed=true] { color: #4c3815; background: #dcc79b; border-color: #9a7132; }
.roll-stage-dots { display: flex; gap: 5px; }
.roll-stage-dots i { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
.roll-stage-dots .is-filled { background: currentColor; }
.roll-options>.check { margin-top: 20px; }
.training-card-art-call-response { color: #a6c6c0; background: radial-gradient(ellipse at 50% 70%, #35545080, transparent 70%); }
.call-response-player { border: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.call-response-page .training-sheet { border-radius: 0 0 14px 14px; }
.call-response-page .training-settings { grid-template-columns: minmax(0, 1fr); }
.call-response-page .training-panel>.check { display: flex; justify-content: space-between; }
.call-response-sheet-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 18px; }
.call-response-sheet-toolbar .training-sheet-meta { margin: 0; }
.call-response-sheet-toolbar .check { color: var(--score-ink); }
.call-response-sheet-toolbar .switch-state, .call-response-sheet-toolbar .switch-control input:checked ~ .switch-state { color: #69614f; }
.call-response-turns { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 20px; }
.call-response-turn { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.call-response-turn>svg { width: 24px; height: 24px; flex-shrink: 0; }
.call-response-turn strong, .call-response-turn span { display: block; }
.call-response-turn strong { font-size: 18px; color: var(--subtle); }
.call-response-turn span { margin-top: 3px; font-size: 11px; }
.call-response-turn.is-current { border-color: #c4a56a; background: #c4a56a18; color: #dfc796; }
.call-response-turn.is-current strong { color: #ead3a6; }
.call-response-turn[data-call-response-phase=response].is-current { border-color: #83b7ae; background: #83b7ae18; color: #b0d4cb; }
.call-response-turn[data-call-response-phase=response].is-current strong { color: #c5e4dd; }
.call-response-arrow { color: var(--muted); }
.call-response-score-status { position: sticky; top: 102px; z-index: 1; padding: 12px; margin: 18px 0 0; border: 1px solid #c9bda6; border-radius: 6px; color: #674b18; background: #f3eee3; font-size: 12px; font-weight: 600; }
.call-response-score-status[data-phase=response] { color: #285b54; border-color: #83aaa1; }
.call-response-score { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 24px; direction: ltr; }
.call-response-score .roll-bar { padding: 12px 0; border-top: 1px solid #dcd4c3; }
.call-response-score .roll-bar+.roll-bar { margin-top: 0; }
.call-response-score .roll-bar-heading { margin-bottom: 6px; }
.call-response-score .roll-staff { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.call-response-score .roll-stroke-label { font-size: 22px; }
.call-response-score .roll-count { font-size: 19px; }
.call-response-score .roll-tuplet { font-size: 20px; }
.call-response-score .roll-bar.is-current { background: #bd984c0d; }
@media (min-width: 900px) {
  .call-response-score { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1150px) {
  .call-response-score-status { top: 136px; }
}
@media (max-width: 1100px) {
  .call-response-page .training-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .call-response-score-status { top: 76px; }
}
@media (max-width: 600px) {
  .call-response-turn { padding: 12px 8px; gap: 7px; }
  .call-response-turn>svg { display: none; }
  .call-response-turn strong { font-size: 16px; }
  .call-response-score .roll-staff { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .roll-page .paradiddle-setup { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 560px) {
  .roll-staff { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 560px) {
  .paradiddle-staff { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .paradiddle-staff.is-dense { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 851px) and (max-width: 1000px) {
  .sticking-page .training-layout { grid-template-columns: minmax(0, 1fr); }
  .sticking-page .training-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
:root {
  color-scheme: dark;
  --bg: #111315;
  --site-footer-height: calc(77px + env(safe-area-inset-bottom));
  --paper: #1a1d20;
  --white: #f0ebe2;
  --ink: #f0ebe2;
  --muted: #a0a6a8;
  --line: #34383a;
  --green: #cbb27e;
  --green-light: #302d26;
  --copper: #cbb27e;
  --sand: #302b24;
  --danger: #eda092;
  --shadow: 0 8px 28px #00000016;
  --accent: #cbb27e;
  --accent-hover: #dfc99b;
  --active-fill: #cbb27e14;
  --active-border: #cbb27e55;
  --teal: #91b9b7;
  --stroke-rim-fill: #273b3c;
  --stroke-rim-border: #435f5f;
  --stroke-rim-ink: #bed6d2;
  --stroke-slap-fill: #7da9a6;
  --stroke-slap-border: #91b9b7;
  --stroke-slap-ink: #101d1d;
  --stroke-bass-fill: #3c3527;
  --stroke-bass-border: #66583b;
  --stroke-bass-ink: #dfc796;
  --surface: #202427;
  --field: #171a1c;
  --subtle: #c0c4c2;
  --serif: 'Iowan Old Style', 'Baskerville', 'Palatino Linotype', Georgia, serif;
  font-family: 'Avenir Next', Avenir, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
}
html, body { min-width: 0; background: var(--bg); color: var(--ink); }
body { background-image: radial-gradient(ellipse at 85% 0%, #51412b20, transparent 700px); }
::selection { background: #cbb27e40; color: var(--ink); }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button, .button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; font-weight: 500; min-height: 44px; padding: 10px 16px; transition: border-color .18s, background .18s, color .18s; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; line-height: 1.3; text-align: center; text-decoration: none; }
button:hover:not(:disabled), .button:hover { background: #2a2e30; border-color: #575a57; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #181a19; font-weight: 650; }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.selected, button[aria-pressed=true]:not(.favourite) { background: var(--green-light); color: var(--accent-hover); border-color: #6a5f46; }
button.ghost, .button.ghost { background: transparent; border-color: transparent; color: var(--subtle); }
button.ghost:hover:not(:disabled), .button.ghost:hover { background: #ffffff08; border-color: #ffffff08; color: var(--ink); }
button.small, .button.small { font-size: 12px; }
button.danger, .button.danger { color: var(--danger); }
button:disabled { opacity: .4; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a { color: var(--accent-hover); text-underline-offset: 4px; }
input, select, textarea { color: var(--ink); background: var(--field); border: 1px solid #3b4143; border-radius: 9px; min-height: 44px; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: #90999b; }
input[type=file] { max-width: 100%; padding: 6px; color: var(--muted); font-size: 13px; }
input[type=file]::file-selector-button { margin-inline-end: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
input[type=file]:hover::file-selector-button { border-color: #575a57; background: #2a2e30; }
input[type=range], input[type=checkbox] { accent-color: var(--accent); }

/* Native inputs keep label clicks and Space; the switch makes both states explicit. */
.check { min-height: 44px; min-width: 0; gap: 12px; font-size: 14px; line-height: 1.4; color: var(--ink); }
.check-label { min-width: 0; }
.switch-control { position: relative; display: inline-grid; grid-template-columns: 3ch 44px; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; min-height: 44px; font-size: 12px; }
.switch-control input[type=checkbox] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 44px; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { grid-column: 2; grid-row: 1; width: 44px; height: 26px; border: 1px solid #737c80; border-radius: 999px; background: #343b3e; transition: background .18s ease, border-color .18s ease; }
.switch-track::after { content: ''; display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: var(--ink); box-shadow: 0 1px 3px #00000030; transition: transform .18s ease, background .18s ease; }
.switch-state { grid-column: 1; grid-row: 1; text-align: right; color: var(--muted); }
.switch-on { display: none; }
.switch-control input:checked ~ .switch-track { background: var(--accent); border-color: var(--accent); }
.switch-control input:checked ~ .switch-track::after { transform: translateX(18px); background: var(--bg); }
.switch-control input:checked ~ .switch-state { color: var(--accent-hover); }
.switch-control input:checked ~ .switch-state .switch-on { display: inline; }
.switch-control input:checked ~ .switch-state .switch-off { display: none; }
.check:hover .switch-control input:not(:disabled) ~ .switch-track { border-color: var(--accent-hover); }
.switch-control input:focus-visible ~ .switch-track { outline: 2px solid var(--accent); outline-offset: 4px; }
.check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.switch-control input:disabled { cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }
@media (forced-colors: active) {
  .switch-track { forced-color-adjust: none; background: Canvas; border-color: ButtonText; }
  .switch-track::after { background: ButtonText; }
  .switch-control input:checked ~ .switch-track { background: Highlight; border-color: Highlight; }
  .switch-control input:checked ~ .switch-track::after { background: HighlightText; }
  .switch-control input:focus-visible ~ .switch-track { outline-color: Highlight; }
}

h1 { font-family: var(--serif); font-size: clamp(38px, 4.3vw, 60px); font-weight: 400; letter-spacing: -1.8px; line-height: 1.13; margin: 14px 0; }
h2 { font-size: 19px; font-weight: 550; letter-spacing: -.4px; }
h3 { font-weight: 500; }
p { line-height: 1.65; }
.ui-icon { width: 20px; height: 20px; flex-shrink: 0; }
.subtitle { font-size: 15px; line-height: 1.65; color: var(--muted); max-width: 610px; }
.hint, small, .fine-print { color: var(--muted); }
.fine-print { font-size: 12px; text-align: center; margin-top: 30px; }
.field-label { color: var(--subtle); font-size: 12px; font-weight: 500; }
.badge, .badge.green, .badge.sand { color: #c6ba9e; background: #cbb27e0c; border: 1px solid #cbb27e26; border-radius: 5px; font-size: 9px; font-weight: 500; letter-spacing: .08em; padding: 4px 7px; }
.badge.sand { color: #b7cecd; background: #91b9b70c; border-color: #91b9b726; }
.skip-link { color: var(--bg); background: var(--accent); }

/* Main destinations, tucked into a disclosure menu on small screens. */
/* Keep header dropdowns above the floating player and its notifications. */
.site-header { position: sticky; top: 0; z-index: 80; background: #111315ed; border-bottom: 1px solid #ffffff0d; backdrop-filter: blur(18px); }
.header-inner { max-width: 1280px; margin: auto; min-height: 88px; padding: 0 40px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.site-brand { display: inline-flex; align-items: center; justify-self: start; gap: 12px; padding: 0; border: 0; background: none; color: inherit; text-decoration: none; text-align: left; min-height: 54px; }
.site-brand:hover:not(:disabled) { border: 0; background: none; }
.brand-mark { width: 44px; height: 44px; }
.site-brand .brand-image { display: flex; flex: none; }
.site-brand .brand-name a { color: inherit; text-decoration: none; }
.site-brand .brand-partner { display: block; width: fit-content; }
.brand-partner:hover small { text-decoration: underline; text-underline-offset: 3px; }
.brand-name strong { font-family: var(--serif); display: block; font-size: 26px; font-weight: 500; letter-spacing: -.6px; line-height: 1.1; }
.brand-name small { display: block; margin-top: 5px; font-size: 10.2px; font-weight: 600; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.top-tabs { display: flex; justify-content: center; align-self: center; align-items: center; gap: 4px; }
.top-tabs :is(button, a) { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 10px; gap: 8px; font-size: 13px; white-space: nowrap; transition: color .18s, background .18s; }
.top-tabs :is(button, a):hover:not(:disabled) { color: var(--ink); background: #ffffff06; }
.top-tabs :is(button, a).active { color: var(--accent-hover); background: var(--active-fill); }
.top-tabs .ui-icon { width: 17px; height: 17px; opacity: .8; }
.navigation-toggle { display: none; }
.save-state { color: var(--teal); font-size: 12px; }
.page-heading .save-state { max-width: none; margin-top: 10px; }
.save-state.state-saving, .save-state.state-dirty { color: var(--accent); }
.save-state.state-conflict, .save-state.state-error { color: var(--danger); }
.app-content { margin-left: 0; padding-bottom: 0; }
#main-content { scroll-margin-top: 110px; }
#main-content:focus-visible { outline: none; }
.page { max-width: 1280px; padding: 42px 40px 45px; }
.page-heading { align-items: center; margin-bottom: 35px; gap: 28px; }
.page-heading h1 { margin-top: 0; }
.heading-actions { max-width: none; }
.heading-actions:empty { display: none; }
/* Inline notices use the same dark surfaces as the rest of the app. */
.notice { background: var(--surface); color: var(--ink); border-color: var(--active-border); }
.notice.error-notice { background: var(--surface); color: var(--danger); border-color: var(--danger); }
/* Quiet notifications float above the player without moving page content. */
.toast-region {
  position: fixed; z-index: 70; inset-inline-end: max(20px, env(safe-area-inset-right), env(safe-area-inset-left));
  bottom: calc(var(--transport-height, 0px) + max(18px, env(safe-area-inset-bottom)) + 12px);
  display: flex; flex-direction: column; gap: 8px; box-sizing: content-box; width: min(400px, calc(100% - 24px));
  max-height: max(88px, calc(100dvh - var(--transport-height, 0px) - 130px));
  padding: 8px; margin: -8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  pointer-events: none;
}
.toast-region:empty { display: none; }
.toast {
  --toast-accent: var(--accent); display: flex; flex: 0 0 auto; align-items: center; gap: 12px;
  padding-block: 10px; padding-inline: 16px 10px; border: 1px solid #ffffff1c; border-radius: 14px;
  background: #222629f5; color: var(--ink); box-shadow: 0 4px 16px #0004, inset 0 1px 0 #ffffff05;
  backdrop-filter: blur(16px); pointer-events: auto; animation: toast-enter .2s ease-out both;
}
.toast[data-tone=success] { --toast-accent: var(--teal); }
.toast[data-tone=error] { --toast-accent: var(--danger); }
.toast-icon { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; color: var(--toast-accent); background: #ffffff06; }
.toast-icon>.ui-icon { width: 18px; height: 18px; stroke-width: 1.8; }
.toast-message { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.toast-message a { color: var(--accent-hover); text-underline-offset: 3px; }
.toast-dismiss { display: grid; place-items: center; flex: 0 0 36px; width: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.toast-dismiss:hover { color: var(--ink); background: #ffffff09; }
.toast-dismiss:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.toast-dismiss>.ui-icon { width: 16px; height: 16px; }
.toast.is-leaving { animation: toast-leave .16s ease-in both; pointer-events: none; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-leave { to { opacity: 0; transform: translateY(5px); } }
@media (max-width: 760px) {
  .toast-region { inset-inline-end: max(12px, env(safe-area-inset-right), env(safe-area-inset-left)); bottom: calc(var(--transport-height, 0px) + max(10px, env(safe-area-inset-bottom)) + 12px); }
  .toast-dismiss { flex-basis: 44px; width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { animation: none; } }
@media print { .toast-region { display: none; } }

/* Let the rhythms lead; reserve the inlay for the masthead. */
.library-intro { display: flex; justify-content: space-between; align-items: center; gap: 32px; margin: -5px 0 30px; position: relative; }
.library-intro .page-heading { margin: 0; position: relative; z-index: 1; }
.library-intro h1 { font-size: clamp(44px, 5vw, 68px); letter-spacing: -2.5px; }
.intro-inlay { width: 225px; height: 185px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.intro-inlay::before { content: ''; position: absolute; inset: -30px -50px; background: url('./assets/inlay-pattern.svg') center / 110px; opacity: .1; mask-image: radial-gradient(ellipse, #000, transparent 72%); }
.intro-inlay img { width: 178px; height: 178px; }
.intro-inlay::before { pointer-events: none; }
.intro-drum { position: relative; display: flex; }
.intro-drum img { pointer-events: none; user-select: none; transition: transform .1s; }
.intro-drum .intro-drum-hit { position: absolute; inset: 5%; padding: 0; min-height: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; touch-action: none; user-select: none; -webkit-touch-callout: none; }
.intro-drum button:hover:not(:disabled) { border: 0; background: transparent; }
.intro-drum button.intro-drum-doum { inset: 19%; z-index: 1; }
.intro-drum button:focus-visible { outline-offset: -3px; }
.intro-drum:has(button:active) img { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .intro-drum img { transition: none; } .intro-drum:has(button:active) img { transform: none; } }
.library-toolbar { display: flex; flex-direction: row; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: nowrap; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field>.ui-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.library-toolbar .search-field input { width: 100%; min-width: 0; padding-left: 47px; height: 48px; font-size: 14px; background: var(--field); }
.library-toolbar select:is(.library-meter-filter, .library-region-filter, .library-sort) { flex: none; width: 192px; min-width: 0; min-height: 48px; font-size: 13px; background: var(--field); }
.library-toolbar select.library-region-filter { width: 230px; }
.collection-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 22px; }
.collection-options { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.library-details-toggle { font-size: 12px; padding: 7px 12px; min-height: 38px; background: transparent; white-space: nowrap; }
.library-details-toggle[aria-expanded=true] { color: var(--accent-hover); border-color: #6a5f46; background: var(--green-light); }
.filter-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.filter-tabs button { color: var(--muted); background: transparent; border-color: transparent; font-size: 12px; padding: 7px 13px; border-radius: 7px; min-height: 38px; }
.filter-tabs button[aria-pressed=true] { color: var(--accent-hover); border-color: #cbb27e30; background: #cbb27e0e; }
.filter-tabs button:hover:not(:disabled) { color: var(--ink); border-color: var(--line); background: #ffffff04; }
.collection-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rhythm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 28px; }
.rhythm-card { position: relative; isolation: isolate; background: linear-gradient(145deg, #1d2023, #191c1e); border-color: #34383a; border-radius: 14px; padding: 18px 22px 0; box-shadow: 0 4px 20px #00000012; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.rhythm-card:hover { transform: none; border-color: #796c50; box-shadow: 0 9px 35px #00000030; }
.card-top { margin-bottom: 12px; }
.card-top .badge { font-size: 9px; }
.favourite { border: 0; color: #8e9698; width: 34px; min-width: 34px; height: 34px; min-height: 34px; border-radius: 50%; background: transparent; padding: 7px; }
.favourite:hover:not(:disabled) { background: #cbb27e12; color: var(--accent); border: 0; }
.favourite[aria-pressed=true] { color: var(--accent); }
.favourite[aria-pressed=true] svg { fill: var(--accent); }
.favourite .ui-icon { width: 18px; height: 18px; }
.card-title { margin: 0 0 20px; gap: 12px; align-items: center; }
.card-title h3 { font-family: var(--serif); font-size: 27px; font-weight: 400; letter-spacing: -.6px; margin: 0; min-height: 0; line-height: 1.1; }
.card-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-name h3 { min-width: 0; overflow-wrap: anywhere; }
/* Stretch the practice link over the card; keep its other controls above it.
   A button's pressed transform would shrink this overlay to the title. */
.card-practice { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-align: inherit; text-decoration: none; }
.card-practice:hover:not(:disabled) { background: transparent; color: inherit; border: 0; }
.card-practice::after { content: ''; position: absolute; inset: 0; z-index: 1; cursor: pointer; border-radius: 14px; }
.card-practice:focus-visible { outline: none; }
.card-practice:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -3px; }
.card-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rhythm-card .card-play, .rhythm-card .favourite { position: relative; z-index: 2; }
.card-play { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; padding: 9px; border-radius: 50%; color: var(--accent-hover); background: #cbb27e0b; border-color: #cbb27e40; }
.card-play:hover:not(:disabled), .card-play.is-playing { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.card-play .ui-icon { width: 19px; height: 19px; }
.card-play[data-icon=play] .ui-icon { fill: currentColor; stroke: none; }
.card-title .meter-pill { flex-shrink: 0; }
.rhythm-card:not(:has(.card-meta)) .pulse-rail { margin-bottom: 18px; }
.rhythm-card:has(.rhythm-card-copy) .card-title { margin-bottom: 8px; }
.rhythm-card-copy { flex: 1; margin-bottom: 20px; }
.rhythm-arabic { display: inline-block; font-family: Tahoma, 'Geeza Pro', Arial, sans-serif; font-size: 21px; font-weight: 400; letter-spacing: normal; line-height: 1.7; color: var(--accent-hover); }
.rhythm-region { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 5px 0 9px; }
.rhythm-summary { color: var(--subtle); font-size: 13px; line-height: 1.7; margin: 0; }
.rhythm-heading { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .05em .3em; max-width: 100%; }
.rhythm-heading-english { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.rhythm-heading-translation { display: inline-flex; align-items: baseline; gap: .35em; letter-spacing: normal; }
.rhythm-heading-separator { color: var(--muted); font-size: .55em; }
.rhythm-heading-arabic { max-width: 100%; font-size: clamp(23px, 3vw, 30px); }
.rhythm-names { display: grid; grid-template-columns: minmax(100px, 180px) minmax(0, 1fr); gap: 8px 16px; margin: 0 0 20px; }
.rhythm-names dt { color: var(--muted); font-size: 12px; }
.rhythm-names dd { margin: 0; overflow-wrap: anywhere; }
.rhythm-names bdi[lang=ar] { font-family: Tahoma, 'Geeza Pro', Arial, sans-serif; font-size: 18px; line-height: 1.7; }
.rhythm-sources { padding-inline-start: 20px; margin-bottom: 0; }
.rhythm-sources li { margin-block: 8px; overflow-wrap: anywhere; }
.practice-backing-track { max-width: 880px; margin: 24px auto 0; }
.practice-backing-track .panel-heading { margin-bottom: 10px; }
.backing-track-intro { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.backing-track-screen { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #171b1c; border-radius: 8px; }
.backing-track-screen.skills-video-cover { border: 1px solid var(--line); }
.backing-track-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin: 18px 0 10px; }
.backing-track-caption h3 { font-size: 16px; margin: 0; }
.backing-track-credit { font-size: 12px; }
.backing-track-actions { margin-top: 16px; font-size: 13px; }
@media (max-width: 540px) {
  .rhythm-heading { font-size: clamp(26px, 7.5vw, 36px); letter-spacing: -.8px; }
  .rhythm-heading-arabic { font-size: clamp(20px, 5.5vw, 24px); }
  .rhythm-names { grid-template-columns: 1fr; gap: 4px; }
  .rhythm-names dd { margin-bottom: 10px; }
}
.meter-pill { font-size: 15px; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--subtle); }
.compact .pulse-lane { gap: 5px; }
.compact .pulse-cell { min-height: 37px; border-radius: 5px; }
.compact .pulse-cell strong { font-family: inherit; font-size: 12px; font-weight: 500; }
.card-meta { color: var(--muted); font-size: 11px; margin: 13px 0 0; padding: 10px 0 17px; gap: 6px; }
.card-cta { color: var(--accent); font-weight: 600; }
.card-meta>span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Practice, readable notation, and live ensemble controls. */
.panel, .disclosure, .composition-block { background: var(--paper); border-color: var(--line); box-shadow: var(--shadow); border-radius: 13px; }
.panel p, .disclosure-body p { color: var(--subtle); }
.practice-breadcrumb { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 11px; letter-spacing: .08em; margin-top: 0; }
.practice-breadcrumb button { font-size: 12px; letter-spacing: 0; }
.practice-breadcrumb a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 12px; letter-spacing: 0; text-decoration: none; }
.practice-breadcrumb a .ui-icon { width: 16px; }
.practice-page .page-heading { margin-bottom: 22px; }
.practice-page .page-heading>div { min-width: 0; max-width: 100%; }
.practice-edit-rhythm { gap: 8px; padding: 10px 14px; font-size: 13px; }
.practice-edit-rhythm .ui-icon { width: 18px; height: 18px; }
.practice-page .tempo-panel { padding: 20px 28px; background: linear-gradient(105deg, #25251f, #1b1f21); border-color: #45443a; }
.tempo-number strong { font-family: var(--serif); color: var(--accent-hover); }
.tempo-number>span, .tempo-ticks { color: var(--muted); }
.tempo-controls { display: flex; align-items: center; gap: 12px; }
.tempo-controls>.field { flex: 1; min-width: 0; }
.tempo-step { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 23px; line-height: 1; color: var(--accent-hover); }
.tempo-slider .tempo-ticks { margin-inline: 56px; }
.variation-bar select { background: var(--field); }
.variation-bar { flex-wrap: wrap; row-gap: 14px; }
.rhythm-neighbours { gap: 12px; margin-left: auto; }
.rhythm-neighbours button { min-height: 48px; min-width: 132px; gap: 10px; padding: 12px 18px; border-color: #596062; background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.4; }
.rhythm-neighbours button:hover:not(:disabled) { border-color: var(--accent); background: var(--green-light); color: var(--accent-hover); }
.rhythm-neighbours button:active:not(:disabled) { background: #3b3529; }
.rhythm-neighbours .ui-icon { width: 20px; height: 20px; color: var(--accent-hover); }
.rhythm-neighbours button:first-child .ui-icon { transform: rotate(180deg); }
.segmented { background: var(--bg); border-color: var(--line); border-radius: 9px; }
.segmented button { color: var(--muted); background: transparent; }
.segmented button[aria-pressed=true] { background: #32322b; color: var(--accent-hover); box-shadow: 0 1px 6px #00000033; }
.practice-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 20px; }
.practice-controls .segmented button { white-space: nowrap; }
.practice-controls>.field { flex-direction: row; align-items: center; gap: 10px; }
.practice-controls select { min-width: 115px; }
.practice-study-meta { display:flex; align-items:center; flex-wrap:wrap; gap:10px 14px; margin-bottom:14px; }
.practice-study-meta strong { font-size:14px; font-weight:600; }
.study-context { color:var(--muted); font-size:13px; line-height:1.6; margin:8px 0 18px; max-width:78ch; }
.practice-source-bar + .practice-source-bar { border-top:1px solid var(--line); margin-top:22px; padding-top:18px; }
.practice-source-bar > h3 { font-size:15px; margin:0 0 12px; }
@media (min-width:1200px) {
  .practice-bars-basic[data-bar-count="2"] { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
  .practice-bars-basic[data-bar-count="2"] .practice-source-bar + .practice-source-bar { border-top:0; margin:0; padding:0; }
  .practice-bars-basic[data-bar-count="2"] .pulse-lane { grid-template-columns:repeat(var(--pulses),minmax(28px,1fr)); gap:4px; }
  .practice-bars-basic[data-bar-count="2"] .pulse-cell { min-width:0; padding-inline:2px; }
}
.instrument-row { border-color: #ffffff0b; }
.instrument-toggle, .instrument-toggle[aria-pressed=true] { background: none; color: var(--ink); border-color: transparent; }
.instrument-toggle:hover:not(:disabled) { background: #ffffff05; }
.instrument-icon { background: #263330; border-color: #3e5650; color: #a8c4b7; }
.instrument-icon.dahola { background: #342e26; border-color: #594a36; color: #d7ba91; }
.instrument-icon.bendir { background: #302e29; border-color: #514b3f; color: #c1b59a; }
.instrument-icon.riq { background: #273234; border-color: #405456; color: var(--teal); }
.instrument-icon.sagats { background: #343023; border-color: #5b5134; color: #d6bf7b; }
.instrument-switch { background: #454b4d; }
.instrument-switch::after { background: #ece9df; }
.instrument-toggle[aria-pressed=true] .instrument-switch { background: #788e80; }
.instrument-solo[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.instrument-mix input::-webkit-slider-runnable-track { background: #42494b; }
.instrument-mix input::-webkit-slider-thumb { background: #a6b7ac; }
.instrument-mix input[type=range] { accent-color: #a6b7ac; }
.instrument-part, .instrument-part[aria-pressed=true], .instrument-part:hover:not(:disabled) { background: transparent; border-color: transparent; }
.ensemble-cell { background: #23282b; border-bottom-color: #394145; }
.ensemble-cell.beat-start { background: #2b3234; border-left-color: #4e5c60; }
.ensemble-hit { background: #7da9a6; color: #101d1d; }
.slap-hit .ensemble-hit { background: var(--stroke-slap-fill); color: var(--stroke-slap-ink); }
.bass-hit .ensemble-hit { background: #c0a775; color: #221e15; }
.ghost-hit .ensemble-hit { background: #4d6564; color: #d2e0da; }
.metal-hit .ensemble-hit { background: #ac9d73; color: #201d14; }
.ensemble-rest { color: #8c989b; }
.ensemble-counts span { color: var(--muted); }
.ensemble-cell.playing { background: #535347; outline-color: var(--accent-hover); box-shadow: inset 0 3px 0 var(--accent-hover); }
.ensemble-cell.playing .ensemble-hit { filter: brightness(1.2); }
.ensemble-long .instrument-controls, .ensemble-long .ensemble-ruler>span { background: var(--paper); box-shadow: 10px 0 12px var(--paper); }
.long-cycle-scroll { scrollbar-color: #626665 #23282b; }
.ensemble-cell.group-start, .ensemble-counts .group-start { border-left-color: #9c8b65; }
.ensemble-counts .group-start, .cycle-count-guide strong { color: var(--accent-hover); }
.legend-dum { background: #c0a775; }
.legend-tek { background: #7da9a6; }
.compact .pulse-cell, .pulse-cell { background: #24292c; border-color: #353d40; color: #a0a9aa; }
.compact .pulse-cell.attack, .pulse-cell.attack { background: var(--stroke-rim-fill); border-color: var(--stroke-rim-border); color: var(--stroke-rim-ink); }
.compact .pulse-cell.slap, .pulse-cell.slap { background: var(--stroke-slap-fill); border-color: var(--stroke-slap-border); color: var(--stroke-slap-ink); }
.pulse-cell.slap small { color: inherit; }
.compact .pulse-cell.bass, .pulse-cell.bass { background: var(--stroke-bass-fill); border-color: var(--stroke-bass-border); color: var(--stroke-bass-ink); }
.pulse-cell.playing { background: var(--accent); border-color: var(--accent-hover); outline-color: var(--accent-hover); color: var(--bg); }
.pulse-cell.playing small { color: #403b2d; }
.notation-bar { border-color: var(--line); background: var(--field); }
.notation-bar.current-measure { border-color: #9c8b65; box-shadow: none; }
.bar-caption { background: var(--surface); color: var(--subtle); border-color: var(--line); }
.staff-svg { color: var(--ink); }
.staff-label, .hand-label { fill: var(--subtle); }
.staff-playhead { stroke: var(--accent); }
.disclosure>summary { color: var(--ink); }

/* Skills and linked lessons. */
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 18px; font-weight: 500; }
.skill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.skill-card { display: flex; flex-direction: column; padding: 24px 21px 0; background: linear-gradient(145deg, #202527, #1a1d20); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.skill-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 32px; }
.skill-number { color: #9f9378; font-family: var(--serif); font-size: 26px; }
.skill-rhythm { color: var(--teal); font-size: 12px; letter-spacing: .08em; }
.skill-card h3 { font-size: 17px; margin-bottom: 11px; }
.skill-card p { font-size: 12px; color: var(--muted); margin-bottom: 24px; flex: 1; }
.skill-open { margin: 0 -21px; border: 0; border-top: 1px solid #ffffff0b; border-radius: 0; background: #ffffff02; font-size: 12px; padding: 13px 21px; color: var(--accent); justify-content: space-between; }
.skill-open:hover:not(:disabled) { background: #cbb27e0b; border-color: #cbb27e28; }
.skill-open .ui-icon { width: 16px; }
.lessons-heading { margin-top: 48px; }
.library-tools { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 24px; }
.library-tools>.field:first-child { flex: 1; }
.library-tools>.field:last-child { min-width: 190px; }
.lesson-grid { gap: 20px; }
.lesson-card { padding: 24px; grid-template-columns: 44px 1fr; }
.lesson-monogram { width: 42px; height: 48px; background: #303329; color: var(--accent-hover); border: 1px solid #4b4b3c; border-radius: 9px; font-family: var(--serif); }
.lesson-card h2 { color: var(--ink); font-size: 21px; font-family: var(--serif); font-weight: 400; }
.lesson-card .button-row button, .lesson-card .button-row .button { font-size: 12px; }
.lesson-card .button-row .button { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.credit-details summary { color: var(--muted); font-size: 11px; }
.video-player iframe { border-radius: 8px; }

/* Skills: curated playlists and videos with players that load on demand. */
.skills-page .page-heading { margin-bottom: 28px; }
.skills-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.skills-tabs a { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; transition: color .18s, background .18s; }
.skills-tabs a:hover { color: var(--ink); background: #ffffff06; }
.skills-tabs a[aria-current="page"] { color: var(--accent-hover); background: var(--active-fill); }
.skills-tabs a>span { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--surface); }
.skills-catalogue>section, .skills-page .section-header h2, .skills-video-card[id] { scroll-margin-top: 100px; }
.skills-catalogue>section+section { margin-top: 44px; }
.skills-playlist-lessons { width: 100%; margin-top: 24px; font-size: 12px; }
.skills-playlist-lessons summary { color: var(--accent); cursor: pointer; }
.skills-playlist-lessons ol { padding-left: 22px; margin: 18px 0 0; }
.skills-playlist-lessons li { padding-left: 4px; margin-top: 12px; overflow-wrap: anywhere; }
.skills-playlist-lessons li span { color: var(--muted); }
.skills-playlist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.skills-playlist-card { min-width: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--paper); display: flex; flex-direction: column; }
.skills-playlist-cover-link { display: block; text-decoration: none; }
.skills-playlist-cover { position: relative; aspect-ratio: 16 / 7; background: #232829; overflow: hidden; border-bottom: 1px solid var(--line); }
.skills-playlist-cover img { width: 100%; height: 100%; object-fit: cover; }
.skills-playlist-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 45%, #0009); pointer-events: none; }
.skills-playlist-count { position: absolute; bottom: 14px; right: 16px; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #ffffff30; border-radius: 6px; background: #171b1cdd; color: #fff; font-size: 11px; z-index: 1; }
.skills-playlist-count .ui-icon { width: 13px; height: 13px; }
.skills-playlist-body { padding: 24px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.skills-playlist-body h3 { margin: 13px 0 10px; font: 400 27px/1.25 var(--serif); overflow-wrap: anywhere; }
.skills-playlist-body h3 a { color: var(--ink); text-decoration: none; }
.skills-playlist-body>p { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.skills-playlist-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding-top: 24px; margin-top: auto; font-size: 12px; text-decoration: none; }
.skills-back { display: inline-block; margin-bottom: 24px; font-size: 12px; text-decoration: none; }
.skills-playlist-heading { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.skills-playlist-heading h2 { font: 400 34px/1.2 var(--serif); margin: 12px 0; }
.skills-playlist-heading p { color: var(--muted); font-size: 14px; margin: 0; }
.skills-playlist-heading>button { flex-shrink: 0; }
.skills-playlist-videos { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 22px; }
.skills-playlist-videos>li { min-width: 0; }
.skills-video-card.skills-series-video { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.skills-sequence { color: var(--accent-hover); }
.skills-next-video { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; text-align: left; width: 100%; margin-top: 18px; padding: 12px; }
.skills-next-video>span { font-size: 10px; color: var(--muted); }
.skills-next-video>strong { grid-column: 1; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.skills-next-video>.ui-icon { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.skills-filter-panel { margin-bottom: 32px; }
.skills-filter-fields { display: grid; grid-template-columns: minmax(210px, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.skills-filter-fields.has-source-filter, .skills-filter-fields.has-language-filter { grid-template-columns: minmax(210px, 2fr) repeat(4, minmax(0, 1fr)); }
.skills-filter-fields.has-source-filter.has-language-filter { grid-template-columns: minmax(210px, 2fr) repeat(5, minmax(0, 1fr)); }
.skills-filter-fields .field { margin: 0; min-width: 0; }
.skills-filter-fields input, .skills-filter-fields select { width: 100%; min-width: 0; }
.skills-filter-fields .field-label { font-size: 11px; color: var(--muted); font-weight: 500; }
.skills-active-filters { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.skills-page .section-header { gap: 16px; flex-wrap: wrap; }
.skills-page .section-header .muted { font-size: 12px; }
.skills-video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.skills-video-card { position: relative; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.skills-video-anchor { position: absolute; top: 0; scroll-margin-top: 100px; }
.skills-video-card.is-watching { border-color: var(--accent); }
.skills-video-screen { display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; position: relative; background: #171b1c; overflow: hidden; flex-shrink: 0; }
.skills-video-cover { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; color: #fff; }
.skills-video-cover:hover { background: #232829; }
.skills-video-cover:focus-visible { outline: 3px solid var(--accent); outline-offset: -4px; }
.skills-video-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.skills-video-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 45%, #000a); pointer-events: none; }
.skills-play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #171b1cd9; border: 1px solid #ffffff60; z-index: 1; }
.skills-play-icon .ui-icon { width: 24px; height: 24px; margin-left: 3px; }
.skills-video-cover:hover .skills-play-icon { background: var(--accent); color: #171b1c; border-color: var(--accent); }
.skills-watch-label { position: absolute; bottom: 15px; left: 18px; font-size: 12px; font-weight: 500; z-index: 1; }
.skills-player { scroll-margin-top: 90px; }
.skills-player iframe { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.skills-player.source-instagram { aspect-ratio: 9 / 14; max-height: 640px; }
.skills-video-body { padding: 22px; flex: 1; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.skills-video-body .badge { font-size: 9px; }
.skills-video-body h3 { font-size: 18px; line-height: 1.45; margin: 12px 0 6px; overflow-wrap: anywhere; }
.skills-creator { color: var(--muted); font-size: 12px; margin: 0 0 16px; overflow-wrap: anywhere; }
.skills-publisher { color: var(--muted); font-size: 11px; margin: -8px 0 16px; overflow-wrap: anywhere; }
.skills-notes { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--subtle); margin: 0 0 15px; }
.skills-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.skills-tag { border: 1px solid #ffffff12; border-radius: 6px; min-height: 30px; padding: 4px 8px; color: var(--subtle); font-size: 11px; background: #ffffff04; overflow-wrap: anywhere; max-width: 100%; }
.skills-video-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; margin-top: 18px; min-height: 30px; }
.skills-video-actions a { color: var(--muted); font-size: 11px; text-decoration: none; }
.skills-video-actions a:hover { color: var(--accent-hover); text-decoration: underline; }
.skills-player-hint { font-size: 11px; color: var(--muted); margin: 12px 0 0; }
.skills-empty { text-align: center; }
@media (max-width: 800px) {
  .skills-filter-fields, .skills-filter-fields.has-source-filter, .skills-filter-fields.has-language-filter, .skills-filter-fields.has-source-filter.has-language-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .skills-filter-fields>.field:first-child { grid-column: 1/-1; }
  .skills-video-card.skills-series-video { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .skills-filter-fields, .skills-filter-fields.has-source-filter, .skills-filter-fields.has-language-filter, .skills-filter-fields.has-source-filter.has-language-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .skills-filter-fields select, .skills-filter-fields input { font-size: 13px; }
  .skills-video-grid, .skills-playlist-grid { grid-template-columns: minmax(0, 1fr); }
  .skills-playlist-body { padding: 20px; }
  .skills-playlist-heading { flex-direction: column; align-items: flex-start; gap: 18px; }
  .skills-playlist-heading h2 { font-size: 28px; }
  .skills-video-body { padding: 18px; }
  .skills-page .section-header h2 { font-size: 17px; }
}

/* Arrangements and the saved document tools. */
.empty-state { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 58px 28px; }
.empty-state>.ui-icon { width: 32px; height: 32px; color: var(--accent); margin-bottom: 22px; }
.empty-state h2 { font-family: var(--serif); font-size: 30px; font-weight: 400; }
.empty-state p { font-size: 14px; }
.arrangement-inlay { width: 88px; height: 88px; opacity: .65; margin: 0 auto 23px; }
.arrangement-steps { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; color: var(--subtle); margin: 26px 0; font-size: 12px; }
.arrangement-steps span { display: flex; align-items: center; gap: 8px; }
.arrangement-steps b { color: var(--accent); font-size: 10px; font-weight: 500; border: 1px solid #60563f; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; }
.arrangement-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.arrangement-list>.empty-state { grid-column: 1 / -1; }
.arrangement-row { display: flex; flex-direction: column; align-items: stretch; min-width: 0; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.arrangement-row-content { flex: 1; min-width: 0; }
.arrangement-row h2 { font: 400 24px/1.25 var(--serif); min-width: 0; margin: 0; overflow-wrap: anywhere; }
.arrangement-row h2 a { color: var(--ink); text-decoration: none; }
.arrangement-row h2 a:hover { color: var(--accent-hover); }
.arrangement-row-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.arrangement-row-name { min-width: 0; }
.arrangement-card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.arrangement-row-heading>.favourite { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; }
.arrangement-row-name>.hint { font-size: 11px; line-height: 1.5; margin: 0 0 8px; }
.arrangement-row-meta { color: var(--subtle); font-size: 12px; line-height: 1.5; margin: 0 0 4px; }
.arrangement-sequence { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; overflow: hidden; overflow-wrap: anywhere; }
.arrangement-row>.button { align-self: flex-start; }
.arrangement-back { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0 20px; font-size: 13px; text-decoration: none; }
.composition-detail .page-heading h1 { overflow-wrap: anywhere; }
.arrangement-editor { border: 0; border-top: 1px solid var(--line); padding: 28px 0 0; margin: 0; min-width: 0; }
.arrangement-mixer { border: 0; padding: 0; margin: 0; min-width: 0; }
.personal-storage { margin: 0 0 24px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; }
.personal-storage p { max-width: 760px; }
.personal-storage p:last-child { margin-bottom: 0; }
.personal-storage button, .personal-storage .button { margin-inline-end: 10px; margin-bottom: 8px; }
.page .personal-sync-notice { margin: 0 0 24px; flex-wrap: wrap; }
.personal-sync-notice a { flex-shrink: 0; }
.arrangement-editor-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 22px; }
.arrangement-editor-heading h2 { font-family: var(--serif); font-size: 30px; font-weight: 400; margin: 0; }
.arrangement-editor-heading p { margin: 0; font-size: 12px; }
.arrangement-editor>.field { max-width: 550px; margin-bottom: 24px; }
.arrangement-editor .empty-state h3 { font-family: var(--serif); font-size: 27px; font-weight: 400; }
.arrangement-add-action { margin: 0 0 28px; }
.arrangement-add-action.empty-state { margin-top: 24px; }
.arrangement-add-action.empty-state p { margin-top: 0; }
.arrangement-add-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.arrangement-add-action.empty-state .arrangement-add-buttons { justify-content: center; }
.rest-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: end; }
.rest-fields input, .rest-fields select { width: 100%; min-width: 0; }
.rest-meter-inputs { display: flex; gap: 8px; align-items: center; }
.rest-fields [hidden] { display: none; }
.rest-unit-hint { margin: 16px 0; }
.composition-rest { border-inline-start: 3px solid var(--muted); }
.rest-description { margin: 10px 0 6px; }
.arrangement-rest-score { display: flex; align-items: center; gap: 16px; min-height: 90px; padding: 20px; color: var(--subtle); }
.modal.arrangement-add-dialog { width: 560px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); overflow: hidden; }
.arrangement-add-dialog[open] { display: flex; flex-direction: column; }
.arrangement-add-dialog .modal-heading, .arrangement-add-dialog .modal-actions { flex-shrink: 0; }
.arrangement-add-dialog .modal-heading { gap: 12px; }
.arrangement-add-dialog .modal-heading .icon-button { flex: 0 0 44px; }
.arrangement-add-dialog .modal-body { min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.arrangement-add-dialog .modal-actions button { min-height: 44px; font-size: 14px; }
.add-rhythm-settings { border: 0; margin: 0; padding: 0; min-width: 0; }
.add-rhythm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 18px; }
.add-rhythm-fields>.field { min-width: 0; }
.add-rhythm-fields>.field:nth-child(-n+2) { grid-column: 1/-1; }
.add-rhythm-fields input, .add-rhythm-fields select { width: 100%; min-width: 0; }
.add-rhythm-instrument-picker, .block-instrument-picker { margin-top: 16px; border-top: 1px solid var(--line); }
.add-rhythm-instrument-picker>summary, .block-instrument-picker>summary { min-height: 48px; padding: 14px 0; cursor: pointer; font-size: 12px; color: var(--ink); }
.add-rhythm-instrument-picker>summary::marker, .block-instrument-picker>summary::marker { color: var(--accent); }
.add-rhythm-instrument-picker>summary:focus-visible, .block-instrument-picker>summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.block-instrument-count { margin-inline-start: 10px; color: var(--muted); font-size: 11px; }
.block-instrument-options { padding: 4px 0 0; }
.block-instrument-options .instrument-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.block-instrument-options>.hint { margin: 10px 0 0; font-size: 11px; }
.add-rhythm-options { padding: 6px 0 20px; }
.add-rhythm-instruments { border: 0; padding: 0; margin: 0; min-width: 0; }
.add-rhythm-instruments legend { padding: 0; margin-bottom: 5px; font-size: 11px; color: var(--muted); font-weight: 650; letter-spacing: .03em; }
.instrument-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.instrument-choices .check { min-height: 44px; gap: 9px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); }
.instrument-choices .check:has(input:checked) { background: #333027; border-color: #655a42; color: var(--accent-hover); }
.add-rhythm-instruments .hint { margin: 8px 0 0; font-size: 11px; }
.add-rhythm-summary { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.add-rhythm-error { color: var(--danger); margin: 16px 0 0; }
.add-rhythm-summary.warning-text { color: var(--danger); }
.rhythm-update-form .rhythm-update-warning { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); }
.rhythm-update-form .hint[hidden] { display: none; }
.composition-summary { background: #2c2c25; color: var(--accent-hover); border: 1px solid #4c4a3c; }
.composition-summary span { color: var(--subtle); }
.composition-summary strong { font-family: var(--serif); }
.composition-block { padding: 20px; }
.block-side { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.block-side .block-duration { margin: 0; padding-bottom: 0; text-align: end; }
.block-actions { display: grid; grid-template-columns: repeat(2, minmax(72px, 1fr)); align-self: flex-start; gap: 8px; }
.block-actions .block-refresh { grid-column: 1/-1; }
.composition-block.is-current { border-color: var(--accent); background: #292921; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px #cbb27e12; }
.composition-block.is-current .block-number { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.block-playback-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 20px; background: #cbb27e1c; color: var(--accent-hover); font-size: 11px; font-weight: 600; }
.block-playback-status[hidden] { display: none; }
.block-playback-status::before { content: ''; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.composition-block[data-play-state=paused] .block-playback-status::before, .composition-block[data-play-state=interrupted] .block-playback-status::before { background: transparent; border: 1px solid currentColor; }
.block-number { background: #302d26; color: var(--accent); border: 1px solid #514936; }
.block-heading h3 { font-family: var(--serif); font-size: 26px; font-weight: 400; margin: 0; }
.block-heading .badge { font-size: 9px; }
.block-fields .field-label, .block-duration small { color: var(--muted); }
.document-row { border-color: var(--line); }
.data-page .data-grid { gap: 24px; align-items: start; margin-bottom: 24px; }
.data-page .panel { padding: 28px; }
.data-page .panel-heading h2 { font: 400 28px/1.25 var(--serif); letter-spacing: -.5px; }
.data-page .data-grid .panel { gap: 16px; }
.data-page .panel p { font-size: 14px; line-height: 1.7; }
.data-page .panel p.hint { font-size: 12px; }
.data-page .data-grid .panel > button { max-width: 100%; min-height: 44px; font-size: 13px; text-align: start; }
.data-page .data-grid .field { margin-top: 8px; }
.data-page .data-grid input[type=file] { font-size: 13px; }
.data-page .document-row { padding: 18px 0; }
.data-page .document-row:last-child { border-bottom: 0; padding-bottom: 0; }
.data-page .document-row strong { font-size: 15px; font-weight: 500; }
.data-page .document-row small { color: var(--muted); line-height: 1.6; }
.data-page .document-row button { font-size: 13px; }
.data-page button > .ui-icon { width: 17px; height: 17px; }
.saved-music .panel-heading { flex-wrap: wrap; gap: 8px 20px; }
.saved-music-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 220px); gap: 16px; }
.saved-music-filters input, .saved-music-filters select { width: 100%; min-width: 0; }
.saved-music-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 44px; }
.saved-music-count { color: var(--muted); font-size: 13px; }
.saved-music .document-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.saved-music-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.saved-music-pagination > span { color: var(--muted); font-size: 13px; }
.saved-music [hidden] { display: none; }
@media (max-width: 760px) {
  .data-page .data-grid { gap: 20px; }
  .data-page .panel { padding: 22px; }
  .data-page .data-grid .panel > button { width: 100%; justify-content: flex-start; white-space: normal; }
  .data-page .document-row .button-row { width: 100%; }
  .data-page .document-row button { flex: 1; }
}
@media (max-width: 480px) {
  .saved-music-filters { grid-template-columns: minmax(0, 1fr); }
  .saved-music-pagination { display: grid; grid-template-columns: 1fr 1fr; }
  .saved-music-pagination > span { grid-area: 1 / 1 / 2 / -1; text-align: center; }
}
.readonly-banner { background: #302c22; border-color: #615337; color: #dfcea8; }
@media (max-width: 760px) {
  .arrangement-editor { padding-top: 24px; }
  .add-rhythm-fields { gap: 16px; }
  .composition-block { display: block; }
  .block-number { display: none; }
  .block-side { flex-direction: column-reverse; gap: 0; margin-top: 9px; }
  .block-side .block-duration { text-align: start; }
  .block-actions { width: 100%; min-width: 0; margin-top: 18px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .block-actions button { flex: 1 0 auto; min-width: 44px; min-height: 44px; }
  .block-actions .block-refresh { flex-basis: 100%; }
}
@media (max-width: 420px) {
  .block-heading h3 { font-size: 23px; }
  .arrangement-add-buttons>button { flex: 1; }
  .arrangement-add-dialog .modal-actions button { flex: 1; }
  .arrangement-add-dialog input, .arrangement-add-dialog select { font-size: 16px; }
  .instrument-choices .check { flex: 1 0 auto; }
}


/* Dialogs share the palette, including native form controls. */
.modal { color: var(--ink); background: var(--paper); border: 1px solid #505450; border-radius: 16px; box-shadow: 0 25px 100px #000000bb; }
.modal::backdrop { background: #080a0bb8; backdrop-filter: blur(8px); }
.modal-heading, .modal-actions { border-color: var(--line); background: var(--surface); }
.modal-heading h2 { color: var(--ink); font-family: var(--serif); font-size: 27px; font-weight: 400; }
.modal-body { color: var(--subtle); }
.modal-body .hint { color: var(--muted); }
.modal-body .panel { background: var(--field); }
.mixer-track { border-color: var(--line); }
.mixer-track-title { font-size: 13px; }
.mixer-controls { flex-wrap: wrap; }
.mixer-controls>.field { flex: 1 1 140px; }
.mixer-controls .check, .mixer-controls .field-label { font-size: 11px; }
@media (max-width: 540px) {
  .mixer-controls>.field { flex-basis: 100%; }
  .mixer-controls>.check { flex: 1 1 100px; }
  .modal .mixer-controls { column-gap: 12px; }
}

@media (min-width: 1500px) { .page { padding-top: 54px; } }
@media (max-width: 1050px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 0 18px; padding: 13px 28px 0; }
  .site-brand { grid-column: 1; grid-row: 1; }
  .top-tabs { grid-column: 1 / -1; grid-row: 2; margin-top: 10px; min-height: 47px; }
  .top-tabs { gap: 4px; padding-bottom: 10px; }
  .page { padding: 34px 28px 42px; }
  .rhythm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice { margin-inline: 28px; }
}
@media (max-width: 760px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 12px 22px; min-height: 70px; }
  .site-brand { grid-column: 1; grid-row: 1; min-height: 45px; gap: 9px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name strong { font-size: 23px; }
  .brand-name small { font-size: 9.35px; margin-top: 3px; }
  .navigation-toggle { grid-column: 3; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; min-width: 44px; font-size: 12px; background: transparent; }
  .navigation-toggle[aria-expanded=true] { color: var(--accent-hover); border-color: #6a5f46; background: var(--green-light); }
  .top-tabs { display: none; position: absolute; top: calc(100% + 6px); left: 22px; right: 22px; margin: 0; min-height: 0; padding: 8px; gap: 4px; max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px #00000066; }
  .top-tabs.is-open { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .top-tabs :is(button, a) { flex-shrink: 0; justify-content: flex-start; text-align: left; font-size: 14px; min-height: 48px; line-height: 1.3; gap: 12px; padding: 12px 14px; border-radius: 7px; white-space: normal; }
  .top-tabs :is(button, a):hover:not(:disabled) { background: #ffffff08; }
  .top-tabs :is(button, a).active { background: var(--green-light); }
  .top-tabs .ui-icon { width: 18px; height: 18px; }
  .app-content { margin-left: 0; padding-bottom: 0; }
  .page { padding: 30px 22px 36px; }
  #main-content { scroll-margin-top: 90px; }
  .library-intro { margin-bottom: 28px; gap: 0; }
  .intro-inlay { width: 110px; height: 140px; }
  .intro-inlay img { width: 106px; height: 106px; }
  .intro-inlay::before { inset: -10px -20px; background-size: 75px; }
  .library-intro h1 { font-size: 46px; }
  .library-intro .subtitle { font-size: 13px; max-width: 260px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 18px; }
  .library-toolbar { gap: 10px; }
  .library-toolbar select.library-meter-filter { width: 165px; }
  .rhythm-card { padding-inline: 18px; }
  .card-title h3 { font-size: 25px; }
  .collection-toolbar { gap: 8px; align-items: flex-start; }
  .filter-tabs { gap: 4px; }
  .filter-tabs button { padding: 7px 10px; }
  .collection-count { padding-top: 0; }
  .notice { margin-inline: 22px; }
  .library-tools>.field:last-child { min-width: 140px; }
}
@media (max-width: 600px) {
  .rhythm-neighbours { width: 100%; margin-left: 0; }
  .rhythm-neighbours button { flex: 1; min-width: 0; padding-inline: 12px; }
  .rhythm-neighbours button>span { min-width: 0; overflow-wrap: anywhere; }
  .header-inner { padding-inline: 17px; }
  .top-tabs { left: 17px; right: 17px; }
  .page, .practice-page { padding: 25px 17px 35px; }
  h1 { font-size: 39px; letter-spacing: -1.5px; }
  .library-intro { margin-bottom: 19px; }
  .library-intro h1 { font-size: 43px; letter-spacing: -1.8px; }
  .intro-inlay { display: none; }
  .library-intro .subtitle { font-size: 13px; max-width: 100%; }
  .library-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .library-toolbar .search-field { grid-column: 1 / -1; }
  .library-toolbar .search-field input { height: 45px; min-height: 45px; font-size: 13px; padding-left: 37px; }
  .search-field>.ui-icon { left: 12px; width: 16px; }
  .library-toolbar select:is(.library-meter-filter, .library-region-filter, .library-sort) { width: 100%; min-height: 45px; padding-inline: 8px; font-size: 11px; }
  .collection-toolbar { flex-direction: column; gap: 8px; margin-bottom: 17px; }
  .collection-options { width: 100%; justify-content: space-between; }
  .filter-tabs { gap: 4px; width: 100%; }
  .filter-tabs button { flex: 1; min-height: 36px; padding: 7px 9px; font-size: 11px; white-space: nowrap; }
  .collection-count { padding: 0; font-size: 10px; }
  .rhythm-grid { grid-template-columns: 1fr; gap: 15px; }
  .rhythm-card { padding: 16px 21px 0; }
  .card-title { margin: 0 0 18px; }
  .card-title h3 { font-size: 28px; }
  .card-top .badge { font-size: 9px; }
  .compact .pulse-cell { min-height: 37px; }
  .compact .pulse-cell strong { font-size: 12px; }
  .card-meta { font-size: 11px; margin-top: 10px; }
  .skill-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .skill-card { padding: 17px 15px 0; }
  .skill-top { flex-direction: column; align-items: flex-start; gap: 7px; margin-bottom: 23px; }
  .skill-rhythm { font-size: 10px; }
  .skill-card h3 { font-size: 15px; }
  .skill-card p { font-size: 11px; }
  .skill-open { padding: 10px 15px; margin-inline: -15px; font-size: 11px; }
  .skill-open .ui-icon { width: 14px; }
  .section-header { gap: 12px; }
  .section-header>span { font-size: 10px; }
  .section-header h2 { font-size: 17px; }
  .lessons-heading { margin-top: 36px; }
  .library-tools { gap: 12px; flex-direction: column; align-items: stretch; }
  .library-tools .field { min-width: 0; }
  .lesson-card { padding: 20px; grid-template-columns: 1fr; }
  .lesson-monogram { display: none; }
  .lesson-card h2 { font-size: 24px; }
  .practice-page .tempo-panel { padding: 18px; flex-direction: column; align-items: stretch; gap: 14px; }
  .tempo-number { flex-direction: row; justify-content: center; gap: 8px; }
  .tempo-controls { gap: 8px; }
  .tempo-slider .tempo-ticks { margin-inline: 52px; }
  .ensemble-panel { padding: 20px 14px; }
  .practice-controls>.field { width: 100%; justify-content: space-between; }
  .practice-controls select { flex: 1; max-width: 180px; }
  .empty-state { padding: 40px 20px; }
  .empty-state h2 { font-size: 27px; }
  .arrangement-steps { flex-direction: column; align-items: center; gap: 14px; }
  .composition-block { padding: 19px; }
  .block-fields .field { flex: 1; min-width: 106px; }
  .notice { margin-inline: 17px; }
}
@media (max-width: 420px) { .navigation-toggle>span { display: none; } }
@media (max-width: 380px) {
  .library-toolbar { grid-template-columns: minmax(0, 1fr); }
  .filter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-tabs button { padding-inline: 6px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { button, .button, .rhythm-card { transition: none; } }
@media print {
  .site-header { display: none!important; }
  body { background: #fff; }
  :root { color-scheme: light; --ink: #202524; --subtle: #424b49; --line: #c9cdca; --paper: #fff; --bg: #fff; }
  .staff-svg { color: #163f50; }
  .staff-label, .hand-label { fill: #163f50; }
  .notation-bar, .bar-caption { background: #fff; color: #202524; border-color: #c9cdca; }
  #print-score { padding: 0; }
  #print-score h1 { margin: 0 0 1mm; font-size: 19pt; }
  #print-score > p { margin: 0 0 3mm; font-size: 8pt; }
  #print-score .print-notation { display: block; }
  #print-score .print-system { break-inside: avoid; page-break-inside: avoid; margin-bottom: 2mm; }
  #print-score .staff-svg { color: #161616; }
  #print-score .staff-label, #print-score .hand-label { fill: currentColor; }
  #print-score .print-bar-number { font: 600 10px var(--notation-font); fill: currentColor; }
  #print-score .print-tempo { font: 10px var(--notation-font); fill: currentColor; }
  #print-score .print-grouping { font: 9px var(--notation-font); fill: currentColor; }
  #print-score .notation-legend { margin-top: 2mm; padding-top: 2mm; }
  #print-score .notation-legend > strong, #print-score .legend-item { font-size: 7pt; }
  #print-score .legend-entries { gap: 1mm 3mm; margin: 1mm 0; }
  #print-score > small { display: block; margin-top: 2mm; font-size: 7pt; color: #424b49; }
}

/* Bundled journal articles and the instrument guide. */
.journal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.journal-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px #00000012; transition: border-color .18s, box-shadow .18s; }
.journal-card:hover { border-color: #796c50; box-shadow: 0 12px 34px #00000030; }
.journal-art { min-height: 190px; display: flex; align-items: center; justify-content: center; gap: 28px; background: #252a29 url('./assets/inlay-pattern.svg') center / 150px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.journal-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #252a29d9, #202426f0); }
.journal-art img { position: relative; width: 110px; height: 110px; }
.journal-art>span { position: relative; font: 36px var(--serif); letter-spacing: .04em; color: var(--accent); }
.journal-card:nth-child(3) .journal-art { background-color: #252829; }
.journal-copy { padding: 28px 30px; flex: 1; display: flex; flex-direction: column; }
.reading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; color: var(--muted); font-size: 12px; }
.reading-meta>span+span::before { content: '·'; margin-right: 20px; }
.journal-copy h2 { font-family: var(--serif); font-size: 31px; line-height: 1.18; font-weight: 400; margin: 20px 0 14px; }
.journal-copy p { color: var(--muted); font-size: 14px; max-width: 490px; flex: 1; }
.journal-open { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; color: var(--accent); font-size: 13px; }
.journal-open .ui-icon { width: 18px; }
.journal-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.35fr 1fr; }
.journal-featured .journal-copy { grid-column: 1; grid-row: 1; padding: 42px; }
.journal-featured .journal-art { grid-column: 2; grid-row: 1; border: 0; border-left: 1px solid var(--line); flex-direction: column; gap: 10px; }
.journal-featured .journal-art img { width: 165px; height: 165px; }
.journal-featured .journal-art>span { font-size: 60px; }
.journal-featured h2 { font-size: 43px; }
.reading-page { max-width: 940px; }
.reading-back { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0 25px; font-size: 13px; text-decoration: none; }
.reading-page .page-heading { margin-bottom: 18px; }
.reading-page>.reading-meta { border-bottom: 1px solid var(--line); padding-bottom: 25px; margin-bottom: 36px; }
.reading-body p { color: var(--subtle); font-size: 16px; line-height: 1.85; }
.reading-body p.reading-lead { font-size: 19px; color: #dddcd4; line-height: 1.8; }
.reading-body section { margin-top: 35px; }
.reading-body h2 { font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1.2; margin-bottom: 15px; }
.reading-points { padding-left: 23px; color: var(--subtle); font-size: 16px; line-height: 1.8; }
.reading-points li { padding-left: 5px; margin-bottom: 13px; }
.reading-points li::marker { color: var(--accent); }
.reading-sources { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 17px; }
.article-figure, .article-video { margin: 28px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.article-figure>a { display: block; background: #202728; }
.article-figure>a:focus-visible { outline: 3px solid var(--accent); outline-offset: -4px; }
.article-figure img { display: block; width: 100%; height: auto; }
.learning-timeline { background: #202728; }
.learning-timeline-heading { padding: 28px 32px 0; }
.learning-timeline-heading h2 { margin: 9px 0 8px; font: 400 32px/1.2 var(--serif); }
.reading-body .learning-timeline-heading p { margin: 0; font-size: 14px; color: var(--muted); }
.learning-timeline-stages { list-style: none; padding: 0; margin: 26px 32px 28px; }
.learning-timeline-stages li { position: relative; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 18px; padding: 0 0 26px 32px; }
.learning-timeline-stages li::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: -10px; width: 1px; background: #746749; }
.learning-timeline-stages li::after { content: ''; position: absolute; left: 0; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px #202728; }
.learning-timeline-stages li:last-child { padding-bottom: 0; }
.learning-timeline-stages li:last-child::before { display: none; }
.learning-timeline-time { color: var(--accent); font-size: 18px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.learning-timeline-detail { min-width: 0; }
.learning-timeline-detail h3 { margin: 0 0 5px; font-size: 17px; font-weight: 500; line-height: 1.45; color: var(--ink); }
.reading-body .learning-timeline-detail p { margin: 0; color: var(--subtle); font-size: 14px; line-height: 1.6; }
.learning-timeline figcaption { border-top: 1px solid var(--line); }
.learning-timeline-download { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
@media (max-width: 600px) {
  .learning-timeline-heading { padding: 24px 20px 0; }
  .learning-timeline-heading h2 { font-size: 28px; }
  .learning-timeline-stages { margin: 24px 20px; }
  .learning-timeline-stages li { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-left: 26px; }
  .learning-timeline-time { font-size: 17px; }
}
.anatomy-heading { padding: 24px 28px 20px; }
.anatomy-heading h3 { font-family: var(--serif); font-size: 32px; font-weight: 400; margin: 8px 0 0; }
.anatomy-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 28px; padding: 0 28px 24px; }
.anatomy-photo { display: block; position: relative; border-radius: 8px; overflow: hidden; }
.anatomy-photo:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.anatomy-marker, .anatomy-number { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; border-radius: 50%; font-size: 13px; font-weight: 600; line-height: 1; }
.anatomy-marker { position: absolute; width: 28px; height: 28px; transform: translate(-50%, -50%); background: #263b37; color: #fff9df; border: 2px solid #fff9df; box-shadow: 0 1px 5px #0008; }
.anatomy-key { margin: 0; display: grid; gap: 18px; }
.anatomy-key dt { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.anatomy-number { width: 24px; height: 24px; color: var(--accent); border: 1px solid var(--line); }
.anatomy-key dd { margin: 5px 0 0 34px; font-size: 13px; line-height: 1.65; color: var(--subtle); }
.anatomy-figure figcaption { border-top: 1px solid var(--line); }
.anatomy-figure .reading-source { font-size: inherit; }
.article-figure figcaption, .article-video figcaption { padding: 20px 24px; }
.reading-body figcaption p, .learn-content figcaption p { font-size: 14px; line-height: 1.75; margin: 0 0 12px; }
.reading-body .article-credit, .learn-content .article-credit { display: block; font-size: 12px; line-height: 1.7; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.article-video h3 { font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.3; margin: 0 0 8px; }
.reading-body .article-watch-prompt, .learn-content .article-watch-prompt { margin: 18px 0 12px; color: var(--subtle); }
.article-watch-prompt strong { color: var(--accent); font-weight: 500; }
.article-video-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 13px; }
.article-video-actions>a { display: inline-flex; align-items: center; min-height: 44px; }
.article-video .skills-video-screen { min-height: 220px; }
.article-video .skills-video-cover[disabled] { opacity: 1; }
.article-video .skills-video-cover[disabled] .skills-play-icon { opacity: .35; }
@media (max-width: 480px) {
  .article-figure figcaption, .article-video figcaption { padding: 16px; }
  .article-video h3 { font-size: 23px; }
}
.reading-source { display: inline-block; color: var(--accent); font-size: 12px; line-height: 1.6; padding-block: 5px; }
.reading-patterns { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 22px; margin-top: 25px; }
.reading-patterns>div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.reading-patterns strong { font-size: 14px; font-weight: 500; }
.reading-patterns code { background: #2e3535; border-radius: 5px; color: #c4dbd4; padding: 9px 12px; font-size: 16px; letter-spacing: .06em; white-space: nowrap; }
.reading-try { margin-top: 40px; padding: 30px; border: 1px solid #4b4c3e; border-radius: 14px; background: #252a29; }
.reading-try h2 { font-family: var(--serif); font-size: 30px; font-weight: 400; margin-bottom: 15px; }
.reading-try p { font-size: 14px; }
.reading-actions { margin-top: 22px; }
.more-reading { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 28px; }
.more-reading h2 { font-size: 15px; margin-bottom: 18px; }
.more-reading>a { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); color: var(--accent); text-decoration: none; }
.history-feature { display: grid; grid-template-columns: 300px minmax(0, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.history-illustration { background: #242a2a; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px 20px; gap: 13px; }
.history-illustration img { width: 210px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.history-illustration>span { font-size: 9px; color: var(--muted); letter-spacing: .2em; }
.history-intro { padding: 38px 42px; }
.history-intro h2, .history-section h2 { font-family: var(--serif); font-size: 32px; line-height: 1.2; font-weight: 400; margin: 0 0 20px; }
.history-intro p, .history-section p { font-size: 15px; line-height: 1.8; color: var(--subtle); }
.history-section { margin-top: 50px; }
.history-section .section-header { margin-bottom: 14px; }
.history-section .section-header h2 { margin: 0; }
.history-section-intro { max-width: 740px; }
.history-timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; margin-top: 28px; }
.history-timeline article { padding: 24px 0 5px 27px; border-left: 2px solid #595441; position: relative; }
.history-timeline article::before { content: ''; position: absolute; left: -6px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px var(--bg); }
.history-date { color: var(--accent); font-size: 12px; letter-spacing: .06em; }
.history-timeline h3 { margin: 17px 0 14px; font-size: 18px; }
.rhythm-context { display: flex; gap: 50px; align-items: center; padding: 36px 40px; border-radius: 15px; border: 1px solid var(--line); background: var(--paper); }
.rhythm-context>div:first-child { flex: 1; }
.history-symbol { width: 170px; flex-shrink: 0; }
.history-symbol img { width: 100%; height: auto; }
.rhythm-glossary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 28px 0 18px; }
.rhythm-glossary>div { border: 1px solid var(--line); background: var(--paper); padding: 23px; border-radius: 12px; }
.rhythm-glossary dt { display: flex; flex-direction: column; gap: 17px; font-size: 15px; font-weight: 550; }
.glossary-symbol { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 8px; background: #252a29; color: var(--accent); font: 24px var(--serif); }
.rhythm-glossary dd { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* A browsable instrument and performance guide. */
.guide-anchor { scroll-margin-top: 120px; }
.guide-anchor:focus-visible { outline: none; }
.instrument-guide-list { container-type: inline-size; margin-top: 28px; border-bottom: 1px solid var(--line); }
.instrument-photo-guide { container-type: inline-size; margin: 28px 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.instrument-photo-heading h3 { margin: 10px 0 12px; font: 30px/1.25 var(--serif); }
.instrument-photo-heading p { margin: 0 0 24px; color: var(--subtle); font-size: 14px; line-height: 1.75; }
.instrument-photo-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 16px; }
.instrument-photo-card { grid-column: span 2; margin: 0; min-width: 0; }
.instrument-photo-goblet { grid-column: span 3; }
.instrument-photo-link { position: relative; display: flex; align-items: center; justify-content: center; height: 165px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #121512; }
.instrument-photo-goblet .instrument-photo-link { height: 235px; }
.instrument-photo-link img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.instrument-photo-link img[hidden] { display: none; }
.instrument-photo-link:hover, .instrument-photo-link:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 3px; }
.instrument-photo-enlarge { position: absolute; right: 7px; top: 7px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 5px; background: #151915dd; color: var(--accent-hover); font-size: 15px; }
.instrument-photo-card figcaption { padding-top: 14px; }
.instrument-photo-card figcaption>strong { display: block; font: 23px/1.3 var(--serif); color: var(--ink); }
.instrument-photo-card figcaption>p { margin: 5px 0 8px; color: var(--subtle); font-size: 12px; line-height: 1.6; }
.instrument-photo-credit { color: var(--muted); font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.instrument-photo-credit .reading-source { font-size: inherit; }
.instrument-photo-kind { display: block; margin-bottom: 7px; color: var(--accent); font-size: 10px; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase; }
.darbuka-type-guide .instrument-photo-link { height: 220px; }
.darbuka-type-guide .instrument-photo-card:nth-child(4) { grid-column: 2 / span 2; }
.darbuka-type-guide .instrument-photo-card:nth-child(5) { grid-column: 4 / span 2; }
.reading-body .instrument-photo-note { margin: -8px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.7; }
@container (max-width: 570px) {
  .instrument-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .instrument-photo-card, .instrument-photo-goblet { grid-column: auto; }
  .darbuka-type-guide .instrument-photo-card:nth-child(n+4) { grid-column: auto; }
  .instrument-photo-link, .instrument-photo-goblet .instrument-photo-link { height: 190px; }
  .darbuka-type-guide .instrument-photo-link { height: 190px; }
}
@container (max-width: 350px) {
  .instrument-photo-grid { grid-template-columns: 1fr; gap: 26px; }
  .instrument-photo-link, .instrument-photo-goblet .instrument-photo-link { height: 220px; }
  .darbuka-type-guide .instrument-photo-link { height: 220px; }
  .instrument-photo-credit { font-size: 11px; }
}
@media (max-width: 600px) {
  .instrument-photo-guide { padding: 18px; }
  .instrument-photo-heading h3 { font-size: 27px; }
}
.instrument-guide-entry { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.7fr); align-items: start; gap: 20px 28px; padding: 30px 0; border-top: 1px solid var(--line); scroll-margin-top: 130px; }
.instrument-guide-title { grid-column: 1 / -1; }
.instrument-guide-title h3 { font-family: var(--serif); font-size: 27px; line-height: 1.25; font-weight: 400; margin: 0 0 8px; }
.instrument-guide-title span { display: block; color: var(--muted); font-size: 11px; line-height: 1.7; }
.instrument-guide-entry .instrument-photo-card { grid-column: auto; }
.instrument-guide-entry .instrument-photo-link { height: 240px; }
.instrument-guide-copy>p { margin: 0; font-size: 14px; }
.instrument-guide-copy .listening-tip { margin-top: 20px; }
.instrument-guide-copy .reading-sources { margin-top: 12px; gap: 4px 16px; }
@container (max-width: 570px) {
  .instrument-guide-entry { grid-template-columns: 1fr; gap: 18px; }
  .instrument-guide-copy>p { font-size: 15px; }
}
.listening-tip { border-left: 2px solid #cbb27e38; padding-left: 19px; }
.listening-tip>span { color: var(--accent); font-size: 9px; letter-spacing: .17em; }
.history-section .listening-tip p { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 8px 0 0; }
.melodic-heading { margin-top: 40px; }
.melodic-heading h3 { font-size: 21px; margin-bottom: 10px; }
.melodic-heading p { color: var(--muted); font-size: 14px; }
.melodic-guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 23px; }
.melodic-guide-grid article { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 24px; }
.guide-kind { color: var(--muted); font-size: 12px; line-height: 1.5; letter-spacing: 0; }
.melodic-guide-grid h3 { font: 27px var(--serif); margin: 15px 0 12px; }
.melodic-guide-grid p { font-size: 13px; flex: 1; }
.melodic-guide-grid .reading-source { font-size: 11px; }
.performance-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.performance-guide-card { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 30px; }
.performance-guide-card h3 { font: 32px var(--serif); margin: 13px 0 16px; }
.performance-guide-card>p { font-size: 14px; flex: 1; }
.performance-guide-card .listening-tip { margin: 10px 0 18px; }
.journal-art>span { max-width: 65%; }
.journal-featured .journal-darbuka img { width: 200px; height: 200px; }
.journal-featured .journal-darbuka>span { font-size: 35px; letter-spacing: .16em; }
@media (max-width: 1050px) {
  #main-content { scroll-margin-top: 150px; }
  .guide-anchor { scroll-margin-top: 165px; }
  .melodic-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-feature { grid-template-columns: 235px minmax(0, 1fr); }
  .history-intro { padding: 28px; }
  .history-illustration img { width: 190px; }
  .rhythm-glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #main-content { scroll-margin-top: 195px; }
  .guide-anchor { scroll-margin-top: 205px; }
  .performance-guide-grid { grid-template-columns: 1fr; }
  .journal-featured { grid-template-columns: 1fr; }
  .journal-featured .journal-art { grid-column: 1; grid-row: 1; min-height: 200px; border: 0; border-bottom: 1px solid var(--line); flex-direction: row; gap: 25px; }
  .journal-featured .journal-copy { grid-column: 1; grid-row: 2; padding: 28px; }
  .journal-featured .journal-art img { width: 130px; height: 130px; }
  .journal-featured h2 { font-size: 34px; }
  .journal-art { gap: 15px; }
  .journal-art img { width: 80px; height: 80px; }
  .journal-art>span { font-size: 24px; }
  .journal-copy { padding: 24px; }
  .journal-copy h2 { font-size: 28px; }
  .history-feature { grid-template-columns: 1fr; }
  .history-illustration { padding: 20px; }
  .history-illustration img { width: 170px; }
  .history-timeline { gap: 25px; }
  .history-symbol { display: none; }
  .rhythm-context { padding: 28px; }
}
@media (max-width: 600px) {
  .melodic-guide-grid { grid-template-columns: 1fr; gap: 14px; }
  .melodic-guide-grid article, .performance-guide-card { padding: 24px; }
  .melodic-guide-grid p, .performance-guide-card>p { font-size: 14px; }
  .reading-points { font-size: 15px; }
  .journal-featured .journal-darbuka img { width: 115px; height: 115px; }
  .journal-featured .journal-darbuka>span { font-size: 23px; letter-spacing: .02em; }
  .journal-grid { grid-template-columns: 1fr; gap: 20px; }
  .journal-copy, .journal-featured .journal-copy { padding: 25px; }
  .journal-art, .journal-featured .journal-art { min-height: 165px; }
  .journal-art img, .journal-featured .journal-art img { width: 105px; height: 105px; }
  .journal-art>span { font-size: 30px; }
  .reading-page .page-heading h1 { font-size: 39px; }
  .reading-meta { font-size: 11px; gap: 8px 12px; }
  .reading-meta>span+span::before { margin-right: 12px; }
  .reading-body p { font-size: 15px; }
  .reading-body p.reading-lead { font-size: 17px; }
  .reading-body h2 { font-size: 27px; }
  .reading-patterns { padding: 15px; }
  .reading-patterns code { font-size: 13px; letter-spacing: 0; }
  .reading-try { padding: 24px; }
  .reading-try h2 { font-size: 28px; }
  .more-reading>a { font-size: 14px; }
  .history-intro { padding: 27px 24px; }
  .history-intro h2, .history-section h2 { font-size: 29px; }
  .history-timeline { grid-template-columns: 1fr; gap: 25px; }
  .history-section { margin-top: 38px; }
  .rhythm-context { padding: 25px; }
  .rhythm-glossary { gap: 12px; }
  .rhythm-glossary>div { padding: 18px 15px; }
  .rhythm-glossary dt { font-size: 14px; }
  .rhythm-glossary dd { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .journal-card { transition: none; } }

.reading-route .app-content>main { padding-bottom: 20px; }

/* Learn keeps its topic menu beside a focused reading page. */
.learn-page { display: grid; grid-template-columns: 218px minmax(0, 1fr); align-items: start; gap: 48px; }
.learn-sidebar { position: sticky; top: 118px; min-width: 0; }
.learn-sidebar-heading { padding: 0 16px 22px; }
.learn-sidebar-heading h2 { margin: 0 0 8px; font: 32px var(--serif); }
.learn-sidebar-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.learn-toggle { display: none; }
#learn-navigation { max-height: calc(100dvh - 218px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #51544b transparent; padding: 5px 7px 8px 5px; }
.learn-sections, .learn-rhythm-links { display: flex; flex-direction: column; gap: 3px; }
.learn-nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 7px; color: var(--subtle); font-size: 13px; line-height: 1.4; text-decoration: none; border-left: 2px solid transparent; }
.learn-nav-link:hover { color: var(--ink); background: #ffffff05; }
.learn-nav-link[aria-current=page] { color: var(--accent-hover); background: #cbb27e10; border-left-color: var(--accent); }
.learn-nav-link .ui-icon { width: 17px; height: 17px; color: var(--muted); }
.learn-nav-link[aria-current=page] .ui-icon { color: var(--accent); }
.learn-rhythm-heading { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin: 22px 12px 10px; padding-top: 21px; font-size: 9px; letter-spacing: .12em; color: var(--muted); }
.learn-rhythm-links .learn-nav-link { justify-content: space-between; min-height: 38px; padding-block: 8px; font-size: 12px; }
.learn-rhythm-links small { font-size: 10px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.learn-content { min-width: 0; padding-left: 36px; border-left: 1px solid var(--line); }
.learn-content .article-video, .learn-content .article-figure { min-width: 0; }
.history-article { max-width: 900px; }
.history-article .history-lead { font-size: 19px; line-height: 1.85; color: #dddcd4; margin: 24px 0 30px; }
.history-contents { border-block: 1px solid var(--line); margin: 28px 0 32px; }
.history-contents>summary { display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 12px 2px; cursor: pointer; list-style: none; font-size: 14px; color: var(--ink); }
.history-contents>summary::-webkit-details-marker { display: none; }
.history-contents>summary>span { flex: 1; }
.history-contents>summary small { font-size: 11px; color: var(--muted); }
.history-contents>summary .ui-icon { width: 16px; height: 16px; color: var(--accent); }
.history-contents[open]>summary .ui-icon { transform: rotate(180deg); }
.history-contents ol { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 30px; padding: 0 0 16px; margin: 0; list-style: none; }
.history-contents button { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 8px; width: 100%; min-height: 44px; text-align: left; background: transparent; border: 0; border-radius: 5px; font-size: 13px; color: var(--subtle); }
.history-contents button:hover { color: var(--accent-hover); background: var(--surface); }
.history-contents button span { font-size: 14px; color: var(--accent); }
.history-chapter { margin-top: 50px; padding-top: 8px; scroll-margin-top: 120px; }
.history-chapter>h2 { font-family: var(--serif); font-size: 32px; font-weight: 400; line-height: 1.25; margin: 0 0 22px; text-wrap: balance; }
.history-passage { margin: 0 0 24px; }
.history-passage>h3 { font-size: 18px; line-height: 1.45; font-weight: 500; margin: 30px 0 12px; }
.history-passage>p, .history-milestones p { font-size: 16px; line-height: 1.85; color: var(--subtle); margin: 0 0 10px; }
.learn-prose { max-width: 800px; }
.reading-topic { scroll-margin-top: 120px; }
.reading-topic>p>strong, .learn-prose .history-passage>p>strong { color: var(--ink); font-weight: 500; }
.reading-note-symbol { display: inline-block; min-width: 24px; margin-right: 8px; color: var(--accent); font-family: var(--serif); text-align: center; }
.reading-citation>a { display: inline-block; min-width: 24px; padding: 0 2px; text-align: center; font-size: 12px; line-height: 24px; font-variant-numeric: tabular-nums; color: var(--accent); text-decoration: none; border-radius: 3px; }
.reading-citation>a:hover, .reading-citation>a:focus-visible { color: var(--accent-hover); background: #cbb27e18; text-decoration: underline; text-underline-offset: 3px; }
.reading-source-preview { position: fixed; z-index: 80; display: block; width: min(290px, calc(100vw - 24px)); padding: 14px 16px; border: 1px solid #69614e; border-radius: 8px; background: #262a25; box-shadow: 0 8px 30px #0006; text-align: left; font-size: 12px; line-height: 1.6; color: var(--subtle); overflow-wrap: anywhere; }
.reading-source-preview[hidden] { display: none; }
.reading-source-preview strong { display: block; font-weight: 500; font-size: 13px; color: var(--ink); }
.reading-source-preview>span { display: block; color: var(--muted); margin-top: 5px; }
.history-photo>a { background: #161915; }
.history-photo img { max-height: 520px; object-fit: contain; }
.history-photo img[hidden], .photo-fallback { display: none; }
.photo-unavailable .photo-fallback { display: block; padding: 36px 24px; font-size: 14px; }
.history-milestones { list-style: none; margin: 24px 0; padding: 0 0 0 8px; }
.history-milestones li { position: relative; padding: 0 0 30px 27px; border-left: 1px solid #595441; }
.history-milestones li:last-child { padding-bottom: 0; }
.history-milestones li::before { content: ''; position: absolute; top: 4px; left: -5px; width: 9px; height: 9px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px var(--bg); }
.history-milestones .history-milestone-title { margin: 8px 0; font-size: 16px; line-height: 1.45; color: var(--ink); }
.history-milestones p { font-size: 15px; }
.history-milestone-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.history-date-note { border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; font-size: 10px; color: var(--muted); }
.history-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 24px 0 14px; }
.history-materials { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.65; text-align: left; }
.history-materials caption { text-align: left; padding: 18px; color: var(--ink); background: var(--paper); font-weight: 500; font-size: 15px; }
.history-materials th, .history-materials td { padding: 14px 16px; vertical-align: top; border-top: 1px solid var(--line); }
.history-materials thead th { font-weight: 500; color: var(--muted); font-size: 12px; }
.history-materials tbody th { font-weight: 500; width: 18%; }
.history-materials td { color: var(--subtle); }
.history-materials.reading-prose-table { min-width: 0; table-layout: fixed; }
.reading-prose-table tr > :first-child { width: 34%; }
.reading-rhythm-comparison { min-width: 480px; }
.reading-rhythm-comparison th, .reading-rhythm-comparison td { text-align: center; }
.reading-rhythm-comparison th:first-child { text-align: left; width: 24%; }
.reading-rhythm-comparison td { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 16px; font-weight: 600; }
.reading-bibliography { border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; margin: 38px 0; background: var(--paper); }
.reading-bibliography summary { cursor: pointer; font-size: 15px; line-height: 1.6; color: var(--accent); }
.reading-bibliography p { font-size: 13px; line-height: 1.75; color: var(--muted); }
.reading-bibliography ol { padding-left: 20px; }
.reading-bibliography li { margin-top: 20px; color: var(--muted); font-size: 12px; }
.reading-bibliography li p { margin: 6px 0 0; }
.history-next { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 24px; font-size: 14px; }
@media (max-width: 620px) {
  .anatomy-heading { padding: 20px 20px 16px; }
  .anatomy-layout { grid-template-columns: 1fr; padding: 0 20px 22px; gap: 22px; }
  .anatomy-photo { width: 100%; max-width: 360px; justify-self: center; }
  .anatomy-key { gap: 16px; }
  .history-article .history-lead { font-size: 17px; }
  .history-contents ol { grid-template-columns: 1fr; }
  .history-chapter { margin-top: 38px; }
  .history-chapter>h2 { font-size: 28px; }
  .history-passage>p { font-size: 15px; }
  .history-materials th, .history-materials td { padding: 12px 10px; }
  .history-materials { min-width: 460px; }
  .reading-bibliography { padding: 18px; }
}
.roll-guide-card .article-video { margin-bottom: 0; }
.learn-content .page-heading { margin-bottom: 30px; }
.practice-page .page-heading h1, .learn-content .page-heading h1 { font-size: clamp(38px, 4vw, 54px); overflow-wrap: anywhere; }
.practice-page .page-heading .subtitle, .learn-content .subtitle { max-width: 720px; }
/* Keep the normal section gap after the Learn topic cards. */
.learn-content>div>.history-section:first-of-type:not(.learn-rhythm-grid + .history-section) { margin-top: 0; }
.learn-content .history-feature { grid-template-columns: 190px minmax(0, 1fr); }
.learn-content .history-illustration img { width: 155px; max-width: 100%; }
.learn-content .history-intro { padding: 28px; }
.learn-content .history-intro h2, .learn-content .history-section h2 { font-size: 29px; }
.learn-content .melodic-guide-grid, .learn-content .rhythm-glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.learn-content .history-symbol { width: 120px; }
.learn-content .rhythm-context { gap: 24px; padding: 28px; }
.learn-content .button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; margin-top: 10px; border: 1px solid #6a5f46; border-radius: 8px; text-decoration: none; font-size: 13px; }
.learn-content .button:hover { background: #cbb27e10; }
.learn-rhythm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.learn-rhythm-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); }
.learn-rhythm-card:hover { border-color: #796c50; }
.learn-card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.learn-card-title h2 { font: 27px var(--serif); margin: 0 0 10px; }
.learn-rhythm-card .rhythm-arabic { align-self: flex-start; font-size: 18px; }
.learn-rhythm-card p { color: var(--muted); font-size: 12px; margin: 10px 0 20px; flex: 1; }
.learn-card-open { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--accent); }
.learn-card-open .ui-icon { width: 17px; }
.learn-rhythm-meta { margin: -9px 0 30px; }
.learn-rhythm-meta>span+span::before { content: none; }
.rhythm-region-tags, .rhythm-context-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rhythm-region-tags li, .rhythm-context-tags li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--accent); font-size: 12px; }
.rhythm-region-context .hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.learn-pattern { padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.learn-pattern-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.learn-pattern-heading h2 { font: 27px var(--serif); margin: 0; }
.learn-pattern-heading .guide-kind { flex-shrink: 0; }
.learn-pattern-selector { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.learn-pattern-selector .field-label { flex-shrink: 0; }
.learn-pattern-selector select { width: 210px; min-width: 0; max-width: 100%; }
.learn-pattern p { color: var(--subtle); font-size: 14px; }
.learn-pattern .hint { color: var(--muted); font-size: 12px; margin: 16px 0 0; }
.learn-pattern-scroll { max-width: 100%; overflow-x: auto; margin-top: 24px; padding: 4px 0 12px; }
.learn-pattern .pulse-rail { overflow: visible; margin: 0; }
.learn-pattern .pulse-lane { grid-template-columns: repeat(var(--pulses), minmax(42px, 1fr)); }
.learn-pattern .pulse-cell { min-width: 42px; min-height: 84px; }
.learn-pattern .pulse-cell>strong+small { display: none; }
.learn-pattern .pulse-track-name { display: none; }
.learn-pattern .reading-actions { margin-top: 22px; }
.learn-pattern .reading-actions button+button { background: transparent; color: var(--accent); border-color: #6a5f46; }
.learn-rhythm-page .rhythm-sources { padding-left: 20px; }
.learn-rhythm-page .rhythm-sources a { overflow-wrap: anywhere; }
.learn-neighbours { display: flex; justify-content: space-between; gap: 24px; padding-top: 24px; margin-top: 40px; border-top: 1px solid var(--line); }
.learn-neighbours a { display: flex; flex-direction: column; gap: 7px; text-decoration: none; }
.learn-neighbours>a:last-child { text-align: right; }
.learn-neighbours small { font-size: 11px; }
.learn-neighbours span { font: 23px var(--serif); }

/* The stroke guide uses the same symbols as the practice player. */
.stroke-intro { max-width: 710px; color: var(--subtle); font-size: 15px; line-height: 1.8; margin: -6px 0 30px; }
.stroke-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.stroke-guide-card { min-width: 0; padding: 25px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.stroke-guide-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.stroke-symbol { display: grid; place-items: center; flex: 0 0 49px; width: 49px; height: 56px; border: 1px solid #435f5f; border-radius: 10px; background: #273b3c; color: #bed6d2; font: 30px var(--serif); }
.stroke-dum .stroke-symbol { background: #3c3527; border-color: #66583b; color: #dfc796; }
.stroke-rest .stroke-symbol { background: #24292c; border-color: #353d40; color: var(--muted); }
.stroke-pop .stroke-symbol { background: #2a2931; border-color: #514b62; color: #c8bddc; }
.stroke-guide-heading .guide-kind { line-height: 1.6; }
.stroke-guide-heading h2 { font: 27px var(--serif); line-height: 1.2; margin: 6px 0 0; }
.stroke-guide-card p, .stroke-details dd { color: var(--subtle); font-size: 14px; line-height: 1.8; }
.stroke-details { margin: 23px 0; }
.stroke-details dt, .stroke-practice-tip h3 { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 500; }
.stroke-details dd { margin: 0 0 17px; }
.stroke-practice-tip { padding: 17px 19px; border-left: 2px solid #5b604a; background: #ffffff03; }
.stroke-practice-tip p { margin: 0; font-size: 13px; }
.stroke-guide-card .stroke-note { margin: 20px 0 0; color: var(--muted); font-size: 12px; }
.stroke-guide-card .reading-sources { flex-direction: column; align-items: flex-start; gap: 3px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.stroke-guide-card .reading-source { overflow-wrap: anywhere; }
.stroke-ornaments>div { margin-top: 24px; }
.stroke-ornaments h3 { font-size: 17px; margin-bottom: 10px; }
.stroke-guide-link { display: inline-block; min-height: 36px; padding: 8px 0; font-size: 12px; }
.roll-jump-links { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }
.roll-jump-links button { min-height: 40px; padding: 8px 14px; border-radius: 20px; color: var(--subtle); font-size: 12px; }
.roll-jump-links button:hover { color: var(--accent); border-color: var(--accent); }
.roll-guide-card { scroll-margin-top: 110px; }
.roll-symbol { color: #dfc796; background: #3c3527; border-color: #66583b; }
.roll-sequence { margin: 22px 0; }
.roll-sequence figcaption { color: var(--muted); font-size: 11px; line-height: 1.7; margin-bottom: 10px; }
.roll-sequence ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.roll-sequence li { min-width: 32px; text-align: center; padding: 8px 10px; border: 1px solid #435f5f; border-radius: 6px; background: #273b3c; color: #bed6d2; font-size: 12px; }
.roll-practice ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-left: 20px; }
.roll-practice li { padding-left: 5px; }
.roll-practice li::marker { color: var(--accent); }
.roll-practice h3 { font-size: 16px; margin: 0 0 10px; }
.roll-practice p { font-size: 13px; }
@media (max-width: 1050px) {
  .stroke-guide-grid { grid-template-columns: 1fr; }
  .roll-practice ol { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 600px) {
  .stroke-guide-card { padding: 22px; }
  .stroke-guide-heading { gap: 14px; }
  .stroke-guide-heading h2 { font-size: 25px; }
  .stroke-guide .reading-actions, .roll-guide .reading-actions { flex-direction: column; }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .learn-page { grid-template-columns: 175px minmax(0, 1fr); gap: 24px; }
  .learn-sidebar { top: 165px; }
  #learn-navigation { max-height: calc(100dvh - 265px); }
  .learn-content { padding-left: 24px; }
  .learn-content .history-feature, .learn-content .performance-guide-grid { grid-template-columns: 1fr; }
  .learn-content .history-illustration { padding: 20px; }
  .learn-content .history-illustration img { width: 150px; }
  .learn-content .history-timeline { grid-template-columns: 1fr; }
  .learn-content .history-symbol { display: none; }
  .learn-rhythm-card { padding: 18px; }
  .learn-card-title { flex-wrap: wrap; gap: 0 8px; }
  .learn-pattern-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
  .learn-pattern-selector { width: 100%; }
  .learn-pattern-selector select { flex: 1; width: auto; }
}
@media (max-width: 760px) {
  .learn-page { display: block; }
  .learn-sidebar { position: static; margin-bottom: 30px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
  .learn-sidebar-heading { display: none; }
  .learn-toggle { display: flex; width: 100%; gap: 12px; padding: 10px; border: 0; background: transparent; text-align: left; justify-content: flex-start; }
  .learn-toggle>span { min-width: 0; flex: 1; }
  .learn-toggle small, .learn-toggle strong { display: block; }
  .learn-toggle small { font-size: 10px; font-weight: 400; margin-bottom: 3px; }
  .learn-toggle strong { font-size: 14px; font-weight: 500; }
  .learn-toggle>.ui-icon { color: var(--accent); width: 18px; }
  .learn-toggle[aria-expanded=true]>.ui-icon:last-child { transform: rotate(180deg); }
  #learn-navigation { display: none; max-height: 55dvh; padding: 8px; border-top: 1px solid var(--line); margin-top: 5px; }
  .learn-sidebar.is-open #learn-navigation { display: block; }
  .learn-rhythm-links .learn-nav-link { min-height: 44px; font-size: 13px; }
  .learn-content { padding-left: 0; border: 0; }
  .learn-content .history-feature { grid-template-columns: 1fr; }
  .learn-content .history-illustration { padding: 20px; }
  .learn-pattern-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 600px) {
  .learn-rhythm-grid, .learn-content .melodic-guide-grid { grid-template-columns: 1fr; }
  .learn-content .history-intro, .learn-pattern { padding: 22px; }
  .learn-content .rhythm-glossary { gap: 10px; }
  .learn-content .rhythm-glossary>div { padding: 17px; }
  .learn-content .history-timeline { grid-template-columns: 1fr; }
  .learn-pattern .reading-actions { flex-direction: column; }
}
.transport[hidden] { display: none; }

/* One practice dock: choose, play and adjust without leaving the rhythm. */
.app-content>main { padding-bottom: 48px; }
.app-content:has(+ .transport:not([hidden])) { padding-bottom: calc(var(--transport-height, 230px) + max(18px, env(safe-area-inset-bottom))); }
.transport {
  position: fixed; z-index: 60; left: 50%; right: auto; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: calc(100% - 56px); max-width: 1200px; min-height: 0;
  padding: 16px 20px 11px; border: 1px solid #69604b; border-radius: 20px;
  background: linear-gradient(120deg, #292b28fa, #202427fa 48%); box-shadow: 0 12px 48px #00000080, 0 1px 0 #ffffff08 inset;
  backdrop-filter: blur(24px); max-height: calc(100dvh - 90px - var(--site-footer-height)); overflow-y: auto;
}
.transport-main { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(185px, .9fr) minmax(270px, 1.4fr) 44px; gap: 20px; align-items: center; }
.transport-current { display: flex; align-items: center; gap: 14px; min-width: 0; }
.transport-meter { flex: 0 0 47px; min-height: 51px; border: 1px solid #cbb27e30; border-radius: 10px; background: #cbb27e08; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent-hover); }
.transport-meter strong { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.transport-meter>span { font-size: 7px; letter-spacing: .12em; color: #b5ac97; }
.transport-source { display: block; min-width: 0; max-width: none; flex: 1; }
.transport-title { display: flex; justify-content: flex-start; gap: 9px; border: 0; background: transparent; border-radius: 6px; max-width: 100%; min-height: 35px; padding: 0 3px; text-align: left; color: var(--ink); }
.transport-title>span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--serif); font-size: 24px; line-height: 1.35; }
.transport-title>.ui-icon { width: 15px; height: 15px; color: var(--accent); }
.transport-title:hover:not(:disabled) { background: #ffffff06; color: var(--accent-hover); }
.transport-variation { display: block; width: auto; max-width: 100%; min-height: 30px; height: 30px; padding: 2px 24px 2px 3px; border: 0; border-radius: 5px; font-size: 11px; color: var(--subtle); background-color: transparent; cursor: pointer; }
.transport-variation:hover { background-color: #ffffff06; }
.transport-kind { display: block; margin: 3px 0 7px 3px; font-size: 11px; color: var(--muted); }
.transport-buttons { display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); align-items: center; gap: 12px; }
.transport-play { display: grid; place-items: center; width: 54px; height: 54px; min-width: 54px; min-height: 54px; padding: 0; border-radius: 50%; border: 1px solid var(--accent); background: var(--accent); color: #1c1e1b; box-shadow: 0 3px 16px #cbb27e15; }
.transport-play:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.transport-play .ui-icon { width: 26px; height: 26px; stroke-width: 1.7; }
.transport-play[data-icon=play] .ui-icon { fill: currentColor; }
.transport-play[data-icon=pause] .ui-icon { stroke-width: 4; }
.transport-skip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 48px; padding: 5px 2px; border: 0; background: transparent; color: var(--subtle); }
.transport-skip>.ui-icon { width: 21px; height: 21px; }
.transport-skip>span { font-size: 10px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport-skip:hover:not(:disabled) { background: #ffffff06; color: var(--accent-hover); }
.transport-buttons.sequence-buttons { display: flex; justify-content: center; gap: 6px; }
.sequence-buttons>.transport-skip { flex: 0 0 44px; width: 44px; }
@media (min-width: 761px) {
  .transport-main.transport-sequence { grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr) 44px; }
  .transport-simplified .transport-main.transport-sequence { grid-template-columns: minmax(0, 1fr) auto minmax(0, 160px) 44px; }
}
.transport-main>button.transport-more { display: grid; place-items: center; align-self: center; width: 44px; min-height: 44px; padding: 0; border-color: #cbb27e33; border-radius: 50%; background: transparent; color: var(--ink); grid-column: 4; grid-row: 1; }
.transport-more>.ui-icon { width: 24px; height: 24px; fill: currentColor; }
.transport-tempo { min-width: 0; }
.transport-tempo-caption { display: flex; justify-content: space-between; padding: 0 6px; margin-bottom: 1px; font-size: 9px; color: var(--muted); }
.transport-tempo-caption>span:first-child { letter-spacing: .14em; }
.transport-tempo-controls { display: flex; align-items: center; gap: 9px; }
.transport-tempo .tempo-step { flex: 0 0 32px; width: 32px; min-height: 44px; height: 44px; border: 0; background: transparent; color: var(--subtle); font-size: 23px; padding: 0; }
.transport-tempo .tempo-step:hover:not(:disabled) { background: #ffffff08; color: var(--accent-hover); }
.transport input.transport-tempo-slider { flex: 1; width: 100%; min-width: 0; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.transport-tempo-slider::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(to right, var(--accent) 0 var(--tempo-fill), #535956 var(--tempo-fill) 100%); }
.transport-tempo-slider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border: 2px solid #e9d7b1; border-radius: 50%; background: var(--accent-hover); margin-top: -8.5px; box-shadow: 0 2px 8px #00000055; }
.transport-tempo-slider::-moz-range-track { height: 5px; border-radius: 5px; background: #535956; }
.transport-tempo-slider::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--accent); }
.transport-tempo-slider::-moz-range-thumb { width: 19px; height: 19px; border: 2px solid #e9d7b1; border-radius: 50%; background: var(--accent-hover); box-shadow: 0 2px 8px #00000055; }
.transport-bpm { display: flex; flex-direction: column; justify-content: center; align-items: center; flex: 0 0 57px; border-left: 1px solid #ffffff12; padding-left: 8px; }
.transport-bpm input { width: 100%; min-height: 31px; height: 31px; padding: 0; border: 0; border-radius: 4px; background: transparent; font-size: 23px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.transport-bpm input::-webkit-inner-spin-button, .transport-bpm input::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; margin: 0; }
.transport-bpm>span { font-size: 8px; letter-spacing: .1em; color: var(--muted); line-height: 1.4; }
.transport-block-tempo { font-size: 12px; color: var(--subtle); text-align: center; }
.transport-section-loop { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.transport-loop-name { display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; color: var(--accent); overflow-wrap: anywhere; }
.transport-loop-name .ui-icon { width: 14px; height: 14px; flex-shrink: 0; }
.transport-exit-loop { min-height: 36px; padding: 6px 12px; font-size: 12px; border-color: #cbb27e66; background: #cbb27e12; color: var(--ink); }
.transport-statusline { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #ffffff0b; padding-top: 8px; margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.transport-statusline>span { text-transform: capitalize; min-width: 0; }
.transport-statusline>div { display: flex; gap: 6px; flex-shrink: 0; }
.transport-detail { display: block; min-height: 0; margin: 7px 0 0; font-size: 11px; line-height: 1.5; color: var(--accent-hover); white-space: normal; overflow: visible; overflow-wrap: anywhere; text-align: left; }
.transport-detail:empty { display: none; }
.transport-detail.transport-warning { color: var(--danger); max-height: 20vh; overflow-y: auto; }

/* Focus stays inside these native dialogs; Escape and outside taps dismiss them. */
.player-sheet { width: 430px; max-width: calc(100vw - 28px); }
.player-sheet .modal-heading { padding: 18px 21px; background: transparent; }
.player-sheet .modal-heading h2 { font-size: 25px; }
.player-sheet .modal-heading .icon-button { border: 0; background: transparent; color: var(--muted); min-width: 44px; }
.player-sheet .modal-body { padding: 12px; max-height: 65dvh; }
.player-sheet .modal-actions:empty { display: none; }
.heading-with-info { display: flex; align-items: center; gap: 4px; min-width: 0; }
.heading-with-info h2 { margin: 0; }
.info-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; min-height: 44px; padding: 10px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.info-button:hover { background: var(--field); color: var(--accent-hover); }
.info-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.info-button > .ui-icon { width: 18px; height: 18px; }
.info-dialog { width: 460px; max-width: calc(100vw - 32px); }
.info-dialog .modal-heading { gap: 12px; }
.info-dialog .modal-heading h2 { min-width: 0; font-size: 24px; }
.info-dialog .modal-heading .icon-button { flex: 0 0 44px; width: 44px; min-height: 44px; }
.info-dialog .modal-body p { font-size: 14px; }
.info-dialog .modal-actions:empty { display: none; }
.info-copy { display: grid; gap: 12px; }
.info-copy p { margin: 0; line-height: 1.7; }
.player-options { display: flex; flex-direction: column; gap: 3px; }
.player-option { display: flex; align-items: center; justify-content: flex-start; gap: 15px; padding: 12px; border: 0; background: transparent; text-align: left; }
.player-option>.ui-icon:first-child { width: 23px; height: 23px; color: var(--accent); }
.player-option>span { flex: 1; }
.player-option strong, .player-option small { display: block; }
.player-option strong { font-size: 14px; font-weight: 500; color: var(--ink); }
.player-option small { font-size: 11px; margin-top: 3px; line-height: 1.5; }
.player-option>.ui-icon:last-child { width: 15px; color: var(--muted); }
.player-stop { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 12px 4px; }
.player-stop>.ui-icon { width: 18px; height: 18px; color: var(--accent); }
.player-inline-settings { padding: 0 12px 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.player-screen-awake, .player-dock-setting { padding-bottom: 18px; }
.player-screen-awake button[hidden] { display: none; }
.player-inline-settings .check { display: flex; width: 100%; margin: 0; font-weight: 500; }
.player-screen-awake .check-label>span, .player-screen-awake .check-label>small,
.player-dock-setting .check-label>span, .player-dock-setting .check-label>small { display: block; }
.player-screen-awake .check-label>small, .player-dock-setting .check-label>small { font-weight: 400; }
.player-inline-settings .hint { margin: 2px 0 0; font-size: 11px; line-height: 1.5; }
.player-sound-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 12px; }
.player-sound-label { display: flex; align-items: center; gap: 4px; min-width: 0; }
.player-sound-label label { min-width: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.player-sound-info { display: grid; place-items: center; flex: 0 0 28px; min-height: 44px; color: var(--muted); border-radius: 6px; }
.player-sound-info[hidden] { display: none; }
.player-sound-info:hover { color: var(--accent-hover); }
.player-sound-info>.ui-icon { width: 17px; height: 17px; }
.player-sound-setting select { width: 100%; min-width: 0; }
.player-sound-setting .player-sound-status { margin-top: 8px; color: var(--accent-hover); }
.player-sound-status:empty { display: none; }
.player-metronome { margin-top: 12px; }
.rhythm-picker-search { position: sticky; top: 0; z-index: 1; background: var(--paper); }
.rhythm-picker-search input { width: 100%; padding-left: 39px; }
.rhythm-picker-search>.ui-icon { left: 12px; width: 17px; }
.rhythm-picker-count { margin: 11px 9px 0; color: var(--muted); font-size: 11px; }
.rhythm-picker-group { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 15px 9px 7px; margin: 0; }
.rhythm-picker-item { display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 11px; width: 100%; border: 1px solid transparent; background: transparent; text-align: left; }
.rhythm-picker-item[aria-current=true] { background: var(--green-light); border-color: #cbb27e30; }
.picker-meter { display: grid; place-items: center; width: 39px; height: 39px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; color: var(--accent-hover); }
.picker-name { flex: 1; min-width: 0; }
.picker-name strong { display: block; font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.picker-name small { display: block; font-size: 11px; }
.rhythm-picker-item>.ui-icon { width: 17px; color: var(--accent); }
.picker-empty { padding: 18px 10px; color: var(--muted); }
.session-fields>.field { margin-bottom: 18px; }
.session-fields>.check { margin-bottom: 15px; }

@media (max-width: 1050px) and (min-width: 761px) {
  .transport-main { grid-template-columns: minmax(180px, 1fr) minmax(180px, .85fr) minmax(225px, 1fr) 44px; gap: 12px; }
  .transport { width: calc(100% - 36px); padding-inline: 16px; }
  .transport-current { gap: 9px; }
  .transport-buttons { gap: 5px; }
  .transport-title>span { font-size: 21px; }
  .transport-tempo-controls { gap: 3px; }
  .transport-bpm { flex-basis: 49px; }
}
@media (max-width: 760px) {
  .transport { width: calc(100% - 24px); bottom: max(10px, env(safe-area-inset-bottom)); padding: 10px 15px 9px; border-radius: 18px; }
  .transport-main { grid-template-columns: minmax(0, 1fr) 44px; gap: 7px 10px; }
  .transport-current { grid-column: 1; grid-row: 1; gap: 12px; }
  .transport-main>button.transport-more { grid-column: 2; grid-row: 1; }
  .transport-title>span { font-size: 24px; }
  .transport-variation { font-size: 11px; }
  .transport-meter { flex-basis: 44px; min-height: 48px; }
  .transport-buttons { grid-column: 1 / -1; grid-row: 2; grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr); gap: 20px; width: 100%; max-width: 420px; justify-self: center; }
  .transport-play { width: 52px; height: 52px; min-width: 52px; min-height: 52px; }
  .transport-skip { flex-direction: row; gap: 10px; min-height: 44px; }
  .transport-skip>span { width: auto; font-size: 11px; }
  .skip-previous { flex-direction: row-reverse; }
  .transport-tempo, .transport-block-tempo { grid-column: 1 / -1; grid-row: 3; }
  .transport-tempo-caption { display: none; }
  .transport-tempo-controls { gap: 5px; }
  .transport-tempo .tempo-step { flex-basis: 32px; width: 32px; }
  .transport-bpm { flex-basis: 59px; }
  .transport-statusline { font-size: 10px; margin-top: 4px; padding-top: 7px; gap: 8px; }
  .transport-detail { font-size: 11px; }
  .player-sheet { position: fixed; top: auto; bottom: max(12px, env(safe-area-inset-bottom)); margin: 0 auto; width: 460px; border-radius: 20px; }
  .player-sheet .modal-body { max-height: 62dvh; }
  .player-sheet .modal-heading { padding: 13px 19px; }
  .rhythm-picker { bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .transport { padding-inline: 11px; }
  .transport-current { gap: 9px; }
  .transport-title>span { font-size: 22px; }
  .transport-buttons { gap: 12px; }
  .transport-skip { gap: 6px; }
  .transport-skip>span { font-size: 10px; }
}

/* A saved compact layout keeps the essential controls in one row, or two on phones. */
.transport.transport-simplified { padding: 10px 14px; }
.transport-simplified .transport-main { grid-template-columns: minmax(0, 1fr) auto auto 44px; gap: 16px; }
.transport-simplified .transport-source { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.transport-simplified .transport-title { min-width: 0; min-height: 44px; }
.transport-simplified .transport-title>span { font-size: 21px; }
.transport-simplified .transport-title>.ui-icon { flex-shrink: 0; }
.transport-simplified .transport-variation { flex-shrink: 0; max-width: 50%; height: 44px; min-height: 44px; }
.transport-simplified .transport-kind, .transport-simplified .transport-skip>span { display: none; }
.transport-simplified .transport-buttons { grid-template-columns: 40px 44px 40px; gap: 2px; width: auto; }
.transport-simplified .transport-play { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.transport-simplified .transport-play .ui-icon { width: 23px; height: 23px; }
.transport-simplified .transport-skip { min-height: 44px; padding: 0; }
.transport-simplified .transport-tempo-controls { gap: 2px; }
.transport-simplified .transport-tempo .tempo-step { flex-basis: 40px; width: 40px; }
.transport.transport-simplified .transport-bpm { flex: 0 0 48px; border: 0; padding: 0; }
.transport-simplified .transport-bpm input { font-size: 21px; }
.transport-simplified .transport-block-tempo { min-width: 0; max-width: 160px; }
@media (max-width: 760px) {
  .transport.transport-simplified { padding: 8px 11px; }
  .transport-simplified .transport-main { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 4px 8px; }
  .transport-simplified .transport-current { grid-column: 1 / 3; grid-row: 1; }
  .transport-simplified .transport-source { gap: 8px; }
  .transport-simplified .transport-title>span { font-size: 20px; }
  .transport-simplified .transport-main>button.transport-more { grid-column: 3; grid-row: 1; }
  .transport-simplified .transport-buttons { grid-column: 1; grid-row: 2; justify-self: start; }
  .transport-simplified .transport-tempo, .transport-simplified .transport-block-tempo { grid-column: 2 / 4; grid-row: 2; justify-self: end; }
  .transport-simplified .transport-block-tempo { max-width: 132px; font-size: 11px; }
  .transport-simplified .transport-sequence .sequence-buttons { grid-column: 1 / -1; justify-self: center; gap: 4px; }
  .transport-simplified .transport-sequence .transport-block-tempo { grid-column: 1 / -1; grid-row: 3; justify-self: center; max-width: 100%; }
}
@media (max-width: 360px) {
  .transport-simplified .transport-title>span { font-size: 18px; }
  .transport-simplified .transport-variation { font-size: 10px; }
  .transport-simplified .transport-buttons { grid-template-columns: 36px 44px 36px; }
  .transport-simplified .transport-tempo .tempo-step { flex-basis: 36px; width: 36px; }
  .transport.transport-simplified .transport-bpm { flex-basis: 44px; }
}

/* Standalone metronome: a legible pulse and quiet, tactile controls. */
.metronome-page { max-width: 1160px; margin-inline: auto; }
.metronome-page .page-heading { margin-bottom: 30px; }
.metronome-page .subtitle { max-width: 660px; }
.metro-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.metro-main, .metro-sidebar { display: grid; gap: 20px; min-width: 0; }
.metro-panel { min-width: 0; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.metro-console { padding: 26px 30px 22px; background: linear-gradient(150deg, #27282355, transparent 45%), var(--paper); }
.metro-console-top, .metro-section-heading, .metro-pattern-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metro-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.metro-eyebrow .ui-icon { width: 17px; height: 17px; }
.metro-live-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.metro-live-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #676d6f; }
.metro-live-status.is-playing { color: var(--accent-hover); }
.metro-live-status.is-playing::before { background: var(--accent); box-shadow: 0 0 10px #cbb27e55; }
.metro-tempo { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 22px 0 4px; }
.metro-tempo-value { display: grid; text-align: center; }
.metro-tempo-value input { width: 220px; min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); text-align: center; font-family: inherit; font-size: clamp(64px, 8vw, 94px); font-weight: 400; line-height: 1.1; letter-spacing: -5px; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.metro-tempo-value input::-webkit-inner-spin-button, .metro-tempo-value input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.metro-tempo-value input:hover { border-color: var(--line); }
.metro-tempo-value>span { color: var(--accent); font-size: 10px; letter-spacing: .2em; }
.metro-step { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 25px; font-weight: 400; flex-shrink: 0; }
.metro-unit-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 15px 0; }
.metro-slider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.metro-slider input { flex: 1; min-width: 0; width: 100%; padding-inline: 0; border: 0; background: transparent; }
.metro-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .8fr) 48px; gap: 10px; margin-top: 12px; }
.metro-actions button { min-height: 50px; justify-content: center; }
#metro-reset { padding: 0; }
.metro-tap-hint { text-align: center; font-size: 11px; min-height: 18px; margin: 10px 0 22px; }
.metro-announcement { font-size: 12px; line-height: 1.5; color: var(--teal); margin: 0; }
.metro-announcement:not(:empty) { padding: 12px; background: #91b9b70b; border: 1px solid #91b9b726; border-radius: 8px; margin: 0 0 20px; }
.metro-pattern-heading { border-top: 1px solid var(--line); padding-top: 23px; flex-wrap: wrap; }
.metro-pattern-heading > .heading-with-info { flex-shrink: 0; }
.metro-panel h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -.2px; }
.metro-panel h2 .ui-icon { width: 18px; height: 18px; color: var(--accent); }
.metro-meter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 24px; }
.metro-meter select { padding: 8px; min-width: 60px; min-height: 42px; text-align: center; font-size: 16px; }
.metro-meters { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 20px; }
.metro-meters button { flex: 1; min-width: 42px; min-height: 36px; padding: 6px 8px; font-size: 11px; border-radius: 6px; background: transparent; }
.metro-beats { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 9px; }
.metro-beat { position: relative; display: flex; flex-direction: column; gap: 5px; min-height: 104px; padding: 13px 5px 10px; border-radius: 10px; background: #202427; }
.metro-beat-number { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metro-beat-mark { height: 18px; line-height: 18px; font-size: 12px; }
.metro-beat-label { font-size: 10px; }
.metro-beat.level-accent { color: var(--accent-hover); background: #302c24; border-color: #6a5f46; }
.metro-beat.level-soft { color: var(--muted); }
.metro-beat.level-soft .metro-beat-mark { font-size: 24px; }
.metro-beat.level-mute { color: var(--muted); border-style: dashed; background: #171a1c; }
.metro-beat.is-current { border-color: var(--accent-hover); box-shadow: 0 0 0 1px var(--accent); background: #3b352a; color: var(--ink); }
.metro-beat.is-current.is-silent { box-shadow: 0 0 0 1px var(--teal); border-color: var(--teal); background: #253133; }
.metro-pattern-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 6px; margin-top: 11px; }
.metro-pattern-tools .hint { font-size: 11px; margin: 0; }
.metro-pattern-tools button { min-height: 36px; padding: 6px 0; }
.metro-mute-hint { font-size: 11px; margin: 0 0 26px; }
.metro-section-heading { margin-bottom: 20px; }
.metro-section-heading .hint { font-size: 10px; }
.metro-subdivisions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.metro-subdivisions button { display: flex; flex-direction: column; justify-content: center; gap: 7px; min-height: 67px; padding: 9px 3px; font-size: 10px; }
.metro-subdivision-marks { height: 18px; font-size: 13px; white-space: pre; }
.metro-change-hint { margin: 18px 0 0; font-size: 11px; }
.metro-sidebar .field { margin-bottom: 18px; }
.metro-sidebar .field select, .metro-sidebar .field input { width: 100%; min-width: 0; }
.metro-sidebar .hint, .metro-training .hint { font-size: 11px; line-height: 1.6; }
.metro-sidebar p:last-child { margin-bottom: 0; }
.metro-clock { font-size: 52px; font-weight: 400; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -2px; margin-top: 24px; }
.metro-clock-label { font-size: 11px; text-align: center; color: var(--muted); margin: 6px 0 22px; }
.metro-duration { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metro-timer progress { display: block; width: 100%; height: 4px; margin: 0 0 20px; accent-color: var(--accent); border: 0; border-radius: 2px; overflow: hidden; }
.metro-timer progress::-webkit-progress-bar { background: var(--line); }
.metro-timer progress::-webkit-progress-value { background: var(--accent); }
.metro-timer-presets { display: flex; gap: 6px; margin: 0 0 22px; }
.metro-timer-presets button { flex: 1; padding: 6px 3px; min-height: 34px; font-size: 10px; }
.metro-volume-label { display: flex; justify-content: space-between; }
.metro-volume-label output { color: var(--accent); }
.metro-training { padding: 0; }
.metro-training summary { cursor: pointer; padding: 20px 24px; font-size: 13px; }
.metro-training summary .hint { display: inline-block; margin-left: 10px; }
.metro-training>p, .metro-training-fields { margin: 0 24px 20px; }
.metro-training-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.metro-training-fields select { width: 100%; min-width: 0; }
.metro-footnote { text-align: center; color: var(--muted); font-size: 11px; margin: 26px 0 0; }
.metronome-page [hidden] { display: none !important; }
@media (max-width: 900px) {
  .metro-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
  .metro-console { padding-inline: 20px; }
  .metro-panel:not(.metro-console):not(.metro-training) { padding: 20px; }
  .metro-tempo { gap: 14px; }
  .metro-tempo-value input { width: 175px; font-size: 76px; }
  .metro-beats { grid-template-columns: repeat(auto-fit, minmax(55px, 1fr)); gap: 8px; }
}
@media (max-width: 760px) {
  .metro-layout { grid-template-columns: minmax(0, 1fr); }
  .metro-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .metro-tempo-value input { width: 200px; font-size: 86px; }
}
@media (max-width: 520px) {
  .metronome-page { padding-inline: 17px; }
  .metronome-page .page-heading { margin-bottom: 24px; }
  .metro-console { padding: 20px 16px; }
  .metro-sidebar { grid-template-columns: minmax(0, 1fr); }
  .metro-tempo { gap: 12px; }
  .metro-tempo-value input { width: 154px; font-size: 76px; }
  .metro-step { width: 40px; height: 44px; }
  .metro-actions { grid-template-columns: minmax(0, 1fr) minmax(92px, .85fr) 44px; gap: 7px; }
  .metro-actions button { padding-inline: 8px; font-size: 12px; }
  .metro-beats { grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 8px; }
  .metro-beat { min-height: 95px; }
  .metro-meters { gap: 6px; }
  .metro-meters button { flex: 1 0 calc(25% - 6px); }
  .metro-section-heading .hint { max-width: 100px; text-align: right; }
  .metro-subdivisions { gap: 5px; }
  .metro-subdivisions button { font-size: 9px; }
  .metro-subdivision-marks { font-size: 11px; }
  .metro-meter select { min-width: 52px; font-size: 14px; }
  .metro-training summary { padding-inline: 18px; }
  .metro-training summary .hint { display: block; margin: 6px 0 0 17px; }
}

/* Accent studies share the beat-wrapping notation and practice controls. */
.sticking-focus { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #d6ccba; color: #69614f; font-size: 13px; line-height: 1.7; }
.training-card-art-accents { color: #d1a385; background: radial-gradient(ellipse at center, #d1a38520, transparent 65%), #171a1c; }
.training-card-art-accents>.ui-icon { border-color: #d1a38540; background: #d1a38508; }
/* Member rhythm collections and creation share the existing music workspace. */
.member-rhythm-tabs { display: flex; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; margin: 0 0 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.member-rhythm-tabs .button { min-width: 0; min-height: 44px; padding: 10px 16px; border-color: transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.member-rhythm-tabs .button:hover { background: #ffffff06; color: var(--ink); }
.member-rhythm-tabs .current-tab, .member-rhythm-tabs .current-tab:hover { background: var(--green-light); color: var(--accent-hover); border-color: #cbb27e30; }
.member-rhythms-page .page-heading>div:first-child { min-width: 0; }
.member-rhythms-page .page-heading h1 { overflow-wrap: anywhere; }
.member-rhythms-page .heading-actions { flex-shrink: 1; }
.member-rhythms-page .heading-actions :is(button, .button) { font-size: 14px; }
.member-rhythms-page .collection-options > [hidden] { display: none; }
.member-rhythm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.member-rhythm-grid > .empty-state { grid-column: 1 / -1; }
.member-rhythm-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 24px; border-radius: 14px; }
.member-rhythm-card h2 { margin: 0; font: 400 28px/1.25 var(--serif); letter-spacing: -.5px; overflow-wrap: anywhere; }
.member-rhythm-card .card-title { align-items: flex-start; margin: 0 0 6px; gap: 10px; }
.member-rhythm-card .card-name h2 { min-width: 0; }
.member-rhythm-title { color: inherit; text-decoration: none; }
.member-rhythm-title:hover { color: var(--accent-hover); }
.member-rhythm-card .card-play { flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; padding: 8px; }
.member-rhythm-card .favourite { flex-shrink: 0; width: 32px; height: 36px; padding: 7px; }
.member-rhythm-preview { min-width: 0; margin-block: 12px 4px; }
.member-rhythm-card .member-rhythm-preview .pulse-rail { margin: 0; }
.compact .pulse-preview-more { display: grid; place-items: center; font-size: 14px; color: var(--subtle); }
.member-rhythm-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.community-card-actions { display: flex; align-items: center; gap: 4px; }
.community-rhythm-menu .editor-menu-items { top: auto; bottom: calc(100% + 6px); width: 230px; }
.member-rhythm-open { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent-hover); font-size: 13px; text-decoration: none; }
.member-rhythm-open:hover { text-decoration: underline; }
.member-rhythm-open > .ui-icon { width: 16px; height: 16px; }
.member-rhythm-delete, .routine-delete { flex: 0 0 44px; width: 44px; height: 44px; margin-inline-start: auto; }
.member-rhythm-delete:hover:not(:disabled), .routine-delete:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.member-rhythm-card p { margin: 0; overflow-wrap: anywhere; }
.member-rhythm-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; color: var(--subtle); font-size: 13px; font-variant-numeric: tabular-nums; }
.member-rhythm-card .member-rhythm-meta { color: var(--accent-hover); }
.member-rhythm-card .member-rhythm-author { color: var(--subtle); font-size: 13px; }
.member-rhythm-card .member-rhythm-save { font-size: 12px; }
.rhythm-description { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.member-rhythm-card .rhythm-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 13px; }
.community-score > .rhythm-description { max-width: 70ch; margin: 0 0 20px; }
.member-rhythm-card .button-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 20px; }
.member-rhythm-card :is(button, .button) { padding-inline: 10px; font-size: 13px; }
.member-rhythm-card .ghost { min-height: 44px; }
.rhythm-setup-form { max-width: 850px; display: grid; gap: 24px; padding: 32px; border-radius: 14px; }
.rhythm-start-choices { max-width: 850px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.rhythm-start-choice { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: start; gap: 12px; padding: 28px; text-align: start; white-space: normal; }
.rhythm-start-choice>.ui-icon { width: 24px; height: 24px; color: var(--accent); }
.rhythm-start-choice>strong { font-size: 18px; }
.rhythm-start-choice>span { color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.6; }
.rhythm-start-choice[aria-expanded="true"] { border-color: var(--accent); background: var(--green-light); }
.rhythm-source-controls, .rhythm-source-instruments { border: 0; padding: 0; margin: 0; min-width: 0; }
.rhythm-source-controls { display: grid; gap: 24px; }
.rhythm-source-instruments>legend { padding: 0; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.rhythm-source-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rhythm-source-selects>.field { min-width: 0; margin: 0; }
.rhythm-source-summary p { margin: 0; }
.rhythm-source-summary { display: grid; gap: 8px; }
.rhythm-setup-form :is(input:not([type="checkbox"]), select) { width: 100%; min-width: 0; min-height: 48px; }
.rhythm-setup-form .field { gap: 8px; }
.rhythm-setup-form .field-label { letter-spacing: 0; font-size: 13px; }
.rhythm-setup-form .warning-text { color: var(--danger); margin: 0; }
.rhythm-setup-form .rhythm-setup-hint { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); line-height: 1.7; }
.rhythm-setup-hint>.ui-icon { width: 17px; height: 17px; color: var(--accent); margin-top: 2px; }
.rhythm-setup-form>button { justify-self: start; min-width: 160px; }
.rhythm-sharing { display: grid; gap: 20px; }
.rhythm-sharing>p, .rhythm-sharing>.field { margin: 0; }
.rhythm-sharing .rhythm-sharing-status { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid #cbb27e30; border-radius: 10px; background: var(--green-light); color: var(--accent-hover); }
.rhythm-sharing .rhythm-moderation-notice { padding: 14px 16px; border: 1px solid #cbb27e50; border-radius: 10px; background: #cbb27e14; color: var(--ink); }
.rhythm-sharing input { min-height: 48px; }
.community-search { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(210px, .45fr); align-items: end; gap: 12px; margin-bottom: 28px; }
.community-search .field { gap: 8px; }
.community-search :is(input, select) { width: 100%; min-width: 0; }
.community-search :is(input, select, button) { min-height: 48px; }
.community-search input { padding-inline-start: 40px; }
.community-search .search-field>.ui-icon { width: 18px; height: 18px; inset-inline-start: 13px; }
.rhythm-back { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0 16px; color: var(--muted); font-size: 13px; text-decoration: none; }
.rhythm-back:hover { color: var(--accent-hover); }
.community-detail .page-heading { margin-bottom: 28px; }
.community-score { padding: 24px; border-radius: 14px; }
.community-score>.member-rhythm-meta { color: var(--subtle); margin: 0 0 20px; }
.community-score .score-pages { overflow-x: auto; }
.community-pagination { align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.community-pagination>span { color: var(--muted); font-size: 12px; }
.member-rhythm-card button > .ui-icon, .rhythm-like > .ui-icon { width: 17px; height: 17px; }
.rhythm-like[aria-pressed=true] > .ui-icon { fill: currentColor; }
.editor-page .workspace-tabs { align-items: center; gap: 10px; padding-bottom: 18px; margin-bottom: 24px; border-color: var(--line); }
.editor-page .workspace-tabs .current-tab { margin-inline-end: auto; border: 0; padding-inline: 0; background: transparent; color: var(--accent-hover); font-size: 13px; }
.editor-page .editor-titlebar { gap: 16px; margin-bottom: 24px; }
.editor-page .editor-titlebar>.field { max-width: 640px; }
.editor-page .editor-titlebar input { min-height: 48px; }
.editor-page .editor-navigation { gap: 12px; margin-bottom: 22px; }
.editor-page .editor-navigation select { min-height: 44px; font-size: 13px; }
.editor-page .editor-navigation button { font-size: 12px; }
.editor-page .entry-palette { padding: 20px; border-radius: 14px; background: var(--paper); border-color: var(--line); }
.rhythm-backing { margin: 0 0 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.rhythm-backing > summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; min-height: 58px; padding: 16px 44px 16px 20px; padding-inline: 20px 44px; position: relative; cursor: pointer; list-style: none; }
.rhythm-backing > summary::-webkit-details-marker { display: none; }
.rhythm-backing > summary::after { content: ''; position: absolute; inset-inline-end: 22px; top: 23px; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1px 1px 0; transform: rotate(45deg); }
.rhythm-backing[open] > summary::after { transform: translateY(4px) rotate(225deg); }
.rhythm-backing > summary > span:first-child { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rhythm-backing > summary .ui-icon { width: 18px; height: 18px; color: var(--accent); }
.rhythm-backing > summary .hint { margin: 0; overflow-wrap: anywhere; }
.rhythm-backing-body { padding: 4px 20px 20px; }
.rhythm-backing-body > p { max-width: 780px; margin: 0 0 20px; line-height: 1.7; }
.rhythm-backing-fields, .backing-instruments { min-width: 0; padding: 0; margin: 0; border: 0; }
.rhythm-backing-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rhythm-backing-selects select { width: 100%; min-width: 0; font-size: 14px; }
.backing-instruments { margin-top: 20px; }
.backing-instruments legend { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.rhythm-backing-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 28px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.rhythm-backing-controls > .field { flex: 1; min-width: 180px; max-width: 340px; }
.backing-volume { display: flex; align-items: center; gap: 12px; }
.backing-volume input { flex: 1; min-width: 0; }
.backing-volume output { min-width: 40px; color: var(--subtle); font-size: 12px; text-align: end; }
.use-rhythm-form { display: grid; gap: 18px; }
.use-rhythm-form .hint { margin: 0; line-height: 1.7; }
.use-rhythm-form .field[hidden] { display: none; }
.use-rhythm-form :is(select, input) { width: 100%; }
@media (max-width: 600px) {
  .rhythm-backing-selects { grid-template-columns: minmax(0, 1fr); }
  .rhythm-backing-controls { align-items: stretch; gap: 16px; }
  .rhythm-backing-controls > .field { max-width: none; flex-basis: 100%; }
  .rhythm-backing-body { padding-inline: 18px; }
}
.editor-page .palette-strokes button { min-width: 68px; border-color: var(--line); }
.editor-page .palette-strokes button[aria-pressed=true] { background: var(--green-light); border-color: #8e7b56; color: var(--accent-hover); }
.editor-page .palette-strokes button[aria-pressed=true] small { color: var(--accent-hover); }
.editor-page .entry-options { border-color: var(--line); }
.editor-page .entry-options summary { color: var(--subtle); }
.editor-page .grid-cell { background: var(--surface); color: var(--muted); border-color: var(--line); }
.editor-page .grid-cell:hover:not(:disabled) { border-color: var(--accent); background: var(--paper); }
.editor-page .grid-cell.on { background: var(--accent); color: #171a1c !important; border-color: var(--accent); }
.editor-page .grid-cell.on:hover:not(:disabled) { background: var(--accent-hover); }
.editor-page .grid-cell.incompatible { background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 4px, var(--surface) 4px, var(--surface) 8px); }
.editor-page .bar-actions { padding-bottom: 8px; }

/* Rhythm creation: one instrument in focus, one shared musical timeline. */
.editor-bar-overview { margin: 0 0 20px; min-width: 0; }
.editor-overview-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 10px; }
.editor-overview-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; min-width: 0; }
.editor-overview-heading h2 { font-size: 13px; font-weight: 500; line-height: 1.4; margin: 0; }
.editor-overview-heading .hint { margin: 0; font-size: 12px; }
.editor-overview-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.editor-overview-controls > button { min-height: 40px; font-size: 12px; }
.editor-bar-previews { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; }
.focused-editor .editor-bar-thumbnail { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; text-align: start; }
.focused-editor .editor-bar-thumbnail:hover { background: var(--surface); border-color: #575a57; }
.focused-editor .editor-bar-thumbnail.editing { background: var(--active-fill); border-color: var(--active-border); }
.focused-editor .editor-bar-thumbnail.editing .editor-bar-number { color: var(--accent-hover); }
.focused-editor .editor-bar-thumbnail[aria-pressed=true] { background: var(--green-light); border-color: var(--accent); }
.focused-editor .editor-bar-thumbnail.playing { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.focused-editor .editor-bar-thumbnail:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.editor-bar-thumbnail:nth-child(5) { margin-inline-start: 8px; }
.editor-bar-number { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: var(--ink); font-size: 12px; }
.editor-bar-selected-mark { color: var(--accent); }
.editor-bar-selected-mark:empty { display: none; }
.editor-bar-preview { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); grid-template-rows: repeat(3, 5px); gap: 2px; }
.editor-bar-preview > span { border-radius: 1px; background: var(--line); }
.editor-bar-preview > .hit.bass { background: var(--accent); }
.editor-bar-preview > .hit.rim { background: var(--teal); }
.editor-bar-preview > .hit.slap { background: var(--stroke-slap-fill); }
.editor-bar-caption { min-height: 16px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.editor-bar-state { display: flex; justify-content: space-between; gap: 3px; min-height: 16px; font-size: 11px; color: var(--accent); }
.editor-bar-state [data-bar-playing] { color: var(--teal); }
.editor-bar-previews.compact { display: flex; flex-wrap: wrap; gap: 6px; }
.focused-editor .compact .editor-bar-thumbnail { flex-direction: row; align-items: center; justify-content: center; min-width: 64px; min-height: 44px; padding: 8px 12px; }
.compact .editor-bar-number { white-space: nowrap; }
.compact .editor-bar-state { display: contents; }
/* The filled bar and aria-current identify the editing bar in the compact view. */
.compact .editor-bar-state > span:first-child { display: none; }
/* Keep the editing label when a selected range shares the same filled treatment. */
.compact .editor-bar-thumbnail[aria-pressed=true] .editor-bar-state > span:first-child:not(:empty) { display: inline; }
.compact .editor-bar-state > span:empty { display: none; }
.editor-overview-pagination, .editor-window-navigation { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.editor-overview-pagination .field { flex-direction: row; align-items: center; gap: 8px; }
.editor-overview-pagination input { width: 78px; }
.editor-overview-pagination > button, .editor-window-navigation > button { min-height: 38px; font-size: 12px; padding: 7px 10px; }
.editor-overview-pagination .hint, .editor-window-navigation .hint { font-size: 12px; margin: 0; }
.editor-bar-selection { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; }
.editor-bar-selection > .hint { flex-basis: 100%; margin: 0; }
.editor-bar-selection .field { width: 130px; }
.editor-bar-selection input { width: 100%; }
.editor-range-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.editor-range-label { font-size: 12px; color: var(--muted); }
.editor-range-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.editor-range-buttons > button { min-height: 38px; font-size: 12px; padding: 7px 10px; }
.editor-layout-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; }
.editor-layout-controls .field { flex-direction: row; align-items: center; gap: 8px; }
.editor-layout-controls select { min-height: 36px; font-size: 12px; }
.editor-phrase-bar { padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.editor-phrase-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.editor-phrase-heading > button { min-height: 34px; padding: 5px 9px; font-size: 12px; background: transparent; }
.editor-phrase-bar.editing .editor-phrase-heading > button { border-color: var(--accent); color: var(--accent); }
.editor-phrase-editing { margin-inline-start: auto; font-size: 11px; color: var(--accent); }
.editor-phrase-bar.playing .editor-phrase-heading { box-shadow: inset 3px 0 var(--teal); padding-inline-start: 8px; }
.editor-window-navigation { margin: 8px 0 16px; }
.editor-playback-scope { padding-bottom: 7px; margin-bottom: 7px; border-bottom: 1px solid var(--line); }
.editor-scope-summary { display: flex; flex-direction: column; gap: 3px; padding: 0 11px 4px; color: var(--muted); font-size: 12px; }
.editor-scope-summary small { font-size: 11px; }
@media (max-width: 700px) {
  .editor-bar-previews { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .editor-bar-thumbnail:nth-child(5) { margin-inline-start: 0; }
  .focused-editor .editor-bar-thumbnail { padding: 8px; }
  .editor-bar-preview { gap: 1px; }
  .editor-range-actions { align-items: flex-start; }
}
@media (max-width: 480px) {
  .editor-overview-heading { align-items: flex-start; }
  .editor-overview-title { flex-direction: column; gap: 3px; }
  .editor-overview-controls > button, .editor-range-buttons > button, .editor-layout-controls button, .editor-layout-controls select,
  .editor-phrase-heading > button, .editor-window-navigation > button, .editor-overview-pagination > button { min-height: 44px; }
  .editor-range-buttons { width: 100%; }
  .editor-range-buttons > .editor-menu { margin-inline-start: auto; }
  .editor-layout-controls { align-items: flex-start; gap: 8px; }
  .editor-layout-controls .field { gap: 5px; flex-wrap: wrap; }
  .editor-window-navigation .hint { flex-basis: 100%; order: -1; text-align: center; }
  .editor-bar-caption { font-size: 11px; }
}
.focused-editor .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.focused-editor .editor-heading { display: flex; flex-direction: row; align-items: center; gap: 20px; margin-bottom: 16px; }
.editor-heading-main { min-width: 0; flex: 1; }
.focused-editor .editor-title { display: block; width: 100%; min-height: 44px; padding: 3px 0; border-color: transparent; border-radius: 3px; background: transparent; font: 400 clamp(25px, 3vw, 34px)/1.25 var(--serif); letter-spacing: -.6px; }
.focused-editor .editor-title:hover:not(:disabled) { border-bottom-color: var(--line); }
.editor-description { max-width: 680px; margin: 4px 0 10px; }
.editor-description > summary { width: fit-content; padding: 6px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.editor-description > summary:hover { color: var(--ink); }
.editor-description textarea { display: block; width: 100%; min-height: 88px; margin-top: 6px; resize: vertical; font-size: 14px; line-height: 1.5; }
.editor-description .hint { margin: 6px 0 0; font-size: 11px; }
.editor-document-state { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.editor-document-state > span { display: inline-flex; align-items: center; gap: 6px; }
.editor-document-state .ui-icon { width: 12px; height: 12px; }
.editor-document-state .save-state { margin: 0; font-size: 11px; }
.editor-heading-actions { display: flex; align-items: center; align-self: flex-start; gap: 4px; flex-shrink: 0; }
.editor-heading-actions > button.ghost { width: 40px; padding: 8px; font-size: 22px; }
.editor-heading-actions > button:not(.ghost) { margin-inline: 10px; }
.editor-transport { padding: 14px 18px 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; margin-bottom: 18px; }
.editor-transport-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.focused-editor .field { margin: 0; gap: 5px; }
.focused-editor .field-label { font-size: 11px; letter-spacing: 0; }
.editor-transport input, .editor-transport select { min-height: 40px; font-size: 13px; }
.editor-transport input[type=number] { width: 85px; }
.editor-transport-controls > button { min-height: 40px; }
.editor-transport-controls > .ghost { width: 36px; padding-inline: 7px; }
.editor-transport-controls > .editor-play { min-width: 100px; }
.editor-transport-controls > .editor-metronome { margin-inline-start: auto; font-size: 12px; }
.editor-transport-controls > .editor-menu > summary { min-height: 40px; }
.editor-selected-bar-toggle { display: flex; align-items: center; min-width: 0; min-height: 40px; }
.editor-selected-bar-toggle .check { gap: 8px; font-size: 12px; }
.editor-playback-status { min-height: 20px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.editor-tempo-note { margin: 3px 0 6px; }
.editor-bars { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.editor-bar-tabs, .editor-bar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
.editor-bars button { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.editor-menu-items .editor-mobile-duplicate, .editor-menu-items .editor-mobile-stop { display: none; }
.editor-bar-tabs > button:not([aria-pressed=true]) { background: transparent; border-color: transparent; color: var(--muted); }
.editor-bar-tabs > button.playing { border-color: var(--teal); background: #91b9b712; }
.editor-bar-tabs > .field { flex-direction: row; align-items: center; gap: 10px; }
.editor-bar-tabs select { min-height: 38px; }
.editor-workspace { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.editor-instruments { min-width: 0; padding-top: 17px; }
.editor-instruments > h2 { margin: 0 12px 14px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.editor-instrument-list { display: flex; flex-direction: column; gap: 6px; }
.focused-editor .editor-instrument { width: 100%; justify-content: flex-start; text-align: start; padding: 13px 14px; background: transparent; border-color: transparent; }
.focused-editor .editor-instrument[aria-pressed=true] { background: var(--green-light); border-color: #cbb27e55; }
.editor-instrument-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.editor-instrument-name strong { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.editor-instrument-name small { font-size: 11px; color: var(--muted); font-weight: 400; }
.editor-instrument.muted .editor-instrument-name strong { text-decoration: line-through; color: var(--muted); }
.editor-instrument.solo { box-shadow: inset 3px 0 var(--teal); }
.focused-editor .editor-add-instrument { width: 100%; margin-top: 12px; padding: 10px 8px; background: transparent; border-style: dashed; font-size: 12px; color: var(--subtle); }
.editor-instrument-workspace { min-width: 0; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.editor-instrument-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.editor-instrument-heading h2 { margin: 0; min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
.editor-instrument-heading-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.editor-view-tabs.segmented { width: auto; flex-shrink: 0; }
.editor-view-tabs.segmented button { min-height: 30px; padding: 6px 13px; font-size: 12px; }
.editor-instrument-options { padding-bottom: 7px; margin-bottom: 7px; border-bottom: 1px solid var(--line); }
.editor-track-mix { display: flex; align-items: center; gap: 8px; padding: 4px 11px; }
.editor-menu-items .editor-track-mix button { flex: 1; justify-content: center; border: 1px solid var(--line); }
.focused-editor .grid-scroll { padding: 0 0 5px; overflow: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; border: 0; margin: 0; }
.focused-beat-grid { min-width: 100%; width: max-content; }
.focused-beat-grid .grid-row { --stroke-fill: var(--stroke-rim-fill); --stroke-border: var(--stroke-rim-border); --stroke-ink: var(--stroke-rim-ink); grid-template-columns: 78px repeat(var(--cells), minmax(32px, 1fr)); gap: 4px; margin: 8px 0; }
.focused-beat-grid .grid-row[data-stroke-tone=bass] { --stroke-fill: var(--stroke-bass-fill); --stroke-border: var(--stroke-bass-border); --stroke-ink: var(--stroke-bass-ink); }
.focused-beat-grid .grid-row[data-stroke-tone=slap] { --stroke-fill: var(--stroke-slap-fill); --stroke-border: var(--stroke-slap-border); --stroke-ink: var(--stroke-slap-ink); }
.focused-beat-grid .grid-row-label { position: sticky; left: 0; z-index: 1; align-self: stretch; background: var(--paper); box-shadow: 4px 0 var(--paper); font-size: 11px; padding: 0 8px 0 0; }
.focused-beat-grid .grid-row-label strong { font: 600 18px/1 var(--serif); min-width: 15px; color: var(--subtle); }
.focused-beat-grid .grid-row-label small { font-size: 10px; }
.focused-beat-grid .grid-counts { margin: 0 0 8px; }
.focused-beat-grid .grid-counts > span:not(.grid-row-label) { text-align: center; color: var(--muted); font-size: 10px; }
.focused-beat-grid .grid-counts > span.beat-start { font-size: 12px; font-weight: 600; color: var(--ink); }
.focused-editor .focused-beat-grid .grid-cell { min-width: 32px; min-height: 44px; padding: 4px 1px; border-radius: 6px; font-size: 12px; border-color: #ffffff09; }
.focused-editor .focused-beat-grid .grid-cell.beat-start { border-left-color: #cbb27e66; }
.focused-editor .focused-beat-grid .grid-cell.group-start { border-left-color: var(--accent); }
.focused-editor .focused-beat-grid .grid-cell.playing { box-shadow: inset 0 0 0 2px var(--teal); }
.focused-editor .focused-beat-grid .grid-cell.on { background: var(--stroke-fill); color: var(--stroke-ink) !important; border-color: var(--stroke-border); font-size: 16px; font-weight: 600; }
.focused-editor .focused-beat-grid .grid-cell.on:hover:not(:disabled) { background: var(--stroke-fill); border-color: var(--stroke-ink); }
.focused-editor .focused-beat-grid .grid-cell.on.incompatible { color: var(--stroke-ink) !important; }
.editor-grid-actions { display: flex; justify-content: flex-end; margin: 9px 0 11px; }
.editor-grid-actions > button { padding: 7px 0 7px 10px; min-height: 36px; font-size: 11px; color: var(--subtle); }
.editor-accent-choice { display: flex; flex-direction: column; gap: 5px; }
.editor-accent-choice .segmented { width: auto; }
.editor-accent-choice .segmented button { min-height: 40px; padding: 6px 12px; gap: 7px; font-size: 12px; }
.editor-accent-example { font: 600 17px/1 var(--serif); min-width: 12px; }
.editor-advanced, .editor-legend { border-top: 1px solid var(--line); }
.editor-advanced > summary, .editor-legend > summary, .editor-range > summary { padding: 13px 0; color: var(--subtle); font-size: 12px; cursor: pointer; }
.editor-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.editor-notation { min-width: 0; }
.editor-notation .notation-event[role="button"] { cursor: pointer; }
.editor-notation .practice-system .notation-event:is(:hover, :focus-visible, .selected) .notation-hitbox { fill: #ab803226; }
.editor-notation .score-pages { overflow-x: auto; margin: 0 0 14px; }
.editor-notation .notation-legend { padding: 12px 0; }
.focused-editor .editor-advanced { margin-top: 8px; }
.focused-editor .editor-advanced .entry-palette { padding: 14px; }
.focused-editor .rhythm-backing { margin-bottom: 4px; background: transparent; }
.focused-editor .rhythm-backing > summary { min-height: 54px; padding-block: 13px; }
.focused-editor .rhythm-backing > summary::after { top: 20px; }
.focused-editor .rhythm-backing > summary > span:first-child { font-size: 12px; }
.focused-editor .rhythm-backing > summary .hint { font-size: 11px; }
.editor-range { padding: 0 18px; }
.editor-range-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 5px 0 15px; }
.editor-menu { position: relative; flex-shrink: 0; }
.editor-menu > summary { display: flex; align-items: center; justify-content: center; width: 36px; min-height: 36px; border-radius: 7px; cursor: pointer; list-style: none; color: var(--muted); }
.editor-menu > summary::-webkit-details-marker { display: none; }
.editor-menu > summary:hover, .editor-menu[open] > summary { background: var(--surface); color: var(--ink); }
.editor-menu > summary .ui-icon { width: 19px; height: 19px; }
.editor-menu-items { position: absolute; z-index: 20; inset-inline-end: 0; top: calc(100% + 6px); display: flex; flex-direction: column; width: 260px; max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 40px #0008; }
.editor-menu-items button { justify-content: flex-start; text-align: start; background: transparent; border: 0; min-height: 40px; padding: 9px 11px; font-size: 12px; }
.editor-menu-items button:hover:not(:disabled) { background: var(--green-light); }
.editor-menu-items .hint { margin: 5px 11px 8px; font-size: 11px; }
.editor-menu-items .check { justify-content: space-between; padding: 8px 11px; font-size: 12px; }
.editor-menu-items .field { margin: 0; padding: 8px 11px; gap: 5px; }
.editor-menu-items select { width: 100%; min-height: 40px; font-size: 12px; }
.editor-instrument-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.editor-instrument-picker button { display: flex; flex-direction: column; align-items: flex-start; text-align: start; padding: 16px; gap: 6px; }
.editor-instrument-picker strong { font-size: 14px; font-weight: 550; }
.editor-instrument-picker span { font-size: 12px; color: var(--muted); }
@media (max-width: 1050px) {
  .editor-workspace { grid-template-columns: 156px minmax(0, 1fr); gap: 14px; }
  .editor-instrument-workspace { padding: 16px; }
  .editor-transport-controls { gap: 10px; }
}
@media (max-width: 760px) {
  .editor-workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .editor-instruments { display: flex; align-items: center; gap: 8px; padding: 0; }
  .editor-instruments > h2 { display: none; }
  .editor-instrument-list { flex: 1; flex-direction: row; overflow-x: auto; min-width: 0; padding: 3px 0; }
  .focused-editor .editor-instrument { width: auto; flex-shrink: 0; padding: 9px 12px; }
  .editor-instrument-name small { display: none; }
  .focused-editor .editor-add-instrument { width: auto; max-width: 135px; margin: 0; flex-shrink: 0; }
  .editor-transport-controls > .editor-metronome { margin-inline-start: 0; }
  .editor-transport-controls > .editor-menu { margin-inline-start: auto; }
}
@media (max-width: 480px) {
  .focused-editor { padding-inline: 16px; padding-bottom: 26px; }
  .focused-editor .editor-heading { flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
  .editor-heading-main { flex-basis: 100%; width: 100%; }
  .editor-heading-actions { width: 100%; justify-content: flex-end; }
  .editor-heading-actions > button.ghost { width: 36px; padding-inline: 6px; }
  .editor-heading-actions > button:not(.ghost) { margin-inline: 0; padding-inline: 8px; }
  .editor-heading-actions > .editor-menu { margin-inline-start: auto; }
  .editor-heading-actions > button { min-height: 38px; }
  .editor-transport { padding: 12px 12px 7px; }
  .editor-transport-controls { gap: 10px 8px; }
  .editor-transport-controls > .editor-play { min-width: 86px; }
  .editor-transport-controls > .field { flex: 1; min-width: 0; }
  .editor-transport-controls > .field:has([data-focus-key=editor-grid]) { flex-basis: calc(100% - 165px); }
  .editor-transport-controls > .field:first-of-type { flex: 0 0 80px; }
  .editor-transport input[type=number], .editor-transport select { width: 100%; }
  .editor-transport-controls > .editor-metronome { padding-inline: 9px; }
  .editor-transport-controls > .editor-selected-bar-toggle { flex: 1 1 calc(100% - 44px); }
  .editor-selected-bar-toggle > .check { width: 100%; }
  .editor-transport .field-label { font-size: 10px; line-height: 1.3; }
  .editor-bars { gap: 8px; flex-wrap: nowrap; }
  .editor-bar-tabs { flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .editor-bar-tabs > button { flex-shrink: 0; }
  .editor-bar-actions { margin-inline-start: 0; }
  .editor-bar-actions > .editor-duplicate { display: none; }
  .editor-menu-items .editor-mobile-duplicate { display: flex; }
  .editor-instrument-heading { flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
  .editor-instrument-heading h2 { font-size: 16px; }
  .editor-instrument-workspace { padding: 15px 12px 5px; }
  .editor-layout-controls .editor-view-tabs button { min-height: 44px; }
  .focused-beat-grid .grid-row { grid-template-columns: 64px repeat(var(--cells), 40px); }
  .focused-beat-grid .grid-row-label { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
  .focused-beat-grid .grid-row-label small { font-size: 10px; }
  .editor-grid-actions > button { padding-top: 0; min-height: 34px; }
  .editor-instrument-picker { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .editor-transport-controls > .ghost { display: none; }
  .editor-transport-controls > .editor-play { min-width: 82px; padding-inline: 10px; font-size: 12px; }
  .editor-transport-controls > .field:first-of-type { flex-basis: 66px; }
  .editor-transport-controls > .editor-metronome { width: 40px; padding: 8px; font-size: 0; gap: 0; }
  .editor-transport-controls > .field:has([data-focus-key=editor-grid]) { flex-basis: 140px; }
  .editor-menu-items .editor-mobile-stop { display: flex; }
}
@media (max-width: 1050px) {
    .member-rhythm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .member-rhythm-tabs { width: 100%; margin-bottom: 24px; gap: 3px; }
    .member-rhythm-tabs .button { flex: 1 1 0; padding: 9px 6px; font-size: 12px; line-height: 1.4; }
    .member-rhythms-page .page-heading { align-items: stretch; gap: 20px; }
    .member-rhythms-page .heading-actions { justify-content: flex-start; }
    .member-rhythms-page .heading-actions>.button { width: 100%; }
    .personal-storage { padding: 18px; }
    .member-rhythm-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .member-rhythm-card { padding: 22px; }
    .rhythm-setup-form { padding: 22px 20px; gap: 22px; }
    .rhythm-start-choices, .rhythm-source-selects { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .rhythm-start-choice { padding: 22px 20px; gap: 10px; }
    .rhythm-setup-form>button { width: 100%; }
    .community-search { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 8px; }
    .community-search>.field:last-child { grid-column: 1 / -1; }
    .community-score { padding: 16px; }
    .community-detail .heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .community-detail .heading-actions button { padding-inline: 8px; }
    .community-detail .heading-actions .favourite-labelled { grid-column: 1 / -1; }
    .editor-page .editor-navigation, .editor-page .editor-titlebar { flex-wrap: wrap; }
    .editor-page .editor-titlebar .button-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .editor-page .editor-titlebar button { padding-inline: 8px; }
    .editor-page .entry-palette { padding: 16px; }
    .editor-page .palette-strokes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .editor-page .palette-strokes button { min-width: 0; }
    .editor-page .bar-actions { flex-wrap: wrap; }
}
.favourite.favourite-labelled { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; height: auto; min-height: 44px; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.favourite-labelled .ui-icon { width: 18px; height: 18px; flex-shrink: 0; }
.skills-playlist-body > .favourite-labelled { margin-bottom: 14px; }
.favourite[aria-pressed="true"] { color: var(--accent); }
.favourite[aria-pressed="true"] [data-icon="star"] { fill: currentColor; }

/* Timed practice plans live in Training and accompany the existing tools. */
.routine-suggestion { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 4px 16px; margin: 0 0 24px; padding: 8px 10px 8px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.routine-suggestion p { margin: 0; color: var(--subtle); font-size: 14px; line-height: 1.5; }
.routine-suggestion-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.routine-suggestion-link:hover { text-decoration: underline; }
.routine-suggestion-link .ui-icon { flex-shrink: 0; width: 16px; height: 16px; }
[dir="rtl"] .routine-suggestion-link .ui-icon { transform: scaleX(-1); }
button.routine-suggestion-dismiss { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; color: var(--subtle); border-color: transparent; background: transparent; }
.routine-suggestion-dismiss .ui-icon { width: 16px; height: 16px; }
button.routine-suggestion-dismiss:hover { color: var(--ink); border-color: var(--line); }
.routine-suggestion :is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
    .routine-suggestion { grid-template-columns: minmax(0, 1fr) 44px; gap: 0 8px; padding-inline-start: 14px; }
    .routine-suggestion p { grid-column: 1; grid-row: 1; }
    .routine-suggestion-link { grid-column: 1; grid-row: 2; }
    .routine-suggestion-dismiss { grid-column: 2; grid-row: 1 / span 2; }
}
.routine-hub-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; margin-bottom: 28px; padding: 26px 28px; border: 1px solid #cbb27e66; border-radius: 14px; color: var(--ink); background: linear-gradient(115deg, #cbb27e12, transparent 70%), var(--paper); text-decoration: none; }
.routine-hub-card:hover { border-color: var(--accent); background-color: var(--surface); }
.routine-hub-card h2 { margin: 0 0 6px; font: 400 28px/1.2 var(--serif); }
.routine-pro-badge { display: inline-block; margin-inline-start: 10px; padding: 3px 7px; border: 1px solid #cbb27e66; border-radius: 5px; color: var(--accent); font: 600 11px/1.2 var(--sans, system-ui, sans-serif); vertical-align: middle; }
.routine-hub-card p { margin: 0; color: var(--subtle); font-size: 14px; line-height: 1.6; }
.routine-hub-icon, .routine-empty-icon { display: grid; place-items: center; color: var(--accent); }
.routine-hub-icon .ui-icon, .routine-empty-icon .ui-icon { width: 36px; height: 36px; }
.routine-editor-heading, .routine-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.routine-editor-heading h2 { margin: 0; font: 400 28px/1.2 var(--serif); }
.routine-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.assigned-routines, .published-routines { margin-bottom: 32px; }
.routine-browser { margin-bottom: 32px; }
.routine-results-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin: 20px 0; }
.routine-results-bar p { margin: 0; }
.routine-card-heading>.favourite { flex-shrink: 0; }
.routine-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--subtle); font-size: 12px; margin: -8px 0 16px; }
.routine-card-meta .routine-pro-badge { margin: 0; }
.routine-card-meta .routine-source { font-weight: 600; }
.routine-card .routine-date { margin: 0 0 16px; font-size: 12px; }
.routine-card>.routine-total { margin-top: 0; }
.routine-card, .routine-editor, .routine-empty { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 28px; }
.routine-card { display: flex; flex-direction: column; min-width: 0; }
.routine-card h3 { margin: 0; font: 400 26px/1.25 var(--serif); overflow-wrap: anywhere; }
.routine-total { flex-shrink: 0; color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; }
.routine-preview-group { margin-bottom: 24px; }
.routine-preview { margin: 0; padding-inline-start: 22px; }
.routine-preview li { padding: 8px 0 8px 4px; color: var(--subtle); font-size: 14px; }
.routine-preview li>span:last-child { margin-inline-start: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }
button.routine-preview-toggle { margin-top: 6px; padding: 8px 0; min-height: 44px; color: var(--accent); font-size: 13px; font-weight: 500; text-align: start; }
.routine-preview-toggle .ui-icon { width: 16px; height: 16px; }
.routine-preview-toggle[aria-expanded="true"] .ui-icon { transform: rotate(180deg); }
.routine-actions, .routine-editor-footer, .routine-banner-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.routine-card>.routine-actions { margin-top: auto; }
.routine-actions>.routine-delete { align-self: flex-end; }
.routine-empty { padding: 42px; text-align: center; }
.routine-empty h2 { margin: 20px 0 10px; font: 400 32px/1.2 var(--serif); }
.routine-empty p { color: var(--subtle); }
.routine-example { display: flex; justify-content: center; gap: 16px; padding: 0; margin: 28px 0; list-style: none; }
.routine-example li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; text-align: start; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.routine-example li>span:last-child { grid-column: 2; color: var(--muted); font-size: 13px; }
.routine-step-number { display: grid; place-items: center; border-radius: 50%; width: 28px; height: 28px; background: #cbb27e18; color: var(--accent); font-size: 13px; flex-shrink: 0; }
.routine-editor { max-width: 900px; }
.routine-editor>.field { max-width: 520px; }
.routine-editor>.field + .field { margin-top: 16px; }
.routine-editor>.hint { margin-top: 16px; }
.routine-steps { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 16px; }
.routine-step { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff03; min-width: 0; }
.routine-step-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.routine-step-top>strong { font-size: 14px; font-weight: 500; }
.routine-step-actions { margin-inline-start: auto; display: flex; gap: 6px; }
.routine-step-actions button { width: 40px; height: 40px; min-height: 40px; padding: 8px; }
.routine-step-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 14px; }
.routine-step-fields>.field { min-width: 0; }
.routine-step input, .routine-step select { min-width: 0; width: 100%; }
.routine-editor-footer { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.routine-banner { display: flex; align-items: center; gap: 28px; padding: 22px 28px; margin: 0 0 28px; width: 100%; border: 1px solid #cbb27e66; border-radius: 12px; background: linear-gradient(110deg, #cbb27e12, transparent 60%), var(--paper); }
.routine-banner-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.routine-banner-info h2 { margin: 5px 0; font: 400 26px/1.2 var(--serif); }
.routine-banner-info p { margin: 5px 0; }
.routine-clock { min-width: 100px; display: grid; gap: 5px; text-align: center; }
.routine-clock output { color: var(--accent); font: 400 36px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.routine-clock>span { color: var(--muted); font-size: 12px; }
.routine-clock progress { display: block; width: 100%; height: 5px; margin-top: 4px; accent-color: var(--accent); }
.routine-banner-actions { max-width: 280px; }
@media (max-width: 900px) {
    .routine-hub-card { grid-template-columns: auto minmax(0, 1fr); }
    .routine-hub-card>.training-card-action { grid-column: 2; }
    .routine-list { grid-template-columns: minmax(0, 1fr); }
    .routine-banner { flex-wrap: wrap; }
    .routine-banner-actions { max-width: none; width: 100%; }
}
@media (max-width: 600px) {
    .routine-hub-card, .routine-card, .routine-editor, .routine-empty { padding: 20px; }
    .routine-hub-card { gap: 12px 16px; }
    .routine-hub-card h2 { font-size: 25px; }
    .routine-example { flex-direction: column; gap: 10px; }
    .routine-card-heading { flex-wrap: wrap; gap: 8px; }
    .routine-step { padding: 14px; }
    .routine-step-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .routine-step-fields>.field:first-child { grid-column: 1 / -1; }
    .routine-step-actions { gap: 4px; }
    .routine-step-actions button { width: 36px; }
    .routine-step-top { gap: 6px; }
    .routine-banner { padding: 18px; gap: 18px; }
    .routine-banner-info h2 { font-size: 23px; }
    .routine-clock { min-width: 76px; }
    .routine-clock output { font-size: 30px; }
    .routine-banner-actions button { flex: 1 1 auto; }
}
/* Published teaching pieces and the member's existing arrangements share one area. */
.arrangement-tabs { display:flex; gap:6px; margin-bottom:28px; padding:5px; width:fit-content; max-width:100%; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.arrangement-tabs a { padding:11px 18px; border-radius:7px; text-decoration:none; color:var(--muted); font-size:14px; white-space:nowrap; }
.arrangement-tabs a.active { background:var(--surface); color:var(--accent-hover); box-shadow:inset 0 0 0 1px var(--line); }
.arrangement-tabs a:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.repertoire-filters { display:grid; grid-template-columns:minmax(0,2fr) repeat(2,minmax(0,1fr)); gap:16px; margin-block:24px 12px; }
.repertoire-filters.has-collection-filter { grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr)); }
.repertoire-filters.has-sort { grid-template-columns:minmax(0,2fr) repeat(2,minmax(0,1fr)) minmax(0,1.5fr); }
.repertoire-filters.has-collection-filter.has-sort { grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr)) minmax(0,1.5fr); }
.repertoire-filters input,.repertoire-filters select { width:100%; }
.repertoire-search-row,.repertoire-filter-panel { display:contents; }
.repertoire-filters .field,.repertoire-filter-panel>div { min-width:0; }
.repertoire-filter-toggle { display:none; }
.repertoire-filter-count { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding-inline:4px; border-radius:50%; background:var(--accent); color:var(--paper); font-size:11px; }
.repertoire-filter-count:empty { display:none; }
.arrangement-clear-filters[hidden] { display:none; }
.repertoire-results-bar { flex-direction:row; align-items:center; }
.repertoire-results-bar .filter-tabs { display:flex; width:auto; }
.repertoire-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; scroll-margin-block-start:100px; }
.repertoire-list>.empty-state { grid-column:1 / -1; }
/* Composition placeholders reserve space while the catalogue or score arrives. */
.composition-loading { clear:both; }
.composition-loading-status,.loading-status { display:flex; align-items:center; gap:10px; margin:0 0 20px; padding-block:10px; color:var(--muted); font-size:13px; }
.composition-loading-dot,.loading-dot { width:7px; height:7px; flex-shrink:0; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 12%,transparent); }
.composition-skeleton-block,.skeleton-block { display:block; flex-shrink:0; width:100%; max-width:100%; height:12px; border-radius:5px; background:var(--line); position:relative; overflow:hidden; }
.composition-skeleton-block::after { content:""; position:absolute; inset:0; background:linear-gradient(100deg,transparent 15%,color-mix(in srgb,var(--accent) 16%,transparent) 50%,transparent 85%); transform:translateX(-100%); animation:composition-skeleton-shimmer 2s ease-in-out infinite; }
.composition-skeleton-block.is-title,.skeleton-block.is-title { width:65%; height:28px; }
.composition-skeleton-block.is-short,.skeleton-block.is-short { width:38%; }
.composition-skeleton-block.is-badge,.skeleton-block.is-badge { width:78px; height:22px; border-radius:20px; }
.composition-skeleton-block.is-circle,.skeleton-block.is-circle { width:28px; height:28px; border-radius:50%; }
.composition-skeleton-block.is-button { width:144px; height:38px; border-radius:7px; }
.composition-skeleton-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-width:0; }
.repertoire-skeleton-card { display:grid; align-content:start; gap:18px; min-width:0; padding:26px; border:1px solid var(--line); border-radius:14px; background:var(--paper); }
.repertoire-skeleton-card.is-compact { gap:12px; padding:16px; }
.repertoire-skeleton-card.is-compact .is-title { height:22px; }
.composition-skeleton-heading { display:grid; gap:12px; min-width:0; }
.composition-skeleton-detail .published-overview { margin-bottom:24px; gap:14px 24px; }
.composition-skeleton-detail .repertoire-meta .is-short { width:140px; }
.composition-skeleton-detail .published-score-toolbar>.is-short { width:160px; }
.composition-skeleton-score { display:grid; gap:30px; padding-block:30px; }
.composition-skeleton-score.published-sheet { --paper:inherit; --ink:inherit; --subtle:inherit; --accent:inherit; }
.composition-skeleton-system { display:grid; gap:20px; }
.composition-skeleton-system>.is-short { width:100px; height:10px; }
.composition-skeleton-staff { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); height:64px; padding-block:8px; background:repeating-linear-gradient(to bottom,transparent 0 11px,var(--line) 11px 12px) 0 8px / 100% 49px no-repeat; }
.composition-skeleton-bar { display:flex; align-items:center; justify-content:space-around; gap:6px; min-width:0; padding-inline:8px; border-inline-start:1px solid var(--line); }
.composition-skeleton-bar:last-child { border-inline-end:1px solid var(--line); }
.composition-skeleton-block.is-note,.skeleton-block.is-note { width:14px; height:10px; border-radius:50%; }
.composition-skeleton-bar .is-note:nth-child(even) { margin-top:18px; }
.composition-skeleton-bar:nth-child(even) .is-note:nth-child(odd) { margin-top:-16px; }
@keyframes composition-skeleton-shimmer { to { transform:translateX(100%); } }
@media(prefers-reduced-motion:reduce) { .composition-skeleton-block::after { animation:none; display:none; } }
@media(max-width:760px) {
  .repertoire-skeleton-card { padding:18px; }
  .composition-skeleton-score { padding:22px 14px; gap:26px; }
  .composition-skeleton-bar { gap:3px; padding-inline:4px; }
  .composition-skeleton-block.is-note,.skeleton-block.is-note { width:10px; height:8px; }
}
/* Shared dark placeholders: one opacity animation per loading region, with no timers. */
.skeleton-content { pointer-events:none; animation:skeleton-pulse 2s ease-in-out infinite alternate; }
.skeleton-stack { display:grid; align-content:start; gap:14px; min-width:0; }
.skeleton-panel { min-height:250px; gap:28px; }
.skeleton-block.is-day { height:48px; border-radius:8px; }
.community-skeleton-heading { margin-block:24px; max-width:700px; }
.community-skeleton-score { display:grid; gap:32px; background:var(--paper); }
@keyframes skeleton-pulse { from { opacity:.65; } to { opacity:1; } }
@media(prefers-reduced-motion:reduce) { .skeleton-content { animation:none; } }
.repertoire-pagination { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:28px; padding-top:20px; border-top:1px solid var(--line); }
.repertoire-pagination>span { color:var(--muted); font-size:13px; }
.repertoire-pagination>button { min-height:44px; }
.repertoire-card,.repertoire-collection-card { padding:26px; border:1px solid var(--line); background:var(--paper); border-radius:14px; min-width:0; overflow-wrap:anywhere; }
.repertoire-card h2,.repertoire-card h3,.repertoire-collection-card h2 { font:400 28px/1.2 var(--serif); margin-block:18px 10px; }
.repertoire-card-title { display:flex; align-items:center; gap:10px; min-width:0; margin-block:18px 10px; }
.repertoire-card-title :is(h2,h3) { min-width:0; margin:0; }
.repertoire-card h2 a,.repertoire-card h3 a,.repertoire-collection-card h2 a { color:inherit; text-decoration:none; }
.repertoire-card>p { line-height:1.6; }
.repertoire-list.is-compact { gap:12px; }
.repertoire-list.is-compact>article { display:flex; flex-direction:column; gap:6px; padding:12px 16px; }
.repertoire-list.is-compact :is(h2,h3) { margin:0; min-width:0; font-size:22px; line-height:1.25; }
.repertoire-list.is-compact .repertoire-card-title { margin:0; }
.repertoire-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; }
.repertoire-card-name { display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; min-width:0; }
.repertoire-card-description { margin:0; color:var(--muted); font-size:13px; }
.repertoire-card-heading>.favourite { flex:0 0 44px; width:44px; min-height:44px; }
.repertoire-card-heading>.ui-icon { flex:0 0 24px; width:24px; height:24px; color:var(--accent); }
.repertoire-card-footer { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; width:100%; margin-top:auto; }
.repertoire-card-info { display:grid; gap:4px; min-width:0; }
.repertoire-card-info>.hint,.repertoire-card-footer>.hint { margin:0; font-size:12px; line-height:1.5; }
.repertoire-list.is-compact .repertoire-card-labels { gap:6px; }
.repertoire-card-link,.repertoire-list.is-compact .repertoire-collection-link { display:inline-flex; align-items:center; gap:6px; min-height:44px; margin:0; color:var(--accent-hover); font-size:12px; text-decoration:none; }
.repertoire-card-link:hover { text-decoration:underline; }
.repertoire-card-link>.ui-icon,.repertoire-list.is-compact .repertoire-collection-link>.ui-icon { width:16px; height:16px; flex-shrink:0; }
.composition-card-preview { margin-block:20px; min-width:0; }
.repertoire-card>.composition-card-preview+p { margin-top:8px; }
.composition-preview-caption { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; color:var(--muted); font-size:11px; margin-bottom:4px; }
.composition-preview-meter { margin-inline-start:auto; }
.composition-card-preview .notation-paper {
  --paper:inherit; --score-ink:#eadbb7; --notation-muted:#9da6a3; --notation-accent:#d9be88;
  padding:0; border:0; border-radius:0; background:transparent;
}
.composition-preview-staff .print-bar-svg>g>line:is([stroke-width="0.7"],[stroke-width="1.2"]) { stroke:#68716f; }
.composition-preview-staff .practice-system .hand-label { fill:var(--notation-muted); }
.composition-preview-staff .practice-system-scroll { overflow:hidden; padding-bottom:0; }
.composition-preview-grid { overflow-x:auto; }
.composition-preview-grid .pulse-rail { margin:0; padding:0; }
.composition-preview-grid .pulse-track-name,.composition-preview-grid .pulse-cell>strong+small { display:none; }
.composition-preview-grid .pulse-lane { grid-template-columns:repeat(var(--pulses),minmax(0,1fr)); min-width:calc(var(--pulses) * 17px); gap:2px; }
.composition-preview-grid .pulse-cell { min-width:0; min-height:44px; padding:5px 0; gap:4px; }
.composition-preview-grid .pulse-cell small { font-size:9px; }
.composition-preview-grid .pulse-cell strong { font-size:12px; overflow-wrap:anywhere; }
.repertoire-collection-card { display:flex; flex-direction:column; align-items:start; }
.repertoire-collection-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; color:var(--muted); font-size:13px; }
.repertoire-collection-summary>.ui-icon { width:28px; height:28px; color:var(--accent); }
.repertoire-collection-description { color:var(--muted); margin-block:12px 20px; line-height:1.6; }
.repertoire-list.is-compact .repertoire-collection-description { margin:0; font-size:13px; }
.repertoire-collection-link { display:inline-flex; align-items:center; gap:12px; min-height:44px; margin-top:auto; color:var(--accent-hover); text-decoration:none; }
.repertoire-collection-link:hover { text-decoration:underline; }
.repertoire-collection-heading { font:400 32px/1.2 var(--serif); margin-block:4px 20px; overflow-wrap:anywhere; }
.repertoire-card-labels,.repertoire-meta,.repertoire-tags { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.repertoire-card-labels { color:var(--muted); font-size:12px; }
.repertoire-card-labels .favourite { margin-inline-start:auto; flex-shrink:0; }
.repertoire-tags span { font-size:12px; color:var(--muted); border:1px solid var(--line); border-radius:5px; padding:3px 7px; }
.repertoire-meta { color:var(--muted); font-size:13px; }
.repertoire-description { max-width:70ch; white-space:pre-line; line-height:1.7; }
.published-performance { margin-top:28px; }
.repertoire-controls { display:flex; gap:14px; align-items:end; flex-wrap:wrap; margin-block:28px 18px; }
.page.published-composition-page { padding-top:18px; }
.published-composition-page .arrangement-tabs { float:inline-end; margin:0; padding:3px; }
.published-composition-page .arrangement-tabs a { padding:7px 12px; font-size:12px; }
.published-composition-page .arrangement-back { margin:0 0 10px; min-height:32px; }
.published-overview { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 24px; clear:both; padding-top:10px; margin-bottom:12px; }
.published-overview .page-heading { grid-column:1; margin:0; }
.published-overview .page-heading h1 { font-size:clamp(28px,3vw,34px); margin:0 0 4px; }
.published-overview .subtitle { display:flex; flex-wrap:wrap; gap:4px 10px; font-size:13px; margin:0; }
.published-overview .subtitle a { min-width:0; overflow-wrap:anywhere; }
.published-overview .repertoire-meta { grid-column:1; }
.published-overview .repertoire-controls { grid-column:2; grid-row:1 / 3; margin:0; align-self:center; gap:10px; }
.published-practice-notes { margin-bottom:12px; font-size:12px; color:var(--muted); }
.published-practice-notes summary { cursor:pointer; width:fit-content; }
.published-practice-notes p { margin-block:10px; color:var(--ink); }
.published-score-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.published-score-toolbar .hint { margin:0; font-size:12px; }
.published-score-options { display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.published-score-options .check { margin:0; gap:10px; font-size:12px; }
.published-range-button { display:inline-flex; align-items:center; gap:6px; min-height:38px; padding:7px 12px; font-size:12px; }
.published-range-button .ui-icon { width:16px; height:16px; }
.published-range-button.active { border-color:var(--accent); color:var(--accent-hover); }
.published-loop-dialog { width:520px; max-width:calc(100vw - 30px); }
.published-loop-stop { display:inline-flex; align-items:center; gap:6px; margin-inline-end:auto; }
.published-loop-stop .ui-icon { width:16px; height:16px; }
@media(max-width:480px) {
  .published-loop-dialog .published-loop-fields { grid-template-columns:1fr; }
  .published-loop-dialog .modal-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .published-loop-dialog .published-loop-stop { grid-column:1 / -1; margin:0; justify-content:center; }
}
.published-loop-explanation { margin-top:0; color:var(--muted); font-size:14px; }
.published-loop-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.published-loop-fields select { width:100%; min-width:0; }
.published-notation-switch.segmented { width:auto; }
.published-notation-switch.segmented button { min-height:38px; padding:7px 15px; font-size:13px; }
.published-score-scroll { overflow-x:auto; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.published-sections { min-width:680px; }
.published-section { display:grid; grid-template-columns:116px minmax(0,1fr) 38px; align-items:center; gap:12px; padding:10px 14px; min-width:0; scroll-margin-top:100px; }
.published-section+.published-section { border-top:1px solid var(--line); }
.published-sheet { --paper:#f5f0e5; --ink:#26221c; --subtle:#675c4c; --accent:#8a6325; background:var(--paper); color:var(--ink); padding:20px 24px 16px; border:0; border-radius:4px; }
.published-staff { min-width:0; direction:ltr; }
.composition-systems { display:grid; gap:14px; }
.composition-system { font-family:var(--notation-font); display:block; width:100%; height:auto; color:var(--ink); overflow:visible; }
.composition-system text { fill:currentColor; }
.composition-system .hand-label { font:12px var(--notation-font); fill:var(--subtle); }
.composition-system .staff-label { font:11px var(--notation-font); fill:var(--subtle); }
.composition-system .time-signature { font:bold 21px var(--notation-font); }
.composition-system .composition-bar-number { font:italic 11px var(--notation-font); fill:var(--subtle); }
.composition-system .composition-tempo { font:14px var(--notation-font); }
.composition-system .composition-repeat-count { font:italic 12px var(--notation-font); }
.composition-measure-highlight { fill:transparent; }
.published-measure { cursor:pointer; outline:none; }
.published-measure.is-current .composition-measure-highlight { fill:#ab80321c; }
.published-measure:hover .composition-measure-highlight { fill:#ab803210; }
.published-measure[aria-pressed="true"] .composition-measure-highlight { fill:#ab80321c; stroke:var(--accent); stroke-width:1; }
.published-measure:focus-visible .composition-measure-highlight { fill:#ab80321c; stroke:var(--accent); stroke-width:1.5; }
.published-sheet-hint { margin:8px 0 0; font-size:12px; }

/* Shared music sheet for practice and training. SVG geometry stays at reading size. */
.notation-paper, .training-sheet {
  --paper:#f5f0e5; --score-ink:#26221c; --notation-muted:#675c4c; --notation-accent:#8a6325;
  color:var(--score-ink); background:var(--paper);
}
.notation-paper { padding:18px 20px; border-radius:4px; }
.practice-notation>.field { width:fit-content; max-width:100%; margin:0 0 14px; }
.practice-notation>.field select { max-width:100%; }
.responsive-notation, .study-phrases, .practice-systems { min-width:0; max-width:100%; }
.practice-systems { display:grid; gap:16px; direction:ltr; }
.practice-system-scroll { min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; padding-bottom:3px; }
.practice-system-scroll:focus-visible { outline:2px solid var(--notation-accent); outline-offset:2px; }
.practice-system { font-family:var(--notation-font); display:block; max-width:none; height:auto; color:var(--score-ink); overflow:visible; }
.practice-system text { fill:currentColor; }
.practice-system .staff-label { font:11px var(--notation-font); fill:var(--notation-muted); }
.practice-system .hand-label, .practice-system [class$="-stroke-label"] { font:500 14px var(--notation-font); fill:var(--score-ink); }
.practice-system [class$="-hand-label"], .practice-system [class$="-count"] { font:12px var(--notation-font); fill:var(--notation-muted); }
.practice-system .time-signature { font:bold 20px var(--notation-font); }
.practice-system .practice-bar-number { font:italic 11px var(--notation-font); fill:var(--notation-muted); }
.practice-system .practice-grouping { font:11px var(--notation-font); fill:var(--notation-muted); }
.practice-system [class$="-tuplet"] { font:italic 13px var(--notation-font); }
.practice-system [class$="-accent"] { font:20px var(--notation-font); }
.practice-system .notation-event { cursor:default; }
.practice-system .notation-event:hover .notation-hitbox { fill:transparent; }
.practice-system .study-note.is-current .notation-hitbox { fill:#ab803226; }
.practice-system .study-beat-highlight { fill:#ab803213; }
.practice-system .study-playhead, .practice-system .staff-playhead { stroke:var(--notation-accent); pointer-events:none; }
.practice-system .study-note[data-stroke=T] [class$="-stroke-label"] { fill:#74551d; }
.practice-system .study-note[data-stroke=K] [class$="-stroke-label"] { fill:#285b5c; }
.training-score.unified-score, .call-response-score.unified-score { display:block; }
.unified-score { margin-block:22px 18px; }
.study-captions { display:flex; flex-wrap:wrap; gap:6px 24px; margin-bottom:8px; color:var(--notation-muted); font-size:12px; line-height:1.6; }
.study-captions p { margin:0; }
.study-captions .roll-pattern-text { display:block; }
@media (max-width:600px) {
  .notation-paper { padding:14px 10px; }
  .training-sheet { padding-inline:16px; }
  .practice-systems { gap:12px; }
  .practice-notation>.field { width:100%; }
}
.published-section.is-current { background:#cbb27e0c; box-shadow:inset 3px 0 var(--accent); }
.published-section-heading { display:flex; align-items:center; flex-wrap:wrap; gap:5px 9px; min-width:0; }
.published-section-heading h2 { width:100%; margin:0; font:500 13px/1.4 var(--sans); overflow-wrap:anywhere; }
.published-bars { width:100%; overflow-wrap:anywhere; }
.published-repeat { font-size:13px; font-weight:600; color:var(--accent-hover); }
.published-bars,.published-tempo { font-size:11px; color:var(--muted); }
.published-playback-status { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.published-loop { min-width:36px; min-height:36px; padding:8px; background:transparent; border-color:transparent; color:var(--muted); }
.published-loop:hover,.published-loop:focus-visible { color:var(--accent-hover); border-color:var(--line); }
.published-loop[aria-pressed="true"] { color:var(--accent-hover); background:#cbb27e18; border-color:var(--accent); }
.published-loop .ui-icon { width:18px; height:18px; }
.published-notation { min-width:0; }
.published-notation .score-notation { display:grid; gap:0; }
.published-notation .notation-bar { border:0; border-radius:0; margin:0; padding:0; background:transparent; }
.published-notation .staff-scroll { overflow:visible; }
.published-notation .staff-svg { display:block; width:100%; min-width:0; max-width:none; height:auto; margin:0; }
.published-notation .staff-svg text { fill:currentColor; }
.published-notation .staff-svg .hand-label { fill:var(--muted); }
.published-notation .pulse-rail { margin:0; padding:0; overflow:visible; }
.published-notation .pulse-track { margin:0; padding:0; }
.published-notation .pulse-lane { grid-template-columns:repeat(var(--pulses),minmax(0,1fr)); gap:2px; min-width:0; overflow:visible; }
.published-notation .pulse-cell { min-width:0; min-height:52px; padding:5px 1px; border-radius:3px; gap:4px; }
.published-notation .pulse-cell strong { font-size:18px; line-height:1.2; }
.published-notation .pulse-cell small { font-size:10px; line-height:1; }
.published-notation .pulse-cell>strong+small,.published-notation.single-track .pulse-track-name { display:none; }
.published-notation .pulse-track-name { margin-block:3px; font-size:11px; }
.published-tab-legend { display:flex; flex-wrap:wrap; gap:8px 18px; margin-top:12px; color:var(--muted); font-size:12px; }
.arrangement-view-toolbar { margin-bottom:20px; }
.arrangement-grid-section { grid-template-columns:140px minmax(0,1fr); align-items:start; }
.arrangement-grid-phrase { display:grid; grid-template-columns:36px minmax(0,1fr); gap:10px; padding:8px 0; }
.arrangement-grid-phrase+.arrangement-grid-phrase { border-top:1px dashed var(--line); }
.arrangement-grid-phrase>.published-repeat { align-self:center; text-align:center; }
.arrangement-grid-bar+.arrangement-grid-bar { margin-top:12px; }
.arrangement-grid-bar>.hint { font-size:11px; }
.arrangement-grid .published-notation.single-track .pulse-track-name { display:block; }
.arrangement-score-scroll .published-measure[role="group"] { cursor:default; }
.arrangement-score-scroll .published-measure[role="group"]:not(.is-current):hover .composition-measure-highlight { fill:transparent; }
.arrangement-score-scroll .composition-system { min-width:100%; width:auto; max-width:none; }
@media(max-width:1000px) {
  .repertoire-filters.has-sort,.repertoire-filters.has-collection-filter.has-sort { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .published-overview { grid-template-columns:1fr; }
  .published-overview .repertoire-controls { grid-column:1; grid-row:auto; margin-top:8px; }
}
@media(max-width:700px) {
  .repertoire-filters,.repertoire-filters.has-collection-filter,.repertoire-filters.has-sort,.repertoire-filters.has-collection-filter.has-sort,.repertoire-list,.arrangement-list { grid-template-columns:1fr; }
  .repertoire-filters { gap:12px; }
  .repertoire-search-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; }
  .repertoire-filter-toggle { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:10px 12px; white-space:nowrap; }
  .repertoire-filter-toggle>.ui-icon { width:16px; height:16px; }
  .repertoire-filter-toggle[aria-expanded=true] { color:var(--accent-hover); border-color:var(--accent); }
  .repertoire-filter-toggle[aria-expanded=true]>.ui-icon { transform:rotate(180deg); }
  .repertoire-filter-panel { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:12px; padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
  .repertoire-filters[data-expanded=false] .repertoire-filter-panel { display:none; }
  .arrangement-filters .repertoire-filter-panel { grid-template-columns:1fr; }
  .repertoire-filter-collection,.repertoire-filter-sort { grid-column:1 / -1; }
  .repertoire-pagination { display:grid; grid-template-columns:1fr 1fr; }
  .repertoire-pagination>span { grid-area:1 / 1 / 2 / -1; text-align:center; }
  .repertoire-card,.repertoire-collection-card,.arrangement-row { padding:18px; }
  .published-score-toolbar { align-items:start; flex-direction:column; gap:8px; }
  .published-notation-switch.segmented { width:100%; }
  .published-section { grid-template-columns:100px minmax(0,1fr) 38px; gap:8px; padding-inline:10px; }
  .arrangement-grid-section { grid-template-columns:100px minmax(0,1fr); }
  .published-sheet { padding:16px 12px 12px; }
  .published-composition-page .arrangement-tabs { float:none; margin-bottom:8px; }
  .arrangement-tabs { width:100%; }
  .arrangement-tabs a { flex:1; text-align:center; padding-inline:10px; font-size:13px; }
}
.composition-backing { margin-top: 24px; }
.composition-backing-header { display: flex; align-items: center; gap: 16px; padding-inline-end: 20px; }
button.composition-backing-disclosure { flex: 1; min-width: 0; min-height: 76px; justify-content: space-between; gap: 16px; padding: 16px 20px; background: transparent; border: 0; text-align: start; }
.composition-backing-heading { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.composition-backing-heading > span:first-child { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.composition-backing-heading .ui-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.composition-backing-heading .hint { margin: 0; font-weight: 400; }
.composition-backing-chevron { width: 8px; height: 8px; flex-shrink: 0; border: solid var(--muted); border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.composition-backing-disclosure[aria-expanded=true] .composition-backing-chevron { transform: translateY(2px) rotate(225deg); }
.composition-backing-header > .check { flex-shrink: 0; }
.composition-backing-header > .check .check-label { display: none; }
.composition-backing-sequence { margin: 0 0 20px; padding-inline-start: 24px; }
.composition-backing-sequence li { padding: 4px; overflow-wrap: anywhere; }
.composition-backing-sequence li span { margin-inline-start: 12px; color: var(--muted); }
.composition-backing .rhythm-backing-controls + .hint { margin: 18px 0 0; }
