/* ── CSS custom properties (Match YouTube / Safe Zone pattern) ── */
:root {
  --primary: #059669;       /* teal‑green for readability / text focus */
  --primary-light: #d1fae5;
  --primary-dark: #047857;
  --bg: #ffffff;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e0e0e0;
  --shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Dark mode */
html[data-theme="dark"] {
  --bg: #0f172a;
  --card-bg: #1f2937;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary: #34d399;
  --primary-light: #ecfdf5;
  --primary-dark: #15803d;
}

/* ── Ad slots hidden ── */
.ad-slot,.ad-leaderboard,.ad-in-article,.ad-anchor,.ad-placeholder,[class*='ad-slot']{display:none!important;width:0!important;height:0!important;margin:0!important;padding:0!important;}

/* ── Hero (Readability variant, green‑teal) ── */
.tool-hero {
  background: linear-gradient(135deg, #059669 0%, #34d399 100%);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  color: #fff;
}

.tool-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.tool-hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 1rem;
}

/* ── Main layout ── */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Calculator card (Flesch & Grade Level) ── */
.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.calc-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-card h2 svg {
  color: #059669;
}

/* ── Form fields ── */
.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-field .textarea {
  width: 100%;
  min-height: 160px;
  max-height: 400px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.form-field .textarea:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
}

/* ── Two‑column form grid ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Analyze button ── */
.calc-btn {
  width: 100%;
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.calc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Results grid (Flesch, Grade, Words, Sentences, WPS) ── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: all 0.15s;
}

.result-card.highlight {
  background: #ecfdf5;
  border: 1px solid #059669;
}

.result-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 0.3rem;
}

.result-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── "People Also Use" section ── */
.related-tools-section {
  margin: 2rem 0;
}

.related-tools-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .related-tools-grid {
    grid-template-columns: 1fr;
  }
}

/* Tool cards (People Also Use) */
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.tool-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  background: #f8fafc;
}

.tool-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.tool-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Content section (About, FAQ, Tips, etc.) ── */
.content-section {
  margin-top: 2rem;
}

.content-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  border-left: 3px solid #059669;
  padding-left: 0.75rem;
}

.content-section p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ── Steps box (HOW TO, tips) ── */
.steps-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  counter-reset: steps;
}

.steps-box li {
  list-style: none;
  padding: 0.5rem 0 0.5rem 2.5rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.steps-box li:last-child {
  border-bottom: none;
}

.steps-box li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 24px;
  height: 24px;
  background: #059669;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 24px;
  text-align: center;
}

/* ── Feature grid (Instant, Private) */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

@media (max-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature-pill {
  background: var(--primary-light);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.feature-pill strong {
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.feature-pill strong svg {
  flex-shrink: 0;
}

.feature-pill p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── FAQ items */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.85rem;
}

.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.faq-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
}

/* ── Related tools list */
.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  border-bottom: 1px solid var(--border);
}

.related-list li:last-child {
  border-bottom: none;
}

.related-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.related-list a:hover {
  color: var(--primary);
}

.related-list a::before {
  content: "→";
  color: #059669;
  font-weight: 700;
  flex-shrink: 0;
}