/* Botanica Planer – Gestaltung nach den Botanica-Gestaltungsregeln
   Farben: Lila #5B45DB, Dunkelblau #141A3D, Blütenlila #E4DEFD, Lavendel #E9E5FA, Grund #F6F5FA, Text #3D4366
   Schrift: Inter SemiBold (Text, Überschriften), Space Mono (Wortmarke, Beschriftungen, Zahlen) */

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/fonts/SpaceMono-Regular.woff2") format("woff2"), url("/fonts/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --lila: #5B45DB;
  --lila-hell: #7562E6;
  --blau: #141A3D;
  --bluete: #E4DEFD;
  --lavendel: #E9E5FA;
  --grund: #F6F5FA;
  --text: #3D4366;
  --leise: #7C8099;
  --linie: #E3DFF5;
  --weiss: #FFFFFF;
  --sans: "Inter", Helvetica, Arial, sans-serif;
  --mono: "Space Mono", Menlo, "Courier New", monospace;
  --r: 14px;
  --schatten: 0 1px 2px rgba(20, 26, 61, .06), 0 8px 24px rgba(20, 26, 61, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--text);
  background: var(--grund);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { color: var(--blau); font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: var(--lila); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-weight: 400; }
.leise { color: var(--leise); }
.hidden { display: none !important; }
[hidden] { display: none !important; }

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

