/* ============================================================
   COCKPIT — Styling (dunkel, mobil-first, TimeTree-inspiriert)
   ============================================================ */
:root {
  --bg: #0c0f1a;
  --bg-soft: #131829;
  --card: #1a2036;
  --card-2: #212945;
  --line: rgba(255,255,255,.08);
  --text: #eef1fa;
  --muted: #8b93ad;
  --accent: #6c8cff;
  --accent-2: #38d9c8;
  --danger: #ff6b6b;
  --warn: #ffb84d;
  --ok: #4cd97b;
  --privat: #4cd97b;
  --lunico: #b78cff;
  --nezwerk: #38bdf8;
  --radius: 16px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="checkbox"] { width: auto; }
a { color: var(--accent); text-decoration: none; }
::placeholder { color: #5c6584; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---------- App-Gerüst ---------- */
#app { display: none; min-height: 100dvh; }
#app.ready { display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(12,15,26,.97), rgba(12,15,26,.88));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 18px;
}
.topbar h1 { font-size: 1.05rem; font-weight: 650; letter-spacing: .3px; }
.topbar .sub { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 17px;
}
.iconbtn:active { transform: scale(.94); }

.main {
  flex: 1; width: 100%; max-width: 860px; margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 84px);
}

/* ---------- Bottom-Navigation ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: rgba(17,21,37,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottomnav button {
  flex: 1; max-width: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; border-radius: 12px;
  color: var(--muted); font-size: .68rem;
}
.bottomnav button .nicon { font-size: 20px; line-height: 1.2; }
.bottomnav button.active { color: var(--text); }
.bottomnav button.active .nicon { transform: translateY(-1px); }
.bottomnav button.active::after {
  content: ''; width: 18px; height: 3px; border-radius: 3px; margin-top: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---------- Karten & Sektionen ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); margin-bottom: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.card h3 .count {
  background: var(--card-2); border-radius: 999px; padding: 1px 8px;
  font-size: .72rem; color: var(--text);
}
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), #5a7cf0);
  color: #fff; font-weight: 600; border-radius: 12px;
  padding: 11px 18px; font-size: .92rem;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--card-2); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: rgba(255,107,107,.15); color: var(--danger); border: 1px solid rgba(255,107,107,.3); }
.btn.small { padding: 7px 12px; font-size: .82rem; border-radius: 10px; }
.btn.block { width: 100%; }

/* ---------- Chips (Kontext-Filter) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.active { color: var(--text); border-color: var(--accent); background: rgba(108,140,255,.12); }
.chip.cal-off { opacity: .38; }

/* ---------- Dashboard ---------- */
.greet { margin: 4px 2px 16px; }
.greet .hello { font-size: 1.45rem; font-weight: 700; }
.greet .date { color: var(--muted); font-size: .88rem; margin-top: 2px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; text-align: center;
}
.kpi .num { font-size: 1.35rem; font-weight: 700; }
.kpi .lbl { font-size: .68rem; color: var(--muted); margin-top: 2px; }
.kpi.alert .num { color: var(--danger); }

/* Schnellzugriff nach Bereich gruppiert */
.linkgroup { margin-bottom: 14px; }
.linkgroup:last-child { margin-bottom: 0; }
.lgtitle {
  display: flex; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 700; color: var(--muted);
  margin-bottom: 7px; letter-spacing: .3px;
}
.lgtitle .lgdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.linkgrid { display: flex; gap: 8px; flex-wrap: wrap; }
.linkgrid a {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 14px; color: var(--text); font-size: .85rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
}
.linkgrid a .ldot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Listen (Events/Todos) ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: none; }
.item .cdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.item .title { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: .76rem; color: var(--muted); margin-top: 1px; }
.item .time { font-size: .8rem; color: var(--muted); flex: none; text-align: right; min-width: 52px; }
.item.clickable { cursor: pointer; }
.item.clickable:active { background: rgba(255,255,255,.03); }

