/* afterSpark Tools — Stylesheet
 * Extends auth.css (CSS variables already loaded) with tools-specific components.
 * Does NOT redefine :root — relies on variables from auth.css.
 */

/* ── Outer wrapper ─────────────────────────────────────────────── */

.tools-wrap {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Nav bar ───────────────────────────────────────────────────── */

.tools-nav {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tools-nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.tools-nav-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.tools-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tools-nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.tools-nav-link:hover { color: var(--text); }

.tools-nav-signup {
  font-size: 13px;
  font-weight: 600;
  color: #ff9933;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, #ff9933, #ff6600) border-box;
  border: 2px solid transparent;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.tools-nav-signup:hover { opacity: 0.85; transform: translateY(-1px); }

/* ── Inline tool links (in top nav) ────────────────────────────── */

.tools-nav-left {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.tools-nav-tools {
  display: flex;
  align-items: center;
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
  gap: 0;
}

.tools-nav-tool-link {
  position: relative;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 20px;
  white-space: nowrap;
  transition: color var(--transition);
}
.tools-nav-tool-link:hover { color: var(--text); }
.tools-nav-tool-link.active { color: var(--text); font-weight: 600; }

/* dot separators — inline flex items, centered automatically */
.tools-nav-sep {
  width: 3px;
  height: 3px;
  background: var(--border-focus);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Landing hero ──────────────────────────────────────────────── */

.tools-hero {
  text-align: center;
  padding: 72px 24px 56px;
  max-width: 720px;
  margin: 0 auto;
}

.tools-hero-badge {
  display: block;
  width: 225px;
  text-align: center;
  background: var(--orange-dim);
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 99px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
}

.tools-hero h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.tools-hero-gradient {
  background: linear-gradient(135deg, #ff9933 0%, #ff6600 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
}


.tools-hero p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.65;
  white-space: nowrap;
  margin: 0 auto;
}

/* ── Tool cards grid ───────────────────────────────────────────── */

.tool-cards {
  display: grid;
  grid-template-columns: repeat(3, 415px);
  gap: 20px;
  padding: 0 28px 80px;
  max-width: 1300px;
  margin: 0 auto;
  width: fit-content;
}

.tool-card, .tool-card * {
  user-select: text;
}

.tool-card-badge {
  position: absolute;
  top: 18px;
  right: -32px;
  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  font-size: 10px;
  font-family: ui-monospace, monospace;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 36px;
  transform: rotate(45deg);
  width: 120px;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.tool-card-badge.badge-popular {
  background: rgba(0,0,0,0.35);
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  transition: border-color var(--transition), transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card:last-child:nth-child(3n + 1) { grid-column: 2; }
.tool-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.tool-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-card-icon.orange { background: var(--orange-dim); color: var(--orange); }
.tool-card-icon.teal   { background: var(--teal-dim);   color: var(--teal);   }
.tool-card-icon.purple { background: var(--purple-dim); color: var(--purple); }

.tool-card-title {
  user-select: text;
  font-size: 15px;
  font-weight: 400;
  color: rgba(255,255,255,.75);
  line-height: 1.3;
}
.tool-card-title--orange,
.tool-card-title--teal,
.tool-card-title--purple,
.tool-card-title--blue { color: rgba(255,255,255,.75); }
.tool-card-icon.blue { background: rgba(10,102,194,.15); color: #0a66c2; }

.tool-card-desc {
  user-select: text;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 20px;
}

.tool-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tool-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tool-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
  border: 1px solid rgba(255,153,51,.35);
  border-radius: 99px;
  padding: 7px 18px;
  transition: background var(--transition), border-color var(--transition);
  align-self: center;
  margin: 0 auto;
}
.tool-card:hover .tool-card-cta {
  background: var(--orange-dim);
  border-color: rgba(255,153,51,.6);
}

/* ── Tool page shell ───────────────────────────────────────────── */

.tool-page-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
}

.tool-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px 80px;
}

.tool-page-back {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color var(--transition);
}
.tool-page-back:hover { color: var(--text); }

/* ── Page title row ────────────────────────────────────────────── */

.tool-page-header {
  max-width: 640px;
  margin-bottom: 36px;
  text-align: left;
}

.tool-page-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.tool-page-title-row .tool-page-title {
  margin-bottom: 0;
}
.tool-page-title-row .tool-card-example {
  width: auto;
  align-self: center;
  margin: 0;
  flex-shrink: 0;
}
.tool-page-example {
  margin-top: 8px;
  margin-bottom: 10px;
  width: auto;
  background: var(--orange-dim);
  border-color: rgba(255,153,51,0.2);
}
.tool-page-example .tce-dim { color: rgba(255,153,51,0.78); }
.tool-page-example .tce-sep { color: rgba(255,153,51,0.35); }
.tool-page-example .tce-out { color: var(--orange); }

.tool-page-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.tool-page-badge.orange { background: var(--orange-dim); color: var(--orange); }
.tool-page-badge.teal   { background: var(--teal-dim);   color: var(--teal);   }
.tool-page-badge.purple { background: var(--purple-dim); color: var(--purple); }

.tool-page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.25;
}

.tool-page-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.8;
}

.subtitle-pill {
  display: block;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  height: 20px;
  line-height: 20px;
  padding: 0 10px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  width: fit-content;
}

.subtitle-pill-inner {
  position: relative;
  top: -1px;
}

/* ═══════════════════════════════════════════════════════════════
   STEPPER
═══════════════════════════════════════════════════════════════ */

.tool-steps {
  width: fit-content;
  max-width: 640px;
}

/* Each step row */
.ts-step {
  display: flex;
  align-items: flex-start;
  gap: 0;
  transition: opacity 0.25s ease;
}

/* Pending steps are dimmed */
.ts-step.ts-pending {
  opacity: 0.35;
}

/* Rail: dot + vertical connector */
.ts-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 36px;
}

/* The numbered / check dot */
.ts-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  position: relative;
  z-index: 1;

  /* pending */
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--border-focus);
}

