/* Avanço Commerce — Painel do Atendente IA */

/* ---------- Tema claro (padrão) ---------- */
:root {
  --brand: #5b21b6;
  --brand-600: #4c1d95;
  --brand-glow: rgba(124, 58, 237, .14);
  --brand-soft: #f1ebfd;
  --brand-soft-2: #e4d8fb;
  --brand-text: #5b21b6;
  --bg: #f5f3fa;
  --panel: #ffffff;
  --panel-2: #faf8fe;
  --field: #f8f6fc;
  --text: #1c1530;
  --muted: #6e6787;
  --border: #e9e4f3;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --success-text: #15803d;
  --danger: #dc2626;
  --danger-soft: #fde8e8;
  --warn-soft: #fff6e0;
  --warn-border: #fbe1a6;
  --warn-text: #8a5300;
  --shadow: 0 1px 2px rgba(40, 20, 80, .04), 0 8px 28px rgba(40, 20, 80, .06);
  --chat-bg: #f3effb;
  --bubble-in: #ffffff;
  --bubble-ai: #e9dffd;
  --bubble-human: #daf2e3;
  --radius: 18px;
  color-scheme: light;
}
/* ---------- Tema escuro ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-glow: rgba(139, 92, 246, .22);
    --brand-soft: #2a1d4a;
    --brand-soft-2: #3a2866;
    --brand-text: #c7b3fb;
    --bg: #100b1d;
    --panel: #1b1430;
    --panel-2: #21183a;
    --field: #241b3d;
    --text: #efeaf9;
    --muted: #a39bbd;
    --border: #2e2448;
    --success-soft: #133524;
    --success-text: #86efac;
    --danger-soft: #3d1a22;
    --warn-soft: #33270f;
    --warn-border: #4d3a14;
    --warn-text: #f5c46b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    --chat-bg: #150f26;
    --bubble-in: #261d40;
    --bubble-ai: #432a80;
    --bubble-human: #1b4430;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-glow: rgba(139, 92, 246, .22);
  --brand-soft: #2a1d4a;
  --brand-soft-2: #3a2866;
  --brand-text: #c7b3fb;
  --bg: #100b1d;
  --panel: #1b1430;
  --panel-2: #21183a;
  --field: #241b3d;
  --text: #efeaf9;
  --muted: #a39bbd;
  --border: #2e2448;
  --success-soft: #133524;
  --success-text: #86efac;
  --danger-soft: #3d1a22;
  --warn-soft: #33270f;
  --warn-border: #4d3a14;
  --warn-text: #f5c46b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --chat-bg: #150f26;
  --bubble-in: #261d40;
  --bubble-ai: #432a80;
  --bubble-human: #1b4430;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5;
  display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-text); font-weight: 600; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.hidden { display: none !important; }
::selection { background: var(--brand-soft-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--brand-soft-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 252px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(185deg, #2c0f57 0%, #1d0a3b 55%, #150730 100%);
  color: #e4dafa; padding: 20px 14px 16px; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
}
.brand { background: #fff; border-radius: 16px; padding: 6px 10px; display: flex; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.brand img { width: 100%; max-width: 190px; height: 70px; object-fit: cover; object-position: center; }
.brand-sub { text-align: center; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: #a993d6; margin: 12px 0 16px; font-weight: 700; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #7f6aae; margin: 18px 12px 6px; font-weight: 700; }
nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; justify-content: flex-start;
  background: none; color: #cfc2ec; border: 0; padding: 10px 12px; border-radius: 11px;
  cursor: pointer; font: inherit; font-weight: 500; transition: background .15s, color .15s;
  box-shadow: none;
}
nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
nav button.active { background: linear-gradient(90deg, rgba(167,139,250,.28), rgba(167,139,250,.08)); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 #b69cff; }
.badge { margin-left: auto; background: #ef4444; color: #fff; border-radius: 999px; padding: 0 8px; font-size: 11.5px; font-weight: 700; line-height: 20px; }
.theme-switch { display: flex; gap: 4px; background: rgba(255,255,255,.06); padding: 4px; border-radius: 12px; margin-bottom: 8px; }
.theme-switch button { flex: 1; background: none; color: #b5a6d8; padding: 6px; border-radius: 9px; font-size: 12px; font-weight: 600; gap: 6px; box-shadow: none; }
.theme-switch button svg { width: 15px; height: 15px; }
.theme-switch button:hover { background: rgba(255,255,255,.08); color: #fff; }
.theme-switch button.active { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 13px; color: #d6cbef; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.dot.ok { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.2); }
.dot.wait { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
.dot.off { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.2); }

/* ---------- Layout ---------- */
main {
  flex: 1; min-width: 0; padding: 28px 36px 48px;
  background:
    radial-gradient(900px 340px at 18% -120px, var(--brand-glow), transparent 70%),
    radial-gradient(700px 300px at 100% -160px, var(--brand-glow), transparent 70%);
  background-repeat: no-repeat;
}
.container { max-width: 1280px; margin: 0 auto; }
.tab { display: none; animation: fade .22s ease; } .tab.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.title-wrap { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; }
.page-icon { grid-row: span 2; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8b5cf6, #4c1d95); box-shadow: 0 10px 24px rgba(91,33,182,.35); }
.page-icon svg { width: 24px; height: 24px; }
h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
h3 .count { font-size: 12px; background: var(--brand-soft); color: var(--brand-text); padding: 1px 9px; border-radius: 999px; }
h3.mt { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.sub { margin: 3px 0 0; color: var(--muted); max-width: 760px; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 6px 8px; }
.card.narrow { max-width: 820px; }
.split { display: flex; gap: 18px; align-items: flex-start; }
.split > .card { margin-bottom: 0; }
.grow { flex: 1; min-width: 0; }
.side { width: 300px; flex-shrink: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.two-col .card { margin-bottom: 0; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.row input { flex: 1; }
.row.end { justify-content: flex-end; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -34px; top: -34px; width: 100px; height: 100px; border-radius: 50%; background: var(--brand-soft); opacity: .8; }
.stat > * { position: relative; z-index: 1; }
.stat-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
.stat-value .dot { width: 10px; height: 10px; }
.stat-value .unit { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.stat-foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat.highlight { background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 60%, #3b1475 100%); border-color: transparent; color: #fff; box-shadow: 0 14px 34px rgba(91,33,182,.35); }
.stat.highlight::after { background: rgba(255,255,255,.1); }
.stat.highlight .stat-label, .stat.highlight .stat-foot { color: #ddd0fb; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 13px; margin: 16px 0 6px; }
input, textarea, select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--field); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 4px var(--brand-glow); }
textarea { resize: vertical; }
#prompt-text { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13.5px; line-height: 1.65; }
button {
  background: linear-gradient(180deg, #6d28d9, #5b21b6); color: #fff; border: 0; padding: 11px 18px; border-radius: 11px;
  cursor: pointer; font: inherit; font-weight: 700; white-space: nowrap; transition: filter .15s, transform .05s, background .15s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center; box-shadow: 0 4px 14px rgba(91,33,182,.25);
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: wait; }
button.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
button.secondary:hover { background: var(--brand-soft); filter: none; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--border); box-shadow: none; }
button.danger:hover { background: var(--danger-soft); filter: none; }
button.small { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.card > button { margin-top: 18px; }
.save-bar { display: flex; justify-content: flex-end; max-width: 820px; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; margin: 0; font-size: 14px; }
.switch input { display: none; }
.switch span { width: 46px; height: 26px; background: #b9b0cf; border-radius: 999px; position: relative; transition: .2s; flex-shrink: 0; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { left: 23px; }
.switch.big { background: var(--panel); border: 1px solid var(--border); padding: 10px 18px 10px 12px; border-radius: 999px; box-shadow: var(--shadow); }

/* Escolha de modo (Configurações) */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; margin: 0; font-weight: 400; transition: border-color .15s, background .15s; }
.mode:hover { background: var(--panel-2); }
.mode:has(input:checked) { border-color: #8b5cf6; background: var(--brand-soft); }
.mode input { width: auto; margin-top: 3px; accent-color: #7c3aed; }
.mode b { display: block; font-size: 14px; }
.mode span { font-size: 12.5px; color: var(--muted); }
.code-box { display: flex; align-items: center; gap: 8px; background: var(--field); border: 1px dashed var(--brand-soft-2); border-radius: 11px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
.code-box span { flex: 1; }
.info-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-top: 18px; font-size: 13px; }
.info-box ol { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.info-box li { margin-bottom: 4px; }
.info-box b { color: var(--text); }

/* ---------- Início ---------- */
.qr { display: block; width: 240px; margin: 6px 0 14px; border-radius: 14px; background: #fff; padding: 10px; border: 1px solid var(--border); }
.wa-state { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); }
.wa-state .big-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--success-soft); color: var(--success-text); flex-shrink: 0; }
.wa-state .big-icon svg { width: 22px; height: 22px; }
.wa-state.bad .big-icon { background: var(--danger-soft); color: var(--danger); }
.wa-state.wait .big-icon { background: var(--warn-soft); color: var(--warn-text); }
.steps-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, transform .15s; }
.step:hover { border-color: #8b5cf6; transform: translateY(-2px); }
.step > span { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.step b { display: block; font-size: 14px; }
.step p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

/* Atividade recente */
.activity { display: flex; flex-direction: column; }
.act { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 10px; }
.act:last-child { border-bottom: 0; }
.act:hover { background: var(--panel-2); }
.act .who { flex: 1; min-width: 0; }
.act .who b { display: block; font-size: 14px; }
.act .who span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Alerts */
#alerts:empty { display: none; }
#alerts { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.alert { background: var(--warn-soft); color: var(--warn-text); border: 1px solid var(--warn-border); padding: 12px 16px; border-radius: 12px; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
:root[data-theme="dark"] .alert.error { color: #fca5a5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alert.error { color: #fca5a5; } }

/* Lists */
.list { display: flex; flex-direction: column; gap: 6px; max-height: 72vh; overflow: auto; }
.list-item { padding: 11px 12px; border: 1px solid transparent; border-radius: 13px; cursor: pointer; transition: border-color .15s, background .15s; display: flex; gap: 11px; align-items: flex-start; }
.list-item:hover { background: var(--panel-2); }
.list-item.active { border-color: #8b5cf6; background: var(--brand-soft); }
.list-item .body { flex: 1; min-width: 0; }
.list-item .meta { font-size: 12px; color: var(--muted); }
.list-item .preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.list-item .top { display: flex; align-items: center; gap: 6px; }
.list-item .top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); white-space: nowrap; }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.gray { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.tag.green { background: var(--success-soft); color: var(--success-text); }
.tag.lost { background: var(--danger-soft); color: var(--danger); }
.lost-bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--danger-soft); border-bottom: 1px solid var(--border); }
.lost-bar .lost-ico { font-size: 20px; }
.lost-bar b { color: var(--danger); }
.lost-bar .muted { font-size: 12.5px; }
.lost-item .muted { display: block; font-size: 12px; }

/* Empty states */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .e-icon { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.empty .e-icon svg { width: 28px; height: 28px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 360px; font-size: 13px; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
th { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
td input[type=checkbox] { width: 18px; height: 18px; accent-color: #7c3aed; }
.file-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.file-name .f-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; flex-shrink: 0; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--brand-soft-2); border-radius: 16px; padding: 38px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; background: var(--panel-2); transition: .15s; font-weight: 500;
}
.dropzone svg { width: 34px; height: 34px; color: var(--brand-text); margin-bottom: 6px; }
.dropzone.over, .dropzone:hover { border-color: #8b5cf6; background: var(--brand-soft); }
details { margin-top: 16px; } summary { cursor: pointer; color: var(--brand-text); font-weight: 700; }
details input, details textarea { margin-top: 10px; } details button { margin-top: 10px; }

/* Correções */
.corr-layout { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 18px; align-items: start; }
.corr-layout > .card { margin-bottom: 0; position: sticky; top: 20px; }
.cards-list { display: flex; flex-direction: column; gap: 12px; }
.correction { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.correction p { margin: 6px 0; }
.correction .q { font-weight: 700; }
.correction .bad { color: var(--danger); text-decoration: line-through; opacity: .85; font-size: 13.5px; }
.correction .good { background: var(--success-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; }

/* Guia de instruções */
.side-col { width: 380px; flex-shrink: 0; }
.side-col .card { margin-bottom: 0; max-height: calc(100vh - 230px); overflow-y: auto; }
.side-tabs { display: flex; gap: 4px; margin-bottom: 10px; background: var(--panel); border: 1px solid var(--border); padding: 4px; border-radius: 13px; }
.side-tab { flex: 1; background: none; color: var(--muted); box-shadow: none; padding: 8px; }
.side-tab:hover { background: var(--panel-2); filter: none; }
.side-tab.active { background: var(--brand-soft); color: var(--brand-text); }
.guide details { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.guide summary { margin-bottom: 8px; }
.g-item { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.g-item:last-of-type { border-bottom: 0; }
.g-item p { margin: 6px 0; font-size: 13px; color: var(--muted); }
.g-item p b { color: var(--text); }
.g-item button { margin-top: 2px; }
.guide code, .info-box code { background: var(--brand-soft); color: var(--brand-text); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.g-tips { padding-left: 18px; margin: 6px 0; font-size: 13px; color: var(--muted); }
.g-tips li { margin-bottom: 8px; }
.g-tips b { color: var(--text); }
.tip { font-size: 12.5px; background: var(--brand-soft); padding: 10px 12px; border-radius: 10px; margin: 10px 0 0; }

/* ---------- Cérebro ---------- */
/* Cores das partes do conhecimento (paleta categórica validada: azul, laranja, verde-água, amarelo) */
:root {
  --part-1: #2a78d6; --part-2: #eb6834; --part-3: #1baf7a; --part-4: #eda100;
  --part-5: #e87ba4;
  --part-ink-1: #fff; --part-ink-2: #fff; --part-ink-3: #fff; --part-ink-4: #0b0b0b; --part-ink-5: #fff;
  --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --part-1: #3987e5; --part-2: #d95926; --part-3: #199e70; --part-4: #c98500; --part-5: #d55181; --part-ink-4: #fff; }
}
:root[data-theme="dark"] { --part-1: #3987e5; --part-2: #d95926; --part-3: #199e70; --part-4: #c98500; --part-5: #d55181; --part-ink-4: #fff; }

/* Diário de aprendizado */
.badge.learn { background: #a78bfa; color: #1d0a3b; }
h3 .count.new { background: linear-gradient(135deg, #8b5cf6, #5b21b6); color: #fff; }
h3 .count.new:empty { display: none; }
.diary-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.diary-summary .sum { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.feed { display: flex; flex-direction: column; }
.feed-day { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 10px; }
.feed-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.feed-day:first-child { margin-top: 0; }
.feed-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 10px 8px; border-radius: 12px; position: relative; }
.feed-item:hover { background: var(--panel-2); }
.feed-item.is-new { background: linear-gradient(90deg, var(--brand-soft), transparent 70%); }
.feed-item .fi-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: var(--panel-2); border: 1px solid var(--border); }
.feed-item .fi-body { min-width: 0; }
.feed-item .fi-type { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.feed-item b { display: block; font-size: 14px; margin-top: 1px; }
.feed-item p { margin: 3px 0 0; font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-item time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.new-pill { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; background: linear-gradient(135deg, #8b5cf6, #5b21b6); color: #fff; margin-left: 6px; vertical-align: 1px; }
.feed.compact .feed-item p { -webkit-line-clamp: 1; }
.feed.compact .feed-day { display: none; }

/* Aprendizado automático */
.learn-status { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.learn-status .ls { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 150px; }
.learn-status .ls b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.learn-status .ls span { font-size: 12px; color: var(--muted); }
.learn-status .ls.running { border-color: #8b5cf6; background: var(--brand-soft); }
.ln-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.ln-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-2); }
.ln-item.off { opacity: .55; }
.ln-item input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: #7c3aed; }
.ln-item b { font-size: 14px; }
.ln-item p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.ln-item .meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brain-top { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.brain-top .card { margin-bottom: 0; }
.hero { display: flex; align-items: baseline; gap: 4px; margin-top: 8px; }
.hero span:first-child { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.hero-of { font-size: 18px; color: var(--muted); font-weight: 700; }
.tier { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin: 10px 0 14px; padding: 4px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); }
.meter { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--meter-color, var(--st-good)) 18%, transparent); overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; background: var(--meter-color, var(--st-good)); transition: width .6s ease; }
.next-steps { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.next-steps .ns-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ns-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.ns-item:hover { border-color: #8b5cf6; }
.ns-item b { flex: 1; font-weight: 600; }
.ns-item .pts { font-size: 12px; font-weight: 700; color: var(--brand-text); }

.factors { display: flex; flex-direction: column; }
.factor { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.factor:last-child { border-bottom: 0; }
.factor .f-ico { font-size: 18px; text-align: center; }
.factor b { display: block; font-size: 14px; }
.factor span { font-size: 12.5px; color: var(--muted); }
.factor .f-pts { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; text-align: right; }
.factor .f-pts button { margin-left: 8px; }

/* Barra segmentada (uma só barra dividida nas partes do conhecimento) */
.segbar { display: flex; gap: 2px; height: 28px; margin: 4px 0 16px; }
.seg { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 700; min-width: 3px; white-space: nowrap; overflow: visible; }
.legend-table th, .legend-table td { padding: 9px 10px; font-size: 13.5px; }
.legend-table td:not(:first-child), .legend-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* Início: cartão de saúde */
.home-health { display: grid; grid-template-columns: minmax(240px, 320px) 1fr auto; gap: 24px; align-items: center; cursor: pointer; transition: border-color .15s; }
.home-health:hover { border-color: #8b5cf6; }
.hh-row { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 10px; }
.hh-score { font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.hh-row .tier { margin: 0 0 0 8px; font-size: 12.5px; }
.hh-next { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-next .tag { font-size: 12px; padding: 4px 10px; }

/* Exemplos */
.ex-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.ex-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-2); }
.ex-item .grow b { display: block; font-size: 14px; }
.ex-item input[type=checkbox] { width: 18px; height: 18px; accent-color: #7c3aed; }
.people { display: flex; flex-direction: column; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; margin: 0; font-weight: 500; }
.person:has(input:checked) { border-color: #8b5cf6; background: var(--brand-soft); }
.person input { width: 18px; height: 18px; accent-color: #7c3aed; }
.person .muted { margin-left: auto; }

/* Consumo */
.usage-table th, .usage-table td { padding: 9px 10px; font-size: 13px; white-space: nowrap; }
.usage-table td:nth-child(n+3), .usage-table th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.usage-table tfoot td { font-weight: 800; border-top: 2px solid var(--border); }

@media (max-width: 1000px) {
  .brain-top, .home-health { grid-template-columns: 1fr; }
}

/* Seletor de modo de resposta + filtros */
.segmented { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--border); padding: 4px; border-radius: 14px; box-shadow: var(--shadow); }
.seg-label { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 0 8px 0 10px; }
.segmented button { background: none; color: var(--muted); box-shadow: none; padding: 8px 14px; border-radius: 10px; font-size: 13px; }
.segmented button:hover { background: var(--panel-2); filter: none; }
.segmented button.active { background: linear-gradient(180deg, #6d28d9, #5b21b6); color: #fff; box-shadow: 0 4px 12px rgba(91,33,182,.3); }
.chips { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.chip { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); box-shadow: none; padding: 5px 11px; font-size: 12px; border-radius: 999px; }
.chip:hover { filter: none; background: var(--brand-soft); }
.chip.active { background: var(--brand-soft); color: var(--brand-text); border-color: #8b5cf6; }
.ai-switch { background: var(--panel-2); border: 1px solid var(--border); padding: 7px 14px 7px 9px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.list-item .ai-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); flex-shrink: 0; }

/* ---------- Chat ---------- */
.inbox { display: flex; gap: 18px; align-items: stretch; }
.inbox > .card { margin-bottom: 0; }
.inbox-list { width: 330px; flex-shrink: 0; padding: 10px; max-height: calc(100vh - 175px); }
.inbox-search { margin-bottom: 8px; }
.chat-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #4c1d95); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.chat {
  background: var(--chat-bg); padding: 20px; height: calc(100vh - 340px); min-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  background-image: radial-gradient(var(--brand-soft-2) 1px, transparent 1px); background-size: 20px 20px;
}
.msg { max-width: 72%; padding: 9px 12px 6px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 2px rgba(30,10,60,.1); }
.msg.in { background: var(--bubble-in); align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.out { background: var(--bubble-ai); align-self: flex-end; border-bottom-right-radius: 5px; }
.msg.human { background: var(--bubble-human); align-self: flex-end; border-bottom-right-radius: 5px; }
.msg .foot { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.msg .fix { background: none; color: var(--brand-text); padding: 0; font-size: 11px; font-weight: 700; box-shadow: none; }
.msg .fix:hover { text-decoration: underline; filter: none; }
.day-sep { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--panel); border: 1px solid var(--border); padding: 3px 12px; border-radius: 999px; margin: 8px 0; }
.typing { align-self: flex-start; background: var(--bubble-in); padding: 12px 14px; border-radius: 16px; display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.empty-chat { margin: auto; }
.composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--panel); }
.composer input { flex: 1; border-radius: 999px; padding: 12px 18px; }
.composer { align-items: flex-end; }
.composer textarea { flex: 1; border-radius: 22px; padding: 12px 18px; resize: none; min-height: 46px; max-height: 180px; line-height: 1.4; font: inherit; }
/* Conversa transferida para a equipe */
.handoff-panel { border-top: 1px solid var(--warn-border); background: var(--warn-soft); padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.handoff-panel.meeting { border-top-color: transparent; background: var(--success-soft); }
.hp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hp-head b { color: var(--text); }
.hp-head .muted { font-size: 12.5px; margin-top: 2px; }
.hp-draft { display: flex; gap: 8px; }
.hp-draft input { flex: 1; }
.composer button { border-radius: 50%; width: 46px; height: 46px; padding: 0; }
.notice { background: var(--warn-soft); color: var(--warn-text); padding: 10px 18px; display: flex; align-items: center; gap: 12px; font-weight: 500; border-radius: 12px; }
.chat-card .notice { border-radius: 0; }

/* Login, usuário e permissões */
.login-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 20% 10%, #3b1d7a 0, transparent 50%), radial-gradient(circle at 80% 90%, #241050 0, transparent 50%), #140a2b; }
.login-box { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 30px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-box h2 { margin: 14px 0 4px; }
.login-logo { display: block; margin: 0 auto 6px; width: 120px; border-radius: 14px; background: #fff; padding: 6px; }
.login-box h2, .login-box > p.muted { text-align: center; }
body.role-usuario .admin-only { display: none !important; }
body:not(.role-usuario) .user-only { display: none !important; }
nav button.perm-off { display: none !important; }
.no-access { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.no-access .card { max-width: 440px; text-align: center; }
.no-access .row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.no-access a.btn { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 10px; background: var(--accent, #7c3aed); color: #fff; text-decoration: none; font-weight: 600; }
.omni-hint { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--border); font-size: 14px; }
body.booting main, body.booting .sidebar { visibility: hidden; }
.user-box { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 8px 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); color: #efeaf9; }
.user-box .grow b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .grow span { display: block; font-size: 11px; color: #b5a6d8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .icon-btn { color: #cbbdf0; padding: 4px 6px; }
.user-box .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.inst-pick { display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.08); }
.inst-pick svg { width: 16px; height: 16px; stroke: #cbbdf0; fill: none; stroke-width: 2; flex-shrink: 0; }
.inst-pick select { background: transparent; border: none; color: #fff; font-weight: 600; padding: 4px 0; box-shadow: none; }
.inst-pick select option { color: #1c1530; }
.inst-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.inst-row .grow b { display: block; }
.inst-row .dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.inst-row .dot.ok { background: #22c55e; } .inst-row .dot.wait { background: #f59e0b; } .inst-row .dot.off { background: #ef4444; }
.inst-row select { width: auto; }
.msg .foot .who { font-weight: 700; }
.segmented.disabled { opacity: .5; pointer-events: none; }
.audit-table td:last-child { max-width: 420px; white-space: pre-wrap; word-break: break-word; }

/* Agenda (calendário de reuniões) */
.agenda { display: flex; gap: 18px; align-items: flex-start; }
.agenda > .grow { min-width: 0; }
.agenda .side-col { display: flex; flex-direction: column; gap: 18px; width: 320px; }
.cal-card { padding: 18px; min-width: 0; }
.cal-day { min-width: 0; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h3 { margin: 0 6px; min-width: 150px; text-align: center; text-transform: capitalize; }
.cal-head .icon-btn { font-size: 20px; padding: 2px 12px; }
.cal-legend { margin-left: auto; display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekdays span { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 6px 4px; }
.cal-day { min-height: 104px; border: 1px solid var(--border); border-radius: 12px; padding: 6px; background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s; }
.cal-day:hover { border-color: #8b5cf6; }
.cal-day.other { opacity: .45; }
.cal-day.past { background: var(--panel-2); }
.cal-day .d-num { font-size: 12.5px; font-weight: 700; color: var(--muted); align-self: flex-start; padding: 1px 6px; border-radius: 999px; }
.cal-day.today .d-num { background: var(--brand); color: #fff; }
.cal-day .d-more { font-size: 11px; color: var(--muted); font-weight: 600; padding-left: 4px; }
.mt-chip { font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #8b5cf6; }
.mt-chip.manual { background: var(--panel-2); color: var(--text); border-left-color: var(--muted); }
.mt-chip.realizada { border-left-color: #16a34a; }
.mt-chip.cancelada, .mt-chip.nao_compareceu { text-decoration: line-through; opacity: .6; }
.mt-chip b { font-weight: 700; }
.mt-chip.ext { background: transparent; color: var(--muted); border: 1px dashed var(--border); border-left: 3px solid #0ea5e9; cursor: default; }
.tag.ext { background: transparent; color: var(--muted); border: 1px dashed #0ea5e9; }
#mt-meet-box { margin-top: 12px; }
.mt-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mt-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.mt-item:hover { border-color: #8b5cf6; }
.mt-when { text-align: center; min-width: 44px; }
.mt-when b { display: block; font-size: 18px; line-height: 1; }
.mt-when span { font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mt-item .grow { min-width: 0; }
.mt-item .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-item .muted { font-size: 12.5px; }
.mt-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; }
.ag-free { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ag-free .d { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: capitalize; margin-bottom: 4px; }
.ag-free .t { display: flex; flex-wrap: wrap; gap: 4px; }
.ag-free .t span { font-size: 12px; padding: 2px 7px; border-radius: 7px; background: var(--success-soft); color: var(--success-text); font-weight: 600; }
.day-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; cursor: pointer; }
.day-pick label:has(input:checked) { background: var(--brand-soft); border-color: #8b5cf6; color: var(--brand-text); }
.day-pick input { width: auto; }
.block-row { display: flex; align-items: center; gap: 8px; }
.block-row input { width: auto; }

/* Telas menores: a lista de reuniões vai para baixo do calendário (lado a lado), sem cortar nada */
@media (max-width: 1500px) {
  .agenda { flex-direction: column; align-items: stretch; }
  .agenda .side-col { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
  .agenda .side-col .card { max-height: none; }
  .cal-day { min-height: 84px; }
}
@media (max-width: 700px) { .cal-day { min-height: 64px; padding: 4px; } .mt-chip { font-size: 10.5px; } .cal-legend { display: none; } }

/* Recuperação de clientes */
.fu-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.fu-side { width: 360px; display: flex; flex-direction: column; gap: 18px; }
.fu-side .card { max-height: none; }
.fu-item { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--panel); }
.fu-item .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fu-item .top b { flex: 1; min-width: 0; }
.fu-item textarea { margin-top: 10px; }
.fu-item .row { flex-wrap: wrap; margin-top: 10px; }
.fu-ctx { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.fu-ctx div { padding: 6px 10px; border-radius: 10px; max-width: 85%; white-space: pre-wrap; }
.fu-ctx .in { background: var(--panel-2); border: 1px solid var(--border); align-self: flex-start; }
.fu-ctx .out { background: var(--brand-soft); color: var(--brand-text); align-self: flex-end; }
.fu-small { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.fu-small .grow { min-width: 0; }
.fu-small .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-step { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-top: 12px; }
.fu-step.off { opacity: .55; }
.fu-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fu-step-head .num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.fu-step-head input[type="number"] { width: 80px; }
.fu-step-head select { width: auto; }
.fu-step-head .grow { flex: 1; }
.fu-lesson { font-size: 13px; }
.fu-lesson .bad { text-decoration: line-through; color: var(--muted); }
@media (max-width: 1100px) { .fu-side { width: 100%; } }

/* ---------- Instruções em cartões ---------- */
.ins-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ins-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.ins-how-step { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ins-how-step > span { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.ins-how-step b { display: block; font-size: 14px; }
.ins-how-step p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.ins-how-step.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.ins-how-step.clickable:hover { border-color: #8b5cf6; transform: translateY(-2px); }
.ins-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.ins-main { min-width: 0; }
.ins-side { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ins-side .card { margin: 0; padding: 16px; }
.ins-side-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px 8px; }
.ins-idx { display: flex; width: 100%; justify-content: flex-start; align-items: center; gap: 9px; background: none; color: var(--text); box-shadow: none; padding: 7px 8px; border-radius: 9px; font-weight: 600; font-size: 13px; text-align: left; }
.ins-idx:hover { background: var(--brand-soft); filter: none; }
.ins-idx-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-idx-count { font-size: 11px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); padding: 0 7px; border-radius: 999px; }
details.ins-side-box { margin-top: 0; }
.ins-side-box summary { color: var(--text); font-size: 14px; }
.ins-side-box p { margin: 8px 0 0; }
.ins-auto-list { list-style: none; padding: 0; margin: 10px 0 0; font-size: 12.8px; color: var(--muted); }
.ins-auto-list li { margin-bottom: 8px; }
.ins-auto-list b { color: var(--text); }

.ins-card { scroll-margin-top: 16px; transition: border-color .3s, box-shadow .3s; }
.ins-card.flash { border-color: #8b5cf6; box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow); }
.ins-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ins-icon { width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.ins-fixed-title, .ins-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.ins-fixed-title { padding: 4px 0; }
.ins-title { border: 1px solid transparent; background: transparent; padding: 3px 8px; margin-left: -9px; border-radius: 8px; }
.ins-title:hover { border-color: var(--border); background: var(--field); }
.ins-title:focus { background: var(--field); }
.ins-hint { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ins-warn { margin: 8px 0 0; font-size: 12.5px; background: var(--warn-soft); color: var(--warn-text); border: 1px solid var(--warn-border); border-radius: 9px; padding: 6px 10px; }
.ins-note-wrap { display: flex; align-items: center; gap: 4px; margin: 2px 0; }
.ins-note-wrap span { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ins-note { border: 1px solid transparent; background: transparent; padding: 3px 8px; font-size: 13px; font-style: italic; color: var(--muted); border-radius: 8px; }
.ins-note:hover, .ins-note:focus { border-color: var(--border); background: var(--field); color: var(--text); }
.ins-tools { display: flex; gap: 2px; flex-shrink: 0; opacity: .5; transition: opacity .15s; }
.ins-card:hover .ins-tools, .ins-tools:focus-within { opacity: 1; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.ins-del:hover { color: var(--danger); background: var(--danger-soft); }
.ins-card textarea.auto { max-height: 640px; min-height: 0; line-height: 1.55; }
.ins-free { background: transparent; border-style: dashed; font-size: 13.5px; }
.ins-items { display: flex; flex-direction: column; gap: 7px; margin: 8px 0; }
.ins-items textarea { padding: 9px 12px; }
.ins-item { display: flex; gap: 10px; align-items: flex-start; }
.ins-bullet { width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; flex-shrink: 0; margin-top: 18px; }
.ins-x { padding: 6px 9px; margin-top: 4px; opacity: .45; }
.ins-item:hover .ins-x, .ins-pair:hover .ins-x, .ins-step:hover .ins-x, .ins-x:focus { opacity: 1; }
.ins-x:hover { color: var(--danger); background: var(--danger-soft); }
.ins-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.ins-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; margin-top: 6px; }
.ins-step-tools { display: flex; align-items: center; flex-shrink: 0; }
.ins-step-tools .icon-btn { padding: 6px 8px; margin-top: 4px; }
.ins-pair { display: grid; grid-template-columns: minmax(0, 2fr) 18px minmax(0, 3fr) 34px; gap: 8px; align-items: start; }
.ins-pair-head span { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ins-pair-arrow { color: var(--brand-text); font-weight: 800; padding-top: 9px; text-align: center; }
.ins-pair textarea.ins-pair-r { background: var(--brand-soft); }
.ins-add-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.ins-enter-hint { font-size: 12px; color: var(--muted); }
.ins-add-card { border: 2px dashed var(--brand-soft-2); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.ins-add-title { font-weight: 800; margin-bottom: 12px; }
.ins-add-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ins-add-type { flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; gap: 2px; background: var(--panel); color: var(--text); border: 1px solid var(--border); box-shadow: none; padding: 12px 14px; }
.ins-add-type:hover { border-color: #8b5cf6; background: var(--brand-soft); filter: none; }
.ins-add-type b { font-size: 13.5px; }
.ins-add-type span { font-size: 12px; color: var(--muted); font-weight: 500; }
.ins-add-type .ins-add-ic { font-size: 20px; margin-bottom: 2px; }

/* Abas internas da página Instruções */
.ins-views { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.ins-views button { display: flex; align-items: center; gap: 12px; justify-content: flex-start; text-align: left; white-space: normal; background: var(--panel); color: var(--text); border: 2px solid var(--border); box-shadow: var(--shadow); padding: 12px 16px; border-radius: 16px; }
.ins-views button:hover { border-color: #b69cff; filter: none; }
.ins-views button.active { border-color: #8b5cf6; background: var(--brand-soft); box-shadow: 0 0 0 4px var(--brand-glow); }
.ins-views .iv-ic { font-size: 24px; width: 44px; height: 44px; border-radius: 13px; background: var(--panel-2); display: grid; place-items: center; flex-shrink: 0; }
.ins-views button.active .iv-ic { background: var(--panel); }
.ins-views b { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.ins-views small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.iv-count { font-style: normal; font-size: 11px; background: var(--brand); color: #fff; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.iv-count:empty { display: none; }
#ins-restart { margin-bottom: 18px; }
.ins-toolbar { display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ins-pane > .ins-layout { margin-bottom: 18px; }
#tab-instrucoes > .ins-savebar { margin-top: 4px; }

/* Galeria de mídias */
.media-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.media-top .card { margin: 0; }
.media-upload { border: 2px dashed var(--brand-soft-2); box-shadow: none; display: flex; align-items: center; justify-content: center; min-height: 190px; transition: border-color .15s, background .15s; }
.media-upload.over { border-color: #8b5cf6; background: var(--brand-soft); }
.media-up-main { text-align: center; }
.media-up-icon { font-size: 30px; margin-bottom: 4px; }
.media-up-main b { font-size: 15px; }
.media-up-main p { margin: 4px 0 14px; }
.media-up-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.media-rec-panel { display: flex; align-items: center; gap: 12px; width: 100%; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(220,38,38,.5); animation: recpulse 1.2s infinite; flex-shrink: 0; }
@keyframes recpulse { 70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
#media-rec-time { font-variant-numeric: tabular-nums; font-size: 18px; min-width: 48px; }
.rec-meter { flex: 1; height: 44px; display: flex; align-items: center; gap: 3px; }
.rec-meter i { flex: 1; height: 8%; background: #8b5cf6; border-radius: 3px; transition: height .1s; }
.media-busy { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--brand-text); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--brand-soft-2); border-top-color: #8b5cf6; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.media-how ol { margin: 6px 0 10px; padding-left: 20px; font-size: 13px; color: var(--muted); }
.media-how li { margin-bottom: 6px; }
.media-how b { color: var(--text); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.media-grid > .card { margin: 0; }
.media-card { padding: 0; overflow: hidden; transition: opacity .2s, border-color .3s, box-shadow .3s; }
.media-card.flash { border-color: #8b5cf6; box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow); }
.media-card.off .media-preview, .media-card.off .media-body > :not(.media-head) { opacity: .5; }
.media-preview { background: var(--chat-bg); border-bottom: 1px solid var(--border); }
.media-img img { display: block; width: 100%; height: 210px; object-fit: contain; background: var(--chat-bg); }
.media-body { padding: 16px 18px 14px; }
.media-body label { margin-top: 14px; }
.media-head { display: flex; align-items: center; gap: 10px; }
.media-head .ins-title { flex: 1; min-width: 0; font-size: 16px; }
.media-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.media-triggers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-tr { flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; white-space: normal; background: var(--panel); color: var(--text); border: 2px solid var(--border); box-shadow: none; padding: 9px 10px; border-radius: 12px; }
.media-tr:hover { background: var(--panel-2); filter: none; }
.media-tr.active { border-color: #8b5cf6; background: var(--brand-soft); }
.media-tr .mt-ic { font-size: 17px; }
.media-tr b { font-size: 12.8px; }
.media-tr small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.media-auto-note:empty { display: none; }
.media-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.media-sw { font-size: 13px; font-weight: 600; gap: 9px; }
.media-sw em { font-style: normal; }
.media-head .media-sw { flex-shrink: 0; }
.media-status { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--success-text); white-space: nowrap; }
.media-status.saving { color: var(--muted); }
.media-status.err { color: var(--danger); }
.media-empty { grid-column: 1 / -1; text-align: center; padding: 34px; }
.media-empty-ic { font-size: 34px; }
.media-empty b { display: block; font-size: 16px; margin-top: 6px; }
.media-ideas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.media-ideas span { background: var(--brand-soft); color: var(--brand-text); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }

/* Player de áudio no estilo do WhatsApp */
.ap { display: flex; align-items: center; gap: 12px; padding: 18px; }
.ap-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #4c1d95); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.ap-play { width: 40px; height: 40px; border-radius: 50%; padding: 0; flex-shrink: 0; font-size: 14px; }
.ap-wave { flex: 1; height: 40px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.ap-wave i { flex: 1; background: var(--brand-soft-2); border-radius: 2px; min-width: 2px; }
.ap-wave i.on { background: #7c3aed; }
.ap-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* Mídia dentro das conversas e do simulador */
.msg.has-media { display: flex; flex-direction: column; gap: 6px; }
.msg-img { display: block; max-width: 260px; max-height: 300px; border-radius: 10px; cursor: zoom-in; }
.msg-audio { width: 270px; max-width: 100%; height: 40px; }
.msg-media-label { font-size: 11.5px; opacity: .7; margin-top: 4px; }
.msg-caption { margin-top: 6px; white-space: pre-wrap; }
.msg-media-gone { font-size: 12.5px; font-style: italic; opacity: .7; }

/* Ritmo e tempo */
.ritmo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; margin-bottom: 18px; }
.ritmo-controls .card { margin-bottom: 14px; }
.ritmo-card .ins-card-head { margin-bottom: 8px; }
.ritmo-card .switch { margin-top: 6px; }
.ritmo-row { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.ritmo-row input[type=range] { flex: 1; padding: 0; border: 0; background: none; accent-color: #7c3aed; height: 28px; box-shadow: none; }
.ritmo-val { min-width: 84px; text-align: center; font-weight: 800; font-size: 14px; background: var(--brand-soft); color: var(--brand-text); padding: 5px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.ritmo-speed { display: inline-flex; box-shadow: none; flex-wrap: wrap; }
/* Quebrar objeções */
.obj-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.obj-levels button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; white-space: normal; padding: 12px 14px; border-radius: 14px; background: var(--panel); color: var(--text); border: 2px solid var(--border); box-shadow: none; }
.obj-levels button:hover { border-color: #b69cff; filter: none; }
.obj-levels button.active { border-color: #8b5cf6; background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-glow); }
.obj-levels .ol-ic { font-size: 22px; }
.obj-levels b { font-size: 14px; }
.obj-levels button span:last-child { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.obj-stop { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; }
.obj-tactics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.obj-tactic { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; margin: 0; font-weight: 400; }
.obj-tactic:has(input:checked) { border-color: #8b5cf6; background: var(--brand-soft); }
.obj-tactic input { margin-top: 3px; flex-shrink: 0; width: auto; }
.obj-tactic b { display: block; font-size: 13.5px; }
.obj-tactic span { display: block; font-size: 12px; color: var(--muted); }
.ritmo-chat.obj-chat { height: auto; min-height: 300px; max-height: 640px; }
.ritmo-card.off .obj-tactics { opacity: .4; pointer-events: none; }
.obj-chat .rp-note { align-self: center; font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 2px 10px; margin: 2px 0; }
.ins-moved { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 2px dashed var(--border); border-radius: 16px; color: var(--muted); }
.ins-moved b { color: var(--text); }
@media (max-width: 900px) { .obj-tactics { grid-template-columns: 1fr; } }
/* Confirmação da reunião */
.cf-who { margin-top: 4px; }
.cf-who input { max-width: 320px; }
.cf-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; font-weight: 400; }
.cf-switch-row b { display: block; font-size: 13.5px; }
.cf-switch-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cf-body { transition: opacity .2s; }
.cf-touch.off .cf-body { opacity: .4; pointer-events: none; }
.cf-time { max-width: 140px; }
.cf-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.cf-reset { background: none; color: var(--muted); box-shadow: none; border: none; padding: 5px 4px; }
.cf-reset:hover { color: var(--text); filter: none; text-decoration: underline; }
.cf-reminder .ins-card-head { margin-bottom: 0; }
.ritmo-chat.cf-chat { height: auto; min-height: 300px; max-height: 720px; }
.cf-chat .cf-sep { align-self: center; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; margin: 8px 0 2px; }
.cf-chat .cf-sep.off { text-decoration: line-through; opacity: .6; }
.cf-chat .cf-group.off { display: none; }
.cf-chat .cf-ai { align-self: flex-end; font-size: 10.5px; color: var(--muted); margin-top: -2px; }
.cf-chat .rp-msg { white-space: pre-line; }
.style-sample { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.style-sample .ss-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.style-sample .ss-in, .style-sample .ss-out { max-width: 82%; padding: 7px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; }
.style-sample .ss-in { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); }
.style-sample .ss-out { align-self: flex-end; background: var(--brand-soft, #ede9fe); color: var(--text); }
#rt-typing-box, #rt-recording-box { transition: opacity .2s; }
#rt-typing-box.off, #rt-recording-box.off { opacity: .4; pointer-events: none; }
.ritmo-side { position: sticky; top: 20px; }
.ritmo-preview { margin: 0; padding: 16px; }
.ritmo-phone { background: var(--chat-bg); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.ritmo-phone-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.ritmo-phone-head b { display: block; font-size: 13.5px; }
.ritmo-phone-head span { display: block; font-size: 12px; color: var(--success-text); font-weight: 600; }
.rp-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; }
.ritmo-chat { height: 290px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.rp-msg { max-width: 84%; padding: 7px 11px; border-radius: 12px; font-size: 13px; animation: fade .25s ease; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.rp-msg.in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 4px; }
.rp-msg.out { background: var(--bubble-ai); align-self: flex-end; border-top-right-radius: 4px; }
.rp-audio { display: flex; align-items: center; gap: 8px; width: 210px; }
.rp-play { font-size: 12px; }
.rp-wave { flex: 1; height: 22px; display: flex; align-items: center; gap: 2px; }
.rp-wave i { flex: 1; background: #8b5cf6; opacity: .55; border-radius: 2px; }
.rp-dur { font-size: 11px; color: var(--muted); }
.rp-dots { color: var(--brand-text); font-weight: 700; }
.dots { display: inline-flex; gap: 4px; padding: 3px 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.ritmo-play { width: 100%; margin-top: 12px; }
.ritmo-play.playing { background: var(--panel); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.ritmo-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ritmo-summary > div { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.ritmo-summary span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ritmo-summary b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ritmo-summary .hint { grid-column: 1 / -1; margin: 0; }
.ritmo-timeline { list-style: none; padding: 0; margin: 12px 0 0; font-size: 12.8px; }
.rt-step { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.rt-step:last-child { border-bottom: 0; }
.rt-ic { width: 22px; text-align: center; }
.rt-label { flex: 1; color: var(--muted); }
.rt-msg .rt-label { color: var(--text); font-weight: 700; }
.rt-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.rt-msg .rt-time { color: var(--success-text); }

/* Primeira mensagem (apresentação) */
.pres-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.pres-who { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 0 12px; }
.pres-who label { margin-top: 0; }
label .opt { font-weight: 500; color: var(--muted); }
.pres-mode-pick { margin-top: 14px; }
.pres-phone { background: var(--chat-bg); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.pres-phone-head { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.pres-chat { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pres-bubble { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.pres-bubble.in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 4px; }
.pres-bubble.out { background: var(--bubble-ai); align-self: flex-end; border-top-right-radius: 4px; }
.pres-bubble.ghost { opacity: .75; font-style: italic; }
.pres-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* Texto completo */
.ins-text-help { margin-bottom: 12px; }
.ins-text-help p { margin: 4px 0 0; }
.ins-text-help code { background: var(--brand-soft); color: var(--brand-text); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; font-weight: 700; }
#prompt-text { min-height: 65vh; }

/* Barra de salvar (fica grudada embaixo) */
.ins-savebar { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px 10px 18px; box-shadow: 0 10px 30px rgba(40,20,80,.12); }
.ins-save-state { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; color: var(--success-text); }
.ins-savebar .ins-dirty-only { display: none; }
.ins-savebar.dirty .ins-dirty-only { display: inline-flex; }
.ins-savebar.dirty input.ins-dirty-only { display: block; flex: 1; min-width: 160px; padding: 9px 12px; }
.ins-savebar.dirty .ins-clean-only { display: none; }
.ins-savebar.dirty { border-color: #8b5cf6; box-shadow: 0 0 0 4px var(--brand-glow), 0 10px 30px rgba(40,20,80,.18); }
.ins-savebar.dirty .ins-save-state { flex: 0 0 auto; color: var(--brand-text); }

/* Versões anteriores */
.ins-versions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ins-version { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.ins-version.current { border-color: var(--success); }
.ins-version-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-version-top .muted { margin-left: auto; }
.ins-version-note { font-size: 13px; margin-top: 4px; }
.ins-version .row { margin-top: 10px; }
.ins-version-text { margin: 10px 0 0; max-height: 360px; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; }

@media (max-width: 1250px) {
  .ins-layout { grid-template-columns: 1fr; }
  .ins-side { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  #ins-index-card { display: none; }
  .pres-grid { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 1500px) {
  .ins-views button { padding: 10px 12px; gap: 9px; }
  .ins-views .iv-ic { width: 36px; height: 36px; font-size: 20px; border-radius: 11px; }
  .ins-views b { font-size: 13.5px; }
  .ins-views small { font-size: 11.5px; line-height: 1.3; }
}
@media (max-width: 1320px) {
  .ins-views { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .ins-views { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .ritmo-layout, .media-top { grid-template-columns: 1fr; }
  .obj-levels { grid-template-columns: 1fr; }
  .ritmo-side { position: static; }
}
@media (max-width: 900px) {
  .ins-views, .media-triggers { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .ins-how, .pres-grid { grid-template-columns: 1fr; }
  .ins-add-grid { grid-template-columns: 1fr 1fr; }
  .ins-savebar { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .pres-who { grid-template-columns: 1fr; }
  .pres-who label { margin-top: 12px; }
  .ins-pair { grid-template-columns: minmax(0, 1fr) 34px; }
  .ins-pair > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .ins-pair > :nth-child(3) { grid-column: 1; grid-row: 2; }
  .ins-pair > :nth-child(4) { grid-column: 2; grid-row: 1; }
  .ins-pair-arrow, .ins-pair-head { display: none; }
  .ins-add-grid { grid-template-columns: 1fr; }
}

/* Modal / toast */
.modal { position: fixed; inset: 0; background: rgba(20,8,45,.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.modal-box { background: var(--panel); border-radius: 20px; width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.35); border: 1px solid var(--border); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 14px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 4px 24px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--panel-2); }
.icon-btn { background: none; color: var(--muted); box-shadow: none; padding: 6px 10px; border-radius: 9px; font-size: 15px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); filter: none; }
textarea.auto { resize: none; overflow-y: hidden; min-height: 46px; max-height: 320px; }
.quote { background: var(--field); border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px; white-space: pre-wrap; word-wrap: break-word; max-height: 220px; overflow-y: auto; font-size: 14px; }
.bad-quote { border-left: 3px solid var(--danger); }
.context-box { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--panel-2); }
.context-box summary { font-size: 13px; }
.context-box .quote { margin-top: 10px; font-size: 13px; color: var(--muted); max-height: 180px; }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--border); border-radius: 13px; padding: 12px; cursor: pointer; margin: 0; font-weight: 400; transition: border-color .15s, background .15s; }
.kind:hover { background: var(--panel-2); }
.kind:has(input:checked) { border-color: #8b5cf6; background: var(--brand-soft); }
.kind input { width: auto; margin-top: 3px; accent-color: #7c3aed; }
.kind b { display: block; font-size: 13.5px; }
.kind span { font-size: 12px; color: var(--muted); }
.correction .context { font-size: 12.5px; color: var(--muted); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; }
.correction .guide-text { background: var(--brand-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; }
@media (max-width: 640px) { .kind-pick { grid-template-columns: 1fr; } }
.toast { position: fixed; bottom: 24px; right: 24px; background: #1c1530; color: #fff; padding: 13px 18px; border-radius: 12px; z-index: 20; max-width: 440px; box-shadow: 0 12px 32px rgba(0,0,0,.3); font-weight: 500; animation: fade .2s ease; }
.toast.error { background: var(--danger); }

/* ---------- Responsivo ---------- */
@media (max-width: 1150px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .corr-layout { grid-template-columns: 1fr; }
  .corr-layout > .card { position: static; }
  .steps-strip { grid-template-columns: repeat(2, 1fr); }
}
/* ---------- Celular ---------- */
.m-top, .m-scrim, .m-close, .m-back { display: none; }
@media (max-width: 860px) {
  body { display: block; }
  /* barra de cima + menu em gaveta */
  .m-top {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    height: 56px; padding: 0 12px; color: #fff;
    background: linear-gradient(90deg, #2c0f57, #1d0a3b); box-shadow: 0 4px 16px rgba(20,8,45,.25);
  }
  .m-menu { position: relative; background: rgba(255,255,255,.1); color: #fff; box-shadow: none; width: 40px; height: 40px; padding: 0; border-radius: 12px; display: grid; place-items: center; }
  .m-menu svg { width: 22px; height: 22px; }
  .m-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #2c0f57; }
  .m-title { flex: 1; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-logo { height: 34px; width: 34px; object-fit: cover; object-position: 14% 50%; border-radius: 9px; background: #fff; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 40; width: min(290px, 86vw); height: 100vh; height: 100dvh;
    overflow-y: auto; transform: translateX(-105%); transition: transform .22s ease; padding: 54px 14px 16px;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 12px 0 40px rgba(0,0,0,.35); }
  .m-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(20,8,45,.5); backdrop-filter: blur(2px); }
  body.nav-open .m-scrim { display: block; }
  body.nav-open { overflow: hidden; }
  .m-close { display: block; position: absolute; top: 10px; right: 10px; z-index: 1; color: #fff; background: rgba(0,0,0,.25); }
  nav { overflow: visible; flex: none; }
  nav button { padding: 12px; }
  main { padding: 16px 14px 40px; }

  /* textos, cabeçalhos e campos */
  h1 { font-size: 21px; }
  .page-head { margin-bottom: 16px; gap: 12px; }
  .page-head > * { max-width: 100%; }
  .title-wrap { column-gap: 12px; }
  .page-icon { width: 42px; height: 42px; border-radius: 13px; }
  .page-icon svg { width: 20px; height: 20px; }
  .sub { font-size: 13.5px; }
  .card { padding: 16px; border-radius: 16px; }
  input, select, textarea { font-size: 16px; max-width: 100%; } /* evita o zoom automático do iPhone */
  select { min-width: 0; text-overflow: ellipsis; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .split > *, .grow, .card { min-width: 0; max-width: 100%; }
  .split, .inbox { flex-direction: column; }
  .side, .inbox-list, .side-col { width: 100%; }
  .form-grid, .mode-pick, .stats, .steps-strip, .two-col { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row > input, .row > select { min-width: 0; flex-basis: 180px; }
  .segmented { flex-wrap: wrap; max-width: 100%; }
  .segmented button { padding: 8px 11px; }
  .seg-label { width: 100%; padding: 2px 8px; }
  /* barra "salvar" das instruções: só fica grudada embaixo quando há algo para salvar */
  .ins-savebar { padding: 8px 10px 8px 12px; font-size: 13px; bottom: 8px; }
  .ins-savebar:not(.dirty) { position: static; }
  .ins-savebar button { padding: 9px 12px; font-size: 13px; }
  .tab td select, .tab td input:not([type=checkbox]):not([type=radio]) { min-width: 140px; }
  /* tabelas largas rolam para o lado dentro do cartão */
  .tab table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .tab th, .tab td { white-space: nowrap; }

  /* conversas: lista OU conversa, uma de cada vez */
  .inbox-list { max-height: none; }
  .inbox-list .list { max-height: none; }
  .inbox.chat-open .inbox-list { display: none; }
  .inbox:not(.chat-open) .chat-card { display: none; }
  #tab-conversas:has(.inbox.chat-open) .page-head { display: none; }
  .inbox.chat-open .chat-card { flex: none; height: calc(100vh - 56px - 32px); height: calc(100dvh - 56px - 32px); border-radius: 16px; }
  .chat-card .chat { flex: 1; height: auto; min-height: 0; padding: 12px; }
  .m-back { display: grid; place-items: center; padding: 6px; margin-left: -6px; }
  .m-back svg { width: 22px; height: 22px; }
  .chat-head { padding: 8px 10px; gap: 4px 8px; flex-wrap: wrap; justify-content: flex-end; }
  .chat-head .grow { min-width: 0; flex: 1 1 calc(100% - 90px); }
  .chat-head .grow b, .chat-head .grow .muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head .avatar { width: 36px; height: 36px; }
  .chat-head .icon-btn { padding: 6px; }
  .ai-switch { padding: 5px 10px 5px 6px; font-size: 12px; gap: 8px; }
  .ai-switch span { width: 40px; height: 23px; }
  .ai-switch span::after { width: 17px; height: 17px; }
  .ai-switch input:checked + span::after { left: 20px; }
  .msg { max-width: 86%; }
  .composer { padding: 10px; gap: 8px; }
  .composer textarea { padding: 11px 14px; }
  .handoff-panel { padding: 10px 12px; max-height: 45vh; overflow-y: auto; }
  .hp-draft { flex-direction: column; }
  .lost-bar { flex-wrap: wrap; padding: 8px 12px; gap: 6px 10px; font-size: 13px; }
  .lost-bar .lost-ico { display: none; }
  .lost-bar #lost-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; }

  /* janelas sobem de baixo e ocupam a largura toda */
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { width: 100% !important; max-width: 100% !important; max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .modal-head { padding: 14px 16px 12px; }
  .modal-body { padding: 4px 16px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot button { flex: 1; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }

  /* quadro de leads: colunas deslizam para o lado */
  .ld-board { grid-template-columns: repeat(5, 82vw) !important; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 8px; scroll-padding: 0 14px; }
  .ld-col { scroll-snap-align: start; }
}

/* Horário em que a IA responde (Instruções → Ritmo) */
.rt-hours { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.rt-hours label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.rt-hours input[type=time] { width: auto; min-width: 120px; }
#rt-hours-box.off { opacity: .45; }

/* Controle das reuniões marcadas pela IA (Agenda) */
.ia-mt-card { margin-top: 18px; }
.ia-mt-head { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ia-mt-kpis { grid-template-columns: repeat(5, 1fr); margin: 16px 0 14px; }
.ia-mt-filter { flex-wrap: wrap; width: fit-content; max-width: 100%; margin-bottom: 12px; }
.ia-mt-table-wrap { overflow-x: auto; }
.ia-mt-table td { vertical-align: top; }
.ia-mt-table .nowrap { white-space: nowrap; }
.ia-mt-table .small { font-size: 12.5px; }
.ia-mt-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ia-mt-status { width: auto; min-width: 170px; padding: 6px 10px; font-size: 13px; }
.ia-mt-warn { color: var(--danger); margin-top: 3px; }
.ia-mt-late td { background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
@media (max-width: 1100px) { .ia-mt-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .ia-mt-kpis { grid-template-columns: repeat(2, 1fr); } }

/* Quadro de leads (aba Leads) */
.ld-search { width: 280px; }
.ld-board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.ld-col { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; transition: border-color .15s, background .15s; }
.ld-col.over { border-color: #7c3aed; background: var(--brand-soft); }
.ld-col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-size: 14px; }
.ld-count { font-size: 12px; font-weight: 700; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; color: var(--muted); }
.ld-cards { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 250px); overflow-y: auto; padding-right: 2px; }
.ld-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.ld-card:hover { border-color: #a78bfa; }
.ld-card.dragging { opacity: .45; }
.ld-card.late { border-color: var(--danger); }
.ld-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.ld-card-top b { font-size: 14px; line-height: 1.3; word-break: break-word; }
.ld-card .small, .ld-box .small { font-size: 12px; }
.ld-meet { font-size: 12.5px; font-weight: 600; color: var(--brand-text); }
.ld-meet.late { color: var(--danger); }
.ld-reason { font-style: italic; }
.ld-card-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.ld-chip { font-size: 11px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.ld-ago { margin-left: auto; }
.ld-empty { padding: 14px 6px; text-align: center; }
.ld-feita .ld-col-head b { color: var(--success-text); }
.ld-perdido .ld-col-head b, .ld-faltou .ld-col-head b { color: var(--danger); }
/* ficha do lead */
.ld-box { max-width: 640px; }
.ld-sec { border-top: 1px solid var(--border); padding: 12px 0 4px; margin-top: 10px; }
.ld-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ld-meet-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ld-links { display: flex; flex-direction: column; gap: 6px; }
.ld-link { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.ld-link a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ld-link-kind { font-size: 12px; white-space: nowrap; color: var(--muted); min-width: 110px; }
.ld-add { display: flex; gap: 8px; margin-top: 8px; }
.ld-add input { flex: 1; }
.ld-summary { white-space: pre-wrap; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.55; }
@media (max-width: 1300px) { .ld-board { grid-template-columns: repeat(5, 240px); } }

/* Login: esqueci minha senha */
/* Foto de perfil e Minha conta */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; margin: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; box-shadow: none; }
.me-open:hover { background: none; }
.me-open:hover b { text-decoration: underline; }
.acc-top { display: flex; align-items: center; gap: 18px; margin: 6px 0 6px; }
.acc-photo { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #8b5cf6, #4c1d95); box-shadow: 0 8px 24px -10px rgba(76,29,149,.6); }
.acc-photo img { width: 100%; height: 100%; object-fit: cover; }
.acc-photo-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acc-photo-btns .hint { flex-basis: 100%; }
.acc-row { display: flex; gap: 8px; align-items: center; }
.acc-row input { flex: 1; min-width: 0; }
.acc-meta { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted, #6b7280); margin: 8px 0 14px; }
.acc-wide { width: 100%; }
.team-name { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.team-name .avatar { width: 28px; height: 28px; font-size: 11px; }

/* ID do login, discreto */
.uid { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; font-weight: 600; opacity: .55; margin-right: 6px; letter-spacing: .02em; }
.user-box .grow span.uid { display: inline; margin: 0 0 0 6px; color: inherit; }
.login-forgot { text-align: center; margin: 14px 0 0; font-size: 14px; }
.login-forgot a { color: var(--muted, #6b7280); text-decoration: underline; }


/* Ficha do lead: etapa */
.ld-stage-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; font-weight: 700; font-size: 13px; }
.ld-stage-row select { width: auto; flex: 0 1 260px; }
@media (max-width: 860px) { .ld-stage-row select { flex: 1; } .m-logo { width: auto !important; max-width: 96px; object-fit: contain !important; padding: 2px 6px; } }


/* Atalho para o Fluxo no menu */
nav a.nav-ext { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: #cfc2ec; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
nav a.nav-ext:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-ext-ic { margin-left: auto; opacity: .6; font-size: 13px; }
@media (max-width: 860px) { nav a.nav-ext { padding: 12px; } }

/* Conversas: IA pausada no geral */
#reply-mode .seg-pause.active { background: var(--danger) !important; color: #fff !important; }
#reply-mode.paused { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* Instruções → Assistente */
#tab-instrucoes.as-mode .ins-savebar:not(.dirty) { display: none; }
.ins-views button.iv-ai .iv-ic { background: linear-gradient(135deg, #8b5cf6, #4c1d95); }
.as-box { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.as-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.as-head p { margin: 4px 0 0; }
.as-head button { white-space: nowrap; }
.as-chat { display: flex; flex-direction: column; gap: 10px; min-height: 220px; max-height: calc(100vh - 380px); overflow-y: auto; padding: 12px; background: var(--field); border: 1px solid var(--border); border-radius: 14px; }
.as-empty { margin: auto; text-align: center; color: var(--muted); max-width: 460px; font-size: 13.5px; line-height: 1.6; }
.as-empty .as-ex { display: block; margin: 8px auto 0; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; cursor: pointer; color: var(--text); font-weight: 500; box-shadow: none; width: 100%; white-space: normal; line-height: 1.45; height: auto; }
.as-empty .as-ex:hover { border-color: #a78bfa; filter: none; background: var(--brand-soft); }
.as-msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 14px; }
.as-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.as-msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.as-tool, .as-note { align-self: flex-start; font-size: 12px; color: var(--muted); padding: 0 4px; }
.as-note { font-style: italic; }
.as-typing { align-self: flex-start; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.as-typing::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand-soft-2); border-top-color: var(--brand); animation: as-spin .8s linear infinite; }
@keyframes as-spin { to { transform: rotate(360deg); } }
.as-prop { align-self: stretch; background: var(--panel); border: 2px solid #8b5cf6; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.as-prop.aplicada { border-color: #16a34a; }
.as-prop.descartada, .as-prop.desfeita { border-color: var(--border); opacity: .75; }
.as-prop-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.as-prop-head b { font-size: 14px; }
.as-chg { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 13px; }
.as-chg-title { background: var(--panel-2); padding: 6px 10px; font-weight: 700; font-size: 12.5px; }
.as-chg pre { margin: 0; padding: 7px 10px; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13px; line-height: 1.5; max-height: 260px; overflow: auto; }
.as-chg .del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.as-chg .add { background: rgba(22, 163, 74, .12); color: #15803d; }
:root[data-theme="dark"] .as-chg .add { color: #4ade80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .as-chg .add { color: #4ade80; } }
.as-prop-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.as-form { display: flex; gap: 8px; align-items: flex-end; }
.as-form textarea { flex: 1; min-height: 46px; max-height: 200px; }
.as-foot { margin: 0; }
@media (max-width: 860px) {
  .as-head { flex-direction: column; }
  .as-msg { max-width: 92%; }
  .as-chat { max-height: calc(100vh - 330px); }
}

