/* =============================================
   DOTCOM DESIGN — SEO STRATEGY REPORT
   v4 — CSS Subgrid alignment for all card grids
   Brand: #3F80EA (Blue), #334168 (Dark), #EB0052 (Red)
   Rules: no em-dashes in content, full client name always,
          keyword quality gate enforced in app.js
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; color: #35373C; background: #fff; line-height: 1.7; }

/* ---- HEADER ---- */
.site-header {
  background: #334168;
  padding: 16px 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { height: 38px; }
.header-tagline {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #3F80EA;
  text-transform: uppercase;
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, #334168 0%, #1a2540 100%);
  padding: 80px 40px;
  text-align: center;
  color: #fff;
  overflow-x: hidden;
}
.hero-inner { max-width: 800px; margin: 0 auto; }
.hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #3F80EA;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.75);
  margin-bottom: 32px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.meta-badge {
  background: rgba(63,128,234,0.2);
  border: 1px solid rgba(63,128,234,0.4);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* ---- NAV: center-aligned, scrollable on mobile ---- */
.section-nav {
  background: #fff;
  border-bottom: 2px solid #E6E6E6;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 70px;
  z-index: 99;
  padding: 0 16px;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  padding: 16px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: #35373C;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.section-nav a:hover, .section-nav a.active {
  color: #3F80EA;
  border-bottom-color: #3F80EA;
}

/* ---- SECTIONS: full-bleed backgrounds, inner content constrained ---- */
.strategy-section { padding: 72px 0; overflow-x: clip; }
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.alt-bg { background: #f7f8fc; }
.section-header {
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.section-number {
  font-size: 3rem;
  font-weight: 900;
  color: #E6E6E6;
  line-height: 1;
  min-width: 60px;
}
.section-header h2 {
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #334168;
}
.prose { font-size: 1rem; color: #35373C; margin-bottom: 24px; line-height: 1.8; }
.prose-sm { font-size: 0.88rem; color: #666; margin-bottom: 16px; font-style: italic; }
.subsection-title {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #334168;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #E6E6E6;
}

/* ---- STAT GRID ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.stat-card {
  background: #334168;
  color: #fff;
  padding: 28px 20px;
  border-radius: 12px;
  text-align: center;
}
.stat-number { font-size: 2.5rem; font-weight: 900; color: #3F80EA; line-height: 1; }
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.7); margin-top: 8px; }

/* ---- DATA TABLES ---- */
.table-wrapper { overflow-x: auto; margin-bottom: 32px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table th {
  background: #334168;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.data-table th.num-col { text-align: right; }
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.data-table td.num-col { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr:hover td { background: rgba(63,128,234,0.04); }
.row-selected td { background: rgba(63,128,234,0.06); }
.row-tier3 td { color: #999; font-size: 0.8rem; }
.check { color: #22c55e; font-weight: 900; text-align: center; }
.dash { color: #ccc; text-align: center; }

/* RULE: rationale column — write text short enough to fit 2 lines; never truncate */
.rationale-cell {
  line-height: 1.5;
  font-size: 0.82rem;
  /* Row height is controlled by the fixed city-row height on the tier cards;
     for the table, we rely on short copy (max 2 lines written at source) */
}

/* ---- TIER PILLS: nowrap so they never wrap to two lines ---- */
.tier-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  display: inline-block;
}
.tier-pill.t1 { background: rgba(63,128,234,0.15); color: #3F80EA; }
.tier-pill.t2 { background: rgba(51,65,104,0.15); color: #334168; }
.tier-pill.t3 { background: rgba(235,0,82,0.12); color: #EB0052; }
.tier-pill.t4 { background: rgba(249,115,22,0.12); color: #f97316; }
.nowrap { white-space: nowrap; }

/* ============================================================
   MARKET TIER CARDS — CSS Subgrid alignment
   The outer grid defines row tracks; each card uses subgrid
   so label, title, desc, and city rows all align across cards.
   ============================================================ */
.tier-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Named row tracks shared by all three cards via subgrid:
     [card-label] auto  [card-title] auto  [card-desc] auto  [city-list] 1fr */
  grid-template-rows: auto auto auto 1fr;
  column-gap: 24px;
  row-gap: 0;
  margin-bottom: 16px;
  align-items: stretch;
}
.tier-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  border-top: 4px solid #E6E6E6;
  /* Use subgrid so internal elements share the outer row tracks */
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
}
.tier-card-1 { border-top-color: #3F80EA; }
.tier-card-2 { border-top-color: #334168; }
.tier-card-3 { border-top-color: #E6E6E6; }
.tier-card-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  align-self: start;
}
.tier-card-1 .tier-card-label { color: #3F80EA; }
.tier-card-2 .tier-card-label { color: #334168; }
.tier-card-3 .tier-card-label { color: #999; }
.tier-card-title {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #334168;
  margin-bottom: 8px;
  align-self: start;
}
.tier-card-desc {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 10px;
  align-self: start;
  /* Fixed height so city rows always start at the same vertical position across all cards.
     Height is set to 6.5em to accommodate up to 4 lines of text at 0.85rem/1.5 line-height.
     All descriptions MUST be written to fit within 4 lines. Never truncate visible text. */
  /* Height equalized by JS after render */
}
.tier-city-list {
  list-style: none;
  padding: 0;
  align-self: start;
  width: 100%;
}

/* Each city row is fixed height so they align across all three cards */
.city-row {
  height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88rem;
}
.city-row:last-child { border-bottom: none; }
.city-row.selected-city .city-name { color: #334168; }
.city-spacer { visibility: hidden; }
.city-more { color: #999; font-style: italic; font-size: 0.8rem; justify-content: flex-start; }
.city-name { font-weight: 600; }
.city-pop {
  font-size: 0.75rem;
  font-weight: 700;
  color: #3F80EA;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  min-width: 52px;
  margin-left: 6px;
  flex-shrink: 0;
}
.hq-tag {
  display: inline-block;
  background: #EB0052;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

/* City header row — matches kw-header style: divider above and below, small uppercase gray labels.
   The border-top acts as the divider line above the header (like kw-tier-divider).
   The border-bottom acts as the divider line below the header (like kw-header). */
.city-header-row {
  height: auto !important;
  padding: 8px 0 !important;
  border-top: 1px solid #e8e8e8 !important;
  border-bottom: 2px solid #eee !important;
  margin-top: 8px;
  margin-bottom: 2px;
}
.city-col-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
}

/* Legend below tier cards */
.tier-legend {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
  margin-bottom: 32px;
  margin-top: 4px;
}

/* ---- CHART: full width, horizontal labels ---- */
.chart-container {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  margin-top: 24px;
  width: 100%;
}

/* ---- KEYWORD FULL TABLE ---- */
.kw-table th.num-col { text-align: right; }
.kw-table td.num-col { text-align: right; font-variant-numeric: tabular-nums; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-selected { background: rgba(34,197,94,0.15); color: #166534; }
.status-near-me { background: rgba(249,115,22,0.12); color: #c2410c; }
.status-not-used { background: #f3f4f6; color: #6b7280; }

/* ============================================================
   KEYWORD TIER CARDS — flex column, divider pushed to bottom
   ============================================================ */
/* ============================================================
   KEYWORD TIER CARDS — subgrid for perfect cross-card alignment
   Row tracks: [label] auto  [name] auto  [desc] 1fr  [table] auto
   The 1fr on desc stretches it to fill space so the divider+table
   always aligns at the same vertical position across all 4 cards.
   ============================================================ */
.kw-tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 5 tracks: label | name | desc(stretches) | divider | table */
  grid-template-rows: auto auto 1fr auto auto;
  column-gap: 20px;
  row-gap: 0;
  margin-bottom: 40px;
  align-items: stretch;
}
.kw-tier-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  display: grid;
  grid-row: span 5;
  grid-template-rows: subgrid;
}
.kw-tier-1 { border-top: 4px solid #3F80EA; }
.kw-tier-2 { border-top: 4px solid #334168; }
.kw-tier-3 { border-top: 4px solid #EB0052; }
.kw-tier-4 { border-top: 4px solid #f97316; }
.kw-tier-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px 20px 0;
}
.kw-tier-1 .kw-tier-label { color: #3F80EA; }
.kw-tier-2 .kw-tier-label { color: #334168; }
.kw-tier-3 .kw-tier-label { color: #EB0052; }
.kw-tier-4 .kw-tier-label { color: #f97316; }
.kw-tier-name {
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #334168;
  padding: 4px 20px 10px;
}
.kw-tier-desc {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.55;
  padding: 0 20px 16px;
  align-self: start; /* sits at top of 1fr track; extra space below before divider */
}
/* Divider — subgrid places this in the 4th row track, always aligned across all cards */
.kw-tier-divider {
  border-top: 1px solid #e8e8e8;
  margin: 0 20px;
  align-self: end;
}
.kw-tier-table {
  padding: 0 20px 16px;
}
.kw-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.82rem;
}
.kw-row:last-child { border-bottom: none; }
.kw-header {
  border-bottom: 2px solid #eee !important;
  padding-bottom: 8px !important;
  margin-bottom: 4px;
}
.kw-header .kw-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
}
.kw-header .kw-vol {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
  text-align: right;
}
.kw-name { color: #35373C; }
.kw-vol { font-weight: 700; color: #3F80EA; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; min-width: 42px; margin-left: 6px; flex-shrink: 0; padding-top: 1px; }

/* ---- MATRIX ---- */
.matrix-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 700px;
  table-layout: fixed;
}
.matrix-table colgroup col:first-child { width: 28%; }
.matrix-table th {
  background: #334168;
  color: #fff;
  padding: 12px 10px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.matrix-table th:first-child,
.matrix-table th.kw-col-header { text-align: left; padding-left: 16px; }
/* Tier pill row in matrix header: distinct background so pills are always visible */
.matrix-table thead tr:first-child th {
  background: #1a2540;
  padding: 8px 10px;
  vertical-align: middle;
}
.matrix-table thead tr:first-child th:first-child {
  background: #1a2540;
}
.city-header { font-size: 11px; font-weight: 700; }
.city-pop-small { font-size: 9px; font-weight: 400; opacity: 0.7; }
.hq-star { color: #3F80EA; }
.matrix-table td { padding: 0 10px; height: 48px; text-align: center; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.matrix-table td:first-child { text-align: left; padding-left: 16px; font-weight: 600; white-space: nowrap; }
.matrix-table tr:hover td { background: rgba(63,128,234,0.04); }
.check-cell { color: #22c55e; font-size: 1.1rem; font-weight: 900; }
.kw-cell { font-size: 0.85rem; }
.total-row td { background: #f7f8fc; font-weight: 900; color: #334168; border-top: 2px solid #E6E6E6; font-size: 0.85rem; }
.total-cell { font-weight: 900; }
.total-label { text-align: left; padding-left: 16px; }
.grand-total-row td { background: #334168; color: #fff; font-weight: 900; font-size: 0.9rem; text-align: center; padding: 14px; }

/* ============================================================
   NOT USED CARDS — flex column, divider pushed to bottom
   ============================================================ */
/* ============================================================
   NOT USED CARDS — subgrid for perfect cross-card alignment
   Row tracks: [title] auto  [desc] 1fr  [divider] auto  [table] auto
   ============================================================ */
.not-used-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto 1fr auto auto;
  column-gap: 20px;
  row-gap: 0;
  align-items: stretch;
}
.not-used-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  border-top: 4px solid #EB0052;
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
}
.nu-reason {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #EB0052;
  line-height: 1.3;
  margin-bottom: 8px;
}
.nu-desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
  padding-bottom: 14px;
  align-self: start; /* sits at top of 1fr track; extra space below before divider */
}
.nu-divider {
  border-top: 2px solid #f0f0f0;
  margin: 0;
  align-self: end; /* subgrid places this in track 3, always aligned across all cards */
}
.nu-kw-table {
  width: 100%;
  padding-top: 10px;
  padding-bottom: 16px;
}
.nu-kw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.82rem;
}
.nu-kw-row:last-child { border-bottom: none; }
.nu-header {
  border-bottom: 2px solid #eee !important;
  padding-bottom: 8px !important;
  margin-bottom: 4px;
}
.nu-header .nu-kw-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
}
.nu-header .nu-kw-vol {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
  text-align: right;
}
.nu-kw-name { color: #35373C; }
.nu-kw-vol { font-weight: 600; color: #999; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ============================================================
   OPPORTUNITIES CARDS — subgrid for perfect cross-card alignment
   7 tracks: [badge] auto [label] auto [price] auto [combos] auto
             [headline] auto [desc] 1fr [kw-list] auto
   ============================================================ */
.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto auto auto auto 1fr auto;
  column-gap: 20px;
  row-gap: 0;
  align-items: stretch;
}
.opp-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  border-top: 4px solid #E6E6E6;
  display: grid;
  grid-row: span 7;
  grid-template-rows: subgrid;
}
.opp-card-highlight {
  border-top-color: #3F80EA;
  box-shadow: 0 4px 24px rgba(63,128,234,0.15);
}
.opp-recommended {
  display: inline-block;
  background: #3F80EA;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  align-self: flex-start;
}
.opp-recommended-spacer {
  display: block;
  height: 26px;
  margin-bottom: 12px;
}
.opp-plan-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #3F80EA;
  margin-bottom: 4px;
}
.opp-price {
  font-size: 2rem;
  font-weight: 900;
  color: #334168;
  line-height: 1;
  margin-bottom: 6px;
}
.opp-price-mo { font-size: 0.9rem; font-weight: 500; color: #999; }
.opp-combos {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8e8e8;
}
.opp-add { color: #22c55e; font-weight: 700; }
.opp-headline {
  font-size: 1rem;
  font-weight: 900;
  color: #334168;
  margin-bottom: 8px;
}
.opp-desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.55;
  margin-bottom: 14px;
  align-self: start; /* sits at top of 1fr track; extra space below before kw-list */
}
.opp-kw-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid #e8e8e8;
  padding-top: 10px;
  margin-top: 0; /* subgrid places this in track 7, always aligned across all cards */
}
.opp-kw-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid #f5f5f5;
}
.opp-kw-list li:last-child { border-bottom: none; }
/* Header row inside opp-kw-list — matches nu-header and kw-header style */
.opp-kw-header {
  border-bottom: 2px solid #eee !important;
  padding-bottom: 8px !important;
  margin-bottom: 4px;
}
.opp-kw-col-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
}
.opp-kw { font-weight: 600; color: #35373C; }
.opp-vol {
  font-size: 0.75rem;
  font-weight: 700;
  color: #3F80EA;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  min-width: 42px;
  margin-left: 6px;
  flex-shrink: 0;
}
.opp-new-market {
  color: #22a06b;
  font-style: italic;
}

/* ============================================================
   MOBILE MARKET LIST & MOBILE MATRIX
   Hidden on desktop, shown on mobile
   ============================================================ */
.mobile-market-list { display: none; }
.mobile-matrix { display: none; }

/* Mobile market list styles */
.mob-mkt-header,
.mob-mkt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.82rem;
}
.mob-mkt-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 8px;
  margin-bottom: 2px;
}
.mob-mkt-row.selected { background: rgba(63,128,234,0.04); border-radius: 6px; padding-left: 4px; padding-right: 4px; }
.mob-mkt-row:last-child { border-bottom: none; }
.mob-rank { width: 24px; flex-shrink: 0; color: #999; font-size: 0.78rem; text-align: center; }
.mob-city { flex: 1; min-width: 0; }
.mob-pop { width: 56px; flex-shrink: 0; text-align: right; color: #666; font-size: 0.75rem; }
.mob-tier { width: 54px; flex-shrink: 0; text-align: center; }
.mob-check { color: #22c55e; font-weight: 900; font-size: 1rem; width: 20px; text-align: center; }
.mob-dash { color: #ccc; font-size: 1rem; width: 20px; text-align: center; }
.mob-sel { width: 20px; text-align: center; color: #999; }

/* Mobile matrix styles */
.mob-matrix-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 12px;
  overflow: hidden;
}
.mob-matrix-city {
  background: #334168;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.mob-matrix-city-name {
  font-weight: 900;
  font-size: 0.95rem;
}
.mob-matrix-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mob-matrix-kws {
  padding: 8px 16px;
}
.mob-matrix-kw {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.85rem;
}
.mob-matrix-kw:last-child { border-bottom: none; }
.mob-matrix-check {
  color: #22c55e;
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
}
.mob-matrix-total {
  background: #f7f8fc;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334168;
  text-align: right;
  border-top: 1px solid #e8e8e8;
}
.mob-matrix-grand-total {
  background: #334168;
  color: #fff;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.9rem;
  border-radius: 10px;
  margin-top: 4px;
}

/* ---- FOOTER ---- */
.site-footer {
  background: #334168;
  color: rgba(255,255,255,0.7);
  padding: 48px 40px;
  text-align: center;
}
.footer-inner { max-width: 700px; margin: 0 auto; }
.footer-logo { height: 32px; margin-bottom: 16px; opacity: 0.8; }
.footer-tagline { font-size: 0.85rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.footer-note { font-size: 0.78rem; color: rgba(255,255,255,0.45); line-height: 1.6; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

/* --- 1100px: Keyword tier grid collapses to 2 cols --- */
@media (max-width: 1100px) {
  .kw-tier-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2x2 layout: each pair of cards shares 5 row tracks */
    grid-template-rows: auto auto 1fr auto auto  auto auto 1fr auto auto;
  }
  .kw-tier-card { grid-row: span 5; }
}

/* --- 900px: All card grids go single-column, disable subgrid --- */
@media (max-width: 900px) {
  /* Tier cards — disable subgrid */
  .tier-cards-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 16px;
  }
  .tier-card {
    grid-row: span 1;
    grid-template-rows: none;
    display: flex;
    flex-direction: column;
    padding: 24px;
  }
  .city-spacer { display: none; }

  /* Keyword tier cards — disable subgrid, go single column */
  .kw-tier-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 16px;
  }
  .kw-tier-card {
    grid-row: span 1;
    grid-template-rows: none;
    display: flex;
    flex-direction: column;
  }
  .kw-tier-divider { align-self: auto; margin-top: auto; }

  /* Not Used cards — disable subgrid, go single column */
  .not-used-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 16px;
  }
  .not-used-card {
    grid-row: span 1;
    grid-template-rows: none;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 0;
  }
  .nu-divider { align-self: auto; margin-top: auto; }

  /* Opportunities cards — disable subgrid, go single column */
  .opportunities-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 16px;
  }
  .opp-card {
    grid-row: span 1;
    grid-template-rows: none;
    display: flex;
    flex-direction: column;
  }
  .opp-recommended-spacer { display: none; }
  .opp-kw-list { margin-top: auto; }
}

/* --- 768px: Core mobile layout --- */
@media (max-width: 768px) {
  /* Header */
  .site-header { padding: 12px 20px; }
  .header-tagline { display: none; }
  .logo { height: 30px; }

  /* Hero */
  .hero { padding: 40px 20px; }
  .hero-inner { max-width: 100%; padding: 0; }
  .hero-title { font-size: 1.5rem; word-break: break-word; overflow-wrap: break-word; }
  .hero-subtitle { font-size: 0.88rem; }
  .meta-badge { font-size: 10px; padding: 5px 10px; }

  /* Navigation */
  .section-nav {
    top: 54px;
    padding: 0;
    justify-content: flex-start;
  }
  .section-nav a { padding: 12px 14px; font-size: 10px; letter-spacing: 0.5px; }

  /* Sections */
  .section-inner { padding: 0 20px; }
  .strategy-section { padding: 48px 0; }
  .section-header { margin-bottom: 28px; gap: 10px 14px; flex-wrap: nowrap; align-items: center; }
  .section-number { font-size: 1.6rem; min-width: 28px; flex-shrink: 0; line-height: 1; }
  .section-header h2 { font-size: 1rem; min-width: 0; overflow-wrap: break-word; word-break: break-word; line-height: 1.3; }
  .prose { font-size: 0.9rem; }
  .subsection-title { font-size: 0.9rem; }

  /* Stats */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
  .stat-card { padding: 20px 16px; }
  .stat-number { font-size: 2rem; }

  /* Tables */
  .table-wrapper { margin-bottom: 24px; }
  .data-table { font-size: 0.78rem; }
  .data-table th { padding: 8px 10px; }
  .data-table td { padding: 8px 10px; }

  /* Chart */
  .chart-container { padding: 20px 16px; }

  /* Show mobile views, hide desktop tables */
  .desktop-only { display: none; }
  .mobile-market-list { display: block; margin-bottom: 24px; }
  #matrix-table-wrapper { display: none; }
  .mobile-matrix { display: block; }

  /* Market tier cards */
  .tier-card { padding: 20px; }
  .tier-card-title { font-size: 0.9rem; }
  .tier-card-desc { font-size: 0.82rem; }
  /* City rows: auto height on mobile, no fixed height */
  .city-row { height: auto; min-height: 36px; font-size: 0.82rem; padding: 6px 0; }
  .city-pop { text-align: right; }

  /* Keyword tier cards */
  .kw-tier-label { padding: 12px 16px 0; }
  .kw-tier-name { padding: 6px 16px 8px; font-size: 0.88rem; }
  .kw-tier-desc { padding: 0 16px 12px; font-size: 0.8rem; }
  .kw-tier-divider { margin: 0 16px; }
  .kw-tier-table { padding: 0 16px 14px; }

  /* Matrix: break out of section-inner padding for full-width scroll */
  .matrix-wrapper { margin: 0 -20px; border-radius: 0; overflow-x: auto; }
  .matrix-table { font-size: 0.78rem; min-width: 520px; }
  .matrix-table th { padding: 8px 8px; font-size: 9px; }
  .matrix-table td { padding: 0 8px; height: 44px; }
  .matrix-table td:first-child { padding-left: 12px; font-size: 0.78rem; }
  .grand-total-row td { font-size: 0.82rem; padding: 12px; }

  /* Not Used cards */
  .not-used-card { padding: 20px; }
  .nu-reason { font-size: 13px; }
  .nu-desc { font-size: 0.8rem; }
  .nu-kw-row { font-size: 0.78rem; }

  /* Opportunities cards */
  .opp-card { padding: 20px; }
  .opp-price { font-size: 1.75rem; }
  .opp-headline { font-size: 0.95rem; }
  .opp-desc { font-size: 0.82rem; }
  .opp-kw-list li { font-size: 0.78rem; }

  /* Footer */
  .site-footer { padding: 36px 20px; }
}

/* --- 480px: Small phones --- */
@media (max-width: 480px) {
  .hero-title { font-size: 1.5rem; }
  .hero { padding: 36px 16px; }
  .strategy-section { padding: 36px 16px; }
  .section-header { gap: 10px; }
  .section-number { font-size: 1.6rem; min-width: 30px; }
  .section-header h2 { font-size: 1.1rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-number { font-size: 1.75rem; }
  .stat-label { font-size: 10px; }
  .section-inner { padding: 0 16px; }
  .strategy-section { padding: 36px 0; }
  /* Matrix: horizontal scroll with full width */
  .matrix-wrapper { margin: 0 -16px; }
  .matrix-table { font-size: 0.72rem; min-width: 480px; }
  .matrix-table th { padding: 7px 6px; font-size: 8px; }
  .matrix-table td { padding: 0 6px; height: 40px; }
  .matrix-table td:first-child { padding-left: 10px; }
  /* Tier cards */
  .tier-card, .not-used-card, .opp-card { padding: 16px; }
  /* Nav */
  .section-nav a { padding: 10px 10px; font-size: 9px; }
}