/* Active dot — filled with accent color */
.ts-step.ts-active .ts-dot {
  background: var(--tool-accent, var(--orange));
  border-color: var(--tool-accent, var(--orange));
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tool-accent, var(--orange)) 18%, transparent);
}

/* Done dot — accent ring, checkmark */
.ts-step.ts-done .ts-dot {
  background: transparent;
  border-color: var(--tool-accent, var(--orange));
  color: var(--tool-accent, var(--orange));
}
.ts-step.ts-done .ts-dot::after {
  content: '';
  display: block;
  width: 7px;
  height: 5px;
  border-left: 2px solid var(--tool-accent, var(--orange));
  border-bottom: 2px solid var(--tool-accent, var(--orange));
  transform: rotate(-45deg) translate(1px, -1px);
}
/* Hide the number when done */
.ts-step.ts-done .ts-dot .ts-num { display: none; }

/* Vertical connector line between dots */
.ts-line {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: var(--border);
  margin: 4px 0;
  transition: background 0.3s ease;
}
.ts-step.ts-done .ts-line {
  background: var(--tool-accent, var(--orange));
  opacity: 0.4;
}
/* No line on the last step */
.ts-step:last-child .ts-line { display: none; }

/* Step content area */
.ts-content {
  flex: 1;
  padding: 0 0 32px 16px;
  min-width: 0;
}
.ts-step:last-child .ts-content { padding-bottom: 0; }

/* Step heading */
.ts-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.45px;
  margin-bottom: 12px;
  padding-top: 4px;       /* align with dot center */
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-step.ts-active .ts-heading { color: var(--text); }
.ts-step.ts-done .ts-heading   { color: var(--muted); }

/* ── Upload zone (compact) ─────────────────────────────────────── */

.upload-zone {
  border: 2px dotted var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--tool-accent, var(--orange));
  background: color-mix(in srgb, var(--tool-accent, var(--orange)) 4%, transparent);
}

.upload-zone-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--tool-accent, var(--orange)) 14%, transparent);
  color: var(--tool-accent, var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-zone-copy { text-align: left; flex: 1; }

.upload-zone-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 3px;
}

.upload-zone-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.upload-zone-limit {
  font-size: 11px;
  color: var(--border-focus);
  margin-top: 6px;
}

.upload-zone-hint {
  font-size: 11.5px;
  color: var(--border-focus);
  font-family: monospace;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  white-space: pre;
  flex-shrink: 0;
  line-height: 1.7;
  text-align: left;
}

#file-input { display: none; }

