:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --line: #e4dfd4;
  --text: #24221f;
  --muted: #77716a;
  --accent: #2f7d6d;
  --accent-soft: #dcefe9;
  --accent-text: #ffffff;
  --warn: #c7622b;
  --warn-soft: #fbe6d8;
  --danger: #c23b3b;
  --ok: #3a8a4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 14px rgba(40, 30, 10, .05);
  --nav-w: 220px;
  color-scheme: light;
}

/* dunkel */
  :root[data-theme="dark"] {
    --bg: #161716;
    --surface: #212321;
    --surface-2: #2a2d2a;
    --line: #353935;
    --text: #ecebe7;
    --muted: #9c9a94;
    --accent: #5bb39f;
    --accent-soft: #23403a;
    --accent-text: #0f1a17;
    --warn: #f0935c;
    --warn-soft: #43301f;
    --danger: #ef6b6b;
    --ok: #6cc184;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }


* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w);
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; padding: 4px 10px 16px; }
.nav-brand img { width: 30px; height: 30px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; color: var(--text); font-weight: 500; position: relative;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .ico { font-size: 1.15rem; width: 1.5rem; text-align: center; }
.nav .badge { margin-left: auto; }
.main { margin-left: var(--nav-w); padding: 28px 32px 60px; max-width: 1280px; }

@media (max-width: 820px) {
  .nav {
    inset: auto 0 0 0; width: auto; flex-direction: row; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; z-index: 20;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-brand { display: none; }
  .nav a { flex: 1 0 64px; flex-direction: column; gap: 0; padding: 6px 4px; font-size: .68rem; text-align: center; }
  .nav .ico { font-size: 1.3rem; width: auto; }
  .nav .badge { position: absolute; top: 2px; right: 8px; margin: 0; }
  .main { margin-left: 0; padding: 16px 16px calc(90px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.35rem; }
}

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-sub { color: var(--muted); margin-top: 4px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { color: var(--muted); padding: 14px 4px; text-align: center; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card > h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card > h2 .spacer + * { font-size: .85rem; font-weight: 500; }
.card-link { text-decoration: none; font-size: .85rem; font-weight: 500; }

.alert {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--text); margin-bottom: 14px; border: 1px solid transparent;
}
.alert .big { font-size: 1.6rem; }
@media (max-width: 600px) {
  .alert { flex-wrap: wrap; }
  .alert > div { flex: 1 1 200px; min-width: 0; }
  .alert > .big, .alert > .bin-icon { flex: 0 0 auto; }
  .alert > .btn { margin-left: auto; }
}
.alert.info { background: var(--accent-soft); }

/* ---------- Buttons & Inputs ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px;
  cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.danger.confirm { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 8px; color: var(--muted); font-size: 1rem; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  outline: none; min-height: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

.quick-add { display: flex; gap: 8px; margin-bottom: 14px; }
.quick-add input { flex: 1; }
.quick-add select { width: auto; flex: 0 0 auto; max-width: 42%; }

.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- Badges, chips ---------- */
.badge {
  display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-text);
  font-size: .72rem; font-weight: 700; text-align: center;
}
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .78rem; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.late { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.tag.today { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .85rem; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--muted); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.1rem; color: #fff; font-weight: 700; flex: 0 0 auto;
}

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 500; overflow-wrap: anywhere; }
.list .sub { color: var(--muted); font-size: .82rem; }
.list li.done .title { text-decoration: line-through; color: var(--muted); }
.check {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); background: var(--surface); flex: 0 0 auto; cursor: pointer;
  display: grid; place-items: center; color: transparent; font-size: .85rem; padding: 0;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.clickable { cursor: pointer; }

.time-col { width: 52px; flex: 0 0 52px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
.ev-bar { width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 4px; background: var(--accent); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-wd { background: var(--surface-2); text-align: center; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 6px 0; }
.cal-day { background: var(--surface); min-height: 104px; padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { background: var(--bg); }
.cal-day.other .cal-num { color: var(--muted); opacity: .6; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-size: .8rem; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-text); }
.pill {
  font-size: .72rem; padding: 1px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c, var(--accent)) 18%, var(--surface)); border-left: 3px solid var(--c, var(--accent));
}
.pill.more { background: transparent; border: 0; color: var(--muted); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .cal-day { min-height: 58px; padding: 2px; }
  .pill { font-size: 0; height: 6px; padding: 0; border-left-width: 0; background: var(--c, var(--accent)); border-radius: 3px; }
  .pill.more { display: none; }
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .82rem; color: var(--muted); }

/* ---------- Meals ---------- */
.meal-week { display: grid; gap: 10px; }
.meal-day { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 10px; align-items: stretch; }
.meal-date { padding: 10px 4px; }
.meal-date strong { display: block; }
.meal-day.today .meal-date strong { color: var(--accent); }
.meal-slot {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; min-height: 62px;
  display: flex; flex-direction: column; gap: 3px; position: relative;
}
.meal-slot:hover { border-color: var(--accent); }
.meal-slot.empty-slot { border-style: dashed; color: var(--muted); background: transparent; justify-content: center; }
.meal-slot .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.meal-slot .meal-title { font-weight: 600; }
.meal-slot .icon-btn { flex: 0 0 auto; }
.meal-slot:not(.empty-slot) { cursor: default; }
.meal-slot:not(.empty-slot):hover { border-color: var(--line); }
.dish {
  display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer;
}
.dish:hover { background: var(--surface-2); }
.dish .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dish + .dish { border-top: 1px dashed var(--line); border-radius: 0 0 8px 8px; }
.meal-add {
  align-self: flex-start; margin-top: 4px; border: 1px dashed var(--line); background: transparent; color: var(--muted);
  border-radius: 8px; padding: 3px 10px; font-size: .82rem; cursor: pointer;
}
.meal-add:hover { border-color: var(--accent); color: var(--accent); }
.dish-link:hover { text-decoration: underline; }

/* Gerichte-Sammlung */
.dish-search { flex: 1 1 240px; width: auto !important; }
.dish-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.dish-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-height: 150px;
}
.dish-card h3 { font-size: 1rem; }
.tm-tag { font-size: .7rem; vertical-align: 2px; background: #e6f2ea; color: #2e7d4f; font-weight: 600; }
/* dunkel */ :root[data-theme="dark"] .tm-tag { background: #23402f; color: #8fd3a8; } 
.seg { flex-wrap: wrap; }
.dish-ing { color: var(--text); opacity: .8; overflow-wrap: anywhere; }
.star { font-size: 1.25rem; color: var(--muted); }
.star.on { color: #e0a526; }
.dish-picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.dish-chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 11px; font-size: .85rem; cursor: pointer; color: var(--text);
}
.dish-chip:hover { border-color: var(--accent); }
.dish-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
@media (max-width: 600px) {
  .meal-day { grid-template-columns: 1fr 1fr; }
  .meal-date { grid-column: 1 / -1; padding: 6px 2px 0; display: flex; gap: 8px; }
}

/* ---------- Members / Tasks ---------- */
.member-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); align-items: start; }
.member-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.member-head h2 { flex: 1; }
.inline-add { display: flex; gap: 6px; margin-top: 8px; }
.inline-add input { flex: 1; min-height: 36px; padding: 6px 10px; }

.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 14px; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 6px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; flex: 0 0 auto; color: var(--text);
}
.tab:hover { background: var(--surface-2); }
.tab.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab.add { padding: 6px 14px; color: var(--muted); border-style: dashed; }
.tab .badge { margin-left: 2px; }
.member-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
}
.member-banner h2 { font-size: 1.25rem; }

