/* ============================================================
   WordsCounterAI.com — Main Stylesheet
   Version: 1.0 | March 2026
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-border: #BFDBFE;
  --secondary: #475569;
  --accent: #10B981;
  --accent-dark: #059669;
  --accent-light: #ECFDF5;
  --bg: #FFFFFF;
  --bg-panel: #F8FAFC;
  --bg-textarea: #F9FAFB;
  --bg-hover: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg: 0 8px 24px rgba(15,23,42,0.10), 0 4px 8px rgba(15,23,42,0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
  --transition: 0.2s ease;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg: #0F172A;
  --bg-panel: #1E293B;
  --bg-textarea: #1A2332;
  --bg-hover: #293548;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --border: #334155;
  --border-strong: #475569;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.30);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.35);
  --primary-light: #1E3A5F;
  --primary-border: #1E40AF;
  --accent-light: #064E3B;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-primary-color { color: var(--primary); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--accent-light); color: var(--accent-dark); }

/* --- Header / Navigation --- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition), border-color var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  font-weight: 800;
  letter-spacing: -1px;
  flex-shrink: 0;
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.logo-text span { color: var(--primary); }
.site-logo:hover .logo-text { color: var(--primary); text-decoration: none; }

/* Main Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item svg { width: 15px; height: 15px; }

/* Tools dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  background: none;
  border: none;
}
.nav-dropdown-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-arrow { font-size: 10px; transition: transform var(--transition); }
.nav-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 8px;
  display: none;
  z-index: 200;
}
.nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.dropdown-menu a:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-menu a .icon { font-size: 16px; width: 20px; text-align: center; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 6px 10px 2px;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Dark mode toggle */
.dark-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: background var(--transition), border-color var(--transition);
}
.dark-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.mobile-menu-btn span {
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav a:hover { background: var(--bg-hover); color: var(--primary); }

/* --- Ad Containers --- */
.ad-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}
.ad-leaderboard {
  width: 100%;
  min-height: 90px;
  margin: 16px 0;
}
.ad-leaderboard-slim {
  width: 100%;
  min-height: 60px;
  margin: 12px 0;
}
.ad-sidebar {
  width: 100%;
  min-height: 250px;
  margin-bottom: 16px;
}
.ad-in-content {
  width: 100%;
  min-height: 90px;
  margin: 24px 0;
}
/* Hide dashed border on live ads - AdSense will fill the container */
.ad-container ins.adsbygoogle { display: block; }

/* --- Page Hero / Tool Header --- */
.page-hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 60%);
  border-bottom: 1px solid var(--border);
  padding: 32px 0 24px;
  text-align: center;
}
[data-theme="dark"] .page-hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-panel) 60%);
}
.page-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.page-hero p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 16px;
}
.page-hero .tool-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.tool-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.tool-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* --- Main Tool Layout --- */
.tool-wrapper {
  padding: 24px 0 32px;
}
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* Textarea Section */
.textarea-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg);
}
.textarea-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.btn-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-toolbar:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}
.btn-toolbar svg { width: 13px; height: 13px; }

#main-textarea {
  width: 100%;
  min-height: 360px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-textarea);
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--font-sans);
  transition: background-color var(--transition);
}
#main-textarea::placeholder { color: var(--text-muted); }
#main-textarea:focus { background: var(--bg); }

/* Live stats strip at the bottom of textarea */
.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 4px;
}
.live-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.live-stat .live-val {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.live-stat-divider { color: var(--border-strong); }

/* Stats Panel */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stats-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stats-card-header {
  padding: 12px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stats-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.stat-cell {
  background: var(--bg);
  padding: 16px 12px;
  text-align: center;
  transition: background var(--transition);
}
.stat-cell:hover { background: var(--bg-panel); }
.stat-cell .stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.stat-cell .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Extended stats list */
.extended-stats-list {
  padding: 8px 0;
}
.extended-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.extended-stat-row:last-child { border-bottom: none; }
.extended-stat-row:hover { background: var(--bg-panel); }
.extended-stat-row .esr-label { color: var(--text-secondary); }
.extended-stat-row .esr-value {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.esr-value.accent { color: var(--accent); }

/* Goals/Targets */
.goals-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.goals-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.goal-row {
  margin-bottom: 12px;
}
.goal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.goal-input-label { font-size: 13px; color: var(--text-secondary); flex: 1; }
.goal-input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-textarea);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.goal-input:focus { outline: none; border-color: var(--primary); }
.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}
.progress-bar-fill.at-goal { background: var(--accent); }
.progress-bar-fill.over-goal { background: #EF4444; }
.goal-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* --- Content Sections (below the tool) --- */
.content-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.content-section:first-child { border-top: none; }

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.section-title.centered { text-align: center; }
.section-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.section-subtitle.centered { text-align: center; }

/* How To Use steps */
.how-to-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.step-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.step-number {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}
.step-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.step-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background var(--transition);
}
.faq-question:hover { background: var(--bg-panel); }
.faq-question .faq-icon {
  font-size: 18px;
  color: var(--primary);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  display: none;
  padding: 0 20px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  background: var(--bg-panel);
}
.faq-item.open .faq-answer { display: block; }

/* Related Tools Grid */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.related-tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition);
}
.related-tool-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.related-tool-icon {
  font-size: 24px;
  line-height: 1;
}
.related-tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.related-tool-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.related-tool-card:hover .related-tool-name { color: var(--primary); }

/* Info Boxes */
.info-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 16px 0;
}
.info-box strong { color: var(--text-primary); }
.info-box.accent-box {
  background: var(--accent-light);
  border-color: #A7F3D0;
}

