/* Tagwerk – warmes Urlaubs-Licht. Alle Größen in rem, damit A+ (100–150 %) alles mitwachsen lässt. Tippflächen ≥ 2,75rem (≈ 44 pt). */
:root {
  --bg: #f6efe3; --karte: #fffaf0; --tinte: #2a2118; --grau: #6e6254; --linie: #e4d9c6; --hell: #efe5d3;
  --ak: #e0702b; --ak-d: #a04612; --balken: #b3a690; --ak-h: #fbe6d4; --bl: #1f6f8b; --bl-h: #dcecf2; --gruen: #3f7d4c; --rot: #b2453b; --rot-h: #f6e1de;
  --sans: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --r: 16px; --schatten: 0 1px 2px rgba(60,40,20,.08), 0 4px 14px rgba(60,40,20,.07);
  --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-look="hell"]) { --bg: #181410; --karte: #241e18; --tinte: #f3ebdf; --grau: #b5a897; --linie: #3a3128; --hell: #2e261e; --ak: #f08a4a; --ak-d: #f6a06c; --balken: #6e6256; --ak-h: #3f2a1b; --bl: #7bc2da; --bl-h: #1c3039; --gruen: #7cc08a; --rot: #ec8075; --rot-h: #3d2422; --schatten: none; }
}
:root[data-look="dunkel"] { --bg: #181410; --karte: #241e18; --tinte: #f3ebdf; --grau: #b5a897; --linie: #3a3128; --hell: #2e261e; --ak: #f08a4a; --ak-d: #f6a06c; --balken: #6e6256; --ak-h: #3f2a1b; --bl: #7bc2da; --bl-h: #1c3039; --gruen: #7cc08a; --rot: #ec8075; --rot-h: #3d2422; --schatten: none; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-a="115"] { font-size: 18.4px; } html[data-a="130"] { font-size: 20.8px; } html[data-a="150"] { font-size: 24px; }
body { margin: 0; background: var(--bg); color: var(--tinte); font: 400 1rem/1.4 var(--sans); overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--ak-d); }
img, video, canvas { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: .4rem 0; }
.klein, p, .txt, .hinweis { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.app { min-height: 100vh; }
.inhalt { max-width: 760px; margin: 0 auto; padding: .5rem 1rem calc(7.5rem + var(--unten)); }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: .6rem; padding: calc(var(--oben) + .5rem) 1rem .6rem; max-width: 760px; margin: 0 auto; }
.kopf .titel { flex: 1; min-width: 0; }
.kopf h1 { font-size: 1.3rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf small { display: block; color: var(--grau); font-size: .8rem; }
.rund { min-width: 2.75rem; min-height: 2.75rem; border-radius: 14px; display: grid; place-items: center; background: var(--karte); border: 1px solid var(--linie); font-size: 1.3rem; color: var(--ak-d); text-decoration: none; }
.aplus { font-weight: 800; font-size: .95rem; background: var(--tinte); color: var(--bg); border-radius: 12px; min-height: 2.75rem; min-width: 2.75rem; padding: 0 .7rem; }
.schritte { display: flex; gap: 2px; max-width: 760px; margin: 0 auto; padding: 0 .4rem; position: sticky; top: calc(var(--oben) + 3.9rem); z-index: 4; background: var(--bg); }
.schritte a { flex: 1; height: 2.75rem; position: relative; }
.schritte a::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: .5rem; transform: translateY(-50%); border-radius: 4px; background: var(--balken); }
.schritte a.an::after { background: var(--ak); } .schritte a.jetzt::after { background: var(--bl); }
.schrittname { max-width: 760px; margin: 0 auto; padding: 0 1rem .2rem; font-size: .85rem; color: var(--grau); }

