/* ============================================================
   Familien-Tagebuch — Stylesheet
   Mobil zuerst; ab 900 px die weitere Ansicht.
   Design aus den Mockups (~/dev/sofia-family-webapp/mockups).
   ============================================================ */

@import url('fonts.css');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --paper:  #FBF8F4;
  --card:   #FFFFFF;
  --ink:    #1B1815;
  --ink-2:  #6C625A;
  --ink-3:  #A79C92;
  --line:   #ECE5DB;
  --line-2: #F5F0E8;
  --accent: #A9543A;
  --accent-tint: #F6EDE6;   /* Grund der Rollen-Etiketten; je Instanz überschreibbar */
  --heart:  #CF463C;
  --ok:     #4F7A5B;
  --r:      18px;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  --top-h: 62px;
  --tab-h: 74px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }

a { color: var(--accent); }
img { max-width: 100%; }

/* ------------------------------------------------------------ Kopf */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px 11px;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-2);
  padding-top: max(13px, env(safe-area-inset-top));
}
.top .mark {
  font-family: var(--serif); font-size: 21px; font-weight: 500;
  letter-spacing: -.01em; font-variation-settings: 'opsz' 40;
  color: var(--ink); text-decoration: none;
}
.top .sub { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }
.top .spacer { flex: 1; }
.navlinks { display: none; gap: 4px; }
.navlinks a {
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  padding: 7px 13px; border-radius: 999px;
}
.navlinks a[aria-current="page"] { background: #EFE7DB; color: var(--ink); }
@media (min-width: 900px) {
  .top { padding: 16px 34px; gap: 26px; }
  .navlinks { display: flex; }
}

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); text-decoration: none;
  display: grid; place-items: center; cursor: pointer; font-size: 15px; flex: none;
}
.spacewitch {
  font: inherit; font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 11px;
}

/* ------------------------------------------------------------ Tab-Leiste */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  /* Fünf Plätze seit dem Kalender (10.09.2026): Story · Galerie · Kalender · ＋ · Familie */
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a {
  display: grid; gap: 3px; justify-items: center; text-decoration: none;
  font-size: 9.5px; font-weight: 500; color: var(--ink-3); padding: 4px 0;
  /* Bei fünf Plätzen wird es auf schmalen Geräten eng — lieber kürzen als umbrechen */
  max-width: 100%; overflow: hidden; white-space: nowrap;
}
.tabs svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tabs a[aria-current="page"] { color: var(--accent); }
/* Ohne Kalender (FAM_KALENDER=false, z. B. Livias App) bleiben vier Plätze */
.tabs.vier { grid-template-columns: repeat(4, 1fr); }
.tabs .fab {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #FFF7EC;
  display: grid; place-items: center; font-size: 22px; font-weight: 300;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,.45); margin-top: -4px;
}
@media (min-width: 900px) { .tabs { display: none; } }

