/* ============================================================
   tool.css — shared tool-page styles used by all 4 category
   bases (b2b / social / downloader / email).
   ============================================================ */

/* ─── Breadcrumb ─────────────────────────────────────────── */
.dx .breadcrumb {
  color: var(--fg-dim);
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 28px;
}
.dx .breadcrumb a { color: var(--fg-muted); }
.dx .breadcrumb a:hover { color: var(--fg); }
.dx .breadcrumb .bc-sep { color: var(--fg-faint); }
.dx .breadcrumb .bc-curr { color: var(--fg); }

/* ─── Tool hero ──────────────────────────────────────────── */
.dx .tool-hero { position: relative; padding: 64px 0 80px; overflow: hidden; }
.dx .tool-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 980px) { .dx .tool-hero-grid { grid-template-columns: 1fr; gap: 32px; } }

.dx .tool-hero-left { display: flex; flex-direction: column; gap: 20px; }
.dx .tool-hero-left h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0;
}

/* ─── Tool form ──────────────────────────────────────────── */
.dx .tool-form {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-top: 8px;
}
.dx .tool-form .field-label { margin-bottom: 6px; }
.dx .tool-form .form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 600px) { .dx .tool-form .form-row { grid-template-columns: 1fr; } }
.dx .tool-form textarea.input { min-height: 140px; padding: 12px 14px; resize: vertical; line-height: 1.5; }

.dx .tool-submit { width: 100%; justify-content: center; margin-top: 4px; }
.dx .tool-submit .tool-submit-idle,
.dx .tool-submit .tool-submit-busy {
  display: inline-flex; align-items: center; gap: 8px;
}
.dx .tool-submit[disabled] { opacity: 0.85; cursor: progress; }

/* animated dots in "Agent working…" state */
.dx .dots { display: inline-flex; gap: 3px; }
.dx .dots span {
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
  animation: tool-dot 1.2s var(--ease) infinite;
}
.dx .dots span:nth-child(2) { animation-delay: 200ms; }
.dx .dots span:nth-child(3) { animation-delay: 400ms; }
@keyframes tool-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-3px); opacity: 1; }
}

/* ─── B2B preview card ───────────────────────────────────── */
.dx .tool-preview {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.dx .tool-preview-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-inset);
}
.dx .tool-preview-body { position: relative; padding: 18px; max-height: 460px; overflow: hidden; }
.dx .tool-preview-fade {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 80px;
  background: linear-gradient(180deg, transparent, var(--bg-elev-1) 80%);
  pointer-events: none;
}
.dx .preview-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dx .preview-table th, .dx .preview-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--fg);
}
.dx .preview-table th {
  background: transparent;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.dx .preview-table tr:last-child td { border-bottom: none; }

/* ─── Social metrics grid ────────────────────────────────── */
.dx .tool-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.dx .metric-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  overflow: hidden;
}
.dx .metric-card .m-lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.dx .metric-card .m-num {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.dx .metric-card .m-delta { font-family: var(--font-mono); font-size: 11.5px; color: var(--success); }
.dx .metric-card .m-delta.down { color: var(--orange); }

/* ─── Results stream ─────────────────────────────────────── */
.dx .tool-results-section { padding: 32px 0 64px; }
.dx .tool-results-section .results-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.dx .results-table-wrap { max-height: 480px; overflow: auto; }

/* ─── Recent runs feed ───────────────────────────────────── */
.dx .tool-recent { padding: 0 0 96px; }
.dx .recent-runs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .dx .recent-runs { grid-template-columns: 1fr; } }
.dx .recent-run {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-muted);
}
.dx .recent-run .rr-top { display: flex; justify-content: space-between; gap: 12px; color: var(--fg-dim); }
.dx .recent-run .rr-q { color: var(--fg); font-family: var(--font-sans); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.dx .recent-run .rr-meta { color: var(--success); }
.dx .recent-empty { padding: 24px; text-align: center; }

/* ─── Bento features specific to tools ───────────────────── */
.dx .tool-features { padding: 32px 0 96px; }
.dx .bento-tool { grid-template-columns: repeat(4, 1fr); }
.dx .bento-tool .b { grid-column: span 2; }
@media (max-width: 900px) { .dx .bento-tool { grid-template-columns: 1fr; } .dx .bento-tool .b { grid-column: auto; } }

/* ─── FAQ section ────────────────────────────────────────── */
.dx .tool-faq-section { padding: 0 0 96px; }
.dx .faq-container { max-width: 760px; }

/* ─── DOWNLOADER ─────────────────────────────────────────── */
.dx .tool-hero-downloader { padding: 80px 0 120px; }
.dx .dl-hero-stack {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.dx .dl-h1 {
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0;
}
.dx .dl-sub { margin: 0; }
.dx .dl-form {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px;
}
@media (max-width: 700px) { .dx .dl-form { grid-template-columns: 1fr; } }
.dx .dl-input { height: 52px; font-size: 15px; border: none; background: transparent; box-shadow: none !important; }
.dx .dl-input:focus { box-shadow: none !important; }
.dx .dl-submit { height: 52px; padding: 0 28px; }
.dx .dl-meta { margin-top: 14px; }
.dx .dl-steps { padding: 64px 0; }
.dx .dl-result {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}

/* ─── EMAIL pipeline ─────────────────────────────────────── */
.dx .tool-hero-email { padding: 64px 0 56px; }
.dx .email-head { max-width: 720px; }
.dx .email-pipeline {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 6px;
  margin: 40px 0 32px;
  padding: 14px 16px;
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.dx .ep-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--bg-elev-2);
  color: var(--fg-muted);
  border: 1px solid var(--line);
  animation: ep-flash 4s var(--ease) infinite;
  animation-delay: var(--ep-delay);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}
.dx .ep-step .ep-i { width: 14px; height: 14px; color: var(--orange); }
.dx .ep-step .ep-i svg { width: 100%; height: 100%; }
.dx .ep-step .ep-lbl { color: var(--fg); }
.dx .ep-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent);
  position: relative; overflow: hidden;
}
.dx .ep-line::after {
  content: '';
  position: absolute; top: 0; left: -30%;
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  animation: ep-flow 4s linear infinite;
  animation-delay: var(--ep-delay);
}
@keyframes ep-flash {
  0%, 80%, 100% { background: var(--bg-elev-2); border-color: var(--line); }
  10%, 30%      { background: var(--orange-tint); border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-tint); }
}
@keyframes ep-flow {
  0%   { left: -30%; }
  100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .dx .ep-step, .dx .ep-line::after { animation: none; }
}
@media (max-width: 760px) {
  .dx .email-pipeline {
    grid-template-columns: 1fr;
  }
  .dx .ep-line { display: none; }
}