/* ---------- Bausteine ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  background: var(--blau); color: var(--weiss); font-weight: 600; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: #232b5c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.lila { background: var(--lila); }
.btn.lila:hover { background: #4c37c9; }
.btn.zweit { background: var(--lavendel); color: var(--blau); }
.btn.zweit:hover { background: var(--bluete); }
.btn.rand { background: transparent; color: var(--blau); box-shadow: inset 0 0 0 1.5px var(--linie); }
.btn.rand:hover { box-shadow: inset 0 0 0 1.5px var(--lila); }
.btn.klein { padding: 6px 12px; font-size: 13px; }
.btn.icon { padding: 8px; width: 36px; height: 36px; }
.btn.gefahr { background: transparent; color: var(--blau); box-shadow: inset 0 0 0 1.5px var(--blau); }

.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.feld > span, .label {
  font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--leise);
  letter-spacing: .03em; text-transform: lowercase;
}
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time],
input[type=number], select, textarea {
  width: 100%; border: 1.5px solid var(--linie); background: var(--weiss); border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--lila); }
textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.reihe { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.reihe > .feld { flex: 1; min-width: 140px; }

.karte {
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r);
  padding: 20px; box-shadow: var(--schatten);
}

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--lila); flex: none; }

.segment { display: inline-flex; background: var(--lavendel); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.segment button {
  border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center; color: var(--blau);
}
.segment button.an { background: var(--weiss); box-shadow: 0 1px 3px rgba(20,26,61,.12); color: var(--lila); }
.segment svg { width: 16px; height: 16px; }

.hinweis {
  border-radius: 12px; padding: 12px 14px; background: var(--lavendel); color: var(--blau);
  font-size: 14px; margin-bottom: 12px;
}
.hinweis.stark { background: var(--blau); color: var(--bluete); }
.hinweis.fehler {
  background: repeating-linear-gradient(135deg, var(--weiss) 0 8px, var(--lavendel) 8px 16px);
  box-shadow: inset 0 0 0 1.5px var(--blau);
}
.hinweis ul { margin: 6px 0 0; padding-left: 18px; }

/* Status-Kennzeichnung – nur Lila, Dunkelblau und helle Lila-Töne */
.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px;
  font-family: var(--mono); font-weight: 400; font-size: 12px; white-space: nowrap;
}
.st-draft { background: var(--grund); color: var(--text); box-shadow: inset 0 0 0 1.5px #C9C0F4; }
.st-review { background: var(--lavendel); color: var(--blau); box-shadow: inset 3px 0 0 var(--lila); }
.st-scheduled { background: var(--lila); color: var(--weiss); }
.st-published { background: var(--blau); color: var(--bluete); }
.st-reminder { background: var(--bluete); color: var(--blau); box-shadow: inset 0 0 0 1.5px var(--lila); }
.st-failed {
  background: repeating-linear-gradient(135deg, var(--weiss) 0 5px, var(--lavendel) 5px 10px);
  color: var(--blau); box-shadow: inset 0 0 0 1.5px var(--blau);
}
.badge.st-draft { box-shadow: inset 0 0 0 1px #C9C0F4; }
.badge.st-review { box-shadow: inset 0 0 0 1.5px var(--lila); color: var(--lila); }
.zeile .badge { justify-self: end; }

/* ---------- Anmeldung ---------- */

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--lila); position: relative; overflow: hidden;
}
.login .bluete-gross { position: absolute; width: 900px; height: 900px; right: -260px; top: -160px; opacity: .14; }
.login .karte { width: min(400px, 100%); position: relative; padding: 32px; border: 0; }
.login .marke { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login .btn { width: 100%; margin-top: 8px; padding: 12px; }
.login .fehlertext { color: var(--blau); min-height: 20px; font-size: 14px; margin-top: 10px; }

.wortmarke { font-family: var(--mono); font-weight: 400; color: var(--lila); font-size: 22px; letter-spacing: -.01em; }
.logo-kachel { width: 40px; height: 40px; border-radius: 11px; background: var(--lila); display: grid; place-items: center; flex: none; }
.logo-kachel svg { width: 30px; height: 30px; }

/* ---------- Rahmen ---------- */

.kopf {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
}
.kopf-innen { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; }
.kopf .marke { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.kopf .marke .zusatz { font-family: var(--mono); font-size: 12px; color: var(--leise); padding: 2px 8px; border-radius: 999px; background: var(--lavendel); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a {
  text-decoration: none; color: var(--blau); padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { background: var(--grund); }
.nav a.an { background: var(--lila); color: var(--weiss); }
.nav .zahl { font-family: var(--mono); font-size: 11px; background: var(--bluete); color: var(--blau); border-radius: 999px; padding: 0 6px; }
.nav a.an .zahl { background: rgba(255,255,255,.22); color: var(--weiss); }
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.puls { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--leise); white-space: nowrap; }
.puls i { width: 8px; height: 8px; border-radius: 50%; background: var(--lila); box-shadow: 0 0 0 0 rgba(91,69,219,.5); animation: puls 2.4s infinite; }
.puls.aus i { background: var(--blau); animation: none; box-shadow: 0 0 0 2px var(--bluete); }
@keyframes puls { 0% { box-shadow: 0 0 0 0 rgba(91,69,219,.45); } 70% { box-shadow: 0 0 0 7px rgba(91,69,219,0); } 100% { box-shadow: 0 0 0 0 rgba(91,69,219,0); } }
.ich { position: relative; }
.ich > button { border: 0; background: var(--lavendel); color: var(--blau); border-radius: 999px; padding: 6px 12px 6px 6px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blau); color: var(--bluete); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
.menue { position: absolute; right: 0; top: calc(100% + 6px); background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px; box-shadow: var(--schatten); padding: 6px; min-width: 200px; }
.menue button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--blau); }
.menue button:hover { background: var(--grund); }

main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 80px; }
.seitenkopf { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.seitenkopf .kapitel { font-family: var(--mono); font-size: 12px; color: var(--lila); display: block; margin-bottom: 2px; }
.seitenkopf .aktionen { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Übersichtszahlen ---------- */

.zahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.zahlen a { text-decoration: none; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); padding: 12px 16px; color: var(--blau); display: flex; align-items: baseline; gap: 10px; }
.zahlen a:hover { border-color: var(--lila); }
.zahlen b { font-family: var(--mono); font-weight: 400; font-size: 26px; color: var(--lila); }
.zahlen a.warn b { color: var(--blau); }

/* ---------- Kalender ---------- */

.kal { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; box-shadow: var(--schatten); }
.kal-kopf, .kal-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kal-kopf div { padding: 10px 12px; font-family: var(--mono); font-size: 12px; color: var(--leise); border-bottom: 1px solid var(--linie); }
.tag { min-height: 126px; border-right: 1px solid var(--linie); border-bottom: 1px solid var(--linie); padding: 6px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.tag:nth-child(7n) { border-right: 0; }
.tag.fremd { background: #FBFAFD; }
.tag.fremd .nr { color: #B9BCCF; }
.tag.ziel { background: var(--lavendel); }
.tag .oben { display: flex; align-items: center; justify-content: space-between; }
.tag .nr { font-family: var(--mono); font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--blau); }
.tag.heute .nr { background: var(--lila); color: var(--weiss); }
.tag .plus { opacity: 0; border: 0; background: var(--lavendel); color: var(--lila); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; transition: opacity .15s; }
.tag:hover .plus { opacity: 1; }
.tag.vergangen .plus { display: none; }

.chip {
  display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 5px 7px; cursor: pointer;
  font-size: 12px; line-height: 1.25; overflow: hidden; border: 0; text-align: left; width: 100%;
}
.chip .zeit { font-family: var(--mono); font-weight: 400; font-size: 11px; flex: none; }
.chip svg { width: 13px; height: 13px; flex: none; }
.chip .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip img, .chip .vid { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; flex: none; background: rgba(255,255,255,.4); }
.chip[draggable=true] { cursor: grab; }
.chip:hover { filter: brightness(.97); }
.mehr { font-family: var(--mono); font-size: 11px; color: var(--lila); background: none; border: 0; text-align: left; cursor: pointer; padding: 2px 4px; }

/* Termine: Farbe kommt aus der Rubrik (--farbe), bewusst über die CI-Palette hinaus – internes Werkzeug */
.chip.termin { background: var(--weiss); color: var(--blau); box-shadow: inset 3px 0 0 var(--farbe), inset 0 0 0 1px var(--linie); padding-left: 9px; }
.chip.termin.balken { background: var(--farbe-hell); box-shadow: inset 3px 0 0 var(--farbe); }
.chip.termin .zeit { color: var(--farbe); filter: brightness(.8); }
.chip .rub-punkt { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px rgba(255,255,255,.8); }
.chip .wdh { margin-left: auto; flex: none; font-size: 12px; opacity: .65; }
.monat-titel { position: relative; }
.monat-knopf { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.monat-knopf svg { width: 22px; height: 22px; color: var(--lila); }
.monat-knopf:hover { color: var(--lila); }
.monatswahl { left: 0; right: auto; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 10px; }
.monatswahl .mw-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.monatswahl .mw-kopf b { font-family: var(--mono); font-weight: 400; color: var(--blau); }
.monatswahl .mw-kopf button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.monatswahl .mw-kopf svg { width: 18px; height: 18px; }
.monatswahl .mw-raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.monatswahl .mw-raster button { text-align: center; padding: 9px 0; }
.monatswahl .mw-raster button.jetzt { box-shadow: inset 0 0 0 1.5px var(--lila); }
.monatswahl .mw-raster button.an { background: var(--lila); color: var(--weiss); }
.plus-menue { top: 30px; z-index: 5; min-width: 180px; }
.plus-menue button { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.plus-menue svg { width: 16px; height: 16px; color: var(--lila); }

.legende { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.legende button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 6px 12px; background: var(--weiss); box-shadow: inset 0 0 0 1.5px var(--linie); cursor: pointer; color: var(--blau); font-size: 13px; }
.legende button i { width: 10px; height: 10px; border-radius: 50%; background: var(--farbe); flex: none; }
.legende button svg { width: 15px; height: 15px; color: var(--lila); }
.legende button.aus { opacity: .45; text-decoration: line-through; }
.legende button.aus i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--farbe); }
.legende .trenner { width: 1px; height: 20px; background: var(--linie); margin: 0 4px; }
.legende .verwalten { box-shadow: none; background: none; color: var(--lila); text-decoration: underline; text-underline-offset: 3px; }

.zeile.termin-zeile { box-shadow: inset 4px 0 0 var(--farbe); }
.zeile .vorschau.farbfeld { background: var(--farbe-hell); color: var(--farbe); }
.badge.rubrik { background: var(--farbe-hell); color: var(--blau); box-shadow: inset 0 0 0 1.5px var(--farbe); }
.agenda .tagkopf { display: flex; align-items: center; justify-content: space-between; }
.agenda .tagkopf .plus { border: 0; background: var(--lavendel); color: var(--lila); width: 28px; height: 28px; border-radius: 50%; font-size: 17px; cursor: pointer; position: relative; }
.agenda .tagkopf { position: relative; }

/* Dialoge für Termine und Rubriken */
.dialog { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog .knoepfe .luecke { flex: 1; }
.ganztags .nur-zeit { display: none; }
.meta-zeile { font-size: 12px; margin: 4px 0 8px; }
.farben { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 16px; }
.farben button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--farbe); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(20,26,61,.12); }
.farben button.an { box-shadow: 0 0 0 2px var(--weiss), 0 0 0 4px var(--blau); }
.farben .eigene { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--leise); cursor: pointer; }
.farben .eigene input, .rubrik-zeile input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.rubrik-liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rubrik-zeile { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rubrik-zeile input[type=text] { width: 100%; }

.ohne-termin { margin-top: 18px; }
.ohne-termin .liste-klein { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ohne-termin .chip { width: auto; max-width: 280px; }

/* Agenda (Handy) */
.agenda { display: none; }
.agenda .tagkopf { font-family: var(--mono); font-size: 12px; color: var(--lila); margin: 18px 0 8px; }
.agenda .tagkopf.heute span::after { content: " · heute"; color: var(--blau); }

/* ---------- Liste ---------- */

.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter button { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--weiss); box-shadow: inset 0 0 0 1.5px var(--linie); cursor: pointer; color: var(--blau); }
.filter button.an { background: var(--blau); color: var(--weiss); box-shadow: none; }
.zeilen { display: flex; flex-direction: column; gap: 8px; }
.zeile {
  display: grid; grid-template-columns: 64px 150px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); padding: 10px 14px 10px 10px; cursor: pointer;
}
.zeile:hover { border-color: var(--lila); }
.zeile .vorschau { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--lavendel); display: grid; place-items: center; color: var(--lila); }
.zeile .vorschau svg { width: 22px; height: 22px; }
.zeile .wann { font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--blau); }
.zeile .wann small { display: block; color: var(--leise); font-size: 11px; }
.zeile .was { min-width: 0; }
.zeile .was .titel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--blau); }
.zeile .was .meta { font-size: 13px; color: var(--leise); display: flex; gap: 10px; align-items: center; }
.zeile .was .meta svg { width: 14px; height: 14px; color: var(--lila); }
.leer { text-align: center; padding: 48px 20px; color: var(--leise); }
.leer svg { width: 64px; height: 64px; margin-bottom: 8px; }

