/* Base legada do app (antigo styles.css), parte 29 (#533) · E-mail: escrita e anexos. Ordem de carga: scripts/helpers/styles-source.js. */

.mail-thread-message-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--mail-line);
}
.mail-thread-message-tabs button {
  min-width: 140px;
  padding: 7px 9px;
  border: 1px solid rgb(var(--mix-fx-line, 220 228 238));
  border-radius: 8px;
  background: rgb(var(--mix-fx-paper, 255 255 255));
  color: rgb(var(--mix-fx-body, 85 100 123));
  cursor: pointer;
  text-align: left;
}
.mail-thread-message-tabs button.active { border-color: #8eb8e8; background: var(--mail-blue-soft); color: var(--mail-blue-dark); }
.mail-thread-message-tabs strong,
.mail-thread-message-tabs small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-thread-message-tabs strong { font-size: 10.5px; }
.mail-thread-message-tabs small { margin-top: 2px; font-size: 9px; }

.mail-message-meta {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 18px 22px 15px;
}
.mail-message-meta strong { display: block; color: var(--mail-ink); font-size: 12.5px; }
.mail-message-meta p { margin: 2px 0 0; overflow: hidden; color: var(--mail-muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.mail-message-meta time { color: var(--mail-muted); font-size: 9.5px; white-space: nowrap; }

.mail-message-content {
  display: block;
  min-height: 220px;
  padding: 9px 24px 30px 75px;
  color: rgb(var(--mix-fx-ink, 38 54 77));
  font-size: 12.5px;
  line-height: 1.65;
}
.mail-message-content pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.mail-html-frame {
  display: block;
  width: 100%;
  min-height: 180px;
  border: 0;
  background: rgb(var(--mix-fx-paper, 255 255 255));
}

.mail-content-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 8px 10px;
  border: 1px solid rgb(var(--mix-fx-line, 219 229 240));
  border-radius: 8px;
  background: rgb(var(--mix-fx-paper, 247 250 255));
  color: var(--mail-muted);
  font-size: 10px;
}

.mail-content-controls > span,
.mail-content-controls > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mail-content-controls svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--mail-blue);
  stroke-width: 1.8;
}

.mail-content-controls button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgb(var(--mix-fx-line, 201 216 232));
  border-radius: 6px;
  background: rgb(var(--mix-fx-paper, 255 255 255));
  color: var(--mail-blue-dark);
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 750;
  white-space: nowrap;
}

.mail-content-controls button:hover { border-color: #8eb8e8; background: rgb(var(--mix-fx-paper, 237 245 255)); }

.mail-message-view-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
  margin: -5px 0 7px;
}
.mail-message-view-actions button {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--mail-blue-dark);
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 700;
}
.mail-message-view-actions button:hover { text-decoration: underline; }

.mail-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 28px;
  padding-top: 15px;
  border-top: 1px solid var(--mail-line);
}
.mail-attachments > strong { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; color: var(--mail-ink); font-size: 11px; }
.mail-attachments a {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 2px 7px;
  padding: 10px;
  border: 1px solid var(--mail-line);
  border-radius: 8px;
  color: var(--mail-ink);
  text-decoration: none;
}
.mail-attachments a:hover { border-color: rgb(var(--mix-fx-line, 159 194 233)); background: rgb(var(--mix-fx-paper, 247 250 255)); }
.mail-attachments svg { grid-row: 1 / 3; align-self: center; width: 17px; height: 17px; fill: none; stroke: var(--mail-blue); stroke-width: 1.8; }
.mail-attachments a span { overflow: hidden; font-size: 10.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mail-attachments a small { color: var(--mail-muted); font-size: 9px; }

.mail-quick-reply {
  display: flex;
  gap: 8px;
  padding: 0 24px 26px 75px;
}
.mail-quick-reply button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgb(var(--mix-fx-line, 205 217 231));
  border-radius: 8px;
  background: rgb(var(--mix-fx-paper, 255 255 255));
  color: rgb(var(--mix-fx-ink-blue, 63 80 105));
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
}
.mail-quick-reply button:hover { border-color: #8eb8e8; color: var(--mail-blue-dark); }
.mail-quick-reply svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.mail-compose-layer {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 22px 28px;
  background: rgb(14 34 56 / 25%);
  backdrop-filter: blur(3px);
}

.mail-compose-form {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1280px, 80vw);
  height: min(770px, calc(100dvh - 70px));
  max-height: none;
  overflow: hidden;
  min-width: min(520px, calc(100vw - 32px));
  min-height: min(420px, calc(100dvh - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  resize: none;
  border: 1px solid rgb(var(--mix-fx-line, 205 216 230));
  border-radius: 13px;
  background: rgb(var(--mix-fx-paper, 255 255 255));
  color: var(--mail-ink);
  box-shadow: 0 25px 80px rgb(8 31 61 / 30%);
}

.mail-compose-resize-handle {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: linear-gradient(135deg, transparent 0 52%, #8fa1b7 53% 58%, transparent 59% 67%, #8fa1b7 68% 73%, transparent 74%);
  cursor: nwse-resize;
  touch-action: none;
}

.mail-compose-form > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 0 13px 0 17px;
  background: #19324f;
  color: #fff;
}
.mail-compose-form > header > div { display: flex; align-items: center; gap: 10px; }
.mail-compose-form > header > div > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: rgb(var(--mix-fx-paper, 255 255 255) / 10%); }
.mail-compose-form > header svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mail-compose-form > header strong,
.mail-compose-form > header small { display: block; }
.mail-compose-form > header strong { font-size: 13px; }
.mail-compose-form > header small { margin-top: 1px; color: rgb(255 255 255 / 66%); font-size: 9.5px; }
.mail-compose-form > header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
}
.mail-compose-form > header button:hover { background: rgb(var(--mix-fx-paper, 255 255 255) / 10%); }

