:root {
  /* Farben aus dem Logo – jeder Bereich hat seine eigene */
  --c-calendar: #1d6ff2;
  --c-food: #f0592b;
  --c-tasks: #f39c0b;
  --c-shop: #23a86d;
  --c-more: #6e45eb;
  --c-travel: #0aa6b8;
  --navy: #162031;

  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #172030;
  --muted: #66728a;
  --border: #e1e6ee;
  --primary: var(--c-calendar);
  --primary-text: #ffffff;
  --ok: #23a86d;
  --warn: #c77700;
  --warn-soft: #fdf0d9;
  --danger: #d9442a;
  --danger-soft: #fde4dd;
  --radius: 14px;
  --topbar-h: 52px;
  --tabbar-h: 58px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-calendar: #4b8ff7;
    --c-food: #fb6a3c;
    --c-tasks: #fdad1a;
    --c-shop: #3cc489;
    --c-more: #8f6cf5;
    --c-travel: #19c3cf;

    --bg: #0d1524;
    --surface: #162031;
    --surface-2: #1e2a3f;
    --text: #e8ecf3;
    --muted: #94a0b4;
    --border: #263247;
    --ok: #3cc489;
    --warn: #fdad1a;
    --warn-soft: #3a2c12;
    --danger: #fb6a3c;
    --danger-soft: #3d2219;
    color-scheme: dark;
  }
}

