/* Estratto da static/css/app.css. Dipende da variabili --border, --surface, --muted, --text, --danger, --topbar-h, --tab-h. */

.sx-mail-shell {
  margin: -1.25rem -1.5rem -2rem;
  height: calc(100dvh - var(--topbar-h, 64px));
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.sx-mail {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sx-mail-nav-w, 220px) 6px var(--sx-mail-list-w, 320px) 6px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  --sx-mail-nav-w: 220px;
  --sx-mail-list-w: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sx-mail__toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-height: 52px;
  padding: 0.4rem 0.7rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.sx-mail__toolbar-filters {
  flex: 1 1 280px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  gap: 0.3rem;
}
.sx-mail__toolbar-filters .sx-mail__filter {
  min-height: 28px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem;
  white-space: nowrap;
}
.sx-mail__toolbar form { margin: 0; }
.sx-mail__toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding-right: 0.4rem;
  border-right: 1px solid var(--border);
}
.sx-mail__toolbar-new {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
}
.sx-mail__toolbar-new .sx-icon { width: 0.95rem; height: 0.95rem; color: #fff; }
.sx-mail__toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.4rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
}
.sx-mail__toolbar-btn:hover:not(:disabled) { background: #f1f5f9; }
.sx-mail__toolbar-btn:disabled { opacity: 0.35; cursor: default; }
.sx-mail__toolbar-btn.is-on { color: #b45309; background: #fff7ed; }
.sx-mail__toolbar-btn .sx-icon { width: 1.05rem; height: 1.05rem; }
.sx-mail__toolbar-search { flex: 1 1 180px; max-width: 280px; margin-left: auto !important; }
.sx-mail__splitter {
  width: 6px;
  margin: 0 -1px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 2;
  touch-action: none;
}
.sx-mail__splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: transparent;
  transition: background 0.15s ease;
}
.sx-mail__splitter:hover::after,
.sx-mail__splitter:focus-visible::after,
body.sx-mail-resizing .sx-mail__splitter::after {
  background: var(--accent, #0d9488);
}
body.sx-mail-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
.sx-mail__firma {
  margin: 0 0.75rem 0.65rem;
  font-size: 0.82rem;
}
.sx-mail__firma > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}
.sx-mail__firma > summary::-webkit-details-marker { display: none; }
.sx-mail__firma-form {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.sx-mail__firma-form textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  background: #fff;
}
.sx-mail-row__tag--trk-risposto {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}
.sx-mail-row__tag--trk-in_corso {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}
.sx-mail-row__tag--trk-chiusa {
  background: rgba(100, 116, 139, 0.16);
  color: #475569;
}
.sx-mail__nav {
  background: #f4f6f8;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}
.sx-mail__compose-cta {
  padding: 0.85rem 0.85rem 0.35rem;
}
.sx-mail__compose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: #2563eb;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.12s ease;
}
.sx-mail__compose-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.sx-mail__compose-btn-icon {
  display: inline-flex;
}
.sx-mail__compose-btn-icon .sx-icon { width: 1.05rem; height: 1.05rem; color: #fff; }
.sx-mail__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: #475569;
  text-decoration: none !important;
  cursor: pointer;
  padding: 0;
}
.sx-mail__icon-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.sx-mail__icon-btn--light {
  background: #fff;
  color: #64748b;
}
.sx-mail__icon-btn .sx-icon { width: 1.1rem; height: 1.1rem; }
.sx-mail__nav-section {
  padding: 0.55rem 0.55rem 0.25rem;
}
.sx-mail__nav-section--foot {
  margin-top: auto;
  padding-bottom: 0.85rem;
  border-top: 1px solid var(--border);
}
.sx-mail__nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.35rem 0.45rem;
}
.sx-mail__nav-fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  gap: 0.15rem;
}
.sx-mail__nav-fold > summary::-webkit-details-marker { display: none; }
.sx-mail__nav-fold > summary::before {
  content: "▸";
  display: inline-block;
  width: 0.8rem;
  margin-right: 0.15rem;
  text-transform: none;
  color: #94a3b8;
  flex: 0 0 auto;
}
.sx-mail__nav-fold[open] > summary::before { content: "▾"; }
.sx-mail__nav-fold > summary .sx-mail__icon-btn { margin-left: auto; }
.sx-mail__nav-fold-current {
  margin-left: auto;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.72rem;
  color: #64748b;
}
.sx-mail__folder-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.sx-mail__folder-row .sx-mail__folder { flex: 1 1 auto; min-width: 0; }
.sx-mail__pin-form { margin: 0; flex: 0 0 auto; }
.sx-mail__pin {
  width: 1.45rem;
  height: 1.45rem;
  min-height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}