/* ------------------------------------------------------------ Feed */
.wrap { padding: 14px 14px 30px; display: grid; gap: 14px; }
@media (min-width: 900px) {
  .wrap { max-width: 620px; margin: 0 auto; padding: 26px 20px 60px; gap: 20px; }
  .wrap.wide { max-width: 1100px; }
  /* Ein einzelnes Hochformat wird auf grossen Bildschirmen sonst sehr hoch.
     Deckeln statt beschneiden: das Bild bleibt vollständig, nur kleiner. */
  .shots.n1 { display: flex; justify-content: center; background: #F7F2EA; }
  .shots.n1 img { max-height: 74dvh; width: auto; max-width: 100%; }
}

.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; scroll-margin-top: 80px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 11px; }
.ava {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600;
}
.ava.lg { width: 42px; height: 42px; font-size: 14px; }
.ava.sm { width: 26px; height: 26px; font-size: 10px; }
.who { display: grid; line-height: 1.28; min-width: 0; }
.who b { font-size: 13.5px; font-weight: 600; }
.who span { font-size: 11.5px; color: var(--ink-3); }
.role {
  font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint); padding: 3px 7px; border-radius: 6px; white-space: nowrap;
}
.role.only { color: #7A6A2F; background: #F6F1DF; }

.post-title {
  font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.22;
  font-variation-settings: 'opsz' 30; letter-spacing: -.012em; margin: 0 14px 9px;
}
.post-title a { color: inherit; text-decoration: none; }
.post-text { margin: 0 14px 13px; font-size: 14.2px; line-height: 1.58; color: #3A342E; white-space: pre-wrap; }

.shots { display: grid; gap: 3px; background: var(--line-2); }
.shots a { display: block; overflow: hidden; position: relative; }
.shots img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; background: var(--line-2); }
.shots.n1 { grid-template-columns: 1fr; }
.shots.n2 { grid-template-columns: 1fr 1fr; }
.shots.n2 img { aspect-ratio: 1/1; }
.shots.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.shots.n3 img { aspect-ratio: 1/1; }
.shots.n3 a:first-child { grid-row: 1 / span 2; }
.shots.n3 a:first-child img { aspect-ratio: auto; height: 100%; }
.shots.n4, .shots.nx { grid-template-columns: 1fr 1fr; }
.shots.n4 img, .shots.nx img { aspect-ratio: 1/1; }
.more { position: relative; }
.more::after {
  content: attr(data-more); position: absolute; inset: 0;
  background: rgba(20,17,14,.5); color: #fff;
  display: grid; place-items: center; font-size: 20px; font-weight: 500;
  pointer-events: none;
}

.acts { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.act {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 11px; cursor: pointer; text-decoration: none;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; transition: .16s;
}
.act:hover { border-color: #DED3C5; }
.act .glyph { font-size: 13px; line-height: 1; transition: transform .22s cubic-bezier(.3,1.6,.5,1); }
.act.on { color: var(--heart); border-color: #F1D3CF; background: #FDF3F1; }
.act.on .glyph { transform: scale(1.22); }
.act.quiet { border: 0; color: var(--ink-3); }
.likers { margin-left: auto; font-size: 11.5px; color: var(--ink-3); text-align: right; }
/* Ab drei Herzen: «Jana, Bea +2» antippen zeigt alle Namen. Die Liste schwebt unter
   der Zeile; solange sie offen ist, darf sie über den Kartenrand hinausragen
   (.post schneidet sonst ab — bei einem Beitrag ohne Kommentare wäre sie halb weg). */
.likers details { position: relative; }
.likers summary {
  list-style: none; cursor: pointer; padding: 6px 0;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.likers summary::-webkit-details-marker { display: none; }
.likers details[open] summary { color: var(--ink-2); }
.likers-liste {
  position: absolute; right: 0; top: calc(100% + 2px); z-index: 20;
  margin: 0; padding: 8px 12px; list-style: none; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  font-size: 12.5px; color: var(--ink-2); min-width: 150px; max-width: 70vw;
}
.likers-liste li { padding: 3px 0; }
.likers-liste li::before { content: "♥"; color: var(--heart); margin-right: 7px; }
.post:has(.likers details[open]) { overflow: visible; position: relative; z-index: 20; }

.threads { padding: 2px 14px 14px; display: grid; gap: 11px; }
.cmt { display: flex; gap: 9px; }
.cmt .bubble { background: #F7F3ED; border-radius: 4px 13px 13px 13px; padding: 8px 11px; font-size: 13px; line-height: 1.5; }
.cmt .bubble b { font-size: 12.5px; display: block; margin-bottom: 2px; }
.cmt .bubble time { color: var(--ink-3); font-size: 10.5px; margin-left: 6px; font-weight: 400; }
/* Löschknopf am Kommentar. Dezent, aber auf dem Handy dauerhaft sichtbar —
   ein Hover-Effekt wäre dort unerreichbar. */
.cmt form { margin: 0; display: flex; align-items: flex-start; }
.cmtweg {
  border: 0; background: none; cursor: pointer; padding: 4px 6px; line-height: 1;
  color: var(--ink-3); font-family: inherit; font-size: 15px; opacity: .5;
}
.cmtweg:hover, .cmtweg:focus-visible { opacity: 1; color: var(--heart); }

.cmt-new { display: flex; gap: 9px; align-items: center; }
.cmt-new input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: #FCFAF7;
  border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 13px; color: var(--ink);
}
.cmt-new input::placeholder { color: var(--ink-3); }
.cmt-new button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; padding: 0 4px; }

.monat {
  font-family: var(--serif); font-size: 13px; font-weight: 500; color: var(--ink-2);
  letter-spacing: .02em; padding: 6px 4px 0; font-variation-settings: 'opsz' 14;
  display: flex; align-items: center; gap: 10px;
}
.monat::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------ Galerie */
.gal-head { padding: 20px 16px 8px; }
.gal-head h1, .seite h1 {
  font-family: var(--serif); font-size: 25px; font-weight: 400; margin: 0;
  font-variation-settings: 'opsz' 60; letter-spacing: -.02em;
}
.gal-head p { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.gal-monat {
  position: sticky; top: var(--top-h); z-index: 12;
  padding: 14px 16px 8px; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 2px; }
.grid a { position: relative; display: block; }
.grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; cursor: zoom-in; }
@media (min-width: 900px) {
  .gal-head { max-width: 1100px; margin: 0 auto; padding: 26px 34px 10px; }
  .gal-monat { padding-inline: 34px; max-width: 1100px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(6, 1fr); gap: 4px; max-width: 1100px; margin: 0 auto; padding: 0 34px; }
}

/* ------------------------------------------------------------ Seiten (Familie, Formulare) */
.seite { padding: 20px 16px 40px; }
@media (min-width: 900px) { .seite { max-width: 620px; margin: 0 auto; padding-top: 28px; } }
.seite h1 { margin-bottom: 4px; }
.seite > .lead { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-3); }
.seite h2 {
  font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 28px 0 4px;
  font-variation-settings: 'opsz' 30;
}

.prow, .nrow {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px;
}
.prow .who, .nrow .who { flex: 1; }
.nrow.col { display: grid; gap: 9px; }
.nrow label { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }

.sw { appearance: none; border: 0; cursor: pointer; flex: none; width: 44px; height: 27px; border-radius: 99px; background: #DDD4C7; position: relative; transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.sw.on { background: var(--accent); }
.sw.on::after { transform: translateX(17px); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); color: #FBF6EE; border-color: var(--ink); }

.field { margin-top: 15px; }
.field label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.field .opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-3); font-size: 11px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  padding: 12px 13px; font: inherit; font-size: 15px; color: var(--ink); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid #E4D6CB; outline-offset: 1px; }

.btn {
  display: block; width: 100%; margin-top: 18px; padding: 14px; border: 0; border-radius: 14px;
  background: var(--accent); color: #FFF6F0; font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-align: center; text-decoration: none;
}
.btn.ghost { background: none; color: var(--ink-3); font-weight: 500; margin-top: 8px; }
.btn.dashed { background: #FCF8F2; border: 1px dashed #D9CDBD; color: var(--accent); }

.drop {
  border: 1.5px dashed #D8CCBC; border-radius: 16px; background: #FCF9F4;
  padding: 24px 16px; text-align: center; cursor: pointer; display: block;
}
.drop .big { font-size: 26px; color: var(--accent); }
.drop b { display: block; font-size: 13.5px; margin-top: 7px; }
.drop span { font-size: 11.5px; color: var(--ink-3); }
.picked { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 11px; }
.picked img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 9px; display: block; }

/* Bildkachel mit Entfernen-Knopf. Bewusst über eine Checkbox gelöst: funktioniert
   auch ohne JavaScript, und das Löschen passiert erst beim Speichern — ein Fehlgriff
   ist also ohne Folgen. */
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick > label,
.pick > .pickweg {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(18,15,12,.6); color: #fff;
  display: grid; place-items: center; font-size: 16px; line-height: 1;
  cursor: pointer; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.pick > .pickweg { border: 0; font-family: inherit; padding: 0; }
.pick input:checked + label { background: var(--heart); }
.pick input:checked ~ img { opacity: .3; filter: grayscale(1); }
.pick input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.hinweis { border-radius: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.5; margin: 14px 0 0; }
.hinweis.warn { background: #FDF2EF; border: 1px solid #F0D6CF; color: #8A3B2B; }
.hinweis.info { background: #F3F6F1; border: 1px solid #DCE5D8; color: #3F5A46; }
.hinweis code { font-size: 12px; word-break: break-all; }

.leer { text-align: center; padding: 60px 24px; color: var(--ink-3); }
.leer .big { font-size: 34px; }
.leer p { font-size: 14px; line-height: 1.6; margin: 12px 0 0; }

/* ------------------------------------------------------------ Anmeldeseiten */
.mitte { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.karte { width: 100%; max-width: 380px; }
.karte .marke {
  font-family: var(--serif); font-size: 30px; font-weight: 400; text-align: center;
  font-variation-settings: 'opsz' 72; letter-spacing: -.02em; margin: 0 0 4px;
}
.karte .unter { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 0 0 22px; }
.karte .box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }

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

   Monatsraster wie im Handy-Kalender: Tageszahlen, darunter Balken über mehrere
   Tage mit dem Text darin. Je Woche ein eigenes Raster mit sieben Spalten —
   Zeile 1 sind die Tage, jede weitere Zeile eine Balkenspur. Ein Balken ist EIN
   Element mit grid-column von…bis; dadurch steht sein Text einmal in der Mitte
   und wird nicht an jedem Tag wiederholt. */
.kal { padding: 14px 10px 30px; }
@media (min-width: 900px) { .kal { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; } }

.kal-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kal-kopf h1 {
  font-family: 'Fraunces', Georgia, serif; font-size: 21px; margin: 0; text-align: center;
  font-variation-settings: 'opsz' 72; letter-spacing: -.01em;
}
.kal-pfeil {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 24px; line-height: 1;
  color: var(--ink-2); text-decoration: none; background: var(--card);
  border: 1px solid var(--line);
}
.kal-pfeil:hover { background: var(--line-2); }
.kal-zweck { text-align: center; font-size: 12px; color: var(--ink-3); margin: 4px 0 14px; }

.kal-wochentage {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); text-align: center; margin-bottom: 4px;
}

.kal-woche {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(var(--spuren, 0), 20px);
  gap: 2px; margin-bottom: 3px;
  /* Mindesthöhe, damit auch leere Wochen als Zeile erkennbar bleiben */
  min-height: 46px;
}
.kal-tag {
  grid-row: 1; text-align: center; font-size: 12.5px; padding: 5px 0 3px;
  color: var(--ink); text-decoration: none; border-radius: 8px 8px 0 0;
  background: var(--card); border: 1px solid var(--line); border-bottom: 0;
}
.kal-tag.fremd { color: var(--ink-3); background: transparent; border-color: transparent; }
.kal-tag.heute { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.kal-tag:hover { background: var(--line-2); }
.kal-tag.heute:hover { background: var(--accent); }

.kal-balken {
  background: var(--farbe, var(--accent)); color: #fff; text-decoration: none;
  border-radius: 5px; font-size: 11px; line-height: 18px; height: 18px;
  padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  display: block; min-width: 0;
}
.kal-balken span { display: block; overflow: hidden; text-overflow: ellipsis; }
/* Läuft der Zeitraum über die Woche hinaus, wird die Kante flach und bekommt
   eine Andeutung — sonst sähe ein Wochenwechsel aus wie zwei Termine. */
.kal-balken.offen-l { border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: 3px; }
.kal-balken.offen-r { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 3px; }
.kal-balken.offen-l::before { content: '‹ '; opacity: .75; }
.kal-balken.offen-r::after { content: ' ›'; opacity: .75; }

/* Zeitraum-Auswahl im Raster */
.kal-tag.gewaehlt {
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent); font-weight: 600; border-radius: 0;
}
.kal-tag.gewaehlt.rand-l { border-top-left-radius: 8px; }
.kal-tag.gewaehlt.rand-r { border-top-right-radius: 8px; }
.kal-tag.heute.gewaehlt { background: var(--accent); color: #fff; }

/* Was nur mit bzw. nur ohne Skript Sinn ergibt. */
.nur-mit-js { display: none !important; }
body.hat-js .nur-mit-js { display: inline-block !important; }
body.hat-js .nur-ohne-js { display: none !important; }

/* Das Panel ist immer da — im Zustand «leer» als ruhige Zeile, die sagt, was zu
   tun ist; sobald ein Tag gewählt ist, wird daraus der Eingabekasten. */
.kal-neu { display: none; }
body.hat-js .kal-neu {
  display: block;
  position: sticky; bottom: 78px; z-index: 20; margin: 12px 0 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 13px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35);
}
body.hat-js .kal-neu.leer {
  box-shadow: none; padding: 10px 13px;
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
.kal-neu.leer .kal-neu-eingabe,
.kal-neu.leer .kal-neu-zu { display: none; }
.kal-neu.leer .kal-neu-kopf { margin-bottom: 0; }
.kal-neu.leer #kalzeitraum { color: var(--accent); font-weight: 500; }
.kal-neu-kopf b::before { content: '🗓 '; }
@media (min-width: 900px) { .kal-neu { bottom: 16px; } }
.kal-neu-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.kal-neu-kopf b { font-size: 13.5px; flex: 1; }
.kal-neu-zu {
  border: 0; background: none; font-size: 20px; line-height: 1; color: var(--ink-3);
  cursor: pointer; padding: 0 4px; font-family: inherit;
}
.kal-neu input[name="titel"] {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--paper);
  color: var(--ink); box-sizing: border-box;
}
.kal-neu input[name="titel"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.kal-neu-knoepfe { display: flex; gap: 8px; margin-top: 9px; }
.kal-neu-knoepfe .btn { width: auto; flex: 1; margin: 0; }

.kal-fuss { display: flex; gap: 8px; margin: 16px 0 4px; }
.kal-fuss .btn { width: auto; flex: 1; }
.kal-titel { font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
             color: var(--ink-3); margin: 22px 0 8px; font-family: inherit; font-weight: 600; }
.kal-liste { list-style: none; margin: 0; padding: 0; }
.kal-liste li { margin-bottom: 6px; }
.kal-liste a {
  display: block; padding: 11px 13px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.kal-liste b { font-size: 14px; display: block; }
.kal-liste .wann { font-size: 12px; color: var(--ink-3); }
.kal-liste em { font-style: normal; opacity: .8; }

/* Zwei Datumsfelder nebeneinander */
.field.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.zwei label { display: block; }

/* ------------------------------------------------------------ Angemeldete Geräte */
.geraete { margin: 4px 0 16px; }
.geraete > b { display: block; font-size: 13px; margin-bottom: 8px; }
.geraete ul { list-style: none; margin: 0; padding: 0; }
.geraete li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.geraete li > div { flex: 1; min-width: 0; }
.geraete .gname { font-size: 13.5px; font-weight: 500; }
.geraete .dieses {
  margin-left: 7px; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 20px; padding: 1px 7px;
}
.geraete .wann { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.geraete form { margin: 0; flex: none; }
.btn.klein { padding: 6px 12px; font-size: 12.5px; width: auto; display: inline-block; }

/* ------------------------------------------------------------ Absenden

   Sichtbare Rückmeldung beim Hochladen. Zwei Phasen: der Balken füllt sich mit
   dem Upload, danach («wartet») rechnet der Server noch — Bilder skalieren und
   das Standbild aus dem Video holen. Ohne diese Anzeige drückt man ein zweites
   Mal auf «Veröffentlichen». */
.senden { margin-top: 14px; }
.senden .balken {
  height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden;
}
.senden .balken span {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: 99px;
  transition: width .18s ease-out;
}
.senden p { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* Zweite Phase: der Balken ist voll, es geht aber weiter — ein ruhiges Pulsieren
   sagt «läuft noch», ohne einen Fortschritt vorzutäuschen, den wir nicht kennen. */
.senden.wartet .balken span { animation: pulsen 1.5s ease-in-out infinite; }
@keyframes pulsen { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .senden .balken span { transition: none; }
  .senden.wartet .balken span { animation: none; }
}

/* ------------------------------------------------------------ Video

   Ein Video sieht im Raster aus wie ein Foto — es ist sein Standbild. Damit man
   den Unterschied sieht, bevor man tippt: Play-Zeichen in der Mitte, Länge unten
   rechts. Beides liegt über dem Bild und nimmt keine Klicks an, sonst käme der
   Klick nicht beim Anker an, der die Lightbox öffnet. */
.vidplay, .vidmark { position: absolute; pointer-events: none; z-index: 2; }
.vidplay {
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(18,15,12,.46); color: #fff;
  display: grid; place-items: center; font-size: 19px; padding-left: 3px;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.vidplay.klein { width: 34px; height: 34px; font-size: 13px; }
.vidmark {
  bottom: 6px; right: 6px;
  background: rgba(18,15,12,.62); color: #fff;
  font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 20px;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
/* Solange umgewandelt wird, ist die Marke ein Satz statt einer Zahl — dann darf
   sie auch breiter werden. */
.vidmark.wartet { left: 6px; right: auto; max-width: calc(100% - 12px); }
.pick video {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 9px;
  display: block; background: var(--line-2);
}

/* ------------------------------------------------------------ Lightbox */
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(12,10,9,.96); display: none; place-items: center; }
.lb.on { display: grid; }

/* Volle Fläche: früher begrenzte max-height:82dvh das Bild, damit unten Platz für
   den Download-Link blieb — im Querformat verschenkte das fast ein Fünftel der Höhe.
   Die Bedienelemente liegen jetzt als Leiste über dem Bild. */
.lb img, .lb video { max-width: 100%; max-height: 100dvh; object-fit: contain; display: block; }
/* Platz für die Bedienleiste des Spielers: sie sitzt am unteren Rand des
   Elements, und ganz am Bildschirmrand liesse sie sich kaum treffen. */
.lb video { max-height: 92dvh; }
.lb video[hidden], .lb img[hidden] { display: none; }

.lb .lbbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
           14px max(14px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0,0,0,.6), transparent);
  pointer-events: none;
}
.lb .lbbar a { pointer-events: auto; color: #EDE4D6; font-size: 13px; text-decoration: none; }
.lb .lbbar a:hover { text-decoration: underline; }
.lb .lbclose {
  font-size: 26px; line-height: 1; padding: 2px 8px 6px; text-decoration: none;
  pointer-events: auto; background: none; border: 0; color: #EDE4D6;
  font-family: inherit; cursor: pointer;
}
.lb .lbzahl { pointer-events: none; color: #C9BFB2; font-size: 12.5px; margin-left: auto; margin-right: 10px; }

/* Blättern innerhalb eines Beitrags. Auf dem Handy wischt man, die Knöpfe sind
   für Maus und Tastatur — darum ab 900 px sichtbar, darunter dezent. */
.lb .lbnav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 64px; border: 0; border-radius: 10px;
  background: rgba(18,15,12,.42); color: #EDE4D6;
  font-size: 30px; line-height: 1; cursor: pointer;
  display: none; place-items: center;
}
.lb.mehrere .lbnav { display: grid; }
.lb .lbnav.zurueck { left: max(6px, env(safe-area-inset-left)); }
.lb .lbnav.vor { right: max(6px, env(safe-area-inset-right)); }
@media (max-width: 899px) { .lb .lbnav { opacity: .35; width: 38px; height: 54px; font-size: 24px; } }
