:root {
  --bg: #f5f8fd;
  --bg-soft: #eef4ff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text: #23284f;
  --muted: #6d7894;
  --line: rgba(69, 132, 229, 0.16);
  --line-strong: rgba(69, 132, 229, 0.28);
  --blue: #276fd6;
  --blue-soft: #edf4ff;
  --blue-strong: #1e5fc7;
  --orange: #ff5d2d;
  --orange-strong: #ff7b3d;
  --success: #2aaf7f;
  --shadow: 0 26px 70px rgba(50, 88, 166, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(70, 132, 229, 0.08), transparent 28%),
    radial-gradient(circle at 15% 20%, rgba(255, 93, 45, 0.06), transparent 22%),
    linear-gradient(180deg, #fbfdff, #f4f8fe 42%, #f7faff);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 13%, rgba(39, 111, 214, 0.12), transparent 11%),
    radial-gradient(circle at 72% 24%, rgba(39, 111, 214, 0.08), transparent 18%),
    radial-gradient(circle at 84% 36%, rgba(255, 93, 45, 0.08), transparent 10%);
  opacity: 0.9;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.hero-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 32px 28px;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -100px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(39, 111, 214, 0.12), rgba(39, 111, 214, 0));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2b74dc, #69a7ff);
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 700;
  box-shadow: 0 18px 28px rgba(39, 111, 214, 0.22);
}

.eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 3vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 9ch;
}

h2 {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.hero-copy,
.notes-card p,
.status-row span,
.audio-meta span,
label span {
  color: var(--muted);
}

.status-card,
.notes-card {
  border: 1px solid rgba(39, 111, 214, 0.1);
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(237, 244, 255, 0.7));
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(39, 111, 214, 0.08);
}

.status-row strong {
  color: var(--text);
}

.status-row:last-child {
  border-bottom: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-content: start;
}

.control-panel {
  grid-column: 1 / -1;
}

.panel {
  position: relative;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 255, 0.95)),
    var(--panel);
}

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

.panel-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 36ch;
}

.pill {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 93, 45, 0.12);
  color: var(--orange);
  font-size: 0.84rem;
  font-weight: 700;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input,
button {
  font: inherit;
}

input[type="text"] {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(39, 111, 214, 0.14);
  border-radius: 18px;
  color: var(--text);
  background: rgba(246, 250, 255, 0.92);
  outline: none;
}

input[type="text"]::placeholder {
  color: #9aa8c3;
}

input[type="text"]:focus {
  border-color: rgba(39, 111, 214, 0.45);
  box-shadow: 0 0 0 5px rgba(39, 111, 214, 0.08);
}

.toggle-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 18px;
  padding: 14px 20px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

#connect-button,
#send-button {
  background: linear-gradient(135deg, var(--orange), var(--orange-strong));
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 16px 26px rgba(255, 93, 45, 0.2);
}

.secondary {
  background: rgba(237, 244, 255, 0.95);
  color: var(--blue-strong);
  border: 1px solid rgba(39, 111, 214, 0.14);
}

.audio-panel,
.chat-panel {
  min-height: 480px;
}

.audio-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  margin-bottom: 22px;
  border-radius: 28px;
  border: 1px solid rgba(39, 111, 214, 0.12);
  background:
    radial-gradient(circle at center, rgba(39, 111, 214, 0.1), transparent 44%),
    linear-gradient(180deg, #fbfdff, #eef4ff 100%);
  overflow: hidden;
}

.wave-ring {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(39, 111, 214, 0.22);
  box-shadow:
    0 0 0 24px rgba(39, 111, 214, 0.06),
    0 0 0 58px rgba(39, 111, 214, 0.025);
  animation: pulse 2.8s infinite ease-in-out;
}

.wave-ring.second {
  width: 320px;
  height: 320px;
  opacity: 0.55;
  animation-duration: 3.4s;
}

.audio-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  padding: 24px;
  border-radius: 50%;
  text-align: center;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(225, 237, 255, 0.98));
  border: 1px solid rgba(39, 111, 214, 0.15);
  box-shadow: inset 0 -16px 28px rgba(39, 111, 214, 0.08);
}

.audio-label {
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 600;
}

.audio-readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.readout-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(39, 111, 214, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(237, 244, 255, 0.78));
}

.readout-label {
  font-size: 0.84rem;
  color: var(--muted);
}

.readout-card strong {
  color: var(--text);
  font-size: 1rem;
}

.audio-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.chat-log {
  height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.9), rgba(237, 244, 255, 0.82));
  border: 1px solid rgba(39, 111, 214, 0.08);
}

.message {
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border-left: 4px solid rgba(39, 111, 214, 0.2);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 18px rgba(39, 111, 214, 0.05);
}

.message.self {
  align-self: stretch;
  border-left-color: rgba(39, 111, 214, 0.9);
  background: linear-gradient(180deg, #eff6ff, #e3efff);
}

.message.agent {
  align-self: stretch;
  border-left-color: rgba(255, 93, 45, 0.85);
  background: linear-gradient(180deg, #fff6f2, #fff1e9);
  border-color: rgba(255, 93, 45, 0.12);
}

.message.system {
  align-self: center;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 0.86rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
}

.message.live {
  position: relative;
}

.message.live::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 6px rgba(255, 93, 45, 0.12);
}

.message-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.message.live .message-header span {
  color: var(--orange);
  font-weight: 700;
}

.message-body {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 16px;
}

#chat-input {
  border-radius: 20px;
  background: #ffffff;
}

.hidden {
  display: none;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.76;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .app-shell,
  .workspace {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .control-grid,
  .chat-compose {
    grid-template-columns: 1fr;
  }

  .audio-meta,
  .actions,
  .audio-readout {
    flex-direction: column;
    align-items: stretch;
  }

  .audio-readout {
    grid-template-columns: 1fr;
  }
}

