/* ==========================================================================
   LARP Chronik – Design
   Warme Erdtöne, Gold-Akzente, Hell-/Dunkelmodus über CSS-Variablen.
   Keine Inline-Styles (CSP): jede Gestaltung läuft über Klassen.
   ========================================================================== */

:root {
  --gold: #b58a1f;
  --gold-hell: #d9b451;
  --sidebar-w: 96px;
  --sidebar-pad: 10px;
  --radius: 14px;
  --radius-klein: 9px;
  --schatten: 0 2px 10px rgba(43, 32, 24, 0.08);
  --schatten-stark: 0 12px 40px rgba(43, 32, 24, 0.22);
  --tempo: 160ms;
}

html[data-design='hell'] {
  --bg: #f6efe4;
  --bg2: #efe5d6;
  --flaeche: #fffdf9;
  --flaeche2: #f7f1e6;
  --text: #2b2018;
  --text-dezent: #6d5e50;
  --linie: #e0d3c0;
  --linie-stark: #cbb99f;
  --gefahr: #9a3412;
  --gefahr-bg: #fdeee6;
  --ok: #2f6b3f;
  --tt-bg: #2b2018;
  --tt-text: #f6efe4;
}

html[data-design='dunkel'] {
  --bg: #191410;
  --bg2: #201a15;
  --flaeche: #241d17;
  --flaeche2: #2b231c;
  --text: #f0e6d8;
  --text-dezent: #b3a394;
  --linie: #3a2f26;
  --linie-stark: #4d3f33;
  --gefahr: #f0a186;
  --gefahr-bg: #3a201a;
  --ok: #8fd0a1;
  --tt-bg: #f0e6d8;
  --tt-text: #241d17;
  --schatten: 0 2px 10px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss jede Layoutregel schlagen.
   Grund (Fehler aus 1.0.3): Der Browser setzt fuer [hidden] zwar display:none,
   aber jede eigene Regel mit display (.modal-huelle{display:grid},
   .tabbar{display:flex}) gewinnt gegen das Standard-Stylesheet. Die
   Dialoghuelle lag dadurch unsichtbar ueber der Anmeldeseite und hat alle
   Klicks abgefangen. Diese Regel macht das strukturell unmoeglich. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { font-family: 'Trebuchet MS', 'Segoe UI', Candara, Optima, sans-serif; line-height: 1.25; margin: 0; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; color: inherit; }

/* Inline-SVGs: feste Ersatzgröße. Ohne diese Regel (und ohne width/height im
   SVG selbst) fallen SVGs auf 300x150 px zurück. */
svg { width: 18px; height: 18px; flex: 0 0 auto; }

.skiplink {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: #221a12; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skiplink:focus { left: 0; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --- Rahmen --------------------------------------------------------------- */
.app { min-height: 100vh; padding-bottom: 84px; }
/* Vor der Anmeldung gibt es weder Kopfzeile noch Tableiste. */
.app.nur-auth { padding: 0 !important; }

.kopf {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-bottom: 1px solid var(--linie);
  backdrop-filter: blur(6px);
}
.kopf-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
/* Kopf links: aktiver Charakter, zugleich Umschalter. */
.kopf-titel {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: min(60vw, 460px);
  background: none; border: 1px solid transparent; border-radius: var(--radius-klein);
  padding: 5px 8px; margin-left: -8px; color: inherit; text-align: left; font: inherit;
  transition: background var(--tempo), border-color var(--tempo);
}
.kopf-titel-wechselbar { cursor: pointer; }
.kopf-titel-wechselbar:hover { background: var(--flaeche2); border-color: var(--linie); }
.kopf-titel[disabled] { cursor: default; }
.kopf-texte { display: flex; flex-direction: column; min-width: 0; }
.kopf-h1 {
  font-family: 'Trebuchet MS', 'Segoe UI', Candara, Optima, sans-serif;
  font-size: 1.1rem; font-weight: 700; line-height: 1.2; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kopf-unter { margin: 0; font-size: .78rem; color: var(--text-dezent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-pfeil { display: inline-flex; color: var(--text-dezent); }
.kopf-pfeil:empty { display: none; }
.kopf-pfeil svg { width: 15px; height: 15px; }
.kopf-wappen { color: var(--gold); display: inline-flex; }
.kopf-wappen svg { width: 26px; height: 26px; }
.kopf-aktionen { display: flex; align-items: center; gap: 8px; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-dezent); }
.sync-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dezent); display: inline-block; }
.sync-gruen { background: #4e9d63; }
.sync-gelb { background: var(--gold-hell); animation: pulsieren 1.2s infinite; }
.sync-rot { background: #c0563a; }
@keyframes pulsieren { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.inhalt { max-width: 1080px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 16px; }

/* --- Tableiste ------------------------------------------------------------ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: var(--flaeche); border-top: 1px solid var(--linie);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; padding: 8px 2px; border-radius: var(--radius-klein);
  color: var(--text-dezent); cursor: pointer; font-size: .72rem; transition: color var(--tempo), background var(--tempo);
}
.tab-icon { display: inline-flex; }
.tab:hover { color: var(--text); }
.tab-aktiv { color: var(--gold); background: var(--flaeche2); }

/* --- Karten und Abschnitte ------------------------------------------------ */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--schatten);
}
.abschnitt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.abschnitt-kopf h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.abschnitt-icon { color: var(--gold); display: inline-flex; }
.abschnitt-aktionen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.unter-titel {
  font-size: .95rem; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px;
  color: var(--text); border-top: 1px solid var(--linie); padding-top: 12px;
}
.unter-titel:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.dezent { color: var(--text-dezent); }
.klein { font-size: .82rem; }
.liste-titel { font-size: .95rem; margin: 14px 0 8px; color: var(--text-dezent); }

/* --- Knöpfe --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--linie-stark); background: var(--flaeche2); color: var(--text);
  padding: 8px 13px; border-radius: var(--radius-klein); cursor: pointer;
  font-size: .9rem; transition: background var(--tempo), border-color var(--tempo), transform var(--tempo);
}
.btn:hover { background: var(--bg2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(180deg, var(--gold-hell), var(--gold)); border-color: var(--gold); color: #241a0c; font-weight: 600; }
.btn-gold:hover { filter: brightness(1.06); background: linear-gradient(180deg, var(--gold-hell), var(--gold)); }
.btn-still { background: var(--flaeche2); }
.btn-gefahr { background: var(--gefahr); border-color: var(--gefahr); color: #fff; }
.btn-gefahr-still { color: var(--gefahr); border-color: var(--linie-stark); }
.btn-gefahr-still:hover { background: var(--gefahr-bg); }
.btn-icon { padding: 8px; }
.btn-klein { padding: 4px 9px; font-size: .8rem; }
.btn-breit { width: 100%; padding: 12px; font-size: 1rem; }
.btn.aktiv { border-color: var(--gold); color: var(--gold); }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 8px; }

.segment { display: inline-flex; border: 1px solid var(--linie-stark); border-radius: var(--radius-klein); overflow: hidden; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--flaeche);
  border: 0; padding: 7px 11px; cursor: pointer; color: var(--text-dezent); font-size: .85rem;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--linie); }
.seg-btn.aktiv { background: var(--gold); color: #241a0c; font-weight: 600; }

.pille {
  display: inline-flex; align-items: center; gap: 4px; background: var(--flaeche2);
  border: 1px solid var(--linie); border-radius: 999px; padding: 2px 9px; font-size: .78rem; white-space: nowrap;
}
.pille-still { color: var(--text-dezent); }
.pille-gold { border-color: var(--gold); color: var(--gold); }
.pille svg { width: 13px; height: 13px; }

/* --- Anmeldung ------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-karte {
  width: min(430px, 100%); background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 20px; padding: 30px 26px; box-shadow: var(--schatten-stark); text-align: center;
}
.auth-wappen { color: var(--gold); margin-bottom: 8px; }
.auth-wappen svg { width: 52px; height: 52px; }
.auth-karte h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-unter { color: var(--text-dezent); margin-bottom: 18px; }
.auth-karte form { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.auth-fuss { margin-top: 18px; font-size: .76rem; color: var(--text-dezent); }
.feld-pruefung { font-size: .8rem; display: flex; align-items: center; gap: 5px; min-height: 1.2em; }
.feld-pruefung svg { width: 14px; height: 14px; }
.pruefung-ok { color: var(--ok); }
.pruefung-fehler { color: var(--gefahr); }
.feld input[aria-invalid='true'] { border-color: var(--gefahr); }

/* --- Formulare ------------------------------------------------------------ */
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.feld { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; color: var(--text-dezent); }
.feld-breit { grid-column: 1 / -1; }
.feld > span { font-weight: 600; }
.feld input, .feld select, .feld textarea, .modal-inhalt input, .modal-inhalt textarea {
  background: var(--bg); border: 1px solid var(--linie-stark); border-radius: var(--radius-klein);
  padding: 9px 11px; color: var(--text); width: 100%; font-size: .95rem;
}
.feld textarea { resize: vertical; line-height: 1.6; }
.feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--gold); outline: none; }
.feld-inline { display: inline-flex; align-items: center; gap: 6px; }
.feld-inline select { padding: 5px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--linie-stark); }
.pflicht { color: var(--gefahr); font-style: normal; }
.form-fuss { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hinweis {
  display: flex; align-items: flex-start; gap: 8px; background: var(--flaeche2);
  border-left: 3px solid var(--gold); border-radius: 0 var(--radius-klein) var(--radius-klein) 0;
  padding: 9px 12px; font-size: .84rem; color: var(--text-dezent);
}
.datei-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.datei-wahl { margin-top: 10px; }
.schalter-reihe { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; }
.schalter { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; cursor: pointer; }
.schalter-liste { display: flex; flex-direction: column; gap: 4px; }
.schalter-zeile {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--linie);
}
.schalter-zeile:last-child { border-bottom: 0; }
.schalter-zeile span { display: flex; flex-direction: column; }
.schalter-zeile small { font-size: .78rem; }
.schalter-box { width: 20px; height: 20px; accent-color: var(--gold); }