/* Format note below upload zone */
.format-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--border-focus);
  margin-top: 8px;
}
.format-note .fn-col {
  font-family: monospace;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  color: var(--muted);
  font-size: 11px;
}
.format-note .fn-col.required {
  border-color: var(--tool-accent, var(--orange));
  color: var(--tool-accent, var(--orange));
}

/* ── File info bar (after file selected) ───────────────────────── */

.file-info {
  display: none;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
  align-items: center;
  gap: 12px;
}

.fi-icon {
  width: 65px;
  height: 65px;
  background: color-mix(in srgb, var(--tool-accent, var(--orange)) 14%, transparent);
  color: var(--tool-accent, var(--orange));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fi-meta { flex: 1; min-width: 0; text-align: left; }
.fi-name  { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-count { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.fi-count-strike { text-decoration: line-through; opacity: 0.45; margin-right: 3px; }

.fi-change {
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
  display: block;
  margin-top: 6px;
}
.fi-change:hover { color: var(--text); }

/* ── Step 2: process / run ─────────────────────────────────────── */

.ts-run-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Process button inherits .btn + .btn-gradient--*-outline from auth.css.
   Left-panel override: full width, normal font size. */
.tool-panel-left #process-btn {
  font-size: 13.5px;
}

.processing-msg {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Spinner ───────────────────────────────────────────────────── */

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,153,51,0.2);
  border-top-color: var(--tool-accent, var(--orange));
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Step 3: results table ─────────────────────────────────────── */

.results-summary {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.results-summary strong { color: var(--text); }

/* Same card treatment as the file-info bar */
.results-table-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  user-select: none;
}

.results-table th {
  background: rgba(255,255,255,0.025);
  padding: 8px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* Row-number column */
.results-table th.col-num,
.results-table td.col-num {
  width: 36px;
  min-width: 36px;
  padding-right: 6px;
  color: var(--border-focus);
  font-size: 11px;
  text-align: right;
  user-select: none;
}

.results-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.results-table tbody tr { height: 40px; }
.results-table tr:last-child td { border-bottom: none; }

/* Domain cells — light orange monospace */
.results-table .cell-domain {
  font-family: monospace;
  font-size: 12px;
  color: color-mix(in srgb, var(--orange) 70%, #fff);
}

.results-table .cell-empty { color: var(--border-focus); font-style: italic; }

/* Confidence pills */
.conf-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  letter-spacing: 0.2px;
  width: 75px;
  text-align: center;
}
.conf-pill.conf-high   { background: rgba(52,211,153,0.12);  color: var(--success); border: 1px solid rgba(52,211,153,0.25); }
.conf-pill.conf-medium { background: rgba(255,153,51,0.12);  color: var(--orange);  border: 1px solid rgba(255,153,51,0.25); }
.conf-pill.conf-low    { background: rgba(248,113,113,0.10); color: var(--error);   border: 1px solid rgba(248,113,113,0.22); }
.conf-pill.conf-none   { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); width: 28px; }

.results-more {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

.results-cta {
  font-size: 12px;
  color: var(--muted);
}
.results-cta-link {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
}
.results-cta-link:hover { text-decoration: underline; }

/* ── Step 4: email gate ────────────────────────────────────────── */

.email-gate-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.email-gate-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.email-gate-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--transition);
  min-width: 0;
}
.email-gate-input:focus {
  outline: none;
  border-color: var(--tool-accent, var(--orange));
}
.email-gate-input::placeholder { color: var(--border-focus); }

/* .email-gate-submit appearance is handled by .btn-gradient--*-outline from auth.css */
.email-gate-submit {
  white-space: nowrap;
  flex-shrink: 0;
}

.email-gate-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 7px;
  display: none;
}

/* ── Email success ─────────────────────────────────────────────── */

.email-success {
  display: none;
  align-items: center;
  gap: 12px;
  background: rgba(52,211,153,0.07);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

/* Full left-panel replacement shown after email submit */
.email-sent {
  display: none;
  align-items: flex-start;
  gap: 16px;
  background: rgba(52,211,153,0.07);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 310px;
}

.email-sent-icon {
  width: 44px;
  height: 44px;
  background: rgba(52,211,153,0.15);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-sent-copy { min-width: 0; overflow: hidden; }
.email-sent-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.5;
  margin-bottom: 6px;
}
.email-sent-sub {
  font-size: 12.5px;
  color: var(--muted);
}
#sent-email {
  color: rgba(255,255,255,0.35);
}
.email-sent-link {
  color: var(--orange);
  text-decoration: none;
}
.email-sent-link:hover { text-decoration: underline; }

