@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg:          #e8f2fa;
  --surface:     #ffffff;
  --surface-2:   #f0f7fc;
  --border:      #d4e8f5;
  --border-2:    #b8d9ef;
  --text:        #0b1f3a;
  --text-2:      #3d5472;
  --text-3:      #8baabf;
  --deck-bg:     #141d2c;
  --deck-bg-2:   #1c2840;
  --deck-edge:   #090e16;
  --grad:        linear-gradient(135deg, #0b3060 0%, #0ea5e9 100%);
  --header-h:    62px;
  --meta-h:      40px;
  --radius-sm:   8px;
  --radius:      12px;
  --transition:  .15s cubic-bezier(.4,0,.2,1);
  --banner-h:    0px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ── SHELL ─────────────────────────────────────────
   Kein overflow:hidden, kein height:100vh.
   Der Browser scrollt natürlich.
   ─────────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR — sticky, scrollt intern ─────────── */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  position: relative;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

/* ── SIDEBAR RESIZE HANDLE ──────────────────────── */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  z-index: 21;
  transition: background var(--transition);
}
.sidebar-resize-handle:hover { background: rgba(3,105,161,.06); }

.sidebar-resize-bar {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--border-2);
  transition: height var(--transition);
}
.sidebar-resize-handle:hover .sidebar-resize-bar { height: 48px; }

.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 26px;
  height: 26px;
  background: var(--grad);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo span { font-size: .83rem; font-weight: 700; letter-spacing: -.02em; }

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
}

.toggle-all-btn {
  background: none;
  border: none;
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.toggle-all-btn:hover { color: var(--text-2); background: var(--surface-2); }


.customer-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

/* ── Buchstabengruppe ── */
.customer-group { list-style: none; }

.customer-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--transition);
}
.customer-group-header::-webkit-details-marker { display: none; }
.customer-group-header::marker { display: none; }
.customer-group-header:hover { background: var(--surface-2); }

.customer-group-letter {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
}

.group-chevron {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--transition);
}

details[open] > .customer-group-header .group-chevron {
  transform: rotate(90deg);
}

