/* ============================================================
   AI Writing Tools — Shared Design System
   styles.css | All pages link to this file
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:      #2563eb;
  --accent-h:    #1d4ed8;
  --accent-mid:  #3b82f6;
  --accent-pale: #93c5fd;
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --muted:       #64748b;
  --danger:      #dc2626;
  --amber:       #d97706;
  --green:       #16a34a;
  --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────── */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── AdSense: Header Leaderboard ──────────────────────────── */
.ad-header {
  width: 100%;
  background: var(--border);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ── Site Header ──────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

/* ── Nav + Dropdown ───────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
}

nav a {
  margin-left: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 1.25rem;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-dropdown-toggle:hover { color: var(--text); }

.nav-dropdown-toggle .caret {
  font-size: 0.65rem;
  transition: transform 0.15s;
}

.nav-dropdown.open .caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 220px;
  z-index: 100;
  overflow: hidden;
}

.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-left: 0;
  border-bottom: 1px solid var(--border);
}

.nav-dropdown-menu a:last-child { border-bottom: none; }

.nav-dropdown-menu a:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.nav-dropdown-menu a.active {
  color: var(--accent);
  font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fca5a5;
}
.btn-danger:hover { background: #fef2f2; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links a { margin-left: 1rem; }

/* ── Content Grid (tool pages) ────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  padding: 1.5rem 0;
  align-items: start;
}

@media (max-width: 768px) {
  .content-grid { grid-template-columns: 1fr; }
  .ad-sidebar   { display: none !important; }
}

/* ── Tool Card ────────────────────────────────────────────── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.tool-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tool-card .subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ── Textarea ─────────────────────────────────────────────── */
.textarea-input,
#input-text {
  width: 100%;
  min-height: 200px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  resize: vertical;
  background: var(--bg);
  transition: border-color 0.15s;
}

.textarea-input:focus,
#input-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── Controls ─────────────────────────────────────────────── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

/* ── Sample Text Wrap ─────────────────────────────────────── */
.sample-text-wrap {
  margin-top: 0.5rem;
}

/* ── Stats Bar ────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
}

.stats-bar span strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Why Card (collapsible) ───────────────────────────────── */
.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 1rem;
  overflow: hidden;
}

.why-card summary,
.why-card-toggle {
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.why-card summary::-webkit-details-marker { display: none; }

.why-card summary .caret,
.why-card-toggle .caret {
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: var(--muted);
}

.why-card[open] summary .caret,
.why-card details[open] summary .caret {
  transform: rotate(180deg);
}

.why-card-body {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
}

details.why-card summary {
  padding: 0.9rem 1.25rem;
}

details.why-card[open] summary .caret {
  transform: rotate(180deg);
}

details.why-card .why-card-body {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Next Tool Card ───────────────────────────────────────── */
.next-tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.next-tool-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.next-tool-card .next-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.next-tool-card strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}

/* ── Results Fade-In ──────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-fade-in {
  animation: fadeInUp 0.25s ease forwards;
}

/* ── Tool Badge ───────────────────────────────────────────── */
.tool-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.tool-badge.geo {
  background: rgba(37,99,235,0.1);
  color: var(--accent);
}

.tool-badge.seo {
  background: rgba(22,163,74,0.1);
  color: var(--green);
}

.tool-badge.seo-geo {
  background: rgba(37,99,235,0.08);
  color: var(--accent-mid);
}

/* ── Hub Tool Card Links ──────────────────────────────────── */
.tool-card-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  text-decoration: none;
}

.tool-card-link h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.tool-card-link p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }

.ad-sidebar {
  width: 300px;
  min-height: 250px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  border-radius: 6px;
}

.sidebar-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.85rem;
}

.sidebar-info h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.sidebar-info p  { color: var(--muted); line-height: 1.5; }

