/* Werkstatt – dunkel, mit Farbwahl */
:root {
  --bg: #15131a; --flaeche: #1f1c26; --flaeche2: #2a2633; --linie: #3a3546; --leer: #4a4553;
  --text: #ece6da; --text-leise: #a69f93;
  --gold: #d4a94f; --gold-leise: #8a6d33;
  --rot: #c0504d; --gelb: #d9b44a; --gruen: #6fa86a;
}
html[data-farbe="nachtblau"] { --bg: #10141b; --flaeche: #19202a; --flaeche2: #222b37; --linie: #33404f; --leer: #445063; }
html[data-farbe="walnuss"]   { --bg: #16120e; --flaeche: #211b15; --flaeche2: #2c241c; --linie: #45382b; --leer: #54473a; }
html[data-farbe="tanne"]     { --bg: #0f1511; --flaeche: #172019; --flaeche2: #202c23; --linie: #324438; --leer: #435548; }
html[data-farbe="anthrazit"] { --bg: #141414; --flaeche: #1e1e1e; --flaeche2: #282828; --linie: #3b3b3b; --leer: #4d4d4d; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Segoe UI", system-ui, sans-serif; }
a { color: var(--gold); }
header {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
header h1 { margin: 0; font: 600 22px Georgia, serif; }
header h1 a { color: var(--gold); text-decoration: none; }
header .kalender { color: var(--text-leise); }
nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
nav a { color: var(--text-leise); text-decoration: none; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--linie); font-size: 14px; }
nav a.aktiv, nav a:hover { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.farbform select { background: var(--flaeche2); color: var(--text); border: 1px solid var(--linie); border-radius: 6px; padding: 5px 8px; font: 14px "Segoe UI", sans-serif; }
main { max-width: 1600px; margin: 0 auto; padding: 14px 16px 60px; }
h2 { font: 600 21px Georgia, serif; color: var(--gold); margin: 0 0 6px; }
h3 { font-size: 14px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 8px; }
.leise { color: var(--text-leise); font-size: 14px; }
.meldung { max-width: 1600px; margin: 10px auto 0; padding: 8px 16px; background: rgba(111,168,106,.15); border-left: 3px solid var(--gruen); }
.fehler { color: #e08a86; }
.hinweis { font-size: 13px; color: var(--text-leise); margin-top: 3px; }

/* Knöpfe und Felder */
.knopf, button.knopf {
  display: inline-block; background: var(--flaeche2); border: 1px solid var(--linie); color: var(--text);
  padding: 7px 14px; border-radius: 6px; font: 15px "Segoe UI", sans-serif; cursor: pointer; text-decoration: none;
}
.knopf:hover { border-color: var(--gold-leise); }
.knopf.haupt { background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 600; }
.knopf.klein { padding: 3px 9px; font-size: 13px; }
.knopf.gefahr:hover { border-color: var(--rot); color: #e08a86; }
.gruppe { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px 6px; margin-bottom: 10px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drei { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 760px) { .zwei, .drei { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; color: var(--text-leise); margin-bottom: 2px; }
.feld { margin-bottom: 8px; }
input[type=text], input[type=number], input[type=date], input[type=password], textarea, select {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--linie);
  border-radius: 6px; padding: 9px 11px; font: 17px/1.5 "Segoe UI", system-ui, sans-serif;
}
textarea { min-height: 170px; resize: vertical; }
textarea.gross { min-height: 360px; }
textarea.klein { min-height: 110px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
.code { font-family: Consolas, monospace; letter-spacing: 3px; text-transform: uppercase; }
.schalter { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--text); cursor: pointer; margin-top: 6px; }
.schalter input { width: 20px; height: 20px; accent-color: var(--gold); cursor: pointer; }

/* Sterne für die Spannung */
.sterne { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.sterne input { display: none; }
.sterne label { font-size: 26px; color: var(--leer); cursor: pointer; margin: 0; line-height: 1; }
.sterne input:checked ~ label, .sterne label:hover, .sterne label:hover ~ label { color: var(--gold); }
.sterne .null { font-size: 13px; align-self: center; margin-left: 8px; }

/* KaleRnder-Liste */
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 12px 0 24px; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 14px; }
.karte h3 { text-transform: none; letter-spacing: 0; font: 600 19px Georgia, serif; }
.balken { height: 8px; border-radius: 4px; background: var(--leer); overflow: hidden; display: flex; margin: 8px 0; }
.balken span { display: block; height: 100%; }

/* Übersicht */
.stand { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 14px; font-size: 14px; align-items: center; }
.stand .rechts { margin-left: auto; display: flex; gap: 8px; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.p-leer { background: var(--leer); } .p-angefangen { background: var(--gelb); } .p-fertig { background: var(--gruen); }
.kurve { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 12px 14px 6px; margin-bottom: 16px; }
.kurve svg { width: 100%; height: 120px; display: block; }
.auftritte table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.auftritte th { text-align: left; font-weight: normal; font-size: 13px; color: var(--text-leise); padding-right: 10px; white-space: nowrap; width: 1%; }
.auftritte td { text-align: center; padding: 3px 0; }
.auftritte td span { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--leer); opacity: .45; }
.auftritte td span.da { background: var(--gold); opacity: 1; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tuer { display: block; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; position: relative; min-height: 104px; color: var(--text); text-decoration: none; }
.tuer:hover { border-color: var(--gold-leise); }
.tuer .nr { font: 600 26px Georgia, serif; color: var(--gold); }
.tuer .titel { font-size: 14px; }
.tuer .titel.ohne { color: var(--text-leise); font-style: italic; }
.tuer .ampel { position: absolute; top: 14px; right: 12px; }
.tuer .klein { font-size: 12px; color: var(--text-leise); margin-top: 4px; }
.tuer .online { color: var(--gruen); }

/* Tür bearbeiten */
.kopf { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; border-bottom: 1px solid var(--linie); }
.kopf .weiter { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.stueck { border: 1px solid var(--linie); border-radius: 8px; padding: 8px 10px 4px; margin: 0 0 10px; background: var(--flaeche2); }
.stueck-kopf { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.stueck-kopf .name { font-weight: 600; margin-right: auto; }
.marke { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: rgba(212,169,79,.15); color: var(--gold); }
.marke.warnung { background: rgba(217,180,74,.18); color: var(--gelb); }
.dazu { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 6px 0 8px; }
.dazu select { width: auto; max-width: 420px; font-size: 15px; padding: 6px 8px; }
.leer-hinweis { color: var(--text-leise); font-style: italic; margin: 0 0 8px; }

/* Sammlung */
.reiter { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 14px; }
.reiter a { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--linie); text-decoration: none; color: var(--text-leise); }
.reiter a.aktiv { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.reiter a.aus { opacity: .5; }
.liste .zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.liste .zeile .name { flex: 1; min-width: 200px; }
.liste .zeile form { display: flex; gap: 6px; align-items: center; margin: 0; }
.liste .zeile select { width: auto; font-size: 14px; padding: 4px 6px; }

.anmelden { max-width: 380px; margin: 60px auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 20px; }

/* ---------- Welten und Tagesarten (02.12.2026) – neue Regeln in rem, Farben nur über Variablen ---------- */
:root { --welt: var(--gold); --tagesart: #8a8a8a; --orange: #e8913a; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
header { border-top: 0.25rem solid var(--welt); }
.weltform select {
  background: var(--flaeche2); color: var(--text); border: 0.0625rem solid var(--welt); border-radius: 0.375rem;
  padding: 0.35rem 0.6rem; font: 600 0.95rem "Segoe UI", sans-serif; min-height: 2.25rem; width: auto; cursor: pointer;
}
@media (pointer: coarse) { .weltform select { min-height: 3rem; font-size: 1.05rem; } }

/* Einklappbare Abschnitte: großer oranger Pfeil links, Überschrift antippen genügt */
details.klapp > summary { list-style: none; display: flex; align-items: center; gap: 0.6rem; cursor: pointer; min-height: 2.5rem; }
details.klapp > summary::-webkit-details-marker { display: none; }
details.klapp > summary::before { content: "▶"; color: var(--orange); font-size: 1.3rem; line-height: 1; transition: transform .15s; }
details.klapp[open] > summary::before { transform: rotate(90deg); }
details.klapp > summary h3 { margin: 0; }
details.klapp > summary .zahl { font-size: 0.8rem; color: var(--text-leise); background: var(--flaeche2); border: 0.0625rem solid var(--linie); border-radius: 1rem; padding: 0 0.55rem; }
details.klapp.gruppe { padding-bottom: 0.4rem; }
details.klapp.gruppe[open] > summary { margin-bottom: 0.5rem; }
details.klapp.innen { margin-top: 0.5rem; border-top: 0.0625rem solid var(--linie); padding-top: 0.3rem; }
.farbpunkt { display: inline-block; width: 1rem; height: 1rem; border-radius: 50%; background: var(--farbe); border: 0.0625rem solid var(--linie); }
input[type=color] { width: 100%; height: 2.6rem; padding: 0.2rem; background: var(--bg); border: 0.0625rem solid var(--linie); border-radius: 0.375rem; cursor: pointer; }

/* Schild einer Tagesart: Zeichen + Name, Farbe über --tagesart */
.ta-schild { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0.6rem 0.1rem 0.2rem; border-radius: 1rem;
  border: 0.125rem solid var(--tagesart); background: color-mix(in srgb, var(--tagesart) 18%, transparent); color: var(--text); font-size: 0.9rem; text-transform: none; letter-spacing: 0; font-weight: 600; vertical-align: middle; }
.ta-zeichen { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--tagesart); font-size: 0.95rem; }
.ta-zeile { border-left: 0.35rem solid var(--tagesart) !important; }
.ta-legende { gap: 0.5rem; }
.ta-zeichen-feld { font-size: 1.4rem !important; text-align: center; }
.ta-gruppe { border-left: 0.35rem solid var(--tagesart); }
.ta-wahl { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ta-wahl label { margin: 0; font-size: 0.95rem; color: var(--text); }
.ta-wahl select { width: auto; min-width: 14rem; }
#abschnitte { border-left: 0.35rem solid var(--tagesart); }
.abschnitt .stueck-kopf .ab-titel { flex: 1; min-width: 12rem; font-weight: 600; padding: 0.4rem 0.6rem; }
.schalter.klein { font-size: 0.85rem; margin: 0; gap: 0.35rem; }
details.hilfe { display: inline-block; }
details.hilfe summary { list-style: none; cursor: pointer; font-size: 1.1rem; }
details.hilfe summary::-webkit-details-marker { display: none; }
details.hilfe p { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--text-leise); max-width: 34rem; }

/* Tür-Kachel in der Übersicht mit Tagesart */
.tuer.mit-tagesart { border-left: 0.4rem solid var(--tagesart); }
.tuer .ta-ecke { position: absolute; bottom: 0.5rem; right: 0.6rem; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--tagesart); font-size: 1rem; }

/* Sammlung: Trenner zwischen den Ordnern und den Welt-Ansichten */
.reiter .trenner { width: 0.0625rem; background: var(--linie); margin: 0 0.3rem; }

/* Entwurf gefunden */
.entwurf-balken { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; padding: 0.5rem 0.8rem; margin-bottom: 0.6rem;
  background: color-mix(in srgb, var(--orange) 15%, transparent); border-left: 0.2rem solid var(--orange); border-radius: 0.375rem; }

@media print {
  header, nav, .knopf, .weltform, .entwurf-balken { display: none !important; }
  body { background: #fff; color: #000; }
}
.meldung.warnung { background: color-mix(in srgb, var(--orange) 18%, transparent); border-left-color: var(--orange); }

/* ---------- Handy und Tablet (02.12.2026): kompakter Kopf, Speichern schwebt unten rechts, große Tippflächen ---------- */
@media (max-width: 760px) {
  header { gap: 0.5rem; padding: 0.5rem 0.75rem; }
  header h1 { font-size: 1.15rem; }
  header .kalender { flex: 1 1 100%; font-size: 0.85rem; order: 3; }
  nav { order: 4; flex: 1 1 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.25rem; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a, nav .farbform { flex: 0 0 auto; white-space: nowrap; }
  main { padding: 0.6rem 0.6rem 6rem; }
  .kopf { position: static; gap: 0.4rem; }
  .kopf .weiter { margin-left: 0; width: 100%; }
  .kopf .knopf.haupt { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; padding: 0.8rem 1.3rem; font-size: 1.05rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, .55); border-radius: 2rem; }
  .gruppe { padding: 0.6rem 0.6rem 0.3rem; }
  .raster { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
  .liste .zeile .name { min-width: 100%; }
}
@media (pointer: coarse) {
  .knopf, button.knopf, nav a, .reiter a { min-height: 3rem; display: inline-flex; align-items: center; justify-content: center; }
  .knopf.klein { min-width: 3rem; min-height: 3rem; font-size: 1rem; }
  .schalter input { width: 1.6rem; height: 1.6rem; }
  details.klapp > summary { min-height: 3rem; }
  .sterne label { font-size: 2.2rem; padding: 0 0.15rem; }
}

/* ---------- Farbpalette je Welt (02.12.2026) ---------- */
.farbfelder { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.farbfeld { width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; background: var(--farbe); border: 0.125rem solid var(--linie); cursor: pointer; padding: 0; }
.farbfeld:hover { border-color: var(--text-leise); }
.farbfeld.gewaehlt { border-color: var(--text); box-shadow: 0 0 0 0.15rem var(--bg), 0 0 0 0.3rem var(--text); }
.farbe-eigen { display: flex; align-items: center; gap: 0.6rem; }
.farbe-eigen input[type=color] { width: 4rem; flex: 0 0 auto; }
.farbname { font-size: 0.9rem; color: var(--text-leise); }
.palette-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.4rem; margin-bottom: 0.5rem; }
.palette-zeile { display: flex; gap: 0.4rem; align-items: center; }
.palette-zeile input[type=color] { width: 3rem; flex: 0 0 auto; }
.palette-zeile input[type=text] { padding: 0.4rem 0.6rem; font-size: 1rem; }
@media (pointer: coarse) { .farbfeld { width: 3rem; height: 3rem; } }

/* Kontrast (02.12.2026): Schrift auf Tagesart-Farbe über --tagesart-schrift; dunkle Farben (Tannengrün) bekommen einen hellen Rand */
.ta-zeichen, .tuer .ta-ecke { color: var(--tagesart-schrift, #fff); box-shadow: 0 0 0 0.0625rem rgba(255, 255, 255, .35); }
.ta-schild { box-shadow: inset 0 0 0 0.0625rem rgba(255, 255, 255, .12); }