.customer-group-items {
  list-style: none;
  padding-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.customer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.customer-item:hover  { background: var(--surface-2); }
.customer-item.active { background: #e0f2fe; border-color: #bae6fd; }

.customer-item-info { flex: 1; min-width: 0; }

.customer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .67rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.customer-item-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-item-company {
  font-size: .7rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── MAIN — wächst mit dem Inhalt ─────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
}

.main-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* ── AKTIVE ANSICHT ─────────────────────────────── */
.active-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── CUSTOMER HEADER — sticky ──────────────────── */
.customer-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.customer-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(3,105,161,.22);
}

.customer-header-name    { font-size: .92rem; font-weight: 700; letter-spacing: -.02em; }
.customer-header-company { font-size: .73rem; color: var(--text-3); margin-top: 1px; }

/* ── KUNDEN-STATUS (Header rechts) ─────────────── */
.customer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.status-lamp {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}
.status-lamp.green  { background: #22c55e; box-shadow: 0 0 7px rgba(34,197,94,.65); }
.status-lamp.yellow { background: #fbbf24; box-shadow: 0 0 7px rgba(251,191,36,.55); animation: pulse-yellow 2s ease-in-out infinite; }

@keyframes pulse-yellow {
  0%, 100% { opacity: 1;   box-shadow: 0 0 7px rgba(251,191,36,.55); }
  50%       { opacity: .45; box-shadow: 0 0 3px rgba(251,191,36,.2); }
}

.status-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
}

.status-timer {
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #16a34a;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.28);
  padding: 2px 8px;
  border-radius: 5px;
}

.customer-status.inactive {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px;
  margin-right: -8px;
  transition: background var(--transition);
}
.customer-status.inactive:hover  { background: rgba(251,191,36,.12); }
.customer-status.inactive:active { background: rgba(251,191,36,.22); }

/* ── SIDEBAR STATUS-PUNKT ───────────────────────── */
.sidebar-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-status-dot.green  { background: #22c55e; box-shadow: 0 0 5px rgba(34,197,94,.5); }
.sidebar-status-dot.yellow { background: #fbbf24; box-shadow: 0 0 5px rgba(251,191,36,.4); }

/* ── METADATA STRIP — sticky unter dem Header ─── */
.metadata-strip {
  position: sticky;
  top: calc(var(--header-h) + var(--banner-h));
  z-index: 9;
  height: var(--meta-h);
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.metadata-strip::-webkit-scrollbar { display: none; }

.meta-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 16px;
  flex-shrink: 0;
}

.meta-divider {
  width: 1px;
  background: var(--border);
  margin: 7px 0;
  flex-shrink: 0;
}

.meta-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  white-space: nowrap;
}

.meta-value {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  border-radius: 3px;
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s;
  flex-shrink: 0;
}
.meta-item:hover .meta-copy-btn {
  opacity: 1;
}
.meta-copy-btn:hover {
  color: var(--text-1);
}
.meta-copy-btn.copied {
  color: #22c55e;
  opacity: 1;
}

/* ── WORKSPACE ─────────────────────────────────── */
.workspace {
  display: flex;
  flex: 1;
}

/* ── DECK RESIZE HANDLE ─────────────────────────── */
.deck-resize-handle {
  width: 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  border-left: 1px solid var(--border);
  transition: background var(--transition);
  z-index: 1;
}
.deck-resize-handle:hover { background: rgba(3,105,161,.06); }
.deck-resize-bar {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--border-2);
  transition: height var(--transition);
}
.deck-resize-handle:hover .deck-resize-bar { height: 48px; }

/* ── DECK SIDEBAR ──────────────────────────────── */
.deck-scroll {
  width: 264px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 12px 8px 40px;
  background: var(--bg);
}

.deck {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inactive-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: .8rem;
  color: #92400e;
}
.inactive-banner span { flex: 1; }
.inactive-banner button {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: .75rem;
  font-weight: 600;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity var(--transition);
}
.inactive-banner button:hover { opacity: .85; }

/* ── DECK TABS ──────────────────────────────────── */
.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.deck-tabs {
  display: flex;
  background: var(--deck-bg-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.deck-tab {
  padding: 4px 12px;
  font-size: .72rem;
  font-weight: 600;
  color: #5a6a82;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.deck-tab:hover:not(.active):not(:disabled) { color: #8baabf; }
.deck-tab:disabled { opacity: .35; cursor: default; }
.deck-tab.active {
  background: var(--deck-bg);
  color: #c8d8e8;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* Panel-Karte */
.deck-group {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Panel-Header */
.deck-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.deck-group-header:hover { background: var(--surface-2); }
.deck-group-header::-webkit-details-marker { display: none; }
.deck-group-header::marker { display: none; }

details.deck-group[open] > .deck-group-header .group-chevron { transform: rotate(90deg); }
details.deck-group:not([open]) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
details.deck-group:not([open]) > .deck-group-header { border-bottom: none; }

.deck-group-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.deck-group-label {
  flex: 1;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  white-space: nowrap;
}

.deck-group .group-chevron { color: var(--text-3); }

/* Button-Fläche */
.deck-workflow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px 8px;
}

/* ── DECK BUTTON ───────────────────────────────── */
.deck-btn {
  position: relative;
  width: 100%;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--deck-bg-2) 0%, var(--deck-bg) 100%);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 12px 0 14px;
  color: rgba(255,255,255,.45);
  box-shadow:
    0 3px 0 var(--deck-edge),
    0 5px 14px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateY(0);
  transition: transform .1s ease, box-shadow .1s ease;
  user-select: none;
  overflow: hidden;
}

/* Farbiger linker Akzentstreifen */
.deck-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  opacity: .45;
  transition: opacity var(--transition), top var(--transition), bottom var(--transition);
}
.deck-btn:hover::before  { opacity: 1; top: 4px; bottom: 4px; }
.deck-btn.pressed::before { opacity: 1; }

.deck-step-num {
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255,255,255,.18);
  min-width: 16px;
  flex-shrink: 0;
  transition: color var(--transition);
}

/* Icon in Akzentfarbe */
.deck-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--accent);
  opacity: .55;
  transition: opacity var(--transition);
}

