/* ViaOn Conecta 0.4.4. Conversa como foco: interface mobile idêntica em hierarquia ao mockup aprovado. */
:root{--user-accent:#fb790f;--user-accent-soft:#fff0e2;--user-accent-border:#ffd7b7;--user-accent-shadow:#ffb883;--chat-header:53px;--chat-city:55px;--chat-nav:48px;--chat-composer:57px;--ptt-sheet-size:clamp(235px,41dvh,336px)}
[hidden]{display:none!important}
button,.attach{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:active,.attach:active{transform:scale(.96) translateY(2px)!important;filter:brightness(.94)!important;box-shadow:inset 0 3px 8px #0003!important}
/* Paleta da pessoa: o padrão permanece ViaOn, os temas só mudam o seu dispositivo. */
body:not(.is-admin) .chat-nav button.active,body:not(.is-admin) #sendTextBtn,body:not(.is-admin) .conversations-tabs button.active,
body:not(.is-admin) .primary,body:not(.is-admin) #ptt,body:not(.is-admin) .root-orange{background:var(--user-accent)!important;border-color:var(--viaon-orange-dark)!important;color:white!important}
body:not(.is-admin) .bubble.me{background:var(--user-accent-soft)!important;border-color:var(--user-accent-border)!important}
body:not(.is-admin) .header-actions .update-app.has-update{background:var(--user-accent)!important}
body:not(.is-admin) #driverCitySelect:focus-visible,body:not(.is-admin) #msg:focus-visible{outline:2px solid var(--user-accent)!important}
body:not(.is-admin) .convo-item.is-selected{background:var(--user-accent-soft)!important}
.header-online{display:none;align-items:center;gap:6px;color:#f2f5f8;font-size:11px;font-weight:750;white-space:nowrap}
.online-dot{display:inline-block;flex:0 0 7px;width:7px;height:7px;border-radius:50%;background:#42cf83;box-shadow:0 0 0 3px #42cf8320}
.palette-overlay{position:fixed;z-index:300;inset:0;background:#06172699;display:grid;place-items:center;padding:14px}
.palette-sheet{background:#fff;color:#1e2b37;width:min(480px,100%);max-height:min(85dvh,740px);overflow:auto;border-radius:24px;box-shadow:0 24px 60px #0005;padding:20px}
.palette-top{display:flex;gap:10px;align-items:start;justify-content:space-between}.palette-top small{color:var(--user-accent);font-weight:900;letter-spacing:1px;font-size:10px}.palette-top h2{margin:5px 0 8px;font-size:23px}.palette-top p{margin:0 0 16px;font-size:12px;color:#64748b;line-height:1.45}
.palette-top>button{background:#eef1f5;border:0;border-radius:13px;min-height:38px;min-width:38px}
.palette-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.palette-choice{display:flex;align-items:center;gap:9px;min-height:46px;border-radius:13px;background:#fff;border:1px solid #e2e7ed;color:#344256;font-size:12px;text-align:left;font-weight:700;padding:6px 10px;box-shadow:0 2px 6px #09182909}
.palette-choice.selected{border:2px solid var(--user-accent);background:var(--user-accent-soft)}
.palette-swatch{display:inline-block;width:24px;height:24px;border-radius:8px;box-shadow:inset 0 1px 2px #fff8,0 1px 5px #15203330;flex:0 0 24px}
.palette-custom{display:flex;align-items:center;gap:8px;margin:17px 0 12px;flex-wrap:wrap}.palette-custom label{font-weight:700;font-size:12px;flex:1 1 100%}.palette-custom input{width:55px;height:39px;padding:0;border:0;background:transparent}.palette-custom button,.palette-modes button,.palette-footer button{min-height:40px;border:1px solid #dde2e9;background:#f5f7fa;border-radius:12px;font-size:12px;font-weight:800;color:#253241;padding:8px 11px}
.palette-modes{display:flex;gap:8px}.palette-modes button{flex:1}.palette-modes button.selected{outline:2px solid var(--user-accent)}
.palette-footer{display:flex;justify-content:space-between;margin-top:18px;gap:9px}.palette-footer button{flex:1}
.attach-toggle{display:none}.radio-backdrop,.ptt-sheet-handle{display:none}
@media(max-width:959px){
 body:not(.is-admin){margin:0;overflow:hidden!important;height:100dvh!important;}
 body:not(.is-admin) .shell{height:100dvh!important;min-height:0!important;max-width:680px!important;margin:0 auto;background:#fff!important;overflow:hidden!important;}
 body:not(.is-admin) .top{position:fixed!important;top:0!important;left:0!important;right:0!important;max-width:680px!important;height:var(--chat-header)!important;min-height:var(--chat-header)!important;padding:7px 14px!important;gap:8px!important;z-index:115!important;background:#121c28!important;box-shadow:0 2px 8px #0b192622!important}
 body:not(.is-admin) .brand{gap:7px!important;flex:1;min-width:0}
 body:not(.is-admin) .brand .mark,body:not(.is-admin) .brand .mark img{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important}
 body:not(.is-admin) .brand b{font-size:17px!important;letter-spacing:-.55px!important;white-space:nowrap}
 body:not(.is-admin) .brand b::after{content:' Conecta';font-size:13px!important;color:#fff;letter-spacing:-.15px;font-weight:650}
 body:not(.is-admin) .brand small{display:none!important}
 body:not(.is-admin) .header-online{display:flex!important;font-size:10px;max-width:116px!important}
 body:not(.is-admin) .header-actions{display:none!important}
 body:not(.is-admin) main:not([hidden]){position:fixed!important;inset:var(--chat-header) 0 0 0;padding:0!important;margin:0 auto!important;max-width:680px!important;min-height:0!important;height:calc(100dvh - var(--chat-header))!important;overflow:hidden!important;display:block!important}
 body:not(.is-admin) .roomline{position:fixed!important;top:var(--chat-header)!important;left:0!important;right:0!important;width:100%!important;max-width:680px!important;min-height:var(--chat-city)!important;height:var(--chat-city)!important;z-index:112!important;margin:0 auto!important;padding:6px 10px!important;display:grid!important;grid-template-columns:minmax(0,1fr) 38px!important;gap:6px!important;border-radius:0 0 15px 15px!important;border:1px solid #edf0f5!important;border-top:0!important;background:#fff!important;box-shadow:0 3px 11px #0d1b2e12!important;align-items:center!important}
 body:not(.is-admin) .roomline>div:first-child>small,body:not(.is-admin) .roomline h1,body:not(.is-admin) .roomline #members,body:not(.is-admin) .roomline #driverCityPicker{display:none!important}
 body:not(.is-admin) .roomline #driverCityPicker:not([hidden]){display:block!important;margin:0!important;min-width:0!important}
 body:not(.is-admin) .roomline #driverCityPicker{font-size:0!important;color:transparent!important}
 body:not(.is-admin) .roomline #driverCitySelect{display:block!important;min-height:40px!important;height:40px!important;width:100%!important;max-width:100%!important;padding:7px 34px 7px 13px!important;border-radius:13px!important;font-size:13px!important;font-weight:800!important;line-height:1.15!important;background:#f8fafc!important;border:1px solid #e5e9f0!important;color:#142236!important;white-space:nowrap!important;text-overflow:ellipsis!important}
 body:not(.is-admin) .room-header-toggle{display:flex!important;flex-direction:row!important;width:38px!important;min-width:38px!important;height:39px!important;min-height:39px!important;border-radius:13px!important;align-items:center!important;justify-content:center!important;font-size:20px!important;padding:0!important;gap:0!important;background:var(--user-accent-soft)!important;border:1px solid var(--user-accent-border)!important;color:var(--viaon-orange-dark)!important}
 body:not(.is-admin) .room-header-toggle span{display:none!important}
 body:not(.is-admin) .roomline .room-tools{position:absolute!important;top:51px!important;right:9px!important;left:auto!important;max-width:min(310px,calc(100vw - 18px))!important;grid-row:auto!important;display:none!important;flex-wrap:wrap!important;gap:6px!important;padding:10px!important;border:1px solid #e2e8ef!important;border-radius:15px!important;background:#fff!important;box-shadow:0 12px 30px #13223433!important;z-index:120!important}
 body:not(.is-admin) .roomline[data-room-expanded="true"] .room-tools{display:flex!important}
 body:not(.is-admin) .roomline .room-tools button{font-size:11px!important;min-height:38px!important}
 /* The conversation is the entire available center area. */
 body:not(.is-admin)[data-conecta-view="chat"] #chatPanel{position:fixed!important;inset:calc(var(--chat-header) + var(--chat-city) + 2px) 0 calc(var(--chat-nav) + var(--chat-composer) + 4px + env(safe-area-inset-bottom)) 0!important;max-width:680px!important;width:100%!important;margin:0 auto!important;min-height:0!important;max-height:none!important;height:auto!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:2px 8px 0!important;background:#fff!important;border:0!important;border-radius:0!important;box-shadow:none!important;gap:0!important}
 body:not(.is-admin)[data-conecta-view="chat"] #chatPanel .mobile-fold-toggle,body:not(.is-admin)[data-conecta-view="chat"] #chatPanel .chathead{display:none!important}
 body:not(.is-admin)[data-conecta-view="chat"] #chatPanel #messages{display:flex!important;flex-direction:column!important;flex:1 1 auto!important;width:100%!important;height:0!important;min-height:0!important;max-height:none!important;overflow:auto!important;overscroll-behavior:contain!important;margin:0!important;padding:10px 10px 14px!important;border:none!important;border-radius:0!important;gap:8px!important;scrollbar-width:thin!important;scroll-padding-bottom:18px!important;background:#fdfbfa url('/fox-face-watermark.png') center 52%/min(52vw,210px) no-repeat!important}
 body:not(.is-admin) .bubble{max-width:85%!important;padding:8px 10px!important;border-radius:16px 16px 16px 5px!important;font-size:12px!important;line-height:1.42!important;box-shadow:0 2px 7px #0e1b3012!important}
 body:not(.is-admin) .bubble.me{border-radius:16px 16px 5px 16px!important}
 body:not(.is-admin)[data-conecta-view="chat"] .chathead{flex:0 0 0!important}
 body:not(.is-admin)[data-conecta-view="chat"] #chatPanel .mediaactions{display:none!important}
 body:not(.is-admin)[data-conecta-view="chat"] #chatPanel .mediaactions[data-open="true"]{display:flex!important;position:fixed!important;left:10px!important;right:10px!important;bottom:calc(var(--chat-nav) + var(--chat-composer) + 8px + env(safe-area-inset-bottom))!important;max-width:660px!important;z-index:96!important;margin:0 auto!important;gap:5px!important;padding:9px!important;border-radius:16px!important;background:#fff!important;border:1px solid #e1e7ef!important;box-shadow:0 -7px 20px #0b233121!important}
 body:not(.is-admin)[data-conecta-view="chat"] #chatPanel .mediaactions .attach{min-height:40px!important;padding:6px 8px!important;font-size:11px!important}
 body:not(.is-admin)[data-conecta-view="chat"] #chatPanel .transcript-option{display:none!important}
 body:not(.is-admin)[data-conecta-view="chat"] #recordingStatus:not([hidden]){display:block!important;position:fixed!important;bottom:calc(var(--chat-composer) + var(--chat-nav) + 5px + env(safe-area-inset-bottom))!important;left:8px!important;right:8px!important;z-index:100!important;background:#fff4eb!important;border:1px solid var(--user-accent-border)!important;border-radius:10px!important;font-size:11px!important;padding:5px!important}
 body:not(.is-admin) #attachToggle{display:flex!important;position:fixed!important;left:8px!important;bottom:calc(var(--chat-nav) + 10px + env(safe-area-inset-bottom))!important;height:39px!important;width:33px!important;min-width:33px!important;z-index:94!important;align-items:center!important;justify-content:center!important;font-size:25px!important;line-height:1!important;padding:0!important;color:var(--viaon-orange-dark)!important;border:1px solid var(--user-accent-border)!important;background:var(--user-accent-soft)!important;border-radius:12px!important;box-shadow:0 2px 6px #13243816!important}
 body:not(.is-admin)[data-conecta-view="chat"] #msgForm{position:fixed!important;left:0!important;right:0!important;bottom:calc(var(--chat-nav) + env(safe-area-inset-bottom))!important;max-width:680px!important;width:100%!important;height:var(--chat-composer)!important;min-height:var(--chat-composer)!important;display:flex!important;align-items:center!important;gap:6px!important;padding:6px 9px 6px 45px!important;margin:0 auto!important;z-index:90!important;background:#fff!important;border:1px solid #eaedf1!important;border-radius:13px 13px 0 0!important;box-shadow:0 -3px 14px #14223412!important}
 body:not(.is-admin)[data-conecta-view="chat"] #msgForm input{flex:1 1 0!important;height:40px!important;min-width:0!important;font-size:12px!important;padding:7px 11px!important;border-radius:12px!important;background:#f9fafc!important}
 body:not(.is-admin)[data-conecta-view="chat"] #msgForm button{flex:0 0 37px!important;width:37px!important;height:39px!important;min-height:39px!important;padding:0!important;border-radius:12px!important;box-shadow:0 2px 7px #0f1e2c1a!important;font-size:18px!important;display:grid!important;place-items:center!important}
 body:not(.is-admin)[data-conecta-view="chat"] #msgForm #quickPtt{background:var(--user-accent-soft)!important;color:var(--viaon-orange-dark)!important;border:1px solid var(--user-accent-border)!important}
 body:not(.is-admin)[data-conecta-view="chat"] #chatDeliveryStatus:not([hidden]){position:fixed!important;z-index:95!important;bottom:calc(var(--chat-nav) + var(--chat-composer) + 6px + env(safe-area-inset-bottom))!important;left:8px!important;right:8px!important;max-width:660px!important;margin:0 auto!important}
 body:not(.is-admin) .chat-nav{position:fixed!important;bottom:env(safe-area-inset-bottom)!important;left:0!important;right:0!important;width:100%!important;max-width:680px!important;height:var(--chat-nav)!important;min-height:var(--chat-nav)!important;margin:0 auto!important;z-index:110!important;padding:3px 8px!important;gap:4px!important;display:grid!important;grid-template-columns:1fr 1fr 1fr!important;background:#fff!important;border-top:1px solid #edf0f2!important;box-shadow:0 -2px 8px #1a263512!important}
 body:not(.is-admin) .chat-nav button{min-height:40px!important;height:40px!important;border:0!important;background:#fff!important;color:#344154!important;font-size:11px!important;font-weight:780!important;box-shadow:none!important;border-radius:11px!important;padding:4px!important}
 body:not(.is-admin) .chat-nav button.active{background:#fff!important;color:var(--viaon-orange-dark)!important;box-shadow:inset 0 -3px var(--user-accent)!important;border-radius:8px!important}
 body:not(.is-admin) .chat-nav #alertsTab{display:none!important}
 body:not(.is-admin) .chat-nav #filesTab{display:flex!important}
 body:not(.is-admin)[data-conecta-view="radio"] #radioPanel{display:none!important}
 body:not(.is-admin) .radio-backdrop:not([hidden]){display:block!important;position:fixed!important;inset:calc(var(--chat-header) + var(--chat-city)) 0 calc(var(--chat-nav) + var(--chat-composer) + env(safe-area-inset-bottom)) 0!important;z-index:94!important;background:#17223212!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel{position:fixed!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;left:0!important;right:0!important;bottom:calc(var(--chat-nav) + var(--chat-composer) + env(safe-area-inset-bottom))!important;top:auto!important;width:100%!important;max-width:680px!important;height:var(--ptt-sheet-size)!important;min-height:0!important;max-height:75dvh!important;margin:0 auto!important;padding:7px 14px 12px!important;gap:6px!important;border:1px solid #e8ebf1!important;border-radius:24px 24px 0 0!important;box-shadow:0 -8px 30px #12233620!important;background:#fff!important;overflow:auto!important;z-index:100!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .ptt-sheet-handle{display:block!important;flex:0 0 4px!important;width:37px!important;height:4px!important;border-radius:4px!important;background:#a7afb9!important;margin:1px auto 5px!important;touch-action:pan-y}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .mobile-fold-toggle,body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .hint{display:none!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .radiohead{order:1!important;align-self:stretch!important;flex:0 0 auto!important;justify-content:center!important;text-align:center!important;max-height:26px!important;margin:0!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .radiohead strong{font-size:14px!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .radiohead small{display:none!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .radio-return-chat{display:block!important;position:absolute!important;top:8px!important;right:10px!important;left:auto!important;margin:0!important;padding:4px 6px!important;font-size:10px!important;min-height:30px!important;background:#f4f6fa!important;color:#314257!important;border-radius:10px!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel #ptt{order:2!important;position:static!important;align-self:center!important;margin:auto auto 0!important;min-height:0!important;min-width:0!important;flex:0 0 auto!important;width:clamp(110px,17dvh,154px)!important;height:clamp(110px,17dvh,154px)!important;max-width:170px!important;border-radius:50%!important;transform:none!important;inset:auto!important;box-shadow:0 0 0 6px var(--user-accent-soft),0 8px 20px #f878243a!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel #ptt span{font-size:30px!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel #ptt b{font-size:12px!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .ptt-volume-label{order:3!important;flex:0 0 auto!important;display:flex!important;width:100%!important;margin:0!important;max-width:300px!important;font-size:10px!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .ptt-volume-label input{accent-color:var(--user-accent)!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .consent{order:4!important;width:100%!important;max-width:340px!important;flex:0 0 auto!important;padding:7px 8px!important;font-size:10px!important;margin:0!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel .consent small{display:none!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #chatPanel{bottom:calc(var(--chat-nav) + var(--chat-composer) + var(--ptt-sheet-size) + 4px + env(safe-area-inset-bottom))!important}
 body:not(.is-admin)[data-ptt-sheet="open"] #radioTab{background:var(--user-accent-soft)!important;color:var(--viaon-orange-dark)!important;box-shadow:inset 0 -3px var(--user-accent)!important}
 body:not(.is-admin) #conversationsPanel,body:not(.is-admin) #morePanel{position:fixed!important;top:calc(var(--chat-header) + var(--chat-city) + 2px)!important;bottom:calc(var(--chat-nav) + env(safe-area-inset-bottom))!important;left:0!important;right:0!important;max-width:680px!important;margin:0 auto!important;min-height:0!important;max-height:none!important;height:auto!important;overflow:auto!important;border-radius:0!important;border:0!important;box-shadow:none!important;z-index:30!important}
 body:not(.is-admin) #morePanel{background:white!important}
 body:not(.is-admin) #morePanel .more-hero{padding:12px 14px!important}
 body:not(.is-admin) .palette-sheet{max-height:85dvh}
 body:not(.is-admin)[data-conecta-view="alerts"] #sosPanel{position:fixed!important;top:calc(var(--chat-header) + var(--chat-city) + 8px)!important;left:10px!important;right:10px!important;bottom:calc(var(--chat-nav) + 12px)!important;width:auto!important;min-height:0!important;margin:0 auto!important;max-width:640px!important;display:grid!important;align-content:start!important;gap:12px!important;border-radius:18px!important;background:white!important;z-index:40!important}
 body:not(.is-admin)[data-conecta-view="alerts"] #sosPanel .mobile-fold-toggle{display:none!important}
 body:not(.is-admin) #notificationSettings:not([hidden]),body:not(.is-admin) #bulletinInbox:not([hidden]){position:fixed!important;z-index:45!important;top:calc(var(--chat-header) + var(--chat-city) + 6px)!important;bottom:calc(var(--chat-nav) + 5px)!important;left:6px!important;right:6px!important;max-width:666px!important;margin:0 auto!important;overflow:auto!important;background:#fff!important;border-radius:16px!important}
}
@media(max-width:380px){
 body:not(.is-admin) .brand b{font-size:15px!important}
 body:not(.is-admin) .brand b::after{font-size:12px!important}
 body:not(.is-admin) .header-online{font-size:9px!important}
 body:not(.is-admin) #msgForm input{font-size:11px!important}
 body:not(.is-admin) #radioPanel #ptt{width:clamp(103px,16dvh,145px)!important;height:clamp(103px,16dvh,145px)!important}
}
@media(prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}
/* Login e instalação continuam acessíveis antes da autenticação. */
@media(max-width:959px){
 body:not(.is-admin):has(#main[hidden]){height:auto!important;min-height:100dvh!important;overflow-y:auto!important}
 body:not(.is-admin):has(#main[hidden]) .shell{height:auto!important;min-height:100dvh!important;overflow:visible!important}
 body:not(.is-admin):has(#main[hidden]) .top{position:static!important;width:100%!important;height:auto!important;min-height:58px!important}
 body:not(.is-admin):has(#main[hidden]) .header-online{display:none!important}
 body:not(.is-admin):has(#main[hidden]) .header-actions{display:flex!important}
 body:not(.is-admin):has(#main[hidden]) #login{margin:14px auto!important;padding:20px 15px!important}
}
/* Temas escuros: manter contraste do texto, mensagens e composição. */
@media(max-width:959px){
 html[data-theme="dark"] body:not(.is-admin) .shell,html[data-theme="dark"] body:not(.is-admin)[data-conecta-view="chat"] #chatPanel{background:#141b24!important}
 html[data-theme="dark"] body:not(.is-admin) .roomline,html[data-theme="dark"] body:not(.is-admin) #msgForm,html[data-theme="dark"] body:not(.is-admin) .chat-nav,html[data-theme="dark"] body:not(.is-admin) #morePanel{background:#1a2430!important;border-color:#303e50!important}
 html[data-theme="dark"] body:not(.is-admin) .roomline #driverCitySelect,html[data-theme="dark"] body:not(.is-admin) #msgForm input{background:#233143!important;color:#f3f6fa!important;border-color:#3b4a5c!important}
 html[data-theme="dark"] body:not(.is-admin)[data-conecta-view="chat"] #messages{background:#151e2a url('/fox-face-watermark.png') center 52%/min(52vw,210px) no-repeat!important}
 html[data-theme="dark"] body:not(.is-admin) .bubble:not(.me){background:#2a3748!important;border-color:#3c4958!important;color:#f2f5fb!important}
 html[data-theme="dark"] body:not(.is-admin) .bubble.me{background:#3a2d24!important;border-color:#6b5035!important;color:#f8f3ed!important}
 html[data-theme="dark"] body:not(.is-admin) .chat-nav button{background:#1a2430!important;color:#e8eef5!important}
 html[data-theme="dark"] body:not(.is-admin) .chat-nav button.active{background:#1a2430!important;color:var(--user-accent)!important}
 html[data-theme="dark"] body:not(.is-admin)[data-ptt-sheet="open"] #radioPanel,html[data-theme="dark"] .palette-sheet{background:#202b39!important;color:#f2f5f9!important;border-color:#3c4b5d!important}
 html[data-theme="dark"] .palette-top p{color:#a9bacb!important}
 html[data-theme="dark"] .palette-choice,html[data-theme="dark"] .palette-custom button,html[data-theme="dark"] .palette-footer button,html[data-theme="dark"] .palette-modes button{background:#263346!important;color:#f2f5fb!important;border-color:#465769!important}
 html[data-theme="dark"] .palette-choice.selected{border-color:var(--user-accent)!important;background:#3a3438!important}
}
