/* collai Cloud – Designsystem 2 (Collai/.claude/skills/collai-design/SKILL.md, ADR-168), Erscheinungsbilder Hell/Dunkel/Farbig.
   Aufbau wie collai am Mac: Bereiche stehen frei auf dem Arbeitsplatz-Grund, nur Kacheln tragen Flächen (Rollen standard,
   subdued, prominent, glass). Kein Blau, Markenverlauf nur für die primäre Aktion, Fortschritt und Fokus. */

/* ==================== Grundwerte ==================== */
:root,
body[data-look="hell"] {
  color-scheme: light;
  --bg-top: #ECECEA;
  --bg-bottom: #DCDCD8;
  --watermark: rgba(60, 60, 70, 0.07);

  --tile: rgba(251, 251, 249, 0.92);
  --tile-border: rgba(0, 0, 0, 0.06);
  --tile-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  --subdued: rgba(234, 234, 230, 0.72);
  --prominent: #17181B;
  --on-prominent: #F5F5F7;
  --glass: rgba(251, 251, 249, 0.82);
  --glass-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);

  --text-primary: #1D1D1F;
  --text-secondary: #48484C;
  --text-tertiary: #646469;
  --fill: rgba(0, 0, 0, 0.06);
  --fill-hover: rgba(0, 0, 0, 0.09);
  --control: rgba(255, 255, 255, 0.72);
  --control-border: rgba(0, 0, 0, 0.06);
  --selection: #FFFFFF;
  --selection-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --field: rgba(255, 255, 255, 0.78);

  --brand: #7A4FE0;
  --brand-gradient: linear-gradient(135deg, #7A4FE0 0%, #5B36C2 100%);
  --brand-soft: rgba(122, 79, 224, 0.14);
  --glow: linear-gradient(90deg, #7A4FE0 0%, #DB6A4B 100%);
  --focus: rgba(122, 79, 224, 0.55);
  --success: #1F8A5E;
  --danger: #C8281E;
  --now: #C8281E;
}

body[data-look="dunkel"] {
  color-scheme: dark;
  --bg-top: #121214;
  --bg-bottom: #1A1A1D;
  --watermark: rgba(255, 255, 255, 0.045);

  --tile: rgba(31, 32, 36, 0.94);
  --tile-border: rgba(255, 255, 255, 0.07);
  --tile-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  --subdued: rgba(23, 24, 27, 0.7);
  --prominent: #35363D;
  --glass: rgba(30, 31, 37, 0.86);
  --glass-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);

  --text-primary: #F5F5F7;
  --text-secondary: #C7C7CC;
  --text-tertiary: #9C9CA2;
  --fill: rgba(255, 255, 255, 0.08);
  --fill-hover: rgba(255, 255, 255, 0.12);
  --control: rgba(255, 255, 255, 0.07);
  --control-border: rgba(255, 255, 255, 0.07);
  --selection: rgba(255, 255, 255, 0.13);
  --selection-shadow: none;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --field: rgba(255, 255, 255, 0.07);
  --brand: #A68BFF;
  --brand-soft: rgba(166, 139, 255, 0.18);
  --now: #F06A5E;
}

body[data-look="farbig"] {
  color-scheme: dark;
  --bg-top: #2A1E4A;
  --bg-bottom: #160F2A;
  --watermark: rgba(255, 255, 255, 0.05);

  --tile: rgba(34, 29, 46, 0.82);
  --tile-border: rgba(255, 255, 255, 0.08);
  --tile-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
  --subdued: rgba(34, 29, 46, 0.62);
  --prominent: #141318;
  --glass: rgba(34, 27, 52, 0.88);
  --glass-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);

  --text-primary: #F5F5F7;
  --text-secondary: #CFCADB;
  --text-tertiary: #A39DB3;
  --fill: rgba(255, 255, 255, 0.08);
  --fill-hover: rgba(255, 255, 255, 0.13);
  --control: rgba(255, 255, 255, 0.08);
  --control-border: rgba(255, 255, 255, 0.08);
  --selection: rgba(255, 255, 255, 0.14);
  --selection-shadow: none;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --field: rgba(255, 255, 255, 0.08);
  --brand: #A68BFF;
  --brand-soft: rgba(166, 139, 255, 0.2);
  --now: #F06A5E;
}

