:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --soft: #f1f5f9;
  --danger: #b91c1c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  height: 42px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #eef2f7;
  color: var(--text);
}

label {
  display: block;
  margin: 18px 0 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 12px 14px;
}

textarea {
  resize: vertical;
  min-height: 180px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 42px;
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.health,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.health,
.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
}

.dot.ok {
  background: var(--accent);
}

.dot.fail {
  background: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 22px;
  min-height: calc(100vh - 130px);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.side {
  padding: 22px;
  overflow: auto;
}

.token-row,
.actions,
.composer {
  display: flex;
  gap: 10px;
}

.token-row input {
  min-width: 0;
}

.actions {
  margin-top: 12px;
}

.actions input {
  height: 42px;
}

.muted {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.whatsapp {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.qr-box {
  display: grid;
  place-items: center;
  margin-top: 16px;
  min-height: 230px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.qr-box img {
  display: none;
  width: 210px;
  height: 210px;
  image-rendering: crisp-edges;
}

.chat-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 18px 0;
}

.message {
  width: fit-content;
  max-width: min(760px, 88%);
  margin: 0 0 12px;
  padding: 13px 15px;
  border-radius: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.user {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
}

.message.assistant {
  background: var(--soft);
  color: var(--text);
}

.composer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.composer input {
  height: 48px;
}

.composer button {
  height: 48px;
  min-width: 110px;
}

@media (max-width: 900px) {
  .shell {
    padding: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

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

  .chat-panel {
    min-height: 70vh;
  }
}
