/* Haiku Lines Web (SYS-114 Paket P). Farben wie die App (Pflaume), hell und dunkel. */
:root {
  --grund: #fbf8fa; --flaeche: #ffffff; --flaeche2: #f3edf1; --text: #1f1a1d; --blass: #6e6369; --linie: #e3d9df;
  --primaer: #7a1f4f; --primaer-text: #ffffff; --gelb: #ffe066; --rb: rgba(122, 31, 79, .65); --mark: rgba(122, 31, 79, .28);
  --f1: #F5B942; --f2: #8FD0F5; --f3: #5CCFA8; --f4: #8FA3F0; --f5: #F09A70; --f6: #E0A3C8;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #161214; --flaeche: #1f1a1d; --flaeche2: #2a2327; --text: #efe6ea; --blass: #a99ca3; --linie: #3a3035;
    --primaer: #e8a3c6; --primaer-text: #2b0a1b; --gelb: #8a7220; --rb: rgba(232, 163, 198, .8); --mark: rgba(232, 163, 198, .3);
    --f1: rgba(245, 185, 66, .5); --f2: rgba(143, 208, 245, .45); --f3: rgba(92, 207, 168, .45);
    --f4: rgba(143, 163, 240, .5); --f5: rgba(240, 154, 112, .5); --f6: rgba(224, 163, 200, .5);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--grund); color: var(--text); font-family: var(--schrift); display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#kopf { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
#kopf h1 { font-size: 18px; margin: 0; color: var(--primaer); }
#status { margin-left: auto; font-size: 13px; color: var(--blass); }
#status.fehler { color: #c0392b; }

#haupt { flex: 1; display: flex; min-height: 0; }
#seite { width: 300px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--linie); background: var(--flaeche); min-height: 0; }
.seite-oben { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
#suche { padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--grund); }
#liste { overflow-y: auto; flex: 1; padding-bottom: 24px; }
.eintrag { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--linie); background: none; cursor: pointer; }
.eintrag:hover { background: var(--flaeche2); }
.eintrag.aktiv { background: var(--flaeche2); box-shadow: inset 3px 0 0 var(--primaer); }
.eintrag .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .u { display: block; font-size: 13px; color: var(--blass); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag.ordner .t::before { content: "▸ "; color: var(--primaer); }
.eintrag.reimbuch .t { color: var(--primaer); }
.pfad { padding: 8px 14px; font-size: 13px; color: var(--blass); }

#inhalt { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.leer { padding: 48px 24px; color: var(--blass); max-width: 640px; line-height: 1.5; }

.knopf { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.knopf:hover { background: var(--flaeche2); }
.knopf.voll { background: var(--primaer); color: var(--primaer-text); border-color: var(--primaer); }
.knopf.schlicht { border: 0; background: none; font-size: 20px; padding: 2px 8px; }
.knopf.an { box-shadow: inset 0 0 0 2px var(--primaer); }
.knopf:disabled { opacity: .45; cursor: default; }

.werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--linie); background: var(--flaeche); }
.werkzeug .titel { flex: 1 1 220px; min-width: 120px; font-size: 18px; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; background: none; }
.werkzeug .titel:focus, .werkzeug .titel:hover { border-color: var(--linie); }
.klecks { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: #222; padding: 0; }
.klecks.gewaehlt { border-color: var(--text); }
.trenner { width: 1px; align-self: stretch; background: var(--linie); }
.hinweis { padding: 8px 16px; background: var(--gelb); color: #222; font-size: 14px; }

.blatt { flex: 1; overflow-y: auto; position: relative; }
.schicht { position: relative; max-width: 900px; margin: 0 auto; }
.text { font: 17px/1.65 var(--schrift); padding: 16px 64px 120px 20px; margin: 0; border: 0; width: 100%;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; letter-spacing: normal; }
.hinten { position: absolute; inset: 0; color: transparent; pointer-events: none; }
.hinten > div { min-height: 1.65em; }
textarea.text { position: relative; display: block; background: transparent; resize: none; overflow: hidden; outline: none; color: var(--text); caret-color: var(--text); min-height: 60vh; }
.f1 { background: var(--f1); } .f2 { background: var(--f2); } .f3 { background: var(--f3); }
.f4 { background: var(--f4); } .f5 { background: var(--f5); } .f6 { background: var(--f6); }
.rb { text-decoration: underline; text-decoration-color: var(--rb); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mark { background: var(--mark); outline: 2px solid var(--primaer); }
.spalte { position: absolute; top: 0; right: 0; width: 56px; height: 100%; }
.nummern { position: absolute; top: 0; left: 0; width: 40px; height: 100%; pointer-events: none; }
.nr { position: absolute; right: 8px; font-size: 12px; line-height: calc(17px * 1.65); color: var(--blass); opacity: .75; font-variant-numeric: tabular-nums; font-family: var(--schrift); }
.mit-nummern .text { padding-left: 48px; }
.zahl { position: absolute; right: 10px; font-size: 12px; color: var(--blass); border: 0; background: none; cursor: pointer; padding: 0 2px; line-height: calc(17px * 1.65); font-family: var(--schrift); }
.zahl:hover { color: var(--primaer); }

/* Reimbuch */
.rb-seite { flex: 1; overflow-y: auto; padding: 16px 20px 80px; }
.rb-kopf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.rb-kopf h2 { margin: 0 12px 0 0; font-size: 22px; }
.rb-kopf input, .rb-kopf select { padding: 6px 8px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); }
.rb-zeile { display: block; width: 100%; text-align: left; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; cursor: pointer; }
.rb-zeile:hover { border-color: var(--primaer); }
.rb-zeile .w { font-weight: 700; font-size: 17px; }
.rb-zeile .i, .rb-zeile .n { display: block; font-size: 13px; color: var(--blass); margin-top: 2px; }
.rb-gruppe { margin: 18px 0 6px; font-size: 14px; font-weight: 700; color: var(--primaer); }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--flaeche2); margin: 0 6px 6px 0; font-size: 14px; }
.fund { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 0; cursor: pointer; border-bottom: 1px solid var(--linie); }
.fund:hover { background: var(--flaeche2); }
.fund .z { color: var(--blass); font-size: 13px; margin-right: 8px; }
.fund b { background: var(--mark); }
.fund-titel { margin: 14px 0 2px; font-weight: 700; }

