/* Casella email Plus — client Outlook (layout 1:1 stile Outlook Web) */

body.page-mail {
  overflow: hidden;
  background: #f3f2f1 !important;
}

body.page-mail main {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
}

body.page-mail .site-footer,
body.page-mail > footer,
body.page-mail main > footer {
  display: none !important;
}

.pt-mail-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 52px);
  max-height: calc(100vh - 52px);
  overflow: hidden;
  background: #f3f2f1;
}

/* Sidebar stile Outlook Web */
.pt-mail-sidebar {
  background: #faf9f8;
  color: #323130;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
  border-right: 1px solid #edebe9;
}

.pt-mail-owa-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.pt-mail-owa-brand > div {
  flex: 1;
  min-width: 0;
}

.pt-mail-gear-side,
.pt-mail-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(11, 61, 92, 0.2);
  background: #fff;
  color: #0b3d5c;
  font-size: 16px;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.pt-mail-gear-side:hover,
.pt-mail-gear:hover {
  background: #e67800;
  border-color: #e67800;
  color: #fff;
}

.pt-mail-owa-logo {
  width: 36px;
  height: 36px;
  background: #e67800;
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.pt-mail-owa-sub {
  font-size: 11px;
  color: #605e5c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pt-mail-setup-link {
  display: block;
  margin: 0 10px;
  color: #0b3d5c;
  font-size: 12px;
}

.pt-mail-folders-h {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #605e5c;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}

.pt-mail-folders:not(.pt-mail-folders--projects) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pt-mail-folder-tree {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.pt-mail-tree-row {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 30px;
}

.pt-mail-tree-toggle {
  border: none;
  background: transparent;
  width: 20px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  color: #605e5c;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 2px;
}

.pt-mail-tree-toggle:hover { background: #edebe9; }
.pt-mail-tree-toggle.is-open { transform: rotate(90deg); }

.pt-mail-tree-spacer {
  width: 20px;
  flex-shrink: 0;
}

.pt-mail-tree-children {
  display: flex;
  flex-direction: column;
}

.pt-mail-tree-row .pt-mail-folder {
  flex: 1;
  min-width: 0;
  padding: 5px 8px 5px 2px;
}

.pt-mail-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.pt-mail-tree-loading {
  padding: 12px;
  font-size: 12px;
}

.pt-mail-folders-sep {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a19f9d;
  padding: 10px 12px 4px;
  margin-top: 4px;
  border-top: 1px solid #edebe9;
}

.pt-mail-folder--sub {
  font-size: 12px;
}

.pt-mail-folder,
.pt-mail-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  color: #323130;
  text-align: left;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.pt-mail-folder:hover,
.pt-mail-project:hover {
  background: #edebe9;
}

.pt-mail-folder.is-active {
  background: #deecf9;
  border-left-color: #0b3d5c;
  font-weight: 600;
  color: #0b3d5c;
}

.pt-mail-folder--projects.is-active {
  border-left-color: #107c10;
  color: #107c10;
  background: #dff6dd;
}

.pt-mail-badge {
  background: #edebe9;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  min-width: 20px;
  text-align: center;
  color: #605e5c;
}

.pt-mail-folder.is-active .pt-mail-badge {
  background: #c7e0f4;
  color: #0b3d5c;
}

.pt-mail-folders--projects {
  border-top: 1px solid #edebe9;
  padding-top: 4px;
  flex-shrink: 0;
  max-height: 35vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pt-mail-projects {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.pt-mail-project {
  font-size: 12px;
  padding-left: 20px;
}

.pt-mail-project-val {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-mail-settings {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 8px 4px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(11, 61, 92, 0.25);
  background: #fff;
  color: #0b3d5c;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  margin-top: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.pt-mail-settings:hover {
  background: #0b3d5c;
  color: #fff;
  border-color: #0b3d5c;
}

/* Main + ribbon Outlook Web (chiaro) */
.pt-mail-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.pt-mail-compose-new {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 4px;
  background: #0078d4;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.pt-mail-compose-new:hover {
  background: #106ebe;
}

.pt-mail-ribbon {
  background: #fff;
  color: #323130;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #edebe9;
}

.pt-mail-ribbon-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid #f3f2f1;
}

.pt-mail-ribbon-title {
  padding: 0;
  font-size: 20px;
  font-weight: 600;
  flex: 0 0 auto;
  min-width: 140px;
}

.pt-mail-ribbon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 10px;
  flex-wrap: wrap;
}

.pt-mail-rib-btn {
  border: 1px solid #edebe9;
  background: #fff;
  color: #323130;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: none;
}

.pt-mail-rib-btn:hover {
  background: #f3f2f1;
  border-color: #c8c6c4;
}

.pt-mail-rib-btn--primary {
  background: #0078d4;
  color: #fff;
  border-color: #0078d4;
}

.pt-mail-rib-btn--primary:hover {
  background: #106ebe;
  border-color: #106ebe;
  color: #fff;
}

.pt-mail-rib-btn--orange {
  background: #0078d4;
  color: #fff;
  border-color: #0078d4;
}

.pt-mail-rib-btn--orange:hover {
  background: #106ebe;
  border-color: #106ebe;
  color: #fff;
}

.pt-mail-rib-btn--archive {
  background: #107c10;
  border-color: #107c10;
  color: #fff;
}

.pt-mail-rib-btn--archive:hover {
  background: #0b5a0b;
  border-color: #0b5a0b;
  color: #fff;
}

.pt-mail-rib-btn--danger {
  background: #fff;
  color: #a4262c;
  border-color: #e1dfdd;
}

.pt-mail-rib-btn--danger:hover:not(:disabled) {
  background: #fde7e9;
  border-color: #a4262c;
  color: #a4262c;
}

.pt-mail-rib-btn--danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pt-mail-ribbon-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  flex: 1 1 280px;
  min-width: 0;
}

.pt-mail-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: #605e5c;
}

.pt-mail-sort-label {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pt-mail-sort {
  border: 1px solid #edebe9;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: #323130;
  max-width: 190px;
  cursor: pointer;
}

.pt-mail-search {
  flex: 1;
  min-width: 160px;
  max-width: none;
  padding: 8px 12px;
  border: 1px solid #edebe9;
  border-radius: 4px;
  font-size: 13px;
  color: #323130;
  background: #faf9f8;
  caret-color: #0078d4;
}
.pt-mail-search:focus {
  outline: none;
  border-color: #0078d4;
  background: #fff;
  box-shadow: 0 0 0 1px #0078d4;
}
.pt-mail-search::placeholder {
  color: #a19f9d;
  opacity: 1;
}

.pt-mail-search-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #edebe9;
  color: #605e5c;
  font-size: 12px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
}

.pt-mail-status {
  font-size: 11px;
  color: #605e5c;
  white-space: nowrap;
}

.pt-mail-split {
  display: grid;
  grid-template-columns: minmax(280px, 38%) 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.pt-mail-list-wrap {
  background: #fff;
  border-right: 1px solid #edebe9;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.pt-mail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.pt-mail-col-check {
  width: 34px;
}

.pt-mail-col-avatar {
  width: 40px;
  padding-right: 0 !important;
}

.pt-mail-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}

.pt-mail-col-from {
  width: auto;
}

.pt-mail-col-date {
  width: 92px;
  min-width: 92px;
  white-space: nowrap;
  text-align: right;
  vertical-align: top;
}

.pt-mail-table thead th {
  position: sticky;
  top: 0;
  background: #faf9f8;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #edebe9;
  font-weight: 600;
  color: #605e5c;
  z-index: 1;
}

.pt-mail-col-date.pt-mail-col-date,
.pt-mail-table thead th.pt-mail-col-date {
  text-align: right;
  padding-right: 12px;
}

.pt-mail-col-date .pt-mail-date {
  display: block;
  text-align: right;
}

.pt-mail-row {
  cursor: pointer;
  border-bottom: 1px solid #f3f2f1;
  background: #fff;
  position: relative;
}
.pt-mail-row.is-unread { background: #faf9f8; }
.pt-mail-row:hover { background: #f3f2f1; }
.pt-mail-row.is-unread:hover { background: #edebe9; }
.pt-mail-row.is-selected {
  background: #deecf9 !important;
  box-shadow: inset 3px 0 0 #0078d4;
}
.pt-mail-row.is-ai-highlight {
  background: #fff4e5 !important;
  box-shadow: inset 3px 0 0 #e67800;
}
.pt-mail-row.is-ai-highlight .pt-mail-subj {
  color: #9a3412;
  font-weight: 700;
}

.pt-mail-row td { padding: 10px 10px; vertical-align: top; }
.pt-mail-row .pt-mail-col-avatar { vertical-align: middle; padding-top: 12px; }

.pt-mail-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.pt-mail-row-date-inline {
  display: none;
  font-size: 11px;
  color: #605e5c;
  flex-shrink: 0;
}

.pt-mail-col-main {
  min-width: 0;
  overflow: hidden;
}

.pt-mail-from { font-weight: 600; color: #323130; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.pt-mail-row.is-unread .pt-mail-from { font-weight: 700; color: #201f1e; }
.pt-mail-subj { color: #323130; font-weight: 400; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-mail-row.is-unread .pt-mail-subj { font-weight: 600; color: #201f1e; }
.pt-mail-prev { color: #605e5c; font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-mail-date {
  color: #605e5c;
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pt-mail-date-d,
.pt-mail-date-t {
  display: block;
}
.pt-mail-date-t {
  margin-top: 1px;
  font-weight: 700;
  color: #323130;
}
.pt-mail-row.is-unread .pt-mail-date { color: #0b3d5c; }
.pt-mail-row.is-unread .pt-mail-date-t { color: #0b3d5c; font-weight: 800; }

.pt-mail-empty { padding: 24px; text-align: center; color: #605e5c; }
.pt-mail-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 11px;
  color: #605e5c;
  border-top: 1px solid #edebe9;
}
.pt-mail-pager-btn {
  border: 1px solid #d2d0ce;
  background: #fff;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  color: #323130;
}
.pt-mail-pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
#ptMailPagerInfo { flex: 1; text-align: center; }

.pt-mail-read {
  background: #faf9f8;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 20px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.pt-mail-read-empty { color: #a19f9d; padding: 48px 24px; text-align: center; font-size: 14px; line-height: 1.5; }
.pt-mail-read-subj { font-size: 20px; font-weight: 600; color: #323130; margin: 0 0 10px; }
.pt-mail-read-meta { font-size: 13px; color: #605e5c; line-height: 1.6; }
.pt-mail-read-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  padding: 12px 0 4px;
  border-top: 1px solid #edebe9;
}

.pt-mail-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.pt-mail-act-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.pt-mail-act-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.pt-mail-act-btn__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  font-size: 15px;
  line-height: 1;
}

.pt-mail-act-btn--reply {
  background: linear-gradient(180deg, #34d399 0%, #27ae60 100%);
  box-shadow: 0 3px 10px rgba(39, 174, 96, 0.28);
}

.pt-mail-act-btn--reply-all {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.28);
}

.pt-mail-act-btn--forward {
  background: linear-gradient(180deg, #f59a4a 0%, #e87722 100%);
  box-shadow: 0 3px 10px rgba(232, 119, 34, 0.3);
}

.pt-mail-act-btn--archive {
  background: linear-gradient(180deg, #38bdf8 0%, #2980b9 100%);
  box-shadow: 0 3px 10px rgba(41, 128, 185, 0.3);
}

@media (max-width: 720px) {
  .pt-mail-read-actions {
    gap: 8px;
  }
  .pt-mail-act-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
    padding: 10px 12px;
  }
}

.pt-mail-read-atts {
  margin: 12px 0 4px;
  padding: 10px 12px;
  background: #f3f2f1;
  border-radius: 6px;
  border: 1px solid #edebe9;
}
.pt-mail-att-title {
  font-size: 12px;
  font-weight: 700;
  color: #323130;
  margin-bottom: 8px;
}
.pt-mail-att-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pt-mail-read-actions .btn-mail-dl,
.pt-mail-att-list .btn-mail-dl {
  background: linear-gradient(180deg, #38bdf8 0%, #2980b9 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(41, 128, 185, 0.25);
}
.pt-mail-att-list .pt-mail-att-wc {
  background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(91, 33, 182, 0.28);
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
}
.pt-mail-att-list .pt-mail-att-drive {
  background: linear-gradient(180deg, #34a853 0%, #1e8e3e 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(30, 142, 62, 0.28);
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
}
.pt-mail-read-refs { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }

.pt-mail-ref-tag {
  background: #dff6dd;
  color: #107c10;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pt-mail-ref-tag--removable {
  padding-right: 4px;
}

.pt-mail-ref-go {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}
.pt-mail-ref-go:hover {
  text-decoration: underline;
}

.pt-mail-ref-rm {
  border: none;
  background: rgba(16, 124, 16, 0.15);
  color: #107c10;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 1;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.pt-mail-ref-rm:hover {
  background: #107c10;
  color: #fff;
}

.pt-mail-read-body {
  background: #fff;
  border: 1px solid #edebe9;
  border-radius: 4px;
  padding: 14px;
  min-height: 240px;
  overflow-x: auto;
}

.pt-mail-read-body iframe { width: 100%; min-height: 400px; border: none; }

/*
 * HTML email body document (blob iframe).
 * Linked from buildMailBodyDocHtml — parent page rules do not apply inside the iframe.
 */
body.pt-mail-body-doc {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #1a1a2e;
  margin: 0;
  padding: 12px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  overflow-x: auto;
  box-sizing: border-box;
}

body.pt-mail-body-doc img {
  max-width: 100% !important;
  height: auto !important;
}

/* Height-only sizing (no width): avoid natural-width blowout; inline height !important wins */
body.pt-mail-body-doc img.pt-mail-img--height-only {
  width: auto !important;
  max-width: 100% !important;
  max-height: 240px;
}

body.pt-mail-body-doc table {
  max-width: 100% !important;
}

body.pt-mail-body-doc td,
body.pt-mail-body-doc th {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

body.pt-mail-body-doc a {
  color: #0078d4;
}

/* Quoted history / reply chronology — visual separation between messages */
body.pt-mail-body-doc p {
  margin: 0 0 0.7em;
}

body.pt-mail-body-doc hr {
  margin: 18px 0;
  border: none;
  border-top: 1px solid #c8c6c4;
}

body.pt-mail-body-doc blockquote,
body.pt-mail-body-doc .pt-mail-thread-quote,
body.pt-mail-body-doc .pt-mail-thread-msg,
body.pt-mail-body-doc .gmail_quote,
body.pt-mail-body-doc .gmail_quote_container,
body.pt-mail-body-doc #divRplyFwdMsg,
body.pt-mail-body-doc #mail-editor-reference-message-container,
body.pt-mail-body-doc .yahoo_quoted,
body.pt-mail-body-doc .protonmail_quote {
  display: block;
  margin: 16px 0 10px;
  padding: 10px 12px 10px 14px;
  border-left: 3px solid #8a8886;
  background: #f5f5f4;
  border-radius: 0 6px 6px 0;
  color: #3b3a39;
}

body.pt-mail-body-doc blockquote blockquote,
body.pt-mail-body-doc .pt-mail-thread-quote .pt-mail-thread-quote,
body.pt-mail-body-doc .pt-mail-thread-msg .pt-mail-thread-msg {
  background: #ebebea;
  border-left-color: #a19f9d;
  margin-top: 12px;
}

body.pt-mail-body-doc .pt-mail-thread-hdr,
body.pt-mail-body-doc .gmail_attr,
body.pt-mail-body-doc .moz-cite-prefix,
body.pt-mail-body-doc .OutlookMessageHeader {
  display: block;
  font-size: 12px !important;
  color: #605e5c !important;
  line-height: 1.55;
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e1dfdd;
  white-space: pre-wrap;
  word-break: break-word;
}

body.pt-mail-body-doc .pt-mail-thread-quote,
body.pt-mail-body-doc .pt-mail-thread-msg {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

body.pt-mail-body-doc .pt-mail-thread-quote img,
body.pt-mail-body-doc .pt-mail-thread-msg img {
  max-width: 180px !important;
  max-height: 140px !important;
}

body.pt-mail-body-doc .pt-mail-thread-hdr strong,
body.pt-mail-body-doc .pt-mail-thread-hdr b {
  color: #323130;
  font-weight: 600;
}

.pt-mail-plain-thread {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a2e;
  white-space: normal;
}

.pt-mail-plain-top {
  margin-bottom: 12px;
}

.pt-mail-plain-thread .pt-mail-thread-msg {
  margin: 16px 0 10px;
  padding: 10px 12px 10px 14px;
  border-left: 3px solid #8a8886;
  background: #f5f5f4;
  border-radius: 0 6px 6px 0;
  color: #3b3a39;
}

.pt-mail-plain-thread .pt-mail-thread-hdr {
  font-size: 12px;
  color: #605e5c;
  line-height: 1.55;
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e1dfdd;
}

.pt-mail-split.is-read-fullscreen {
  grid-template-columns: 1fr;
}
.pt-mail-split.is-read-fullscreen .pt-mail-list-wrap {
  display: none;
}
.pt-mail-read.is-fullscreen {
  position: relative;
}
.pt-mail-read-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin: -16px -20px 12px;
  background: #0b3d5c;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.pt-mail-read.is-fullscreen .pt-mail-read-topbar {
  display: flex;
}
.pt-mail-read-topbar-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.pt-mail-read-close {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pt-mail-read-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
.pt-mail-split.is-read-fullscreen .pt-mail-read-body iframe {
  min-height: calc(100vh - 280px);
}

/* Compose in-app */
.pt-mail-compose-ov {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pt-mail-compose-ov.is-open {
  display: flex;
}

.pt-mail-compose {
  background: #fff;
  border-radius: 6px;
  width: min(780px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  overflow: hidden;
}

.pt-mail-compose-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #0b3d5c;
  color: #fff;
  border-radius: 6px 6px 0 0;
}

.pt-mail-compose-x {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.pt-mail-compose-fields {
  padding: 14px 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
}

.pt-mail-compose-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #323130;
}

.pt-mail-richtext-label {
  display: flex;
  flex-direction: column;
  gap: 6px !important;
  /* Caption only — editor must NEVER inherit 600 from this wrapper */
  font-weight: 400;
}

.pt-mail-compose-field-lbl {
  font-size: 12px;
  font-weight: 600;
  color: #323130;
}

.pt-mail-richtext-label > .pt-mail-richtext {
  font-weight: 400;
}

.pt-mail-richtext {
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.pt-mail-rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 6px 8px;
  background: #f3f2f1;
  border-bottom: 1px solid #e1dfdd;
}

.pt-mail-rt-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
  border-right: 1px solid #d2d0ce;
  margin-right: 2px;
}

.pt-mail-rt-group:last-child { border-right: none; margin-right: 0; padding-right: 0; }

.pt-mail-rt-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #323130;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}

.pt-mail-rt-btn:hover { background: #edebe9; border-color: #c8c6c4; }
.pt-mail-rt-btn:active { background: #e1dfdd; }

.pt-mail-rt-select {
  height: 28px;
  max-width: 110px;
  font-size: 12px;
  border: 1px solid #c8c6c4;
  border-radius: 3px;
  background: #fff;
  color: #323130;
}

.pt-mail-rt-colors { gap: 4px; }

.pt-mail-rt-color-lbl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  position: relative;
}

.pt-mail-rt-color-lbl:hover { background: #edebe9; }

.pt-mail-rt-hilite { font-weight: 400; color: #323130; }

.pt-mail-rt-color {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  padding: 0;
}

#ptMailComposeBody,
.pt-mail-compose-body,
.pt-mail-rt-editor {
  min-height: 160px;
  max-height: 280px;
  overflow: auto;
  padding: 10px 12px;
  font-family: Calibri, "Segoe UI", Candara, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400 !important;
  font-style: normal;
  line-height: 1.45;
  color: #323130;
  outline: none;
  caret-color: #0b3d5c;
}

.pt-mail-sig-block {
  margin-top: 1.1em;
  font-family: Calibri, "Segoe UI", Candara, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #323130;
  /* Evita che il cursore/editing entri nella firma (contenuto poi scartato in validazione) */
  -webkit-user-modify: read-only;
  user-select: text;
}

/* NO bold in compose body — AI / paste / typing always normal (quotes are sibling) */
#ptMailComposeBody,
#ptMailComposeBody *,
.pt-mail-rt-editor,
.pt-mail-rt-editor * {
  font-weight: 400 !important;
}

#ptMailComposeBody b,
#ptMailComposeBody strong,
.pt-mail-rt-editor b,
.pt-mail-rt-editor strong {
  font-weight: 400 !important;
}

.pt-mail-rt-editor p {
  margin: 0 0 0.6em;
  font-family: inherit;
}

.pt-mail-rt-editor p:last-child {
  margin-bottom: 0;
}

.pt-mail-rt-editor:empty::before {
  content: "Scrivi il messaggio…";
  color: #a19f9d;
  pointer-events: none;
  font-weight: 400;
  font-family: Calibri, "Segoe UI", Candara, Arial, sans-serif;
}

#ptMailComposeBody:empty::before {
  content: "Scrivi il messaggio…";
}

#ptMailComposeQuote:empty::before,
.pt-mail-compose-quote:empty::before {
  content: none;
}

.pt-mail-compose-quote-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px dashed #c8c6c4;
  background: #f3f2f1;
  font-size: 12px;
  color: #605e5c;
}

.pt-mail-compose-quote-bar[hidden] {
  display: none !important;
}

.pt-mail-compose-quote-label {
  font-weight: 600;
  color: #323130;
}

.pt-mail-compose-quote-remove {
  border: 1px solid #c8c6c4;
  background: #fff;
  color: #a4262c;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.pt-mail-compose-quote-remove:hover {
  background: #fde7e9;
  border-color: #e37d85;
}

.pt-mail-compose-quote {
  border-top: none;
  padding: 10px 12px;
  background: #faf9f8;
  font-size: 13px;
  font-weight: 400;
  color: #323130;
  max-height: 320px;
  overflow: auto;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
  line-height: 1.45;
  outline: none;
}

.pt-mail-compose-quote:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(11, 61, 92, 0.18);
}

.pt-mail-compose-quote[hidden] {
  display: none !important;
}

.pt-mail-compose-quote .pt-mail-quote-hdr {
  font-size: 11px;
  font-weight: 400;
  color: #797775;
  margin-bottom: 10px;
  line-height: 1.55;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1dfdd;
}

.pt-mail-compose-quote .pt-mail-quote-hdr strong {
  font-weight: 600;
  color: #323130;
}

.pt-mail-rt-ai { background: #eef6fc; border-radius: 4px; padding: 2px 4px !important; }

.pt-mail-rt-ai-btn {
  font-size: 12px;
  min-width: 32px;
}

.pt-mail-ai-direct-btn {
  font-weight: 700;
  min-width: 44px !important;
  background: #0b3d5c !important;
  color: #fff !important;
  border-color: #0b3d5c !important;
}

.pt-mail-ai-direct-btn:hover {
  background: #145a82 !important;
}

.pt-mail-rt-ai-btn.is-active,
.pt-mail-rt-ai-btn.is-listening {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.28);
  animation: pt-mail-mic-pulse 1.1s ease-in-out infinite;
}

@keyframes pt-mail-mic-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.pt-mail-mic-wave {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
  padding: 0 4px;
}
.pt-mail-mic-wave.is-live {
  display: inline-flex;
}
.pt-mail-wave-bar {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: #dc2626;
  transform-origin: bottom center;
  animation: pt-mail-wave-idle 0.85s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.07s);
}
.pt-mail-mic-wave.is-live .pt-mail-wave-bar {
  animation: none;
}
@keyframes pt-mail-wave-idle {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1.15); }
}
.pt-mail-mic-rec {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #dc2626;
  padding: 0 4px;
}

.pt-mail-compose-quote .pt-mail-quote-text {
  border-left: 3px solid #c8c6c4;
  padding: 4px 0 4px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 400;
  color: #3b3a39;
}

.pt-mail-compose-quote .pt-mail-quote-text--html {
  white-space: normal;
}

.pt-mail-compose-quote .pt-mail-quote-text--html p,
.pt-mail-compose-quote .pt-mail-quote-text--html div {
  margin: 0 0 0.55em;
  font-weight: 400;
  line-height: 1.45;
}

.pt-mail-compose-quote .pt-mail-quote-text--html p:last-child,
.pt-mail-compose-quote .pt-mail-quote-text--html div:last-child {
  margin-bottom: 0;
}

.pt-mail-compose-quote .pt-mail-quote-text--html table {
  max-width: 100% !important;
  border-collapse: collapse;
  margin: 0 0 0.55em;
}

.pt-mail-compose-quote .pt-mail-quote-text--html td,
.pt-mail-compose-quote .pt-mail-quote-text--html th {
  padding: 2px 4px;
  vertical-align: top;
  word-break: break-word;
}

.pt-mail-compose-quote .pt-mail-quote-text--html img {
  max-width: 160px !important;
  max-height: 120px !important;
  height: auto !important;
  width: auto !important;
}

.pt-mail-compose-arch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 4px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e1dfdd;
  border-radius: 6px;
}
.pt-mail-compose-arch-field {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #323130;
}
.pt-mail-compose-arch-input {
  margin-top: 4px;
  width: 100%;
}
.pt-mail-compose-arch-suggest {
  max-height: 180px;
  overflow: auto;
}
.pt-mail-compose-arch-chips {
  margin-top: 0;
}
.pt-mail-compose-arch-hint {
  margin: 0;
  font-size: 11px;
  color: #605e5c;
  line-height: 1.35;
}

.pt-mail-compose-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  position: relative;
}

#ptMailComposeFileInput,
.pt-mail-compose-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  display: none !important;
  appearance: none !important;
}

.pt-mail-compose-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.pt-mail-compose-att-count {
  font-size: 12px;
  font-weight: 600;
  color: #0b3d5c;
  width: 100%;
  order: 99;
}

.pt-mail-compose-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #e8f4fd;
  border: 1px solid #c7e0f4;
  border-radius: 6px;
  font-size: 11px;
  color: #323130;
  max-width: 100%;
}

.pt-mail-compose-att-preview {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
  font: inherit;
  color: inherit;
  text-align: left;
}

.pt-mail-compose-att-preview:hover {
  color: #0078d4;
  text-decoration: underline;
}

.pt-mail-compose-att-chip span,
.pt-mail-compose-att-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-mail-compose-att-rm {
  border: none;
  background: transparent;
  color: #605e5c;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.pt-mail-compose-att-rm:hover { color: #c0392b; }

.pt-mail-doc-pick-box {
  max-width: min(560px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.pt-mail-doc-pick-hint {
  margin: 0 16px 8px;
  font-size: 12px;
  color: #605e5c;
}
.pt-mail-doc-pick-status {
  margin: 0 16px 8px;
  min-height: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #323130;
}
.pt-mail-doc-pick-status.is-err {
  color: #c0392b;
}
.pt-mail-doc-pick-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 16px 14px;
}
.pt-mail-doc-choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #edebe9;
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
}
.pt-mail-doc-choice-btn:hover {
  border-color: #0080ff;
  background: #f0f7ff;
}
.pt-mail-doc-choice-ico {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.pt-mail-doc-choice-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pt-mail-doc-choice-txt strong {
  font-size: 14px;
  color: #201f1e;
}
.pt-mail-doc-choice-txt small {
  font-size: 12px;
  color: #605e5c;
}
.pt-mail-doc-pick-project {
  margin: 0 16px 10px;
}
.pt-mail-doc-pick-list {
  margin: 0 16px 12px;
  padding: 8px;
  border: 1px solid #edebe9;
  border-radius: 8px;
  background: #faf9f8;
  max-height: min(420px, 50vh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pt-mail-doc-pick-list[hidden],
.pt-mail-doc-pick-choice[hidden],
.pt-mail-doc-pick-project[hidden] {
  display: none !important;
}
.pt-mail-doc-pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #edebe9;
  border-radius: 6px;
  cursor: pointer;
}
.pt-mail-doc-pick-row:hover {
  border-color: #0080ff;
  background: #f0f7ff;
}
.pt-mail-doc-pick-row input {
  margin: 0;
  flex-shrink: 0;
}
.pt-mail-doc-pick-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pt-mail-doc-pick-empty {
  padding: 16px 8px;
  text-align: center;
  color: #605e5c;
  font-size: 13px;
}

.pt-mail-compose-preview-ov {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 45, 82, 0.55);
}
.pt-mail-compose-preview-ov.is-open {
  display: flex;
}
.pt-mail-compose-preview-ov.is-max {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
.pt-mail-compose-preview-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 45, 82, 0.28);
  max-width: min(920px, 96vw);
  width: 96vw;
  max-height: 88vh;
  height: 88vh;
  min-width: 640px;
  min-height: 420px;
  resize: both;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pt-mail-compose-preview-box.is-max {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw;
  max-height: 100vh;
  min-width: 0;
  min-height: 0;
  resize: none;
  border-radius: 0;
}
.pt-mail-compose-preview-h {
  background: #0078d4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 14px;
}
.pt-mail-compose-preview-h #ptMailComposePreviewTitle {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pt-mail-compose-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.pt-mail-compose-preview-max,
.pt-mail-compose-preview-close {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pt-mail-compose-preview-max {
  background: #1abc9c;
  border-color: transparent;
}
.pt-mail-compose-preview-max:hover,
.pt-mail-compose-preview-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.pt-mail-compose-preview-max:hover {
  background: #16a085;
}
.pt-mail-compose-preview-main {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #eceff4;
  overflow: auto;
}
.pt-mail-compose-preview-status {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: #4a4a6a;
  font-size: 13px;
  background: #eceff4;
  white-space: pre-line;
}
.pt-mail-compose-preview-status.is-visible {
  display: flex;
}
.pt-mail-compose-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #eceff4;
}
.pt-mail-compose-preview-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  padding: 12px;
  object-fit: contain;
}
.pt-mail-compose-preview-img[hidden],
.pt-mail-compose-preview-frame[hidden] {
  display: none !important;
}
.pt-mail-compose-preview-foot {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: #f8fafc;
  font-size: 11px;
  color: #6b7280;
}

.pt-mail-att-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.pt-mail-att-name {
  font-size: 12px;
  color: #323130;
  min-width: 0;
  flex: 1 1 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pt-mail-att-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.pt-mail-att-actions .pt-fbtn--sm {
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  min-width: 0;
}
.pt-mail-att-wc {
  background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 100%) !important;
  color: #fff !important;
}
.pt-mail-att-drive {
  background: linear-gradient(180deg, #34a853 0%, #1e8e3e 100%) !important;
  color: #fff !important;
}

.pt-mail-addr-suggest {
  max-height: min(280px, 40vh);
  overflow: auto;
  z-index: 40;
}
.pt-mail-addr-suggest-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f0f2f5;
}
.pt-mail-addr-suggest-row:last-child { border-bottom: none; }
.pt-mail-addr-suggest-row .pt-mail-addr-pick {
  flex: 1 1 auto;
  border-bottom: none !important;
}
.pt-mail-addr-forget {
  flex: 0 0 34px;
  border: none;
  background: transparent;
  color: #a19f9d;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.pt-mail-addr-forget:hover {
  color: #a4262c;
  background: #fde7e9;
}

.pt-mail-postarch-box {
  max-width: min(520px, 96vw);
}
.pt-mail-postarch-customer {
  margin: 0 16px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #201f1e;
}
.pt-mail-postarch-list {
  margin: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(360px, 48vh);
  overflow: auto;
}
.pt-mail-postarch-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid #edebe9;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}
.pt-mail-postarch-row:hover {
  border-color: #0078d4;
  background: #f0f7ff;
}
.pt-mail-postarch-row strong {
  font-size: 13px;
  color: #201f1e;
}
.pt-mail-postarch-row span {
  font-size: 11px;
  color: #605e5c;
  word-break: break-word;
}
.pt-mail-postarch-empty {
  padding: 12px 8px;
  text-align: center;
  color: #605e5c;
  font-size: 13px;
}
.pt-mail-postarch-status {
  margin: 0 16px 8px;
  min-height: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #323130;
}
.pt-mail-postarch-status.is-err {
  color: #c0392b;
}

.pt-mail-rib-btn--sent-organize {
  background: #e8f4fd;
  border-color: #0078d4;
  color: #004578;
  font-weight: 700;
}
.pt-mail-rib-btn--sent-organize:hover {
  background: #cce4f7;
}

.pt-mail-sent-organize-progress {
  margin: 0 16px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0078d4;
}
.pt-mail-sent-organize-samples {
  margin: 0 16px 10px;
  padding-left: 20px;
  font-size: 12px;
  color: #605e5c;
  max-height: 88px;
  overflow: auto;
}
.pt-mail-sent-organize-samples li {
  margin: 2px 0;
  word-break: break-word;
}
.pt-mail-sent-organize-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 10px;
  font-size: 12px;
  color: #323130;
  cursor: pointer;
}
.pt-mail-sent-organize-search {
  margin: 0 16px 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fbff;
  border: 1px solid #c7e0f4;
}
.pt-mail-sent-organize-search-h {
  font-size: 13px;
  font-weight: 700;
  color: #004578;
  margin-bottom: 4px;
}
.pt-mail-sent-organize-search-note {
  margin: 0 0 8px;
  font-size: 11px;
  color: #605e5c;
  line-height: 1.35;
}
.pt-mail-sent-organize-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pt-mail-sent-organize-search .pt-mail-move-field {
  margin: 0;
}
.pt-mail-sent-organize-search-actions .dbtn,
.pt-mail-sent-organize-search-actions .pt-fbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #fff !important;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}
.pt-mail-sent-organize-search-actions .pt-fbtn--green {
  background: linear-gradient(180deg, #34d399 0%, #27ae60 100%) !important;
}
.pt-mail-sent-organize-search-actions .pt-fbtn--green:hover:not(:disabled) {
  background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%) !important;
}
.pt-mail-sent-organize-search-actions .pt-fbtn--gray {
  background: linear-gradient(180deg, #94a3b8 0%, #5a6268 100%) !important;
}
.pt-mail-sent-organize-search-actions .pt-fbtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #faf9f8;
  border: 1px dashed #c8c6c4;
  font-size: 12px;
  color: #605e5c;
}
.pt-mail-postarch-row.is-saved-rule {
  border-color: #0078d4;
  background: #f0f7ff;
}
.pt-mail-sent-organize-actions {
  gap: 8px;
  flex-wrap: wrap;
}
.pt-mail-sent-organize-actions .pt-fbtn--blue {
  background: #0078d4;
  border-color: #0078d4;
  color: #fff;
  font-weight: 700;
}
.pt-mail-sent-organize-actions .pt-fbtn--blue:hover:not(:disabled) {
  background: #106ebe;
  border-color: #106ebe;
}
.pt-mail-sent-organize-actions .pt-fbtn--blue:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pt-mail-compose-f {
  padding: 12px 16px;
  border-top: 1px solid #edebe9;
  display: flex !important;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  background: #faf9f8;
  z-index: 2;
}

.pt-mail-compose-f .pt-mail-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.pt-mail-compose-f .pt-mail-send-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.pt-mail-compose-f .pt-mail-send-btn--cancel {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

.pt-mail-compose-f .pt-mail-send-btn--draft {
  background: linear-gradient(180deg, #38bdf8 0%, #2980b9 100%);
}

.pt-mail-compose-f .pt-mail-send-btn--send {
  background: linear-gradient(180deg, #34d399 0%, #16a34a 100%);
  min-width: 120px;
  font-size: 14px;
}

.pt-mail-send-split {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}

.pt-mail-send-split .pt-mail-send-btn {
  box-shadow: none;
  border-radius: 0;
  min-width: 0;
}

.pt-mail-send-split .pt-mail-send-btn--now {
  padding-left: 14px;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}

.pt-mail-send-split .pt-mail-send-btn--delay {
  padding-left: 12px;
  padding-right: 14px;
  font-size: 13px;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
}

.pt-mail-send-split .pt-mail-send-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  filter: none;
}

.pt-mail-compose-undo-hint {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.pt-mail-compose-ov.is-undo-pending .pt-mail-rt-editor,
.pt-mail-compose-ov.is-undo-pending input,
.pt-mail-compose-ov.is-undo-pending textarea {
  opacity: 0.95;
  cursor: default;
}

/* Undo Send — barra flottante (stile Outlook) */
.pt-mail-undo-send {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 1400;
  max-width: min(560px, calc(100vw - 24px));
  width: max-content;
}
.pt-mail-undo-send[hidden] { display: none !important; }
.pt-mail-undo-send-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #1a1a2e;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}
.pt-mail-undo-send-msg {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.pt-mail-undo-send-btn {
  border: 0;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #f59e0b;
  color: #1a1a2e;
  flex-shrink: 0;
}
.pt-mail-undo-send-btn:hover { background: #fbbf24; }
.pt-mail-undo-send-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Modali archivia / sposta — overlay centrato (non in fondo pagina) */
.pt-email-ov {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  overflow-y: auto;
}

.pt-email-ov.is-open {
  display: flex;
}

.pt-email-box {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  margin: auto;
}

.pt-email-h {
  background: #1a5276;
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.pt-mail-archive-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 14px 16px;
  -webkit-overflow-scrolling: touch;
}

.pt-email-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e0e4ea;
  background: #fafbfc;
  flex-shrink: 0;
}

/* Su /mail non c’è plus_friendly_ux: senza questi stili i .dbtn restano testo bianco su fondo chiaro */
.pt-email-f .dbtn,
.pt-email-f .pt-fbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #fff !important;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}
.pt-email-f .pt-fbtn--green,
.pt-email-f #ptMailArchSave,
.pt-email-f #ptMailMoveSave {
  background: linear-gradient(180deg, #34d399 0%, #27ae60 100%) !important;
}
.pt-email-f .pt-fbtn--gray,
.pt-email-f #ptMailArchCancel,
.pt-email-f #ptMailMoveCancel {
  background: linear-gradient(180deg, #94a3b8 0%, #5a6268 100%) !important;
}
.pt-email-f .dbtn:disabled,
.pt-email-f .pt-fbtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.pt-mail-archive-box {
  width: min(560px, 100%);
  max-width: none;
  max-height: min(820px, calc(100vh - 24px));
}
.pt-mail-archive-box .pt-mail-archive-scroll {
  min-height: 420px;
  overflow: visible;
  flex: 1 1 auto;
  max-height: none;
}
.pt-mail-archive-hint { font-size: 13px; color: #605e5c; margin: 0 0 12px; line-height: 1.45; }
.pt-mail-archive-form { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0; }
.pt-mail-archive-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.pt-mail-arch-search-field { font-size: 12px; font-weight: 700; color: #4a4a6a; }
.pt-mail-arch-search-input {
  color: #1a1a2e !important;
  background: #fff !important;
  font-weight: 500;
  font-size: 15px !important;
  padding: 10px 12px !important;
}
.pt-mail-arch-suggest {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: min(480px, 58vh) !important;
}

.pt-mail-arch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.pt-mail-arch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px 5px 10px;
  border-radius: 4px;
  background: #e8f3fc;
  border: 1px solid #c7e0f4;
  font-size: 12px;
  font-weight: 600;
  color: #004578;
  line-height: 1.3;
}
.pt-mail-arch-chip[data-kind="quotation"] {
  background: #f3f2f1;
  border-color: #d2d0ce;
  color: #323130;
}
.pt-mail-arch-chip-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.pt-mail-arch-chip-x {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
}
.pt-mail-arch-chip-x:hover { opacity: 1; }

.pt-mail-col-check { width: 32px; text-align: center; vertical-align: top; padding-top: 10px !important; }
.pt-mail-sel-info { font-size: 11px; opacity: 0.95; margin-left: 8px; }
.pt-mail-read-refs--list { margin: 3px 0 0; }
.pt-mail-ref-tag--list { font-size: 10px; padding: 2px 6px; }

.pt-mail-ac-wrap { position: relative; }

.pt-mail-suggest {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 20;
  background: #fff;
  border: 1px solid #edebe9;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow: auto;
  margin-top: 4px;
}

.pt-mail-suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #1a1a2e;
}

.pt-mail-suggest-item:hover,
.pt-mail-suggest-item.is-active { background: #deecf9; }

.pt-mail-suggest-kind {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0b3d5c;
  background: #e8f2fa;
  border-radius: 3px;
  padding: 2px 6px;
  margin-top: 1px;
}

.pt-mail-suggest-item--ref {
  align-items: flex-start;
}
.pt-mail-suggest-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.pt-mail-suggest-item--ref .pt-mail-suggest-main {
  white-space: normal;
  line-height: 1.25;
}
.pt-mail-suggest-item--ref .pt-mail-suggest-path {
  display: block;
  margin-top: 0;
  font-size: 11px;
  color: #5b6b7c;
}
.pt-mail-suggest-main {
  flex: 1 1 auto;
  line-height: 1.35;
}

/* Dialog Sposta: lista cartelle sempre visibile sotto il campo */
.pt-mail-move-box {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 24px));
  overflow: visible;
}
.pt-mail-move-box .pt-mail-archive-scroll {
  overflow: visible;
  flex: 1 1 auto;
  min-height: 280px;
  max-height: none;
}
.pt-mail-move-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #4a4a6a;
}
.pt-mail-move-input {
  color: #1a1a2e !important;
  background: #fff !important;
  font-weight: 500;
}
.pt-mail-suggest--panel {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  margin-top: 10px;
  max-height: min(360px, 50vh);
  overflow-y: auto;
  border: 1px solid #c8d0da;
  box-shadow: none;
  display: none;
}
.pt-mail-suggest--panel .pt-mail-suggest-item {
  border-bottom: 1px solid #f0f2f5;
}
.pt-mail-suggest--panel .pt-mail-suggest-item:last-child {
  border-bottom: none;
}
.pt-mail-suggest-path {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}
.pt-mail-move-picked {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 13px;
  font-weight: 600;
}

/* Dialog più in alto così la lista non finisce fuori schermo */
#ptMailMoveOv.pt-email-ov.is-open {
  align-items: flex-start;
  padding-top: 6vh;
}

.pt-mail-arch-count { font-size: 13px; font-weight: 600; color: #0b3d5c; margin: 0 0 10px; }

/* Pulsante Aggiungi nell’anteprima archivio (stesso fix sfondo) */
.pt-mail-arch-preview .pt-fbtn--green,
.pt-mail-arch-preview #ptMailArchAddPreview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  color: #fff !important;
  background: linear-gradient(180deg, #34d399 0%, #27ae60 100%) !important;
  cursor: pointer;
}

.pt-mail-arch-preview {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #c8e6c9;
  background: #f1faf1;
}
.pt-mail-arch-preview.is-error {
  border-color: #f5c6cb;
  background: #fdf3f4;
}
.pt-mail-arch-preview.is-hint {
  border-color: #c5d8eb;
  background: #f3f8fc;
}
.pt-mail-arch-preview.is-loading {
  border-color: #deecf9;
  background: #f3f9fd;
  color: #605e5c;
  font-size: 13px;
}
.pt-mail-arch-preview-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #107c10;
  margin-bottom: 4px;
}
.pt-mail-arch-preview.is-error .pt-mail-arch-preview-kicker { color: #a4262c; }
.pt-mail-arch-preview.is-hint .pt-mail-arch-preview-kicker { color: #0b3d5c; }
.pt-mail-suggest-empty {
  padding: 18px 14px;
  font-size: 13px;
  color: #605e5c;
  line-height: 1.4;
}
.pt-mail-suggest-older {
  display: block;
  width: calc(100% - 16px);
  margin: 4px 8px 10px;
  padding: 9px 12px;
  border: 1px solid #c7e0f4;
  border-radius: 6px;
  background: #eff6fc;
  color: #0b3d5c;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.pt-mail-suggest-older:hover {
  background: #deecf9;
  border-color: #2b88d8;
}
.pt-mail-arch-preview-title {
  font-size: 18px;
  font-weight: 700;
  color: #201f1e;
  line-height: 1.25;
}
.pt-mail-arch-preview-sub {
  font-size: 14px;
  font-weight: 600;
  color: #323130;
  margin-top: 4px;
  line-height: 1.35;
}
.pt-mail-arch-preview-meta {
  font-size: 12px;
  color: #605e5c;
  margin-top: 6px;
}
.pt-mail-arch-preview-err {
  font-size: 13px;
  color: #a4262c;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .pt-mail-app { grid-template-columns: 1fr; }
  .pt-mail-sidebar { display: none; }
  .pt-mail-split { grid-template-columns: 1fr; }
  .pt-mail-read { display: none; }
  .pt-mail-read.is-open-mobile {
    display: block;
    position: fixed;
    inset: 56px 0 0 0;
    z-index: 50;
  }
}

/* ===== Impostazioni casella (layout 1:1 stile form ADA, colori Plus) ===== */
body.page-settings-email {
  background: #f3f4f6 !important;
}

.pt-settings-shell {
  max-width: 920px;
  margin: 16px auto 32px;
  padding: 0 16px;
}

.pt-exchange-form .pt-exchange-intro {
  margin: 0 0 14px;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.pt-exchange-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: end;
}

.pt-exchange-grid--simple {
  margin-top: 8px;
}

.pt-ca-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pt-ca-lab {
  color: #4a4a6a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pt-exchange-wide { grid-column: 1 / -1; }

.pt-exchange-active {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #1a1a2e;
  font-size: 13px;
  padding-top: 18px;
}

.pt-exchange-signature {
  min-height: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
  margin-top: 8px;
}

.pt-exchange-signature-preview {
  min-height: 200px;
  max-height: 420px;
  overflow: auto;
  font-family: Calibri, "Segoe UI", Candara, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #1a1a2e;
  background: #fff;
  white-space: normal;
}

.pt-exchange-signature-preview:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.pt-exchange-signature-preview img {
  max-width: 220px;
  height: auto;
}

.pt-sig-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.pt-sig-upload-btn,
.pt-sig-html-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
}

.pt-sig-upload-btn:hover,
.pt-sig-html-toggle:hover {
  background: #e0f2fe;
  border-color: #93c5fd;
}

.pt-sig-html-toggle.is-open {
  background: #e0f2fe;
  border-color: #2980b9;
  color: #0b3d5c;
}

.pt-sig-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.pt-sig-list-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.pt-sig-add-btn,
button.pt-sig-add-btn,
#exSigAddBtn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 14px !important;
  border: none !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #38bdf8 0%, #2980b9 100%) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(41, 128, 185, 0.28);
  white-space: nowrap;
  line-height: 1.2;
  text-decoration: none !important;
}

.pt-sig-add-btn:hover,
#exSigAddBtn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #fff !important;
}

.pt-sig-add-btn:active,
#exSigAddBtn:active {
  transform: none;
  filter: brightness(0.98);
}

.pt-sig-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.pt-sig-empty {
  padding: 18px 12px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

.pt-sig-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: #1a1a2e;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pt-sig-item:hover {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.pt-sig-item.is-selected {
  border-color: #2980b9;
  box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.18);
  background: #e0f2fe;
}

.pt-sig-item-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-sig-item-def {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #0b3d5c;
  background: #dbeafe;
  border-radius: 999px;
  padding: 2px 7px;
}

.pt-sig-edit-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-mail-compose-sig-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}

.pt-mail-compose-sig-row label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.pt-mail-compose-sig-select {
  min-width: 160px;
  max-width: 280px;
  padding: 5px 8px;
  border: 1px solid #b9c0cc;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #1a1a2e;
}

@media (max-width: 720px) {
  .pt-sig-layout {
    grid-template-columns: 1fr;
  }
}

.pt-exchange-form .dedit {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #b9c0cc;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  color: #1a1a2e;
  font-family: inherit;
  box-sizing: border-box;
}

.pt-exchange-form .dedit:focus {
  outline: none;
  border-color: #e67800;
  box-shadow: 0 0 0 2px rgba(230, 120, 0, 0.18);
}

.pt-exchange-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pt-exchange-actions .dbtn,
.pt-exchange-actions .pt-fbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pt-exchange-actions .pt-fbtn--green {
  background: #27ae60;
}
.pt-exchange-actions .pt-fbtn--green:hover { background: #1e8449; }

.pt-exchange-actions .pt-fbtn--slate {
  background: #475569;
}
.pt-exchange-actions .pt-fbtn--slate:hover { background: #334155; }

.pt-exchange-actions .dbtn:disabled,
.pt-exchange-actions .pt-fbtn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pt-exchange-status {
  min-height: 1.4em;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

.pt-exchange-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
}

@media (max-width: 720px) {
  .pt-exchange-grid { grid-template-columns: 1fr; }
  .pt-exchange-active { padding-top: 0; }
}

/* OAuth Microsoft 365 */
.pt-exchange-oauth-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(11, 61, 92, 0.2);
  border-radius: 8px;
  background: #f8fafc;
}
.pt-ms365-btn {
  background: #e67800 !important;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(230, 120, 0, 0.35);
}
.pt-ms365-btn:hover { background: #c96800 !important; }
.pt-ms365-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  background: #94a3b8 !important;
}
.pt-oauth-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}
.pt-exchange-oauth-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}
.pt-exchange-sep {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 8px 0 16px;
}
