/* Free public SEO tools. Loaded after landing.css, so it inherits the brand
   :root variables and the .btn-primary / .container / nav / footer chrome. This
   file only styles the tool-specific surface: hub grid, forms, result cards. */

.tool-main {
  padding-top: 7rem;
  padding-bottom: 4rem;
  max-width: 920px;
}

.tool-crumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.tool-crumbs a { color: var(--muted); text-decoration: none; }
.tool-crumbs a:hover { color: var(--brand); }
.tool-crumbs span { margin: 0 0.15rem; }

/* ── Hero ── */
.tool-hero { margin-bottom: 2rem; }
.tool-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}
.tool-hero-sm h1 { font-size: 2.1rem; }
.tool-hero-lede {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 70ch;
  margin: 0;
}

/* ── Hub grid ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.tool-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tool-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}
.tool-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.tool-card-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.tool-icon { width: 22px; height: 22px; color: var(--brand); flex-shrink: 0; }
.tool-card-tagline { font-weight: 600; color: var(--text); margin: 0 0 0.5rem; }
.tool-card-blurb { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.55; margin: 0 0 1rem; }
.tool-card-go { font-size: 0.9rem; font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 0.35rem; }
.tool-card-go .btn-arrow { stroke: var(--brand); }

/* ── Form ── */
.tool-form { margin-bottom: 2rem; }
.tool-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.tool-form-row { display: flex; gap: 0.6rem; }
.tool-input {
  flex: 1;
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.tool-form-row .btn-primary { flex-shrink: 0; white-space: nowrap; }

/* ── Result shell ── */
.tool-result {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}
.tool-result-error { background: var(--brand-light); border-color: #f5c2c2; }
.tool-result-error p { margin: 0 0 0.5rem; color: var(--navy); }
.tool-result-error code { background: rgba(0,0,0,0.06); padding: 0.1rem 0.35rem; border-radius: 5px; font-size: 0.9em; }

/* ── DR gauge ── */
.tool-result:has(.dr-gauge) { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.dr-gauge { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.dr-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.dr-ring-track { fill: none; stroke: var(--surface-alt); stroke-width: 10; }
.dr-ring-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.dr-gauge-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dr-num { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.dr-den { font-size: 0.85rem; color: var(--muted); }
.dr-detail { flex: 1; min-width: 220px; }
.dr-domain { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.2rem; word-break: break-all; }
.dr-band { font-weight: 700; margin-bottom: 0.5rem; }
.dr-note { color: var(--text-secondary); line-height: 1.55; margin: 0 0 0.75rem; }
.dr-source { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin: 0; }

/* ── SEO checker ── */
.seo-score {
  display: flex; align-items: center; gap: 1rem;
  padding-bottom: 1.25rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.seo-score-num { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.seo-score-num span { font-size: 1.4rem; color: var(--muted); font-weight: 700; }
.seo-score-label { color: var(--text-secondary); }
.seo-score-good .seo-score-num { color: var(--green); }
.seo-score-ok .seo-score-num { color: #f59e0b; }
.seo-score-bad .seo-score-num { color: var(--brand); }

.check-list { display: flex; flex-direction: column; gap: 0.5rem; }
.check-row { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.check-row summary {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.75rem 0.9rem; cursor: pointer; list-style: none;
}
.check-row summary::-webkit-details-marker { display: none; }
.check-status {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800; color: #fff;
}
.check-pass .check-status { background: var(--green); }
.check-fail .check-status { background: var(--brand); }
.check-pass { border-color: rgba(34,197,94,0.3); }
.check-fail { border-color: #f5c2c2; }
.check-label { font-weight: 600; flex: 1; }
.check-detail { font-size: 0.85rem; color: var(--muted); }
.check-body { padding: 0 0.9rem 0.9rem 2.55rem; }
.check-help { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; margin: 0 0 0.5rem; }
.check-value { font-size: 0.88rem; color: var(--text); margin: 0 0 0.4rem; word-break: break-word; }
.check-value span, .check-fix span { font-weight: 700; color: var(--muted); }
.check-fix { font-size: 0.9rem; color: var(--navy); background: var(--brand-light); padding: 0.55rem 0.75rem; border-radius: 8px; margin: 0; line-height: 1.5; }

/* ── Sitemap ── */
.sm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.sm-stat { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; text-align: center; }
.sm-stat-num { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.sm-stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.sm-good .sm-stat-num { color: var(--green); }
.sm-warnstat .sm-stat-num { color: #f59e0b; }
.sm-badstat .sm-stat-num { color: var(--brand); }
.sm-section { margin-top: 1.5rem; }
.sm-section h3 { font-size: 1rem; font-weight: 700; margin: 0 0 0.6rem; }
.sm-warn { color: var(--brand); font-weight: 600; }
.sm-muted { color: var(--muted); font-weight: 500; }
.sm-file-list, .sm-url-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.sm-file { display: flex; flex-direction: column; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: 8px; }
.sm-file-bad { border-color: #f5c2c2; background: var(--brand-light); }
.sm-file-url { font-size: 0.85rem; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sm-file-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.sm-url-list li { font-size: 0.84rem; word-break: break-all; line-height: 1.5; color: var(--text-secondary); }
.sm-bad-code { display: inline-block; font-weight: 700; color: var(--brand); margin-right: 0.4rem; }
.sm-arrow { color: var(--muted); }

/* ── SERP preview tool ── */
.serp-tool { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; align-items: start; }
.serp-fields .tool-input { margin-bottom: 0.35rem; }
.serp-fields .tool-form-label { margin-top: 1rem; }
.serp-fields .tool-form-label:first-child { margin-top: 0; }
.serp-textarea { resize: vertical; line-height: 1.5; }
.serp-counter { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.25rem; }
.serp-counter-warn { color: #d97706; }
.serp-counter-quiet { min-height: 0; }
.serp-preview-wrap { position: sticky; top: 6rem; }
.serp-preview-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 0.5rem; }
.serp-snippet {
  border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.25rem; background: var(--surface);
  font-family: arial, sans-serif;
}
.serp-snip-url { font-size: 0.82rem; color: #202124; margin-bottom: 0.15rem; }
.serp-snip-url #out-fav { color: #4d5156; }
.serp-snip-title { color: #1a0dab; font-size: 1.25rem; line-height: 1.3; margin-bottom: 0.2rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.serp-snip-desc { color: #4d5156; font-size: 0.88rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Explainer + CTA + cross-links ── */
.tool-explain { margin: 2.5rem 0; }
.tool-explain h2 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.tool-explain h2:first-child { margin-top: 0; }
.tool-explain p { color: var(--text-secondary); line-height: 1.65; margin: 0; }

.tool-cta {
  background: var(--navy); color: #fff; border-radius: 18px; padding: 2rem 2.25rem; margin: 2.5rem 0;
}
.tool-cta h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.75rem; line-height: 1.2; }
.tool-cta p { color: rgba(255,255,255,0.82); line-height: 1.65; margin: 0 0 1.25rem; max-width: 60ch; }
.tool-cta .btn-primary { display: inline-flex; }

.tool-more { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.tool-more h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 1rem; }
.tool-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tool-more-card {
  display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem;
  border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text);
  transition: border-color 0.15s;
}
.tool-more-card:hover { border-color: var(--brand); }
.tool-more-name { font-weight: 600; }
.tool-more-tagline { font-size: 0.82rem; color: var(--muted); }

@media (max-width: 760px) {
  .tool-grid, .serp-tool, .tool-more-grid { grid-template-columns: 1fr; }
  .sm-stats { grid-template-columns: repeat(2, 1fr); }
  .tool-hero h1 { font-size: 2.1rem; }
  .tool-form-row { flex-direction: column; }
  .serp-preview-wrap { position: static; }
}