.todo-check {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 2px solid var(--muted); display: grid; place-items: center;
  font-size: 13px; color: transparent; cursor: pointer;
}
.todo-check.done { background: var(--ok); border-color: var(--ok); color: #0b2214; }
.item.done-item .title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.prio-flag { color: var(--warn); font-size: .9rem; }
.due-late { color: var(--danger) !important; font-weight: 600; }

/* ---------- Spracheingabe ---------- */
.microw { display: flex; gap: 8px; align-items: flex-start; }
.microw > input, .microw > textarea { flex: 1; min-width: 0; }
.micbtn {
  flex: none; width: 46px; align-self: stretch; min-height: 42px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 10px; font-size: 19px; line-height: 1;
  display: grid; place-items: center;
}
.micbtn:active { transform: scale(.94); }
.micbtn.rec {
  background: var(--danger); border-color: var(--danger); color: #fff;
  animation: micpulse 1.1s ease-in-out infinite;
}
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,.55); }
  50%      { box-shadow: 0 0 0 9px rgba(255,107,107,0); }
}
.micstatus {
  font-size: .74rem; color: var(--danger); font-weight: 600;
  margin-top: 5px; display: none;
}
.micstatus.on { display: block; }

.quickadd { display: flex; gap: 8px; margin-bottom: 14px; }
.quickadd input { flex: 1; }
.quickadd .btn { padding: 10px 16px; flex: none; }

.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: .88rem; }
.empty .eicon { font-size: 30px; display: block; margin-bottom: 8px; opacity: .6; }