/* Fenster */
#schleier { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.fenster { background: var(--flaeche); border-radius: 14px; padding: 18px 20px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.fenster h3 { margin: 0 0 12px; }
.fenster label { display: block; font-size: 13px; color: var(--blass); margin: 10px 0 4px; }
.fenster input[type=text], .fenster textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--grund); }
.fenster .aktionen { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.fenster .klein { font-size: 13px; color: var(--blass); margin-top: 4px; min-height: 1em; }
.wahl { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--linie); margin: 0 6px 6px 0; cursor: pointer; background: none; }
.wahl.an { background: var(--primaer); color: var(--primaer-text); border-color: var(--primaer); }
.silbe-wort { display: inline-block; margin: 0 8px 8px 0; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--linie); background: none; cursor: pointer; }
.silbe-wort.unsicher { background: var(--gelb); color: #222; }
.silbe-wort.eigen { box-shadow: inset 0 0 0 2px var(--primaer); }

@media (max-width: 760px) {
  #seite { position: fixed; top: 49px; bottom: 0; left: 0; z-index: 5; width: 86vw; max-width: 340px; box-shadow: 4px 0 20px rgba(0, 0, 0, .2); }
  #seite.zu { display: none; }
  .text { padding: 12px 48px 120px 14px; font-size: 16px; }
  .spalte { width: 44px; }
  .mit-nummern .text { padding-left: 40px; }
  .nummern { width: 34px; }
}
@media (min-width: 761px) { #seitenKnopf { display: none; } }
.zeile2 { display: flex; gap: 8px; }
.zeile2 #neuText { flex: 1; }
.ordner-knoepfe { display: flex; gap: 8px; padding: 0 14px 8px; }
.eintrag.ziel { background: var(--mark); box-shadow: inset 0 0 0 2px var(--primaer); }
.ordnerwahl { padding: 5px 8px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); max-width: 200px; }
/* Ansicht (formatiert) */
.ansicht { max-width: 900px; margin: 0 auto; padding: 16px 20px 120px; font: 17px/1.65 var(--schrift); }
.a-zeile { display: flex; align-items: baseline; gap: 12px; }
.a-nr { width: 28px; flex: none; text-align: right; font-size: 12px; color: var(--blass); opacity: .75; font-variant-numeric: tabular-nums; }
.a-silben { width: 32px; flex: none; text-align: right; font-size: 12px; color: var(--blass); }
.a-text { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: break-word; }
.a-h1 { font-size: 28px; font-weight: 700; margin: 18px 0 6px; line-height: 1.3; }
.a-h2 { font-size: 23px; font-weight: 700; margin: 16px 0 4px; line-height: 1.3; }
.a-h3 { font-size: 20px; font-weight: 700; margin: 14px 0 2px; line-height: 1.3; color: var(--primaer); }
.a-zitat { font-style: italic; color: var(--blass); border-left: 3px solid var(--linie); padding-left: 10px; }
.a-liste::before { content: "• "; color: var(--primaer); font-weight: 700; }
.ansicht hr { border: 0; border-top: 1px solid var(--linie); margin: 14px 40px; }
.fett { font-weight: 700; } .kursiv { font-style: italic; } .unklar { background: var(--gelb); color: #222; }
.werkzeug .titel.nur { flex: 1 1 220px; font-size: 18px; font-weight: 600; padding: 4px 6px; border: 0; }
/* Beschreibung, BPM, Beat (Paket A) */
.angaben { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--linie); background: var(--flaeche2); }
.beschreibung { width: 100%; max-width: 900px; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); resize: vertical; min-height: 3.2em; }
.angaben-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bpm-feld { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--blass); }
.bpm { width: 76px; padding: 5px 8px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); }
.beat-name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.blass { font-size: 13px; color: var(--blass); }
#spieler { display: flex; align-items: center; gap: 12px; padding: 6px 16px; border-top: 1px solid var(--linie); background: var(--flaeche); }
#spieler audio { flex: 1; min-width: 0; height: 36px; }
#beatName { max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--primaer); }
.schleife { font-size: 13px; color: var(--blass); white-space: nowrap; }
@media (max-width: 760px) { #beatName { display: none; } }
/* Reimlisten (Paket L) */
.rl-reihe { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 8px; }
.rl-kachel { text-align: left; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.rl-kachel:hover { border-color: var(--primaer); }
.rl-kachel.neu { border-style: dashed; }
.rl-kachel .w { display: block; font-weight: 700; font-size: 17px; color: var(--primaer); }
.rl-kachel .i, .rl-wort .i, .rl-wahl .i, .rl-kat .i { font-size: 13px; color: var(--blass); }
.rl-kachel .i { display: block; margin-top: 2px; }
.rl-eingabe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.rl-eingabe input { flex: 1 1 240px; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); font-size: 17px; }
.rl-eingabe .klein { flex-basis: 100%; font-size: 13px; color: var(--blass); }
.rl-eingabe .klein.falsch { color: #9a6b00; }
.rl-filter { margin-bottom: 8px; }
.rl-wort { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px; border-bottom: 1px solid var(--linie); }
.rl-wort.falsch { background: rgba(255, 224, 102, .35); }
.rl-w { border: 0; background: none; font-weight: 700; font-size: 17px; cursor: pointer; padding: 0; text-align: left; }
.rl-w:hover { color: var(--primaer); }
.rl-kats { flex: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; }
.wahl.klein { padding: 2px 9px; font-size: 13px; margin: 2px 4px 2px 0; }
.rl-auswahl { max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.rl-wahl { display: block; padding: 6px 0; border-bottom: 1px solid var(--linie); cursor: pointer; color: var(--text) !important; font-size: 15px !important; margin: 0 !important; }
.rl-kat { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.rl-kat input { flex: 1; padding: 6px 8px; border: 1px solid var(--linie); border-radius: 8px; background: var(--grund); }
/* Drums (SYS-121) */
.drum-raster { margin: 10px 0; }
.drum-spur { margin-bottom: 12px; }
.drum-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.drum-kopf b { width: 52px; }
.drum-kopf input[type=range] { width: 160px; }
.drum-zeile { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; margin-bottom: 4px; max-width: 900px; }
.schritt { height: 34px; border: 0; border-radius: 4px; background: var(--flaeche2); cursor: pointer; font-size: 12px; padding: 0; color: var(--primaer-text); }
.schritt.zwei { background: var(--linie); }
.schritt.ende { margin-right: 6px; }
.schritt.an { background: var(--primaer); }
.schritt.offen { background: #3a8f7a; color: #fff; }
.schritt.jetzt { outline: 2px solid var(--text); outline-offset: -2px; }
.bpm.falsch { border-color: #c0392b; }
#patSwing { width: 140px; }

/* SYS-127: Anmelden, Einladung, Konto (nur Modus konten) */
body.gesperrt #haupt, body.gesperrt #spieler, body.gesperrt #seitenKnopf, body.gesperrt #kontoKnopf, body.gesperrt #appLeiste { display: none !important; }
#tor { flex: 1; overflow-y: auto; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tor-karte { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; }
.tor-karte h2 { margin: 0; font-size: 20px; color: var(--primaer); }
.tor-karte p { margin: 0; }
.tor-feld { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--blass); }
.tor-feld input { padding: 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--grund); font-size: 16px; color: var(--text); }
.tor-fehler { color: #c0392b; min-height: 1.2em; font-size: 14px; }
.tor-klein { font-size: 13px; color: var(--blass); }
.tor-datenschutz { width: 100%; max-width: 380px; font-size: 13px; color: var(--blass); }
.tor-datenschutz summary { cursor: pointer; }
.tor-datenschutz p { margin: 8px 0 0; }
.app-hinweis { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.app-hinweis a { text-align: center; text-decoration: none; padding: 10px 12px; }
.app-hinweis ol { margin: 6px 0 0; padding-left: 20px; }
#kontoKnopf { font-size: 14px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#kontoTafel { position: absolute; right: 12px; top: 52px; z-index: 30; width: min(340px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
#kontoTafel p { margin: 0; }
#appLeiste { display: flex; align-items: center; gap: 6px; }
#appLeiste a { color: #222; font-weight: 600; }
#appLeiste button { margin-left: auto; color: #222; }
