:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde5;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --mine: #dcfce7;
  --theirs: #eef2f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.entry {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.entry-panel {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
}

.entry-panel h1,
.room-header h2,
.voice-panel h3 {
  margin: 4px 0 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.entry-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.entry-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.entry-actions,
.header-actions,
.voice-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 16px;
  min-height: 0;
}

.timeline-panel,
.voice-panel {
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline-panel {
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.message {
  max-width: min(72ch, 85%);
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--theirs);
}

.message.mine {
  margin-left: auto;
  background: var(--mine);
}

.message-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.voice-panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.participants {
  display: grid;
  gap: 8px;
  min-height: 92px;
  margin-bottom: 16px;
}

.participant {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
}

.error-text {
  min-height: 20px;
  margin: 8px 12px;
  color: var(--danger);
  font-size: 14px;
}

.mic-diagnostics {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.mic-diagnostics label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.mic-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.mic-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 120ms linear;
}

.mic-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

audio {
  width: min(320px, 100%);
}

@media (max-width: 760px) {
  .room-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .voice-panel {
    order: -1;
  }

  .composer {
    grid-template-columns: 1fr;
  }
}