:root {
  --radius-tile: 22px;
  --radius-compact: 18px;
  --radius-inner: 12px;
  --space-tile: 20px;
  --micro: 150ms ease-out;
  --content: 260ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --dock-w: 112px;
  --top-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  font: 14px/1.45 var(--font);
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-color: var(--bg-bottom);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.collai-icon { flex-shrink: 0; display: block; }

/* Grund: blasses Halbton-Zeichen in der Mitte, unten der Violett→Koralle-Schein (wie am Mac). */
.collai-bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.collai-bg-mark {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(62vh, 640px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: var(--watermark);
  -webkit-mask: url(assets/zeichen-xl-maske.svg) center / contain no-repeat;
  mask: url(assets/zeichen-xl-maske.svg) center / contain no-repeat;
}

.collai-bottom-glow {
  position: absolute;
  left: 50%;
  bottom: -60px;
  width: 70%;
  height: 120px;
  transform: translateX(-50%);
  background: var(--glow);
  filter: blur(46px);
  opacity: 0.28;
}

body[data-look="farbig"] .collai-bottom-glow { opacity: 0.4; }

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

/* ==================== Gerüst ==================== */
.collai-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px 0 calc(var(--dock-w) + 8px);
  z-index: 20;
}

.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-right { justify-content: flex-end; }

.brand-mark {
  /* Mittig über der linken Leiste und mittig in der Höhe der oberen Leiste. */
  position: fixed;
  left: calc(var(--dock-w) / 2 - 17px);
  top: calc(var(--top-h) / 2 - 17px);
  z-index: 21;
  width: 34px;
  height: 34px;
  background: url(assets/zeichen-s-hell.svg) center / contain no-repeat;
}

body[data-look="dunkel"] .brand-mark,
body[data-look="farbig"] .brand-mark { background-image: url(assets/zeichen-s-dunkel.svg); }

/* Runde Knöpfe (obere Leiste, Dock, Werkzeuge) */
.round-btn,
.dock-item-btn,
.icon-action-btn,
.counter-btn,
.btn-tool-icon,
.mini-nav-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--control-border);
  background: var(--control);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--micro), transform var(--micro);
}

.round-btn:hover,
.dock-item-btn:hover,
.icon-action-btn:hover,
.counter-btn:hover,
.btn-tool-icon:hover,
.mini-nav-btn:hover { background: var(--fill-hover); }

.round-btn:active,
.dock-item-btn:active,
.counter-btn:active,
.btn-tool-icon:active { transform: scale(0.97); }

.counter-btn.active,
.dock-item-btn.active {
  background: var(--selection);
  box-shadow: var(--selection-shadow);
}

.counter-btn .collai-icon,
.round-btn .collai-icon,
.btn-tool-icon .collai-icon { width: 18px; height: 18px; }

.btn-tool-icon { width: 40px; height: 40px; }
.mini-nav-btn { width: 30px; height: 30px; border: none; background: transparent; }
.mini-nav-btn .collai-icon { width: 14px; height: 14px; }

.btn-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.btn-badge-static {
  position: static;
  display: inline-block;
}

/* Person-Pille */
.user-pill-btn {
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 4px 4px;
  border-radius: 22px;
  border: 1px solid var(--control-border);
  background: var(--control);
  font-weight: 500;
  transition: background var(--micro);
}

.user-pill-btn:hover { background: var(--fill-hover); }

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--prominent);
  color: var(--on-prominent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}

/* Firmen-Bubble */
.org-bubble-wrap { position: relative; }

.org-bubble-btn,
.status-capsule {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 6px;
  border-radius: 20px;
  border: 1px solid var(--control-border);
  background: var(--control);
  font-weight: 500;
}

.status-capsule { padding: 0 14px; color: var(--text-secondary); }

.org-bubble-btn:hover { background: var(--fill-hover); }

.org-badge-kurz {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.dropdown-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  padding: 6px;
  border-radius: var(--radius-compact);
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid var(--tile-border);
  box-shadow: var(--glass-shadow);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--micro), transform var(--micro);
}

.dropdown-menu-popover.open { opacity: 1; transform: none; pointer-events: auto; }

