/* ViaOn Conecta v0.3.3: revisão visual aprovada, sem alteração dos contratos da API. */
:root{--orange:#f57518;--ink:#21242a;--sub:#606872;--bg:#f7f8fa;--pane:#fff;--stroke:#e5e8ed;--bubble:#fff;--bubble-own:#fff1e6;font-size:14px}
html{scroll-behavior:smooth} body{font-size:14px;background:#edf0f3} .shell{background:var(--bg);box-shadow:0 4px 30px #29334412}
.top{height:74px;padding:12px 22px;background:var(--pane);border-bottom:1px solid var(--stroke);box-shadow:none}
.brand{gap:9px}.brand b{font-size:24px;font-weight:900;line-height:1.05}.brand small{font-size:10px;letter-spacing:.7px;margin-top:5px;color:var(--sub)}
.mark{width:44px;height:44px;background:#fff0e5;border-radius:12px;overflow:hidden;display:grid;place-items:center}.mark img{width:32px;height:32px;opacity:1;filter:drop-shadow(0 0 0 #f57518)}
.status{font-size:12px;font-weight:650}.roomline{margin:17px 0 10px;gap:12px}.roomline small{font-size:10px;letter-spacing:1px}.roomline h1{font-size:24px;line-height:1.15;margin:5px 0}.roomline span{font-size:12px}.room-tools button{font-size:12px;min-width:43px;min-height:40px}
.chat-nav button{font-size:12px;font-weight:750;min-height:44px;border-radius:12px}.chat-nav button.active{background:var(--orange);color:#fff;border-color:var(--orange)}
.panel{border-color:var(--stroke);border-radius:17px;box-shadow:0 4px 14px #15202d0b}
.chat{padding:0;overflow:hidden;min-height:0}.chathead{padding:15px 17px 11px;border-bottom:1px solid var(--stroke)}.chathead strong{font-size:16px;letter-spacing:-.2px}.chathead small{font-size:11px;margin-top:4px;color:var(--sub)}
.messages{position:relative;flex:1;min-height:380px;padding:18px 17px;gap:11px;border-radius:0;margin:0;background-color:#fcfbf9;background-image:url('/fox.svg');background-position:center 53%;background-size:235px;background-repeat:no-repeat;overflow-y:auto;overscroll-behavior:contain}
.bubble{font-size:14px;line-height:1.48;padding:10px 13px;border-radius:14px;max-width:min(82%,550px);box-shadow:0 2px 7px #1111}.bubble small{font-size:11px}.bubble .time{font-size:10px}.bubble .media-audio{width:min(100%,330px)}.transcript p{font-size:12px}
.mediaactions{padding:9px 13px 2px;margin:0;justify-content:flex-start;gap:8px;background:var(--pane)}.attach{flex:0 1 auto;padding:9px 15px;border-radius:10px;font-size:12px;min-height:37px}.attach span{font-size:16px}
.transcript-option{margin:5px 13px!important;padding:7px 10px;font-size:11px}.transcript-option small{font-size:10px}
.send{padding:9px 12px 14px;background:var(--pane)}.send input{height:45px;font-size:14px;background:#f7f8fa;padding:10px 15px;border-radius:14px}.send button{width:48px;min-width:48px;background:var(--orange);font-size:19px;border-radius:13px}
.radio{border:1px solid var(--stroke);background:var(--pane);text-align:center}.radiohead{width:100%}.radiohead strong{font-size:15px}.radiohead small{font-size:11px;color:var(--sub)}.radio .hint{font-size:11px;line-height:1.45;color:var(--sub)}.radio .consent{font-size:11px;line-height:1.35}.radio .consent small{font-size:10px}.ptt{width:72px;height:72px;border:4px solid #fff;background:var(--orange);box-shadow:0 0 0 2px #ffd4b2,0 5px 13px #1112}.ptt span{font-size:25px}.ptt b{font-size:10px;margin:2px 0 0}.actions button{font-size:12px;min-height:44px}.people{font-size:12px}.person{font-size:12px}.fine{font-size:11px!important}
.install-app{font-size:12px;padding:9px 12px}.login{font-size:14px}.login label,.auth-form label{font-size:12px}.auth-form input,.auth-form select{font-size:14px}.login .primary{font-size:14px}
/* Admin dashboard: dark sidebar and large white cards, as per approved mockup. */
.is-admin .shell{max-width:1720px}.is-admin .root-panel{border:0;border-radius:15px;box-shadow:0 8px 32px #141b261c;overflow:hidden}.is-admin .root-sidebar{background:#11151b;min-height:calc(100dvh - 160px)}.root-sidebar-brand{font-size:29px}.root-sidebar nav a{font-size:13px;line-height:1.25;padding:12px}.root-sidebar nav a:hover{background:var(--orange)}.is-admin .root-dashboard{background:#f7f8fa}.root-head h2{font-size:27px}.root-head p{font-size:12px}.root-head small{font-size:10px}.root-shield{font-size:12px}.root-kpis>div{box-shadow:0 2px 12px #1111}.root-kpis strong{font-size:29px}.root-kpis small{font-size:12px}.root-section{padding:18px;border-radius:14px;box-shadow:0 2px 12px #1111}.root-section summary{font-size:16px}.root-row{padding:11px 10px;gap:9px}.root-row span{font-size:12px}.root-row-actions button,.root-panel button{font-size:12px;padding:9px 11px}.root-panel input,.root-panel textarea,.root-panel select{font-size:13px}.root-label{font-size:12px}.permission-line{font-size:12px}.root-panel .fine{font-size:11px!important}
:root[data-theme="dark"]{--ink:#edf0f2;--sub:#adb6c2;--bg:#101317;--pane:#1c2026;--stroke:#323942;--bubble:#262b32;--bubble-own:#3a2a21}
[data-theme="dark"] .shell{background:var(--bg)}[data-theme="dark"] .messages{background-color:#15191e}[data-theme="dark"] .chathead,[data-theme="dark"] .mediaactions,[data-theme="dark"] .send{background:var(--pane)}[data-theme="dark"] .send input{background:#292e35;color:#f8fafc}[data-theme="dark"] .mark{background:#37271c}[data-theme="dark"] .root-dashboard{background:#15191e}
@media(min-width:960px){
 body:not(.is-admin) .shell{max-width:1480px;width:100%;min-height:100dvh}
 body:not(.is-admin) main{display:grid;grid-template-columns:minmax(0,1fr) 292px;gap:12px 16px;padding:0 24px 16px;align-content:start}
 body:not(.is-admin) .roomline{grid-column:1/-1;margin:17px 0 8px}
 body:not(.is-admin) .chat-nav{grid-column:1/-1;margin:0 0 3px;display:flex;gap:8px}
 body:not(.is-admin) .chat-nav button{padding:11px 18px}
 body:not(.is-admin) .chat{grid-column:1;grid-row:3/span 4;margin:0;height:max(610px,calc(100dvh - 220px));max-height:1020px;padding:0;display:flex;flex-direction:column}
 body:not(.is-admin) .messages{flex:1;max-height:none;min-height:300px;background-size:250px}
 body:not(.is-admin) .radio{grid-column:2;grid-row:3;margin:0;padding:16px 17px;display:flex;align-items:center;flex-direction:column;gap:8px}
 body:not(.is-admin) .ptt{width:74px;height:74px;margin:7px auto}
 body:not(.is-admin) .radio .hint{margin:0}
 body:not(.is-admin) .radio .consent{margin:4px 0 0;padding:8px}
 body:not(.is-admin) .actions{grid-column:2;grid-row:4;margin:0;display:grid;gap:9px}
 body:not(.is-admin) .people{grid-column:2;grid-row:5;margin:0;align-self:start;padding:15px}
 body:not(.is-admin) .chathead strong{font-size:17px}
 body:not(.is-admin) .bubble{font-size:14px;max-width:80%}
 body:not(.is-admin) .mediaactions{max-width:none}
 body:not(.is-admin) .center{grid-column:1/-1}
}
@media(max-width:959px){
 .shell{max-width:100%;width:100%}.top{height:62px;padding:9px 13px}.brand b{font-size:18px}.mark{width:35px;height:35px}.mark img{width:27px;height:27px}.brand small{font-size:9px}.status{font-size:10px}.install-app{font-size:10px;padding:7px 8px}
 main{padding:0 9px}.roomline{margin:11px 4px 8px}.roomline h1{font-size:17px}.roomline span{font-size:11px}
 .chat-nav{margin:0 0 8px;gap:5px}.chat-nav button{min-height:40px;font-size:10.5px;padding:7px 3px}
 .chat{display:flex;flex-direction:column;min-height:calc(100dvh - 205px);height:auto;margin:0 0 8px;border-radius:15px}
 .chathead{padding:11px 13px 9px}.chathead strong{font-size:13px}.chathead small{font-size:10px}
 .messages{min-height:calc(100dvh - 420px);max-height:calc(100dvh - 270px);background-size:min(65vw,220px);padding:12px 9px}.bubble{font-size:12.5px;max-width:92%;padding:9px 10px}
 .mediaactions{padding:7px 10px 3px;gap:5px}.attach{font-size:11px;min-height:34px;padding:7px 9px}.transcript-option{padding:6px 9px;margin:3px 10px!important}.transcript-option small{font-size:9px}
 .send{padding:7px 10px 10px}.send input{font-size:16px;height:44px;padding:10px 11px}.send button{min-width:43px;width:43px}
 .radio{margin:7px 0;padding:10px 12px;gap:10px;display:flex;align-items:center}.radiohead{min-width:100px;flex:1}.ptt{width:66px;height:66px;margin:0;flex-shrink:0}.ptt span{font-size:23px}.ptt b{font-size:9px}.radio .hint,.radio .consent{width:100%}
 .actions{margin:7px 0}.people{margin:7px 0}.is-admin .root-panel{margin:9px 0}.root-section{padding:12px}.root-head h2{font-size:20px}.root-kpis strong{font-size:23px}
}
@media(max-width:400px){.header-actions{gap:4px}.install-app{font-size:9px}.status{font-size:9px}.room-tools button{min-width:34px;padding:7px 9px}.chat-nav button{font-size:9.5px}.chathead{padding:10px}.bubble{font-size:12px}}

/* Correções 0.3.3 de legibilidade e segurança de layout */
html,body{min-width:320px;width:100%;overflow-x:hidden}
.shell,main,.chat,.messages,.bubble,.root-panel{min-width:0}
.messages{background-color:#fffdfb}
.pwa-help-link{text-align:center;font-size:12px;margin:12px 0}
.pwa-help-link a{color:#b9510b;text-decoration:underline;font-weight:750}
@media(max-width:959px){
 .shell{padding-bottom:env(safe-area-inset-bottom)}
 .roomline{gap:8px}
 .roomline h1{overflow-wrap:anywhere}
 .chat{min-height:calc(100dvh - 190px)}
 .messages{max-height:calc(100dvh - 260px);min-height:max(200px,calc(100dvh - 440px))}
 .send{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
 .mediaactions{flex-wrap:wrap}
 .chat-nav{display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
 .chat-nav button{flex:1 0 auto}
 .header-actions{min-width:0}
}
@media(max-width:390px){
 .top{padding:8px 9px}.brand b{font-size:17px}.brand small{font-size:8px}.mark{width:32px;height:32px}
 .install-app{padding:6px 7px}.roomline h1{font-size:16px}
}