.email-sent-stats {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.email-sent-stat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.email-sent-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.email-sent-stat svg { width: 20px !important; height: 20px !important; flex-shrink: 0; color: #6b7280; opacity: 1; }
.email-sent-stat--file { display: flex; min-width: 0; max-width: 100%; overflow: hidden; }
.email-sent-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.email-sent-conf-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.email-sent-cta-row {
  margin-top: 26px;
  font-size: 11px;
  color: var(--muted);
}
.email-sent-cta-row .email-sent-link {
  white-space: nowrap;
}
.conf-pill--sm {
  font-size: 10px;
  padding: 1px 7px;
}

.email-success-icon {
  width: 32px;
  height: 32px;
  background: rgba(52,211,153,0.12);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-success-copy {}
.email-success-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}
.email-success-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ── Toast ─────────────────────────────────────────────────────── */

.tool-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 360px;
  z-index: 999;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  animation: slideUp 0.2s ease;
}
.tool-toast.error   { background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.35); color: var(--error); }
.tool-toast.success { background: rgba(52,211,153,0.12);  border: 1px solid rgba(52,211,153,0.35);  color: var(--success); }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Footer ─────────────────────────────────────────────────────── */

.tools-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 16px 28px;
  background: var(--bg);
}

.tools-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1300px;
  margin: 0 auto;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.tools-footer-copy { font-size: 12px; color: var(--border-focus); }

.tools-footer-links { display: flex; gap: 16px; }
.tools-footer-links a {
  font-size: 12px;
  color: var(--border-focus);
  text-decoration: none;
  transition: color var(--transition);
}
.tools-footer-links a:hover { color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   TWO-PANEL WORKSPACE LAYOUT
═══════════════════════════════════════════════════════════════ */

/* Widen the page header to match the workspace */
.tool-page .tool-page-header {
  max-width: 1000px;
}

/* Side-by-side workspace grid */
.tool-workspace {
  width: fit-content;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  align-items: start;
}

/* ── Left panel: upload + button + email ────────────────────────── */

.tool-panel-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Upload zone: fixed 130px footprint, column layout, vertically centered */
.tool-panel-left .upload-zone {
  flex-direction: column;
  text-align: center;
  padding: 0 16px;
  gap: 8px;
  height: 150px;
  max-width: 310px;
  width: 100%;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
  transition: height 0.35s ease, border-color var(--transition), background var(--transition);
}

.tool-panel-left .upload-zone.upload-zone--compact {
  height: 100px;
}

.tool-panel-left .upload-zone-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto;
}

.tool-panel-left .upload-zone-copy   { flex: none; text-align: center; }
.tool-panel-left .upload-zone-title  { font-size: 13px; }
.tool-panel-left .upload-zone-subtitle { font-size: 11.5px; }
.tool-panel-left .upload-zone-hint   { display: none; }

/* File-info card: same 130px footprint as the upload zone */
.tool-panel-left .file-info {
  height: 150px;
  max-width: 310px;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.03);
  border: 2px dotted var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-top: 0;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  overflow: hidden;
}

.tool-panel-left .fi-change {
  margin-top: 2px;
}

/* Process button fills the left panel width */
.tool-panel-left #process-btn {
  width: fit-content;
  justify-content: center;
  padding: 11px 16px;
  font-size: 13.5px;
}