.org-item-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.org-item-select-btn:hover { background: var(--fill); }
.org-item-select-btn.active { background: var(--selection); box-shadow: var(--selection-shadow); }
.org-item-left { display: flex; align-items: center; gap: 10px; }

.org-menu-role-hint {
  padding: 8px 10px 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.profile-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border-subtle);
}

/* Dock links */
.collai-dock {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--dock-w);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 96px 0 24px;
  z-index: 15;
}

.dock-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.dock-item-btn { width: 52px; height: 52px; }
.dock-item-btn .collai-icon { width: 20px; height: 20px; }

.dock-divider {
  width: 28px;
  height: 1px;
  background: var(--border-subtle);
}

.collai-workspace {
  position: absolute;
  top: var(--top-h);
  left: var(--dock-w);
  right: 0;
  bottom: 0;
}

.collai-view-container { position: relative; height: 100%; }

.collai-view {
  position: absolute;
  inset: 0;
  display: none;
  padding: 6px 20px 20px 22px;
  gap: 24px;
}

.collai-view.active-view {
  display: grid;
  animation: bereich var(--content) both;
}

@keyframes bereich { from { opacity: 0; transform: translateY(6px); } }

/* ==================== Bausteine ==================== */
.tile {
  background: var(--tile);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius-tile);
  box-shadow: var(--tile-shadow);
}

.tile-subdued,
.collai-tile-subdued {
  background: var(--subdued);
  border-radius: var(--radius-tile);
}

.btn-primary-action {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: none;
  border-radius: 22px;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 15px;
  transition: filter var(--micro), opacity var(--micro);
}

.btn-primary-action:hover { filter: brightness(0.92); }
.btn-primary-action:active { filter: brightness(0.85); }
.btn-primary-action:disabled { opacity: 0.4; cursor: default; filter: none; }
.btn-primary-action .collai-icon { width: 17px; height: 17px; }
.btn-primary-compact { height: 40px; padding: 0 18px; font-size: 14px; }

.btn-secondary-action {
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px solid var(--control-border);
  background: var(--control);
  font-weight: 500;
  transition: background var(--micro);
}

.btn-secondary-action:hover { background: var(--fill-hover); }
.btn-secondary-action:disabled { opacity: 0.4; cursor: default; }
.btn-secondary-compact { height: 34px; padding: 0 14px; font-size: 13px; }

.btn-plain {
  border: none;
  background: none;
  padding: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.collai-search-field {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid var(--control-border);
  background: var(--field);
  color: var(--text-tertiary);
}

.collai-search-field:focus-within { box-shadow: 0 0 0 2px var(--focus); }

.collai-search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
}

.collai-search-field input::placeholder { color: var(--text-tertiary); }
.collai-search-field input::-webkit-search-cancel-button { opacity: 0.5; }

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border-radius: 18px;
  background: var(--fill);
}

.seg-btn {
  height: 30px;
  padding: 0 16px;
  border: none;
  border-radius: 15px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  transition: background var(--micro), color var(--micro);
}

.seg-btn.active {
  background: var(--selection);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field-input,
.event-input-small,
.event-select-small,
.event-notes-textarea {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-subtle);
  background: var(--field);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.form-field-input:focus,
.event-input-small:focus,
.event-select-small:focus,
.event-notes-textarea:focus { box-shadow: 0 0 0 2px var(--focus); }

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.flex-1 { flex: 1; }

.collai-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.18);
  animation: blende var(--micro) both;
}

@keyframes blende { from { opacity: 0; } }

.glass-card,
.event-modal-card,
.profile-modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-tile);
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid var(--tile-border);
  box-shadow: var(--glass-shadow);
  animation: auftauchen var(--content) both;
}

@keyframes auftauchen { from { opacity: 0; transform: translateY(8px); } }

.cloud-hinweis {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--tile-border);
  box-shadow: var(--glass-shadow);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--micro), transform var(--micro);
  z-index: 1000;
}

.cloud-hinweis.sichtbar { opacity: 1; transform: translate(-50%, 0); }