.mail-compose-envelope {
  flex: 0 0 auto;
  padding: 9px 18px 0;
  border-bottom: 1px solid var(--mail-line);
}
.mail-compose-envelope label {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid rgb(var(--mix-fx-line, 232 237 243));
}
.mail-compose-envelope label > span { color: rgb(var(--mix-fx-body, 101 117 140)); font-size: 10.5px; font-weight: 750; }
.mail-compose-envelope label > .mix-input {
  width: 100%;
  min-width: 0;
}
.mail-compose-envelope input[name="to"] { padding-right: 170px; }
.mail-compose-envelope label > em {
  position: absolute;
  right: 0;
  color: rgb(var(--mix-fx-muted, 154 165 180));
  font-size: 8.5px;
  font-style: normal;
  pointer-events: none;
}
.mail-compose-copy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.mail-compose-copy label { grid-template-columns: 62px minmax(0, 1fr); }
.mail-compose-subject { border-bottom: 0 !important; }
.mail-compose-subject input { font-weight: 750 !important; }

.mail-compose-editor-wrap {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.mail-format-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-height: 39px;
  padding: 0 17px;
  border-bottom: 1px solid rgb(var(--mix-fx-line, 237 240 244));
  background: rgb(var(--mix-fx-paper, 251 252 254));
}
.mail-format-toolbar button {
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgb(var(--mix-fx-body, 88 103 125));
  cursor: pointer;
  font-size: 10px;
}
.mail-format-toolbar button:hover { background: rgb(var(--mix-fx-paper, 234 241 249)); color: var(--mail-blue-dark); }
.mail-format-toolbar .mail-format-font { width: 132px; color: rgb(var(--mix-fx-body, 88 103 125)); cursor: pointer; }
.mail-format-toolbar > i { width: 1px; height: 18px; margin: 0 5px; background: rgb(var(--mix-fx-paper, 221 228 236)); }
.mail-format-toolbar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mail-compose-editor-canvas {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px;
  overflow-y: auto;
}
.mail-compose-editor {
  min-height: 72px;
  color: rgb(var(--mix-fx-ink, 36 53 77));
  font-size: 13px;
  line-height: 1.65;
  outline: none;
}
.mail-compose-editor:empty::before { content: attr(data-placeholder); color: rgb(var(--mix-fx-muted, 164 175 188)); pointer-events: none; }

.mail-compose-inline-signature {
  margin-top: 14px;
  min-width: 0;
}
.mail-compose-inline-signature .mail-signature-frame {
  width: 100%;
  max-width: 100%;
  border: 0;
  background: transparent;
}

