/* ===================== Planer – Aussehen ===================== */

:root {
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --bg: #eef1f8;
  --bg-2: #e4e8f3;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.5);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.12);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.1);
  --amber: #d97706;
  --amber-bg: rgba(217, 119, 6, 0.12);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --blur: 18px;
  --side-w: 236px;
  --right-w: 290px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --blob-1: #a5b4fc;
  --blob-2: #f9a8d4;
  --blob-3: #99f6e4;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e1a;
    --bg-2: #0f1424;
    --surface: rgba(24, 30, 50, 0.66);
    --surface-solid: #161c2e;
    --surface-2: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(22, 28, 46, 0.94);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e8ebf4;
    --text-2: #c3c9d9;
    --muted: #8b93a9;
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.14);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, 0.13);
    --amber: #fbbf24;
    --amber-bg: rgba(251, 191, 36, 0.13);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 70px -10px rgba(0, 0, 0, 0.7);
    --blob-1: #3730a3;
    --blob-2: #831843;
    --blob-3: #134e4a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-2: #0f1424;
  --surface: rgba(24, 30, 50, 0.66);
  --surface-solid: #161c2e;
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(22, 28, 46, 0.94);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ebf4;
  --text-2: #c3c9d9;
  --muted: #8b93a9;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.14);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.13);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.13);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 70px -10px rgba(0, 0, 0, 0.7);
  --blob-1: #3730a3;
  --blob-2: #831843;
  --blob-3: #134e4a;
  color-scheme: dark;
}

