/* =====================================================================
   ClearKeywords - STYLESHEET
   A clean, plain, content-first design system.

   Structure:
     1. Variables         - every design decision lives here
     2. Reset & Base       - sensible defaults
     3. Typography         - type scale, measure, rhythm
     4. Layout             - containers, sections, grids
     5. Components         - nav, footer, buttons, forms, cards,
                              badges, tables, tooltips, callouts
     6. Page Patterns       - hero/launcher, tool pages, brief +
                              title/meta generator, blog, legal/404
     7. Responsive          - tablet and mobile adjustments

   FONT NOTE
   The font stack below puts Inter first. Inter is not bundled here
   to avoid a render-blocking @import in a single-file stylesheet.
   To enable it, add this to your <head>:

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">

   Without it, the stack falls back to the OS system font (San
   Francisco, Segoe UI Variable, Roboto) - all close cousins of
   Inter, so the design holds up either way.
   ===================================================================== */


/* =====================================================================
   1. VARIABLES
   ===================================================================== */
:root {

  /* ---- Colour: a strictly limited, neutral palette ------------------
     One off-white page colour, one paper-white surface, one charcoal
     ink, one muted grey for secondary text, one quiet border colour,
     and a single restrained accent reserved for primary CTAs. */
  --color-bg: #F7F6F3;
  /* page background - off-white */
  --color-surface: #FFFFFF;
  /* cards, inputs, the "paper" */
  --color-surface-2: #F1EFEA;
  /* table headers, soft fills */
  --color-ink: #1B1B1A;
  /* headings, body text, hover & selected states (not pure black) */
  --color-muted: #6E6D68;
  /* secondary / supporting text */
  --color-border: #E4E1DA;
  /* default hairline border */
  --color-border-strong: #D3CFC6;
  /* inputs, slightly firmer edges */

  /* The single accent - used only for primary CTA buttons and the
     small selected-state wash in the title/meta tool. Everything
     else (active tabs, hovers, focus) uses --color-ink. */
  --color-accent: #3D6B52;
  /* deep, muted forest green */
  --color-accent-hover: #1B1B1A;
  /* primary CTA hover = ink, per spec */
  --color-accent-on: #FFFFFF;
  /* text on the accent */
  --color-accent-light: #E8EFE9;
  /* pale accent wash, "selected" state */

  /* Inverse surfaces (used sparingly: tooltips, the "next step" box) */
  --color-ink-on: #FAFAF8;
  /* text on an ink background */

  /* ---- Typography ---------------------------------------------------
     Inter first, system fonts as a faithful fallback. */
  --font-sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Base sizes */
  --text-xs: 0.8125rem;
  /* 13px - captions, labels */
  --text-sm: 0.9375rem;
  /* 15px - secondary text, UI */
  --text-base: 1rem;
  /* 16px - default UI text */
  --text-md: 1.0625rem;
  /* 17px - long-form article body */
  --text-lg: 1.25rem;
  /* 20px - lede, large UI */

  /* Heading scale - bold, with clear jumps, never shouting */
  --text-h4: 1.125rem;
  /* 18px */
  --text-h3: clamp(1.25rem, 1.6vw + 0.9rem, 1.5rem);
  /* 20 -> 24px */
  --text-h2: clamp(1.75rem, 2.6vw + 1rem, 2.375rem);
  /* 28 -> 38px */
  --text-h1: clamp(2.25rem, 4vw + 1.25rem, 3.5rem);
  /* 36 -> 56px */

  --weight-body: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.2;
  /* headings */
  --leading-base: 1.6;
  /* UI text */
  --leading-loose: 1.7;
  /* long-form article copy */

  /* ---- Spacing scale -------------------------------------------------
     Generous by default. These feed almost every gap, margin, and
     padding in the system, so increasing them increases the "air"
     on the page everywhere at once. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;

  /* Section / card rhythm - the main "whitespace" levers */
  --section-y: clamp(3.5rem, 7vw, 6.5rem);
  --section-y-tight: clamp(2.5rem, 5vw, 4rem);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --card-pad: clamp(1.5rem, 2.6vw, 2.25rem);
  --card-pad-tight: clamp(1.1rem, 2vw, 1.5rem);
  --grid-gap: clamp(1.25rem, 2.4vw, 2rem);
  --grid-gap-tight: clamp(1rem, 1.8vw, 1.5rem);

  /* ---- Radius -------------------------------------------------------
     Subtle and consistent. Pills for tags/badges, a single 8px
     radius for cards, controls and surfaces. */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* ---- Shadow -------------------------------------------------------
     Very soft, used sparingly: a hint of lift on hover and on the
     one floating element (the jargon tooltip). Buttons stay flat. */
  --shadow-sm: 0 1px 2px rgba(27, 27, 26, 0.05);
  --shadow-md: 0 12px 28px rgba(27, 27, 26, 0.08);

  /* ---- Layout widths --------------------------------------------------
     Unchanged from the previous system on purpose - these numbers
     are tuned against the grid min-widths below, so widening them
     would silently change column counts. Whitespace comes from the
     spacing tokens above, not from stretching the canvas. */
  --container-max: 1040px;
  --container-wide: 1180px;
  --content-max: 720px;
  /* ~68-72ch reading measure */
  --hero-max: 980px;
  --tool-max: 980px;
  --tool-wide-max: 1120px;

  /* Grid minimums - change these to control cards-per-row */
  --grid-card-min: 16rem;
  --grid-card-min-small: 13.5rem;
  --grid-blog-min: 18rem;
  --grid-related-min: 17rem;
  --grid-step-min: 14rem;

  /* Component sizing */
  --control-height: 46px;
  --control-height-sm: 38px;
  --button-height: 46px;
  --button-height-sm: 38px;
  --button-height-lg: 52px;

  /* Focus ring */
  --focus-ring: var(--color-ink);

  /* Callouts */
  --callout-tip-bg: var(--color-accent-light);
  --callout-tip-border: var(--color-accent);
  --callout-tip-text: var(--color-ink);
  --callout-warning-bg: var(--color-surface-2);
  --callout-warning-border: var(--color-ink);
  --callout-warning-text: var(--color-ink);
}


/* =====================================================================
   2. RESET & BASE
   ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-body);
  line-height: var(--leading-base);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

/* Overflow protection: children scale to their container */
:where(section, div, article, aside, header, footer, nav, main, form,
  table, th, td, a, p, h1, h2, h3, h4, h5, h6, li, button, input,
  textarea, select) {
  min-width: 0;
}

:where(p, h1, h2, h3, h4, h5, h6, a, button, td, th, li, span) {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ul,
ol {
  padding-left: 1.35rem;
}

::selection {
  background: var(--color-ink);
  color: var(--color-ink-on);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

[hidden] {
  display: none !important;
}

/* Screen-reader-only labels (used on every form input's <label>) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* =====================================================================
   3. TYPOGRAPHY
   ===================================================================== */
h1,
h2,
h3,
h4 {
  color: var(--color-ink);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  max-width: 22ch;
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.012em;
}

h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.008em;
}

p {
  max-width: 70ch;
  /* the requested ~65-75 character measure */
  text-wrap: pretty;
}

small {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

strong,
b {
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}


/* =====================================================================
   4. LAYOUT - containers, sections, grids
   ===================================================================== */

/* Page-edge containers. Every top-level wrapper shares one width rule. */
.container,
.hero-inner,
.footer-inner,
.nav-inner,
.tips-inner,
.blog-hero-inner,
.blog-layout,
.related-inner,
.learn-card,
.error-inner,
.error-tools-inner {
  width: min(var(--container-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

/* Generous vertical rhythm between sections */
.section,
.tips-section,
.related-section,
.learn-section,
.section-alt,
.section-white {
  padding-block: var(--section-y);
}

.section-alt,
.section-white,
.tips-section,
.related-section,
.learn-section {
  background: transparent;
  border: 0;
}

/* Section headers */
.section-header {
  max-width: var(--content-max);
  margin-bottom: var(--space-6);
}

.section-header.compact-header {
  max-width: 620px;
}

.section-header.split-header {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 400px);
  gap: var(--space-6);
  align-items: end;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: var(--space-3);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  margin-bottom: var(--space-2);
}

.section-sub {
  color: var(--color-muted);
  max-width: 56ch;
}

/* Small uppercase labels at the top of blog/related cards */
.blog-card-label,
.related-card-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Shared grid systems --------------------------------------------
   One auto-fit grid pattern, reused everywhere via min-width tokens. */
.tools-grid,
.tips-grid,
.honesty-grid,
.intent-grid,
.brief-stats,
.power-words-list,
.steps-list,
.form-options,
.error-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-card-min)), 1fr));
  gap: var(--grid-gap);
}

.tips-grid,
.honesty-grid,
.brief-stats,
.form-options,
.error-tools-grid {
  --grid-card-min: var(--grid-card-min-small);
}

.steps-list {
  --grid-card-min: var(--grid-step-min);
}

.blog-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-blog-min)), 1fr));
  gap: var(--grid-gap);
}

.related-grid {
  --grid-blog-min: var(--grid-related-min);
}

.blog-index-grid {
  max-width: 980px;
  margin-inline: auto;
}