/* ---------- Editor ---------- */

.overlay { position: fixed; inset: 0; background: rgba(20, 26, 61, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.editor {
  width: min(1240px, 100%); height: min(100%, 940px); background: var(--grund); border-radius: 20px;
  display: grid; grid-template-rows: auto 1fr; overflow: hidden; box-shadow: 0 24px 64px rgba(20,26,61,.3);
}
.editor-kopf { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--weiss); border-bottom: 1px solid var(--linie); }
.editor-kopf h2 { font-size: 18px; }
.editor-kopf .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.editor-koerper { display: grid; grid-template-columns: minmax(0, 1fr) 400px; overflow: hidden; }
.editor-form { overflow-y: auto; padding: 22px 24px 40px; }
.editor-seite { overflow-y: auto; padding: 22px 22px 40px; background: var(--weiss); border-left: 1px solid var(--linie); }
.abschnitt { margin-bottom: 24px; }
.abschnitt > h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.abschnitt > h3 .nr { font-family: var(--mono); font-weight: 400; color: var(--lila); font-size: 12px; }
.zaehler { display: flex; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--leise); margin-top: 6px; }
.zaehler .zu-viel { color: var(--blau); background: var(--bluete); border-radius: 4px; padding: 0 4px; }

.medien { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.medium { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--blau); }
.medium img, .medium video { width: 100%; height: 100%; object-fit: cover; display: block; }
.medium .leiste { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; gap: 4px; justify-content: space-between; }
.medium .leiste button { border: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--blau); cursor: pointer; font-size: 13px; }
.medium .info { position: absolute; left: 6px; top: 6px; font-family: var(--mono); font-size: 10px; background: rgba(20,26,61,.75); color: var(--bluete); border-radius: 6px; padding: 1px 6px; }
.medium .lade { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20,26,61,.6); color: var(--weiss); font-family: var(--mono); font-size: 12px; }
.ablage {
  aspect-ratio: 1; border-radius: 12px; border: 2px dashed #C9C0F4; display: grid; place-items: center; text-align: center;
  color: var(--lila); cursor: pointer; padding: 10px; font-size: 13px; background: var(--weiss);
}
.ablage.ueber { background: var(--lavendel); border-color: var(--lila); }
.ablage svg { width: 26px; height: 26px; display: block; margin: 0 auto 4px; }