/* ---------- Kalender (TimeTree-Stil) ---------- */
.calhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.calhead .month { font-size: 1.15rem; font-weight: 700; flex: 1; text-align: center; }
.calweekdays {
  display: grid; grid-template-columns: 30px repeat(7, 1fr);
  font-size: .68rem; color: var(--muted); text-align: center;
  margin-bottom: 4px; font-weight: 600;
}
.calweekdays .we { color: #d98c8c; }
.calweekdays .kwhead { font-size: .62rem; opacity: .75; }
.calgrid {
  display: grid; grid-template-columns: 30px repeat(7, 1fr);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
/* Kalenderwoche-Spalte */
.kwcell {
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6px;
  font-size: .7rem; font-weight: 700; color: #9aa3bd;
  background: rgba(255,255,255,.04);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.kwcell.kw-now { color: var(--accent); background: rgba(108,140,255,.16); }
.calcell {
  min-height: 74px; padding: 4px 3px;
  border-right: 1px solid rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}
.calcell:nth-child(8n) { border-right: none; }
.calcell .dnum {
  font-size: .72rem; font-weight: 600; text-align: center;
  width: 22px; height: 22px; line-height: 22px; border-radius: 50%;
  margin: 0 auto 1px; flex: none;
}
.calcell.other .dnum { color: #4a5270; }
.calcell.today .dnum { background: var(--accent); color: #fff; }
.calcell.selected { background: rgba(108,140,255,.1); box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 8px; }
.calcell .ebar {
  font-size: .6rem; line-height: 1.5; padding: 0 4px;
  border-radius: 4px; color: #fff; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: none;
}
.calcell .emore { font-size: .58rem; color: var(--muted); padding-left: 4px; }

.daypanel { margin-top: 14px; }
.daypanel .dhead {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; padding: 0 2px;
}
.daypanel .dhead .dtitle { font-weight: 700; font-size: .98rem; }

/* ---------- Personen / Teilnehmer ---------- */
.peoplechips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  background: var(--bg-soft); border: 1.5px solid var(--line); color: var(--muted);
  cursor: pointer;
}
.pchip .pdot { width: 10px; height: 10px; border-radius: 50%; }
.pchip.on { color: var(--text); background: var(--card-2); border-color: var(--pcol, var(--accent)); }
.pchip:active { transform: scale(.96); }

/* „von XY geteilt"-Vermerk */
.shared-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .66rem; font-weight: 650; color: var(--accent-2);
  background: rgba(56,217,200,.12); border: 1px solid rgba(56,217,200,.25);
  border-radius: 999px; padding: 1px 8px; margin-top: 4px;
}

.abadge {
  display: inline-block; font-size: .64rem; font-weight: 700; color: #fff;
  padding: 1.5px 8px; border-radius: 999px; margin-right: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.ebar { display: flex; align-items: center; gap: 4px; }
.ebar .etxt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
/* Name der zugeteilten Person — wird nie abgeschnitten */
.ebar .ename {
  flex: none; font-weight: 800; opacity: .95;
  padding-left: 4px; border-left: 1px solid rgba(255,255,255,.35);
}

/* Mehrtägige Termine: an den Übergängen eckig, damit sie als
   durchgehender Balken lesbar sind */
.ebar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -3px; }
.ebar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -3px; }
.ebar.cont-l .etxt { opacity: .75; }

/* ---------- Drag & Drop ---------- */
.ebar[draggable="true"] { cursor: grab; }
.calcell.dragover {
  background: rgba(108,140,255,.18);
  box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: 8px;
}

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 45;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 26px; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(80,110,255,.45);
}
.fab:active { transform: scale(.92); }

/* ---------- Notizen ---------- */
.notegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.notecard {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; cursor: pointer; min-height: 96px;
  display: flex; flex-direction: column; gap: 6px;
  border-top: 3px solid var(--muted);
}
.notecard:active { transform: scale(.98); }
.notecard .nhead { display: flex; align-items: flex-start; gap: 8px; }
.notecard .nhead .todo-check { width: 20px; height: 20px; font-size: 11px; margin-top: 1px; }
.notecard .ntitle { font-weight: 700; font-size: .9rem; flex: 1; min-width: 0; }
.notecard .nbody {
  font-size: .78rem; color: var(--muted); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-line;
}
.notecard .nfoot { font-size: .66rem; color: var(--muted); display: flex; justify-content: space-between; }
/* erledigte Notizen zurückhaltend darstellen */
.notecard.arch { opacity: .58; border-top-style: dashed; }
.notecard.arch .ntitle { color: var(--muted); text-decoration: line-through; }

/* ---------- Mehr-Menü ---------- */
.menulist { display: flex; flex-direction: column; }
.menulist button {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 4px; border-bottom: 1px solid var(--line);
  font-size: .98rem; font-weight: 600; text-align: left;
}
.menulist button:last-child { border-bottom: none; }
.menulist .micon { font-size: 21px; width: 26px; text-align: center; }
.menulist .marrow { color: var(--muted); font-size: 20px; }
.menulist button:active { background: rgba(255,255,255,.04); }

/* ---------- Fortschrittsbalken (Ziele, Sparziele) ---------- */
.prog {
  height: 8px; border-radius: 999px; background: var(--bg-soft);
  overflow: hidden; margin-top: 7px;
}
.prog > span { display: block; height: 100%; border-radius: 999px; transition: width .25s; }

.goalcard {
  padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.goalcard:last-child { border-bottom: none; }
.goalcard:active { background: rgba(255,255,255,.03); }
.goalcard .gtop { display: flex; align-items: center; gap: 8px; }
.goalcard .gtitle { font-weight: 650; font-size: .95rem; flex: 1; min-width: 0; }
.goalcard .gpct { font-size: .85rem; font-weight: 700; flex: none; }
.goalcard .gmeta { font-size: .74rem; color: var(--muted); margin-top: 3px; }
.goalcard.done-goal .gtitle { color: var(--muted); text-decoration: line-through; }

.steprow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.steprow:last-child { border-bottom: none; }
.steprow .stitle { flex: 1; font-size: .88rem; }
.steprow.sdone .stitle { text-decoration: line-through; color: var(--muted); }
.steprow .srm { color: var(--danger); padding: 0 4px; font-size: 15px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; padding: 0;
  height: 6px; border-radius: 999px; background: var(--bg-soft);
  border: 1px solid var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 3px solid var(--bg-soft);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: var(--accent); cursor: pointer;
}

/* ---------- Finanzen ---------- */
.segbtns {
  display: flex; gap: 6px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px;
}
.segbtns .seg {
  flex: 1; padding: 9px 6px; border-radius: 9px; font-size: .88rem;
  font-weight: 650; color: var(--muted);
}
.segbtns .seg.active { background: var(--card-2); color: var(--text); }
.segbtns .seg[data-type="out"].active { color: var(--danger); }
.segbtns .seg[data-type="in"].active { color: var(--ok); }

.accrow {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 2px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.accrow:last-child { border-bottom: none; }
.accrow .abar { width: 4px; height: 30px; border-radius: 3px; flex: none; }
.accrow .aname { font-weight: 620; font-size: .93rem; }
.accrow .ameta { font-size: .73rem; color: var(--muted); margin-top: 1px; }
.accrow .abal { font-weight: 700; font-size: .96rem; flex: none; font-variant-numeric: tabular-nums; }

.amt-pos { color: var(--ok); }
.amt-neg { color: var(--danger); }
.amt-big { font-variant-numeric: tabular-nums; }

.svcard { padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.svcard:last-child { border-bottom: none; }
.svcard .stop { display: flex; align-items: baseline; gap: 8px; }
.svcard .sname { font-weight: 650; font-size: .93rem; flex: 1; }
.svcard .samt { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.svcard .sfoot { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 5px; }

.barchart { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 6px; }
.barchart .bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.barchart .bpair { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.barchart .bbar { width: 42%; border-radius: 4px 4px 0 0; min-height: 2px; }
.barchart .bin { background: var(--ok); }
.barchart .bout { background: var(--danger); }
.barchart .blbl { font-size: .64rem; color: var(--muted); flex: none; }
.chartlegend { display: flex; gap: 14px; justify-content: center; font-size: .72rem; color: var(--muted); margin-top: 8px; }
.chartlegend span { display: inline-flex; align-items: center; gap: 5px; }
.chartlegend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5,7,14,.72); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; width: 100%; max-width: 560px;
  max-height: 88dvh; overflow-y: auto;
  padding: 18px 18px calc(20px + var(--safe-b));
  animation: slideup .18s ease-out;
}
@keyframes slideup { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.modal h2 .close { font-size: 22px; color: var(--muted); padding: 2px 8px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: .74rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; letter-spacing: .3px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions .btn { flex: 1; }
.switchrow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: .9rem;
}
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--card-2);
  border: 1px solid var(--line); transition: background .15s;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- Auth / Setup ---------- */
.gate {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(700px 380px at 85% -10%, rgba(108,140,255,.22), transparent 60%),
    radial-gradient(600px 340px at 0% 110%, rgba(56,217,200,.14), transparent 60%),
    var(--bg);
}
.gatebox { width: 100%; max-width: 400px; }
.gatebox .glogo {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 32px;
  box-shadow: 0 12px 34px rgba(80,110,255,.4);
}
.gatebox h1 { text-align: center; font-size: 1.5rem; margin-bottom: 2px; }
.gatebox .gsub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.gatebox .card { padding: 20px; }
.gate .err {
  background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.3);
  color: var(--danger); border-radius: 10px; padding: 10px 12px;
  font-size: .82rem; margin-bottom: 12px;
}
.gate .toggleline { text-align: center; margin-top: 14px; font-size: .84rem; color: var(--muted); }

/* ---------- Einstellungen ---------- */
.setting-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting-item:last-child { border-bottom: none; }
.colorpick { width: 34px; height: 34px; border: none; padding: 0; background: none; border-radius: 8px; flex: none; }
.memberchip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 6px 5px 12px; font-size: .8rem; margin: 3px 4px 3px 0;
}
.memberchip .rm { color: var(--danger); font-size: 15px; padding: 0 5px; }

/* ---------- Datenbank-Update-Status ---------- */
.modrow {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; padding: 4px 0;
}
.modrow .mstate { flex: none; width: 16px; text-align: center; }
.modrow.miss { color: var(--warn); }
.modrow.miss code {
  background: rgba(255,184,77,.12); border-radius: 5px;
  padding: 1px 6px; font-size: .74rem;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 20px); z-index: 99;
  background: #232b4a; border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 12px; font-size: .86rem;
  box-shadow: 0 10px 26px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; }

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  .main { padding-top: 24px; }
  .calcell { min-height: 96px; }
  .calcell .ebar { font-size: .68rem; }
  .modal-bg { align-items: center; }
  .modal { border-radius: 20px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
