:root {
  --bg: #f6f8fb;
  --card: #fff;
  --text: #17212b;
  --muted: #5b6b7a;
  --border: #e4e9f0;
  --shadow: 0 2px 10px rgba(16,24,40,.06);
  --ok: #1a7f37;
  --warn: #b58100;
  --crit: #c62828;
  --link: #0a66c2;
  --chip: #eef3f8;
  --radius: 12px;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--sans);
  margin: 0;
  padding: 20px;
  background-color: transparent;
  color: var(--text);
  overflow: visible;
  height: auto;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: transparent;
  border-top: 1px solid var(--border);
  padding: 10px 0;
  z-index: 1000;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--link);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}

.btn:hover {
  background: #084d8f;
  border-color: #084d8f;
}

/* Icon-only button */
.btn-icon {
  width: 36px;
  padding: 8px;
  font-size: 16px;
  color: #ffffff;        /* ✅ makes the icon white */

}

/* inner footer content stays centered like other pages */
footer .footer-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: #333;
}
    .container {
      max-width: 1040px;
      margin: 0 auto;
    }

    h1 {
      font-size: 18px;
      font-weight: 700;
      margin: 0 0 16px 0;
      color: var(--text);
    }

    h2 {
      font-size: 16px;
      font-weight: 700;
      margin: 0 0 12px 0;
      color: var(--text);
    }

    .directsend-chip .fa-circle-question {
  color: #555;          /* neutral gray */
  margin-left: 6px;
  font-size: 0.86em;
}
    .badge {
      display: inline-block;
      padding: 2px 10px;
      border-radius: 999px;
      font-size: 0.85rem;
      border: 1px solid transparent;
      line-height: 1.4;
      white-space: nowrap;
      font-weight: 600; /* NEW: keeps pill text consistent */
      vertical-align: middle; /* NEW: better baseline alignment next to headings */
    }
  
    .badge-ok { background: #e7f7ee; color: #137a3a; border-color: #bfe8cf; }
    .badge-neutral {background:#e9ecef; border:1px solid #d0d7de; font-size:13px; color:#222}
    .badge-warn { background: #fff6df; color: #8a5a00; border-color: #ffe1a3; }
    .badge-danger { background: #ffe8e8; color: #a40000; border-color: #ffbdbd; }
  
    .hint-text {
      font-size: 0.92rem;
      color: #555;
      margin: 8px 0 0 0;
      line-height: 1.35;
    }
  
    .warning-icon {
      color: #d9534f;
      margin-left: 6px;
      cursor: help;
      vertical-align: middle;
    }
  
    .dns-pre {
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: anywhere;
      max-width: 100%;
      background: #f6f8fa;
      padding: 12px;
      border-radius: 10px;
      border: 1px solid #e1e4e8;
      margin: 0;
      font-size: 0.9rem;
    }
  
    /* Overview / posture panel */
    .posture-card {
      padding: 16px;
      border-radius: 14px;
      margin: 14px 0 12px 0;
      border: 1px solid #ddd;
      width: 100%;
    }
    .posture-good { background: #e9f8ef; border-color: #bfe8cf; }
    .posture-warning { background: #fff7e6; border-color: #ffe1a3; }
    .posture-critical { background: #ffeded; border-color: #ffbdbd; }
  
    .overview-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 10px;
    }
  
    .overview-left {
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-width: 0;
      flex: 1 1 auto;
    }
  
    .overview-title {
      font-size: 1.05rem;
      font-weight: 700;
      color: #2b2b2b;
    }
  
    .overview-domain {
      font-size: 1.22rem;
      font-weight: 800;
      color: #111;
      word-break: break-word;
    }
  
  

    .overview-chips{
  display: flex;
  flex-wrap: nowrap;   /* never wrap */
  gap: 8px;
  overflow: visible;   /* IMPORTANT: do not clip the last chip */
}



.overview-chips .meta-chip,
.overview-chips .badge{
  flex: 0 0 auto;
  white-space: nowrap;
}


  
    .meta-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.75);
      border: 1px solid rgba(0,0,0,0.08);
      font-size: 0.85rem;
      color: #333;
    }
    .meta-chip i { color: #555; }
  
    .overview-right {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }
  
    .overview-logo {
      height: 22px;
      width: auto;
      object-fit: contain;
      opacity: 0.95;
    }
  
    /* Signal tiles row */
    .signal-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-top: 12px;
    }
  
    .signal {
      background: rgba(255,255,255,0.70);
      border: 1px solid rgba(0,0,0,0.06);
      border-radius: 12px;
      padding: 12px;
      min-width: 0;
    }
  
    .signal-label {
      font-size: 0.78rem;
      color: #555;
      margin-bottom: 8px;
      letter-spacing: 0.25px;
      text-transform: uppercase;
    }
  
    .signal-value {
      display: flex;
      gap: 8px;
      align-items: center;
    }
  
    .signal-subtext {
      margin-top: 8px;
      
      
      
      font-size: 0.75rem;
  color: #666;
  font-weight: 600;
  margin-right: 2px;
    }
  
    /* Adds faint divider + spacing above the chip row (used by DMARC/MX) */
    .signal-divider {
      margin-top: 6px;
      padding-top: 6px;
      border-top: 1px solid rgba(0,0,0,0.06);
    }
  
    /* Invisible row to shift DMARC/MX chips down to align with SPF metrics row */
    .invisible-row {
      visibility: hidden; /* occupies space but not visible */
      height: 18px;       /* tweak if needed to perfectly match SPF */
      margin-top: 6px;    /* matches spacing used by SPF metrics row */
    }
  
    /* SPF mini-metrics inside SPF tile */
    .spf-metrics {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 6px;
      padding-top: 6px;
      border-top: 1px solid rgba(0,0,0,0.06);
    }
  
    .metric-title {
      font-size: 0.75rem;
      color: #666;
      margin-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: 0.2px;
    }
  
    /* Concerns callout */
    .callout {
      border-radius: 12px;
      padding: 14px;
      border: 1px solid #ddd;
      margin: 12px 0 14px 0;
      width: 100%;
    }
    .callout-warn {
      background: #fff6df;
      border-color: #ffe1a3;
    }
    .callout ul { margin: 10px 0 0 0; padding-left: 18px; }
    .callout li { margin: 4px 0; }
  
    /* Section head + copy button */
    .section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 26px;
      padding-bottom: 6px;
      border-bottom: 1px solid #ccc;
      gap: 12px;
    }
  
    .section-head h2 {
      font-size: 1.2rem;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin: 0;
    }
  
    /* NEW: For headings like <h2 class="section-heading">SPF Records <span class="badge">...</span></h2> */
    .section-heading {
      font-size: 1.2rem;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin: 0;
    }
  
    .copy-btn {
      background: #fff;
      border: 1px solid #ddd;
      border-radius: 12px;
      padding: 6px 10px;
      cursor: pointer;
      font-size: 0.9rem;
      white-space: nowrap;
    }
    .copy-btn:hover { background: #f6f8fa; }
  
    /* SPF summary card (kept) */
    .spf-summary {
      padding: 12px;
      border: 1px solid #ddd;
      border-radius: 10px;
      margin: 10px 0 14px 0;
      background: #fafafa;
    }
  
    .meter {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      padding: 2px 8px;
      border-radius: 8px;
      background: #eee;
      margin: 0 6px;
    }
  
    /* ========================= */
    /* NEW: Recursive SPF tree UI */
    /* ========================= */
    .run-another-wrapper {
  display: flex;
  justify-content: center;
  margin: 28px 0 12px;   /* IMPORTANT: bottom margin is small */
}

.run-another-card {
  width: 100%;
  max-width: 620px;
  padding: 18px;
  background: #f8f9fb;
  border: 1px dashed #d0d7de;
  border-radius: 14px;
}

.run-another-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.run-another-row {
  display: flex;
  gap: 10px;
}

.run-another-row input {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.run-another-help {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.3;
}

.run-another-divider {
  margin: 34px 0 12px;
  text-align: center;
  position: relative;
}

.run-another-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e6e6e6;
  z-index: 0;
}

.run-another-divider span {
  position: relative;
  background: #fff;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #777;
  z-index: 1;
}
    .spf-recursive {
      border: 1px solid #ddd;
      border-radius: 10px;
      padding: 10px 12px;
      background: #fafafa;
      margin: 12px 0 14px 0;
    }
  
    .spf-recursive summary {
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 600;
      gap: 10px;
    }
  
    .lookup-pill {
      font-size: 0.82rem;
      padding: 2px 10px;
      border-radius: 999px;
      background: #eee;
      border: 1px solid #ddd;
      font-weight: 600;
      white-space: nowrap;
    }
  
    .spf-node-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      margin-bottom: 6px;
      min-width: 0;
    }
  
    .spf-node-header .domain {
      font-weight: 700;
      color: #222;
      word-break: break-word;
    }
  
    .spf-record-card {
      background: #f2f2f2;
      border-radius: 10px;
      padding: 10px;
      margin: 6px 0 8px;
      border: 1px solid rgba(0,0,0,0.04);
    }
  
.extval-chip-btn i {
  margin-right: 6px;
  font-size: 0.9em;
}

    .spf-child-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 10px 0 6px;
      min-width: 0;
    }
  
    .bubble {
      display: inline-flex;
      min-width: 22px;
      height: 22px;
      padding: 0 7px;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      background: #e7f7ee;
      color: #137a3a;
      border: 1px solid #bfe8cf;
      font-size: 0.8rem;
      font-weight: 700;
      flex: 0 0 auto;
    }
    .toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  max-width: min(420px, calc(100vw - 36px));

  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px 12px;

  font-size: 14px;
  line-height: 1.25;

  box-shadow: 0 10px 30px rgba(0,0,0,0.25);

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast .toast-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast .toast-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
}

.toast.success .toast-icon {
  background: #1f7a3a;
}

.toast.error .toast-icon {
  background: #a40000;
}

.toast .toast-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Optional: bottom-center instead of bottom-right */
@media (max-width: 560px) {
  .toast {
    right: 50%;
    transform: translate(50%, 10px);
  }
  .toast.show {
    transform: translate(50%, 0);
  }
}
    .child-label {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 0.93rem;
      color: #222;
      overflow-wrap: anywhere;
      min-width: 0;
    }
    .spf-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap; /* safe for mobile */
}

