.nspa-smtp-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.nspa-smtp-active {
  color: var(--npac-accent, var(--primary, #0078d4)) !important;
}

.nspa-smtp-page {
  width: 100%;
}

.nspa-smtp-page .page-header {
  align-items: center;
}

.nspa-smtp-page .action-strip .button svg {
  width: 15px;
  height: 15px;
}

.nspa-smtp-statusline {
  min-height: 34px;
  display: flex;
  align-items: center;
}

.nspa-smtp-statusline:empty {
  display: none;
}

.nspa-smtp-metrics .metric-card strong {
  font-size: 1.35rem;
}

.nspa-smtp-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.nspa-smtp-wide {
  grid-column: 1 / -1;
}

.nspa-smtp-wide textarea {
  min-height: 86px;
  resize: vertical;
}

.nspa-smtp-scope-field {
  grid-column: span 2;
}

.nspa-smtp-main-toggle {
  margin-left: auto;
}

.nspa-smtp-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.nspa-smtp-checks .member-check {
  min-width: 170px;
}

.nspa-smtp-overview-list {
  display: grid;
  gap: 8px;
}

.nspa-smtp-overview-row {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  text-align: left;
}

.nspa-smtp-overview-row:hover {
  border-color: color-mix(in srgb, var(--primary, #1f6df0) 28%, var(--line, #dbe4ef));
}

.nspa-smtp-pill.is-ok {
  background: #dff7eb;
  border-color: #b8ebd1;
  color: #0f6c4a;
}

.nspa-smtp-history-table td:first-child {
  min-width: 240px;
}

.nspa-smtp-history-table th:last-child,
.nspa-smtp-history-table td:last-child {
  width: 210px;
  text-align: right;
  white-space: nowrap;
}

.nspa-smtp-history-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.nspa-smtp-log-toggle {
  gap: 6px;
  justify-content: center;
  min-width: 92px;
}

.nspa-smtp-email-toggle {
  gap: 6px;
  justify-content: center;
  min-width: 108px;
}

.nspa-smtp-log-row td,
.nspa-smtp-email-row td {
  background: color-mix(in srgb, var(--surface, #ffffff) 70%, var(--muted-bg, #f4f6f8));
  border-top: 0;
  padding: 0;
}

.nspa-smtp-log-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.nspa-smtp-log-item {
  border: 1px solid var(--line, #dbe4ef);
  background: var(--surface, #fff);
  padding: 10px 12px;
}

.nspa-smtp-log-item span {
  color: var(--muted, #5b6472);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.nspa-smtp-log-item strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.nspa-smtp-log-item-wide {
  grid-column: 1 / -1;
}

.nspa-smtp-email-preview {
  padding: 12px;
}

.nspa-smtp-email-head {
  border: 1px solid var(--line, #dbe4ef);
  border-bottom: 0;
  background: var(--surface, #fff);
  padding: 10px 12px;
}

.nspa-smtp-email-head span {
  color: var(--muted, #5b6472);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.nspa-smtp-email-head strong {
  display: block;
  overflow-wrap: anywhere;
}

.nspa-smtp-email-frame,
.nspa-smtp-email-text {
  border: 1px solid var(--line, #dbe4ef);
  background: #fff;
  color: #0f172a;
  display: block;
  margin: 0;
  min-height: 220px;
  width: 100%;
}

.nspa-smtp-email-frame {
  height: 320px;
}

.nspa-smtp-email-text {
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.45;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.nspa-smtp-loading {
  gap: 10px;
}

.nspa-smtp-fallback-shell .portal-topbar {
  min-height: 56px;
}

.nspa-smtp-fallback-shell .portal-brand img {
  max-height: 36px;
  width: auto;
}

.nspa-smtp-fallback-shell .portal-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nspa-smtp-fallback-shell .portal-content {
  padding-bottom: 96px;
}

.nspa-smtp-fallback-shell .portal-footer {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  margin-left: 235px;
}

@media (max-width: 1100px) {
  .nspa-smtp-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nspa-smtp-overview-row {
    grid-template-columns: 1fr 1fr;
  }

  .nspa-smtp-log-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nspa-smtp-page .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .nspa-smtp-page .action-strip {
    justify-content: flex-start;
  }

  .nspa-smtp-form-grid,
  .nspa-smtp-overview-row {
    grid-template-columns: 1fr;
  }

  .nspa-smtp-scope-field {
    grid-column: auto;
  }

  .nspa-smtp-main-toggle {
    margin-left: 0;
  }

  .nspa-smtp-fallback-shell .portal-footer {
    margin-left: 0;
  }

  .nspa-smtp-log-detail {
    grid-template-columns: 1fr;
  }

  .nspa-smtp-history-actions {
    align-items: flex-end;
    flex-direction: column;
  }
}

:root[data-portal-color-mode="dark"] .nspa-smtp-pill.is-ok {
  background: #123923 !important;
  border-color: #14532d !important;
  color: #bbf7d0 !important;
}

:root[data-portal-color-mode="dark"] .nspa-smtp-log-row td,
:root[data-portal-color-mode="dark"] .nspa-smtp-email-row td,
:root[data-portal-color-mode="dark"] .nspa-smtp-log-item,
:root[data-portal-color-mode="dark"] .nspa-smtp-email-head {
  background: var(--surface, #111827) !important;
}