.subgroup {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700;
  margin: 12px 0 0; padding-bottom: 2px;
}
.card > h2 + .subgroup { margin-top: 0; }
.day-head { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-top: 14px; }
.day-head .icon-btn { margin-left: auto; font-size: .95rem; padding: 0 6px; }
.day-head.is-today { color: var(--accent); }
/* Übersicht: links die Termin-Woche, rechts die übrigen Karten */
.home-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.home-side { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 700px) { .home-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 1250px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .home-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Bins ---------- */
.bin-icon { width: 34px; height: 40px; border-radius: 5px 5px 8px 8px; position: relative; flex: 0 0 auto; background: var(--c); }
.bin-icon::before { content: ""; position: absolute; left: -3px; right: -3px; top: -5px; height: 7px; border-radius: 3px; background: var(--c); filter: brightness(.8); }
.bin-icon.sm { width: 16px; height: 19px; border-radius: 3px 3px 4px 4px; }
.bin-icon.sm::before { left: -2px; right: -2px; top: -3px; height: 4px; }

/* ---------- Dialog ---------- */
.dlg {
  border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.dlg::backdrop { background: rgba(20, 18, 14, .45); }
.form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form label > span, .form .label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.form .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; padding-top: 4px; flex-wrap: wrap; }
.member-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.member-pick label { cursor: pointer; }
.member-pick input { display: none; }
.member-pick span.pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); font-size: .88rem;
}
.member-pick input:checked + span.pick { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.checkline { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.checkline input { width: 18px; height: 18px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); }

/* ---------- Login / Toast ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--surface); padding: 32px 28px; border-radius: 20px; box-shadow: var(--shadow); width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-logo { font-size: 3rem; }
.login-card p { margin: 0; color: var(--muted); }
.login-error { color: var(--danger) !important; min-height: 1.2em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
@media (max-width: 820px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }

.help { font-size: .88rem; color: var(--muted); }
.help summary { cursor: pointer; color: var(--text); }
.ok-text { color: var(--ok); font-weight: 500; }
.err-text { color: var(--danger); }

.switch {
  width: 38px; height: 22px; border-radius: 99px; border: 0; background: var(--line); position: relative; cursor: pointer; flex: 0 0 auto; padding: 0;
  transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }

.legend-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 10px; cursor: pointer; color: var(--text); font: inherit; font-size: .82rem; }
.legend-btn.off { opacity: .45; text-decoration: line-through; }
button:disabled { opacity: .6; cursor: default; }
.help ol { padding-left: 1.2rem; margin: 6px 0; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; word-break: break-all; }

/* =====================================================================
   Design „Dashboard“: dunkle Seitenleiste, hellgrauer Arbeitsbereich,
   weiße runde Karten, Akzente in Limette und Lavendel
   ===================================================================== */
:root {
  --frame: #19191b;
  --bg: #ececea;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --line: #e8e8e5;
  --text: #141414;
  --muted: #8b8b88;
  --accent: #141414;
  --accent-soft: #eef8c9;
  --accent-text: #ffffff;
  --lime: #d7f26e;
  --lime-soft: #eef8c9;
  --lavender: #b6a9f6;
  --lavender-soft: #ece8fd;
  --warn: #c2410c;
  --warn-soft: #ffe4d6;
  --ok: #3f7d1f;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03);
  --nav-w: 232px;
}
/* dunkel */
  :root[data-theme="dark"] {
    --frame: #0e0e0f;
    --bg: #1c1c1e;
    --surface: #262629;
    --surface-2: #303034;
    --line: #38383d;
    --text: #f2f2f0;
    --muted: #9b9b9f;
    --accent: #d7f26e;
    --accent-soft: #3a4320;
    --accent-text: #141414;
    --lime-soft: #3a4320;
    --lavender-soft: #34305a;
    --warn: #ff9a6b;
    --warn-soft: #4a2a1c;
    --ok: #b5e05a;
    --shadow: none;
  }


body { background: var(--frame); font-feature-settings: "tnum" 0; letter-spacing: -.005em; }
a { color: inherit; }
h1 { font-size: 2.15rem; font-weight: 600; letter-spacing: -.03em; }
.page-sub { font-size: .85rem; }

/* Seitenleiste */
.nav { background: var(--frame); border-right: 0; padding: 22px 14px; gap: 4px; }
.nav-brand { color: #fff; padding: 2px 10px 26px; font-size: 1.15rem; }
.nav-brand img { width: 28px; height: 28px; border-radius: 8px; }
.nav a { color: #c9c9c6; border-radius: 99px; padding: 10px 14px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: #fff; color: #141414; }
.nav .ico { filter: grayscale(.15); }
.nav .badge { background: var(--lime); color: #141414; }
.main {
  margin: 12px 12px 12px var(--nav-w); max-width: none; min-height: calc(100vh - 24px);
  background: var(--bg); border-radius: 30px; padding: 30px 34px 60px;
}
.main > * { max-width: 1320px; }
@media (max-width: 820px) {
  body { background: var(--bg); }
  .nav { background: var(--frame); border-top: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
  .nav a { border-radius: 16px; padding: 7px 4px; }
  .main { margin: 0; border-radius: 0; min-height: 100vh; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.7rem; }
}

/* Karten */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px; }
.card > h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: 14px; min-height: 34px; }
.h-ico {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto;
  background: var(--surface-2); font-size: 1rem; line-height: 1;
}
.card-link { color: var(--muted); font-weight: 500; }
.page-head > h1 { display: flex; align-items: center; gap: 12px; }
.h1-ico { width: 46px; height: 46px; font-size: 1.35rem; background: var(--surface); }
.card-link:hover { color: var(--text); }

/* Knöpfe, Felder, Schilder */
.btn { border-radius: 99px; border: 0; background: var(--surface); padding: 9px 16px; font-weight: 500; }
.card .btn:not(.primary), .dlg .btn:not(.primary):not(.ghost) { background: var(--surface-2); }
.btn:hover { background: var(--surface-2); filter: brightness(.98); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.15); background: var(--accent); }
.btn.small { padding: 6px 12px; }
.icon-btn { border-radius: 99px; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], select {
  border-radius: 99px; border: 1px solid transparent; background: var(--surface); padding: 10px 16px; min-height: 42px;
}
textarea { border-radius: 18px; border: 1px solid transparent; background: var(--surface-2); padding: 12px 16px; }
.card input[type=text], .card input[type=search], .dlg input:not([type=checkbox]):not([type=color]), .dlg select { background: var(--surface-2); }
input:focus, select:focus, textarea:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--lime-soft); }
.badge { background: var(--lime); color: #141414; font-weight: 700; }
.tag { background: var(--surface-2); color: var(--muted); }
.tag.today { background: var(--lime); color: #141414; }
.tag.late { background: var(--warn-soft); color: var(--warn); }
.check { border-radius: 50%; border-width: 2px; }
.check.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.alert { border-radius: var(--radius); background: var(--warn-soft); }
.alert.info { background: var(--lime-soft); }
.seg { background: var(--surface); border-radius: 99px; padding: 4px; }
.seg button { border-radius: 99px; padding: 6px 14px; color: var(--muted); }
.seg button.on { background: var(--text); color: var(--surface); box-shadow: none; }
.tab { border: 0; background: var(--surface); }
.tab.on { background: var(--text); color: var(--surface); }
.tab.on .badge { background: var(--lime); color: #141414; }
.tab.add { background: transparent; border: 1px dashed var(--muted); }
.tabs { border-bottom: 0; }
.ok-text { color: var(--ok); }
.subgroup { color: var(--muted); }
.list > li { border-bottom-color: var(--line); }
.dot { box-shadow: 0 0 0 2px var(--surface); }
.switch.on { background: var(--text); }
.switch.on::after { background: var(--lime); }

/* Dialog */
.dlg { border-radius: 28px; }
.dlg::backdrop { background: rgba(15, 15, 16, .55); backdrop-filter: blur(3px); }
.member-pick span.pick { border: 0; background: var(--surface-2); }
.member-pick input:checked + span.pick { background: var(--text); color: var(--surface); }

/* Kalender */
.cal { border: 0; background: var(--bg); gap: 6px; border-radius: 0; overflow: visible; }
.cal-wd { background: transparent; }
.cal-day { border-radius: 16px; background: var(--surface); }
.cal-day.other { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--text); }
.cal-day.today .cal-num { background: var(--lime); color: #141414; }
.pill { border-left: 0; border-radius: 6px; background: color-mix(in srgb, var(--c, var(--lavender)) 22%, var(--surface)); }
.legend-btn { border: 0; background: var(--surface); }

/* Essen, Gerichte */
.meal-slot { border: 0; border-radius: 18px; }
.meal-slot.empty-slot { border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); }
.meal-day.today .meal-date strong { color: #141414; background: var(--lime); padding: 1px 9px; border-radius: 99px; display: table; margin: 0 0 2px -2px; }
.dish-card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.dish-chip { border: 0; background: var(--surface-2); }
.dish-chip.on { background: var(--text); color: var(--surface); }
.star.on { color: #c7a400; }
.member-banner { border: 0; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 22%, var(--surface)); }

/* ---------- Übersicht im Dashboard-Stil ---------- */
.dash-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head .grow { min-width: 220px; }
.dash-head h1 { line-height: 1.05; }
.date-pill { background: var(--surface); border-radius: 99px; padding: 9px 16px; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 3px var(--bg); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat {
  background: var(--surface); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: var(--text); min-height: 128px; transition: transform .15s;
}
.stat:hover { transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .92rem; }
.stat-top .more { margin-left: auto; color: var(--muted); }
.stat-num { font-size: 2.3rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.stat-num small { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat-sub { font-size: .8rem; color: var(--muted); margin-top: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip-lime, .chip-lav { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #141414; }
.chip-lime { background: var(--lime); }
.chip-lav { background: var(--lavender); }
.stat.is-lime { background: var(--lime); color: #141414; }
.stat.is-lime .stat-num small, .stat.is-lime .stat-sub, .stat.is-lime .more { color: rgba(20, 20, 20, .6); }
.stat.is-lime .h-ico { background: rgba(255, 255, 255, .55); }

/* Dunkle Wochen-Karte */
.card-dark { background: #1d1d1f; color: #f3f3f1; --line: #313134; --muted: #8f8f93; --surface-2: #2c2c2f; }
.card-dark .card-link { color: #b9b9bc; }
.card-dark .h-ico { background: #2f2f33; }
.card-dark .subgroup { color: #a3a3a7; }
.card-dark .day-head.is-today { color: var(--lime); }
.card-dark .btn:not(.primary) { background: #2f2f33; color: #f3f3f1; }
.card-dark .icon-btn { color: #a3a3a7; }
.card-dark .icon-btn:hover { background: #2f2f33; color: #fff; }
.week-sum { display: flex; gap: 22px; margin: 2px 0 14px; flex-wrap: wrap; }
.week-sum .num { font-size: 1.9rem; font-weight: 600; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
.week-sum .num::before { content: ""; width: 6px; height: 26px; border-radius: 4px; background: var(--bar, var(--lime)); }
.week-sum .lbl { font-size: .75rem; color: #8f8f93; margin-left: 14px; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; margin-bottom: 6px; }
.week-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; cursor: pointer; }
.week-bar .b {
  width: 100%; max-width: 30px; border-radius: 99px; min-height: 10px;
  background: repeating-linear-gradient(135deg, #3a3a3e 0 3px, #2a2a2d 3px 7px);
}
.week-bar.has .b { background: var(--lavender); }
.week-bar.today .b { background: var(--lime); }
.week-bar .d { font-size: .72rem; color: #8f8f93; }
.week-bar.today .d { color: #fff; font-weight: 600; }

/* ---------- Kopfzeile ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; position: relative; z-index: 5; }
.tb-family { display: flex; align-items: center; gap: 10px; }
.tb-name { display: flex; flex-direction: column; line-height: 1.2; }
.tb-name b { font-size: .92rem; }
.tb-name span { font-size: .76rem; color: var(--muted); }
.tb-search { position: relative; display: flex; align-items: center; background: var(--surface); border-radius: 99px; padding: 0 6px 0 14px; width: min(320px, 46vw); }
.tb-search .ico { font-size: .85rem; opacity: .6; }
.tb-search input[type=search] { background: transparent !important; border: 0 !important; box-shadow: none !important; min-height: 42px; padding: 8px 10px; }
.tb-bell-wrap { position: relative; }
.tb-bell {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); cursor: pointer; font-size: 1.05rem; position: relative;
}
.tb-dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--lime); color: #141414;
  font-size: .66rem; font-weight: 800; display: grid; place-items: center; padding: 0 4px; box-shadow: 0 0 0 2px var(--bg);
}
.tb-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 280px; background: var(--surface); border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18); padding: 8px; max-height: 60vh; overflow-y: auto;
}
.tb-pop-right { left: auto; right: 0; width: 320px; }
.tb-pop-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 6px 10px; }
.tb-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; text-decoration: none; color: var(--text); }
.tb-item:hover { background: var(--surface-2); }
.tb-item span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tb-item b { font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.tb-item small { color: var(--muted); font-size: .76rem; }
.tb-empty { padding: 14px; color: var(--muted); text-align: center; font-size: .9rem; }
@media (max-width: 600px) {
  .tb-name { display: none; }
  .tb-search { width: auto; flex: 1; }
  .topbar .spacer { display: none; }
  .tb-pop-right { width: min(320px, calc(100vw - 32px)); }
}

/* ---------- Kachel unten in der Seitenleiste ---------- */
.nav-promo {
  margin-top: auto; background: var(--lime); color: #141414; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.nav-promo .promo-ico { font-size: 2.4rem; position: absolute; right: 8px; top: 6px; opacity: .9; transform: rotate(-12deg); }
.nav-promo b { font-size: 1rem; padding-right: 44px; line-height: 1.25; }
.nav-promo span { font-size: .78rem; opacity: .75; margin-bottom: 8px; }
.nav .nav-promo a.promo-btn {
  background: #141414; color: #fff; border-radius: 99px; text-align: center; justify-content: center; padding: 10px; font-size: .86rem; font-weight: 600;
}
.nav .nav-promo a.promo-btn:hover { background: #2a2a2a; }
@media (max-width: 820px) { .nav-promo { display: none; } }

/* ---------- Dashboard-Raster ---------- */
.dash-grid {
  display: grid; gap: 14px; margin-bottom: 16px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "over today index" "over shop index" "over dark dark";
}
.d-over { grid-area: over; } .d-today { grid-area: today; } .d-shop { grid-area: shop; } .d-index { grid-area: index; } .d-dark { grid-area: dark; }
@media (max-width: 1150px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "over today" "over shop" "over index" "dark dark"; }
}
@media (max-width: 640px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "today shop" "over over" "index index" "dark dark"; }
}
.dash-grid a.card { text-decoration: none; color: inherit; display: block; transition: transform .15s; }
.dash-grid a.card:hover { transform: translateY(-2px); }
.big-num { font-size: 2.2rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.big-num small { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.big-num .chip-lime { align-self: flex-start; font-size: .68rem; letter-spacing: 0; }
.mini-row { display: flex; align-items: flex-end; gap: 10px; }
.mini-row .big-num { flex: 1; }
.mini-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: .78rem; line-height: 1.25; min-width: 0; }
.mini-side small { color: var(--muted); }
.mini-side b { font-size: .95rem; }
.mini-side span { color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.mini > h2 { margin-bottom: 10px; }
@media (max-width: 640px) { .mini-side { display: none; } .big-num { font-size: 1.9rem; } }

/* Kreise */
.bubbles { position: relative; height: 230px; margin: 10px 0 14px; }
.bubble {
  position: absolute; width: var(--s); height: var(--s); border-radius: 50%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-decoration: none; transition: transform .2s;
}
.bubble:hover { transform: scale(1.04); z-index: 3; }
.bubble b { font-size: 1.7rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.bubble small { font-size: .7rem; opacity: .7; margin-top: 2px; }
.bubble.b0 { left: 4%; top: 6%; z-index: 1; }
.bubble.b1 { right: 4%; top: 0; z-index: 2; }
.bubble.b2 { left: 38%; bottom: 0; z-index: 2; box-shadow: 0 0 0 4px var(--surface); }

/* Fortschrittsbalken */
.progress { display: flex; flex-direction: column; gap: 12px; }
.prog { text-decoration: none; color: inherit; display: block; }
.prog-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.prog-num { font-size: 1.45rem; font-weight: 600; letter-spacing: -.03em; }
.prog-num small { font-size: .7rem; color: var(--muted); margin-left: 2px; }
.prog-lbl { font-size: .78rem; display: flex; align-items: center; gap: 6px; }
.prog-lbl i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.prog-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.prog-bar > div { height: 100%; border-radius: 99px; min-width: 4px; }

/* Punkte-Matrix */
.dot-matrix { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 16px 0 10px; }
.dot-col { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.dot-col i { width: 100%; max-width: 12px; aspect-ratio: 1; border-radius: 50%; background: var(--lavender-soft); display: block; }
.dot-col i.on { background: var(--lavender); }
.dot-col.today i.on { background: #9fd63a; }
.dot-col.today i { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 60%, transparent); }

/* Dunkle Karte */
.pill-dark { background: #2f2f33; color: #e8e8e8; text-decoration: none; border-radius: 99px; padding: 6px 12px; font-size: .78rem; font-weight: 500; }
.d-dark .week-bars { height: 150px; }

/* Übrige Karten */
.home-rest { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
@media (min-width: 1000px) { .home-rest .card-events { grid-row: span 3; } }

/* =====================================================================
   Design „Warm & Hell“: Menüleiste oben, Verlauf grau → warmes Gelb,
   durchscheinende weiße Karten, dünne große Schrift, gelber Akzent
   ===================================================================== */
:root {
  --bg: transparent;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-2: #f1efe9;
  --line: rgba(30, 30, 30, .08);
  --text: #1e1e1e;
  --muted: #8b877d;
  --accent: #1e1e1e;
  --accent-text: #ffffff;
  --accent-soft: #e4ecdc;
  --lime: #b9cca9;
  --lime-soft: #e4ecdc;
  --lavender: #bdb7aa;
  --lavender-soft: #e9e5dc;
  --yellow: #b9cca9;
  --warn: #b45309;
  --warn-soft: #fde7cf;
  --ok: #6b8e23;
  --radius: 26px;
  --shadow: 0 1px 1px rgba(0, 0, 0, .02);
}
/* dunkel */
  :root[data-theme="dark"] {
    --surface: rgba(40, 39, 36, .82);
    --surface-solid: #2a2926;
    --surface-2: #34322e;
    --line: rgba(255, 255, 255, .08);
    --text: #f3f1ea;
    --muted: #a7a297;
    --accent: #b9cca9;
    --accent-text: #1e1e1e;
    --accent-soft: #34402e;
    --lime-soft: #34402e;
    --lavender: #6c685f;
    --lavender-soft: #3c3a35;
    --warn: #fdba74;
    --warn-soft: #4a3020;
    --ok: #c5e17a;
  }


body {
  background: linear-gradient(140deg, #e7e7e6 0%, #efede7 38%, #e9eee2 70%, #d5e2ca 100%) fixed;
  font-weight: 400;
}
/* dunkel */
  :root[data-theme="dark"] body { background: linear-gradient(140deg, #1b1b1a 0%, #22211e 45%, #232a20 80%, #2a3426 100%) fixed; }

h1 { font-weight: 300; letter-spacing: -.03em; }
.card, .dish-card, .stat, .meal-slot:not(.empty-slot), .cal-day:not(.other), .tb-search, .tb-bell, .date-pill, .seg, .tab, .legend-btn {
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tb-pop, .dlg { background: var(--surface-solid); }

/* ---------- Menüleiste oben (PC) ---------- */
.app { display: flex; flex-direction: column; }
.nav {
  position: sticky; top: 0; inset: auto; width: auto; height: auto; flex-direction: row; align-items: center; gap: 10px;
  background: transparent; padding: 18px 28px 6px; z-index: 30; overflow: visible;
}
.nav-brand {
  color: var(--text); text-decoration: none; padding: 9px 20px 9px 12px; border: 1.5px solid color-mix(in srgb, var(--text) 35%, transparent);
  border-radius: 99px; font-weight: 400; font-size: 1.15rem; flex: 0 0 auto; gap: 8px;
}
.nav-brand img { width: 24px; height: 24px; border-radius: 7px; }
.nav-links {
  display: flex; gap: 2px; background: var(--surface); backdrop-filter: blur(14px); border-radius: 99px; padding: 4px; margin-left: auto;
  overflow-x: auto; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav a { color: var(--text); padding: 8px 14px; border-radius: 99px; font-size: .86rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: rgba(0, 0, 0, .05); color: var(--text); }
.nav a.active { background: #1e1e1e; color: #fff; }
.nav .ico { display: none; }
.nav .badge { background: var(--yellow); color: #1e1e1e; margin-left: 6px; }
.nav-links .nav-settings-link { display: none; }
.nav-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nav-tools .tb-search { width: 210px; }
.nav-set { background: var(--surface); backdrop-filter: blur(14px); }
.nav-set.active { background: #1e1e1e; color: #fff; }
.nav-me { padding: 0 !important; border-radius: 50% !important; }
.nav-me .avatar { box-shadow: 0 0 0 3px var(--surface-solid); }
.nav-promo { display: none; }
.main { margin: 0; border-radius: 0; background: transparent; min-height: 0; padding: 18px 28px 60px; }
.main > * { max-width: 1440px; margin-left: auto; margin-right: auto; }
.topbar { display: none; }
@media (max-width: 1280px) { .nav-tools .tb-search { width: 160px; } .nav-set span { display: none; } }
@media (max-width: 1060px) { .nav-tools .tb-search { display: none; } }

/* ---------- Handy: Leiste unten, Kopfzeile oben ---------- */
@media (max-width: 820px) {
  .nav {
    position: fixed; inset: auto 10px calc(10px + env(safe-area-inset-bottom)) 10px; padding: 5px; border-radius: 26px;
    background: #1e1e1e; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); gap: 0;
  }
  .nav .nav-brand, .nav .nav-tools { display: none; }
  .nav-links { background: transparent; backdrop-filter: none; margin: 0; padding: 0; width: 100%; gap: 0; }
  .nav-links .nav-settings-link { display: flex; }
  .nav a { color: #cfcac0; flex: 1 0 58px; flex-direction: column; gap: 1px; padding: 6px 2px; border-radius: 20px; font-size: .64rem; }
  .nav a.active { background: var(--yellow); color: #1e1e1e; }
  .nav .ico { display: block; font-size: 1.2rem; }
  .nav .badge { position: absolute; top: 1px; right: 6px; margin: 0; }
  .main { padding: 14px 14px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; margin-bottom: 14px; }
  .topbar .tb-search { flex: 1; width: auto; }
}

/* ---------- Karten & Bedienelemente im hellen Stil ---------- */
.card { background: var(--surface); border: 0; }
.card > h2 { font-weight: 500; }
.h-ico { background: var(--surface-2); }
.h1-ico { background: var(--surface); }
.btn { background: var(--surface); }
.btn.primary { background: #1e1e1e; color: #fff; }
/* dunkel */ :root[data-theme="dark"] .btn.primary { background: var(--yellow); color: #1e1e1e; } 
.badge, .tag.today, .chip-lime { background: var(--yellow); color: #1e1e1e; }
.check.on { background: #1e1e1e; border-color: #1e1e1e; color: var(--yellow); }
.seg button.on, .tab.on, .member-pick input:checked + span.pick, .dish-chip.on { background: #1e1e1e; color: #fff; }
.alert { background: var(--surface); border-left: 4px solid var(--yellow); }
.alert.info { background: var(--surface); }
.cal-day.today .cal-num, .meal-day.today .meal-date strong { background: var(--yellow); color: #1e1e1e; }
.switch.on { background: #1e1e1e; }
.switch.on::after { background: var(--yellow); }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], select { background: var(--surface-solid); }
.card input[type=text], .card input[type=search], .dlg input:not([type=checkbox]):not([type=color]), .dlg select, textarea { background: var(--surface-2); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 45%, transparent); }
.tb-dot { background: var(--yellow); box-shadow: 0 0 0 2px var(--surface-solid); }
.card-dark { background: #1e1e1e; }

/* ---------- Übersicht ---------- */
.hr-head { margin: 6px 0 22px; }
.hello { font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 300; letter-spacing: -.035em; margin-bottom: 18px; }
.hr-row { display: flex; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.seg-progress { flex: 1 1 420px; display: flex; gap: 8px; min-width: 0; }
.sp { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); min-width: 64px; }
.sp-lbl { font-size: .82rem; padding-left: 4px; }
.sp-bar {
  height: 44px; border-radius: 99px; display: flex; align-items: center; padding: 0 16px; font-size: .8rem; font-weight: 500;
}
.sp-dark { background: #1e1e1e; color: #fff; }
.sp-yellow { background: var(--yellow); color: #1e1e1e; }
.sp-hatch { background: repeating-linear-gradient(135deg, rgba(30, 30, 30, .16) 0 2px, transparent 2px 9px), var(--surface); color: var(--text); }
.sp-outline { border: 1.5px solid color-mix(in srgb, var(--text) 45%, transparent); color: var(--text); }
.hr-stats { display: flex; gap: 30px; margin-left: auto; }
.hr-stats a { text-decoration: none; color: var(--text); display: flex; flex-direction: column; align-items: flex-start; }
.hr-stats b { font-size: clamp(2.4rem, 4.6vw, 3.6rem); font-weight: 300; letter-spacing: -.04em; line-height: 1; }
.hr-stats span { font-size: .78rem; color: var(--muted); margin-top: 2px; }

.hr-grid {
  display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: "spot prog ring onb" "acc cal cal onb";
}
.g-spot { grid-area: spot; } .g-prog { grid-area: prog; } .g-ring { grid-area: ring; } .g-onb { grid-area: onb; } .g-acc { grid-area: acc; } .g-cal { grid-area: cal; }
@media (max-width: 1150px) {
  .hr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "spot prog" "ring onb" "acc onb" "cal cal"; }
}
@media (max-width: 640px) {
  .hr-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "onb" "spot" "prog" "ring" "cal" "acc"; }
  .hr-stats { gap: 18px; margin-left: 0; }
  .seg-progress { flex-basis: 100%; }
  .sp-bar { height: 38px; padding: 0 10px; }
}
.hr-grid > div { min-width: 0; display: flex; }
.hr-card {
  background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; width: 100%; min-height: 250px; color: var(--text); text-decoration: none; border: 0; text-align: left; font: inherit;
}
.hr-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hr-card-head h3 { font-size: 1.15rem; font-weight: 400; letter-spacing: -.01em; }
.round-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-solid); text-decoration: none;
  color: var(--text); font-size: .95rem; border: 0; cursor: pointer; flex: 0 0 auto;
}
.round-btn.dark { background: #1e1e1e; color: #fff; }
.hr-big { font-size: 2.6rem; font-weight: 300; letter-spacing: -.04em; display: flex; align-items: center; gap: 10px; line-height: 1; }
.hr-big small { font-size: .72rem; color: var(--muted); letter-spacing: 0; line-height: 1.2; }
.hr-pct { font-size: 2rem; font-weight: 300; letter-spacing: -.03em; }

/* Personen-Kachel */
.spot {
  position: relative; overflow: hidden; padding: 0; cursor: pointer; justify-content: flex-end;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 100%);
}
.spot-face {
  position: absolute; inset: 0 0 30%; display: grid; place-items: center; font-size: 6.5rem; color: rgba(255, 255, 255, .92);
  font-weight: 300; text-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.spot-foot {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 16px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .35));
}
.spot-foot b { font-size: 1.15rem; font-weight: 500; display: block; }
.spot-foot span { font-size: .78rem; opacity: .85; }
.spot-pill { border: 1.5px solid rgba(255, 255, 255, .8); border-radius: 99px; padding: 7px 14px; font-size: .82rem !important; opacity: 1 !important; white-space: nowrap; }

/* Termine: Stäbe mit Punkten */
.sticks { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 4px; min-height: 130px; margin-top: 10px; }
.stick { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; cursor: pointer; position: relative; }
.stick i { width: 5px; border-radius: 99px; background: #1e1e1e; position: relative; display: block; }
.stick i::before { content: ""; position: absolute; top: -4px; left: 50%; width: 11px; height: 11px; transform: translateX(-50%); border-radius: 50%; background: inherit; }
.stick.empty i { background: color-mix(in srgb, var(--text) 18%, transparent); }
.stick.today i { background: var(--yellow); }
.stick span { font-size: .7rem; color: var(--muted); }
.stick.today span { color: var(--text); font-weight: 600; }
.stick-tip { position: absolute; top: -2px; background: var(--yellow); color: #1e1e1e; border-radius: 99px; padding: 2px 7px; font-size: .66rem !important; font-weight: 600; white-space: nowrap; }
/* dunkel */ :root[data-theme="dark"] .stick i { background: #f3f1ea; } 

/* Ring */
.ring { position: relative; width: 170px; height: 170px; margin: 4px auto 8px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-ticks { fill: none; stroke: color-mix(in srgb, var(--text) 25%, transparent); stroke-width: 6; stroke-dasharray: 1 5.2; }
.ring-bg { fill: none; stroke: color-mix(in srgb, var(--text) 7%, transparent); stroke-width: 14; }
.ring-fg { fill: none; stroke: var(--yellow); stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray .6s; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 2.1rem; font-weight: 300; letter-spacing: -.03em; }
.ring-center span { font-size: .75rem; color: var(--muted); }
.ring-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }

/* Putzplan + dunkle Liste */
.onb-bars { display: flex; gap: 4px; margin: 6px 0 14px; }
.onb-bars > div { display: flex; flex-direction: column; gap: 4px; min-width: 34px; }
.onb-bars small { font-size: .7rem; color: var(--muted); border-left: 1px solid color-mix(in srgb, var(--text) 30%, transparent); padding-left: 5px; }
.onb-bars span { height: 36px; border-radius: 12px; display: flex; align-items: center; padding: 0 10px; font-size: .78rem; }
.ob-yellow { background: var(--yellow); color: #1e1e1e; }
.ob-dark { background: #1e1e1e; }
.ob-grey { background: color-mix(in srgb, var(--text) 35%, transparent); }
.todo-dark { background: #1e1e1e; color: #f3f1ea; border-radius: 22px; padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; margin: 0 -6px -6px; }
.todo-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; padding: 0 4px; }
.todo-head h3 { font-weight: 400; font-size: 1.05rem; }
.todo-head span { font-size: 1.6rem; font-weight: 300; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; }
.todo-item .grow { min-width: 0; }
.todo-item b { display: block; font-weight: 500; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-item small { color: #9a958a; font-size: .72rem; }
.todo-item.done b { color: #9a958a; text-decoration: line-through; }
.todo-ico { width: 34px; height: 34px; border-radius: 50%; background: #2e2d2a; display: grid; place-items: center; flex: 0 0 auto; font-size: .9rem; }
.todo-check {
  width: 22px; height: 22px; border-radius: 50%; border: 0; background: #4a4842; flex: 0 0 auto; cursor: pointer; display: grid; place-items: center;
  font-size: .75rem; color: #1e1e1e; padding: 0;
}
.todo-check:hover { background: color-mix(in srgb, var(--yellow) 60%, #4a4842); }
.todo-check.on { background: var(--yellow); font-weight: 800; }
.todo-empty { color: #9a958a; padding: 14px 4px; text-align: center; }
.todo-more { color: #cfcac0; font-size: .8rem; padding: 4px; text-decoration: none; }

/* Aufklapp-Liste */
.acc { padding: 8px 14px; min-height: 0; }
.acc-sec { border-bottom: 1px solid var(--line); }
.acc-sec:last-child { border-bottom: 0; }
.acc-head {
  width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 14px 4px; font-size: .92rem; font-weight: 500;
  cursor: pointer; color: var(--text); text-align: left;
}
.acc-head .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.acc-sec.open .chev { transform: rotate(180deg); }
.acc-body { padding: 0 4px 14px; display: flex; flex-direction: column; gap: 6px; }
.acc-line { display: flex; align-items: center; gap: 10px; font-size: .88rem; flex-wrap: wrap; }
.acc-line > span:first-child:not(.bin-icon) { width: 52px; color: var(--muted); font-size: .8rem; }
.acc-line .tag { margin-left: auto; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font: inherit; }
.link-btn:hover { color: var(--text); }
.acc .quick-add { margin-bottom: 6px; }

/* Wochen-Kalender */
.weekcal { min-height: 0; }
.weekcal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.weekcal-head b { font-weight: 500; }
.pill-light { background: var(--surface-solid); border-radius: 99px; padding: 6px 14px; font-size: .78rem; text-decoration: none; color: var(--text); border: 0; cursor: pointer; font: inherit; font-size: .78rem; }
.weekcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wc-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; border-left: 1px dashed var(--line); padding-left: 6px; }
.wc-col:first-child { border-left: 0; padding-left: 0; }
.wc-day { display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 4px 0; border-radius: 14px; }
.wc-day span { font-size: .72rem; color: var(--muted); }
.wc-day b { font-size: 1.1rem; font-weight: 400; }
.wc-col.today .wc-day { background: #1e1e1e; color: #fff; }
.wc-col.today .wc-day span { color: #cfcac0; }
.wc-events { display: flex; flex-direction: column; gap: 5px; }
.wc-ev {
  background: var(--surface-solid); border-radius: 12px; padding: 6px 8px; font-size: .72rem; position: relative; overflow: hidden; cursor: default;
}
.wc-ev[data-act] { cursor: pointer; }
.wc-ev b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-time { color: var(--muted); font-size: .66rem; }
.wc-ev i { position: absolute; right: 6px; top: 7px; width: 7px; height: 7px; border-radius: 50%; }
.wc-ev.dark { background: #1e1e1e; color: #fff; }
.wc-ev.dark .wc-time { color: #b9b4a9; }
.wc-more { font-size: .72rem; color: var(--muted); text-align: center; cursor: pointer; }
@media (max-width: 640px) {
  .weekcal-grid { grid-template-columns: repeat(7, minmax(84px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
}
.onb-legend { display: flex; gap: 12px; font-size: .72rem; color: var(--muted); margin: -6px 0 14px; }
.onb-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }

/* ---------- Übersicht: Wochen-Kalender oben, kleine Kacheln darunter ---------- */
.hr-top { margin-bottom: 14px; display: flex; }
.hr-top .weekcal .wc-events { min-height: 60px; }
.mini-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: stretch; }
.mini-grid > .hr-card { min-height: 210px; }
.mini-card { gap: 6px; }
.mini-card .hr-card-head h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.mini-card .h-ico { width: 32px; height: 32px; font-size: .95rem; }
.mini-num { font-size: 2.4rem; font-weight: 300; letter-spacing: -.04em; line-height: 1; display: flex; align-items: baseline; gap: 6px; margin: 2px 0 4px; }
.mini-num small { font-size: .74rem; color: var(--muted); letter-spacing: 0; }
.mini-body { display: flex; flex-direction: column; gap: 7px; font-size: .86rem; }
.mini-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mini-line > span:not(.bin-icon):not(.tag):not(.mini-lbl) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-line b { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-lbl { width: 54px; flex: 0 0 54px; color: var(--muted); font-size: .78rem; }
.mini-line .tag { margin-left: auto; }
.mini-check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--text) 30%, transparent); background: transparent;
  flex: 0 0 auto; cursor: pointer; padding: 0;
}
.mini-check:hover { background: var(--yellow); border-color: var(--yellow); }
.mini-more { font-size: .78rem; color: var(--muted); text-decoration: none; margin-top: auto; }
.mini-more:hover { color: var(--text); }
.mini-grid .spot { min-height: 210px; }
.mini-grid .spot-face { font-size: 5rem; }
.mini-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1400px) { .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .mini-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Übersicht: Uhr & Wetter ---------- */
.head-cards { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
@media (max-width: 560px) { .head-cards { grid-template-columns: minmax(0, 1fr); } }
.head-cards .hr-card { min-height: 0; }
.clock-card { justify-content: space-between; gap: 6px; }
.clock-time { font-size: clamp(3.4rem, 7vw, 5.2rem); font-weight: 200; letter-spacing: -.05em; line-height: .95; font-variant-numeric: tabular-nums; }
.clock-time small { font-size: .32em; color: var(--muted); letter-spacing: 0; margin-left: 6px; vertical-align: top; font-weight: 300; }
.clock-date { font-size: 1.05rem; font-weight: 400; }
.clock-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.clock-pill { background: var(--surface-solid); border-radius: 99px; padding: 5px 12px; font-size: .78rem; }
.weather-card { gap: 12px; }
.wx-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wx-ico { font-size: 3.4rem; line-height: 1; }
.wx-temp { font-size: clamp(3.4rem, 7vw, 5.2rem); font-weight: 200; letter-spacing: -.05em; line-height: .95; }
.wx-temp small { font-size: .3em; color: var(--muted); letter-spacing: 0; vertical-align: top; margin-left: 4px; font-weight: 300; }
.wx-desc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wx-desc b { font-size: 1.15rem; font-weight: 500; }
.wx-desc span { font-size: .82rem; color: var(--muted); }
.wx-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.wx-chips span { background: var(--surface-solid); border-radius: 99px; padding: 5px 12px; font-size: .8rem; }
.wx-hours { display: grid; grid-template-columns: repeat(8, minmax(52px, 1fr)); gap: 6px; overflow-x: auto; scrollbar-width: none; }
.wx-hours::-webkit-scrollbar { display: none; }
.wx-h { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 16px; background: var(--surface-solid); font-size: .74rem; }
.wx-h span { color: var(--muted); }
.wx-h i { font-style: normal; font-size: 1.15rem; }
.wx-h b { font-weight: 500; font-size: .86rem; }
.wx-h.now { background: #1e1e1e; color: #fff; }
.wx-h.now span { color: #cfcac0; }

/* Termine im Wochen-Kalender: Hintergrund in der Farbe des Kalenders / der Person */
.wc-ev {
  background: color-mix(in srgb, var(--c, var(--muted)) 30%, var(--surface-solid));
  box-shadow: inset 4px 0 0 var(--c, var(--muted));
  padding-left: 11px;
}
.wc-ev .wc-time { color: color-mix(in srgb, var(--text) 62%, transparent); }
.wc-ev[data-act]:hover { background: color-mix(in srgb, var(--c, var(--muted)) 42%, var(--surface-solid)); }

/* Kachel „Heute“ mit den Terminen des Tages */
.today-card { gap: 6px; }
.today-card .hr-card-head { gap: 8px; }
.today-card .hr-card-head h3 { display: flex; align-items: center; gap: 10px; flex: 1; }
.today-card .h-ico { width: 32px; height: 32px; font-size: .95rem; }
.today-date { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.today-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 260px; margin: 0 -4px; padding: 0 4px; }
.today-ev {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--c, var(--muted)) 26%, var(--surface-solid)); box-shadow: inset 4px 0 0 var(--c, var(--muted));
}
.today-ev[data-act] { cursor: pointer; }
.today-time { display: flex; flex-direction: column; font-size: .8rem; font-weight: 600; width: 46px; flex: 0 0 46px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.today-time small { font-weight: 400; color: color-mix(in srgb, var(--text) 55%, transparent); }
.today-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-txt b { font-weight: 500; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-txt small { font-size: .72rem; color: color-mix(in srgb, var(--text) 55%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-ev.past { opacity: .5; }
.today-ev.next { box-shadow: inset 4px 0 0 var(--c, var(--muted)), 0 0 0 2px #1e1e1e; }
.today-next { font-size: .64rem; font-weight: 700; background: #1e1e1e; color: #fff; border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.today-empty { color: var(--muted); padding: 20px 0; text-align: center; }

/* Untere Leiste (Handy/schmal): beim Überfahren hell bleiben statt dunkel auf dunkel */
@media (max-width: 820px) {
  .nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
  .nav a.active:hover { color: #1e1e1e; background: var(--yellow); }
}
/* Platz für den Rahmen des nächsten Termins, damit er nicht abgeschnitten wird */
.today-list { padding: 4px 6px; margin: -4px -6px; }
/* „Heute“: keine Höhenbegrenzung – die Kachel wächst mit, alle Termine des Tages sind sichtbar */
.today-list { max-height: none; overflow: visible; margin: 0; padding: 2px 0 0; }
.mini-grid > .today-card { grid-row: span 1; height: auto; }

/* Essen-Kachel: nächste 3 Tage als Tabelle */
.meal-table { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: start; font-size: .86rem; }
.mt-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.mt-day { color: var(--muted); font-size: .8rem; white-space: nowrap; padding-top: 1px; }
.mt-day.is-today { color: var(--text); font-weight: 600; }
.meal-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meal-cell b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-cell .link-btn { text-align: left; font-size: .84rem; }

/* Einkauf-Kachel: Schnell-Eingabe + Artikel-Chips */
.mini-card .hr-card-head h3 .badge { margin-left: 2px; font-size: .74rem; }
.shop-quick { display: flex; gap: 6px; }
.shop-quick input { flex: 1; min-height: 38px !important; padding: 7px 14px !important; }
.shop-quick .btn { width: 38px; height: 38px; padding: 0; justify-content: center; flex: 0 0 auto; font-size: 1.1rem; }
.shop-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.shop-chip {
  border: 0; background: var(--surface-2); color: var(--text); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .82rem;
  cursor: pointer; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s;
}
.shop-chip small { color: var(--muted); }
.shop-chip:hover { background: var(--yellow); color: #1e1e1e; text-decoration: line-through; }
.shop-list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.shop-sub { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-top: 4px; }
.shop-list .shop-sub:first-child { margin-top: 0; }

/* Obere Reihe der Übersicht (Heute + Aufgaben) größer */
.mini-grid > .today-card, .mini-grid > .today-card + .mini-card { min-height: 360px; }
.mini-grid > .today-card .today-ev { padding-top: 11px; padding-bottom: 11px; }
.mini-grid > .today-card .today-txt b { font-size: .95rem; }
.mini-grid > .today-card + .mini-card .mini-num { font-size: 3rem; }
.mini-grid > .today-card + .mini-card .mini-body { font-size: .92rem; gap: 9px; }

/* Klassenarbeiten */
.exam-list { display: flex; flex-direction: column; gap: 6px; }
.exam-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 8px; border-radius: 14px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 16%, var(--surface-solid));
}
.exam-row:hover { background: color-mix(in srgb, var(--c) 26%, var(--surface-solid)); }
.exam-row.soon { box-shadow: 0 0 0 2px var(--c); }
.exam-date {
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface-solid); display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 0 0 auto; line-height: 1.05;
}
.exam-date b { font-size: 1.05rem; font-weight: 600; }
.exam-date span { font-size: .62rem; color: var(--muted); text-transform: uppercase; }
.exam-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exam-txt b { font-weight: 600; font-size: .9rem; }
.exam-txt small { font-size: .72rem; color: color-mix(in srgb, var(--text) 60%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-count { font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--surface-solid); border-radius: 99px; padding: 3px 9px; }
.exam-row.soon .exam-count { background: #1e1e1e; color: #fff; }
.grade-missing { background: var(--yellow) !important; color: #1e1e1e !important; }
.exam-grade { font-size: 1.1rem; font-weight: 600; min-width: 34px; text-align: center; }

/* Wochen-Kalender: heutiger Tag hervorgehoben */
.wc-col.today {
  background: color-mix(in srgb, var(--yellow) 30%, var(--surface-solid)); border-radius: 18px; padding: 6px; margin: -6px 0;
  box-shadow: 0 0 0 2px var(--yellow); border-left: 0;
}
.wc-col.today + .wc-col { border-left: 0; }
.wc-col.today .wc-day { background: #1e1e1e; color: #fff; }
.wc-col.today .wc-day span { color: var(--yellow); font-weight: 700; text-transform: uppercase; font-size: .66rem; letter-spacing: .05em; }
.wc-col.today .wc-ev { background: color-mix(in srgb, var(--c, var(--muted)) 32%, #fff); }
.wc-ev.past { opacity: .45; }
.wc-ev.next { box-shadow: inset 4px 0 0 var(--c, var(--muted)), 0 0 0 2px #1e1e1e; }
.wc-ev.next .wc-time { color: var(--text); font-weight: 600; }
.wc-none { font-size: .72rem; color: var(--muted); text-align: center; padding: 6px 0; }
/* Obere Kachel-Reihe (jetzt Aufgaben + Klassenarbeiten) etwas größer */
.mini-grid > .today-card + .mini-card { min-height: 0; }
.mini-grid > .hr-card:nth-child(-n+2) { min-height: 300px; }
.weekcal-grid { padding: 8px 2px; }
.wc-ev.next::after {
  content: "als Nächstes"; display: block; font-size: .6rem; font-weight: 700; margin-top: 3px; color: #1e1e1e;
  text-transform: uppercase; letter-spacing: .04em;
}
/* Heute im Wochen-Kalender: Tageskopf gelb statt schwarz; nächster Termin nur per Rahmen hervorgehoben */
.wc-col.today .wc-day { background: var(--yellow); color: #1e1e1e; }
.wc-col.today .wc-day span { color: #1e1e1e; }
.wc-ev.next::after { content: none; }

/* Essen-Kachel: Wochenübersicht 7 Tage */
.mw { display: flex; flex-direction: column; gap: 4px; }
.mw-head, .mw-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: stretch; }
.mw-head span { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding-left: 4px; }
.mw-row { border-radius: 14px; padding: 3px; }
.mw-row.is-today { background: color-mix(in srgb, var(--yellow) 32%, transparent); box-shadow: 0 0 0 1.5px var(--yellow); }
.mw-day { display: flex; align-items: baseline; gap: 4px; padding: 6px 4px; }
.mw-day b { font-size: .82rem; font-weight: 600; }
.mw-day span { font-size: .72rem; color: var(--muted); }
.mw-row.is-weekend .mw-day b { color: var(--warn); }
.mw-row.is-today .mw-day b { color: var(--text); }
.mw-cell {
  border-radius: 10px; min-height: 32px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 4px 9px;
  font: inherit; font-size: .8rem; min-width: 0;
}
.mw-cell.filled { background: var(--surface-solid); }
.mw-cell.empty {
  border: 1.5px dashed color-mix(in srgb, var(--muted) 35%, transparent); background: transparent; color: var(--muted); cursor: pointer;
  align-items: center; font-size: .95rem;
}
.mw-cell.empty:hover { border-color: var(--text); color: var(--text); background: var(--surface-solid); }
.mw-dish { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.mw-dish:hover { text-decoration: underline; }
.mw-foot { font-size: .72rem; color: var(--muted); margin-top: 4px; padding-left: 4px; }
/* Wochen-Kalender: alle Termine sichtbar, lange Titel umbrechen statt abschneiden */
.wc-ev b { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Müllplan-Kachel: Abholungen als Kärtchen, diese Woche farbig */
.bin-list { display: flex; flex-direction: column; gap: 6px; }
.bin-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; border-radius: 14px; cursor: pointer;
  background: var(--surface-solid);
}
.bin-row.hot { background: color-mix(in srgb, var(--c) 24%, var(--surface-solid)); box-shadow: inset 4px 0 0 var(--c); padding-left: 12px; }
.bin-row.urgent { box-shadow: inset 4px 0 0 var(--c), 0 0 0 2px #1e1e1e; }
.bin-row:not(.hot) { opacity: .8; }
.bin-row .exam-date { width: 38px; height: 38px; }
.bin-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bin-txt b { font-weight: 600; font-size: .9rem; }
.bin-txt small { font-size: .72rem; color: color-mix(in srgb, var(--text) 62%, transparent); }
.bin-row.urgent .bin-txt small { color: var(--text); font-weight: 600; }
.bin-when { font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--surface-solid); border-radius: 99px; padding: 3px 9px; }
.bin-row.urgent .bin-when { background: #1e1e1e; color: #fff; }

/* ---------- Anmelden / Familie gründen / Beitreten ---------- */
.auth-card { width: min(420px, 100%); gap: 14px; }
.auth-card h1 { font-weight: 300; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 99px; padding: 4px; gap: 2px; }
.auth-tabs a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 99px; text-decoration: none; color: var(--muted); font-size: .86rem; font-weight: 500; }
.auth-tabs a.on { background: #1e1e1e; color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-form label > span { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0 0 4px 6px; }
.auth-form input { background: var(--surface-2) !important; }
.auth-form .btn { justify-content: center; margin-top: 4px; padding: 12px; }
.auth-hint { font-size: .8rem; color: var(--muted); text-align: center; margin: 0; }

/* ---------- Konten in den Einstellungen ---------- */
.acc-me { display: flex; align-items: center; gap: 14px; }
.acc-me > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acc-me b { font-size: 1.1rem; font-weight: 600; }
.acc-me span:not(.tag) { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.acc-me .tag { align-self: flex-start; }
.role-select { width: auto !important; min-height: 32px !important; padding: 4px 28px 4px 12px !important; font-size: .82rem; }
.invite { display: flex; align-items: center; gap: 10px; background: var(--surface-solid); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.invite > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.invite .label { font-size: .72rem; color: var(--muted); font-weight: 600; margin: 0; }
.invite-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; letter-spacing: .08em; user-select: all; }
.invite small { font-size: .72rem; color: var(--muted); }
/* E-Mail-Felder wie die übrigen Eingabefelder */
input[type=email] {
  width: 100%; padding: 10px 16px; border: 1px solid transparent; border-radius: 99px; background: var(--surface-solid);
  outline: none; min-height: 42px; color: var(--text); font: inherit;
}
input[type=email]:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 45%, transparent); }

/* Anmeldeseite: App-Icon statt Emoji */
img.login-logo { width: 64px; height: 64px; display: block; margin: 0 auto; border-radius: 16px; }

/* Aktueller Tag: zartes Salbeigrün statt Gelb (Wochen-Kalender, Essen, Kalender, Essensplan) */
:root { --sage: #a9bf98; --sage-soft: #e3ecdb; }
.wc-col.today { background: var(--sage-soft); box-shadow: 0 0 0 2px var(--sage); }
.wc-col.today .wc-day { background: var(--sage); color: #1e1e1e; }
.wc-col.today .wc-day span { color: #1e1e1e; }
.wc-col.today .wc-ev { background: color-mix(in srgb, var(--c, var(--muted)) 30%, #fff); }
.mw-row.is-today { background: var(--sage-soft); box-shadow: 0 0 0 1.5px var(--sage); }
.cal-day.today .cal-num, .meal-day.today .meal-date strong { background: var(--sage); color: #1e1e1e; }
.tag.today { background: var(--sage); color: #1e1e1e; }
/* dunkel */
  :root[data-theme="dark"] .wc-col.today, :root[data-theme="dark"] .mw-row.is-today { background: color-mix(in srgb, var(--sage) 22%, var(--surface-solid)); }


/* Aufgaben: zugeordnete Personen als kleine Farb-Avatare */
.task-who { display: inline-flex; flex: 0 0 auto; margin-left: auto; padding-left: 6px; }
.task-who .avatar { box-shadow: 0 0 0 2px var(--surface-solid); }
.task-who .avatar + .avatar { margin-left: -6px; }
.mini-line > span.task-who.task-who.task-who { flex: 0 0 auto; overflow: visible; }

/* Hell/Dunkel: per Schalter in den Einstellungen (Standard hell) */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-seg button { padding: 8px 14px; }
.theme-seg button.on { background: var(--yellow); color: #1e1e1e; }
:root[data-theme="dark"] .wc-col.today .wc-ev { background: color-mix(in srgb, var(--c, var(--muted)) 40%, var(--surface-solid)); }
:root[data-theme="dark"] .wx-h.now { background: var(--yellow); color: #1e1e1e; }
:root[data-theme="dark"] .wx-h.now span { color: #1e1e1e; }
.theme-seg button { display: inline-flex; gap: 6px; align-items: center; }
/* Wetter „Jetzt“ in zartem Salbeigrün (hell und dunkel) */
.wx-h.now, :root[data-theme="dark"] .wx-h.now { background: var(--sage); color: #1e1e1e; }
.wx-h.now span, :root[data-theme="dark"] .wx-h.now span { color: #1e1e1e; }

/* Untere Leiste (Handy/schmal): weißer Hintergrund statt schwarz (im Dunkelmodus dunkelgrau) */
@media (max-width: 820px) {
  .nav { background: var(--surface-solid); box-shadow: 0 8px 28px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); }
  .nav a { color: var(--muted); }
  .nav a:hover { color: var(--text); background: var(--surface-2); }
  .nav a.active, .nav a.active:hover { background: var(--yellow); color: #1e1e1e; }
  .nav .badge { box-shadow: 0 0 0 2px var(--surface-solid); }
}

/* Heute-Spalte: vergangene Termine nicht mehr verblasst, sondern gut lesbar im Vordergrund */
.wc-col.today .wc-ev, .wc-col.today .wc-ev.past { opacity: 1; box-shadow: inset 4px 0 0 var(--c, var(--muted)), 0 2px 8px rgba(0, 0, 0, .08); }
.wc-col.today .wc-ev.past { background: color-mix(in srgb, var(--c, var(--muted)) 22%, #fff); }
.wc-col.today .wc-ev.past .wc-time { color: var(--muted); }
.wc-col.today .wc-ev .wc-title, .wc-col.today .wc-ev b { color: var(--text); }
.wc-col.today .wc-ev.next { box-shadow: inset 4px 0 0 var(--c, var(--muted)), 0 0 0 2px #1e1e1e; }
:root[data-theme="dark"] .wc-col.today .wc-ev.past { background: color-mix(in srgb, var(--c, var(--muted)) 30%, var(--surface-solid)); }

/* Aufgaben-Kachel: Fälligkeitsdatum unter dem Titel */
.mini-line > span.mini-task.mini-task.mini-task { display: flex; flex-direction: column; white-space: normal; line-height: 1.25; }
.mini-due { font-size: .74rem; color: var(--muted); }
.mini-due.today { color: #5f7a4c; font-weight: 600; }
.mini-due.late { color: var(--warn); font-weight: 600; }
:root[data-theme="dark"] .mini-due.today { color: var(--sage); }

/* ---------- Bonusprogramm ---------- */
.bonus-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.bonus-card { display: flex; flex-direction: column; gap: 12px; }
.bonus-card.reached { box-shadow: 0 0 0 2px var(--sage); background: color-mix(in srgb, var(--sage-soft) 70%, var(--surface)); }
.bonus-head { display: flex; align-items: center; gap: 12px; }
.bonus-head h2 { margin: 0; }
.bonus-progress { position: relative; display: grid; place-items: center; margin: 4px auto; }
.bonus-ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.bonus-ring-fg { fill: none; stroke: var(--c, var(--sage)); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .6s; }
.bonus-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.bonus-num b { font-size: 2.2rem; font-weight: 300; letter-spacing: -.03em; }
.bonus-num span { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.bonus-left { text-align: center; font-size: .9rem; color: var(--muted); }
.bonus-left b { color: var(--text); }
.bonus-reached { text-align: center; font-weight: 600; font-size: 1rem; }
.bonus-manual { justify-content: center; gap: 6px; }
.bonus-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.bonus-log li { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.bonus-log .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bonus-pts { min-width: 30px; text-align: center; font-weight: 700; font-size: .75rem; padding: 2px 6px; border-radius: 99px; background: var(--sage-soft); color: #3f5a30; }
.bonus-pts.neg { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .bonus-pts { background: color-mix(in srgb, var(--sage) 30%, var(--surface-solid)); color: var(--text); }
.center { text-align: center; }
/* Handy: Hinweis, dass die untere Leiste seitlich weitergeht */
@media (max-width: 820px) {
  .nav-links { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .nav-links.at-end { -webkit-mask-image: none; mask-image: none; }
}

/* Nachfrage „Wer hat das erledigt?“ */
.who-done-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.who-done-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border-radius: 20px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, var(--surface-solid));
  font: inherit; font-weight: 600; color: var(--text);
}
.who-done-btn:hover { background: color-mix(in srgb, var(--c) 25%, var(--surface-solid)); }

/* Putzplan „jeder einzeln“: jedes Kind hakt mit seinem Kreis ab */
.clean-checks { display: inline-flex; gap: 4px; flex: 0 0 auto; margin-left: auto; }
.mini-line > span.clean-checks.clean-checks.clean-checks { flex: 0 0 auto; overflow: visible; }
.clean-who { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; line-height: 0; }
.clean-who.open .avatar { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px color-mix(in srgb, var(--text) 25%, transparent); }
.clean-who.later .avatar { opacity: .55; }
.clean-who:hover .avatar { transform: scale(1.08); }
.clean-who.done { cursor: default; }
.clean-who.done .avatar { opacity: .35; }
.clean-who.done i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #2e4a22; font-size: .85em; }
.mini-spacer, .check-spacer { flex: 0 0 auto; width: 22px; }
.check-spacer { width: 28px; }
.mini-line > span.mini-spacer.mini-spacer.mini-spacer { flex: 0 0 22px; }

/* Gerichtesammlung als Liste, nach Kochhäufigkeit */
.dish-list li { gap: 10px; }
.dish-rank { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.dish-list li:nth-child(-n+3) .dish-rank { background: var(--sage); color: #1e1e1e; }
.dish-count { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; min-width: 34px; text-align: right; }
@media (max-width: 560px) { .hide-sm { display: none; } }
/* Aufgaben mehrerer Personen: erledigte Kreise lassen sich zum Zurücknehmen antippen */
.clean-who.done[data-act] { cursor: pointer; }
/* „Heute erledigt“ mit Rückgängig (Eltern) */
.done-today { margin-top: 16px; }
.done-today .check.on { cursor: default; flex: 0 0 auto; }
.done-today .title { text-decoration: line-through; color: var(--muted); }

/* Aufgaben-Tab einer Person: alle Bereiche untereinander */
.grid.task-stack { grid-template-columns: minmax(0, 1fr); }

/* Aufgaben-Kachel: Überschrift je Person */
.task-sub { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.task-sub:first-child { margin-top: 0; }
.task-sub .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- Kleine Kacheln: gut lesbare Anordnung ----------
   Höchstens 3 Spalten (nie 6 schmale), Höhe richtet sich nach dem Inhalt.
   Reihenfolge: Aufgaben, Einkauf, Putzplan, Essen, Klassenarbeiten, Müllplan. */
.mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.mini-grid > .hr-card, .mini-grid > .hr-card:nth-child(-n+2),
.mini-grid > .today-card, .mini-grid > .today-card + .mini-card { min-height: 0; }
.mini-grid .mini-body { font-size: .92rem; }
@media (min-width: 1100px) {
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) { .mini-grid { grid-template-columns: minmax(0, 1fr); } }

/* Einkauf: eigenes Feld für die Menge */
.shop-quick .shop-qty, .quick-add .shop-qty { flex: 0 0 84px; width: 84px; min-width: 0; text-align: center; }
@media (max-width: 520px) { .shop-quick .shop-qty, .quick-add .shop-qty { flex-basis: 70px; width: 70px; } }

/* ---------- Einkaufsliste kompakt: gleicher Inhalt, weniger Platz ----------
   Karten fließen spaltenweise ohne Lücken (wie Notizzettel), Zeilen niedriger, Schrift etwas kleiner. */
.grid.shop-grid { display: block; columns: 250px; column-gap: 12px; }
.shop-grid > .card { break-inside: avoid; margin: 0 0 12px; padding: 14px 16px 10px; display: block; width: 100%; }
.shop-grid > .card h2 { font-size: .95rem; margin: 0 0 6px; gap: 8px; }
.shop-grid > .card h2 .h-ico, .shop-grid > .card h2 > span:first-child { font-size: 1rem; }
.shop-grid .subgroup { font-size: .62rem; margin: 8px 0 2px; }
.shop-grid .list li { padding: 3px 0; min-height: 0; gap: 8px; font-size: .9rem; }
.shop-grid .list li + li { border-top: 0; }
.shop-grid .check { width: 22px; height: 22px; flex: 0 0 22px; font-size: .7rem; }
.shop-grid .icon-btn { width: 26px; height: 26px; font-size: .8rem; opacity: .55; }
.shop-grid .icon-btn:hover { opacity: 1; }

/* Essen-Kachel: vergangene Tage der Woche etwas zurückgenommen */
.mw-row.is-past { opacity: .55; }

/* ---------- Natürliche Touch-Bedienung ---------- */
html { touch-action: manipulation; }               /* kein Doppeltipp-Zoom, Tippen reagiert sofort */
button, a, [data-act] { -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  .btn:active, .round-btn:active, .check:active, .mini-check:active, .clean-who:active, .nav a:active, [data-act]:active { transform: scale(.96); transition: transform .08s; }
}
/* Kiosk (Chromium im Vollbild): kein Markieren, kein Gummiband-/Zurück-Wischen des Browsers */
html.kiosk, html.kiosk body { overscroll-behavior: none; }
html.kiosk body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: default; }
html.kiosk input, html.kiosk textarea, html.kiosk [contenteditable] { -webkit-user-select: text; user-select: text; }
html.kiosk .btn:active, html.kiosk [data-act]:active, html.kiosk .nav a:active { transform: scale(.96); transition: transform .08s; }
/* Wisch-Übergang zwischen Ansichten */
html[data-swipe="left"] #main { animation: swipe-in-left .25s ease-out; }
html[data-swipe="right"] #main { animation: swipe-in-right .25s ease-out; }
@keyframes swipe-in-left { from { opacity: .3; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes swipe-in-right { from { opacity: .3; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html[data-swipe] #main { animation: none; } }

/* Übersicht: Uhr/Wetter-Reihe genauso zentriert wie Kalender und Kacheln (eine Flucht) */
.main > .hr-head { margin-left: auto; margin-right: auto; }

/* Aufgaben schnell eingeben: Datum gleich mit */
.quick-add .task-due { flex: 0 0 auto; width: 150px; }
.inline-add { flex-wrap: wrap; }
.inline-add input[name="title"] { flex: 1 1 100%; }
.inline-add .task-due { flex: 1 1 0; width: auto; min-height: 36px; padding: 6px 10px; min-width: 0; }
.inline-add .btn { flex: 0 0 auto; }
@media (max-width: 520px) {
  .quick-add:has(.task-due) { flex-wrap: wrap; }
  .quick-add:has(.task-due) input[name="title"] { flex: 1 1 100%; }
  .quick-add .task-due { flex: 1 1 auto; width: auto; }
}

/* Kiosk / Vollbild (Chromium): Inhalt nutzt die ganze Bildschirmbreite */
html.kiosk .main > *, html.kiosk .main > .hr-head { max-width: none; }
@media (display-mode: fullscreen) { .main > *, .main > .hr-head { max-width: none; } }

/* Zweite Webseite & Tablet-Zugang */
.side-form { padding: 0; gap: 10px; }
.nav a.nav-side { cursor: pointer; }
.tablet-link { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; }

/* Bildschirmtastatur (Tablet ohne Tastatur) */
.osk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: none;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #d5dbcf; box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.osk.open { display: block; }
.osk-row { display: flex; gap: 6px; max-width: 1100px; margin: 0 auto 6px; }
.osk-row:last-child { margin-bottom: 0; }
.osk-key {
  flex: 1 1 0; min-width: 0; height: 54px; border: 0; border-radius: 10px; background: #fff; color: #1d2a17;
  font: 500 1.25rem/1 system-ui, sans-serif; box-shadow: 0 1px 0 rgba(0, 0, 0, .18); cursor: pointer; padding: 0;
}
.osk-key:active { background: var(--sage, #a9bf98); }
.osk-key.wide { flex: 1.5 1 0; background: #eef1ea; font-size: 1.1rem; }
.osk-key.wide.on, .osk-key.enter { background: var(--sage, #a9bf98); }
.osk-key.space { flex: 6 1 0; font-size: .95rem; color: #6b7466; }
.osk-num .osk-row { max-width: 520px; }
.osk-num .osk-key { height: 60px; }
html.osk-open body { padding-bottom: var(--osk-h, 300px); }
html.osk-open .dlg[open] { margin-top: 12px; max-height: calc(100vh - var(--osk-h, 300px) - 24px); overflow: auto; }
html[data-theme="dark"] .osk { background: #23262a; }
html[data-theme="dark"] .osk-key { background: #3a3e44; color: #f2f2f2; }
html[data-theme="dark"] .osk-key.wide { background: #2c3035; }
html[data-theme="dark"] .osk-key.wide.on, html[data-theme="dark"] .osk-key.enter { background: #5f7a52; }

/* Noten */
.gr-year { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.gr-year b { min-width: 86px; text-align: center; }
.gr-card { padding: 6px 0 0; overflow: hidden; border-top: 4px solid var(--c, var(--sage)); }
.gr-head-row, .gr-row { display: grid; grid-template-columns: minmax(110px, 1.1fr) 2fr 2fr 1.3fr 64px; align-items: stretch; }
.gr-head-row { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.gr-head-row > div { padding: 8px 12px; }
.gr-row { border-top: 1px solid var(--line); }
.gr-sub { padding: 10px 12px; font-weight: 600; display: flex; align-items: center; }
.gr-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-left: 1px solid var(--line); cursor: pointer; min-height: 48px; }
.gr-cell:hover { background: var(--sage-soft, #e3ecdb); }
.gr-cell-label { display: none; }
.gr-add { color: var(--muted); opacity: .35; font-weight: 700; padding: 0 4px; }
.gr-cell:hover .gr-add { opacity: 1; }
.gr-cavg { margin-left: auto; font-size: .75rem; color: var(--muted); }
.grade-chip { border: 0; border-radius: 9px; min-width: 34px; height: 32px; padding: 0 8px; font: inherit; font-weight: 700; cursor: pointer; }
.g-good { background: #d7ecd0; color: #24521c; }
.g-ok { background: #e8efdf; color: #3d4d33; }
.g-mid { background: #f6e8c7; color: #6a4b0b; }
.g-bad { background: #f6d3cf; color: #7d1f16; }
.gr-avg { display: flex; align-items: center; justify-content: center; font-weight: 800; border-left: 1px solid var(--line); background: transparent; }
.gr-row .gr-avg.g-good, .gr-row .gr-avg.g-ok, .gr-row .gr-avg.g-mid, .gr-row .gr-avg.g-bad { border-radius: 0; }
.gr-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 2px solid var(--line); font-weight: 600; }
.gr-total b { padding: 4px 12px; border-radius: 9px; font-size: 1.1rem; }
.gr-foot { margin-top: 12px; gap: 12px; align-items: center; }
.gr-foot select { width: auto; padding: 4px 8px; min-height: 0; }
.gr-missing { text-decoration: underline; margin-right: 10px; color: var(--text); }
.grade-pad { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: -6px; }
.grade-pad button { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.grade-pad button.on { background: var(--sage, #a9bf98); border-color: transparent; color: #1d2a17; }
html[data-theme="dark"] .g-good { background: #2f4a2a; color: #cfeac6; }
html[data-theme="dark"] .g-ok { background: #36402f; color: #dfe8d6; }
html[data-theme="dark"] .g-mid { background: #4d3f1d; color: #f3dfa9; }
html[data-theme="dark"] .g-bad { background: #57261f; color: #f6c9c2; }
.print-only { display: none; }
@media (max-width: 760px) {
  .gr-head-row { display: none; }
  .gr-row { grid-template-columns: 1fr 64px; }
  .gr-sub { grid-column: 1; }
  .gr-row > .gr-avg { grid-column: 2; grid-row: 1; border-left: 0; }
  .gr-cell { grid-column: 1 / -1; border-left: 0; border-top: 1px dashed var(--line); min-height: 42px; }
  .gr-cell-label { display: inline; font-size: .75rem; color: var(--muted); width: 100px; }
  .grade-pad { grid-template-columns: repeat(4, 1fr); }
}
@media print {
  .nav, .no-print, .toast, #osk, .topbar { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body { background: #fff !important; }
  .print-only { display: block; margin: 0 0 10px; }
  .page-head h1 { display: none; }
  .gr-card { box-shadow: none; border: 1px solid #bbb; }
  .gr-add { display: none; }
  .gr-cell { min-height: 34px; }
}
.gr-new { background: var(--surface); }
.gr-new .gr-sub input { width: 100%; min-height: 38px; padding: 6px 10px; font-weight: 600; }
.gr-new-btn { grid-column: 2 / -1; display: flex; align-items: center; padding: 8px 10px; border-left: 1px solid var(--line); }
@media (max-width: 760px) { .gr-row.gr-new { grid-template-columns: 1fr auto; } .gr-new-btn { grid-column: 2; grid-row: 1; border-left: 0; padding-left: 0; } .gr-new-btn .btn { white-space: nowrap; } }
.gr-sub .grow { flex: 1 1 auto; min-width: 0; }
.gr-del { border: 0; background: none; color: var(--muted); opacity: .5; cursor: pointer; font-size: .85rem; padding: 4px 6px; border-radius: 8px; }
.gr-row:hover .gr-del, .gr-del:focus { opacity: 1; }
.gr-del:hover { background: #f6d3cf; color: #7d1f16; }
@media (hover: none) { .gr-del { opacity: .6; } }
.gr-move { border: 0; background: none; color: var(--muted); opacity: .5; cursor: pointer; font-size: .7rem; width: 28px; height: 28px; border-radius: 8px; padding: 0; }
.gr-move-gap { display: inline-block; width: 28px; }
.gr-row:hover .gr-move, .gr-move:focus { opacity: 1; }
.gr-move:hover { background: var(--sage-soft, #e3ecdb); color: var(--text); }
@media (hover: none) { .gr-move { opacity: .6; width: 34px; height: 34px; } .gr-move-gap { width: 34px; } }

/* Stundenplan */
.tt-brushes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.tt-chip { border: 2px solid var(--c, var(--line)); background: color-mix(in srgb, var(--c, #888) 16%, var(--surface)); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; }
.tt-chip.idea { border-style: dashed; background: var(--surface); opacity: .8; }
.tt-chip.on { background: var(--c, var(--sage)); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #888) 35%, transparent); opacity: 1; }
.tt-chip.add { border: 2px dashed var(--line); background: var(--surface); }
.tt-chip.erase { --c: #b9b3a8; }
.tt-chip.erase.on { color: #1d1d1d; }
.tt-card { padding: 12px; }
.tt-grid { display: grid; grid-template-columns: 44px repeat(5, minmax(0, 1fr)); gap: 6px; }
.tt-corner { }
.tt-day { text-align: center; font-weight: 700; padding: 6px 0; border-radius: 10px; }
.tt-day.today { background: var(--sage-soft, #e3ecdb); }
.tt-day .short { display: none; }
.tt-period { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.tt-cell { min-height: 52px; border: 1px dashed var(--line); background: transparent; border-radius: 10px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; padding: 4px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-cell.filled { border: 0; border-left: 6px solid var(--c); background: color-mix(in srgb, var(--c) 28%, var(--surface)); }
.tt-cell.main { font-weight: 800; }
.tt-plus { color: var(--muted); opacity: .4; font-size: 1.2rem; }
.tt-cell:hover .tt-plus { opacity: 1; }
.tt-foot { margin-top: 12px; gap: 8px; align-items: center; }
.tt-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.gr-main .grow { font-weight: 800; }
.gr-main-tag { display: inline-block; margin-left: 8px; font-size: .68rem; font-weight: 700; color: var(--muted); background: var(--sage-soft, #e3ecdb); padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
@media (max-width: 640px) {
  .tt-grid { grid-template-columns: 26px repeat(5, minmax(0, 1fr)); gap: 4px; }
  .tt-day .long { display: none; } .tt-day .short { display: inline; }
  .tt-cell { min-height: 46px; font-size: .66rem; letter-spacing: -.02em; padding: 2px 2px; white-space: normal; word-break: normal; overflow-wrap: normal; -webkit-hyphens: auto; hyphens: auto; line-height: 1.1; }
  .tt-cell.filled { border-left-width: 3px; }
  .gr-main-tag { display: none; }
}
@media print {
  .tt-cell { border: 1px solid #bbb !important; min-height: 36px; }
  .tt-plus { display: none; }
}
.tt-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.tt-chip.on-mode { background: #2b2b2b; color: #fff; border-color: #2b2b2b; border-style: solid; }
.tt-grid { grid-template-columns: 62px repeat(5, minmax(0, 1fr)); }
.tt-period { flex-direction: column; gap: 2px; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; border-radius: 10px; padding: 2px 0; line-height: 1.1; }
.tt-period:hover { background: var(--sage-soft, #e3ecdb); }
.tt-period b { color: var(--text); }
.tt-period small { font-size: .7rem; }
.tt-pause { grid-column: 1 / -1; text-align: center; font-size: .72rem; color: var(--muted); padding: 1px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); letter-spacing: .03em; }
.tt-cell.now { outline: 3px solid var(--c, var(--sage)); outline-offset: 1px; }
@media (max-width: 640px) {
  .tt-grid { grid-template-columns: 34px repeat(5, minmax(0, 1fr)); }
  .tt-period small { font-size: .56rem; }
}
.tt-pause.lunch { padding: 6px 0; font-weight: 700; background: var(--sage-soft, #e3ecdb); border-radius: 8px; border: 0; }
.tt-cell.nograde { font-weight: 500; font-style: italic; }
.tt-cell.filled.light { box-shadow: inset 0 0 0 1px #c9c9c9; border-left-color: #d6d6d6; background: #fff; }
html[data-theme="dark"] .tt-cell.filled.light { background: #f4f4f4; color: #1d1d1d; }
.swatch[data-c="#ffffff"], .swatch[data-c="#FFFFFF"] { box-shadow: inset 0 0 0 1px #bbb; }
.form:focus { outline: none; }

/* Türklingel */
.bell-url { gap: 8px; margin: 6px 0 4px; }
.bell-url input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, monospace; font-size: .78rem; }
.ring-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 15, 16, .6); display: flex; align-items: center; justify-content: center; padding: 16px; animation: ringIn .2s ease-out; }
.ring-card { background: var(--surface); color: var(--text); border-radius: 26px; padding: 22px; width: min(960px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.ring-head { display: flex; align-items: center; gap: 16px; }
.ring-head b { display: block; font-size: 1.8rem; }
.ring-head span { color: var(--muted); }
.ring-bell { font-size: 3rem; animation: ringShake 1s ease-in-out infinite; transform-origin: 50% 10%; }
.ring-cam { width: 100%; aspect-ratio: 16 / 9; max-height: 65vh; border: 0; border-radius: 16px; background: #111; }
.ring-close { align-self: flex-end; min-width: 160px; min-height: 52px; font-size: 1.1rem; }
@keyframes ringShake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
@keyframes ringIn { from { opacity: 0; } to { opacity: 1; } }

/* Aufgaben über einen Zeitraum: läuft noch */
.tag.range { background: var(--accent-soft); color: var(--accent); }

/* Rezepte: Link und Fotos */
.recipe-btn, .recipe-thumb { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface) center / cover no-repeat; text-decoration: none; font-size: 1.1rem; cursor: pointer; position: relative; padding: 0; color: inherit; }
.recipe-thumb span { position: absolute; right: -6px; top: -6px; background: var(--text); color: var(--bg); border-radius: 999px; font-size: .7rem; font-weight: 700; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.recipe-btn.small, .recipe-thumb.small { width: 26px; height: 26px; border-radius: 7px; font-size: .85rem; margin-left: 6px; vertical-align: middle; }
.recipe-thumb.small span { display: none; }
.recipe-thumb.big { width: 84px; height: 84px; border-radius: 12px; }
.recipe-thumb.loading { cursor: default; font-size: 1.4rem; }
.photo-edit { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.photo-edit:empty { display: none; }
.photo-item { position: relative; }
.photo-del { position: absolute; right: -8px; top: -8px; width: 26px; height: 26px; border-radius: 999px; border: 0; background: var(--danger); color: #fff; font-size: .8rem; cursor: pointer; }
.photo-add { cursor: pointer; align-self: flex-start; }
dialog.lightbox { max-width: none; max-height: none; width: 100vw; height: 100dvh; margin: 0; padding: 0; border: 0; background: rgba(10, 10, 12, .92); display: flex; align-items: center; justify-content: center; }
dialog.lightbox::backdrop { background: rgba(10, 10, 12, .6); }
dialog.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close, .lb-nav { position: absolute; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #141414; cursor: pointer; display: grid; place-items: center; }
.lb-close { top: 16px; right: 16px; width: 48px; height: 48px; font-size: 1.3rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; line-height: 1; }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 600; }
.recipe-row { display: flex; gap: 6px; margin: 4px 0 2px; }
.recipe-row .recipe-btn.small, .recipe-row .recipe-thumb.small { margin-left: 0; width: 32px; height: 32px; }

/* Noten: geplante Arbeiten */
.gr-exams { margin-bottom: 16px; }
.gr-exams-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.gr-exams-head h2 { margin: 0; flex: 1; }
.gr-exams .exam-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
/* Einkauf: Produkt hat ein Foto */
.icon-btn.photo-ico { font-size: 1.2rem; }
/* Test-Text neben dem Logo */
.nav-test { font-size: .75rem; font-weight: 700; color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); padding: 2px 8px; border-radius: 999px; }
