/* Schriften lokal, Herkunft und Lizenz siehe README */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../fonts/fraunces-latin.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 300 900; font-display: swap; src: url('../fonts/fraunces-italic-latin.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../fonts/bricolage-grotesque-latin.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); }

/* Token-System wie Trash Reel, Akzent Bühnenlicht violett.
   Rot ist reserviert für mögliche Probleme im Text, Bernstein für „fällig“. */
:root {
  --bg: #14110d;
  --bg-elevated: #1d1812;
  --bg-card: #221c15;
  --border: #3a3025;
  --border-soft: #2a2218;
  --text: #f3e9d8;
  --text-dim: #a89884;
  --text-faint: #6b5d4a;

  --spot: #a98bff;
  --spot-deep: #7a5ce6;
  --spot-soft: rgba(169, 139, 255, 0.12);
  --spot-glow: rgba(169, 139, 255, 0.4);
  --amber: #e8c547;
  --amber-soft: rgba(232, 197, 71, 0.12);
  --problem: #ff5a4f;
  --problem-soft: rgba(255, 90, 79, 0.12);
  --ok: #7fd18b;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { background: var(--bg); }

body {
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(169, 139, 255, 0.09), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(232, 197, 71, 0.04), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--spot); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--spot);
  outline-offset: 2px;
}

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }
main.container { flex: 1; padding-top: 2.5rem; padding-bottom: 4rem; }

/* Navigation: dünn, auf dem Handy einklappbar */
.nav { border-bottom: 1px solid var(--border-soft); background: rgba(20, 17, 13, 0.85); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; }
.logo { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.6rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--spot); }
.nav-links { display: flex; gap: 0.25rem; align-items: center; list-style: none; }
.nav-links a, .nav-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem; border-radius: 999px; color: var(--text-dim); text-decoration: none; font: 500 0.95rem var(--font-body); background: none; border: 0; cursor: pointer; }
.nav-links a:hover, .nav-links button:hover { color: var(--text); background: var(--spot-soft); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--spot-soft); }
.nav-toggle { display: none; }

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: none; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font: 500 0.9rem var(--font-body); padding: 0 0.9rem; cursor: pointer; }
  .nav .container { flex-wrap: wrap; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 0.75rem; }
  .nav-links.open { display: flex; }
}

/* Überschriften */
.eyebrow { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--spot); margin-bottom: 0.6rem; }
h1 { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1; letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; text-wrap: balance; }
.lead { color: var(--text-dim); margin-top: 0.75rem; max-width: 62ch; }
.page-head { margin-bottom: 2rem; }

/* Karten und Gruppen */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; min-width: 0; }
.card h2 { font-size: 1.25rem; }
.muted { color: var(--text-dim); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0 1.3rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font: 600 0.95rem var(--font-body); text-decoration: none; cursor: pointer; transition: border-color .2s, background .2s; }
.btn:hover { border-color: var(--spot); background: var(--spot-soft); }
.btn-primary { background: var(--spot); border-color: var(--spot); color: #17120c; }
.btn-primary:hover { background: var(--spot-deep); border-color: var(--spot-deep); color: var(--text); }
.btn-danger { border-color: var(--problem); color: var(--problem); background: transparent; }
.btn-danger:hover { background: var(--problem-soft); border-color: var(--problem); }

/* Chips für Zustände */
.chip { display: inline-flex; align-items: center; gap: 0.35rem; font: 500 0.7rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); }
.chip-due { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.chip-ok { color: var(--ok); border-color: var(--ok); }
.chip-problem { color: var(--problem); border-color: var(--problem); background: var(--problem-soft); }

/* Formulare */
label.field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; min-height: 44px; width: 100%;
}
textarea { min-height: 8rem; resize: vertical; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.6; }

/* Mögliches Problem im Text, z. B. nach dem Einfügen */
.problem { background: var(--problem-soft); border-bottom: 2px solid var(--problem); color: var(--text); border-radius: 3px; }
.problem-note { color: var(--problem); font-size: 0.85rem; }

/* Leerer Zustand */
.empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 2rem 1.25rem; text-align: center; color: var(--text-dim); }
.empty strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 0.35rem; }

/* Fuß */
.footer { border-top: 1px solid var(--border-soft); }
.footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1rem; font: 0.75rem var(--font-mono); color: var(--text-faint); }
.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Schmale Spalte für Anmelden und Rechtliches */
.narrow { max-width: 42rem; margin: 0 auto; }
label.check { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; cursor: pointer; }
label.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--spot); }