/* --- Listen --------------------------------------------------------------- */
.listen-eintrag {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: 0; border-bottom: 1px solid var(--linie);
  padding: 11px 2px; cursor: pointer; text-align: left; color: inherit;
}
.listen-eintrag:last-child { border-bottom: 0; }
.listen-eintrag:hover { background: var(--flaeche2); }
.le-links { display: flex; flex-direction: column; min-width: 0; }
.le-titel { font-weight: 600; }
.le-unter { font-size: .8rem; color: var(--text-dezent); }
.le-rechts { display: flex; align-items: center; gap: 6px; color: var(--text-dezent); }
.jahr-kopf { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.jahr-kopf h2 { font-size: 1.3rem; color: var(--gold); }

.leer { text-align: center; padding: 34px 18px; border: 1px dashed var(--linie-stark); border-radius: var(--radius); background: var(--flaeche); }
.leer-icon { color: var(--gold); margin-bottom: 8px; }
.leer-icon svg { width: 34px; height: 34px; }
.leer h3 { margin-bottom: 6px; }
.leer p { color: var(--text-dezent); max-width: 46ch; margin: 0 auto 14px; }

/* --- Dashboard ------------------------------------------------------------ */
.charakter-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.charakter-kopf-links { display: flex; align-items: center; gap: 12px; min-width: 0; }
.charakter-kopf-rechts { display: flex; gap: 8px; flex-wrap: wrap; }
.wappen-klein { color: var(--gold); display: inline-flex; }
.wappen-klein svg { width: 30px; height: 30px; }

.zaehl-leiste { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.zaehl-info { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dezent); font-size: .86rem; cursor: help; }
.zaehl-info svg { color: var(--gold); }
.zaehl-schalter { display: inline-flex; gap: 6px; }
.zaehl-btn {
  width: 38px; height: 34px; border-radius: var(--radius-klein); border: 1px solid var(--linie-stark);
  background: var(--flaeche2); color: var(--text-dezent); cursor: pointer; font-weight: 700;
}
.zaehl-btn.aktiv { background: var(--gold); border-color: var(--gold); color: #241a0c; }
.zaehl-marke {
  display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--text-dezent);
  border: 1px solid var(--linie); border-radius: 999px; padding: 1px 8px; cursor: help; white-space: nowrap;
}
.zaehl-marke svg { width: 12px; height: 12px; color: var(--gold); }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kachel {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 14px; cursor: pointer; text-align: left; box-shadow: var(--schatten);
  transition: transform var(--tempo), border-color var(--tempo);
}
.kachel:hover { transform: translateY(-2px); border-color: var(--gold); }
.kachel-icon { color: var(--gold); }
.kachel-wert { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.kachel-text { font-size: .8rem; color: var(--text-dezent); }

/* Abstand des Diagramms zum Kachelblock (Fehlerbild 1.0.2: klebte oben an) */
.diagramm-karte { margin-top: 10px; }
.diagramm-flaeche { width: 100%; overflow: hidden; margin-top: 6px; }
.diagramm { width: 100%; height: 240px; display: block; }
.diagramm .raster { stroke: var(--linie); stroke-width: 1; }
.diagramm .achse { fill: var(--text-dezent); font-size: 11px; font-family: 'Trebuchet MS', sans-serif; }
.diagramm .balken { fill: var(--gold); opacity: .85; }
.diagramm .balken-leer { fill: var(--linie-stark); }
.diagramm .verlauf-linie { fill: none; stroke: var(--gold); stroke-width: 2.5; }
.diagramm .verlauf-flaeche { fill: var(--gold); opacity: .16; stroke: none; }
.diagramm .verlauf-punkt { fill: var(--gold); stroke: var(--flaeche); stroke-width: 2; }
.diagramm .punkt-leer { fill: var(--linie-stark); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-hit:hover, .chart-hit:focus { fill: var(--gold); fill-opacity: .10; outline: none; }
.diagramm-liste:empty { display: none; }

.karten-karte { margin-top: 2px; }
.karte-flaeche { display: flex; justify-content: center; }
.karte-svg { width: min(100%, 420px); height: auto; }
.karte-svg .land { fill: var(--flaeche2); stroke: var(--linie-stark); stroke-width: 1.4; }
.kartenpunkt { cursor: pointer; }
.kartenpunkt .punkt-hof { fill: var(--gold); opacity: .16; }
.kartenpunkt .punkt { fill: var(--gold); opacity: .8; stroke: var(--flaeche); stroke-width: 1.4; }
.kartenpunkt.exakt .punkt { opacity: 1; stroke: var(--text); }
.kartenpunkt:hover .punkt, .kartenpunkt:focus .punkt { opacity: 1; }
.kartenpunkt:focus { outline: none; }
.punkt-zahl { fill: #241a0c; font-size: 10px; font-weight: 700; font-family: 'Trebuchet MS', sans-serif; }
.karte-hinweis { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; }

.orga-liste { display: flex; flex-direction: column; }
.orga-zeile {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: 0; border-bottom: 1px solid var(--linie); padding: 10px 2px;
  cursor: pointer; color: inherit; text-align: left;
}
.orga-zeile:last-child { border-bottom: 0; }
.orga-zeile:hover { background: var(--flaeche2); }
.orga-name { font-weight: 600; }
.orga-zahlen { display: flex; align-items: center; gap: 6px; color: var(--text-dezent); }

/* --- Detailansichten ------------------------------------------------------ */
.detail-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-kopf h2 { font-size: 1.25rem; }
.detail-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.werte { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.wert-gross { display: flex; flex-direction: column; }
.wert-zahl { font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.wert-text { font-size: .8rem; color: var(--text-dezent); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wert-paar { display: flex; flex-direction: column; font-size: .9rem; }
.wert-paar span { font-size: .76rem; color: var(--text-dezent); text-transform: uppercase; letter-spacing: .4px; }
.adress-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--flaeche2);
  border-radius: var(--radius-klein); padding: 10px 12px; font-size: .9rem;
}
.adress-box svg { color: var(--gold); }
.lesetext { font-size: 1rem; line-height: 1.75; }
.lesetext p { margin: 0 0 .8em; }
.lesetext-buch { font-size: 1.05rem; line-height: 1.8; max-width: 80ch; text-align: left; hyphens: auto; }
.lesetext-buch p:first-child::first-letter { font-size: 2.6rem; float: left; line-height: .9; padding: 4px 8px 0 0; color: var(--gold); }
.unter-karte { border-left: 3px solid var(--linie-stark); padding: 4px 0 4px 12px; margin: 12px 0; }
.unter-karte h4 { font-size: .98rem; display: flex; align-items: center; gap: 6px; }
.meilenstein { border-left-color: var(--gold); }
.meilenstein h4 svg { color: var(--gold); }

.unterliste { display: flex; flex-direction: column; gap: 10px; }
.unter-block { border: 1px solid var(--linie); border-radius: var(--radius-klein); padding: 10px; background: var(--flaeche2); }
.unter-kopf { display: flex; gap: 8px; margin-bottom: 8px; }
.unter-kopf input { flex: 1 1 auto; background: var(--bg); border: 1px solid var(--linie-stark); border-radius: 8px; padding: 7px 9px; }
.unter-kopf .u-datum { flex: 0 0 auto; max-width: 170px; }
.unter-block textarea { width: 100%; background: var(--bg); border: 1px solid var(--linie-stark); border-radius: 8px; padding: 8px 10px; resize: vertical; }

.anhang-zeile { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.anhang-zeile:last-child { border-bottom: 0; }
.anhang-icon { color: var(--gold); display: inline-flex; }
.anhang-name { flex: 1 1 auto; min-width: 0; word-break: break-word; font-size: .9rem; }
.anhang-aktionen { display: flex; gap: 4px; }

.vorschlaege { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.vorschlag {
  display: inline-flex; align-items: center; gap: 5px; border: 1px dashed var(--gold);
  background: var(--flaeche2); color: var(--text); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: .84rem;
}
.vorschlag:hover { background: var(--bg2); }
.vorschlag-genommen { border-style: solid; background: var(--gold); color: #241a0c; }
.extrakt {
  background: var(--bg2); border: 1px solid var(--linie); border-radius: var(--radius-klein);
  padding: 10px; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .8rem;
}
.ausklapp { border-top: 1px solid var(--linie); padding: 10px 0; }
.ausklapp summary { cursor: pointer; font-weight: 600; }
.ausklapp[open] summary { color: var(--gold); }

/* --- Zeitleisten ---------------------------------------------------------- */
.ot-gruppe { display: grid; grid-template-columns: 74px 1fr; gap: 12px; margin-bottom: 20px; }
.ot-spalte {
  display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--linie); padding-right: 10px;
}
.ot-jahr {
  font-family: 'Trebuchet MS', sans-serif; font-size: 1.5rem; font-weight: 700;
  color: var(--text-dezent); opacity: .55; letter-spacing: .5px; line-height: 1.1;
}
.ot-zahl {
  font-size: .7rem; line-height: 1.35;
  color: var(--text-dezent); opacity: .75; font-family: 'Trebuchet MS', sans-serif;
}
.ot-inhalt { min-width: 0; }

.zeitleiste { position: relative; padding-left: 20px; }
.zeitleiste::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--linie); }
.zl-eintrag { position: relative; padding: 6px 0 14px; }
.zl-punkt {
  position: absolute; left: -20px; top: 10px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--flaeche); border: 2px solid var(--linie-stark); display: inline-flex; align-items: center; justify-content: center;
}
.zl-raute { background: var(--gold); border-color: var(--gold); color: #241a0c; }
.zl-raute svg { width: 9px; height: 9px; }
.zl-inhalt h4 { font-size: .98rem; }
.zl-titel { background: none; border: 0; padding: 0; color: var(--gold); font-weight: 700; font-size: 1rem; cursor: pointer; text-align: left; }
.zl-titel:hover { text-decoration: underline; }
.ms-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.ms-liste li { display: flex; gap: 8px; font-size: .88rem; }
.ms-raute { color: var(--gold); display: inline-flex; }

/* --- Charakter, Geschichten, Zauber, Artefakte ---------------------------- */
.char-karte { display: flex; flex-direction: column; gap: 10px; }
.char-aktiv { border-color: var(--gold); }
.char-kopf { display: flex; align-items: center; gap: 12px; }
.char-kopf h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.char-zahlen { display: flex; flex-wrap: wrap; gap: 6px; }
.char-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }

.reiter { display: flex; gap: 4px; overflow-x: auto; border-top: 1px solid var(--linie); margin-top: 14px; padding-top: 10px; }
.reiter-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent;
  border-radius: var(--radius-klein); padding: 7px 12px; cursor: pointer; color: var(--text-dezent);
  white-space: nowrap; font-size: .88rem;
}
.reiter-btn:hover { color: var(--text); }
.reiter-btn.aktiv { background: var(--flaeche2); border-color: var(--linie-stark); color: var(--gold); font-weight: 600; }

.lese-karte { border-left: 4px solid var(--gold); }
.lese-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lese-titel { font-size: 1.25rem; }
.lese-aktionen { display: flex; gap: 6px; align-items: center; }

/* Zauber werden wie Artefakte dargestellt: volle Breite, Kopf mit Icon,
   Aktionen rechts. Das Kartenraster war unruhig und brach ungleich um. */
.zauber-karte { border-top: 3px solid var(--gold); }
.zauber-werte { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0; }
.zauber-werte dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dezent); }
.zauber-werte dd { margin: 0; font-size: .92rem; }

/* Pauschal nachgetragene Tage („Damals“) */
.vorzeit-zeile {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linie);
}
.vorzeit-zeile:last-child { border-bottom: 0; }
.vorzeit-tage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 62px; padding: 6px 8px; border-radius: var(--radius-klein);
  background: var(--flaeche2); border: 1px solid var(--gold);
  font-size: 1.15rem; font-weight: 700; line-height: 1.1; color: var(--gold);
}
.vorzeit-tage small { font-size: .62rem; font-weight: 400; color: var(--text-dezent); letter-spacing: .3px; }
.vorzeit-text { flex: 1 1 auto; min-width: 0; font-size: .92rem; }
.u-mt12 { margin-top: 12px; }

