* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0c;
  --panel: #15151a;
  --text: #e8e8ed;
  --muted: #7a7a85;
  --accent: #3b82f6;
  --accent-hot: #ef4444;
  --green: #22c55e;
  --orange: #f59e0b;
  --border: #2a2a32;
}
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
}
.container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  --col-ratio: 62;
  --ru-font: 18px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
h1 {
  font-size: 22px;
  font-weight: 600;
}
.subtitle {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}
.badges { display: flex; gap: 8px; }
.badge {
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--muted);
}
.badge.live { color: var(--green); border-color: var(--green); }
.badge.thinking { color: var(--orange); border-color: var(--orange); }
.badge.error { color: var(--accent-hot); border-color: var(--accent-hot); }

main { flex: 1; }

.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.mic-button {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  padding: 14px 24px;
  border-radius: 28px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}
.mic-button:hover { transform: translateY(-1px); }
.mic-button.recording {
  background: var(--accent-hot);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
.mic-icon { font-size: 20px; }

.stop-button {
  padding: 10px 18px;
  background: var(--accent-hot);
  color: white;
  border: 1px solid var(--accent-hot);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.stop-button:not(:disabled):hover { filter: brightness(1.1); }
.stop-button:disabled { opacity: 0.4; cursor: not-allowed; background: var(--panel); color: var(--muted); border-color: var(--border); }
.mute-button { background: var(--panel); color: var(--text); border-color: var(--border); }
.mute-button:not(:disabled):hover { background: var(--accent-hot); color: white; border-color: var(--accent-hot); }
.mute-button.active { background: var(--accent-hot); color: white; border-color: var(--accent-hot); animation: pulse 1.5s infinite; }

.end-button {
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.end-button:not(:disabled):hover { color: var(--text); border-color: var(--muted); }
.end-button:disabled { opacity: 0.4; cursor: not-allowed; }

.status-line {
  height: 24px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--orange);
}
.consulting.hidden { display: none; }

.meeting-area {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  min-height: 360px;
}
.transcript {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  min-height: 360px;
  max-height: 60vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.original-col { flex: calc(100 - var(--col-ratio)); }
.translation-col { flex: var(--col-ratio); }

.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.02);
}
.col-label { font-size: 11px; opacity: 0.7; }
.col-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}
.translation-col .col-body {
  font-size: var(--ru-font);
  line-height: 1.55;
}
.original-col .col-body {
  font-size: 13px;
}

.translation-entry {
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--green);
}
.translation-entry.partial {
  opacity: 0.55;
  font-style: italic;
  border-left-color: var(--orange);
}
.translation-entry .ts {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}

@media (max-width: 768px) {
  body { padding: 12px; }
  .meeting-area {
    flex-direction: column;
    min-height: auto;
  }
  .original-col, .translation-col {
    flex: none;
    min-height: 200px;
    max-height: 40vh;
  }
}
.empty-hint {
  color: var(--muted);
  text-align: center;
  padding: 80px 20px;
  font-style: italic;
}
.empty-hint em { color: var(--accent); font-style: normal; }

.transcript-entry {
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.transcript-entry.user { border-left-color: var(--accent); }
.transcript-entry.hans { border-left-color: var(--green); }
.transcript-entry .role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.transcript-entry.user .role { color: var(--accent); }
.transcript-entry.hans .role { color: var(--green); }
.transcript-entry .text {
  font-size: 14px;
  line-height: 1.5;
}

details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}
details[open] summary { color: var(--text); margin-bottom: 12px; }

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.settings-grid select,
.settings-grid input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.settings-grid small { color: var(--muted); font-size: 12px; }

#catalog-list {
  list-style: none;
  padding: 0;
}
#catalog-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
#catalog-list li:last-child { border: none; }
#catalog-list li .chunks {
  float: right;
  color: var(--muted);
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
}
#ws-status { font-size: 10px; }
#ws-status.connected { color: var(--green); }
#ws-status.disconnected { color: var(--accent-hot); }
