:root {
  --bg: #f3efe6;
  --ink: #1c1a18;
  --muted: #73695f;
  --card: rgba(255, 250, 242, 0.84);
  --line: rgba(28, 26, 24, 0.08);
  --blue: #1459c7;
  --blue-soft: #cfe1ff;
  --green: #23704a;
  --red: #b8442d;
  --gold: #b8872b;
  --shadow: 0 18px 40px rgba(36, 26, 10, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(20, 89, 199, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(184, 135, 43, 0.12), transparent 24%),
    linear-gradient(180deg, #fffaf2 0%, #f1eadc 52%, #ece3d4 100%);
  color: var(--ink);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: stretch;
}

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

.hero__copy,
.hero__panel {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.95;
  max-width: 12ch;
}

.lede,
.hint,
.session {
  color: var(--muted);
  line-height: 1.55;
}

.statusline,
.controls,
.panel__head,
.metrics,
.grid {
  display: flex;
  gap: 14px;
}

.statusline,
.panel__head {
  justify-content: space-between;
  align-items: center;
}

.controls {
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

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

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn--primary {
  background: linear-gradient(135deg, var(--blue), #0f7be1);
  color: #fff;
}

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

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge--idle,
.pill {
  background: rgba(17, 24, 39, 0.06);
  color: var(--muted);
}

.badge--live {
  background: rgba(35, 112, 74, 0.12);
  color: var(--green);
}

.badge--error {
  background: rgba(184, 68, 45, 0.14);
  color: var(--red);
}

.metrics {
  margin-top: 20px;
  flex-wrap: wrap;
}

.card {
  flex: 1 1 250px;
  padding: 20px;
}

.card__label {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.card__value {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.meter {
  margin-top: 14px;
  height: 12px;
  background: rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #1148a2 0%, #1f83ff 100%);
  transition: width 80ms linear;
}

.meter--warm span {
  background: linear-gradient(90deg, #906119 0%, #edb34d 100%);
}

.grid {
  margin-top: 20px;
  flex-wrap: wrap;
}

.panel {
  flex: 1 1 420px;
  padding: 22px;
}

.stream {
  margin-top: 18px;
  min-height: 220px;
  padding: 22px;
  border-radius: 20px;
  line-height: 1.65;
  font-size: 1.04rem;
  white-space: pre-wrap;
}

.stream--user {
  background: rgba(20, 89, 199, 0.08);
}

.stream--assistant {
  background: rgba(184, 135, 43, 0.1);
}

.panel--log {
  margin-top: 20px;
}

.log {
  margin-top: 16px;
  max-height: 240px;
  overflow: auto;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #3e372f;
}

.log__line {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(28, 26, 24, 0.08);
}

code {
  background: rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  padding: 2px 6px;
}

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