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

:root {
  --bg: #eef0f5;
  --surface: #ffffff;
  --surface-2: #f5f6f9;
  --surface-3: #eef0f5;
  --border: rgba(0,0,0,0.07);
  --border-active: rgba(37,211,102,0.5);
  --text: #141920;
  --text-muted: #6b7585;
  --text-faint: #aab3bb;
  --accent: #25d366;
  --accent-dark: #128c7e;
  --accent-dim: rgba(37,211,102,0.10);
  --accent-glow: 0 0 0 3px rgba(37,211,102,0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
}

/* ── Login ── */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.login-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-logo {
  width: 56px; height: 56px;
  background: var(--accent-dim);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.login-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-btn {
  width: 100%;
  margin-top: 4px;
  justify-content: center;
}
.login-error {
  background: rgba(220,38,38,0.06);
  color: #dc2626;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ── Top Bar ── */
.topbar {
  background: linear-gradient(135deg, #064e46 0%, #128c7e 60%, #1aaa96 100%);
  color: #fff;
  padding: 0 32px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 16px rgba(6,78,70,.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topbar-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.topbar-customer-id {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.4);
  letter-spacing: 0.2px;
  pointer-events: none;
}

/* ── Layout ── */
.main {
  display: flex;
  flex: 1;
  gap: 24px;
  padding: 24px 32px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

/* ── Editor Panel ── */
.editor-panel { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-num {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-title { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -0.1px; }

/* ── Media Selector ── */
.media-options { display: flex; gap: 8px; }
.media-btn {
  flex: 1;
  padding: 14px 8px 12px;
  border: 1.5px solid #e6eaed;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
}
.media-btn:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-dark); }
.media-btn.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #f0fdf6, #e8f9ef);
  color: var(--accent-dark);
  box-shadow: var(--accent-glow);
}
.media-btn .icon {
  width: 36px; height: 36px;
  border-radius: 10px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.media-btn.active .icon, .media-btn:hover .icon { background: rgba(37,211,102,.15); }
.media-btn svg { width: 17px; height: 17px; }

/* ── Upload Area ── */
.upload-area {
  margin-top: 12px;
  border: 1.5px dashed #ced4da;
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  background: var(--surface-2);
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-dim); }
.upload-area input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-area-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius); background: #e6eaed;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.upload-area-text { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.upload-area-hint { margin-top: 4px; font-size: 11px; color: var(--text-faint); }

/* ── Media Preview (Editor) ── */
.media-preview {
  position: relative;
  margin-top: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  max-height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.media-preview img, .media-preview video {
  max-width: 100%; max-height: 220px;
  object-fit: contain; display: block;
}
.remove-media {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  color: #fff; border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.remove-media:hover { background: rgba(239,68,68,.85); }

/* ── Format Toolbar ── */
.format-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1.5px solid #e6eaed;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.fmt-btn {
  padding: 5px 9px;
  border: none; background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px; color: var(--text-muted); font-weight: 700;
  transition: all 0.12s; line-height: 1;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.fmt-btn:hover { background: #e6eaed; color: var(--text); }
.fmt-italic { font-style: italic; }
.fmt-strike { text-decoration: line-through; }
.fmt-divider { width: 1px; height: 18px; background: #d1d7db; margin: 0 4px; }
.fmt-hint { margin-left: auto; font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* ── WYSIWYG Editor ── */
.rich-editor {
  width: 100%;
  min-height: 140px;
  max-height: 300px;
  padding: 12px 14px;
  border: 1.5px solid #e6eaed;
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 14px; line-height: 1.6;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  outline: none;
  overflow-y: auto;
  transition: border-color 0.15s;
  white-space: pre-wrap;
  word-break: break-word;
}
.rich-editor:focus { border-color: var(--accent); }
.rich-editor:empty::before {
  content: 'Schreibe deinen Newsletter-Text…';
  color: #c8d0d6; font-style: italic; pointer-events: none;
}

.textarea-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.format-legend { font-size: 11px; color: var(--text-faint); }
.format-legend code {
  background: var(--surface-2); border-radius: 4px;
  padding: 1px 4px; font-size: 10px; color: var(--text-muted);
}
.char-counter { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.char-counter.warn { color: #f59e0b; }
.char-counter.over  { color: #ef4444; font-weight: 700; }

/* ── Toggle ── */
.toggle-row { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #d1d7db; border-radius: 24px; transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-label { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Button Config ── */
.button-config { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.btn-type-row { display: flex; gap: 8px; }
.btn-type-opt {
  flex: 1;
  padding: 10px 6px;
  border: 1.5px solid #e6eaed;
  border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all 0.15s;
}
.btn-type-opt:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-dark); }
.btn-type-opt.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #f0fdf6, #e8f9ef);
  color: var(--accent-dark);
  box-shadow: var(--accent-glow);
}

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label {
  font-size: 10px; font-weight: 800;
  color: var(--text-faint); letter-spacing: 0.8px; text-transform: uppercase;
}
.input-field {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e6eaed; border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--text);
  outline: none; transition: border-color 0.15s; background: var(--surface);
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: #c8d0d6; }
.input-field:disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
}

.appointment-note {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px; color: #92400e;
  display: flex; gap: 8px; align-items: flex-start;
  line-height: 1.5;
}

/* ── Versand Section ── */
.segment-control {
  display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 3px;
}
.segment-opt {
  flex: 1;
  padding: 8px 10px;
  border: none; border-radius: 6px; background: transparent;
  cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
  text-align: center;
}
.segment-opt.active {
  background: var(--surface);
  color: var(--accent-dark); font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.date-time-row { display: flex; gap: 12px; }
.date-time-row .input-group { flex: 1; }

.schedule-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #1e40af;
  line-height: 1.5;
}

/* ── Send Button ── */
.send-btn {
  background: linear-gradient(135deg, #25d366, #1aaa55);
  color: #fff; border: none; border-radius: var(--radius);
  padding: 16px 28px;
  font-size: 14px; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
  letter-spacing: -0.1px;
}
.send-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(37,211,102,.45); }
.send-btn:active { transform: translateY(0); }
.send-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Preview Panel ── */
.preview-panel {
  width: 288px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 82px;
  align-self: flex-start;
}
.preview-label {
  font-size: 10px; font-weight: 800; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 1px;
}

/* ── Phone Shell ── */
.phone-shell {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border-radius: 44px;
  border: 9px solid #1c1c1e;
  background: #e5ddd5;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.06),
    0 32px 72px rgba(0,0,0,.22),
    0 8px 24px rgba(0,0,0,.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 76px; height: 22px;
  background: #1c1c1e;
  border-radius: 18px;
  z-index: 10;
}

/* Status Bar */
.wa-statusbar {
  background: #075e54;
  height: 44px;
  display: flex; align-items: flex-end;
  justify-content: space-between;
  padding: 0 16px 7px;
  flex-shrink: 0;
}
.wa-statusbar-time { font-size: 11px; color: rgba(255,255,255,.95); font-weight: 700; }
.wa-statusbar-icons { display: flex; gap: 4px; align-items: center; opacity: .9; }

/* WA Header */
.wa-header {
  background: #075e54;
  padding: 8px 12px 10px;
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.wa-back { color: rgba(255,255,255,.8); font-size: 20px; line-height: 1; }
.wa-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.wa-contact-info { flex: 1; min-width: 0; }
.wa-contact-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.wa-contact-status { font-size: 10px; color: rgba(255,255,255,.65); }
.wa-header-icons { margin-left: auto; display: flex; gap: 12px; color: rgba(255,255,255,.8); }

/* Chat Area */
.wa-chat-area {
  flex: 1;
  padding: 8px 8px 10px;
  overflow-y: auto;
  background-color: #e5ddd5;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,.015) 0px, rgba(0,0,0,.015) 1px,
    transparent 1px, transparent 10px
  );
  min-height: 0;
}

/* Date chip */
.wa-date-chip { text-align: center; margin-bottom: 8px; }
.wa-date-chip span {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(4px);
  font-size: 10px; color: #54656f;
  padding: 3px 9px; border-radius: 8px; font-weight: 500;
}

/* Bubble */
.wa-bubble {
  background: #fff;
  border-radius: 0 8px 8px 8px;
  padding: 6px 8px 4px;
  max-width: 92%;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  position: relative;
}
.wa-bubble::before {
  content: '';
  position: absolute; left: -7px; top: 0;
  border-width: 0 8px 8px 0; border-style: solid;
  border-color: transparent #fff transparent transparent;
}

/* Media in bubble */
.wa-media-wrap {
  width: 100%;
  border-radius: 5px; overflow: hidden;
  margin-bottom: 5px;
  background: #f0f2f5;
  display: flex; align-items: center; justify-content: center;
  min-height: 90px;
}
.wa-media-wrap img, .wa-media-wrap video {
  width: 100%; max-height: 150px;
  object-fit: cover; display: block;
}
.wa-media-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; color: #8696a0; font-size: 10px;
  min-height: 80px; background: #f0f2f5; width: 100%;
}

/* Greeting */
.wa-greeting { font-size: 13px; font-weight: 400; color: #111b21; margin-bottom: 3px; }

/* Text */
.wa-text { font-size: 13px; color: #111b21; line-height: 1.45; word-break: break-word; }
.wa-text.placeholder { color: #c8d0d6; font-style: italic; }

/* Time */
.wa-time-row {
  display: flex; align-items: center; justify-content: flex-end; gap: 3px;
  margin-top: 3px;
}
.wa-time { font-size: 10px; color: #8696a0; }
.wa-tick { color: #53bdeb; }

/* Button in bubble */
.wa-btn-divider { height: 1px; background: #e9edef; margin: 6px -8px 0; }
.wa-btn-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 0 3px;
  color: #027eb5; font-size: 12px; font-weight: 600;
}
.wa-btn-row.appointment { color: #128c7e; }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
  z-index: 999; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius-xl); padding: 28px;
  max-width: 580px; width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  border: 1px solid var(--border);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-title { font-size: 15px; font-weight: 800; color: var(--text); }
.modal-close {
  background: var(--surface-2); border: none; font-size: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: #e9edef; }
.modal-pre {
  background: var(--surface-2); border: 1px solid #e6eaed; border-radius: var(--radius-sm);
  padding: 16px; font-size: 12px; overflow: auto; max-height: 320px;
  color: var(--text); white-space: pre-wrap; word-break: break-all;
  font-family: 'Menlo', 'Monaco', monospace; line-height: 1.6;
}
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-btn {
  flex: 1; border: none; border-radius: var(--radius-sm); padding: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif; transition: all 0.15s;
}
.modal-btn-primary { background: var(--accent); color: #fff; }
.modal-btn-primary:hover { background: #1ebe5d; }
.modal-btn-secondary { background: var(--surface-2); color: var(--text-muted); }
.modal-btn-secondary:hover { background: #e9edef; }
.modal-btn-danger { background: #fee2e2; color: #dc2626; }
.modal-btn-danger:hover { background: #fecaca; }

/* ── Custom Date Picker ── */
.date-picker-wrap { position: relative; }
.dp-display-input { cursor: pointer; }

.date-picker-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid #e6eaed;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
  padding: 16px;
  z-index: 300;
  width: 256px;
  user-select: none;
}
.date-picker-dropdown.open { display: block; }

.dp-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.dp-nav {
  width: 28px; height: 28px;
  border: 1.5px solid #e6eaed;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 17px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.dp-nav:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-dim); }
.dp-month-year { font-size: 13px; font-weight: 700; color: var(--text); }

.dp-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.dp-weekdays span {
  text-align: center; font-size: 10px; font-weight: 800;
  color: var(--text-faint); letter-spacing: 0.2px; padding: 3px 0;
}

.dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.dp-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.12s;
  border: none; background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.dp-day:hover:not(.dp-day-disabled):not(.dp-day-selected) {
  background: var(--accent-dim); color: var(--accent-dark);
}
.dp-day-selected { background: var(--accent); color: #fff; font-weight: 800; }
.dp-day-today:not(.dp-day-selected) {
  color: var(--accent-dark); border: 1.5px solid rgba(37,211,102,0.4);
}
.dp-day-disabled { color: #d1d7db; cursor: not-allowed; }
.dp-day-empty { cursor: default; }

.dp-manual {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f5;
}
.dp-manual-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #e6eaed; border-radius: var(--radius-sm);
  font-size: 12px; font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text); outline: none;
  transition: border-color 0.15s;
}
.dp-manual-input::placeholder { color: var(--text-faint); }
.dp-manual-input:focus { border-color: var(--accent); }

/* ── Custom Time Picker ── */
.time-picker-wrap { position: relative; }
.tp-display-input { cursor: pointer; }

.time-picker-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid #e6eaed;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
  padding: 16px;
  z-index: 300;
  width: 220px;
  user-select: none;
}
.time-picker-dropdown.open { display: block; }

.tp-section-label {
  font-size: 10px; font-weight: 800;
  color: var(--text-faint); letter-spacing: 0.8px;
  text-transform: uppercase; margin-bottom: 8px;
}

.tp-hours {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  margin-bottom: 14px;
}
.tp-hour-btn {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text);
  border: none; background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.12s;
}
.tp-hour-btn:hover:not(.tp-selected) {
  background: var(--accent-dim); color: var(--accent-dark);
}
.tp-selected { background: var(--accent); color: #fff; font-weight: 800; }

.tp-minutes {
  display: flex; gap: 8px;
}
.tp-min-btn {
  flex: 1; padding: 9px;
  border: 1.5px solid #e6eaed; border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.12s;
  text-align: center;
}
.tp-min-btn:hover:not(.tp-selected) {
  border-color: var(--accent); color: var(--accent-dark); background: var(--accent-dim);
}
.tp-min-btn.tp-selected {
  border-color: var(--accent); background: var(--accent-dim);
  color: var(--accent-dark); font-weight: 800;
  box-shadow: var(--accent-glow);
}

/* ── Bestätigungs-Ansicht ── */
.confirm-view {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: flex-start;
  padding: 32px;
}
.confirm-inner {
  width: 100%;
  max-width: 640px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 0;
  margin-bottom: 28px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.confirm-hero { margin-bottom: 24px; }
.confirm-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.confirm-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.confirm-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.confirm-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.confirm-card-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-faint);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.confirm-card-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}
.confirm-text-preview {
  font-size: 13px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 110px;
  overflow: hidden;
}
.confirm-value-empty { color: var(--text-faint) !important; font-style: italic; }

.confirm-schedule-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: #b91c1c;
  line-height: 1.5;
  margin-bottom: 14px;
}
.confirm-error svg { flex-shrink: 0; margin-top: 1px; }

.confirm-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.back-btn {
  padding: 14px 20px;
  border: 1.5px solid #e6eaed;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.back-btn:hover { border-color: var(--text-muted); color: var(--text); }
.confirm-send-btn { flex: 1; }

.json-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
}
.json-details summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  padding: 14px 0;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.json-details summary::-webkit-details-marker { display: none; }
.json-details summary::before {
  content: '›';
  font-size: 16px;
  transition: transform 0.2s;
  display: inline-block;
  line-height: 1;
}
.json-details[open] summary { color: var(--text-muted); }
.json-details[open] summary::before { transform: rotate(90deg); }
.json-details-inner { padding-bottom: 16px; }
.json-details pre {
  background: var(--surface-2);
  border: 1px solid #e6eaed;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 11px;
  overflow: auto;
  max-height: 280px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Menlo', 'Monaco', monospace;
  line-height: 1.6;
  margin-bottom: 10px;
}
.json-copy-btn {
  border: 1.5px solid #e6eaed;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
}
.json-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-dim);
}

/* ── Erfolgs-Ansicht ── */
.success-view {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 32px;
  min-height: 400px;
}
.success-inner {
  text-align: center;
  max-width: 420px;
}
.success-icon {
  width: 88px;
  height: 88px;
  background: linear-gradient(135deg, #f0fdf6, #e0f9ec);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  color: var(--accent);
  box-shadow: 0 0 0 12px rgba(37,211,102,.08);
}
.success-circle {
  stroke-dasharray: 144;
  stroke-dashoffset: 144;
  animation: draw-circle 0.5s ease forwards;
}
.success-check {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: draw-check 0.35s ease forwards 0.45s;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-check  { to { stroke-dashoffset: 0; } }

.success-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.success-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 36px;
}
.success-new-btn { width: 100%; }

/* ── Kampagnen-Übersicht ── */
.campaigns-view {
  flex: 1;
  padding: 32px;
  display: flex;
  justify-content: center;
}
.campaigns-inner {
  width: 100%;
  max-width: 860px;
}
.campaigns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.campaigns-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.campaigns-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
}
.campaigns-new-btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 12px 20px;
  font-size: 13px;
}

/* Loading */
.campaigns-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.campaigns-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid #e6eaed;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.campaigns-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #b91c1c;
  font-size: 14px;
}
.campaigns-retry-btn {
  margin-left: auto;
  background: none;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.15s;
  white-space: nowrap;
}
.campaigns-retry-btn:hover { background: #fee2e2; }

/* Empty */
.campaigns-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 32px;
  gap: 8px;
}
.campaigns-empty-icon {
  width: 72px; height: 72px;
  background: var(--surface-2);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.campaigns-empty-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.campaigns-empty-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.campaigns-create-first-btn {
  padding: 12px 24px;
  font-size: 13px;
}

/* List */
.campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Gesperrte Elemente ── */
.media-btn { position: relative; }
.btn-type-opt { position: relative; }

.media-btn.locked,
.btn-type-opt.locked {
  opacity: 0.4;
  cursor: not-allowed;
}
.media-btn.locked:hover,
.btn-type-opt.locked:hover {
  border-color: #e6eaed !important;
  background: var(--surface) !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  transform: none !important;
}
.media-btn.locked .icon { background: var(--surface-2) !important; }
.locked-icon {
  position: absolute;
  top: 6px; right: 6px;
  color: var(--text-faint);
  pointer-events: none;
}

/* ── Lade-Ansicht ── */
.loading-view {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 32px;
  min-height: 400px;
}
.loading-inner { text-align: center; max-width: 380px; }
.loading-spinner-large {
  width: 72px; height: 72px;
  border: 4px solid #e6eaed;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 28px;
}
.loading-title {
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.4px; margin-bottom: 10px;
}
.loading-subtitle { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Campaign Card */
.campaign-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.03);
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow 0.15s;
}
.campaign-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.09), 0 6px 24px rgba(0,0,0,.06);
}
.campaign-card--deleted {
  opacity: 0.45;
  filter: grayscale(0.4);
}
.campaign-card--deleted:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.03);
}

.campaign-thumb {
  width: 68px; height: 68px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.campaign-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}


.campaign-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.campaign-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.campaign-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.campaign-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-approved { background: #dcfce7; color: #15803d; }
.badge-pending  { background: #fef9c3; color: #a16207; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }
.badge-planned  { background: var(--surface-2); color: var(--text-muted); }
.badge-sending  { background: #dbeafe; color: #1d4ed8; }
.badge-sent     { background: #dcfce7; color: #15803d; }

.campaign-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.campaign-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.campaign-meta {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
}
.campaign-card-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.delete-campaign-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
}
.delete-campaign-btn:hover { background: #fee2e2; }
.test-msg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid #e6eaed;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
}
.test-msg-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-dim);
}

/* Test-Modal Loading */
.test-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Test-Modal Erfolg */
.test-success {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 14px;
}

/* Success-View Buttons */
.success-campaigns-btn { width: 100%; }
.success-new-link {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  padding: 8px;
  margin-top: 4px;
  transition: color 0.15s;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.success-new-link:hover { color: var(--text-muted); }

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

@media (max-width: 820px) {
  .main { flex-direction: column; padding: 16px; }
  .preview-panel { width: 100%; position: static; }
  .phone-shell { max-width: 280px; margin: 0 auto; }
}