.messages-empty-state,
.reading-empty-prompt,
.cal-cat-empty {
  padding: 18px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.reading-empty-prompt {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== Anmeldung ==================== */
.auth-page-container {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 36px 32px 28px;
  border-radius: var(--radius-tile);
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid var(--tile-border);
  box-shadow: var(--glass-shadow);
  text-align: center;
  animation: auftauchen var(--content) both;
}

.auth-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  background: url(assets/zeichen-l-hell.svg) center / contain no-repeat;
}

body[data-look="dunkel"] .auth-mark,
body[data-look="farbig"] .auth-mark { background-image: url(assets/zeichen-l-dunkel.svg); }

.auth-wordmark {
  width: 104px;
  height: 30px;
  margin: 0 auto 6px;
  background: url(assets/wortmarke-hell.svg) center / contain no-repeat;
}

body[data-look="dunkel"] .auth-wordmark,
body[data-look="farbig"] .auth-wordmark { background-image: url(assets/wortmarke-dunkel.svg); }

.auth-heading {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.auth-subline {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.auth-email-input,
.auth-code-input {
  height: 46px;
  font-size: 16px;
}

.auth-code-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
}

.auth-form-wrap .btn-primary-action { width: 100%; }

.auth-info-footnote,
.auth-wait-text {
  margin: 18px 0 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.auth-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 8px 0 6px;
}

.auth-big-code {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--prominent);
  color: var(--on-prominent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.auth-timer-pill {
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 13px;
  background: var(--fill);
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.auth-timer-pill .collai-icon { width: 13px; height: 13px; }

.auth-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.auth-trenner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.auth-trenner::before,
.auth-trenner::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-meldung {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--radius-inner);
  background: rgba(200, 40, 30, 0.1);
  color: var(--danger);
  font-size: 13px;
}

body[data-look="dunkel"] .auth-meldung,
body[data-look="farbig"] .auth-meldung { color: #FF8A80; }

/* ==================== Mail ==================== */
.mail-view {
  grid-template-columns: 250px minmax(300px, 420px) minmax(0, 1fr);
}

.mail-folders-col,
.mail-list-col,
.mail-reading-col,
.calendar-sidebar-col,
.chat-sidebar-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mail-folders-col .btn-primary-action { width: 100%; flex-shrink: 0; }

.mail-folders-scroll,
.messages-scroll,
.chat-channels-scroll,
.calendar-categories-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.mailbox-group { margin-bottom: 18px; }

.mailbox-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.mailbox-group-header .collai-icon { width: 15px; height: 15px; }

.folder-tree-list,
.subfolder-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.subfolder-tree-list { padding-left: 22px; }

.folder-item-btn {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-inner);
  background: transparent;
  font-size: 15px;
  text-align: left;
  transition: background var(--micro);
}

.folder-item-btn:hover { background: var(--fill); }

.folder-item-btn.active {
  background: var(--selection);
  box-shadow: var(--selection-shadow);
  font-weight: 600;
}

.folder-label-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.folder-label-wrap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-label-wrap .collai-icon { width: 17px; height: 17px; color: var(--text-secondary); }

.folder-badge-count {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mailbox-error-hint {
  padding: 0 12px 6px;
  font-size: 12px;
  color: var(--danger);
}

.mail-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.mail-list-title-wrap { display: flex; align-items: center; gap: 10px; }

.mail-list-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.shared-pill,
.shared-tag-pill {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.shared-pill .collai-icon,
.shared-tag-pill .collai-icon { width: 12px; height: 12px; }

.tag-assigned { background: var(--brand-soft); color: var(--text-primary); }

.message-item-card {
  position: relative;
  padding: 14px 16px 14px 70px;
  margin-bottom: 2px;
  border-radius: var(--radius-compact);
  cursor: pointer;
  transition: background var(--micro);
}

.message-item-card:hover { background: var(--fill); }

.message-item-card.active {
  background: var(--tile);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
  padding: 13px 15px 13px 69px;
}

.message-item-card.is-unread::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.msg-top-row { display: contents; }

.sender-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.message-item-card .sender-avatar {
  position: absolute;
  left: 18px;
  top: 16px;
}

.sender-avatar-lg { width: 50px; height: 50px; font-size: 17px; }

.msg-sender-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.msg-sender-name {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-unread .msg-sender-name,
.is-unread .msg-subject { font-weight: 600; }

.msg-meta-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.msg-meta-icons .collai-icon { width: 13px; height: 13px; }

.msg-subject {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.msg-shared-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mail-reading-col { min-width: 0; }

.reading-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.reading-tools-left,
.reading-tools-right { display: flex; align-items: center; gap: 10px; }

.reading-scroll-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.mail-title-subject {
  margin: 4px 0 10px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.mail-sender-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mail-sender-info { display: flex; gap: 14px; min-width: 0; flex: 1; }
.mail-sender-text { min-width: 0; flex: 1; }
.mail-sender-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.mail-sender-name-lg { font-size: 18px; font-weight: 600; }
.mail-sender-email { color: var(--text-secondary); font-size: 14px; }
.mail-recipient-line { color: var(--text-secondary); font-size: 14px; margin-top: 2px; }

.mail-date-stamp {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.attachments-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--radius-inner);
  background: var(--tile);
  border: 1px solid var(--tile-border);
  text-decoration: none;
  transition: background var(--micro);
}

.attachment-chip:hover { background: var(--selection); }
.attachment-chip .collai-icon { width: 22px; height: 22px; color: var(--text-secondary); }
.att-name { font-size: 14px; font-weight: 600; }
.att-size { font-size: 12px; color: var(--text-tertiary); }

.collab-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px 12px 18px;
  border-radius: var(--radius-compact);
  background: var(--subdued);
}

.collab-assigned-lead {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.collab-assigned-lead .collai-icon { width: 15px; height: 15px; }
.collab-pills-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.btn-claim-action {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border: none;
  border-radius: 18px;
  background: var(--prominent);
  color: var(--on-prominent);
  font-weight: 600;
}

.btn-claim-action .collai-icon { width: 15px; height: 15px; }

/* Geöffnete Mail: immer deckendes Weiß und helles Schema (feste Ausnahme 12). */
.mail-sandbox-frame-wrap {
  flex: 1;
  min-height: 320px;
  border-radius: var(--radius-tile);
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--tile-shadow);
  overflow: hidden;
  padding: 10px 6px 6px 14px;
}

.mail-sandbox-iframe {
  width: 100%;
  height: 100%;
  min-height: 300px;
  border: none;
  background: #FFFFFF;
  color-scheme: light;
}

/* Schreibfenster (schwebende Karte, Rolle glass) */
.compose-window-card {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: min(620px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-tile);
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid var(--tile-border);
  box-shadow: var(--glass-shadow);
  z-index: 90;
  animation: auftauchen var(--content) both;
}

.compose-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px 22px;
  font-size: 16px;
  font-weight: 600;
}

.compose-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 22px 18px;
}

.compose-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--border-subtle);
}

.compose-field-label {
  width: 64px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.compose-field-row input,
.compose-from-select {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
}

.compose-body-area {
  flex: 1;
  min-height: 120px;
  margin-top: 14px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
}

.compose-tools-left { display: flex; gap: 8px; }

/* ==================== Kalender ==================== */
.calendar-view {
  grid-template-columns: 270px minmax(0, 1fr);
}

.calendar-sidebar-col .btn-primary-action { width: 100%; flex-shrink: 0; }

.mini-month-widget {
  flex-shrink: 0;
  padding: 14px 14px 10px;
  border-radius: var(--radius-tile);
  background: var(--subdued);
}

.mini-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 6px 4px;
}

.mini-month-title { font-weight: 600; font-size: 15px; }
.mini-month-nav { display: flex; }

.mini-weekdays-row,
.mini-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.mini-weekdays-row { font-size: 12px; color: var(--text-tertiary); padding-bottom: 4px; }

.mini-day-cell {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.mini-day-cell:hover { background: var(--fill); }
.mini-day-cell.other-month { color: var(--text-tertiary); }

.mini-day-cell.selected { background: var(--fill); }

.mini-day-cell.today {
  background: var(--prominent);
  color: var(--on-prominent);
  font-weight: 700;
  width: 30px;
  justify-self: center;
}

.mini-day-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--brand);
}

.cal-cat-group { margin-top: 6px; }

.cal-cat-group-title {
  padding: 0 6px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cal-cat-item-row {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  border-radius: 10px;
  cursor: pointer;
}

.cal-cat-item-row:hover { background: var(--fill); }
.cal-cat-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cal-cat-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cat-right { color: var(--text-tertiary); }
.cal-cat-right .collai-icon { width: 12px; height: 12px; }

.cal-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-checkbox .collai-icon { width: 12px; height: 12px; }

.calendar-main-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.calendar-top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.calendar-nav-arrows { display: flex; gap: 8px; }
.calendar-nav-arrows .mini-nav-btn { width: 40px; height: 40px; border: 1px solid var(--control-border); background: var(--control); }

.btn-today-pill {
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px solid var(--control-border);
  background: var(--control);
  font-weight: 600;
}

.btn-today-pill:hover { background: var(--fill-hover); }

.calendar-title-heading {
  margin: 0 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-grid-container,
.month-grid-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tile);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius-tile);
  box-shadow: var(--tile-shadow);
}

