/* CAMAC PIM – Grundlayout (Farben aus den Entwürfen vom 17.11.2026) */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e2e7ee;
  --line-soft: #eef1f5;
  --text: #1d2733;
  --muted: #5a6573;
  /* Akzentfarbe – wird aus den Einstellungen überschrieben (Standard: Camavio #4499ce) */
  --accent: #4499ce;
  --accent-strong: #4499ce;
  --accent-hover: #3c87b5;
  --accent-text: #2f6b90;
  --accent-soft: #e8f2f9;
  --accent-line: #c9e0f0;
  --on-accent: #ffffff;
  --danger: #b42318;
  --ok: #2f855a;
  --radius: 12px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; left: -9999px; }

/* Kopfleiste */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 0 24px; min-height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.brand-logo { height: 28px; width: auto; display: block; }
.brand b { font-size: 16px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a, .nav span { padding: 18px 12px 16px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.nav a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.nav span { opacity: .55; cursor: default; }
.top-right { flex: 1 1 200px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }

/* Seitenaufbau */
.page { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px; }
.side { flex: 1 1 240px; max-width: 270px; display: flex; flex-direction: column; gap: 20px; }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-title { font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.narrow { max-width: 880px; margin: 0 auto; width: 100%; }

/* Knöpfe & Felder */
.btn { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-danger { color: var(--danger); }
.btn-big { height: 44px; border-radius: 10px; justify-content: center; }
.btn-link { border: 0; background: none; color: var(--accent-text); cursor: pointer; padding: 0; font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input { height: 38px; border: 1px solid #d5dce5; border-radius: 8px; padding: 0 10px; background: #fff; width: 100%; }
textarea.input { height: auto; min-height: 110px; padding: 8px 10px; resize: vertical; }
.input:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent-strong); margin: 0; }
.seg { display: inline-flex; background: #e9eef4; border-radius: 10px; padding: 3px; }
.seg a { height: 32px; padding: 0 14px; border-radius: 8px; color: var(--muted); font-weight: 500; text-decoration: none; display: flex; align-items: center; }
.seg a.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: #fff; border-radius: 5px; padding: 2px 7px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 10px; }
.flash { border-radius: 10px; padding: 10px 14px; border: 1px solid; }
.flash-ok { background: #ecf8f1; border-color: #b9e3cb; color: #1f5f3f; }
.flash-err { background: #fdeeee; border-color: #f3c3c0; color: #8a1f17; }
.flash-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }

/* Kalender-Kopf */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cal-head h1 { font-size: 20px; margin-left: 8px; }
.kw { color: var(--muted); font-size: 13px; background: #e9eef4; border-radius: 6px; padding: 3px 8px; }
.cal-head .seg { margin-left: auto; }

/* Minikalender */
.mini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; font-size: 12px; }
.mini .wd { color: var(--muted); font-weight: 500; padding: 4px 0; }
.mini a { padding: 5px 0; border-radius: 6px; text-decoration: none; color: var(--text); font-variant-numeric: tabular-nums; }
.mini a.out { color: #a3acb7; }
.mini a.inweek { background: var(--accent-soft); }
.mini a.today { background: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.mini a:hover { outline: 1px solid var(--accent); }

.cal-list { display: flex; flex-direction: column; gap: 14px; }
.cal-group { display: flex; flex-direction: column; gap: 4px; }
.cal-item { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.cal-item .name { flex: 1; }
.lock { color: var(--muted); }

/* Woche als Agenda */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
@media (max-width: 1180px) { .week { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.day { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px 10px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.day-head .wd { font-weight: 600; }
.day.weekend .day-head .wd { color: var(--muted); }
.day-head .date { font-size: 12px; color: var(--muted); }
.day.today .day-head .date { color: var(--on-accent); background: var(--accent-strong); border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.day-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.day-empty { color: var(--muted); font-size: 13px; padding: 6px 4px; }
.ev { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); text-decoration: none; color: var(--text); }
.ev:hover { background: #eef3f8; }
.ev .bar { width: 4px; border-radius: 2px; flex: 0 0 4px; align-self: stretch; }
.ev .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev .time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev .title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ev .meta { font-size: 12px; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.ev.tentative { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #f1f4f8 6px, #f1f4f8 12px); border: 1px dashed #b9c4d0; }
.ev.cancelled .title { text-decoration: line-through; color: var(--muted); }
.tag-tent { font-size: 11px; color: var(--muted); font-weight: 500; }
.join { align-self: flex-start; margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 3px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 12px; font-weight: 500; text-decoration: none; }
.join .pm { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.join.soon { height: 28px; border: 0; color: #fff; font-weight: 600; }
.join.soon .pm { background: rgba(255,255,255,.22) !important; }

/* Monat */
.month { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.month-inner { min-width: 760px; }
.m-head, .m-week { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); }
.m-head { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.m-head span { padding: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.m-head span:first-child { text-align: center; padding: 10px 0; font-size: 11px; }
.m-week { border-bottom: 1px solid var(--line-soft); min-height: 124px; }
.m-kw { grid-column: 1; grid-row: 1 / -1; text-align: center; padding-top: 8px; font-size: 12px; color: var(--muted); background: var(--surface-2); border-right: 1px solid var(--line-soft); text-decoration: none; }
.m-day { grid-row: 1 / -1; border-right: 1px solid var(--line-soft); padding: 6px 8px; text-decoration: none; color: var(--text); font-size: 12px; font-weight: 500; }
.m-day.out { background: #fafbfc; color: #8f99a5; }
.m-day.weekend { background: #fbfcfd; }
.m-day.today span { display: inline-block; color: var(--on-accent); background: var(--accent-strong); border-radius: 6px; padding: 1px 7px; font-weight: 600; }
.m-day:hover { background: #f3f7fb; }
.m-bar { margin: 1px 4px; height: 21px; line-height: 21px; padding: 0 8px; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; text-decoration: none; }
.m-bar:hover { filter: brightness(1.06); }
.m-bar.tentative { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.32) 0 5px, transparent 5px 10px) !important; }
.m-bar.cancelled { text-decoration: line-through; opacity: .6; }
.m-more { margin: 0 8px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; z-index: 1; align-self: center; }

/* Termin-Detail & Formulare */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 16px rgba(16,24,40,.05); }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); }
.panel-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line-soft); background: #fafbfc; border-radius: 0 0 14px 14px; }
.meeting { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.meeting .logo { width: 36px; height: 36px; border-radius: 8px; color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.meeting .info { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.days-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.days-pick label { display: inline-flex; }
.days-pick input { position: absolute; opacity: 0; }
.days-pick span { width: 36px; height: 32px; border-radius: 8px; border: 1px solid #d5dce5; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }
.days-pick input:checked + span { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.color-input { width: 44px; height: 34px; padding: 2px; border: 1px solid #d5dce5; border-radius: 8px; background: #fff; }

/* Mail */
.mail { display: flex; flex-wrap: wrap; min-height: calc(100vh - 57px); align-items: stretch; }
.mail-side { flex: 1 1 230px; max-width: 260px; padding: 18px 14px; display: flex; flex-direction: column; gap: 20px; border-right: 1px solid var(--line); background: var(--surface-2); }
.fold-list { display: flex; flex-direction: column; gap: 2px; }
.fold { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.fold:hover { background: #eaeff5; }
.fold.on { background: var(--accent-soft); font-weight: 600; }
.fold.sub { min-height: 30px; font-size: 13px; }
.fold .grow { flex: 1; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 8px; }
.cnt { font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--accent-strong); border-radius: 10px; padding: 1px 7px; }
.cnt.soft { background: #e1e7ee; color: var(--muted); }
.mail-list { flex: 1 1 360px; max-width: 470px; min-width: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.mail-search { display: flex; padding: 12px 12px 0; }
.mail-tabs { display: flex; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); }
.mail-tabs a, .mail-tabs span { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; text-decoration: none; }
.mail-tabs .on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.mrow { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.mrow:hover { background: #f7fafc; }
.mrow.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.av { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.av.big { width: 40px; height: 40px; flex-basis: 40px; }
.av.img { background: #fff; border: 1px solid var(--line); overflow: hidden; }
.av.img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.av.img.photo img { object-fit: cover; padding: 0; }
.av.img:not(.photo) { border-radius: 9px; }
.av.img:not(.photo) img { padding: 2px; }
.mbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mline { display: flex; gap: 8px; align-items: baseline; }
.mline .from { flex: 1; min-width: 0; font-weight: 500; }
.mrow.unseen .from { font-weight: 700; }
.mrow.unseen .subj { font-weight: 600; }
.when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.subj { font-size: 13.5px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; }
.tgt { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.chip.rule { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.chip.inv { background: #eef1f5; color: var(--text); font-weight: 500; }
.mail-read { flex: 999 1 480px; min-width: 0; padding: 20px 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.read-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.read-tools form { margin: 0; }
.input.slim { height: 36px; width: auto; min-width: 130px; }
.read-head { display: flex; flex-direction: column; gap: 10px; }
.read-head h1 { font-size: 21px; }
.sender { display: flex; gap: 12px; align-items: center; }
.prio-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prio-line form { margin: 0; }
.invite { background: #fff; border: 1px solid var(--accent-line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.cal-badge { width: 52px; flex: 0 0 52px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-align: center; }
.cal-badge span { display: block; background: var(--accent-strong); color: var(--on-accent); font-size: 11px; font-weight: 600; padding: 3px 0; }
.cal-badge b { display: block; font-size: 20px; padding: 4px 0; }
.mail-frame { width: 100%; border: 0; min-height: 60px; background: #fff; border-radius: 8px; }
.att-list { display: flex; flex-wrap: wrap; gap: 10px; }
.att { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); max-width: 300px; }
.att:hover { border-color: var(--accent); }
.att-ico { width: 34px; height: 40px; flex: 0 0 34px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.back-link { display: none; text-decoration: none; }
@media (max-width: 900px) {
  .mail-side { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .mail-list { max-width: none; flex-basis: 100%; }
  .mail.reading .mail-side, .mail.reading .mail-list { display: none; }
  .mail:not(.reading) .mail-read { display: none; }
  .back-link { display: inline; }
  .mail-read { padding: 14px; }
}

/* Anmeldung */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .panel { width: 100%; max-width: 380px; }

@media (max-width: 700px) {
  .page { padding: 14px; gap: 14px; }
  .side { max-width: none; order: 2; }
  .cal-head .seg { margin-left: 0; }
  .top { gap: 10px; padding: 0 12px; }
  .nav a, .nav span { padding: 14px 8px 12px; }
  .kv { grid-template-columns: 1fr; }
}

/* Schreiben */
.compose-page { padding: 24px; }
.compose-page .narrow { max-width: 960px; }
.c-fields { padding: 8px 24px 4px; display: flex; flex-direction: column; }
.c-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.c-row > span, .c-row > label { flex: 0 0 64px; font-size: 13px; font-weight: 500; color: var(--muted); }
.c-row > .input, .c-row > select.input { flex: 1 1 auto; border-color: transparent; padding-left: 4px; }
.c-row > .input:hover, .c-addr .input:hover { border-color: #d5dce5; }
.c-addr { flex: 1 1 auto; position: relative; min-width: 0; }
.c-addr .input { border-color: transparent; padding-left: 4px; }
.c-hint { margin: 2px 0 4px 76px; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 40px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(16,24,40,.14); overflow: hidden; }
.suggest .sg { padding: 8px 12px; cursor: pointer; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .sg.on, .suggest .sg:hover { background: var(--accent-soft); }
.c-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px 20px; border-bottom: 1px solid var(--line-soft); background: #fafbfc; }
.c-toolbar button { min-width: 34px; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.c-toolbar button:hover { background: #e9eef4; }
.c-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.c-editor { min-height: 260px; padding: 18px 24px; outline: none; line-height: 1.5; color: #1d2733; overflow-wrap: anywhere; }
.c-editor p, .c-sigprev p, .sig-mini p { margin: 0 0 10px; }
.c-editor img, .c-sigprev img, .sig-mini img { max-width: 100%; height: auto; }
.c-editor blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid #d5dce5; color: #5a6573; }
.c-editor:focus { box-shadow: inset 0 0 0 2px var(--accent-line); }
.c-sig { display: flex; align-items: center; gap: 10px; padding: 8px 24px 0; border-top: 1px dashed var(--line); }
.c-sigprev { padding: 10px 24px 14px; color: #1d2733; line-height: 1.5; opacity: .9; }
.c-sigprev:empty { display: none; }
.c-quote { margin: 0 24px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-2); }
.c-quote > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.c-quote > summary::-webkit-details-marker { display: none; }
.c-quote[open] > summary .muted { visibility: hidden; }
.c-quote-body { padding: 0 16px 14px; font-size: 13px; line-height: 1.5; max-height: 420px; overflow: auto; overflow-wrap: anywhere; }
.c-quote-body blockquote { margin: 0; padding-left: 12px; border-left: 3px solid #d5dce5; color: #5a6573; }
.c-quote-body img { max-width: 100%; }
.c-atts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 24px 16px; border-top: 1px solid var(--line-soft); }
.c-atts .att-list { flex-basis: 100%; }
.c-atts .att-list:empty { display: none; }
label.att { cursor: pointer; }
.sig-mini { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: #1d2733; line-height: 1.5; max-height: 220px; overflow: hidden; }
.invite-answer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.invite-answer details { flex-basis: 100%; }
@media (max-width: 640px) {
  .compose-page { padding: 0; }
  .compose-page .panel { border-radius: 0; border-left: 0; border-right: 0; }
  .c-fields, .c-editor, .c-sigprev, .c-atts { padding-left: 14px; padding-right: 14px; }
  .c-row > span, .c-row > label { flex-basis: 48px; }
  .c-hint { margin-left: 0; }
  .c-quote { margin: 0 14px 14px; }
}

/* Feiertage */
:root { --hol: #c0392b; --karneval: #b7791f; }
.day-head .wd .hol { display: block; font-size: 11px; font-weight: 600; margin-top: 2px; }
.day.hol-legal .day-head .hol { color: var(--hol); }
.day.hol-legal .day-head { background: #fdf3f2; }
.day.hol-half .day-head .hol, .day.hol-info .day-head .hol { color: var(--muted); font-weight: 500; }
.day.hol-karneval .day-head .hol { color: var(--karneval); }
.day.hol-karneval .day-head { background: #fdf8ec; }
.day-head .wd { display: flex; flex-direction: column; }
.m-day { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.m-day .hol { font-style: normal; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.m-day.hol-legal { background: #fdf6f5; }
.m-day.hol-legal .hol, .m-day.hol-legal > span:first-child { color: var(--hol); }
.m-day.hol-half .hol, .m-day.hol-info .hol { color: var(--muted); font-weight: 500; }
.m-day.hol-karneval { background: #fdf9ef; }
.m-day.hol-karneval .hol { color: var(--karneval); }
.m-day.out .hol { opacity: .6; }
.m-day.today.hol-legal > span:first-child { color: var(--on-accent); }
.mini a.hol-legal { color: var(--hol); font-weight: 600; }
.mini a.hol-karneval { color: var(--karneval); font-weight: 600; }
.mini a.hol-legal.today, .mini a.hol-karneval.today { color: var(--on-accent); }
/* Sprungziele nicht unter der fixierten Leiste verstecken */
html { scroll-padding-top: 72px; }
.set-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.set-nav a { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.set-nav a:hover { border-color: var(--accent); color: var(--accent-text); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.btn-ok { color: var(--ok); border-color: #b7dfc7; }
.filter-note { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.att.locked { opacity: .6; cursor: not-allowed; }
.mail-tabs form { align-self: center; margin: 0 0 4px; }
.slim-btn { height: 30px; padding: 0 10px; font-size: 13px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 2px; max-width: 340px; padding: 12px 16px; border-radius: 12px; background: #1d2733; color: #fff; text-decoration: none; box-shadow: 0 12px 30px rgba(16,24,40,.25); }
.toast span { font-size: 13px; opacity: .85; }
.toast + .toast { bottom: 96px; }
.file-sel { border-color: var(--accent-line); color: var(--accent-text); font-weight: 600; }

/* Aufgaben */
.tasks .mail-list { max-width: 560px; flex-basis: 420px; }
.tquick { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.tquick.sub { padding: 8px 0 0; border-bottom: 0; }
.tplus { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: 1.5px dashed var(--line); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; }
.tquick .input { border-color: transparent; background: var(--surface-2); }
.tquick .input:focus { background: #fff; }
.tgroup { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 6px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.tgroup.late { color: var(--danger); }
.tgroup.done-head a { color: var(--muted); text-decoration: none; }
.trow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.trow:hover { background: #f7fafc; }
.trow.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.trow.child { padding-left: 46px; }
.tcheck-form { margin: 0; }
.tcheck { --c: var(--accent); width: 22px; height: 22px; flex: 0 0 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--c); background: #fff; color: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .15s, color .15s; }
.tcheck:hover { color: var(--c); }
.tcheck.big { width: 30px; height: 30px; flex-basis: 30px; }
.trow.done .tcheck, .tcheck.on { background: var(--c); color: #fff; }
.trow.done .ttitle { text-decoration: line-through; color: var(--muted); }
.tbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text); }
.ttitle { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.ttitle .prio { color: var(--danger); margin-right: 5px; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.tmeta .chip { font-size: 11px; padding: 1px 7px; }
.tdue.late { color: var(--danger); font-weight: 600; }
.tlist { display: inline-flex; align-items: center; gap: 5px; }
.tdetail { display: flex; flex-direction: column; gap: 14px; }
.tdetail-head { display: flex; align-items: center; gap: 12px; }
.ttitle-in { font-size: 18px; font-weight: 600; height: 44px; }
.ttitle-in.is-done { text-decoration: line-through; color: var(--muted); }
.tsubs { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.tsubs .trow.child { padding-left: 4px; border-bottom: 0; }

/* Kontakte */
.contacts .mail-list { max-width: 420px; }
.cletter { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: var(--accent-text); background: var(--surface-2); border-bottom: 1px solid var(--line-soft); position: sticky; top: 57px; z-index: 1; }
.crow { align-items: center; padding: 9px 14px; }
.crow .mline { justify-content: flex-start; gap: 8px; }
.crow .chip { font-size: 11px; padding: 1px 7px; }
.chead { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.av.cbig { width: 84px; height: 84px; flex: 0 0 84px; font-size: 28px; }
.cdl { grid-template-columns: 170px 1fr; row-gap: 10px; }
.cdl dd { overflow-wrap: anywhere; }
.cmail { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.cform { display: flex; flex-direction: column; gap: 14px; }
.cset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.cset legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.crow-edit { flex-wrap: nowrap; align-items: center; }
.crow-edit.adr { flex-wrap: wrap; }
.crow-edit .input.slim { flex: 0 0 140px; min-width: 0; }
.crow-edit .input:not(.slim) { flex: 1 1 auto; }
.cset [data-add-row] { align-self: flex-start; }

/* Heute */
.today-page { flex-direction: column; max-width: 1400px; margin: 0 auto; width: 100%; }
.today-head h1 { font-size: 24px; margin: 0 0 2px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.today-list { gap: 6px; }
.hev { --c: var(--accent); display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; border-left: 4px solid var(--c); background: var(--surface-2); text-decoration: none; color: var(--text); }
.hev:hover { background: #eef3f8; }
.hev.past { opacity: .5; }
.hev.now { box-shadow: 0 0 0 2px var(--accent-line); background: var(--accent-soft); }
.hev.tentative { border-left-style: dashed; }
.hev-time { flex: 0 0 92px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.hev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hev-title { font-weight: 600; overflow-wrap: anywhere; }
.htask { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.htask form { margin: 0; }
.hmail { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.hmail .mbody { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hmail .mline { display: flex; justify-content: space-between; gap: 8px; }
.hmail .from { font-weight: 600; }
.hol-legal-txt { color: var(--hol); font-weight: 600; }
.hol-karneval-txt { color: var(--karneval); font-weight: 600; }
.caltask { display: flex; align-items: flex-start; gap: 8px; padding: 4px 2px 6px; font-size: 13px; border-bottom: 1px dashed var(--line-soft); }
.caltask form { margin: 0; }
.caltask a { color: var(--text); text-decoration: none; line-height: 1.35; }
.caltask a.late { color: var(--danger); }
.tcheck.sm { width: 16px; height: 16px; flex-basis: 16px; border-width: 1.6px; }
.m-day .mtask { font-style: normal; font-size: 11px; color: var(--accent-text); margin-left: auto; white-space: nowrap; }
.top-search input { height: 34px; width: 210px; border: 1px solid var(--line); border-radius: 17px; padding: 0 14px 0 32px; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6573' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center; transition: width .2s; }
.top-search input:focus { width: 280px; outline: 2px solid var(--accent); background-color: #fff; }
.search-page { flex-direction: column; max-width: 1400px; margin: 0 auto; width: 100%; }
.search-big { display: flex; gap: 10px; max-width: 760px; }
.sres { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); min-width: 0; }
.sres b { font-weight: 600; }
@media (max-width: 700px) { .top-search input { width: 120px; } .top-search input:focus { width: 170px; } }

/* ---------- Handy: Seitenleiste als Schublade, kompakte Wochenansicht ---------- */
.drawer-btn, .fab, .drawer-bg, .mini-cell, .wd-s, .tshort, .h-s, .drawer-close { display: none; }
@media (max-width: 900px) {
  .mail-side, .page > .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: min(320px, 86vw); max-width: none; flex-basis: auto; order: 0;
    background: var(--surface, #fff); overflow-y: auto; padding: 14px;
    border: 0; border-right: 1px solid var(--line); box-shadow: 4px 0 24px rgba(15, 30, 50, .18);
    transform: translateX(-105%); transition: transform .22s ease; visibility: hidden;
  }
  body.drawer-open .mail-side, body.drawer-open .page > .side { transform: none; visibility: visible; }
  .drawer-bg { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(15, 25, 40, .38); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.drawer-open .drawer-bg { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }
  .drawer-close { display: flex; justify-content: flex-end; margin: -4px -4px 6px; }
  .drawer-btn { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; max-width: 46vw; }
  .drawer-btn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mob-bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px 0; }
  .mob-bar .mail-search { flex: 1; padding: 0 !important; border: 0; }
  .fab { display: flex; position: fixed; right: 18px; bottom: 22px; z-index: 60; width: 56px; height: 56px; border-radius: 18px; align-items: center; justify-content: center; background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 6px 18px rgba(15, 30, 50, .28); text-decoration: none; }
  .mail.reading ~ .fab, body.drawer-open .fab { display: none; }
}
@media (max-width: 700px) {
  .page { padding: 8px; gap: 8px; }
  .cal-head { gap: 6px; }
  .cal-head h1 { font-size: 17px; margin-left: 2px; }
  .cal-head .h-l { display: none; }
  .cal-head .h-s { display: inline; }
  .cal-head .kw { font-size: 12px; }
  .cal-head .seg { margin-left: auto; }
  .cal-head .seg a { padding: 5px 9px; font-size: 13px; }
  .legend { display: none; }

  .week {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr)); grid-auto-flow: column;
    gap: 0; height: calc(100dvh - 190px); min-height: 420px;
    border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
  }
  .week .day { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
  .week .day:nth-child(-n+4) { border-right: 1px solid var(--line); }
  .week .day:nth-child(4), .week .day:nth-child(8) { border-bottom: 0; }
  .week .day.weekend { background: #f3f4f6; }
  .week .day.today { box-shadow: inset 0 0 0 2px var(--accent); }
  .week .day-head { padding: 4px 6px 2px; border: 0; justify-content: flex-start; }
  .week .day-head .date, .week .wd-l { display: none; }
  .week .wd-s { display: inline; font-size: 13px; }
  .week .day.today .wd-s { color: var(--on-accent); background: var(--accent-strong); border-radius: 5px; padding: 0 5px; }
  .week .day.sun .wd, .week .day.hol-legal .wd { color: var(--hol); }
  .week .day-head .wd .hol { display: inline; font-size: 10px; margin: 0 0 0 5px; font-weight: 500; }
  .week .day-body { gap: 1px; padding: 0 5px 4px; overflow: hidden; flex: 1; min-height: 0; }
  .week .day-empty { display: none; }
  .week .ev { display: block; padding: 0; background: none; border-radius: 0; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c); }
  .week .ev .bar, .week .ev .time, .week .ev .meeting-chip, .week .ev .chip { display: none; }
  .week .ev .body { display: inline; }
  .week .ev .tshort { display: inline; color: var(--c); font-variant-numeric: tabular-nums; margin-right: 4px; }
  .week .ev .tshort:empty { display: none; }
  .week .ev .tshort .rec { opacity: .75; }
  .week .ev .title { display: inline; font-weight: 600; color: var(--c) !important; }
  .week .ev .meta { display: inline; color: #8a95a3; margin-left: 4px; font-size: 11px; }
  .week .ev.allday { background: var(--c); color: #fff; border-radius: 3px; padding: 0 4px; }
  .week .ev.allday .title { color: #fff !important; }
  .week .ev.allday .meta { color: rgba(255,255,255,.8); }
  .week .ev.cancelled .title { text-decoration: line-through; }
  .week .caltask { font-size: 12px; gap: 4px; padding: 0; white-space: nowrap; overflow: hidden; }
  .week .caltask a { overflow: hidden; text-overflow: ellipsis; }
  .week .mini-cell { display: flex; padding: 4px 4px 2px; background: #fff !important; }
  .mini-cell .mini-head { font-size: 12px; font-weight: 600; text-align: center; margin-bottom: 1px; }
  .mini-cell .mini { font-size: 10.5px; gap: 0; }
  .mini-cell .mini .wd { padding: 0; }
  .mini-cell .mini a { padding: 1px 0; border-radius: 4px; }
}
.m-plus { display: none; }
@media (max-width: 900px) { .m-plus { display: inline-flex; } }
.week .mini-cell { display: none; }
@media (max-width: 700px) {
  .top { gap: 0 8px; padding: 6px 10px 0; min-height: 0; }
  .brand { order: 1; }
  .brand b { display: none; }
  .top-right { order: 2; margin-left: auto; gap: 6px; }
  .top-right .icon-btn { width: 34px; height: 34px; }
  .top-search input { width: 104px; }
  .top-search input:focus { width: 150px; }
  .nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 0; justify-content: space-between; scrollbar-width: none; }
  .nav a, .nav span { padding: 10px 6px 9px; font-size: 15px; white-space: nowrap; }
  .week { align-items: stretch; height: calc(100dvh - 150px); }
  .week .mini-cell { display: flex; flex-direction: column; }
  .cal-head { flex-wrap: nowrap; }
  .cal-head .kw { display: none; }
  .cal-head .h-s small { font-size: 12px; font-weight: 500; color: var(--muted); }
  .cal-head h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
  .cal-head .seg { display: none; }
  .cal-head .btn { padding: 0 10px; }
}
.drawer-close .drawer-seg { margin: 0 auto 0 0; }
@media (max-width: 700px) {
  .month { border-radius: 10px; }
  .month-inner { min-width: 0; }
  .m-head, .m-week { grid-template-columns: 20px repeat(7, minmax(0, 1fr)); }
  .m-head span { padding: 6px 2px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-head span:first-child { font-size: 0; }
  .m-kw { font-size: 10px; padding-top: 4px; }
  .m-week { min-height: 84px; }
  .m-day { padding: 3px 3px; font-size: 11px; }
  .m-bar { margin: 1px 1px; height: 16px; line-height: 16px; padding: 0 3px; font-size: 10px; border-radius: 3px; }
  .m-more { margin: 0 2px; font-size: 10px; }
}

/* Kontakte ergänzen */
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.pic { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-width: 0; }
.pic input { position: absolute; opacity: 0; }
.pic-img { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.pic-img img { width: 100%; height: 100%; object-fit: cover; }
.pic-from { font-size: 12px; font-weight: 600; }
.pic:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.enrich { display: flex; flex-direction: column; gap: 14px; }
.en-row { border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.en-row legend { font-weight: 600; padding: 0 4px; }
.en-opt { display: flex; gap: 10px; align-items: flex-start; }
.en-opt > input { margin-top: 9px; }
.en-opt .input { width: 100%; }
.en-src { display: block; margin-top: 2px; }

/* Aufgabenlisten einstellen */
.tl-set { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tl-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 30px 30px 20px; align-items: center; gap: 4px; }
.tl-row > input { justify-self: center; margin: 0; }
.tl-row a { text-decoration: none; justify-self: center; }
.tl-headrow { font-size: 11px; }
.tl-headrow span:nth-child(3), .tl-headrow span:nth-child(4) { text-align: center; }
.tl-row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* Handy: Speichern-Knöpfe bleiben am unteren Rand sichtbar */
@media (max-width: 900px) {
  .sticky-actions {
    position: sticky; bottom: 0; z-index: 30;
    background: var(--surface, #fff);
    margin-left: -14px; margin-right: -14px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 14px rgba(15, 30, 50, .07);
  }
  .panel-foot.sticky-actions { margin: 0; border-radius: 0 0 12px 12px; }
  .sticky-actions .btn { min-height: 42px; }
}

/* Ordnerbäume ein-/ausklappen */
.tw { flex: 0 0 18px; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--muted); cursor: pointer; margin-right: -4px; }
.tw::before { content: ''; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
.tw.open::before { transform: rotate(90deg); }
.tw.none { cursor: default; }
.tw.none::before { display: none; }
.tw:hover:not(.none) { background: var(--line-soft); color: var(--text); }
.fold.tree-hidden { display: none !important; }
.tree-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 12px 10px 4px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.tree-head::before { content: ''; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transform: rotate(90deg); transition: transform .15s; }
.tree-head.closed::before { transform: none; }
.tree-tools { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.tree-tools span { cursor: pointer; }
.tree-tools span:hover { text-decoration: underline; }
.tree-head.closed .tree-tools { display: none; }

/* Handy-Woche: Text schwarz, Farbe als Quadrat davor; Ganztägiges mit passender Schriftfarbe */
@media (max-width: 700px) {
  .week .ev, .week .ev .tshort, .week .ev .title { color: var(--text) !important; }
  .week .ev .tshort { color: var(--muted) !important; }
  .week .ev:not(.allday)::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 4px; vertical-align: 1px; }
  .week .ev.allday, .week .ev.allday .title { color: var(--fg) !important; }
  .week .ev.allday .meta { color: var(--fg) !important; opacity: .75; }
  .week .ev.tentative:not(.allday)::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
}
