/*
 * Mensagens: montador (msg-*, bt-*, md-*, insp, pb-*), seletores (ep-*, pk-*)
 * e prévia igual ao Discord (dp-*, dmd-*). Celular primeiro; editor e prévia
 * lado a lado a partir de 1100 px.
 */

/* ---------- página ---------- */

.msg-page > * + * {
  margin-top: 16px;
}
.msg-page > .page-head + * {
  margin-top: 0;
}
.msg-tabs .tabs {
  margin: 0;
}
.msg-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}
.msg-editor,
.msg-side {
  min-width: 0;
}
.msg-stack > * + * {
  margin-top: 16px;
}
@media (min-width: 1100px) {
  .msg-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
  }
  .msg-side {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    max-height: calc(100dvh - var(--topbar-h) - 110px);
    overflow: auto;
    scrollbar-width: thin;
  }
  .only-narrow {
    display: none !important;
  }
}
.preview-card {
  padding: 12px;
}
.preview-card .card-head {
  padding: 4px 4px 0;
  margin-bottom: 12px;
}

/* Rodapé de envio, preso embaixo (acima da fila quando ela aparece). */
.msg-footer {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin-left: calc(var(--page-gutter) * -1);
  margin-right: calc(var(--page-gutter) * -1);
  padding: 10px var(--page-gutter) calc(10px + var(--safe-b));
  background: rgba(13, 13, 18, 0.95);
  border-top: 1px solid var(--ui-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Barra única: com o rodapé de Mensagens na tela, a barra global da fila some (o rodapé mostra a fila). */
body:has(.msg-footer) .queue-bar {
  display: none;
}
.msg-footer .save-info b {
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: 0.02em;
}
.msg-footer .save-blocked {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.show-xs {
  display: none;
}
@media (max-width: 479px) {
  .hide-xs {
    display: none;
  }
  .show-xs {
    display: inline;
  }
  .msg-footer .save-footer {
    align-items: flex-end;
  }
  .msg-footer .save-actions {
    gap: 6px;
  }
  .msg-footer .save-actions .btn {
    padding: 0 10px;
  }
}

/* ---------- blocos (árvore) ---------- */

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 12px;
}
.count-pill {
  font: 500 10px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  padding: 5px 8px;
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
}
.count-pill.over {
  color: var(--out);
  border-color: rgba(255, 122, 122, 0.4);
}
.bt {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.bt-item {
  border-radius: var(--control-radius);
  border: 1px solid transparent;
}
.bt-item.depth1 {
  margin-left: 18px;
  position: relative;
}
.bt-item.depth1::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--rule-soft);
}
.bt-item.selected {
  background: rgb(var(--accent-rgb) / 0.07);
  border-color: rgb(var(--accent-rgb) / 0.35);
}
.bt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--ui-text);
  text-align: left;
  border-radius: var(--control-radius);
}
.bt-row:hover {
  background: rgba(255, 255, 255, 0.035);
}
.bt-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 6px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.04);
}
.bt-item.selected .bt-icon {
  color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.12);
}
.bt-text {
  display: grid;
  min-width: 0;
  flex: 1;
}
.bt-type {
  font: 500 9.5px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-2);
}
.bt-sum {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bt-issue {
  flex: none;
  display: inline-flex;
}
.bt-issue.error {
  color: var(--out);
}
.bt-issue.warn {
  color: var(--warn);
}
.bt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 6px 6px;
}
.danger-icon:hover,
.danger-icon.armed {
  color: var(--out);
  background: rgba(255, 122, 122, 0.1);
}

/* ---------- inspetor ---------- */