.titelbild {
  display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 18px; margin-top: 14px;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); padding: 14px;
}
.tb-gross { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--blau); align-self: start; }
.tb-gross video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-label { position: absolute; left: 6px; top: 6px; font-family: var(--mono); font-size: 10px; background: var(--lila); color: var(--weiss); border-radius: 6px; padding: 1px 6px; }
.tb-zeit { position: absolute; left: 6px; bottom: 6px; font-family: var(--mono); font-size: 11px; background: rgba(20, 26, 61, .78); color: var(--bluete); border-radius: 6px; padding: 1px 6px; }
.tb-rechts { min-width: 0; }
.tb-streifen { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; margin: 8px 0 14px; }
.tb-streifen button { border: 0; padding: 0; aspect-ratio: 9 / 16; border-radius: 7px; overflow: hidden; cursor: pointer; background: var(--lavendel); outline: 3px solid transparent; outline-offset: 1px; transition: outline-color .15s, transform .1s; }
.tb-streifen button:active { transform: scale(.96); }
.tb-streifen button.an { outline-color: var(--lila); }
.tb-streifen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-lade { aspect-ratio: 9 / 16; border-radius: 7px; background: linear-gradient(100deg, var(--lavendel) 30%, var(--bluete) 50%, var(--lavendel) 70%); background-size: 300% 100%; animation: schimmer 1.4s infinite linear; }
@keyframes schimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.tb-regler { width: 100%; accent-color: var(--lila); height: 28px; }
.tb-rechts p { font-size: 13px; margin: 6px 0 0; }
.pruef { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); padding: 12px 16px; }
.pruef .check { border-bottom: 1px solid var(--grund); }
.pruef .check:last-child { border-bottom: 0; }