/* Email gate inside the left panel */
.tool-panel-left .tool-email-row {
  width: fit-content;
  max-width: none;
  margin-top: 4px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.tool-panel-left .tool-email-row .email-gate-heading {
  font-size: 12.5px;
  margin-top: 20px;
  margin-bottom: 6px;
}

.tool-panel-left .tool-email-row .email-gate-intro {
  font-size: 11.5px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.tool-panel-left .email-gate-row {
  flex-direction: column;
  gap: 6px;
}

.tool-panel-left .email-gate-submit {
  width: fit-content;
}

.tool-panel-left .email-gate-input {
  font-size: 13px;
  width: 310px;
  flex: none;
}

/* ── Right panel: preview area ──────────────────────────────────── */

.tool-panel-right {
  position: relative;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 620px;
  height: 525px;
  flex: none;
  display: flex;
  user-select: none;
  flex-direction: column;
  overflow: hidden;
}

/* -- Tool card example pills -- */
.tool-card-example { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.07); border-radius: 99px; padding: 5px 12px; font-size: 10px; font-family: ui-monospace, monospace; margin: 10px 0 14px; max-width: fit-content; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; align-self: stretch; width: 100%; }
.tce-dim { color: rgba(255,255,255,0.35); }
.tce-sep { color: rgba(255,255,255,0.18); flex-shrink: 0; }
.tce-out { color: rgba(255,255,255,0.7); }

/* Empty state */


/* ── Empty state: ghost preview ─────────────────────────────────── */

/* Tune this single value to adjust how dim the ghost appears (0–1) */
:root { --ghost-opacity: 0.18; }

.tools-wrap, .tools-wrap * { user-select: text !important; }
.tool-panel-right, .tool-panel-right * { user-select: none !important; -webkit-user-select: none !important; }
.results-table { user-select: none !important; }
.results-table th.col-num, .results-table td.col-num { user-select: none !important; }
.tool-card-cta { user-select: none !important; }

.panel-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Ghost wrapper: grayscale + dim opacity */
.ghost-preview {
  user-select: none;
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  filter: grayscale(1);
  opacity: var(--ghost-opacity);
  pointer-events: none;
  user-select: none;
}

/* Mirrors .panel-results layout so summary + table + more-row sit correctly */
.ghost-results {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ghost-results .results-summary {
  padding: 12px 14px 8px;
  font-size: 12px;
  color: var(--muted);
}
.ghost-results .results-table-wrap {
  flex: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Center confidence column header and cells */
.results-table .col-conf {
  text-align: center;
}

/* Angled gradient fade that melts the table into the panel background */
.ghost-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    transparent 25%,
    var(--card, #12141a) 78%
  );
}

/* Results inside the right panel */
.panel-results {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.panel-results .results-summary {
  padding: 12px 14px 0;
  font-size: 12px;
}

.panel-results .results-table-wrap {
  flex: 1;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
}

.panel-results .results-more {
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   SPARK LOADING ANIMATION
═══════════════════════════════════════════════════════════════ */

.spark-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
}

.spark-stage {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Two expanding rings, offset by half a cycle */
.spark-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--tool-accent, var(--orange)) 50%, transparent);
  animation: spark-ring-pulse 2s ease-out infinite;
}
.spark-ring:nth-child(2) {
  animation-delay: 1s;
}

@keyframes spark-ring-pulse {
  0%   { transform: scale(0.35); opacity: 0; }
  15%  { opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Central icon with throb glow */
.spark-icon {
  position: relative;
  z-index: 2;
  width: 60px;
  height: 60px;
  background: color-mix(in srgb, var(--tool-accent, var(--orange)) 16%, transparent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tool-accent, var(--orange));
  animation: spark-icon-throb 1.4s ease-in-out infinite;
}

@keyframes spark-icon-throb {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--tool-accent, var(--orange)) 40%, transparent);
  }
  50% {
    box-shadow: 0 0 20px 8px color-mix(in srgb, var(--tool-accent, var(--orange)) 18%, transparent);
  }
}

.spark-bug-svg {
  filter:
    drop-shadow(0 0 3px rgba(0,0,0,1))
    drop-shadow(0 0 7px rgba(0,0,0,0.85))
    drop-shadow(0 0 14px rgba(0,0,0,0.5));
}

/* Particle container — fills the stage */
.spark-particles {
  position: absolute;
  inset: 0;
}

/*
 * Each .spark-pw is a zero-size anchor rotated to a compass angle.
 * The child .spark-p translates along the X axis (away from center).
 */
.spark-pw {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

.spark-p {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tool-accent, var(--orange));
  top: -2.5px;
  left: 4px;
  animation: spark-fly 1.6s ease-out infinite;
  box-shadow: 0 0 5px 1px color-mix(in srgb, var(--tool-accent, var(--orange)) 55%, transparent);
}

@keyframes spark-fly {
  0%   { transform: translateX(0)    scale(1);   opacity: 0; }
  10%  { opacity: 1; }
  75%  { opacity: 0.55; }
  100% { transform: translateX(48px) scale(0.2); opacity: 0; }
}

/* Breathing label */
.spark-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.2px;
  animation: spark-label-pulse 1.4s ease-in-out infinite;
}