.insp > * + * {
  margin-top: 12px;
}
.insp .field {
  margin-bottom: 0;
}
.sub-card {
  border: 1px solid var(--rule-soft);
  border-radius: var(--control-radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.012);
}
.sub-card > * + * {
  margin-top: 10px;
}
.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}
.sub-head b {
  font-size: 13px;
  font-weight: 600;
}
.inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inline-actions.wrap {
  flex-wrap: wrap;
}
.block-hint {
  display: block;
}
.field-hint.bad {
  color: var(--out);
}
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.color-input {
  width: 52px;
  padding: 4px;
  cursor: pointer;
}
.btn-emoji {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.img-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.img-thumb {
  width: 72px;
  height: 72px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--control-radius);
  border: 1px solid var(--ui-input-border);
  background: var(--ui-control-bg);
  color: var(--muted-2);
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-actions {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-items: start;
}

/* Editor de markdown. */
.md-editor {
  border: 1px solid var(--ui-input-border);
  border-radius: var(--control-radius);
  background: var(--ui-input);
  overflow: hidden;
}
.md-editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.18);
}
.md-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px;
  border-bottom: 1px solid var(--rule-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.md-toolbar::-webkit-scrollbar {
  display: none;
}
.md-tool {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ui-muted);
}
.md-tool:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ui-text);
}
.md-glyph {
  font: 700 13px/1 var(--font-sans);
}
.md-tool.i .md-glyph {
  font-style: italic;
  font-weight: 500;
  font-family: Georgia, serif;
}
.md-tool.u .md-glyph {
  text-decoration: underline;
}
.md-tool.s .md-glyph {
  text-decoration: line-through;
}
.md-sep {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--rule-soft);
  flex: none;
}
.md-area {
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 110px;
  font-size: 15px;
}
.md-area:focus {
  box-shadow: none;
}
.md-foot {
  display: flex;
  justify-content: flex-end;
  padding: 4px 10px 6px;
  border-top: 1px solid var(--rule-soft);
}
.md-count {
  font: 500 10px var(--font-mono);
  color: var(--muted-2);
  letter-spacing: 0.04em;
}
.md-count.over {
  color: var(--out);
}
@media (max-width: 900px) {
  .md-tool {
    width: 44px;
    height: 44px;
  }
  .md-area {
    font-size: 16px;
  }
}

/* ---------- destino, menções e resultado ---------- */

.target-box > * + * {
  margin-top: 12px;
}
.target-box .field {
  margin-bottom: 0;
}
.target-box .seg {
  display: flex;
  width: fit-content;
  max-width: 100%;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips:empty {
  display: none;
}
.chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--ui-btn-border);
  border-radius: 16px;
  background: var(--ui-raised);
  font-size: 13px;
}
.chip-x {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ui-muted);
}
.chip-x:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ui-text);
}
.pk-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.dd-option .pk-dot {
  margin-right: 8px;
}
.result-box {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}
.sent-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 209, 149, 0.3);
  background: rgba(79, 209, 149, 0.06);
  border-radius: var(--control-radius);
}
.sent-icon {
  color: var(--in);
  display: inline-flex;
}
.sent-text {
  display: grid;
  flex: 1;
  min-width: 140px;
}
.sent-text b {
  font-size: 13px;
}

/* ---------- problemas ---------- */

.pb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.pb-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--rule-soft);
  border-radius: var(--control-radius);
  background: none;
  color: var(--ui-text);
  font-size: 13px;
  text-align: left;
  line-height: 1.4;
}
.pb-item:disabled {
  opacity: 1;
  cursor: default;
}
.pb-item:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.035);
}
.pb-item .ico {
  flex: none;
  margin-top: 1px;
}
.pb-item.error .ico {
  color: var(--out);
}
.pb-item.warn .ico {
  color: var(--warn);
}
.pb-item > span:nth-of-type(1) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pb-go {
  flex: none;
  font: 500 9.5px/1.8 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.pb-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--in);
  font-size: 13px;
}

/* ---------- JSON, modelos e rascunhos ---------- */

.json-area {
  font: 12.5px/1.5 var(--font-mono);
  min-height: 220px;
  white-space: pre;
  overflow: auto;
}
.tpl-list {
  display: grid;
  gap: 8px;
}
.tpl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-text);
  text-align: left;
}
.tpl-item:hover {
  border-color: rgb(var(--accent-rgb) / 0.5);
}
.tpl-text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.tpl-text b {
  font-size: 14px;
  font-weight: 600;
}
.draft-head {
  margin: 18px 0 8px;
}
.draft-items {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule-soft);
  border-radius: var(--control-radius);
}
.draft-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}
.draft-item + .draft-item {
  border-top: 1px solid var(--rule-soft);
}
.draft-open {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--ui-text);
  text-align: left;
}
.draft-open:hover b {
  color: var(--accent-hot);
}
.draft-open b {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* ---------- seletores ---------- */

.picker-pop,
.picker-sheet {
  overflow: hidden;
}
.picker-pop .dd-list,
.picker-sheet .dd-list {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.ep {
  overflow: auto;
  min-height: 0;
  flex: 1;
  padding: 0 8px 10px;
}
.ep-label {
  font: 500 9.5px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-2);
  padding: 8px 2px 6px;
}
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 2px;
}
.ep-item {
  display: grid;
  place-items: center;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: none;
}
.ep-item:hover,
.ep-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}
.ep-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
@media (max-width: 639px) {
  .ep-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  }
  .ep-item {
    height: 44px;
  }
}