.mail-compose-signature {
  flex: 0 0 auto;
  max-height: 210px;
  padding: 9px 20px 12px;
  overflow: auto;
  border-top: 1px solid rgb(var(--mix-fx-line, 237 240 244));
  background: rgb(var(--mix-fx-paper, 251 252 254));
}
.mail-compose-signature > span {
  display: block;
  margin-bottom: 7px;
  color: rgb(var(--mix-fx-muted, 123 137 156));
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.mail-signature-frame {
  display: block;
  width: 100%;
  min-height: 90px;
  max-height: 170px;
  border: 0;
  background: transparent;
}

.mail-compose-attachment-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  max-height: 76px;
  padding: 0 18px;
  overflow: auto;
}
.mail-compose-attachment-list:not(:empty) { padding-top: 8px; border-top: 1px solid rgb(var(--mix-fx-line, 237 240 244)); }
.mail-compose-attachment-list span {
  display: grid;
  grid-template-columns: 16px auto;
  gap: 0 6px;
  padding: 6px 9px;
  border: 1px solid rgb(var(--mix-fx-line, 220 228 238));
  border-radius: 7px;
  background: rgb(var(--mix-fx-paper, 248 250 252));
}
.mail-compose-attachment-list svg { grid-row: 1 / 3; align-self: center; width: 14px; height: 14px; fill: none; stroke: var(--mail-blue); stroke-width: 1.8; }
.mail-compose-attachment-list b { max-width: 160px; overflow: hidden; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.mail-compose-attachment-list small { color: var(--mail-muted); font-size: 8px; }

.mail-compose-form > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 61px;
  padding: 0 18px;
  border-top: 1px solid var(--mail-line);
  background: rgb(var(--mix-fx-paper, 255 255 255));
}
.mail-compose-form > footer > div,
.mail-compose-send { display: flex; align-items: center; gap: 7px; }
.mail-send-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 37px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--mail-blue);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.mail-send-button:hover { background: var(--mail-blue-dark); }
.mail-send-button:disabled { opacity: .6; cursor: wait; }
.mail-send-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mail-send-button kbd { padding-left: 8px; border-left: 1px solid rgb(var(--mix-fx-line, 255 255 255) / 28%); color: rgb(255 255 255 / 70%); font: 8px inherit; }
.mail-attach-button,
.mail-discard-compose,
.mail-save-draft {
  display: grid;
  place-items: center;
  min-height: 33px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgb(var(--mix-fx-body, 95 110 131));
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.mail-attach-button:hover,
.mail-discard-compose:hover,
.mail-save-draft:hover { background: rgb(var(--mix-fx-paper, 237 242 247)); color: var(--mail-blue-dark); }
.mail-attach-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mail-attach-button svg,
.mail-discard-compose svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }

@media (max-width: 1180px) {
  .mail-client-shell { grid-template-columns: 190px minmax(300px, var(--mail-list-width, 340px)) 7px minmax(340px, 1fr); }
  .mail-message-content { padding-left: 24px; }
  .mail-quick-reply { padding-left: 24px; }
}

@media (max-width: 960px) {
  .mail-client-shell { grid-template-columns: 190px minmax(310px, 1fr); }
  .mail-list-pane,
  .mail-reading-pane { grid-column: 2; }
  .mail-pane-resizer { display: none; }
  .mail-reading-pane { display: none; }
  .mail-client-shell:has(.mail-reading-pane .mail-reading-header) .mail-list-pane { display: none; }
  .mail-client-shell:has(.mail-reading-pane .mail-reading-header) .mail-reading-pane { display: flex; }
  .mail-client-shell:has(.mail-reading-pane .mail-reading-header) { grid-template-columns: 190px minmax(0, 1fr); }
  .mail-mobile-back { display: grid; }
  .mail-reading-actions .mail-close-action { display: none; }
}

@media (max-width: 680px) {
  .mail-client-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - 190px);
    min-height: 520px;
    border-radius: 10px;
  }
  .mail-folder-panel { display: none; }
  .mail-list-pane,
  .mail-reading-pane { grid-column: 1; }
  .mail-client-shell:has(.mail-reading-pane .mail-reading-header) { grid-template-columns: 1fr; }
  .mail-list-header { padding: 0 10px; }
  .mail-list-tools > span { display: none; }
  .mail-message-meta { grid-template-columns: 38px minmax(0, 1fr); padding-inline: 15px; }
  .mail-message-meta time { grid-column: 2; }
  .mail-sender-avatar { width: 38px; height: 38px; }
  .mail-message-content,
  .mail-quick-reply { padding-left: 15px; padding-right: 15px; }
  .mail-content-controls { align-items: flex-start; flex-direction: column; }
  .mail-content-controls > div { flex-wrap: wrap; }
  .mail-compose-layer { padding: 0; }
  .mail-compose-form { width: 100vw; height: 100dvh; min-width: 0; min-height: 0; border: 0; border-radius: 0; resize: none; }
  .mail-compose-copy { grid-template-columns: 1fr; gap: 0; }
  .mail-compose-envelope label > em { display: none; }
  .mail-format-toolbar button:nth-of-type(4),
  .mail-format-toolbar button:nth-of-type(5) { display: none; }
  .mail-send-button kbd { display: none; }
}
