/* App-Ergänzungen: Navigation unten, Installieren-Hinweis, Fortschritt */
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.appnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid #eadfd4;
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.appnav a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0;
  color: #5b6170; text-decoration: none; font-size: 11px; font-weight: 800; min-height: 52px; justify-content: center; }
.appnav a[aria-current=page] { color: #e8620c; }
.appnav svg { width: 22px; height: 22px; }
.appnav a { position: relative; }
.appnav .soon { position: absolute; top: 2px; left: 50%; margin-left: 6px; font-size: 8px; letter-spacing: .06em; background: #14213d; color: #fff; border-radius: 6px; padding: 1px 4px; }

.install { display: none; background: #fff6ee; border: 2px solid #e8620c; border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; position: relative; }
.install.show { display: block; }
.install h3 { font-size: 16px; color: #14213d; margin-bottom: 4px; padding-right: 30px; }
.install p { font-size: 14px; color: #5b6170; }
.install ol { font-size: 14px; color: #1d1d1f; margin: 8px 0 0 18px; }
.install button.go { margin-top: 10px; width: 100%; background: #e8620c; color: #fff; border: 0; border-radius: 12px; padding: 13px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.install button.x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 22px; color: #5b6170; cursor: pointer; }

.progress { background: #14213d; color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 20px; }
.progress .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.progress h3 { font-size: 16px; }
.progress .count { font-size: 26px; font-weight: 900; color: #e8620c; }
.progress .bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.15); margin: 10px 0 12px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: #e8620c; border-radius: 6px; width: 0; transition: width .3s; }
.progress button { width: 100%; border: 0; border-radius: 12px; padding: 13px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; background: #e8620c; color: #fff; }
.progress button.done { background: rgba(255,255,255,.15); color: #fff; }
.progress .sub { font-size: 13px; color: #d9deea; margin-top: 8px; text-align: center; }
.progress .undo { background: transparent; color: #d9deea; font-size: 13px; font-weight: 700; padding: 6px; margin-top: 4px; text-decoration: underline; }

/* Platz für Uhrzeit/Notch oben, wenn die App vom Homescreen gestartet wird */
.hero { padding-top: calc(30px + env(safe-area-inset-top)) !important; }

/* =========================================================
   Modernes Design: Verläufe, weiche Schatten, Tiefe
   ========================================================= */
:root {
  --g-navy: linear-gradient(150deg, #24345f 0%, #14213d 48%, #0a1124 100%);
  --g-orange: linear-gradient(135deg, #f2812c 0%, #e8620c 55%, #c94a10 100%);
  --g-orange-soft: radial-gradient(circle at 78% 22%, #ffb35f 0%, #f27a26 42%, #c84810 100%);
  --sh-card: 0 1px 2px rgba(20,33,61,.06), 0 10px 28px rgba(20,33,61,.08);
  --sh-btn: 0 6px 16px rgba(20,33,61,.18);
}
body { background: #faf6f1 !important; }

/* Kopfbereich: Navy-Verlauf mit Lichtschein + Orange-Welle als Verlauf */
.hero { background: radial-gradient(90% 80% at 88% 0%, rgba(96,112,170,.35) 0%, rgba(20,33,61,0) 60%), var(--g-navy) !important; }
.hero:after { background: var(--g-orange-soft) !important; width: 190px !important; height: 190px !important; right: -90px !important; top: -95px !important; }

/* Buttons */
.btn:not(.ghost):not(.dark):not(.secondary):not([style*="#fff"]) { background: var(--g-orange) !important; box-shadow: var(--sh-btn); }
.btn.dark, .btn.secondary { background: var(--g-navy) !important; box-shadow: var(--sh-btn); }
.install button.go, .progress button:not(.done):not(.undo) { background: var(--g-orange) !important; box-shadow: var(--sh-btn); }

/* Karten: weiche Schatten statt Rahmen */
.card:not(.new), .letter, .list li, .partner, .help, .summary { border-color: transparent !important; box-shadow: var(--sh-card); background-color: #fff; }
.card.new { box-shadow: 0 10px 28px rgba(232,98,12,.14); }
.teaser, .founder { background: linear-gradient(160deg, #fff8f1 0%, #ffeedd 100%) !important; box-shadow: var(--sh-card); }

/* Dunkle Karten: Navy-Verlauf mit Licht */
.card.today, .progress, .calbox:not([style]) { background: radial-gradient(80% 70% at 90% 0%, rgba(96,112,170,.30) 0%, rgba(20,33,61,0) 60%), var(--g-navy) !important; box-shadow: 0 12px 30px rgba(20,33,61,.22); }

/* Kleine Elemente in Orange als Verlauf */
.bar i, .progress .bar i { background: var(--g-orange) !important; }
.day.done i { background: var(--g-orange) !important; border-color: transparent !important; }
.opts button[aria-pressed=true], .opts input:checked + span, .moods input:checked + span, .days input:checked + span { background: var(--g-orange) !important; border-color: transparent !important; box-shadow: var(--sh-btn); }
.num, .n { background: var(--g-orange) !important; box-shadow: 0 4px 10px rgba(201,74,16,.25); }
.badge { background: var(--g-orange) !important; }
.stats div, .day { box-shadow: inset 0 0 0 1px rgba(20,33,61,.04); }

/* Navigation unten: leicht durchsichtig, wie bei iOS */
.appnav { background: rgba(255,255,255,.86) !important; -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid rgba(20,33,61,.06) !important; box-shadow: 0 -6px 20px rgba(20,33,61,.05); }

/* Nachrichten von Chris */
.msg { background:#fff; border-radius:18px; padding:16px; margin-bottom:14px; box-shadow: var(--sh-card); }
.msg-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.msg-head img { width:42px; height:42px; border-radius:50%; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f27a26; }
.msg-head b { display:block; color:#14213d; font-size:16px; line-height:1.2; }
.msg-head span { font-size:13px; color:#5b6170; }
.msg-text { font-size:16px; line-height:1.5; color:#1d1d1f; }
.msg-img { display:block; width:100%; max-height:62vh; object-fit:cover; object-position:center 30%; border-radius:14px; margin-top:12px; }
.msg-link { display:inline-block; margin-top:10px; color:#e8620c; font-weight:800; text-decoration:none; }
.msg-foot { display:flex; margin-top:12px; }
.poll { display:grid; gap:8px; margin-top:14px; }
.pop-opt { position:relative; overflow:hidden; display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:48px; padding:12px 14px; border:2px solid #eadfd4; border-radius:14px; background:#fff; color:#14213d; font:inherit; font-size:16px; font-weight:800; text-align:left; cursor:pointer; }
.pop-opt span, .pop-opt b { position:relative; z-index:1; }
.pop-opt b { color:#5b6170; font-size:15px; }
.pop-opt i { position:absolute; left:0; top:0; bottom:0; background:#fbe9dc; transition:width .5s ease; }
.pop-opt.me { border-color:#e8620c; }
.pop-opt.me i { background:#ffd9bd; }
.pop-opt.me b { color:#e8620c; }
.poll-sum { font-size:13px; color:#5b6170; margin:2px 2px 0; }
.like { display:inline-flex; align-items:center; gap:6px; border:0; border-radius:999px; padding:9px 14px; min-height:44px; background:#f6f1eb; color:#5b6170; font:inherit; font-weight:800; font-size:15px; cursor:pointer; }
.like svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; }
.like.on { background: var(--g-orange); color:#fff; box-shadow: var(--sh-btn); }
.like.on svg { fill:#fff; stroke:#fff; }
.like.pop svg { animation: ckpop .35s ease; }
@keyframes ckpop { 50% { transform: scale(1.35); } }
.msg-lbl { font-size:12px; letter-spacing:.12em; text-transform:uppercase; color:#e8620c; font-weight:800; margin:0 0 8px 4px; }
.msg-more { display:block; text-align:right; font-size:14px; font-weight:800; color:#e8620c; text-decoration:none; margin:-4px 4px 18px; }
.appnav a:last-child .soon { left:auto; right:0; margin-left:0; }

/* Ladeplatzhalter für Nachrichten */
.skel i { display:block; background:#efe7de; border-radius:8px; animation: skp 1.2s ease-in-out infinite; }
.skel .sk-av { width:42px; height:42px; border-radius:50%; }
.skel .sk-l { height:14px; margin:10px 0; width:100%; }
.skel .sk-t { font-size:13px; color:#5b6170; margin-top:12px; }
@keyframes skp { 50% { opacity:.45; } }

/* ===== Abzeichen & Feier ===== */
.ck-badge { width:52px; height:52px; border-radius:50%; display:grid; place-items:center; flex:none;
  background: radial-gradient(circle at 30% 25%, #ffd08a 0%, #f2812c 45%, #c94a10 100%);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(242,129,44,.35), 0 8px 18px rgba(201,74,16,.25); }
.ck-badge span { font-size:26px; line-height:1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.ck-badge.sm { width:40px; height:40px; } .ck-badge.sm span { font-size:20px; }
.ck-badge.big { width:120px; height:120px; margin:6px auto 14px; animation: ckpopin .6s cubic-bezier(.2,1.6,.4,1); }
.ck-badge.big span { font-size:60px; }
.ck-badge.next { background:#f1ebe4; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #eadfd4; }
.ck-badge.next span { filter: grayscale(1) opacity(.45); }
@keyframes ckpopin { 0% { transform:scale(.2) rotate(-25deg); opacity:0; } 100% { transform:scale(1) rotate(0); opacity:1; } }
.ck-cele { position:fixed; inset:0; z-index:200; background:rgba(10,17,36,.72); display:grid; place-items:center; padding:20px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ck-cele-card { position:relative; z-index:2; background:#fff; border-radius:24px; padding:26px 22px 22px; max-width:360px; width:100%; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,.35); }
.ck-cele-card h2 { color:#14213d; font-size:24px; margin-bottom:8px; }
.ck-cele-card p { color:#1d1d1f; font-size:16px; line-height:1.45; }
.ck-cele-card .sig { color:#e8620c; font-weight:800; margin-top:6px; }
.ck-cele-kick { font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:#e8620c; font-weight:800; }
.ck-cele .btn { margin-top:16px; }
.ck-conf { position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.ck-conf i { position:absolute; top:-12px; width:9px; height:14px; border-radius:2px; animation: ckfall linear forwards; }
@keyframes ckfall { to { transform: translateY(105vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .ck-conf { display:none; } .ck-badge.big { animation:none; } }

/* ===== Heute: Kompakt ===== */
.hero .gear { position:absolute; right:0; top:-4px; width:44px; height:44px; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.12); color:#fff; z-index:3; }
.hero .gear svg { width:22px; height:22px; }
.chal { margin-top:14px; } .chal .t { display:flex; justify-content:space-between; font-size:13px; font-weight:800; color:#ffb27a; letter-spacing:.04em; }
.chal .b { height:6px; border-radius:4px; background:rgba(255,255,255,.15); margin-top:6px; overflow:hidden; } .chal .b i { display:block; height:100%; background:var(--g-orange); border-radius:4px; }
.chal .teaser-line { font-size:13px; color:#d9deea; margin-top:6px; }
.statrow { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px; }
.statrow div { background:#fff; border-radius:16px; padding:12px 8px; text-align:center; box-shadow: var(--sh-card); }
.statrow b { display:block; font-size:22px; font-weight:900; color:#14213d; line-height:1.2; }
.statrow span { font-size:12px; color:#5b6170; font-weight:700; }
.erfolge .row { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0 4px; }
.erfolge .nextgoal { display:flex; gap:12px; align-items:center; background:#faf6f1; border-radius:14px; padding:12px; margin-top:12px; }
.erfolge .nextgoal p { font-size:14px; color:#1d1d1f; } .erfolge .nextgoal b { color:#14213d; }
.erfolge .nb { height:8px; border-radius:6px; background:#efe7de; margin-top:6px; overflow:hidden; } .erfolge .nb i { display:block; height:100%; background:var(--g-orange); }
.erfolge details { margin-top:12px; } .erfolge summary { cursor:pointer; font-weight:800; color:#e8620c; font-size:15px; list-style:none; padding:6px 0; }
.erfolge summary::-webkit-details-marker { display:none; }
.blist { list-style:none; margin-top:8px; } .blist li { display:flex; gap:12px; align-items:center; padding:8px 0; border-bottom:1px solid #f0e8df; }
.blist li:last-child { border-bottom:0; } .blist b { display:block; color:#14213d; } .blist small { color:#5b6170; font-size:13px; }
.hist { columns:2; font-size:14px; color:#5b6170; margin-top:8px; list-style:none; } .hist li { padding:3px 0; }
.ghostlink { display:block; text-align:center; margin-top:10px; font-size:14px; font-weight:700; color:#d9deea; background:none; border:0; font-family:inherit; cursor:pointer; text-decoration:underline; width:100%; padding:8px; }
.donebox { margin-top:12px; background:rgba(255,255,255,.12); border-radius:14px; padding:12px; text-align:center; color:#fff; font-weight:800; }

/* ===== Onboarding ===== */
.onb { position:fixed; inset:0; z-index:150; background:#faf6f1; overflow:auto; padding: calc(24px + env(safe-area-inset-top)) 20px 30px; }
.onb .in { max-width:480px; margin:0 auto; }
.onb .dots { display:flex; gap:6px; justify-content:center; margin-bottom:18px; } .onb .dots i { width:8px; height:8px; border-radius:50%; background:#e5dbd0; } .onb .dots i.on { background:#e8620c; width:22px; border-radius:6px; }
.onb h1 { color:#14213d; font-size:30px; line-height:1.1; margin:6px 0 10px; } .onb h1 span { color:#e8620c; }
.onb p { color:#5b6170; font-size:16px; }
.onb img.hero-img { width:100%; max-height:42vh; object-fit:cover; object-position:center 25%; border-radius:20px; margin:4px 0 16px; box-shadow: var(--sh-card); }
.onb .opts { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:16px 0 4px; }
.onb .opts button { border:2px solid #eadfd4; background:#fff; border-radius:14px; padding:16px 6px; font:inherit; font-weight:800; font-size:16px; color:#14213d; cursor:pointer; }
.onb .opts button[aria-pressed=true] { background: var(--g-orange); color:#fff; border-color:transparent; }
.onb .skip { display:block; margin:12px auto 0; background:none; border:0; color:#5b6170; font:inherit; font-weight:700; text-decoration:underline; cursor:pointer; padding:10px; }

/* Tastatur-Fokus sichtbar (Barrierefreiheit) */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline:3px solid #e8620c; outline-offset:3px; border-radius:8px; }

/* =========================================================
   Design-Regeln (docs/design-regeln.md) – gelten für alle Seiten
   ========================================================= */
/* Regel 3: Jedes Tippen reagiert sichtbar – der Knopf drückt sich kurz ein (wie bei iPhone-Apps) */
button, .btn, .cb, .like, .pop-opt, .appnav a, .msg-link, .t-mehr {
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .16s cubic-bezier(.3,.7,.4,1), opacity .16s ease, background-color .2s ease, box-shadow .2s ease;
}
button:not(:disabled):active, .btn:active, .cb:active, .like:active, .pop-opt:active, .msg-link:active, .t-mehr:active { transform: scale(.96); }
.appnav a:active { transform: scale(.92); opacity: .7; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(232,98,12,.55); outline-offset: 2px; }

/* Regel 4: Sanftes Überblenden beim Wechsel zwischen Seiten statt hartem Springen.
   Die Navigation unten bleibt dabei ruhig stehen. Browser ohne Unterstützung springen wie bisher. */
@view-transition { navigation: auto; }
.appnav { view-transition-name: appnav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; animation-timing-function: ease; }

/* Regel 5: Navigation unten etwas größer lesbar */
.appnav a { font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  button, .btn, .cb, .like, .pop-opt, .appnav a, .msg-link, .t-mehr { transition: none; }
}