/* ---------- prévia do Discord ---------- */

.dp {
  --dp-bg: #313338;
  --dp-text: #dbdee1;
  --dp-muted: #949ba4;
  background: var(--dp-bg);
  color: var(--dp-text);
  border-radius: var(--control-radius);
  padding: 16px 16px 18px 12px;
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.375;
  overflow-wrap: anywhere;
}
.dp-msg {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
}
.dp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e1f22;
}
.dp-avatar.empty {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
}
.dp-main {
  min-width: 0;
}
.dp-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 6px;
  margin-bottom: 4px;
}
.dp-name {
  font-weight: 600;
  color: #f2f3f5;
}
.dp-app {
  align-self: center;
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 4px;
  border-radius: 3px;
  background: #5865f2;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dp-time {
  font-size: 12px;
  color: var(--dp-muted);
}
.dp-components {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.dp-components > * {
  width: 100%;
  max-width: 600px;
}
.dp-empty {
  color: var(--dp-muted);
  font-size: 14px;
  padding: 12px 0;
}
.dp [data-bid] {
  cursor: pointer;
  border-radius: 4px;
}
.dp [data-bid]:hover {
  outline: 1px dashed rgba(255, 255, 255, 0.22);
  outline-offset: 2px;
}
.dp .dp-selected,
.dp .dp-selected:hover {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Container. */
.dp-container {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}
.dp-container.has-accent {
  border-left: 4px solid var(--dp-accent);
  padding-left: 14px;
}
.dp-container.is-spoiler:not(.revealed) > :not(.dp-spoiler-tag),
.dp-media.is-spoiler:not(.revealed) img {
  filter: blur(36px) brightness(0.7);
}
.dp-spoiler-tag {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.revealed > .dp-spoiler-tag {
  display: none;
}

/* Texto. */
.dp-text {
  white-space: pre-wrap;
  min-width: 0;
}
.dmd-p + *,
.dmd-h + *,
.dmd-sub + *,
.dmd-list + *,
.dmd-quote + *,
.dmd-pre + * {
  margin-top: 0;
}
.dmd-h {
  margin: 8px 0 8px;
  color: #f2f3f5;
  font-weight: 700;
  line-height: 1.375;
  letter-spacing: 0;
}
.dmd-h:first-child {
  margin-top: 0;
}
.dmd-h1 {
  font-size: 24px;
}
.dmd-h2 {
  font-size: 20px;
}
.dmd-h3 {
  font-size: 16px;
}
.dmd-sub {
  display: block;
  font-size: 13px;
  color: var(--dp-muted);
  line-height: 1.3;
}
.dmd-sub .dmd-emoji {
  width: 1.2em;
  height: 1.2em;
}
.dmd-list {
  margin: 4px 0;
  padding-left: 22px;
  white-space: normal;
}
.dmd-list li {
  margin: 2px 0;
}
.dmd-quote {
  display: flex;
  gap: 0;
  white-space: pre-wrap;
}
.dmd-quote-bar {
  width: 4px;
  border-radius: 4px;
  background: #4e5058;
  flex: none;
}
.dmd-quote blockquote {
  margin: 0;
  padding: 0 8px 0 12px;
  min-width: 0;
}
.dmd-code {
  padding: 0.1em 0.25em;
  border-radius: 4px;
  background: #1e1f22;
  font:
    0.85em/1.4 "gg mono",
    Consolas,
    "Andale Mono",
    monospace;
}
.dmd-pre {
  margin: 4px 0;
  padding: 8px 10px;
  border: 1px solid #1e1f22;
  border-radius: 4px;
  background: #2b2d31;
  font:
    13px/1.45 Consolas,
    "Andale Mono",
    monospace;
  white-space: pre-wrap;
}
.dp-container .dmd-pre {
  background: #1e1f22;
}
.dmd-link {
  color: #00a8fc;
  text-decoration: none;
}
.dmd-link:hover {
  text-decoration: underline;
}
.dmd-mention {
  padding: 0 2px;
  border-radius: 3px;
  color: #c9cdfb;
  background: rgba(88, 101, 242, 0.3);
  font-weight: 500;
}
.dmd-time {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
}
.dmd-spoiler {
  border-radius: 3px;
  background: #1e1f22;
  color: transparent;
  cursor: pointer;
}
.dmd-spoiler * {
  visibility: hidden;
}
.dmd-spoiler.revealed {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  cursor: auto;
}
.dmd-spoiler.revealed * {
  visibility: visible;
}
.dmd-emoji {
  width: 1.375em;
  height: 1.375em;
  vertical-align: bottom;
  object-fit: contain;
}
.dmd-emoji.jumbo {
  width: 48px;
  height: 48px;
}

/* Galeria: até 10 imagens em grade de 6 colunas. */
.dp-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
}
.dp-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background: #1e1f22;
  grid-column: span 2;
  aspect-ratio: 1;
}
.dp-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dp-media-note {
  padding: 16px;
  color: var(--dp-muted);
  font-size: 12px;
  text-align: center;
}
.dp-gallery.n1 .dp-media {
  grid-column: span 6;
  aspect-ratio: auto;
}
.dp-gallery.n1 .dp-media img {
  height: auto;
  max-height: 420px;
  object-fit: contain;
}
.dp-gallery.n1 .dp-media-note {
  padding: 48px 16px;
}
.dp-gallery.n2 .dp-media,
.dp-gallery.n4 .dp-media,
.dp-gallery.n5 .g1,
.dp-gallery.n5 .g2,
.dp-gallery.n8 .g1,
.dp-gallery.n8 .g2 {
  grid-column: span 3;
}
.dp-gallery.n3 {
  grid-template-rows: repeat(2, auto);
}
.dp-gallery.n3 .g1 {
  grid-column: span 4;
  grid-row: span 2;
}
.dp-gallery.n3 .g2,
.dp-gallery.n3 .g3 {
  grid-column: span 2;
}
.dp-gallery.n7 .g1,
.dp-gallery.n10 .g1 {
  grid-column: span 6;
  aspect-ratio: 16 / 9;
}

/* Seção. */
.dp-section {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.dp-section-texts {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}
.dp-section-acc {
  flex: none;
}
.dp-section-acc.btn {
  align-self: center;
}
.dp-thumb {
  width: 85px;
  height: 85px;
  aspect-ratio: 1;
  border-radius: 8px;
  grid-column: auto;
}
.dp-thumb .dp-media-note {
  padding: 6px;
  font-size: 10px;
}

/* Separador. */
.dp-sep {
  height: 0;
  margin: 0;
}
.dp-sep.sp1 {
  padding: 2px 0;
}
.dp-sep.sp2 {
  padding: 8px 0;
}
.dp-sep.line {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  background-clip: content-box;
}

/* Botões. */
.dp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 2px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}
.dp-btn.s1 {
  background: #5865f2;
}
.dp-btn.s2 {
  background: #4e5058;
}
.dp-btn.s3 {
  background: #248046;
}
.dp-btn.s4 {
  background: #da373c;
}
.dp-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dp-btn-emoji {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.dp-unknown {
  color: var(--dp-muted);
  font-size: 12px;
}
@media (max-width: 479px) {
  .dp {
    padding: 12px 10px 14px 8px;
    font-size: 14.5px;
  }
  .dp-msg {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }
  .dp-avatar {
    width: 32px;
    height: 32px;
  }
  .dp-container {
    padding: 12px;
  }
  .dp-container.has-accent {
    padding-left: 10px;
  }
}

/* Avisos acima do rodapé de envio (e da fila, quando ela aparece). */
body:has(.msg-footer) #toasts {
  bottom: calc(84px + var(--safe-b));
}
body.has-queue:has(.msg-footer) #toasts {
  bottom: calc(84px + var(--safe-b));
}

/* Celular: ações do topo quebram linha; rodapé com contadores em cima e botões embaixo. */
.msg-page .page-actions {
  flex-wrap: wrap;
}
@media (max-width: 639px) {
  .msg-footer .save-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
  .msg-footer .save-info {
    flex: 1 1 100%;
  }
  .msg-footer .save-actions {
    flex: 1 1 100%;
  }
  .msg-footer .save-actions {
    flex-wrap: wrap;
  }
  .msg-footer .save-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }
  /* Com a fila no rodapé (barra única), "Ver prévia" fica só com o ícone para caber numa linha. */
  .msg-footer .save-actions:has(.msg-queue-btn) .only-narrow .btn-label {
    display: none;
  }
  .msg-footer .save-actions:has(.msg-queue-btn) .only-narrow {
    flex: 0 0 44px;
  }
}
@media (min-width: 901px) {
  .md-toolbar {
    flex-wrap: wrap;
  }
}
