/* Boogie-Trainer — im Look des Funkkurses: Papier, Seeblau, Signalrot,
   Glas-Kacheln, Kompassrose. Hell und dunkel, iPad zuerst. */

/* ------------------------------------------------------------- fonts ---- */
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces-var-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("assets/fonts/source-sans-3-var.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("assets/fonts/caveat-var.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* ------------------------------------------------------------ tokens ---- */
:root {
  color-scheme: light dark;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", system-ui, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  --paper: #fbf7ef; --paper-2: #f3ead9; --card: #fffdf8;
  --ink: #1b2b3c; --ink-2: #44546a; --ink-3: #6b7889; --line: #e2d8c5;
  --red: #c8372d; --red-ink: #b02d24; --sea: #1f5f8b; --sea-soft: #e3eef6; --sun: #f2c14e;
  --ok: #2f7d4f; --ok-soft: #e2f1e7; --warn-soft: #fbecd0; --danger-soft: #f8e1de;

  --glas: color-mix(in srgb, var(--card) 22%, transparent);
  --glas-karte: color-mix(in srgb, var(--card) 44%, transparent);
  --glas-dicht: color-mix(in srgb, var(--card) 82%, transparent);
  --haar: color-mix(in srgb, var(--ink) 12%, transparent);
  --haar-2: color-mix(in srgb, var(--ink) 22%, transparent);
  --haar-stark: color-mix(in srgb, var(--ink) 58%, transparent);
  --schatten: 0 6px 20px rgba(10, 30, 60, .05);
  --schatten-hoch: 0 16px 34px rgba(10, 30, 60, .12);
  --glanz: rgba(255, 255, 255, .5);
  --rot-rgb: 205, 70, 62; --orange-rgb: 214, 132, 34; --gruen-rgb: 47, 140, 88; --blau-rgb: 31, 95, 139;
  --akzent: var(--sea); --cta: #c8372d; --fokus: var(--sea);
  --lh: #1f5f8b; --rh: #c8372d;
  --r-kachel: 22px; --r-karte: 24px;
  --feder: cubic-bezier(.2, .9, .3, 1.2);
  --seite: 1120px;
  --rose: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-20 -20 640 640' fill='none' stroke='%23000'%3E%3Ccircle cx='300' cy='300' r='290' stroke-width='1.4'/%3E%3Ccircle cx='300' cy='300' r='250' stroke-width='0.9'/%3E%3Ccircle cx='300' cy='300' r='120' stroke-width='0.7'/%3E%3Cpath d='M300 38L300 16M323.7 29L324.8 17.1M347.2 32.1L349.3 20.3M370.4 37.3L373.5 25.7M393 44.4L397.1 33.1M415 53.5L420 42.6M431 73.1L442 54M456 77.2L462.9 67.4M474.8 91.6L482.6 82.4M492.3 107.7L500.8 99.2M508.4 125.2L517.6 117.4M522.8 144L532.6 137.1M526.9 169L546 158M546.5 185L557.4 180M555.6 207L566.9 202.9M562.7 229.6L574.3 226.5M567.9 252.8L579.7 250.7M571 276.3L582.9 275.2M562 300L584 300M571 323.7L582.9 324.8M567.9 347.2L579.7 349.3M562.7 370.4L574.3 373.5M555.6 393L566.9 397.1M546.5 415L557.4 420M526.9 431L546 442M522.8 456L532.6 462.9M508.4 474.8L517.6 482.6M492.3 492.3L500.8 500.8M474.8 508.4L482.6 517.6M456 522.8L462.9 532.6M431 526.9L442 546M415 546.5L420 557.4M393 555.6L397.1 566.9M370.4 562.7L373.5 574.3M347.2 567.9L349.3 579.7M323.7 571L324.8 582.9M300 562L300 584M276.3 571L275.2 582.9M252.8 567.9L250.7 579.7M229.6 562.7L226.5 574.3M207 555.6L202.9 566.9M185 546.5L180 557.4M169 526.9L158 546M144 522.8L137.1 532.6M125.2 508.4L117.4 517.6M107.7 492.3L99.2 500.8M91.6 474.8L82.4 482.6M77.2 456L67.4 462.9M73.1 431L54 442M53.5 415L42.6 420M44.4 393L33.1 397.1M37.3 370.4L25.7 373.5M32.1 347.2L20.3 349.3M29 323.7L17.1 324.8M38 300L16 300M29 276.3L17.1 275.2M32.1 252.8L20.3 250.7M37.3 229.6L25.7 226.5M44.4 207L33.1 202.9M53.5 185L42.6 180M73.1 169L54 158M77.2 144L67.4 137.1M91.6 125.2L82.4 117.4M107.7 107.7L99.2 99.2M125.2 91.6L117.4 82.4M144 77.2L137.1 67.4M169 73.1L158 54M185 53.5L180 42.6M207 44.4L202.9 33.1M229.6 37.3L226.5 25.7M252.8 32.1L250.7 20.3M276.3 29L275.2 17.1' stroke-width='.8'/%3E%3Cpath d='M300 54L290.2 251L300 300ZM352 174.4L305.9 270.6L300 300ZM431.5 168.5L322.2 266.7L300 300ZM425.6 248L324.9 283.3L300 300ZM546 300L349 290.2L300 300ZM425.6 352L329.4 305.9L300 300ZM431.5 431.5L333.3 322.2L300 300ZM352 425.6L316.7 324.9L300 300ZM300 546L309.8 349L300 300ZM248 425.6L294.1 329.4L300 300ZM168.5 431.5L277.8 333.3L300 300ZM174.4 352L275.1 316.7L300 300ZM54 300L251 309.8L300 300ZM174.4 248L270.6 294.1L300 300ZM168.5 168.5L266.7 277.8L300 300ZM248 174.4L283.3 275.1L300 300Z' fill='%23000' stroke='none'/%3E%3Cpath d='M300 54L309.8 251L300 300M352 174.4L316.7 275.1L300 300M431.5 168.5L333.3 277.8L300 300M425.6 248L329.4 294.1L300 300M546 300L349 309.8L300 300M425.6 352L324.9 316.7L300 300M431.5 431.5L322.2 333.3L300 300M352 425.6L305.9 329.4L300 300M300 546L290.2 349L300 300M248 425.6L283.3 324.9L300 300M168.5 431.5L266.7 322.2L300 300M174.4 352L270.6 305.9L300 300M54 300L251 290.2L300 300M174.4 248L275.1 283.3L300 300M168.5 168.5L277.8 266.7L300 300M248 174.4L294.1 270.6L300 300' stroke-width='1'/%3E%3Cpath d='M300 -6L288 30L300 21L312 30Z' fill='%23000' stroke='none'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1923; --paper-2: #16232f; --card: #182633;
    --ink: #ece4d6; --ink-2: #c3bbad; --ink-3: #8f9aa6; --line: #2a3a49;
    --red: #ef6b5f; --red-ink: #ff8a7f; --sea: #7ab8e3; --sea-soft: #17303f;
    --ok: #6fcf97; --ok-soft: #173327; --warn-soft: #3a2f17; --danger-soft: #3d1f1d;
    --glas: rgba(255, 255, 255, .035);
    --glas-karte: color-mix(in srgb, var(--card) 42%, transparent);
    --glas-dicht: color-mix(in srgb, var(--card) 84%, transparent);
    --haar: rgba(255, 255, 255, .11); --haar-2: rgba(255, 255, 255, .19); --haar-stark: rgba(255, 255, 255, .5);
    --schatten: 0 8px 24px rgba(0, 0, 0, .22); --schatten-hoch: 0 16px 36px rgba(0, 0, 0, .42);
    --glanz: rgba(255, 255, 255, .1);
    --rot-rgb: 232, 100, 92; --orange-rgb: 236, 160, 70; --gruen-rgb: 96, 196, 140; --blau-rgb: 122, 184, 227;
    --cta: #cf4338; --fokus: var(--sun);
    --lh: #7ab8e3; --rh: #ef6b5f;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1923; --paper-2: #16232f; --card: #182633;
  --ink: #ece4d6; --ink-2: #c3bbad; --ink-3: #8f9aa6; --line: #2a3a49;
  --red: #ef6b5f; --red-ink: #ff8a7f; --sea: #7ab8e3; --sea-soft: #17303f;
  --ok: #6fcf97; --ok-soft: #173327; --warn-soft: #3a2f17; --danger-soft: #3d1f1d;
  --glas: rgba(255, 255, 255, .035);
  --glas-karte: color-mix(in srgb, var(--card) 42%, transparent);
  --glas-dicht: color-mix(in srgb, var(--card) 84%, transparent);
  --haar: rgba(255, 255, 255, .11); --haar-2: rgba(255, 255, 255, .19); --haar-stark: rgba(255, 255, 255, .5);
  --schatten: 0 8px 24px rgba(0, 0, 0, .22); --schatten-hoch: 0 16px 36px rgba(0, 0, 0, .42);
  --glanz: rgba(255, 255, 255, .1);
  --rot-rgb: 232, 100, 92; --orange-rgb: 236, 160, 70; --gruen-rgb: 96, 196, 140; --blau-rgb: 122, 184, 227;
  --cta: #cf4338; --fokus: var(--sun);
  --lh: #7ab8e3; --rh: #ef6b5f;
}

/* -------------------------------------------------------------- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh; overflow-x: clip;
  background: var(--paper); color: var(--ink);
  font: 400 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 4% 10%, color-mix(in srgb, var(--sea) 12%, transparent), transparent 62%),
    radial-gradient(55vmax 50vmax at 100% 64%, color-mix(in srgb, var(--sun) 9%, transparent), transparent 62%);
}
body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  top: 150px; left: calc(50% + min(250px, 23vw)); width: min(860px, 125vw); aspect-ratio: 1;
  transform: translateX(-50%); background: var(--ink); opacity: .085;
  -webkit-mask: var(--rose) center / contain no-repeat; mask: var(--rose) center / contain no-repeat;
}
:root[data-theme="dark"] body::after { opacity: .11; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { opacity: .11; } }
body.route-player::after { opacity: 0; }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; font-weight: 650; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--sea); text-underline-offset: .18em; }
a:hover { color: var(--red); }
strong, b { font-weight: 700; }
small { font-size: .86rem; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 3px; }
.leise { color: var(--ink-2); }
.hand-font { font-family: var(--hand); font-weight: 700; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: .5em 1em; border-radius: 12px; background: var(--card); box-shadow: var(--schatten-hoch); }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40; isolation: isolate;
  border-bottom: 1px solid var(--haar);
  padding-top: env(safe-area-inset-top);
}
/* The blur sits on a pseudo layer: a backdrop-filter on .topbar itself would turn it into the
   containing block of the fixed bottom tab bar on phones and pull the bar up to the top. */
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--paper) 74%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.topbar-inner { max-width: var(--seite); margin: 0 auto; padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.12rem; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand b { font-family: var(--serif); font-weight: 800; letter-spacing: -.01em; }
.brand-by { font-family: var(--hand); font-weight: 700; font-size: 1.45rem; color: var(--red); line-height: 1; margin-left: -2px; }
.topnav { margin-left: auto; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); font: 700 .95rem/1 var(--sans);
  transition: box-shadow .15s, background-color .15s, transform .2s var(--feder);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { box-shadow: inset 0 0 0 1px var(--haar-2); background: var(--glas-karte); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="true"] { color: var(--sun); }

/* MIDI-Status: Punkt + Gerät */
.midi-pill {
  --g: 120, 140, 170;
  display: inline-flex; align-items: center; gap: .5em; min-height: 40px; max-width: 240px; padding: .35em .95em .35em .75em; border: 0; border-radius: 999px;
  font: 700 .9rem/1.1 var(--sans); color: var(--ink);
  background: linear-gradient(rgba(var(--g), .12), rgba(var(--g), .12)), var(--glas-karte);
  box-shadow: inset 0 0 0 1.5px rgba(var(--g), .45);
  transition: transform .2s var(--feder), box-shadow .2s;
}
.midi-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.midi-pill .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--g)); }
.midi-pill .pill-ikon { display: none; flex: none; width: 20px; height: 20px; color: var(--ink-2); }
.midi-pill.is-on { --g: var(--gruen-rgb); }
.midi-pill.is-on .dot { box-shadow: 0 0 0 4px rgba(var(--g), .22); }
.midi-pill.is-off { --g: var(--orange-rgb); }
.midi-pill.is-busy .dot { animation: puls 1s ease-in-out infinite; }
.midi-pill:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px rgba(var(--g), .8); }
@keyframes puls { 50% { opacity: .3; } }

