/* Tokens do brandbook LunoChat: branco primeiro, azul com propósito.
   Regra de equilíbrio: 70% superfícies claras / 20% texto e bordas / 10% azul e ciano. */
:root {
  --bg: #f8fafc;            /* Branco suave: fundo principal */
  --surface: #ffffff;
  --fill: #f1f5f9;
  --fill-hover: #e7edf5;
  --text: #101827;          /* Texto: títulos e conteúdo */
  --text-2: #526077;
  --text-3: #7c889c;
  --line: #e5eaf2;          /* Bordas de 1 px */
  --accent: #2563ff;        /* Azul principal: ações e marca */
  --accent-hover: #3882f6;  /* Azul vivo: hover e gráficos */
  --accent-soft: #e7f0ff;   /* Azul pálido: superfícies suaves e navegação ativa */
  --accent-ring: rgba(37, 99, 255, 0.18);
  --cyan: #5ac8fa;          /* Ciano: detalhes e brilho */
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.12);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.1);
  --orange-soft: #fff4e5;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 39, 0.04), 0 4px 16px rgba(16, 24, 39, 0.04);
  --shadow-lg: 0 24px 80px rgba(16, 24, 39, 0.18);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---- Botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 980px; padding: 9px 18px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 255, 0.25); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--fill); }
