:root {
  --areia: #f3e6d4;
  --papel: #faf6f0;
  --terracota: #c45c3e;
  --sálvia: #6b8f71;
  --marine: #0c2e2a;
  --tinta: #1a1a18;
  --muted: #6a655c;
  --card: #fffdf9;
  --line: #e5d9c8;
  --ok: #2f6f5e;
  --err: #a33;
  --shadow: 0 12px 40px rgba(26, 26, 24, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #fff8ee 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8f0ea 0%, transparent 45%),
    var(--papel);
  color: var(--tinta);
  line-height: 1.5;
  min-height: 100dvh;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1.15rem 3rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracota);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(1.55rem, 4.5vw, 1.9rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.lede { margin: 0; color: var(--muted); font-size: 1rem; }
.lede strong { color: var(--marine); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.15rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}

.product {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.9rem;
  align-items: center;
}

.swatch {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, #2a2118 0%, #8b6914 28%, #d4a017 48%, #1a1410 70%, #c9a227 100%);
  border: 1px solid var(--line);
}

.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sálvia);
  margin: 0 0 0.2rem;
  font-weight: 600;
}

.product h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.price { margin: 0 0 0.35rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  cursor: pointer;
  font-size: 0.92rem;
}
.consent input { margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--marine); }

.status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  font-size: 0.92rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bbb;
  flex-shrink: 0;
}
.dot.idle { background: #bbb; }
.dot.connecting { background: #e0a800; box-shadow: 0 0 0 4px rgba(224,168,0,.15); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 4px rgba(47,111,94,.18); animation: pulse 1.6s ease infinite; }
.dot.error { background: var(--err); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(47,111,94,.18); }
  50% { box-shadow: 0 0 0 8px rgba(47,111,94,.08); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--marine);
  color: #f5faf8;
}
.btn.primary:not(:disabled):hover { background: #164840; }
.btn.ghost {
  margin-top: 0.55rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: #f5efe6; }

.hint { margin: 0.75rem 0 0; }
#sessaoLine { margin-top: 0.6rem; word-break: break-all; }

.transcript {
  margin-top: 1rem;
  max-height: 42vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bubble {
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.92rem;
  max-width: 95%;
  white-space: pre-wrap;
}
.bubble.sofia {
  background: #eef5f2;
  color: var(--marine);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.bubble.you {
  background: #f3e8dc;
  color: var(--tinta);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.bubble .who {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.foot {
  margin-top: 1.75rem;
  text-align: center;
}
.foot a { color: var(--marine); }

/* Mic pretest */
.mic-test {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.mic-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.meter {
  height: 10px;
  background: #eee6da;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.65rem 0 0.45rem;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sálvia), var(--marine));
  border-radius: 999px;
  transition: width 0.06s linear;
}
.mic-ok {
  margin: 0.5rem 0 0;
  color: var(--ok);
  font-weight: 600;
  font-size: 0.9rem;
}
.bubble .body { display: inline; }

/* Encerramento da sessão — bem visível */
.end-banner {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: #e8f3ef;
  border: 1px solid #b7d4c8;
  color: var(--marine);
}
.end-banner .end-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.end-banner .end-body {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  line-height: 1.4;
}
.end-banner .mono { margin: 0; }

@media (min-width: 480px) {
  .page { padding-top: 2.25rem; }
}