/* ── Ad Below Tool ────────────────────────────────────────── */
.ad-below-tool {
  width: 100%;
  background: var(--border);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  border-radius: 6px;
  margin-top: 1.25rem;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ── Content Card (about/privacy pages) ──────────────────── */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.back-link:hover { color: var(--accent); text-decoration: none; }

/* ── Highlighted sentences (snippet extractor) ────────────── */
.snippet-highlight {
  background: rgba(37,99,235,0.12);
  border-left: 3px solid var(--accent);
  padding: 0 3px;
  border-radius: 2px;
}

/* ── Sentence card (snippet extractor) ───────────────────── */
.sentence-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.sentence-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.score-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.criterion-list {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
}

.criterion-list li {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.15rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.criterion-list .tick { color: var(--green); }
.criterion-list .dash { color: var(--border); }

/* ── Question card (question coverage) ───────────────────── */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.question-card blockquote {
  border-left: 3px solid var(--border);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Score chip ───────────────────────────────────────────── */
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.score-chip.good { background: rgba(22,163,74,0.1); color: var(--green); }
.score-chip.warn { background: rgba(217,119,6,0.1); color: var(--amber); }
.score-chip.bad  { background: rgba(220,38,38,0.1); color: var(--danger); }
.score-chip.info { background: rgba(37,99,235,0.1); color: var(--accent); }

/* ── Issue panel ──────────────────────────────────────────── */
.issue-panel {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.issue-panel.no-issues {
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(22,163,74,0.25);
  color: var(--green);
}

.issue-panel.has-issues {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--amber);
}

.issue-panel ul {
  margin: 0.5rem 0 0 1.25rem;
}

.issue-panel li {
  margin-bottom: 0.35rem;
}

/* ── Toggle wrap (stop words etc) ────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.toggle-wrap input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ── Table styles (word frequency) ───────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--bg);
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

thead th:hover { color: var(--accent); }

thead th .sort-icon {
  display: inline-block;
  margin-left: 0.3rem;
  opacity: 0.4;
  font-style: normal;
}

thead th.sort-asc  .sort-icon,
thead th.sort-desc .sort-icon { opacity: 1; color: var(--accent); }

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f1f5f9; }

tbody td {
  padding: 0.55rem 0.9rem;
  vertical-align: middle;
}

.freq-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.freq-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  min-width: 40px;
  max-width: 120px;
}

.freq-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.2s;
}

.freq-pct { min-width: 3.5rem; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Gauge (GEO Score and Readability) ────────────────────── */
.gauge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* ── Subscore bars ────────────────────────────────────────── */
.subscore {
  margin-bottom: 0.85rem;
}

.subscore-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.subscore-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.info-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--border);
  border-radius: 50%;
  text-align: center;
  line-height: 14px;
  font-size: 0.65rem;
  color: var(--muted);
  cursor: help;
  font-style: normal;
}

.info-icon .tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  width: 200px;
  line-height: 1.4;
  z-index: 300;
  white-space: normal;
  pointer-events: none;
}

.info-icon:hover .tip,
.info-icon:focus .tip { display: block; }

.subscore-value {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
}

.bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

/* ── Cloud card ───────────────────────────────────────────── */
.cloud-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.cloud-card h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.score-card h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

/* ── Tooltip ──────────────────────────────────────────────── */
#cloud-tooltip {
  position: fixed;
  background: var(--text);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  pointer-events: none;
  display: none;
  z-index: 200;
  white-space: nowrap;
}

/* ── Results grid (GEO Score) ─────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .results-grid { grid-template-columns: 1fr; }
}

/* ── Section info card ────────────────────────────────────── */
.info-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.info-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.info-section p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Highlighted text block ───────────────────────────────── */
.highlighted-text-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ── Percentage badge ─────────────────────────────────────── */
.pct-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

.pct-badge.good { background: rgba(22,163,74,0.1); color: var(--green); }
.pct-badge.warn { background: rgba(217,119,6,0.1); color: var(--amber); }
.pct-badge.bad  { background: rgba(220,38,38,0.1); color: var(--danger); }

/* ── Blockquote ───────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--border);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

/* ── Section header within results ───────────────────────── */
.results-section-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ── Show/hide toggle link ────────────────────────────────── */
.show-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  margin-top: 0.5rem;
}

.show-more-btn:hover { text-decoration: underline; }

/* ── Hub hero ─────────────────────────────────────────────── */
.hero {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.65rem; }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 1.75rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Explainer section ────────────────────────────────────── */
.explainer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.explainer h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.explainer p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.explainer p:last-child { margin-bottom: 0; }

/* ── Tool grid (hub) ──────────────────────────────────────── */
.tools-section { margin-bottom: 3rem; }

.tools-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .tool-grid { grid-template-columns: 1fr; }
}

/* ── Learning pathway ─────────────────────────────────────── */
.pathway-section {
  margin-bottom: 3rem;
}

.pathway-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.pathway-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .pathway-grid { grid-template-columns: 1fr; }
}

.pathway-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.pathway-card .level-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.pathway-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pathway-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Responsive helpers ───────────────────────────────────── */
@media (max-width: 480px) {
  .next-tool-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Start here badge (GEO Score card) ───────────────────── */
.tool-badge-start {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  margin-bottom: 0.45rem;
}

/* ── Goal cards section ───────────────────────────────────── */
.goal-section {
  margin-bottom: 3rem;
}

.goal-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .goal-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .goal-grid { grid-template-columns: 1fr; }
}

.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.goal-icon {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
  line-height: 1;
}

.goal-statement {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.goal-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.goal-link {
  font-size: 0.8rem;
  color: var(--muted);
}

.goal-link a {
  color: var(--accent);
  font-weight: 500;
}

/* ── Tool router widget ───────────────────────────────────── */
.router-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
}

.router-widget h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.router-step { }

.router-hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.router-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .router-btn-group {
    flex-direction: column;
  }
}

.router-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}

.router-btn:hover {
  border-color: var(--accent-pale);
  background: var(--surface);
}

.router-btn--active {
  border-color: var(--accent);
  background: rgba(37,99,235,0.07);
  color: var(--accent);
  font-weight: 600;
}

.router-back-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.85rem;
  display: inline-block;
}

.router-back-link:hover { color: var(--accent); }

.router-result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.85rem;
}

.router-result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.router-result-tool {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.router-result-desc {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.router-result-why {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-style: italic;
}

.router-result-link {
  margin-top: 0.25rem;
}

.router-all-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.router-tool-chip {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.router-tool-chip:hover {
  background: rgba(37,99,235,0.07);
  border-color: var(--accent-pale);
  text-decoration: none;
}

/* ── Accessibility utility ────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