/* Content Prose */
.prose {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 720px;
}
.prose h2 { font-size: 20px; margin: 28px 0 12px; color: var(--text-primary); }
.prose h3 { font-size: 17px; margin: 20px 0 8px; color: var(--text-primary); }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 20px; margin-bottom: 14px; list-style: revert; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--primary); }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.prose table th {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}
.prose table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  color: var(--text-secondary);
}
.prose table tr:hover td { background: var(--bg-panel); }

/* --- Words-to-Pages Reference Tables --- */
.reference-table-wrap { overflow-x: auto; margin: 20px 0; }
.reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 500px;
}
.reference-table th {
  background: var(--primary);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}
.reference-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.reference-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.reference-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.reference-table tr:nth-child(even) td { background: var(--bg-panel); }
.reference-table tr:hover td { background: var(--primary-light); }
.reference-table td.highlight {
  font-weight: 700;
  color: var(--primary);
}

/* Calculator widget */
.calc-widget {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 480px;
  margin: 0 auto;
}
.calc-widget h3 {
  font-size: 17px;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.calc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.calc-row label {
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 100px;
  font-weight: 500;
}
.calc-select, .calc-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.calc-select:focus, .calc-input:focus {
  outline: none;
  border-color: var(--primary);
}
.calc-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.calc-result .result-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.calc-result .result-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- Keyword Density Table --- */
.keyword-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.keyword-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}
.keyword-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.keyword-table tr:hover td { background: var(--bg-panel); }
.keyword-density-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kd-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.kd-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}
.kd-pct { font-size: 12px; font-weight: 600; color: var(--primary); min-width: 38px; }

/* Readability gauge */
.readability-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  gap: 8px;
}
.readability-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
  border: 6px solid;
}
.score-easy { border-color: var(--accent); color: var(--accent); }
.score-medium { border-color: #F59E0B; color: #F59E0B; }
.score-hard { border-color: #EF4444; color: #EF4444; }
.readability-level {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.readability-desc {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  max-width: 240px;
}

/* --- Footer --- */
#site-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand .site-logo { margin-bottom: 12px; }
.footer-brand-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-legal {
  display: flex;
  gap: 16px;
}
.footer-legal a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-legal a:hover { color: var(--primary); }

/* --- Cookie Consent Banner --- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: none;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
}
#cookie-banner.visible { display: flex; }
.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-text {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 200px;
}
.cookie-text a { color: var(--primary); }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }

/* --- Contact Form --- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.form-input, .form-textarea, .form-select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-textarea);
  font-family: var(--font-sans);
  transition: border-color var(--transition);
}
.form-textarea { min-height: 140px; resize: vertical; }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg);
}
.form-submit {
  display: flex;
  gap: 12px;
  align-items: center;
}
.form-success {
  display: none;
  padding: 14px 16px;
  background: var(--accent-light);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--accent-dark);
}
.contact-info-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.contact-info-card h3 {
  font-size: 17px;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.contact-info-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.contact-info-item:last-child { border-bottom: none; }
.contact-info-item .cii-icon { font-size: 20px; }
.contact-info-item .cii-text { flex: 1; }
.cii-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 2px; }
.cii-value { font-size: 14px; color: var(--text-secondary); }

/* --- About Page --- */
.about-hero {
  text-align: center;
  padding: 48px 0 32px;
}
.about-hero h1 { font-size: clamp(28px, 5vw, 42px); margin-bottom: 16px; }
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.about-feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.about-feature-card .afc-icon { font-size: 32px; margin-bottom: 12px; }
.about-feature-card h3 { font-size: 16px; margin-bottom: 8px; color: var(--text-primary); }
.about-feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* --- Legal Pages --- */
.legal-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 32px;
  padding: 40px 0;
  align-items: start;
}
.legal-toc {
  position: sticky;
  top: 80px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.legal-toc h3 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 12px; }
.legal-toc ol { list-style: decimal; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.legal-toc li a { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.legal-toc li a:hover { color: var(--primary); }
.legal-content h2 { font-size: 20px; margin: 32px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-primary); }
.legal-content h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.legal-content h3 { font-size: 16px; margin: 20px 0 8px; color: var(--text-primary); }
.legal-content p, .legal-content li { font-size: 15px; line-height: 1.75; color: var(--text-secondary); margin-bottom: 12px; }
.legal-content ul, .legal-content ol { padding-left: 20px; list-style: revert; margin-bottom: 16px; }
.legal-meta {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border-strong); }
.breadcrumb .current { color: var(--text-secondary); font-weight: 500; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
  .stats-panel { order: -1; }
  .stats-grid-2 { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-height: 56px; }
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .page-hero { padding: 24px 0 20px; }
  .page-hero h1 { font-size: 22px; }
  .stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .legal-layout, .contact-layout { grid-template-columns: 1fr; }
  .legal-toc { display: none; }
  .how-to-steps { grid-template-columns: 1fr; }
  .related-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .ad-leaderboard { display: none; } /* Hide large leaderboards on mobile */
  .ad-in-content { display: none; }
  .btn { padding: 8px 14px; font-size: 13px; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .stat-cell .stat-number { font-size: 22px; }
  .related-tools-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-legal { flex-wrap: wrap; gap: 10px; }
}

/* --- Print --- */
@media print {
  #site-header, #site-footer, #cookie-banner, .ad-container, .stats-panel, .toolbar-right { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-layout { grid-template-columns: 1fr; }
}
