:root {
  --bg: #0e1116;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --error: #ff7b72;
  --success: #3fb950;
  --warn: #d29922;
  --chip-bg: #21262d;
  --msg-bg: #0e1116;
}

/* Helles Design */
[data-theme="light"] {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --border: #d0d7de;
  --text: #1f2328;
  --muted: #59636e;
  --accent: #6e4bff;
  --accent2: #0891b2;
  --error: #d1242f;
  --success: #1a7f37;
  --warn: #9a6700;
  --chip-bg: #eaeef2;
  --msg-bg: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

h1 { margin: 0; font-size: 22px; }
h2 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

#dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
#dot.online { background: var(--success); box-shadow: 0 0 10px var(--success); }
#dot.connecting { background: var(--warn); }
#dot.offline { background: var(--error); }

.providers {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.provider-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.provider-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.provider-chip input {
  margin: 0;
  accent-color: var(--success);
}

.provider-chip.pending {
  border-color: var(--warn);
}

.provider-chip.pending input { accent-color: var(--warn); }
.provider-chip.pending span { color: var(--warn); }

.actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.chat {
  flex: 1;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.msg {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--msg-bg);
  border: 1px solid var(--border);
}

.msg.user { border-left: 4px solid var(--accent2); }
.msg.assistant { border-left: 4px solid var(--accent); }
.msg.error { border-left: 4px solid var(--error); }

.msg strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.msg p { margin: 0; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }

.input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

textarea {
  width: 100%;
  min-height: 70px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  resize: vertical;
}

textarea:focus { outline: none; border-color: var(--accent); }

.input-buttons {
  display: flex;
  gap: 10px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.1); }
button.recording { background: var(--error); }

#micBtn,
#optionsBtn {
  background: var(--chip-bg);
  border: 1px solid var(--border);
}

#optionsBtn {
  margin-left: auto;
}

#optionsPanel {
  position: fixed;
  right: 16px;
  bottom: 96px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

#optionsPanel.hidden { display: none; }

.options-header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.options-body { padding: 12px 14px; }

.options-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.options-item button {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .container { padding: 10px; }
  .input-buttons { flex-direction: column; }
}