.spf-inline-label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
  margin-right: 2px;
}
    .spf-notes {
      margin: 6px 0 0 18px;
      padding-left: 0;
      color: #666;
      font-size: 0.9rem;
    }
  
    .spf-notes li { margin: 3px 0; }
    
    /* Make summary look like a clickable control */
.spf-recursive summary.spf-summary-row{
  list-style: none;                /* hides default marker in some browsers */
  cursor: pointer;
  user-select: none;
  padding: 10px 10px;
  border-radius: 10px;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  transition: background 120ms ease, border-color 120ms ease;
}

.spf-recursive summary.spf-summary-row:hover{
  background: #eef2f7;
  border-color: #d0d7de;
}

/* Layout: left label + right pill */
.spf-summary-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.spf-summary-left{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

/* Chevron indicator */
.spf-summary-row .chev{
  width: 0;
  height: 0;
  border-left: 6px solid #555;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: rotate(0deg);
  transition: transform 120ms ease;
  opacity: 0.9;
}

/* Rotate chevron when open */
.spf-recursive[open] summary .chev{
  transform: rotate(90deg);
}

/* Hint text */
.expand-hint{
  font-size: 0.85rem;
  color: #666;
  font-weight: 400;
}

/* When open, change hint text feel (optional) */
.spf-recursive[open] .expand-hint{
  color: #888;
}
    /* DKIM cards (cleaner output) */
    .dkim-section {
      display: flex;
      flex-direction: column;
      gap: 14px;
      margin-top: 10px;
    }
  
    .dkim-selector {
      border: 1px solid #e1e4e8;
      border-radius: 12px;
      padding: 12px;
      background: #fafafa;
    }
  
    .dkim-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }
  
    .dkim-name {
      font-weight: 600;
      font-size: 0.95rem;
      color: #222;
      word-break: break-word;
    }
  
    .dkim-fqdn {
      font-weight: normal;
      color: #555;
      margin-left: 4px;
      font-size: 0.9rem;
    }
  
    .dkim-record {
      margin-top: 8px;
      font-size: 0.85rem;
      line-height: 1.35;
    }
  
    .dkim-missing-text {
      margin-top: 8px;
      font-size: 0.9rem;
      color: #666;
      font-style: italic;
    }
  
    /* Lookup form */
    .lookup-form {
      margin-top: 30px;
      background: #fafafa;
      padding: 16px;
      border-radius: 12px;
      border: 1px solid #eee;
    }
  
    .lookup-form label {
      display: block;
      margin-bottom: 5px;
      font-weight: bold;
    }
  
    .lookup-form input[type="text"] {
      width: 100%;
      padding: 10px;
      margin-bottom: 10px;
      border-radius: 10px;
      border: 1px solid #ccc;
    }
  
    .lookup-form input[type="submit"] {
      background-color: #2b6cb0;
      color: #fff;
      border: none;
      padding: 10px 18px;
      border-radius: 10px;
      cursor: pointer;
      font-weight: 600;
    }
  
    .lookup-form input[type="submit"]:hover {
      background-color: #245a92;
    }
  
    .bulk-btn {
      display: block;
      width: 300px;
      margin: 12px auto 0 auto;
      padding: 10px 0;
      background-color: #6c757d;
      color: #fff;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      text-align: center;
      text-decoration: none;
    }