/* Bausteine */
.karte { background: var(--karte); border-radius: var(--r); padding: .9rem; margin: .7rem 0; box-shadow: var(--schatten); border: 1px solid var(--linie); }
.karte h2 { font-size: 1.1rem; margin-bottom: .3rem; }
.klein { color: var(--grau); font-size: .85rem; }
.knopf { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 3rem; padding: .6rem 1rem; border-radius: 16px; font-weight: 700; background: var(--ak-d); color: #fff; margin: .5rem 0; text-decoration: none; text-align: center; }
@media (prefers-color-scheme: dark) { :root:not([data-look="hell"]) .knopf:not(.hell):not(.bl):not(.rot) { color: #1d1208; } }
:root[data-look="dunkel"] .knopf:not(.hell):not(.bl):not(.rot) { color: #1d1208; }
.knopf.bl { background: var(--bl); } @media (prefers-color-scheme: dark) { :root:not([data-look="hell"]) .knopf.bl { color: #07202a; } }
:root[data-look="dunkel"] .knopf.bl { color: #07202a; }
.knopf.hell { background: var(--karte); color: var(--tinte); border: 1px solid var(--linie); }
.knopf.rot { background: var(--rot); color: #fff; }
.knopf[disabled] { opacity: .45; pointer-events: none; }
.knopf.klein2 { width: auto; min-height: 2.75rem; padding: .4rem .9rem; margin: .2rem; display: inline-flex; }
.reihe { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.reihe > .knopf { flex: 1 1 8rem; }
.umschalter { display: flex; gap: .4rem; margin: .4rem 0; }
.umschalter button { flex: 1; min-height: 2.75rem; border: 2px solid var(--bl); border-radius: 12px; background: var(--karte); font-weight: 600; padding: 0 .4rem; }
.umschalter button.an { background: var(--bl); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-look="hell"]) .umschalter button.an { color: #07202a; } }
:root[data-look="dunkel"] .umschalter button.an { color: #07202a; }
.stepper { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; }
.stepper button { min-width: 2.75rem; min-height: 2.75rem; border-radius: 12px; background: var(--hell); font-size: 1.3rem; font-weight: 800; }
.stepper b { min-width: 3.2rem; text-align: center; font-size: 1.15rem; }
label.feld { display: block; font-weight: 600; margin: .6rem 0 .2rem; }
input[type=text], input[type=date], input[type=search] { width: 100%; min-height: 2.75rem; border-radius: 12px; border: 1px solid var(--linie); background: var(--bg); padding: 0 .7rem; }
input[type=range] { width: 100%; min-height: 2.75rem; accent-color: var(--ak); }
.balken { height: .7rem; border-radius: 6px; background: var(--linie); overflow: hidden; margin: .5rem 0; }
.balken i { display: block; height: 100%; width: 0; background: var(--ak); transition: width .2s; }
.hinweis { background: var(--bl-h); color: var(--tinte); border-radius: 12px; padding: .6rem .8rem; margin: .6rem 0; font-size: .92rem; }
.hinweis.warn { background: var(--ak-h); } .hinweis.fehler { background: var(--rot-h); }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; min-height: 3rem; padding: .3rem 0; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border: 0; } .zeile .txt { flex: 1; min-width: 0; } .zeile b { display: block; }

/* Start */
.tage { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
a.tag { display: block; text-decoration: none; color: inherit; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; box-shadow: var(--schatten); }
a.tag .bild { aspect-ratio: 4/3; background: linear-gradient(135deg, var(--ak), var(--bl)); display: grid; place-items: center; font-size: 2rem; color: #fff; }
a.tag .bild img { width: 100%; height: 100%; object-fit: cover; }
a.tag .t { padding: .5rem .7rem .7rem; } a.tag b { display: block; }
.marke { display: inline-block; font-size: .72rem; font-weight: 800; padding: .1rem .5rem; border-radius: 99px; background: var(--ak-h); color: var(--ak-d); margin: .1rem .2rem 0 0; }
.marke.gruen { background: var(--bl-h); color: var(--bl); }

/* Raster der Auswahl */
.raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.zelle { position: relative; aspect-ratio: 1; background: var(--hell); border-radius: 8px; overflow: hidden; border: 3px solid transparent; }
.zelle > img { width: 100%; height: 100%; object-fit: cover; }
.zelle.herz { border-color: var(--ak); } .zelle.raus { opacity: .35; } .zelle.vorschlag { border-color: var(--bl); } .zelle.doppelt::after { content: "doppelt"; position: absolute; left: 4px; bottom: 4px; background: #000a; color: #fff; font-size: .65rem; padding: 0 .3rem; border-radius: 4px; }
.zelle .oeffnen { position: absolute; inset: 0; width: 100%; height: 100%; }
.zelle .h, .zelle .x { position: absolute; top: 0; min-width: 2.75rem; min-height: 2.75rem; display: grid; place-items: center; color: #fff; font-size: 1.25rem; text-shadow: 0 1px 3px #000c; }
.zelle .h { right: 0; } .zelle .x { left: 0; }
.zelle.herz .h { color: #ff8a4c; } .zelle.raus .x { color: #ff6b5f; }
.zelle .art { position: absolute; left: 6px; bottom: 4px; font-size: .7rem; color: #fff; background: #000a; border-radius: 4px; padding: 0 .3rem; }
.zelle .zeit { position: absolute; right: 6px; bottom: 4px; font-size: .65rem; color: #fff; background: #000a; border-radius: 4px; padding: 0 .3rem; }
.zelle .oeffnen { z-index: 0; } .zelle .h, .zelle .x { z-index: 1; }

/* Collage */
.collagenbox { background: var(--hell); border-radius: 12px; padding: 6px; touch-action: manipulation; }
.collagenbox canvas { width: 100%; height: auto; border-radius: 6px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.collagenbox canvas.zieht { touch-action: none; }

/* Zeitleiste (Einsprechen) */
.zeitleiste { position: relative; height: 3.2rem; border-radius: 10px; background: var(--hell); margin: .6rem 0; overflow: hidden; touch-action: manipulation; }
.zeitleiste .film { position: absolute; left: 0; right: 0; top: .3rem; height: .75rem; background: var(--bl); border-radius: 6px; opacity: .85; }
.zeitleiste .teil { position: absolute; top: .3rem; height: .75rem; width: 2px; background: var(--bg); }
.zeitleiste .stimme { position: absolute; bottom: .35rem; height: 1.1rem; border-radius: 6px; background: var(--ak); }
.zeitleiste .kopf2 { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--tinte); }
.pegel { height: .7rem; border-radius: 6px; background: var(--linie); overflow: hidden; } .pegel i { display: block; height: 100%; width: 0; background: var(--gruen); }
.aufnahme-an { animation: pulse 1.1s infinite; } @keyframes pulse { 50% { opacity: .55; } }
video.vorschau { width: 100%; border-radius: 14px; background: #000; max-height: 60vh; }

/* Vollbild */
.viewer { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; flex-direction: column; touch-action: none; }
.viewer .flaeche { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; }
.viewer img { max-width: none; max-height: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; will-change: transform; }
.viewer .leiste { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(var(--oben) + .4rem) .6rem .4rem; background: linear-gradient(#000a, transparent); z-index: 2; gap: .5rem; }
.viewer .unten { position: absolute; left: 0; right: 0; bottom: 0; padding: .6rem .8rem calc(var(--unten) + .6rem); background: linear-gradient(transparent, #000b); text-align: center; z-index: 2; font-size: .9rem; }
.viewer button { min-width: 2.75rem; min-height: 2.75rem; font-size: 1.4rem; color: #fff; background: #fff2; border-radius: 99px; padding: 0 .8rem; }
.viewer video { max-width: 100%; max-height: 100%; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(5.2rem + var(--unten)); background: var(--tinte); color: var(--bg); padding: .7rem 1rem; border-radius: 14px; z-index: 60; max-width: 90vw; font-weight: 600; text-align: center; }

/* Fußleiste mit Hauptknopf */
.fuss { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: linear-gradient(transparent, var(--bg) 28%); padding: 1.2rem 1rem calc(var(--unten) + .7rem); }
.fuss .innen { max-width: 760px; margin: 0 auto; display: flex; gap: .5rem; } .fuss .knopf { margin: 0; }

/* Seitenleiste ab iPad quer */
.seitenleiste { display: none; }
.zweispaltig > * { min-width: 0; }
@media (min-width: 700px) { .tage { grid-template-columns: repeat(3, 1fr); } .raster { grid-template-columns: repeat(5, 1fr); } .inhalt { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 900px) and (orientation: portrait) { .raster { grid-template-columns: repeat(6, 1fr); } .tage { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) and (orientation: landscape) {
  .seitenleiste { display: block; position: fixed; left: 0; top: 0; bottom: 0; width: 17rem; background: var(--karte); border-right: 1px solid var(--linie); overflow-y: auto; padding: calc(var(--oben) + 1rem) .8rem 1rem; z-index: 10; }
  .seitenleiste h2 { font-size: 1.3rem; margin: 0 .4rem .8rem; }
  .seitenleiste .gruppe { font-size: .72rem; text-transform: uppercase; color: var(--grau); font-weight: 800; letter-spacing: .06em; margin: 1rem .4rem .3rem; }
  .seitenleiste a { display: flex; align-items: center; gap: .6rem; min-height: 2.9rem; padding: 0 .6rem; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; }
  .seitenleiste a.an { background: var(--ak-h); color: var(--ak-d); }
  .app { padding-left: 17rem; }
  .kopf, .schritte, .schrittname, .inhalt { max-width: 1160px; }
  .fuss { left: 17rem; } .fuss .innen { max-width: 1160px; }
  .zweispaltig { display: grid; grid-template-columns: minmax(20rem, 1fr) minmax(20rem, 28rem); gap: 1.2rem; align-items: start; }
  .zweispaltig > .rechts { position: sticky; top: 7rem; }
  .raster { grid-template-columns: repeat(6, 1fr); } .tage { grid-template-columns: repeat(4, 1fr); }
  /* bei großer Schrift passen zwei Spalten nicht mehr neben die Seitenleiste */
  html[data-a="130"] .zweispaltig, html[data-a="150"] .zweispaltig { display: block; }
  html[data-a="130"] .zweispaltig > .rechts, html[data-a="150"] .zweispaltig > .rechts { position: static; }
  html[data-a="130"] .tage, html[data-a="150"] .tage { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* Dunkel: helle Knopffarben bekommen dunkle Schrift (Kontrast ≥ 4,5) */
@media (prefers-color-scheme: dark) { :root:not([data-look="hell"]) .knopf.rot { color: #2a0a07; } }
:root[data-look="dunkel"] .knopf.rot { color: #2a0a07; }
