/* Master Control V12 — Master AI. Isolated CSS, GPU-friendly transforms. */
#master-ai-root { --mai-red:#ff243c; --mai-red2:#be061e; --mai-bg:#08090b; --mai-border:#74222c; position:fixed; z-index:2147482000; bottom:22px; right:24px; font-family:Inter,Arial,Helvetica,sans-serif; color:#fff; font-size:14px; line-height:1.45; }
#master-ai-root *, #master-ai-root *::before, #master-ai-root *::after { box-sizing:border-box; }
#master-ai-root [hidden] { display:none!important; }
#master-ai-root button { font:inherit; cursor:pointer; }
#master-ai-root .mai-orb { width:66px; height:66px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin-left:auto; position:relative; border:1px solid #ff3a50; background:radial-gradient(circle at 40% 30%,#b71b2c 0%,#4a0710 33%,#0a090a 72%); color:#fff; box-shadow:0 0 18px #d30b2940, inset 0 0 18px #d50a2a55; transition:transform .2s ease, box-shadow .2s ease; isolation:isolate; }
#master-ai-root .mai-orb:hover { transform:scale(1.055); box-shadow:0 0 28px #ee0d3980, inset 0 0 16px #ef233c77; }
#master-ai-root .mai-orb::before { content:""; position:absolute; inset:-5px; border-radius:50%; border:2px solid transparent; border-top-color:#ff2942; border-right-color:#cf142c; animation:mai-rotate 6s linear infinite; pointer-events:none; }
#master-ai-root .mai-orb::after { content:""; position:absolute; inset:8px; border-radius:50%; border:1px solid #ff566c88; box-shadow:inset 0 0 16px #e7092770; pointer-events:none; }
#master-ai-root .mai-orb svg { width:33px; height:33px; z-index:1; filter:drop-shadow(0 0 4px #ff1937); }
#master-ai-root .mai-orb.mai-listening::before { animation-duration:1.6s; }
#master-ai-root .mai-orb.mai-listening { box-shadow:0 0 0 7px #f2213828,0 0 32px #f70c3288; }
#master-ai-root .mai-orb.mai-thinking::before { animation-duration:1.1s; }
@keyframes mai-rotate { to { transform:rotate(360deg); } }
#master-ai-root .mai-panel { position:absolute; right:0; bottom:83px; width:min(405px,calc(100vw - 24px)); height:min(640px,calc(100dvh - 114px)); min-height:300px; display:flex; flex-direction:column; overflow:hidden; background:#090a0df8; border:1px solid #932532; border-radius:20px; box-shadow:0 18px 70px #000e,0 0 30px #a40c203b; backdrop-filter:blur(12px); }
#master-ai-root .mai-panel::before { content:""; position:absolute; top:0; left:20px; width:60%; height:2px; background:linear-gradient(90deg,transparent,#ff2b42,transparent); pointer-events:none; animation:mai-trace 5s ease-in-out infinite alternate; }
@keyframes mai-trace { to { transform:translateX(35%); opacity:.5; } }
#master-ai-root .mai-head { flex:0 0 auto; display:flex; align-items:center; gap:10px; padding:14px 15px; background:linear-gradient(135deg,#1b090d,#0b0c0e); border-bottom:1px solid #46202a; }
#master-ai-root .mai-mark { width:38px; height:38px; flex:0 0 38px; border-radius:12px; display:grid; place-items:center; font-size:13px; font-weight:900; letter-spacing:-.5px; background:#1f070b; color:#ff3850; border:1px solid #ba2337; }
#master-ai-root .mai-title { flex:1; min-width:0; }
#master-ai-root .mai-title strong { font-size:15px; letter-spacing:.6px; display:block; }
#master-ai-root .mai-title strong span { color:#ff354d; }
#master-ai-root .mai-status { display:block; color:#aaa3a7; font-size:11px; margin-top:1px; }
#master-ai-root .mai-icon-button { width:34px; height:34px; flex:0 0 34px; border-radius:11px; display:grid; place-items:center; background:#211217; color:#eee; border:1px solid #4e2830; }
#master-ai-root .mai-icon-button:hover { border-color:#ff2d45; }
#master-ai-root .mai-icon-button[aria-pressed="true"] { background:#6e1020; border-color:#ff3049; }
#master-ai-root .mai-icon-button svg { width:18px; height:18px; }
#master-ai-root .mai-hint { padding:8px 14px; color:#c7aeb4; font-size:11px; background:#190e12; border-bottom:1px solid #422028; }
#master-ai-root .mai-log { flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; gap:11px; padding:16px 14px; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#69202d transparent; }
#master-ai-root .mai-bubble { max-width:90%; border-radius:15px; padding:10px 12px; overflow-wrap:anywhere; white-space:pre-wrap; line-height:1.48; }
#master-ai-root .mai-bubble.user { align-self:flex-end; background:#54111d; border:1px solid #a62539; color:#fff; border-bottom-right-radius:5px; }
#master-ai-root .mai-bubble.assistant { align-self:flex-start; background:#1b1d20; border:1px solid #373039; color:#f2f0f0; border-bottom-left-radius:5px; }
#master-ai-root .mai-bubble.system { align-self:center; max-width:100%; text-align:center; font-size:12px; color:#aaa; background:#141418; border:1px solid #34272b; }
#master-ai-root .mai-approval { margin:0 14px 10px; border:1px solid #b62b3d; border-radius:14px; padding:12px; background:#1e0c12; }
#master-ai-root .mai-approval strong { display:block; color:#ff596b; margin-bottom:4px; }
#master-ai-root .mai-approval p { font-size:12px; margin:4px 0 11px; color:#ddd; }
#master-ai-root .mai-approval-actions { display:flex; gap:8px; }
#master-ai-root .mai-approval-actions button { flex:1; border-radius:9px; padding:9px 10px; border:1px solid #65323a; color:#fff; background:#262126; }
#master-ai-root .mai-approval-actions button.mai-confirm { background:#aa1027; border-color:#ff3047; font-weight:bold; }
#master-ai-root .mai-footer { padding:10px; border-top:1px solid #43202a; background:#0d0e10; }
#master-ai-root .mai-controls { display:flex; gap:7px; align-items:flex-end; }
#master-ai-root .mai-input { flex:1; min-width:0; min-height:43px; max-height:112px; resize:vertical; padding:10px 11px; border-radius:12px; border:1px solid #503038; background:#17191b; color:#fff; outline:none; font:inherit; font-size:13px; }
#master-ai-root .mai-input:focus { border-color:#ed2940; box-shadow:0 0 0 2px #e91e3630; }
#master-ai-root .mai-send { height:43px; width:43px; border-radius:12px; border:1px solid #e12b42; background:#b81028; color:#fff; font-size:21px; font-weight:bold; }
#master-ai-root .mai-send:disabled { opacity:.45; cursor:not-allowed; }
#master-ai-root .mai-footnote { margin:7px 3px 0; font-size:10px; color:#8e8b91; }
#master-ai-root .mai-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:600px){ #master-ai-root { right:12px; bottom:14px; } #master-ai-root .mai-orb { width:58px; height:58px; } #master-ai-root .mai-panel { bottom:74px; width:calc(100vw - 24px); height:min(640px,calc(100dvh - 96px)); } }
@media(prefers-reduced-motion:reduce){ #master-ai-root *, #master-ai-root *::before, #master-ai-root *::after { animation:none!important; transition:none!important; } }

#master-ai-root .mai-health { display:inline; padding:0; border:0; background:none; color:#ff5a70; font-size:10px; font-weight:600; text-decoration:underline; text-underline-offset:2px; }
#master-ai-root .mai-health:hover { color:#fff; }

/* V12.2: seleção de voz masculina, mantendo layout compacto. */
#master-ai-root .mai-voice-settings { display:flex; align-items:center; gap:7px; padding:7px 12px; border-bottom:1px solid #422028; background:#130c10; }
#master-ai-root .mai-voice-settings label { color:#f7a8b2; font-size:11px; font-weight:700; white-space:nowrap; }
#master-ai-root .mai-voice-settings select { flex:1; min-width:0; max-width:100%; border:1px solid #60303a; border-radius:7px; padding:6px 7px; background:#171519; color:#f4f4f4; font-size:11px; }
#master-ai-root .mai-voice-settings button { border:1px solid #a42c3e; background:#3b111a; border-radius:7px; padding:6px 8px; color:#fff; font-size:11px; }
#master-ai-root .mai-voice-settings button:hover { background:#6c1728; }
