.seo-page { overflow-x: hidden; }
.seo-page * { box-sizing: border-box; }

.seo-page .guide-hero h1,
.seo-page .tool-hero h1,
.seo-page .vs-hero h1,
.seo-page .glossary-term-hero h1 {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.seo-page .guide-hero p,
.seo-page .tool-hero p,
.seo-page .vs-hero p { max-width: 760px; }

.seo-page .hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 0 16px;
}

.seo-page .hero-badge {
  white-space: normal;
  text-align: center;
}

.seo-page .guide-layout { max-width: 1120px; }

.seo-author {
  margin: 0 auto;
  padding: 16px 24px 0;
}

.seo-author--760 { max-width: 760px; }
.seo-author--800 { max-width: 800px; }
.seo-author--820 { max-width: 820px; }

.seo-author__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #e8e8f0;
}

.seo-author__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.seo-author__text { min-width: 0; }
.seo-author__name { font-weight: 600; font-size: .95rem; }
.seo-author__meta { font-size: .82rem; color: #555; overflow-wrap: break-word; }

.seo-dashboard-cta .section-label { color: rgba(255,255,255,.6); }
.seo-dashboard-cta__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.seo-dashboard-cta-shot {
  margin-top: 48px;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}
.seo-dashboard-cta__image {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}

.answer-grid,
.layout-grid,
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
  margin: 28px 0;
}

.answer-card,
.layout-card,
.strategy-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px;
}

.strategy-card { padding: 20px; }
.strategy-card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 10px; }
.strategy-card p { margin-bottom: 0; }
.answer-card strong,
.layout-card strong { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.answer-card strong { font-size: 1.1rem; }
.answer-card span,
.layout-card span { display: block; color: var(--color-text-light); font-size: .9rem; line-height: 1.55; }

.chooser,
.traffic-tool {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  margin: 28px 0;
}

.margin-tool {
  background: #f8f9fb;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  margin: 28px 0;
}

.chooser-grid,
.margin-tool-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.traffic-tool-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 14px;
}

.chooser label,
.margin-tool label,
.traffic-tool label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.chooser select,
.chooser input,
.margin-tool select,
.margin-tool input,
.traffic-tool input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}

.seo-heading-flush { margin-top: 0; }
.seo-muted-copy { color: var(--color-text-light); line-height: 1.7; }
.seo-small-muted { font-size: .9rem; color: var(--color-text-light); line-height: 1.7; margin-top: 18px; }

.result-box,
.traffic-result,
.decision-result {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 18px;
  color: #166534;
}

.result-box strong { font-size: 1.2rem; color: #15803d; }
.margin-result {
  margin-top: 18px;
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--color-border);
}

.size-table,
.spec-table,
.isbn-table,
.kdp-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.kdp-table { margin-top: 24px; }
.isbn-table { margin: 22px 0; }

.size-table th,
.size-table td,
.spec-table th,
.spec-table td,
.isbn-table th,
.isbn-table td,
.kdp-table th,
.kdp-table td,
.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 12px;
  text-align: left;
}

.size-table th,
.spec-table th,
.kdp-table th,
.compare-table th {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
}

