:root {
  --bg: #f5efe3;
  --bg-strong: #eadab8;
  --panel: rgba(255, 251, 245, 0.84);
  --panel-border: rgba(74, 53, 41, 0.16);
  --ink: #1f1713;
  --muted: #6b594d;
  --accent: #c65b2f;
  --accent-soft: rgba(198, 91, 47, 0.16);
  --accent-dark: #8f3713;
  --success: #255d4d;
  --shadow: 0 30px 80px rgba(74, 53, 41, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(198, 91, 47, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(37, 93, 77, 0.16), transparent 28%),
    linear-gradient(180deg, #f8f2e8 0%, #efe6d5 100%);
  color: var(--ink);
  font-family: "Aptos", "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 40px;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.32;
  pointer-events: none;
}

.ambient-left {
  left: -120px;
  top: 120px;
  background: rgba(198, 91, 47, 0.36);
}

.ambient-right {
  right: -120px;
  bottom: 80px;
  background: rgba(37, 93, 77, 0.3);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}

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

.hero-copy {
  padding: 30px 32px;
}

.hero-copy h1 {
  margin: 8px 0 14px;
  font-size: clamp(2.7rem, 4vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

.hero-copy .lede,
.panel-kicker,
.message-time,
.field span,
.status-box,
.pill,
.hero-label,
.hero-status-grid span {
  color: var(--muted);
}

.eyebrow,
.panel-kicker,
.hero-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.hero-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.hero-status-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.control-column,
.chat-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  padding: 22px;
}

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

.panel-heading h2 {
  margin: 6px 0 0;
  font-size: 1.45rem;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(31, 23, 19, 0.05);
  font-size: 0.85rem;
  font-weight: 700;
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.field span {
  font-size: 0.86rem;
  font-weight: 700;
}

.field-hint {
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(67, 55, 48, 0.74);
}

.field-hint code {
  font-size: 0.78rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(31, 23, 19, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 14px 16px;
  resize: vertical;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(198, 91, 47, 0.45);
  box-shadow: 0 0 0 4px rgba(198, 91, 47, 0.12);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

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

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.button-primary {
  background: linear-gradient(135deg, #d26031 0%, #b34b20 100%);
  color: white;
  box-shadow: 0 14px 24px rgba(198, 91, 47, 0.24);
}

.button-secondary {
  background: rgba(37, 93, 77, 0.14);
  color: var(--success);
}

.button-ghost {
  background: rgba(31, 23, 19, 0.06);
  color: var(--ink);
}

.transcript-panel {
  min-height: 720px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}

.message-card {
  border-radius: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(31, 23, 19, 0.09);
  background: rgba(255, 255, 255, 0.86);
}

.message-card[data-role="assistant"] {
  background: linear-gradient(135deg, rgba(198, 91, 47, 0.08), rgba(255, 255, 255, 0.95));
}

.message-card[data-role="user"] {
  background: linear-gradient(135deg, rgba(37, 93, 77, 0.08), rgba(255, 255, 255, 0.95));
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.message-role {
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.message-content {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message-audio {
  margin-top: 14px;
  width: 100%;
}

.composer {
  border-top: 1px solid rgba(31, 23, 19, 0.08);
  margin-top: 18px;
  padding-top: 18px;
}

.composer-actions {
  margin-bottom: 0;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 16px;
}

.prompt-chip {
  border-radius: 999px;
  border: 1px solid rgba(31, 23, 19, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 0.86rem;
  cursor: pointer;
}

.status-box {
  margin: 0;
  border-radius: 20px;
  padding: 16px;
  background: rgba(31, 23, 19, 0.05);
  border: 1px solid rgba(31, 23, 19, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.84rem;
}

.status-box.large {
  min-height: 220px;
}

@media (max-width: 1120px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

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

  .hero-copy {
    padding: 24px;
  }

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

  .panel {
    padding: 18px;
  }
}
