.communication-dialog {
  color: var(--text);
  background: var(--panel, var(--bg));
  border: 1px solid var(--line, currentColor);
  border-radius: 16px;
  box-sizing: border-box;
  width: min(720px, calc(100% - 24px));
  max-height: calc(100dvh - 36px);
  padding: 16px;
  overflow: auto;
}
.communication-dialog::backdrop { background: #0009; }
.communication-dialog h2 { margin: 0 0 10px; }
.communication-form { display: grid; gap: 8px; margin-block: 12px; }
.communication-form textarea { min-height: 68px; resize: vertical; }
.communication-form :is(input, select, textarea) { min-width: 0; width: 100%; }
.phrase-import-preview { max-block-size: 15rem; overflow: auto; overflow-wrap: anywhere; }
.communication-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 6px; }
.communication-actions button, .communication-dialog button, #switchScanBar button { min-height: 44px; }
.communication-phrase {
  border-block-start: 1px solid var(--line, currentColor);
  padding-block: 8px 12px;
  overflow-wrap: anywhere;
}
.communication-phrase p { margin: 0 0 8px; white-space: pre-wrap; }
.communication-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.communication-check input { width: 22px; height: 22px; flex: 0 0 22px; }
.communication-model-words { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 104px), 1fr)); gap: 6px; }
.hidden-board-slot { visibility: hidden; pointer-events: none; }
.composer-extra-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  margin-top: 5px;
}
#composer { --composer-button-size: 15px; }
body.dyslexia #composer { --composer-button-size: calc(15px * var(--reading-scale)); }
#bottomControls :is(#openBoardDialog, #layout) > .composer-button-icon,
#bottomControls #openSettings > .composer-button-label { display: none; }
#composer :is(#composerActions, .composer-extra-actions) button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 48px;
  padding: 4px 3px;
  border-radius: 12px;
  font-family: inherit;
  font-size: var(--composer-button-size);
  font-weight: 650;
  line-height: var(--reading-lines, 1.25);
  text-align: center;
}
#composer #composerActions>#bottomControls button { flex-direction: column; }
#composer #composerActions #openSettings { border: 1px solid var(--border); background: var(--surface); }
#composer :is(#composerActions, .composer-extra-actions) .composer-button-icon {
  display: block;
  flex: 0 0 auto;
  font-family: system-ui, 'Segoe UI Emoji', sans-serif;
  font-size: 17px;
  line-height: 1;
}
#composer :is(#composerActions, .composer-extra-actions) .composer-button-label {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
body[data-composer-button-style=words] #composer :is(#composerActions, .composer-extra-actions) .composer-button-icon { display: none; }
body[data-composer-button-style=icons] #composer :is(#composerActions, .composer-extra-actions) .composer-button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body[data-composer-button-style=icons] #composer :is(#composerActions, .composer-extra-actions) .composer-button-icon { font-size: 22px; }
body[data-composer-button-style=icons] #composer #bottomControls :is(#openBoardDialog, #layout) > .composer-button-icon { display: block; }
@media (max-width: 540px) {
  #composer { --composer-button-size: 12px; }
  body.dyslexia #composer { --composer-button-size: calc(12px * var(--reading-scale)); }
}
@media (max-width: 360px) { .composer-extra-actions { gap: 2px; } }
#switchScanBar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  color: var(--text);
  background: var(--panel, var(--bg));
}
#switchScanBar[hidden] { display: none; }
#switchScanStatus { min-width: 0; overflow-wrap: anywhere; }
.switch-scan-highlight { outline: 4px solid #ffcb27 !important; outline-offset: -4px; box-shadow: inset 0 0 0 6px #161616 !important; }

body:not(.aac-message-tools-enabled) [data-optional-message-tool] {
  display: none !important;
}