.size-table td,
.spec-table td { font-size: .92rem; }
.kdp-table .best { background: #f0fdf4; font-weight: 700; }

.callout {
  background: #eff6ff;
  border-left: 4px solid var(--color-accent);
  border-radius: 0 12px 12px 0;
  padding: 18px 20px;
  margin: 24px 0;
  color: #1e3a8a;
}

.diagram {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  margin: 28px 0;
  text-align: center;
}

.page-demo {
  width: 210px;
  height: 300px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid #1a1a2e;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.page-demo:before {
  content: "";
  position: absolute;
  inset: 20px 24px 20px 48px;
  border: 2px dashed #434de7;
}

.page-demo:after {
  content: "Gutter";
  position: absolute;
  left: 8px;
  top: 130px;
  font-size: .72rem;
  color: #434de7;
  writing-mode: vertical-rl;
}

.bleed-band {
  position: absolute;
  inset: -10px;
  border: 2px dashed #dc2626;
  border-radius: 2px;
  pointer-events: none;
}

.bleed-full-cta {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.bleed-cta-shot {
  margin-top: 48px;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.glossary-term-hero,
.vs-hero {
  padding: 64px 0 52px;
  background: #f8f9fb;
  text-align: center;
}

.glossary-term-hero { padding: 70px 0 48px; }
.tool-hero { padding: 52px 0 36px; text-align: center; }

.glossary-term-hero h1,
.vs-hero h1,
.tool-hero h1 {
  font-size: clamp(2rem,5vw,3rem);
  font-weight: 600;
  letter-spacing: -.03em;
  margin-bottom: 14px;
}

.tool-hero h1 { font-size: clamp(1.9rem,4.5vw,2.7rem); margin-bottom: 12px; }
.glossary-term-hero p,
.vs-hero p,
.tool-hero p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--color-text-light);
  font-size: 1.12rem;
  line-height: 1.7;
}

.tool-hero p { font-size: 1.05rem; line-height: 1.65; }

.term-content,
.content-section {
  max-width: 760px;
  margin: 48px auto;
  padding: 0 24px;
}

.content-section { padding: 48px 24px; }
.content {
  max-width: 820px;
  margin: 48px auto;
  padding: 0 24px;
}

.term-content h2,
.content h2 {
  font-size: 1.5em;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 40px 0 16px;
}

.term-content h2 { font-size: 1.45rem; margin: 36px 0 14px; }
.content > :first-child { margin-top: 0; }
.content .tldr-box h2,
.content .traffic-tool h2 { margin-top: 0; }
.term-content p,
.term-content li,
.content-section p,
.content-section li,
.content p,
.content li {
  line-height: 1.75;
  color: var(--color-text-light);
}

.content-section p,
.content-section li { font-size: .95rem; }
.content p { margin: 0 0 16px; }
.content ul,
.content ol { list-style: disc; margin: 0 0 16px; padding-left: 24px; }
.content li { margin-bottom: 8px; }

.decision {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 22px;
  margin: 26px 0;
}

.decision button {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  margin: 4px;
  cursor: pointer;
  font: inherit;
}

.decision button.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.winner-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 16px;
  margin: 22px 0;
}

.winner {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.winner--green { background: #f0fdf4; border-color: #86efac; }
.winner__label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.winner__value { font-size: 1.8rem; font-weight: 700; }
.winner--green .winner__value { color: #15803d; }
.winner__sub { font-size: .85rem; color: var(--color-text-muted); margin-top: 5px; }
.winner--green .winner__sub { color: #166534; }
.kdp-cost-page .guide-section { padding-top: 0; }
.kdp-cost-page .container--narrow { max-width: 820px; }
.kdp-cost-page .bs-calc { max-width: 100%; }

@media(max-width:760px) {
  .seo-page .guide-hero,
  .seo-page .tool-hero,
  .seo-page .vs-hero,
  .seo-page .glossary-term-hero { padding: 44px 0 38px; }
  .seo-page .guide-hero h1,
  .seo-page .tool-hero h1,
  .seo-page .vs-hero h1,
  .seo-page .glossary-term-hero h1 {
    font-size: 1.85rem;
    line-height: 1.18;
    padding: 0 20px;
  }
  .seo-page .guide-hero p,
  .seo-page .tool-hero p,
  .seo-page .vs-hero p,
  .seo-page .glossary-term-hero p {
    font-size: 1rem;
    line-height: 1.65;
    padding: 0 24px;
  }
  .seo-page .seo-author__row { align-items: flex-start; }
  .seo-page .seo-dashboard-cta-shot,
  .bleed-cta-shot { margin-top: 32px; }
  .answer-grid,
  .layout-grid,
  .chooser-grid,
  .margin-tool-grid,
  .traffic-tool-grid,
  .strategy-grid,
  .winner-grid { grid-template-columns: 1fr; }
  .size-table,
  .spec-table,
  .isbn-table,
  .kdp-table,
  .compare-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .diagram { padding: 20px 14px; overflow: hidden; }
  .diagram h2 { font-size: 1.2rem; line-height: 1.3; }
  .page-demo { width: 160px; height: 230px; }
  .page-demo:before { inset: 18px 20px 18px 38px; }
  .page-demo:after { left: 6px; top: 96px; }
  .bleed-band { inset: -6px; }
}