/* Clickable DMARC external validation chip */
.extval-chip-btn{
  cursor: pointer;
}
.extval-chip-btn i {
  margin-left: 6px;
  font-size: 0.75em;
}
/* Expand box */
.extval-panel{
  margin-top: 10px;
  border: 1px solid #e1e4e8;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.extval-panel-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.extval-title{
  font-weight: 800;
  color: #333;
}

.extval-close{
  border: 1px solid #d0d7de;
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: 800;
}

.extval-close:hover{
  background: #f6f8fa;
}

.extval-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.extval-item{
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fafafa;
  padding: 10px 12px;
}

.extval-item-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.extval-item-status{
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.extval-row{
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  padding: 3px 0;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.extval-row:first-of-type{
  border-top: none;
}

.extval-key{
  font-weight: 700;
  color: #333;
  text-align: right;
  white-space: nowrap;
  font-size: 0.86rem;
}

.extval-val{
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.25;
}


    /* --- Modal layout guardrails --- */
#ds-modal {
  box-sizing: border-box;
}

/* Ensure signal tiles can shrink and wrap content */
#ds-modal .signal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* Critical: allow children to shrink */
#ds-modal .signal {
  min-width: 0;
}

/* Make long hostnames/IP lists wrap instead of overflow */
#ds-modal .signal .badge,
#ds-modal .signal .signal-value {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