.deck-btn:hover {
  border-color: rgba(255,255,255,.13);
  box-shadow:
    0 4px 0 var(--deck-edge),
    0 7px 20px rgba(0,0,0,.35),
    0 0 18px var(--glow),
    inset 0 1px 0 rgba(255,255,255,.1);
  transform: translateY(-1px);
}
.deck-btn:hover .deck-icon     { opacity: 1; }
.deck-btn:hover .deck-step-num { color: var(--accent); opacity: .6; }

.deck-btn:disabled {
  opacity: .28;
  cursor: not-allowed;
  transform: none !important;
  box-shadow:
    0 3px 0 var(--deck-edge),
    0 5px 14px rgba(0,0,0,.25) !important;
}
.deck-btn:disabled::before { opacity: .15; }

.deck-btn.pressed,
.deck-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 var(--deck-edge),
    0 2px 8px rgba(0,0,0,.25),
    0 0 14px var(--glow),
    inset 0 2px 4px rgba(0,0,0,.3);
}
.deck-btn.pressed .deck-icon { opacity: 1; }

.deck-label {
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255,255,255,.65);
  transition: color var(--transition);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-btn:hover .deck-label,
.deck-btn.pressed .deck-label { color: #fff; }

/* ── PREVIEW PANEL — nimmt den Großteil ein ────── */
.preview-panel {
  flex: 1;
  min-width: 0;
  position: relative;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  overflow: hidden;
}

.resize-handle {
  width: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  transition: background var(--transition);
}

.resize-handle:hover { background: rgba(3,105,161,.06); }

.resize-handle-bar {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--border-2);
  transition: height var(--transition);
}

.resize-handle:hover .resize-handle-bar { height: 48px; }

.preview-inner {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  text-align: center;
}

.preview-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.preview-empty-title { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.preview-empty-hint  { font-size: .75rem; color: var(--text-3); line-height: 1.6; }

.preview-content {
  padding: 20px;
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── HTML PREVIEW + EDITOR ──────────────────────── */
.preview-html-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-html-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.preview-html-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-html-filename {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}

.preview-html-filename::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  flex-shrink: 0;
}

/* Segmented control */
.preview-html-actions {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.preview-mode-btn {
  padding: 4px 12px;
  font-size: .68rem;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--transition);
}
.preview-mode-btn.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 1px 4px rgba(3,105,161,.25);
}
.preview-mode-btn:hover:not(.active):not(:disabled) { color: var(--text-2); background: var(--border); }
.preview-mode-btn:disabled { opacity: .35; cursor: not-allowed; }

.preview-send-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.preview-send-btn:hover:not(:disabled)  { opacity: .85; }
.preview-send-btn:active:not(:disabled) { transform: scale(.96); }
.preview-send-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── FORMAT-LEISTE ──────────────────────────────── */
.fmt-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.fmt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  font-size: .72rem;
  font-weight: 600;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.fmt-btn:hover  { background: var(--surface); border-color: var(--border); }
.fmt-btn:active { background: var(--border); }

.fmt-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.preview-html-frame {
  flex: 1;
  border: none;
  width: 100%;
}

.preview-html-editor {
  flex: 1;
  border: none;
  padding: 14px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: .72rem;
  color: var(--text);
  background: var(--surface);
  resize: none;
  outline: none;
  line-height: 1.6;
  tab-size: 2;
}

/* ── TERMIN-FORMULAR ───────────────────────────── */
.termin-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.termin-row {
  display: flex;
  gap: 12px;
}
.termin-row .termin-field { flex: 1; }

.termin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.termin-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
}

.termin-input {
  padding: 8px 11px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  box-sizing: border-box;
}
.termin-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.termin-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* ── LEAD FORM ─────────────────────────────────── */
.lead-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}

.lead-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-section-label {
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

.lead-row {
  display: flex;
  gap: 10px;
}
.lead-row .lead-field { flex: 1; min-width: 0; }

.lead-field {
  position: relative;
}

.lead-input {
  width: 100%;
  box-sizing: border-box;
  padding: 18px 12px 6px;
  font-size: .84rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lead-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.lead-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .84rem;
  color: var(--text-2);
  pointer-events: none;
  transition: top .15s ease, transform .15s ease, font-size .15s ease, color .15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 24px);
}

.lead-input:focus + .lead-label,
.lead-input:not(:placeholder-shown) + .lead-label {
  top: 7px;
  transform: none;
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: #0ea5e9;
}