/* Hauptfarbe je nach geoeffnetem Bereich (Knöpfe, Haken, Zähler, Tableiste) */
body[data-tab="start"] { --primary: var(--c-calendar); }
body[data-tab="einkauf"], .tint-shop { --primary: var(--c-shop); }
body[data-tab="aufgaben"], .tint-tasks { --primary: var(--c-tasks); --primary-text: #2b1a00; }
body[data-tab="essen"], .tint-food { --primary: var(--c-food); }
body[data-tab="kalender"], .tint-calendar { --primary: var(--c-calendar); }
body[data-tab="mehr"], .tint-more { --primary: var(--c-more); }
body[data-tab="reisen"], .tint-travel { --primary: var(--c-travel); --primary-text: #ffffff; }
.tint-shop, .tint-food, .tint-calendar, .tint-more { --primary-text: #ffffff; }
.tabbar a[data-tab="start"] { --tab: var(--c-calendar); }
.tabbar a[data-tab="einkauf"] { --tab: var(--c-shop); }
.tabbar a[data-tab="aufgaben"] { --tab: var(--c-tasks); }
.tabbar a[data-tab="essen"] { --tab: var(--c-food); }
.tabbar a[data-tab="kalender"] { --tab: var(--c-calendar); }
.tabbar a[data-tab="mehr"] { --tab: var(--c-more); }
.tabbar a[data-tab="reisen"] { --tab: var(--c-travel); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); }
[hidden] { display: none !important; }
h2 { font-size: 18px; margin: 0 0 8px; }
p { margin: 0 0 8px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  flex: 1;
  margin: 0 8px;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.actions { display: flex; }
.sync-dot {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.sync-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.sync-dot[data-status="ok"]::after { background: var(--ok); }
.sync-dot[data-status="pending"]::after,
.sync-dot[data-status="syncing"]::after { background: var(--warn); }
.sync-dot[data-status="syncing"]::after { animation: pulse 0.8s infinite alternate; }
.sync-dot[data-status="error"]::after { background: var(--danger); }
@keyframes pulse { to { opacity: 0.3; } }

/* ---------- Inhalt ---------- */
#view {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
body.logged-out .topbar,
body.logged-out .tabbar { display: none; }

.stack > * + * { margin-top: 16px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

.greeting { font-size: 22px; font-weight: 650; margin: 4px 0 0; }
.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 8px 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title .icon svg { width: 18px; height: 18px; }
.section-title .icon { color: var(--primary); }
a.section-title { text-decoration: none; }
.icon { display: inline-grid; place-items: center; }

/* ---------- Listen ---------- */
.list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 6px 6px 6px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.row:last-child { border-bottom: 0; }
.list > div:not(:last-child) > .row:last-child { border-bottom: 1px solid var(--border); }
.row:active { background: var(--surface-2); }
.row.static { cursor: default; padding-right: 14px; }
.row.static:active { background: none; }
.row.link > .icon { color: var(--muted); padding-right: 6px; }
.row.link .title { color: var(--text); }
.title { display: block; overflow-wrap: anywhere; }
.sub { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.note-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emoji { width: 28px; font-size: 22px; text-align: center; }

.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}
.row.done .check { background: var(--primary); border-color: var(--primary); }
.row.done .check::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--primary-text);
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.row.done .title { color: var(--muted); text-decoration: line-through; }

/* Auswahlmodus (z. B. Artikel verschieben) */
.row.selecting { -webkit-touch-callout: none; }
.row.selecting .check { border-radius: 7px; }
.row.selected { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.row.selected .check { background: var(--primary); border-color: var(--primary); }
.row.selected .check::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--primary-text);
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.row.was-done .title { color: var(--muted); }
.select-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.15);
  font-weight: 600;
  white-space: nowrap;
}
.select-bar .grow { overflow: hidden; text-overflow: ellipsis; }
.select-bar .icon-btn { font-size: 18px; color: var(--muted); }
.select-bar .btn { padding-left: 14px; padding-right: 14px; }

.badge {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}
.badge.muted { background: var(--surface-2); color: var(--muted); }
.badge.warn { background: var(--danger); color: #fff; }
.qty-badge {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 14px;
  white-space: nowrap;
}
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.chip {
  display: inline-block;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  line-height: 20px;
}
.chip.today { background: var(--warn-soft); color: var(--warn); font-weight: 650; }
.chip.overdue { background: var(--danger-soft); color: var(--danger); font-weight: 650; }
.sub .chip:last-child { margin-right: 0; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.avatar.large { width: 44px; height: 44px; font-size: 18px; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.empty { padding: 24px 8px; text-align: center; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

/* ---------- Buttons & Eingaben ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.icon-only { flex: none; width: 48px; padding: 0; }
.btn:disabled { opacity: 0.6; }

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }
.row .icon-btn { color: var(--muted); }

.link-btn {
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.link-btn.danger { color: var(--danger); }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* verhindert das Hineinzoomen auf dem iPhone */
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

.add-bar {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  z-index: 5;
  display: flex;
  gap: 8px;
  margin-top: -8px;
  padding: 8px 0;
  background: var(--bg);
}
.add-bar input.grow { width: auto; }
.add-bar input.qty { flex: none; width: 84px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; gap: 4px; }
.cal-month { flex: 1; margin: 0; font-size: 20px; text-align: center; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.cal-card {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekdays span { padding: 4px 0 6px; font-size: 12px; font-weight: 650; text-align: center; color: var(--muted); }
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 46px;
  padding: 4px 0 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.cal-day .num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 15px; }
.cal-day.other { color: var(--muted); opacity: 0.55; }
.cal-day.today .num { color: var(--primary); font-weight: 750; }
.cal-day.selected .num { background: var(--primary); color: var(--primary-text); font-weight: 700; }
.cal-day .dots { display: flex; gap: 3px; height: 5px; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.cal-day.other .dots i { background: var(--muted); }
.cal-status { font-size: 13px; text-align: center; }
.cal-status .btn { margin-top: 8px; font-size: 15px; }.empty.small { padding: 16px 8px; }

.event-row, .row:has(.ev-bar) { align-items: stretch; }
.ev-time {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 92px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.ev-day { font-weight: 700; color: var(--text); }
.ev-bar { flex: none; width: 4px; margin: 4px 0; border-radius: 2px; background: var(--primary); }
.row .grow { align-self: center; }
.row > .icon { align-self: center; }
.ev-repeat { color: var(--muted); }

/* ---------- Essensplan ---------- */
.week-range { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.meal-day + .meal-day { margin-top: 18px; }
.meal-day-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px 4px; font-weight: 650; }
.meal-day-head .icon-btn { width: 34px; height: 34px; color: var(--primary); }
.meal-day.today .meal-day-head { color: var(--primary); }
.meal-day.past { opacity: 0.6; }
.meal-slot {
  flex: none;
  width: 84px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.avatar.both { background: var(--danger); font-size: 13px; }
.meal-empty {
  width: 100%;
  padding: 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.field-pair.even { grid-template-columns: 1fr 1fr; }
.field-pair > .field, .field-pair input, .field-pair select { min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline > span { flex: 1; min-width: 0; color: var(--text); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.field.inline > span small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.field.inline select { flex: none; width: 46%; min-height: 40px; padding: 6px 8px; font-size: 15px; }
.field.inline.all { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.meal-row .icon-btn { color: var(--muted); }

/* ---------- Reisen ---------- */
.phase-stepper {
  display: flex;
  gap: 6px;
  margin: 0 -16px;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.phase-stepper::-webkit-scrollbar { display: none; }
.phase {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.phase.passed { color: var(--text); }
.phase.current { border-color: var(--primary); color: var(--text); }
.phase.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.phase-emoji { font-size: 15px; }
.phase-hint { margin: -8px 4px 0; }
.chip.phase-chip { flex: none; margin: 0; }
.chip.ok-chip { margin-left: 8px; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); font-weight: 650; }
.chip.cheap-chip { margin-left: 8px; background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary); font-weight: 650; }
.cost { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost.big { font-size: 24px; }
.cost-block { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.title-sum { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.trip-item .check { cursor: pointer; }
.trip-item.booked .check { background: var(--ok); border-color: var(--ok); }
.trip-item.booked .check::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.booked-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  vertical-align: 2px;
  white-space: nowrap;
}
.variant-head { display: flex; flex-direction: column; gap: 6px; }
.variant-dates { font-weight: 600; }
.per-person { display: block; font-size: 14px; }
.flight-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.flight-box-title { font-size: 15px; }
.details > .flight-box-title { margin-bottom: 2px; }
.flight-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flight-info { flex: 1 1 100%; font-size: 13px; color: var(--muted); }
.flight-info:empty { display: none; }
.flight-info .btn { margin: 6px 6px 0 0; }
.cost-breakdown { display: flex; flex-wrap: wrap; gap: 6px; }
.cost-breakdown .chip { margin: 0; font-size: 13px; }
.quick-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-add .btn { min-height: 38px; padding: 0 12px; font-size: 14px; }
.chosen-card { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; border-left: 4px solid var(--primary); }
.chosen-card .sub { display: block; }
.chosen-note { color: var(--ok); font-weight: 600; }
.progress { height: 8px; margin: 0 0 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--primary); transition: width 0.3s; }
.note-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.details { display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; gap: 12px; }
.detail-label { flex: none; width: 120px; color: var(--muted); font-size: 14px; font-weight: 600; }
.detail-row > :last-child { overflow-wrap: anywhere; }
.booked-toggle { padding-top: 6px; border-top: 1px solid var(--border); }

/* Vor Ort */
.plan-row { align-items: center; }
.plan-time { flex: none; width: 44px; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--muted); }
.booked-row { background: var(--surface-2); }
.booked-row .title { font-size: 15px; color: var(--muted) !important; }
.plan-day + .plan-day { margin-top: 18px; }
.hint-card { width: 100%; text-align: left; font: inherit; font-weight: 650; color: var(--primary); border-color: var(--primary); cursor: pointer; }

/* Packliste */
.pack-head { display: flex; flex-direction: column; gap: 8px; }
.pack-progress-text { font-weight: 650; }
.pack-head .progress { margin: 0; }
.pack-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.field-check.small { font-size: 14px; font-weight: 500; }
.field-check.small input { width: 18px; height: 18px; }
.pack-add { display: flex; gap: 8px; margin-top: 8px; }
.pack-add input.grow { width: auto; }
.chips.left { justify-content: flex-start; margin-top: 8px; }
.chip-btn {
  padding: 5px 10px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* Unterwegs */
.travel-status { font-size: 17px; border-left: 4px solid var(--primary); }
.booking-card { display: flex; flex-direction: column; gap: 4px; }
.booking-card + .booking-card { margin-top: 10px; }
.booking-head { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.booking-head .icon { color: var(--muted); }
.booking-card .sub { display: block; }
.booking-ref { margin-top: 4px; font-size: 14px; color: var(--muted); }
.copy-chip {
  padding: 2px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.quick-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick-file {
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Erinnerungen */
.summary-card { display: flex; flex-direction: column; gap: 10px; }
.stars { display: flex; gap: 4px; }
.star { padding: 0 2px; border: 0; background: none; color: var(--border); font-size: 32px; line-height: 1; cursor: pointer; }
.star.on { color: var(--c-tasks); }
.note-card.plain { padding: 0; border: 0; background: none; }
.timeline-day { position: relative; padding-left: 16px; border-left: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.timeline-day + .timeline-day { margin-top: 18px; }
.moment { display: flex; flex-direction: column; gap: 10px; }
.moment + .moment { margin-top: 10px; }
.moment-text { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.moment-text .sub { margin-top: 4px; }

.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.attach {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 100px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.attach-img { padding: 0; aspect-ratio: 1; }
.attach.just-added { animation: just-added 2.2s ease-out; }
@keyframes just-added {
  0%, 40% { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 35%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.attach-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-icon { font-size: 26px; }
.attach-name { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.attach-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.attach-actions { display: flex; gap: 8px; margin-top: 10px; }
.attach-actions .btn { flex: 1; }

.field-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.field-check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--primary); }
.field-pair { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: end; }
.field-pair:has(> .field[hidden]) { grid-template-columns: 1fr; }
.dialog-intro { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Karten, Dialoge, Hinweise ---------- */
.info-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.user-card { display: flex; align-items: center; gap: 14px; }

dialog.dialog {
  width: min(92vw, 440px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog-form { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.dialog-form h2 { margin: 0; font-size: 19px; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dialog-actions .btn { padding: 0 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.banner {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(var(--topbar-h) + 8px + env(safe-area-inset-top));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 608px;
  margin: 0 auto;
  padding: 8px 8px 8px 16px;
  border-radius: 14px;
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.banner .btn { min-height: 36px; border: 0; background: var(--primary-text); color: var(--primary); }

.info-card h2 { display: flex; align-items: baseline; gap: 8px; }
.version-date { font-size: 13px; font-weight: 500; }
.steps { margin: 0; padding-left: 20px; }
.steps li + li { margin-top: 6px; }
.code {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
.info-card .btn { margin-top: 8px; }
.small-text { font-size: 13px; }
.whats-new { max-height: 60vh; overflow-y: auto; }
.whats-new .info-card { padding: 0; border: 0; }

/* ---------- Anmeldung ---------- */
.login { display: flex; flex-direction: column; gap: 14px; max-width: 360px; margin: 10vh auto 0; }
.login-logo { align-self: center; width: 84px; height: 84px; border-radius: 20px; }
.login h1 { margin: 0 0 8px; text-align: center; }
.error { margin: 0; color: var(--danger); }

/* ---------- Tableiste ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--tabbar-h);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  text-decoration: none;
}
.tabbar a.active { color: var(--tab); }
.tabbar a.active svg { filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--tab) 45%, transparent)); }