/* ------------------------------------------------------ reiter / tabs ---- */
.reiter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.reiter > a, .reiter > button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 42px; padding: .55em 1.05em; border: 0; border-radius: 999px;
  font: 700 .98rem/1.15 var(--sans); color: var(--ink); text-decoration: none; cursor: pointer; opacity: .72;
  background: var(--glas-karte);
  -webkit-backdrop-filter: blur(8px) saturate(160%); backdrop-filter: blur(8px) saturate(160%);
  box-shadow: inset 0 0 0 1.5px var(--haar-2);
  transition: transform .2s var(--feder), box-shadow .2s, background-color .2s, opacity .2s;
}
.reiter svg { width: 18px; height: 18px; flex: none; }
.reiter [aria-current], .reiter [aria-selected="true"], .reiter .ist-aktiv {
  opacity: 1; color: var(--ink);
  background: color-mix(in srgb, var(--akzent) 20%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 68%, transparent);
}
@media (hover: hover) {
  .reiter > a:hover, .reiter > button:hover { opacity: 1; color: var(--ink); transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--haar-stark), 0 10px 22px rgba(10, 30, 60, .1); }
}
@media (max-width: 640px) {
  .reiter-unten {
    position: fixed; z-index: 50; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); flex-wrap: nowrap; gap: 4px; padding: 5px; border-radius: 999px;
    background: var(--glas-dicht);
    -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
    box-shadow: inset 0 0 0 1.5px var(--haar-2), 0 8px 24px rgba(10, 30, 60, .16);
  }
  .reiter-unten > a, .reiter-unten > button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; min-height: 50px; padding: .4em .3em; font-size: .78rem; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; opacity: .66; }
  .reiter-unten svg { width: 22px; height: 22px; }
  body:not(.route-player):not(.route-lesson) { padding-bottom: 84px; }
  body.route-lesson .reiter-unten { display: none; }
  .brand-by { display: none; }
}
/* Top bar on tablets and desktop: at most 1080px wide, so it gives up space step by step
   (tab icons, account name, "mit Max", brand name, pill text) and the five tabs stay on one line. */
@media (min-width: 641px) {
  .topnav { gap: .4rem; }
  .topnav > a { gap: .4em; padding-inline: .95em; }
  .topnav svg, .topbar .konto-name { display: none; }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .brand-by { display: none; }
  .topbar-inner { gap: 10px; }
  .topnav > a { padding-inline: .8em; }
}
@media (min-width: 641px) and (max-width: 920px) {
  .brand b { display: none; }
  .topbar .midi-pill { padding-inline: .75em; }
  .topbar .midi-pill .pill-ikon { display: block; }
  .topbar .midi-pill span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 641px) and (max-width: 760px) {
  .topnav { gap: .25rem; }
  .topnav > a { padding-inline: .65em; font-size: .92rem; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .icon-btn { min-width: 40px; padding-inline: 6px; }
}
@media (max-width: 480px) {
  .brand b { display: none; }
  .topbar-inner { gap: 8px; }
  .topbar .midi-pill { max-width: 46vw; }
}

/* ------------------------------------------------------- bausteine ---- */
.kachel {
  --k: var(--akzent);
  position: relative; display: flex; flex-direction: column; gap: .35rem; min-height: 116px; padding: 1rem 1.05rem; border: 0; border-radius: var(--r-kachel);
  color: var(--ink); text-decoration: none; text-align: left;
  background: var(--glas);
  -webkit-backdrop-filter: blur(1.5px) saturate(170%); backdrop-filter: blur(1.5px) saturate(170%);
  box-shadow: inset 0 0 0 1px var(--haar), var(--schatten);
  transition: transform .22s var(--feder), box-shadow .22s;
}
.kachel:hover { color: var(--ink); transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px var(--haar-stark), var(--schatten-hoch); }
.kachel:active { transform: scale(.975); }
.kachel > svg { width: 24px; height: 24px; opacity: .62; }
.kachel b, .kachel h3 { font: 700 1.06rem/1.25 var(--sans); margin: 0; }
.kachel small { color: var(--ink-2); line-height: 1.4; }
.kachel-voll { background: color-mix(in srgb, var(--k) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--k) 50%, transparent), var(--schatten); }
.kachel-zahl { position: absolute; top: .8rem; right: .9rem; }

.karte {
  padding: 1.3rem 1.4rem; border-radius: var(--r-karte);
  background: var(--glas-karte);
  -webkit-backdrop-filter: blur(3px) saturate(160%); backdrop-filter: blur(3px) saturate(160%);
  box-shadow: inset 0 0 0 1px var(--haar), var(--schatten);
}
.karte-dicht { background: var(--glas-dicht); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }

.knopf {
  --k: var(--akzent);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .8em 1.25em; border: 0; border-radius: 999px;
  font: 700 1rem/1.15 var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap;
  background: var(--glas-karte);
  -webkit-backdrop-filter: blur(8px) saturate(160%); backdrop-filter: blur(8px) saturate(160%);
  box-shadow: inset 0 0 0 1.5px var(--haar-2);
  transition: transform .2s var(--feder), box-shadow .2s, background-color .2s;
}
.knopf svg { width: 18px; height: 18px; flex: none; }
.knopf:hover { color: var(--ink); transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--haar-stark), 0 10px 22px rgba(10, 30, 60, .1); }
.knopf:active { transform: scale(.97); }
.knopf:disabled { opacity: .45; pointer-events: none; }
.knopf-voll { background: color-mix(in srgb, var(--k) 13%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--k) 55%, transparent); }
.knopf-rot { color: #fff; background: var(--cta); box-shadow: 0 6px 16px rgba(var(--rot-rgb), .28); }
.knopf-rot:hover { color: #fff; background: var(--cta); box-shadow: 0 12px 24px rgba(var(--rot-rgb), .36); }
.knopf-klein { min-height: 38px; padding: .5em 1em; font-size: .92rem; }
.knopf-still { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; text-decoration: underline; text-underline-offset: .2em; color: var(--ink-2); padding-inline: .4em; }
.knopf-still:hover { box-shadow: none; color: var(--ink); }
.knopf.pulse { animation: knopf-puls 1.6s ease-in-out infinite; }
@keyframes knopf-puls { 50% { box-shadow: 0 0 0 8px rgba(var(--rot-rgb), .14), 0 6px 16px rgba(var(--rot-rgb), .28); } }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.marke { --g: 120, 140, 170; display: inline-flex; align-items: center; gap: .3em; padding: .22em .65em; border-radius: 999px; font: 700 .8rem/1.2 var(--sans); color: var(--ink); background: rgba(var(--g), .14); box-shadow: inset 0 0 0 1px rgba(var(--g), .5); white-space: nowrap; }
.marke svg { width: 13px; height: 13px; }
.marke-rot { --g: var(--rot-rgb); } .marke-gruen { --g: var(--gruen-rgb); } .marke-orange { --g: var(--orange-rgb); } .marke-blau { --g: var(--blau-rgb); }
.balken { height: 6px; border-radius: 99px; overflow: hidden; background: var(--haar); }
.balken > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--red); transition: width .3s; }
.balken-gruen > i { background: rgb(var(--gruen-rgb)); }
.punkte { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 0; padding: 0; list-style: none; }
.punkte > i { display: block; width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--haar-2); transition: background-color .2s, box-shadow .2s, transform .2s; }
.punkte > .ok { background: rgb(var(--gruen-rgb)); box-shadow: none; }
.punkte > .no { background: rgb(var(--rot-rgb)); box-shadow: none; }
.punkte > .teil { background: rgb(var(--orange-rgb)); box-shadow: none; }
.punkte > .voll { background: var(--ink-2); box-shadow: none; }
.punkte > .jetzt { box-shadow: inset 0 0 0 2px var(--ink); transform: scale(1.2); }
.hinweis { --g: 120, 140, 170; margin: 0; padding: .75rem 1rem; border-radius: 16px; font-size: .97rem; line-height: 1.45; color: var(--ink); background: linear-gradient(rgba(var(--g), .13), rgba(var(--g), .13)), var(--glas-karte); box-shadow: inset 0 0 0 1.5px rgba(var(--g), .5); }
.hinweis-fehler { --g: var(--rot-rgb); } .hinweis-ok { --g: var(--gruen-rgb); } .hinweis-warn { --g: var(--orange-rgb); }

/* Sterne (Bestwert) */
.sterne { display: inline-flex; gap: 2px; color: var(--haar-2); }
.sterne svg { width: 16px; height: 16px; fill: currentColor; }
.sterne .an { color: var(--sun); }
.sterne-gross svg { width: 54px; height: 54px; }
.sterne-gross { gap: 8px; }
.sterne-gross .an { animation: stern .5s var(--feder) both; filter: drop-shadow(0 4px 10px rgba(242, 193, 78, .45)); }
.sterne-gross .an:nth-child(2) { animation-delay: .15s; }
.sterne-gross .an:nth-child(3) { animation-delay: .3s; }
@keyframes stern { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }

/* Segmentierte Auswahl (Hände, Thema, Sprache) */
.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 999px; background: var(--glas-karte); box-shadow: inset 0 0 0 1.5px var(--haar-2); }
.seg > button { min-height: 40px; min-width: 44px; padding: .35em .95em; border: 0; border-radius: 999px; background: transparent; font: 700 .92rem/1.1 var(--sans); color: var(--ink-2); transition: background-color .15s, color .15s, box-shadow .15s; }
.seg > button:hover { color: var(--ink); }
.seg > button[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--akzent) 20%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 68%, transparent); }
.seg .h-L[aria-pressed="true"] { --akzent: var(--lh); }
.seg .h-R[aria-pressed="true"] { --akzent: var(--rh); }
.seg .h-hoeren { display: inline-flex; align-items: center; gap: .4em; }
.seg .h-hoeren svg { width: 18px; height: 18px; flex: none; }
.seg .h-hoeren[aria-pressed="true"] { --akzent: rgb(var(--orange-rgb)); }

/* Schalter (Checkbox als Toggle) */
.schalter { position: relative; flex: none; width: 46px; height: 28px; margin: 0; appearance: none; -webkit-appearance: none; border-radius: 99px; background: var(--haar-2); cursor: pointer; transition: background-color .2s; }
.schalter::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .22s var(--feder); }
.schalter:checked { background: rgb(var(--gruen-rgb)); }
.schalter:checked::after { transform: translateX(18px); }

/* Schieberegler */
input[type="range"] { width: 100%; accent-color: var(--sea); min-height: 32px; }
select.eingabe, .eingabe { width: 100%; min-height: 46px; padding: .55em .9em; border: 0; border-radius: 14px; font: 400 1rem/1.3 var(--sans); color: var(--ink); background: color-mix(in srgb, var(--paper) 62%, transparent); box-shadow: inset 0 0 0 1.5px var(--haar-2); }
input.eingabe:focus-visible, select.eingabe:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--akzent), 0 0 0 4px color-mix(in srgb, var(--akzent) 22%, transparent); }