.legal h2 { font-size: 1.15rem; margin: 1.8rem 0 0.5rem; }
.legal p { margin: 0 0 0.9rem; color: var(--text); max-width: 65ch; }
.legal p b { color: var(--text); }

/* Impressum und Datenschutz fest unten rechts */
.legal-fixed {
  position: fixed; z-index: 20; display: flex; overflow: hidden;
  right: calc(10px + env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
}
.legal-fixed a { font: 500 0.75rem var(--font-body); color: var(--text-dim); text-decoration: none; padding: 0.3rem 0.75rem; }
.legal-fixed a + a { border-left: 1px solid var(--border); }
.legal-fixed a:hover { color: var(--text); background: var(--spot-soft); }
.footer { padding-bottom: 2.5rem; }
.ok-note { color: var(--ok); font-size: 0.9rem; }

/* Suchliste und Fortschrittsbalken */
.probe-status { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.search-row { display: flex; gap: 0.75rem; }
.search-row input { flex: 1; min-width: 0; }
.tracks { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.track { width: 100%; display: flex; align-items: center; gap: 0.8rem; text-align: left; padding: 0.5rem 0.7rem; min-height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); background: var(--bg-elevated); color: var(--text); font: inherit; cursor: pointer; }
.track:hover, .track[aria-current="true"] { border-color: var(--spot); background: var(--spot-soft); }
.track img { border-radius: 6px; flex: none; }
.track-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.track-text span, .track-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); cursor: pointer; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--spot); }
.controls, .loop-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.loop-row .field { width: 7rem; }

