:root{--primary:#1D4ED8;--background:#0F172A;--text:#FFFFFF;--highlight:#38BDF8;--history:#334155;--footer:#1E293B}*{box-sizing:border-box}body{font-family:system-ui,Arial,sans-serif;margin:0;background:#f1f5f9;color:#172033}a{color:#1d4ed8;text-decoration:none}header{background:#102442;color:white;padding:14px 22px;display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap}header a{color:white;margin-right:12px}main{max-width:1150px;margin:25px auto;padding:0 18px}.card{background:white;border-radius:13px;padding:22px;margin:15px 0;box-shadow:0 2px 12px #14203816}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:15px}.btn,button{background:#1d4ed8;border:0;color:white;padding:12px 18px;border-radius:9px;cursor:pointer;font-size:1rem;display:inline-block}.btn.alt,button.alt{background:#475569}.btn.danger,button.danger{background:#b91c1c}.btn:disabled,button:disabled{opacity:.5;cursor:wait}input,select,textarea{width:100%;padding:11px;border:1px solid #cbd5e1;border-radius:8px;margin:5px 0 14px;font:inherit}label{font-weight:600}table{border-collapse:collapse;width:100%;background:white}td,th{padding:10px;border-bottom:1px solid #e2e8f0;text-align:left}th{background:#e2e8f0}.notice{padding:12px;border-radius:9px;background:#dbeafe;margin:12px 0}.error{background:#fee2e2}.muted{color:#64748b}.inline{display:inline}.actions{display:flex;gap:8px;flex-wrap:wrap}.display-body{background:var(--background);color:var(--text);height:100vh;overflow:hidden}.display-shell{height:100vh;display:flex;flex-direction:column;padding:1.5vh 2vw;gap:1.4vh}.display-top{display:flex;align-items:center;justify-content:space-between;min-height:10vh}.display-logo{max-height:9vh;max-width:24vw;object-fit:contain}.display-main{flex:1;min-height:0;display:grid;grid-template-columns:44% 56%;gap:1.4vw}.display-left{display:flex;flex-direction:column;min-height:0;gap:1.4vh}.current{background:var(--primary);border-radius:16px;padding:2vh 2vw;text-align:center;flex:1;display:flex;flex-direction:column;justify-content:center}.current .number{font-size:clamp(64px,9vw,180px);font-weight:900;color:var(--highlight);line-height:1.1}.current .counter{font-size:clamp(25px,3vw,58px)}.history{background:var(--history);border-radius:15px;padding:1.5vh 2vw;min-height:25vh}.history-row{display:flex;justify-content:space-between;font-size:clamp(18px,2vw,36px);padding:5px 0;border-bottom:1px solid #ffffff35}.media{border-radius:16px;overflow:hidden;background:#000;display:flex;align-items:center;justify-content:center}.media iframe,.media video{width:100%;height:100%;border:0;object-fit:contain}.display-footer{background:var(--footer);border-radius:12px;padding:1vh 2vw;display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:8vh;font-size:clamp(16px,1.5vw,30px)}.footer-message{flex:1;white-space:pre-wrap}.footer-info{text-align:right;white-space:nowrap}.kiosk{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#eaf2ff}.kiosk .card{max-width:700px;width:94%;text-align:center}.kiosk-buttons{display:grid;grid-template-columns:1fr 1fr;gap:20px}.kiosk-buttons button{font-size:clamp(20px,3vw,38px);padding:40px 12px}.receipt{display:none}@media(max-width:700px){.display-main{grid-template-columns:1fr}.media{display:none}.kiosk-buttons{grid-template-columns:1fr}}@media print{body *{visibility:hidden!important}.receipt,.receipt *{visibility:visible!important}.receipt{display:block!important;position:absolute;top:0;left:0;width:72mm;padding:2mm;text-align:center;font-family:Arial;color:black!important}.receipt h1{font-size:16pt}.receipt .big{font-size:38pt;font-weight:bold} @page{size:80mm auto;margin:0}}

/* Cabeçalho da TV: logo à esquerda, nome realmente centralizado e data à direita. */
.display-top{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr);align-items:center;gap:1.5vw}
.display-brand{min-width:0;display:flex;align-items:center;justify-content:flex-start}
.display-brand a{display:inline-flex;align-items:center;max-width:100%}
.display-company-name{margin:0;text-align:center;font-size:clamp(22px,2.1vw,44px);line-height:1.15;overflow-wrap:anywhere}
.display-date{justify-self:end;text-align:right;font-size:clamp(16px,1.2vw,25px);line-height:1.3}
@media(max-width:900px){.display-top{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr);gap:1vw}.display-company-name{font-size:clamp(16px,2.2vw,30px)}.display-date{font-size:clamp(12px,1.5vw,18px)}}

