:is(#compose,#thread-compose) .mort-dictation-editor {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding-inline-start: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
}

:is(#compose,#thread-compose) .mort-dictation-editor:focus-within {
  border-color: var(--text);
}

:is(#compose,#thread-compose) .mort-dictation-editor :is(#message,#thread-message) {
  appearance: none;
  order: initial;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  height: 44px;
  margin: 0;
  padding: 10px 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  resize: none;
  font-size: 16px;
}

:is(#compose,#thread-compose) .mort-dictation-editor :is(#message,#thread-message):focus {
  outline: 0;
}

:is(#compose,#thread-compose) .mort-dictation-button {
  align-self: center;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
}

:is(#compose,#thread-compose) .mort-dictation-button:hover,
:is(#compose,#thread-compose) .mort-dictation-button[aria-pressed="true"] {
  background: var(--wash);
}

:is(#compose,#thread-compose) .mort-dictation-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

:is(#compose,#thread-compose) .mort-dictation-button svg { width: 21px; height: 21px }

:is(#compose,#thread-compose).mort-dictation-ready button[type="submit"] {
  border-radius: 999px;
}

#active-thread.message-thread { min-height: 0; }

#active-thread .thread-header { margin-bottom: 10px; }

#active-thread .thread-log {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(38dvh, 30rem);
  align-content: start;
  gap: 6px;
}

#active-thread .thread-log .bubble {
  align-self: start;
  justify-self: start;
  max-width: min(88%, 36rem);
  min-width: 0;
  padding: 7px 11px;
  border-radius: 15px 15px 15px 5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#active-thread .thread-log .bubble.user {
  justify-self: end;
  border-radius: 15px 15px 5px 15px;
}

#active-thread .thread-log .bubble .who { margin-bottom: 2px; }

#active-thread .thread-reply {
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}

#thread-compose.mort-dictation-ready > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#thread-compose.mort-dictation-ready .thread-compose { gap: 8px; }

#thread-compose.mort-dictation-ready button[type="submit"] {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
}

#thread-compose button[type="submit"] svg { width: 21px; height: 21px; }
#active-thread #thread-delivery { margin-top: 6px; }

.portal-chat-dock .portal-chat-popover {
  width: min(380px, calc(100% - 2 * var(--portal-chat-gutter)));
}

.embedded-mort-chat #compose.mort-dictation-ready {
  padding: 8px 9px 9px;
  border-top: 0;
}

.embedded-mort-chat #compose .embedded-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 4px 2px;
}

.embedded-mort-chat #compose .embedded-chat-entry { min-width: 0; }
.embedded-mort-chat #compose .embedded-chat-help { margin: 0; font-size: 11px; color: var(--muted); }

.embedded-mort-chat #compose .embedded-chat-header .embedded-chat-hide {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
}

.embedded-mort-chat #compose .embedded-chat-header .embedded-chat-hide:hover { background: var(--wash); }
.embedded-mort-chat #compose .embedded-chat-header .embedded-chat-hide svg { width: 21px; height: 21px; }

.embedded-mort-chat #compose.mort-dictation-ready .compose-row {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 6px;
}

.embedded-mort-chat #compose .compose-row > .embedded-chat-attach { border-radius: 50%; }

:is(#compose,#thread-compose) .mort-attachment-options:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 4px;
  border-radius: 16px;
}

:is(#compose,#thread-compose) .mort-attachment-options .btn:not([hidden]) {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 9px;
  padding-inline: 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: start;
  font-size: 14px;
}

:is(#compose,#thread-compose) .mort-attachment-options .btn:hover,
:is(#compose,#thread-compose) .mort-attachment-options .btn:focus-visible {
  background: var(--wash);
}

:is(#compose,#thread-compose) .mort-attachment-options .btn svg { width: 20px; height: 20px; flex: none }

:is(#compose,#thread-compose) .mort-dictation-status {
  grid-column: 1 / -1;
  margin: 3px 0 1px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

:is(#compose,#thread-compose) .mort-dictation-status:empty { display: none }

