/* Kalender - Optik aus den Entwuerfen (austausch: zeitkiste-handoff/mockup).
 * Farben, Abstaende und Schriftgroessen sind dort abgelesen, nicht erfunden. */

@font-face {
  font-family: 'Geist';
  src: url('schrift/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('schrift/geist-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --grund: #0D0F13;
  --flaeche: #161920;
  --flaeche2: #1E222B;
  --karte2: #0F1217;
  --blatt: #14171D;
  --blatt-grund: #08090C;
  --linie: #20242D;
  --linie2: #272C36;
  --linie3: #2A2F3A;
  --raster: #1D2129;
  --strich: #3A404C;
  --kasten: #4A5160;
  --text: #EDEFF3;
  --text2: #C9CED6;
  --text3: #B9BFC9;
  --gedaempft: #9CA3B0;
  --leise: #8A919E;
  --leiser: #7A8290;
  --aus: #6E7583;
  --akzent: #B794FF;
  --gelb: #F5C451;
  --tuerkis: #3DD6B0;
  --regen: #7FB2FF;
  --jetzt: #FF6B6B;
  --sonntag: #FF9C9C;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grund); color: var(--text); }
body {
  font-family: var(--sans); font-size: 14px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--text); }
.mono { font-family: var(--mono); }
.versteckt { display: none !important; }
svg { flex: none; }

/* ---- Grundgeruest ----------------------------------------------------------- */
#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.seite { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding-top: var(--oben); }
.rollen { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.kopf { padding: 14px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kopf .titel { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kopf .unter { font-size: 12px; color: var(--gedaempft); font-weight: 500; }
.kopf h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; }
.kopf .knoepfe { display: flex; align-items: center; gap: 6px; }
.rund { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.rund.voll { background: var(--flaeche2); border: 1px solid var(--linie3); }
.pille {
  height: 36px; padding: 0 12px; border-radius: 18px; background: var(--flaeche2);
  border: 1px solid var(--linie3); font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 6px;
}

/* Filter-Chips */
.chips { display: flex; gap: 6px; padding: 10px 16px 8px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 10px; border-radius: 16px; background: var(--flaeche);
  border: 1px solid var(--linie2); font-weight: 500; font-size: 12px; display: flex; align-items: center; gap: 6px;
}
.chip .punkt { width: 8px; height: 8px; border-radius: 4px; background: var(--f); }
.chip.aus { background: transparent; border: 1px dashed var(--strich); color: var(--gedaempft); }
.chip.aus .punkt { background: transparent; border: 1.5px solid var(--f); }

/* ---- Wochenraster ----------------------------------------------------------- */
.woche { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.tagkopf { display: flex; padding: 0 8px; border-bottom: 1px solid var(--linie); }
.zeitspalte { width: 30px; flex: none; }
.tk {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0 6px; border-radius: 10px 10px 0 0;
}
.tk .wt { font-size: 10px; color: var(--gedaempft); font-weight: 500; }
.tk .nr { font-size: 15px; font-weight: 600; height: 26px; line-height: 26px; min-width: 26px; text-align: center; }
.tk.heute { background: rgba(255, 255, 255, 0.03); }
.tk.heute .wt { color: var(--text); font-weight: 600; }
.tk.heute .nr { font-weight: 700; width: 26px; border-radius: 13px; background: var(--text); color: var(--grund); }
.tk.rot .wt, .tk.rot .nr { color: var(--sonntag); }
.tk.heute.rot .nr { color: var(--grund); }
.tk .we { display: flex; align-items: center; gap: 2px; font: 400 9px var(--mono); color: var(--gedaempft); min-height: 11px; }
.tk button { display: contents; }

.ganz { display: flex; padding: 4px 8px; border-bottom: 1px solid var(--linie); }
.ganz .zeitspalte { font-size: 9px; color: var(--leise); padding-top: 3px; }
.ganz .bahn { flex: 1 1 auto; position: relative; }
.gt {
  position: absolute; font-size: 9px; font-weight: 500; padding: 2px 4px; border-radius: 4px; height: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
  background: color-mix(in srgb, var(--f) 20%, transparent); color: color-mix(in srgb, var(--f) 24%, white);
}
.gt.feiertag { background: rgba(156, 163, 176, 0.16); color: #D3D7DE; }
.ganz .mehr { position: absolute; font-size: 9px; color: var(--gedaempft); }

.raster-rollen { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; }
.raster { display: flex; padding: 8px 8px 0; }
.stunden { width: 30px; flex: none; display: flex; flex-direction: column; font: 400 9px var(--mono); color: var(--leiser); }
.stunden div { transform: translateY(-5px); }
.spalten {
  flex: 1 1 auto; display: flex; position: relative;
  background-image: repeating-linear-gradient(to bottom, var(--raster) 0, var(--raster) 1px, transparent 1px, transparent var(--std));
}
.sp { flex: 1 1 0; min-width: 0; position: relative; border-left: 1px solid var(--raster); }
.sp.heute { background: rgba(255, 255, 255, 0.03); }
.t {
  position: absolute; box-sizing: border-box; border-radius: 6px; padding: 3px 4px; overflow: hidden;
  text-align: left; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  background: color-mix(in srgb, var(--f) 24%, transparent); color: color-mix(in srgb, var(--f) 24%, white);
}
.t.gemeinsam { background: color-mix(in srgb, var(--f) 26%, transparent); }
.t .tt { font-size: 10px; font-weight: 600; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.t > * { flex-shrink: 0; }
.t .tz { font: 400 9px var(--mono); opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t .tw { display: flex; align-items: center; gap: 2px; font-size: 8px; margin-top: 4px; opacity: 0.85; }
.t.kurz .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
.t.gesperrt { background: color-mix(in srgb, var(--f) 14%, transparent); border: 1px solid color-mix(in srgb, var(--f) 45%, transparent); }
.t.gesperrt { padding-left: 3px; padding-right: 2px; }
.t.gesperrt .tt { display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; hyphens: none; letter-spacing: -0.01em; }
.t.gesperrt.eng .tt, .t.gesperrt .tt { font-size: 9px; }
.dk-haupt .t.gesperrt .tt, .woche.tag .t.gesperrt .tt { font-size: inherit; }
.t.eng .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; hyphens: none; }
.t.vorbei { opacity: 0.55; }
.jetzt { position: absolute; left: -3px; right: 0; height: 2px; background: var(--jetzt); z-index: 2; pointer-events: none; }
.jetzt::before { content: ''; position: absolute; left: -1px; top: -3px; width: 8px; height: 8px; border-radius: 4px; background: var(--jetzt); }

/* Tagesansicht */
.woche.tag .tk { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 6px 10px; }
.woche.tag .tk .nr { font-size: 18px; }
.woche.tag .t { padding: 6px 8px; border-radius: 8px; }
.woche.tag .t .tt { font-size: 13px; }
.woche.tag .t .tz { font-size: 11px; }
.t .to { font-size: 11px; opacity: 0.8; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Monatsansicht */
.monat { flex: 1 1 auto; display: flex; flex-direction: column; padding: 0 8px 8px; min-height: 0; overflow-y: auto; }
.monat .mk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: 10px; color: var(--gedaempft); text-align: center; padding: 4px 0 6px; border-bottom: 1px solid var(--linie); }
.monat .mr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex: 1 1 0; min-height: 76px; border-bottom: 1px solid var(--raster); }
.mz { border-left: 1px solid var(--raster); padding: 3px 2px; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.mz:first-child { border-left: none; }
.mz .nr { font-size: 12px; font-weight: 600; height: 22px; width: 22px; line-height: 22px; text-align: center; border-radius: 11px; align-self: center; }
.mz.fremd .nr { color: #4F5562; }
.mz.heute .nr { background: var(--text); color: var(--grund); font-weight: 700; }
.mz.rot .nr { color: var(--sonntag); }
.mz.heute.rot .nr { color: var(--grund); }
.mt { font-size: 9px; font-weight: 500; padding: 1px 3px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--f) 22%, transparent); color: color-mix(in srgb, var(--f) 24%, white); }
.mz .mehr { font-size: 9px; color: var(--gedaempft); padding-left: 3px; }

/* ---- Unten: Schnell-Eintrag + Reiter ------------------------------------------------- */
.unten { padding: 10px 12px 0; border-top: 1px solid var(--linie); background: var(--grund); }
.schnellzeile {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 5px 0 14px; border-radius: 23px;
  background: var(--flaeche); border: 1px solid var(--linie2); color: var(--leise); font-size: 14px; width: 100%; text-align: left;
}
.schnellzeile .platz { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schnellzeile .plus { width: 36px; height: 36px; border-radius: 18px; background: var(--text); color: var(--grund); display: flex; align-items: center; justify-content: center; }
nav.reiter { display: flex; justify-content: space-around; padding: 6px 0 calc(12px + var(--unten)); }
nav.reiter a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 72px; padding: 6px 0;
  text-decoration: none; color: var(--leise); font-size: 11px; font-weight: 500;
}
nav.reiter a.an { color: var(--text); font-weight: 600; }
.listen-unten { border-top: 1px solid var(--linie); background: var(--grund); }

/* ---- Blatt (Schnell-Eintrag, Auswahl) ---------------------------------------------- */
.blatt-huelle { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: rgba(8, 9, 12, 0.72); }
.blatt-huelle .oben { flex: 0 0 calc(64px + var(--oben)); }
.blatt {
  flex: 1 1 auto; background: var(--blatt); border-radius: 24px 24px 0 0; border-top: 1px solid var(--linie2);
  padding: 10px 16px calc(20px + var(--unten)); display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  animation: hoch .18s ease-out;
}
@keyframes hoch { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.blatt > *, .inhalt-detail > *, .mitte > *, .dialog > * { flex-shrink: 0; }
.griff { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--strich); flex: none; }
.blatt .zeile1 { display: flex; align-items: center; justify-content: space-between; }
.blatt h2 { margin: 0; font-size: 18px; font-weight: 650; }
.feldname { font-size: 11px; color: var(--gedaempft); font-weight: 500; }

.eingabe-huelle { position: relative; border-radius: 14px; background: var(--grund); border: 1.5px solid var(--akzent); }
.eingabe-huelle .spiegel, .eingabe-huelle textarea {
  padding: 14px; font-size: 16px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
  margin: 0; border: 0; width: 100%; min-height: 54px; font-family: var(--sans); letter-spacing: normal;
}
.eingabe-huelle .spiegel { color: var(--text); pointer-events: none; }
.eingabe-huelle textarea {
  position: absolute; inset: 0; height: 100%; resize: none; background: transparent; color: transparent;
  caret-color: var(--akzent); outline: none; overflow: hidden;
}
.eingabe-huelle textarea::placeholder { color: var(--leise); }
mark[class^="m-"] { color: inherit; border-radius: 4px; box-shadow: 0 0 0 1.5px var(--m); background: var(--m); }
mark.m-zeit { --m: rgba(108, 155, 255, 0.22); }
mark.m-kalender { --m: rgba(183, 148, 255, 0.26); }
mark.m-ort { --m: rgba(61, 214, 176, 0.2); }
mark.m-erinnerung { --m: rgba(245, 196, 81, 0.2); }
mark.m-wiederholung { --m: rgba(245, 123, 182, 0.2); }
mark.m-privat { --m: rgba(156, 163, 176, 0.24); }
mark.m-liste { --m: rgba(61, 214, 176, 0.2); }

.verstanden { display: flex; flex-direction: column; border-radius: 14px; background: var(--karte2); border: 1px solid var(--linie); }
.verstanden .kopfzeile { padding: 10px 14px 4px; font-size: 11px; color: var(--gedaempft); font-weight: 500; }
.vz {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-bottom: 1px solid var(--raster);
  text-align: left; width: 100%;
}
.vz:last-child { border-bottom: none; }
.vz .inhalt { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 6px 0; min-width: 0; }
.vz .klein { font-size: 11px; color: var(--leise); }
.vz .warn { font-size: 11px; color: var(--gelb); }
.vz.fest .klein::after { content: ' · von dir geändert'; }
.ikon18 { width: 18px; display: flex; justify-content: center; }
.kreis10 { width: 10px; height: 10px; border-radius: 5px; background: var(--f); }
.korrektur { padding: 4px 14px 12px; border-bottom: 1px solid var(--raster); display: flex; flex-direction: column; gap: 8px; }

.knopf-gross {
  height: 50px; border-radius: 25px; background: var(--text); color: var(--grund); font-size: 15px; font-weight: 650;
  display: flex; align-items: center; justify-content: center; width: 100%; flex: none;
}
.knopf-gross:disabled { opacity: .45; }
.knopf-zweit {
  height: 44px; border-radius: 22px; border: 1px solid var(--linie3); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
}
.knopf-rot { color: #FFB4B4; }
.beispiele { display: flex; flex-wrap: wrap; gap: 6px; }
.beispiele button { padding: 6px 10px; border-radius: 10px; background: #1B1F27; font: 400 12px var(--mono); color: var(--text2); }

.auswahl { display: flex; flex-wrap: wrap; gap: 6px; }
.auswahl button {
  height: 34px; padding: 0 12px; border-radius: 17px; background: var(--flaeche); border: 1px solid var(--linie2);
  font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.auswahl button.an { background: var(--linie3); border-color: var(--kasten); font-weight: 600; }
.auswahl button:disabled { opacity: .4; }

input.feld, textarea.feld, select.feld { color: var(--text);
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; background: var(--grund);
  border: 1px solid var(--linie2); outline: none; font-size: 16px;
}
input.feld:focus, textarea.feld:focus, select.feld:focus { border-color: var(--akzent); }
.reihe { display: flex; gap: 8px; align-items: center; }
.reihe > * { flex: 1 1 0; min-width: 0; }

/* ---- Detail ----------------------------------------------------------------------- */
.leiste { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0; }
.zurueck { height: 44px; padding: 0 10px; display: flex; align-items: center; gap: 4px; color: var(--text2); font-size: 14px; font-weight: 500; text-decoration: none; }
.leiste .rechts { height: 44px; padding: 0 14px; font-weight: 600; font-size: 14px; }
.inhalt-detail { padding: 6px 16px calc(24px + var(--unten)); display: flex; flex-direction: column; gap: 14px; }
.kalchip {
  align-self: flex-start; display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px;
  background: color-mix(in srgb, var(--f) 18%, transparent); color: color-mix(in srgb, var(--f) 30%, white); font-size: 12px; font-weight: 600;
}
.kalchip .punkt { width: 7px; height: 7px; border-radius: 4px; background: var(--f); }
.inhalt-detail h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.wann { font-size: 15px; color: var(--text2); }
.wo { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gedaempft); }
.karte { padding: 14px; border-radius: 16px; background: var(--flaeche); border: 1px solid var(--linie); }
.wetterkarte { display: flex; gap: 14px; align-items: center; }
.wetterkarte .gross { font-size: 22px; font-weight: 650; }
.schalter { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); cursor: pointer; }
.schalter input { width: 20px; height: 20px; margin: 0; accent-color: var(--akzent); flex: none; }
.schalter .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.schalter .txt b { font-size: 14px; font-weight: 600; }
.schalter .txt span { font-size: 12px; color: var(--gedaempft); }
.abschnitt { display: flex; flex-direction: column; gap: 8px; }
.abschnitt h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--gedaempft); }
.gruppe { display: flex; flex-direction: column; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); }
.gz { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-bottom: 1px solid var(--raster); font-size: 14px; width: 100%; text-align: left; }
.gz:last-child { border-bottom: none; }
.gz .weg { color: var(--leise); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.gz.leise { color: var(--gedaempft); font-weight: 500; }
.notizkarte { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); text-align: left; width: 100%; }
.haken { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.kaestchen { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--kasten); flex: none; display: flex; align-items: center; justify-content: center; }
.kaestchen.an { background: var(--tuerkis); border: none; }
.haken .durch { text-decoration: line-through; color: var(--leise); }
.pfadzeile { font-size: 11px; color: var(--leise); }

/* ---- Listen und Notizen ----------------------------------------------------------- */
.inhalt-listen { padding: calc(14px + var(--oben)) 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.umschalter { display: flex; padding: 3px; border-radius: 12px; background: var(--flaeche); border: 1px solid var(--linie); gap: 3px; }
.umschalter button { flex: 1; height: 38px; border-radius: 9px; font-weight: 500; font-size: 13px; color: var(--gedaempft); }
.umschalter button.an { background: var(--linie3); color: var(--text); font-weight: 600; }
.liste { border-radius: 16px; background: var(--flaeche); border: 1px solid var(--linie); padding: 6px 0; }
.liste .lk { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 6px; gap: 8px; }
.liste h2 { margin: 0; font-size: 15px; font-weight: 650; }
.liste .meta { font-size: 11px; color: var(--gedaempft); }
.posten { display: flex; align-items: center; gap: 4px; min-height: 46px; padding: 0 14px 0 4px; }
.posten .abhaken { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.box22 { width: 22px; height: 22px; border-radius: 7px; border: 1.8px solid var(--kasten); display: flex; align-items: center; justify-content: center; }
.box22.an { background: var(--tuerkis); border: none; }
.posten .ptext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: left; }
.posten .ptext > span:first-child { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.posten.fertig .ptext > span:first-child { color: var(--aus); text-decoration: line-through; }
.faellig { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--gelb); }
.faellig.vorbei { color: var(--sonntag); }
.wer { flex: none; width: 22px; height: 22px; border-radius: 11px; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: var(--grund); background: var(--f, transparent); }
.neuposten { display: flex; align-items: center; gap: 10px; padding: 4px 14px 6px 16px; }
.neuposten input { flex: 1; min-width: 0; height: 40px; background: transparent; border: none; outline: none; font-size: 14px; }
.neuposten input::placeholder { color: var(--leise); }
.fuss { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 11px; color: var(--leise); }
.suchfeld { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--flaeche); border: 1px solid var(--linie); color: var(--leise); }
.suchfeld input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; font-size: 16px; color: var(--text); }
.notiz { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); text-align: left; width: 100%; }
.notiz .nk { display: flex; align-items: center; gap: 8px; }
.notiz .nt { flex: 1; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.etikett { flex: none; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 10px; font-weight: 600; display: flex; align-items: center;
  background: color-mix(in srgb, var(--f) 20%, transparent); color: color-mix(in srgb, var(--f) 30%, white); }
.notiz .nv { font-size: 13px; color: var(--text3); line-height: 1.4; overflow-wrap: anywhere; }
.notiz .nm { font-size: 11px; color: var(--leise); }
.editor { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; padding: 0 16px calc(16px + var(--unten)); min-height: 0; }
.editor .titelfeld { font-size: 22px; font-weight: 650; background: transparent; border: none; outline: none; padding: 4px 0; width: 100%; }
.editor textarea.text { flex: 1 1 auto; min-height: 240px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 14px; outline: none; font: 400 15px/1.5 var(--mono); resize: none; }
.editor .werkzeug { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vorschau-md { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 14px; font-size: 15px; line-height: 1.5; overflow-y: auto; flex: 1 1 auto; }
.vorschau-md h1, .vorschau-md h2, .vorschau-md h3 { margin: .6em 0 .3em; font-weight: 650; }
.vorschau-md h1 { font-size: 20px; } .vorschau-md h2 { font-size: 17px; } .vorschau-md h3 { font-size: 15px; }
.vorschau-md p { margin: .4em 0; }
.vorschau-md ul { margin: .3em 0; padding-left: 1.3em; }
.vorschau-md li.hk { list-style: none; margin-left: -1.3em; display: flex; gap: 8px; align-items: flex-start; }
.vorschau-md li.hk button { margin-top: 3px; }
.vorschau-md code { font-family: var(--mono); font-size: 13px; background: var(--flaeche2); padding: 1px 4px; border-radius: 4px; }
.vorschau-md a { color: var(--akzent); }
.status-klein { font-size: 11px; color: var(--leise); }

/* ---- Meldungen, Dialoge, Anmelden ------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(150px + var(--unten)); transform: translateX(-50%); z-index: 60;
  background: var(--flaeche2); border: 1px solid var(--linie3); padding: 10px 16px; border-radius: 14px;
  font-size: 13px; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.toast.fehler { border-color: #6B3A3A; }
.banner { margin: 8px 16px 0; padding: 8px 12px; border-radius: 10px; background: var(--flaeche); border: 1px solid var(--linie2); font-size: 12px; color: var(--gedaempft); display: flex; gap: 8px; align-items: center; }
.dialog-huelle { position: fixed; inset: 0; z-index: 50; background: rgba(8, 9, 12, 0.72); display: flex; align-items: flex-end; justify-content: center; }
.dialog {
  width: 100%; max-width: 480px; background: var(--blatt); border-radius: 20px 20px 0 0; border-top: 1px solid var(--linie2);
  padding: 18px 16px calc(18px + var(--unten)); display: flex; flex-direction: column; gap: 10px;
}
.dialog h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.dialog p { margin: 0 0 6px; color: var(--gedaempft); font-size: 13px; }
.mitte { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; padding: 24px; gap: 18px; max-width: 460px; margin: 0 auto; width: 100%; }
.logo { width: 56px; height: 56px; border-radius: 16px; background: var(--text); color: var(--grund); display: flex; align-items: center; justify-content: center; }
.mitte h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.mitte p { margin: 0; color: var(--text2); line-height: 1.5; }
.schritte { display: flex; flex-direction: column; gap: 0; border-radius: 14px; background: var(--flaeche); border: 1px solid var(--linie); }
.schritt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--raster); font-size: 14px; }
.schritt:last-child { border-bottom: none; }
.schritt .zeichen { width: 20px; height: 20px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--kasten); margin-top: 1px; }
.schritt.fertig .zeichen { background: var(--tuerkis); border: none; }
.schritt .zeichen.nr { font-size: 11px; font-weight: 700; color: var(--gedaempft); }
.hinweis { font-size: 12px; color: var(--gedaempft); line-height: 1.5; }
.lade { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--gedaempft); gap: 10px; }
.drehen { width: 18px; height: 18px; border: 2px solid var(--linie3); border-top-color: var(--akzent); border-radius: 50%; animation: dreh 0.8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---- Desktop ab 1024 px ------------------------------------------------------------- */
.nur-desktop { display: none !important; }
@media (min-width: 1024px) {
  .nur-desktop { display: flex !important; }
  .nur-handy { display: none !important; }
  #app { flex-direction: column; }
  .dk-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 20px; border-bottom: 1px solid var(--raster); }
  .dk-marke { display: flex; align-items: center; gap: 10px; flex: none; }
  .dk-marke .zeichen { width: 30px; height: 30px; border-radius: 9px; background: var(--text); color: var(--grund); display: flex; align-items: center; justify-content: center; }
  .dk-marke b { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
  .dk-schnell { flex: 1 1 320px; max-width: 560px; position: relative; }
  .dk-schnell label { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 6px 0 14px; border-radius: 21px; background: var(--flaeche); border: 1px solid var(--linie2); }
  .dk-schnell label:focus-within { border-color: var(--akzent); }
  .dk-schnell input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; font-size: 14px; }
  .taste { font: 400 11px var(--mono); color: var(--leise); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--linie3); }
  .dk-schnell .klapp { position: absolute; left: 0; right: 0; top: 48px; z-index: 40; background: var(--blatt); border: 1px solid var(--linie2); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 16px 50px rgba(0,0,0,.5); max-height: 70vh; overflow-y: auto; }
  .dk-schnell .klapp .spiegelzeile { font-size: 14px; line-height: 1.7; padding: 2px 4px; white-space: pre-wrap; }
  .dk-rechts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
  .heute-knopf { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--linie3); font-weight: 500; font-size: 13px; }
  .segment { display: flex; padding: 3px; border-radius: 12px; background: var(--flaeche); border: 1px solid var(--linie); gap: 2px; }
  .segment button { height: 30px; padding: 0 12px; border-radius: 9px; color: var(--gedaempft); font-weight: 500; font-size: 13px; }
  .segment button.an { background: var(--linie3); color: var(--text); font-weight: 600; }
  .avatare { display: flex; align-items: center; margin-left: 4px; }
  .avatar { text-decoration: none; width: 32px; height: 32px; border-radius: 16px; background: var(--f); color: var(--grund); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--grund); }
  .avatar + .avatar { margin-left: -9px; }
  .dk-rumpf { flex: 1 1 auto; display: flex; min-height: 0; }
  .dk-seite { width: 280px; flex: none; padding: 18px 20px; display: flex; flex-direction: column; gap: 22px; border-right: 1px solid var(--raster); overflow-y: auto; }
  .dk-seite h2 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--gedaempft); letter-spacing: 0.02em; }
  .mini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; font-size: 11px; text-align: center; }
  .mini .wk { color: var(--leise); padding-bottom: 4px; }
  .mini button { height: 28px; line-height: 28px; border-radius: 14px; color: var(--text2); font-size: 11px; }
  .mini button.fremd { color: #4F5562; }
  .mini button.woche-an { background: rgba(255, 255, 255, 0.06); color: var(--text); }
  .mini button.heute { background: var(--text); color: var(--grund); font-weight: 700; }
  .mini button.rot { color: var(--sonntag); }
  .mini button.heute.rot { color: var(--grund); }
  .minikopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .minikopf b { font-size: 14px; font-weight: 650; }
  .minikopf button { width: 28px; height: 28px; border-radius: 8px; color: var(--gedaempft); display: flex; align-items: center; justify-content: center; }
  .kalwahl label { display: flex; align-items: center; gap: 10px; height: 32px; font-size: 13px; cursor: pointer; }
  .kalwahl input { width: 16px; height: 16px; margin: 0; accent-color: var(--f); }
  .faellig-liste { display: flex; flex-direction: column; gap: 6px; }
  .faellig-liste button { display: flex; align-items: center; gap: 10px; font-size: 13px; text-align: left; }
  .faellig-liste .kl { width: 16px; height: 16px; border-radius: 5px; border: 1.6px solid var(--kasten); flex: none; }
  .faellig-liste .wann { font-size: 11px; color: var(--gelb); margin-left: auto; }
  .dk-haupt { flex: 1 1 auto; min-width: 0; padding: 14px 20px 0; display: flex; flex-direction: column; gap: 10px; }
  .dk-nav { display: flex; align-items: center; gap: 10px; }
  .dk-nav h1 { margin: 0 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
  .dk-nav .kw { font-size: 13px; color: var(--gedaempft); }
  .pfeil { width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--linie3); display: flex; align-items: center; justify-content: center; }
  .dk-haupt .woche { min-width: 700px; }
  .dk-haupt .zeitspalte, .dk-haupt .stunden { width: 48px; }
  .dk-haupt .tagkopf, .dk-haupt .ganz, .dk-haupt .raster { padding-left: 0; padding-right: 0; }
  .dk-haupt .tk { flex-direction: row; gap: 8px; padding: 8px 10px; align-items: center; }
  .dk-haupt .tk .wt { font-size: 12px; }
  .dk-haupt .tk .nr { font-size: 18px; }
  .dk-haupt .tk.heute .nr { font-size: 15px; width: 28px; height: 28px; line-height: 28px; border-radius: 14px; }
  .dk-haupt .tk .we { margin-left: auto; font-size: 11px; }
  .dk-haupt .ganz .zeitspalte { font-size: 10px; }
  .dk-haupt .gt { font-size: 11px; height: 20px; padding: 3px 6px; border-radius: 5px; }
  .dk-haupt .stunden { font-size: 11px; }
  .dk-haupt .stunden div { transform: translateY(-7px); }
  .dk-haupt .t { border-radius: 8px; padding: 6px 8px; }
  .dk-haupt .t .tt { font-size: 13px; }
  .dk-haupt .t .tz { font-size: 11px; }
  .dk-haupt .t.kurz { padding: 3px 8px; }
  .dk-haupt .t.kurz .tt { font-size: 11px; }
  .dk-haupt .t .tw { font-size: 11px; margin-top: 6px; }
  .dk-haupt .sp .jetzt { left: -4px; }
  .dk-haupt .jetzt::before { width: 10px; height: 10px; top: -4px; border-radius: 5px; }
  .dk-haupt .monat { padding: 0; }
  .dk-haupt .mz .nr { font-size: 13px; }
  .dk-haupt .mt { font-size: 11px; padding: 2px 5px; }
  .seitenblatt-huelle { position: fixed; inset: 0; z-index: 40; background: rgba(8, 9, 12, 0.55); display: flex; justify-content: flex-end; }
  .seitenblatt { width: 440px; max-width: 100%; height: 100%; background: var(--grund); border-left: 1px solid var(--linie2); display: flex; flex-direction: column; overflow-y: auto; animation: rein .16s ease-out; }
  @keyframes rein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
  .blatt-huelle { align-items: center; justify-content: center; }
  .blatt-huelle .oben { display: none; }
  .blatt { flex: 0 1 auto; width: 520px; max-height: 88vh; border-radius: 20px; border: 1px solid var(--linie2); }
  .dialog-huelle { align-items: center; }
  .dialog { border-radius: 20px; border: 1px solid var(--linie2); }
  .dk-listen { flex: 1 1 auto; overflow-y: auto; }
  .dk-listen .inhalt-listen { max-width: 720px; padding-top: 14px; }
  .toast { bottom: 32px; }
}