/* Stretch grid children to equal height for a calm, aligned rhythm */
.tools-grid,
.tips-grid,
.honesty-grid,
.intent-grid,
.steps-list,
.blog-grid,
.related-grid,
.brief-stats,
.power-words-list,
.result-guide {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.tools-grid>*,
.tips-grid>*,
.honesty-grid>*,
.intent-grid>*,
.steps-list>*,
.blog-grid>*,
.related-grid>*,
.brief-stats>*,
.power-words-list>*,
.result-guide>* {
  min-width: 0;
  height: 100%;
}


/* =====================================================================
   5. COMPONENTS
   ===================================================================== */

/* ---- 5.1 Navigation --------------------------------------------------- */
nav#site-nav,
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 246, 243, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
}

.nav-inner .logo {
  justify-self: start;
}

.nav-links {
  justify-self: center;
}

.nav-cta {
  justify-self: end;
  flex-shrink: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-ink);
  text-decoration: none;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--color-ink);
  color: var(--color-ink-on);
  font-weight: var(--weight-bold);
  line-height: 1;
}

/* A single touch of the accent, in the wordmark only */
.logo-word span,
.logo>span:not(.logo-mark),
.logo span span {
  color: var(--color-accent);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links a {
  color: var(--color-ink);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.nav-links a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 18px;
  height: 1.5px;
  background: var(--color-ink);
  border-radius: 1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle--open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle--open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle--open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}


/* ---- 5.2 Footer --------------------------------------------------------- */
footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  padding-block: var(--space-10) var(--space-6);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: var(--space-8);
}

.footer-brand p {
  margin-block: var(--space-3);
  color: var(--color-muted);
  max-width: 32ch;
}

.footer-col h4 {
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.footer-col a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}

.footer-col a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.bmc-link {
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  color: var(--color-muted);
  font-size: var(--text-sm);
}


/* ---- 5.3 Buttons --------------------------------------------------------- */
.btn,
.error-box button,
.copy-btn,
.cluster-tab,
.example-chip,
.feed-tab,
.blog-card-link,
.launcher-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--button-height);
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-ink);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.1;
  box-shadow: none;
  transition: background 0.14s ease, color 0.14s ease,
    border-color 0.14s ease, box-shadow 0.14s ease;
}

/* Default hover: every non-primary control darkens toward ink */
.btn:hover,
.error-box button:hover,
.copy-btn:hover,
.cluster-tab:hover,
.example-chip:hover,
.feed-tab:hover,
.launcher-tab:hover {
  border-color: var(--color-ink);
  background: var(--color-surface-2);
}

.blog-card:hover .blog-card-link {
  text-decoration: underline;
}

/* Primary CTA - the one place the accent colour appears */
.btn-primary,
.launcher-tab.active,
.cluster-tab.active,
.feed-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-on);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-ink-on);
}

/* Active tabs/pills use ink, not the accent, to keep the accent
   reserved for primary CTA buttons only */
.launcher-tab.active,
.cluster-tab.active,
.feed-tab.active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-ink-on);
}

.launcher-tab.active:hover,
.cluster-tab.active:hover,
.feed-tab.active:hover {
  background: var(--color-ink);
  color: var(--color-ink-on);
}

.btn-outline {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-border-strong);
}

.btn-white {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-border-strong);
}

.btn-sm {
  min-height: var(--button-height-sm);
  padding: 0.45rem 0.85rem;
  font-size: var(--text-xs);
}

.btn-lg {
  min-height: var(--button-height-lg);
  padding: 0.85rem 1.5rem;
  font-size: var(--text-base);
}

/* "Already done" state for copy/used buttons */
.btn.copied,
.copy-btn.copied,
.btn.used,
.copy-btn.used {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-ink);
}


/* ---- 5.4 Forms & inputs --------------------------------------------------- */
input,
select,
textarea,
.option-select {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-ink);
  padding: 0.7rem 1rem;
  font-size: var(--text-sm);
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-muted);
}

input:focus,
select:focus,
textarea:focus,
.option-select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--color-ink);
}

label,
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 12rem);
  gap: var(--space-3);
  align-items: stretch;
}

.option-select,
.brief-form select {
  min-height: var(--control-height-sm);
  background: var(--color-surface-2);
  border-color: var(--color-border);
  font-size: var(--text-sm);
}

.option-select:hover,
.brief-form select:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
}

.search-bar,
.tool-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: stretch;
}

.search-bar input,
.tool-search input {
  min-height: var(--button-height);
  border-color: var(--color-border-strong);
}

.search-bar .btn,
.tool-search .btn {
  white-space: nowrap;
}

.brief-form {
  display: grid;
  gap: var(--space-3);
  padding: var(--card-pad-tight);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.brief-form .form-row {
  margin: 0;
}

.brief-form input {
  min-height: var(--button-height);
}

.brief-form .btn {
  min-height: var(--button-height);
  white-space: nowrap;
}


/* ---- 5.5 Cards ----------------------------------------------------------
   One shared "card" treatment used across every box on the site:
   white surface, soft border, 8px radius, generous padding, and a
   gentle lift on hover for interactive cards. */
.tool-card,
.tip-card,
.blog-card,
.related-card,
.honesty-card,
.intent-card,
.step,
.faq-item,
.sidebar-card,
.legal-card,
.meta-card,
.title-card,
.angle-box,
.serp-card,
.output-block,
.brief-section,
.data-coming,
.upgrade-banner,
.state-empty,
.state-loading,
.state-error,
.error-box,
.tool-next-card,
.blog-next-box,
.callout,
.serp-preview,
.result-guide-item,
.stat-pill,
.title-item,
.outline-item,
.link-item,
.meta-box,
.results-content,
.brief-content,
.launcher-card,
.tool-cta {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: none;
}

.tool-card,
.tip-card,
.blog-card,
.related-card,
.honesty-card,
.intent-card,
.step,
.faq-item,
.sidebar-card,
.legal-card,
.meta-card,
.title-card,
.angle-box,
.serp-card,
.output-block,
.brief-section,
.data-coming,
.tool-next-card,
.blog-next-box,
.callout,
.serp-preview,
.launcher-card {
  padding: var(--card-pad);
}

/* Cards that contain text are flex columns with a comfortable gap */
.tool-card,
.tip-card,
.blog-card,
.related-card,
.honesty-card,
.intent-card,
.step,
.sidebar-card,
.legal-card,
.meta-card,
.title-card,
.angle-box,
.serp-card,
.output-block,
.brief-section,
.data-coming,
.tool-next-card,
.blog-next-box,
.callout,
.serp-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  overflow: hidden;
}

.tool-card *,
.tip-card *,
.blog-card *,
.related-card *,
.honesty-card *,
.intent-card *,
.step *,
.sidebar-card * {
  min-width: 0;
  max-width: 100%;
}

/* Interactive cards: a soft lift on hover, never a colour change */
.tool-card,
.blog-card,
.related-card,
.sidebar-tool-link,
.link-item {
  color: var(--color-ink);
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    transform 0.16s ease;
}

.tool-card:hover,
.blog-card:hover,
.related-card:hover,
.sidebar-tool-link:hover,
.link-item:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Equal-height card grids */
.tool-card,
.blog-card,
.related-card,
.honesty-card,
.intent-card,
.step,
.faq-item,
.result-guide-item,
.stat-pill {
  min-width: 0;
  overflow: hidden;
  height: 100%;
}