.aktionsleiste { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.verlauf { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.verlauf li { padding: 8px 0; border-bottom: 1px solid var(--grund); display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.verlauf time { font-family: var(--mono); font-size: 11px; color: var(--leise); }
.verlauf .detail { color: var(--leise); display: block; }

/* Handy-Vorschau */
.telefon { width: 300px; margin: 0 auto 14px; background: var(--blau); border-radius: 36px; padding: 10px; box-shadow: var(--schatten); }
.bildschirm { background: var(--weiss); border-radius: 28px; overflow: hidden; position: relative; aspect-ratio: 9 / 16; display: flex; flex-direction: column; }
.bildschirm .ig-kopf { display: flex; align-items: center; gap: 8px; padding: 30px 12px 8px; font-size: 12px; color: var(--blau); }
.bildschirm .ig-kopf .logo-kachel { width: 26px; height: 26px; border-radius: 50%; }
.bildschirm .ig-kopf .logo-kachel svg { width: 18px; height: 18px; }
.bildschirm .ig-medium { position: relative; background: var(--grund); overflow: hidden; }
.bildschirm .ig-medium img, .bildschirm .ig-medium video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bildschirm .punkte { display: flex; gap: 5px; justify-content: center; padding: 8px; }
.bildschirm .punkte button { width: 6px; height: 6px; border-radius: 50%; border: 0; padding: 0; background: #C9C0F4; cursor: pointer; transition: background .15s, transform .15s; }
.bildschirm .punkte button.an { background: var(--lila); transform: scale(1.25); }
.kv-spur { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.kv-spur::-webkit-scrollbar { display: none; }
.kv-folie { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; background: var(--grund); }
.kv-folie img, .kv-folie video { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.kv-pfeil { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255, 255, 255, .9); color: var(--blau); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(20, 26, 61, .25); }
.kv-pfeil svg { width: 16px; height: 16px; }
.kv-pfeil.links { left: 8px; }
.kv-pfeil.rechts { right: 8px; }
.kv-zaehler { position: absolute; right: 10px; top: 10px; z-index: 4; font-family: var(--mono); font-size: 10px; background: rgba(20, 26, 61, .72); color: var(--weiss); border-radius: 999px; padding: 2px 8px; }
.bildschirm .ig-text { padding: 0 12px 12px; font-size: 11.5px; color: var(--blau); white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.bildschirm.voll .ig-medium { position: absolute; inset: 0; }
.bildschirm.voll .ig-kopf { position: absolute; top: 0; left: 0; right: 0; z-index: 2; color: var(--weiss); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.bildschirm.voll .ig-text { position: absolute; left: 0; right: 40px; bottom: 30px; color: var(--weiss); z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,.5); -webkit-line-clamp: 2; }
.bildschirm .leer-medium { position: absolute; inset: 0; display: grid; place-items: center; color: #B9AEF5; font-family: var(--mono); font-size: 12px; text-align: center; padding: 20px; }
.abspielen {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(20, 26, 61, .72); color: var(--weiss); display: grid; place-items: center;
}
.abspielen svg { width: 28px; height: 28px; margin-left: 4px; }
.abspielen[hidden], .video-fehler[hidden] { display: none; }
.video-fehler {
  position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); z-index: 5;
  background: rgba(20, 26, 61, .85); color: var(--bluete); border-radius: 10px; padding: 10px; font-size: 11px; text-align: center;
}
.ig-medium video { cursor: pointer; }
.ton {
  position: absolute; right: 10px; bottom: 10px; z-index: 5; border: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px 6px 8px;
  background: rgba(20, 26, 61, .78); color: var(--weiss); font-family: var(--mono); font-size: 11px;
}
.ton svg { width: 15px; height: 15px; }
.bildschirm.voll .ton { bottom: auto; top: 64px; }
.sicher { position: absolute; left: 0; right: 0; z-index: 3; background: repeating-linear-gradient(135deg, rgba(91,69,219,.55) 0 6px, rgba(91,69,219,.25) 6px 12px); color: var(--weiss); font-family: var(--mono); font-size: 9px; display: grid; place-items: center; text-align: center; }

/* ---------- Konten & Team ---------- */

.raster-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.konto .kopfzeile { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.konto .kopfzeile .logo-kachel { border-radius: 50%; }
.konto dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 14px; font-size: 14px; }
.konto dt { font-family: var(--mono); font-size: 12px; color: var(--leise); }
.konto dd { margin: 0; color: var(--blau); }
.tabelle { width: 100%; border-collapse: collapse; background: var(--weiss); border-radius: var(--r); overflow: hidden; border: 1px solid var(--linie); }
.tabelle th, .tabelle td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--grund); }
.tabelle th { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--leise); }
.zwei-spalten { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.dialog { width: min(460px, 100%); background: var(--weiss); border-radius: 18px; padding: 24px; box-shadow: 0 24px 64px rgba(20,26,61,.3); }
.dialog h2 { margin-bottom: 16px; }
.dialog.crop { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.crop-buehne {
  position: relative; overflow: hidden; margin: 16px auto 12px; border-radius: 10px; background: var(--blau);
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.crop-buehne:active { cursor: grabbing; }
.crop-buehne img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.crop-raster {
  position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
  background-image: linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% + .5px), transparent calc(66.66% + .5px));
}
.crop-zoom { display: flex; align-items: center; gap: 12px; }
.crop-zoom input { flex: 1; accent-color: var(--lila); }
.dialog .knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--blau); color: var(--weiss); padding: 11px 18px; border-radius: 999px; box-shadow: var(--schatten); max-width: min(560px, 92vw); font-size: 14px; animation: rein .2s ease-out; pointer-events: auto; }
.toast.fehler { background: var(--weiss); color: var(--blau); box-shadow: inset 0 0 0 2px var(--blau), var(--schatten); border-radius: 14px; }
@keyframes rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Handy ---------- */

/* Tablet (iPad): Platz in der Kopfzeile, Plus-Knopf ohne Maus sichtbar */
@media (max-width: 1100px) {
  .puls span { display: none; }
  .chip img { display: none; }
  .kopf-innen { gap: 14px; }
}
@media (hover: none) {
  .tag .plus { opacity: .75; }
}
@media (max-width: 960px) {
  .editor-koerper { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .editor-form, .editor-seite { overflow: visible; }
  .editor-seite { border-left: 0; border-top: 1px solid var(--linie); }
  .zwei-spalten { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .kopf-innen { flex-wrap: wrap; gap: 8px 12px; padding: 8px 14px; }
  .nav { order: 3; width: 100%; }
  .puls span { display: none; }
  main { padding: 16px 14px 80px; }
  .kal { display: none; }
  .agenda { display: block; }
  .zahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zeile { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; }
  .zeile .vorschau { width: 56px; height: 56px; grid-row: span 3; }
  .zeile .wann small { display: inline; margin-left: 6px; }
  .zeile .badge { justify-self: start; }
  .segment { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .segment button { padding: 7px 11px; flex: none; }
  #fmt { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 14px; width: 100%; }
  #fmt button { flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 13px; border-radius: 10px; }
  #modus { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 14px; width: 100%; }
  #modus button { border-radius: 10px; justify-content: center; white-space: normal; }
  .telefon { width: min(300px, 100%); }
  .titelbild { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .tb-streifen { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overlay { padding: 0; }
  .editor { border-radius: 0; height: 100%; }
  .seitenkopf h1 { font-size: 22px; }
}