.week-header-row,
.all-day-row,
.time-grid-wrapper {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
}

.week-header-row { height: 64px; align-items: center; }

.week-kw-cell {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 12px;
}

.week-day-header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.day-number-bubble {
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.week-day-header-cell.is-today .day-number-bubble {
  background: var(--prominent);
  color: var(--on-prominent);
}

.all-day-row { border-bottom: 1px solid var(--border-subtle); }

.all-day-label {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 8px 0 0 10px;
}

.all-day-content { grid-column: 2 / -1; position: relative; }

.all-day-event-bar {
  position: absolute;
  height: 24px;
  border-radius: 6px;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  padding: 0 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.week-time-scroll { flex: 1; min-height: 0; overflow-y: auto; position: relative; }

.time-slot-label-col { display: flex; flex-direction: column; }

.time-slot-label {
  height: 60px;
  padding: 0 10px 0 0;
  text-align: right;
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  transform: translateY(-8px);
}

.time-slot-label:first-child { visibility: hidden; }

.day-column-slots {
  position: relative;
  border-left: 1px solid var(--border-subtle);
}

.slot-hour-line { height: 60px; border-top: 1px solid var(--border-subtle); }

.current-time-marker {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--now);
  z-index: 5;
  pointer-events: none;
}

.current-time-marker::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--now);
}

