/* famyWerk Web-App: ruhige Flächen, runde Formen, ein warmer Verlauf als Akzent. Hell und Dunkel. */
:root {
  --warm: #ff8a5b;
  --berry: #e8457a;
  --accent: #f0626b;
  --glow: linear-gradient(135deg, var(--warm), var(--berry));
  --bg: #f4f3f7;
  --surface: #ffffff;
  --text: #1c1b22;
  --muted: #6e6c7a;
  --line: #e6e4ec;
  --quiet: #ebe9f1;
  --cal: #5b5bd6;
  --todo: #0a84ff;
  --shop: #2fb457;
  --radius: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111015;
    --surface: #1c1b22;
    --text: #f3f2f7;
    --muted: #9d9aa9;
    --line: #2b2a33;
    --quiet: #26252e;
    --cal: #8583f2;
    --todo: #4aa3ff;
    --shop: #46c96c;
  }
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand, .bigcode { font-family: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 2rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 0.85rem; margin: 18px 6px 6px; color: var(--muted); font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.85rem; }
.error { color: #d92d3a; font-weight: 600; }
.late { color: #e5383b; font-weight: 600; }
small { display: block; color: var(--muted); font-size: 0.82rem; }

/* Farben der Familienmitglieder */
.c-coral { --c: #f56b61; } .c-blue { --c: #0a84ff; } .c-green { --c: #30b85a; } .c-purple { --c: #af52de; }
.c-orange { --c: #ff9500; } .c-teal { --c: #2bb3c0; } .c-pink { --c: #ff4f8b; } .c-indigo { --c: #5e5ce6; } .c-gray { --c: #8e8e93; }

.avatar {
  --s: 28px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 78%, white), var(--c));
  color: #fff; font: 700 calc(var(--s) * 0.46) ui-rounded, -apple-system, sans-serif;
}
.avatar.add { background: var(--quiet); color: var(--text); }
.avatars { display: inline-flex; flex: none; }
.avatars .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.pro { background: var(--glow); color: #fff; font-size: 0.62rem; font-weight: 800; padding: 2px 6px; border-radius: 99px; vertical-align: middle; }
.badge {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 75%, white), var(--k));
}
.badge svg, .tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge svg { stroke: #fff; }
.badge.big { width: 64px; height: 64px; border-radius: 20px; } .badge.big svg { width: 34px; height: 34px; }
.cal { --k: var(--cal); } .todo { --k: var(--todo); } .shop { --k: var(--shop); }

/* Knöpfe */
.glow { background: var(--glow); color: #fff; font-weight: 700; border-radius: 16px; min-height: 52px; padding: 0 22px; text-align: center; width: 100%; }
.glow:hover, .pill:hover, .ghost:hover { filter: brightness(1.05); }
.link { color: var(--accent); font-weight: 600; min-height: 40px; text-align: center; }
.link.danger, .pill.danger { color: #d92d3a; }
.pill { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; border-radius: 99px; padding: 0 16px; min-height: 40px; }
.pill.solid { background: var(--glow); color: #fff; }
.ghost { background: var(--quiet); border-radius: 12px; padding: 0 14px; min-height: 40px; font-weight: 600; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  background: var(--quiet); border: 1px solid transparent; border-radius: 12px; padding: 0 12px; min-height: 44px; color: var(--text); font-weight: 400; font-size: 1rem; width: 100%;
}
textarea { padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.check-row { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 1rem; font-weight: 400; min-height: 36px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; } legend { font-size: 0.85rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--c); }
.swatch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 6px; }

/* Willkommen */
.welcome { max-width: 420px; margin: 0 auto; padding: 9vh 24px 40px; display: flex; flex-direction: column; gap: 16px; text-align: center; align-items: stretch; }
.welcome img { align-self: center; border-radius: 24px; box-shadow: 0 16px 36px color-mix(in srgb, var(--berry) 35%, transparent); }
.welcome h1 { font-size: 2.6rem; }
.welcome .lead { font-size: 1.15rem; color: var(--muted); }
.welcome form { text-align: left; margin-top: 8px; }
.points { text-align: left; display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.points p { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.code, .bigcode { font-family: ui-monospace, "SF Mono", Menlo, monospace !important; letter-spacing: 0.08em; text-transform: uppercase; }
.bigcode { font-size: 2rem; font-weight: 800; background: var(--glow); -webkit-background-clip: text; background-clip: text; color: transparent; margin-top: 14px; user-select: all; }

/* Rahmen */
.shell { display: flex; height: 100%; }
nav { width: 228px; flex: none; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; padding: 0 8px 16px; }
.brand img { border-radius: 9px; }
.tab { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 44px; border-radius: 12px; font-weight: 600; color: var(--muted); }
.tab:hover { background: var(--quiet); }
.tab.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; font-weight: 600; }
.offline { font-size: 0.8rem; color: var(--muted); padding: 0 10px; }
main { flex: 1; overflow-y: auto; padding: 28px clamp(16px, 4vw, 44px) 60px; }
main > * { max-width: 1060px; margin-left: auto; margin-right: auto; }
header { margin-bottom: 18px; }
.kicker { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

/* Heute */
.people { display: flex; gap: 16px; overflow-x: auto; padding: 2px 2px 14px; }
.people > * { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.people small { color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); background: color-mix(in srgb, var(--k) 11%, var(--surface)); transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.card:hover { transform: translateY(-2px); }
.card h2 { display: flex; align-items: center; gap: 10px; }
.line { display: flex; align-items: center; gap: 10px; }
.time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 62px; font-size: 0.92rem; }
.sub { color: var(--muted); font-size: 0.8rem; font-weight: 600; margin-top: 4px; }
.ring { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--todo); flex: none; }

/* Kalender */
.calendar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; background: color-mix(in srgb, var(--cal) 8%, var(--surface)); padding: 12px; border-radius: var(--radius); }
.wd { text-align: center; font-size: 0.78rem; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.day { display: flex; flex-direction: column; gap: 3px; min-height: 92px; padding: 6px; border-radius: 12px; background: var(--surface); overflow: hidden; }
.day:hover { background: color-mix(in srgb, var(--cal) 8%, var(--surface)); }
.day.out { opacity: 0.45; }
.day.sel { box-shadow: inset 0 0 0 2px var(--cal); }
.num { font: 600 0.92rem ui-rounded, -apple-system, sans-serif; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.day.today .num { background: var(--glow); color: #fff; }
.chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip { font-size: 0.72rem; line-height: 1.5; padding: 0 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 0.7rem; color: var(--muted); padding-left: 6px; }
.dots { display: none; gap: 3px; justify-content: center; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.calendar aside { display: flex; flex-direction: column; gap: 10px; }
.event { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-left: 4px solid var(--c); width: 100%; }

/* Listen */
.chipsbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.listchip { background: var(--quiet); border-radius: 99px; padding: 0 14px; min-height: 36px; font-weight: 600; font-size: 0.92rem; }
.listchip b { opacity: 0.7; font-size: 0.8rem; }
.listchip.on { background: var(--todo); color: #fff; }
.listchip.on.shop { background: var(--shop); }
.listchip.quiet { background: none; color: var(--muted); font-weight: 500; }
.quick { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 99px; padding: 5px 5px 5px 18px; margin-bottom: 16px; box-shadow: 0 6px 22px rgb(0 0 0 / 0.06), 0 0 0 1px var(--line); }
.quick input { background: none !important; border: 0 !important; padding: 0 !important; }
.quick button { width: 40px; height: 40px; border-radius: 50%; background: var(--k); color: #fff; font-size: 1.3rem; display: grid; place-items: center; flex: none; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.rows li { display: flex; align-items: center; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows .body { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 10px 16px 10px 0; min-height: 50px; }
.check { width: 48px; height: 50px; flex: none; position: relative; }
.check::after { content: ""; position: absolute; inset: 13px 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); transition: all 0.2s; }
.check:hover::after { border-color: var(--k); }
.done .check::after { background: var(--k) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 70% no-repeat; border-color: var(--k); }
.done .title { text-decoration: line-through; color: var(--muted); }
.qty { background: var(--quiet); border-radius: 99px; padding: 2px 10px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.prio { font-weight: 800; color: #ff9500; } .prio.p3 { color: #e5383b; }
.section { display: flex; width: 100%; color: var(--muted); font-weight: 600; padding: 18px 6px 8px; font-size: 0.9rem; }
.groups { columns: 2 320px; column-gap: 20px; }
.groups section { break-inside: avoid; }
.groups section:first-child h3 { margin-top: 0; }
.empty { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); }
.empty h2 { color: var(--text); } .empty p { max-width: 340px; }

/* Familie */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.panel form { width: 100%; }
.plain { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }

/* Dialog */
dialog { border: 0; border-radius: 22px; padding: 22px; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgb(0 0 0 / 0.3); }
dialog::backdrop { background: rgb(20 18 28 / 0.45); backdrop-filter: blur(6px); }
dialog[open] { animation: pop 0.28s cubic-bezier(0.3, 1.3, 0.5, 1); }
@keyframes pop { from { transform: scale(0.94) translateY(10px); opacity: 0; } }
dialog.allday .timed { display: none; }
.buttons { margin-top: 6px; }
.paywall { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.paywall .spark { width: 72px; height: 72px; border-radius: 22px; background: var(--glow); color: #fff; font-size: 2rem; display: grid; place-items: center; }
.paywall ul { list-style: none; padding: 16px; margin: 6px 0; text-align: left; background: color-mix(in srgb, var(--warm) 12%, var(--surface)); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; width: 100%; color: var(--muted); font-size: 0.92rem; }
.paywall li b { display: block; color: var(--text); font-size: 1rem; }

/* Schmale Bildschirme: Leiste unten, Kalender mit Punkten statt Titeln */
@media (max-width: 760px) {
  .shell { flex-direction: column-reverse; }
  nav { width: auto; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 0; background: var(--surface); }
  .brand, .who, nav .grow, .offline { display: none; }
  .tab { flex: 1; flex-direction: column; gap: 2px; font-size: 0.68rem; padding: 6px 0; min-height: 50px; justify-content: center; }
  main { padding: 20px 16px 30px; }
  .calendar { grid-template-columns: 1fr; }
  .day { min-height: 54px; align-items: center; }
  .chips { display: none; } .dots { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
header.row select { width: auto; }
header.row { flex-wrap: wrap; }