.tool-card,
.blog-card,
.related-card,
.honesty-card,
.intent-card,
.step {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.tool-card {
  min-height: 15rem;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.blog-card {
  min-height: 15.5rem;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.related-card,
.honesty-card,
.intent-card,
.step,
.tip-card,
.result-guide-item {
  min-height: 11.5rem;
}

.step,
.honesty-card,
.intent-card,
.related-card {
  grid-template-rows: auto auto minmax(0, 1fr);
}

/* Clamp body text inside repeated cards so one long item never
   stretches a whole row */
.tool-desc,
.blog-card p,
.related-card p,
.tip-card p,
.honesty-card p,
.intent-card p,
.step p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 3;
}

.blog-card h2,
.blog-card h3,
.related-card h4,
.tool-name,
.tip-card h4,
.honesty-card h3,
.intent-card h3,
.step h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card h2,
.blog-card h3,
.related-card h4 {
  -webkit-line-clamp: 3;
}

.tool-name,
.tip-card h4,
.honesty-card h3,
.intent-card h3,
.step h3 {
  -webkit-line-clamp: 2;
}

.tool-name,
.tip-card h4,
.honesty-card h3,
.intent-card h3,
.step h3 {
  font-size: var(--text-h4);
}

.blog-card h2,
.blog-card h3,
.related-card h4 {
  font-size: clamp(1.25rem, 1.6vw + 0.9rem, 1.45rem);
  letter-spacing: -0.015em;
}

.tool-card:hover .tool-link .arrow,
.blog-card:hover .arrow {
  transform: translateX(3px);
}

.tool-link,
.blog-card-link {
  margin-top: auto;
  align-self: flex-start;
  justify-self: start;
}

.tool-link .arrow,
.blog-card-link .arrow {
  display: inline-block;
  transition: transform 0.14s ease;
}

/* Small square "letter"/icon marks on tool cards */
.tool-card-letter,
.big-icon,
.sidebar-tool-icon,
.label-icon,
.data-coming-icon,
.tool-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.sidebar-tool-icon,
.label-icon,
.data-coming-icon {
  margin: 0;
  flex: 0 0 auto;
}

.step-num {
  display: block;
  color: var(--color-muted);
  font-weight: var(--weight-bold);
  font-size: var(--text-h3);
  margin-bottom: var(--space-2);
}


/* ---- 5.6 Badges, tags & pills ---------------------------------------------
   A single shared pill shape. Variants are distinguished by subtle
   ink-tinted backgrounds rather than new hues, keeping the palette
   neutral while still giving each category its own identity. */
.hero-kicker span,
.stat-pill,
.kw-chip,
.type-badge,
.intent-badge,
.angle-badge,
.heading-tag,
.label.live,
.label.soon,
.badge,
.tool-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

/* Result-type badges: tonal variants of ink, no new hues */
.type-badge.type-question,
.type-badge.type-search {
  background: var(--color-surface-2);
}

.type-badge.type-comparison,
.type-badge.type-semantic {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.type-badge.type-modifier,
.type-badge.type-idea {
  background: var(--color-ink);
  color: var(--color-ink-on);
  border-color: var(--color-ink);
}

.type-badge.type-general,
.type-badge.type-topic {
  background: var(--color-surface);
  color: var(--color-muted);
}

/* Relevance badges - intensity instead of traffic-light colour */
.badge.rel-high {
  background: var(--color-ink);
  color: var(--color-ink-on);
  border-color: var(--color-ink);
}

.badge.rel-med {
  background: var(--color-surface-2);
  color: var(--color-ink);
}

.badge.rel-low {
  background: var(--color-surface);
  color: var(--color-muted);
}

/* "Live" / "Coming later" labels on the homepage honesty grid */
.label.live {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-ink);
}

.label.soon {
  background: var(--color-surface-2);
  color: var(--color-muted);
}

/* Power-word angle tags */
.angle-badge.angle-benefit {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.angle-badge.angle-question {
  background: var(--color-surface-2);
}

.angle-badge.angle-number,
.angle-badge.angle-curiosity {
  background: var(--color-ink);
  color: var(--color-ink-on);
  border-color: var(--color-ink);
}

.angle-badge.angle-keyword {
  background: var(--color-surface);
  color: var(--color-muted);
}

/* H2/H3 outline tags */
.heading-tag.tag-h1 {
  background: var(--color-ink);
  color: var(--color-ink-on);
  border-color: var(--color-ink);
}

.heading-tag.tag-h2 {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.heading-tag.tag-h3 {
  background: var(--color-surface-2);
  color: var(--color-muted);
}


/* ---- 5.7 Tables & results -------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
}

th,
td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-surface-2);
}

tr:last-child td {
  border-bottom: 0;
}

.results-table {
  table-layout: fixed;
  width: 100%;
}

.keyword-results-table {
  min-width: 720px;
}

.related-results-table {
  min-width: 980px;
}

.results-table .col-index {
  width: 54px;
}

.results-table .col-keyword {
  width: auto;
}

.results-table .col-action {
  width: 120px;
}

.keyword-results-table .col-type {
  width: 190px;
}

.related-results-table .col-type {
  width: 150px;
}

.related-results-table .col-relevance {
  width: 145px;
}

.related-results-table .col-source {
  width: 140px;
}

.related-results-table .col-wordcount {
  width: 120px;
}

.results-table th,
.results-table td {
  overflow-wrap: anywhere;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: center;
}

.results-table th:last-child,
.results-table td:last-child {
  text-align: right;
}

.results-table .kw-text {
  display: inline-block;
  max-width: 100%;
}

.results-table .type-badge,
.results-table .badge {
  white-space: nowrap;
}

.results-table .copy-btn {
  min-width: 78px;
}

.kw-text,
.source-cell,
.angle-keyword,
.title-text,
.meta-text {
  font-weight: var(--weight-semibold);
}

.result-index {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.result-muted,
.title-card-meta,
.intent-card-label,
.intent-card-example,
.intent-card-write {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.truncated {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intent-table,
.limit-table,
.blog-example-table {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.intent-table table,
.limit-table table,
.blog-example-table table {
  min-width: 520px;
}


/* ---- 5.8 Jargon tooltips ----------------------------------------------------- */
.jargon {
  position: relative;
  display: inline;
  border-bottom: 1px dotted var(--color-ink);
  font-weight: var(--weight-semibold);
  cursor: help;
}

.jargon-icon {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.65rem;
  font-weight: var(--weight-bold);
  line-height: 1;
  vertical-align: 0.1rem;
}

.jargon-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.6rem);
  transform: translateX(-50%);
  z-index: 20;
  width: min(280px, calc(100vw - 32px));
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--color-ink);
  color: var(--color-ink-on);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.jargon:hover .jargon-tip,
.jargon:focus-within .jargon-tip,
.jargon.tip-open .jargon-tip {
  opacity: 1;
  visibility: visible;
}


/* ---- 5.9 Callouts -------------------------------------------------------------- */
.callout {
  border-color: var(--color-border);
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-ink);
}

.callout strong {
  display: block;
  margin-bottom: var(--space-1);
}

.callout-tip {
  background: var(--callout-tip-bg);
  border-color: var(--callout-tip-border);
  border-left-color: var(--color-accent);
  color: var(--callout-tip-text);
}

.callout-warning {
  background: var(--callout-warning-bg);
  border-color: var(--color-border);
  border-left-color: var(--color-ink);
  color: var(--callout-warning-text);
}


/* ---- 5.10 SERP preview ----------------------------------------------------------- */
.serp-preview {
  gap: var(--space-1);
}

.serp-label {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.serp-favicon {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  margin-right: var(--space-2);
  vertical-align: -0.05rem;
}

.serp-url {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.serp-title {
  color: var(--color-ink);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.serp-desc {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.serp-card {
  display: grid;
  gap: var(--space-1);
}

.serp-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: stretch;
}

.serp-compare .serp-preview {
  margin: 0;
  height: 100%;
}


/* =====================================================================
   6. PAGE PATTERNS
   ===================================================================== */

/* ---- 6.1 Homepage hero + launcher --------------------------------------- */
.hero {
  padding-block: clamp(2.75rem, 6vw, 5rem);
}

.hero-inner.hero-board,
.hero-board {
  width: min(var(--hero-max), calc(100% - var(--gutter) * 2));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(min(100%, 320px), 0.85fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.hero-copy,
.launcher-card,
.honesty-panel,
.learn-card,
.support-card,
.bmc-card-inner {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.hero-tag {
  display: inline-block;
  margin-bottom: var(--space-3);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: var(--space-4);
}

.hero-lede {
  color: var(--color-muted);
  font-size: var(--text-lg);
  margin-bottom: var(--space-5);
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.launcher-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: var(--card-pad);
  align-self: center;
  max-width: 420px;
  justify-self: end;
}

.launcher-head {
  margin-bottom: var(--space-4);
}

.launcher-label {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.launcher-head strong {
  display: block;
  font-size: var(--text-h3);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.launcher-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.launcher-tab {
  width: 100%;
  min-height: 40px;
  padding-inline: var(--space-2);
  font-size: var(--text-xs);
}

.launcher-note,
.tool-note {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
  max-width: 42rem;
}

.usage-note {
  color: var(--color-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  max-width: 42rem;
}

.tool-search+.tool-note+.usage-note,
.brief-form+.tool-note+.usage-note {
  margin-top: var(--space-1);
}

/* Page-specific hooks: these co-occur with .hero / .section / .launcher-card
   and inherit that styling. Kept as empty, named anchors so a future
   page-specific tweak has somewhere to go without touching the shared rule. */
.hero-home,
.section-tools,
.launcher {}


/* ---- 6.2 Tools grid / steps / honesty / learn / support --------------------- */
.honesty-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-8);
  align-items: start;
}

.honesty-panel .honesty-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.honesty-copy>*+* {
  margin-top: var(--space-3);
}

.steps-list {
  list-style: none;
  padding: 0;
}

.learn-section {
  padding-block: var(--space-10);
}

.learn-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-6);
}

.bmc-card-inner,
.tool-next-card,
.blog-next-box,
.upgrade-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  min-height: 6.5rem;
}

.bmc-card-text,
.learn-card-content {
  flex: 1 1 320px;
  min-width: 0;
}

.bmc-card-text strong {
  display: block;
  margin-bottom: var(--space-1);
}

.bmc-card-text p {
  color: var(--color-muted);
  margin: 0;
}

.upgrade-banner {
  padding: var(--card-pad-tight);
  margin-top: var(--space-4);
}

.upgrade-banner-text p,
.data-coming,
.loading-sub,
.results-meta-left p,
.results-header-left p,
.output-block-note,
.brief-meta-left p {
  color: var(--color-muted);
}


/* ---- 6.3 Tool pages: hero, shell, results, tabs, banner, tips, SEO block ----- */
.tool-hero {
  padding: var(--section-y-tight) 0 var(--space-6);
}

.tool-hero-inner {
  width: min(var(--tool-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.tool-hero h1 {
  margin-bottom: var(--space-3);
}

.tool-hero p {
  color: var(--color-muted);
  font-size: var(--text-lg);
}

.tool-hero-inner>p {
  margin-bottom: 0;
}

.tool-search,
.brief-form {
  margin-top: var(--space-5);
}

.tool-shell {
  width: min(var(--tool-wide-max), calc(100% - var(--gutter) * 2));
  margin: var(--space-4) auto var(--space-10);
}

.tool-shell--compact {
  max-width: var(--tool-max);
}

.results-area {
  display: grid;
  gap: var(--space-4);
}

.results-area>* {
  width: 100%;
}

.state-empty,
.state-loading,
.state-error {
  padding: var(--card-pad);
  text-align: left;
}

.state-loading,
.state-error,
.results-content,
.brief-content {
  display: none;
}

.results-content[style*="block"],
.brief-content[style*="block"] .brief-card {
  display: grid;
}

.results-content,
.brief-content {
  padding: var(--card-pad);
  gap: var(--space-4);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-ink);
  border-radius: var(--radius-pill);
  animation: spin 0.75s linear infinite;
  margin-bottom: var(--space-3);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.try-examples,
.kw-chips,
.brief-meta,
.title-list,
.outline-list,
.link-list,
.faq-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.title-list,
.outline-list,
.faq-list,
.link-list {
  display: grid;
  gap: var(--space-3);
}

.results-meta,
.results-header,
.output-block-header,
.meta-card-top,
.title-card-top,
.brief-actions,
.meta-card-footer,
.results-actions,
.blog-next-actions,
.tool-next-actions,
.brief-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.results-meta,
.brief-meta {
  margin-bottom: var(--space-2);
  align-items: center;
}

.results-meta-left,
.results-header-left,
.brief-meta-left {
  max-width: 44rem;
}

.results-actions,
.brief-actions {
  align-items: center;
  flex-wrap: wrap;
}

.cluster-tabs,
.feed-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.tab-count {
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  font-size: 0.7rem;
}

.cluster-tab.active .tab-count,
.launcher-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: var(--color-ink-on);
}

.cluster-tab.empty-tab {
  opacity: 0.45;
}

/* Result-guide strip */
.result-guide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.result-guide--wide {
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
}

.result-guide-item {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--color-surface-2);
  padding: var(--card-pad-tight);
}

.result-guide-item strong {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-guide-item p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-base);
}

/* Tips section */
.tips-section {
  padding-block: var(--section-y-tight);
}

.tip-card {
  gap: var(--space-2);
}

/* About-this-tool / FAQ section */
.tool-seo-section {
  padding-top: var(--section-y-tight);
}

.prose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.prose-grid>div>*+*,
.seo-subsection>*+* {
  margin-top: var(--space-3);
}

.seo-subsection {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.compact-faq {
  align-self: start;
}

.faq-list {
  display: grid;
  gap: var(--space-3);
}

.faq-item h3 {
  margin-bottom: var(--space-1);
}

/* Tool next-step + support sections */
.tool-next-section {
  padding-block: var(--space-8);
}

.tool-support-section {
  padding-block: var(--space-6);
}


/* ---- 6.4 Brief generator + Title/Meta generator specifics ------------------- */
.brief-card {
  display: grid;
  gap: var(--space-4);
}

.brief-section {
  gap: var(--space-3);
}

.brief-section-label {
  margin-bottom: var(--space-1);
}

.brief-angle-stack {
  display: grid;
  gap: var(--space-3);
}

.brief-angle-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.brief-inline-label {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.angle-box {
  background: var(--color-surface-2);
}

.stat-pill {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  padding: var(--card-pad-tight);
  background: var(--color-surface-2);
  min-height: auto;
}

.stat-pill strong {
  font-size: var(--text-h4);
  line-height: 1.1;
}

.stat-pill span {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.title-item,
.outline-item,
.link-item,
.meta-box {
  padding: var(--card-pad-tight);
}

.title-item,
.outline-item,
.link-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  justify-content: space-between;
}

.outline-item {
  justify-content: flex-start;
}

.outline-item--child {
  padding-left: clamp(1.5rem, 3vw, 2.25rem);
}

.link-item:first-child {
  border-top: 0;
}

.title-card,
.meta-card {
  display: grid;
  gap: var(--space-3);
  cursor: pointer;
}

/* Selected state uses the pale accent wash (the one place the
   accent appears outside the primary CTA, as a quiet "selected" tint) */
.title-card.active,
.meta-card.active,
.title-card[style*="--accent-light"],
.meta-card[style*="--accent-light"] {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.title-text,
.meta-text {
  font-size: var(--text-md);
}

.char-bar-wrap,
.char-bar {
  height: 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.char-bar-fill {
  height: 100%;
  width: 0;
  background: var(--color-ink);
  border-radius: var(--radius-pill);
  transition: width 0.2s ease;
}

.char-bar-fill.fill-good {
  background: var(--color-ink);
}

.char-bar-fill.fill-warn {
  background: var(--color-border-strong);
}

.char-count,
.meta-char-count {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.char-count.char-good {
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
}

.char-count.char-warn {
  color: var(--color-muted);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.score-row {
  display: grid;
  gap: var(--space-2);
}

.score-row-spaced {
  margin-top: var(--space-2);
}

.score-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.score-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-border-strong);
  display: inline-block;
  flex-shrink: 0;
}

.score-dot.good,
.score-dot.dot-good {
  background: var(--color-ink);
}

.score-dot.bad,
.score-dot.dot-warn {
  background: var(--color-border-strong);
  border: 1px solid var(--color-muted);
}

.score-dot.dot-off {
  background: var(--color-surface-2);
}

.power-words-wrap {
  display: grid;
  gap: var(--space-3);
}

.power-words-intro {
  color: var(--color-muted);
}

.power-word {
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.output-block {
  gap: var(--space-3);
}

.output-block-title {
  margin-bottom: 0;
}

.output-block h3,
.output-block h4,
.brief-section h3 {
  margin-bottom: var(--space-2);
}

.output-block ul,
.output-block ol,
.brief-section ul,
.brief-section ol {
  display: grid;
  gap: var(--space-2);
}

.output-block-subtitle {
  font-weight: var(--weight-body);
  text-transform: none;
  letter-spacing: 0;
}

.copy-btn-inline {
  margin-left: auto;
}

.data-coming {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.kw-chip {
  background: var(--color-surface-2);
}


/* ---- 6.5 Blog --------------------------------------------------------------------- */
.blog-page-bg {
  background: var(--color-bg);
}

.blog-hero {
  padding: var(--section-y-tight) 0 var(--space-5);
  border-bottom: 0;
}

.blog-hero-inner {
  width: min(var(--container-max), calc(100% - var(--gutter) * 2));
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, var(--content-max)) minmax(240px, 300px);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.blog-hero-inner>* {
  grid-column: 1;
  max-width: var(--content-max);
}

.blog-hero h1 {
  max-width: var(--content-max);
  margin-bottom: var(--space-4);
}

.blog-badge {
  text-decoration: none;
}

.blog-badge:hover {
  text-decoration: underline;
}

.blog-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.blog-layout {
  grid-template-columns: minmax(0, var(--content-max)) minmax(240px, 300px);
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-block: var(--section-y-tight);
  align-items: start;
}

.blog-body {
  min-width: 0;
  max-width: var(--content-max);
  font-size: var(--text-md);
}

.blog-body>*+* {
  margin-top: var(--space-4);
}

.blog-body h2 {
  margin-top: var(--space-10);
}

.blog-body h3 {
  margin-top: var(--space-6);
}

.blog-body p {
  color: var(--color-ink);
  line-height: var(--leading-loose);
}

.blog-body a {
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-color: var(--color-border-strong);
}

.blog-body a:hover {
  text-decoration-color: var(--color-ink);
}

.blog-body a.btn,
.blog-body a.btn:visited,
.blog-body a.btn-primary,
.blog-body a.btn-primary:visited,
.blog-body a.btn-outline,
.blog-body a.btn-outline:visited,
.blog-body a.btn-white,
.blog-body a.btn-white:visited {
  color: inherit;
  text-decoration: none;
}

.blog-body a.btn-primary,
.blog-body a.btn-primary:visited {
  color: var(--color-accent-on);
}

.blog-divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

.blog-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: var(--space-4);
  align-self: start;
}

.sidebar-card {
  height: auto;
}

.sidebar-card h4 {
  margin-bottom: var(--space-3);
}

.sidebar-card-tip {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.sidebar-card-tip p {
  color: var(--color-ink);
  margin: 0;
}

.toc-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.toc-list a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-decoration: none;
}

.toc-list a:hover,
.toc-list a.toc-active {
  color: var(--color-ink);
  text-decoration: underline;
}

.sidebar-tool-link {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
}

.sidebar-tool-link:first-of-type {
  border-top: 0;
}

.sidebar-tool-link:hover {
  border-color: var(--color-border);
  box-shadow: none;
  transform: none;
}

.sidebar-tool-name {
  font-weight: var(--weight-semibold);
}

.sidebar-tool-desc {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.tool-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--card-pad-tight);
  margin: var(--space-6) 0;
}

.tool-cta-text p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.blog-next-box {
  margin-top: var(--space-8);
  background: var(--color-ink);
  color: var(--color-ink-on);
  border-color: var(--color-ink);
}

.blog-next-box .section-label,
.blog-next-box p {
  color: rgba(250, 250, 248, 0.65);
}

.blog-next-box h3 {
  color: var(--color-ink-on);
}

.blog-next-box .btn-outline {
  background: transparent;
  border-color: rgba(250, 250, 248, 0.35);
  color: var(--color-ink-on);
}

.blog-next-box .btn-outline:hover {
  border-color: var(--color-ink-on);
  background: rgba(250, 250, 248, 0.08);
}

.related-section {
  padding-block: var(--space-10);
}

.blog-card {
  min-height: 100%;
}

/* Search-intent cards */
.intent-grid {
  gap: var(--grid-gap-tight);
}

.intent-card-label {
  margin-bottom: var(--space-1);
}


/* ---- 6.6 Legal & 404 -------------------------------------------------------------- */
.legal-page {
  padding-block: var(--section-y-tight);
}

.legal-card {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--card-pad);
}

.legal-card>*+* {
  margin-top: var(--space-3);
}

.legal-card h2 {
  margin-top: var(--space-6);
}

.legal-card a {
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

.legal-updated {
  color: var(--color-muted);
}

.error-inner {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: var(--space-12);
}

.error-hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.error-tools {
  background: transparent;
}

.error-code {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  color: var(--color-muted);
}

.error-title {
  margin-top: var(--space-2);
}

.error-desc {
  color: var(--color-muted);
  margin-top: var(--space-3);
  margin-inline: auto;
}

.error-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.error-tools-inner {
  padding-block: var(--space-10);
}

.error-tools-label {
  margin-bottom: var(--space-5);
}

.error-tools-label p {
  color: var(--color-muted);
}


/* =====================================================================
   7. RESPONSIVE
   ===================================================================== */

/* ---- Tablet ------------------------------------------------------------------- */
@media (max-width: 980px) {

  .hero-inner.hero-board,
  .hero-board,
  .honesty-panel,
  .blog-layout,
  .blog-hero-inner,
  .section-header.split-header {
    grid-template-columns: 1fr;
  }

  .blog-hero-inner>* {
    max-width: var(--content-max);
  }

  .launcher-card {
    max-width: none;
    justify-self: stretch;
  }

  .blog-sidebar {
    position: static;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .result-guide,
  .form-options {
    grid-template-columns: 1fr;
  }
}

/* ---- Mobile ---------------------------------------------------------------------- */
@media (max-width: 720px) {

  .container,
  .hero-inner,
  .footer-inner,
  .nav-inner,
  .tips-inner,
  .blog-hero-inner,
  .blog-layout,
  .related-inner,
  .learn-card,
  .error-inner,
  .error-tools-inner,
  .hero-inner.hero-board,
  .hero-board,
  .tool-shell,
  .tool-hero-inner {
    width: min(var(--container-max), calc(100% - 2rem));
  }

  .nav-inner {
    min-height: 64px;
    display: flex;
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: var(--space-3) var(--space-2);
  }

  .nav-cta {
    display: none;
  }

  .hero {
    padding-block: var(--space-8);
  }

  .launcher-card {
    padding: var(--card-pad-tight);
  }

  .launcher-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-bar,
  .tool-search,
  .form-row,
  .tool-cta {
    grid-template-columns: 1fr;
  }

  .brief-form {
    padding: var(--card-pad-tight);
  }

  .brief-form .btn,
  .tool-search .btn,
  .search-bar .btn {
    width: 100%;
  }

  .tools-grid,
  .tips-grid,
  .blog-grid,
  .related-grid,
  .honesty-grid,
  .steps-list,
  .intent-grid,
  .brief-stats,
  .power-words-list,
  .serp-compare {
    grid-template-columns: 1fr;
  }

  .learn-card,
  .bmc-card-inner,
  .tool-next-card,
  .blog-next-box,
  .upgrade-banner,
  .tool-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-meta,
  .results-header,
  .brief-meta {
    display: block;
  }

  .results-actions,
  .brief-actions {
    margin-top: var(--space-3);
  }

  .results-actions .btn,
  .brief-actions .btn,
  .error-actions .btn,
  .blog-next-actions .btn,
  .tool-next-actions .btn {
    width: 100%;
  }

  th,
  td {
    padding: 0.65rem 0.75rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .blog-hero-meta {
    gap: var(--space-1) var(--space-3);
  }

  .blog-card h2,
  .blog-card h3,
  .related-card h4 {
    font-size: 1.35rem;
  }

  .tool-name,
  .tip-card h4,
  .honesty-card h3,
  .intent-card h3,
  .step h3 {
    font-size: 1.08rem;
  }

  .blog-card {
    min-height: 14rem;
  }

  .tool-card,
  .related-card,
  .honesty-card,
  .intent-card,
  .step,
  .result-guide-item {
    min-height: auto;
  }

  .table-wrap {
    margin-inline: calc(var(--gutter) * -1);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .table-wrap table {
    padding-inline: 0;
  }
}

/* ---- Small phones ------------------------------------------------------------------ */
@media (max-width: 430px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .btn,
  .error-box button,
  .copy-btn,
  .cluster-tab,
  .example-chip,
  .feed-tab,
  .blog-card-link,
  .launcher-tab {
    width: 100%;
  }

  .results-actions,
  .blog-next-actions,
  .tool-next-actions {
    width: 100%;
  }
}
/* =====================================================================
   8. RESULT PAGE CLEANUP
   =====================================================================
   Result areas use a tighter, more deliberate layout. The aim is simple:
   show the summary first, then the action controls, then the actual data.
   Cards in result areas should not become oversized just because they
   share a grid row or contain a few short lines.
   ===================================================================== */

.results-content,
.brief-content {
  width: min(var(--tool-max), 100%);
  margin-inline: auto;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  gap: var(--space-5);
}

.results-content[style*="block"],
.brief-content[style*="block"] {
  display: grid !important;
}

.results-header,
.results-meta,
.brief-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: start;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.results-header-left,
.results-meta-left,
.brief-meta-left {
  max-width: 56rem;
}

.results-actions,
.brief-actions {
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
}

.results-header h3,
.results-meta h3,
.brief-meta h3 {
  margin: 0;
  line-height: var(--leading-tight);
}

.results-header p,
.results-meta p,
.brief-meta p {
  margin-top: var(--space-1);
  color: var(--color-muted);
}

.result-guide,
.result-guide.result-guide--wide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  align-items: stretch;
  grid-auto-rows: auto;
}

.result-guide > *,
.result-guide-item {
  height: auto !important;
  min-height: 0;
}

.result-guide-item {
  display: block;
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-color: var(--color-border);
}

.result-guide-item strong {
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
}

.result-guide-item p {
  font-size: var(--text-sm);
  line-height: 1.55;
}

.cluster-tabs {
  margin: 0;
  gap: var(--space-2);
}

.cluster-tab {
  min-height: 42px;
}

.table-wrap {
  margin-top: 0;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.table-wrap .results-table {
  border: 0;
}

.table-wrap th,
.table-wrap td {
  padding-block: 0.85rem;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.output-block,
.brief-section {
  padding: clamp(1.1rem, 2vw, 1.5rem);
  gap: var(--space-3);
}

.output-block-header,
.brief-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.output-block-title,
.brief-section-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.output-block-note,
.output-block-subtitle {
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-body);
  letter-spacing: 0;
  text-transform: none;
}

#titles-list,
#metas-list,
.title-list,
.outline-list,
.faq-list,
.link-list {
  display: grid;
  gap: var(--space-3);
}

.title-card,
.meta-card {
  padding: var(--space-4);
  gap: var(--space-3);
  cursor: pointer;
}

.title-card-top,
.meta-card-top,
.meta-card-footer,
.title-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
}

.title-card-meta,
.meta-card-footer {
  align-items: center;
}

.title-text,
.meta-text {
  font-size: var(--text-base);
  line-height: 1.45;
}

.char-bar-wrap {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: var(--space-2);
}

.char-bar {
  min-width: 120px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.score-row-spaced {
  margin-top: 0;
}

.score-item {
  font-size: var(--text-sm);
  line-height: 1.4;
}

.power-words-list {
  --grid-card-min: 120px;
  gap: var(--space-2);
}

.power-word,
.kw-chip,
.angle-badge,
.intent-badge,
.type-badge,
.badge {
  border-radius: var(--radius-pill);
}

.serp-preview {
  padding: var(--space-4);
  background: var(--color-surface-2);
}

.serp-card {
  padding: 0;
  border: 0;
  background: transparent;
}

.brief-card {
  display: grid;
  gap: var(--space-4);
}

.brief-section-label {
  justify-content: flex-start;
}

.brief-angle-stack {
  gap: var(--space-3);
}

.angle-box,
.meta-box,
.title-item,
.outline-item,
.link-item,
.faq-item,
.stat-pill {
  padding: var(--space-4);
}

.brief-stats {
  --grid-card-min: 160px;
  gap: var(--space-3);
}

.stat-pill {
  min-height: 0;
}

.outline-item,
.title-item,
.link-item {
  align-items: center;
}

.results-content > .upgrade-banner,
.brief-content .upgrade-banner {
  display: none;
}

@media (max-width: 860px) {
  .results-header,
  .results-meta,
  .brief-meta,
  .title-card-top,
  .meta-card-top,
  .meta-card-footer,
  .title-card-meta {
    grid-template-columns: 1fr;
  }

  .results-actions,
  .brief-actions {
    justify-content: stretch;
  }

  .results-actions .btn,
  .brief-actions .btn {
    width: 100%;
  }

  .result-guide,
  .result-guide.result-guide--wide {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .char-bar-wrap {
    grid-template-columns: 1fr;
  }
}


/* =====================================================================
   Layout refinement pass
   Purpose: make the plain style feel placed, not scattered.
   ===================================================================== */
:root {
  --container-max: 1120px;
  --container-wide: 1240px;
  --hero-max: 1120px;
  --tool-max: 1040px;
  --tool-wide-max: 1080px;
  --content-max: 740px;
  --section-y: clamp(2.75rem, 5vw, 4.75rem);
  --section-y-tight: clamp(2rem, 4vw, 3.25rem);
  --card-pad: clamp(1.15rem, 2vw, 1.65rem);
  --card-pad-tight: clamp(0.95rem, 1.6vw, 1.25rem);
  --grid-gap: clamp(1rem, 1.8vw, 1.5rem);
  --grid-gap-tight: clamp(0.85rem, 1.5vw, 1.15rem);
}

/* Wider pages for tools and indexes, narrow measure only for articles. */
.container,
.hero-inner,
.footer-inner,
.nav-inner,
.tips-inner,
.related-inner,
.learn-card,
.error-inner,
.error-tools-inner {
  width: min(var(--container-max), calc(100% - var(--gutter) * 2));
}

.blog-hero-inner,
.blog-layout {
  width: min(var(--content-max), calc(100% - var(--gutter) * 2));
}

body:has(.blog-index-grid) .blog-hero-inner {
  width: min(var(--container-max), calc(100% - var(--gutter) * 2));
}

.section,
.tips-section,
.related-section,
.learn-section,
.section-alt,
.section-white {
  padding-block: var(--section-y);
}

.hero {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section-header {
  margin-bottom: var(--space-5);
}

.section-header.split-header {
  align-items: start;
}

.section-header.split-header .section-sub {
  max-width: 42ch;
  justify-self: end;
}

/* Homepage: stop four-card areas from creating lonely rows on desktop. */
@media (min-width: 1000px) {
  .section-tools .tools-grid,
  .steps-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .honesty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 700px) and (max-width: 999px) {
  .section-tools .tools-grid,
  .steps-list,
  .honesty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tools-grid,
.steps-list,
.honesty-grid,
.blog-grid,
.related-grid,
.tips-grid,
.intent-grid,
.brief-stats,
.result-guide {
  gap: var(--grid-gap);
}

.tool-card,
.blog-card,
.related-card,
.honesty-card,
.intent-card,
.step,
.tip-card,
.faq-item {
  min-height: 0;
}

.tool-card {
  min-height: 13.25rem;
  padding: var(--card-pad);
}

.blog-card {
  min-height: 14.25rem;
}

.step,
.honesty-card,
.intent-card,
.related-card,
.tip-card {
  min-height: 9.75rem;
}

.tool-card h3,
.blog-card h2,
.related-card h4,
.honesty-card h3,
.intent-card h3,
.step h3 {
  overflow-wrap: anywhere;
}

.tool-desc,
.blog-card p,
.related-card p,
.tip-card p,
.honesty-card p,
.intent-card p,
.step p {
  color: var(--color-muted);
  line-height: 1.55;
}

/* Homepage middle sections need to feel connected, not separated by deserts. */
.section-tools {
  padding-bottom: var(--section-y-tight);
}

.section-tools + .section,
.section-white + .section-alt,
.section-alt + .learn-section,
.learn-section + .section {
  padding-top: var(--section-y-tight);
}

.honesty-panel {
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.learn-section {
  padding-block: var(--section-y-tight);
}

.learn-card {
  padding-block: var(--space-5);
  min-height: 0;
}

.bmc-card-inner,
.tool-next-card,
.blog-next-box,
.upgrade-banner {
  min-height: 0;
  padding-block: var(--space-5);
}

footer {
  padding-block: var(--space-8) var(--space-5);
}

.footer-top {
  gap: var(--space-6);
}

.footer-bottom {
  margin-top: var(--space-6);
}

/* Blog index: wide enough to look intentional, but still readable. */
body:has(.blog-index-grid) .blog-hero {
  padding-block: clamp(3rem, 6vw, 5rem) var(--section-y-tight);
}

body:has(.blog-index-grid) .blog-hero-inner h1 {
  max-width: 14ch;
}

.blog-index-grid {
  max-width: var(--container-max);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

@media (min-width: 1050px) {
  .blog-index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tool pages: compact enough for results to appear sooner. */
.tool-hero {
  padding: var(--section-y-tight) 0 var(--space-5);
}

.tool-search,
.brief-form {
  margin-top: var(--space-4);
}

.tool-shell {
  width: min(var(--tool-wide-max), calc(100% - var(--gutter) * 2));
  margin: var(--space-3) auto var(--section-y-tight);
}

.tool-shell--compact {
  max-width: var(--tool-max);
}

.results-area {
  gap: var(--space-3);
}

.state-empty,
.state-loading,
.state-error,
.results-content,
.brief-content {
  padding: var(--card-pad);
}

.results-content,
.brief-content {
  gap: var(--space-4);
}

.results-header,
.brief-meta {
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.results-header-left h3,
.brief-meta-left h3 {
  margin-bottom: var(--space-1);
}

/* Result guide boxes: compact explanatory strip, not big feature cards. */
.result-guide,
.result-guide.result-guide--wide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  align-items: stretch;
  grid-auto-rows: auto;
}

.result-guide > *,
.result-guide-item {
  height: auto !important;
  min-height: 0 !important;
}

.result-guide-item {
  display: block;
  padding: var(--space-4);
  background: var(--color-surface-2);
}

.result-guide-item strong {
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

.result-guide-item p {
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Results tables: stable and readable without wasting page width. */
.table-wrap {
  margin-top: 0;
}

.table-wrap th,
.table-wrap td {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.results-table .copy-btn {
  min-width: 72px;
}

/* Title and meta results: convert the large cards into tighter working rows. */
.output-block,
.brief-section {
  padding: var(--card-pad-tight);
  gap: var(--space-3);
}

.output-block-header,
.brief-section-label {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.title-card,
.meta-card {
  padding: var(--space-4);
  gap: var(--space-3);
}

.title-card-top,
.meta-card-top,
.meta-card-footer,
.title-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
}

.title-text,
.meta-text {
  font-size: var(--text-base);
  line-height: 1.45;
}

.title-card-meta,
.meta-card-footer {
  align-items: center;
}

.char-bar-wrap {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: var(--space-2);
  align-items: center;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.score-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-sm);
}

.score-dot {
  flex: 0 0 auto;
}

/* Content brief: make dense output easier to scan. */
.brief-card {
  gap: var(--space-3);
}

.brief-section {
  min-height: 0;
}

.brief-stats {
  --grid-card-min: 150px;
  gap: var(--space-3);
}

.angle-box,
.meta-box,
.title-item,
.outline-item,
.link-item,
.faq-item,
.stat-pill {
  padding: var(--space-4);
}

.outline-item,
.title-item,
.link-item,
.faq-item {
  min-height: 0;
}

/* Keep smaller informational card groups from feeling like oversized blocks. */
.tips-section,
.tool-seo-section,
.tool-next-section,
.tool-support-section,
.related-section {
  padding-block: var(--section-y-tight);
}

.faq-list,
.title-list,
.outline-list,
.link-list,
#titles-list,
#metas-list {
  gap: var(--space-3);
}

/* Mobile keeps the same rhythm without squeezing controls. */
@media (max-width: 860px) {
  .section-header.split-header,
  .hero-inner.hero-board,
  .hero-board,
  .honesty-panel,
  .prose-grid {
    grid-template-columns: 1fr;
  }

  .section-header.split-header .section-sub {
    justify-self: start;
  }

  .launcher-card {
    justify-self: stretch;
    max-width: none;
  }

  .result-guide,
  .result-guide.result-guide--wide {
    grid-template-columns: 1fr;
  }

  .title-card-top,
  .meta-card-top,
  .meta-card-footer,
  .title-card-meta,
  .char-bar-wrap {
    grid-template-columns: 1fr;
  }

  .copy-btn,
  .results-actions .btn,
  .brief-actions .btn {
    width: 100%;
  }

  .learn-card,
  .bmc-card-inner,
  .tool-next-card,
  .blog-next-box {
    align-items: stretch;
  }
}

/* =====================================================================
   BLOG LAYOUT REPAIR
   Purpose: blogs use the same ClearKeywords system, but with a proper
   article format. No tiny article strip, no awkward right-column layout,
   no oversized hero gaps, no 3-plus-1 article card grids.
   ===================================================================== */
:root {
  --blog-page-max: 1060px;
  --blog-read-max: 820px;
  --blog-index-max: 1120px;
}

/* Blog article pages */
.blog-hero {
  padding-block: clamp(2.5rem, 5vw, 4.25rem) clamp(1rem, 2vw, 1.75rem);
}

.blog-hero-inner {
  width: min(var(--blog-read-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  display: block;
}

.blog-hero-inner > * {
  max-width: 100%;
}

.blog-hero h1 {
  max-width: 100%;
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin-bottom: var(--space-5);
}

.blog-hero-inner > p:not(.section-label):not(.blog-hero-meta) {
  max-width: 70ch;
  color: var(--color-muted);
  font-size: var(--text-md);
}

.blog-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* A blog is primarily an article. Extra cards/tools should support it,
   not steal the layout or squeeze the article. */
.blog-layout {
  width: min(var(--blog-read-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  display: block;
  padding-block: clamp(2rem, 4vw, 3.25rem);
}

.blog-body {
  max-width: var(--blog-read-max);
  width: 100%;
  min-width: 0;
  font-size: var(--text-base);
}

.blog-body > * + * {
  margin-top: var(--space-4);
}

.blog-body p,
.blog-body li {
  max-width: 74ch;
  line-height: 1.72;
}

.blog-body h2 {
  max-width: 100%;
  margin-top: clamp(2.75rem, 5vw, 4rem);
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.blog-body h3 {
  max-width: 100%;
  margin-top: var(--space-7, 2.5rem);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.blog-divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: clamp(2.5rem, 5vw, 3.75rem) 0;
}

/* Sidebar becomes a supporting panel below the article, laid out as a
   compact card grid. This avoids the cramped newspaper-column look. */
.blog-sidebar {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap-tight);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.blog-sidebar .sidebar-card {
  height: auto;
  min-height: 0;
  padding: var(--card-pad-tight);
}

.blog-sidebar .sidebar-card h4 {
  margin-bottom: var(--space-3);
}

.blog-sidebar .toc-list {
  max-height: none;
}

.sidebar-tool-link {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
}

.sidebar-tool-link:first-of-type {
  border-top: 0;
}

.sidebar-tool-link:hover {
  border-color: var(--color-border);
  box-shadow: none;
  transform: none;
}

/* Article card groups should use deliberate grids. Four item explainers
   should be a calm 2x2, not 3 cards plus one orphan. */
.blog-body .intent-grid,
.blog-body .tips-grid,
.blog-body .power-words-list,
.blog-body .brief-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap-tight);
  max-width: 100%;
}

.blog-body .intent-card,
.blog-body .tip-card,
.blog-body .stat-pill,
.blog-body .callout,
.blog-body .tool-cta,
.blog-body .blog-next-box,
.blog-body .serp-preview,
.blog-body .output-block,
.blog-body .brief-section {
  max-width: 100%;
}

.blog-body .intent-card,
.blog-body .tip-card,
.blog-body .stat-pill {
  min-height: 0;
  height: 100%;
  padding: var(--card-pad-tight);
}

.blog-body .callout,
.blog-body .tool-cta,
.blog-body .blog-next-box {
  margin-block: var(--space-6);
}

.tool-cta,
.blog-next-box {
  min-height: 0;
}

/* Blog related articles use the same card system, aligned to the article
   page width instead of stretching across a random canvas. */
.related-section {
  padding-block: var(--section-y-tight);
}

.related-inner {
  width: min(var(--blog-page-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.related-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* Blog index page */
body:has(.blog-index-grid) .blog-hero {
  padding-block: clamp(2.75rem, 5vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

body:has(.blog-index-grid) .blog-hero-inner {
  width: min(var(--blog-index-max), calc(100% - var(--gutter) * 2));
  display: block;
}

body:has(.blog-index-grid) .blog-hero-inner h1 {
  max-width: 15ch;
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 1.02;
}

body:has(.blog-index-grid) .blog-hero-inner > p {
  max-width: 62ch;
}

body:has(.blog-index-grid) .section.section-alt {
  padding-top: var(--section-y-tight);
}

body:has(.blog-index-grid) .section .container {
  width: min(var(--blog-index-max), calc(100% - var(--gutter) * 2));
}

body:has(.blog-index-grid) .section-header {
  max-width: 760px;
  margin-bottom: var(--space-5);
}

.blog-index-grid {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

@media (min-width: 1040px) {
  .blog-index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 720px) and (max-width: 1039px) {
  .blog-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.blog-card {
  min-height: 15rem;
  padding: var(--card-pad);
}

.blog-card h2,
.blog-card h3 {
  max-width: 100%;
  line-height: 1.16;
}

.blog-card p {
  max-width: 100%;
}

/* Responsive */
@media (max-width: 900px) {
  .blog-sidebar {
    grid-template-columns: 1fr;
  }

  .blog-body .intent-grid,
  .blog-body .tips-grid,
  .blog-body .power-words-list,
  .blog-body .brief-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .blog-hero-inner,
  .blog-layout,
  body:has(.blog-index-grid) .blog-hero-inner,
  body:has(.blog-index-grid) .section .container,
  .related-inner {
    width: min(100%, calc(100% - 2rem));
  }

  .blog-hero h1,
  body:has(.blog-index-grid) .blog-hero-inner h1 {
    max-width: 100%;
    font-size: clamp(2.2rem, 12vw, 3.25rem);
  }

  .blog-body h2 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }
}

/* =====================================================================
   MOBILE RESPONSIVE REPAIR
   Purpose: make every page feel intentionally designed on phones.
   This pass keeps the flat ClearKeywords style, but fixes spacing,
   overflow, cramped controls, result layouts, blog readability and footer.
   ===================================================================== */

/* Tablet first: two-column where useful, no orphaned cards. */
@media (min-width: 721px) and (max-width: 980px) {
  .section-tools .tools-grid,
  .steps-list,
  .honesty-grid,
  .blog-index-grid,
  .related-grid,
  .tips-grid,
  .intent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone layout */
@media (max-width: 720px) {
  :root {
    --gutter: 1rem;
    --section-y: 2.75rem;
    --section-y-tight: 2rem;
    --card-pad: 1.15rem;
    --card-pad-tight: 1rem;
    --grid-gap: 1rem;
    --grid-gap-tight: 0.8rem;
    --button-height: 44px;
    --control-height: 44px;
    --control-height-sm: 42px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  body {
    font-size: 15.5px;
  }

  .container,
  .hero-inner,
  .footer-inner,
  .nav-inner,
  .tips-inner,
  .blog-hero-inner,
  .blog-layout,
  .related-inner,
  .learn-card,
  .error-inner,
  .error-tools-inner,
  .tool-shell,
  .tool-hero-inner,
  .hero-inner.hero-board,
  .hero-board,
  body:has(.blog-index-grid) .section .container,
  body:has(.blog-index-grid) .blog-hero-inner {
    width: min(100%, calc(100% - 2rem));
    max-width: none;
  }

  /* Nav */
  .nav-inner {
    min-height: 60px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.65rem;
  }

  .logo {
    min-width: 0;
    gap: 0.45rem;
  }

  .logo-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
  }

  .logo-word {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-cta {
    min-height: 38px;
    padding-inline: 0.8rem;
    font-size: 0.82rem;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .nav-links {
    left: 1rem;
    right: 1rem;
    top: 68px;
    gap: 0;
    padding: 0.4rem;
  }

  .nav-links a {
    display: block;
    padding: 0.85rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .nav-links a:hover {
    background: var(--color-surface-2);
    text-decoration: none;
  }

  /* Type and global page rhythm */
  h1,
  .blog-hero h1,
  body:has(.blog-index-grid) .blog-hero-inner h1 {
    font-size: clamp(2.15rem, 12vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
    max-width: 100%;
  }

  h2,
  .section-title,
  .blog-body h2 {
    font-size: clamp(1.65rem, 8vw, 2.25rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
  }

  h3,
  .blog-body h3 {
    font-size: clamp(1.25rem, 6vw, 1.55rem);
    line-height: 1.2;
  }

  p {
    max-width: 100%;
  }

  .hero,
  .blog-hero {
    padding-block: 2.25rem 1.75rem;
  }

  .section,
  .tips-section,
  .related-section,
  .learn-section,
  .section-alt,
  .section-white,
  .tool-seo-section,
  .tool-next-section,
  .tool-support-section {
    padding-block: var(--section-y);
  }

  .section-header,
  .section-header.compact-header,
  .section-header.split-header {
    display: block;
    max-width: 100%;
    margin-bottom: 1.25rem;
  }

  .section-label {
    margin-bottom: 0.65rem;
  }

  /* Homepage */
  .hero-inner.hero-board,
  .hero-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
  }

  .hero-lede {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .hero-kicker {
    gap: 0.5rem;
  }

  .launcher-card {
    padding: var(--card-pad);
    max-width: none;
    width: 100%;
  }

  .launcher-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .launcher-tab {
    min-height: 42px;
    font-size: 0.86rem;
  }

  .search-bar,
  .tool-search,
  .form-row,
  .brief-form .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .search-bar .btn,
  .tool-search .btn,
  .brief-form .btn {
    width: 100%;
  }

  .tools-grid,
  .steps-list,
  .honesty-grid,
  .tips-grid,
  .intent-grid,
  .blog-grid,
  .blog-index-grid,
  .related-grid,
  .brief-stats,
  .power-words-list,
  .form-options,
  .error-tools-grid {
    grid-template-columns: 1fr !important;
    gap: var(--grid-gap);
  }

  .tool-card,
  .blog-card,
  .related-card,
  .honesty-card,
  .intent-card,
  .step,
  .tip-card,
  .faq-item {
    min-height: 0;
    padding: var(--card-pad);
  }

  .section-tools + .section,
  .section-white + .section-alt,
  .section-alt + .learn-section,
  .learn-section + .section {
    padding-top: var(--section-y-tight);
  }

  .honesty-panel {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .learn-card,
  .bmc-card-inner,
  .tool-next-card,
  .blog-next-box,
  .upgrade-banner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: var(--card-pad);
    align-items: stretch;
  }

  .learn-card .btn,
  .bmc-card-inner .btn,
  .tool-next-card .btn,
  .blog-next-box .btn,
  .upgrade-banner .btn {
    width: 100%;
  }

  /* Tool pages */
  .tool-hero {
    padding: 2rem 0 1rem;
  }

  .tool-hero p {
    font-size: 1rem;
  }

  .tool-search,
  .brief-form {
    margin-top: 1rem;
  }

  .brief-form {
    padding: var(--card-pad);
  }

  .tool-note,
  .usage-note {
    max-width: 100%;
  }

  .tool-shell {
    margin: 1rem auto var(--section-y);
  }

  .results-content,
  .brief-content,
  .state-empty,
  .state-loading,
  .state-error {
    padding: var(--card-pad);
  }

  .results-header,
  .brief-meta,
  .output-block-header,
  .brief-section-label {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .results-actions,
  .brief-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .results-actions .btn,
  .brief-actions .btn {
    width: 100%;
  }

  .result-guide,
  .result-guide.result-guide--wide {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .result-guide-item {
    padding: 0.95rem;
  }

  .cluster-tabs,
  .feed-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    margin-inline: -1rem;
    padding-inline: 1rem;
    scrollbar-width: none;
  }

  .cluster-tabs::-webkit-scrollbar,
  .feed-tabs::-webkit-scrollbar {
    display: none;
  }

  .cluster-tab,
  .feed-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: -1rem;
    padding-inline: 1rem;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .keyword-results-table {
    min-width: 640px;
  }

  .related-results-table {
    min-width: 860px;
  }

  .results-table th,
  .results-table td {
    padding: 0.8rem 0.75rem;
  }

  .results-table .col-index {
    width: 44px;
  }

  .results-table .col-action {
    width: 92px;
  }

  .results-table .copy-btn {
    min-width: 68px;
    min-height: 38px;
  }

  /* Title and meta generator */
  .output-block,
  .brief-section {
    padding: var(--card-pad);
  }

  .title-card,
  .meta-card,
  .angle-box,
  .meta-box,
  .title-item,
  .outline-item,
  .link-item,
  .faq-item,
  .stat-pill {
    padding: 1rem;
  }

  .title-card-top,
  .meta-card-top,
  .meta-card-footer,
  .title-card-meta,
  .char-bar-wrap {
    grid-template-columns: 1fr;
  }

  .title-card .copy-btn,
  .meta-card .copy-btn,
  .title-item .copy-btn,
  .meta-box .copy-btn {
    width: 100%;
  }

  .score-row {
    display: grid;
    gap: 0.5rem;
  }

  .serp-preview {
    padding: 1rem;
  }

  /* Content brief */
  .brief-card {
    gap: 1rem;
  }

  .brief-stats {
    grid-template-columns: 1fr !important;
  }

  .outline-item,
  .link-item,
  .faq-item {
    display: block;
  }

  /* Blog index and article pages */
  body:has(.blog-index-grid) .blog-hero,
  .blog-hero {
    padding-block: 2.25rem 1.25rem;
  }

  body:has(.blog-index-grid) .blog-hero-inner h1,
  .blog-hero h1 {
    max-width: 100%;
  }

  .blog-layout {
    padding-block: 1.75rem 2.75rem;
  }

  .blog-body {
    font-size: 1rem;
  }

  .blog-body p,
  .blog-body li {
    line-height: 1.7;
  }

  .blog-body > * + * {
    margin-top: 1rem;
  }

  .blog-body h2 {
    margin-top: 2.5rem;
  }

  .blog-body h3 {
    margin-top: 1.75rem;
  }

  .blog-divider {
    margin: 2rem 0;
  }

  .blog-body .intent-grid,
  .blog-body .tips-grid,
  .blog-body .power-words-list,
  .blog-body .brief-stats {
    grid-template-columns: 1fr !important;
  }

  .blog-sidebar {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }

  .sidebar-card {
    padding: var(--card-pad);
  }

  .tool-cta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: var(--card-pad);
  }

  .tool-cta .btn,
  .blog-next-actions .btn,
  .tool-next-actions .btn {
    width: 100%;
  }

  /* Footer */
  footer {
    padding-block: 2.5rem 1.75rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-brand p {
    max-width: 100%;
  }

  .footer-col {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
  }

  .footer-bottom {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }
}

@media (max-width: 420px) {
  .nav-cta {
    display: none;
  }

  .nav-inner {
    grid-template-columns: 1fr auto;
  }

  .launcher-tabs {
    grid-template-columns: 1fr;
  }

  .btn,
  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* =====================================================================
   MOBILE RESULT CARD REPAIR
   Purpose: the main keyword tools should not rely on sideways scrolling
   on phones. The desktop table becomes stacked result cards under 720px.
   ===================================================================== */
@media (max-width: 720px) {
  .table-wrap {
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    border: 0;
    background: transparent;
  }

  .keyword-results-table,
  .related-results-table {
    min-width: 0;
    width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .keyword-results-table colgroup,
  .related-results-table colgroup,
  .keyword-results-table thead,
  .related-results-table thead {
    display: none;
  }

  .keyword-results-table,
  .keyword-results-table tbody,
  .keyword-results-table tr,
  .keyword-results-table td,
  .related-results-table,
  .related-results-table tbody,
  .related-results-table tr,
  .related-results-table td {
    display: block;
    width: 100%;
  }

  .keyword-results-table tbody,
  .related-results-table tbody {
    display: grid;
    gap: 0.85rem;
  }

  .keyword-results-table tr,
  .related-results-table tr {
    position: relative;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
  }

  .keyword-results-table td,
  .related-results-table td {
    padding: 0;
    border: 0;
    text-align: left !important;
  }

  /* The index becomes a small quiet count badge, not a full row. */
  .keyword-results-table td[data-label="#"],
  .related-results-table td[data-label="#"] {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: auto;
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
  }

  .keyword-results-table td[data-label="#"]::before,
  .related-results-table td[data-label="#"]::before {
    content: "#";
  }

  /* Main keyword text gets priority. */
  .keyword-results-table td[data-label="Keyword"],
  .related-results-table td[data-label="Keyword"] {
    padding-right: 2.5rem;
    margin-bottom: 0.85rem;
  }

  .keyword-results-table .kw-text,
  .related-results-table .kw-text {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  /* Metadata sits underneath as small chips. */
  .keyword-results-table td[data-label="Type"],
  .related-results-table td[data-label="Type"],
  .related-results-table td[data-label="Relevance"],
  .related-results-table td[data-label="Source"],
  .related-results-table td[data-label="Word Count"] {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    margin: 0 0.45rem 0.45rem 0;
    vertical-align: top;
  }

  .related-results-table td[data-label="Source"]::before,
  .related-results-table td[data-label="Word Count"]::before {
    content: attr(data-label) ": ";
    margin-right: 0.25rem;
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
  }

  .related-results-table td[data-label="Source"],
  .related-results-table td[data-label="Word Count"] {
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-2);
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.2;
  }

  .keyword-results-table .type-badge,
  .related-results-table .type-badge,
  .related-results-table .badge {
    white-space: normal;
    line-height: 1.2;
  }

  /* Copy is a normal phone action, full width at the bottom. */
  .keyword-results-table td[data-label="Action"],
  .related-results-table td[data-label="Action"] {
    margin-top: 0.5rem;
  }

  .keyword-results-table .copy-btn,
  .related-results-table .copy-btn {
    width: 100%;
    min-height: 42px;
  }
}

/* =====================================================================
   MOBILE RESULTS COMPACTNESS REPAIR
   Purpose: mobile results should be compact readable cards, not oversized
   panels, and filters should wrap visibly instead of hiding off-screen.
   ===================================================================== */
@media (max-width: 720px) {
  /* Filter tabs should be visible without side-scrolling. */
  .cluster-tabs,
  .feed-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0 0 0.85rem;
    padding: 0;
    overflow: visible;
  }

  .cluster-tab,
  .feed-tab {
    width: 100%;
    min-height: 38px;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    white-space: normal;
    justify-content: center;
    text-align: center;
  }

  .tab-count {
    margin-left: 0.2rem;
    padding: 0.05rem 0.3rem;
    font-size: 0.68rem;
  }

  /* Active filters should not turn into heavy black blocks. */
  .cluster-tab.active,
  .feed-tab.active,
  .cluster-tab.active:hover,
  .feed-tab.active:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
    color: var(--color-ink);
  }

  .cluster-tab.active .tab-count,
  .feed-tab.active .tab-count {
    background: var(--color-surface);
    color: var(--color-ink);
  }

  /* Compact mobile result cards. */
  .keyword-results-table tbody,
  .related-results-table tbody {
    gap: 0.65rem;
  }

  .keyword-results-table tr,
  .related-results-table tr {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius);
  }

  .keyword-results-table td[data-label="#"],
  .related-results-table td[data-label="#"] {
    top: 0.75rem;
    right: 0.85rem;
    font-size: 0.72rem;
  }

  .keyword-results-table td[data-label="Keyword"],
  .related-results-table td[data-label="Keyword"] {
    padding-right: 2rem;
    margin-bottom: 0.5rem;
  }

  .keyword-results-table .kw-text,
  .related-results-table .kw-text {
    font-size: 0.98rem;
    line-height: 1.3;
  }

  .keyword-results-table td[data-label="Type"],
  .related-results-table td[data-label="Type"],
  .related-results-table td[data-label="Relevance"],
  .related-results-table td[data-label="Source"],
  .related-results-table td[data-label="Word Count"] {
    margin: 0 0.35rem 0.35rem 0;
  }

  .type-badge,
  .badge,
  .related-results-table td[data-label="Source"],
  .related-results-table td[data-label="Word Count"] {
    min-height: 26px;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
  }

  .keyword-results-table td[data-label="Action"],
  .related-results-table td[data-label="Action"] {
    margin-top: 0.25rem;
  }

  .keyword-results-table .copy-btn,
  .related-results-table .copy-btn {
    min-height: 36px;
    padding: 0.45rem 0.75rem;
  }

  /* No black category/relevance badges inside results. */
  .type-badge.type-modifier,
  .type-badge.type-idea,
  .badge.rel-high {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
    color: var(--color-ink);
  }
}

@media (max-width: 380px) {
  .cluster-tabs,
  .feed-tabs {
    grid-template-columns: 1fr;
  }
}