/* Créditos da desenvolvedora, exceto no painel público de TV */
.speakbr-credits{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;text-align:center;margin:30px auto 14px;padding:8px 12px;color:#64748b;font-size:12px;line-height:1.4}
.speakbr-credits a{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:6px}
.speakbr-credits img{display:block;width:45px;height:35px;object-fit:contain}
.speakbr-credits a:focus-visible{outline:2px solid #2563eb;outline-offset:3px}
.kiosk .speakbr-credits{position:fixed;bottom:5px;left:0;right:0;margin:0;z-index:2}
@media print{.speakbr-credits{display:none!important}}

.current .number.patient-name{font-size:clamp(28px,4.2vw,84px);overflow-wrap:anywhere;line-height:1.15;}

/* SpeakBR TV Studio: CSS only; video element and polling are untouched. */
.display-body{font-family:var(--tv-font);background:var(--background)}
.display-top{background:linear-gradient(110deg,var(--header),transparent);border-radius:var(--tv-radius);padding:0 1.4vw}
.display-body .current,.display-body .history,.display-body .media,.display-body .display-footer{border-radius:var(--tv-radius)}
.display-body .media{background:var(--media)}
.display-body .current{background:var(--primary)}
.display-body .current .number{font-size:clamp(58px,calc(9vw * var(--tv-scale)),220px)}
.display-body .current #current-label{color:var(--label)}
.display-body .current .counter{color:var(--counter)}
.display-body .footer-message{text-align:var(--tv-message-align)}
.display-body.tv-layout-right .display-left{order:2}
.display-body.tv-layout-right .media{order:1}
.display-body.tv-layout-right .display-main{grid-template-columns:56% 44%}
.display-body.tv-theme-glass .current,.display-body.tv-theme-glass .history,.display-body.tv-theme-glass .display-footer{background-image:linear-gradient(145deg,#ffffff18,transparent 48%,#00000022)}
.display-body.tv-theme-glass .current,.display-body.tv-theme-glass .history,.display-body.tv-theme-glass .media{box-shadow:0 calc(20px * var(--tv-shadow)) calc(55px * var(--tv-shadow)) var(--shadow),inset 0 1px 0 #ffffff35}
.display-body.tv-theme-neon .current{background:linear-gradient(135deg,var(--primary),var(--gradient))}
.display-body.tv-theme-neon .current,.display-body.tv-theme-neon .history,.display-body.tv-theme-neon .media{box-shadow:0 0 calc(35px * var(--tv-shadow)) var(--border),inset 0 1px 0 #ffffff30}
.display-body.tv-theme-minimal .current,.display-body.tv-theme-minimal .history,.display-body.tv-theme-minimal .media{box-shadow:none}
.display-body.tv-border .current,.display-body.tv-border .history,.display-body.tv-border .media{border:1px solid var(--border)}
.display-body.tv-animate .current{transition:background .35s ease,box-shadow .35s ease}
.display-body.tv-animate .number{transition:color .25s ease}
@media(prefers-reduced-motion:reduce){.display-body *{animation:none!important;transition:none!important}}

.display-body[style*="--tv-gradient:0"] .current{background-image:none!important}

.display-body.tv-no-gradient .current,.display-body.tv-no-gradient .history,.display-body.tv-no-gradient .display-footer{background-image:none!important}

/* Ajuste responsivo da chamada: o JS calcula o tamanho real disponível. */
.display-body .current{min-width:0;min-height:0;overflow:hidden}
.display-body .current .number,.display-body .current .number.patient-name{display:block;max-width:100%;min-width:0;max-height:100%;line-height:1.08;white-space:normal;overflow-wrap:anywhere;font-size:inherit}
#voice-unlock{position:fixed;z-index:9999;bottom:12px;left:50%;transform:translateX(-50%);background:#0e7490;color:white;border:2px solid #fff;border-radius:30px;box-shadow:0 6px 25px #0008;padding:12px 22px;font-weight:700;font-size:16px;cursor:pointer}

/* Indicadores opcionais, posicionados acima da mensagem inferior. */
.display-body .tv-metrics{background:var(--history);color:var(--text);border-radius:var(--tv-radius,14px);padding:clamp(7px,1vh,14px) clamp(12px,1.4vw,28px);box-shadow:0 6px 20px #0002;display:flex;flex-direction:column;gap:4px;flex-shrink:0;max-height:20vh;overflow:hidden}.tv-metrics-title{font-size:clamp(15px,1.3vw,25px);font-weight:600}.tv-metrics-details{display:flex;flex-wrap:wrap;gap:5px clamp(12px,2vw,36px);font-size:clamp(12px,1vw,20px)}.tv-metrics strong{font-variant-numeric:tabular-nums}

/* SPEAK PANEL - identidade visual 2026. Display TV não recebe estes estilos. */
body.speak-app,body.speak-login{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:#112447;background:#f1f6fd}
body.speak-app{background:linear-gradient(180deg,#e8f0fb 0,#f5f8fd 300px,#f5f8fd 100%)}
body.speak-app .speak-header{position:relative;z-index:2;background:linear-gradient(105deg,#061b39,#063779 68%,#0756ad);border-bottom:2px solid #0c9eff;box-shadow:0 8px 24px #08265325;padding:9px clamp(14px,3vw,42px);gap:20px;min-height:90px}
.speak-brand{display:flex;align-items:center;flex:0 0 auto;max-width:205px;transition:transform .2s ease}.speak-brand:hover{transform:translateY(-2px)}.speak-brand img{display:block;width:185px;max-height:75px;object-fit:contain;object-position:left center;filter:drop-shadow(0 3px 6px #0005)}
.speak-header-right{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex:1;min-width:0}.speak-operator{font-size:.82rem;color:#c5e7ff;font-weight:650;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
body.speak-app .speak-header nav{display:flex;gap:5px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
body.speak-app .speak-header nav a{margin:0;color:#eef7ff;font-size:.91rem;font-weight:650;border:1px solid transparent;border-radius:11px;padding:10px 13px;transition:background .2s,box-shadow .2s,transform .2s}
body.speak-app .speak-header nav a:hover,body.speak-app .speak-header nav a:focus-visible{background:linear-gradient(145deg,#1474df,#064a9b);border-color:#5ab8ff;box-shadow:0 4px 14px #0003;transform:translateY(-1px)}
body.speak-app main{max-width:1220px;margin:30px auto;padding:0 clamp(14px,2vw,28px)}body.speak-app main>h1{font-size:clamp(1.5rem,2.4vw,2.15rem);letter-spacing:-.035em;color:#102a51;margin:0 0 24px}
body.speak-app .card,body.kiosk .card{background:#fff;border:1px solid #e5edf8;border-radius:19px;box-shadow:0 10px 30px #153a6710,0 2px 7px #153a670a;padding:clamp(18px,2.2vw,28px)}
body.speak-app .card h2,body.speak-app .card h3{color:#122b52}
body.speak-app .btn,body.speak-app button,body.kiosk button{background:linear-gradient(135deg,#1376e7,#0644bd);color:#fff;border:1px solid #1d70d8;border-radius:11px;padding:11px 19px;box-shadow:0 4px 12px #1453c529;font-weight:650;transition:transform .18s,box-shadow .18s,filter .18s}
body.speak-app .btn:hover,body.speak-app button:hover,body.kiosk button:hover{filter:brightness(1.08);box-shadow:0 7px 19px #1453c53a;transform:translateY(-1px)}
body.speak-app .btn.alt,body.speak-app button.alt{background:linear-gradient(135deg,#647c9b,#3c526d);border-color:#607b9b}body.speak-app .btn.danger,body.speak-app button.danger{background:linear-gradient(135deg,#dc3545,#ad1731);border-color:#c52b3b}
body.speak-app input,body.speak-app select,body.speak-app textarea{border:1px solid #c9d7ea;border-radius:10px;background:#fff;transition:border-color .15s,box-shadow .15s}body.speak-app input:focus,body.speak-app select:focus,body.speak-app textarea:focus{outline:0;border-color:#2284eb;box-shadow:0 0 0 3px #2b8af226}
body.speak-app table{border-radius:12px;overflow:hidden}body.speak-app th{background:#eaf2fc;color:#163861}body.speak-app tr:hover td{background:#f8fbff}
body.speak-login{min-height:100vh;background:radial-gradient(ellipse at 5% 0%,#0b87e9 0%,transparent 36%),radial-gradient(ellipse at 100% 100%,#0072cf 0%,transparent 42%),linear-gradient(135deg,#001b3d,#003977 55%,#001b3d);display:flex;flex-direction:column}
.speak-login-main{width:100%;max-width:none;flex:1;display:flex;justify-content:center;align-items:center;margin:0;padding:32px 16px 8px}
.speak-login-card{background:linear-gradient(155deg,#fff,#f3f7ff);border:1px solid #ffffffb0;border-radius:28px;box-shadow:0 25px 65px #00142e8c,0 1px 1px #fff inset;width:min(100%,530px);padding:clamp(22px,4vw,44px);text-align:center}
.speak-login-logo{display:block;max-width:320px;width:83%;height:auto;margin:-12px auto 5px;filter:drop-shadow(0 9px 10px #002d5d30)}
.speak-login-card h1{font-size:clamp(1.65rem,3vw,2.1rem);margin:5px 0 2px;color:#0b2348;letter-spacing:-.035em}.speak-login-subtitle{margin:0 0 22px;color:#526780;font-size:1rem}
.speak-login-form{text-align:left}.speak-login-form label{display:block;color:#18355a;font-size:.92rem;margin:14px 0 3px}.speak-login-form input{margin:3px 0 0;padding:14px 15px;border:1px solid #c7d5e9;border-radius:11px;background:white;color:#18355a}.speak-login-form input:focus{outline:0;border-color:#1474df;box-shadow:0 0 0 3px #2388f224}
.speak-password-wrap{position:relative}.speak-password-wrap input{padding-right:85px}.speak-password-toggle{position:absolute;right:7px;top:8px;border:0;background:transparent;color:#1755a4;font-weight:700;padding:8px;cursor:pointer}
.speak-login-submit{display:block;width:100%;margin:21px 0 0;padding:15px;border:1px solid #1660ca;border-radius:12px;background:linear-gradient(120deg,#1376ed,#0343c1);color:#fff;font-weight:750;font-size:1.05rem;box-shadow:0 8px 20px #0956c82d;cursor:pointer;transition:transform .18s,filter .18s}.speak-login-submit:hover{filter:brightness(1.08);transform:translateY(-1px)}
.speak-login-features{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:24px 0 18px;padding-bottom:19px;border-bottom:1px solid #dce7f6;color:#0952aa}.speak-login-features span{display:flex;flex-direction:column;font-size:1.5rem;font-weight:800;gap:4px}.speak-login-features small{font-size:.72rem;font-weight:600;color:#193c6b}
.speak-login-caption{display:flex;flex-direction:column;gap:3px;color:#526780;font-size:.78rem}.speak-login-caption strong{font-size:1.1rem;color:#0648b4}.speak-login-error{padding:10px;border-radius:10px;color:#a51630;background:#ffe8ed}
body.speak-login .speakbr-credits{margin:0 auto 12px;color:#e3f3ff}body.speak-login .speakbr-credits img{width:50px;height:37px}
@media(max-width:850px){body.speak-app .speak-header{align-items:flex-start}.speak-brand img{width:130px;max-height:65px}.speak-header-right{align-items:flex-end}body.speak-app .speak-header nav a{padding:8px 9px;font-size:.83rem}}
@media(max-width:560px){body.speak-app .speak-header{flex-direction:column;align-items:center;gap:8px}.speak-header-right{width:100%;align-items:center}body.speak-app .speak-header nav{justify-content:center}.speak-login-card{border-radius:20px}.speak-login-features small{font-size:.61rem}}
@media(prefers-reduced-motion:reduce){body.speak-app .btn,body.speak-app button,.speak-login-submit,.speak-brand{transition:none}}

/* Hard cap: never allow brand illustration to fill header */
body.speak-app .speak-header .speak-brand img{width:160px!important;height:65px!important;max-width:160px!important;max-height:65px!important;object-fit:contain!important}

/* Speak Panel: correção final de identidade e layout */
body.speak-app .speak-header{width:100%;box-sizing:border-box}
body.speak-app .speak-brand{width:170px;max-width:170px;min-width:135px}
body.speak-app .speak-brand img{display:block;width:160px;height:65px;max-width:100%;max-height:65px;object-fit:contain}
body.speak-app main .grid>.card{border:1px solid #dbe8f8;border-radius:18px;box-shadow:0 12px 35px #12376914}
body.speak-app main .grid>.card .btn{background:linear-gradient(135deg,#0879e8,#064bb5);border-radius:10px;font-weight:700;box-shadow:0 6px 14px #0756b525}
body.speak-app main .grid>.card .btn:hover{filter:brightness(1.1);transform:translateY(-1px)}
@media(max-width:800px){body.speak-app .speak-header{justify-content:center}body.speak-app .speak-header-right{align-items:center}body.speak-app .speak-header nav{justify-content:center}}
