:root {
  --th-navy: #0b315b;
  --th-green: #705494;
  --th-green-dark: #563e73;
  --th-mint: #f2edf7;
  --th-blue: #edf5fa;
  --th-coral: #d65d52;
  --th-gold: #d49322;
  --th-paper: #fffaf2;
  --th-line: #dacbb6;
  --th-muted: #5c7080;
  --th-white: #fff;
  --th-shadow: 0 12px 30px rgba(16, 50, 77, .1);
}

@font-face {
  font-family: "Bravura";
  src: url("../core/notation/fonts/bravura.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

* { box-sizing: border-box; }
.notalix-skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 9px 13px; border-radius: 8px; color: #fff; background: var(--th-navy); transform: translateY(calc(-100% - 16px)); transition: transform .12s ease; }
.notalix-skip-link:focus { transform: translateY(0); }
html { min-height: 100%; overflow-x: hidden; }
body {
  min-height: 100%;
  margin: 0;
  padding: 18px 18px 42px;
  overflow-x: hidden;
  color: var(--th-navy);
  background:
    radial-gradient(circle at 8% 9%, rgba(112, 84, 148, .08), transparent 29rem),
    linear-gradient(135deg, #f7f4ec 0%, #edf5f7 58%, #e8f2f7 100%);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 4px solid rgba(218, 147, 32, .46);
  outline-offset: 3px;
}

.theory-shell { width: min(1080px, 100%); margin: 0 auto; }
.section-kicker, .stage-kicker, .lesson-tag {
  display: block;
  margin: 0 0 5px;
  color: var(--th-muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .11em;
}
.section-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(650px, 100%);
  margin: 0 auto 14px;
  padding: 5px;
  border: 1px solid #d5cbe0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .67);
}
body[data-theory-scope="measure"] .section-tabs,
body[data-theory-scope="pulse"] .section-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-theory-scope="measure"] .level-tabs,
body[data-theory-scope="pulse"] .level-tabs { grid-template-columns: 1fr; }
body[data-theory-scope="signatures"] .level-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-tab {
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 11px;
  color: var(--th-navy);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}
.section-tab.selected { color: #fff; background: var(--th-green); box-shadow: 0 4px 11px rgba(112, 84, 148, .18); }

.level-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.level-tab {
  position: relative;
  min-height: 70px;
  padding: 10px 13px 10px 48px;
  border: 1px solid #c7d7d4;
  border-radius: 16px;
  color: var(--th-navy);
  background: rgba(255, 255, 255, .78);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.level-tab:hover { transform: translateY(-2px); border-color: var(--th-green); }
.level-tab[aria-current="step"] {
  color: #fff;
  border-color: var(--th-green);
  background: linear-gradient(145deg, #76599a, #563e73);
  box-shadow: 0 8px 18px rgba(26, 102, 85, .2);
}
.level-number {
  position: absolute;
  left: 12px;
  top: 50%;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  color: var(--th-green-dark);
  background: var(--th-mint);
  font-weight: 900;
  transform: translateY(-50%);
}
.level-tab[aria-current="step"] .level-number { color: var(--th-green-dark); background: #fff; }
.level-tab strong, .level-tab small { display: block; }
.level-tab strong { font-size: .98rem; line-height: 1.15; }
.level-tab small { margin-top: 4px; font-size: .76rem; opacity: .78; }
.level-tab.is-complete::after {
  content: "✓";
  position: absolute;
  right: 9px;
  top: 7px;
  font-weight: 950;
}

.lesson-card, .explorer-card, .quiz-card, .result-card {
  border: 1px solid var(--th-line);
  border-radius: 24px;
  background: var(--th-paper);
  box-shadow: var(--th-shadow);
}
.lesson-card { padding: clamp(17px, 3vw, 30px); }
.lesson-progress {
  display: grid;
  grid-template-columns: minmax(80px, auto) 1fr minmax(60px, auto);
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  color: var(--th-muted);
  font-size: .82rem;
  font-weight: 850;
}
.lesson-progress > :last-child { text-align: right; }
.progress-dots { display: flex; justify-content: center; gap: 7px; }
.progress-dots i {
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: #dedfd9;
}
.progress-dots i.done { background: var(--th-green); }
.lesson-copy { max-width: 830px; margin: 0 auto 22px; text-align: center; }
.lesson-tag { color: var(--th-coral); }
.lesson-copy h2, .quiz-topline h2, .result-card h2 {
  margin: 0;
  color: var(--th-navy);
  font-size: clamp(1.55rem, 3.5vw, 2.25rem);
  line-height: 1.13;
  letter-spacing: -.022em;
}
.lesson-copy > p:last-child {
  max-width: 760px;
  margin: 10px auto 0;
  color: #334f62;
  font-size: clamp(1rem, 1.9vw, 1.1rem);
  line-height: 1.55;
}

.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: stretch; }
.meter-stage {
  min-width: 0;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid #a8c9c0;
  border-radius: 20px;
  background: linear-gradient(150deg, #f7fffc, #eaf5f1);
}
.meter-stage-head { display: flex; min-height: 62px; align-items: flex-start; justify-content: space-between; gap: 14px; }
.meter-stage h3, .idea-card h3 { margin: 0; font-size: 1.08rem; }
.time-signature {
  flex: 0 0 auto;
  display: grid;
  width: 48px;
  color: var(--th-navy);
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 850;
  line-height: .78;
  text-align: center;
}
.time-signature span:first-child { padding-bottom: 3px; }
.time-signature span:last-child { padding-top: 3px; }

.pulse-visual {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
}
.measure-group {
  position: relative;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 17px);
  padding: 13px 19px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}
.pulse-visual.show-bars .measure-group { border-left-color: transparent; border-right-color: var(--th-navy); }
.pulse-visual.show-bars .measure-group:first-child { border-left-color: var(--th-navy); }
.pulse-visual.continuous .measure-group { padding-inline: 5px; }
.beat-group {
  display: grid;
  min-width: 36px;
  gap: 8px;
  place-items: center;
}
.beat-dot {
  position: relative;
  width: 25px;
  height: 25px;
  border: 3px solid #8eb8af;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(11, 49, 91, .08);
  transition: transform .11s ease, background .11s ease, border-color .11s ease;
}
.beat-group.group-start .beat-dot::before {
  content: "";
  position: absolute;
  left: -13px;
  top: -8px;
  bottom: -21px;
  width: 2px;
  border-radius: 2px;
  background: rgba(112, 84, 148, .35);
}
.beat-group:first-child .beat-dot::before { display: none; }
.pulse-visual.continuous .beat-dot::before { display: none; }
.pulse-visual:not(.compare) .beat-dot::before { display: none; }
.beat-dot.active {
  border-color: var(--th-gold);
  background: var(--th-gold);
  transform: scale(1.22);
}
.beat-dot.accent.active { border-color: var(--th-coral); background: var(--th-coral); transform: scale(1.36); }
.subdivision-row { display: flex; gap: 5px; min-height: 9px; }
.subdivision-row i { width: 7px; height: 7px; border-radius: 50%; background: #b9d0ca; }
.subdivision-row i.active { background: var(--th-green); transform: scale(1.35); }
.group-label { min-height: 18px; color: var(--th-green-dark); font-size: .76rem; font-weight: 900; }

.notation-example {
  position: relative;
  min-height: 136px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, .76);
}
.notation-example[hidden] { display: none; }
.notation-example svg { display: block; max-width: 100%; }
.theory-note { cursor: pointer; transition: filter .14s ease, transform .14s ease; transform-box: fill-box; transform-origin: center; }
.theory-note:hover, .theory-note:focus-visible { filter: drop-shadow(0 0 3px rgba(112, 84, 148, .4)); }
.theory-note:hover path, .theory-note:hover text, .theory-note:focus-visible path, .theory-note:focus-visible text { fill: var(--th-green); stroke: var(--th-green); }
.theory-note.is-playing { transform: scale(1.09); }
.theory-note.is-playing path, .theory-note.is-playing text { fill: var(--th-gold); stroke: var(--th-gold); }
.note-hint { margin: 7px 0 0; color: var(--th-green-dark); font-size: .86rem; font-weight: 800; text-align: center; }
.notation-fallback { display: grid; min-height: 112px; place-items: center; color: var(--th-muted); }
.variant-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 0; }
.variant-buttons[hidden] { display: none; }
.variant-buttons button {
  min-width: 70px;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid #9dbeb7;
  border-radius: 10px;
  color: var(--th-green-dark);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}
.variant-buttons button.selected { color: #fff; background: var(--th-green); border-color: var(--th-green); }
.demo-button {
  display: flex;
  width: min(330px, 100%);
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 14px auto 7px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--th-navy);
  box-shadow: 0 5px 12px rgba(11, 49, 91, .17);
  font-weight: 900;
  cursor: pointer;
}
.demo-button.is-playing { background: var(--th-coral); }
.demo-caption { min-height: 22px; margin: 6px 0 0; color: var(--th-muted); font-size: .9rem; line-height: 1.4; text-align: center; }

.idea-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 18px;
  border-radius: 20px;
  color: #63390a;
  background: linear-gradient(150deg, #fff7df, #f7e7b9);
}
.idea-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--th-gold); }
.idea-card p { margin: 8px 0 0; font-size: .98rem; line-height: 1.52; }

.lesson-actions, .quiz-actions, .result-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.primary-button, .secondary-button {
  min-height: 48px;
  padding: 11px 19px;
  border-radius: 13px;
  font-weight: 900;
  cursor: pointer;
}
.primary-button { border: 1px solid var(--th-green); color: #fff; background: var(--th-green); box-shadow: 0 5px 12px rgba(112, 84, 148, .18); }
.primary-button:hover { background: var(--th-green-dark); }
.secondary-button { border: 1px solid #c1d0ce; color: var(--th-navy); background: rgba(255, 255, 255, .78); }
.secondary-button:disabled { opacity: .38; cursor: default; }

.quiz-card, .result-card { padding: clamp(20px, 4vw, 36px); }
.quiz-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.quiz-count { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; color: var(--th-green-dark); background: var(--th-mint); font-weight: 900; }
.quiz-prompt { max-width: 820px; margin: 0 auto 18px; color: var(--th-navy); font-size: clamp(1.2rem, 2.5vw, 1.55rem); font-weight: 850; line-height: 1.35; text-align: center; }
.quiz-visual:not(:empty) { width: 84px; margin: 0 auto 18px; }
.quiz-visual:has(.quiz-listen-button) { width: min(280px, 100%); }
.quiz-visual .time-signature { width: 84px; font-size: 3.2rem; }
.quiz-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  width: min(760px, 100%);
  margin: 0 auto 24px;
}
.quiz-level-button {
  min-height: 62px;
  padding: 9px 12px;
  border: 1px solid #c9d8d5;
  border-radius: 14px;
  color: var(--th-navy);
  background: #fff;
  cursor: pointer;
}
.quiz-level-button strong, .quiz-level-button small { display: block; }
.quiz-level-button strong { font-size: .96rem; }
.quiz-level-button small { margin-top: 3px; color: var(--th-muted); font-size: .78rem; }
.quiz-level-button.selected { border-color: var(--th-green); background: var(--th-mint); box-shadow: inset 0 0 0 1px var(--th-green); }
.quiz-listen-button {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--th-navy);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(11, 49, 91, .18);
}
.quiz-listen-button.is-playing { background: var(--th-coral); }
.quiz-listen-hint {
  display: block;
  margin-top: 9px;
  color: var(--th-muted);
  font-size: .78rem;
  line-height: 1.35;
  text-align: center;
}
.answers { display: grid; width: min(720px, 100%); gap: 10px; margin: 0 auto; }
.answer-button {
  min-height: 54px;
  padding: 12px 16px;
  border: 2px solid #d3ddd9;
  border-radius: 14px;
  color: var(--th-navy);
  background: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.answer-button:hover { border-color: var(--th-green); }
.answer-button.correct { border-color: var(--th-green); color: var(--th-green-dark); background: var(--th-mint); }
.answer-button.wrong { border-color: var(--th-coral); color: #8d2b28; background: #fff0ed; }
.answer-button:disabled { cursor: default; }
.feedback { width: min(720px, 100%); margin: 15px auto 0; padding: 13px 15px; border-radius: 13px; color: var(--th-green-dark); background: var(--th-mint); font-weight: 750; line-height: 1.45; }
.feedback.is-wrong { color: #7e332c; background: #fff0ed; }

.result-card { text-align: center; }
.result-mark { display: grid; width: 74px; height: 74px; margin: 0 auto 14px; place-items: center; border-radius: 50%; color: #fff; background: var(--th-green); font-size: 2.2rem; font-weight: 950; box-shadow: 0 0 0 10px var(--th-mint); }
.result-card p { max-width: 620px; margin: 12px auto 0; color: #405c6c; font-size: 1.05rem; line-height: 1.5; }
.result-card .result-actions { justify-content: center; }

.explorer-card { padding: clamp(18px, 3vw, 30px); }
.explorer-heading, .families-heading { text-align: center; }
.explorer-heading h2, .families-heading h2 {
  margin: 0;
  color: var(--th-navy);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.15;
}
.explorer-heading p { margin: 8px 0 0; color: var(--th-muted); }
.four-four-board {
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.5fr);
  gap: 16px;
  margin: 22px 0 32px;
}
.signature-explained, .four-four-example {
  min-width: 0;
  border: 1px solid #aed0c7;
  border-radius: 18px;
  background: var(--th-mint);
}
.signature-explained {
  display: grid;
  grid-template-columns: 92px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  padding: 18px;
}
.explorer-signature {
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  align-self: center;
  color: var(--th-navy);
  font-family: Georgia, serif;
  font-size: 4.35rem;
  font-weight: 900;
  line-height: .7;
  text-align: center;
}
.explorer-signature span:first-child { padding-bottom: 8px; }
.explorer-signature span:last-child { padding-top: 8px; }
.signature-callout { position: relative; padding: 10px 10px 10px 22px; }
.signature-callout::before { content: ""; position: absolute; left: 0; top: 50%; width: 15px; height: 2px; background: var(--th-gold); }
.signature-callout strong, .signature-callout span { display: block; }
.signature-callout strong { color: var(--th-green-dark); }
.signature-callout span { margin-top: 3px; color: #405a68; font-size: .88rem; line-height: 1.35; }
.top-callout { align-self: end; }
.bottom-callout { align-self: start; }
.four-four-example { padding: 12px 16px; background: rgba(255, 255, 255, .8); }
.four-four-notation { min-height: 118px; overflow: hidden; border-radius: 12px; background: #fff; }
.four-four-notation svg { display: block; max-width: 100%; }
.four-four-example p { margin: 7px 0 2px; color: #405a68; text-align: center; line-height: 1.45; }
.duration-code {
  margin: 0 0 34px;
  padding: clamp(17px, 2.8vw, 26px);
  border: 1px solid #c5d5d1;
  border-radius: 18px;
  background: #fff;
}
.duration-code-heading { text-align: center; }
.duration-code-heading h2 { margin: 0; color: var(--th-navy); font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
.duration-code-heading p { margin: 8px 0 0; color: #405a68; line-height: 1.45; }
.duration-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.4vw, 14px);
  margin: 20px auto 16px;
  color: var(--th-green-dark);
}
.duration-rule span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--th-mint); font-size: 1.1rem; }
.duration-rule i { color: var(--th-gold); font-size: .82rem; font-style: normal; font-weight: 900; }
.duration-table-wrap { overflow: hidden; border: 1px solid #cbd8d5; border-radius: 14px; }
.duration-table { width: 100%; border-collapse: collapse; color: var(--th-navy); }
.duration-table th, .duration-table td { padding: 10px 14px; border-bottom: 1px solid #dce5e2; text-align: left; }
.duration-table tr:last-child td { border-bottom: 0; }
.duration-table th { color: var(--th-green-dark); background: var(--th-mint); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
.duration-table tbody tr:nth-child(even) { background: #fbfdfc; }
.duration-table td:first-child { width: 90px; font-size: 1.05rem; }
.duration-table td:nth-child(2) { width: 34%; font-weight: 800; }
.duration-note { display: inline-block; min-width: 34px; color: var(--th-navy); font-family: "Bravura", "Segoe UI Symbol", serif; font-size: 1.65rem; line-height: 1; vertical-align: middle; }
.duration-summary { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; color: #63390a; background: #fff2c9; line-height: 1.48; text-align: center; }
.families-heading { margin-bottom: 15px; }
.family-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 680px; margin: 0 auto 12px; }
.family-tab {
  min-height: 46px;
  border: 1px solid #b9cdc9;
  border-radius: 13px;
  color: var(--th-navy);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}
.family-tab.selected { color: #fff; border-color: var(--th-green); background: var(--th-green); }
.family-panel {
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid #aed0c7;
  border-radius: 18px;
  background: linear-gradient(150deg, #f7fffc, #eaf5f1);
}
.family-copy { text-align: center; }
.family-copy h3 { margin: 0; color: var(--th-navy); font-size: 1.35rem; }
.family-copy p { margin: 7px 0 0; color: #405a68; }
.family-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 18px 0; }
.family-example {
  position: relative;
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 12px;
  padding: 12px 34px 12px 13px;
  border: 1px solid #d5cbe0;
  border-radius: 14px;
  color: var(--th-navy);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.family-example:hover { border-color: var(--th-green); }
.family-example.is-playing { border-color: var(--th-gold); background: #fff8e4; }
.family-example > span:nth-child(2) { min-width: 0; }
.family-example strong, .family-example small, .family-example em { display: block; }
.family-example strong { font-size: 1.02rem; }
.family-example small { margin-top: 3px; color: var(--th-muted); line-height: 1.25; }
.family-example em { margin-top: 5px; color: var(--th-green-dark); font-size: .7rem; font-style: normal; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.family-example > i { position: absolute; right: 12px; color: var(--th-green); font-style: normal; font-size: 1.2rem; }
.mini-signature {
  display: grid;
  width: 34px;
  flex: 0 0 34px;
  color: var(--th-navy);
  font-family: Georgia, serif;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: .74;
  text-align: center;
}
.mini-signature span:first-child { padding-bottom: 3px; }
.mini-signature span:last-child { padding-top: 3px; }
.family-note { padding: 13px 15px; border-radius: 13px; color: #63390a; background: #fff2c9; }
.family-note strong { color: #8a5400; }
.family-note p { margin: 4px 0 0; line-height: 1.45; }
.meter-levels { display: grid; gap: 14px; margin-bottom: 34px; }
.meter-level {
  border: 1px solid #dde4e1;
  border-radius: 18px;
  background: #f7f9f8;
}
.meter-level-primary { padding: clamp(18px, 3vw, 28px); }
.meter-level-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.meter-level-heading > span, .meter-level-advanced summary > span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--th-green);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.meter-level-heading h3 { margin: 0; color: var(--th-navy); font-size: 1.3rem; }
.meter-level-heading p { margin: 3px 0 0; color: var(--th-muted); font-size: .9rem; }
.meter-family-block { padding: 22px 0 4px; }
.meter-family-block + .meter-family-block { margin-top: 10px; border-top: 1px solid #dde4e1; }
.meter-family-block .family-copy { text-align: left; }
.meter-family-block .family-copy h4 { margin: 0; color: var(--th-navy); font-size: 1.18rem; }
.meter-family-block .family-copy p { margin: 5px 0 0; color: var(--th-muted); }
.meter-family-block .family-examples { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0 10px; }
.meter-family-block .family-example.selected { border-color: var(--th-green); background: var(--th-mint); box-shadow: inset 0 0 0 1px var(--th-green); }
.family-score { margin: 12px 0 10px; overflow: hidden; border: 1px solid #d9e1de; border-radius: 14px; background: #fff; }
.family-score-head { display: flex; min-height: 42px; align-items: center; gap: 10px; padding: 8px 13px; border-bottom: 1px solid #e4e8e6; }
.family-score-head span { color: var(--th-green); font-size: .68rem; font-weight: 900; letter-spacing: .1em; }
.family-score-head strong { color: var(--th-navy); font-size: 1rem; }
.family-score-head small { margin-left: auto; color: var(--th-muted); }
.family-score-notation { min-height: 128px; overflow: hidden; }
.family-score-notation svg { display: block; max-width: 100%; }
.meter-family-block .family-note { padding: 11px 13px; font-size: .88rem; }
.meter-level-advanced { overflow: hidden; background: #fff; }
.meter-level-advanced summary {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}
.meter-level-advanced summary::-webkit-details-marker { display: none; }
.meter-level-advanced summary::after { content: "+"; margin-left: auto; color: var(--th-green); font-size: 1.55rem; font-weight: 500; }
.meter-level-advanced[open] summary::after { content: "−"; }
.meter-level-advanced summary strong { color: var(--th-navy); font-size: 1rem; }
.meter-level-advanced summary small { color: var(--th-muted); }
.advanced-content { padding: 0 22px 18px; border-top: 1px solid #e2e7e5; }
.explorer-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }

.sources-panel { margin: 18px 8px 0; color: var(--th-muted); font-size: .88rem; }
.sources-panel summary { width: fit-content; cursor: pointer; font-weight: 800; }
.sources-panel p { margin: 8px 0 4px; }
.sources-panel a { color: var(--th-green-dark); font-weight: 800; }

@media (max-width: 820px) {
  body { padding-inline: 10px; }
  .level-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench { grid-template-columns: 1fr; }
  .idea-card { padding: 16px; }
  .four-four-board { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  body { padding: 10px 7px 28px; }
  .section-tabs { grid-template-columns: 1fr; gap: 4px; }
  .section-tab { min-height: 38px; }
  .level-tabs { gap: 7px; }
  .level-tab { min-height: 58px; padding: 8px 8px 8px 41px; border-radius: 13px; }
  .level-number { left: 8px; width: 26px; height: 26px; }
  .level-tab strong { font-size: .87rem; }
  .level-tab small { display: none; }
  .lesson-card, .explorer-card, .quiz-card, .result-card { border-radius: 18px; }
  .lesson-progress { gap: 8px; margin-bottom: 16px; }
  .progress-dots i { width: 22px; }
  .meter-stage { padding: 14px 10px; }
  .pulse-visual { min-height: 96px; gap: 3px; }
  .measure-group { gap: 7px; padding-inline: 9px; }
  .beat-group { min-width: 26px; }
  .beat-dot { width: 21px; height: 21px; }
  .notation-example { min-height: 126px; }
  .lesson-actions, .quiz-actions, .result-actions { align-items: stretch; flex-direction: column-reverse; }
  .lesson-actions button, .quiz-actions button, .result-actions button { width: 100%; }
  .quiz-topline { align-items: center; }
  .quiz-count { font-size: .82rem; }
  .quiz-levels { grid-template-columns: 1fr; gap: 7px; }
  .quiz-level-button { min-height: 52px; text-align: left; }
  .quiz-level-button strong, .quiz-level-button small { display: inline; }
  .quiz-level-button small::before { content: " · "; }
  .family-examples { grid-template-columns: 1fr; }
  .family-example { min-height: 70px; }
  .meter-family-block .family-examples { grid-template-columns: 1fr; }
  .meter-level-heading { align-items: flex-start; flex-direction: column; }
  .family-score-notation { min-height: 232px; }
  .meter-level-advanced summary { flex-wrap: wrap; }
  .meter-level-advanced summary small { width: 100%; padding-left: 78px; }
  .advanced-content { padding-inline: 14px; }
  .duration-rule { gap: 4px; }
  .duration-rule span { width: 35px; height: 35px; }
  .duration-rule i { font-size: .68rem; }
  .duration-table th, .duration-table td { padding: 9px 8px; }
  .duration-table td:first-child { width: 52px; }
  .duration-table td:nth-child(2) { width: 40%; }
  .duration-note { min-width: 27px; font-size: 1.45rem; }
  .explorer-actions { align-items: stretch; flex-direction: column-reverse; }
  .explorer-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Identité éditoriale du module Théorie */
:root {
  --th-navy: #0a2540;
  --th-green: #705494;
  --th-green-dark: #563e73;
  --th-mint: #f2edf7;
  --th-blue: #315f75;
  --th-coral: #a85a4f;
  --th-gold: #bd862a;
  --th-paper: #fffefd;
  --th-line: #ddd8ce;
  --th-muted: #53697a;
  --th-shadow: 0 18px 50px rgba(22, 43, 54, .065);
}

body.theory-page {
  color: var(--th-navy);
  background: #f5f2ec;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.theory-shell { width: min(1180px, 100%); }
.section-tabs {
  width: min(720px, 100%);
  margin: 16px auto 18px;
  padding: 0;
  gap: 0;
  border: 0;
  border-bottom: 1px solid rgba(10, 37, 64, .16);
  border-radius: 0;
  background: transparent;
}
.section-tab {
  position: relative;
  min-height: 54px;
  border-radius: 0;
  color: var(--th-muted);
  background: transparent;
}
.section-tab::after { content: ""; position: absolute; right: 22%; bottom: -1px; left: 22%; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.section-tab.selected { color: var(--th-navy); background: transparent; box-shadow: none; }
.section-tab.selected::after { background: var(--th-green); }

.level-tabs { gap: 10px; margin-bottom: 18px; }
.level-tab {
  min-height: 76px;
  border: 1px solid var(--th-line);
  border-top: 3px solid transparent;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(10, 37, 64, .055);
}
.level-tab:nth-child(n) { border-top-color: #c8d5d1; }
.level-tab:hover { border-color: #b7c9c4; box-shadow: 0 10px 24px rgba(22, 43, 54, .07); }
.level-tab[aria-current="step"] { color: #fff; border-color: var(--th-navy); border-top-color: var(--th-gold); background: var(--th-navy); box-shadow: 0 11px 26px rgba(22, 43, 54, .14); }
.level-number { background: var(--th-mint); color: var(--th-green-dark); }

.lesson-card, .explorer-card, .quiz-card, .result-card { border: 1px solid var(--th-line); border-radius: 26px; background: var(--th-paper); box-shadow: var(--th-shadow); }
.lesson-card { padding: clamp(24px, 4vw, 42px); }
.lesson-progress { margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--th-line); }
.progress-dots i { height: 4px; background: #dfe4e3; }
.progress-dots i.done { background: var(--th-green); }
.lesson-copy { max-width: none; margin-bottom: 28px; text-align: left; }
.lesson-copy h2 { max-width: 800px; font-size: clamp(1.9rem, 4vw, 3.25rem); font-weight: 750; letter-spacing: -.045em; }
.lesson-copy > p:last-child { max-width: 780px; margin: 13px 0 0; color: var(--th-muted); font-size: 1.06rem; }
.lesson-tag { color: var(--th-green); }
.workbench { grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; }
.meter-stage { padding: clamp(20px, 3vw, 30px); border: 1px solid #dde4e1; border-radius: 18px; background: #f7f9f8; }
.notation-example { background: #fff; }
.idea-card { border: 1px solid #e5d7ba; border-radius: 18px; color: #5b4218; background: #faf4e6; }
.idea-icon { background: var(--th-gold); }
.demo-button { background: var(--th-navy); box-shadow: 0 10px 24px rgba(10, 37, 64, .16); transition: transform .18s ease, background .18s ease; }
.demo-button:hover { transform: translateY(-1px); background: var(--th-green-dark); }
.primary-button { border-color: var(--th-navy); background: var(--th-navy); box-shadow: 0 8px 18px rgba(10, 37, 64, .13); transition: transform .18s ease, background .18s ease; }
.primary-button:hover { background: var(--th-green-dark); transform: translateY(-1px); }
.secondary-button { border-color: var(--th-line); background: #fff; }

.explorer-card { padding: clamp(25px, 4.5vw, 50px); }
.explorer-heading h2, .families-heading h2 { font-size: clamp(2rem, 4vw, 3.15rem); font-weight: 750; letter-spacing: -.045em; }
.four-four-board { margin-top: 30px; gap: 18px; }
.signature-explained { border: 0; color: #fff; background: var(--th-navy); }
.explorer-signature { color: #fff; }
.signature-callout strong { color: #8fe0cf; }
.signature-callout span { color: rgba(255, 255, 255, .7); }
.signature-callout::before { background: var(--th-gold); }
.four-four-example { border-color: var(--th-line); background: #fff; }
.duration-code { padding: clamp(22px, 4vw, 38px); border: 1px solid #e0e2dd; background: #f7f7f4; }
.duration-rule span { color: var(--th-navy); border: 1px solid #c7d4d0; background: #fff; box-shadow: 0 5px 12px rgba(22, 43, 54, .05); }
.duration-rule i { color: var(--th-green); }
.duration-table-wrap { border-color: var(--th-line); background: #fff; }
.duration-table th { color: var(--th-navy); background: #edf2f0; }
.duration-summary { color: #5b4218; border: 1px solid #e5d7ba; background: #faf4e6; }
.family-tabs { gap: 10px; }
.family-tab { border: 1px solid var(--th-line); border-bottom: 3px solid transparent; border-radius: 12px; box-shadow: 0 5px 14px rgba(22, 43, 54, .045); }
.family-tab:nth-child(n).selected { color: #fff; border-color: var(--th-green); background: var(--th-green); }
.family-panel { border: 1px solid #dde4e1; background: #f7f9f8; }
.family-example { border: 1px solid #dce2df; box-shadow: 0 5px 14px rgba(22, 43, 54, .045); }
.family-note { color: #5b4218; border: 1px solid #e5d7ba; background: #faf4e6; }
.quiz-level-button { border: 1px solid var(--th-line); box-shadow: 0 5px 14px rgba(22, 43, 54, .045); }
.quiz-level-button.selected { border: 1px solid var(--th-green); background: var(--th-mint); box-shadow: inset 0 0 0 1px var(--th-green); }
.answer-button { border-color: rgba(10, 37, 64, .11); }
.answer-button:hover { border-color: var(--th-green); }

.body-guide {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 10px;
  margin: 10px 0;
}
.conducting-guide,
.dance-guide {
  min-width: 0;
  min-height: 96px;
  padding: 11px 14px;
  border: 1px solid #d9e1de;
  border-radius: 14px;
  background: #fff;
}
.conducting-guide {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) 150px;
  align-items: center;
  gap: 8px;
}
.conducting-guide span,
.dance-guide span {
  display: block;
  color: var(--th-green);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .09em;
}
.conducting-guide strong,
.dance-guide strong {
  display: block;
  margin-top: 3px;
  color: var(--th-navy);
  font-size: .98rem;
}
.conducting-guide svg {
  width: 142px;
  height: 70px;
  justify-self: end;
  overflow: visible;
}
.conducting-path {
  fill: none;
  stroke: #b5c4c0;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.conducting-beat circle {
  fill: #fff;
  stroke: #84aaa0;
  stroke-width: 2;
  transition: fill .14s ease, stroke .14s ease, transform .14s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.conducting-beat text {
  fill: var(--th-green-dark);
  font-size: 11px;
  font-weight: 850;
  text-anchor: middle;
  pointer-events: none;
}
.conducting-beat.active circle {
  fill: var(--th-gold);
  stroke: var(--th-gold);
  transform: scale(1.18);
}
.conducting-beat.active text { fill: #fff; }
.dance-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 12px;
}
.dance-beats { display: flex; gap: 6px; }
.dance-beats i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #9ab7b0;
  border-radius: 50%;
  color: var(--th-green-dark);
  background: #fff;
  font-size: .75rem;
  font-style: normal;
  font-weight: 850;
  transition: color .14s ease, background .14s ease, border-color .14s ease, transform .14s ease;
}
.dance-beats i.active {
  color: #fff;
  border-color: var(--th-gold);
  background: var(--th-gold);
  transform: translateY(-3px);
}
.dance-guide p {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--th-muted);
  font-size: .82rem;
  line-height: 1.35;
}

@media (max-width: 820px) {
  .workbench { grid-template-columns: 1fr; }
  .body-guide { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  body.theory-page { padding-inline: 7px; }
  .section-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .section-tab { min-height: 60px; padding: 8px 5px; font-size: .78rem; line-height: 1.25; }
  .level-tabs { gap: 7px; }
  .level-tab { min-height: 62px; }
  .lesson-card, .explorer-card, .quiz-card, .result-card { border-radius: 23px; }
  .lesson-card, .explorer-card { padding: 20px 15px; }
  .lesson-copy h2 { font-size: 2rem; }
  .four-four-board { margin-top: 22px; }
  .duration-code { padding: 20px 12px; }
  .conducting-guide { grid-template-columns: minmax(100px, 1fr) 126px; }
  .conducting-guide svg { width: 122px; }
  .dance-guide { grid-template-columns: 1fr; }
  .dance-beats { margin-top: 6px; }
}

/* Durées : une leçon autonome, concrète et courte. */
.duration-shell { width: min(1040px, 100%); }
.duration-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.duration-lesson {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--th-line);
  border-radius: 24px;
  background: var(--th-paper);
  box-shadow: var(--th-shadow);
}
.duration-heading { max-width: 790px; margin: 0 auto 22px; text-align: center; }
.duration-heading h2 { margin: 0; font-size: clamp(1.65rem, 3.6vw, 2.35rem); line-height: 1.12; letter-spacing: -.03em; }
.duration-heading > p { margin: 9px 0 0; color: #405a6d; font-size: 1rem; line-height: 1.5; }
.duration-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.duration-selector button {
  display: grid;
  min-width: 0;
  min-height: 92px;
  place-items: center;
  padding: 9px;
  border: 1px solid #d7d1c8;
  border-radius: 14px;
  color: var(--th-navy);
  background: #fff;
  cursor: pointer;
}
.duration-selector button.selected { color: #fff; border-color: var(--th-green); background: var(--th-green); box-shadow: 0 7px 18px rgba(86, 62, 115, .18); }
.music-glyph,
.rest-symbol,
.point-formula span,
.duration-token i,
.duration-quiz-visual { font-family: "Bravura", "Times New Roman", serif; }
.music-glyph { font-size: 1.85rem; line-height: 1; }
.duration-selector strong,
.duration-selector small { display: block; }
.duration-selector strong { margin-top: 2px; font-size: .88rem; }
.duration-selector small { margin-top: 3px; color: var(--th-muted); font-size: .73rem; }
.duration-selector button.selected small { color: rgba(255,255,255,.78); }
.duration-chain { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: -2px 0 4px; padding: 12px; border: 1px solid #ded8cf; border-radius: 13px; background: #fff; font-size: .82rem; }
.duration-chain span { white-space: nowrap; }
.duration-chain b { color: var(--th-green-dark); font-size: 1.05rem; }
.duration-chain i { color: var(--th-gold); font-style: normal; font-weight: 900; }
.duration-chain-rule { margin: 0 0 16px; color: var(--th-muted); font-size: .78rem; text-align: center; }
.duration-context { margin: 0 0 16px; padding: 17px; border: 1px solid #e0e1df; border-radius: 17px; background: #f8f8f6; }
.duration-context > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.duration-context > header .section-kicker { margin: 0; }
.duration-context > header h3 { margin: 0; font-size: 1.05rem; }
.duration-context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.duration-context-grid article { display: grid; min-width: 0; grid-template-columns: 45px 1fr; align-items: center; gap: 11px; padding: 12px; border: 1px solid #e1dfda; border-radius: 13px; background: #fff; box-shadow: 0 6px 18px rgba(23, 42, 58, .05); }
.duration-context-grid article > div { display: grid; min-width: 0; gap: 4px; }
.duration-context-grid strong { font-size: .8rem; line-height: 1.25; }
.duration-context-grid small { color: var(--th-muted); font-size: .67rem; line-height: 1.35; }
.context-meter { display: grid; width: 42px; height: 52px; place-content: center; border-radius: 11px; color: var(--th-green-dark); background: #f2edf7; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 850; line-height: .68; text-align: center; }
.context-meter b { display: block; }
.duration-context > p { margin: 12px 2px 0; color: #48606c; font-size: .76rem; line-height: 1.45; }
.duration-context > p strong { color: var(--th-green-dark); }
.duration-workbench { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(230px, .75fr); gap: 14px; }
.duration-demo,
.duration-point { padding: clamp(17px, 2.5vw, 24px); border-radius: 19px; }
.duration-demo { border: 1px solid #c9d8d4; background: #f7fbfa; }
.duration-demo h3,
.duration-point h3,
.silence-strip h3 { margin: 0; font-size: 1.12rem; }
.duration-equation { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 10px; margin: 20px 0 9px; }
.duration-side { display: flex; min-width: 0; height: 92px; align-items: stretch; gap: 4px; }
.duration-token {
  position: relative;
  display: grid;
  flex: var(--units) 1 0;
  min-width: 32px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #c8d6d2;
  border-radius: 12px;
  color: var(--th-navy);
  background: #fff;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.duration-token::after { content: ""; position: absolute; inset: auto 0 0; height: 5px; background: #d9e4e1; }
.duration-token i { font-size: clamp(1.9rem, 4vw, 2.7rem); font-style: normal; }
.duration-token.active { color: #fff; border-color: var(--th-green); background: var(--th-green); }
.duration-token.active::after { background: var(--th-gold); }
.duration-equation > b { text-align: center; font-size: 1.35rem; }
.duration-ruler { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0 0 17px; color: var(--th-muted); font-size: .7rem; font-weight: 800; text-align: center; }
.duration-ruler span { padding-top: 4px; border-top: 2px solid #aebfba; }
.duration-point { display: flex; align-items: flex-start; gap: 12px; border: 1px solid #d4c8df; background: #f5f0f9; }
.duration-point p { margin: 7px 0 17px; color: #405a6d; line-height: 1.45; }
.point-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--th-green-dark); }
.point-formula span { font-size: 1.55rem; }
.point-formula b { font-size: .9rem; }
.silence-strip { display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 18px; margin-top: 14px; padding: 18px 20px; border: 1px solid #ddd6ca; border-radius: 17px; background: #fff; }
.silence-strip ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 0; padding: 0; list-style: none; }
.silence-strip li { display: grid; min-width: 0; grid-template-columns: 35px 1fr; align-items: center; gap: 0 8px; padding: 8px; border-left: 1px solid #e4dfd7; }
.rest-symbol { grid-row: 1 / 3; font-size: 1.55rem; }
.silence-strip strong { font-size: .78rem; }
.silence-strip small { color: var(--th-muted); font-size: .68rem; }
.duration-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.duration-quiz { padding: clamp(22px, 4vw, 38px); }
.duration-quiz-visual { min-height: 90px; display: grid; place-items: center; margin: 14px auto; border: 1px solid #d8d2c9; border-radius: 15px; background: #fff; font-size: clamp(2rem, 6vw, 3.5rem); }
.duration-quiz-visual.has-score { display: block; width: min(820px, 100%); min-height: 130px; overflow: hidden; font-family: inherit; font-size: 1rem; }
.duration-quiz-visual.has-score svg { display: block; width: 100%; max-width: 100%; }
.duration-reminder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 22px; padding: 16px 19px; border: 1px solid #d7cfdf; border-radius: 15px; background: #f7f3fa; }
.duration-reminder .section-kicker { width: 100%; margin: 0; }
.duration-reminder p { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.duration-reminder a { margin-left: auto; color: var(--th-green-dark); font-size: .84rem; font-weight: 800; }

@media (max-width: 760px) {
  .duration-context-grid { grid-template-columns: 1fr; }
  .duration-workbench { grid-template-columns: 1fr; }
  .silence-strip { grid-template-columns: 1fr; }
  .silence-strip ul { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .duration-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duration-selector { grid-template-columns: repeat(2, 1fr); }
  .duration-equation { grid-template-columns: 1fr; }
  .duration-equation > b { line-height: .7; }
  .duration-side { height: 78px; }
  .silence-strip ul { grid-template-columns: 1fr; }
  .silence-strip li { border-left: 0; border-top: 1px solid #e4dfd7; }
  .duration-actions { display: grid; grid-template-columns: 1fr; }
}

/* Chiffres indicateurs : une page directe, sans parcours intermédiaire. */
.signature-shell { width: min(960px, 100%); margin: 0 auto; }
.signature-page-heading { margin: 24px 0 14px; padding: 0 4px; }
.signature-page-heading h1 { margin: 0; color: var(--th-navy); font-size: clamp(2rem, 4.7vw, 3rem); line-height: 1; letter-spacing: -.04em; }
.signature-page-heading p { margin: 8px 0 0; color: var(--th-muted); line-height: 1.45; }
.meter-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
.meter-picker button { min-height: 48px; padding: 8px; border: 1px solid #d6cedd; border-radius: 12px; color: var(--th-green-dark); background: rgba(255,255,255,.86); font-weight: 900; cursor: pointer; }
.meter-picker button:hover { border-color: var(--th-green); }
.meter-picker button.selected { color: #fff; border-color: var(--th-green); background: var(--th-green); box-shadow: 0 6px 15px rgba(86,62,115,.18); }
.signature-focus,
.mini-challenge { border: 1px solid var(--th-line); border-radius: 22px; background: var(--th-paper); box-shadow: var(--th-shadow); }
.signature-focus { padding: clamp(19px, 3vw, 30px); }
.signature-definition { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 19px; }
.signature-big { display: grid; width: 84px; height: 92px; place-content: center; border-radius: 18px; color: #fff; background: var(--th-green); font-family: Georgia, serif; font-size: 2.55rem; font-weight: 850; line-height: .72; text-align: center; }
.signature-big span:first-child { padding-bottom: 5px; }
.signature-main-copy h2 { margin: 0; font-size: clamp(1.45rem, 3.2vw, 2.1rem); line-height: 1.13; letter-spacing: -.025em; }
.signature-main-copy p { margin: 8px 0 0; color: #385268; font-size: 1rem; }
.signature-equation { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 10px; margin: 21px 0 15px; padding: 15px; border: 1px solid #d6dfdc; border-radius: 16px; background: #f7fbfa; }
.signature-unit-group { display: flex; position: relative; gap: 5px; padding: 2px 6px 23px; border-bottom: 3px solid #c1d1cd; }
.signature-unit-group small { position: absolute; right: 0; bottom: 3px; left: 0; color: var(--th-muted); font-family: inherit; font-size: .65rem; font-style: normal; font-weight: 750; text-align: center; white-space: nowrap; }
.signature-unit { display: grid; width: 39px; height: 48px; place-items: center; border: 1px solid #d2dbd8; border-radius: 10px; color: var(--th-navy); background: #fff; font-family: "Bravura", Georgia, serif; font-size: 1.65rem; font-style: normal; transition: color .12s ease, background .12s ease, transform .12s ease; }
.signature-unit.active { color: #fff; background: var(--th-green); transform: translateY(-2px); }
.signature-reading { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.signature-reading > div { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid #ddd6ca; border-radius: 13px; background: #fff; }
.signature-reading > div > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; color: var(--th-green-dark); background: #f2edf7; font-size: 1.1rem; font-weight: 900; }
.signature-reading p { margin: 0; }
.signature-reading strong,
.signature-reading small { display: block; }
.signature-reading strong { font-size: .85rem; }
.signature-reading small { margin-top: 2px; color: var(--th-muted); font-size: .76rem; }
.signature-score { position: relative; min-height: 136px; overflow: hidden; border: 1px solid #e1ddd5; border-radius: 14px; background: #fff; }
.signature-score svg { display: block; max-width: 100%; }
.score-beat-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.score-beat-marker {
  position: absolute;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid #aab5b3;
  border-radius: 50%;
  color: #526663;
  background: rgb(255 255 255 / 94%);
  font-size: .68rem;
  font-weight: 850;
  line-height: 1;
  transition: transform 110ms ease, color 110ms ease, border-color 110ms ease, background 110ms ease, box-shadow 110ms ease;
}
.score-beat-marker::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  width: 1px;
  height: 61px;
  background: rgb(91 119 114 / 18%);
}
.score-beat-marker.is-active { z-index: 1; transform: translateX(-50%) scale(1.22); border-color: #c5871a; color: #fff; background: #c5871a; box-shadow: 0 0 0 5px rgb(197 135 26 / 14%); }
.score-beat-marker.is-active::after { width: 2px; background: rgb(197 135 26 / 52%); }
.signature-play { margin-top: 12px; }
.signature-note { min-height: 22px; margin: 10px auto 0; color: var(--th-muted); font-size: .86rem; line-height: 1.4; text-align: center; }
.mini-challenge { margin-top: 13px; padding: clamp(19px, 3vw, 28px); }
.challenge-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.challenge-heading h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.85rem); }
.challenge-heading > span { color: var(--th-green-dark); font-size: .82rem; font-weight: 850; }
.challenge-prompt { margin: 18px 0 10px; color: var(--th-navy); font-size: clamp(1rem, 2.1vw, 1.15rem); font-weight: 800; line-height: 1.45; text-align: center; }
.challenge-visual { display: grid; min-height: 72px; place-items: center; margin-bottom: 10px; border-radius: 13px; color: var(--th-green-dark); background: #f3eef7; font-family: "Bravura", Georgia, serif; font-size: clamp(1.7rem, 5vw, 2.7rem); font-weight: 800; }
.challenge-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.theory-related { display: flex; justify-content: center; gap: 10px 24px; padding: 17px; }
.theory-related a { color: var(--th-green-dark); font-size: .82rem; font-weight: 800; }

@media (max-width: 640px) {
  .signature-page-heading { margin-top: 14px; }
  .meter-picker { grid-template-columns: repeat(3, 1fr); }
  .signature-definition { grid-template-columns: 70px minmax(0, 1fr); gap: 13px; }
  .signature-big { width: 68px; height: 76px; border-radius: 15px; font-size: 2rem; }
  .signature-reading { grid-template-columns: 1fr; }
  .signature-unit { width: 34px; }
  .challenge-actions { display: grid; grid-template-columns: 1fr; }
  .challenge-actions .primary-button { grid-row: 1; }
  .theory-related { flex-direction: column; align-items: center; }
}

/* Chiffres indicateurs : repères, exemple modulable et exercices à la demande. */
.signature-simple-page .meter-picker { grid-template-columns: 1.35fr repeat(8, minmax(0, 1fr)); }
.signature-simple-page .meter-picker button { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 6px; padding: 6px; }
.signature-simple-page .meter-picker .advanced-meter { border-style: dashed; }
.summary-button-icon { color: var(--th-gold); font-size: 1.2rem; }
.meter-mark,
.inline-meter-mark,
.summary-meter-mark,
.challenge-meter-mark,
.answer-meter-mark { display: inline-grid; place-items: center; color: currentColor; font-family: Georgia, serif; font-weight: 900; line-height: .68; vertical-align: middle; }
.meter-mark { min-width: 24px; font-size: 1.05rem; }
.meter-mark span:first-child,
.inline-meter-mark span:first-child,
.summary-meter-mark span:first-child,
.challenge-meter-mark span:first-child,
.answer-meter-mark span:first-child { padding-bottom: .14em; }
.inline-meter-mark { min-width: 22px; margin: 0 3px; color: var(--th-green-dark); font-size: 1rem; }
.summary-meter-mark { min-width: 45px; color: var(--th-green-dark); font-size: 1.6rem; }
.challenge-meter-mark { color: var(--th-green-dark); font-size: 2.9rem; }
.answer-meter-mark { font-size: 1.25rem; }

.meter-summary,
.practice-drawer { border: 1px solid var(--th-line); border-radius: 22px; background: var(--th-paper); box-shadow: var(--th-shadow); }
.meter-summary { padding: clamp(19px, 3vw, 30px); }
.summary-rule { display: grid; grid-template-columns: 76px repeat(2, minmax(0, 1fr)); align-items: center; gap: 12px; margin-bottom: 25px; padding: 16px 18px; border-radius: 16px; color: #fff; background: var(--th-green); }
.summary-signature { display: grid; width: 62px; height: 68px; place-content: center; border-radius: 14px; color: var(--th-green-dark); background: #fff; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 900; line-height: .68; }
.summary-signature span:first-child { padding-bottom: 5px; }
.summary-rule > div:not(.summary-signature) { display: grid; gap: 3px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.32); }
.summary-rule span:not(.summary-signature span) { color: rgba(255,255,255,.72); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.summary-rule strong { font-size: .94rem; line-height: 1.3; }
.summary-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 11px; }
.summary-heading h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.85rem); }
.summary-heading p { max-width: 280px; margin: 0; color: var(--th-muted); font-size: .82rem; line-height: 1.4; text-align: right; }
.meter-summary-list { overflow: hidden; border: 1px solid #ded9d0; border-radius: 15px; background: #fff; }
.meter-summary-row { display: grid; width: 100%; grid-template-columns: 58px 1fr 1.2fr 24px; align-items: center; gap: 12px; padding: 12px 15px; border: 0; color: var(--th-navy); background: transparent; cursor: pointer; text-align: left; }
.meter-summary-row + .meter-summary-row { border-top: 1px solid #e8e3dc; }
.meter-summary-row:hover { background: #f7f3fa; }
.meter-summary-row > span:not(.summary-meter-mark) { display: grid; gap: 2px; }
.meter-summary-row strong { font-size: .88rem; }
.meter-summary-row small { color: var(--th-muted); font-size: .7rem; }
.meter-summary-row > span:last-child { color: var(--th-green); font-size: 1.1rem; }
.irregular-summary-note { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 15px; margin-top: 12px; padding: 14px 16px; border: 1px solid #d8cce2; border-radius: 14px; background: #f7f3fa; }
.irregular-summary-note > strong { color: var(--th-green-dark); }
.irregular-summary-note > span { color: #405a68; font-size: .84rem; line-height: 1.5; }

.signature-unit-row { display: flex; position: relative; gap: 5px; }
.is-eighth-group .signature-unit-row { gap: 2px; min-height: 49px; padding: 0 4px; }
.is-eighth-group .signature-unit-row::before { content: ""; position: absolute; z-index: 2; top: 5px; right: 11px; left: 19px; height: 5px; border-radius: 1px; background: currentColor; }
.signature-unit-group.is-eighth-group { min-width: 72px; color: var(--th-navy); }
.is-eighth-group .signature-unit { display: block; position: relative; width: 27px; height: 48px; border: 0; border-radius: 0; color: inherit; background: transparent; }
.rhythm-eighth::before { content: ""; position: absolute; top: 5px; right: 5px; width: 3px; height: 33px; border-radius: 2px; background: currentColor; }
.rhythm-eighth::after { content: ""; position: absolute; right: 4px; bottom: 5px; width: 15px; height: 10px; border-radius: 55% 45%; background: currentColor; transform: rotate(-18deg); }
.is-eighth-group .signature-unit.active { color: var(--th-gold); background: transparent; transform: translateY(-2px) scale(1.08); }
.is-quarter-group .signature-unit-row { gap: 5px; }

.example-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0 0 12px; }
.example-controls label,
.example-control-group { display: grid; gap: 5px; color: var(--th-muted); font-size: .68rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.example-controls label[hidden] { display: none; }
.example-controls select { width: 100%; min-height: 42px; padding: 8px 34px 8px 11px; border: 1px solid #d5d0c8; border-radius: 11px; color: var(--th-navy); background: #fff; font: inherit; font-size: .82rem; font-weight: 800; letter-spacing: 0; text-transform: none; }
.tempo-control { align-content: end; }
.tempo-readout {
  display: grid;
  min-height: 42px;
  grid-template-columns: auto 48px auto minmax(58px, 1fr);
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #d5d0c8;
  border-radius: 11px;
  color: var(--th-navy);
  background: #fff;
  font-size: .76rem;
  letter-spacing: 0;
  text-transform: none;
}
.tempo-readout > span:first-child { font-family: "Bravura", Georgia, serif; font-size: 1.08rem; }
.tempo-readout input[type="number"] { width: 48px; min-height: 29px; padding: 3px 2px 3px 6px; border: 0; border-radius: 7px; color: var(--th-navy); background: #f3f1ee; font: inherit; font-size: .88rem; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.tempo-readout strong { justify-self: end; color: #69547a; font-size: .73rem; }
.tempo-control > input[type="range"] { width: 100%; height: 18px; margin: -1px 0 -6px; accent-color: #6f5a80; cursor: pointer; }
.control-label { display: block; }
.instrument-settings-button {
  display: grid;
  min-height: 47px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #d5d0c8;
  border-radius: 11px;
  color: var(--th-navy);
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.instrument-settings-button > span:first-child { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #685179; background: #f3f0f5; font-size: 1rem; }
.instrument-settings-button > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }
.instrument-settings-button strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.instrument-settings-button small { color: var(--th-muted); font-size: .61rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.instrument-settings-button > span:last-child { color: #82758b; font-size: 1.35rem; }
.instrument-settings-button:hover { border-color: #a99bb4; box-shadow: 0 5px 14px rgb(43 36 49 / 8%); }

.practice-drawer { margin-top: 13px; overflow: hidden; }
.practice-drawer > summary { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px; cursor: pointer; list-style: none; }
.practice-drawer > summary::-webkit-details-marker { display: none; }
.practice-drawer > summary > span:first-child { display: grid; gap: 2px; }
.practice-drawer > summary strong { font-size: 1rem; }
.practice-drawer > summary small { color: var(--th-muted); font-size: .76rem; }
.practice-drawer > summary > span:last-child { color: var(--th-green); font-size: 1.5rem; transition: transform .2s ease; }
.practice-drawer[open] > summary > span:last-child { transform: rotate(45deg); }
.practice-content { padding: 0 20px 20px; border-top: 1px solid #e5dfd7; }
.practice-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: 15px 0; padding: 4px; border-radius: 13px; background: #f0ece7; }
.practice-tabs button { min-height: 42px; border: 0; border-radius: 10px; color: var(--th-muted); background: transparent; font-weight: 850; cursor: pointer; }
.practice-tabs button[aria-selected="true"] { color: var(--th-green-dark); background: #fff; box-shadow: 0 3px 9px rgba(20,38,48,.08); }
.practice-panel { padding: clamp(15px, 2vw, 22px); border: 1px solid #ddd7cf; border-radius: 16px; background: #fff; }
.practice-panel[hidden] { display: none; }
.ear-play { margin: 12px auto 16px; }
.ear-timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(720px, 100%);
  margin: 12px auto 16px;
}
.ear-measure {
  padding: 11px 14px 13px;
  border: 1px solid #ddd8d1;
  border-radius: 14px;
  background: #fbfbfa;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.ear-measure > span {
  display: block;
  margin-bottom: 9px;
  color: #6f6a65;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ear-measure.is-current { border-color: #a99abb; background: #fff; box-shadow: 0 7px 20px rgb(48 40 57 / 9%); }
.ear-pulses { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.ear-pulse {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid #a8b5b2;
  border-radius: 50%;
  background: #fff;
  transition: transform 110ms ease, border-color 110ms ease, background 110ms ease, box-shadow 110ms ease;
}
.ear-pulse.is-played { border-color: #8c7b9f; background: #ddd5e6; }
.ear-pulse.is-active { transform: scale(1.45); border-color: #665078; background: #665078; box-shadow: 0 0 0 5px rgb(102 80 120 / 13%); }
.meter-answer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 760px) {
  .signature-simple-page .meter-picker { grid-template-columns: repeat(5, 1fr); }
  .summary-rule { grid-template-columns: 62px 1fr; }
  .summary-rule > div:last-child { grid-column: 2; }
  .summary-heading { display: block; }
  .summary-heading p { margin-top: 5px; text-align: left; }
  .irregular-summary-note { grid-template-columns: 1fr; gap: 5px; }
}

@media (max-width: 540px) {
  .signature-simple-page .meter-picker { grid-template-columns: repeat(3, 1fr); }
  .signature-simple-page .meter-picker button { min-height: 54px; }
  .summary-rule { grid-template-columns: 52px 1fr; padding: 13px; }
  .summary-signature { width: 48px; height: 58px; }
  .summary-rule > div:not(.summary-signature) { padding-left: 10px; }
  .meter-summary-row { grid-template-columns: 46px 1fr 22px; gap: 8px; padding: 11px; }
  .meter-summary-row > span:nth-child(3) { grid-column: 2; }
  .meter-summary-row > span:last-child { grid-row: 1 / 3; grid-column: 3; }
  .example-controls { grid-template-columns: 1fr; }
  .practice-content { padding: 0 12px 12px; }
  .practice-tabs { grid-template-columns: 1fr; }
  .meter-answer-grid { grid-template-columns: 1fr 1fr; }
  .ear-timeline { gap: 8px; }
  .ear-measure { padding-inline: 10px; }
  .ear-pulses { gap: 5px; }
  .ear-pulse { width: 9px; height: 9px; flex-basis: 9px; }
}

/* Navigation par familles et mémo imprimable. */
.signature-simple-page .family-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.signature-simple-page .family-picker button { min-height: 70px; justify-content: flex-start; gap: 11px; padding: 10px 13px; text-align: left; }
.family-picker button > span:last-child { display: grid; min-width: 0; gap: 2px; }
.family-picker button strong,
.family-picker button small { display: block; }
.family-picker button strong { font-size: .9rem; }
.family-picker button small { overflow: hidden; color: var(--th-muted); font-size: .66rem; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.family-picker button.selected small { color: rgba(255,255,255,.75); }
.family-symbol { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--th-green-dark); background: #f2edf7; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 900; }
.family-picker button.selected .family-symbol { color: var(--th-green-dark); background: #fff; }
.family-symbol.irregular-symbol { font-size: .8rem; }
.family-symbol.memo-symbol { color: var(--th-gold); }

.meter-subpicker { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: -3px 0 12px; padding: 9px; border: 1px solid #d8d0df; border-radius: 14px; background: rgba(255,255,255,.72); }
.meter-subpicker[hidden] { display: none; }
.meter-subpicker button { display: flex; min-width: 150px; min-height: 47px; flex: 1 1 0; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 10px; color: var(--th-green-dark); background: transparent; font-weight: 850; cursor: pointer; }
.meter-subpicker button:hover { background: #fff; }
.meter-subpicker button.selected { border-color: #cbbcdc; background: #f4eff8; box-shadow: 0 3px 8px rgba(60,45,80,.07); }
.meter-subpicker button > span:last-child { font-size: .78rem; }

.print-memo { display: inline-flex; min-height: 42px; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid #c9bdd5; border-radius: 11px; color: var(--th-green-dark); background: #fff; font-weight: 850; cursor: pointer; }
.print-memo:hover { border-color: var(--th-green); background: #f7f3fa; }
.meter-summary-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.memo-family { min-width: 0; overflow: hidden; border: 1px solid #ddd6ca; border-radius: 16px; background: #fff; }
.memo-family header { display: flex; min-height: 78px; align-items: center; gap: 11px; padding: 13px 14px; color: #fff; background: var(--th-green); }
.memo-family header > span { display: grid; flex: 0 0 auto; width: 43px; height: 43px; place-items: center; border-radius: 12px; color: var(--th-green-dark); background: #fff; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 900; }
.memo-family.memo-irregular header > span { font-size: .78rem; }
.memo-family h3 { margin: 0; font-size: 1rem; }
.memo-family header h3 { color: #fff; }
.memo-family header p { margin: 3px 0 0; color: rgba(255,255,255,.76); font-size: .69rem; line-height: 1.3; }
.memo-meter-grid { display: grid; }
.memo-meter-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 92px; padding: 12px 13px; }
.memo-meter-card + .memo-meter-card { border-top: 1px solid #e9e4dc; }
.memo-meter-card > div { display: grid; gap: 1px; }
.memo-meter-card strong { font-size: .82rem; }
.memo-meter-card small { color: var(--th-muted); font-size: .66rem; }
.memo-meter-card b { margin-top: 7px; color: var(--th-green-dark); font-size: .76rem; line-height: 1.25; }
.memo-meter-card em { margin-top: 4px; color: #7a5e24; font-size: .62rem; font-style: normal; line-height: 1.3; }
.memo-footnote { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; color: #425b68; background: #f4f0f7; font-size: .78rem; line-height: 1.45; }
.memo-footnote strong { color: var(--th-green-dark); }

.example-controls { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); align-items: end; }
.conduct-toggle { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid #d5d0c8; border-radius: 11px; color: var(--th-navy); background: #fff; cursor: pointer; text-align: left; }
.conduct-toggle > span:first-child { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: var(--th-green-dark); background: #f2edf7; font-size: 1.1rem; }
.conduct-toggle > span:last-child { display: grid; gap: 1px; }
.conduct-toggle strong { font-size: .76rem; }
.conduct-toggle small { color: var(--th-muted); font-size: .62rem; }
.conduct-toggle[aria-pressed="true"] { border-color: var(--th-green); background: #f7f3fa; }
.beat-guide { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 16px; min-height: 120px; margin: 0 0 12px; padding: 10px 18px; border: 1px solid #d5cadf; border-radius: 14px; background: #f7f3fa; }
.beat-guide[hidden] { display: none; }
.beat-guide > div { display: grid; gap: 4px; }
.beat-guide > div strong { color: var(--th-green-dark); }
.beat-guide > div small { color: var(--th-muted); }
.conduct-hand-picker { display: flex !important; width: fit-content; align-items: center; gap: 3px !important; margin-top: 8px; padding: 3px; border: 1px solid #dfdbd5; border-radius: 10px; background: #fff; }
.conduct-hand-picker > span { padding: 0 6px; color: var(--th-muted); font-size: .65rem; font-weight: 750; }
.conduct-hand-picker button { min-height: 29px; padding: 4px 9px; border: 0; border-radius: 7px; color: var(--th-muted); background: transparent; cursor: pointer; font: 750 .69rem/1 var(--th-font, system-ui, sans-serif); }
.conduct-hand-picker button[aria-pressed="true"] { color: #fff; background: #665078; box-shadow: 0 3px 8px rgb(64 48 78 / 14%); }
.beat-guide svg { display: block; width: 130px; height: 100px; justify-self: end; overflow: visible; }
.beat-guide polyline { fill: none; stroke: #c2b2d0; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.beat-point circle { fill: #fff; stroke: var(--th-green); stroke-width: 2; }
.beat-point text { fill: var(--th-green-dark); font-size: 10px; font-weight: 900; text-anchor: middle; }
.beat-point.active circle { fill: var(--th-gold); stroke: var(--th-gold); }
.beat-point.active text { fill: #fff; }
.beat-cursor { fill: var(--th-green); opacity: .8; transition: cx .16s ease, cy .16s ease; }

@media (max-width: 760px) {
  .signature-simple-page .family-picker { grid-template-columns: repeat(2, 1fr); }
  .meter-summary-list { grid-template-columns: 1fr; }
  .memo-meter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memo-meter-card { grid-template-columns: 38px 1fr; min-height: 112px; padding: 10px; }
  .memo-meter-card + .memo-meter-card { border-top: 0; border-left: 1px solid #e9e4dc; }
}

@media (max-width: 540px) {
  .signature-simple-page .family-picker button { min-height: 64px; padding: 8px; }
  .family-symbol { width: 34px; height: 34px; }
  .family-picker button small { display: none; }
  .meter-subpicker button { min-width: 0; flex-basis: calc(33.333% - 7px); padding: 7px; }
  .meter-subpicker button > span:last-child { display: none; }
  .summary-heading { display: grid; gap: 10px; }
  .print-memo { width: 100%; justify-content: center; }
  .memo-meter-grid { grid-template-columns: 1fr; }
  .memo-meter-card { grid-template-columns: 48px 1fr; min-height: 83px; }
  .memo-meter-card + .memo-meter-card { border-top: 1px solid #e9e4dc; border-left: 0; }
  .beat-guide { grid-template-columns: 1fr 112px; padding: 9px 12px; }
  .beat-guide svg { width: 105px; }
  .conduct-hand-picker > span { display: none; }
  .conduct-hand-picker button { padding-inline: 7px; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { color: #111; background: #fff !important; }
  body > header,
  .notalix-topbar,
  .notalix-global-topbar,
  .family-picker,
  .meter-subpicker,
  .signature-focus,
  .practice-drawer,
  .theory-related,
  .print-memo,
  .note-hint { display: none !important; }
  .theory-page main,
  .signature-shell { width: 100%; max-width: none; margin: 0; padding: 0; }
  .signature-page-heading { margin: 0 0 8mm; }
  .signature-page-heading p { display: none; }
  .meter-summary { display: block !important; padding: 0; border: 0; box-shadow: none; }
  .summary-rule { margin-bottom: 7mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .meter-summary-list { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .memo-family { break-inside: avoid; }
  .memo-family header { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .memo-meter-card { min-height: 24mm; }
  .memo-footnote { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Une interface calme : le mauve identifie la théorie sans remplir l’écran. */
.signature-simple-page .family-picker button {
  border-color: #e2e4e7;
  color: var(--th-navy);
  background: rgba(255,255,255,.9);
  box-shadow: 0 7px 20px rgba(23, 42, 58, .06);
}
.signature-simple-page .family-picker button:hover {
  border-color: #c8b9d8;
  background: #fff;
  box-shadow: 0 9px 24px rgba(23, 42, 58, .09);
}
.signature-simple-page .family-picker button.selected {
  color: var(--th-navy);
  border-color: #bca8d0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(112, 84, 148, .08), 0 10px 26px rgba(23, 42, 58, .09);
}
.signature-simple-page .family-picker button.selected small { color: var(--th-muted); }
.signature-simple-page .family-picker button.selected .family-symbol {
  color: var(--th-green-dark);
  background: #f2edf7;
}

.summary-rule {
  color: var(--th-navy);
  border: 1px solid #e2e3e1;
  background: linear-gradient(180deg, #fff 0%, #f8f8f6 100%);
  box-shadow: 0 8px 24px rgba(23, 42, 58, .06);
}
.summary-signature {
  color: var(--th-green-dark);
  background: #f2edf7;
}
.summary-rule > div:not(.summary-signature) { border-left-color: #dedfe0; }
.summary-rule span:not(.summary-signature span) { color: #766487; }

.memo-family {
  border-color: #e1e2e1;
  box-shadow: 0 10px 26px rgba(23, 42, 58, .055);
}
.memo-family header {
  color: var(--th-navy);
  border-bottom: 1px solid #e4e3e0;
  background: linear-gradient(180deg, #fbfbfa 0%, #f6f6f4 100%);
}
.memo-family header > span {
  color: var(--th-green-dark);
  background: #f2edf7;
  font-family: inherit;
}
.memo-family header h3 { color: var(--th-navy); }
.memo-family header p { color: var(--th-muted); }
.memo-footnote { background: #f6f6f4; }

.signature-big {
  color: var(--th-green-dark);
  border: 1px solid #ded8e4;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 42, 58, .08);
}
.beat-guide {
  border-color: #e0e1df;
  background: #f8f8f6;
}
.conduct-toggle[aria-pressed="true"] { background: #f7f6f4; }
.challenge-visual { background: #f7f6f4; }
.challenge-visual.has-score {
  min-height: 132px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid #e2ddd6;
  background: #fbfbfa;
  font-family: inherit;
}
.challenge-visual.has-score svg { display: block; width: 100%; max-width: 900px; margin-inline: auto; }

/* Les chiffres sont dessinés par VexFlow, comme ceux qui figurent sur la portée. */
.meter-render-host { position: fixed; top: 0; left: -10000px; width: 120px; height: 110px; pointer-events: none; }
.music-meter { line-height: 1; }
.music-meter-svg { display: block; width: 1.15em; height: 1.5em; overflow: visible; font-family: "Bravura", "Academico" !important; font-weight: 400 !important; }
.music-meter-fallback { display: grid; place-items: center; font-family: Georgia, serif; font-weight: 800; line-height: .68; }
.music-meter-fallback span { display: block; }
.meter-mark { font-size: 1.7rem; }
.inline-meter-mark { font-size: 1.25rem; }
.summary-meter-mark { font-size: 2.4rem; }
.challenge-meter-mark { font-size: 3.4rem; }
.answer-meter-mark { font-size: 1.85rem; }
.signature-big { font-size: 1rem; line-height: 1; }
.signature-big .music-meter-svg { width: 58px; height: 72px; }

@media print {
  .summary-rule,
  .memo-family header { color: #111; background: #f5f5f5 !important; }
  .summary-rule span:not(.summary-signature span),
  .memo-family header p { color: #555; }
  .memo-family header h3 { color: #111; }
}

/* La couleur de Théorie reste un repère sur la page des durées. */
.duration-selector button.selected {
  color: var(--th-navy);
  border-color: #bca8d0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(112, 84, 148, .08), 0 9px 22px rgba(23, 42, 58, .08);
}
.duration-selector button.selected .music-glyph { color: var(--th-green-dark); }
.duration-selector button.selected small { color: var(--th-muted); }
.duration-point { border-color: #e0e1df; background: #f8f8f6; }

/* Pulsation et mesure : pages courtes, démonstration centrale, questions musicales. */
.concept-shell { width: min(1040px, 100%); }
.concept-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.concept-lesson {
  padding: clamp(20px, 3.4vw, 34px);
  border: 1px solid var(--th-line);
  border-radius: 24px;
  background: var(--th-paper);
  box-shadow: var(--th-shadow);
}
.concept-heading { max-width: 790px; margin: 0 auto 24px; text-align: center; }
.concept-heading h1,
.concept-quiz h1 { margin: 0; color: var(--th-navy); font-size: clamp(1.75rem, 4vw, 2.55rem); line-height: 1.1; letter-spacing: -.035em; }
.concept-heading > p { margin: 9px 0 0; color: #405a6d; font-size: 1.02rem; line-height: 1.5; }
.three-concepts,
.measure-definition { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 17px; }
.three-concepts article,
.measure-definition article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 150px;
  padding: 16px;
  border: 1px solid #e1ded8;
  border-radius: 17px;
  background: #fff;
}
.three-concepts h2,
.measure-definition h2 { margin: 2px 0 5px; font-size: 1.02rem; }
.three-concepts p,
.measure-definition p { margin: 0; color: #405a6d; font-size: .84rem; line-height: 1.48; }
.concept-symbol,
.measure-icon { display: grid; width: 54px; min-height: 54px; place-items: center; border-radius: 14px; color: var(--th-green-dark); background: #f2edf7; font-family: "Bravura", Georgia, serif; font-size: 1.15rem; font-weight: 800; line-height: .78; text-align: center; }
.pulse-symbol { grid-template-columns: repeat(4, 7px); gap: 4px; }
.pulse-symbol i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rhythm-symbol { font-size: 1.02rem; letter-spacing: -.08em; }
.tempo-symbol { font-size: .86rem; letter-spacing: -.04em; }
.measure-icon { font-family: Georgia, serif; font-size: 1.55rem; line-height: .7; }

.concept-demo { padding: clamp(16px, 2.5vw, 24px); border: 1px solid #dfdcd6; border-radius: 19px; background: #fbfbfa; }
.concept-demo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.concept-demo-head h2 { margin: 0; font-size: clamp(1.18rem, 2.4vw, 1.55rem); letter-spacing: -.02em; }
.concept-tempo { display: grid; flex: 0 0 210px; grid-template-columns: 1fr auto; align-items: center; gap: 5px 10px; color: var(--th-muted); font-size: .69rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.concept-tempo strong { color: var(--th-navy); font-size: .83rem; letter-spacing: 0; }
.concept-tempo input { grid-column: 1 / -1; width: 100%; accent-color: var(--th-green); }
.concept-score,
.concept-question-visual.has-score { position: relative; min-height: 142px; overflow: hidden; border: 1px solid #e4e0da; border-radius: 15px; background: #fff; }
.concept-score svg,
.concept-question-visual.has-score svg { display: block; width: 100%; max-width: 100%; }
.concept-pulse-layer { position: absolute; inset: 0; pointer-events: none; }
.concept-pulse-marker { position: absolute; display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #afbfbe; border-radius: 50%; color: #46606b; background: #fff; font-size: .67rem; font-weight: 900; transform: translateX(-50%); transition: transform .11s ease, color .11s ease, border-color .11s ease, background .11s ease; }
.concept-pulse-marker.is-active { color: #fff; border-color: var(--th-gold); background: var(--th-gold); transform: translateX(-50%) scale(1.25); }
.concept-demo-actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.concept-demo-actions .demo-button { margin: 0; }
.compact-button { min-height: 48px; }
.barline-key { display: inline-flex; align-items: center; gap: 8px; color: var(--th-muted); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.barline-key i { display: block; width: 2px; height: 28px; background: var(--th-coral); }
.measure-score::after,
.barline-question::after { content: ""; position: absolute; top: 35px; bottom: 31px; left: 53.2%; width: 3px; border-radius: 3px; background: rgba(214, 93, 82, .76); pointer-events: none; }
.measure-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.measure-facts p { margin: 0; padding: 13px 15px; border: 1px solid #e4e0da; border-radius: 13px; color: #405a6d; background: #fff; font-size: .83rem; line-height: 1.45; }
.measure-facts strong { color: var(--th-navy); }
.concept-rule { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-top: 13px; padding: 13px 15px; border: 1px solid #dcd7e2; border-radius: 14px; background: #f7f5f8; }
.concept-rule > span { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: #fff; background: var(--th-green); font-weight: 900; }
.concept-rule p { margin: 0; color: #405a6d; font-size: .86rem; line-height: 1.45; }
.concept-rule a { color: var(--th-green-dark); font-size: .8rem; font-weight: 850; white-space: nowrap; }
.concept-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.concept-question-visual { width: min(880px, 100%); min-height: 120px; margin: 0 auto 18px; }
.concept-question-visual.has-score { min-height: 142px; }
.listening-visual { display: grid; gap: 12px; place-items: center; padding: 16px; border: 1px solid #e1ded8; border-radius: 15px; background: #fbfbfa; }
.listening-visual .demo-button { margin: 0; }
.audio-passes { display: grid; width: min(560px, 100%); grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 9px; color: var(--th-muted); font-size: .72rem; font-weight: 800; }
.audio-passes i { display: block; height: 7px; overflow: hidden; border-radius: 99px; background: #dedbd6; }
.audio-passes i.active { background: linear-gradient(90deg, var(--th-green), #c8b8d9); }
.cycle-animation { display: grid; width: min(620px, 100%); grid-template-columns: repeat(2, 1fr); gap: 11px; }
.cycle-pass { padding: 12px; border: 1px solid #dedbd6; border-radius: 12px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.cycle-pass span { display: block; margin-bottom: 9px; color: var(--th-muted); font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.cycle-pass::after { content: ""; display: block; height: 8px; border-radius: 99px; background: #ece9e4; }
.cycle-pass.is-current { border-color: #bca8d0; box-shadow: 0 6px 18px rgba(38, 48, 58, .08); }
.cycle-progress { position: relative; z-index: 1; display: block; height: 8px; margin-bottom: -8px; border-radius: 99px; background: var(--th-green); transition: width .17s linear; }

@media (max-width: 760px) {
  .three-concepts,
  .measure-definition { grid-template-columns: 1fr; }
  .three-concepts article,
  .measure-definition article { min-height: 0; }
  .concept-demo-head { display: grid; }
  .concept-tempo { width: 100%; max-width: 320px; }
  .measure-facts { grid-template-columns: 1fr; }
  .concept-rule { grid-template-columns: 32px 1fr; }
  .concept-rule a { grid-column: 2; }
}

@media (max-width: 540px) {
  .concept-lesson { padding: 15px 12px; }
  .concept-demo { padding: 13px 9px; }
  .concept-demo-actions { display: grid; }
  .concept-demo-actions > * { width: 100%; }
  .concept-actions { display: grid; }
  .concept-actions > * { width: 100%; }
  .audio-passes { grid-template-columns: 1fr 1fr; }
  .audio-passes i { grid-row: 2; }
  .cycle-animation { gap: 7px; }
  .measure-score::after,
  .barline-question::after { display: none; }
}
