*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0f0f13;
  color: #e2e8f0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* Header */
header {
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
header p {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 2px;
}
.header-icon { font-size: 2rem; }

/* Privacy disclaimer */
.disclaimer {
  background: rgba(74,222,128,0.06);
  border-bottom: 1px solid rgba(74,222,128,0.15);
  padding: 0.6rem 2rem;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}
.disclaimer strong { color: #94a3b8; }

/* Main layout */
main {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tab {
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 10px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  transition: all 0.2s;
}
.tab:hover { border-color: #7c3aed; color: #c4b5fd; }
.tab.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }

/* Input card */
.input-card {
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 14px;
  padding: 1.75rem;
}
.input-card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: #c4b5fd;
}
.tab-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
/* Deliverability step blocks */
.step-block {
  margin-bottom: 1.5rem;
}
.step-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.addr-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.test-addr-display {
  flex: 1;
  background: #0f0f13;
  border: 1px solid #7c3aed;
  border-radius: 9px;
  padding: 0.7rem 1rem;
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  color: #a78bfa;
  word-break: break-all;
}
.copy-btn {
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.copy-btn:hover { opacity: 0.85; }
.copy-btn.copied { background: #16a34a; }
.refresh-btn {
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.6rem 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}
.refresh-btn:hover { border-color: #7c3aed; color: #c4b5fd; }

.open-btn {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  text-decoration: none;
  border-radius: 9px;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s;
  margin-bottom: 0.5rem;
}
.open-btn:hover { opacity: 0.88; }

.addr-input {
  flex: 1;
  background: #0f0f13;
  border: 1px solid #2d2d3d;
  border-radius: 9px;
  color: #e2e8f0;
  padding: 0.7rem 1rem;
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  width: 100%;
}
.addr-input:focus { outline: none; border-color: #7c3aed; }
.addr-input::placeholder { color: #475569; }
.addr-input:valid { border-color: #4ade80; }

.step-hint {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 0.45rem;
  line-height: 1.5;
}

/* How it works */
.how-it-works {
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-top: 0.25rem;
}
.how-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 0.6rem;
}
.how-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0;
}
.how-list li {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
  padding-left: 1.1rem;
  position: relative;
}
.how-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #7c3aed;
  font-size: 0.75rem;
}
.how-list li strong { color: #94a3b8; }
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.fields-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
  .fields, .fields-2 { grid-template-columns: 1fr; }
}
.field label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.field input {
  width: 100%;
  background: #0f0f13;
  border: 1px solid #2d2d3d;
  border-radius: 8px;
  color: #e2e8f0;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.field input:focus {
  outline: none;
  border-color: #7c3aed;
}
.field input::placeholder { color: #475569; }

.check-btn {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  width: 100%;
}
.check-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.check-btn:active { transform: translateY(0); }
.check-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Results */
#dnsResults { margin-top: 2rem; }
#deliverResults { margin-top: 1.5rem; }

/* Score */
.score-section {
  text-align: center;
  margin-bottom: 2rem;
}
.score-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #1a1a24;
  border: 2px solid #2d2d3d;
  border-radius: 50%;
  width: 130px;
  height: 130px;
  justify-content: center;
  box-shadow: 0 0 30px rgba(124,58,237,0.2);
}
.score-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
}
.score-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}
.score-high .score-number { color: #4ade80; }
.score-mid .score-number { color: #fb923c; }
.score-low .score-number { color: #f87171; }
.score-high { border-color: #4ade80; }
.score-mid { border-color: #fb923c; }
.score-low { border-color: #f87171; }
.score-domain {
  margin-top: 0.75rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Checks grid */
.checks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .checks-grid { grid-template-columns: 1fr; }
}

/* Check card */
.check-card {
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  border-left: 4px solid #2d2d3d;
}
.check-card.status-pass { border-left-color: #4ade80; }
.check-card.status-warn { border-left-color: #fb923c; }
.check-card.status-fail { border-left-color: #f87171; }
.check-card.status-skip { border-left-color: #475569; }
.check-card.full-width { grid-column: 1 / -1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c4b5fd;
}
.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-pass { background: rgba(74,222,128,0.15); color: #4ade80; }
.badge-warn { background: rgba(251,146,60,0.15); color: #fb923c; }
.badge-fail { background: rgba(248,113,113,0.15); color: #f87171; }
.badge-skip { background: rgba(71,85,105,0.15); color: #94a3b8; }

.card-detail {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.card-value {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-family: 'Consolas', monospace;
  color: #a78bfa;
  word-break: break-all;
  background: rgba(124,58,237,0.08);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
}

/* Toggle */
.check-toggle {
  background: none;
  border: none;
  color: #7c3aed;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  margin-top: 0.5rem;
  margin-right: 1rem;
  text-decoration: underline;
  display: inline-block;
}
.check-toggle:hover { color: #a78bfa; }
.fix-toggle { color: #f59e0b; }
.fix-toggle:hover { color: #fbbf24; }

.card-extra { margin-top: 0.75rem; }

/* Fix box */
.fix-box {
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  color: #fde68a;
  white-space: pre-wrap;
  line-height: 1.6;
  font-family: 'Consolas', monospace;
}

/* Blacklist tags */
.bl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.bl-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 500;
}
.bl-tag-listed { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.bl-tag-clean  { background: rgba(71,85,105,0.15);   color: #64748b;  border: 1px solid rgba(71,85,105,0.3); }

/* Error */
.error-box {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: #f87171;
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Deliverability results */
.deliver-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 560px) { .deliver-summary { grid-template-columns: 1fr; } }

.deliver-meta { display: flex; flex-direction: column; gap: 0.4rem; }
.deliver-verdict {
  font-size: 1.5rem;
  font-weight: 800;
}
.verdict-excellent { color: #4ade80; }
.verdict-good      { color: #a3e635; }
.verdict-fair      { color: #fb923c; }
.verdict-poor      { color: #f87171; }

.deliver-sub {
  font-size: 0.82rem;
  color: #64748b;
}
.test-addr-box {
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-family: 'Consolas', monospace;
  color: #a78bfa;
  word-break: break-all;
  margin-top: 0.25rem;
}

.sa-section {
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.sa-section h3 {
  font-size: 0.88rem;
  color: #c4b5fd;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.sa-score-line {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}
.sa-score-line strong { color: #e2e8f0; }

.sa-rules { display: flex; flex-direction: column; gap: 0.35rem; }
.sa-rule {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
  gap: 0.5rem;
}
.sa-rule-name { font-family: 'Consolas', monospace; color: #94a3b8; flex: 1; }
.sa-rule-desc { color: #64748b; font-size: 0.75rem; flex: 2; }
.sa-rule-score { font-weight: 700; font-family: 'Consolas', monospace; white-space: nowrap; }
.sa-rule-score.pos { color: #f87171; }
.sa-rule-score.neg { color: #4ade80; }

.no-rules { font-size: 0.82rem; color: #4ade80; }

/* Lead magnet CTA */
.lead-magnet {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(109,40,217,0.08));
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-top: 1.25rem;
}
.lead-magnet-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 0.5rem;
}
.lead-magnet-summary {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.lead-magnet-summary strong { color: #e2e8f0; }
.lead-magnet-fixes {
  list-style: none;
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.lead-magnet-fixes li {
  font-size: 0.82rem;
  color: #94a3b8;
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.5;
}
.lead-magnet-fixes li::before { position: absolute; left: 0; }
.fix-item::before  { content: "⚠"; color: #fb923c; }
.good-item::before { content: "✓"; color: #4ade80; }
.lead-cta {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
}
.lead-cta:hover { opacity: 0.88; }
.lead-cta-sub {
  font-size: 0.75rem;
  color: #475569;
  margin-top: 0.6rem;
}

/* Subject line checker results */
.subject-result-card {
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.subject-result-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.subject-original {
  font-size: 0.95rem;
  color: #e2e8f0;
  font-style: italic;
  line-height: 1.5;
}
.subject-verdict {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.risk-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.risk-low  { background: rgba(74,222,128,0.15);  color: #4ade80; }
.risk-med  { background: rgba(251,146,60,0.15);  color: #fb923c; }
.risk-high { background: rgba(248,113,113,0.15); color: #f87171; }
.subject-score {
  font-size: 0.82rem;
  font-weight: 600;
}
.subject-section {
  border-top: 1px solid #2d2d3d;
  padding-top: 1rem;
}
.subject-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.trigger-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.trigger-tag {
  background: rgba(248,113,113,0.12);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.3);
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
}
.no-triggers {
  font-size: 0.82rem;
  color: #4ade80;
}
.subject-issues {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.subject-issue {
  font-size: 0.82rem;
  color: #94a3b8;
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.5;
}
.subject-issue::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #fb923c;
}
.rewrites-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rewrite-item {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  background: rgba(124,58,237,0.07);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
}
.rewrite-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #7c3aed;
  background: rgba(124,58,237,0.2);
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rewrite-text {
  font-size: 0.85rem;
  color: #c4b5fd;
  line-height: 1.5;
}

.waiting-box {
  background: #1a1a24;
  border: 1px solid #2d2d3d;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}
