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

:root {
  --bg:         #0a0a0a;
  --surface:    #111111;
  --text:       #e8e8e8;
  --text-muted: #666666;
  --accent:     #7c6af7;
  --border:     #1e1e1e;
  --danger:     #e05555;
  --radius:     10px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: var(--bg);
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
}

.header-actions { display: flex; gap: 10px; }

.header-actions button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.header-actions button:hover {
  color: var(--text);
  border-color: var(--accent);
}

.chat-view {
  position: fixed;
  top: 53px; bottom: 0; left: 0; right: 0;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.msg-venvis {
  max-width: 82%;
  align-self: flex-start;
  color: var(--text);
  line-height: 1.65;
}

.msg-venvis p { margin-bottom: 0.5em; }
.msg-venvis p:last-child { margin-bottom: 0; }
.msg-venvis code {
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}
.msg-venvis pre {
  background: var(--surface);
  padding: 12px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  margin: 8px 0;
}

.msg-user {
  align-self: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius);
  max-width: 70%;
  color: var(--text);
}

.msg-error {
  align-self: center;
  color: var(--danger);
  font-size: 13px;
}

.input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.input-bar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.input-bar input:focus { border-color: var(--accent); }

.input-bar button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.input-bar button:hover { opacity: 0.85; }
.input-bar button:disabled { opacity: 0.4; cursor: not-allowed; }

.voice-view {
  position: fixed;
  top: 53px; bottom: 0; left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.voice-name {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--text);
}

.voice-status {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  min-height: 20px;
  text-align: center;
}

.push-to-talk {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.push-to-talk:active,
.push-to-talk.recording { transform: scale(0.93); }

.ptt-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.push-to-talk.recording .ptt-ring {
  border-color: var(--accent);
  animation: pulse-ring 1.2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

.voice-hint { font-size: 12px; color: var(--text-muted); }

.voice-transcript {
  max-width: 340px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  min-height: 40px;
  padding: 0 20px;
}

.thinking { display: inline-flex; gap: 4px; padding: 4px 0; }

.thinking span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: blink 1.2s ease-in-out infinite;
}

.thinking span:nth-child(2) { animation-delay: 0.2s; }
.thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40%           { opacity: 1; }
}

.memory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  z-index: 100;
}

.memory-panel {
  width: 360px;
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.memory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
}

.memory-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.memory-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memory-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 12px;
}

.memory-item-body { flex: 1; min-width: 0; }

.memory-item-key {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.memory-item-value {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.memory-item-conf {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.memory-item button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  padding: 0 2px;
  transition: color 0.15s;
}

.memory-item button:hover { color: var(--danger); }

.empty-state {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

.hidden { display: none !important; }