/* Optional: make "host" badges less pill-like if long */
#ds-modal .signal .badge {
  display: inline-block;
  line-height: 1.3;
}
/* --- SMTP table improvements inside modal --- */
#ds-modal table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* IMPORTANT: prevents content from stretching columns */
}

#ds-modal th,
#ds-modal td {
  border: 1px solid #e1e4e8;
  padding: 8px 10px;
  vertical-align: top;
}

/* Keep Stage/Code narrow and predictable */
#ds-modal th:nth-child(1), #ds-modal td:nth-child(1) { width: 160px; }
#ds-modal th:nth-child(2), #ds-modal td:nth-child(2) { width: 90px; }

/* Response gets the rest */
#ds-modal th:nth-child(3), #ds-modal td:nth-child(3) { width: auto; }

/* Make response text readable and bounded */
#ds-modal td pre {
  margin: 0;
  white-space: pre-wrap;      /* preserve newlines but wrap long lines */
  overflow-wrap: anywhere;    /* break long tokens */
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.25;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 10px;
  padding: 10px;
  max-height: 240px;          /* prevent giant EHLO blocks from taking over */
  overflow: auto;             /* scroll inside the cell */
}

/* Optional: header styling */
#ds-modal th {
  background: #f4f4f4;
  font-weight: 700;
}  

/* ===========================
   Direct Send Modal (EOP-only)
   =========================== */

   #ds-modal { overflow-x: auto; overflow-y: auto; } /* allow modal horizontal scroll if host is extremely long */

#ds-modal .ds-meta-row {
  display: grid;
  grid-template-columns: 140px 1fr auto; /* label | host | close */
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

#ds-modal .ds-meta-label {
  font-size: 0.78rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.25px;
  font-weight: 700;
}

#ds-modal .ds-meta-value {
  min-width: 0; /* allows the host area to size naturally */
}
.results-title {
  margin: 0;
}

.results-meta {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280; /* neutral gray */
}
#ds-modal .ds-host-pill {
  display: inline-block;
  max-width: none;        /* IMPORTANT: don't constrain width */
  white-space: nowrap;    /* IMPORTANT: no wrap */
  overflow: visible;      /* allow full host text */
}

#ds-modal .ds-meta-actions {
  display: flex;
  justify-content: flex-end;
}

    .bulk-btn:hover { background-color: #5a6268; }
  
    @media (max-width: 780px) {
      .signal-row { grid-template-columns: 1fr; }
    }
  
    @media print {
      footer, .lookup-form, .copy-btn { display: none !important; }
      body { background: #fff; }
      .container { box-shadow: none; margin: 0; max-width: none; padding-bottom: 20px; }
    }
    .subline {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
}
.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

    

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.lookup-form {
  margin-bottom: 0;
}

.lookup-form label,
label {
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.lookup-form textarea,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  background: var(--card);
  color: var(--text);
}

.lookup-form textarea:focus,
textarea:focus {
  outline: 3px solid rgba(10,102,194,.18);
  outline-offset: 2px;
  border-color: var(--link);
}

.btn-primary {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #084d8f;
  border-color: #084d8f;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 12px;
}

.alert-error {
  background: #fee;
  border: 1px solid #fcc;
  color: #a00;
}
