@font-face { font-family: Jost; src: url(fonts/jost-latin-300-normal.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: Jost; src: url(fonts/jost-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Jost; src: url(fonts/jost-latin-500-normal.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --grund: #ece8e2;
  --grund-dunkel: #cbc5bd;
  --karte: #ffffff;
  --text: #2e3133;
  --text-leise: #6b6e70;
  --navy: #1f3c54;
  --navy-hell: #2c5677;
  --lime: #a7bd3b;
  --lime-dunkel: #8ea22c;
  --blau: #6ba7c5;
  --blau-hell: #c8dce8;
  --taupe: #d6cec4;
  --rot: #b4443f;
  --gelb: #d9a521;
  --gruen: #5f8f3a;
  --rand: #ddd7cf;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(40, 36, 30, .06), 0 6px 22px rgba(40, 36, 30, .07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 400 16px/1.5 Jost, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text); background: var(--grund);
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 300; }
h2 { font-size: 1.25rem; }
a { color: var(--navy-hell); }
.klein { font-size: .88rem; color: var(--text-leise); }
[hidden] { display: none !important; }

/* ------------------------------------------------ Kopf */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) clamp(14px, 3vw, 32px) 10px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rand);
}
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 1.2rem; font-weight: 300; }
.marke b { font-weight: 500; }
.lesezeichen {
  display: inline-grid; place-items: center; width: 30px; height: 34px; padding-bottom: 6px;
  background: var(--lime); color: #fff; font-weight: 500; font-size: .85rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { padding: 7px 12px; border-radius: 99px; text-decoration: none; color: var(--text); font-size: .95rem; white-space: nowrap; }
.nav a:hover { background: var(--grund); }
.nav a.aktiv { background: var(--navy); color: #fff; }
.nav-konto span { display: inline-block; max-width: 9em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

main { padding: clamp(14px, 3vw, 32px); max-width: 1400px; margin: 0 auto; outline: none; }

/* ------------------------------------------------ Knöpfe & Formulare */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px;
  font: 500 1rem Jost, sans-serif; text-decoration: none; cursor: pointer;
  background: var(--navy); color: #fff; transition: background .15s, transform .05s;
}
.knopf:hover { background: var(--navy-hell); }
.knopf:active { transform: translateY(1px); }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf-hell { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.knopf-hell:hover { background: #f1f5f8; }
.knopf-lime { background: var(--lime); color: #fff; }
.knopf-lime:hover { background: var(--lime-dunkel); }
.knopf-gefahr { background: var(--rot); }
.knopf-gefahr:hover { background: #963531; }
.knopf-gross { min-height: 52px; padding: 12px 24px; font-size: 1.05rem; }
.knopf-voll { width: 100%; }
.knopf-klein { min-height: 34px; padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.datei-knopf { position: relative; overflow: hidden; }
.datei-knopf input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: clamp(16px, 2.5vw, 26px); margin-bottom: 18px; }
.formular { display: grid; gap: 14px; }
.formular label { display: grid; gap: 5px; font-size: .92rem; color: var(--text-leise); }
.formular input, .formular select, .formular textarea, textarea {
  font: 400 1rem Jost, sans-serif; color: var(--text);
  padding: 11px 12px; border: 1.5px solid var(--rand); border-radius: 9px; background: #fff; width: 100%;
}
.formular input:focus, .formular select:focus, textarea:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(107, 167, 197, .25); }
.formular .haken { display: flex; align-items: flex-start; gap: 10px; color: var(--text); }
.formular .haken input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
fieldset { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 14px; }
legend { font-size: 1.1rem; color: var(--navy); margin-bottom: 4px; padding: 0; }
.zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zeile-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; }
.link-klein { font-size: .9rem; justify-self: start; }

.reiter { display: inline-flex; background: var(--grund); border-radius: 12px; padding: 4px; gap: 4px; }
.reiter a { padding: 8px 16px; border-radius: 9px; text-decoration: none; color: var(--text); cursor: pointer; white-space: nowrap; }
.reiter a.aktiv { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); color: var(--navy); font-weight: 500; }

/* ------------------------------------------------ Startseite */
.held { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(20px, 5vw, 70px); align-items: center; padding: clamp(10px, 4vw, 50px) 0; }
.vorzeile { color: var(--lime-dunkel); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; margin: 0 0 10px; }
.held h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 300; margin-bottom: .4em; }
.lead { font-size: 1.15rem; color: #4a4d50; max-width: 36em; }
.held-knoepfe { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 14px; }

.held-bild { display: grid; place-items: center; }
.mini-blatt {
  width: min(100%, 360px); aspect-ratio: 1 / 1.414; background: var(--grund-dunkel); border-radius: 6px;
  box-shadow: 0 20px 50px rgba(40, 36, 30, .25); padding-top: 3%; transform: rotate(2deg); display: flex; flex-direction: column;
}
.mini-foto { height: 49%; background: linear-gradient(160deg, #9fbad0, #e0c9a6 70%, #c79c6e); }
.mini-unten { flex: 1; display: grid; grid-template-columns: 2.9fr 1fr; gap: 3%; padding: 3% 4% 7%; }
.mini-kal, .mini-notiz { background: #fff; border-radius: 6px; position: relative; padding: 8% 5% 5%; }
.mini-nr { position: absolute; top: -3%; left: 4%; background: var(--lime); color: #fff; font-size: .6rem; padding: 2px 4px 6px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.mini-monat { display: block; font-weight: 300; font-size: .85rem; margin-top: 6%; }
.mini-jahr { position: absolute; right: 8%; top: 6%; font-weight: 300; font-size: 1.4rem; color: #b8afa6; }
.mini-raster { margin-top: 6%; height: 66%; background:
  linear-gradient(90deg, transparent 96%, #fff 96%) 0 0 / 14.28% 100%,
  linear-gradient(transparent 92%, #fff 92%) 0 0 / 100% 16.6%,
  linear-gradient(#c8dce8 33%, #ececec 33%); border-radius: 3px; }
.mini-notiz span { position: absolute; top: 5%; left: 8%; background: var(--lime); color: #fff; font-size: .45rem; padding: 1px 6px; border-radius: 9px; }

.vorteile { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 30px 0; }
.vorteile article { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--schatten); border-top: 4px solid var(--lime); }
.vorteile h3 { font-size: 1.15rem; font-weight: 500; color: var(--navy); }
.vorteile p { margin: 0; color: #4a4d50; }
.schritte { background: var(--navy); color: #fff; border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); margin: 30px 0; }
.schritte ol { list-style: none; counter-reset: s; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.schritte li { counter-increment: s; display: grid; gap: 6px; }
.schritte li::before { content: counter(s); width: 38px; height: 38px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; font-weight: 500; }
.schritte li b { font-weight: 500; font-size: 1.1rem; }
.schritte li span { color: #cfdbe5; }

.auth { max-width: 440px; margin: 20px auto; }
.auth .reiter { margin-bottom: 18px; display: flex; }
.auth .reiter a { flex: 1; text-align: center; }
.auth .formular { display: none; }
.auth .formular.aktiv { display: grid; }

/* ------------------------------------------------ Bereiche */
.bereich { max-width: 1100px; margin: 0 auto; }
.bereich.schmal { max-width: 560px; }
.bereich-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bereich-kopf h1 { margin: 0; }
.lead-klein { color: var(--text-leise); margin-top: -6px; }

.kalender-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.kal-karte { background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: transform .15s; }
.kal-karte:hover { transform: translateY(-3px); }
.kal-karte .bild { aspect-ratio: 4 / 3; background: var(--grund-dunkel) center / cover no-repeat; display: grid; place-items: end start; }
.kal-karte .jahr { background: var(--navy); color: #fff; padding: 4px 12px; font-size: 1.3rem; font-weight: 300; border-top-right-radius: 10px; }
.kal-karte .info { padding: 14px 16px; }
.kal-karte .info b { font-weight: 500; display: block; }
.leer { text-align: center; padding: 40px 20px; color: var(--text-leise); }

/* ------------------------------------------------ Editor */
.editor-kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.editor-kopf h1 { margin: 0; flex: 1; min-width: 10em; font-size: 1.6rem; }
.zurueck { font-size: 2rem; line-height: 1; text-decoration: none; color: var(--navy); padding: 0 6px; }
.tab { display: none; }
.tab.aktiv { display: block; }

.seiten-leiste { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.seite {
  flex: none; width: 78px; scroll-snap-align: start; cursor: pointer; text-align: center; font-size: .78rem; color: var(--text-leise);
  border-radius: 10px; padding: 4px; border: 2px solid transparent; background: none; font-family: inherit;
}
.seite .mini { width: 100%; aspect-ratio: 1 / 1.414; border-radius: 5px; background: #fff; overflow: hidden; position: relative; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); display: flex; flex-direction: column; }
.seite .mini .f { height: 49%; background: var(--taupe) center / cover no-repeat; margin-top: 4%; }
.seite .mini .f.leer { background: repeating-linear-gradient(45deg, #ece6de, #ece6de 4px, #e2dbd2 4px, #e2dbd2 8px); }
.seite .mini .u { flex: 1; background: linear-gradient(#fff 0 0) 8% 20% / 62% 70% no-repeat, linear-gradient(#fff 0 0) 92% 20% / 20% 75% no-repeat, var(--grund-dunkel); }
.seite.deck .mini .f { height: 63%; }
.seite.deck .mini .u { background: #e8e7e4; }
.seite.rueck .mini { background: var(--grund-dunkel); }
.seite .dpi { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; }
.seite.aktiv { border-color: var(--navy); color: var(--navy); font-weight: 500; }
.seite.ziel { border-color: var(--lime); background: rgba(167, 189, 59, .15); }

.gestalten { display: grid; grid-template-columns: minmax(0, auto) 300px; justify-content: center; gap: 28px; align-items: start; }
.gestalten .vorschau-rahmen { width: min(100%, calc((100vh - 250px) * .7071)); min-width: 320px; }
.vorschau-rahmen { position: relative; background: #fff; border-radius: 8px; box-shadow: 0 10px 40px rgba(40, 36, 30, .18); overflow: hidden; touch-action: pan-y; }
.vorschau { aspect-ratio: 420 / 594; line-height: 0; }
.vorschau svg { width: 100%; height: 100%; display: block; }
.vorschau svg image.foto { cursor: grab; }
.vorschau.zieht svg image.foto { cursor: grabbing; }
.vorschau.laedt { opacity: .6; transition: opacity .2s; }
.ablage-hinweis { position: absolute; inset: 0; display: none; place-items: center; background: rgba(31, 60, 84, .55); color: #fff; font-size: 1.5rem; border: 4px dashed var(--lime); border-radius: 8px; }
.vorschau-rahmen.drueber .ablage-hinweis { display: grid; }
.seiten-werkzeug { position: sticky; top: 80px; display: grid; gap: 12px; }
.seiten-werkzeug h2 { margin: 0; font-size: 1.5rem; font-weight: 300; }
.seiten-werkzeug p { margin: 0; }
.tipp { font-size: .88rem; background: #fff; border-left: 4px solid var(--lime); padding: 12px 14px; border-radius: 8px; color: #4a4d50; }
.qualitaet { font-size: .88rem; }
.ampel { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ampel.gut { background: var(--gruen); } .ampel.mittel { background: var(--gelb); } .ampel.gering { background: var(--rot); }

.einstellungen { max-width: 640px; }

.druck { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.druck .karte { margin: 0; }
.formate { display: grid; gap: 10px; }
.format { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--rand); border-radius: 10px; }
.format b { font-weight: 500; display: block; }
.format .klein { display: block; }
.format.druckerei { border-color: var(--lime); background: #f8faef; }
.anleitung { padding-left: 1.2em; margin: 0 0 12px; display: grid; gap: 8px; }
.pruef-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* ------------------------------------------------ Geburtstage */
.geb-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.geb-raster .karte { margin: 0; }
.import.drueber { outline: 3px dashed var(--lime); background: #f8faef; }
.import p { margin-top: 0; }
.eintrag-liste { columns: 3 260px; column-gap: 28px; }
.monatsgruppe { break-inside: avoid; margin-bottom: 18px; }
.monatsgruppe h3 { font-size: 1rem; font-weight: 500; color: var(--navy); border-bottom: 2px solid var(--lime); padding-bottom: 4px; margin-bottom: 6px; }
.eintrag { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f0ece7; }
.eintrag .d { width: 3.2em; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.eintrag .t { flex: 1; }
.eintrag .typ { font-size: .75rem; background: var(--blau-hell); color: var(--navy); padding: 1px 7px; border-radius: 99px; }
.eintrag button { border: 0; background: none; color: #aaa; font-size: 1.2rem; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.eintrag button:hover { color: var(--rot); background: #fbeceb; }

/* ------------------------------------------------ Admin */
.tabelle-rahmen { overflow-x: auto; padding: 0; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #efebe6; vertical-align: middle; }
.tabelle th { font-weight: 500; color: var(--text-leise); background: #faf8f6; }
.status { font-size: .78rem; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.status.aktiv { background: #e6f0dc; color: #3e6a1f; }
.status.wartend { background: #fbefcf; color: #7a5a07; }
.status.unbestaetigt { background: #eee; color: #666; }
.status.gesperrt { background: #fbe1df; color: #8d2f2a; }
.aktionen { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------ Sonstiges */
.laden { display: grid; place-items: center; min-height: 40vh; }
.kringel { width: 34px; height: 34px; border: 3px solid var(--rand); border-top-color: var(--navy); border-radius: 50%; animation: dreh .8s linear infinite; display: inline-block; }
.knopf .kringel { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes dreh { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  max-width: min(92vw, 520px); font-size: .95rem;
}
.toast.fehler { background: var(--rot); }
.toast.ok { background: var(--gruen); }
.meldung { padding: 14px 16px; border-radius: 10px; background: #eef5e6; color: #33561a; }
.meldung.fehler { background: #fbe9e7; color: #8d2f2a; }

body.global-drag::after {
  content: "Fotos loslassen – sie werden auf freie Seiten verteilt"; position: fixed; inset: 10px; z-index: 40;
  display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: rgba(31, 60, 84, .6);
  border: 4px dashed var(--lime); border-radius: 18px; pointer-events: none;
}

@media (max-width: 900px) {
  .gestalten { grid-template-columns: 1fr; }
  .gestalten .vorschau-rahmen { width: 100%; min-width: 0; }
  .seiten-werkzeug { position: static; }
  .held { grid-template-columns: 1fr; }
  .held-bild { order: -1; }
  .mini-blatt { width: min(70%, 260px); }
  .geb-raster { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kopf { flex-wrap: wrap; }
  .nav { width: 100%; justify-content: space-between; }
  .nav a { padding: 6px 9px; font-size: .9rem; }
  .editor-reiter { width: 100%; display: flex; }
  .editor-reiter a { flex: 1; text-align: center; padding: 8px 6px; }
  .zeile { grid-template-columns: 1fr; }
  .tabelle th:nth-child(4), .tabelle td:nth-child(4), .tabelle th:nth-child(5), .tabelle td:nth-child(5) { display: none; }
}

/* ------------------------------------------------ Fußzeile */
.fuss { display: flex; justify-content: center; gap: 22px; padding: 18px 16px 28px; font-size: .88rem; }
.fuss a { color: var(--text-leise); text-decoration: none; }
.fuss a:hover { color: var(--navy); text-decoration: underline; }
