:root {
  --bg: #f6efe4;
  --ink: #1f1b18;
  --muted: #6b6257;
  --panel: rgba(255, 250, 244, 0.82);
  --line: rgba(55, 41, 22, 0.12);
  --accent: #146356;
  --accent-strong: #0e4f45;
  --warn: #a64b2a;
  --shadow: 0 20px 60px rgba(65, 47, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(244, 183, 111, 0.34), transparent 30%),
    radial-gradient(circle at bottom right, rgba(20, 99, 86, 0.2), transparent 35%),
    linear-gradient(160deg, #f8f3eb 0%, #f2e7d7 100%);
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

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

.hero {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
}

.summary {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.customer-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

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

.field span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 108px;
}

.field.full {
  grid-column: 1 / -1;
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(20, 99, 86, 0.12);
  color: var(--accent-strong);
  font-weight: 700;
}

.status-note {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  min-height: 460px;
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

#sessionTimer {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.transcript,
.events,
.tool-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transcript {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.entry {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  line-height: 1.55;
}

.entry.user {
  background: rgba(20, 99, 86, 0.08);
}

.entry.assistant {
  background: rgba(255, 255, 255, 0.72);
}

.entry.system {
  background: rgba(166, 75, 42, 0.08);
}

.entry-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.events {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow: auto;
}

.events li {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.5;
}

.result-box + .result-box {
  margin-top: 14px;
}

.result-box h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.snapshot,
.tool-result {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  line-height: 1.55;
}

.snapshot strong,
.tool-result strong {
  color: var(--ink);
}

.tool-results {
  max-height: 220px;
  overflow: auto;
}

.tool-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty {
  color: var(--muted);
}

audio {
  width: 0;
  height: 0;
  opacity: 0;
}

@media (max-width: 900px) {
  .customer-form {
    grid-template-columns: 1fr;
  }

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

  .shell {
    width: min(100vw - 20px, 100%);
    padding-top: 20px;
  }

  .hero,
  .panel {
    border-radius: 20px;
  }
}