.btn:focus-visible, .card:focus-visible, .post:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.btn-text { background: none; color: var(--accent); padding: 8px 4px; }
.btn-text:hover { text-decoration: underline; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-lg { padding: 13px 24px; font-size: 17px; }

/* ---- Navegação ---- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; letter-spacing: -0.02em; }
.brand b, .login-card h1 b { font-weight: 700; color: var(--text); }
.brand b + span, .login-card h1 b + span { font-weight: 700; color: var(--accent); }
.brand-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.status {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 980px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; background: var(--green-soft); color: #15803d; white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.off { background: var(--red-soft); color: var(--red); }
.account { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; min-width: 0; }
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-picker { display: grid; gap: 3px; color: var(--text-3); font-size: 10px; font-weight: 600; line-height: 1.1; }
.unit-picker select {
  max-width: 240px; min-width: 120px; padding: 7px 28px 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.unit-picker-top { flex: none; }
.unit-picker-side { display: none; }
.unit-choice { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.unit-choice-card {
  width: min(100%, 480px); display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 30px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface);
  box-shadow: 0 20px 60px rgba(18, 42, 82, .08); text-align: center;
}
.unit-choice-card h1 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.unit-choice-card > p { margin: 0 0 6px; color: var(--text-2); line-height: 1.5; }
.unit-choice-list { display: grid; width: 100%; gap: 8px; }
.unit-choice-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
}
.unit-choice-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.unit-choice-option span:last-child { color: var(--accent); font-size: 22px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--fill); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--text-2);
}

/* ---- Página ---- */
.page { max-width: 1080px; margin: 0 auto; padding: 48px 22px 96px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.hero h1 {
  font-family: var(--font-display); font-size: 40px; line-height: 1.1; font-weight: 700;
  letter-spacing: -0.025em; margin: 0 0 8px;
}
.hero p { margin: 0; font-size: 16px; color: var(--text-2); max-width: 560px; }

.connect {
  display: flex; align-items: center; gap: 24px; margin-bottom: 32px; padding: 24px 32px;
  background: var(--accent-soft); border: 1px solid #d6e4ff; border-radius: var(--radius);
}
.connect .mascot { margin: 0; flex: none; }
.connect-text { flex: 1; min-width: 0; }
.connect h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; }
.connect p { margin: 0; color: var(--text-2); max-width: 520px; }
.btn-quiet { color: var(--text-2); font-size: 14px; }
a.btn { text-decoration: none; }

.banner {
  background: var(--orange-soft); border-radius: var(--radius-sm); padding: 14px 18px;
  margin-bottom: 24px; font-size: 14px; color: #8a5300;
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.stat:first-child .stat-value { color: var(--accent); }
.stat-label { color: var(--text-2); font-size: 13px; }

.section-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 16px;
}

/* ---- Segurança da conta (semáforo, limites e "Pausar tudo") ---- */
.safety { display: grid; gap: 16px; margin-bottom: 32px; padding: 20px 24px; }
.safety-yellow { border-color: #ffe7a3; }
.safety-red { border-color: #ffc8c4; }
.safety-head { display: flex; align-items: center; gap: 16px; }
.safety-light {
  display: flex; flex-direction: column; gap: 5px; padding: 7px; flex: none;
  background: var(--fill); border: 1px solid var(--line); border-radius: 13px;
}
.dot { width: 13px; height: 13px; border-radius: 50%; opacity: 0.18; transition: opacity 0.2s, box-shadow 0.2s; }
.dot-red { background: var(--red); }
.dot-yellow { background: #ffcc00; }
.dot-green { background: var(--green); }
.dot.on { opacity: 1; }
.dot-red.on { box-shadow: 0 0 10px rgba(255, 59, 48, 0.6); }
.dot-yellow.on { box-shadow: 0 0 10px rgba(255, 204, 0, 0.7); }
.dot-green.on { box-shadow: 0 0 10px rgba(52, 199, 89, 0.6); }
.safety-text { flex: 1; min-width: 0; }
.safety-eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.safety-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.safety-sub { margin: 2px 0 0; font-size: 14px; color: var(--text-2); }
.safety-btn { flex: none; }
.safety .btn-danger:hover { background: rgba(255, 59, 48, 0.16); }
.safety-alert { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--red-soft); color: #c4221a; font-size: 14px; font-weight: 600; }
.safety-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(96px, 0.45fr); gap: 12px; }
.meter { display: grid; gap: 8px; align-content: start; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.meter:not(.meter-queue) { grid-template-rows: 1fr auto; }
.meter-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.meter-label { font-size: 13px; color: var(--text-2); }
.meter-value { font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter-value b { font-size: 15px; color: var(--text); }
.meter-track { height: 8px; border-radius: 980px; background: var(--fill-hover); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; background: var(--green); transition: width 0.3s; }
.meter-yellow .meter-fill { background: #ffcc00; }
.meter-red .meter-fill { background: var(--red); }
.meter-queue { align-content: center; gap: 2px; }
.meter-big { font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.safety-why summary { width: fit-content; font-size: 13.5px; font-weight: 500; color: var(--accent); cursor: pointer; }
.safety-why p { margin: 8px 0 0; max-width: 720px; font-size: 13.5px; color: var(--text-2); }
@media (max-width: 860px) {
  .safety-bars { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .safety { padding: 16px; gap: 14px; margin-bottom: 24px; }
  .safety-head { flex-wrap: wrap; gap: 12px 14px; }
  .safety-btn { width: 100%; }
  .safety-bars { gap: 8px; }
  .meter { padding: 10px 12px; gap: 6px; }
  .meter-top { flex-direction: column; align-items: flex-start; gap: 0; }
  .meter-label { font-size: 12px; line-height: 1.3; }
}

/* ---- Cards de automação ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; margin-bottom: 56px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px; cursor: pointer; text-align: left;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-2px); border-color: #d3ddf0; box-shadow: 0 2px 4px rgba(16, 24, 39, 0.04), 0 12px 32px rgba(16, 24, 39, 0.08); }
.card.off { opacity: 0.6; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.card-meta { color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.card-meta div { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.card-meta svg { flex: none; color: var(--text-3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); color: var(--accent); border-radius: 980px;
  padding: 4px 11px; font-size: 13px; font-weight: 500;
}
.chip button { border: 0; background: none; color: inherit; padding: 0 0 0 2px; font-size: 15px; line-height: 1; opacity: 0.7; }
.chip button:hover { opacity: 1; }

.empty {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 48px 24px; text-align: center; margin-bottom: 56px;
}
.empty h3 { font-size: 21px; margin: 16px 0 6px; letter-spacing: -0.015em; }
.empty p { color: var(--text-2); margin: 0 0 22px; }
.mascot { display: block; margin: 0 auto; filter: drop-shadow(0 12px 24px rgba(37, 99, 255, 0.18)); }

/* ---- Lista de atividade (estilo Ajustes do iOS) ---- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.row + .row { border-top: 1px solid var(--line); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; }
.row-sub { color: var(--text-2); font-size: 13px; }
.row-time { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.list-empty { padding: 28px 20px; color: var(--text-2); text-align: center; }
.badge { border-radius: 980px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--green-soft); color: #1e8e3e; }
.badge-err { background: var(--red-soft); color: var(--red); }

/* ---- Toggle (estilo iOS) ---- */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 31px; background: #e9e9eb; transition: background 0.25s; }
.switch span::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.25s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.switch input:disabled + span { opacity: 0.45; }

/* ---- Login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 40px 32px 28px; box-shadow: var(--shadow); text-align: center;
}
.login-card .mascot { margin-bottom: 12px; }
.login-card h1 { font-family: var(--font-display); font-size: 32px; letter-spacing: -0.025em; margin: 0 0 6px; }
.login-card p { color: var(--text-2); margin: 0 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.google-login { display: flex; width: 100%; text-decoration: none; }
.google-mark { color: #4285f4; font-weight: 700; font-size: 18px; line-height: 1; }
.login-divider { margin: 18px 0 !important; font-size: 13px; }
.error-text { color: var(--red); font-size: 14px; min-height: 20px; margin: 0; }

/* ---- Campos ---- */
.input, .textarea {
  width: 100%; border: 1px solid transparent; background: var(--fill); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 15px; outline: none; transition: border 0.15s, background 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.textarea { resize: vertical; min-height: 72px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); display: flex; justify-content: space-between; }
.hint { font-size: 12px; color: var(--text-3); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 10px; padding: 2px; }
.segmented button {
  border: 0; background: none; border-radius: 8px; padding: 7px 10px; font-size: 14px; font-weight: 500; color: var(--text);
  transition: background 0.2s, box-shadow 0.2s;
}
.segmented button.active { background: var(--surface); color: var(--accent); box-shadow: 0 2px 6px rgba(16, 24, 39, 0.1), 0 0 0 1px rgba(37, 99, 255, 0.3); }

/* ---- Editor (folha estilo iOS) ---- */
.overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 24px; animation: fade 0.2s ease;
}
.sheet {
  width: 100%; max-width: 1000px; height: min(860px, calc(100vh - 48px));
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.sheet-bar h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-bar .left { justify-self: start; }
.sheet-bar .right { justify-self: end; }
.sheet-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.form { overflow-y: auto; padding: 24px 28px 40px; }
.preview { background: var(--bg); border-left: 1px solid var(--line); display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.preview-stack { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.group { margin-bottom: 30px; }
.group-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.015em; }
.group-desc { color: var(--text-2); font-size: 14px; margin: 0 0 14px; }
.inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--fill); border-radius: var(--radius-sm); padding: 12px 14px; }

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.post {
  position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; border: 0; padding: 0;
  background: var(--fill); outline: 3px solid transparent; outline-offset: -3px; transition: outline-color 0.15s;
}
.post img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post .check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0, 0, 0, 0.25); display: grid; place-items: center; color: #fff;
}
.post.selected { outline-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.post.selected .check { background: var(--accent); }
.post-caption { position: absolute; inset: auto 0 0 0; padding: 4px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); text-align: left; }

.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--fill); border-radius: var(--radius-sm); padding: 8px 10px; border: 1px solid transparent; }
.chip-input:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.chip-input input { flex: 1; min-width: 140px; border: 0; background: none; outline: none; padding: 4px; }

.variant { display: flex; gap: 8px; align-items: center; }
.variant + .variant { margin-top: 8px; }
.icon-btn {
  width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--fill);
  color: var(--text-2); display: grid; place-items: center; font-size: 18px;
}
.icon-btn:hover { background: var(--red-soft); color: var(--red); }

.form-error { background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }

/* ---- Prévia do iPhone ---- */
.phone {
  width: 300px; height: 620px; background: #fff; border-radius: 48px; padding: 12px;
  box-shadow: 0 0 0 10px #1d1d1f, 0 0 0 11px #3a3a3c, 0 30px 60px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.phone::before {
  content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 28px; background: #1d1d1f; border-radius: 20px; z-index: 2;
}
.phone-head { display: flex; align-items: center; gap: 10px; padding: 44px 8px 12px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.phone-head .avatar { width: 30px; height: 30px; }
.phone-head small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.chat { flex: 1; padding: 14px 6px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; font-size: 13.5px; }
.chat-note { text-align: center; color: var(--text-3); font-size: 11px; margin: 4px 0 8px; }
.reply-ref { align-self: flex-start; font-size: 11px; color: var(--text-3); margin-left: 10px; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.them { align-self: flex-start; background: #efefef; border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, #6f3ff5, #3a7bfd); color: #fff; border-bottom-right-radius: 6px; }
.bubble-card { align-self: flex-start; max-width: 80%; background: #efefef; border-radius: 18px; overflow: hidden; border-bottom-left-radius: 6px; }
.bubble-card .bubble { max-width: none; border-radius: 0; background: none; }
.bubble-card .bubble-btn { display: block; border-top: 1px solid rgba(0, 0, 0, 0.08); padding: 9px 12px; text-align: center; color: var(--accent); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 30;
  background: rgba(29, 29, 31, 0.92); color: #fff; padding: 11px 20px; border-radius: 22px; font-size: 14px;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  box-shadow: var(--shadow-lg); animation: rise 0.25s ease;
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.toast { animation-name: toast-in; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---- Abas ---- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 980px; box-shadow: var(--shadow);
  max-width: 100%; overflow-x: auto;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 980px;
  color: var(--text-2); font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); background: var(--fill); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.tab:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.tab-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 980px; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
}

.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-gray { background: var(--fill); color: var(--text-2); }
.badge-orange { background: var(--orange-soft); color: #a35b00; }

/* ---- Aprovações ---- */
.approvals { display: flex; flex-direction: column; gap: 16px; }
.approval {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 14px;
}
.approval-head { display: flex; align-items: center; gap: 12px; }
.comment {
  margin: 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--fill);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 16px; white-space: pre-wrap; word-wrap: break-word;
}
.approval-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.approval .form-error { margin: 0; }

/* ---- Perfil da IA ---- */
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.profile-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel-title { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 4px; }
.panel > .group-desc { margin-bottom: 18px; }
.panel > .field + .field, .panel > .field + .segmented { margin-top: 16px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting .hint { margin: 2px 0 0; }
.setting-stack { flex-direction: column; align-items: stretch; gap: 10px; }
.setting-title { font-weight: 500; }
.examples { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.example { display: flex; gap: 8px; align-items: flex-start; padding: 12px; background: var(--fill); border-radius: var(--radius-sm); }
.example-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.example .input, .example .textarea { background: var(--surface); }
.example .textarea { min-height: 56px; }
.save-bar { display: flex; justify-content: flex-end; }
.test-panel { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.test-panel .group-desc { margin: 0; }
.test-panel .field + .field { margin-top: 0; }
.test-panel > .btn { align-self: flex-start; }
.posts-small { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.test-result:empty { display: none; }
.test-result { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.test-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.test-bubble { max-width: 100%; font-size: 15px; }

/* ---- Posts (capas verticais, como no Reels) ---- */
.btn-sm { padding: 6px 14px; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 18px; margin-bottom: 32px; }
.reel {
  display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; background: none; text-align: left; min-width: 0;
  border-radius: var(--radius-sm);
}
.reel:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 3px; }
.reel-cover {
  position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--fill); box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.reel:hover .reel-cover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 39, 0.05), 0 14px 32px rgba(16, 24, 39, 0.12); }
.reel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-blank { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); }
.reel-top, .reel-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px; }
.reel-top { top: 0; background: linear-gradient(rgba(0, 0, 0, 0.38), transparent); }
.reel-bottom {
  bottom: 0; padding-top: 28px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  flex-direction: column; align-items: flex-start; justify-content: flex-end;
}
/* Selo numa linha e números na de baixo: o rodapé fica igual em todos os cards, caiba ou não. */
.reel-bottom .badge-cover { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.reel-type {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 980px;
  background: rgba(16, 24, 39, 0.55); color: #fff; font-size: 12px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.reel-type svg { fill: currentColor; stroke: none; }
.reel-type-inline { background: var(--accent-soft); color: var(--accent); backdrop-filter: none; }
.reel-counts { display: flex; gap: 10px; min-height: 16px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.reel-counts span { display: inline-flex; align-items: center; gap: 3px; }
.badge-cover.badge-ok { background: #34c759; color: #fff; }
.badge-cover.badge-gray { background: rgba(255, 255, 255, 0.9); color: var(--text); }
.badge-cover.badge-blue { background: var(--accent); color: #fff; }
.badge-new { background: var(--cyan); color: #04283a; }
.reel-info { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.reel-date { font-size: 12px; color: var(--text-3); font-weight: 500; }
.reel-caption {
  font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reel.skeleton .reel-cover { animation: pulse 1.4s ease-in-out infinite; box-shadow: none; }
@keyframes pulse { 50% { opacity: 0.55; } }
.load-more { display: flex; margin: 0 auto 56px; }

.banner-new {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #d6e4ff; color: var(--text);
}
.banner-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.banner-text { flex: 1; min-width: 200px; }

/* Folha do post */
.sheet-post { max-width: 760px; height: auto; max-height: calc(100vh - 48px); }
.sheet-scroll { overflow-y: auto; }
.post-sheet { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; padding: 24px 28px 28px; }
.post-sheet-cover { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--fill); box-shadow: var(--shadow); }
.post-sheet-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-sheet-cover .reel-type { position: absolute; top: 12px; left: 12px; }
.post-sheet-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; align-items: flex-start; }
.post-sheet-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-sheet-caption { margin: 0; white-space: pre-wrap; word-wrap: break-word; max-height: 220px; overflow-y: auto; color: var(--text); }
.post-sheet-counts { color: var(--text-2); }
.post-campaign {
  align-self: stretch; margin-top: 4px; padding: 18px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.post-campaign .card-head { align-self: stretch; }
.post-campaign .campaign-stats { align-self: stretch; }
.post-campaign-empty p { margin: 0; color: var(--text-2); }

/* Cards de campanha */
.campaign { gap: 18px; }
.campaign-top { display: flex; gap: 16px; min-width: 0; }
.campaign-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.campaign-main .card-head { align-self: stretch; }
.cover-mini {
  position: relative; width: 76px; aspect-ratio: 9 / 16; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--fill); display: grid; place-items: center; color: var(--text-3);
}
.cover-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px;
  background: linear-gradient(160deg, var(--accent-soft), var(--fill)); text-align: center;
}
.cover-placeholder span { font-size: 11px; font-weight: 600; color: var(--accent); line-height: 1.2; }
.cover-placeholder small { font-size: 10px; color: var(--text-3); max-width: 100%; }
.cover-more, .cover-tag {
  position: absolute; bottom: 5px; left: 5px; right: 5px; text-align: center; border-radius: 980px;
  background: rgba(16, 24, 39, 0.62); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 4px;
}
.cover-more { left: auto; }
.campaign-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cstat { background: var(--bg); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.cstat b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.cstat span { font-size: 11px; color: var(--text-2); line-height: 1.2; }
.cstat-err b { color: var(--red); }
.card.draft { border-style: dashed; border-color: #c7d7f7; background: linear-gradient(180deg, #fbfcff, var(--surface)); }
.draft-note { margin: 0; font-size: 13px; color: var(--text-2); }
.section-badge { margin-left: 10px; vertical-align: middle; font-size: 12px; }
.section-desc { margin: -8px 0 16px; color: var(--text-2); font-size: 14px; }
.avatar-accent { background: var(--accent-soft); color: var(--accent); }

/* Editor: post de origem, aviso da IA e prévia do comentário */
.editor-note {
  display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; margin-bottom: 18px; border-radius: var(--radius-sm);
  background: var(--orange-soft); color: #8a5300; font-size: 14px;
}
.editor-note svg { flex: none; margin-top: 2px; }
.editor-note-ai { background: var(--accent-soft); color: #1d4ed8; }
.editor-post { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 26px; }
.cover-editor { width: 96px; box-shadow: var(--shadow); }
.editor-post-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.editor-post-text p {
  margin: 0; font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.subgroup { margin-top: 18px; }
.subgroup-title { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.hint-warn { color: #a35b00; margin: 0 0 12px; display: block; }
.comment-preview {
  width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px;
}
.cp-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.cp-title .badge { text-transform: none; letter-spacing: 0; }
.cp-row { display: flex; gap: 8px; align-items: flex-start; word-wrap: break-word; min-width: 0; }
.cp-row .avatar { width: 24px; height: 24px; font-size: 11px; }
.cp-reply { margin-left: 22px; }
.comment-preview .hint { margin: 0; }
.segmented { grid-auto-columns: minmax(0, 1fr); }
.segmented button { min-width: 0; }

/* Aprender minha personalidade */
.learn-card { align-items: center; }
.learn-card .connect-text p.learn-status { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); font-weight: 500; }
.learn-card .connect-text p.learn-status:empty { display: none; }
.learn-card .learn-status .hint-warn, .learn-card .learn-status .form-error { margin: 0; font-weight: 400; }
.learn-card.loading .mascot { animation: float 1.6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.spinner {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--accent-ring); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
/* Carregando: o robô do LunoChat flutuando, em vez de uma rodinha (o spinner pequeno de botões continua). */
.learn-status > .spinner, .wizard-body > .learn-status > .spinner {
  width: 30px; height: 28px; border: 0; border-radius: 0; background: url('/mascote.svg') center / contain no-repeat;
  animation: float 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .support-fab:hover .support-fab-bot { animation: none; } .learn-status > .spinner { animation: none; } }
.empty-note { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; text-align: center; color: var(--text-2); }
.empty-note b { color: var(--text); font-size: 16px; }
.empty-note p { margin: 0; max-width: 360px; }
@keyframes spin { to { transform: rotate(360deg); } }
.learned-line { display: flex; align-items: center; gap: 6px; margin-top: 10px !important; font-size: 14px !important; color: var(--text-2); }
.learned-line svg { color: var(--green); }
.learned-line .btn-text { padding: 0; font-size: 14px; }

.sheet-learn { max-width: 820px; }
.learn-review { padding: 24px 28px 0; display: flex; flex-direction: column; }
.learn-summary { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid #d6e4ff; }
.learn-summary .mascot { flex: none; }
.learn-summary h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.015em; }
.learn-obs { margin: 10px 0 0; color: var(--text-2); font-size: 14px; }
.learn-summary .hint-warn { margin: 8px 0 0; font-size: 13px; }
.learn-title { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin: 28px 0 10px; }
.learn-fields { display: flex; flex-direction: column; gap: 12px; }
.learn-field { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.learn-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.learn-compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.learn-col { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.learn-col-new { background: var(--accent-soft); }
.learn-col-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.learn-col-new .learn-col-label { color: var(--accent); }
.learn-col p { margin: 0; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.learn-empty { color: var(--text-3); font-style: italic; font-size: 14px; margin: 0; }
.learn-field.locked .learn-col-new { opacity: 0.6; }
.pick { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--accent); cursor: pointer; white-space: nowrap; }
.pick input, .learn-example input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.learn-examples { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.learn-example { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--fill); cursor: pointer; }
.learn-example input { margin-top: 2px; }
.learn-example-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.learn-example-text p { margin: 0; font-size: 14px; word-wrap: break-word; }
.learn-example-comment { color: var(--text-2); }
.learn-example-reply::before { content: '↳ '; color: var(--accent); font-weight: 600; }
.learn-actions {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 24px; padding: 16px 0 20px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface) 30%);
}
.learn-actions .form-error { flex-basis: 100%; margin: 0; text-align: right; }

/* Importar do WhatsApp */
.learn-buttons { display: flex; flex-direction: column; gap: 10px; align-items: stretch; flex: none; }
.learn-buttons .btn-secondary { background: var(--surface); }
.wa-steps { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.wa-privacy { display: flex; align-items: center; gap: 8px; margin: 16px 0; font-size: 14px; font-weight: 500; color: #1e8e3e; }
.wa-privacy svg { flex: none; }
.wa-drop {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px;
  border: 1.5px dashed #c7d7f7; border-radius: var(--radius); background: var(--bg); color: var(--accent); transition: background 0.15s, border-color 0.15s;
}
.wa-drop:hover, .wa-drop.over { background: var(--accent-soft); border-color: var(--accent); }
.wa-drop strong { font-size: 15px; }
.wa-drop span { font-size: 13px; color: var(--text-3); }
.wa-chats { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.wa-chat { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.wa-chat-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.wa-chat-head .hint { margin: 2px 0 0; }
.wa-question { margin: 12px 0 8px; font-weight: 600; font-size: 14px; }
.wa-people { display: flex; flex-direction: column; gap: 6px; }
.wa-person {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--fill); cursor: pointer; border: 1px solid transparent;
}
.wa-person.selected { background: var(--accent-soft); border-color: rgba(37, 99, 255, 0.35); }
.wa-person input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.wa-person .avatar { width: 28px; height: 28px; font-size: 13px; }
.wa-person-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-instagram { margin-top: 16px; color: var(--text-2); white-space: normal; }
.learn-review > .learn-status { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); font-weight: 500; }
.learn-review > .learn-status:empty { display: none; }
.learn-review > .learn-status .form-error { margin: 0; flex: 1; font-weight: 400; }
.learn-example-comment .badge { font-size: 11px; padding: 1px 8px; }

/* Posts: Feed × Posts de teste */
.posts-switch { margin: 0 0 20px; max-width: 420px; }
.posts-switch .segmented { display: grid; grid-auto-flow: column; }
.seg-count { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.segmented button.active .seg-count { color: var(--accent); }
.posts-note { margin: -8px 0 16px; }
.test-add {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px 20px; align-items: center;
  margin-bottom: 24px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.test-add-text strong { font-size: 15px; }
.test-add-text .hint { margin: 2px 0 0; display: block; }
.test-add-row { display: flex; gap: 8px; }
.test-add-row .input { flex: 1; min-width: 0; }
.test-add .form-error { grid-column: 1 / -1; margin: 0; }
.reel-pending .reel-cover { background: linear-gradient(160deg, var(--accent-soft), var(--fill)); }
.reel-pending .reel-blank { flex-direction: column; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--accent); }
.reel-pending .reel-blank span { font-size: 12px; font-weight: 600; text-align: center; padding: 0 12px; }

/* Vídeo ao passar o mouse */
.reel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s; }
.reel.playing .reel-video { opacity: 1; }
.reel-cover .reel-top, .reel-cover .reel-bottom { z-index: 1; }
.mute-btn {
  position: absolute; z-index: 2; top: 44px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; background: rgba(16, 24, 39, 0.55); color: #fff; opacity: 0; transition: opacity 0.2s;
}
.reel.playing .mute-btn { opacity: 1; }

/* Automação dentro do post */
.post-sheet-meta .btn-text { padding: 0 2px; font-size: 14px; }
.post-sheet-meta .reel-counts { color: var(--text-2); }
.post-sheet-info .post-sheet-caption { max-height: 72px; font-size: 14px; color: var(--text-2); }
.automation {
  align-self: stretch; display: flex; flex-direction: column; gap: 14px; padding: 18px; margin-top: 4px;
  border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line);
}
.automation .field { margin: 0; }
.automation .editor-note { margin: 0; }
.automation .form-error { margin: 0; }
.automation .learn-status { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); font-weight: 500; }
.automation-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.automation-head h3 { margin: 0; font-size: 17px; letter-spacing: -0.015em; }
.automation-stats { margin: -6px 0 0; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.automation .chip-input, .automation .input, .automation .textarea { background: var(--surface); border-color: var(--line); }
.automation .textarea { min-height: 72px; }
.automation-setting { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.automation-setting + .automation-setting { border-top: 1px solid var(--line); }
.automation-active { border-color: #d6e4ff; background: var(--accent-soft); }
.automation-active .setting-title { font-weight: 600; font-size: 16px; }
.automation-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet-post { max-width: 900px; }

/* Copiar para outros posts */
.copy-grid .learn-title:first-child { margin-top: 18px; }
.copy-grid .posts { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.copy-post { aspect-ratio: 9 / 16; }
.copy-post .reel-blank { display: grid; place-items: center; height: 100%; color: var(--text-3); background: var(--fill); }

/* Testar personalidade (chat) */
.chat-thread {
  display: flex; flex-direction: column; gap: 10px; min-height: 180px; max-height: 420px; overflow-y: auto;
  padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.chat-empty { margin: auto; text-align: center; color: var(--text-3); font-size: 13px; max-width: 240px; }
.chat-row { display: flex; flex-direction: column; gap: 6px; }
.chat-row.them { align-items: flex-start; }
.chat-row.me { align-items: flex-end; }
.chat-them { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; font-size: 14px; }
.chat-me { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; font-size: 14px; }
.chat-skip { background: var(--fill); color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.chat-skip small { font-size: 12px; color: var(--text-3); }
.chat-typing { display: flex; gap: 4px; padding: 12px 14px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1s infinite; }
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
.chat-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat-votes { display: inline-flex; gap: 4px; }
.chat-vote { border: 1px solid var(--line); background: var(--surface); border-radius: 980px; width: 32px; height: 28px; font-size: 14px; line-height: 1; transition: background 0.15s; }
.chat-vote:hover:not(:disabled) { background: var(--fill); }
.chat-vote.on { background: var(--accent-soft); border-color: rgba(37, 99, 255, 0.35); }
.chat-vote:disabled:not(.on) { opacity: 0.35; }
.chat-fix { align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.chat-fix .label { font-size: 13px; }
.chat-fix .btn { align-self: flex-end; }
.chat-saved { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #1e8e3e; font-weight: 500; }
.chat-samples { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-sample { border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; }
.chat-sample:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose .textarea { min-height: 44px; resize: none; }
.chat-send { width: 44px; height: 44px; padding: 0; flex: none; }

/* Selo de verificado e conta */
.handle { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.verified { flex: none; display: inline-block; vertical-align: middle; }
.account-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: 980px; color: var(--text-2); }
.account-btn:hover { background: var(--fill); }
.post-author { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.post-author .avatar { width: 28px; height: 28px; }
.sheet-account { max-width: 420px; height: auto; }
.account-sheet { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 24px; text-align: center; }
.account-sheet .avatar { width: 64px; height: 64px; font-size: 24px; }
.account-sheet h3 { margin: 8px 0 0; font-size: 19px; }
.account-sheet .hint { margin: 0; }
.account-option { align-self: stretch; text-align: left; margin-top: 16px; border-top: 1px solid var(--line); }
.account-sheet .btn-danger { margin-top: 12px; }

@media (max-width: 860px) {
  .post-sheet { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; padding: 20px; }
  .profile-layout { grid-template-columns: 1fr; }
  .test-panel { position: static; }
  .sheet-body { grid-template-columns: 1fr; overflow-y: auto; }
  .form { overflow: visible; padding: 20px 18px 24px; }
  .preview { border-left: 0; border-top: 1px solid var(--line); padding: 32px 16px; overflow: visible; }
}
@media (max-width: 640px) {
  .page { padding: 28px 16px 72px; }
  .nav-inner { padding: 0 16px; }
  .account { gap: 6px; }
  .unit-picker-top > span { display: none; }
  .unit-picker-top select { min-width: 88px; max-width: 112px; padding: 6px 20px 6px 8px; font-size: 12px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }
  .status { display: none; }
  .connect { flex-direction: column; text-align: center; padding: 24px 20px; gap: 16px; }
  .connect .btn { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 12px; }
  .grid { grid-template-columns: 1fr; }
  .overlay { padding: 0; place-items: end stretch; }
  .sheet { height: calc(100vh - 24px); border-radius: 22px 22px 0 0; }
  .phone { width: 270px; height: 560px; }
  .account span { display: none; }
  .tabs { display: flex; width: 100%; margin-bottom: 24px; }
  .tab { flex: 1; justify-content: center; padding: 8px 6px; font-size: 13px; gap: 4px; }
  .tab-count { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
  .approval { padding: 16px; }
  .approval-actions .btn { flex: 1; }
  .panel { padding: 18px; }
  .reels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .reel-top, .reel-bottom { padding: 8px; }
  .reel-bottom { gap: 4px; }
  .reel-counts { gap: 6px; font-size: 11px; }
  .badge-cover { font-size: 11px; padding: 2px 8px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; padding: 11px 14px; font-size: 15px; }
  .sheet-post { max-height: calc(100vh - 24px); }
  .post-sheet { grid-template-columns: 1fr; padding: 16px; }
  .post-sheet-cover { width: min(150px, 45%); margin: 0 auto; }
  .post-campaign .btn { width: 100%; }
  .segmented button { font-size: 13px; padding: 7px 6px; line-height: 1.25; }
  .comment-preview { width: 270px; }
  .learn-card .btn { width: 100%; }
  .learn-card .connect-text p.learn-status { justify-content: center; }
  .learned-line { flex-wrap: wrap; }
  .learn-review { padding: 16px 16px 0; }
  .learn-summary { flex-direction: column; align-items: center; text-align: center; padding: 16px; }
  .learn-summary .test-meta { justify-content: center; }
  .learn-compare { grid-template-columns: 1fr; }
  .learn-field { padding: 12px; }
  .learn-actions .btn { flex: 1; }
  .learn-buttons { width: 100%; }
  .wa-person { grid-template-columns: auto auto minmax(0, 1fr); }
  .wa-person .hint { grid-column: 3; margin-top: -8px; }
  .posts-switch { max-width: none; }
  .test-add { grid-template-columns: 1fr; padding: 16px; }
  .automation { padding: 14px; }
  .automation-actions .btn-lg { flex: 1; }
  .automation-actions .btn-text { width: 100%; }
}

/* ---- Assinatura, selo de conexão oficial e rodapé ---- */
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-by { font-size: 10.5px; letter-spacing: 0.01em; color: var(--text-3); font-weight: 500; }
.brand-by strong { font-weight: 600; color: var(--text-2); }
.signature-img { height: 1.5em; width: auto; vertical-align: middle; }
.brand-by .signature-img { height: 15px; }
.official-badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 980px; padding: 3px 9px 3px 7px;
  font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.official-badge svg { flex: none; }
.brand .official-badge { margin-left: 4px; }
.app-footer {
  max-width: 1080px; margin: 0 auto; padding: 20px 22px 32px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}
.app-footer strong { color: var(--text-2); font-weight: 600; }
.app-footer .official-badge { background: none; padding: 0; color: var(--text-3); font-weight: 500; }
.login + .app-footer { border-top: 0; justify-content: center; }

/* ---- Topo da aba Posts, no jeito do perfil do Instagram ---- */
.profile-head { display: flex; align-items: center; gap: 28px; margin-bottom: 14px; }
.profile-ring {
  flex: none; padding: 3px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
}
.profile-ring .avatar { border: 3px solid var(--bg); box-sizing: content-box; }
.profile-info { min-width: 0; display: grid; gap: 6px; }
.profile-handle { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.profile-name { margin: 0; font-size: 15px; color: var(--text-2); font-weight: 500; }
.profile-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 2px; }
.profile-stat { font-size: 15px; color: var(--text-2); }
.profile-stat b { color: var(--text); font-weight: 700; margin-right: 4px; }
.posts-intro { font-size: 14px; color: var(--text-2); margin: 0 0 22px; max-width: 620px; }

@media (max-width: 640px) {
  .brand .official-badge { font-size: 0; gap: 0; padding: 4px; }
  .brand-by { display: none; }
  .profile-head { gap: 18px; }
  .profile-ring .avatar { width: 68px !important; height: 68px !important; }
  .profile-handle { font-size: 20px; }
  .profile-stats { gap: 14px; }
  .profile-stat { font-size: 13px; display: grid; text-align: center; }
  .profile-stat b { margin: 0; font-size: 16px; }
  .app-footer { padding: 18px 16px 28px; justify-content: center; text-align: center; }
}

/* ---- Abas dentro do post: Automação | Comentários | Insights ---- */
.post-tabs { align-self: stretch; margin-top: 4px; }
.post-tabs .segmented { width: 100%; display: flex; }
.post-tabs .segmented button { flex: 1; }
.post-pane { align-self: stretch; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.post-pane > .automation { margin-top: 0; }
.post-pane .learn-status { margin: 8px 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); font-weight: 500; }
.comments-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comments-head h3 { margin: 0; font-size: 17px; letter-spacing: -0.015em; }
.comments-head .right { margin-left: auto; }
.cmts-empty { margin: 12px 0; }
.cmts { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.cmt-thread { display: flex; flex-direction: column; gap: 12px; }
.cmt-hidden > .cmt { opacity: 0.5; }
.cmt { display: flex; gap: 12px; align-items: flex-start; }
.cmt .avatar, .cmt-avatar { flex: none; border-radius: 50%; }
.cmt-avatar { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.cmt-reply .cmt-avatar { font-size: 11px; }
.cmt-body { min-width: 0; flex: 1; }
.cmt-text { margin: 0; font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.cmt-user { font-weight: 600; }
.cmt-user .handle { vertical-align: -2px; }
.cmt-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 5px; font-size: 12.5px; color: var(--text-3); }
.cmt-action { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text-3); cursor: pointer; }
.cmt-action:hover { color: var(--text); }
.cmt-action-danger:hover { color: var(--red); }
.cmt-like { flex: none; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding-top: 4px; font-size: 11px; color: var(--text-3); min-width: 22px; }
.cmt-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.cmt-dm { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 980px; background: var(--fill); color: var(--text-2); }
.cmt-dm-ok { background: var(--green-soft); color: #1e8e3e; }
.cmt-dm-err { background: var(--red-soft); color: var(--red); }
.cmt-replies { margin-left: 46px; display: flex; flex-direction: column; gap: 12px; }
.cmt-auto .cmt-text { color: #1747c2; }
.cmt-auto-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--accent); }
.cmt-compose {
  margin-left: 46px; display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: 980px; background: var(--surface);
}
.cmt-compose-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; padding: 6px 0; }
.cmt-compose-send { background: none; border: 0; font: inherit; font-weight: 700; font-size: 14px; color: var(--accent); cursor: pointer; padding: 6px 10px; }
.cmt-compose-send:disabled { opacity: 0.5; }

.insight-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.insight-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 2px; }
.insight-tile b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.insight-tile span { font-size: 12.5px; color: var(--text-2); }
.post-pane .panel { padding: 18px; box-shadow: none; display: grid; gap: 12px; }
.panel-sub { margin: 0; font-size: 15px; font-weight: 600; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 190px 1fr 76px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-label { color: var(--text-2); }
.bar-track { height: 10px; border-radius: 980px; background: var(--fill); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 980px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.bar-value small { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); }
.insights-unlock { border-color: #d6e4ff; background: var(--accent-soft); }
.insights-unlock h3 { margin: 0; font-size: 16px; }
.insights-unlock .steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.insights-unlock .btn { justify-self: start; }

@media (max-width: 640px) {
  .bar-row { grid-template-columns: 110px 1fr 60px; font-size: 12.5px; }
  .cmt-replies, .cmt-compose { margin-left: 34px; }
}

/* ---- Menu lateral (computador) ---- */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
  .shell > .nav { display: none; }
  .shell .page > .tabs { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
    padding: 20px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
  }
  .side-brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 8px; font-size: 19px; letter-spacing: -0.02em; }
  .side-brand b { font-weight: 700; color: var(--text); }
  .side-brand b + span { font-weight: 700; color: var(--accent); }
  .unit-picker-side { display: grid; margin: 0 8px 4px; }
  .unit-picker-side select { width: 100%; max-width: none; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-label { padding: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
  .side-item {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px;
    color: var(--text-2); font-size: 15px; font-weight: 500; text-decoration: none;
    background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; width: 100%;
  }
  .side-item:hover { background: var(--fill); color: var(--text); }
  .side-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .side-item svg { flex: none; }
  .side-item .tab-count { margin-left: auto; }
  .side-soon { opacity: 0.5; cursor: default; }
  .side-soon:hover { background: none; color: var(--text-2); }
  .side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
  .side-bottom .official-badge { align-self: flex-start; margin: 0 8px 4px; font-size: 11px; }
  .side-account {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; width: 100%;
    background: var(--bg); border: 1px solid var(--line); cursor: pointer; text-align: left; font: inherit; color: inherit; text-decoration: none;
  }
  .side-account:hover { border-color: #cfd8e6; }
  .side-account-text { display: grid; min-width: 0; font-size: 14px; font-weight: 600; }
  .side-account-text small { font-size: 12px; font-weight: 500; color: var(--text-3); }
  .side-account .handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-logout { color: var(--text-3); font-size: 14px; }
  .shell-main { min-width: 0; display: flex; flex-direction: column; }
  .shell-main .page { max-width: 1720px; width: 100%; padding: 36px 40px 72px; margin: 0; }
  .shell-main .app-footer { max-width: none; width: 100%; margin: auto 0 0; padding: 18px 40px 24px; }
}
@media (min-width: 1600px) {
  .shell-main .page { padding: 40px 56px 80px; }
  .reels { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ---- Campanhas (Meta Ads) ---- */
.ads { display: flex; flex-direction: column; gap: 18px; }
.ads .learn-status { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; margin: 8px 0; }
.ads-connect-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ads-accounts { display: grid; gap: 10px; margin-top: 12px; }
.ads-account { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font: inherit; cursor: pointer; }
.ads-account:hover { border-color: var(--accent); }
.ads-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ads-account-line { display: flex; align-items: center; gap: 8px; }
.ads-select { width: auto; padding: 8px 12px; }
.ads-totals { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ads-list { display: flex; flex-direction: column; gap: 12px; }
.ads-campaign { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ads-campaign-head {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 20px; align-items: center; gap: 18px;
  padding: 18px 20px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.ads-campaign-head:hover { background: var(--bg); }
.ads-campaign-title { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.ads-campaign-title h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ads-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ads-stat { display: grid; gap: 1px; min-width: 0; }
.ads-stat b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ads-stat span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-chevron { font-size: 24px; color: var(--text-3); transition: transform 0.2s; justify-self: end; }
.ads-campaign.open .ads-chevron { transform: rotate(90deg); }
.ads-ads { border-top: 1px solid var(--line); padding: 8px 20px 16px; display: flex; flex-direction: column; }
.ads-ad { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ads-ad:last-child { border-bottom: 0; }
.ads-ad-cover { width: 48px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--fill); }
.ads-ad-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ads-ad-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ads-ad-line { margin: 0; font-size: 13.5px; color: var(--text-2); }
.ads-funnel { margin: 0; font-size: 13px; color: var(--accent); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab { flex: none; }
  .ads-campaign-head { grid-template-columns: minmax(0, 1fr) 16px; padding: 16px; }
  .ads-stats { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ads-chevron { grid-row: 1; grid-column: 2; }
  .ads-ads { padding: 6px 16px 12px; }
  .ads-ad { flex-wrap: wrap; }
}

/* ---- Conversas (WhatsApp) ---- */
.hero-compact { margin-bottom: 20px; align-items: center; }
.hero-compact h1 { font-size: 34px; }
.wa { display: flex; flex-direction: column; gap: 16px; }
.wa .learn-status { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; margin: 8px 0; }
.banner-danger { background: var(--red-soft); color: #b42318; }
.wa-switch-card {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.wa-switch-text { display: grid; line-height: 1.25; }
.wa-switch-text b { font-size: 15px; font-weight: 600; }

.wa-inbox {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 330px); min-height: 460px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.wa-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.wa-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.wa-number { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wa-number-text { display: grid; min-width: 0; line-height: 1.25; }
.wa-number-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-number-text small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-number-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #e6f8ee; color: #15803d; flex: none; }
.wa-number-icon-lg { width: 52px; height: 52px; border-radius: 16px; }
.wa-list-items { flex: 1; overflow-y: auto; padding: 6px; }
.wa-item {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 10px; border: 0; border-radius: 14px;
  background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.wa-item:hover { background: var(--bg); }
.wa-item.active { background: var(--accent-soft); }
.wa-item:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: -2px; }
.wa-avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; }
.wa-item-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.wa-item-top, .wa-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.wa-item-top b { font-size: 15px; font-weight: 600; }
.wa-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.wa-item.unread .wa-time { color: #15803d; font-weight: 600; }
.wa-preview { font-size: 13.5px; color: var(--text-2); }
.wa-item.unread .wa-preview { color: var(--text); font-weight: 500; }
.wa-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 980px; display: inline-grid; place-items: center; background: #25a35a; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.wa-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.wa-channel { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #15803d; }
.wa-flag { font-size: 11px; font-weight: 700; color: #a35b00; background: var(--orange-soft); border-radius: 980px; padding: 1px 8px; }
.wa-flag::before { content: '● '; color: #f59e0b; }
.wa-tag-off { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--fill); border-radius: 980px; padding: 1px 8px; }
.wa-empty { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; text-align: center; color: var(--text-2); }
.wa-empty p { margin: 0; font-size: 14px; max-width: 260px; }
.wa-empty-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text-3); margin-bottom: 4px; }

.wa-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.wa-placeholder { flex: 1; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 24px; color: var(--text-2); }
.wa-placeholder .mascot { margin-bottom: 10px; }
.wa-placeholder b { color: var(--text); font-size: 17px; }
.wa-placeholder p { margin: 0; max-width: 340px; font-size: 14px; }
.wa-thread-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.wa-back { display: none; border: 0; background: none; font-size: 34px; line-height: 1; color: var(--accent); padding: 0 6px 4px 0; cursor: pointer; }
.wa-thread-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.wa-thread-title b { font-size: 16px; }
.wa-crm-context { min-width: 0; font-size: 11px; color: var(--text-3); }
.wa-thread-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.wa-ia-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.wa-show-xs { display: none; }
.wa-thread-sub { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; color: var(--text-3); }
.wa-thread-sub svg { color: #15803d; flex: none; }
.wa-notice { padding: 9px 16px; font-size: 13.5px; color: var(--text-2); background: var(--bg); border-bottom: 1px solid var(--line); }
.wa-notice-flag { background: var(--orange-soft); color: #8a5300; }
.wa-msgs {
  flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px;
  background: #f3f5f8 radial-gradient(circle at 1px 1px, rgba(16, 24, 39, 0.035) 1px, transparent 0) 0 0 / 18px 18px;
}
.wa-loading { align-self: center; }
.wa-day { align-self: center; margin: 10px 0 6px; padding: 3px 10px; font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface); border-radius: 8px; box-shadow: 0 1px 1px rgba(16, 24, 39, 0.06); }
.wa-bubble {
  max-width: min(560px, 78%); padding: 7px 10px 5px 12px; border-radius: 16px; font-size: 15px; line-height: 1.4;
  box-shadow: 0 1px 1px rgba(16, 24, 39, 0.07); display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 10px;
}
.wa-text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.wa-in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 5px; }
.wa-out { align-self: flex-end; background: #e2f6d9; border-bottom-right-radius: 5px; }
.wa-in + .wa-out, .wa-out + .wa-in { margin-top: 6px; }
.wa-failed { background: #fde9e7; }
.wa-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); white-space: nowrap; transform: translateY(2px); }
.wa-ia-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.02em; color: var(--accent); background: rgba(37, 99, 255, 0.1); border-radius: 5px; padding: 0 5px; line-height: 16px; }
.wa-tick { display: inline-flex; color: var(--text-3); }
.wa-tick-read { color: #2a9df4; }
.wa-tick-failed { color: var(--red); font-weight: 800; font-size: 12px; }
.wa-error { align-self: flex-end; margin: 0 2px 4px; font-size: 12px; color: var(--red); max-width: 78%; text-align: right; }
.wa-composer { flex: none; padding: 10px 14px 8px; border-top: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; }
.wa-compose-row { display: flex; align-items: flex-end; gap: 10px; }
.wa-input { resize: none; min-height: 44px; max-height: 140px; border-radius: 22px; padding: 11px 16px; line-height: 1.4; }
.wa-send {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 255, 0.25); transition: transform 0.1s, opacity 0.15s;
}
.wa-send:active { transform: scale(0.94); }
.wa-send:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.wa-window { margin: 0; padding: 0 6px; font-size: 12px; color: var(--text-3); }
.wa-composer.closed .wa-window { color: #a35b00; font-weight: 600; font-size: 13px; }
.wa-composer.closed .wa-input { background: var(--fill); }

/* Conectar */
.wa-connect {
  display: grid; gap: 20px; padding: 28px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.wa-connect-head { display: flex; align-items: flex-start; gap: 16px; }
.wa-connect-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.wa-connect-head p { margin: 0; color: var(--text-2); max-width: 600px; }
.wa-connect .banner { margin: 0; }
.wa-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wa-option { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.wa-option p { margin: 0; flex: 1; color: var(--text-2); font-size: 14.5px; }
.wa-option-top { display: flex; align-items: center; justify-content: space-between; }
.wa-option-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #e6f8ee; color: #15803d; }
.wa-option-btn { white-space: normal; width: 100%; text-align: center; line-height: 1.25; }
.wa-connect-status { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; }
.wa-connect-status.error { background: var(--red-soft); color: #b42318; font-weight: 500; }
.wa-notes { display: grid; gap: 10px; }
.wa-reqs { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); max-width: 720px; }

/* Ajustes e PIN */
.sheet-wa { max-width: 520px; }
.wa-settings { display: grid; gap: 18px; padding: 22px 24px 26px; }
.wa-settings-number { display: flex; align-items: center; gap: 14px; }
.wa-settings-number p { margin: 2px 0 6px; }
.wa-settings-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wa-pin p { margin: 0; max-width: 340px; color: var(--text-2); }
.wa-pin-digits { font-size: 38px; font-weight: 700; letter-spacing: 0.22em; color: var(--text) !important; font-variant-numeric: tabular-nums; margin: 6px 0 4px !important; }

@media (min-width: 1024px) {
  .wa-inbox { grid-template-columns: clamp(300px, 26vw, 420px) minmax(0, 1fr); height: calc(100vh - 236px); min-height: 520px; }
}
@media (max-width: 1180px) {
  .wa-hide-sm { display: none; }
}
@media (max-width: 860px) {
  .wa-inbox { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .wa-list { border-right: 0; }
  .wa-list-items { overflow: visible; }
  .wa-thread { display: none; }
  .wa-inbox.has-thread .wa-thread {
    display: flex; position: fixed; inset: 0; z-index: 15; height: 100vh; height: 100dvh;
  }
  .wa-back { display: block; }
  .wa-options { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .hero-compact h1 { font-size: 30px; }
  .wa-hero-actions, .wa-switch-card { width: 100%; }
  .wa-switch-card { justify-content: space-between; }
  .wa-connect { padding: 18px; gap: 16px; }
  .wa-connect-head { flex-direction: column; gap: 12px; }
  .wa-option { padding: 16px; }
  .wa-thread-head { padding: 8px 10px; gap: 8px; }
  .wa-thread-head .wa-avatar { width: 34px !important; height: 34px !important; }
  .wa-thread-actions { gap: 6px; }
  .wa-ia-toggle { font-size: 13px; gap: 6px; font-weight: 600; }
  .wa-hide-xs { display: none; }
  .wa-show-xs { display: inline; }
  .wa-thread-actions .btn-sm { padding: 6px 10px; }
  .wa-msgs { padding: 12px; }
  .wa-bubble { max-width: 86%; }
  .wa-composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
}

/* Conexão direta do número do dono do app */
.wa-manual { margin-top: 4px; }
.wa-manual > p { margin: 8px 0; font-size: 14px; color: var(--text-2); }
.wa-manual-fields { display: grid; gap: 8px; margin: 10px 0; max-width: 560px; }
.wa-manual .btn { margin-top: 4px; }

/* ---- Campanhas: editar (Ativa, orçamento, conjuntos) ---- */
.ads-campaign-top { display: flex; align-items: center; }
.ads-campaign-top .ads-campaign-head { flex: 1; min-width: 0; }
.ads-switch { display: flex; align-items: center; gap: 8px; padding: 0 20px 0 4px; flex: none; }
.ads-switch > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.ads-section { margin: 14px 0 2px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.ads-set { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ads-set-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ads-audience { margin: 0; font-size: 13px; color: var(--text-2); }
.ads-audience b { color: var(--text); font-weight: 600; }
.ads-note { margin: 10px 0 0; }
.ads-budget { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; padding: 4px 0; }
.ads-budget-label { color: var(--text-2); }
.ads-budget b { font-variant-numeric: tabular-nums; }
.money-input { display: inline-flex; align-items: center; gap: 6px; background: var(--fill); border-radius: var(--radius-sm); padding: 0 12px; border: 1px solid transparent; }
.money-input:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.money-input > span:first-child { color: var(--text-2); font-weight: 500; }
.money-input .input, .money-input .input:focus { background: none; border: 0; box-shadow: none; padding: 11px 0; width: 90px; font-variant-numeric: tabular-nums; }
.ads-budget-edit .input, .ads-budget-edit .input:focus { width: 72px; padding: 7px 0; }
.ads-ad-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.ads-perm { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 0; }
.ads-perm .banner-text { flex: 1; min-width: 220px; }
.post-boost { align-self: stretch; }
.post-boost .btn { color: var(--accent); }

/* ---- Confirmação (dinheiro de verdade) ---- */
.sheet-confirm { max-width: 440px; height: auto; }
.confirm-sheet { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.confirm-sheet p { margin: 0; }
.confirm-sheet > .btn, .confirm-sheet > .ads-connect-icon { align-self: center; }
.confirm-label { font-size: 13px; color: var(--text-2); font-weight: 500; text-align: center; }
.confirm-big { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.1; }
.confirm-check { display: flex; align-items: center; gap: 10px; background: var(--orange-soft); color: #8a5300; border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; cursor: pointer; }
.confirm-check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.confirm-actions { display: flex; gap: 10px; margin-top: 4px; }
.confirm-actions .btn { flex: 1; }

/* ---- Assistente "Criar anúncio" ---- */
.sheet-wizard { max-width: 640px; height: auto; max-height: calc(100vh - 48px); }
.wizard { display: flex; flex-direction: column; min-height: 100%; }
.wizard-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 16px 24px 4px; }
.wizard-steps li { border-top: 3px solid var(--fill); padding-top: 8px; min-width: 0; }
.wizard-steps li.active, .wizard-steps li.done { border-color: var(--accent); }
.wizard-steps button { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; color: var(--text-3); min-width: 0; max-width: 100%; }
.wizard-steps button:disabled { cursor: default; }
.wizard-steps li.active button { color: var(--text); font-weight: 600; }
.wizard-steps li.done button { color: var(--accent); }
.wizard-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.wizard-steps li.active .wizard-dot, .wizard-steps li.done .wizard-dot { background: var(--accent); color: #fff; }
.wizard-step-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-body { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.wizard-title { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.wizard-sub { margin: -8px 0 0; color: var(--text-2); font-size: 14px; }
.wizard-label { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.wizard-posts { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.wizard-body .load-more { margin: 0 auto; }
.wizard-body .learn-status { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; margin: 8px 0; }
.wizard-post { display: flex; align-items: center; gap: 10px; background: var(--fill); border-radius: var(--radius-sm); padding: 8px 10px; }
.wizard-post img, .wizard-post .reel-blank { width: 34px; height: 46px; border-radius: 6px; object-fit: cover; flex: none; }
.wizard-post-caption { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font: inherit; color: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.choice:hover:not(:disabled) { border-color: #bcd0ff; }
.choice.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.choice:disabled { opacity: 0.55; cursor: default; }
.choice-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.choice-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.choice-text b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.choice-text > span { font-size: 13px; color: var(--text-2); }
.choice-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; transition: border 0.15s; }
.choice.selected .choice-radio { border: 7px solid var(--accent); }
.wizard-hint { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wizard-fields { display: flex; flex-direction: column; gap: 14px; }
.wizard-fields .field + .field { margin-top: 0; }
.search-box { position: relative; }
.search-results { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; padding: 4px; }
.search-results .hint { display: block; padding: 10px; }
.search-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; font: inherit; color: inherit; }
.search-item:hover { background: var(--fill); }
.search-item b { font-weight: 500; }
.chip-place small { opacity: 0.75; font-size: 12px; }
.chip-select { border: 0; background: rgba(37, 99, 255, 0.1); color: inherit; border-radius: 980px; font: inherit; font-size: 12px; padding: 1px 4px; }
.wizard-ages { display: flex; align-items: center; gap: 10px; }
.wizard-ages .input { width: auto; flex: 1; min-width: 0; }
.wizard-ages span { color: var(--text-2); font-size: 14px; }
.wizard-estimate { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.wizard-estimate b { font-variant-numeric: tabular-nums; }
.wizard-money-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wizard-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 980px; padding: 6px 12px; font: inherit; font-size: 14px; color: var(--text); }
.chip-btn:hover { background: var(--fill); }
.chip-btn.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.wizard-days-row { display: flex; align-items: center; gap: 10px; }
.wizard-days { width: 100px; }
.wizard-summary { display: grid; gap: 2px; justify-items: start; background: var(--fill); border-radius: var(--radius); padding: 16px 18px; }
.wizard-summary > span:first-child { font-size: 14px; color: var(--text-2); }
.wizard-summary b { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.wizard-setting { padding: 4px 0; }
.wizard-body .form-error { margin: 0; }
.wizard-body .banner { margin: 0; }
.wizard-safe { display: flex; align-items: flex-start; gap: 6px; margin: 0; }
.wizard-safe svg { flex: none; margin-top: 1px; color: var(--green); }
.wizard-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 24px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}
.wizard-foot-actions { display: flex; gap: 10px; }
.wizard-sending { align-items: center; justify-content: center; text-align: center; padding: 56px 24px; }
.wizard-sending p { margin: 0; }
.wizard-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 24px; }
.wizard-done h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -0.02em; }
.wizard-done p { margin: 0; max-width: 440px; color: var(--text-2); }
.wizard-done .hint-warn { margin: 0; }
.wizard-done-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* Equipe: convites */
.team-form { display: grid; gap: 16px; }
.team-form .panel-title { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.team-units { display: grid; gap: 8px; }
.team-created { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 8px; }
.team-created h2 { margin: 0; font-size: 17px; }
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-row .input { flex: 1 1 240px; min-width: 0; }
.team-created h3 { margin: 0; font-size: 17px; }
.team-created p { margin: 0; color: var(--text-2); font-size: 14px; }
.team-link { display: flex; gap: 8px; flex-wrap: wrap; }
.team-link .input { flex: 1 1 260px; min-width: 0; font-size: 13px; }
.team-list { display: grid; gap: 10px; }
.team-list-title { margin: 8px 0 0; font-size: 15px; color: var(--text-2); font-weight: 600; }
.team-invite { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.team-invite-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.team-invite-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* CRM: Kanban */
.crm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; }
.crm-toolbar .crm-search { flex: 1 1 260px; min-width: min(100%, 220px); }
.crm-toolbar select { flex: 0 1 190px; min-width: 150px; }
.crm-view-switch { display: inline-flex; gap: 4px; align-items: center; }
.crm-view-switch [aria-pressed="true"] { background: var(--fill); color: var(--text); border-color: var(--line); }
.crm-filter-empty { width: 100%; }
.crm-board-area { min-width: 0; }
.crm-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 4px 0 18px; color: var(--text-3); font-size: 13px; }
.crm-stage-settings-list { display: grid; gap: 8px; }
.crm-stage-setting { display: grid; grid-template-columns: 26px minmax(120px, 1fr) auto auto; gap: 8px; align-items: center; }
.crm-stage-setting-index, .crm-stage-setting-status { color: var(--text-3); font-size: 12px; text-align: center; }
.crm-stage-setting-actions { display: flex; gap: 4px; }
.crm-stage-setting-actions .btn { min-width: 38px; padding: 7px; }
.crm-board { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 18px; scroll-snap-type: x proximity; align-items: flex-start; }
.crm-col { flex: 0 0 276px; background: var(--fill); border-radius: var(--radius); padding: 10px; scroll-snap-align: start; border: 1px solid transparent; transition: border-color .12s, background .12s; }
.crm-col.drop { border-color: var(--accent); background: var(--accent-soft); }
.crm-col header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 10px; }
.crm-col h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-2); }
.crm-count { min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 980px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; }
.crm-won h3 { color: #1e8e3e; }
.crm-lost h3 { color: var(--red); }
.crm-cards { display: grid; gap: 8px; min-height: 48px; }
.crm-card { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; cursor: grab; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.crm-card:hover { border-color: #bcd0ff; }
.crm-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.crm-card.dragging { opacity: .4; }
.crm-card b { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.crm-card-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.crm-card-line { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.crm-card-next { font-size: 12px; color: var(--text-2); background: var(--fill); border-radius: 8px; padding: 5px 8px; }
.crm-card-next.overdue { background: var(--red-soft); color: var(--red); }
.crm-sheet .wizard-body { gap: 12px; }
.crm-notes { display: grid; gap: 10px; margin-top: 6px; }
.crm-history { display: grid; gap: 8px; }
.crm-note-form { display: grid; gap: 8px; justify-items: end; }
.crm-note-form .textarea { width: 100%; min-height: 56px; }
.crm-event { display: grid; gap: 2px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.crm-event small { color: var(--text-3); font-size: 12px; }
.crm-event-note span { background: var(--orange-soft); border-radius: 8px; padding: 8px 10px; }
.crm-task-list { display: grid; gap: 8px; }
.crm-task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.crm-task-actions { display: flex; gap: 2px; }
.crm-task-actions .btn { padding: 6px; font-size: 12px; }
.crm-task { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; }
.crm-task input { margin-top: 3px; }
.crm-task span { display: grid; gap: 3px; min-width: 0; }
.crm-task small, .crm-task-empty, .crm-task-privacy { color: var(--text-3); font-size: 12px; }
.crm-task.is-done b { text-decoration: line-through; color: var(--text-3); }
.crm-task-compose { display: grid; gap: 8px; }
.crm-agenda-list { display: grid; gap: 10px; }
.crm-agenda-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.crm-agenda-item.overdue { border-color: var(--red); background: var(--red-soft); }
.crm-agenda-item > .btn { white-space: normal; text-align: right; }
.crm-merge { display: grid; gap: 12px; }
.crm-merge-results { display: grid; gap: 8px; }
.crm-merge-result { display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); padding: 12px; cursor: pointer; }
.crm-merge-result:hover { border-color: var(--accent); }
.crm-merge-result small { color: var(--text-3); }
.crm-csv-import { display: grid; gap: 14px; }
.crm-csv-mapping { display: grid; gap: 8px; }
.crm-csv-field { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(160px, 1.2fr); align-items: center; gap: 10px; font-size: 13px; }
.crm-csv-preview { display: grid; gap: 8px; }
.crm-csv-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.crm-csv-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.crm-csv-table th, .crm-csv-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); max-width: 220px; overflow-wrap: anywhere; }
.crm-csv-table th { color: var(--text-2); background: var(--fill); }
.crm-contact-table { min-width: 760px; }
.crm-contact-table tbody tr:hover { background: var(--fill); }
.crm-table-contact { border: 0; padding: 0; color: var(--accent); background: transparent; font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.crm-table-contact:hover { text-decoration: underline; }
.crm-table-subtitle { display: block; margin-top: 3px; color: var(--text-2); font-size: 11px; }
.crm-table-overdue { color: var(--red); font-weight: 600; }
.crm-csv-summary { font-weight: 600; }
.crm-csv-errors { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--red); font-size: 13px; }

/* Financeiro da clínica: indicadores e composição do saldo em aberto. */
.sales-toolbar { align-items: end; }
.sales-toolbar .field { width: min(180px, 100%); }
.sales-stats { margin: 8px 0 22px; }
.sales-stats .stat { display: grid; gap: 8px; margin: 0; }
.sales-stats .stat-value { font-size: clamp(22px, 3vw, 32px); }
.sales-manual-note { margin: 16px 0; }
.sales-position { display: flex; align-items: center; gap: 22px; padding: 22px; margin-bottom: 26px; }
.sales-position-copy { display: grid; gap: 8px; }
.sales-position-copy h2, .sales-position-copy p { margin: 0; }
.sales-donut { width: 148px; height: 148px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) var(--sales-paid), #dfe6f2 var(--sales-paid)); }
.sales-donut-center { width: 106px; height: 106px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.sales-donut-center strong { font-size: 26px; line-height: 1.1; }
.sales-donut-center span { color: var(--text-2); font-size: 12px; }
.sales-legend { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sales-legend-dot { width: 9px; height: 9px; border-radius: 50%; background: #dfe6f2; }
.sales-legend-dot.paid { background: var(--accent); }
.sales-table-area { margin-bottom: 32px; }
.sales-table { min-width: 860px; }
.sales-table td { vertical-align: top; }
.sales-actions { min-width: 140px; display: flex; flex-wrap: wrap; gap: 4px; }
.sales-voided { color: var(--text-3); }
.sales-form, .sales-contact-results { display: grid; gap: 12px; }
.sales-contact-option { display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); padding: 11px 12px; cursor: pointer; }
.sales-contact-option:hover { border-color: var(--accent); }
.sales-contact-option small { color: var(--text-2); }
.performance-note { margin: 16px 0; }
.performance-stats { margin: 8px 0 22px; }
.performance-stats .stat { display: grid; gap: 8px; margin: 0; }
.performance-stats .stat-value { font-size: clamp(22px, 3vw, 32px); }
.performance-charts { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; margin-bottom: 32px; }
.performance-chart-card { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.performance-chart-card h2 { margin: 0 0 6px; }
.performance-bars { min-height: 180px; display: flex; align-items: stretch; gap: 3px; overflow-x: auto; padding: 12px 0 4px; border-bottom: 1px solid var(--line); }
.performance-day { flex: 1 0 14px; min-width: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.performance-day small { color: var(--text-3); font-size: 9px; }
.performance-bar-stack { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.performance-bar-in, .performance-bar-out { width: min(100%, 14px); min-height: 1px; }
.performance-bar-in { background: #2563ff; }
.performance-bar-out { background: #43b3a8; border-radius: 4px 4px 0 0; }
.performance-chart-legend { display: flex; gap: 14px; color: var(--text-2); font-size: 12px; padding-top: 10px; }
.performance-chart-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #2563ff; }
.performance-chart-legend span + span::before { background: #43b3a8; }
.performance-appointments { display: flex; align-items: center; gap: 18px; }
.performance-appointments h2 { margin-bottom: 10px; }
.performance-donut { width: 132px; height: 132px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#f5ac35 0% var(--appt-a), #2563ff var(--appt-a) var(--appt-b), #19a974 var(--appt-b) var(--appt-c), #9aa5b5 var(--appt-c) var(--appt-d), #dfe6f2 var(--appt-d) 100%); }
.performance-donut-center { width: 94px; height: 94px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.performance-donut-center strong { font-size: 24px; line-height: 1.1; }
.performance-donut-center span { color: var(--text-2); font-size: 11px; }
.sales-legend-dot.scheduled { background: #f5ac35; }
.sales-legend-dot.confirmed { background: #2563ff; }
.sales-legend-dot.completed { background: #19a974; }
.sales-legend-dot.cancelled { background: #9aa5b5; }
@media (max-width: 640px) {
  .sales-stats { grid-template-columns: 1fr; gap: 10px; }
  .performance-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .performance-charts { grid-template-columns: 1fr; }
  .performance-chart-card { padding: 16px; }
  .performance-appointments { align-items: flex-start; gap: 12px; }
  .performance-donut { width: 104px; height: 104px; }
  .performance-donut-center { width: 74px; height: 74px; }
  .performance-donut-center strong { font-size: 20px; }
  .sales-position { align-items: flex-start; padding: 16px; gap: 14px; }
  .sales-donut { width: 108px; height: 108px; }
  .sales-donut-center { width: 78px; height: 78px; }
  .sales-donut-center strong { font-size: 21px; }
  .sales-toolbar .field { width: 100%; }
}

/* WhatsApp: modelos */
.tpl-card { align-items: flex-start; }
.tpl-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--text-2); }
.tpl-preview { background: #e7f6dc; color: #1c2b16; border-radius: 14px 14px 14px 4px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.wa-template-btn { justify-self: start; margin-top: 8px; }

/* Triagem */
.triage-event { align-items: flex-start; }
.triage-event .team-invite-main span:nth-child(2) { white-space: normal; overflow-wrap: anywhere; color: var(--text); }
.triage-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: none; max-width: 100%; }
.triage-actions .input { width: auto; min-width: 150px; max-width: 220px; padding: 8px 10px; font-size: 13px; }

@media (max-width: 640px) {
  .crm-toolbar { align-items: stretch; }
  .crm-toolbar .crm-search, .crm-toolbar select { flex: 1 1 100%; width: 100%; min-width: 0; }
  .crm-toolbar .btn { align-self: flex-start; }
  .crm-col { flex-basis: 84vw; }
  .triage-actions { flex-basis: 100%; }
  .triage-actions .input { flex: 1; max-width: none; }
  .team-invite { flex-wrap: wrap; }
  .team-invite-main { flex-basis: 100%; }
  .team-link .btn { width: 100%; }
  .ads-switch { padding: 0 14px 0 0; flex-direction: column; gap: 4px; }
  .ads-switch > span { font-size: 11px; }
  .ads-ad-actions { width: 100%; justify-content: space-between; padding-left: 62px; }
  .ads-create-btn { width: 100%; }
  .sheet-wizard, .sheet-confirm { max-height: calc(100vh - 24px); }
  .wizard-steps { padding: 14px 16px 2px; }
  .wizard-step-label { font-size: 12px; }
  .wizard-dot { display: none; }
  .wizard-body { padding: 16px; }
  .wizard-title { font-size: 19px; }
  .wizard-posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wizard-foot { padding: 10px 16px; flex-wrap: wrap; }
  .wizard-foot-actions { flex: 1; justify-content: flex-end; }
  .wizard-foot-actions .btn { padding: 12px 16px; font-size: 15px; }
  .wizard-foot-actions:has(> :nth-child(2)) { flex-basis: 100%; order: -1; }
  .wizard-foot-actions:has(> :nth-child(2)) .btn { flex: 1; }
  .choice { padding: 12px; gap: 12px; }
  .confirm-big { font-size: 34px; }
}

/* ---- Campanha completa (modo Gerenciador) ---- */
.sheet-pro { max-width: 1180px; height: min(920px, calc(100vh - 48px)); }
.sheet-pro .sheet-scroll { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.wizard.pro { flex: 1; min-height: 0; }
.pro-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); flex: 1; min-height: 0; }
.pro-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--bg); }
.pro-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; border: 0; border-radius: 10px; padding: 10px; text-align: left; background: transparent; color: var(--text-2); font: inherit; cursor: pointer; }
.pro-nav-item:hover { background: var(--fill); }
.pro-nav-item.active { background: var(--accent-soft); color: var(--accent); }
.pro-nav-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--surface); color: var(--text-2); }
.pro-nav-item.active .pro-nav-icon { color: var(--accent); }
.pro-nav-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pro-nav-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.pro-nav-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-3); }
.pro-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #ff9f0a; }
.pro-nav-sub { margin-left: 8px; }
.pro-nav-sub2 { margin-left: 18px; }
.pro-nav-review { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0; padding-top: 16px; }
.pro-nav-add { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px 46px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.pro-main { min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.pro-h4 { margin: 8px 0 -4px; font-size: 14px; font-weight: 650; }
.pro-places { display: grid; gap: 10px; }
.pro-place { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pro-place legend { padding: 0 4px; }
.pro-place-items { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 8px; }
.pro-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.pro-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.pro-check-all { font-size: 14px; }
.pro-check-all input { width: 18px; height: 18px; }
.pro-ad-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pro-ad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); align-items: start; gap: 24px; }
.pro-ad-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pro-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; min-height: 120px; border: 1px dashed #aebcce; border-radius: var(--radius); padding: 18px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.pro-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.pro-drop > svg { color: var(--accent); }
.pro-drop small { color: var(--text-3); text-align: center; }
.pro-upload { display: grid; gap: 7px; font-size: 13px; color: var(--text-2); }
.pro-upload-bar { height: 6px; overflow: hidden; border-radius: 99px; background: var(--fill); }
.pro-upload-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.15s; }
.pro-processing { display: flex; align-items: center; gap: 8px; }
.pro-ok { display: flex; align-items: center; gap: 5px; color: var(--green); }
.pro-preview-wrap { position: sticky; top: 12px; min-width: 0; }
.pro-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.pro-preview-head { display: flex; align-items: center; gap: 9px; padding: 12px; font-size: 12px; }
.pro-preview-head > span:last-child { display: grid; gap: 2px; }
.pro-preview-head small { color: var(--text-3); }
.pro-preview-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); }
.pro-preview-media { display: grid; place-items: center; overflow: hidden; aspect-ratio: 4 / 5; background: var(--fill); }
.pro-preview-media img, .pro-preview-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.pro-preview-blank { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; background: var(--fill); color: var(--text-3); }
.pro-preview-cta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--bg); font-size: 12px; font-weight: 600; }
.pro-preview-text { margin: 0; padding: 10px 12px 12px; font-size: 12px; line-height: 1.45; }
.pro-review { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.pro-review-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; font-size: 13px; }
.pro-review-row + .pro-review-row { border-top: 1px solid var(--line); }
.pro-review-row > span { color: var(--text-2); }
.pro-review-row > b { min-width: 0; overflow-wrap: anywhere; font-weight: 550; }
.pro-issues ul { margin: 8px 0 0; padding-left: 18px; }
.pro-issues li + li { margin-top: 5px; }
.pro-issues .btn-link { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: underline; cursor: pointer; }
.pro-remove { color: var(--red); }

@media (max-width: 760px) {
  .sheet-pro { max-height: calc(100vh - 24px); }
  .pro-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .pro-nav { flex-direction: row; align-items: stretch; gap: 6px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .pro-nav-item { width: auto; min-width: 145px; max-width: 190px; flex: none; }
  .pro-nav-review { margin-top: 0; border-top: 0; }
  .pro-nav-sub, .pro-nav-sub2 { margin-left: 0; }
  .pro-nav-add { min-width: 130px; margin: 0; padding: 0 8px; flex: none; }
  .pro-main { min-height: 0; }
  .pro-ad { grid-template-columns: minmax(0, 1fr); }
  .pro-preview-wrap { position: static; max-width: 360px; margin: 0 auto; width: 100%; }
  .pro-review-row { grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
  .pro-review-row .btn { grid-column: 2; justify-self: start; }
}

/* ---- "Criar campanha": editor completo (Campanha → Conjuntos → Anúncios) ---- */
.ads-campaign-foot { display: flex; gap: 14px; padding: 0 20px 10px; margin-top: -6px; }
.ads-campaign-foot .btn { color: var(--text-2); gap: 5px; }
.ads-campaign-foot .btn:hover { color: var(--accent); text-decoration: none; }
.sheet-cc { max-width: 1280px; height: calc(100vh - 48px); }
.sheet-cc .sheet-scroll { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.cc { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.cc.cc-single { display: block; overflow-y: auto; }
.cc-tree { border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; padding: 14px 10px 20px; display: flex; flex-direction: column; gap: 2px; }
.cc-node {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: none; border-radius: 10px;
  padding: 8px 10px; font: inherit; color: var(--text); position: relative; min-width: 0;
}
.cc-node:hover { background: var(--fill-hover); }
.cc-node.active { background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.cc-node.active .cc-node-icon { background: var(--accent); color: #fff; }
.cc-node-icon { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.cc-node-text { flex: 1; min-width: 0; display: grid; }
.cc-node-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-node-text small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-node-status { font-size: 11px; color: var(--text-3); background: var(--fill); border-radius: 980px; padding: 1px 7px; flex: none; }
.cc-node-status.on { color: #1e8e3e; background: var(--green-soft); }
.cc-node-bad { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
.cc-tree .cc-l1 { padding-left: 24px; }
.cc-tree .cc-l2 { padding-left: 42px; }
.cc-tree .cc-node.cc-l1::before, .cc-tree .cc-node.cc-l2::before { content: ''; position: absolute; left: 12px; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.cc-tree .cc-node.cc-l2::before { left: 30px; }
.cc-add { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 8px; align-self: flex-start; }
.cc-tree > .cc-add:not(.cc-l2) { padding-left: 24px; }
.cc-add:hover { background: var(--accent-soft); }
.cc-tree-sep { border-top: 1px solid var(--line); margin: 10px 4px; }
.cc-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cc-main { flex: 1; overflow-y: auto; min-height: 0; }
.cc-form { max-width: 720px; padding: 22px 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.cc-form-wide { max-width: 1080px; }
.cc-form > .field + .field { margin-top: 0; }
.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cc-head .eyebrow { margin: 0 0 2px; }
.cc-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-switch { padding: 0; flex-direction: row; gap: 8px; }
.cc-section { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.cc-section-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.cc-section > .hint { margin: -4px 0 0; }
.cc-section > .field + .field { margin-top: 0; }
.cc-meta-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--text-3); background: var(--fill); border-radius: 6px; padding: 1px 6px; font-weight: 400; overflow-wrap: anywhere; }
.cc-locked { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: var(--fill); border-radius: var(--radius-sm); padding: 12px 14px; }
.cc-locked svg { color: var(--accent); }
.cc-goals { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cc-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-check { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 980px; padding: 7px 13px; font-size: 14px; cursor: pointer; background: var(--surface); max-width: 100%; }
.cc-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cc-check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: none; }
.cc-check small { color: var(--text-3); font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cc-check.off { opacity: 0.45; cursor: default; }
.cc-warn { background: var(--orange-soft); color: #8a5300; margin: 0; }
.cc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cc-row .segmented { min-width: 200px; }
.cc-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cc-grid2 .field + .field { margin-top: 0; }
.cc-inline-btn { align-self: flex-start; margin-top: -6px; }
.cc-more { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.cc-more summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-2); }
.cc-more[open] summary { margin-bottom: 10px; }
.cc-more > .chips { margin-bottom: 10px; }
.chip-kind { opacity: 0.7; font-size: 12px; }
.cc-audiences { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 260px; overflow-y: auto; }
.cc-audience { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.cc-audience + .cc-audience { border-top: 1px solid var(--line); }
.cc-audience-name { display: grid; min-width: 0; }
.cc-audience-name b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-audience-name small { font-size: 12px; color: var(--text-3); }
.cc-audience .segmented { width: 220px; flex: none; }
.cc-placements { display: flex; flex-direction: column; gap: 14px; }
.cc-pos-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cc-pos-group > b { width: 100%; font-size: 13px; color: var(--text-2); font-weight: 600; }
.cc-ad { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.cc-ad-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cc-ad-form > .field + .field { margin-top: 0; }
.cc-ad-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; background: var(--bg); border-radius: var(--radius); padding: 18px 16px; }
.cc-ad-side .hint { text-align: center; margin: 0; }
.cc-preview-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.cc-preview { width: 100%; max-width: 300px; }
.cc-existing { display: flex; gap: 12px; align-items: center; background: var(--fill); border-radius: var(--radius-sm); padding: 10px; }
.cc-existing img, .cc-existing .reel-blank { width: 56px; height: 70px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; }
.cc-existing p { margin: 2px 0 0; }
.cc-section > .btn { align-self: flex-start; }
.cc-posts { display: flex; flex-direction: column; gap: 10px; }
.cc-posts .btn { align-self: center; }
.cc-posts .wizard-posts { max-height: 360px; overflow-y: auto; padding: 2px; margin: 0; }
.cc-upload-box { display: flex; align-items: center; gap: 14px; border: 1.5px dashed #c8d4e6; border-radius: var(--radius); padding: 14px; background: var(--bg); }
.cc-upload-box img, .cc-upload-box video { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--fill); }
.cc-upload-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-upload-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-upload-text .hint-warn { margin: 0; }
.cc-progress { display: block; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.cc-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.cc-ai-btn { gap: 5px; padding: 0 2px; font-size: 13px; }
.cc-ai-btn .spinner { width: 13px; height: 13px; }
.cc-ai { display: flex; flex-direction: column; gap: 8px; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px; }
.cc-ai .hint { margin: 0; }
.cc-ai .btn { align-self: flex-start; }
.cc-ai-option { display: grid; gap: 3px; text-align: left; border: 1px solid transparent; background: var(--surface); border-radius: 10px; padding: 10px 12px; font: inherit; color: inherit; }
.cc-ai-option:hover { border-color: var(--accent); }
.cc-ai-option span { font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.ad-mock { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); font-size: 13px; }
.ad-mock-top { display: flex; align-items: center; gap: 8px; padding: 9px 10px; }
.ad-mock-top .avatar { width: 28px; height: 28px; font-size: 12px; }
.ad-mock-top > div { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.ad-mock-top b { font-size: 13px; font-weight: 600; }
.ad-mock-top small { font-size: 11px; color: var(--text-2); }
.ad-mock-dots { color: var(--text-2); letter-spacing: 1px; font-size: 10px; }
.ad-mock-media { position: relative; aspect-ratio: 4 / 5; background: var(--fill); }
.ad-mock-media img, .ad-mock-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-mock-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-3); font-size: 12px; }
.ad-mock-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #fff; display: grid; place-items: center; }
.ad-mock-cta { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--accent); color: #fff; font-weight: 600; }
.ad-mock-icons { display: flex; gap: 14px; padding: 9px 10px 4px; }
.ad-mock-text { margin: 0; padding: 0 10px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-mock-headline { margin: 0; padding: 8px 10px 10px; border-top: 1px solid var(--line); display: grid; gap: 1px; }
.ad-mock-headline span { color: var(--text-2); font-size: 12px; }
.cc-review { display: flex; flex-direction: column; gap: 8px; }
.cc-review-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; background: var(--surface); min-width: 0; }
.cc-review-item p { margin: 0; }
.cc-review-item.cc-l1 { background: var(--bg); }
.cc-review-title { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; min-width: 0; }
.cc-review-title svg { color: var(--accent); flex: none; }
.cc-review-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cc-review-title:hover b { color: var(--accent); }
.cc-review-title .hint { margin-left: auto; flex: none; }
.cc-kv { display: flex; gap: 10px; font-size: 13px; }
.cc-kv span { color: var(--text-3); flex: 0 0 120px; }
.cc-kv b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cc-err { color: var(--red); font-size: 13px; }
.cc-errors { background: var(--red-soft); color: #b42318; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.cc-errors ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.cc-ok { display: flex; align-items: center; gap: 8px; background: var(--green-soft); color: #1e8e3e; border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; }
.cc-ok-gray { background: var(--fill); color: var(--text-2); font-weight: 500; }
.cc-foot { position: static; padding: 12px 28px; }
.cc-foot-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cc-saved { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-steps { display: none; }

@media (max-width: 1100px) {
  .cc-ad { grid-template-columns: minmax(0, 1fr); }
  .cc-ad-side { position: static; }
}
@media (max-width: 760px) {
  .cc { display: flex; }
  .cc-tree { display: none; }
  .cc-right { flex: 1; }
  .cc-steps { display: block; position: sticky; top: 0; z-index: 2; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 16px 8px; }
  .cc-steps-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
  .cc-steps-add { display: flex; gap: 2px; }
  .cc-steps-add .cc-add { padding: 4px 8px; }
  .cc-steps-bar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .cc-steps-bar::-webkit-scrollbar { display: none; }
  .cc-step { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 980px; padding: 5px 11px; font: inherit; font-size: 13px; color: var(--text-2); white-space: nowrap; }
  .cc-step.done { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
  .cc-step.active { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
  .cc-step.bad:not(.active) { border-color: var(--red); color: var(--red); background: var(--red-soft); }
  .cc-form { padding: 16px 16px 24px; }
  .cc-grid2 { grid-template-columns: minmax(0, 1fr); }
  .cc-goals { grid-template-columns: minmax(0, 1fr); }
  .cc-audience { flex-direction: column; align-items: stretch; gap: 6px; }
  .cc-audience .segmented { width: 100%; }
  .cc-foot { padding: 10px 16px; }
  .cc-kv span { flex-basis: 96px; }
  .sheet-cc { height: calc(100vh - 24px); }
  .ads-campaign-foot { padding: 0 16px 10px; }
  .hero-actions .ads-create-btn { width: auto; }
}

.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; font-size: 14px; cursor: pointer; }
.check-row input[type='checkbox'] { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--blue, #2563ff); }

.crm-card.is-archived { opacity: 0.6; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---- Agenda em grade (dia, semana e mês) ---- */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { margin: 0 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.cal-title::first-letter { text-transform: uppercase; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--fill); border: 0; font-size: 22px; line-height: 1; color: var(--text); cursor: pointer; }
.btn-icon:hover { background: var(--fill-hover); }
.cal-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cal-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cal-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--ev); }
.cal-chip.off { opacity: 0.5; }
.cal-chip.off i { background: transparent; box-shadow: inset 0 0 0 2px var(--ev); }
.cal-board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-scroll { overflow: auto; max-height: calc(100vh - 260px); min-height: 360px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cal-inner { min-width: 100%; }
.cal-row { display: grid; }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-dayhead { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-left: 1px solid var(--line); color: var(--text-2); text-transform: capitalize; }
.cal-dayhead small { font-size: 12px; }
.cal-dayhead b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 17px; color: var(--text); font-weight: 600; }
.cal-dayhead.today b { background: var(--accent); color: #fff; }
.cal-dayhead.today small { color: var(--accent); }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--text-3); }
.cal-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 55px, var(--line) 55px, var(--line) 56px); cursor: pointer; }
.cal-event { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 3px 6px; overflow: hidden; text-align: left; font: inherit; font-size: 12px; line-height: 1.25; color: var(--text); background: color-mix(in srgb, var(--ev) 16%, #fff); border: 0; border-left: 3px solid var(--ev); border-radius: 6px; cursor: pointer; }
.cal-event b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event small { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event:hover { background: color-mix(in srgb, var(--ev) 26%, #fff); }
.cal-event:focus-visible { outline: 2px solid var(--ev); outline-offset: 1px; }
.cal-event.scheduled { border-left-style: dashed; }
.cal-event.completed { opacity: 0.6; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.cal-empty { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-monthhead { padding: 8px 0; text-align: center; font-size: 12px; color: var(--text-2); text-transform: capitalize; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.cal-cell { min-height: 108px; padding: 4px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-cell:nth-child(7n + 8) { border-left: 0; }
.cal-cell:hover { background: var(--fill); }
.cal-cell.other { background: color-mix(in srgb, var(--fill) 60%, #fff); }
.cal-cell.other .cal-num { color: var(--text-3); }
.cal-num { align-self: flex-end; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; font-size: 13px; font-weight: 500; }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; }
.cal-pill { display: flex; align-items: center; gap: 5px; padding: 1px 6px; border-radius: 5px; font-size: 11px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--ev) 16%, #fff); }
.cal-pill i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ev); }
.cal-pill.completed { opacity: 0.6; }
.cal-more { color: var(--text-2); font-size: 11px; padding-left: 6px; }
@media (max-width: 640px) {
  .cal-toolbar { gap: 8px; }
  .cal-title { font-size: 17px; }
  .cal-scroll { max-height: calc(100vh - 300px); }
  .cal-cell { min-height: 64px; padding: 2px; }
  .cal-pill { font-size: 0; padding: 0; height: 6px; width: 6px; border-radius: 50%; background: var(--ev); }
  .cal-pill i { display: none; }
  .cal-cell { flex-flow: row wrap; align-content: flex-start; gap: 3px; }
  .cal-cell .cal-num { flex-basis: 100%; }
  .cal-more { display: none; }
}

/* ---- Perfil de quem usa o painel ---- */
.user-avatar { border-radius: 50%; object-fit: cover; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 600; flex: none; }
.side-account .side-account-text b { display: block; font-size: 14px; color: var(--text); }
.side-account .side-account-text small { display: block; color: var(--text-2); }
.account-sheet { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.account-sheet h3 { margin: 4px 0 0; font-size: 20px; }
.account-sheet .account-role { margin: 0; font-weight: 500; color: var(--accent); }
.account-connections { width: 100%; text-align: left; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.account-connections h4 { margin: 8px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.connection-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.connection-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.connection-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.connection-text small.ok { color: var(--green); }
.connection-text small.off { color: var(--text-3); }
.account-logout { width: 100%; margin-top: 10px; }
.unit-choice-user { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 500; margin-bottom: 4px; }
.unit-last { display: block; font-size: 12px; font-weight: 400; color: var(--accent); }

/* ---- Agenda: acabamento ---- */
.cal-board { border-radius: 20px; box-shadow: 0 1px 2px rgba(16, 24, 39, 0.04), 0 12px 40px rgba(16, 24, 39, 0.06); }
.cal-head { backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.cal-col { background-image:
  repeating-linear-gradient(to bottom, transparent 0, transparent 27px, color-mix(in srgb, var(--line) 55%, transparent) 27px, color-mix(in srgb, var(--line) 55%, transparent) 28px),
  repeating-linear-gradient(to bottom, transparent 0, transparent 55px, var(--line) 55px, var(--line) 56px); }
.cal-col.is-today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cal-event { box-shadow: 0 1px 2px rgba(16, 24, 39, 0.08); border-radius: 8px; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.cal-event:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 24, 39, 0.14); z-index: 2; }
.cal-event b { font-size: 12.5px; }
.cal-ghost { position: absolute; left: 3px; right: 3px; height: 56px; border-radius: 8px; padding: 4px 8px; pointer-events: none; font-size: 12px; font-weight: 500; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); z-index: 1; }
.cal-ghost[hidden] { display: none; }
.cal-dayhead.today small { font-weight: 600; }
.cal-cell { transition: background 0.12s ease; }
.cal-cell.today { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.cal-pill { transition: filter 0.12s ease; }
.cal-pill:hover { filter: brightness(0.96); }
.cal-title { font-weight: 650; }
.cal-toolbar .btn-icon { transition: background 0.12s ease, transform 0.12s ease; }
.cal-toolbar .btn-icon:active { transform: scale(0.92); }
@media (hover: none) { .cal-ghost { display: none; } }
@media (prefers-reduced-motion: reduce) { .cal-event, .cal-event:hover { transition: none; transform: none; } }

/* ---- Painel Dev (dono do sistema) ---- */
.dev-pill { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #0b1220; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: middle; }
.dev-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 0; scrollbar-width: none; }
.dev-tabs::-webkit-scrollbar { display: none; }
.dev-tabs .tab { flex: none; white-space: nowrap; }
@media (min-width: 1024px) {
  .dev-tabs { display: none; }
  .dev-shell .sidebar { background: #0b1220; border-right-color: #0b1220; }
  .dev-shell .side-brand b { color: #fff; }
  .dev-shell .side-label { color: #64748b; }
  .dev-shell .side-item { color: #cbd5e1; }
  .dev-shell .side-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
  .dev-shell .side-item.active { background: rgba(37, 99, 255, 0.28); color: #fff; }
  .dev-shell .side-account { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); }
  .dev-shell .side-account .side-account-text b { color: #fff; }
  .dev-shell .side-account .side-account-text small { color: #94a3b8; }
  .dev-shell .dev-pill { background: var(--accent); }
}
.unit-choice-dev { background: #0b1220; color: #fff; border-color: #0b1220; }
.unit-choice-dev .unit-last { color: #93c5fd; }
.dev-overview { display: flex; flex-direction: column; gap: 18px; }
.dev-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dev-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); height: 100%; }
.dev-stat b { font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; }
.dev-stat span { color: var(--text-2); font-size: 13px; }
.dev-stat.ok b { color: var(--green); }
.dev-stat.warn { border-color: #f59e0b; background: var(--orange-soft); }
.dev-stat-link { text-decoration: none; color: inherit; display: block; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.dev-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.dev-card h3 { margin: 0 0 14px; font-size: 15px; }
.dev-chart { display: flex; flex-direction: column; gap: 10px; }
.dev-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.dev-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.dev-bar-stack { width: 100%; max-width: 28px; min-height: 2px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 2px 2px; overflow: hidden; background: var(--fill); }
.dev-bar small { font-size: 10px; color: var(--text-3); }
.dev-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.dev-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dev-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dev-legend-col { flex-direction: column; gap: 8px; }
.dev-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dev-donut { position: relative; width: 120px; height: 120px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.dev-donut::after { content: ''; position: absolute; inset: 24px; border-radius: 50%; background: var(--surface); }
.dev-donut span { position: relative; z-index: 1; font-size: 22px; font-weight: 700; }
.dev-note { margin: 0; }
.dev-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dev-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dev-table th, .dev-table td { padding: 11px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.dev-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); background: var(--bg); }
.dev-table tr:last-child td { border-bottom: 0; }
.dev-table tr.late td { background: var(--orange-soft); }
.dev-late { color: #b45309; font-weight: 600; }
.dev-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.dev-check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.dev-check small { display: block; color: var(--text-2); margin-top: 2px; }
.dev-check.bad { border-color: #f59e0b; background: var(--orange-soft); }
.dev-dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 13px; color: #fff; background: var(--green); }
.dev-check.bad .dev-dot { background: #f59e0b; }
.dev-log { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.dev-log-row { display: grid; grid-template-columns: 110px 54px minmax(0, 1fr); gap: 10px; padding: 9px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.dev-log-row:last-child { border-bottom: 0; }
.dev-log-row time { color: var(--text-3); }
.dev-log-row.error b { color: var(--red); }
.dev-log-row.warn b { color: #b45309; }
.dev-log-row span { overflow-wrap: anywhere; }
@media (max-width: 640px) { .dev-log-row { grid-template-columns: 1fr; gap: 2px; } }

/* "Clinic" na marca (LunoChat Clinic) */
.clinic-tag { font-style: normal; margin-left: 5px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff !important; font-size: 0.55em; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; vertical-align: 0.22em; }
.login-card h1 .clinic-tag { font-size: 0.34em; vertical-align: 0.9em; }
.dev-shell .clinic-tag { background: rgba(255, 255, 255, 0.16); }

/* ---- Login: Google, e-mail e senha ---- */
.login-card .login-tagline { margin: 0 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.login-pass { position: relative; display: flex; }
.login-pass .input { width: 100%; padding-right: 84px; }
.login-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--fill); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.login-eye:hover { color: var(--accent); }
.login-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.login-link { font-size: 14px; padding: 4px 6px; }
.login-title { margin: 6px 0 14px; font-size: 20px; letter-spacing: -0.015em; }
.login-card .login-sub { margin: -6px 0 16px; font-size: 14px; }
.login-hint { margin-top: -6px; color: var(--text-3); font-size: 12.5px; }
.login-owner-check { justify-content: center; margin-top: 14px; font-size: 14px; color: var(--text-2); }
.login-owner { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; text-align: left; }
.login-owner small { color: var(--text-3); font-size: 12.5px; }
.login-note { font-size: 13px; margin-top: 14px !important; }
.login-admin { margin-top: 14px; text-align: left; font-size: 13px; color: var(--text-3); }
.login-admin summary { cursor: pointer; text-align: center; }
.login-admin .login-form { margin-top: 10px; }
.login-card .error-text:empty { display: none; }
.login-card .banner { margin-bottom: 14px; text-align: left; }

/* ---- Agenda: arrastar e visão Ano ---- */
.cal-event[draggable='true'] { cursor: grab; }
.cal-event.dragging { opacity: 0.45; }
.cal-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; padding: 20px; }
.y-month { min-width: 0; }
.y-title { border: 0; background: none; padding: 0; margin-bottom: 8px; font: inherit; font-size: 16px; font-weight: 700; color: var(--accent); text-transform: capitalize; cursor: pointer; }
.y-title:hover { text-decoration: underline; }
.y-dow, .y-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.y-dow span { text-align: center; font-size: 10px; color: var(--text-3); padding-bottom: 3px; }
.y-grid .blank { display: block; }
.y-day { border: 0; background: none; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font: inherit; font-size: 12px; color: var(--text); cursor: pointer; padding: 0; }
.y-day:hover { background: var(--fill); }
.y-day.has { font-weight: 700; }
.y-day.l1 { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.y-day.l2 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.y-day.l3 { background: color-mix(in srgb, var(--accent) 45%, transparent); color: #fff; }
.y-day.l4 { background: var(--accent); color: #fff; }
.y-day.today { box-shadow: 0 0 0 2px var(--red); }
@media (max-width: 1100px) { .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cal-year { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; padding: 14px; } }

/* ---- Suporte ---- */
.support-thread { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 4px 2px; }
.support-msg { align-self: flex-start; max-width: 86%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--fill); }
.support-msg.mine { align-self: flex-end; background: var(--accent-soft); border-radius: 16px 16px 4px 16px; }
.support-msg small { display: block; color: var(--text-3); font-size: 11.5px; margin-bottom: 3px; }
.support-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.support-reply { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.support-reply .btn { align-self: flex-end; }
.support-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.support-item { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.support-item:hover { border-color: var(--accent); }
.support-item small { color: var(--text-3); }
.support-item.unread { border-color: var(--accent); background: var(--accent-soft); }
.support-item.unread b::after { content: ' ●'; color: var(--accent); font-size: 10px; }
.support-item.closed { opacity: 0.65; }
.support-item.active { box-shadow: 0 0 0 2px var(--accent); }
.support-item .when { align-self: flex-end; }
.support-inbox { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.support-inbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.support-inbox-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-height: 300px; }
.support-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.support-head p { margin: 2px 0 0; color: var(--text-2); }
@media (max-width: 860px) { .support-inbox { grid-template-columns: 1fr; } }

/* ---- Horários de atendimento ---- */
.hours-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 12px; }
.hours-card h3 { margin: 0 0 8px; font-size: 16px; }
.hours-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 6px 0; border-top: 1px solid var(--fill); }
.hours-row.off .hours-time, .hours-row.off .hours-sep { opacity: 0.35; pointer-events: none; }
.hours-day { display: flex; align-items: center; gap: 8px; width: 104px; font-weight: 500; font-size: 14px; }
.hours-time { width: 104px; padding: 6px 8px; font-size: 14px; }
.hours-sep { color: var(--text-3); font-size: 12.5px; }
@media (max-width: 640px) { .hours-day { width: 100%; } }

/* ---- Agendamento online (painel) ---- */
.booking-box { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--accent-soft); margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.booking-box .panel-title { margin: 0; }
.booking-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.booking-link .input { flex: 1 1 260px; min-width: 0; font-size: 13px; }
.booking-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }

/* Base de conhecimento da IA */
.kb-list { display: grid; gap: 10px; margin: 14px 0; }
.kb-item { padding: 12px 14px; border: 1px solid var(--line, #e5eaf2); border-radius: 14px; background: var(--surface, #fff); }
.kb-item .hint { margin: 4px 0 6px; white-space: pre-line; }
.kb-sheet .textarea { width: 100%; }

/* IA da Clínica */
.assistant-card { margin-top: 18px; }
.assistant-ideas { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.assistant-thread { display: grid; gap: 10px; max-height: 360px; overflow-y: auto; margin: 6px 0 12px; }
.assistant-thread:empty { display: none; }
.assistant-msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; }
.assistant-msg p { margin: 0; white-space: pre-wrap; }
.assistant-msg.user { justify-self: end; background: var(--accent, #2563ff); color: #fff; }
.assistant-msg.ia { justify-self: start; background: var(--fill, #f1f5f9); }
.assistant-form { display: flex; gap: 8px; }
.assistant-form .input { flex: 1; min-width: 0; }

/* NPS e retorno */
.rel-menu-item { width: 100%; justify-content: flex-start; margin-top: 10px; }
.rel-result { margin: 14px 0; }

/* Cobranças de pacientes */
.charge-list { display: grid; gap: 10px; margin: 12px 0; }
.charge-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.charge-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.charge-item .hint { margin: 4px 0; }
.charge-providers { margin-top: 18px; }
.charge-provider { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.chip.chip-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wa-voice-box { margin: 12px 0; }

/* ---- Login dividido: lado escuro com conversa de exemplo + formulário ---- */
.login.login-split { display: grid; grid-template-columns: 1fr; place-items: stretch; padding: 0; min-height: 100vh; }
.login-hero { display: none; }
.login-panel { display: grid; place-items: center; padding: 28px 20px; }
.login-panel .login-card { max-width: 400px; }
.login-mobile-brand { display: grid; justify-items: center; gap: 6px; margin-bottom: 8px; }
.login-mobile-brand h1 { margin: 0; }
.login-heading { font-family: var(--font-display); font-size: 30px; letter-spacing: -0.025em; margin: 4px 0 6px; text-align: left; }
.login-card .login-tagline { text-align: left; margin: 0 0 20px; }
.google-login { gap: 12px; justify-content: center; font-weight: 600; }
.google-login .google-mark { flex: none; }

@media (min-width: 960px) {
  .login.login-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .login-panel { padding: 48px; background: var(--bg); }
  .login-panel .login-card { background: transparent; border: 0; box-shadow: none; padding: 0; max-width: 380px; text-align: left; }
  .login-mobile-brand { display: none; }
  .login-hero {
    display: flex; flex-direction: column; gap: 28px; padding: 44px 56px; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(900px 500px at 15% 110%, rgba(37, 99, 255, 0.45), transparent 60%), radial-gradient(700px 420px at 100% 0%, rgba(90, 200, 250, 0.16), transparent 60%), #080d1c;
  }
  .login-hero-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 22px; }
  .login-hero-brand svg { margin: 0; flex: none; }
  .login-hero-brand b { color: #fff; font-weight: 700; }
  .login-hero-copy { margin-top: auto; max-width: 520px; }
  .login-hero-copy h2 { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; }
  .login-hero-copy p { color: rgba(255, 255, 255, 0.72); font-size: 16px; line-height: 1.55; margin: 0; }
  .login-chat { display: grid; gap: 10px; align-content: start; width: min(430px, 100%); min-height: 330px; margin-bottom: 4px; }
  .login-bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.4; opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 0.4s ease, transform 0.4s ease; display: none; }
  .login-bubble.on { display: block; opacity: 1; transform: none; animation: login-pop 0.45s ease both; }
  .login-bubble-paciente { justify-self: start; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.12); border-bottom-left-radius: 6px; }
  .login-bubble-ia { justify-self: end; background: var(--accent); border-bottom-right-radius: 6px; }
  .login-bubble-agenda { justify-self: center; max-width: 100%; background: rgba(34, 197, 94, 0.16); border: 1px solid rgba(34, 197, 94, 0.4); color: #bbf7d0; border-radius: 999px; font-weight: 600; }
  .login-check { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; border-radius: 50%; background: #22c55e; color: #052e16; font-size: 12px; font-weight: 800; }
  .login-typing { display: none; gap: 4px; width: 54px; padding: 12px 14px; }
  .login-typing.login-typing-on { display: flex; opacity: 1; transform: none; justify-self: end; }
  .login-typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); animation: login-dot 1s infinite ease-in-out; }
  .login-typing i:nth-child(2) { animation-delay: 0.15s; }
  .login-typing i:nth-child(3) { animation-delay: 0.3s; }
  .login-hero-note { margin: 0; color: rgba(255, 255, 255, 0.45); font-size: 12.5px; }
}
@keyframes login-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes login-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .login-bubble.on { animation: none; } .login-typing i { animation: none; } }

/* ---- Agenda simples: mês + lista do dia + agendar em passos ---- */
.cal-simple { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 12px; align-items: start; }
.cal-simple-month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.cal-simple-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-simple-head { text-align: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); padding: 4px 0; }
.cal-simple-day { position: relative; aspect-ratio: 1 / 0.82; min-height: 52px; border: 1.5px solid transparent; border-radius: 14px; background: var(--fill); color: var(--text); font: inherit; cursor: pointer; display: grid; place-items: center; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.cal-simple-day b { font-size: 16px; font-weight: 600; }
.cal-simple-day:hover { background: var(--accent-soft); }
.cal-simple-day:active { transform: scale(0.97); }
.cal-simple-day.other { opacity: 0.45; }
.cal-simple-day.today { border-color: var(--accent); }
.cal-simple-day.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-simple-day:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.cal-simple-count { position: absolute; right: 6px; bottom: 5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cal-simple-day.selected .cal-simple-count { background: #fff; color: var(--accent); }
.cal-day-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.cal-day-title { margin: 0; font-size: 18px; }
.cal-day-title::first-letter { text-transform: uppercase; }
.cal-day-panel .muted { margin: 0; }
.cal-day-item { display: grid; grid-template-columns: 6px auto 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.cal-day-item > i { align-self: stretch; border-radius: 4px; background: var(--ev, var(--accent)); }
.cal-day-item:hover { background: var(--fill); }
.cal-day-item.cancelled { opacity: 0.5; }
.cal-day-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-day-main { display: grid; min-width: 0; }
.cal-day-main small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-tag { grid-column: 3 / -1; justify-self: start; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.cal-day-add { justify-self: start; }
.book-form .pick-list { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; margin: 8px 0; }
.pick-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.pick-item:hover { background: var(--accent-soft); border-color: var(--accent); }
.pick-item small { color: var(--text-3); }
.pick-chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); margin: 8px 0; }
.pick-new { display: grid; gap: 8px; margin: 8px 0; }
.slot-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.slot-chip { min-width: 72px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; }
.slot-chip:hover { border-color: var(--accent); }
.slot-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot-manual { display: grid; gap: 6px; margin-top: 6px; }
@media (min-width: 980px) { .cal-simple { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); } }

/* ---- Escolha da clínica (cartões) ---- */
.unit-choice.unit-choice-v2 { display: grid; grid-template-rows: 1fr auto; min-height: 100vh; padding: 0; background: radial-gradient(900px 420px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.unit-choice-wrap { width: min(760px, 100% - 32px); margin: 0 auto; padding: 48px 0 24px; display: grid; gap: 22px; align-content: center; }
.unit-choice-head { display: flex; align-items: center; gap: 18px; }
.unit-choice-head h1 { margin: 2px 0 4px; font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.03em; }
.unit-choice-head p { margin: 0; color: var(--text-2); }
.unit-choice-head .unit-choice-user { justify-content: flex-start; font-weight: 600; color: var(--text-2); margin: 0 0 4px; }
.unit-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.unit-card { position: relative; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: inherit; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.unit-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(37, 99, 255, 0.14); }
.unit-card:active { transform: scale(0.99); }
.unit-card:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.unit-card-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 17px; letter-spacing: 0.02em; }
.unit-card-text { display: grid; gap: 2px; min-width: 0; }
.unit-card-text b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-card-text small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-card-go { color: var(--accent); font-size: 24px; }
.unit-card-badge { position: absolute; top: -9px; right: 14px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.unit-card-last { border-color: var(--accent); }
.unit-card-new { border-style: dashed; background: transparent; box-shadow: none; }
.unit-card-new .unit-card-mark { background: var(--fill); font-size: 26px; font-weight: 500; }
.unit-card-dev { background: #0b1220; color: #fff; border-color: #0b1220; }
.unit-card-dev .unit-card-mark { background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 12px; }
.unit-card-dev .unit-card-text small { color: #93c5fd; }
.unit-card-dev .unit-card-go { color: #93c5fd; }
@media (max-width: 560px) { .unit-choice-head { flex-direction: column; align-items: flex-start; } .unit-card-grid { grid-template-columns: 1fr; } }

/* ---- Equipe: clínicas e pessoas ---- */
.team-admin { display: grid; gap: 14px; margin: 18px 0; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-row b { display: block; }
.admin-row small { color: var(--text-3); }
.admin-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.admin-chip { padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.admin-chip.off { background: var(--fill); color: var(--text-3); }

/* Agenda: consultas coloridas dentro de cada dia */
.cal-simple-day { aspect-ratio: auto; min-height: 96px; place-items: stretch; align-content: start; display: grid; grid-template-rows: auto 1fr auto; gap: 3px; padding: 6px; text-align: left; }
.cal-simple-num { font-size: 14px; font-weight: 700; justify-self: start; }
.cal-simple-day.today .cal-simple-num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; background: var(--accent); color: #fff; }
.cal-simple-day.selected { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
.cal-simple-pills { display: grid; gap: 3px; min-width: 0; }
.cal-simple-pill { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 6px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--ev) 16%, transparent); border-left: 3px solid var(--ev); }
.cal-simple-pill i { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ev); flex: none; }
.cal-simple-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-simple-pill.confirmed { background: color-mix(in srgb, var(--ev) 30%, transparent); }
.cal-simple-pill.completed { opacity: 0.6; }
.cal-simple-more { font-size: 11px; font-weight: 700; color: var(--text-3); }
@media (max-width: 720px) {
  .cal-simple-day { min-height: 64px; padding: 4px; }
  .cal-simple-pills { display: flex; flex-wrap: wrap; gap: 3px; }
  .cal-simple-pill { padding: 0; background: none; border: 0; }
  .cal-simple-pill i { display: block; }
  .cal-simple-pill span { display: none; }
}

/* Painel Dev: cupons */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line, #e5eaf2); background: var(--surface, #fff); cursor: pointer; font-weight: 600; font-size: 14px; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, #e7f0ff); color: var(--accent); }
.chip-check input { accent-color: var(--accent); margin: 0; }
.coupon-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; font-size: 16px; }
.coupon-warn { color: #b45309; }

/* ---- Configurações ---- */
.settings-section { display: grid; gap: 14px; margin-bottom: 16px; }
.settings-profile { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.settings-photo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.settings-photo-actions { display: grid; gap: 6px; justify-items: start; }
.settings-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.settings-switch b { display: block; }
.settings-switch small { display: block; color: var(--text-2); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.settings-facts { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 14px; }
.settings-section .segmented { max-width: 420px; }

/* ---- Tema escuro (Configurações → Aparência). Só troca as cores; o resto do desenho é o mesmo. ---- */
:root[data-theme='dark'] {
  --bg: #0b1220; --surface: #111a2c; --fill: #17223a; --fill-hover: #1e2b49;
  --text: #e8edf6; --text-2: #a9b5ca; --text-3: #8391ab; --line: #24324d;
  --accent: #3b78ff; --accent-hover: #5a90ff; --accent-soft: rgba(59, 120, 255, 0.18); --accent-ring: rgba(90, 144, 255, 0.35);
  --green-soft: rgba(52, 199, 89, 0.16); --red-soft: rgba(255, 59, 48, 0.16); --orange-soft: rgba(245, 158, 11, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25); --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
:root[data-theme='dark'] .nav { background: rgba(11, 18, 32, 0.78); }
:root[data-theme='dark'] .switch span { background: #33415c; }
:root[data-theme='dark'] .bubble.them, :root[data-theme='dark'] .bubble-card { background: var(--fill); color: var(--text); }
:root[data-theme='dark'] .card.draft { background: linear-gradient(180deg, var(--fill), var(--surface)); border-color: var(--line); }
:root[data-theme='dark'] .learn-actions { background: linear-gradient(180deg, rgba(17, 26, 44, 0), var(--surface) 30%); }
:root[data-theme='dark'] .wizard-foot, :root[data-theme='dark'] .cc-steps { background: rgba(17, 26, 44, 0.95); }
:root[data-theme='dark'] .wa-msgs { background: #0e1626 radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0) 0 0 / 18px 18px; }
:root[data-theme='dark'] .wa-out { background: #17406b; color: #e8f1ff; }
:root[data-theme='dark'] .wa-failed { background: rgba(255, 59, 48, 0.2); }
:root[data-theme='dark'] .wa-notice-flag { color: #f6c36b; }
:root[data-theme='dark'] .tpl-preview { background: #17352a; color: #d6f5e3; }
:root[data-theme='dark'] .wa-number-icon, :root[data-theme='dark'] .wa-option-icon { background: rgba(52, 199, 89, 0.18); color: #4ade80; }
:root[data-theme='dark'] .cal-event, :root[data-theme='dark'] .cal-pill { background: color-mix(in srgb, var(--ev) 30%, var(--surface)); }
:root[data-theme='dark'] .cal-event:hover { background: color-mix(in srgb, var(--ev) 42%, var(--surface)); }
:root[data-theme='dark'] .cal-cell.other { background: color-mix(in srgb, var(--fill) 60%, var(--surface)); }
:root[data-theme='dark'] .badge-cover.badge-gray { background: rgba(17, 26, 44, 0.9); }
:root[data-theme='dark'] .performance-donut { background: conic-gradient(#f5ac35 0% var(--appt-a), #3b78ff var(--appt-a) var(--appt-b), #19a974 var(--appt-b) var(--appt-c), #8391ab var(--appt-c) var(--appt-d), #24324d var(--appt-d) 100%); }
:root[data-theme='dark'] .phone { background: #1b2640; }
:root[data-theme='dark'] img.user-avatar, :root[data-theme='dark'] .avatar { background-color: var(--fill); }

/* ---- Robô com balão de aviso ---- */
/* Balão de suporte do painel da clínica. */
.support-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 55; display: inline-flex; align-items: center; gap: 6px; height: 52px; padding: 0 18px 0 8px; border: 0; border-radius: 26px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 15px; box-shadow: 0 6px 18px rgba(16, 24, 39, 0.22); cursor: pointer; transition: transform 0.15s ease; }
.support-fab:hover { transform: translateY(-2px); }
.support-fab:active { transform: scale(0.97); }
.support-fab:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.support-fab-bot { width: 46px; height: 56px; margin-top: -14px; filter: drop-shadow(0 3px 4px rgba(10, 20, 50, 0.25)); }
.support-fab:hover .support-fab-bot { animation: bot-hop 0.9s ease-out 1; transform-origin: bottom center; }
.support-fab-dot { position: absolute; top: 4px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: #e5484d; border: 2px solid var(--surface); }
.support-fab-dot[hidden] { display: none; }
@media (max-width: 640px) { .support-fab { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; } .support-fab-label { display: none; } .support-fab-bot { margin-top: -10px; } }
@media print { .support-fab { display: none; } }
.bot-toast { position: fixed; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: flex-end; gap: 6px; max-width: min(340px, calc(100vw - 36px)); opacity: 0; transform: translateY(16px) scale(0.96); transition: opacity 0.3s ease, transform 0.4s cubic-bezier(.2,.9,.3,1.2); pointer-events: none; }
.bot-toast.in { opacity: 1; transform: none; pointer-events: auto; }
.bot-bubble { position: relative; text-align: left; padding: 12px 16px; border-radius: 18px 18px 4px 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.35; box-shadow: var(--shadow-lg); cursor: pointer; }
.bot-bubble:hover { border-color: var(--accent); }
.bot-face { flex: none; filter: drop-shadow(0 8px 14px rgba(16, 24, 39, 0.25)); }
.bot-toast.in .bot-face { animation: bot-hop 1.1s ease-out 1; transform-origin: bottom center; }
@keyframes bot-hop { 0% { transform: translateY(14px) scale(0.8); } 45% { transform: translateY(-10px) rotate(-6deg); } 70% { transform: translateY(0) rotate(3deg); } 100% { transform: none; } }
.bot-x { position: absolute; top: -10px; left: -10px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 15px; line-height: 1; display: grid; place-items: center; padding: 0; }
@media (max-width: 860px) { .bot-toast { bottom: 76px; right: 12px; } }
@media (prefers-reduced-motion: reduce) { .bot-toast { transition: opacity 0.2s ease; transform: none; } .bot-toast.in .bot-face { animation: none; } }
.coupon-code-row { display: flex; gap: 8px; }
.coupon-code-row .input { flex: 1; }

/* Conectar WhatsApp: caminhos separados com aviso */
.wa-path { display: grid; gap: 14px; padding: 8px 22px 22px; }
.wa-path h3 { margin: 0; font-size: 19px; }
.wa-danger { background: var(--red-soft); color: var(--text); border-color: transparent; }

/* Caixa de e-mail do Painel Dev. */
.email-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.email-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; color: var(--text); padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-height: 50vh; overflow-y: auto; }
.email-compose { display: grid; gap: 10px; margin-top: 14px; }
.email-setup ol { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); line-height: 1.6; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Orçamentos (Vendas). */
.quotes-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.quotes-head p { margin: 0; color: var(--text-2); }
.quotes-list { display: grid; gap: 12px; }
.quote-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.quote-card.declined { opacity: 0.65; }
.quote-top, .quote-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.quote-card ul { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 4px; }
.quote-card li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text-2); }
.quote-foot small { color: var(--text-3); }
.quote-badge { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft, #e7f0ff); color: var(--accent); }
.quote-badge.accepted { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.quote-badge.declined { background: var(--line); color: var(--text-3); }
.quote-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.quote-items { display: grid; gap: 8px; }
.quote-item-row { display: grid; grid-template-columns: 1fr 110px 36px; gap: 8px; align-items: center; }

/* LunoChat Assistente. */
.assistant-head { display: flex; gap: 12px; align-items: flex-start; }
.assistant-head img { flex: none; filter: drop-shadow(0 4px 6px rgba(10, 20, 50, 0.2)); }
.assistant-msg p { white-space: pre-line; }
.assistant-msg.proposal { border: 1px solid var(--accent); }
.assistant-choice { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.assistant-choice small { color: var(--text-3); }
.staff-wa-steps { margin: 6px 0 10px; padding-left: 20px; line-height: 1.7; color: var(--text-2); }
.staff-wa-code { font-size: 16px; font-weight: 800; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft, #e7f0ff); color: var(--accent); }
.wa-buttons { display: grid; gap: 4px; margin-top: 6px; }
.wa-button { display: block; text-align: center; padding: 6px 10px; border-radius: 8px; border-top: 1px solid rgba(0, 0, 0, 0.08); color: var(--accent); font-weight: 600; font-size: 13px; }

/* Robô 3D no canto do topo do painel. */
.luno-peek { position: relative; flex: none; width: 56px; height: 56px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; }
.luno-peek img { width: 100%; height: 100%; object-fit: contain; object-position: top; }
.luno-peek.luno3d-on img { display: none; }
.luno-peek canvas { position: absolute; inset: 0; }
.luno-peek:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { .luno-peek { width: 44px; height: 44px; } }

/* Trocar clínica (topo do painel). */
.clinic-switch { display: inline-flex; align-items: center; gap: 8px; max-width: 320px; min-height: 40px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.clinic-switch:hover { border-color: var(--accent); }
.clinic-switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.clinic-switch svg { flex: none; color: var(--accent); }
.clinic-switch-text { display: grid; min-width: 0; line-height: 1.2; }
.clinic-switch-text b, .clinic-switch-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clinic-switch-text b { font-size: 13px; }
.clinic-switch-text small { font-size: 11.5px; color: var(--text-3); }
.clinic-switch-cta { flex: none; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft, #e7f0ff); padding: 4px 8px; border-radius: 8px; }
.clinic-switch-sheet { display: grid; gap: 10px; }
.clinic-switch-sheet .eyebrow { margin: 8px 0 0; }
.clinic-group h3 { margin: 0 0 6px; font-size: 16px; }
.clinic-option { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.clinic-option span:first-child { display: grid; gap: 2px; }
.clinic-option small { color: var(--text-3); font-size: 12.5px; }
.clinic-option:hover:not(:disabled) { border-color: var(--accent); }
.clinic-option.active { border-color: var(--accent); background: var(--accent-soft, #e7f0ff); cursor: default; }
.clinic-option.active > span:last-child { color: var(--accent); font-size: 12px; font-weight: 700; }
@media (max-width: 640px) { .clinic-switch { max-width: 170px; } .clinic-switch-text small, .clinic-switch-cta { display: none; } }
.check-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }
.service-pros { display: grid; gap: 2px; }
.wa-notice-booking { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; background: var(--accent-soft, #e7f0ff); }
.wa-notice-actions { display: inline-flex; gap: 6px; }

/* Painel do paciente ao lado da conversa: fixo à direita a partir de 1180 px; em telas menores abre por cima com o botão "Paciente". */
.wa-side { display: none; }
.wa-side-top { display: flex; justify-content: space-between; align-items: center; }
.wa-side-top b { color: #0f1f44; }
.wa-side-close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-3); }
.wa-inbox.with-side.side-open .wa-side { display: flex; flex-direction: column; gap: 12px; padding: 14px; position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 60; background: var(--bg, #f6f8fc); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(15, 31, 68, .18); overflow-y: auto; }
@media (min-width: 1180px) {
  .wa-inbox.with-side { grid-template-columns: 270px minmax(0, 1fr) 300px; }
  .wa-inbox.with-side .wa-side, .wa-inbox.with-side.side-open .wa-side { display: flex; flex-direction: column; gap: 12px; padding: 14px; position: static; width: auto; box-shadow: none; background: none; border-left: 1px solid var(--line); overflow-y: auto; }
  .wa-side-toggle, .wa-side-close { display: none; }
}
.wa-side-empty { padding: 8px 2px; }
.wa-side-block { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.wa-side-block .eyebrow { margin: 0; }
.wa-side-block small { color: var(--text-3); }
.wa-side-sug { border-color: var(--accent); background: var(--accent-soft, #e7f0ff); }
.lead-tag { justify-self: start; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: rgba(245, 158, 11, 0.16); color: #b45309; }
.ok-tag { color: #15803d; font-weight: 600; }
.wa-slots { display: grid; gap: 10px; }
.wa-slot-day b { display: block; font-size: 12.5px; text-transform: capitalize; margin-bottom: 4px; }
.wa-slot-row { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-slot-row .chip { margin: 0; cursor: pointer; }

.wa-side-history { display: grid; gap: 12px; }
.wa-appt { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); }
.wa-appt:first-of-type { border-top: 0; }
.wa-appt small { display: block; color: var(--text-3); }
.wa-appt-actions { display: flex; flex-wrap: wrap; gap: 2px; }
.wa-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wa-money span { display: grid; }
.wa-money b { font-size: 13px; }
.wa-side-block details summary { cursor: pointer; font-size: 13px; padding: 4px 0; }
.wa-pay { display: block; padding-left: 8px; }
.wa-chapter { align-self: center; margin: 14px 0 6px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft, #e7f0ff); color: var(--accent); font-size: 12px; font-weight: 700; }
.wa-auto-book { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--accent-soft, #e7f0ff); cursor: pointer; }
.wa-auto-book span { display: grid; }
.wa-auto-book small { color: var(--text-3); font-size: 11.5px; }

/* Microfone dentro dos campos de texto (sempre visível). */
.voice-wrap { position: relative; display: block; min-width: 0; width: 100%; }
.voice-wrap > .input { width: 100%; }
.voice-mic { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--accent-soft, #e7f0ff); color: var(--accent); cursor: pointer; }
.voice-wrap.is-area .voice-mic { top: 8px; transform: none; }
.voice-mic:hover { background: var(--accent); color: #fff; }
.voice-mic:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.voice-mic.on { background: #e5484d; color: #fff; animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.5); } 50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } }
@media (prefers-reduced-motion: reduce) { .voice-mic.on { animation: none; } }
input.has-mic, textarea.has-mic { padding-right: 46px; }
.wa-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.wa-record-holder { display: grid; gap: 4px; margin-top: 4px; }
.wa-record-box { display: grid; gap: 6px; }
.wa-welcome-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (max-width: 520px) { .wa-welcome-buttons { grid-template-columns: 1fr; } }
.wa-welcome-img { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wa-welcome-img img { max-width: 160px; max-height: 110px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }

/* Prontuário */
.sheet-record { max-width: 1100px; }
.record-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.record-tab { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); padding: 7px 14px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.record-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.record-body h4 { margin: 16px 0 8px; }
.odonto-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.odonto-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.odonto-legend .leg-plan { border: 2px dashed var(--text-2); background: none; }
.odonto-legend .leg-done { background: var(--text-2); }
.odonto-wrap { overflow-x: auto; padding-bottom: 6px; }
.odonto-side { display: block; text-align: center; color: var(--text-3); font-size: 11px; }
.odonto { display: grid; gap: 14px; min-width: 760px; }
.odonto-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.odonto-row + .odonto-row { border-top: 2px solid var(--line); padding-top: 14px; }
.odonto-half { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.odonto-half + .odonto-half { border-left: 2px solid var(--line); padding-left: 14px; }
.tooth { display: grid; justify-items: center; gap: 3px; padding: 4px 2px; border-radius: 10px; border: 1px solid transparent; }
.tooth.active { border-color: var(--accent); background: var(--accent-soft, #e7f0ff); }
.tooth.whole { box-shadow: inset 0 0 0 2px var(--c); }
.tooth.whole.st-planejado { box-shadow: none; border: 2px dashed var(--c); }
.tooth-num { border: 0; background: none; font: 700 12px system-ui; color: var(--text); cursor: pointer; padding: 0 4px; }
.tooth-faces { display: grid; grid-template-columns: repeat(3, 15px); grid-template-rows: repeat(3, 15px); gap: 1px; grid-template-areas: ". top ." "left mid right" ". bottom ."; }
.face { border: 1px solid var(--line); background: var(--surface); border-radius: 3px; font-size: 8px; line-height: 1; color: var(--text-3); padding: 0; cursor: pointer; }
.face:disabled { cursor: default; }
.face-top { grid-area: top; } .face-left { grid-area: left; } .face-mid { grid-area: mid; } .face-right { grid-area: right; } .face-bottom { grid-area: bottom; }
.face.st-existente, .face.st-feito { background: var(--c); border-color: var(--c); color: #fff; }
.face.st-planejado { background: repeating-linear-gradient(45deg, transparent 0 2px, var(--c) 2px 4px); border-color: var(--c); color: transparent; }
.face.picked { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--accent-soft, #e7f0ff); color: var(--accent); }
.tooth-tag { font-size: 9px; color: var(--text-3); max-width: 64px; text-align: center; line-height: 1.1; }
.odonto-form { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.odonto-actions, .odonto-item-actions, .doc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btn { border: 0; background: var(--surface); padding: 6px 12px; font: inherit; cursor: pointer; color: var(--text-2); }
.seg-btn.on { background: var(--accent); color: #fff; }
.odonto-list, .doc-list { display: grid; gap: 6px; }
.odonto-item, .doc-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.odonto-item > div:nth-child(2), .doc-item > div:first-child { flex: 1; display: grid; }
.odonto-item small, .doc-item small { color: var(--text-3); }
.odonto-item .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.doc-new { display: grid; gap: 6px; }
.doc-models { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-compose { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--accent); border-radius: 12px; }
.doc-text { font-family: Georgia, serif; font-size: 14px; line-height: 1.55; }
.file-upload { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 8px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.file-thumb { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; }
.file-thumb img, .file-loading, .file-pdf { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: grid; place-items: center; background: var(--bg, #f1f5f9); color: var(--text-3); font-weight: 700; }
.file-thumb small { color: var(--text-3); }
.wa-record-links { display: grid; gap: 6px; }

.odonto-3d-toggle { margin-bottom: 8px; }
.odonto3d { display: grid; gap: 6px; margin-bottom: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #f8fafc, #e9eef7); }
.odonto3d:fullscreen { padding: 16px; }
.odonto3d-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.odonto3d-bar small, .odonto3d-credit { color: var(--text-3); font-size: 11.5px; }
.odonto3d-stage { position: relative; height: 380px; border-radius: 10px; overflow: hidden; }
.odonto3d:fullscreen .odonto3d-stage { height: calc(100vh - 110px); }
.odonto3d-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.tooth-history { display: grid; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--bg, #f8fafc); }

/* Escaneamento 3D do paciente */
.scan-upload, .scan-viewer { display: grid; gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); }
.scan-form { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.scan-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scan-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.scan-chosen .chip { display: inline-flex; gap: 6px; align-items: center; }
.chip-x { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: inherit; padding: 0 2px; }
.scan-progress { width: 100%; height: 8px; }
.scan-list { display: grid; gap: 8px; }
.scan-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.scan-item > div:first-child { display: grid; gap: 2px; min-width: 0; }
.scan-actions { display: flex; gap: 6px; }
.scan-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.scan-tools .input-sm { width: auto; padding: 4px 8px; min-height: 30px; }
.check-inline { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; }
.scan-stage { position: relative; height: 440px; border-radius: 10px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #f8fafc, #dfe6f1); }
.scan-stage:fullscreen { height: 100vh; border-radius: 0; }
.scan-host { position: absolute; inset: 0; }
.scan-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.scan-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.scan-measure { color: var(--accent); font-weight: 600; min-height: 1em; }
.storage-meter { height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 14px; }
.storage-fill { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.storage-fill.atencao { background: #f59e0b; }
.storage-fill.critico { background: #ef4444; }
@media (max-width: 640px) { .scan-stage { height: 340px; } }
:root[data-theme='dark'] .scan-stage { background: radial-gradient(circle at 50% 40%, #1f2937, #0b1220); }
.scan-stage { background: #0b0f17; }
.scan-stage[data-fundo='claro'] { background: radial-gradient(circle at 50% 40%, #f8fafc, #dfe6f1); }
.scan-stage .scan-loading { color: #cbd5e1; }
.scan-stage[data-fundo='claro'] .scan-loading { color: inherit; }

/* Odontograma 2 */
.odg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.odg-title { margin: 0; font-size: 22px; color: #0f1f44; letter-spacing: -.01em; }
.odg-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.odg-segs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg, #f1f4f9); border: 1px solid var(--line); }
.odg-seg { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font: 600 13px system-ui; color: var(--text-2); cursor: pointer; }
.odg-seg.on { background: #0f1f44; color: #fff; }
.odg-dentition { margin: 8px 0 4px; }
.odg-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; font-size: 12.5px; color: var(--text-2); }
.odg-legend i { display: inline-grid; place-items: center; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; font: 700 8px system-ui; font-style: normal; }
.odg-legend .leg-plan { border: 2px dashed #64748b; background: none; }
.odg-legend .leg-done { background: #16a34a; }
.odg-legend .leg-q { background: #f59e0b; color: #fff; }
.odg-more summary { cursor: pointer; color: var(--accent); list-style: none; }
.odg-more[open] > div { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.odg-arches { display: grid; gap: 4px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.odg-sides { display: flex; justify-content: space-between; min-width: 760px; padding: 0 4px 0 96px; color: var(--text-3); font-size: 11px; }
.odg-arch { display: grid; grid-template-columns: 88px 1fr; gap: 8px; min-width: 760px; }
.odg-arch + .odg-arch { border-top: 1px solid var(--line); padding-top: 6px; }
.odg-arch-label { display: grid; place-items: center; text-align: center; border-radius: 12px; background: #f4f6fb; color: #0f1f44; font: 600 12.5px system-ui; padding: 6px; }
.odg-row { display: grid; grid-template-columns: 1fr 2px 1fr; gap: 6px; }
.odg-mid { background: var(--line); border-radius: 2px; }
.odg-half { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.odg-row.deci .odg-half { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.odg-tooth { display: grid; justify-items: center; gap: 2px; border-radius: 12px; padding: 4px 1px; transition: background .15s; }
.odg-tooth.on { background: #e8f0ff; box-shadow: inset 0 0 0 2px var(--accent); }
.odg-tooth.up { grid-template-rows: auto auto; }
.odg-tooth.down { grid-template-rows: auto auto; }
.odg-tooth.down .odg-flower { order: -1; }
.odg-tooth-btn { position: relative; display: grid; justify-items: center; gap: 0; border: 0; background: none; padding: 0; cursor: pointer; width: 100%; }
.odg-tooth.down .odg-tooth-btn .odg-num { order: 2; }
.odg-num { font: 700 12.5px system-ui; color: #0f1f44; }
.odg-art { width: 100%; max-width: 44px; height: 74px; filter: drop-shadow(0 2px 2px rgba(15, 31, 68, .12)); transition: transform .15s; }
.odg-art.t-molar { max-width: 52px; }
.odg-tooth-btn:hover .odg-art { transform: translateY(-2px); }
.odg-art.big { height: 110px; max-width: 80px; }
.odg-badge { position: absolute; top: 14px; right: 2px; width: 14px; height: 14px; border-radius: 50%; font: 700 9px/14px system-ui; color: #fff; text-align: center; }
.odg-badge.q { background: #f59e0b; }
.odg-badge.plan { border: 2px dashed #64748b; background: #fff; width: 10px; height: 10px; }
.odg-flower { width: 36px; height: 36px; }
.odg-face { fill: #fff; stroke: #c8d1de; stroke-width: 1; cursor: pointer; transition: fill .12s; }
.odg-face:hover { fill: #eef3ff; }
.odg-face.st-existente, .odg-face.st-feito { fill: var(--c); stroke: var(--c); }
.odg-face.st-feito { stroke: #16a34a; stroke-width: 1.6; }
.odg-face.st-planejado { fill: url(#odg-hatch); stroke: var(--c); stroke-dasharray: 2 1.5; }
.odg-face.st-a_confirmar { fill: #fff7e6; stroke: #f59e0b; stroke-dasharray: 2 1.5; }
.odg-face.picked { stroke: var(--accent); stroke-width: 2.4; }
.odg-face:focus-visible { outline: none; stroke: var(--accent); stroke-width: 2.6; }
.odg-panel { position: relative; display: grid; gap: 10px; margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(15, 31, 68, .08); }
.odg-panel-head { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; }
.odg-panel-art { display: grid; place-items: center; border-radius: 12px; background: #f6f8fc; padding: 4px; }
.odg-panel-num { font-size: 24px; color: #0f1f44; }
.odg-chip { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 99px; background: #e8f0ff; color: var(--accent); font-size: 12px; font-weight: 600; }
.odg-close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 4px 8px; }
.odg-label { color: var(--text-3); font-size: 12px; }
.odg-face-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.odg-face-btn { display: grid; justify-items: center; gap: 2px; min-width: 76px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #94a3b8; font: 600 12px system-ui; cursor: pointer; }
.odg-face-btn span { color: var(--text-2); }
.odg-face-btn.on { border-color: var(--accent); background: #e8f0ff; color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 255, .15); }
.odg-face-btn.on span { color: var(--accent); }
.odg-st { display: grid; gap: 8px; }
.odg-st-title { font-weight: 700; color: #0f1f44; }
.odg-st-group { display: grid; gap: 4px; }
.odg-form { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: #f8fafd; border: 1px dashed #c9d5ea; }
.odg-form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.odg-records { display: grid; gap: 6px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.odg-records-head { display: flex; justify-content: space-between; align-items: baseline; }
.odg-records-head h4 { margin: 0; color: #0f1f44; }
.odg-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.odg-filters .input-sm { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.odg-rec { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.odg-rec.compact { grid-template-columns: auto 1fr auto; padding: 6px 8px; }
.odg-rec-tooth { min-width: 36px; height: 30px; border: 0; border-radius: 8px; background: #f1f4fa; font: 700 13px system-ui; color: #0f1f44; cursor: pointer; }
.odg-rec-main { display: grid; min-width: 0; }
.odg-rec-main b { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: #0f1f44; font-size: 14px; }
.odg-rec-main small { color: var(--text-3); }
.odg-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.odg-dot.st-planejado { background: none; border: 2px dashed var(--c); }
.odg-dot.st-a_confirmar { background: none; border: 2px dashed #f59e0b; }
.odg-st-tag { padding: 1px 8px; border-radius: 99px; font: 600 11px system-ui; background: #eef2f7; color: #475569; }
.odg-st-tag.st-feito { background: #e7f8ee; color: #15803d; }
.odg-st-tag.st-planejado { background: #fff6e5; color: #b45309; }
.odg-st-tag.st-a_confirmar { background: #fff1d6; color: #b45309; }
.odg-src { padding: 1px 8px; border-radius: 99px; font: 600 11px system-ui; background: #eef4ff; color: var(--accent); }
.odg-row-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.odg-row-actions .input-sm { width: auto; min-height: 30px; padding: 2px 6px; font-size: 12.5px; }
.odg-events { grid-column: 1 / -1; display: grid; gap: 2px; padding: 6px 8px; border-radius: 8px; background: #f8fafd; color: var(--text-3); }
.odg-import { display: grid; gap: 12px; }
.odg-formats { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--text-2); font-size: 13.5px; }
.odg-drop { display: grid; place-items: center; gap: 4px; padding: 28px; border: 2px dashed #c9d5ea; border-radius: 16px; background: #f8fafd; cursor: pointer; color: #0f1f44; }
.odg-drop.over, .odg-drop:hover { border-color: var(--accent); background: #eef4ff; }
.odg-imp-sec { display: grid; gap: 6px; }
.odg-imp-sec h4 { margin: 4px 0 0; }
.odg-imp-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.odg-imp-table td, .odg-imp-table th { font-size: 12.5px; padding: 4px 8px; }
.odg-imp-table tr.imp-duplicado td { color: var(--text-3); }
.odg-imp-table tr.imp-erro td:last-child { color: #b91c1c; }
.odg-imp-table tr.imp-novo td:last-child { color: #15803d; font-weight: 600; }
.odg-imp-skip { display: block; color: var(--text-3); }
@media (max-width: 640px) {
  .odg-form-grid { grid-template-columns: 1fr; }
  .odg-rec { grid-template-columns: auto auto 1fr; }
  .odg-row-actions { grid-column: 1 / -1; }
}
:root[data-theme='dark'] .odg-title, :root[data-theme='dark'] .odg-num, :root[data-theme='dark'] .odg-panel-num, :root[data-theme='dark'] .odg-records-head h4, :root[data-theme='dark'] .odg-rec-main b, :root[data-theme='dark'] .odg-st-title { color: #e5ecff; }
:root[data-theme='dark'] .odg-panel, :root[data-theme='dark'] .odg-rec, :root[data-theme='dark'] .odg-face-btn, :root[data-theme='dark'] .odg-legend { background: var(--surface); }
:root[data-theme='dark'] .odg-arch-label, :root[data-theme='dark'] .odg-panel-art, :root[data-theme='dark'] .odg-form { background: rgba(255, 255, 255, .04); color: #e5ecff; }
.scan-tooth { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 1em; }

/* Histórico evolutivo dos escaneamentos */
.exam-list-head { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.exam-list-head h4 { margin: 0; color: #0f1f44; }
.exam-timeline { position: relative; padding-left: 22px; margin-top: 8px; }
.exam-timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(#c9d5ea, #e6ecf5); border-radius: 2px; }
.exam-timeline .scan-list { display: grid; gap: 10px; }
.exam { position: relative; }
.exam-dot { position: absolute; left: -20px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 0 0 4px #c9d5ea; }
.exam.removed .exam-dot { background: #94a3b8; }
.exam-body { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.exam.removed .exam-body { background: #f8fafc; opacity: .8; }
.exam-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: flex-start; }
.exam-head > div:first-child { display: grid; }
.exam-num { font: 700 11.5px system-ui; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.exam-title { font-size: 16px; color: #0f1f44; }
.exam-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.exam-meta { color: var(--text-3); }
.exam-last-note { color: var(--text-2); display: block; }
.exam-actions { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; margin-top: 4px; }
.exam-extra:not(:empty) { display: grid; gap: 8px; margin-top: 6px; padding: 10px; border-radius: 12px; background: #f8fafd; border: 1px solid var(--line); }
.exam-extra h5 { margin: 0; font-size: 13.5px; color: #0f1f44; }
.exam-notes { display: grid; gap: 6px; }
.exam-note { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.exam-note p { margin: 0; white-space: pre-wrap; }
.exam-note small { color: var(--text-3); }
.exam-note-form { display: grid; gap: 6px; }
.exam-note-form .input-sm { width: auto; justify-self: start; }
.exam-mini { display: grid; gap: 4px; overflow-x: auto; }
.exam-mini-row { display: grid; grid-template-columns: repeat(8, minmax(22px, 1fr)) 2px repeat(8, minmax(22px, 1fr)); gap: 2px; min-width: 420px; }
.exam-mini-mid { background: var(--line); }
.exam-mini-tooth { display: grid; justify-items: center; }
.exam-mini-tooth small { font-size: 9.5px; color: var(--text-3); }
.exam-mini-tooth .odg-art { height: 40px; max-width: 26px; filter: none; }
.exam-snap-list { display: grid; gap: 2px; }
.exam-snap-list .odg-dot { display: inline-block; width: 9px; height: 9px; vertical-align: 0; }
.cmp { display: grid; gap: 12px; }
.cmp-pick { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.cmp-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-col { display: grid; gap: 8px; align-content: start; }
.cmp-small { height: 360px; }
.cmp-details { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.cmp-a { color: #2563eb; font-weight: 600; }
.cmp-b { color: #d97706; font-weight: 600; }
.cmp-result { margin: 0; padding: 8px 10px; border-radius: 10px; background: #f1f5fb; font-size: 13.5px; }
.cmp-stage-box .scan-stage { height: 460px; }
@media (max-width: 760px) { .cmp-pick, .cmp-side { grid-template-columns: 1fr; } }
:root[data-theme='dark'] .exam-body, :root[data-theme='dark'] .exam-note { background: var(--surface); }
:root[data-theme='dark'] .exam-title, :root[data-theme='dark'] .exam-list-head h4, :root[data-theme='dark'] .exam-extra h5 { color: #e5ecff; }
:root[data-theme='dark'] .exam-extra:not(:empty), :root[data-theme='dark'] .cmp-result { background: rgba(255, 255, 255, .04); }

/* Robô que acompanha o mouse: barra de cima no celular, canto de cima à direita do painel no computador */
.peek-slot-desktop { display: none; }
.peek-slot-mobile { display: inline-flex; }
@media (min-width: 1024px) {
  .peek-slot-mobile { display: none; }
  .shell-main { position: relative; }
  /* Fica no topo da página (não desce junto ao rolar) e "sai" de um buraco: elipse escura com brilho azul embaixo. */
  .peek-slot-desktop { display: block; position: absolute; top: 22px; right: 26px; z-index: 2; width: 84px; height: 92px; pointer-events: none; }
  .peek-slot-desktop::before { content: ''; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 22px; border-radius: 50%;
    background: radial-gradient(ellipse at 50% 40%, #0b1430 0%, #13234f 45%, rgba(37, 99, 255, .35) 70%, transparent 74%);
    box-shadow: 0 0 18px rgba(37, 99, 255, .35), inset 0 3px 6px rgba(0, 0, 0, .6); }
  .peek-slot-desktop::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -6px; height: 10px; border-radius: 50%; background: radial-gradient(ellipse, rgba(15, 31, 68, .22), transparent 70%); }
  .peek-slot-desktop .luno-peek { position: absolute; left: 6px; bottom: 10px; pointer-events: auto; width: 72px; height: 72px; clip-path: inset(-40px -40px 0 -40px); animation: peek-float 4.2s ease-in-out infinite; }
  @keyframes peek-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
  @media (prefers-reduced-motion: reduce) { .peek-slot-desktop .luno-peek { animation: none; } }
  .page > .hero { padding-right: 110px; }
}

/* Pacientes: base de pacientes e ficha */
.pat-avatar { display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--t) 14%, #fff); color: var(--t); font: 700 calc(var(--s) * .36) / 1 system-ui; letter-spacing: .02em; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 22%, transparent); }
.pat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pat-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.pat-search { max-width: 420px; flex: 1 1 260px; }
.pat-list { display: grid; gap: 8px; }
.pat-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pat-row:hover { border-color: #c9d5ea; box-shadow: 0 6px 18px rgba(15, 31, 68, .07); transform: translateY(-1px); }
.pat-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pat-row-main { display: grid; flex: 1; min-width: 0; }
.pat-row-main b { color: #0f1f44; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pat-row-main small { color: var(--text-3); }
.pat-row-side { display: flex; align-items: center; gap: 10px; }
.pat-chevron { font-size: 22px; color: var(--text-3); }
.hub { display: grid; gap: 12px; }
.hub-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 6px 2px 4px; }
.hub-avatar { position: relative; border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; }
.hub-avatar:disabled { cursor: default; }
.hub-avatar-edit { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); padding: 2px 8px; border-radius: 99px; background: var(--accent); color: #fff; font: 600 11px system-ui; white-space: nowrap; box-shadow: 0 2px 6px rgba(37, 99, 255, .3); }
.hub-id { display: grid; gap: 3px; min-width: 0; }
.hub-id h3 { margin: 0; font-size: 21px; color: #0f1f44; }
.hub-id small { color: var(--text-3); }
.hub-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.hub-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.hub-card { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); }
.hub-card-head { display: flex; justify-content: space-between; align-items: center; }
.hub-card h4 { margin: 0; font-size: 14px; color: #0f1f44; }
.hub-appt, .hub-line { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.hub-appt small, .hub-line small { color: var(--text-3); }
.hub-appt .odg-st-tag { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.hub-appt.st-confirmed .odg-st-tag { background: #e8f0ff; color: var(--accent); }
.hub-appt.st-completed .odg-st-tag { background: #e7f8ee; color: #15803d; }
.hub-appt.st-cancelled { opacity: .6; }
.hub-notes { margin: 0; white-space: pre-wrap; color: var(--text-2); }
.hub-form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.hub-inline { display: flex; gap: 8px; }
.hub-inline .input { width: auto; }
.hub-timeline { display: grid; gap: 8px; margin-top: 10px; }
.hub-entry { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.hub-entry p { margin: 0; white-space: pre-wrap; }
.hub-entry .input-sm { width: auto; justify-self: start; }
.hub-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.hub-tile { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, #fff, #f6f8fc); text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.hub-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.hub-tile b { color: #0f1f44; font-size: 15px; }
.hub-tile small { color: var(--text-3); }
.wa-patient-link { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.wa-patient-link > div { display: grid; }
.wa-patient-link small { color: var(--text-3); }
.wa-patient-link .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 640px) {
  .hub-head { grid-template-columns: auto 1fr; }
  .hub-quick { grid-column: 1 / -1; justify-content: flex-start; }
}
:root[data-theme='dark'] .pat-row-main b, :root[data-theme='dark'] .hub-id h3, :root[data-theme='dark'] .hub-card h4, :root[data-theme='dark'] .hub-tile b { color: #e5ecff; }
:root[data-theme='dark'] .hub-form, :root[data-theme='dark'] .hub-tile { background: rgba(255, 255, 255, .04); }

/* Painel: o dia de hoje */
.today { display: grid; gap: 12px; margin-bottom: 18px; }
.today-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.today-head h2 { margin: 2px 0 0; font-size: 22px; color: #0f1f44; text-transform: capitalize; }
.today-actions { display: flex; gap: 6px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.today-card { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface, #fff); box-shadow: 0 6px 20px rgba(15, 31, 68, .05); }
.today-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.today-card-head span { font: 600 13px system-ui; color: var(--text-2); }
.today-card-head b { font-size: 28px; line-height: 1; color: #0f1f44; }
.t-agenda { border-top: 4px solid #2563ff; }
.t-wait { border-top: 4px solid #f59e0b; }
.t-new { border-top: 4px solid #16a34a; }
.today-list { display: grid; gap: 2px; }
.today-item { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 6px 8px; border-radius: 10px; }
.today-item b { font-size: 13px; color: #0f1f44; white-space: nowrap; }
.today-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-item small { grid-column: 2; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-item.next { background: #eef4ff; }
.today-item.done { opacity: .55; }
.today-card .btn-text { justify-self: start; padding-left: 0; }
.section-title { margin: 8px 0 0; font-size: 17px; color: #0f1f44; }
:root[data-theme='dark'] .today-head h2, :root[data-theme='dark'] .today-card-head b, :root[data-theme='dark'] .today-item b, :root[data-theme='dark'] .section-title { color: #e5ecff; }
:root[data-theme='dark'] .today-item.next { background: rgba(37, 99, 255, .15); }
.pat-avatar.portrait { width: calc(var(--s) * .75); height: var(--s); border-radius: calc(var(--s) * .1); }
.pat-avatar.round { border-radius: 50%; }
.wa-avatar { overflow: hidden; }
.wa-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.pat-avatar img { object-position: center 25%; }
.hub-avatar .pat-avatar.portrait { box-shadow: 0 6px 16px rgba(15, 31, 68, .14), inset 0 0 0 1px rgba(15, 31, 68, .08); }

/* Fluxo das conversas */
.flow-intro { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-start; margin: 10px 0; }
.flow-intro h3 { margin: 0; color: #0f1f44; }
.flow-intro p { margin: 4px 0 0; max-width: 680px; }
.switch-row { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); cursor: pointer; }
.switch-row > span { display: grid; }
.switch-row small { color: var(--text-3); }
.flow-ask { display: grid; gap: 6px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #eef4ff, #f6f0ff); border: 1px solid #d8e3fb; margin-bottom: 10px; }
.flow-ask b { color: #0f1f44; }
.flow-ask-input { background: #fff; }
.flow-proposal { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid #d8e3fb; }
.flow-proposal p { margin: 0; }
.flow-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.flow-toolbar .btn { border-left: 3px solid var(--c); }
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.flow-canvas { position: relative; overflow: auto; min-height: 420px; max-height: 70vh; padding: 18px; border-radius: 16px; border: 1px solid var(--line);
  background-color: #f8fafd; background-image: radial-gradient(#d5deec 1px, transparent 1px); background-size: 18px 18px; }
.flow-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.flow-cols { position: relative; display: flex; gap: 70px; align-items: flex-start; width: max-content; }
.flow-col { display: grid; gap: 18px; }
.flow-node { display: grid; gap: 4px; width: 230px; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(15, 31, 68, .07); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.flow-node:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 31, 68, .11); }
.flow-node.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent), 0 8px 22px rgba(15, 31, 68, .11); }
.flow-node-head { display: flex; gap: 6px; align-items: center; }
.flow-node-head b { flex: 1; color: #0f1f44; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-start { padding: 1px 7px; border-radius: 99px; background: #0f1f44; color: #fff; font: 600 10.5px system-ui; }
.flow-kind { color: var(--c); font-weight: 600; font-size: 11.5px; }
.flow-text { margin: 0; font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.flow-out { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-right: -12px; padding: 4px 0 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--c) 8%, #fff); font-size: 12px; color: #0f1f44; }
.flow-out.next { background: none; color: var(--text-3); }
.flow-port { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px #fff; margin-right: -5px; flex: none; }
.flow-empty { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 60px 20px; color: var(--text-2); }
.flow-editor { position: sticky; top: 10px; display: grid; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface, #fff); }
.flow-ed-head { display: flex; gap: 8px; align-items: center; padding-bottom: 6px; border-bottom: 3px solid var(--c); }
.flow-btns { display: grid; gap: 6px; }
.flow-btn-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; }
.flow-ed-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow-save { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.flow-status { color: var(--text-3); }
@media (max-width: 980px) { .flow-wrap { grid-template-columns: 1fr; } .flow-editor { position: static; } }
:root[data-theme='dark'] .flow-canvas { background-color: #0f172a; background-image: radial-gradient(#1e293b 1px, transparent 1px); }
:root[data-theme='dark'] .flow-node, :root[data-theme='dark'] .flow-proposal, :root[data-theme='dark'] .flow-ask-input { background: var(--surface); }
:root[data-theme='dark'] .flow-node-head b, :root[data-theme='dark'] .flow-intro h3, :root[data-theme='dark'] .flow-ask b { color: #e5ecff; }
:root[data-theme='dark'] .flow-ask { background: rgba(37, 99, 255, .08); border-color: rgba(37, 99, 255, .25); }
.sim { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface, #fff); }
.sim-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.sim-head > div { display: grid; gap: 2px; }
.sim-log { display: grid; gap: 8px; align-content: start; max-height: 420px; min-height: 160px; overflow-y: auto; padding: 14px; border-radius: 12px; background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d9d2c5'/%3E%3C/svg%3E"); }
.sim-msg { max-width: 78%; display: grid; gap: 6px; }
.sim-msg p { margin: 0; padding: 8px 11px; border-radius: 10px; white-space: pre-wrap; font-size: 14px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.sim-msg.cliente { justify-self: end; }
.sim-msg.cliente p { background: #d9fdd3; }
.sim-msg.ia p { background: #fff; }
.sim-msg.typing p { color: var(--text-3); font-style: italic; }
.sim-btns { display: grid; gap: 4px; }
.sim-btn { padding: 8px 10px; border: 0; border-radius: 10px; background: #fff; color: #027eb5; font: 600 13.5px system-ui; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.sim-btn:disabled { color: #9ab; cursor: default; }
.sim-flag { color: #b45309; font-weight: 600; }
.sim-send { display: flex; gap: 8px; }
.sim-send .input { flex: 1; }
.wa-files { display: grid; gap: 4px; margin-top: 4px; }
.wa-files-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wa-file { display: grid; gap: 2px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; cursor: pointer; }
.wa-file img, .wa-file-ph, .wa-file-doc { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; background: #f1f4fa; color: var(--text-3); font: 700 11px system-ui; }
.wa-file small { padding: 0 4px 3px; font-size: 10.5px; color: var(--text-2); text-align: center; }
.wa-file:hover { border-color: var(--accent); }
.prompt-section { display: grid; gap: 8px; margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface, #fff); }
.prompt-section h3 { margin: 0; color: #0f1f44; }
.prompt-section p { margin: 0; }
.prompt-extra { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.prompt-details summary { cursor: pointer; }
.prompt-view { margin: 0; max-height: 520px; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 12px; border-radius: 12px; background: #0f172a; color: #e2e8f0; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.prompt-edit { width: 100%; min-height: 420px; max-height: none; resize: vertical; border: 1px solid #1e293b; outline: none; }
/* Ao editar continua escuro com letra clara (a regra geral de .input:focus deixava o fundo branco). */
.prompt-edit, .prompt-edit:focus, .prompt-edit:hover { background: #0f172a; color: #e2e8f0; caret-color: #93b4ff; }
.prompt-edit:focus { border-color: #2563ff; box-shadow: 0 0 0 3px rgba(37, 99, 255, .35); }
.prompt-edit::selection { background: #2563ff; color: #fff; }
.prompt-edit:disabled { opacity: .85; }
.prompt-locked { opacity: .75; }
.prompt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prompt-head .chip { padding: 2px 10px; border-radius: 99px; background: #eef2ff; color: #1d4ed8; font: 600 12px system-ui; }
.prompt-head .chip-warn { background: #fff8e6; color: #a16207; }
.prompt-rules { margin: 0; white-space: pre-wrap; padding: 10px 12px; border-radius: 12px; background: #f6f8fc; border-left: 4px solid #2563ff; font: 13px/1.5 system-ui; }
.banner-warn { background: #fff8e6; color: #7c4a03; border: 1px solid #f5d48a; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; }
.temp-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; font: 600 11.5px system-ui; white-space: nowrap; }
.temp-hot { background: #fff1ee; color: #c2410c; }
.temp-warm { background: #fff8e6; color: #a16207; }
.temp-cold { background: #eaf4ff; color: #1d4ed8; }
.t-leads { border-top: 4px solid #e5484d; }
.lead-temps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lead-temp { display: grid; justify-items: center; padding: 8px 4px; border-radius: 12px; }
.lead-temp b { font-size: 22px; line-height: 1; }
.lead-temp small { font-size: 11.5px; font-weight: 600; }
.lead-temp-sem { grid-column: 1 / -1; text-align: center; }
.lead-src { display: grid; gap: 4px; margin-top: 4px; }
.lead-src-row { display: grid; grid-template-columns: 92px 1fr 28px; gap: 6px; align-items: center; font-size: 12.5px; }
.lead-src-row i { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--w), #e8eef8 var(--w)); }
.lead-src-row b { text-align: right; color: #0f1f44; }
.imp-how { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #f6f8fc; border: 1px solid var(--line); }
.imp-how ol, .imp-how ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.imp-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.imp-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.imp-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.imp-sum > div { display: grid; justify-items: center; padding: 10px; border-radius: 12px; background: #f6f8fc; }
.imp-sum b { font-size: 24px; color: #0f1f44; }
.imp-sum-ok { background: #e7f8ee !important; }
.imp-sum-err { background: #fff1ee !important; }
.imp-done { display: grid; gap: 8px; padding: 16px; border-radius: 14px; background: #e7f8ee; }
:root[data-theme='dark'] .imp-how, :root[data-theme='dark'] .imp-sum > div { background: rgba(255, 255, 255, .04); }

/* ---- Agenda com cara de CRM (28/10/2026): números do dia, lista, ações rápidas e horários livres ---- */
.agd-search { width: 260px; max-width: 100%; }
.agd-views { margin-left: 4px; }
.agd-kpis { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 12px 0 4px; }
.agd-kpis-when { align-self: center; font-weight: 700; color: var(--text-2); margin-right: 4px; text-transform: capitalize; min-width: 64px; }
.agd-kpi { display: grid; gap: 2px; min-width: 96px; padding: 10px 14px; text-align: left; font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.agd-kpi b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.agd-kpi span { font-size: 12.5px; color: var(--text-3); }
.agd-kpi:hover { border-color: var(--accent); }
.agd-kpi.on { border-color: var(--accent); background: var(--accent-soft); }
.agd-kpi-scheduled b { color: #b45309; }
.agd-kpi-confirmed b { color: #15803d; }
.agd-kpi-no_show b { color: #b91c1c; }
.agd-kpi-cancelled b { color: var(--text-3); }
.agd-item { grid-template-columns: 6px 52px auto minmax(0, 1fr) auto; cursor: pointer; }
.agd-item:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.agd-item .cal-day-time { display: grid; line-height: 1.15; }
.agd-item .cal-day-time small { font-weight: 500; color: var(--text-3); font-size: 12px; }
.agd-item.no_show, .agd-item.completed { opacity: 0.78; }
.agd-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.agd-tags:empty { display: none; }
.agd-tags .cal-tag { grid-column: auto; }
.agd-tag-new { color: #7c3aed; background: rgba(124, 58, 237, 0.12); }
.agd-side { display: grid; justify-items: end; gap: 6px; }
.agd-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.agd-actions:empty { display: none; }
.agd-st { white-space: nowrap; }
.agd-st-scheduled { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.agd-st-confirmed { background: rgba(22, 163, 74, 0.14); color: #15803d; }
.agd-st-completed { background: rgba(37, 99, 255, 0.12); color: var(--accent); }
.agd-st-no_show { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.agd-st-cancelled { background: var(--fill); color: var(--text-3); }
.agd-next { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.agd-free { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.agd-free:empty { display: none; }
.agd-free-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.agd-free-head h4 { margin: 0; font-size: 15px; }
.agd-free-head .input-sm { width: auto; max-width: 220px; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.agd-free .slot-chip { min-width: 64px; padding: 8px 12px; }
.agd-list { display: grid; gap: 14px; margin-top: 12px; }
.agd-group { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.agd-group.today { border-color: var(--accent); }
.agd-group-title { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: 16px; }
.agd-group-title::first-letter { text-transform: uppercase; }
.agd-group-title small { font-weight: 500; color: var(--text-3); font-size: 13px; }
.agd-detail-head { display: flex; gap: 14px; align-items: center; }
.agd-detail-head h3 { margin: 0 0 2px; }
.agd-detail-head .muted { margin: 0 0 4px; }
.agd-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 4px 0; }
.agd-facts dt { color: var(--text-3); font-size: 13px; }
.agd-facts dd { margin: 0; }
.agd-facts dd::first-letter { text-transform: uppercase; }
.agd-history { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.agd-history:empty { display: none; }
.agd-history h4 { margin: 0; font-size: 15px; }
.agd-history .muted { margin: 0 0 4px; }
.agd-history-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; margin: 0; font-size: 13.5px; }
@media (max-width: 640px) {
  .agd-search { width: 100%; }
  .agd-kpi { min-width: 0; flex: 1 1 calc(33% - 8px); padding: 8px 10px; }
  .agd-kpi b { font-size: 18px; }
  .agd-kpis-when { width: 100%; }
  .agd-item { grid-template-columns: 6px 46px minmax(0, 1fr); }
  .agd-item > .pat-avatar { display: none; }
  .agd-side { grid-column: 2 / -1; justify-items: start; }
  .agd-actions { justify-content: flex-start; }
}

/* Nota do atendimento (Painel → Hoje) */
.rating-box { display: grid; gap: 8px; }
.rating-bars { display: grid; gap: 4px; }
.rating-row { display: grid; grid-template-columns: 30px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; }
.rating-row i { height: 8px; border-radius: 99px; background: var(--fill); position: relative; overflow: hidden; }
.rating-row i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: #f5b301; border-radius: inherit; }
.rating-row small { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Recepcionista (IA das conversas): três passos simples + "Mais ajustes" */
.recep-intro { padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 12px; font-size: 14px; line-height: 1.45; }
.recep-step { display: grid; gap: 10px; margin-bottom: 12px; }
.recep-step-head { display: flex; gap: 12px; align-items: flex-start; }
.recep-step-head h3 { margin: 0; font-size: 17px; }
.recep-step-head .hint { margin: 2px 0 0; }
.recep-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.recep-step .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.recep-more { margin-bottom: 12px; }
.recep-more summary { cursor: pointer; font-weight: 600; }
.recep-more[open] summary { margin-bottom: 10px; }
.recep-more h4 { margin: 14px 0 6px; }
.recep-step button.chip { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 13px; padding: 6px 12px; }
.recep-imp { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.recep-imp-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.recep-imp-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.recep-imp-item pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13.5px; background: var(--fill); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 640px) { .recep-imp-item { grid-template-columns: 1fr; } }
.flow-learn { display: grid; gap: 8px; justify-items: start; margin: 0 0 12px; }
.flow-learn .switch-row { width: 100%; }
.flow-learn-log ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.comment-words { display: grid; gap: 8px; margin-top: 8px; } .comment-words .btn { justify-self: start; }
.help-log { min-height: 160px; max-height: 340px; }

/* Kanban do CRM: cor pastel por etapa (pedido do dono) */
.crm-col { background: color-mix(in srgb, var(--stage, transparent) 7%, var(--fill)); border-top: 3px solid color-mix(in srgb, var(--stage, var(--line)) 55%, transparent); }
.crm-col h3 { display: flex; align-items: center; gap: 7px; }
.crm-stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stage, var(--accent)); flex: none; }
.crm-col .crm-card { background: color-mix(in srgb, var(--stage, transparent) 5%, var(--surface)); border-left: 3px solid color-mix(in srgb, var(--stage, var(--line)) 45%, transparent); }
.crm-col .crm-card:hover { border-color: color-mix(in srgb, var(--stage, var(--accent)) 45%, var(--line)); }

/* Painel: gráficos mais bonitos (28/10/2026) */
.performance-stats .stat { position: relative; overflow: hidden; }
.performance-stats .stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); opacity: .7; }
.performance-stats .stat:nth-child(2)::before { background: #19a974; }
.performance-stats .stat:nth-child(3)::before { background: #f5ac35; }
.performance-stats .stat:nth-child(4)::before { background: #a78bfa; }
.performance-stats .stat:nth-child(5)::before { background: #38bdf8; }
.performance-stats .stat:nth-child(6)::before { background: #2dd4bf; }
.perf-card { border-radius: 20px; box-shadow: var(--shadow); }
.perf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.perf-head .hint { margin: 0; }
.perf-totals { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.perf-totals b { font-size: 18px; color: var(--text); margin-right: 2px; }
.perf-totals span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: #2563ff; }
.perf-totals .out::before { background: #2dd4bf; }
.perf-plot { position: relative; height: 210px; padding-left: 28px; }
.perf-grid { position: absolute; inset: 8px 0 22px 28px; }
.perf-grid span { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1px dashed var(--line); }
.perf-grid i { position: absolute; left: -28px; top: -8px; width: 24px; text-align: right; font-style: normal; font-size: 10px; color: var(--text-3); }
.perf-bars { position: absolute; inset: 8px 0 0 28px; display: flex; gap: 4px; overflow-x: auto; }
.perf-day { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.perf-day small { height: 18px; color: var(--text-3); font-size: 10px; }
.perf-pair { flex: 1; width: 100%; display: flex; justify-content: center; align-items: flex-end; gap: 2px; }
.perf-bar { position: relative; width: min(45%, 12px); height: var(--h); min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #5b8cff, #2563ff); transition: height .5s cubic-bezier(.2, .8, .2, 1), filter .15s; }
.perf-bar.out { background: linear-gradient(180deg, #5eead4, #14b8a6); }
.perf-bar em { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; white-space: nowrap; }
.perf-day:hover .perf-bar { filter: brightness(1.08); }
.perf-day:hover .perf-bar em { display: block; }
.perf-appts-body { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.perf-donut { width: 150px; height: 150px; flex: none; border-radius: 50%; background: var(--ring); display: grid; place-items: center; }
.perf-donut-center { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.perf-donut-center strong { font-size: 28px; line-height: 1.05; }
.perf-donut-center span { color: var(--text-2); font-size: 11px; }
.perf-legend { display: grid; gap: 8px; min-width: 180px; flex: 1; }
.perf-legend-row { display: grid; grid-template-columns: 10px 1fr auto 40px; align-items: center; gap: 8px; font-size: 13.5px; }
.perf-legend-row i { width: 10px; height: 10px; border-radius: 3px; }
.perf-legend-row small { color: var(--text-3); text-align: right; }
@media (max-width: 640px) { .perf-donut { width: 120px; height: 120px; } .perf-donut-center { width: 84px; height: 84px; } .perf-plot { height: 180px; } }
@media (prefers-reduced-motion: reduce) { .perf-bar { transition: none; } }

/* Planos e serviços: cartões tipo cardápio */
.svc-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.svc-tools .input { width: 240px; max-width: 100%; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.svc-card { display: grid; gap: 8px; align-content: start; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.svc-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.svc-card.plano { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 60%); }
.svc-card.is-archived { opacity: .6; }
.svc-top { display: flex; justify-content: space-between; align-items: center; }
.svc-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--fill); }
.svc-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--text-2); }
.svc-kind.plano { background: var(--accent-soft); color: var(--accent); }
.svc-card h3 { margin: 2px 0 0; font-size: 16px; line-height: 1.3; }
.svc-price { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--accent); }
.svc-price small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.svc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-tags span { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--fill); color: var(--text-2); }
.svc-tags .off { background: var(--red-soft); color: var(--red); }
.svc-actions { display: flex; gap: 6px; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .svc-card { transition: none; } .svc-card:hover { transform: none; } }
.solver-ask { white-space: pre-wrap; font-size: 13px; background: var(--fill); padding: 10px 12px; border-radius: 10px; }
.wa-compare .table td, .wa-compare .table th { font-size: 13px; vertical-align: top; }
.odq-items { display: grid; gap: 10px; margin: 8px 0; } .odq-row { display: grid; grid-template-columns: 1fr 120px; gap: 6px 8px; } .odq-row small { grid-column: 1 / -1; }

/* Financeiro → Integrações (API) */
.api-intro { margin: 6px 0 14px; }
.api-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.api-card { display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.api-card.on { border-color: color-mix(in srgb, #19a974 45%, var(--line)); }
.api-card-head { display: flex; align-items: center; gap: 10px; }
.api-card-head .badge { margin-left: auto; }
.api-connect { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.api-manual { display: grid; gap: 6px; }
.provider-mark { width: var(--s); height: var(--s); flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 800; font-size: calc(var(--s) * .38); overflow: hidden; }
.provider-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.provider-connected { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.provider-connected:empty { display: none; }
.provider-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.sub-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.sub-card.off { opacity: .6; }
.sub-card p { margin: 2px 0 6px; }
.stack-sm { display: grid; gap: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } @media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
:root[data-theme='dark'] .prompt-rules { background: #172036; color: #e2e8f0; }
:root[data-theme='dark'] .banner-warn { background: #2a2210; color: #f5d48a; border-color: #5c4a1a; }
/* Tutoriais em vídeo (Ajuda e Painel Dev) */
.tut-group { margin-top: 14px; }
.tut-group h3 { margin: 0 0 8px; font-size: 14px; color: var(--text-2, #526077); text-transform: uppercase; letter-spacing: .04em; }
.tut-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; margin-bottom: 6px; border-radius: 14px; border: 1px solid var(--line, #e5eaf2); background: var(--surface, #fff); cursor: pointer; font: inherit; color: inherit; }
.tut-item:hover:not(:disabled) { border-color: var(--accent, #2563ff); }
.tut-item b { display: block; } .tut-item small { color: var(--text-2, #526077); }
.tut-item.soon { opacity: .6; cursor: default; }
.tut-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft, #e7f0ff); color: var(--accent, #2563ff); font-weight: 800; }
.tut-player { display: grid; gap: 6px; margin: 10px 0; }
.tut-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.tut-frame iframe, .tut-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tut-admin { display: grid; gap: 10px; }
.tut-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; border: 1px solid var(--line, #e5eaf2); background: var(--surface, #fff); flex-wrap: wrap; }
.tut-row-main { flex: 1 1 520px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.tut-row-side { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
@media (max-width: 700px) { .tut-row-main { grid-template-columns: 1fr; } }
