/* DokGarten – ein Stylesheet, mobile-first. Untere Navigation auf dem Handy, Seitenleiste ab 900px.
   Keine externen Schriften (Datenschutz); Systemschriften. Farben als Variablen, Dunkelmodus automatisch. */
:root {
  --bg: #f4f7f2; --surface: #ffffff; --surface-2: #eef3ec; --fg: #1b261e; --muted: #5a6a5e; --line: #d7e0d4;
  --accent: #2e7a3f; --accent-strong: #1f5c2d; --accent-soft: #e1efe2; --on-accent: #ffffff;
  --warn: #9a5a12; --warn-soft: #fbefdc; --danger: #b3261e; --danger-soft: #fbe4e2; --own: #7a4fb0; --own-soft: #efe7f8;
  --shadow: 0 1px 2px rgba(20,40,25,.06), 0 4px 14px rgba(20,40,25,.06);
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --f-head: Georgia, "Times New Roman", serif;
  --r: 12px; --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111813; --surface: #19221b; --surface-2: #202b22; --fg: #e4ece5; --muted: #9db0a1; --line: #2d3b30;
    --accent: #6cc27e; --accent-strong: #8fd59e; --accent-soft: #1f3425; --on-accent: #0d1a10;
    --warn: #e3a85a; --warn-soft: #352813; --danger: #f08a80; --danger-soft: #3a1d1a; --own: #c3a2ee; --own-soft: #2c2338;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
:where(svg[aria-hidden]) { width: 20px; height: 20px; flex: none; vertical-align: middle; }
html, body { background: var(--bg); color: var(--fg); margin: 0; }
body { font-family: var(--f-body); font-size: 16px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.bot { font-family: var(--f-head); font-style: italic; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.label { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.versteckt { display: none !important; }

/* Rahmen */
.shell { display: block; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: .72rem;
  color: var(--muted); text-decoration: none; min-height: var(--nav-h); }
.nav a svg { width: 24px; height: 24px; }
.nav a.an { color: var(--accent); font-weight: 700; }
.nav a.cam .ic { background: var(--accent); color: var(--on-accent); border-radius: 999px; width: 44px; height: 30px; display: grid; place-items: center; }
.nav a.cam svg { width: 20px; height: 20px; }
.nav .brand, .nav .nur-breit { display: none; }
.kopf { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 0; max-width: 1080px; margin: 0 auto; }
.kopf a { color: var(--muted); text-decoration: none; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.kopf svg { width: 20px; height: 20px; }
.main { padding: 12px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); max-width: 1080px; margin: 0 auto; min-width: 0; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
  .nav { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px; border-top: 0;
    border-right: 1px solid var(--line); padding: 20px 12px; }
  .nav .brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-head); font-weight: 600; font-size: 1.25rem; padding: 4px 10px 18px; color: var(--fg); }
  .nav .brand svg { color: var(--accent); width: 28px; height: 28px; }
  .nav .nur-breit { display: flex; }
  .nav a { flex: 0; flex-direction: row; gap: 12px; font-size: .95rem; padding: 10px 12px; border-radius: 10px; min-height: 0; }
  .nav a.an { background: var(--accent-soft); }
  .nav a.cam .ic { width: 24px; height: 24px; background: transparent; color: inherit; }
  .nav a.cam svg { width: 24px; height: 24px; }
  .kopf { display: none; }
  .main { padding: 32px 32px 48px; }
}

/* Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 700; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); padding-inline: 8px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger.fill { background: var(--danger); color: var(--surface); }
.btn.klein { min-height: 34px; padding: 6px 10px; font-size: .85rem; }
.btn svg { width: 18px; height: 18px; }
.inline { display: inline; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 12px; font-size: .875rem; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--fg); }
.chip:has(input:checked), .chip.an { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
.chip input { accent-color: var(--accent); }
.chip svg { width: 16px; height: 16px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.18); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.eigen { background: var(--own-soft); color: var(--own); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 7px 14px; border-radius: 8px; font-weight: 700; color: var(--muted); text-decoration: none; }
.seg a.an { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.crumbs { font-size: .875rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.hscroll > * { scroll-snap-align: start; }
.grid2 { display: grid; gap: 20px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.leer { padding: 24px; text-align: center; color: var(--muted); }

/* Meldungen */
.meldungen { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.meldungen li { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.meldungen li.error { background: var(--danger-soft); color: var(--danger); }
.warnung { border: 2px solid var(--danger); background: var(--danger-soft); color: var(--fg); border-radius: var(--r); padding: 16px; }
.warnung h2 { color: var(--danger); }
.warnung ul { margin: 8px 0 0; padding-left: 20px; }
.hinweisbox { background: var(--warn-soft); color: var(--fg); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: 16px; }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld > label, .feld > .feldname { font-weight: 700; font-size: .9rem; }
.feld input[type=text], .feld input[type=password], .feld input[type=number], .feld input[type=date], .feld input[type=url],
.feld select, .feld textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
.feld input[type=file] { padding: 8px 0; max-width: 100%; }
.feld textarea { min-height: 70px; resize: vertical; }
.feld .hilfe, .hint { font-size: .85rem; color: var(--muted); }
.feld .fehler, .fehlerliste { color: var(--danger); font-size: .9rem; margin: 0; padding: 0; list-style: none; }
.feld.check { flex-direction: row; align-items: flex-start; gap: 10px; }
.feld.check input { width: 22px; height: 22px; accent-color: var(--accent); margin-top: 1px; flex: none; }
.feld .art-wert { font-size: .8rem; color: var(--own); }
.kaestchen { display: flex; flex-wrap: wrap; gap: 8px; }
.formgruppe { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 14px; margin: 0; }
.formgruppe legend { font-family: var(--f-head); font-weight: 600; font-size: 1.1rem; padding: 0 6px; }
.formgrid { display: grid; gap: 14px; }
@media (min-width: 700px) { .formgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.aufgabe-feld { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.aufgabe-feld:first-of-type { border-top: 0; padding-top: 0; }
.knopfleiste { display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding: 10px 0; }
@media (min-width: 900px) { .knopfleiste { bottom: 0; } }

/* Monatsauswahl: 12 Kästchen */
.monatswahl { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.monatswahl label { position: relative; display: grid; place-items: center; min-height: 40px; border-radius: 6px; background: var(--surface-2);
  font-size: .72rem; font-weight: 700; color: var(--muted); cursor: pointer; user-select: none; }
.monatswahl input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.monatswahl label:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.monatswahl label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 1px; }
@media (max-width: 420px) { .monatswahl { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Monatsleiste (Anzeige) */
.leiste { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; width: 100%; max-width: 360px; }
.leiste i { height: 12px; background: var(--surface-2); display: block; border-radius: 2px; }
.leiste i.an { background: var(--accent); }
.leiste i.jetzt { box-shadow: inset 0 -3px 0 var(--fg); }
.leiste-m { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); font-size: .62rem; color: var(--muted); text-align: center; max-width: 360px; }

/* Fotos */
.ph { display: block; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; max-width: 100%; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .platzhalter { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.ph .platzhalter svg { width: 40%; height: 40%; opacity: .5; }
.thumb { width: 48px; height: 48px; flex: none; border-radius: 8px; }
.tile { width: 112px; flex: none; text-decoration: none; color: var(--fg); display: flex; flex-direction: column; gap: 4px; font-size: .85rem; line-height: 1.25; }
.tile .ph { width: 112px; height: 112px; }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.galerie figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.galerie figcaption { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.titelfoto { width: 100%; max-width: 360px; }

/* Aufgaben */
.aufgabe { display: flex; gap: 12px; align-items: flex-start; padding: 12px; }
.aufgabe + .aufgabe { border-top: 1px solid var(--line); }
.aufgabe .body { flex: 1; min-width: 0; }
.aufgabe .t { font-weight: 700; }
.aufgabe.erledigt .t, .aufgabe.erledigt .n { text-decoration: line-through; color: var(--muted); }
.haken { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--accent); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.haken svg { width: 18px; height: 18px; opacity: 0; }
.haken.an { background: var(--accent); } .haken.an svg { opacity: 1; color: var(--on-accent); }
.picto { width: 28px; height: 28px; border-radius: 7px; background: var(--fg); color: var(--bg); display: inline-grid; place-items: center; flex: none; }
.picto svg { width: 18px; height: 18px; }
.picto.klein { width: 20px; height: 20px; border-radius: 5px; } .picto.klein svg { width: 14px; height: 14px; }
.tip { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.legende { display: flex; gap: 10px 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legende span { display: inline-flex; gap: 6px; align-items: center; }

/* Eigenschaften */
.props { display: grid; grid-template-columns: minmax(0, 1fr); }
.prop { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr); gap: 4px 14px; padding: 11px 0; border-top: 1px solid var(--line); align-items: start; }
.prop:first-child { border-top: 0; }
.prop .k { font-weight: 700; font-size: .9rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.prop .v { min-width: 0; overflow-wrap: anywhere; }
.prop .was { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.prop.eigen .k { color: var(--own); }
@media (max-width: 520px) { .prop { grid-template-columns: minmax(0, 1fr); } }
.vorformat { white-space: pre-line; overflow-wrap: anywhere; }

/* Blütenfarben (feste Anzeigefarben) */
.farbe-weiss { background: #f3f1ea; } .farbe-creme { background: #eee0b0; } .farbe-gelb { background: #f1c21b; }
.farbe-orange { background: #ec8a2c; } .farbe-rot { background: #cf3a2e; } .farbe-rosa { background: #ee8db2; }
.farbe-violett { background: #8b5fc4; } .farbe-blau { background: #4f78d4; } .farbe-gruen { background: #79ad49; }
.farbe-braun { background: #8a5a3a; } .farbe-ohne { background: var(--accent); opacity: .5; }

/* Kalender: Jahresansicht */
.kalwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.kal { border-collapse: collapse; min-width: 760px; width: 100%; font-size: .8rem; }
.kal th, .kal td { border-top: 1px solid var(--line); padding: 0; }
.kal thead th { padding: 8px 2px; color: var(--muted); font-weight: 700; text-align: center; border-top: 0; }
.kal thead th.jetzt { color: var(--accent); }
.kal .lab { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; max-width: 220px; padding: 6px 10px; text-align: left; }
.kal .lab a { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--fg); min-width: 0; }
.kal .lab .ph { width: 30px; height: 30px; border-radius: 6px; flex: none; }
.kal .lab .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.kal .lab .o { font-size: .72rem; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.kal td { border-left: 1px solid var(--line); vertical-align: middle; height: 44px; }
.kal td.jetzt { background: var(--accent-soft); }
.zelle { display: flex; flex-direction: column; gap: 2px; padding: 3px; align-items: stretch; }
.blbalken { display: flex; height: 8px; border-radius: 2px; overflow: hidden; }
.blbalken i { flex: 1; display: block; }
.zelle .icons { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }

/* Kalender: Monatsansicht */
.monatsabschnitte { display: grid; gap: 12px; }
@media (min-width: 700px) { .monatsabschnitte { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .monatsabschnitte { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mitem { display: flex; gap: 10px; align-items: center; padding: 6px 0; text-decoration: none; color: var(--fg); min-width: 0; }
.mitem .ph { width: 40px; height: 40px; flex: none; }
.mitem .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Garten */
.ort { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.ort-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); }
.ort-kopf:hover h3 { color: var(--accent); }
.tiefe-1 { margin-left: 16px; } .tiefe-2 { margin-left: 32px; } .tiefe-3 { margin-left: 48px; } .tiefe-4 { margin-left: 64px; }
@media (max-width: 520px) { .tiefe-1 { margin-left: 10px; } .tiefe-2 { margin-left: 20px; } .tiefe-3, .tiefe-4 { margin-left: 30px; } }
.pcards { display: grid; gap: 12px; }
@media (min-width: 640px) { .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pcard { display: flex; gap: 12px; padding: 12px; text-decoration: none; color: var(--fg); }
.pcard .ph { width: 84px; height: 84px; flex: none; }
.pcard dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 6px 0 0; font-size: .85rem; }
.pcard dt { color: var(--muted); } .pcard dd { margin: 0; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li + li { border-top: 1px solid var(--line); }
.liste a.zeile { display: flex; gap: 12px; align-items: center; padding: 10px 12px; text-decoration: none; color: var(--fg); }
.hero { display: grid; gap: 16px; }
@media (min-width: 700px) { .hero { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); } }
.verlauf { display: flex; flex-direction: column; border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; }
.verlauf div { position: relative; padding: 4px 0; }
.verlauf div::before { content: ""; position: absolute; left: -22px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.verlauf div.aktuell::before { background: var(--accent); }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.login .card { max-width: 400px; width: 100%; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-size: 1.6rem; font-weight: 600; }
.logo svg { width: 34px; height: 34px; color: var(--accent); }
.qr svg { max-width: 220px; height: auto; background: #fff; padding: 8px; border-radius: 8px; }
code.geheimnis { font-size: .9rem; overflow-wrap: anywhere; background: var(--surface-2); padding: 4px 8px; border-radius: 6px; }

/* Bestimmung */
.vorschlag { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--surface); text-align: left; width: 100%; }
.vorschlag:hover { border-color: var(--accent); }
.balken { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 4px; width: 120px; }
.balken b { display: block; height: 100%; background: var(--accent); }

/* Abstände (statt Inline-Styles, die die CSP verbietet) */
.abstand-o { margin-top: 16px; } .abstand-ou { margin: 16px 0; } .block { display: block; }
.vorschlag.an { border-color: var(--accent); background: var(--accent-soft); }
.vorschlag progress { width: 100px; accent-color: var(--accent); margin-left: auto; }

.head.spread { flex-direction: row; align-items: flex-end; }
.kaestchen .chip { padding: 4px 10px; }
details.aufgabe-feld summary { cursor: pointer; list-style: none; min-height: 36px; }
details.aufgabe-feld summary::-webkit-details-marker { display: none; }
details.aufgabe-feld summary::after { content: "▸"; color: var(--muted); margin-left: auto; }
details.aufgabe-feld[open] summary::after { content: "▾"; }
details.aufgabe-feld:first-of-type { border-top: 0; padding-top: 0; }
