:root {
  --bg: #f4f1ec;
  --ink: #1f2a2e;
  --muted: #6b7478;
  --card: #ffffff;
  --line: #e3ddd4;
  --brand: #008069;
  --brand-dark: #075e54;
  --wa-bg: #efeae2;
  --wa-out: #d9fdd3;
  --wa-in: #ffffff;
  --accent: #c2185b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: var(--brand-dark); }

.top { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; max-width: 1080px; margin: 0 auto; padding: 28px 16px 8px; }
.top h1 { margin: 0; font-size: 26px; }
.top h1 span { display: block; font-size: 14px; font-weight: 500; color: var(--accent); letter-spacing: .02em; }
.top p { margin: 6px 0 0; color: var(--muted); }
.btn { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; border: 0; cursor: pointer; font: inherit; }
.btn.ghost { background: transparent; color: var(--brand-dark); border: 1.5px solid var(--brand); }

.tabs { display: none; max-width: 1080px; margin: 12px auto 0; padding: 0 16px; gap: 8px; }
.tab { flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font: inherit; font-weight: 600; cursor: pointer; }
.tab.active { border-color: var(--brand); color: var(--brand-dark); }

.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; max-width: 1080px; margin: 0 auto; padding: 16px; }
.label { margin-bottom: 10px; }
.label strong { font-size: 17px; }
.label span { display: block; color: var(--muted); font-size: 13px; }

.phone { height: 620px; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--wa-bg); box-shadow: 0 10px 40px rgba(31,42,46,.15); border: 6px solid #1f2a2e; }
.col[data-mode="robot"] .phone { filter: saturate(.75); }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--brand-dark); color: #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #fce4ec; color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.who { flex: 1; line-height: 1.2; }
.who small { opacity: .85; font-size: 12px; }
.reset { background: transparent; color: #fff; border: 0; font-size: 20px; cursor: pointer; }

.wa-body { flex: 1; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 6px;
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 18px 18px; }
.day { align-self: center; background: #fff; color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 8px; margin-bottom: 6px; }
.msg { max-width: 84%; padding: 7px 10px 18px; border-radius: 10px; position: relative; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.msg.user { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 2px; }
.msg.bot { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 2px; }
.msg a { color: #027eb5; word-break: break-all; }
.msg time { position: absolute; right: 8px; bottom: 3px; font-size: 11px; color: var(--muted); }
.msg.user time::after { content: " ✓✓"; color: #53bdeb; }
.msg.err { background: #fdecea; color: #8a1c1c; }
.typing { align-self: flex-start; background: #fff; padding: 10px 14px; border-radius: 10px; }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #9aa; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.event { align-self: center; max-width: 90%; font-size: 12.5px; padding: 8px 12px; border-radius: 10px; text-align: center; }
.event.memory { background: #ede7f6; border: 1px solid #d1c4e9; }

.wa-input { display: flex; gap: 8px; padding: 8px 10px 10px; }
.wa-input input { flex: 1; border: 0; border-radius: 22px; padding: 11px 16px; font: inherit; outline: none; }
.wa-input button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 18px; cursor: pointer; }
.wa-input button:disabled { opacity: .5; }

.meter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meter span { flex: 1; min-width: 100px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.meter i { display: block; font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.meter b { font-variant-numeric: tabular-nums; }
.memory { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.memory summary { cursor: pointer; font-weight: 600; }
.memory p { margin: 6px 0 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; }

.try { max-width: 1080px; margin: 8px auto 0; padding: 0 16px; }
.try h2 { font-size: 18px; margin: 16px 0 10px; }
.try-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.try-grid button { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 14px; cursor: pointer; }
.try-grid button:hover { border-color: var(--brand); }
.hint { color: var(--muted); font-size: 13px; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 16px; }

@media (max-width: 760px) {
  .tabs { display: flex; }
  .stage { grid-template-columns: 1fr; }
  .col { display: none; }
  .col.show { display: block; }
  .phone { height: 70vh; border-width: 0; border-radius: 14px; }
  .try-grid { grid-template-columns: 1fr; }
}