.dx .email-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .dx .email-grid { grid-template-columns: 1fr; } }
.dx .email-form { margin-top: 0; }

.dx .email-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dx .email-stats .stat {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.dx .email-stats .stat-lbl {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-bottom: 6px;
}
.dx .email-stats .stat-num {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.dx .email-stats .stat-deliverable .stat-num { color: var(--success); }
.dx .email-stats .stat-risky .stat-num       { color: var(--orange); }
.dx .email-stats .stat-invalid .stat-num     { color: var(--fg-dim); }
.dx .email-stats .stat-disposable .stat-num  { color: #FF8B6B; }

.dx .live-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-dim);
  margin-top: 6px;
}

/* ─── Tab pills (social inputs) ──────────────────────────── */
.dx .tab-pills {
  display: inline-flex;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 10px;
}
.dx .tab-pills label {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.dx .tab-pills label:hover { color: var(--fg); }
.dx .tab-pills input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.dx .tab-pills input[type="radio"]:checked + label { background: var(--bg-elev-1); color: var(--fg); }

/* ─── pbar (shared with results) ─────────────────────────── */
.dx .pbar { width: 160px; height: 4px; background: var(--bg-elev-2); border-radius: 100px; overflow: hidden; }
.dx .pbar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--orange), var(--orange-soft)); transition: width 240ms var(--ease); }
.dx .results-card { background: var(--bg-elev-1); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.dx .results-header { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.dx .results-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dx .results-progress { display: flex; align-items: center; gap: 12px; }
.dx .results-table { width: 100%; border-collapse: collapse; }
.dx .results-table th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); padding: 12px 16px; background: var(--bg-inset); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.dx .results-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--fg); }
.dx .results-table tr:last-child td { border-bottom: none; }
.dx .results-table tr:hover td { background: var(--bg-elev-2); }
.dx .results-actions { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* verdict pills for email rows */
.dx .verdict-pill { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 100px; display: inline-block; }
.dx .verdict-deliverable, .dx .verdict-probable-deliverable { background: var(--success-tint); color: var(--success); }
.dx .verdict-risky-role, .dx .verdict-risky-disposable, .dx .verdict-undeliverable { background: rgba(255, 92, 26, 0.1); color: #FF8B6B; }
.dx .verdict-invalid { background: var(--bg-elev-2); color: var(--fg-dim); }
