:root {
  --bg: #f7f5f1;
  --bg-card: #ffffff;
  --border: #e6e3dc;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-soft: #9a9a9a;
  --primary: #d40511;        /* Porsche Holding rot */
  --primary-hover: #b30410;
  --accent: #1a1a1a;
  --success: #16a34a;
  --warn: #eab308;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

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

html, body {
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

.bg-decoration {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(212, 5, 17, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(26, 26, 26, 0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px 24px;
}

/* ===== Profil-Karte ===== */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 32px;
  height: fit-content;
}

.avatar-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.live-dot {
  position: absolute;
  bottom: 8px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-soft);
  border: 4px solid var(--bg-card);
  transition: background 0.2s;
}

.live-dot.connected { background: var(--success); }
.live-dot.speaking {
  background: var(--primary);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.75; }
}

.name {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.title {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.title .company {
  font-weight: 600;
  color: var(--text);
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
}

.tag {
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-soft);
  flex-shrink: 0;
}

.dot.connected { background: var(--success); }
.dot.speaking { background: var(--primary); animation: pulse 1s infinite; }
.dot.error { background: var(--primary); }

.controls {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(212, 5, 17, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(212, 5, 17, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
}

.btn-whatsapp {
  display: flex;
  width: 100%;
  background: #25D366;
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp:hover {
  background: #1ebd5b;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp svg {
  flex-shrink: 0;
}

.channel-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.hint {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.5;
}

/* ===== Konversations-Bereich ===== */
.conversation {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

.conv-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.conv-header p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.suggestion {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.suggestion:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.suggestion-icon {
  font-size: 20px;
  line-height: 1;
}

.suggestion-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin-bottom: 2px;
}

.suggestion-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.transcript {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-y: auto;
  min-height: 280px;
  max-height: 460px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 220px;
  text-align: center;
  color: var(--text-soft);
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.empty-state span {
  font-size: 12px;
  max-width: 280px;
}

.msg {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-user {
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-left: 32px;
}

.msg-agent {
  background: rgba(212, 5, 17, 0.04);
  border: 1px solid rgba(212, 5, 17, 0.15);
  margin-right: 32px;
}

.msg-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.msg-user .msg-label { color: var(--text-muted); }
.msg-agent .msg-label { color: var(--primary); }

.msg-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px 32px 32px;
  color: var(--text-soft);
  font-size: 12px;
  position: relative;
  z-index: 1;
}

.dot-sep { margin: 0 8px; }

.footer a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.15s;
}

.footer a:hover {
  color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 20px;
  }

  .profile-card {
    position: static;
    padding: 24px;
  }

  .avatar-wrap {
    width: 140px;
    height: 140px;
  }

  .conversation {
    padding: 24px;
    min-height: auto;
  }

  .transcript {
    min-height: 200px;
  }

  .msg-user, .msg-agent {
    margin-left: 0;
    margin-right: 0;
  }
}