@keyframes spark-label-pulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}

.email-gate-heading {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 4px;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .tool-cards { grid-template-columns: 1fr; max-width: 480px; }
  .tools-hero h1 { font-size: 30px; }
}

@media (max-width: 720px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
  .tool-panel-left .upload-zone {
    flex-direction: row;
    text-align: left;
    padding: 18px 16px;
  }
  .tool-panel-left .upload-zone-icon { margin: 0; }
  .tool-email-row { padding: 18px 16px; }
}

@media (max-width: 580px) {
  .tools-nav  { padding: 0 16px; }
  .tool-page  { padding: 20px 16px 60px; }
  .tool-page-title { font-size: 20px; }
  .tool-cards { padding: 0 16px 60px; }
  .tools-hero { padding: 48px 16px 40px; }
  .upload-zone { flex-direction: column; text-align: center; }
  .upload-zone-hint { display: none; }
  .email-gate-row { flex-direction: column; }
  .email-gate-submit { width: fit-content; }
  .tools-footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .ts-content { padding-left: 12px; }
}

/* LinkedIn tool button */
.btn-tool-linkedin {
  color: #0077B5;
  border: 1.5px solid rgba(0,119,181,0.5);
  background: transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.btn-tool-linkedin:hover:not(:disabled) {
  background: rgba(0,119,181,0.12);
  border-color: #0077B5;
  color: #0077B5;
}
.btn-tool-linkedin:disabled { opacity: 0.45; cursor: default; }

/* ════════════════════════════════════════════════════════════
   Tool Credits Purchase Modal  (tcm-*)
   ════════════════════════════════════════════════════════════ */
.tcm-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:900;align-items:center;justify-content:center;padding:16px;}
.tcm-overlay.tcm-open{display:flex;}
.tcm-modal{background:#1a2035;border:1px solid rgba(102,153,255,.2);border-radius:14px;width:100%;max-width:540px;padding:28px 28px 24px;box-shadow:0 24px 64px rgba(0,0,0,.6);}
.tcm-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
.tcm-title{display:flex;align-items:center;gap:8px;font-size:17px;font-weight:700;color:#e4e8f0;}
.tcm-close{background:none;border:none;color:#8a95aa;font-size:20px;cursor:pointer;padding:4px 8px;border-radius:6px;line-height:1;transition:color .15s,background .15s;}
.tcm-close:hover{color:#e4e8f0;background:rgba(255,255,255,.06);}
.tcm-desc{margin:0 0 20px;font-size:13px;color:#8a95aa;line-height:1.5;}
.tcm-packs{display:flex;flex-wrap:wrap;gap:12px;}
.tcm-loading,.tcm-no-plans{font-size:14px;color:#8a95aa;padding:8px 0;}
.tcm-no-plans a{color:#6699ff;text-decoration:none;}
.tcm-pack{flex:1 1 120px;min-width:110px;background:rgba(102,153,255,.06);border:1px solid rgba(102,153,255,.15);border-radius:10px;padding:18px 14px 16px;display:flex;flex-direction:column;align-items:center;gap:4px;transition:border-color .15s,background .15s;}
.tcm-pack:hover{border-color:rgba(102,153,255,.4);background:rgba(102,153,255,.1);}
.tcm-pack--enterprise{background:rgba(255,153,51,.04);border-color:rgba(255,153,51,.15);}
.tcm-pack--enterprise:hover{border-color:rgba(255,153,51,.35);background:rgba(255,153,51,.08);}
.tcm-pack-credits{font-size:22px;font-weight:700;color:#e4e8f0;line-height:1.1;text-align:center;}
.tcm-pack-unit{font-size:11px;color:#8a95aa;text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px;}
.tcm-pack-price{font-size:18px;font-weight:600;color:#6699ff;margin-bottom:12px;}
.tcm-pack-btn{display:inline-block;padding:8px 16px;border-radius:7px;font-size:13px;font-weight:600;cursor:pointer;text-decoration:none;transition:opacity .15s;background:linear-gradient(135deg,#6699ff,#4477dd);border:none;color:#fff;width:100%;text-align:center;margin-top:auto;}
.tcm-pack-btn:hover{opacity:.85;}
.tcm-pack--enterprise .tcm-pack-btn{background:linear-gradient(135deg,#ff9933,#e67300);}

/* Download CSV — match Find Domains button size exactly */
.tool-panel-left .auth-download-row .email-gate-submit {
  width: fit-content;
  padding: 11px 20px;
  font-size: 13.5px;
}

#process-btn:not(:disabled) { cursor: pointer; }
.tool-credit-cost:not(:empty) { margin-top: 5px; }
.tool-panel-left .auth-download-row { margin-top: 5px; }
.tool-auth-download .email-gate-heading { margin-bottom: 5px; }
#process-btn { width: 310px; }
.tool-panel-left .auth-download-row .email-gate-submit { width: 310px; }
#gate-submit { cursor: pointer; }
.tool-panel-left #process-btn { width: 310px; }
.tool-panel-left #process-btn { margin-top: 20px; }
.tool-panel-left #process-btn { margin-top: 10px; }
.fi-chevron { margin-left: auto; display: flex; align-items: center; color: rgba(255,255,255,.3); flex-shrink: 0; }

#build-another-btn { cursor: pointer; margin-top: 10px; height: 40px; justify-content: center; width: 310px; }

/* ── Add Credits modal (shared bill-topup-* / bill-pack-* styles) ── */
.bill-topup-overlay { position:fixed;inset:0;background:rgba(0,0,0,0.55);z-index:8000;display:flex;align-items:center;justify-content:center;padding:20px; }
.bill-topup-modal { background:var(--surface);border:1px solid rgba(255,255,255,0.1);border-radius:18px;width:100%;max-width:680px;max-height:90vh;overflow-y:auto;box-shadow:0 24px 80px rgba(0,0,0,0.6); }
.bill-topup-header { display:flex;align-items:center;justify-content:space-between;padding:22px 26px 0;margin-bottom:18px; }
.bill-topup-title { font-size:16px;font-weight:700;color:var(--white);display:flex;align-items:center;gap:8px; }
.bill-topup-close { background:none;border:none;cursor:pointer;color:var(--muted);width:30px;height:30px;border-radius:8px;font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s; }
.bill-topup-close:hover { background:rgba(255,255,255,0.07);color:var(--white); }
.bill-topup-body { padding:0 26px 26px; }
.bill-topup-desc { font-size:12px;color:var(--muted);margin-bottom:20px;line-height:1.5; }
.bill-topup-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px; }
.bill-pack-card { background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:14px;padding:20px 18px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:6px;transition:border-color .15s,background .15s; }
.bill-pack-card:hover { border-color:rgba(255,153,51,0.4);background:rgba(255,153,51,0.04); }
.bill-pack-card--enterprise { display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:default; }
.bill-pack-card--enterprise .bill-pack-credits { color:#fff; }
.bill-pack-credits { font-size:26px;font-weight:800;color:var(--white);line-height:1; }
.bill-pack-unit { font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:0.5px;margin-bottom:4px; }
.bill-pack-price { font-size:15px;font-weight:700;color:var(--orange); }
.bill-pack-btn { margin-top:10px;display:inline-flex;align-items:center;gap:5px;padding:7px 18px;border-radius:8px;font-size:12px;font-weight:600;background:#14161d;color:#b0b8c8;border:1px solid var(--orange);cursor:pointer;text-decoration:none;transition:background .15s,color .15s; }
.bill-pack-btn:hover { background:#1a1d27;color:var(--orange); }
#build-another-btn { display: flex; align-items: center; justify-content: center; }

/* ── Credits error box ── */
.email-gate-error.gate-error--credits {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(248,113,113,.10);
  border: 1px solid rgba(248,113,113,.35);
  color: #f87171;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
}
.gate-err-msg { flex: 1; }
.gate-credits-pill {
  flex-shrink: 0;
  background: #f87171;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.gate-credits-pill:hover { background: #ef4444; }

/* ── Insufficient credits state on credit estimate box ── */
.tool-credit-cost.credit-est--insufficient {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(248,113,113,.10);
  border: 1px solid rgba(248,113,113,.35);
  color: #f87171;
  border-radius: 8px;
  padding: 7px 12px;
  max-width: 310px;
  width: 100%;
  box-sizing: border-box;
}
.credit-est-add-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  color: #e4e8f0;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  margin-left: auto;
}
.credit-est-add-btn:hover { background: rgba(255,255,255,0.14); }

/* ── Faded disabled Build Report button (insufficient credits) ── */
#gate-submit.gate-submit--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