.cal-event-card {
  position: absolute;
  overflow: hidden;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  z-index: 2;
  transition: filter var(--micro);
}

.cal-event-card:hover { filter: brightness(0.97); z-index: 4; }
.cal-event-title { font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event-time { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.month-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 14px 0 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.month-days-matrix {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(0, 1fr);
}

.month-cell {
  min-height: 0;
  overflow: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.month-cell:nth-child(7n) { border-right: none; }

.month-cell-header {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 4px 2px;
}

.month-cell.is-today .month-cell-header {
  align-self: flex-start;
  min-width: 26px;
  border-radius: 13px;
  background: var(--prominent);
  color: var(--on-prominent);
  text-align: center;
}

.month-cell.is-other-month .month-cell-header { color: var(--text-tertiary); }

.month-event-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-event-pill:hover { background: var(--fill); }

.month-dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.month-more-hint { font-size: 11px; color: var(--text-tertiary); padding: 0 6px; }

.week-grid-container.is-day-mode .week-header-row,
.week-grid-container.is-day-mode .all-day-row,
.week-grid-container.is-day-mode .time-grid-wrapper { grid-template-columns: 64px 1fr; }

/* Termin-Dialog */
.event-title-input {
  width: 100%;
  height: 44px;
  margin-bottom: 14px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  font-size: 22px;
  font-weight: 600;
  outline: none;
}

.event-cal-belegt-row,
.event-row-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.event-cal-select-wrap { display: flex; align-items: center; gap: 8px; }

.event-dot-purple {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.event-label-medium { font-weight: 500; }

.event-form-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px 12px;
  align-items: center;
  margin: 8px 0 12px;
}

.event-field-label-w {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.event-field-label-w .collai-icon { width: 14px; height: 14px; }
.event-date-row { display: flex; gap: 8px; }
.event-date-row .event-input-small { flex: 1; min-width: 0; }
.event-form-grid .form-field-input { width: 100%; }

.event-section-divider { height: 1px; margin: 14px 0; background: var(--border-subtle); }

.event-guests-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
}

.event-guests-header .collai-icon { width: 14px; height: 14px; }
.event-guests-list { display: flex; flex-direction: column; gap: 6px; }

.guest-item-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--fill);
}

.guest-info-left { display: flex; align-items: center; gap: 10px; }

.guest-avatar-xs {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--prominent);
  color: var(--on-prominent);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guest-name-text { display: block; font-size: 13px; font-weight: 600; }
.guest-email-text { display: block; font-size: 12px; color: var(--text-tertiary); }
.guest-status-indicator { font-weight: 700; color: var(--text-tertiary); padding: 0 6px; }
.guest-status-ok { color: var(--success); }

.event-notes-textarea {
  height: 90px;
  padding: 10px 14px;
  resize: vertical;
}

.event-readonly-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.event-readonly-hint .collai-icon { width: 14px; height: 14px; }

.event-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.btn-danger-link {
  margin-right: auto;
  border: none;
  background: none;
  color: var(--danger);
  font-weight: 500;
}

.switch-control { position: relative; width: 42px; height: 26px; }
.switch-control input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: var(--fill-hover);
  transition: background var(--micro);
  cursor: pointer;
}