/* Allgemein */
[x-cloak] { display: none !important; }
.small { font-size: 0.85rem; }
.btn-small { min-height: 36px; padding: 0 0.9rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.chip-spot { color: var(--spot); border-color: var(--spot); background: var(--spot-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }

/* Song anlegen */
.picked { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.picked img { border-radius: 8px; flex: none; }
.picked .track-text { flex: 1; min-width: 12rem; }
.choice { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.editor { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.editor textarea { min-height: 28rem; }
/* Eigene Scrollfläche nur nebeneinander, untereinander scrollt die Seite */
@media (min-width: 861px) { .preview { max-height: 80vh; overflow-y: auto; } }

.problems { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.problem-card, .hint-card { border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.35rem; }
.problem-card { border: 1px solid var(--problem); background: var(--problem-soft); }
.problem-card > .mono { color: var(--problem); }
.hint-card { border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-dim); }
.excerpt { font: 0.8rem/1.5 var(--font-mono); white-space: pre-wrap; color: var(--problem); text-decoration: line-through; margin: 0; overflow-x: auto; }
.problem-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.sec { display: flex; flex-direction: column; gap: 0.5rem; }
.sec-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sec-lines { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.sec-lines li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0.5rem; line-height: 1.55; }
.ln { color: var(--text-faint); font-size: 0.75rem; text-align: right; padding-top: 0.2rem; }
.sec-repeat { opacity: 0.6; }
.preview .sec + .sec { border-top: 1px solid var(--border-soft); padding-top: 0.75rem; }

.save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; flex-wrap: wrap;
  /* unten Platz für Impressum und Datenschutz, die fest unten rechts stehen */
  padding: 0.75rem 0 calc(2.9rem + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--bg) 25%);
}

/* Songliste */
.song-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.song-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text); text-decoration: none; }
.song-row:hover { border-color: var(--spot); background: var(--spot-soft); }
.song-row img, .cover-blank { width: 48px; height: 48px; border-radius: 6px; flex: none; }
.cover-blank { background: var(--bg-elevated); border: 1px solid var(--border); }

/* Songseite */
.song-head { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.song-head img { border-radius: 10px; flex: none; }
.song-head > div { min-width: 0; flex: 1; }
.danger-zone { border: 1px dashed var(--border); border-radius: var(--radius); padding: 0.9rem 1.1rem; color: var(--text-dim); }
.danger-zone summary { cursor: pointer; min-height: 32px; }
/* Der Verlauf der Leiste darf keine Klicks auf darunterliegende Knöpfe schlucken */
.save-bar { pointer-events: none; }
.save-bar > * { pointer-events: auto; }
.sec-lines.untimed li { grid-template-columns: minmax(0, 1fr); }

/* Markierungen für Gesang und Rap. Keine Reimfarbe ist rot: Rot bleibt für mögliche Probleme. */
:root {
  --rhyme-a: #e8c547; --rhyme-b: #4fd1c5; --rhyme-c: #f78fd0;
  --rhyme-d: #6cb6ff; --rhyme-e: #a3e36b; --rhyme-f: #ffa24c;
}
.stress { font-weight: 800; color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--spot); }
.breath { color: var(--spot); font-weight: 700; font-size: 1.15em; padding: 0 0.1em; }
.rhyme { border-radius: 4px; padding: 0 0.15em; border-bottom: 2px solid; }
.rhyme-a { color: var(--rhyme-a); background: color-mix(in srgb, var(--rhyme-a) 14%, transparent); }
.rhyme-b { color: var(--rhyme-b); background: color-mix(in srgb, var(--rhyme-b) 14%, transparent); }
.rhyme-c { color: var(--rhyme-c); background: color-mix(in srgb, var(--rhyme-c) 14%, transparent); }
.rhyme-d { color: var(--rhyme-d); background: color-mix(in srgb, var(--rhyme-d) 14%, transparent); }
.rhyme-e { color: var(--rhyme-e); background: color-mix(in srgb, var(--rhyme-e) 14%, transparent); }
.rhyme-f { color: var(--rhyme-f); background: color-mix(in srgb, var(--rhyme-f) 14%, transparent); }
.rhyme .stress { color: inherit; }

.mark-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mark-group { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0 0.25rem; }
.swatch { width: 32px; height: 32px; border-radius: 999px; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.swatch:hover { border-color: var(--text); }
.rhyme-swatch-a { background: var(--rhyme-a); } .rhyme-swatch-b { background: var(--rhyme-b); } .rhyme-swatch-c { background: var(--rhyme-c); }
.rhyme-swatch-d { background: var(--rhyme-d); } .rhyme-swatch-e { background: var(--rhyme-e); } .rhyme-swatch-f { background: var(--rhyme-f); }
@media (pointer: coarse) { .swatch { width: 40px; height: 40px; } }

/* Spieler auf der Songseite */
.head-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.chip-btn { cursor: pointer; background: transparent; font: inherit; font-family: var(--font-mono); font-size: 0.7rem; }
.chip-btn:hover { border-color: var(--spot); color: var(--text); }
.sec-actions { margin-left: auto; display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }
.sec-loop-btn[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.sec-current { border-color: var(--spot); }
.sec-loop { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.sec-lines li { border-radius: 6px; padding: 0.05rem 0.3rem; margin: 0 -0.3rem; transition: background .15s; }
.sec-lines li.line-jump { cursor: pointer; }
.sec-lines li.line-jump:hover { background: var(--spot-soft); }
.sec-lines li.line-current { background: var(--spot-soft); }
.sec-lines li.line-current > span:nth-child(2) { color: var(--text); font-weight: 600; }
.sec-lines li.line-next { background: var(--amber-soft); outline: 1px solid var(--amber); }
.sec-lines li.line-tapped .ln { color: var(--ok); }

.player-bar {
  position: sticky; bottom: 0; z-index: 6; margin-top: 0.5rem;
  padding: 0.75rem 0 calc(2.9rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, var(--bg) 18%);
}
.player-inner { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, .6); }
.player-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.player-row .progress { flex: 1; min-width: 8rem; }
.play-btn { min-width: 8.5rem; }
.tap-btn { min-width: 10rem; min-height: 56px; font-size: 1.05rem; }
.kbd { font: 500 0.7rem var(--font-mono); border: 1px solid currentColor; border-radius: 4px; padding: 0 0.3rem; opacity: 0.7; }

/* Üben */
.practice-head .eyebrow a { color: inherit; text-decoration: none; }
.practice-head .eyebrow a:hover { text-decoration: underline; }
.mode-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mode-tab { min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-dim); font: 500 0.92rem var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 0.45rem; }
.mode-tab .mono { font-size: 0.7rem; color: var(--text-faint); }
.mode-tab:hover { border-color: var(--spot); color: var(--text); }
.mode-tab[aria-selected="true"] { background: var(--spot); border-color: var(--spot); color: #17120c; }
.mode-tab[aria-selected="true"] .mono { color: #17120c; }
.practice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.practice-lines { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; font-size: clamp(1.1rem, 2.6vw, 1.4rem); line-height: 1.55; }
.practice-lines li { padding: 0.15rem 0.6rem; margin: 0 -0.6rem; border-radius: 8px; border-left: 3px solid transparent; }
.practice-lines li.line-current { background: var(--spot-soft); }
.practice-lines li.line-stuck { border-left-color: var(--amber); }
.practice-lines li.line-pickable { cursor: pointer; }
.practice-lines li.line-pickable:hover { background: var(--bg-elevated); }
.practice-lines li.line-marked { background: var(--amber-soft); border-left-color: var(--amber); }
.practice-lines li.line-next-hidden { border: 1px dashed var(--border); border-left-width: 1px; font-size: 1rem; }
.practice-lines .blank { color: var(--text-faint); letter-spacing: 0.05em; cursor: pointer; }
.practice-lines .rest { color: var(--text-faint); letter-spacing: 0.05em; }
.practice-lines .blank.rhyme, .practice-lines .rhyme .rest { color: inherit; opacity: 0.6; }
.free-sing { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.5rem 0; }
.free-big { font-family: var(--font-display); font-style: italic; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.rate-sicher { border-color: var(--ok); color: var(--ok); }
.rate-gewackelt { border-color: var(--amber); color: var(--amber); }
.rate-haenger { border-color: var(--text-dim); }
.practice-nav { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }

/* Lernstand */
.due-song-head { display: flex; align-items: center; gap: 0.75rem; }
.due-song-head img { border-radius: 6px; flex: none; }
.due-song-head a { color: var(--text); text-decoration: none; }
.due-song-head a:hover strong { text-decoration: underline; }
.due-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.due-list li { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.due-go { margin-left: auto; }
.due-late { color: var(--amber); }
.due-now { color: var(--amber); }
.level-learned { color: var(--ok); }
.upcoming { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.upcoming li { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.upcoming a { color: var(--text); }
.song-progress { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-end; flex: none; }
.song-progress .bar { width: 6rem; height: 6px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; display: block; }
.song-progress .bar span { display: block; height: 100%; background: var(--ok); }

/* Zeit einer Zeile ändern (Doppelklick) */
.time-edit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .4rem 0 .5rem; cursor: default; }
.time-edit input { width: 7.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Probehören beim Anlegen: links in der Speicherleiste */
.mini-player { display: flex; align-items: center; gap: .4rem; margin-right: auto; flex-wrap: wrap; }

/* Termin eines Abschnitts (Rechtsklick, langes Tippen) */
.sec { position: relative; }
.plan-menu { display: flex; flex-direction: column; gap: .6rem; margin: .5rem 0 .75rem; padding: .8rem .9rem; border: 1px solid var(--spot); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.plan-menu input[type=date] { max-width: 12rem; }
.plan-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.song-plan { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }
.song-plan input[type=date] { width: auto; }

/* Listen */
.list-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.list-filter .chip { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.chip-active { border-color: var(--spot); background: var(--spot-soft); color: var(--text); }
.list-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.list-row .search-row { flex: 1; min-width: 0; }
.list-checks { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }

/* Zweiter Faktor */
.qr { background: #fff; padding: 8px; border-radius: 8px; width: 220px; max-width: 100%; height: auto; }
.recovery-codes { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .35rem 1rem; padding: .75rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.today-block + .today-block { margin-top: 2rem; }
.purpose-pick { border: 1px solid var(--border); }
.purpose-pick legend { padding: 0 .3rem; }
.song-plan select { width: auto; }
.cover-blank { display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); }

/* Eigene Songs: Beat-Leiste und Takte je Zeile */
.beat-row { margin-bottom: .5rem; }
.beat-row select { width: auto; }
.bpm-input { width: 4.5rem; text-align: center; }
.beat-count { min-width: 7rem; color: var(--spot); }
.sec-lines li:has(.bars-chip) { grid-template-columns: 3rem minmax(0, 1fr) auto; }
.bars-chip { font-size: .7rem; border: 1px solid var(--border); background: transparent; color: var(--text-dim); border-radius: 999px; padding: 0 .5rem; min-height: 24px; cursor: pointer; align-self: center; }
.bars-chip:hover { border-color: var(--spot); color: var(--text); }

/* Auswahl, Phrasen, Bedeutungen */
.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.sec-lines li[data-selected="true"] { background: var(--amber-soft); outline: 1px solid var(--amber); }
.selection-bar { position: sticky; bottom: 1rem; z-index: 6; }
.has-player .selection-bar, .has-player .tools-flash { bottom: 6.5rem; }
.has-beat .selection-bar, .has-beat .tools-flash { bottom: 10rem; }
.selection-inner { border: 1px solid var(--amber); background: var(--bg-elevated); border-radius: var(--radius-sm); padding: .7rem .9rem; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
.phrase-form select { width: auto; }
.tools-flash { position: sticky; bottom: 1rem; z-index: 6; }
mark.phrase { background: transparent; color: inherit; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; }
.sec-note { margin-top: .75rem; border-top: 1px solid var(--border-soft); padding-top: .6rem; }
.sec-note summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; min-height: 32px; }
.sec-note-body { margin-top: .5rem; }
.note-view { display: grid; gap: .25rem; }
.note-view dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-top: .4rem; }
.note-view dd { margin: 0; white-space: pre-line; }
.suggestions { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.suggestions li { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.phrase-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.phrase-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.phrase-head .btn { margin-left: auto; }
.phrase-text { font-size: 1.1rem; }
.occurrences { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.phrase-list select { width: auto; }
.review-front { font-family: var(--font-display); font-style: italic; font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.2; }
.review-back { font-size: 1.2rem; border-top: 1px solid var(--border-soft); padding-top: .75rem; }
/* Ausschnitt in Schleife ohne Text: nur hören */
.text-hidden .sec-lines li > span:nth-child(2) { filter: blur(7px); user-select: none; }
.loop-row { margin-bottom: .5rem; }

/* Diktat */
.dictation-result li { line-height: 1.9; }
.d-ok { color: var(--ok); }
.d-wrong { color: var(--problem); }
.d-wrong s { color: var(--text-faint); font-size: .85em; }
.d-missing { color: var(--amber); text-decoration: underline dotted; }

/* Kontextmenü (Rechtsklick, langes Tippen) */
.ctx-menu { position: fixed; z-index: 50; min-width: 15rem; max-width: calc(100vw - 16px); padding: .35rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); box-shadow: 0 12px 32px rgb(0 0 0 / .35); }
.ctx-menu button[role=menuitem]:not(.swatch), .ctx-menu a[role=menuitem] { display: flex; align-items: center; gap: .4rem; width: 100%; min-height: 36px; padding: .3rem .6rem; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.ctx-menu button[role=menuitem]:not(.swatch):hover, .ctx-menu button[role=menuitem]:not(.swatch):focus-visible, .ctx-menu a[role=menuitem]:hover { background: var(--spot-soft); }
.ctx-head { padding: .3rem .6rem .2rem; color: var(--text-faint); }
.ctx-word { border-top: 1px solid var(--border-soft); margin-top: .3rem; padding-top: .2rem; }
.ctx-swatches { display: flex; gap: .35rem; padding: .3rem .6rem; }
.ctx-menu [aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--spot); }
/* Langes Tippen soll das Menü öffnen, nicht die Vorschau des Browsers */
.sec-lines li[data-line], .song-row { -webkit-touch-callout: none; }
/* Zeilennummern statt Zeiten */
.show-n .sec-lines .ln { font-size: 0; }
.show-n .sec-lines .ln::before { content: attr(data-n); font-size: .75rem; }
.line-flash { animation: line-flash 1.8s ease-out; }
@keyframes line-flash { from { background: var(--amber-soft); outline: 1px solid var(--amber); } to { background: transparent; outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .line-flash { animation: none; background: var(--amber-soft); } }
a.zref { font-family: var(--font-mono); font-size: .9em; }
/* Untermenü „Zur Liste hinzufügen ›“ */
.ctx-sub { position: relative; }
.ctx-arrow { margin-left: auto; color: var(--text-faint); }
.ctx-submenu { position: absolute; top: -.35rem; left: calc(100% + .2rem); min-width: 13rem; }
.ctx-submenu.ctx-left { left: auto; right: calc(100% + .2rem); }
.ctx-menu button[role=menuitemcheckbox] { display: flex; align-items: center; gap: .4rem; width: 100%; min-height: 36px; padding: .3rem .6rem; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ctx-menu button[role=menuitemcheckbox]:hover { background: var(--spot-soft); }
.list-flash { list-style: none; position: sticky; bottom: 1rem; }
/* Schmale Bildschirme: Untermenü unter dem Eintrag statt daneben */
@media (max-width: 560px) {
  .ctx-submenu, .ctx-submenu.ctx-left { position: static; box-shadow: none; border: 0; padding: 0 0 0 .8rem; min-width: 0; }
}