:root[data-accent="violet"] { --accent: #8b5cf6; --accent-2: #d946ef; }
:root[data-accent="blue"] { --accent: #3b82f6; --accent-2: #06b6d4; }
:root[data-accent="teal"] { --accent: #0d9488; --accent-2: #22c55e; }
:root[data-accent="green"] { --accent: #16a34a; --accent-2: #84cc16; }
:root[data-accent="rose"] { --accent: #e11d48; --accent-2: #f97316; }
:root[data-accent="amber"] { --accent: #d97706; --accent-2: #ef4444; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font: 14px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* farbige, weiche Flecken im Hintergrund – sorgen für den Glas-Look */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(1200px 800px at 100% 0%, var(--bg-2), transparent), var(--bg);
}
.bg-blobs span {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}
.bg-blobs span:nth-child(1) { background: var(--blob-1); top: -18vmax; left: 10vw; }
.bg-blobs span:nth-child(2) { background: var(--blob-2); bottom: -22vmax; right: -6vw; opacity: 0.3; }
.bg-blobs span:nth-child(3) { background: var(--blob-3); bottom: -10vmax; left: -14vmax; opacity: 0.3; }
body:not(.glass-on) .bg-blobs span { display: none; }

#app { position: relative; z-index: 1; height: 100%; }

/* ---------- eigene Titelleiste (installierte App) ---------- */
.titlebar {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: stretch;
  height: 38px;
  user-select: none;
  -webkit-user-select: none;
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
  border-bottom: 1px solid var(--border);
}
body.glass-on .titlebar { backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); }
.titlebar[hidden] { display: none; }
body.has-titlebar #app { height: calc(100% - 38px); }
.tb-drag { flex: 1; display: flex; align-items: center; gap: 9px; padding-left: 14px; min-width: 0; }
.tb-logo { width: 18px; height: 18px; border-radius: 5px; pointer-events: auto; }
.tb-title { font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; }
.tb-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btns { display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.tb-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.tb-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tb-btn:hover { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.tb-btn:active { transform: scale(0.92); }
.tb-btn.close:hover { background: #e5484d; color: #fff; box-shadow: none; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 5px;
}
mark { background: color-mix(in srgb, var(--amber) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.grow { flex: 1; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- Glas ---------- */
.glass {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.glass-strong {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
body.glass-on .glass {
  background: var(--surface);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
}
body.glass-on .glass-strong {
  background: var(--surface-strong);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
}

/* ---------- Symbole ---------- */
.ic { width: 18px; height: 18px; flex: none; }
.ic.tiny { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.imp-ic { color: var(--red); }

/* ---------- Knöpfe ---------- */
button { font: inherit; color: inherit; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.ghost.danger, .btn.danger.ghost { background: transparent; color: var(--red); border-color: var(--border); }
.btn.ghost.danger:hover { background: var(--red-bg); }
.btn.ok { background: var(--green-bg); color: var(--green); border-color: transparent; }
.btn.ok:hover { background: var(--green); color: #fff; }
.btn.no { background: var(--red-bg); color: var(--red); border-color: transparent; }
.btn.no:hover { background: var(--red); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.on { border-color: var(--amber); color: var(--amber); }
.btn.on .ic { fill: currentColor; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 6px; }
.icon-btn.xs .ic { width: 14px; height: 14px; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); }
.icon-btn.on { color: var(--red); background: var(--red-bg); }
.icon-btn.on .ic { fill: currentColor; }
.icon-btn.on-ok { color: #fff; background: var(--green); }
.icon-btn.on-no { color: #fff; background: var(--red); }
.icon-btn.star.on { color: #f59e0b; }
.icon-btn.star.on .ic { fill: currentColor; }

/* ---------- Grundgerüst ---------- */
.shell {
  display: flex;
  height: 100%;
  padding: 12px;
  gap: 12px;
}

.side {
  flex: none;
  border-radius: 20px;
  overflow: hidden;
  transition: width 0.42s var(--ease), margin 0.42s var(--ease), opacity 0.3s, transform 0.42s var(--ease);
  position: relative;
  z-index: 20;
}
.side-left { width: var(--side-w); }
.side-right { width: var(--right-w); }
.side-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.42s var(--ease);
}
.side-left .side-inner { width: var(--side-w); }
.side-right .side-inner { width: var(--right-w); }

/* eingeklappt: Leiste gleitet hinaus */
.shell.left-closed .side-left { width: 0; margin-right: -12px; opacity: 0; border-width: 0; }
.shell.left-closed .side-left .side-inner { transform: translateX(-60px); }
.shell.right-closed .side-right { width: 0; margin-left: -12px; opacity: 0; border-width: 0; }
.shell.right-closed .side-right .side-inner { transform: translateX(60px); }

.edge-left, .edge-right { display: none; }
.shell.left-closed .edge-left, .shell.right-closed .edge-right { display: inline-grid; animation: pop 0.3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(0.7); } }

.scrim { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 14px 16px;
}
.brand .logo { width: 30px; height: 30px; border-radius: 9px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; flex: 1; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-2);
  font-weight: 540;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.nav-item span { flex: 1; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}
.nav-count { font-size: 11px; font-weight: 650; color: var(--muted); min-width: 18px; text-align: center; }
.nav-count:empty { display: none; }
.nav-count.hot {
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
}
.nav-sep { height: 1px; background: var(--border); margin: 8px 12px; }

.side-foot { padding: 10px; border-top: 1px solid var(--border); }
.user-row { display: flex; align-items: center; gap: 4px; }
.user-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.user-btn:hover { background: var(--surface-2); }
.u-name { display: flex; flex-direction: column; min-width: 0; }
.u-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.sync { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sync.ok::before { background: var(--green); }
.sync.sync::before { background: var(--accent); animation: blink 1s infinite; }
.sync.warn::before { background: var(--amber); }
.sync.err::before { background: var(--red); }
@keyframes blink { 50% { opacity: 0.3; } }
.version { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }

/* ---------- Hauptbereich ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 0;
  min-height: 44px;
}
.top-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.top-title h1 { font-size: 24px; letter-spacing: -0.025em; white-space: nowrap; }
#view-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  width: 280px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: width 0.3s var(--ease), border-color 0.15s;
}
.top-search:focus-within { border-color: var(--accent); width: 340px; }
.top-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font: inherit; color: var(--text); }

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 24px;
  scrollbar-gutter: stable;
}
.view { display: flex; flex-direction: column; gap: 14px; }
.view.anim { animation: viewIn 0.28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 2px 8px;
}
.count {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  min-width: 20px;
  padding: 1px 6px;
  text-align: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0;
}

/* ---------- Wichtig ---------- */
.imp-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}
.imp-strip.empty {
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  color: var(--green);
}
.imp-strip.empty div { display: flex; flex-direction: column; color: var(--text); }
.imp-strip.empty span { color: var(--muted); }
.imp-strip.empty > .ic { width: 28px; height: 28px; padding: 5px; background: var(--green-bg); border-radius: 50%; }
.imp-card {
  flex: 0 0 248px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 10px 14px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.imp-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--c);
}
.imp-card.flagged { box-shadow: 0 0 0 1.5px var(--red), var(--shadow); }
.imp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.imp-kind { display: flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; }
.imp-kind .ic { width: 14px; height: 14px; color: var(--c); }
.imp-when { font-weight: 650; color: var(--muted); white-space: nowrap; }
.imp-when.now { color: var(--red); }
.imp-when.soon { color: var(--amber); }
.imp-title { font-weight: 650; font-size: 15px; cursor: pointer; line-height: 1.3; }
.imp-title:hover { color: var(--accent); }
.imp-sub { color: var(--muted); font-size: 12.5px; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.imp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.imp-btns .btn { height: 32px; font-size: 12.5px; padding: 0 8px; }
.imp-btns .ic { width: 15px; height: 15px; }

/* ---------- Woche ---------- */
.week-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius);
}
.week-center { grid-column: 2; display: flex; align-items: center; gap: 6px; }
.week-nav > .btn { grid-column: 3; justify-self: end; }
.week-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 330px;
  padding: 5px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
}
.week-label:hover { border-color: var(--accent); }
.week-label small { color: var(--muted); font-size: 11.5px; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.day-col {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
body.glass-on .day-col { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.day-col.weekend { background: var(--surface-2); }
.day-col.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 30px -14px var(--accent); }
.day-col.past .day-head { opacity: 0.6; }
.day-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 9px 11px 8px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.day-head:hover { background: var(--surface-2); }
.day-head .dn { font-weight: 650; font-size: 13px; }
.day-head .dd { font-size: 12px; color: var(--muted); }
.day-col.today .day-head { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.day-col.today .day-head .dd { color: rgba(255, 255, 255, 0.85); }
.day-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  cursor: pointer;
  position: relative;
}
.day-add {
  display: grid;
  place-items: center;
  height: 28px;
  border-radius: 8px;
  border: 1.5px dashed var(--border-strong);
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
  margin-top: auto;
}
.day-body:hover .day-add { opacity: 1; }

.ev-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 8px 7px 11px;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.ev-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.ev-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ev-card.imp { box-shadow: inset 0 0 0 1.5px var(--red); }
.ev-card.past { opacity: 0.72; }
.ev-card.st-done .ev-title { text-decoration: line-through; text-decoration-color: var(--green); }
.ev-card.st-missed .ev-title { text-decoration: line-through; text-decoration-color: var(--red); }
.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ev-time { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; }
.ev-top .icon-btn { margin: -3px -4px -3px 0; opacity: 0; }
.ev-card:hover .ev-top .icon-btn { opacity: 1; }
.ev-title { font-weight: 640; font-size: 13px; line-height: 1.3; word-break: break-word; }
.ev-desc {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.ev-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 3px;
  padding: 3px 9px 3px 7px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.ev-action:hover { text-decoration: none; background: var(--accent); color: #fff; }
.ev-action .ic { width: 14px; height: 14px; }
.ev-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.ev-card.big { padding: 12px 14px 12px 16px; gap: 6px; }
.ev-card.big .ev-title { font-size: 16px; }
.ev-card.big .ev-desc { -webkit-line-clamp: 8; font-size: 13.5px; }
.ev-card.big .ev-time { font-size: 13px; }

.todo-mini {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 9px;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  cursor: pointer;
}
.todo-mini.high { border-color: var(--red); }
.todo-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tick {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  color: transparent;
  padding: 0;
  transition: all 0.15s;
}
.tick .ic { width: 13px; height: 13px; stroke-width: 3; }
.tick:hover { border-color: var(--green); color: var(--green); }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.pill .ic { width: 12px; height: 12px; stroke-width: 3; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.no { background: var(--red-bg); color: var(--red); }
.pill.open { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Tabs ---------- */
.dash-tabs { border-radius: 20px; padding: 6px 6px 14px; min-height: 360px; }
.tabs { display: flex; gap: 4px; padding: 4px; overflow-x: auto; }
.tabs.big { padding: 0; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 580;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--text); background: var(--surface-solid); border-color: var(--border); box-shadow: var(--shadow); }
.tab.active .ic { color: var(--accent); }
.tab-body { padding: 10px 10px 0; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head b { min-width: 140px; text-align: center; font-size: 15px; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.seg button {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 580;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; }

/* ---------- Monat / Jahr ---------- */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.m-head { text-align: center; font-size: 12px; font-weight: 650; color: var(--muted); padding: 2px 0; }
.m-cell {
  min-height: 108px;
  padding: 5px 6px 6px;
  border-radius: 11px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s;
}
.m-cell:hover { border-color: var(--accent); }
.month-grid.compact .m-cell { min-height: 82px; }
.m-cell.out { opacity: 0.4; }
.m-cell.past { background: var(--surface-2); }
.m-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.m-num { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.m-cell.today .m-num {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 0 6px;
}
.m-chip {
  font-size: 11.5px;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  border-left: 3px solid var(--c);
}
.m-chip:hover { background: color-mix(in srgb, var(--c) 32%, transparent); }
/* mehrtägige Termine: ein Balken über mehrere Tage */
.m-chip.multi { background: color-mix(in srgb, var(--c) 30%, transparent); font-weight: 600; }
.m-chip.multi small { font-weight: 500; opacity: 0.7; }
.m-chip.more-days { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -7px; }
.m-chip.cont { border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -7px; padding-left: 10px; }
.ev-card.multi::before { width: 6px; }
.ev-card.multi.cont { background: color-mix(in srgb, var(--c) 12%, var(--surface-solid)); }
.multi-info:empty { display: none; }
.multi-info { align-self: end; }
.m-chip.todo { background: var(--surface-2); border-left-color: var(--muted); }
.m-more { font-size: 11px; color: var(--muted); padding-left: 4px; }

.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.y-month { border-radius: var(--radius); padding: 10px 12px 12px; }
.y-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  font-weight: 650;
  font-size: 14px;
  padding: 2px 2px 8px;
  cursor: pointer;
}
.y-title:hover { color: var(--accent); }
.y-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.y-wd { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.y-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 11.5px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.y-day:hover { background: var(--surface-2); }
.y-day.has { background: color-mix(in srgb, var(--c) 24%, transparent); font-weight: 700; }
.y-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- Planer ---------- */
.plan-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: var(--radius);
}
.plan-nav { display: flex; align-items: center; gap: 6px; }
.plan-label { min-width: 230px; text-align: center; font-size: 15px; }
.day-view { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-side { border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.day-side h3 { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.add-wide { border-style: dashed; height: 44px; }

/* ---------- Listen (To-Do, Notizen, …) ---------- */
.list-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.list-head > .btn.primary { margin-left: auto; }
.list-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.list-tools select, .search-filters select {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 560;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--text); color: var(--bg); border-color: transparent; }
.chip.active .dot { box-shadow: 0 0 0 2px var(--bg); }
.chip.add { padding: 0 8px; color: var(--muted); }
.chip.add .ic { width: 15px; height: 15px; }
.mini-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--muted);
}
.mini-search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); width: 170px; }
.toolbar-right { display: flex; justify-content: flex-end; }

.quick-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: 14px;
  color: var(--muted);
}
.quick-bar input {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  height: 36px;
}
.quick-bar #todo-quick { flex: 1; min-width: 120px; }
.quick-bar input[type=date] { font-size: 13px; color: var(--muted); width: 135px; }

.group { display: flex; flex-direction: column; gap: 6px; }
.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 10px 2px 2px;
}
.group-title .ic { width: 15px; height: 15px; }

.todo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.todo-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c); }
.todo-row:hover { box-shadow: var(--shadow); }
.todo-row.high { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 55%, transparent); }
.todo-row.done .t-title { text-decoration: line-through; color: var(--muted); }
.todo-row .icon-btn { opacity: 0; }
.todo-row:hover .icon-btn { opacity: 1; }
.t-main { flex: 1; min-width: 0; cursor: pointer; }
.t-title { font-weight: 600; }
.t-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 1px; }
.t-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.due.over { color: var(--red); font-weight: 650; }
.due.now { color: var(--amber); font-weight: 650; }
.dash-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

.note-grid { columns: 260px; column-gap: 12px; }
.note-grid.small { columns: 220px; }
.note-card {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 14px;
  padding: 12px 14px 8px;
  cursor: pointer;
  border-top: 3px solid var(--c);
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.note-card:hover { transform: translateY(-2px); }
.note-card.tinted { background: color-mix(in srgb, var(--tint) 45%, var(--surface-solid)); }
.n-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.n-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  color: var(--text-2);
  max-height: 220px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 80%, transparent);
}
.n-foot { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.n-foot .icon-btn { opacity: 0; }
.note-card:hover .n-foot .icon-btn { opacity: 1; }

.recipe-grid, .series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.recipe-card {
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s var(--ease);
}
.recipe-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.12;
  pointer-events: none;
}
.recipe-card:hover { transform: translateY(-2px); }
.recipe-card h3 { font-size: 16px; }
.r-band { display: flex; align-items: center; justify-content: space-between; }
.r-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted); }
.r-tags { display: flex; flex-wrap: wrap; gap: 5px; font-size: 11.5px; color: var(--accent); }
.cat-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 650;
  padding: 2px 9px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  color: color-mix(in srgb, var(--c) 75%, var(--text));
}

.recipe-modal .modal-body { padding-top: 6px; }
.r-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); margin-bottom: 12px; }
.r-cols { display: grid; grid-template-columns: minmax(240px, 0.8fr) 1.2fr; gap: 18px; align-items: start; }
.r-ing { padding: 12px 14px; border-radius: 14px; }
.r-ing-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.r-ing h3, .r-steps h3 { font-size: 15px; margin-bottom: 6px; }
.r-ing ul { list-style: none; margin: 0; padding: 0; }
.r-ing li label { display: flex; gap: 9px; padding: 6px 2px; border-bottom: 1px dashed var(--border); cursor: pointer; }
.r-ing li input:checked + span { text-decoration: line-through; color: var(--muted); }
.r-steps ol { margin: 0 0 14px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.r-steps li::marker { font-weight: 700; color: var(--accent); }
.stepper { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.stepper b { min-width: 22px; text-align: center; font-size: 15px; }

.series-card {
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 3px solid var(--c);
}
.series-card.st-done { opacity: 0.75; }
.s-head { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.s-head b { font-size: 15.5px; display: block; }
.s-head small { color: var(--muted); }
.s-status { font-size: 11px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.st-watching .s-status { color: var(--green); }
.s-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.s-ep {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.s-ep .lbl { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.s-ep b { font-size: 20px; min-width: 26px; text-align: center; }
.s-notes { font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; }
.s-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }

/* ---------- Archiv / Suche ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px 16px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); }
.stat b { font-size: 26px; display: block; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.ok b { color: var(--green); }
.stat.no b { color: var(--red); }
.arch-list { display: flex; flex-direction: column; gap: 6px; }
.arch-row, .res-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-left: 4px solid var(--c, var(--border-strong));
}
.res-row { cursor: pointer; margin-bottom: 6px; }
.res-row:hover { box-shadow: var(--shadow); }
.a-date { display: flex; flex-direction: column; align-items: center; width: 34px; line-height: 1.1; }
.a-date b { font-size: 17px; }
.a-date small { color: var(--muted); font-size: 11px; }
.a-main, .res-main { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.a-main small, .res-main small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.res-desc { display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-btns { display: flex; gap: 4px; }
.arch-row.st-done { border-left-color: var(--green); }
.arch-row.st-missed { border-left-color: var(--red); }
.res-date { display: flex; flex-direction: column; width: 92px; flex: none; line-height: 1.2; }
.res-date small { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.res-date.past small { color: var(--muted); }

.search-bar { border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.big-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.big-search:focus-within { border-color: var(--accent); }
.big-search .ic { width: 22px; height: 22px; }
.big-search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 18px; color: var(--text); }
.search-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.search-filters label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.res-section { margin-bottom: 8px; }

/* ---------- Einstellungen / Verbindungen ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.card { border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card h2 .ic { color: var(--accent); }
.card p { margin: 0; }
.set-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-row > span:first-child { width: 110px; color: var(--muted); }
.accents { display: flex; gap: 8px; }
.accent {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--a);
  cursor: pointer;
  transition: transform 0.15s;
}
.accent:hover { transform: scale(1.12); }
.accent.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--a); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background 0.2s;
}
.switch i::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::before { transform: translateX(20px); }
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-row { display: flex; align-items: center; gap: 8px; }
.cat-row input[type=color] {
  width: 32px;
  height: 32px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.cat-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cat-row input[type=color]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.cat-name {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-weight: 560;
  color: var(--text);
  padding: 0 8px;
}
.cat-name:hover, .cat-name:focus { border-color: var(--border); background: var(--surface-solid); outline: 0; }
.conn-status { display: flex; gap: 14px; align-items: center; }
.cs-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  flex: none;
}
.conn-status.ok .cs-icon { background: var(--green-bg); color: var(--green); }
.conn-status.error .cs-icon, .conn-status.offline .cs-icon { background: var(--amber-bg); color: var(--amber); }
.profile-list, .profile-pick { display: flex; flex-direction: column; gap: 6px; }
.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  text-align: left;
  width: 100%;
}
button.profile-row { cursor: pointer; }
button.profile-row:hover { border-color: var(--accent); }
.profile-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-row small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.profile-row > .ic { color: var(--muted); }
.profile-row.big { border: 0; background: transparent; padding: 0 0 4px; }

/* ---------- Kontakte ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contact-card {
  border-radius: var(--radius);
  padding: 12px 12px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 4px solid var(--c);
}
.contact-card.bday-soon { box-shadow: 0 0 0 1.5px #ec4899, var(--shadow); }
.ct-head { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.ct-head:hover b { color: var(--accent); }
.ct-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 700;
  color: #fff;
  background: var(--c);
}
.ct-avatar.company { border-radius: 12px; }
.ct-avatar.business { border-radius: 12px 50% 50% 50%; }
.ct-name small a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); }
.ct-addr, .ct-members { display: flex; align-items: baseline; gap: 2px; color: var(--muted); font-size: 12.5px; }
.ct-members { flex-wrap: wrap; }
.ct-members a { color: var(--text-2); }
.ct-actions, .ev-btnrow { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-btnrow { margin-top: 3px; }
.ev-btnrow .ev-action, .ct-actions .ev-action { margin: 0; }
button.ev-action { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); }
.ev-action.route { color: #0d9488; background: color-mix(in srgb, #14b8a6 16%, transparent); }
.ev-action.route:hover { background: #0d9488; color: #fff; }
.me-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; }
.me-card > .ic { width: 34px; height: 34px; padding: 7px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.me-card > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.me-card span { color: var(--muted); font-size: 13px; }
.me-card.empty-me { border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.inline-wide { display: flex; gap: 8px; align-items: center; }
.inline-wide input { flex: 1; }
.seg-radio { flex: 1; display: flex; }
.seg-radio input { display: none; }
.seg-radio span {
  flex: 1;
  display: grid;
  place-items: center;
  height: 32px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 580;
  cursor: pointer;
  font-size: 14px !important;
}
.seg-radio input:checked + span { background: var(--surface-solid); color: var(--text) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ct-name { display: flex; flex-direction: column; min-width: 0; }
.ct-name b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-name small { color: var(--muted); font-size: 12px; }
.ct-lines { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ct-lines a { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-lines a:hover { color: var(--accent); }
.ct-bday { color: #ec4899; font-weight: 600; }
.ct-foot { display: flex; align-items: center; gap: 2px; border-top: 1px solid var(--border); padding-top: 6px; }
.bday-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-radius: 14px; }
.bday-strip > .ic { color: #ec4899; }
.ct-events { display: flex; flex-direction: column; gap: 4px; }
.ct-events .res-row { text-align: left; font: inherit; color: inherit; width: 100%; margin: 0; }

.contact-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; }
.ct-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 4px 0 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  font-size: 13px;
  font-weight: 560;
}
.ct-chip em { font-style: normal; color: var(--muted); display: inline-flex; }
.ct-chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.ct-chip button:hover { background: var(--red-bg); color: var(--red); }
.ct-chip button .ic { width: 13px; height: 13px; }
.contact-picker select.ct-add {
  height: 30px;
  min-height: 30px !important;
  width: auto !important;
  padding: 0 8px !important;
  border-radius: 20px !important;
  border-style: dashed !important;
  color: var(--muted) !important;
}
.ev-contacts { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-action.cancel { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--red); background: var(--red-bg); }
.ev-action.cancel:hover { background: var(--red); color: #fff; }
.imp-card .ev-action { margin: 0 0 2px; }
.arch-row.st-cancelled { border-left-color: var(--red); }
.ev-card.st-cancelled .ev-title { text-decoration: line-through; text-decoration-color: var(--red); }

/* ---------- Adresse in Einzelfeldern ---------- */
/* Straße | Nr. – Zusatz (ganze Breite) – PLZ | Ort; Tab-Reihenfolge = Reihenfolge im HTML */
.addr-grid { display: grid; grid-template-columns: 110px 1fr 90px; gap: 8px; }
.addr-grid input[name="street"] { grid-column: 1 / 3; }
.addr-grid .addr-extra { grid-column: 1 / -1; }
.addr-grid input[name="city"] { grid-column: 2 / -1; }
.addr-grid input { width: 100%; min-height: 38px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-solid); color: var(--text); font: inherit; outline: 0; }
.addr-grid input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* Öffnungszeiten */
.hours-grid { display: flex; flex-direction: column; gap: 5px; }
.h-row { display: grid; grid-template-columns: 30px 1fr 10px 1fr 34px 1fr 10px 1fr; align-items: center; gap: 6px; }
.h-row b { font-size: 13px; }
.h-row span { text-align: center; color: var(--muted); }
.h-row .h-and { font-size: 12px; }
.h-row input { min-height: 34px; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text); font: inherit; min-width: 0; }
.h-row input:focus { border-color: var(--accent); outline: 0; }
.ct-open { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; cursor: help; }
.ct-open i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ct-open.open { color: var(--green); }
.ct-open.open i { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.ct-open.closed { color: var(--red); }
.ct-open.closed i { background: var(--red); }

/* Warnungen im Termin-Formular */
.ev-warn { display: flex; flex-direction: column; gap: 6px; }
.ev-warn > div { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 8px 11px; border-radius: 10px; font-size: 13px; }
.ev-warn .w-over { background: var(--red-bg); color: var(--red); }
.ev-warn .w-tight { background: var(--amber-bg); color: var(--amber); }
.ev-warn .w-hours { background: var(--amber-bg); color: var(--amber); }
.ev-warn b { color: inherit; }

/* Personen bei einer Firma */
.member-list { display: flex; flex-direction: column; gap: 4px; }
.member-row {
  display: grid;
  grid-template-columns: 30px minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  text-align: left;
  cursor: pointer;
}
.member-row:hover { border-color: var(--accent); }
.member-row > span:not(.ct-avatar) { color: var(--text-2); }
.member-row small { color: var(--muted); }
.ct-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.ct-members em { font-style: normal; color: var(--muted); }

/* ---------- Karte & Route im Planer ---------- */
.map-modal { width: min(980px, 100%); }
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.map-addr { display: flex; align-items: center; gap: 10px; min-width: 0; }
.map-addr > .ic { color: var(--accent); }
.map-addr div { display: flex; flex-direction: column; min-width: 0; }
.map-addr span { color: var(--muted); font-size: 13px; }
.map-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.map-modes .seg button .ic { width: 16px; height: 16px; }
.map-modes .seg.speed button.active { color: var(--accent); }
.map-box { height: min(58vh, 520px); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.map-info { margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.ic.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-solid); color: var(--text); }

/* ---------- Server-Verwaltung ---------- */
.admin-card h2 .icon-btn { margin-left: auto; }
.admin-spw { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.admin-spw > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.admin-spw small { color: var(--muted); }
.spw-val { font-size: 14px; padding: 4px 10px; }
.mode-seg button { font-size: 12.5px; padding: 0 8px; }
.mode-seg .ic { width: 15px; height: 15px; }
.admin-invite { display: grid; grid-template-columns: 1fr 130px auto; gap: 10px; align-items: end; }
.admin-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border); }
.admin-row.blocked { opacity: 0.6; }
.admin-row .a-main { cursor: default; }
.admin-row .ct-avatar .ic { color: #fff; }
.invite-code {
  font: 700 26px/1.2 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 14px;
  margin: 10px 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1.5px dashed var(--accent);
  user-select: all;
}
@media (max-width: 700px) { .admin-invite { grid-template-columns: 1fr; } }

.upd-avail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.upd-avail span { flex: 1; color: var(--text); }
.upd-bar { height: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 6px 0 4px; }
.upd-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.2s; }
.upd-notes { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- rechte Leiste: Schnell-Stuss ---------- */
.side-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px 10px; }
.side-head h3 { font-size: 16px; display: flex; align-items: center; gap: 7px; }
.side-head h3 .ic { color: var(--amber); }
.quick-add { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.quick-add textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
  outline: 0;
}
.quick-add textarea:focus { border-color: var(--accent); }
.quick-list { flex: 1; overflow-y: auto; padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.quick-item {
  padding: 9px 10px 6px 12px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
}
.quick-item.pinned { border-color: color-mix(in srgb, var(--amber) 60%, transparent); }
.q-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.q-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.q-acts { display: flex; gap: 1px; opacity: 0.4; transition: opacity 0.15s; }
.quick-item:hover .q-acts { opacity: 1; }
.yt-thumb { display: block; position: relative; border-radius: 9px; overflow: hidden; margin: -2px -2px 7px -4px; aspect-ratio: 16 / 9; background: #000; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb .ic {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  padding: 9px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  fill: #fff;
}

/* ---------- leere Zustände ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 34px 16px;
  color: var(--muted);
}
.empty > .ic { width: 38px; height: 38px; opacity: 0.5; }
.empty p { margin: 0; max-width: 480px; }
.empty.small { padding: 18px 8px; font-size: 12.5px; }

/* ---------- Fenster ---------- */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 12, 24, 0.38);
  opacity: 0;
  transition: opacity 0.18s;
}
body.glass-on .modal-wrap { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-wrap.open { opacity: 1; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s var(--ease);
}
.modal-wrap.open .modal { transform: none; }
.modal.small { width: min(430px, 100%); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 8px 22px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 8px 22px 16px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.modal-foot .grow { flex: 1; }
.modal-foot:not(:has(.grow)) { justify-content: flex-end; }
.confirm-text { margin: 4px 0 8px; font-size: 14.5px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field.check { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.field.check > span { font-size: 14px; color: var(--text); font-weight: 500; }
.field.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input { width: 90px !important; }
.inline em { font-style: normal; color: var(--muted); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); padding: 8px 11px; border-radius: 10px; background: var(--surface-2); }
.form-err { margin: 0; color: var(--red); font-weight: 600; min-height: 0; }
.form-err:empty { display: none; }
.swatches { display: flex; gap: 6px; align-items: center; height: 38px; }
.swatch input { display: none; }
.swatch i {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--s);
  border: 2px solid var(--border-strong);
  cursor: pointer;
}
.swatch input:checked + i { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--accent); }

/* ---------- Menü & Hinweise ---------- */
.popover {
  position: fixed;
  z-index: 200;
  min-width: 210px;
  padding: 6px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.14s, transform 0.18s var(--ease);
}
.popover.open { opacity: 1; transform: none; }
.popover hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
.pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.pop-item:hover { background: var(--surface-2); }
.pop-item .ic { color: var(--muted); }
.pop-item.danger { color: var(--red); }
.pop-item.danger .ic { color: var(--red); }

#toast-root {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 16px;
  border-radius: 12px;
  background: #111827;
  color: #f9fafb;
  box-shadow: var(--shadow-lg);
  font-weight: 540;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s, transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast .btn { color: #fff; height: 28px; border-color: rgba(255, 255, 255, 0.25); }
.toast .btn:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Anmeldung ---------- */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  height: 100%;
}
.login-card {
  width: min(470px, 100%);
  border-radius: 24px;
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: viewIn 0.4s var(--ease);
}
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand img { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 10px 24px -8px var(--accent); }
.login-brand h1 { font-size: 26px; letter-spacing: -0.03em; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
#login-body { display: flex; flex-direction: column; gap: 12px; }
#login-body > .muted, .form > .muted { margin: 0; }
.login-foot { color: var(--muted); font-size: 12px; margin-top: 12px; text-align: center; }

/* ---------- schmale Bildschirme ---------- */
@media (max-width: 1250px) {
  .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top-search { width: 200px; }
  .top-search:focus-within { width: 240px; }
}

@media (max-width: 900px) {
  .shell { padding: 8px; gap: 0; }
  .side {
    position: fixed;
    top: 8px;
    bottom: 8px;
    z-index: 50;
    box-shadow: var(--shadow-lg);
  }
  .side-left { left: 8px; }
  .side-right { right: 8px; }
  .shell.left-closed .side-left { width: var(--side-w); margin: 0; opacity: 0; transform: translateX(-110%); pointer-events: none; }
  .shell.right-closed .side-right { width: var(--right-w); margin: 0; opacity: 0; transform: translateX(110%); pointer-events: none; }
  .shell.left-closed .side-left .side-inner, .shell.right-closed .side-right .side-inner { transform: none; }
  .shell:not(.left-closed) .scrim, .shell:not(.right-closed) .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.35);
  }
  .edge-left, .edge-right { display: inline-grid !important; }
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-nav { grid-template-columns: 1fr; gap: 8px; }
  .week-center, .week-nav > .btn { grid-column: 1; justify-self: center; }
  .week-label { min-width: 0; }
  .day-view, .r-cols, .form.grid2 { grid-template-columns: 1fr; }
  .top-search { display: none; }
  .hide-sm { display: none; }
  .settings { grid-template-columns: 1fr; }
  .m-cell { min-height: 64px; }
  .m-chip { font-size: 10px; }
  .top-title { flex-direction: column; gap: 0; }
  .top-title h1 { font-size: 20px; }
  .plan-label { min-width: 0; }
}

@media (max-width: 520px) {
  .week-grid { grid-template-columns: 1fr; }
  .day-col { min-height: 0; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .month-grid { gap: 2px; }
  .m-cell { padding: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
