#touch-keyboard{position:fixed;inset:auto 0 0;z-index:180;background:var(--panel,#fffdf8);color:var(--ink,#202633);border-top:1px solid var(--line,#d8d5cb);box-shadow:0 -6px 24px #0002;padding:5px max(5px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left));font-family:inherit;touch-action:manipulation}
.touch-keyboard-bar,.touch-keyboard-row{display:flex;justify-content:center;gap:4px;max-width:700px;margin:0 auto 4px}
.touch-keyboard-bar{align-items:center;gap:8px;font-size:11px;color:var(--ink2);margin-bottom:5px}
.touch-keyboard-bar>span{flex:1}
#touch-keyboard button{flex:1;min-width:0;min-height:32px;padding:3px 1px;border:1px solid var(--line,#d8d5cb);border-radius:7px;background:var(--panel2,#f0eee8);color:inherit;font-family:inherit;font-weight:500;font-size:17px;line-height:1.1;cursor:pointer;touch-action:manipulation}
#touch-keyboard button:active,#touch-keyboard button[aria-pressed=true]{background:var(--acc-soft,#e4def8)}
#touch-keyboard button:focus-visible{outline:2px solid var(--acc,#6955cd);outline-offset:1px}
#touch-keyboard .touch-key-wide{flex:1.5;font-size:13px}
#touch-keyboard .touch-key-space{flex:6}
#touch-keyboard .touch-keyboard-bar button{flex:0 0 auto;min-height:28px;padding:4px 12px;font-size:12px}
#touch-keyboard .touch-keyboard-bar button:last-child{background:var(--acc,#6955cd);color:var(--acc-ink,#fff)}
.touch-keyboard-open .shell{height:calc(100dvh - var(--touch-keyboard-height,230px));min-height:0}
/* A barra de baixo está escondida com o teclado aberto: o espaço reservado para ela deixava uma faixa em branco. */
.touch-keyboard-open .shell>.mobile-dock-space{display:none}
.touch-keyboard-open .ov{bottom:var(--touch-keyboard-height,230px);padding:8px}
.touch-keyboard-open .dlg{max-height:calc(100dvh - var(--touch-keyboard-height,230px) - 16px)}
.touch-keyboard-open .pop{max-height:calc(100dvh - var(--touch-keyboard-height,230px) - 150px)}
.touch-keyboard-open input:read-only,.touch-keyboard-open textarea:read-only{cursor:text}
@media(max-height:480px){#touch-keyboard{padding-top:3px}.touch-keyboard-row{margin-bottom:2px}#touch-keyboard button{min-height:27px}.touch-keyboard-bar>span{display:none}.touch-keyboard-bar{position:absolute;right:5px;bottom:5px;width:195px;margin:0}#touch-keyboard .touch-keyboard-row:last-child{padding-right:200px}#touch-keyboard .touch-keyboard-bar button{padding:3px 6px;min-height:27px}}
@media (max-width:760px), (max-height:500px) and (orientation:landscape) and (max-width:1000px){
  .touch-keyboard-open .shell.mobile-search-open>.top,.touch-keyboard-open .shell.mobile-account-open>.top{bottom:calc(var(--touch-keyboard-height,230px) + 8px);max-height:calc(100dvh - var(--touch-keyboard-height,230px) - 24px - env(safe-area-inset-top));display:flex;flex-direction:column;overflow:hidden}
  .touch-keyboard-open .shell.mobile-search-open>.top>.gsearch{min-height:0;display:flex!important;flex-direction:column}
  .touch-keyboard-open .shell.mobile-search-open>.top .gsearch .input{flex-shrink:0}
  .touch-keyboard-open .shell.mobile-search-open>.top .pop{min-height:0;overflow:auto;flex:1}
  .touch-keyboard-open .shell>.top>.mobile-panel-heading{flex-shrink:0}
  .touch-keyboard-open .mobile-dock{visibility:hidden;pointer-events:none}
}

.touch-paste-help{display:flex;align-items:center;gap:8px;max-width:700px;margin:0 auto 6px;font-size:12px}.touch-paste-help span{flex:1}#touch-keyboard .touch-paste-help button{flex:0 1 150px;font-size:12px;padding:6px}

/* Emojis no teclado da aplicação (só na caixa de texto do chat) */
#touch-keyboard .touch-emoji-tabs button{min-height:30px;font-size:18px;background:transparent;border-color:transparent}
#touch-keyboard .touch-emoji-tabs button[aria-selected=true]{background:var(--acc-soft,#e4def8);border-color:var(--line,#d8d5cb)}
.touch-emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;max-width:700px;height:150px;margin:0 auto 4px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#touch-keyboard .touch-emoji-grid button{min-height:37px;padding:0;border:0;background:transparent;font-size:25px;line-height:1}
#touch-keyboard .touch-emoji-grid button:active{background:var(--acc-soft,#e4def8)}
@media(max-height:480px){.touch-emoji-grid{height:96px}#touch-keyboard .touch-emoji-grid button{min-height:30px;font-size:21px}}

/* Teclado v2 (2026-10-25): só “Concluir”, quatro filas com teclas altas, acentos ao manter o dedo e letra ampliada. */
#touch-keyboard{padding-top:6px;background:#ebe7de;-webkit-tap-highlight-color:transparent}
#touch-keyboard button{-webkit-tap-highlight-color:transparent}
html[data-theme="dark"] #touch-keyboard{background:#22242d}
.touch-keyboard-bar{justify-content:flex-end;margin-bottom:6px}
#touch-keyboard .touch-keyboard-bar button{min-height:34px;padding:6px 16px;border:0;border-radius:10px;font-size:14px;font-weight:800}
.touch-keyboard-row{gap:6px;margin-bottom:9px}
#touch-keyboard .touch-keyboard-row button{min-height:46px;border:0;border-radius:9px;background:var(--panel,#fffdf8);box-shadow:0 1.5px 0 #b9b3a7;font-size:22px;font-weight:450}
#touch-keyboard .touch-keyboard-row .touch-key-wide{background:#d8d2c6;font-size:16px}
html[data-theme="dark"] #touch-keyboard .touch-keyboard-row button{background:var(--panel2,#303340);box-shadow:0 1.5px 0 #0008}
html[data-theme="dark"] #touch-keyboard .touch-keyboard-row .touch-key-wide{background:#454756}
#touch-keyboard .touch-keyboard-row .touch-key-space{background:var(--panel,#fffdf8);font-size:15px}
#touch-keyboard .touch-keyboard-row .touch-key-enter{background:var(--acc,#d8c5f4);color:var(--acc-ink,#302444);font-size:20px}
#touch-keyboard .touch-keyboard-row button:active{background:#d8d2c6}
.touch-key-preview{position:absolute;z-index:3;width:52px;height:62px;margin:-66px 0 0 -26px;display:grid;place-items:center;border-radius:12px;background:var(--panel,#fffdf8);color:var(--ink,#202638);box-shadow:0 4px 14px #0004;font-size:32px;font-weight:600;pointer-events:none}
.touch-accent-menu{position:absolute;z-index:4;display:flex;gap:2px;padding:4px;border-radius:12px;background:var(--panel,#fffdf8);box-shadow:0 4px 16px #0005}
#touch-keyboard .touch-accent-menu button{flex:none;width:42px;min-height:50px;border:0;border-radius:9px;background:transparent;box-shadow:none;font-size:24px}
#touch-keyboard .touch-accent-menu button.is-active{background:var(--acc-text,#563c80);color:#fff}
@media(max-height:480px){#touch-keyboard .touch-keyboard-row button{min-height:30px;font-size:17px}.touch-keyboard-row{margin-bottom:3px}#touch-keyboard .touch-keyboard-bar{width:auto}#touch-keyboard .touch-keyboard-row:last-child{padding-right:130px}}