.lead-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  padding-top: 20px;
}

.lead-field--area .lead-label {
  top: 14px;
  transform: none;
}
.lead-textarea:focus + .lead-label,
.lead-textarea:not(:placeholder-shown) + .lead-label {
  top: 5px;
  transform: none;
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: #0ea5e9;
}

/* ── EMPTY STATE ───────────────────────────────── */
.empty-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0369a1;
}

.empty-state h3 { font-size: .88rem; font-weight: 600; color: var(--text-2); }
.empty-state p  { font-size: .76rem; color: var(--text-3); max-width: 200px; line-height: 1.5; }

/* ── TOAST ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 88px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--deck-bg);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  padding: 11px 14px;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  font-size: .8rem;
  max-width: 300px;
  animation: toastIn .2s cubic-bezier(.34,1.56,.64,1);
}

.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: #38bdf8; flex-shrink: 0; }
.toast span { flex: 1; }
.toast button {
  background: none; border: none; color: rgba(255,255,255,.3);
  cursor: pointer; font-size: .75rem; padding: 0; flex-shrink: 0;
}
.toast button:hover { color: rgba(255,255,255,.7); }

@keyframes toastIn {
  from { transform: translateY(8px) scale(.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── SIDEBAR LADE- UND FEHLERZUSTAND ───────────── */
.sidebar-status {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  font-size: .78rem;
  color: var(--text-3);
  line-height: 1.5;
}