.ot-damals { opacity: .92; }
.ot-damals .ot-jahr { font-size: 1.1rem; font-style: italic; letter-spacing: .3px; }
.ot-damals .ot-inhalt::before { border-left-style: dashed; }
.ot-damals .zeitleiste::before { background: repeating-linear-gradient(to bottom, var(--linie-stark) 0 4px, transparent 4px 8px); }
.zl-punkt-damals { border-style: dashed; border-color: var(--gold); }
.damals-fuss { display: flex; align-items: flex-start; gap: 6px; margin-top: 2px; }

.warnbox {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--gefahr-bg); border-left: 3px solid var(--gefahr);
  border-radius: 0 var(--radius-klein) var(--radius-klein) 0;
  padding: 11px 13px; font-size: .86rem; line-height: 1.5;
}
.warnbox svg { color: var(--gefahr); margin-top: 2px; }
.offline-marke { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: .76rem; }
.offline-marke svg { width: 12px; height: 12px; }

/* Auswahl im Orga-Paket: Kästchen in fester Spalte links, damit alle exakt
   untereinander stehen; der Text nutzt die volle Restbreite. */
.paket-liste { display: flex; flex-direction: column; }
.paket-zeile {
  display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--linie); cursor: pointer;
}
.paket-zeile:last-child { border-bottom: 0; }
.paket-zeile:hover { background: var(--flaeche2); }
.paket-zeile .schalter-box { margin: 1px 0 0; }
.paket-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.paket-titel { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: .95rem; }
.paket-anzahl {
  font-size: .72rem; font-weight: 600; color: var(--gold);
  border: 1px solid var(--gold); border-radius: 999px; padding: 0 7px; white-space: nowrap;
}
.paket-beschreibung { font-size: .82rem; color: var(--text-dezent); line-height: 1.4; }

