/**
 * /tools/smtp-diag — вариант D «терминал» (#23026).
 * Паттерн so-tc как Bounce Tester; сетка --so3-wrap / .wrap 1180.
 */

.so-tc.so-smtp-diag a {
  color: #c9b6ff;
}

.so-tc.so-smtp-diag a:hover {
  color: #fff;
}

.so-tc.so-smtp-diag {
  container-type: inline-size;
  container-name: tc;
  font-family: Roboto, system-ui, sans-serif;
  color: #fff;
  background: #16162a;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.so-tc.so-smtp-diag *,
.so-tc.so-smtp-diag *::before,
.so-tc.so-smtp-diag *::after {
  box-sizing: border-box;
}

.so-tc.so-smtp-diag .wrap {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.so-tc.so-smtp-diag .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 66px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}

.so-tc.so-smtp-diag .btn--fill {
  background: linear-gradient(90deg, #c55de0 0%, #7f56f6 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(127, 86, 246, 0.38);
}

.so-tc.so-smtp-diag .btn--fill:hover,
.so-tc.so-smtp-diag .btn--fill:focus-visible {
  color: #fff;
}

.so-tc.so-smtp-diag .btn--xl {
  min-height: 64px;
  padding: 0 36px;
  font-size: 18px;
}

.so-tc.so-smtp-diag .btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.so-tc.so-smtp-diag .th {
  position: relative;
  background: #22223b;
  color: #fff;
  padding-top: 96px;
  padding-bottom: 28px;
  overflow: hidden;
}

.so-tc.so-smtp-diag .th__glow {
  position: absolute;
  inset: -20% 20% auto;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(129, 87, 246, 0.35), transparent 70%);
  pointer-events: none;
}

.so-tc.so-smtp-diag .th__inner {
  position: relative;
  z-index: 1;
}

.so-tc.so-smtp-diag .so3-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.so-tc.so-smtp-diag .so3-kicker a {
  color: #c9b6ff;
  text-decoration: none;
}

.so-tc.so-smtp-diag .so3-kicker a:hover {
  color: #fff;
}

.so-tc.so-smtp-diag .th h1 {
  margin: 0 0 16px;
  font-family: Unbounded, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.so-tc.so-smtp-diag .th__lead {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

/* Терминал: рельс + экран */
.so-smtp-diag__term {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  min-height: 560px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 64px;
  border-radius: 20px;
  overflow: hidden;
  background: #1a1a30;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.so-smtp-diag__rail {
  background: #1c1c34;
  padding: 16px 10px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(80vh, 720px);
  overflow-y: auto;
}

.so-smtp-diag__rail-label {
  margin: 0 8px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.so-smtp-diag__rail-item {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.so-smtp-diag__rail-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.so-smtp-diag__rail-item.is-active,
.so-smtp-diag__rail-item[aria-selected="true"] {
  background: #8157f6;
}

.so-smtp-diag__code {
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace;
  font-weight: 700;
  min-width: 42px;
  flex-shrink: 0;
}

.so-smtp-diag__screen {
  padding: 28px 32px 40px;
  background: #16162a;
}

.so-smtp-diag__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.so-smtp-diag__card-title,
.so-smtp-diag .mg-smtp-diag__card-title {
  margin: 0 0 8px;
  font-family: Unbounded, system-ui, sans-serif;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.so-smtp-diag .mg-smtp-diag__card-desc {
  margin: 0 0 14px;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.75);
  font-size: 16px;
}

.so-smtp-diag__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.so-smtp-diag__tag {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #22223b;
  color: #e6e6f0;
}

.so-smtp-diag__creds-wrap {
  margin: 0 0 20px;
}

.so-smtp-diag__result-lead {
  margin: 0 0 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.so-smtp-diag__creds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.so-smtp-diag__cred {
  margin: 0;
  background: #22223b;
  border-radius: 12px;
  padding: 12px 14px;
}

.so-smtp-diag__cred dt {
  margin: 0 0 4px;
  font-size: 12px;
  color: #8e8e9e;
  font-weight: 500;
}

.so-smtp-diag__cred dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.so-smtp-diag__cred .mg-smtp-diag__mono {
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace;
  font-weight: 500;
  font-size: 13px;
  color: #fff;
  overflow-wrap: anywhere;
}

.so-smtp-diag .mg-smtp-diag__copy {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #c9b6ff;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
}

.so-smtp-diag .mg-smtp-diag__copy:hover,
.so-smtp-diag .mg-smtp-diag__copy.is-copied {
  color: #fff;
}

.so-smtp-diag .mg-smtp-diag__copy-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: #3ae374;
}

.so-smtp-diag__result-actions {
  margin: 12px 0 0;
}

.so-smtp-diag__link {
  font-weight: 600;
  text-decoration: none;
}

.so-smtp-diag__actions {
  margin: 8px 0 16px;
}

.so-smtp-diag__error {
  margin: 0 0 16px;
  color: #ff4d4d;
  font-weight: 600;
}

.so-smtp-diag__captcha {
  margin: 0 0 12px;
}

.so-smtp-diag__preview.con {
  margin-top: 8px;
  border-radius: 16px;
  background: #1a1a30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.so-smtp-diag .con__bar {
  padding: 0;
}

.so-smtp-diag .con__tab {
  display: inline-block;
  padding: 10px 14px;
  background: #8157f6;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
}

.so-smtp-diag .con__body {
  margin: 0;
  padding: 16px 16px 8px;
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #e6e6f0;
  white-space: pre-wrap;
  background: transparent;
  border: 0;
}

.so-smtp-diag .con__body .c-ok,
.so-smtp-diag .c-ok {
  color: #3ae374;
}

.so-smtp-diag .con__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 14px;
  font-size: 13px;
  color: #3ae374;
}

.so-smtp-diag .con__foot .ok {
  color: #3ae374;
}

.so-smtp-diag .con__foot span:last-child {
  color: rgba(255, 255, 255, 0.45);
}

/* —— Сессия / ящик / письмо (FastAPI embed) —— */
.so-tc.mg-smtp-diag--session {
  padding-bottom: 64px;
}

.so-smtp-diag__session-hero {
  padding-bottom: 48px;
}

.so-smtp-diag__session-inner {
  position: relative;
  z-index: 1;
}

.so-smtp-diag__embed {
  margin-top: 8px;
}

.so-smtp-diag__embed .sd-embed-main,
.so-smtp-diag__embed .container {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

.so-smtp-diag__embed .crumbs {
  display: none;
}

.so-smtp-diag__embed .card {
  margin: 0 0 16px;
  padding: 22px 24px;
  border-radius: 20px;
  background: #1a1a30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.so-smtp-diag__embed .card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.so-smtp-diag__embed h1 {
  margin: 0;
  font-family: Unbounded, system-ui, sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}

.so-smtp-diag__embed h2 {
  margin: 0;
  font-family: Unbounded, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.so-smtp-diag__embed .pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #8157f6;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.so-smtp-diag__embed .params-details {
  margin: 0 0 14px;
  border-radius: 14px;
  background: #22223b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.so-smtp-diag__embed .params-details summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 600;
  color: #c9b6ff;
}

.so-smtp-diag__embed .params-details summary::-webkit-details-marker {
  display: none;
}

.so-smtp-diag__embed .params-details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.so-smtp-diag__embed .params {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.so-smtp-diag__embed .params th,
.so-smtp-diag__embed .params td {
  padding: 10px 16px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.so-smtp-diag__embed .params th {
  width: 42%;
  color: #8e8e9e;
  font-weight: 500;
}

.so-smtp-diag__embed .params code,
.so-smtp-diag__embed code {
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.so-smtp-diag__embed .muted,
.so-smtp-diag__embed .hint,
.so-smtp-diag__embed .empty-hint {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
  font-weight: 400;
}

.so-smtp-diag__embed .live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: #3ae374;
  box-shadow: 0 0 0 3px rgba(58, 227, 116, 0.2);
  vertical-align: middle;
}

.so-smtp-diag__embed .counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: #8157f6;
  font-size: 14px;
  font-weight: 600;
  font-family: Roboto, system-ui, sans-serif;
}

.so-smtp-diag__embed .inbox {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 0;
}

.so-smtp-diag__embed .inbox th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8e8e9e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.so-smtp-diag__embed .inbox td {
  padding: 12px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.so-smtp-diag__embed .inbox-row {
  cursor: pointer;
}

.so-smtp-diag__embed .inbox-row:hover td {
  background: rgba(129, 87, 246, 0.12);
}

.so-smtp-diag__embed .tls-badge,
.so-smtp-diag__embed .outcome {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: #22223b;
  color: #e6e6f0;
}

.so-smtp-diag__embed .outcome-ok,
.so-smtp-diag__embed .tls-starttls,
.so-smtp-diag__embed .tls-implicit {
  background: rgba(58, 227, 116, 0.15);
  color: #3ae374;
}

.so-smtp-diag__embed .outcome-reject,
.so-smtp-diag__embed .outcome-error {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
}

.so-smtp-diag__embed .actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 20px;
}

.so-smtp-diag__embed .btn-secondary,
.so-smtp-diag__embed a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 66px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.so-smtp-diag__embed .btn-secondary:hover,
.so-smtp-diag__embed a.btn-secondary:hover {
  border-color: #8157f6;
  color: #fff;
  background: rgba(129, 87, 246, 0.2);
}

.so-smtp-diag__share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 8px;
  margin-bottom: 24px;
}

.so-smtp-diag__share .mg-tools-share__btn,
.so-smtp-diag__share button,
.so-smtp-diag__share a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 66px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1a1a30;
  color: #c9b6ff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.so-smtp-diag__share a:hover,
.so-smtp-diag__share button:hover {
  color: #fff;
  border-color: #8157f6;
}

/* Письмо: вкладки и панели */
.so-smtp-diag__embed .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.so-smtp-diag__embed .tab {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.so-smtp-diag__embed .tab.active,
.so-smtp-diag__embed .tab:hover {
  background: #8157f6;
  border-color: #8157f6;
  color: #fff;
}

.so-smtp-diag__embed .tabpane {
  display: none;
}

.so-smtp-diag__embed .tabpane.active {
  display: block;
}

.so-smtp-diag__embed .msg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.so-smtp-diag__embed pre.dialog,
.so-smtp-diag__embed pre.body {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: #0e0e1a;
  color: #e6e6f0;
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
}

.so-smtp-diag__embed .dir-C {
  color: #c9b6ff;
}

.so-smtp-diag__embed .dir-S {
  color: #3ae374;
}

.so-smtp-diag__embed .steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.so-smtp-diag__embed .step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 4px 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.so-smtp-diag__embed .step-label {
  font-weight: 600;
  color: #fff;
}

.so-smtp-diag__embed .step-detail {
  grid-column: 2;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.so-smtp-diag__embed .html-preview {
  width: 100%;
  min-height: 420px;
  border: 0;
  border-radius: 14px;
  background: #fff;
}

/* Кросс-селл / «следующий шаг» из share — тёмный фон */
.so-smtp-diag__embed + .so-smtp-diag__share ~ .mg-tools-share__next,
.mg-smtp-diag--session .mg-tools-share__next,
.mg-smtp-diag--session .mg-tools-share__promo {
  color: rgba(255, 255, 255, 0.8);
}

.mg-smtp-diag--session .mg-tools-share__next a,
.mg-smtp-diag--session .mg-tools-cross-sell a,
.mg-smtp-diag--session .mg-tools-affiliate-teaser a {
  color: #c9b6ff;
}

.mg-smtp-diag--session .mg-tools-cross-sell,
.mg-smtp-diag--session .mg-tools-affiliate-teaser {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 16px;
}

.mg-smtp-diag--session .mg-tools-cross-sell__title {
  font-family: Unbounded, system-ui, sans-serif;
  color: #fff;
}

@container tc (max-width: 1100px) {
  .so-smtp-diag__creds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container tc (max-width: 900px) {
  .so-smtp-diag__term {
    grid-template-columns: 1fr;
  }

  .so-smtp-diag__rail {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-direction: row;
    flex-wrap: wrap;
  }

  .so-smtp-diag__rail-label {
    width: 100%;
  }

  .so-smtp-diag__rail-item {
    width: auto;
    flex: 1 1 auto;
  }
}

@media (max-width: 639px) {
  .so-tc.so-smtp-diag .th {
    padding-top: 88px;
  }

  .so-smtp-diag__term {
    width: calc(100% - 24px);
    margin-bottom: 40px;
    border-radius: 16px;
  }

  .so-smtp-diag__screen {
    padding: 20px 16px 28px;
  }

  .so-smtp-diag__creds {
    grid-template-columns: 1fr;
  }

  .so-tc.so-smtp-diag .btn--xl {
    width: 100%;
  }
}