.sidebar-status.error { color: var(--text-2); }
.sidebar-status.error svg { color: #f87171; }

.sidebar-status button {
  margin-top: 4px;
  padding: 5px 14px;
  font-size: .72rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-status button:hover { background: #bae6fd; }

.sidebar-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-2);
  border-top-color: #0369a1;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── HILFKLASSEN ────────────────────────────────── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   CLAUDE CHAT
   ═══════════════════════════════════════════════════ */

/* ── FAB ────────────────────────────────────────── */
.chat-fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(3,105,161,.35), 0 2px 4px rgba(0,0,0,.12);
  transition: transform var(--transition), box-shadow var(--transition), background .2s;
}
.chat-fab:hover:not(:disabled)  { transform: scale(1.08); box-shadow: 0 6px 22px rgba(3,105,161,.45), 0 3px 6px rgba(0,0,0,.15); }
.chat-fab:active:not(:disabled) { transform: scale(.94); }
.chat-fab.open   { background: var(--deck-bg); }
.chat-fab:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

.chat-fab-icon-open  { display: block; }
.chat-fab-icon-close { display: none;  }
.chat-fab.open .chat-fab-icon-open  { display: none;  }
.chat-fab.open .chat-fab-icon-close { display: block; }

.chat-fab.has-unread::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0ea5e9;
  border: 2px solid #fff;
  animation: chatBadgePop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes chatBadgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── PANEL ──────────────────────────────────────── */
.chat-panel {
  position: absolute;
  bottom: 76px;
  right: 16px;
  z-index: 9;
  width: calc(100% - 32px);
  max-width: 420px;
  height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
}
.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ─────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.chat-header-info   { flex: 1; min-width: 0; }
.chat-header-title  { font-size: .82rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.chat-header-sub    { font-size: .67rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.chat-icon-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.chat-icon-btn:hover { background: var(--surface-2); color: var(--text-2); }

/* ── MESSAGES ───────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: .8rem;
  line-height: 1.5;
  margin: auto 0;
}

.chat-welcome-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

/* Bubbles */
.chat-msg { display: flex; flex-direction: column; max-width: 88%; }
.chat-msg.user      { align-self: flex-end;   align-items: flex-end; }
.chat-msg.assistant { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: .81rem;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg.user      .chat-bubble { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .chat-bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: chat-bounce .9s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: .15s; }
.chat-typing-dot:nth-child(3) { animation-delay: .30s; }

@keyframes chat-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: .4; }
  40%            { transform: translateY(-5px); opacity: 1;  }
}

/* ── INPUT ──────────────────────────────────────── */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  padding: 7px 11px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .81rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: none;
  outline: none;
  line-height: 1.45;
  overflow-y: auto;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.chat-input:focus          { border-color: #7dd3fc; box-shadow: 0 0 0 3px rgba(125,211,252,.15); }
.chat-input::placeholder   { color: var(--text-3); }

.chat-attach-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--transition);
}
.chat-attach-btn:hover           { background: var(--surface-2); color: var(--text-2); border-color: var(--border-2); }
.chat-attach-btn.active          { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.chat-attach-btn.active:hover    { background: #bae6fd; }

.chat-send-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--grad);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity var(--transition), transform var(--transition);
}
.chat-send-btn:hover:not(:disabled)  { opacity: .85; }
.chat-send-btn:active:not(:disabled) { transform: scale(.92); }
.chat-send-btn:disabled              { opacity: .35; cursor: not-allowed; }

/* ── Desktop: mobile-only elements hidden ────────── */
.mobile-nav             { display: none; }
.mobile-back-btn        { display: none; }
.mobile-home-count      { display: none; }
.customer-item-chevron  { display: none; }
.drawer-overlay         { display: none; }
.mobile-no-customer-bar { display: none; }
.burger-btn             { display: none; }
.drawer-close-btn       { display: none; }

/* ═══════════════════════════════════════════════════
   MOBIL — Burger-Drawer Design (≤ 768px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {

  html, body { height: 100%; overflow: hidden; }
  * { -webkit-tap-highlight-color: transparent; }
  .app { height: 100dvh; overflow: hidden; position: relative; }

  /* ── Dimm-Overlay ── */
  .drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .32s cubic-bezier(.4,0,.2,1);
  }
  .app.drawer-open .drawer-overlay {
    opacity: 1;
    pointer-events: all;
  }

  /* ── Sidebar → Left Drawer ── */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    z-index: 200;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    will-change: transform;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
  }
  .sidebar-resize-handle { display: none; }
  .app.drawer-open .sidebar { transform: translateX(0); }

  /* Drawer schließen-Button */
  .drawer-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    color: var(--text-2);
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    margin-left: auto;
    flex-shrink: 0;
  }
  .drawer-close-btn:active { background: var(--surface-2); }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
  }
  .sidebar-logo .logo-icon { width: 30px; height: 30px; border-radius: 9px; font-size: .66rem; flex-shrink: 0; }
  .sidebar-logo > span:not(.mobile-home-count) { font-size: .88rem; font-weight: 700; letter-spacing: -.02em; }

  .mobile-home-count {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .64rem;
    font-weight: 700;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 8px;
    flex-shrink: 0;
  }

  .sidebar-section-header { display: none; }

  /* Kundenliste */
  .customer-list {
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    user-select: none;
  }

  .customer-list .customer-group         { display: block; width: 100%; }
  .customer-list .customer-group details { display: block; }
  .customer-list .customer-group-items   {
    display: flex !important;
    flex-direction: column;
    padding: 0;
    margin: 0;
    gap: 0;
  }

  .customer-group-header {
    display: flex;
    padding: 8px 16px 4px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    cursor: default;
    min-height: 0;
  }
  .customer-group-header:hover { background: var(--surface-2); }
  .customer-group-header .group-chevron { display: none; }
  .customer-group-letter { font-size: .6rem; letter-spacing: .12em; }

  .customer-item {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 12px 16px;
    min-width: 0;
    width: 100%;
    gap: 12px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    min-height: 64px;
    touch-action: manipulation;
    background: var(--surface);
  }
  .customer-item:active { background: var(--surface-2); }
  .customer-item.active { background: #eff6ff; }

  .customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: .78rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(3,105,161,.15);
  }

  .customer-item-info    { flex: 1; min-width: 0; }
  .customer-item-name    { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .customer-item-company { display: block !important; font-size: .72rem; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-status-dot    { width: 9px; height: 9px; margin-left: 0; flex-shrink: 0; }
  .customer-item-chevron { display: block; flex-shrink: 0; color: var(--border-2); }

  /* ── Main — immer sichtbar ── */
  .main {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
    background: var(--bg);
    overflow: hidden;
  }

  /* ── No-Customer Top Bar ── */
  .mobile-no-customer-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-no-customer-bar .logo-icon { width: 28px; height: 28px; border-radius: 8px; font-size: .62rem; flex-shrink: 0; }
  .mobile-no-customer-bar > span { font-size: .88rem; font-weight: 700; letter-spacing: -.02em; flex: 1; }

  /* ── Burger-Button ── */
  .burger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    background: none;
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
  }
  .burger-btn:active { background: var(--surface-2); }

  /* ── Kunden-Header ── */
  .customer-header {
    position: static;
    height: auto;
    padding: 8px 14px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .customer-header-avatar  { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
  .customer-header-name    { font-size: .84rem; }
  .customer-header-company { font-size: .68rem; }

  .customer-status {
    margin-left: auto;
    width: auto;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    gap: 6px;
    flex-shrink: 0;
  }

  .metadata-strip {
    position: static;
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  .metadata-strip::-webkit-scrollbar { display: none; }
  .meta-copy-btn { opacity: 1; }

  .inactive-banner { border-radius: 0; flex-shrink: 0; }

  /* ── Main-Left ── */
  .main-left {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    position: static;
    height: auto;
    overflow: hidden;
    min-height: 0;
  }
  .main-left.mobile-expand { flex: 1; overflow: hidden; }

  .main-left:not(.mobile-expand) .preview-panel { display: none !important; }
  .main-left:not(.mobile-expand) .empty-wrap    { display: none !important; }

  .main-left.mobile-expand .preview-panel {
    flex: 1;
    position: static;
    height: auto;
    border-right: none;
  }

  .empty-wrap { flex: 1; min-height: 0; }
  .deck-resize-handle { display: none; }

  /* ── Deck ── */
  .deck-scroll {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: static;
    border-left: none;
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 14px 12px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
  }
  .deck-scroll::-webkit-scrollbar { display: none; }

  .deck-toolbar { margin-bottom: 14px; }

  .deck-tabs { flex: 1; padding: 4px; gap: 3px; border-radius: 10px; }
  .deck-tab {
    flex: 1;
    padding: 10px 0;
    font-size: .78rem;
    min-height: 42px;
    text-align: center;
    touch-action: manipulation;
    border-radius: 7px;
  }
  .toggle-all-btn { padding: 9px 12px; min-height: 42px; font-size: .7rem; touch-action: manipulation; }

  .deck       { flex-direction: column; gap: 10px; }
  .deck-group { flex-shrink: unset; width: 100%; }
  .deck-group-header { padding: 12px 16px; min-height: 48px; }

  .deck-workflow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 6px 8px 10px;
  }
  .deck-btn {
    width: 100%;
    height: 62px;
    gap: 10px;
    padding: 0 12px 0 16px;
    touch-action: manipulation;
    border-radius: 12px;
  }
  .deck-workflow .deck-btn:only-child { grid-column: span 2; }
  .deck-step-num { display: none; }
  .deck-icon     { width: 19px; height: 19px; }
  .deck-label    { font-size: .73rem; line-height: 1.3; white-space: normal; }

  /* ── Bottom Tab Bar ── */
  .mobile-nav {
    display: flex;
    flex-shrink: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -1px 0 var(--border), 0 -4px 20px rgba(0,0,0,.06);
  }

  .mobile-nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: none;
    color: var(--text-3);
    font-size: .57rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    padding: 0 0 2px;
    touch-action: manipulation;
  }
  .mobile-nav-tab.active { color: #0369a1; }
  .mobile-nav-tab:active { background: var(--surface-2); }

  .mobile-nav-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2.5px;
    background: linear-gradient(90deg, #0b3060, #0ea5e9);
    border-radius: 0 0 3px 3px;
  }

  .mobile-nav-tab.has-content::after {
    content: '';
    position: absolute;
    top: 10px;
    right: calc(50% - 20px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0ea5e9;
    border: 2px solid var(--surface);
    animation: badgePop .3s cubic-bezier(.34,1.56,.64,1);
  }

  @keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
  }

  /* ── Chat & Toast ── */
  .chat-fab {
    position: fixed;
    bottom: 76px;
    right: 16px;
    z-index: 300;
  }

  .chat-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 136px;
    width: auto;
    max-width: none;
    height: 56vh;
    z-index: 299;
    border-radius: 16px;
  }

  .toast-container { left: 12px; right: 12px; bottom: 70px; }
  .toast           { max-width: 100%; }
}
