/* Passagem UX 14/09: comunicação antes da administração. Sem alterar ordem ou dados da grade. */
html body.sb-shell { padding-bottom: calc(var(--sb-dock-h, 160px) + 12px); background: #f4f6f9; }
html body.sb-shell .wrap { width: 100%; min-width: 0; box-sizing: border-box; scroll-padding-bottom: calc(var(--sb-dock-h, 160px) + 16px); }
/* O conteúdo aparece com a prancha e o rascunho restaurados. Se o script falhar, o CSS libera
   a interface após 8s; a falha de um recurso não deixa a comunicação escondida para sempre. */
html body.sb-shell.sb-starting .wrap { visibility: hidden; animation: sb-start-fallback 0s 8s forwards; }
@keyframes sb-start-fallback { to { visibility: visible; } }
html { --sb-message-reserve: 176px; scroll-padding-top: var(--hh, 56px); }
#board .cell { scroll-margin-top: var(--sb-message-reserve); scroll-margin-bottom: calc(var(--sb-dock-h, 160px) + 16px); }
/* Amplia o alvo sem tomar o centro dos cartões compactos. */
.cell .sb-var-trigger {
  width: min(44px, calc(50% - 4px)) !important;
  min-width: 0 !important;
  min-height: 44px !important;
  top: 0 !important;
  right: 0 !important;
  place-items: start end !important;
  padding-right: 2px;
  box-sizing: border-box;
  color: var(--cell-b, #ccc) !important;
  background: transparent !important;
}
/* Títulos de área ficam disponíveis à leitura assistiva, sem ocupar a composição visual. */
.predzone .predtitle, .mt-sugestoes-titulo, .mt-compositor > label,
#breadcrumb .bc-cur, #breadcrumb:not(:has(.bc-link)) {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip-path: inset(50%); white-space: nowrap; border: 0 !important;
}
#breadcrumb .bc-sep:has(+ .bc-cur) { display: none; }
html body.sb-shell.sb-dockshut .sb-pager { bottom: var(--sb-dock-h, 88px); }
html body.sb-shell .sb-shellbar { background: #fff; box-shadow: 0 -2px 12px #04153420; }
html body.sb-shell .sb-dockhandle { background: #e9eef6; color: #041534; }
html body.sb-shell .sb-shellbtn { min-height: 48px; }
/* Recolher só a navegação secundária: Sim, Não e Urgência continuam ao alcance. */
html body.sb-shell.sb-dockshut .sb-dockrows { max-height: none; opacity: 1; visibility: visible; margin-top: 6px; }
html body.sb-shell.sb-dockshut .sb-shellrow:first-child { display: grid; grid-template-columns: repeat(3, 1fr); }
html body.sb-shell.sb-dockshut .sb-shellrow:nth-child(2),
html body.sb-shell.sb-dockshut [data-shellact="fra"] { display: none; }
html body.sb-shell.sb-dockshut .sb-dockrows { display: block; pointer-events: auto; }
html body.sb-shell.sb-dockshut .sb-shellbar { background: #fff; pointer-events: auto; padding: 8px 10px calc(8px + env(safe-area-inset-bottom,0px)); box-shadow: 0 -2px 12px #04153420; border-style: solid; border-width: 0 0 5px; border-image: linear-gradient(to right,#e31814 0 25%,#f9ba1c 25% 50%,#26c67a 50% 75%,#1250e0 75% 100%) 1; }
html body.sb-shell.sb-dockshut .sb-dockhandle { width: 72px; min-width: 72px; min-height: 24px; padding: 2px 14px; border-radius: 8px; box-shadow: none; background: #e9eef6; color: #041534; }
html body.sb-shell.sb-dockshut .sb-dockhandle::after, html body.sb-shell.sb-dockshut .sb-dockhandle-lbl { display: none; }
body.sb-shell:has(#typepanel:not([hidden])) .sb-pathspanel { display: none; }
body.mt-on header .ham { visibility: hidden; }
body.mt-on .sb-shellrow:nth-child(2), body.mt-on [data-shellact="fra"], body.mt-on .sb-dockhandle { display: none; }
body.mt-on .sb-shellbar .sb-dockrows { display: block; max-height: none; visibility: visible; opacity: 1; }
body.mt-on .sb-shellbar .sb-shellrow:first-child { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
body.mt-on .sb-shellbar { padding-top: 8px; }
#modotexto .mt-campo { box-shadow: 0 1px 3px #04153410; }
.mt-sugestoes-titulo { font-size: 14px; color: #566472; font-weight: 700; }
.tp-scope { display: flex; gap: 8px; margin-block: 12px; }
.tp-scope button { min-height: 44px; flex: 1; border: 1px solid #d8e0ea; border-radius: 10px; padding: 8px; background: #fff; color: #14243d; font: inherit; }
.tp-scope [aria-pressed="true"] { background: #1250e0; color: #fff; }
body .typepanel .tp-card { min-height: 64px; }
body .sb-varpop { max-height: calc(100dvh - 24px); overflow-y: auto; align-content: start; }
body .sb-varpop [hidden] { display: none !important; }
.sb-varhead { position: sticky; top: -8px; width: 100%; background: #fff; padding: 12px 4px; font-weight: 700; z-index: 1; }
.sb-varall { width: 100%; min-height: 44px; font: inherit; border: 1px solid #d8e0ea; border-radius: 10px; padding: 8px; background: #fff; color: #14243d; }
.sb-varpop button:focus-visible { outline: 3px solid #1250e0; outline-offset: 2px; }
#modotexto #mtTeclado[hidden] { display: none !important; }
.sb-modebar { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.sb-mode-switch { display: flex; gap: 4px; }
.sb-modebar .ctxdd-slot:not(:empty) { flex: 0 1 240px; min-width: 160px; }
html body .sb-modebar .ctxdd { margin: 0 !important; max-width: none; }
html body .sb-modebar .ctxdd-btn { min-height: 44px; padding: 8px 12px; }
.sb-modebar button, #sbModeToggle { min-height: 44px; box-sizing: border-box; padding: 12px; border-radius: 10px; border: 1px solid #d8e0ea; font: 700 14px Inter,system-ui,sans-serif; background: #fff; color: #14243d; }
#sbModeToggle { white-space: nowrap; }
#modotexto .mt-textos { position: fixed; inset: 12px; max-width: 720px; margin-inline: auto; background: #fff; }
.sb-mode-settings { display: inline-flex; gap: 8px; align-items: center; justify-content: center; margin-left: auto; }
.sb-modebar .ctxdd-slot:empty { display: none; }
.sb-message-search { min-width: 0; cursor: pointer; border-radius: 8px; }
.sb-message-search:focus-visible, #sbModeToggle:focus-visible { outline: 3px solid #1250e0; outline-offset: 3px; }
html body header .ham, body.sb-focus .sb-mode-settings { display: none !important; }
/* As ferramentas originais ficam no diálogo; nenhum segundo menu ocupa a comunicação. */
html body #config:not(.open) { display: none; }
body .sb-modebar button:focus-visible { outline: 3px solid #1250e0; outline-offset: 3px; }
body.mt-on .mt-topo .mt-modo { order: -1; margin-right: 0; }
body .config .cfg-quick > .mt-abrir, body .config .cfg-quick > [data-act="typeToggle"] { display: none; }
body .hin .sharebtn-h { display: none !important; }
/* O painel tem fundo inerte e sobrepõe a grade, cujo espaço original fica reservado. */
.sb-config-dialog { position: fixed; inset: 0; background: #04153488; display: flex; justify-content: flex-end; }
.sb-config-dialog[hidden] { display: none !important; }
.sb-config-card { width: min(100%, 460px); height: 100%; overflow: auto; background: #fff; box-shadow: -8px 0 30px #04153430; padding: 16px; box-sizing: border-box; }
.sb-config-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; position: sticky; top: -16px; background: #fff; padding: 12px 0; z-index: 2; }
.sb-config-head h2 { font-size: 22px; margin: 0; color: #14243d; }
.sb-config-head button { min-width: 44px; min-height: 44px; background: #fff; border: 1px solid #d8e0ea; border-radius: 10px; font-size: 28px; cursor: pointer; }
.sb-config-back { width: 100%; min-height: 48px; padding: 12px; background: #1250e0; color: #fff; border: 0; border-radius: 10px; font: 700 16px Inter, system-ui, sans-serif; cursor: pointer; margin: 16px 0; }
body .sb-config-dialog #config.open { position: static; display: block; width: auto; max-height: none; overflow: visible; border: 0; background: #fff; box-shadow: none; }
.sb-config-dialog .cfgin { padding: 0; display: block; }
.sb-config-dialog .cfg-quick { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
.sb-config-dialog .cfg-quick #printBtn { margin-left: 0; }
.sb-config-dialog #cfgAdvBtn { display: none; }
body .sb-config-dialog #cfgAdv { display: block; position: static; width: auto; max-width: none; border: 0; padding: 0; box-shadow: none; }
.sb-config-dialog #cfgAdv .cfgsec { display: grid; grid-template-columns: 1fr; gap: 12px; border: 1px solid #d8e0ea; border-radius: 12px; padding: 16px; margin: 0 0 12px; }
.sb-config-dialog #cfgAdv .cfgsec > * { display: block; }
.sb-config-dialog #cfgAdv .cfgseclbl { font-size: 14px; font-weight: 700; color: #14243d; text-transform: none; pointer-events: none; }
.sb-config-dialog #cfgAdv button, .sb-config-dialog #cfgAdv select { min-height: 44px; }
.sb-config-dialog button:focus-visible, .sb-config-dialog select:focus-visible, .sb-config-dialog input:focus-visible { outline: 3px solid #1250e0; outline-offset: 3px; }
body.sb-focus .mt-cfg { display: none !important; }
/* Composição: a mensagem confirmada tem precedência sobre sugestões (104 / 64 ≈ 1,618). */
html body.sb-shell .sentence { --sb-message-pic: 104px; display: grid; grid-template-columns: minmax(0,1fr) 208px; gap: 16px; min-height: 160px; padding: 12px; margin-bottom: 8px; align-items: center; }
html body.sb-shell .slots { min-width: 0; min-height: 132px; max-height: 208px; flex-wrap: nowrap; overflow: auto; gap: 8px; padding: 4px; }
html body.sb-shell .slots .chip { flex: 0 0 auto; width: calc(var(--sb-message-pic) + 8px); gap: 4px; }
html body.sb-shell .slots .chip > img, html body.sb-shell .slots .chip > .imgwrap { width: var(--sb-message-pic); height: var(--sb-message-pic); max-width: none; }
html body.sb-shell .slots .chip span { font-size: 16px; line-height: 20px; overflow-wrap: anywhere; }
html body.sb-shell .slots .chip.chip-txt, html body.sb-shell .slots .chip.chip-ges-txt { width: auto; max-width: 240px; }
html body.sb-shell .sentence .controls { display: grid; grid-template-columns: repeat(4,minmax(44px,1fr)); gap: 8px; }
html body.sb-shell .sentence .controls #sayBtn { grid-column: 1 / -1; min-height: 56px; }
html body.sb-shell .sentence .controls .ctrl.alt { min-width: 44px; min-height: 44px; padding: 8px; }
.sb-undo-icon { font-size: 24px; line-height: 1; }
html body.sb-shell .predbox { padding: 8px; }
/* A largura decide quantos cartões cabem à vista, não quantos são oferecidos. */
html body.sb-shell .predrow {
  --sb-pred-visible: 6; --sb-pred-gap: 8px;
  display: flex; flex-wrap: nowrap;
  gap: var(--sb-pred-gap); align-items: stretch; min-width: 0;
  overflow-x: auto; padding: 4px; scroll-padding-inline: 4px;
  overscroll-behavior-x: contain;
}
html body.sb-shell .predrow:focus-visible { outline: 2px solid #1250e0; outline-offset: 1px; border-radius: 10px; }
html body.sb-shell .predrow .cell {
  flex: 0 0 max(76px,calc((100% - (var(--sb-pred-visible) - 1)*var(--sb-pred-gap))/var(--sb-pred-visible)));
  min-height: 100px; padding: 6px;
}
html body.sb-shell .predrow .cell > img, html body.sb-shell .predrow .cell > .imgwrap { width: 64px; height: 64px; max-width: 100%; }
html body.sb-shell .predrow .cell .lbl { font-size: 14px; line-height: 18px; margin-top: 4px; }
html body.sb-shell .predtitle { margin-bottom: 8px; }
@media (min-width: 1100px) {
  html body.sb-shell .predrow { --sb-pred-visible: 9; --sb-pred-gap: 6px; }
  html body.sb-shell .sb-shellbtn { flex-direction: row; gap: 8px; }
  body.mt-on #modotexto { padding-inline: max(16px, calc((100vw - 1280px) / 2)); }
}
@media (max-width: 760px) {
  html body.sb-shell .predrow { --sb-pred-visible: 4; --sb-pred-gap: 6px; }
  .sb-modebar { display: grid; grid-template-columns: minmax(0,1fr) auto 44px; gap: 8px; }
  .sb-mode-switch { grid-column: 2; grid-row: 1; }
  .sb-modebar .sb-mode-settings { grid-column: 3; grid-row: 1; padding: 8px; margin: 0; min-width: 44px; }
  .sb-mode-settings span[data-i18n] { display: none; }
  .sb-modebar .ctxdd-slot:not(:empty) { grid-column: 1; grid-row: 1; min-width: 0; }
  .sb-modebar button, #sbModeToggle { font-size: 13px; padding: 10px 8px; }
  html { --sb-message-reserve: 184px; }
  html body.sb-shell .sentence { --sb-message-pic: 72px; grid-template-columns: minmax(0,1fr); min-height: 0; padding: 8px; gap: 4px; margin-bottom: 0; }
  html body.sb-shell .slots { min-height: 96px; }
  html body.sb-shell .sentence .controls { grid-template-columns: minmax(80px,1fr) repeat(4,44px); gap: 6px; }
  html body.sb-shell .sentence .controls #sayBtn { grid-column: auto; min-height: 48px; padding: 8px; }
  html body.sb-shell .predbox { padding: 4px; }
  html body.sb-shell .predtitle { margin-bottom: 4px; }
  html body.sb-shell .predrow .cell { min-height: 68px; padding: 4px; }
  html body.sb-shell .predrow .cell > img, html body.sb-shell .predrow .cell > .imgwrap { width: 40px; height: 40px; }
  html body.sb-shell .predrow .cell .lbl { font-size: 12.5px; line-height: 16px; margin-top: 2px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  html { --sb-message-reserve: 124px; }
  html body.sb-shell .sentence { --sb-message-pic: 72px; min-height: 116px; padding: 8px; gap: 8px; margin-bottom: 6px; }
  html body.sb-shell .slots { min-height: 96px; max-height: 120px; }
  html body.sb-shell .sentence .controls #sayBtn { min-height: 44px; }
  html body.sb-shell .predbox { padding: 4px; }
  html body.sb-shell .predtitle { margin-bottom: 4px; }
  html body.sb-shell .predrow .cell { min-height: 72px; padding: 3px; }
  html body.sb-shell .predrow .cell > img, html body.sb-shell .predrow .cell > .imgwrap { width: 48px; height: 48px; }
  html body.sb-shell .predrow .cell .lbl { font-size: 12px; line-height: 14px; margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-shellbar, .sb-dockrows, .sb-shellbtn, .mt-tecla { transition: none !important; }
}
@media print {
  .sb-modebar, .sb-config-dialog { display: none !important; }
}

/* Texto: cinco regiões dentro da altura disponível; o teclado nunca depende de rolagem. */
.mt-sr, body.mt-on #modotexto .mt-status[data-i18n] {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip-path: inset(50%); white-space: nowrap; border: 0 !important;
}
#mtHeaderControls:empty, #modotexto #mtKeyboardRestore:empty { display: none; }
body.mt-on #modotexto {
  height: calc(var(--mt-vh, 100dvh) - var(--hh, 56px) - var(--sb-dock-h, 80px));
  overflow: hidden; grid-template-columns: minmax(0,1fr);
  grid-template-rows: 44px minmax(88px,17fr) 48px 56px minmax(284px,23fr);
  align-content: stretch; gap: 8px; padding: 8px max(8px,calc((100vw - 1280px)/2));
  background: #f4f6f9;
}
body.mt-on #modotexto > * { min-width: 0; }
body.mt-on #modotexto #mtTopoSlot { grid-area: 1 / 1; }
body.mt-on .mt-topo { height: 44px; }
body.mt-on #modotexto .mt-compositor { grid-area: 2 / 1; min-height: 0; gap: 4px; }
body.mt-on #modotexto .mt-campo { flex: 1 1 0; min-height: 0; }
body.mt-on #mtBuffer { min-height: 0; }
body.mt-on #modotexto .mt-status { font-size: 12px; }
body.mt-on #modotexto .mt-acoes { grid-area: 3 / 1; display: flex; flex-wrap: nowrap; gap: 8px; overflow: visible; }
body.mt-on #modotexto .mt-acoes button { flex: 0 1 auto; min-height: 44px; padding: 8px 16px; flex-wrap: nowrap; }
body.mt-on #modotexto .mt-acoes [data-act="mtFalar"] { min-width: 144px; }
body.mt-on #modotexto .mt-acoes [data-act="mtDesfazer"] { margin-left: auto; }
body.mt-on #modotexto .mt-acoes .ico { width: 20px; height: 20px; }
body.mt-on #modotexto .mt-pred { grid-area: 4 / 1; display: flex; align-items: center; gap: 8px; min-height: 0; }
body.mt-on #modotexto .mt-sugestao { flex: 1 1 0; min-width: 0; height: 56px; min-height: 0; padding: 4px; overflow: hidden; }
body.mt-on #modotexto .mt-chip { flex: 1 1 0; width: 0; height: 48px; padding: 4px 6px; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
body.mt-on #modotexto .mt-seta-aceite { min-width: 44px; width: 44px; min-height: 48px; }
body.mt-on #modotexto .mt-entrada { flex: 0 0 184px; position: relative; min-width: 0; }
body.mt-on #modotexto .mt-entrada select { width: 100%; min-width: 0; height: 48px; padding: 8px; border: 1px solid #c7d0d8; border-radius: 10px; background: #fff; color: #14243d; font: inherit; font-size: 14px; }
.mt-entrada-icone { display: none; }
body.mt-on #modotexto .mt-teclado { grid-area: 5 / 1; min-height: 0; height: auto; max-height: none; align-self: stretch; padding: 6px; gap: 6px; border-radius: 14px; }
body.mt-on #modotexto .mt-linhas { display: contents; }
body.mt-on #modotexto .mt-linha { flex: 1 1 0; min-height: 44px; gap: 6px; }
body.mt-on #modotexto .mt-tecla, body.mt-on #modotexto .mt-esp { min-height: 44px; }
body.mt-on #modotexto .mt-linhas .mt-esp { min-width: 0; padding-inline: 0; }
body.mt-on #modotexto .mt-util { grid-template-columns: minmax(44px,1fr) minmax(44px,1fr) minmax(60px,3fr) minmax(44px,1fr) minmax(44px,1fr) minmax(44px,.65fr); }
body.mt-on #modotexto .mt-espaco { grid-column: auto; }
body.mt-on #modotexto .mt-recolher { padding: 8px; }
.mt-recolher svg { width: 24px; height: 24px; }
#modotexto #mtKeyboardRestore { grid-area: 5 / 1; display: flex; justify-content: flex-end; }
#mtKeyboardRestore .mt-recolher { width: 48px; height: 44px; border: 1px solid #c7d0d8; }
#mtKeyboardRestore .mt-recolher svg { transform: rotate(180deg); }
body.mt-on #modotexto.mt-sem-teclado { grid-template-rows: 44px minmax(0,1fr) 48px 56px 44px; }
body.mt-on .sb-shellbar { bottom: max(0px,calc(100dvh - var(--mt-vh,100dvh))); }
@media (max-width: 760px) {
  body.mt-on #modotexto { padding: 6px; gap: 6px; }
  body.mt-on #modotexto .mt-acoes { gap: 6px; }
  body.mt-on #modotexto .mt-acoes button { flex: 1 1 0; padding: 8px; }
  body.mt-on #modotexto .mt-acoes [data-act="mtFalar"] { min-width: 82px; }
  body.mt-on #modotexto .mt-acoes .danger { margin-left: 0; }
  body.mt-on #modotexto .mt-acoes button:not([data-act="mtFalar"]) span[data-i18n] {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
@media (max-width: 580px) {
  body.mt-on #modotexto .mt-entrada { flex-basis: 48px; }
  body.mt-on #modotexto .mt-entrada select { color: transparent; appearance: none; padding: 0; }
  body.mt-on #modotexto .mt-entrada option { color: #14243d; }
  .mt-entrada-icone { display: block; position: absolute; inset: 11px; width: 26px; height: 26px; pointer-events: none; color: #14243d; }
  body.mt-on #modotexto .mt-chip { font-size: 14px; }
  body.mt-on #modotexto .mt-teclado { padding: 4px; gap: 4px; }
  body.mt-on #modotexto .mt-linha { gap: 2px; }
  body.mt-on #modotexto .mt-util { gap: 4px; grid-template-columns: 44px 44px minmax(56px,1fr) 44px 44px 44px; }
}
/* A exceção do celular horizontal reúne os controles no cabeçalho azul. */
@media (max-width: 1000px) and (max-height: 560px) and (orientation: landscape) {
  /* A reserva do Texto independe de o rodapé ter sido recolhido no modo Imagem. */
  html body.mt-on.sb-shell .sb-shellbar { padding: 4px calc(8px + env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) calc(8px + env(safe-area-inset-left,0px)); }
  html body.mt-on.sb-shell .sb-dockrows { margin-top: 0; }
  body.mt-on header .hin { min-height: 52px; }
  body.mt-on #mtHeaderControls { margin-left: 12px; }
  body.mt-on #mtHeaderControls .mt-topo { gap: 8px; }
  body.mt-on #mtHeaderControls button { background: transparent; color: #fff; border-color: #8291a5; }
  body.mt-on #modotexto { grid-template-columns: minmax(220px,34%) minmax(0,1fr); grid-template-rows: minmax(0,1fr) 56px 94px; gap: 6px; padding: 6px; }
  body.mt-on #modotexto #mtTopoSlot { display: none; }
  body.mt-on #modotexto .mt-compositor { grid-area: 1 / 1; }
  body.mt-on #modotexto .mt-acoes { grid-area: 3 / 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(2,44px); gap: 6px; }
  body.mt-on #modotexto .mt-acoes button { min-width: 0; padding: 4px; margin: 0; font-size: 12px; }
  body.mt-on #modotexto .mt-acoes [data-act="mtFalar"] { min-width: 0; }
  body.mt-on #modotexto .mt-acoes [data-act="mtDesfazer"] { margin-left: 0; }
  body.mt-on #modotexto .mt-acoes button:not([data-act="mtFalar"]) span[data-i18n] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body.mt-on #modotexto .mt-pred { grid-area: 2 / 1; }
  body.mt-on #modotexto .mt-entrada { flex-basis: 48px; }
  body.mt-on #modotexto .mt-entrada select { color: transparent; appearance: none; padding: 0; }
  body.mt-on #modotexto .mt-entrada option { color: #14243d; }
  .mt-entrada-icone { display: block; position: absolute; inset: 11px; width: 26px; height: 26px; pointer-events: none; color: #14243d; }
  body.mt-on #modotexto .mt-chip { font-size: 14px; padding-inline: 2px; }
  body.mt-on #modotexto .mt-teclado { grid-area: 1 / 2 / 4 / 3; padding: 4px; gap: 4px; }
  body.mt-on #modotexto .mt-linha { gap: 3px; }
  body.mt-on #modotexto .mt-linhas[data-camada="letras"] [data-digitos] { display: none; }
  body.mt-on #modotexto #mtKeyboardRestore { grid-area: 3 / 2; align-items: flex-end; }
  body.mt-on #modotexto.mt-sem-teclado { grid-template-columns: minmax(0,1fr) 280px; grid-template-rows: 56px minmax(0,1fr) 94px; }
  body.mt-on #modotexto.mt-sem-teclado .mt-compositor { grid-area: 1 / 1 / 4 / 2; }
  body.mt-on #modotexto.mt-sem-teclado .mt-acoes { grid-area: 3 / 2; }
  body.mt-on #modotexto.mt-sem-teclado #mtKeyboardRestore { grid-area: 2 / 2; }
  body.mt-on #modotexto.mt-sem-teclado .mt-entrada { flex-basis: 48px; }
  body.mt-on #modotexto.mt-sem-teclado .mt-pred { grid-area: 1 / 2; }
}

/* Rotas e dock: vidro suave e respiro aprovados em 14/09/2026. */
@media(orientation:portrait) and (max-height:740px){
 body.mt-on #modotexto{grid-template-rows:44px minmax(44px,1fr) 44px 48px minmax(208px,2fr);gap:6px;}
 body.mt-on #modotexto .mt-linhas[data-camada="letras"] [data-digitos]{display:none;}
 body.mt-on #modotexto:has(.mt-linhas[data-camada="simbolos"]){grid-template-rows:44px minmax(44px,1fr) 44px 48px minmax(244px,2fr);}
}
@media(max-width:360px){
 body.mt-on #modotexto .mt-acoes{gap:4px;}
 body.mt-on #modotexto .mt-acoes button{flex:1 1 0;min-width:0;padding:4px;}
 body.mt-on #modotexto .mt-acoes [data-act="mtFalar"]{min-width:0;font-size:12px;}
 body.mt-on #modotexto .mt-acoes [data-act="mtFalar"] svg{display:none;}
}
@media(orientation:landscape) and (max-height:360px){
 html body.sb-shell .sentence{position:relative;top:auto;grid-template-columns:minmax(0,1fr) 208px;}
 html body.sb-shell .sentence .controls{grid-template-columns:repeat(4,44px);}
 html body.sb-shell .sentence .controls #sayBtn{grid-column:1 / -1;}
}
html body.sb-shell{--sb-controls-surface:#fff;--sb-controls-blur:none;}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 html body.sb-shell{--sb-controls-surface:rgba(255,255,255,.92);--sb-controls-blur:blur(16px) saturate(115%);}
}
html body.sb-shell #sbShellBar{background:transparent;box-shadow:none;isolation:isolate;}
html body.sb-shell #sbShellBar::before{content:"";position:absolute;inset:2px 8px 4px;border:1px solid #d8e0eb;border-radius:22px;background:var(--sb-controls-surface);backdrop-filter:var(--sb-controls-blur);-webkit-backdrop-filter:var(--sb-controls-blur);box-shadow:0 4px 18px #04153412;z-index:-1;pointer-events:none;}
html body.sb-shell .sb-dockhandle{background:transparent;color:#42566f;box-shadow:none;}
html body.sb-shell .sb-shellbtn{border-radius:14px;box-shadow:none;}
/* Respiro interno medido a partir da moldura, inclusive com o dock recolhido. */
html body.sb-shell #sbShellBar{padding-left:calc(20px + env(safe-area-inset-left,0px));padding-right:calc(20px + env(safe-area-inset-right,0px));padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));}
html body.sb-shell.mt-on #sbShellBar{padding-top:14px;}
html body.sb-shell .sb-dockrows{overflow:visible;}
html body.sb-shell .sb-shellbtn:focus-visible,
html body.sb-shell .sb-dockhandle:focus-visible{outline:3px solid #1250e0;outline-offset:2px;}
html body.sb-shell .sb-pathspanel{background:var(--sb-controls-surface);backdrop-filter:var(--sb-controls-blur);-webkit-backdrop-filter:var(--sb-controls-blur);border:1px solid #cbd7e5;border-radius:20px;box-shadow:0 8px 24px #04153418;right:10px!important;padding:8px;gap:6px;}
html body.sb-shell .sb-pathshead{min-height:44px;display:flex;align-items:center;padding-right:40px;}
html body.sb-shell .sb-pathstitle{color:#42566f;font-weight:700;text-transform:none;letter-spacing:0;}
html body.sb-shell .sb-pathsclose{color:#42566f;align-items:center;justify-content:center;padding:0;border-radius:12px;}
html body.sb-shell .sb-pathsclose svg{width:20px;height:20px;}
html body.sb-shell .sb-pathsclose:hover{background:#e9eef6;color:#041534;}
html body.sb-shell .sb-pathspanel .sb-pathslist{grid-template-rows:repeat(3,80px);gap:6px;flex:0 0 auto;}
html body.sb-shell .sb-pathcard{box-shadow:none;border-radius:12px;font-weight:700;}
html body.sb-shell .sb-pathpic{height:38px;}
html body.sb-shell .sb-pathsclose:focus-visible,
html body.sb-shell .sb-pathcard:focus-visible{outline:3px solid #1250e0;outline-offset:2px;}
/* Tablet horizontal: reserva espaço para a mensagem e o dock com alvo de 44 px. */
@media(min-width:761px) and (min-height:561px) and (max-height:850px){
 html body.sb-shell .sb-pathspanel .sb-pathslist{grid-template-rows:repeat(3,68px);}
 html body.sb-shell .sb-pathpic{height:30px;}
}
/* No celular em pé, três destinos na mesma faixa, acima do dock. */
@media(max-width:760px) and (orientation:portrait){
 html body.sb-shell .sb-pathspanel{left:8px!important;right:8px!important;width:auto!important;top:auto!important;bottom:calc(var(--sb-dock-h,159px) + 8px)!important;display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;align-items:center;overflow:visible;padding:8px;}
 html body.sb-shell .sb-pathspanel[hidden]{display:none;}
 html body.sb-shell .sb-pathshead{grid-column:2;grid-row:1;width:44px;padding:0;}
 html body.sb-shell .sb-pathstitle{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;}
 html body.sb-shell .sb-pathspanel .sb-pathslist{grid-column:1;grid-row:1;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:80px;gap:6px;}
 html body.sb-shell .sb-pathcard{min-width:0;padding:6px 2px;font-size:12px;gap:4px;}
 html body.sb-shell .sb-pathpic{height:32px;}
}
@media(orientation:landscape) and (max-height:560px){
 html body.sb-shell #sbShellBar{padding-top:8px;padding-bottom:calc(13px + env(safe-area-inset-bottom,0px));}
 html body.sb-shell.mt-on #sbShellBar{padding-top:12px;}
 html body.sb-shell .sb-pathspanel{left:10px!important;right:10px!important;width:auto!important;top:auto!important;bottom:calc(var(--sb-dock-h,87px) + 8px)!important;display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;align-items:center;padding:4px;overflow:visible;}
 html body.sb-shell .sb-pathspanel[hidden]{display:none;}
 html body.sb-shell .sb-pathshead{grid-column:2;grid-row:1;width:44px;padding:0;}
 html body.sb-shell .sb-pathstitle{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;}
 html body.sb-shell .sb-pathspanel .sb-pathslist{grid-column:1;grid-row:1;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:48px;gap:6px;}
 html body.sb-shell .sb-pathcard{flex-direction:row;min-height:48px;gap:8px;}
 html body.sb-shell .sb-pathpic{height:30px;}
}
html body.sb-shell.mt-on .sb-pathspanel{display:none!important;}
@media(prefers-reduced-transparency:reduce){html body.sb-shell{--sb-controls-surface:#fff;--sb-controls-blur:none;}}
@media(prefers-reduced-motion:reduce){html body.sb-shell .sb-pathspanel{transition:none;}}
@media(prefers-contrast:more){html body.sb-shell{--sb-controls-surface:#fff;--sb-controls-blur:none;}html body.sb-shell .sb-pathspanel,html body.sb-shell #sbShellBar::before{border:2px solid #041534;}}
html body.sb-shell.sb-hc{--sb-controls-surface:#fff;--sb-controls-blur:none;}
html body.sb-shell.sb-hc .sb-pathspanel{border:2px solid #041534;}

/* Leitura e comunicação: controles dentro da mensagem, sem uma faixa adicional. */
html body.sb-shell .sb-dockhandle{min-height:44px!important;}
.sb-message-zone{position:relative;min-width:0;}
html body.sb-shell .sb-message-zone .slots{padding-right:52px;}
.sb-message-expand{position:absolute;right:4px;top:4px;z-index:3;width:44px;height:44px;padding:4px;border:0;border-radius:10px;background:transparent;color:#42566f;font:28px/1 system-ui;cursor:pointer;}
.sb-message-expand:hover{background:#e9eef6;}
.sb-message-restore{position:absolute;left:8px;bottom:8px;z-index:3;min-height:44px;max-width:calc(100% - 64px);border:1px solid #1250e0;border-radius:10px;padding:8px 12px;background:#eef4ff;color:#1250e0;font:600 13px/1.3 Inter,system-ui,sans-serif;cursor:pointer;}
.sb-message-restore[hidden]{display:none!important;}
.sb-cleared-image .slots>span{visibility:hidden;}
.sb-message-expand:focus-visible,.sb-message-restore:focus-visible{outline:3px solid #1250e0;outline-offset:2px;}
html body.sb-shell #mtBuffer{padding-right:56px;}
.sb-reading-settings select{min-height:44px;border:1px solid #bdcddd;border-radius:8px;padding:8px;font:inherit;max-width:100%;}
.sb-reading-settings .optgrp{gap:8px;align-items:center;}
.sb-config-dialog #cfgAdv .sb-reading-settings label{display:flex;min-height:44px;gap:8px;align-items:center;}
.sb-reading-preview{padding:16px;border:1px solid #cbd7e5;border-radius:12px;background:#fff;font-size:calc(20px + var(--sb-reading-add,0px));margin:8px 0 0;}
html body.sb-shell.sb-reading-large .cell .lbl{font-size:calc(14px + var(--sb-reading-add));line-height:1.2;white-space:normal;overflow-wrap:anywhere;}
html body.sb-shell.sb-reading-large .cell{height:auto;}
html body.sb-shell.sb-reading-large .slots .chip span{font-size:calc(16px + var(--sb-reading-add));line-height:1.2;}
html body.sb-shell.sb-reading-large #mtBuffer{font-size:calc(clamp(22px,2.2vw,32px) + var(--sb-reading-add));}
.sb-calm{--sb-controls-surface:#fff!important;--sb-controls-blur:none!important;}
html body.sb-calm .sb-pathspanel,html body.sb-calm .sb-dockrows,html body.sb-calm .sb-shellbtn,html body.sb-calm .cell,html body.sb-calm .mt-tecla{transition:none!important;animation:none!important;}
html body.sb-calm .cell:hover{transform:none;}
button[data-sb-voice]{position:relative;padding-bottom:17px!important;}
button[data-sb-voice]::after{content:attr(data-sb-voice);position:absolute;bottom:3px;left:2px;right:2px;text-align:center;font:10px/11px Inter,system-ui,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;}
button[data-sb-speaking] svg{display:none;}
.sb-message-view{position:fixed;inset:0;z-index:14000;overflow:auto;padding:24px;background:#fff;color:#14243d;}
.sb-message-view[hidden]{display:none;}
.sb-message-view-head{display:flex;justify-content:space-between;align-items:center;gap:12px;position:sticky;top:0;background:#fff;padding-bottom:16px;}
.sb-message-view-head button{min-height:48px;padding:10px 16px;border:1px solid #bdcddd;border-radius:12px;background:#fff;color:#14243d;font:600 16px/1.2 Inter,system-ui,sans-serif;}
.sb-message-view-head h2{font:600 18px/1.3 Inter,system-ui,sans-serif;margin:0;}
.sb-message-view-content{max-width:1280px;margin:5vh auto;display:flex;flex-wrap:wrap;gap:24px;align-items:start;}
.sb-message-view-content p{width:100%;margin:0;font:600 clamp(40px,7vw,100px)/1.25 Inter,system-ui,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;}
.sb-message-view-content .chip{display:flex;flex-direction:column;align-items:center;gap:8px;width:min(240px,40vw);}
.sb-message-view-content .pill{font-size:clamp(32px,5vw,60px);padding:16px 24px;}
.sb-message-view-content .imgwrap{width:100%;height: min(240px,40vw);overflow:hidden;}
.sb-message-view-content .chip img{width:100%;height:auto;max-height:240px;object-fit:contain;}
.sb-message-view-content .chip span{font-size:clamp(24px,4vw,40px);line-height:1.2;overflow-wrap:anywhere;text-align:center;}
@media(max-width:760px){.sb-message-view{padding:16px;}.sb-message-view-head h2{font-size:15px;}.sb-message-view-head button{font-size:14px;}}
@media(orientation:landscape) and (max-height:360px){
 html body.sb-shell.mt-on #sbShellBar{padding-top:11px;padding-bottom:calc(13px + env(safe-area-inset-bottom,0px));}
 html body.sb-shell.mt-on #sbShellBar .sb-shellbtn{min-height:44px;}
 body.mt-on #modotexto{grid-template-rows:minmax(44px,1fr) 48px 94px;gap:3px;padding:4px;}
 body.mt-on #modotexto .mt-teclado{gap:2px;}
 body.mt-on #modotexto .mt-sugestao{height:48px;padding:0;}
 body.mt-on #modotexto .sb-message-expand{top:0;right:0;}
 body.mt-on #modotexto .mt-teclado:has(.mt-linhas[data-camada="simbolos"]){gap:0;}
 body.mt-on #modotexto .mt-linhas[data-camada="simbolos"] .mt-linha,
 body.mt-on #modotexto .mt-linhas[data-camada="simbolos"] .mt-tecla,
 body.mt-on #modotexto .mt-linhas[data-camada="simbolos"] .mt-esp{min-height:34px;}
}
