:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #171210;
  color: #f8efe4;
  --cream: #f8efe4;
  --muted: #b8a99c;
  --terracotta: #df7653;
  --terracotta-deep: #8e3d2e;
  --card: rgba(49, 35, 29, 0.78);
  --line: rgba(248, 239, 228, 0.12);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 5%, rgba(208, 104, 70, 0.28), transparent 32rem),
    radial-gradient(circle at 90% 80%, rgba(122, 72, 46, 0.24), transparent 34rem),
    #171210;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.08;
  pointer-events: none;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.shell { width: min(840px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0 42px; }
.hero { text-align: center; }
.eyebrow { color: var(--terracotta); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; }
h1 { margin: 18px 0 14px; font-family: Georgia, serif; font-size: clamp(2.7rem, 8vw, 5.4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.94; }
.lead { max-width: 590px; margin: 0 auto; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.guide-card { display: flex; align-items: center; gap: 14px; width: min(520px, 100%); margin: 38px auto 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); text-align: left; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2); }
.guide-avatar { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #e8946f, #7c3025); color: white; font-family: Georgia, serif; font-size: 1.35rem; }
.guide-name { font-weight: 700; }
.guide-role { margin-top: 3px; color: var(--muted); font-size: 0.85rem; }
.status-pill { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #7f736b; }
.status-pill.active { color: #b7e2b2; }
.status-pill.active .status-dot { background: #7dcc71; box-shadow: 0 0 0 5px rgba(125, 204, 113, 0.12); }
.status-pill.error { color: #ffab8b; }
.status-pill.error .status-dot { background: #ec765d; }
.controls { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
button { font: inherit; cursor: pointer; }
.talk-button, .secondary-button { border-radius: 999px; transition: transform 160ms ease, background 160ms ease, opacity 160ms ease; }
.talk-button { display: inline-flex; align-items: center; gap: 11px; min-height: 54px; padding: 0 25px; border: 0; background: var(--terracotta); color: white; font-weight: 700; box-shadow: 0 10px 30px rgba(207, 98, 66, 0.25); }
.talk-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.talk-button.active { background: var(--terracotta-deep); }
.talk-button:disabled { cursor: wait; opacity: 0.7; }
.mic-icon { display: inline-grid; width: 24px; height: 24px; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-size: 0; }
.mic-icon::after { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.secondary-button { min-height: 48px; padding: 0 18px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.hint { min-height: 1.4em; margin: 13px 0 0; color: var(--muted); font-size: 0.86rem; }
.conversation-card { margin-top: 38px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(31, 24, 21, 0.75); }
.conversation-header { display: flex; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.live-badge { color: #81756d; font-size: 0.68rem; }
.live-badge.active { color: #94cf8c; }
.conversation { display: flex; min-height: 190px; flex-direction: column; gap: 14px; padding: 24px; }
.empty-state { display: grid; flex: 1; place-items: center; align-content: center; min-height: 140px; color: var(--muted); text-align: center; }
.empty-state p { max-width: 500px; margin: 12px auto 0; line-height: 1.55; }
.empty-icon { color: var(--terracotta); font-size: 1.7rem; }
.message { max-width: 82%; padding: 13px 16px; border-radius: 16px; line-height: 1.52; white-space: pre-wrap; }
.message.user { align-self: flex-end; border-bottom-right-radius: 5px; background: #47352c; }
.message.assistant { align-self: flex-start; border-bottom-left-radius: 5px; background: #2b2521; }
.message-label { margin-bottom: 5px; color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
footer { margin-top: 22px; color: #80746b; font-size: 0.76rem; line-height: 1.5; text-align: center; }
@media (max-width: 580px) { .shell { padding-top: 48px; } .guide-card { align-items: flex-start; } .status-pill { margin-top: 4px; } .message { max-width: 94%; } }
