/* SingleAgentIntakeView — the in-app "agente único" intake. Light theme, fits the app shell. */
.sai-view { max-width: 860px; margin: 0 auto; padding: 62px 16px 160px; }
/* Header — fixed blue bar (back · centered BO-type title · logo), matching the classic editor. */
.sai-top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; height: 50px; padding: 0 12px; background: #2563EB; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); box-sizing: border-box; }
.sai-top .sai-back { justify-self: start; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: transparent; border: 0; border-radius: 8px; color: #fff; cursor: pointer; }
.sai-top .sai-back:hover { background: rgba(255, 255, 255, .15); }
.sai-top .sai-title { justify-self: center; font-size: 16px; font-weight: 600; color: #fff; text-align: center; }
.sai-top .sai-logo { justify-self: end; height: 30px; width: auto; filter: brightness(0) invert(1); }

.sai-chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sai-b { padding: 10px 13px; border-radius: 10px; max-width: 90%; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; scroll-margin-top: 62px; }
.sai-b--ai { background: #f3f4f6; border: 1px solid #e5e7eb; align-self: flex-start; }
.sai-b--you { background: #2563EB; border: 1px solid #2563EB; color: #fff; align-self: flex-end; }
.sai-b--sys { background: transparent; color: #6b7280; font-size: 13px; align-self: center; text-align: center; }
.sai-b--report { background: #fbfbfd; border: 1px solid #e5e7eb; align-self: stretch; max-width: 100%; font-size: 14px; }
.sai-b--warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; align-self: stretch; max-width: 100%; font-size: 13px; }
.sai-ts { color: #9ca3af; font-size: 11px; margin: -4px 0 2px; }
.sai-b--you + .sai-ts { text-align: right; }
.sai-thought { color: #9ca3af; font-size: 12px; font-style: italic; margin: -2px 0 2px; }

.sai-offline { background: #f1f5f9; border: 1px solid #cbd5e1; color: #334155; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.sai-degraded { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.sai-degraded-x { margin-left: auto; background: transparent; border: 0; color: #9a3412; cursor: pointer; font-size: 14px; padding: 0 4px; }
/* The `hidden` attribute MUST hide these bars: `.sai-degraded { display: flex }` is a class rule that
   otherwise wins over the UA `[hidden]` (equal specificity → author origin wins), so toggling
   `hidden=true` (the ✕ dismiss AND the auto-hide on a healthy turn) wouldn't hide it. Same reset the
   production smart-intake.css applies to its own bars. */
.sai-offline[hidden], .sai-degraded[hidden] { display: none; }
.sai-typing { color: #6b7280; font-size: 13px; padding: 4px 0; }
/* Composer — fixed at the page bottom, classic-editor look (green send, counter on the right). */
.sai-composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid #e5e7eb; box-shadow: 0 -2px 10px rgba(0, 0, 0, .05); padding: 10px 16px; box-sizing: border-box; }
.sai-composer[hidden] { display: none; }
.sai-composer-inner { max-width: 860px; margin: 0 auto; }
.sai-composer textarea { width: 100%; min-height: 48px; max-height: 322px; background: #fff; color: #111; border: 2px solid #e5e7eb; border-radius: 12px; padding: 12px; font: inherit; font-size: 15px; line-height: 1.5; resize: none; overflow-y: hidden; box-sizing: border-box; }
.sai-composer textarea:focus { outline: none; border-color: #2563EB; }
.sai-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.sai-row .sai-send { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; border: 0; border-radius: 10px; padding: 10px 22px; font-weight: 600; cursor: pointer; font: inherit; }
.sai-row .sai-send:disabled { opacity: .5; cursor: default; }
.sai-row .sai-export { background: transparent; color: #333; border: 1px solid #d3d7de; border-radius: 8px; padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 500; }
.sai-row .sai-export:hover { background: #f3f4f6; }
.sai-grow { flex: 1; }
.sai-hint { color: #9ca3af; font-size: 12px; }
.sai-counter { color: #9ca3af; font-size: 12px; }
.sai-counter--warn { color: #b45309; }
.sai-counter--max { color: #b91c1c; font-weight: 600; }

.sai-review { align-self: stretch; max-width: 100%; background: #fbfbfd; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin-top: 4px; }
.sai-review__disc { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.sai-review__h { font-weight: 600; font-size: 13px; color: #374151; margin: 10px 0 4px; }
.sai-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #374151; padding: 4px 0; cursor: pointer; }
.sai-chk input { margin-top: 3px; flex: none; }
.sai-chk--sign { margin-top: 10px; font-weight: 600; }
.sai-review__row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.sai-copy { background: #e2a300; color: #1a1305; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; font: inherit; }
.sai-copy:disabled { opacity: .5; cursor: default; }
.sai-copy--ok { background: #16a34a; color: #fff; }
.sai-gatenote { color: #6b7280; font-size: 12px; }

/* Per-advisory clarification ("Esclarecer este ponto" → inline box → re-generate). */
.sai-review__hint { color: #6b7280; font-size: 12px; margin: 2px 0 6px; line-height: 1.45; }
.sai-adv { padding: 2px 0 4px; }
.sai-clarify-toggle { background: transparent; border: 1px solid #d3d7de; border-radius: 8px; padding: 4px 10px; margin: 2px 0 0 26px; cursor: pointer; font: inherit; font-size: 12px; color: #374151; }
.sai-clarify-toggle:hover { background: #f3f4f6; }
.sai-clarify { margin: 6px 0 4px 26px; }
.sai-clarify-input { width: 100%; background: #fff; color: #111; border: 1px solid #d3d7de; border-radius: 8px; padding: 8px; font: inherit; font-size: 13px; resize: vertical; box-sizing: border-box; }
.sai-clarify-row { display: flex; gap: 8px; margin-top: 6px; }
.sai-clarify-send { background: #e2a300; color: #1a1305; border: 0; border-radius: 8px; padding: 7px 14px; font-weight: 600; cursor: pointer; font: inherit; font-size: 13px; }
.sai-clarify-send:disabled { opacity: .5; cursor: default; }
.sai-clarify-cancel { background: transparent; color: #6b7280; border: 1px solid #d3d7de; border-radius: 8px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.sai-clarify-cancel:hover { background: #f3f4f6; }
.sai-clarify-toggle--saved { border-color: #16a34a; color: #15803d; background: #f0fdf4; }
.sai-clarify-saved { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 6px 26px; padding: 6px 10px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; font-size: 13px; color: #14532d; }
.sai-clarify-saved__t { flex: 1; white-space: pre-wrap; }
.sai-clarify-remove { background: transparent; border: 0; color: #6b7280; cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; padding: 0; }
.sai-clarify-remove:hover { color: #b91c1c; }
.sai-apply-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; padding-top: 10px; border-top: 1px dashed #e5e7eb; }
.sai-clarify-apply { background: #2563eb; color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; font: inherit; }
.sai-clarify-apply:hover { background: #1d4ed8; }
.sai-clarify-apply:disabled { opacity: .5; cursor: default; }
.sai-apply-note { color: #6b7280; font-size: 12px; flex: 1; min-width: 180px; }

@media (prefers-reduced-motion: no-preference) {
    .sai-b { animation: sai-rise .15s ease-out; }
}
@keyframes sai-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
