/* MyFamilyStory – mobile first */
:root, [data-theme="ocean"] {
  --bg: #eef4ff; --bg2: #e2ecff; --surface: #ffffff; --surface2: #f5f8ff; --text: #14213d; --muted: #66728a;
  --primary: #3b5bdb; --primary2: #4dabf7; --on-primary: #fff; --accent: #ffb703; --border: #dbe4f5;
  --ok: #2fb380; --warn: #f59f00; --danger: #e03131; --shadow: 0 6px 24px rgba(30, 60, 140, .10);
  --radius: 20px; --font: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; --nav-bg: rgba(255,255,255,.92);
}
[data-theme="sunset"] { --bg: #fff3ec; --bg2: #ffe6d9; --surface: #fff; --surface2: #fff8f4; --text: #3a1d14; --muted: #8a6458;
  --primary: #f0603a; --primary2: #ff9f68; --accent: #ffd166; --border: #f7dccf; --shadow: 0 6px 24px rgba(200, 80, 40, .12); }
[data-theme="forest"] { --bg: #eef7f0; --bg2: #ddefe1; --surface: #fff; --surface2: #f5fbf6; --text: #15301f; --muted: #5d7766;
  --primary: #2b8a3e; --primary2: #69db7c; --accent: #fcc419; --border: #d3e8d8; --shadow: 0 6px 24px rgba(30, 110, 60, .12); }
[data-theme="lavender"] { --bg: #f5f0ff; --bg2: #ebe2ff; --surface: #fff; --surface2: #faf7ff; --text: #2b1d4a; --muted: #776a94;
  --primary: #7048e8; --primary2: #b197fc; --accent: #ffc9e3; --border: #e5dcfa; --shadow: 0 6px 24px rgba(100, 60, 200, .12); }
[data-theme="midnight"] { --bg: #0e1528; --bg2: #141d36; --surface: #19233f; --surface2: #1f2a4a; --text: #eef2ff; --muted: #9aa6c7;
  --primary: #ffc53d; --primary2: #ffe08a; --on-primary: #1a1300; --accent: #4dabf7; --border: #2a3760; --shadow: 0 6px 24px rgba(0,0,0,.35);
  --nav-bg: rgba(20, 29, 54, .94); color-scheme: dark; }
[data-theme="kid-blue"] { --bg: #dff1ff; --bg2: #c6e6ff; --surface: #fff; --surface2: #f0f8ff; --text: #0b3a66; --muted: #4f7aa3;
  --primary: #1c7ed6; --primary2: #4dd4ff; --accent: #ffd43b; --border: #bfe0fb; --radius: 28px;
  --font: 'Fredoka', 'Nunito', system-ui, sans-serif; --shadow: 0 8px 0 rgba(28, 126, 214, .18); }
[data-theme="kid-pink"] { --bg: #ffe8f3; --bg2: #ffd3e8; --surface: #fff; --surface2: #fff4fa; --text: #6b1240; --muted: #a8547f;
  --primary: #e64980; --primary2: #ff8cc6; --accent: #ffd43b; --border: #ffcfe4; --radius: 28px;
  --font: 'Fredoka', 'Nunito', system-ui, sans-serif; --shadow: 0 8px 0 rgba(230, 73, 128, .18); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; min-height: 100vh; min-height: 100dvh; }
body.kid { background: radial-gradient(circle at 10% 0%, var(--bg2) 0 180px, transparent 181px), radial-gradient(circle at 100% 30%, var(--bg2) 0 140px, transparent 141px), var(--bg); background-attachment: fixed; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 800; } h2 { font-size: 1.2rem; font-weight: 800; } h3 { font-size: 1.02rem; font-weight: 700; }
body.kid h1, body.kid h2 { font-weight: 600; letter-spacing: .2px; }
p { margin: 0 0 .7em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.hidden { display: none !important; }

/* Layout */
#app { max-width: 640px; margin: 0 auto; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar .logo { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.topbar .title { flex: 1; font-weight: 800; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.kid .topbar .title { font-weight: 600; font-size: 1.25rem; }
.topbar .back { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); border: 1px solid var(--border); cursor: pointer; }
.page { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); animation: fade .25s ease; }
.page.no-nav { padding-bottom: 32px; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Bottom nav (Instagram style) */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav .inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: 62px; }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .66rem; font-weight: 700; position: relative; }
.bottomnav a svg { width: 26px; height: 26px; transition: transform .15s; }
.bottomnav a.active { color: var(--text); }
.bottomnav a.active svg { transform: scale(1.08); }
.bottomnav a.active svg .fillable { fill: currentColor; }
.bottomnav a.active svg .chk { stroke: var(--bg); }
.bottomnav a .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
.bottomnav .plus { width: 46px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent); }
.bottomnav .plus svg { width: 24px; height: 24px; }
body.kid .bottomnav a { font-size: .74rem; font-weight: 600; }
body.kid .bottomnav a svg { width: 28px; height: 28px; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 14px; }
.card.flat { box-shadow: none; }
.hero { border-radius: calc(var(--radius) + 4px); padding: 20px; color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: var(--shadow); margin-bottom: 16px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.14); }
.hero h1, .hero h2 { color: inherit; }
.hero .big { font-size: 2.6rem; font-weight: 800; display: flex; align-items: center; gap: 10px; line-height: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; color: var(--text); box-shadow: var(--shadow); min-height: 96px; }
.tile .emo { font-size: 1.7rem; }
.tile b { font-size: .98rem; }
.tile span { font-size: .8rem; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.section-title h2 { margin: 0; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.item .emo { font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--surface2); flex-shrink: 0; }
.item .body { flex: 1; min-width: 0; }
.item .body b { display: block; overflow-wrap: anywhere; }
.item .body .small { color: var(--muted); }
.item .actions { display: flex; gap: 6px; flex-shrink: 0; }
.item.done { opacity: .6; }
body.kid .item { border-width: 2px; }
body.kid .item .emo { border-radius: 50%; font-size: 1.8rem; width: 52px; height: 52px; }

/* Buttons & forms */
.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; border-radius: 14px; padding: 13px 18px; background: linear-gradient(135deg, var(--primary), var(--primary2)); color: var(--on-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, filter .15s; text-align: center; }
.btn:active { transform: scale(.97); }
.btn:disabled { filter: grayscale(.6); opacity: .6; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn.ok { background: var(--ok); color: #fff; } .btn.danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.sm { padding: 8px 12px; font-size: .85rem; border-radius: 12px; }
.btn.icon { padding: 0; width: 40px; height: 40px; border-radius: 50%; }
body.kid .btn { border-radius: 999px; font-weight: 600; font-size: 1.05rem; box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 55%, #000 10%); }
body.kid .btn.sm { font-size: .9rem; }
body.kid .btn:active { transform: translateY(3px); box-shadow: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .9rem; }
input, textarea, select { font: inherit; color: var(--text); background: var(--surface2); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .88rem; cursor: pointer; font-family: inherit; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface2); border: 1px solid var(--border); border-radius: 16px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 800; padding: 10px; border-radius: 12px; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { font-size: 1.5rem; width: 46px; height: 46px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface2); cursor: pointer; }
.emoji-pick button.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface2); font-size: 1.3rem; font-weight: 800; color: var(--text); cursor: pointer; }
.stepper .val { min-width: 64px; display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 800; font-size: 1.2rem; }

/* Stars */
.star { display: inline-block; vertical-align: -0.15em; width: 1.1em; height: 1.1em; filter: drop-shadow(0 1px 1px rgba(160, 100, 0, .35)); }
.star.lg { width: 1em; height: 1em; }
.starpill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 28%, var(--surface)); font-weight: 800; font-size: .9rem; color: var(--text); white-space: nowrap; }
.hero .starpill { background: rgba(255,255,255,.22); color: inherit; }
.star-burst { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.star-burst .s { position: absolute; width: 34px; height: 34px; animation: burst 1.1s ease-out forwards; }
@keyframes burst { 0% { transform: translate(0,0) scale(.3) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(240deg); opacity: 0; } }
.progress { height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffd43b, #fab005); transition: width .4s; }
.hero .progress { background: rgba(255,255,255,.25); }

/* Badges / status */
.badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; display: inline-grid; place-items: center; padding: 0 5px; }
.status { font-size: .74rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.status.open { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.status.submitted { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #b06d00; }
.status.approved { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status.rejected { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
[data-theme="midnight"] .status.submitted { color: #ffd166; }

/* Avatar */
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--surface2); border: 2px solid var(--border); flex-shrink: 0; }
.avatar.xl { width: 96px; height: 96px; font-size: 3.2rem; border-width: 3px; }
.kids-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.kid-card { flex-shrink: 0; width: 132px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 10px; text-align: center; box-shadow: var(--shadow); color: var(--text); }
.kid-card .avatar { margin: 0 auto 8px; width: 60px; height: 60px; font-size: 2rem; }
.kid-card.boy .avatar { background: #dbeeff; border-color: #74c0fc; } .kid-card.girl .avatar { background: #ffe3f1; border-color: #faa2c1; }
.kid-card.add { display: flex; flex-direction: column; align-items: center; justify-content: center; border-style: dashed; color: var(--muted); }

/* Bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 15, 30, .45); z-index: 50; opacity: 0; transition: opacity .2s; }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 640px; margin: 0 auto; background: var(--surface); color: var(--text); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow-y: auto; transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.sheet.show { transform: none; }
.sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 14px; }
.sheet h2 { margin-bottom: 14px; }
.actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.actions-grid a, .actions-grid button { background: var(--surface2); border: 1px solid var(--border); border-radius: 18px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: .8rem; color: var(--text); cursor: pointer; text-align: center; }
.actions-grid .emo { font-size: 1.7rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 200; opacity: 0; transition: all .25s; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* Auth / Landing */
.landing { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; text-align: center;
  background: radial-gradient(1200px 600px at 50% -10%, #2a3f9a 0%, #121a3d 55%, #0b1029 100%); color: #fff; position: relative; overflow: hidden; }
.landing .twinkle { position: absolute; inset: 0; pointer-events: none; }
.landing .twinkle i { position: absolute; width: 3px; height: 3px; background: #fff; border-radius: 50%; opacity: .7; animation: tw 3s infinite ease-in-out; }
@keyframes tw { 50% { opacity: .1; } }
.landing .biglogo { width: min(68vw, 290px); filter: drop-shadow(0 10px 40px rgba(255, 200, 60, .35)); animation: float 5s ease-in-out infinite; position: relative; }
@keyframes float { 50% { transform: translateY(-8px); } }
.landing h1 { font-size: 1.9rem; margin-top: 22px; }
.landing p { color: #c9d3f5; max-width: 360px; }
.landing .btn { width: 100%; max-width: 340px; }
.landing .btn.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.landing .features { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 6px 0 22px; max-width: 380px; }
.landing .features span { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 700; }
.auth { padding: 24px 18px 40px; max-width: 460px; margin: 0 auto; }
.auth .head { text-align: center; margin: 10px 0 22px; }
.auth .head img { width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 50%; box-shadow: var(--shadow); }
.theme-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme-pick button { border: 2px solid var(--border); border-radius: 16px; padding: 6px 4px 8px; background: var(--surface); cursor: pointer; font: inherit; font-size: .7rem; font-weight: 700; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.theme-pick button.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.theme-pick .sw { width: 100%; height: 34px; border-radius: 10px; }

/* Pet teaser */
.pet { border-radius: var(--radius); padding: 18px; background: linear-gradient(135deg, #ff922b, #ffd43b); color: #3d2200; position: relative; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.pet h3 { font-size: 1.15rem; } .pet .paw { position: absolute; right: -6px; bottom: -14px; font-size: 5rem; opacity: .25; transform: rotate(-20deg); }
.pet .btn { background: #3d2200; color: #fff; box-shadow: none; }

/* Diary */
.entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.entry .meta { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.entry .meta .avatar { width: 36px; height: 36px; font-size: 1.2rem; }
.entry img { width: 100%; max-height: 520px; object-fit: cover; background: var(--surface2); }
.entry .content { padding: 12px 14px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.photo-pick { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; color: var(--muted); font-weight: 700; display: block; }
.photo-pick img { max-height: 240px; margin: 0 auto; border-radius: 14px; }
.photo-pick input { display: none; }

/* Worksheet */
.ws-img { border-radius: 16px; max-height: 340px; object-fit: contain; width: 100%; background: var(--surface2); margin-bottom: 12px; }
.ocr-text { min-height: 240px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.35); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Donate */
.copy-row { display: flex; align-items: center; gap: 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.copy-row .v { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: .9rem; overflow-wrap: anywhere; }
.copy-row .k { font-size: .75rem; color: var(--muted); font-weight: 700; display: block; font-family: var(--font); }

.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .emo { font-size: 3rem; display: block; margin-bottom: 6px; }
.menu-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); border: 0; border-bottom: 1px solid var(--border); background: none; width: 100%; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.menu-list a:last-child, .menu-list button:last-child { border-bottom: 0; }
.menu-list .emo { font-size: 1.3rem; width: 28px; text-align: center; }
.menu-list .chev { margin-left: auto; color: var(--muted); }

@media (min-width: 700px) {
  .page { padding-left: 24px; padding-right: 24px; }
  .grid2.wide { grid-template-columns: repeat(3, 1fr); }
}

/* Admin-Ansicht als Nutzer */
.impbar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: #1a1300; color: #ffe08a; font-size: .9rem; text-align: center; }
.impbar .btn { background: #ffc53d; color: #1a1300; }
.impbar + #app .topbar { top: 0; }

/* Login-Hinweise */
.login-help { margin-top: 18px; display: grid; gap: 8px; }
.login-help div { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--border); font-size: .9rem; color: var(--muted); }
.login-help b { color: var(--text); margin-right: 2px; }
.login-help span { font-size: 1.3rem; }
.login-help p { margin: 0; }

/* Installations-Anleitung */
.install-guide h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.install-guide ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.45; }
.install-guide.mine { border: 2px solid var(--primary); }
.btc-qr { display: block; width: 220px; height: 220px; margin: 6px auto 8px; border-radius: 16px; background: #fff; padding: 6px; box-shadow: var(--shadow); }

/* ======================================================================
   Desktop – mobile first bleibt die Basis, ab 1024px Seitenleiste & breiteres Layout
   ====================================================================== */
.bottomnav .navbrand, .bottomnav .desk { display: none; }
@media (min-width: 1024px) {
  body.with-nav #app { margin-left: 248px; }
  #app { max-width: none; }
  .topbar, .page { max-width: 1080px; margin-left: auto; margin-right: auto; }
  .topbar { padding-left: 32px; padding-right: 32px; }
  .page { padding: 8px 32px 56px; }
  .page.no-nav { padding-bottom: 56px; }

  .bottomnav { top: 0; bottom: 0; right: auto; width: 248px; border-top: 0; border-right: 1px solid var(--border); padding: 22px 14px; overflow-y: auto; }
  .bottomnav .inner { display: flex; flex-direction: column; height: auto; gap: 4px; max-width: none; }
  .bottomnav .navbrand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 1.1rem; color: var(--text); }
  .bottomnav .navbrand img { width: 44px; height: 44px; border-radius: 50%; }
  .bottomnav a { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 11px 14px; border-radius: 14px; font-size: .98rem; transition: background .15s; }
  body.kid .bottomnav a { font-size: 1.02rem; }
  .bottomnav a:hover { background: var(--surface2); color: var(--text); }
  .bottomnav a.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
  .bottomnav a.active svg .chk { stroke: var(--surface); }
  .bottomnav a .badge { position: static; margin-left: auto; }
  .bottomnav a[href="#/new"] { order: -1; margin-bottom: 10px; padding: 0; }
  .bottomnav .plus { width: 100%; height: 46px; gap: 8px; display: flex; justify-content: center; align-items: center; font-weight: 800; font-size: .98rem; border-radius: 14px; }
  .bottomnav .desk { display: inline; }
  body.with-nav .topbar .logo { display: none; }
  .bottomnav .navbrand { order: -2; }

  .grid2 { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .list > p, .list > .card { grid-column: 1 / -1; }
  .hero { padding: 28px 32px; }
  .tile { transition: transform .15s, box-shadow .15s; }
  .tile:hover, a.item:hover, [data-uid]:hover { transform: translateY(-2px); cursor: pointer; }

  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: min(580px, 92vw); max-height: 86vh; border-radius: 24px; padding: 24px 28px;
    transform: translate(-50%, -46%); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .toast { bottom: 28px; }
  body.with-nav .toast { left: calc(50% + 124px); }

  .auth { max-width: 480px; margin: 6vh auto; background: var(--surface); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow); padding: 32px 36px; }
  .landing .biglogo { width: 330px; }
  .landing h1 { font-size: 2.6rem; }
  .landing p { max-width: 520px; font-size: 1.1rem; }
  .landing .features { max-width: 560px; }
  .impbar + #app, body.with-nav .impbar { margin-left: 0; }
}
@media (min-width: 1400px) {
  .list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Unterstützen-Karte (Home, unter der Begrüßung) */
.support-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); color: #5c3b00;
  background: linear-gradient(135deg, #fff4cc, #ffe08a); border: 1px solid #ffd54a; box-shadow: var(--shadow); }
.support-card .emo { font-size: 1.8rem; }
.support-card b { display: block; }
.support-card span:not(.emo):not(.chev) { font-size: .85rem; opacity: .85; }
.support-card .chev { margin-left: auto; font-size: 1.4rem; opacity: .6; }
.bottomnav .deskonly { display: none; }
@media (min-width: 1024px) {
  .bottomnav .deskonly { display: flex; }
  .bottomnav a.support { margin-top: 14px; background: linear-gradient(135deg, #fff4cc, #ffe08a); color: #5c3b00; }
  .bottomnav a.support.active, .bottomnav a.support:hover { color: #5c3b00; filter: brightness(.97); }
}

/* Wunschliste */
.wish-strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; margin-bottom: 6px; }
.wish-card { flex: 0 0 132px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.wish-card b { font-size: .88rem; line-height: 1.25; overflow-wrap: anywhere; }
.wish-card .wimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: grid; place-items: center; font-size: 2.6rem; background: var(--surface2); }
.wish-card.add { border-style: dashed; justify-content: center; align-items: center; text-align: center; color: var(--muted); }
.wish-card.add .wish-emo { font-size: 2rem; }
.wish-card .progress { height: 8px; }
.item .emo.wish-thumb { overflow: hidden; padding: 0; }
.item .emo.wish-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1024px) { .wish-card { flex-basis: 160px; } }

/* Verwandtschaft */
.rel { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); vertical-align: middle; margin-left: 4px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--border); margin-bottom: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }

/* Benachrichtigungen */
.ncard .nhead { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ncard .nhead .emo { font-size: 1.7rem; }
.ncard .nhead > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ok-text { color: var(--ok); font-weight: 700; margin: 0 0 8px; }
.howto { margin-top: 12px; font-size: .9rem; }
.howto summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.howto ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.notify-prompt { border: 2px dashed var(--primary2); }