.switch-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--micro);
}

.switch-control input:checked + .switch-slider { background: var(--brand-gradient); }
.switch-control input:checked + .switch-slider::before { transform: translateX(16px); }

/* ==================== Chat ==================== */
.chat-view {
  grid-template-columns: 380px minmax(0, 1fr);
}

.chat-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 6px;
}

.chat-sidebar-title { margin: 0; font-size: 18px; font-weight: 600; }

.chat-channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-compact);
  cursor: pointer;
  transition: background var(--micro);
}

.chat-channel-card:hover { background: var(--fill); }

.chat-channel-card.active {
  background: var(--tile);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
  padding: 9px 11px;
}

.avatar-with-badge { position: relative; flex-shrink: 0; }

.chat-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
}

.chat-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar-header { width: 56px; height: 56px; }

.online-status-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-top);
}

.chat-channel-meta { flex: 1; min-width: 0; }
.chat-channel-name-row { display: flex; align-items: center; gap: 6px; }
.chat-channel-name { font-size: 15px; font-weight: 600; }
.chat-channel-preview-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.chat-channel-preview {
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-main-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
  flex-shrink: 0;
}

.chat-header-user { display: flex; align-items: center; gap: 14px; min-width: 0; }
.chat-user-name { font-size: 18px; font-weight: 600; }
.chat-user-status { font-size: 14px; color: var(--text-secondary); }
.chat-header-actions { display: flex; align-items: center; gap: 10px; }

.btn-video-call {
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border: none;
  border-radius: 22px;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 15px;
}

.btn-video-call:hover { filter: brightness(0.92); }
.btn-video-call .collai-icon { width: 18px; height: 18px; }

.chat-messages-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 40px 20px 110px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-msg-row { display: flex; flex-direction: column; max-width: 72%; }
.chat-msg-row.outgoing { align-self: flex-end; align-items: flex-end; }
.chat-msg-row.incoming { align-self: flex-start; }

.chat-sender-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.chat-sender-dot { width: 22px; height: 22px; border-radius: 50%; }
.chat-sender-name-text { font-size: 16px; font-weight: 600; }

.chat-time-stamp {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.chat-bubble-text { font-size: 16px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }

.chat-bubble-outgoing {
  padding: 10px 16px;
  margin-bottom: 4px;
  border-radius: 18px;
  background: var(--prominent);
  color: var(--on-prominent);
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-system-call-capsule {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--fill);
  color: var(--text-secondary);
  font-size: 13px;
}

.chat-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 4px;
  padding: 10px 14px;
  min-width: 260px;
  border-radius: var(--radius-compact);
  background: var(--tile);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
  text-decoration: none;
}

.chat-file-card .collai-icon { width: 22px; height: 22px; color: var(--text-secondary); }
.chat-file-card-inner { flex: 1; min-width: 0; }
.chat-file-card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-card-size { font-size: 12px; color: var(--text-tertiary); }

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 20px;
  margin: 0 40px 0 110px;
  border-radius: 28px;
  background: var(--tile);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
  flex-shrink: 0;
}

.chat-input-pill { flex: 1; }

.chat-input-pill input {
  width: 100%;
  height: 40px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
}

.chat-input-bar .btn-primary-action { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* ==================== Profil ==================== */
.profile-avatar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }

.profile-avatar-large {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-name-lg { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.3px; }
.profile-role-sub { color: var(--text-secondary); font-size: 14px; margin-top: 2px; }

.profile-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-info-footnote { color: var(--text-secondary); font-size: 13px; }

.profile-modal-card .profile-divider { margin: 18px 0; }

.profile-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.profile-section-title .collai-icon { width: 22px; height: 22px; color: var(--text-secondary); }
.profile-section-desc { margin: 4px 0 12px; color: var(--text-secondary); font-size: 13px; }

.look-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }

/* ==================== Schmal ==================== */
@media (max-width: 1100px) {
  .mail-view { grid-template-columns: 240px minmax(260px, 1fr); }
  .mail-view .mail-reading-col { display: none; }
  .mail-view.liest { grid-template-columns: 240px minmax(0, 1fr); }
  .mail-view.liest .mail-list-col { display: none; }
  .mail-view.liest .mail-reading-col { display: flex; }
  .calendar-view { grid-template-columns: minmax(0, 1fr); }
  .calendar-sidebar-col { display: none; }
  .chat-view { grid-template-columns: 280px minmax(0, 1fr); }
  .chat-messages-scroll { padding: 10px 12px 20px; }
  .chat-input-bar { margin: 0 12px; }
}

@media (max-width: 760px) {
  :root { --dock-w: 0px; --top-h: 64px; }
  .collai-dock { display: none; }
  .collai-topbar { padding: 0 12px; grid-template-columns: auto 1fr; }
  .topbar-left .org-bubble-wrap span:not(.org-badge-kurz) { display: none; }
  .topbar-right { display: none; }
  .topbar-center { justify-content: flex-end; gap: 6px; }
  .user-pill-btn span { display: none; }
  .user-pill-btn { padding: 4px; }
  .collai-view { padding: 4px 12px 12px; }
  .mail-view, .mail-view.liest { grid-template-columns: minmax(0, 1fr); }
  .mail-view .mail-folders-col { display: none; }
  .chat-view { grid-template-columns: minmax(0, 1fr); }
  .chat-view .chat-main-col { display: none; }
  .chat-view.offen .chat-sidebar-col { display: none; }
  .chat-view.offen .chat-main-col { display: flex; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .glass-card, .event-modal-card, .profile-modal-card, .compose-window-card, .auth-card, .dropdown-menu-popover, .cloud-hinweis {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.look-menu {
  top: auto;
  bottom: 0;
  left: calc(100% + 12px);
  min-width: 180px;
}

/* Dunkel/Farbig: „heute“ als heller Kreis wie am Mac */
body[data-look="dunkel"] .mini-day-cell.today,
body[data-look="farbig"] .mini-day-cell.today,
body[data-look="dunkel"] .week-day-header-cell.is-today .day-number-bubble,
body[data-look="farbig"] .week-day-header-cell.is-today .day-number-bubble,
body[data-look="dunkel"] .month-cell.is-today .month-cell-header,
body[data-look="farbig"] .month-cell.is-today .month-cell-header {
  background: #F5F5F7;
  color: #17181B;
}

.org-zeichen {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.org-item-select-btn .org-zeichen { width: 24px; height: 24px; }

/* ==================== Notizen ==================== */
.notizen-view {
  grid-template-columns: 340px minmax(0, 1fr);
}

.notizen-liste-col,
.notiz-editor-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notizen-liste-col .btn-primary-action { width: 100%; flex-shrink: 0; }

.notizen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.notiz-karte {
  padding: 12px 16px;
  margin-bottom: 2px;
  border-radius: var(--radius-compact);
  cursor: pointer;
  transition: background var(--micro);
}

.notiz-karte:hover { background: var(--fill); }

.notiz-karte.active {
  background: var(--tile);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
  padding: 11px 15px;
}

.notiz-titel {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notiz-rest {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notiz-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.notiz-stand {
  color: var(--text-tertiary);
  font-size: 13px;
}

.notiz-blatt {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 22px 24px;
  border-radius: var(--radius-tile);
  background: var(--tile);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
}

.notiz-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
}

.notiz-textarea::placeholder { color: var(--text-tertiary); }

@media (max-width: 1100px) {
  .notizen-view { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .notizen-view { grid-template-columns: minmax(0, 1fr); }
  .brand-mark { left: 12px; }
}