/* ------------------------------------------------------------- pages ---- */
main { display: block; }
.view { display: none; }
body.route-home #view-home, body.route-songs #view-songs, body.route-practice #view-practice,
body.route-lesson #view-lesson, body.route-help #view-help, body.route-player #view-player, body.route-notfound #view-notfound,
body.route-zugang #view-zugang, body.route-konto #view-konto, body.route-locked #view-locked, body.route-library #view-library,
body.route-combo #view-combo, body.route-record #view-record { display: block; }
.page { max-width: var(--seite); margin: 0 auto; padding: clamp(1.4rem, 4vw, 3rem) max(20px, env(safe-area-inset-right)) 3rem max(20px, env(safe-area-inset-left)); }
.eyebrow { display: inline-block; margin-bottom: .6rem; font: 700 .82rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.lead { font-size: clamp(1.05rem, 1.7vw, 1.22rem); color: var(--ink-2); max-width: 40em; }
.sektion { margin-top: clamp(2rem, 5vw, 3.2rem); }
.sektion-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sektion-kopf h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.sektion-kopf p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.raster-breit { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* Home */
.hero { display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: italic; font-weight: 650; color: var(--red); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.weiter { display: flex; flex-direction: column; gap: .8rem; }
.weiter .eyebrow { margin: 0; color: var(--ink-3); }
.weiter h3 { margin: 0; font-size: 1.45rem; }
.weiter p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.weiter .knopf-rot { align-self: flex-start; }
.weiter-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.fakten { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 1.2rem 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: .95rem; }
.fakten li { display: flex; align-items: center; gap: .45em; }
.fakten svg { width: 18px; height: 18px; color: var(--sea); }

/* Kapitel + Lektionen */
.kapitel-kopf { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; cursor: pointer; list-style: none; padding: .35rem 0; border-radius: 12px; }
.kapitel-kopf::-webkit-details-marker { display: none; }
.kapitel-kopf h3 { margin: 0; font-size: 1.25rem; }
.kapitel-kopf::after { content: "+"; flex: none; font: 400 1.5rem/1 var(--sans); color: var(--ink-3); transition: transform .2s var(--feder); }
.kapitel[open] > .kapitel-kopf::after { transform: rotate(45deg); }
.kapitel:not([open]) > .kapitel-kopf { margin-bottom: 0; }
.kapitel + .kapitel { margin-top: 1rem; }
.kapitel[open] + .kapitel, .kapitel + .kapitel[open] { margin-top: 1.6rem; }
.kapitel-kopf .balken { flex: 1; max-width: 220px; }
.kapitel-kopf small { color: var(--ink-3); white-space: nowrap; }
@media (max-width: 640px) { .kapitel-kopf .balken { display: none; } .kapitel-kopf h3 { flex: 1; font-size: 1.15rem; } }
.lektion { min-height: 128px; }
.lektion .nr { font: 700 .78rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.lektion .balken { margin-top: auto; }
.lektion.ist-fertig { --k: var(--ok); }
.lektion.ist-gesperrt { opacity: .7; }

/* Stück- und Musterkacheln */
.stueck { min-height: 132px; padding-right: 3.2rem; }
.stueck h3 { font-family: var(--serif); font-weight: 650; font-size: 1.22rem; line-height: 1.2; }
.stueck .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; margin-top: auto; font-size: .85rem; color: var(--ink-3); }
.stueck .fav { position: absolute; top: .55rem; right: .55rem; }
.stueck::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--k); opacity: .85; }
.stueck.hand-L { --k: var(--lh); }
.stueck.hand-R { --k: var(--rh); }
.stueck.hand-B, .stueck.art-song { --k: var(--sun); }
.stueck h3 a { color: inherit; text-decoration: none; }
.stueck h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.stueck h3 a:focus-visible { outline: none; }
.stueck:has(h3 a:focus-visible) { outline: 3px solid var(--fokus); outline-offset: 3px; }
.stueck .fav { z-index: 2; }
.fav { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); transition: transform .2s var(--feder), color .15s; }
.fav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fav[aria-pressed="true"] { color: var(--sun); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav:hover { transform: scale(1.12); color: var(--sun); }
.filter { margin: 0 0 1.4rem; }
.gruppe + .gruppe { margin-top: 2rem; }
.gruppe h3 { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin-bottom: .2rem; }
.gruppe > p { margin: 0 0 .9rem; color: var(--ink-2); font-size: .95rem; max-width: 44em; }
.jam { --k: var(--sun); flex-direction: row; align-items: center; gap: 1.2rem; min-height: 96px; }
.jam > svg { width: 40px; height: 40px; opacity: .8; color: var(--red); }

/* --------------------------------------------------------- stage ---- */
.stage { position: relative; overflow: hidden; border-radius: var(--r-karte); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--haar), var(--schatten); touch-action: none; user-select: none; -webkit-user-select: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.hud-chord, .hud-info {
  display: flex; align-items: baseline; gap: .55rem; padding: .35rem .85rem; border-radius: 16px;
  background: var(--glas-dicht); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--haar);
}
.hud-chord b { font: 800 clamp(1.4rem, 3vw, 2rem)/1.1 var(--serif); }
.hud-chord span { font-size: .9rem; color: var(--ink-3); white-space: nowrap; }
.hud-info { flex-direction: column; align-items: flex-end; gap: 0; padding: .4rem .8rem; font-size: .85rem; line-height: 1.35; color: var(--ink-2); text-align: right; }
.hud-info b { color: var(--ink); font-weight: 700; }
.hud:has(.hud-chord b:empty) .hud-chord { visibility: hidden; }
.hud-info:empty { visibility: hidden; }
.toast {
  position: absolute; left: 50%; top: 64px; z-index: 3; max-width: min(92%, 560px); padding: .6rem 1.1rem; border-radius: 16px;
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none; text-align: center; font-weight: 600; font-size: .98rem; line-height: 1.35;
  background: var(--glas-dicht); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1.5px var(--haar-2), var(--schatten-hoch);
  transition: opacity .25s, transform .3s var(--feder);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .knopf { pointer-events: auto; margin: .4rem auto 0; display: flex; }
.toast.mit-knopf { pointer-events: auto; }
.toast.frei { position: fixed; top: calc(72px + env(safe-area-inset-top)); z-index: 60; }

/* --------------------------------------------------------- player ---- */
body.route-player { overflow: hidden; }
body.route-player .topbar, body.route-player .foot, body.route-player .reiter-unten { display: none; }
body.route-player #view-player { display: flex; }
.player {
  flex-direction: column; height: 100dvh; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.player-head { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.player-titel { flex: 1; min-width: 0; line-height: 1.15; }
.player-titel h1 { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-titel small { display: block; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-head .midi-pill { max-width: 200px; }
@media (max-width: 480px) {
  .player-titel h1 { font-size: 1.15rem; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
}
.player-stage { flex: 1; min-height: 180px; display: flex; }
.player-stage .stage { flex: 1; }

/* Abschnitte + Takte */
.loopbar { display: grid; gap: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: .4em; min-height: 38px; padding: .35em .95em; border: 0; border-radius: 999px;
  font: 700 .9rem/1.1 var(--sans); color: var(--ink-2); background: var(--glas-karte); box-shadow: inset 0 0 0 1.5px var(--haar-2);
  transition: background-color .15s, box-shadow .15s, color .15s;
}
.chip svg { width: 16px; height: 16px; }
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--haar-stark); }
.chip[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--akzent) 20%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 68%, transparent); }
.chip-warn { --akzent: rgb(var(--orange-rgb)); color: var(--ink); background: rgba(var(--orange-rgb), .14); box-shadow: inset 0 0 0 1.5px rgba(var(--orange-rgb), .6); }
.takte { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 4px; scroll-snap-type: x proximity; touch-action: pan-x; }
.takt {
  flex: 1 0 54px; max-width: 110px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 46px; padding: .3em .55em; border: 0; border-radius: 12px;
  text-align: left; background: var(--glas); box-shadow: inset 0 0 0 1px var(--haar); color: var(--ink-3); scroll-snap-align: start;
  transition: background-color .12s, box-shadow .12s, color .12s;
}
.takt i { font: 700 .72rem/1 var(--sans); font-style: normal; }
.takt b { font: 700 .88rem/1.1 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.takt.im-loop { background: color-mix(in srgb, var(--sea) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sea) 55%, transparent); color: var(--ink-2); }
.takt.im-loop b { color: var(--ink); }
.takt.ist-anker { box-shadow: inset 0 0 0 2px var(--sea); }
.takt.ist-jetzt { background: color-mix(in srgb, var(--red) 18%, var(--card)); box-shadow: inset 0 0 0 2px var(--red); color: var(--ink); }
.takt.ist-jetzt b { color: var(--ink); }
.takt.neuer-abschnitt { margin-left: 6px; }
.loop-hint { font-size: .82rem; color: var(--ink-3); margin: 0 4px; }

/* Bedienleiste */
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 14px; padding: 8px 10px; border-radius: 26px; background: var(--glas-dicht); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); box-shadow: inset 0 0 0 1px var(--haar), var(--schatten); }
.ctl-links { justify-self: start; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctl-mitte { display: flex; align-items: center; gap: 12px; }
.ctl-rechts { justify-self: end; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tempo { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glas-karte); box-shadow: inset 0 0 0 1.5px var(--haar-2); }
.rund { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font: 700 1.35rem/1 var(--sans); color: var(--ink); transition: background-color .15s, transform .15s; }
.rund:hover { background: var(--haar); }
.rund:active { transform: scale(.9); }
.tempo output { min-width: 4.4em; text-align: center; line-height: 1; }
.tempo output b { display: block; font: 800 1.25rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.tempo output small { font-size: .7rem; letter-spacing: .08em; color: var(--ink-3); }
.play {
  display: grid; place-items: center; width: 68px; height: 68px; border: 0; border-radius: 50%; color: #fff; background: var(--cta);
  box-shadow: 0 8px 20px rgba(var(--rot-rgb), .34), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .2s var(--feder), box-shadow .2s;
}
.play svg { width: 30px; height: 30px; fill: currentColor; }
.play .ic-pause { display: none; }
.play[aria-pressed="true"] .ic-play { display: none; }
.play[aria-pressed="true"] .ic-pause { display: block; }
.play:hover { transform: scale(1.05); box-shadow: 0 12px 26px rgba(var(--rot-rgb), .42); }
.play:active { transform: scale(.94); }
.umschalter {
  display: inline-flex; align-items: center; gap: .45em; min-height: 44px; padding: .4em .9em; border: 0; border-radius: 999px;
  font: 700 .9rem/1.1 var(--sans); color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1.5px var(--haar-2);
  transition: background-color .15s, box-shadow .15s, color .15s;
}
.umschalter svg { width: 20px; height: 20px; flex: none; }
.umschalter:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--haar-stark); }
.umschalter[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--akzent) 20%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 68%, transparent); }
/* Strictness: one button that cycles Genau, Locker, Nur Rhythmus; the colour says how strict. */
#pl-strict { color: var(--ink); }
#pl-strict[data-level="exact"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rh) 60%, transparent); }
#pl-strict[data-level="loose"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 60%, transparent); }
#pl-strict[data-level="rhythm"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--lh) 60%, transparent); }
@media (max-width: 760px) {
  .player { gap: 8px; }
  .controls { grid-template-columns: 1fr auto; grid-template-areas: "links rechts" "mitte mitte"; border-radius: 22px; }
  .ctl-links { grid-area: links; }
  .ctl-rechts { grid-area: rechts; }
  /* With the strictness button there is not enough room next to the hands: own row. */
  .controls:has(#pl-strict:not([hidden])) { grid-template-columns: 1fr; grid-template-areas: "links" "rechts" "mitte"; }
  .controls:has(#pl-strict:not([hidden])) .ctl-links,
  .controls:has(#pl-strict:not([hidden])) .ctl-rechts { justify-self: center; flex-wrap: nowrap; }
  .ctl-mitte { grid-area: mitte; justify-self: center; }
  .umschalter span { display: none; }
  .umschalter.mit-text span { display: inline; font-size: .82rem; }
  .seg .h-hoeren span { display: none; }
  .umschalter { padding-inline: .7em; }
  /* Label stays readable for screen readers, the keyboard icon says it visually. */
  .player-head .midi-pill span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .player-head .midi-pill { gap: .4em; padding: .35em .75em; }
  .player-head .midi-pill .pill-ikon { display: block; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .loopbar .chips { display: none; }
  .loop-hint { display: none; }
  .play { width: 56px; height: 56px; }
  .controls { padding-block: 5px; }
}

/* -------------------------------------------------------- lessons ---- */
.lektion-kopf { margin-bottom: 1.2rem; }
.zurueck { display: flex; width: fit-content; align-items: center; gap: .25em; margin: 0 0 .7rem -.3rem; padding: .3rem .6rem .3rem .3rem; border-radius: 999px; font-weight: 700; font-size: .95rem; color: var(--ink-2); text-decoration: none; }
.zurueck svg { width: 18px; height: 18px; flex: none; }
.zurueck:hover { color: var(--red); }
.lektion-kopf h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: .6rem; }
.schritte { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.schritte a {
  display: inline-flex; align-items: center; gap: .35em; min-height: 36px; padding: .3em .8em; border-radius: 999px; text-decoration: none;
  font: 700 .85rem/1.1 var(--sans); color: var(--ink-2); background: var(--glas-karte); box-shadow: inset 0 0 0 1.5px var(--haar-2);
}
.schritte a svg { width: 14px; height: 14px; color: rgb(var(--gruen-rgb)); }
.schritte a[aria-current] { color: var(--ink); background: color-mix(in srgb, var(--akzent) 20%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 68%, transparent); }
.schritte a.fertig { color: var(--ink); }
@media (max-width: 640px) {
  /* Lesson steps: one swipeable row instead of a block of chips */
  .schritte { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding: 3px 20px 6px; scrollbar-width: none; scroll-padding-inline: 20px; }
  .schritte::-webkit-scrollbar { display: none; }
  .schritte li { flex: none; }
}
.schritt { display: grid; gap: 1.2rem; }
.schritt h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0; }
.prosa { max-width: 42em; font-size: 1.05rem; }
.prosa p:last-child { margin-bottom: 0; }
.tipps { margin: 0; padding: 1rem 1.2rem 1rem 2.4rem; border-radius: 18px; background: color-mix(in srgb, var(--sun) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sun) 45%, transparent); font-size: .98rem; }
.tipps h3 { margin: 0 0 .3rem -1.2rem; font: 700 .82rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.tipps li + li { margin-top: .3rem; }
.ziel { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .85rem 1.1rem; border-radius: 18px; background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar); }
.ziel > svg { width: 22px; height: 22px; color: var(--sea); flex: none; }
.ziel-text { flex: 1 1 240px; }
.ziel-text small { display: block; font: 700 .75rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ziel-check { display: none; color: rgb(var(--gruen-rgb)); font-weight: 700; }
.ziel.erreicht { background: color-mix(in srgb, var(--ok) 14%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 50%, transparent); }
.ziel.erreicht .ziel-check { display: inline-flex; align-items: center; gap: .3em; }
.ziel.erreicht > svg { color: rgb(var(--gruen-rgb)); }
.meta-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.lektion-buehne { height: clamp(280px, 56vh, 600px); display: flex; }
.lektion-buehne .stage { flex: 1; }
.schritt-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.schritt-fuss .mitte { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.schritt-hinweis { width: 100%; text-align: center; color: var(--ink-3); font-size: .85rem; margin: 0; }
.banner { margin: 0; }
.banner:empty { display: none; }
.gesperrt { text-align: center; max-width: 34em; margin: 2rem auto; }
.gesperrt > svg { width: 40px; height: 40px; color: var(--ink-3); }
.stueck.ist-gesperrt h3 a { color: var(--ink-2); }
.marke-schloss { --g: var(--orange-rgb); }

/* ---------------------------------------------- Zugang, Konto, Schloss ---- */
.gesperrt-seite { display: grid; gap: clamp(1rem, 3vw, 2rem); grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.gesperrt-seite .gesperrt { margin: clamp(.5rem, 3vw, 2.5rem) 0 0; text-align: left; }
.gesperrt-seite .gesperrt .knopfreihe { justify-content: flex-start !important; }
.gesperrt-seite:has(> :only-child) { grid-template-columns: 1fr; }
.gesperrt-seite:has(> :only-child) .gesperrt { margin-inline: auto; text-align: center; }
.gesperrt-seite:has(> :only-child) .gesperrt .knopfreihe { justify-content: center !important; }

.zugang { display: grid; gap: clamp(1rem, 3vw, 2rem); grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.zugang-form { display: grid; gap: .9rem; padding: clamp(1.3rem, 3vw, 2rem); }
.zugang-form h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.zugang-form .lead { margin: 0; }
.zugang-form .seg { justify-self: start; }
.zugang-form form { display: grid; gap: .95rem; }
.zugang-form form .knopf { justify-self: start; }
.zugang-form .leise { margin: 0; }
.seg > a { display: inline-flex; align-items: center; min-height: 40px; padding: .35em 1em; border-radius: 999px; font: 700 .92rem/1.1 var(--sans); color: var(--ink-2); text-decoration: none; }
.seg > a:hover { color: var(--ink); }
.seg > a[aria-selected="true"] { color: var(--ink); background: color-mix(in srgb, var(--akzent) 20%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 68%, transparent); }
input.eingabe { -webkit-appearance: none; appearance: none; font-size: max(16px, 1rem); }
input.eingabe::placeholder { color: var(--ink-3); opacity: .7; }
form [hidden] { display: none !important; }
form.arbeitet .knopf[type="submit"] { opacity: .6; pointer-events: none; }

.preis { display: grid; gap: .8rem; padding: clamp(1.3rem, 3vw, 1.8rem); position: relative; }
.preis .eyebrow { margin: 0; }
.preis p { margin: 0; }
.preis-zahl { font: 800 clamp(2.2rem, 5vw, 3rem)/1 var(--serif); letter-spacing: -.02em; }
.preis-wort { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.preis-note { color: var(--ink-2); font-size: .95rem; }
.preis .knopf { justify-self: start; }
.haken { display: grid; gap: .5rem; margin: .2rem 0; padding: 0; list-style: none; }
.haken li { display: flex; gap: .55rem; align-items: flex-start; line-height: 1.4; }
.haken svg { flex: none; width: 18px; height: 18px; margin-top: .15em; color: rgb(var(--gruen-rgb)); }
.doodle { font-family: var(--hand); font-weight: 700; font-size: 1.45rem; line-height: 1; color: var(--red); transform: rotate(-3deg); transform-origin: left; margin: -.1rem 0 0 .3rem !important; }
.preis-code { border-top: 1px solid var(--haar); padding-top: .8rem; }

.freischalten { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: clamp(1.2rem, 3vw, 1.8rem); background: linear-gradient(120deg, rgba(var(--rot-rgb), .1), rgba(var(--blau-rgb), .08)), var(--glas-karte); }
.freischalten > div:first-child { flex: 1 1 22rem; }
.freischalten h2 { margin: 0 0 .3rem; font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.freischalten p { margin: 0; color: var(--ink-2); }
.freischalten .eyebrow { display: inline-flex; align-items: center; gap: .4em; }
.freischalten .eyebrow svg { width: 15px; height: 15px; }

/* The full version on the home page: what is in it, and the price on its own card. */
.freischalten .haken { margin-top: .9rem; }
.freischalten .haken li { color: var(--ink); }
.freischalten-preis { flex: 0 1 17rem; display: grid; gap: .55rem; justify-items: start; padding: 1.2rem 1.4rem; border-radius: 18px; background: var(--glas-dicht); box-shadow: inset 0 0 0 1px var(--haar), var(--schatten); }
.freischalten-preis .preis-zahl { margin: 0; color: var(--ink); }
.freischalten-preis .preis-note { margin: -.2rem 0 .4rem; }
.freischalten-preis .knopf-still { padding-inline: 0; }
.preis-frei { margin: .3rem 0 0; font-size: .9rem; line-height: 1.45; color: var(--ink-3); }

/* ---------- "Hör mal rein": a real piece as a piano roll, on a dark piano-black stage ---------- */
.buehne {
  --b-lh: #7ab8e3; --b-rh: #ef6b5f; --b-kopf: #f2c14e;
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.6fr); align-items: center; gap: clamp(1rem, 3vw, 2.2rem);
  margin-top: clamp(1.8rem, 4vw, 2.6rem); padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: var(--r-karte); color: #ece4d6;
  background:
    radial-gradient(110% 140% at 0% 0%, rgba(122, 184, 227, .17), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(239, 107, 95, .15), transparent 60%),
    linear-gradient(160deg, #1a2430, #0f161e 58%, #15111a);
  box-shadow: 0 26px 54px rgba(10, 20, 35, .26), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.buehne-text .eyebrow { display: inline-flex; align-items: center; gap: .45em; margin: 0 0 .55rem; color: var(--b-kopf); }
.buehne-text .eyebrow svg { width: 17px; height: 17px; }
.buehne h2 { margin: 0 0 .55rem; color: #fffaf0; font-size: clamp(1.5rem, 2.8vw, 2.15rem); }
.buehne-text > p { margin: 0 0 1.15rem; color: #c3bbad; font-size: 1rem; line-height: 1.55; }
.buehne .knopf-rot { box-shadow: 0 10px 26px rgba(200, 55, 45, .45); }
.buehne-legende { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 1.1rem 0 0 !important; color: #8f9aa6; font-size: .86rem !important; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.punkt-lh { background: var(--b-lh); }
.punkt-rh { background: var(--b-rh); margin-left: .7rem; }
.buehne-rolle { padding: .7rem .8rem .55rem .55rem; border-radius: 16px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 10px 30px rgba(0, 0, 0, .25); }
.rolle { display: block; width: 100%; height: auto; overflow: visible; }
.rolle-spur { fill: rgba(255, 255, 255, .035); }
.rolle-schlag { stroke: rgba(255, 255, 255, .055); stroke-width: 1; }
.rolle-takt { stroke: rgba(255, 255, 255, .17); stroke-width: 1.2; }
.rolle-akkord { fill: #c3bbad; font: 700 17px var(--sans); letter-spacing: .03em; }
.taste-weiss { fill: #efe8dc; }
.taste-schwarz { fill: #161b22; }
.taste-fuge { stroke: rgba(0, 0, 0, .28); stroke-width: .8; }
.taste-c { fill: #6b7889; font: 700 9px var(--sans); }
.note { opacity: .8; stroke: rgba(255, 255, 255, 0); stroke-width: 1.6; }
.note-lh { fill: var(--b-lh); }
.note-rh { fill: var(--b-rh); }
.rolle-kopf { stroke: var(--b-kopf); stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(242, 193, 78, .85)); }
@media (prefers-reduced-motion: no-preference) {
  .rolle-kopf { animation: rolle-lauf var(--takt) linear infinite; }
  .note { animation: rolle-blitz var(--takt) linear infinite; }
}
@media (prefers-reduced-motion: reduce) { .rolle-kopf { opacity: 0; } .note { opacity: .95; } }
@keyframes rolle-lauf { from { transform: translateX(0); } to { transform: translateX(var(--lauf, 716px)); } }
@keyframes rolle-blitz {
  0% { opacity: 1; stroke: rgba(255, 255, 255, .95); }
  9% { opacity: .8; stroke: rgba(255, 255, 255, 0); }
  100% { opacity: .8; stroke: rgba(255, 255, 255, 0); }
}

/* ---------- The greats: each one a 78 rpm record with a coloured label ---------- */
.yt-link { display: inline-flex; width: fit-content; max-width: 100%; align-self: flex-start; align-items: center; gap: .5em; margin: .2rem 0 1rem; padding: .45em .9em .45em .7em; border-radius: 999px; background: var(--paper-2, rgba(0,0,0,.04)); border: 1px solid var(--line); color: var(--ink); font-weight: 650; font-size: .95rem; text-decoration: none; }
.yt-link svg { width: 1.35em; height: 1.35em; color: #e0322b; flex: none; }
.yt-link:hover { border-color: currentColor; }
.yt-link:focus-visible { outline: 3px solid var(--focus, #2f6fdf); outline-offset: 2px; }
.legenden-raster { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.legende {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.05rem 1.15rem; border-radius: var(--r-kachel);
  background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar), var(--schatten);
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  color: var(--ink); text-decoration: none; transition: transform .25s var(--feder), box-shadow .2s;
}
.legende:hover { color: var(--ink); transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px var(--haar-stark), var(--schatten-hoch); }
.legende:hover .legende-mono { transform: rotate(40deg); }
.legende-mono {
  --label: var(--red);
  flex: none; display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%;
  font: italic 750 .9rem/1 var(--serif); color: #fffaf0; letter-spacing: .02em;
  background:
    radial-gradient(circle, rgba(0, 0, 0, .55) 0 5%, var(--label) 6% 40%, #0c0c0c 41% 44%, transparent 45%),
    repeating-radial-gradient(circle, #1d1d1f 0 1px, #0f0f10 1px 2.6px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 6px 14px rgba(0, 0, 0, .25);
  transition: transform .6s var(--feder);
}
.legende:nth-child(4n+2) .legende-mono { --label: #c9861f; }
.legende:nth-child(4n+3) .legende-mono { --label: #1f5f8b; }
.legende:nth-child(4n+4) .legende-mono { --label: #2f7d4f; }
.legende-text { display: grid; gap: .1rem; min-width: 0; }
.legende-text b { font: 700 1.1rem/1.2 var(--serif); }
.legende-jahre { color: var(--ink-3); font-size: .82rem; font-variant-numeric: tabular-nums; }
.legende-text > span:not(.legende-hoeren) { margin-top: .3rem; color: var(--ink-2); font-size: .94rem; line-height: 1.45; }
.legende-hoeren { margin-top: .5rem; color: var(--red-ink); font-size: .88rem; font-weight: 700; }
.legende-hoeren i { font-family: var(--serif); font-weight: 600; }
@media (max-width: 760px) {
  .buehne { grid-template-columns: 1fr; gap: 1.1rem; padding: 1.1rem; }
  .buehne-rolle { order: -1; padding: .45rem .5rem .4rem .35rem; }
  .freischalten-preis { flex-basis: 100%; }
}

.konto { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-top: 1.4rem; align-items: start; }
.konto-teil { display: grid; gap: .75rem; }
.konto-teil h2 { display: flex; align-items: center; gap: .45em; margin: 0; font-size: 1.3rem; }
.konto-teil h2 svg { width: 20px; height: 20px; color: var(--ink-3); }
.konto-teil p { margin: 0; color: var(--ink-2); }
.konto-teil form { display: grid; gap: .8rem; }
.konto-teil form .knopf { justify-self: start; }
.konto-wichtig { box-shadow: inset 0 0 0 2px rgba(var(--orange-rgb), .7), var(--schatten); }
.konto-sync { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; color: var(--ink-3); font-size: .95rem; margin: .4rem 0 0; }
.zeile-check { display: flex; align-items: flex-start; gap: .6rem; font-weight: 600; cursor: pointer; }
.zeile-check input { flex: none; width: 20px; height: 20px; margin-top: .1em; accent-color: var(--cta); }
.knopf-gefahr { color: rgb(var(--rot-rgb)); box-shadow: inset 0 0 0 1.5px rgba(var(--rot-rgb), .6); }
.knopf-gefahr:hover { color: #fff; background: var(--cta); }

.konto-link { display: inline-flex; align-items: center; width: auto; gap: .4rem; padding-inline: .55rem; text-decoration: none; color: var(--ink-2); }
.konto-link[hidden] { display: none; }
.konto-link.ist-angemeldet { position: relative; color: var(--ink); }
.konto-link.ist-angemeldet::after { content: ""; position: absolute; right: 9px; bottom: 9px; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--gruen-rgb)); box-shadow: 0 0 0 2px var(--paper); }
.konto-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 .9rem/1 var(--sans); }
.konto-name:empty { display: none; }
@media (max-width: 720px) { .konto-name { display: none; } }

@media (max-width: 820px) {
  .zugang, .gesperrt-seite { grid-template-columns: 1fr; }
  .gesperrt-seite .gesperrt { text-align: center; margin-inline: auto; }
  .gesperrt-seite .gesperrt .knopfreihe { justify-content: center !important; }
}

/* Figuren in den Lektionen */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.fig { margin: 0; padding: 1rem 1.1rem .9rem; border-radius: 20px; background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar); }
.fig.fig-pattern, .fig.fig-hands { grid-column: 1 / -1; }
.fig h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 .8rem; font: 700 .78rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.fig-sub { font-size: .86rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.fig-svg { display: block; width: 100%; height: auto; font-family: var(--sans); }
.fig-grid12 .fig-svg { max-width: 560px; }
.fig-scale .fig-svg { max-width: 480px; }
.fig-swing .fig-svg { max-width: 520px; }
.roll-row { display: flex; flex-wrap: wrap; gap: 14px; }
.roll-bar, .hands-bar { flex: 1 1 260px; margin: 0; min-width: 0; }
.roll-bar figcaption, .hands-bar figcaption { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: .8rem; color: var(--ink-3); }
.roll-bar figcaption b, .hands-bar figcaption b { color: var(--ink); font-weight: 700; }
.roll-bar figcaption span { font: 700 1.1rem/1 var(--serif); color: var(--ink); }
.fill-L { fill: var(--lh); }
.fill-R { fill: var(--rh); }
.g12 rect { fill: var(--glas-karte); stroke: var(--haar-2); stroke-width: 1; }
.g12-I rect { fill: color-mix(in srgb, var(--sea) 14%, transparent); stroke: color-mix(in srgb, var(--sea) 50%, transparent); }
.g12-IV rect { fill: color-mix(in srgb, var(--sun) 20%, transparent); stroke: color-mix(in srgb, var(--sun) 70%, transparent); }
.g12-V rect { fill: color-mix(in srgb, var(--red) 13%, transparent); stroke: color-mix(in srgb, var(--red) 50%, transparent); }
.g12-hl rect { stroke: var(--red); stroke-width: 2.5; }
.g12-n { fill: var(--ink-3); font-size: 11px; font-weight: 600; }
.g12-deg { fill: var(--ink); font-family: var(--serif); font-size: 30px; font-weight: 700; }
.g12-chord { fill: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.roll-black { fill: var(--haar); }
.roll-beat { stroke: var(--haar-2); stroke-width: 1; }
.roll-eighth { stroke: var(--haar); stroke-width: 1; stroke-dasharray: 2 3; }
.roll-count { fill: var(--ink-2); font-size: 10.5px; font-weight: 700; }
.roll-count.off { fill: var(--ink-3); font-weight: 500; }
.roll-name { fill: #fff; font-size: 9.5px; font-weight: 750; pointer-events: none; }
:root[data-theme="dark"] .roll-name { fill: #0f1923; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .roll-name { fill: #0f1923; } }
.lane { stroke: var(--haar-2); stroke-width: 1; }
.lane-label { fill: var(--ink-3); font-size: 11px; font-weight: 700; }
.lane-label.r { fill: var(--rh); }
.lane-label.l { fill: var(--lh); }
.together { stroke: var(--sun); stroke-width: 1.5; stroke-dasharray: 2 3; }
.fig-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: .8rem; color: var(--ink-3); flex-basis: 100%; }
.lg { display: inline-block; width: 14px; height: 8px; border-radius: 4px; vertical-align: middle; }
.lg-l { background: var(--lh); }
.lg-r { background: var(--rh); }
.lg-t { width: 2px; height: 12px; border-left: 2px dashed var(--sun); border-radius: 0; }
.key-w { fill: var(--card); stroke: var(--haar-stark); stroke-width: 1; }
.key-w.on { fill: color-mix(in srgb, var(--sun) 55%, var(--card)); }
.key-b { fill: var(--ink); stroke: var(--ink); }
.key-b.on { fill: color-mix(in srgb, var(--sun) 60%, #6b4a10); }
.key-name { fill: var(--ink); font-size: 13px; font-weight: 750; }
.key-name.b { fill: #fff; font-size: 11px; }
.key-deg { fill: var(--ink-3); font-size: 11.5px; font-weight: 700; }
:root[data-theme="dark"] .key-name.b { fill: #0f1923; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .key-name.b { fill: #0f1923; } }
.sw.on { fill: color-mix(in srgb, var(--sun) 24%, transparent); stroke: color-mix(in srgb, var(--sun) 75%, transparent); }
.sw.off { fill: var(--glas-karte); stroke: var(--haar-2); }
.sw-t { fill: var(--ink); font-size: 12px; font-weight: 700; }
.sw-note { fill: var(--ink-3); font-size: 11px; }

/* ----------------------------------------------------------- help ---- */
.faq { display: grid; gap: 10px; max-width: 46em; }
.hilfe-credits { margin-top: 2rem; max-width: 46em; font-size: .85rem; }
.hilfe-credits a { color: var(--ink-3); text-decoration: none; }
.hilfe-credits a:hover { text-decoration: underline; }
.faq details { border-radius: 18px; background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--sans); color: var(--ink-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 1.2rem 1.1rem; color: var(--ink-2); }
.faq details > div p:last-child { margin: 0; }
.tasten { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tastenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.tastenliste li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; color: var(--ink-2); }
kbd { display: inline-block; min-width: 1.7em; padding: .1em .45em; border-radius: 7px; font: 700 .85em/1.4 var(--sans); text-align: center; background: var(--card); box-shadow: inset 0 -2px 0 var(--haar-2), inset 0 0 0 1px var(--haar-2); }

/* ---------------------------------------------------------- sheets ---- */
dialog.sheet {
  width: min(560px, 100vw); max-width: 100vw; max-height: min(88dvh, 820px); margin: auto; padding: 0; border: 0; border-radius: 28px;
  color: var(--ink); background: var(--glas-dicht);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 0 0 1px var(--haar-2), 0 30px 80px rgba(0, 0, 0, .28);
  overflow: hidden; overscroll-behavior: contain;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-rein .32s var(--feder); }
dialog.sheet::backdrop { background: rgba(10, 20, 32, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes sheet-rein { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.1rem .4rem 1.5rem; }
.sheet-kopf h2 { margin: 0; font-size: 1.5rem; }
.sheet-inhalt { padding: .4rem 1.5rem 1.5rem; overflow-y: auto; display: grid; gap: 1.1rem; }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; }
.zeile > label, .zeile > span:first-child { font-weight: 600; }
.zeile small { display: block; font-weight: 400; color: var(--ink-3); line-height: 1.35; }
.zeile-stapel { flex-direction: column; align-items: stretch; gap: .55rem; padding-block: .2rem; }
.zeile-stapel .seg { align-self: flex-start; flex-wrap: wrap; }
.feld { display: grid; gap: .4rem; font-weight: 600; }
.feld small { font-weight: 400; color: var(--ink-3); }
.sheet-gruppe { display: grid; gap: .6rem; padding: 1rem 1.1rem; border-radius: 18px; background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar); }
.sheet-gruppe h3 { margin: 0; font: 700 .78rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.sheet-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .92rem; }
.geraete { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.geraet { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 14px; background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar); }
.geraet svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.geraet b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geraet.ist-aktiv { box-shadow: inset 0 0 0 1.5px rgba(var(--gruen-rgb), .7); background: rgba(var(--gruen-rgb), .1); }
.geraet.ist-aktiv svg { color: rgb(var(--gruen-rgb)); }
.plattform { font-size: .95rem; color: var(--ink-2); }
.plattform p { margin: 0 0 .5em; }
.plattform ol { margin: .2em 0 0; padding-left: 1.3em; }
.test-taste { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: 16px; background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar); font-weight: 600; }
.test-taste b { font: 800 1.6rem/1 var(--serif); min-width: 2.2em; text-align: center; }
.test-taste.ok { box-shadow: inset 0 0 0 1.5px rgba(var(--gruen-rgb), .7); }

/* Ergebnis */
.ergebnis { text-align: center; justify-items: center; padding-top: 1.6rem; }
.ergebnis h2 { margin: .2rem 0 0; font-size: clamp(1.7rem, 4vw, 2.2rem); }
.ergebnis > p { margin: 0; color: var(--ink-2); max-width: 30em; }
.ergebnis-zahlen { display: flex; justify-content: center; gap: 1.6rem; flex-wrap: wrap; margin: .2rem 0; }
.ergebnis-zahlen div { display: grid; gap: 2px; }
.ergebnis-zahlen b { font: 800 1.7rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.ergebnis-zahlen small { color: var(--ink-3); font-weight: 600; }
.ergebnis .knopfreihe { justify-content: center; }
.ergebnis .marke { font-size: .9rem; }

/* Onboarding */
.ob .sheet-inhalt { padding-top: 1.6rem; min-height: 340px; align-content: start; }
.ob-slide { display: grid; gap: .8rem; }
.ob-slide h2 { margin: 0; }
.ob-slide p { margin: 0; color: var(--ink-2); }
.ob-bild { display: grid; place-items: center; height: 120px; border-radius: 20px; background: color-mix(in srgb, var(--sea) 10%, transparent); color: var(--sea); }
.ob-bild svg { width: 64px; height: 64px; }
.ob-fuss { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.5rem 1.3rem; }
.ob-fuss .punkte > i.jetzt { background: var(--ink); }

@media (max-width: 640px) {
  dialog.sheet { width: 100vw; margin: auto 0 0; border-radius: 26px 26px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  dialog.sheet[open] { animation: sheet-hoch .34s var(--feder); }
  @keyframes sheet-hoch { from { transform: translateY(40%); opacity: .4; } }
  .sheet-inhalt { padding-inline: 1.15rem; }
  .sheet-kopf { padding-left: 1.15rem; }
}

/* ---------------------------------------------------------- footer ---- */
.foot { max-width: var(--seite); margin: 0 auto; padding: 1.6rem 20px 2.4rem; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; justify-content: space-between; color: var(--ink-3); font-size: .88rem; border-top: 1px solid var(--haar); }
.foot a { color: var(--ink-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
body.route-lesson .foot { display: none; }

/* ------------------------------------------------- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.konto-teil > .knopf { justify-self: start; }
.gesperrt-seite .gesperrt > svg { display: block; margin-bottom: .8rem; }
.gesperrt-seite:has(> :only-child) .gesperrt > svg { margin-inline: auto; }
@media (max-width: 820px) { .gesperrt-seite .gesperrt > svg { margin-inline: auto; } }

/* ------------------------------------- Bibliothek, Aufnahme, Kombi ---- */
.mini-roll, .kachel > .mini-roll { display: block; width: 100%; height: 38px; margin: .35rem 0 .15rem; opacity: 1; border-radius: 8px; background: color-mix(in srgb, var(--k) 8%, transparent); }
.mini-roll rect { fill: var(--k); opacity: .85; }
.mini-roll .takt-linie { stroke: var(--haar-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mini-roll .spur-lh rect { fill: var(--lh); }
.mini-roll .spur-rh rect { fill: var(--rh); }
.mini-roll .spur-linie { stroke: var(--haar); stroke-width: 1; vector-effect: non-scaling-stroke; }
/* The tile keeps room on the right for the star; the preview may use it, it sits below the star. */
.stueck > .mini-roll { width: calc(100% + 3.2rem - 1.05rem); max-width: none; }
.art-kombi .mini-roll { height: 46px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.mini-roll-gross { height: clamp(96px, 18vw, 140px); margin: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--haar); }
.stueck.art-kombi { --k: var(--sun); }
.stueck.eigen h3 { padding-right: 0; }
.eigen-aktionen { position: relative; z-index: 2; display: flex; gap: 4px; margin-top: .15rem; }
.mini-knopf { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--haar); cursor: pointer; transition: color .15s, background-color .15s, box-shadow .15s; }
.mini-knopf svg { width: 17px; height: 17px; }
.mini-knopf:hover { color: var(--ink); background: var(--glas-karte); box-shadow: inset 0 0 0 1.5px var(--haar-stark); }
.mini-knopf[data-delete]:hover { color: rgb(var(--rot-rgb)); box-shadow: inset 0 0 0 1.5px rgba(var(--rot-rgb), .6); }
.umbenennen { position: relative; z-index: 2; display: flex; gap: 6px; align-items: center; }
.umbenennen .eingabe { flex: 1; min-width: 0; min-height: 40px; }
.umbenennen .knopf { flex: none; }
.kachel.wird-umbenannt:hover { transform: none; }
.kachel.wird-umbenannt .eigen-aktionen { display: none; }

.leer { display: grid; gap: .8rem; justify-items: start; padding: 1.1rem 1.2rem; border-radius: var(--r-kachel); box-shadow: inset 0 0 0 1.5px var(--haar-2); border: 0; background: color-mix(in srgb, var(--paper) 30%, transparent); }
.leer p { margin: 0; color: var(--ink-2); max-width: 36em; }
.kachel-neu { align-items: center; justify-content: center; text-align: center; color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1.5px var(--haar-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
.kachel-neu > svg { width: 28px; height: 28px; opacity: .8; }
.kachel-neu:hover { color: var(--ink); background: var(--glas); }

.studio-aktionen { margin-top: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.studio-aktion { min-height: 128px; }
.studio-aktion > svg { color: var(--k); opacity: 1; }
.studio-aktion .marke { align-self: flex-start; margin-top: auto; }
.studio-gesperrt { --g: var(--orange-rgb); display: flex; gap: .6rem; align-items: flex-start; margin-top: 1rem; }
.studio-gesperrt > svg { width: 20px; height: 20px; flex: none; margin-top: .1em; }
.studio-start { display: grid; gap: 1rem; }
.studio-start h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.studio-schritte { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 0; padding: 0; list-style: none; counter-reset: schritt; }
.studio-schritte li { display: flex; gap: .8rem; align-items: flex-start; }
.studio-schritte li > svg { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 14px; color: var(--red); background: color-mix(in srgb, var(--red) 11%, transparent); }
.studio-schritte b { display: block; margin-bottom: .15rem; }
.studio-schritte span { color: var(--ink-2); font-size: .95rem; line-height: 1.45; }

.studio-seite { display: grid; gap: 1.1rem; align-content: start; }
.studio-seite > .zurueck { margin-bottom: -.4rem; }
.studio-kopf h1 { margin-bottom: .35rem; font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.studio-kopf h1::after { content: ""; display: block; width: 46px; height: 5px; margin-top: .55rem; border-radius: 5px; background: var(--k); }
.studio-kopf .lead { margin: 0; }
.studio-kopf .leise { margin: .4rem 0 0; }
.studio-art .seg { flex-wrap: wrap; }
.studio-einstellungen { display: grid; gap: 1rem; }
.einstell-raster { display: grid; gap: 1rem 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); align-items: start; }
.einstell-raster .feld { align-content: start; }
.einstell-raster .seg { justify-self: start; flex-wrap: wrap; }
.feld output { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.feld-wert { margin: 0; padding: .7rem 0; font-weight: 400; color: var(--ink-2); }
.feld-hand { position: relative; padding-left: .8rem; }
.feld-hand::before { content: ""; position: absolute; left: 0; top: .15rem; bottom: .15rem; width: 4px; border-radius: 4px; background: var(--k); }
.feld-name .eingabe { font-size: 1.1rem; font-weight: 600; }

.studio-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.studio-fuss[hidden] { display: none; }
.studio-fuss-kombi { justify-content: space-between; }
.knopf-gross { min-height: 54px; padding: .9em 1.6em; font-size: 1.08rem; }
.knopf-gross svg { width: 20px; height: 20px; }
.rec-knopf { min-width: 13rem; }
.rec-knopf.nimmt-auf { animation: rec-puls 1.2s ease-in-out infinite; }
@keyframes rec-puls { 50% { box-shadow: 0 0 0 10px rgba(var(--rot-rgb), .18), 0 6px 16px rgba(var(--rot-rgb), .3); } }
.rec-status { margin: 0; color: var(--ink-2); font-weight: 600; flex: 1 1 14rem; }
.studio-hinweis { --g: var(--orange-rgb); flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }

.studio-ergebnis:empty { display: none; }
.studio-karte { display: grid; gap: 1rem; }
.studio-karte h2 { margin: 0; }
.studio-karte .sektion-kopf { margin: 0; }
.studio-karte > .leise { margin: 0; }
.takes { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.takes button { flex: none; display: grid; gap: 2px; min-width: 7.5rem; padding: .55rem .8rem; border: 0; border-radius: 14px; text-align: left; color: var(--ink); background: var(--glas-karte); box-shadow: inset 0 0 0 1.5px var(--haar-2); cursor: pointer; font: inherit; }
.takes button small { color: var(--ink-3); font-size: .8rem; }
.takes button[aria-pressed="true"] { background: color-mix(in srgb, var(--akzent) 18%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--akzent) 68%, transparent); }
.studio-karte .zeile { flex-wrap: wrap; }
.studio-karte .zeile .seg { flex-wrap: wrap; }
.speichern { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; padding-top: .9rem; border-top: 1px solid var(--haar); }
.speichern .feld { flex: 1 1 16rem; }
.gespeichert { text-align: center; justify-items: center; }
.gespeichert .eyebrow { display: inline-flex; align-items: center; gap: .35em; margin: 0; color: rgb(var(--gruen-rgb)); }
.gespeichert .eyebrow svg { width: 16px; height: 16px; }
.gespeichert h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); }
.gespeichert > p { margin: 0; color: var(--ink-2); max-width: 32em; }
.gespeichert .knopfreihe { justify-content: center; }

.form-streifen { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.takt { display: grid; gap: 2px; justify-items: center; padding: .55rem .1rem .4rem; border-radius: 10px; background: var(--glas-karte); box-shadow: inset 0 0 0 1px var(--haar); }
.takt b { font: 700 .95rem/1.1 var(--sans); }
.takt small { font-size: .7rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.takt.stufe-IV { background: color-mix(in srgb, var(--sea) 13%, var(--card)); }
.takt.stufe-V { background: color-mix(in srgb, var(--sun) 20%, var(--card)); }
.takt.mit-fill { box-shadow: inset 0 0 0 1.5px var(--rh), inset 0 -4px 0 color-mix(in srgb, var(--rh) 55%, transparent); }
@media (max-width: 640px) {
  .form-streifen { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .studio-fuss-kombi > .knopf, .studio-fuss-kombi .knopfreihe { flex: 1 1 100%; }
  .studio-fuss-kombi .knopfreihe .knopf { flex: 1; }
  .rec-knopf { flex: 1 1 100%; }
  .studio-aktionen { grid-template-columns: 1fr 1fr; }
  .studio-aktion { min-height: 112px; padding: .9rem; }
  .studio-aktion small { font-size: .85rem; }
}
@media (max-width: 400px) {
  .reiter-unten > a, .reiter-unten > button { font-size: .72rem; padding-inline: .15em; }
}

/* Combo editor: further choruses with their own riff. */
.durchgaenge { display: grid; gap: .6rem; margin: 1.2rem 0 0; padding: 1rem 0 0; border: 0; border-top: 1px solid var(--haar); }
.durchgaenge legend { float: left; width: 100%; padding: 0; font: 700 1rem/1.3 var(--sans); color: var(--ink); }
.durchgaenge > .leise { margin: 0 0 .2rem; max-width: 62ch; }
.durchgang { display: flex; align-items: flex-end; gap: .5rem; max-width: 520px; }
.durchgang .feld { flex: 1; }
.durchgang .icon-btn { flex: none; margin-bottom: 2px; }
.durchgang-dazu { justify-self: start; }