/* Schreibansicht: das Textfeld soll die Fläche wirklich nutzen. */
.schreib-karte { display: flex; flex-direction: column; }
.schreib-titel input { font-size: 1.15rem; font-weight: 600; padding: 11px 13px; }
.schreib-feld textarea {
  min-height: 320px; resize: vertical; overflow: hidden;
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 1.02rem; line-height: 1.75; padding: 16px 18px;
}
.schreib-feld > span { display: flex; align-items: baseline; gap: 8px; }

.eintrag-liste { display: flex; flex-direction: column; gap: 10px; }
.eintrag { border-left: 3px solid var(--linie-stark); padding: 2px 0 2px 12px; }
.eintrag h4 { font-size: .95rem; margin-bottom: 2px; }
.eintrag .lesetext { font-size: .95rem; }

.lese-frei { border-left-color: var(--gold); }

.artefakt-karte { border-top: 3px solid var(--gold); }
.artefakt-kopf { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.artefakt-kopf > div:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.artefakt-icon { color: var(--gold); display: inline-flex; }
.artefakt-icon svg { width: 26px; height: 26px; }

.gefahr-zone { margin-top: 22px; border: 1px solid var(--gefahr); border-radius: var(--radius); padding: 14px; background: var(--gefahr-bg); }
.gefahr-zone h3 { font-size: .98rem; display: flex; align-items: center; gap: 7px; color: var(--gefahr); }
.loesch-reihe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.loesch-reihe input { flex: 1 1 200px; background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: var(--radius-klein); padding: 9px 11px; }

.admin-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linie); font-size: .9rem; }
.admin-zeile:last-child { border-bottom: 0; }
.wahl-liste { display: flex; flex-direction: column; gap: 6px; }
.wahl {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--flaeche2); border: 1px solid var(--linie); border-radius: var(--radius-klein);
  padding: 11px 13px; cursor: pointer; color: inherit; text-align: left;
}
.wahl-aktiv { border-color: var(--gold); }
.wahl-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.wahl-haken { display: inline-flex; color: var(--gold); }
.wahl-fuss { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.such-ergebnis { margin-top: 8px; }
.zeit-summe { margin: -4px 0 4px; }
.version-zeile { margin-top: 14px; }

/* --- Modal, Toasts, Tooltip ----------------------------------------------- */
.modal-huelle {
  position: fixed; inset: 0; z-index: 60; background: rgba(24, 17, 12, .55);
  display: grid; place-items: center; padding: 16px; overflow-y: auto;
}
.modal {
  width: min(560px, 100%); background: var(--flaeche); border: 1px solid var(--linie-stark);
  border-radius: var(--radius); box-shadow: var(--schatten-stark); max-height: 88vh; display: flex; flex-direction: column;
}
.modal-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linie); }
.modal-kopf h2 { font-size: 1.05rem; }
.modal-inhalt { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.modal-fuss { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--linie); flex-wrap: wrap; }