.sx-mail__pin:hover,
.sx-mail__pin.is-on { color: #0f766e; background: #f0fdfa; }
.sx-mail__pin .sx-icon { width: 0.85rem; height: 0.85rem; }
.sx-mail__nav-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.sx-mail__nav-sublabel {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.15rem 0.45rem 0.2rem;
}
.sx-mail__nav-sublabel--next {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.sx-mail__folders-refresh {
  margin: 0;
  padding: 0;
}
.sx-mail__icon-btn--xs {
  width: 1.65rem;
  height: 1.65rem;
  min-height: 1.65rem;
  padding: 0;
}
.sx-mail__icon-btn--xs .sx-icon {
  width: 0.95rem;
  height: 0.95rem;
}
.sx-mail__accounts,
.sx-mail__folders {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sx-mail__account,
.sx-mail__folder {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  color: #334155;
  text-decoration: none !important;
  min-height: 40px;
  position: relative;
  font-size: 0.88rem;
}
.sx-mail__badge {
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff !important;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sx-mail__account:hover,
.sx-mail__folder:hover {
  background: #e8eef5;
  color: #0f172a;
}
.sx-mail__account.is-active,
.sx-mail__folder.is-active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}
.sx-mail__account-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.sx-mail__account-icon .sx-icon { width: 1rem; height: 1rem; }
.sx-mail__account-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sx-mail__account-main strong {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-overflow: ellipsis;
}
.sx-mail__account-meta {
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-overflow: ellipsis;
}
.sx-mail__account-error {
  margin: 0.25rem 0.5rem 0;
  font-size: 0.72rem;
  color: #dc2626;
}
.sx-mail__nav-empty {
  padding: 0.5rem;
  font-size: 0.82rem;
  color: #94a3b8;
}
.sx-mail__folder .sx-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: #64748b;
}
.sx-mail__folder.is-active .sx-icon { color: #2563eb; }
.sx-mail__folder-form {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem 0.5rem;
}
.sx-mail__folder-form input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
}
.sx-mail__folder-form input::placeholder { color: #94a3b8; }
.sx-mail__nav-settings {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.15rem 0.45rem 0;
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  color: #64748b;
  text-decoration: none !important;
  font-size: 0.84rem;
  min-height: 40px;
}
.sx-mail__nav-settings:hover {
  background: #e8eef5;
  color: #0f172a;
}
.sx-mail__nav-settings .sx-icon { width: 1rem; height: 1rem; }

.sx-mail__list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: #fafbfc;
}
.sx-mail__list-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.sx-mail__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.sx-mail__toolbar .sx-mail__filters {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  gap: 0.3rem;
}
.sx-mail__toolbar .sx-mail__search {
  flex: 0 1 16rem;
  min-width: 9rem;
}
.sx-mail__label-chips {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}
.sx-mail__toolbar-filters.is-labels-menu .sx-mail__label-chips { display: none; }
.sx-mail__label-menu { display: none; position: relative; flex: 0 0 auto; }
.sx-mail__toolbar-filters.is-labels-menu .sx-mail__label-menu { display: inline-flex; }
.sx-mail__label-toggle { white-space: nowrap; }
.sx-mail__label-panel {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: min(16rem, calc(100vw - 1rem));
  max-height: 18rem;
  overflow: auto;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.sx-mail__label-panel[hidden] { display: none !important; }
.sx-mail__label-panel input[type="search"] {
  width: 100%;
  margin-bottom: 0.25rem;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.2rem 0.5rem;
  font: inherit;
  font-size: 0.82rem;
}
.sx-mail__label-opt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.sx-mail__label-opt:hover { background: #f1f5f9; }
.sx-mail__label-opt.is-on { background: #f0fdfa; font-weight: 600; }
.sx-mail__label-opt.is-on::after { content: "✓"; margin-left: auto; color: #0f766e; }
.sx-mail__label-panel .btn { margin-top: 0.35rem; }
.sx-mail__filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
}
.sx-mail__filter:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}
.sx-mail__filter.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff !important;
}
.sx-mail__sort-hint {
  margin-left: auto;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
}
.sx-mail__day-label {
  padding: 0.55rem 0.85rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 1;
}
.sx-mail__search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0 0.55rem;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.sx-mail__search-icon {
  color: var(--muted);
  display: inline-flex;
}
.sx-mail__search-icon .sx-icon { width: 1rem; height: 1rem; }
.sx-mail__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}
.sx-mail__sync { margin: 0; }
.sx-mail__sync-err {
  font-size: 0.72rem;
  font-weight: 700;
  color: #b91c1c;
  white-space: nowrap;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sx-mail-ajax {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.sx-mail__more { height: 1px; }
.sx-mail__items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sx-mail__items > li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sx-mail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.75rem;
  align-items: start;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: #fff;
  color: inherit;
  min-height: 68px;
  box-sizing: border-box;
  transition: background 0.12s ease;
}
.sx-mail-row:hover { background: #f1f5f9; }
.sx-mail-editor { border: 1px solid #e6e8ec; border-radius: 8px; background: #fff; }
.sx-mail-editor__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0;
  padding: 0.2rem 0.35rem;
  border-bottom: 1px solid #e6e8ec;
  background: #f8f9fb;
}
.sx-mail-editor__group {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  padding: 0 0.28rem;
  border-right: 1px solid #e2e5ea;
}
.sx-mail-editor__bar > .sx-mail-editor__group:last-child { border-right: 0; }
.sx-mail-editor__icon,
.sx-mail-editor__chip {
  border: 0;
  background: transparent;
  color: #3c4048;
  border-radius: 4px;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.28rem;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
}
.sx-mail-editor__icon:hover,
.sx-mail-editor__chip:hover { background: #e8eaed; }
.sx-mail-editor__chip {
  max-width: 7.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}
.sx-mail-editor__chip--font { font-family: Arial, Helvetica, sans-serif; }
.sx-mail-editor__size { gap: 0.05rem; }
.sx-mail-editor__size-val {
  min-width: 1.4rem;
  text-align: center;
  font-size: 0.78rem;
  color: #3c4048;
}
.sx-mail-editor__color {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  font-weight: 700;
  color: #3c4048;
  cursor: pointer;
}
.sx-mail-editor__color span { border-bottom: 3px solid #0f172a; line-height: 1; }
.sx-mail-editor__color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.sx-mail-editor__pick { position: relative; }
.sx-mail-editor__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  min-width: 8.5rem;
  padding: 0.25rem;
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sx-mail-editor__menu[hidden] { display: none !important; }
.sx-mail-editor__menu button {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
}
.sx-mail-editor__menu button:hover { background: #e8eaed; }
.sx-mail-editor__area,
.sx-mail-editor__area p {
  font-size: 16px;
  line-height: 1.5;
}
.sx-mail-editor__area {
  min-height: 11rem;
  padding: 0.75rem 0.85rem;
  outline: none;
  font-family: Arial, Helvetica, sans-serif;
}
.sx-mail-editor__area p { margin: 0 0 0.65em; }
.sx-mail-editor__area h2 { font-size: 1.35rem; line-height: 1.3; margin: 0.4em 0; }
.sx-mail-editor__area h3 { font-size: 1.12rem; line-height: 1.35; margin: 0.35em 0; }
.sx-mail-editor__area:focus { box-shadow: inset 0 0 0 2px #0f766e33; }
.sg-mail-signature { margin-top: 0.4rem; }
.sx-mail-proof-dialog {
  width: min(72rem, calc(100vw - 2.5rem));
  max-height: calc(100vh - 2rem);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1.15rem;
}
.sx-mail-proof-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.sx-mail-proof-dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.sx-mail-proof-dialog__status {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.sx-mail-proof-dialog__list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: calc(100vh - 11rem);
  overflow: auto;
}
.sx-mail-proof-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}
.sx-mail-proof-row__was,
.sx-mail-proof-row__now {
  margin: 0;
  white-space: pre-wrap;
  font-size: 1.05rem;
  line-height: 1.5;
}
.sx-mail-proof-row__was {
  color: #334155;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}
.sx-mail-proof-row__now {
  width: 100%;
  min-height: 3.2rem;
  height: auto;
  overflow: hidden;
  resize: none;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
}
.sx-mail-proof-row.is-same .sx-mail-proof-row__now { background: #fff; border-color: var(--border); }
.sx-mail-proof-dialog__actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
@media (max-width: 720px) {
  .sx-mail-proof-row { grid-template-columns: 1fr; }
}
.sx-mail-ai-test {
  width: min(32rem, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
}
.sx-mail-ai-test::backdrop { background: rgba(15, 23, 42, 0.45); }
.sx-mail-ai-test__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.sx-mail-ai-test textarea { width: 100%; margin: 0.35rem 0 0.6rem; }
.sx-mail-ai-test__out {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.7rem;
  background: #f0fdfa;
  border-radius: 8px;
  white-space: pre-wrap;
}
.sx-mail-read__redirect { display: inline-flex; gap: 0.3rem; align-items: center; }
.sx-mail-read__redirect input { width: 11rem; }
.sx-mail-thread__headers { font-size: 0.78rem; color: #64748b; margin-left: auto; }
.sx-mail-thread__headers p { margin: 0.15rem 0; }
@media print {
  .sx-mail__nav, .sx-mail__list, .sx-mail-read__footer, .sx-mail-read__head-tools, .sx-sidebar, .sx-topbar { display: none !important; }
  .sx-mail__read { display: block !important; width: 100% !important; }
}
.sx-mail-row.is-active {
  background: #dbeafe;
  border-left-color: #2563eb;
}
.sx-mail-row.is-unread {
  background: #f0f7ff;
  border-left-color: #2563eb;
}
.sx-mail-row.is-unread:hover { background: #e8f1fc; }
.sx-mail-row.is-unread.is-active {
  background: #dbeafe;
  border-left-color: #1d4ed8;
}
.sx-mail-row.is-unread .sx-mail-row__from,
.sx-mail-row.is-unread .sx-mail-row__subject {
  font-weight: 800;
  color: #0f172a;
}
.sx-mail-row.is-unread .sx-mail-row__preview {
  color: #475569;
  font-weight: 500;
}
.sx-mail-row.is-unread .sx-mail-row__when {
  color: #1d4ed8;
  font-weight: 700;
}
.sx-mail-row.is-read .sx-mail-row__from {
  font-weight: 500;
  color: #64748b;
}
.sx-mail-row.is-read .sx-mail-row__subject {
  font-weight: 500;
  color: #64748b;
}
.sx-mail-row.is-read .sx-mail-row__preview {
  color: #94a3b8;
}
.sx-mail-row.is-read .sx-mail-row__avatar {
  opacity: 0.72;
  filter: saturate(0.85);
}
.sx-mail-row__link {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  column-gap: 0.65rem;
  align-items: start;
  padding: 0.7rem 0.55rem 0.7rem 0.7rem;
  min-width: 0;
  color: inherit;
  text-decoration: none !important;
}
.sx-mail-row__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.28rem;
  min-width: 0;
  width: 4.75rem;
  padding: 0.7rem 0.55rem 0.55rem 0;
  box-sizing: border-box;
}
.sx-mail-row__when {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  min-height: 1rem;
}
.sx-mail-row__meta-icons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  min-height: 0.85rem;
}
.sx-mail-row__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 2px #f0f7ff;
}
.sx-mail-row__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}
.sx-mail-row__avatar .sx-email-avatar__img,
.sx-mail-read__avatar .sx-email-avatar__img,
.prj-avatar .sx-email-avatar__img,
.sx-email-avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.sx-email-avatar__img.is-loaded { opacity: 1; }
[data-email-avatar].has-photo .sx-email-avatar__ini { opacity: 0; }
.sx-email-avatar__ini {
  position: relative;
  z-index: 0;
  line-height: 1;
}
.sx-mail-row__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: 0.05rem;
}
.sx-mail-row__from-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.sx-mail-row__from {
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-overflow: ellipsis;
  min-width: 0;
}
.sx-mail-row__subject {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-overflow: ellipsis;
}
.sx-mail-row--draft .sx-mail-row__link {
  grid-template-columns: minmax(0, 1fr);
}
.sx-mail-row__draft-del {
  white-space: nowrap;

  border: 0;
  background: transparent;
  color: #b91c1c;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0;
}
.sx-mail-row__draft-del:hover { text-decoration: underline; }
.sx-mail-row__preview {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-overflow: ellipsis;
}
.sx-mail-row__tag {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  align-self: center;
  text-transform: uppercase;
}
.sx-mail-row__tag--lead {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}
.sx-mail-row__tag--prospect {
  background: rgba(124, 58, 237, 0.14);
  color: #6d28d9;
}
.sx-mail-row__tag--cliente {
  background: rgba(15, 118, 110, 0.14);
  color: #0f766e;
}
.sx-mail-row__tag--ex {
  background: rgba(100, 116, 139, 0.18);
  color: #475569;
}
.sx-mail-row__crm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
}
.sx-mail-row__crm-form { margin: 0; }
.sx-mail-row__crm-spacer {
  display: block;
  width: 2.85rem;
  height: 32px;
}
.sx-mail-row__crm-btn,
.sx-mail-row__crm-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 2.85rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
}
.sx-mail-row__crm-btn:hover,
.sx-mail-row__crm-link:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
@media (max-width: 768px) {
  .sx-mail-row {
    grid-template-columns: minmax(0, 1fr) 3.4rem;
    min-height: 64px;
  }
  .sx-mail-row__aside {
    width: 3.4rem;
    padding: 0.65rem 0.55rem 0.5rem 0;
  }
  .sx-mail-row__crm { display: none; }
  .sx-mail-row__link {
    grid-template-columns: 2rem minmax(0, 1fr);
    padding: 0.65rem 0.45rem 0.65rem 0.65rem;
    column-gap: 0.55rem;
  }
  .sx-mail-row__avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
  }
  .sx-mail-row__when { font-size: 0.7rem; }
}
.sx-mail-read__crm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  margin-right: auto;
}
.sx-mail-read__crm-form { margin: 0; }
.sx-mail-read__crm-name {
  display: block;
  margin: 0;
  margin-right: auto;
  font-size: 0.78rem;
}
.sx-mail-read__sender-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.45rem;
}
.sx-mail-read__quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  margin-left: auto;
}
.sx-mail__empty-list {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.sx-mail__read {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: #fff;
}
.sx-mail-read__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.sx-mail-read__back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none !important;
  font-size: 1.1rem;
  flex: 0 0 auto;
}
.sx-mail-read__head-main { min-width: 0; flex: 1; }
.sx-mail-read__head-main h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  word-break: break-word;
}
.sx-mail-read__meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.sx-mail-read__meta strong { color: var(--text); }
.sx-mail-read__actions,
.sx-mail-read__head-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.sx-mail-read__sender {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.sx-mail-read__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.sx-mail-read__sender-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.86rem;
}
.sx-mail-read__sender-main strong { color: var(--text); }
.sx-mail-read__addr {
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-all;
}
.sx-mail-read__to { font-size: 0.78rem; }
.sx-mail-read__when {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--muted);
}
.sx-mail-read__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.15rem 1.25rem 5rem;
}
.sx-mail-read__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}
.sx-mail-read__footer .sx-mail-read__action {
  min-height: 30px;
  padding: 0.12rem 0.55rem;
  gap: 0.28rem;
  font-size: 0.75rem;
}
.sx-mail-read__footer .sx-mail-read__action .sx-icon {
  width: 0.85rem;
  height: 0.85rem;
}
.sx-mail-read__action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.sx-mail-read__action:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}
.sx-mail-read__action--danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}
.sx-mail-read__action--danger:hover {
  color: #991b1b;
  border-color: #f87171;
  background: #fee2e2;
}
.sx-mail-read__delete-form { margin: 0; }
.sx-mail-read__action .sx-icon { width: 1.1rem; height: 1.1rem; }
.sx-mail-read__action--icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
}
.sx-mail-read__action--icon span { display: none; }
.sx-mail-read__action--reply-all .sx-icon {
  width: 1.2rem;
  height: 1.2rem;
}
.sx-mail__group-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.82rem;
}
.sx-mail__group-banner a { font-weight: 600; }
.sx-mail-ctx {
  position: fixed;
  z-index: 2600;
  min-width: 12.5rem;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: 0.3rem;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
.sx-mail-ctx[hidden] { display: none !important; }
.sx-mail-ctx__item,
.sx-mail-ctx button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}
.sx-mail-ctx__item:hover,
.sx-mail-ctx button:hover { background: #f1f5f9; }
.sx-mail-ctx__item--danger { color: #b91c1c; }
.sx-mail-ctx__sep {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background: #e2e8f0;
}
.sx-mail-ctx__label {
  padding: 0.35rem 0.7rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sx-mail-groups {
  max-width: 820px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sx-mail-groups__head h1 { margin: 0.35rem 0 0.25rem; }
.sx-mail-groups__back { font-weight: 600; text-decoration: none; }
.sx-mail-groups__form,
.sx-mail-groups__rule-form,
.sx-mail-groups__form-inline {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sx-mail-groups__form-inline,
.sx-mail-groups__rule-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
}
.sx-mail-groups__form-inline select,
.sx-mail-groups__rule-form select,
.sx-mail-groups__rule-form input,
.sx-mail-groups__form input,
.sx-mail-groups__form select {
  min-height: 44px;
  flex: 1 1 10rem;
}
.sx-mail-groups__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.sx-mail-groups__card-head h2 { margin: 0; font-size: 1.1rem; }
.sx-mail-groups__card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sx-mail-groups__rules {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sx-mail-groups__rules li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #fff;
}
@media (max-width: 768px) {
  .sx-mail-groups__form-inline,
  .sx-mail-groups__rule-form { flex-direction: column; align-items: stretch; }
}
.sx-mail-read__text {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.92rem;
  color: var(--text);
  word-break: break-word;
}
.sx-mail-read__html {
  line-height: 1.5;
  font-size: 0.92rem;
  color: var(--text);
  overflow-x: auto;
  max-width: 100%;
  word-break: break-word;
}
.sx-mail-read__html img {
  max-width: 100%;
  height: auto;
}
.sx-mail-read__html table {
  max-width: 100%;
  border-collapse: collapse;
}
.sx-mail-read__html a {
  color: #2563eb;
  word-break: break-all;
}
.sx-mail-read__source {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.sx-mail-read__source summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: #64748b;
}
.sx-mail-read__source-pre {
  margin: 0.65rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #334155;
  max-height: 280px;
  overflow: auto;
}
.sx-mail-attachments {
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.08);
}
.sx-mail-attachments__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.sx-mail-attachments__label .sx-icon { width: 0.95rem; height: 0.95rem; }
.sx-mail-attachments__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sx-mail-attachments__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none !important;
  color: var(--text);
  min-height: 44px;
}
.sx-mail-attachments__item:hover { border-color: var(--accent); }
.sx-mail-attachments__name {
  font-size: 0.86rem;
  word-break: break-all;
}
.sx-mail-attachments__size {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--muted);
}
.sx-mail-attachments__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.sx-mail-attachments__format {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0f766e;
}
.sx-mail-attachments__warn {
  font-size: 0.75rem;
  color: #b45309;
}
.sx-mail-thread {
  display: flex;
  flex-direction: column;
  background: #fff;
}
.sx-mail-thread__msg {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.55rem 0.2rem 0.7rem;
  background: #fff;
}
.sx-mail-thread__msg.is-open { padding-bottom: 1rem; }
.sx-mail-thread__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sx-mail-thread__avatar { width: 32px; height: 32px; }
.sx-mail-thread__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}
.sx-mail-thread__who strong { font-size: 0.95rem; }
.sx-mail-thread__to,
.sx-mail-thread__snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 400;
}
.sx-mail-thread__body { margin: 0.55rem 0 0 2.65rem; }
.sx-mail-thread__headers { margin: 0 0 0.6rem; font-size: 0.78rem; color: #64748b; }
.sx-mail-read__html p,
.sx-mail-read__html div { display: block; margin: 0.35em 0; }
.sx-mail-read__anag {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}
.sx-mail-read__anag-k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sx-mail-read__anag a.sg-badge { text-decoration: none; }
.sx-mail-thread__head time {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.sx-mail-thread__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.sx-mail-thread__labels form { margin: 0; }
.sx-mail-label {
  border: 1px solid var(--sx-label, #0f766e);
  background: #fff;
  color: var(--sx-label, #0f766e);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.sx-mail-label.is-on {
  background: var(--sx-label, #0f766e);
  color: #fff;
}
.sx-mail-label--mini {
  font-size: 0.68rem;
  padding: 0 0.4rem;
  line-height: 1.3;
}
.sx-mail-row__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  min-width: 0;
}
.sx-mail-row__lab {
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  background: var(--sx-label, #0f766e);
  color: #fff;
}
.sx-mail-row__flag {
  color: #b45309;
  font-size: 0.85rem;
  line-height: 1;
}
.sx-mail__label-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.sx-mail__label-row .sx-mail__folder { flex: 1; }
.sx-mail-label__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.sx-mail__filter .sx-mail-label__dot {
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.28rem;
  vertical-align: middle;
}
.sx-mail__label-add {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.2rem 0;
}
.sx-mail__label-add input[type="text"] {
  flex: 1;
  min-width: 0;
}
.sx-mail__firma-form label {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.sx-mail__firma-form input[type="text"],
.sx-mail__firma-form textarea,
.sx-mail__firma-form input[type="file"] {
  width: 100%;
  box-sizing: border-box;
}
.sx-mail__firma-hint,
.sx-mail__firma-studio {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--text, #0f172a);
  white-space: pre-wrap;
}
.sx-mail__firma-logo {
  display: block;
  max-height: 42px;
  margin: 0.35rem 0;
}
.sx-mail-read__flag-form { margin: 0; }
.sx-mail-read__flag-form .is-on {
  background: #b45309;
  color: #fff;
  border-color: #b45309;
}
.sx-mail-file {
  width: min(960px, calc(100vw - 2rem));
  height: min(88vh, 860px);
  max-height: 88vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.sx-mail-file::backdrop { background: rgba(15, 23, 42, 0.45); }
.sx-mail-file__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.sx-mail-file__bar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sx-mail-file__save {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.sx-mail-file__save input {
  width: 14rem;
  min-height: 32px;
}
.sx-mail-file__body {
  height: calc(88vh - 58px);
  max-height: calc(88vh - 58px);
  overflow: auto;
  background: #f8fafc;
}
.sx-mail-file__body iframe,
.sx-mail-file__body img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #fff;
}
.sx-mail-file__body p { padding: 1rem 1.15rem; }
.sx-mail-dialog {
  width: min(1080px, calc(100vw - 2rem));
  height: min(92vh, 920px);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.sx-mail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.sx-mail-dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.sx-mail-dialog__close {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 0.75rem;
  cursor: pointer;
}
.sx-mail-dialog__body {
  display: flex;
  flex-direction: column;
  height: calc(92vh - 58px);
  max-height: calc(92vh - 58px);
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.sx-mail-dialog__body .sx-mail-read__head,
.sx-mail-dialog__body .sx-mail-thread__labels,
.sx-mail-dialog__body .sx-mail-read__footer {
  flex: 0 0 auto;
}
.sx-mail-dialog__body .sx-mail-read__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.sx-mail-dialog__body .sx-mail-compose {
  margin-top: 0;
}
.sx-mail-compose__quote {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.sx-mail-compose__quote-label {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  background: #eff6ff;
  border-left: 3px solid #1d4ed8;
  border-radius: 0 6px 6px 0;
  color: #1e3a8a;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}
.sx-mail-phase {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid #64748b;
  background: #fff;
  border-radius: 0 8px 8px 0;
}
.sx-mail-phase__who {
  margin: 0 0 0.45rem;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.35;
}
.sx-mail-phase__body,
.sx-mail-phase__now { font-size: 0.92rem; line-height: 1.45; color: #0f172a; }
.sx-mail-phase__now { margin-bottom: 0.35rem; }
.sx-mail-etichette-page {
  max-width: 760px;
}
.sx-mail-etichette-page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.sx-mail-etichette-page__head h1 {
  margin: 0;
  font-size: 1.25rem;
}
.sx-mail-etichette {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.sx-mail-etichette th,
.sx-mail-etichette td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.sx-mail-etichette input[type="text"] {
  width: 100%;
  min-height: 36px;
}
.sx-mail-etichette__actions form,
.sx-mail-etichette td form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.sx-mail-row__attach {
  display: inline-flex;
  color: var(--muted);
}
.sx-mail-row__attach .sx-icon { width: 0.85rem; height: 0.85rem; }
.sx-mail-row__tag--sg {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}
.sx-mail-row__tag--doc {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}
.sx-mail-row__tag--forn {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}
.sx-mail-compose__to-wrap {
  position: relative;
}
.sx-mail-compose__suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
}
.sx-mail-compose__suggest .sg-enroll-suggest__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  text-align: left;
}
.sx-mail-compose__suggest .sg-enroll-suggest__item.is-active,
.sx-mail-compose__suggest .sg-enroll-suggest__item:hover {
  background: #eff6ff;
}
.sx-mail-compose__kind {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sx-mail-compose__to-hint {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}
.sx-kv {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}
.sx-kv > div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}
.sx-kv dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.sx-kv dd { margin: 0; word-break: break-word; }
@media (max-width: 768px) {
  .sx-kv > div { grid-template-columns: 1fr; gap: 0.15rem; }
}
.sx-mail-compose__file-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.sx-mail-compose__file-label .sx-icon { width: 0.95rem; height: 0.95rem; }
.sx-mail-compose__files {
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.55rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.sx-mail-compose__files--picked {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.sx-mail-compose__file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sx-mail-compose__file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.sx-mail-compose__file-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.sx-mail-compose__msg-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sx-mail-compose__emoji {
  position: relative;
}
.sx-mail-compose__emoji-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.sx-mail-editor__bar .sx-mail-compose__emoji-btn {
  border: 0;
  background: transparent;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sx-mail-editor__bar .sx-mail-compose__emoji-pop {
  top: calc(100% + 4px);
  z-index: 30;
}
.sx-mail-editor__icon .sx-icon { width: 1.05rem; height: 1.05rem; }
.sx-mail-compose__emoji-pop {
  position: absolute;
  top: 2.3rem;
  right: 0;
  display: grid;
  grid-template-columns: repeat(6, 2rem);
  gap: 0.15rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 4;
}
.sx-mail-compose__emoji-pop[hidden] { display: none; }
.sx-mail-compose__emoji-pop button {
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 6px;
}
.sx-mail-compose__emoji-pop button:hover { background: var(--accent-soft); }
.sx-mail-read__placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}
.sx-mail-read__placeholder-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.sx-mail-read__placeholder-icon .sx-icon { width: 1.75rem; height: 1.75rem; }
.sx-mail-read__placeholder h2 {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-family: var(--font-display);
}
.sx-mail-read__placeholder p { margin: 0.25rem 0; max-width: 28rem; line-height: 1.45; }

.sx-mail-compose {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.sx-mail-compose__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sx-mail-compose__field[hidden] {
  display: none !important;
}
.sx-mail-compose__field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sx-mail-compose__field-label label,
.sx-mail-compose__field > label {
  margin: 0;
}
.sx-mail-compose__field-label .btn {
  min-height: 28px;
  padding: 0.15rem 0.55rem;
}
.sx-mail-compose label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.15rem;
}
.sx-mail-dialog__body .sx-mail-read__head {
  padding: 0.55rem 0.9rem;
}
.sx-mail-dialog__body .sx-mail-read__head h2 {
  font-size: 1rem;
  margin: 0;
}
.sx-mail-compose input,
.sx-mail-compose textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
}
.sx-mail-compose textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.45;
}
.sx-mail-compose__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
}
.sx-mail-compose__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Impostazioni caselle — stesso linguaggio Bitrix/Synapti */
.sx-mail-settings {
  margin: -1.25rem -1.5rem -2rem;
  min-height: calc(100dvh - var(--topbar-h, 64px));
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.sx-mail-settings__nav {
  background: linear-gradient(180deg, #0b1f2a 0%, #123044 100%);
  color: var(--sidebar-text);
  border-right: 1px solid #163445;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.sx-mail-settings__nav-head {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sx-mail-settings__nav-head h1 {
  margin: 0.35rem 0 0.15rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #fff;
}
.sx-mail-settings__back {
  color: #99f6e4;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
}
.sx-mail-settings__new {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0.75rem 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.2);
  color: #99f6e4;
  text-decoration: none !important;
  font-weight: 700;
  min-height: 44px;
}
.sx-mail-settings__new.is-active,
.sx-mail-settings__new:hover {
  background: rgba(20, 184, 166, 0.32);
  color: #fff;
}
.sx-mail-settings__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.55rem 1rem;
}
.sx-mail-settings__row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.25rem;
}
.sx-mail-settings__order {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0 0.35rem 0.25rem;
}
.sx-mail-settings__order form { margin: 0; }
.sx-mail-settings__order button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #cbd5e1;
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
}
.sx-mail-settings__order button:hover { color: #fff; border-color: #5eead4; }
.sx-mail-settings__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.55rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none !important;
  min-height: 52px;
}
.sx-mail-settings__item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sx-mail-settings__item.is-active {
  background: rgba(20, 184, 166, 0.18);
  color: #5eead4;
}
.sx-mail-settings__item-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.35);
  color: #99f6e4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.sx-mail-settings__item-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sx-mail-settings__item-main strong {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-overflow: ellipsis;
}
.sx-mail-settings__item-main span {
  font-size: 0.72rem;
  color: #7f96a6;
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-overflow: ellipsis;
}
.sx-mail-settings__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: flex-end;
  max-width: 5.5rem;
}
.sx-mail-pill {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: #c5d4de;
}
.sx-mail-pill--ok { background: rgba(34, 197, 94, 0.25); color: #86efac; }
.sx-mail-pill--accent { background: rgba(20, 184, 166, 0.25); color: #99f6e4; }
.sx-mail-settings__form {
  padding: 1.25rem 1.5rem 2rem;
  overflow-y: auto;
  max-width: 720px;
}
.sx-mail-settings__form-head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
}
.sx-mail-settings__grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sx-mail-settings__block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #f8fafb;
}
.sx-mail-settings__block h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #0b1f2a;
}
.sx-mail-settings__block label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0.55rem 0 0.25rem;
}
.sx-mail-settings__block input[type="text"],
.sx-mail-settings__block input[type="password"],
.sx-mail-settings__block input[type="number"],
.sx-mail-settings__block input:not([type]) {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}
.sx-mail-settings__row2 {
  display: grid;
  grid-template-columns: 1fr 7rem;
  gap: 0.65rem;
}
.sx-mail-settings__chk {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600 !important;
  color: var(--text) !important;
  margin-top: 0.65rem !important;
}
.sx-mail-settings__chk input {
  width: auto;
  min-height: auto;
}
.sx-mail-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
}
@media (max-width: 960px) {
  .sx-mail-settings {
    margin: -1rem -1rem -2rem;
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .sx-mail-settings__nav { max-height: 40vh; }
  .sx-mail-shell--compose .sx-mail__list { display: none; }
  .sx-mail-shell--compose .sx-mail__nav { display: none; }
}

#sx-mail-ajax.is-ajax-loading { opacity: 0.55; pointer-events: none; }

@media (max-width: 960px) {
  .sx-mail-shell {
    margin: -1rem -1rem -2rem;
    height: calc(100dvh - var(--topbar-h, 64px) - var(--tab-h, 64px));
  }
  .sx-mail {
    grid-template-columns: 1fr;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .sx-mail__splitter { display: none; }
  .sx-mail-shell:not(.sx-mail-shell--read) .sx-mail__read { display: none; }
  .sx-mail-shell--read .sx-mail__nav { display: none; }
  .sx-mail-shell--read .sx-mail__list { display: none; }
  .sx-mail-shell--read .sx-mail-read__back { display: inline-flex; }
}
@media (max-width: 768px) {
  .sx-mail-shell {
    height: calc(100dvh - var(--topbar-h, 64px) - var(--tab-h, 64px));
  }
}


/* Posta: pager + loading anteprima AJAX */
.sx-mail__pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 0.65rem 1rem;
  border-top: 1px solid var(--border);
}
.sx-mail__pager-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.sx-mail-read__loading {
  display: grid;
  place-content: center;
  gap: 0.35rem;
  min-height: 12rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}
.sx-mail__read.is-loading {
  opacity: 0.85;
}
.sx-mail-read__loading p { margin: 0; }

.sx-mail__account-meta.is-error { color: var(--danger); font-weight: 600; }
.sx-mail-read__imap-error {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.sx-mail-read__imap-error strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}
.sx-mail-read__imap-error p { margin: 0.35rem 0 0; font-size: 0.88rem; line-height: 1.45; }
.sx-mail-read__imap-error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin-top: 0.75rem !important;
}
.sx-mail-read__imap-error-actions .muted { font-size: 0.8rem; color: #7f1d1d; }
.sx-mail-settings__last-error {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Icone piccole nella barra dell'editor e nelle etichette (icon(..., size='sm')) */
.sx-icon--sm { width: 0.95rem; height: 0.95rem; }
