:root {
  --bg: #f7f6f2;
  --card: #ffffff;
  --ink: #17201b;
  --soft: #4b5750;
  --muted: #6b766f;
  --line: #e2e0d8;
  --accent: #0f7a4a;
  --accent-ink: #ffffff;
  --warn: #9a5b00;
  --warn-bg: #fff4e0;
  --bad: #a3221b;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.5px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { font-weight: 800; letter-spacing: .5px; text-decoration: none; color: var(--ink); }
.logo b { color: var(--accent); }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 18px; font: 600 16px/1 system-ui, sans-serif; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--bad); border: 1px solid #e7c3c0; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #8fd1ad; outline-offset: 2px; }

.hero { padding: 48px 0 32px; }
.hero p.lead { font-size: 20px; color: var(--soft); max-width: 36ch; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step-n { display: inline-block; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; text-align: center; line-height: 30px; font-weight: 700; margin-bottom: 8px; }
.note { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 14px 16px; font-size: 15px; }
ul.check { padding-left: 1.2em; }
ul.check li { margin: .35em 0; }
footer { color: var(--muted); font-size: 14px; padding: 40px 0; }

.box { max-width: 520px; margin: 32px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 2px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cfccc2; border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 14px 0; }
.checkline input { width: auto; margin-top: 5px; }
.err { color: var(--bad); font-weight: 600; min-height: 1.4em; margin: 12px 0 0; }
.ok-msg { color: var(--accent); font-weight: 600; min-height: 1.4em; margin: 12px 0 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Painel */
.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 20px; }
.stat b { display: block; font-size: 26px; }
.stat small { color: var(--muted); }
.bar { height: 8px; background: #ebe9e2; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; }
.bar.warn i { background: #d48a00; }
.panel-section { margin: 20px 0; }
.qr { text-align: center; }
.qr img { width: 260px; height: 260px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: #ebe9e2; color: var(--soft); }
.pill.on { background: #dcf3e6; color: var(--accent); }
.pill.off { background: #f6dddb; color: var(--bad); }
.convs { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 12px; }
@media (max-width: 760px) { .convs { grid-template-columns: 1fr; } }
.conv-list { list-style: none; margin: 0; padding: 0; max-height: 480px; overflow: auto; }
.conv-list li button { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 6px; cursor: pointer; font: inherit; color: var(--ink); }
.conv-list li button small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { max-height: 480px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 10px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.msg.in { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.msg.ia { background: #dcf3e6; align-self: flex-end; }
.msg.humano { background: #e5ecf7; align-self: flex-end; }
.msg small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 1.6em; }
.hidden { display: none !important; }
.scroll-x { overflow: auto; }