.toasts {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 70;
  display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px));
  pointer-events: none; /* der leere Behaelter darf nichts blockieren */
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 9px; background: var(--tt-bg); color: var(--tt-text);
  padding: 11px 14px; border-radius: var(--radius-klein); box-shadow: var(--schatten-stark);
  font-size: .88rem; animation: einblenden var(--tempo) ease-out;
}
.toast-icon { display: inline-flex; }
.toast-ok { border-left: 4px solid #4e9d63; }
.toast-fehler { border-left: 4px solid #c0563a; }
.toast-weg { opacity: 0; transition: opacity .35s; }
@keyframes einblenden { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tooltip {
  position: absolute; z-index: 80; background: var(--tt-bg); color: var(--tt-text);
  padding: 9px 12px; border-radius: var(--radius-klein); font-size: .82rem;
  box-shadow: var(--schatten-stark); pointer-events: none; max-width: 320px; border: 1px solid var(--linie-stark);
}
.tt-titel { font-weight: 700; margin-bottom: 3px; }
.tt-zeile { line-height: 1.45; }
.tooltip .dezent { opacity: .75; color: inherit; }

/* --- Desktop-Raster ab 900 px --------------------------------------------
   Echte zweispaltige Anordnung: die Seitenleiste bekommt eine eigene Spalte,
   Kopf und Inhalt beginnen rechts daneben. (Fehlerbild 1.0.1: Überlappung.) */
@media (max-width: 420px) {
  .kopf-titel { max-width: 62vw; }
  .kopf-unter { display: none; }
}

@media (min-width: 900px) {
  .app { padding-left: var(--sidebar-w); padding-bottom: 0; }
  .tabbar {
    top: 0; bottom: 0; right: auto; width: var(--sidebar-w);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; border-top: 0; border-right: 1px solid var(--linie);
    padding: 16px var(--sidebar-pad);
  }
  .tab { flex: 0 0 auto; padding: 12px var(--sidebar-pad); font-size: .76rem; gap: 4px; }
  .tab-icon svg { width: 22px; height: 22px; }
  .toasts { left: calc(var(--sidebar-w) + 24px); transform: none; bottom: 24px; }
  .inhalt { padding: 22px 26px 60px; }
  .kopf-inner { padding: 12px 26px; }
  .kacheln { grid-template-columns: repeat(4, 1fr); }
  .karte { padding: 20px; }
}

@media (min-width: 1280px) {
  .inhalt, .kopf-inner { max-width: 1180px; }
}

@media print {
  .tabbar, .kopf-aktionen, .detail-aktionen, .toasts, .tooltip { display: none !important; }
  .app { padding: 0; }
  .karte { break-inside: avoid; box-shadow: none; }
}
