/* CSS Reset & Core Custom Variables */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1E293B;
  --primary-hover: #0F172A;
  --brand-blue: #2563EB;
  --brand-blue-hover: #1D4ED8;
  --brand-blue-subtle: #EFF6FF;
  --accent-emerald: #10B981;
  --accent-emerald-dark: #059669;
  --accent-emerald-subtle: #ECFDF5;
  --accent-amber: #F59E0B;
  --accent-amber-subtle: #FEF3C7;
  
  --bg-page: #F8FAFC;
  --surface-card: #FFFFFF;
  --surface-muted: #F1F5F9;
  --surface-subtle: #F8FAFC;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  
  --border-color: #E2E8F0;
  --border-dark: #CBD5E1;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-winner: 0 10px 25px -5px rgba(16, 185, 129, 0.25), 0 8px 10px -6px rgba(16, 185, 129, 0.15);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
}

input, select {
  font-family: inherit;
  font-size: 0.9375rem;
}

/* Container constraints */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Ad Placeholder Styling */
.ad-slot-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}

.ad-tag-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 0.35rem;
}

.ad-inner-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #64748B;
  font-size: 0.8125rem;
  font-weight: 500;
}

.ad-leaderboard-728x90 {
  width: 728px;
  height: 90px;
  margin: 1.25rem auto 1.5rem;
}

.ad-med-rectangle-300x250 {
  width: 300px;
  height: 250px;
}

.ad-half-page-300x600 {
  width: 300px;
  height: 600px;
}

/* GLOBAL NAVIGATION HEADER */
.global-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.1875rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1E293B 0%, #2563EB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.brand-name span {
  color: var(--brand-blue);
  font-weight: 800;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-blue);
}

.nav-badge-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  border-radius: var(--radius-pill);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-dark);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: var(--surface-muted);
  border-color: #94A3B8;
}

.btn-action-accent {
  background: var(--accent-emerald);
  color: white;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
  transition: all 0.15s;
}

.btn-action-accent:hover {
  background: var(--accent-emerald-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.mobile-menu-btn {
  display: none;
  padding: 0.5rem;
  color: var(--text-muted);
}

/* HERO SECTION */
.hero-section {
  padding: 2.25rem 0 1rem;
  text-align: center;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-xs);
}

.hero-pill-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--primary);
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.hero-title span {
  background: linear-gradient(135deg, #1E293B 20%, #2563EB 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.55;
}

/* MAIN TOOL WORKSPACE */
.tool-workspace-wrapper {
  margin-bottom: 3.5rem;
}

.tool-card-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tool-toolbar {
  padding: 1rem 1.5rem;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.matrix-title-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 260px;
}

.matrix-name-field {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid transparent;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  width: 100%;
  max-width: 380px;
}

.matrix-name-field:hover, .matrix-name-field:focus {
  background: var(--surface-subtle);
  border-color: var(--border-dark);
  outline: none;
}

.toolbar-button-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-tool {
  background: #FFFFFF;
  border: 1px solid var(--border-dark);
  color: var(--text-main);
  padding: 0.475rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}

.btn-tool:hover {
  background: var(--surface-muted);
  border-color: #94A3B8;
}

.btn-tool-primary {
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
}
.btn-tool-primary:hover {
  background: var(--brand-blue-hover);
  border-color: var(--brand-blue-hover);
}

/* WINNER SHOWCASE BANNER */
.winner-banner-strip {
  background: linear-gradient(90deg, #F0FDF4 0%, #FFFFFF 100%);
  border-bottom: 1px solid #DCFCE7;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.winner-announcement {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.winner-trophy-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.winner-text-primary {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--primary);
}

.winner-text-primary span {
  color: var(--accent-emerald-dark);
}

.winner-metrics-pills {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: white;
  border: 1px solid #BBF7D0;
  color: var(--accent-emerald-dark);
}

/* LIVE SCORE SUMMARY CARDS */
.score-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
}

.score-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  position: relative;
}

.score-card.is-winner {
  border: 2px solid var(--accent-emerald);
  background: #FFFFFF;
  box-shadow: var(--shadow-winner);
}

.card-top-tag {
  position: absolute;
  top: -11px;
  right: 14px;
  background: var(--accent-emerald);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.4);
}

.card-header-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.card-option-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
}

.card-rank-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
}

.card-score-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.score-card.is-winner .card-score-number {
  color: var(--accent-emerald-dark);
}

.score-progress-track {
  width: 100%;
  height: 6px;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.score-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: #94A3B8;
  transition: width 0.3s ease;
}

.score-card.is-winner .score-progress-fill {
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
}

/* MATRIX SPREADSHEET TABLE */
.matrix-table-container {
  overflow-x: auto;
  padding: 0;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.matrix-table th, .matrix-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.matrix-table th {
  background: #FFFFFF;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
}

.matrix-table thead tr:first-child th {
  border-bottom: 2px solid var(--border-dark);
}

.col-criteria {
  width: 28%;
  min-width: 240px;
}

.col-weight {
  width: 12%;
  min-width: 110px;
  text-align: center;
}

.col-option-header {
  width: 20%;
  min-width: 180px;
  text-align: center;
  background: var(--surface-subtle);
}

.col-option-header.winner-column-head {
  background: #F0FDF4;
  border-left: 2px solid #BBF7D0;
  border-right: 2px solid #BBF7D0;
}

.option-header-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
}

.col-option-header .criteria-input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  text-align: center;
  font-weight: 700;
}

.col-delete-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #94A3B8;
  border-radius: 4px;
  font-size: 0.8125rem;
  line-height: 1;
  transition: all 0.15s;
  cursor: pointer;
  background: transparent;
  border: none;
}

.col-delete-btn:hover {
  color: #EF4444;
  background: #FEE2E2;
}

.matrix-table tbody tr:hover {
  background-color: #FAFAFA;
}

.criteria-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.criteria-input {
  font-weight: 600;
  color: var(--primary);
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.criteria-input:hover, .criteria-input:focus {
  border-color: var(--border-dark);
  background: white;
  outline: none;
}

.weight-select-box {
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: white;
  font-weight: 700;
  color: var(--brand-blue);
  cursor: pointer;
}

.score-cell-interactive {
  text-align: center;
}

.winner-column-body {
  background: #FAFDFB;
  border-left: 2px solid #DCFCE7;
  border-right: 2px solid #DCFCE7;
}

.rating-input-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.2rem 0.4rem;
}

.rating-val-input {
  width: 32px;
  text-align: center;
  font-weight: 700;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  color: var(--primary);
}

.rating-weighted-calc {
  font-size: 0.75rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  margin-left: 0.25rem;
  font-weight: 500;
}

.winner-column-body .rating-weighted-calc {
  color: var(--accent-emerald-dark);
  font-weight: 600;
}

.row-delete-btn {
  color: #94A3B8;
  padding: 0.35rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.row-delete-btn:hover {
  color: #EF4444;
  background: #FEE2E2;
}

/* Footer Totals Row */
.matrix-totals-row td {
  background: #F8FAFC;
  font-weight: 700;
  border-top: 2px solid var(--border-dark);
  padding: 1.15rem 1rem;
}

.matrix-totals-row .total-number {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  text-align: center;
}

.matrix-totals-row .winner-total {
  background: #ECFDF5;
  color: var(--accent-emerald-dark);
  border-left: 2px solid #BBF7D0;
  border-right: 2px solid #BBF7D0;
}

/* Tool Action Bottom Bar */
.tool-bottom-bar {
  padding: 0.875rem 1.5rem;
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tool-add-controls {
  display: flex;
  gap: 0.75rem;
}

.btn-add-action {
  background: var(--surface-subtle);
  border: 1px dashed var(--border-dark);
  color: var(--brand-blue);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}
.btn-add-action:hover {
  background: var(--brand-blue-subtle);
  border-color: var(--brand-blue);
}

.tool-export-actions {
  display: flex;
  gap: 0.5rem;
}

/* BELOW-THE-TOOL 2-COLUMN CONTENT AREA */
.below-tool-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  margin-top: 2rem;
  align-items: start;
}

.guide-seo-article {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.section-eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-blue);
  margin-bottom: 0.5rem;
}

.article-title-h2 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  line-height: 1.25;
}

.lead-paragraph {
  font-size: 1.0625rem;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.steps-list-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.step-item-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.step-number-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9375rem;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Templates widget */
.templates-box-sidebar {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.75rem;
  box-shadow: var(--shadow-xs);
}

.templates-box-sidebar h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.template-quick-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all 0.15s;
}

.template-link-item:hover {
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  transform: translateX(2px);
}

/* INNER GUIDE TEMPLATE VIEW */
.inner-guide-view {
  margin-bottom: 4rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb-separator {
  color: var(--text-light);
}

.breadcrumb-current {
  color: var(--primary);
  font-weight: 600;
}

.article-header-block {
  margin-bottom: 2rem;
}

.article-meta-tags {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.category-tag {
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.read-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.guide-main-headline {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.guide-pub-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* 70/30 Content Split */
.guide-layout-split {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 3rem;
  align-items: start;
}

.guide-rich-content {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.75rem;
  box-shadow: var(--shadow-sm);
}

.guide-rich-content h2 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2rem 0 1rem;
  letter-spacing: -0.02em;
}

.guide-rich-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1.5rem 0 0.75rem;
}

.guide-rich-content p {
  font-size: 1.0625rem;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.guide-rich-content ul, .guide-rich-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: #334155;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.guide-rich-content li {
  margin-bottom: 0.5rem;
}

.styled-blockquote {
  border-left: 4px solid var(--brand-blue);
  padding: 1.25rem 1.5rem;
  background: #F8FAFC;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.75rem 0;
  font-style: italic;
  color: #1E293B;
  font-size: 1.0625rem;
}

/* Embedded Matrix CTA Box */
.embedded-tool-cta-box {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin: 2.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.embedded-tool-cta-box .cta-box-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  width: fit-content;
}

.embedded-tool-cta-box .cta-box-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  color: #FFFFFF;
}

.embedded-tool-cta-box p,
.embedded-tool-cta-box .cta-box-desc {
  color: #E2E8F0 !important;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.cta-btn-glow {
  background: var(--accent-emerald);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
  text-decoration: none;
}

.cta-btn-glow:hover {
  background: var(--accent-emerald-dark);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

/* Sticky Sidebar 30% Split */
.guide-sticky-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.quick-matrix-widget {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.quick-preset-pills {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.preset-pill-item {
  padding: 0.55rem 0.75rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-pill-item:hover {
  border-color: var(--brand-blue);
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
}

/* GLOBAL FOOTER */
.global-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand-col p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 1rem;
  max-width: 320px;
  line-height: 1.55;
}

.footer-trust-chips {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.trust-chip {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  background: var(--surface-muted);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.footer-col-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-list a {
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-links-list a:hover {
  color: var(--brand-blue);
}

.footer-bottom-bar {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 0.8125rem;
}

.footer-bottom-bar a {
  color: var(--text-muted);
  margin-left: 1.25rem;
}

.footer-bottom-bar a:hover {
  color: var(--brand-blue);
}

/* ==========================================================================
   ARTICLE TYPOGRAPHY & SPACING FIX
   ========================================================================== */

.guide-seo-article h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
  line-height: 1.3;
}

.guide-seo-article h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.guide-seo-article h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.guide-seo-article p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  line-height: 1.65;
  color: #334155;
}

.guide-seo-article ul,
.guide-seo-article ol {
  margin-top: 0.5rem;
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.guide-seo-article li {
  margin-bottom: 0.65rem;
  line-height: 1.6;
  color: #334155;
}

.guide-seo-article blockquote,
.guide-seo-article .styled-blockquote {
  margin-top: 2.25rem;
  margin-bottom: 2.25rem;
  padding: 1.25rem 1.5rem;
}

/* Unified Export Dropdown Styling */
.export-dropdown-container {
  position: relative;
  display: inline-block;
}

.export-dropdown-menu {
  display: none;
  position: absolute;
  bottom: 100%; /* Opens upward from bottom toolbar */
  right: 0;
  margin-bottom: 0.5rem;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
  padding: 0.35rem 0;
}

.export-dropdown-menu.show {
  display: block;
}

.dropdown-item-btn {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item-btn:hover {
  background: var(--surface-subtle);
  color: var(--brand-blue);
}

.dropdown-item-btn svg {
  flex-shrink: 0;
  stroke: var(--text-muted);
}

.dropdown-item-btn:hover svg {
  stroke: var(--brand-blue);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.35rem 0;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .below-tool-grid {
    grid-template-columns: 1fr;
  }
  .guide-layout-split {
    grid-template-columns: 1fr;
  }
  .guide-sticky-sidebar {
    position: static;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .ad-leaderboard-728x90 {
    width: 100%;
    max-width: 728px;
  }
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .hero-title {
    font-size: 2rem;
  }
  .score-summary-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* INTERACTIVE TOUR STYLES */
#tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
  transition: opacity 0.3s ease;
}

.tour-element-highlight {
  position: relative !important;
  z-index: 9999 !important;
  box-shadow: 0 0 0 4px var(--brand-blue), 0 10px 25px rgba(0, 0, 0, 0.3) !important;
  border-radius: var(--radius-md);
  background: #FFFFFF !important;
  transition: all 0.2s ease;
}

#tour-bubble {
  position: absolute;
  z-index: 10000;
  width: 320px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  transition: top 0.25s ease, left 0.25s ease;
}

#tour-bubble::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  transform: rotate(45deg);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

#tour-bubble.arrow-top::before {
  top: -7px;
  left: 20px;
}

#tour-bubble.arrow-bottom::before {
  bottom: -7px;
  left: 20px;
  transform: rotate(225deg);
}

.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
}

.tour-step-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--surface-muted);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.tour-body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-tour-skip {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
}
.btn-tour-skip:hover {
  color: #EF4444;
}

.btn-tour-next {
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
.btn-tour-next:hover {
  background: var(--brand-blue-hover);
}

/* ------------------------------------------------------------------ */
/* MOBILE NAVIGATION DRAWER & HAMBURGER MENU                          */
/* ------------------------------------------------------------------ */
.mobile-nav-drawer {
  display: none;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem 0;
}

.mobile-nav-drawer.is-active {
  display: block;
  animation: slideDownMenu 0.2s ease-out;
}

@keyframes slideDownMenu {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mobile-nav-item {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.mobile-nav-item:hover {
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 0.4rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: var(--surface-muted);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  
  .header-nav {
    display: none !important;
  }
  
  /* Hide heavy action button from sticky mobile header bar */
  .header-actions .btn-action-accent {
    display: none !important;
  }
  
  .brand-name {
    font-size: 1.05rem !important;
  }
}

/* ------------------------------------------------------------------ */
/* MOBILE TOOL TOP HEADER & WINNER BANNER RESPONSIVENESS               */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
  /* 1. Stack Title Field and Button Group Vertically */
  .tool-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .matrix-title-input-wrap {
    width: 100% !important;
  }

  /* 2. Format Button Group onto 2 clean rows */
  .toolbar-button-group {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  /* Add Option & Add Criteria: Row 1 (50% / 50% width) */
  .toolbar-button-group .btn-tool:not(.btn-tool-primary) {
    flex: 1 1 calc(50% - 0.25rem) !important;
    min-width: 0 !important;
    justify-content: center !important;
    padding: 0.6rem 0.5rem !important;
    font-size: 0.8125rem !important;
    white-space: nowrap !important;
  }

  /* Recalculate: Row 2 (100% full width) */
  .toolbar-button-group .btn-tool-primary {
    flex: 1 1 100% !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 0.65rem 0.5rem !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
  }

  /* 3. Stack Winner Announcement Banner Vertically */
  .winner-banner-strip {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    padding: 0.85rem 1rem !important;
  }

  .winner-announcement {
    width: 100% !important;
  }

  .winner-text-primary {
    font-size: 0.9375rem !important;
  }

  .winner-metrics-pills {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .winner-metrics-pills .metric-badge {
    font-size: 0.8125rem !important;
    padding: 0.35rem 0.65rem !important;
    white-space: nowrap !important;
  }
}

/* ------------------------------------------------------------------ */
/* MOBILE TOOL BOTTOM BAR RESPONSIVENESS                              */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .tool-bottom-bar {
    flex-direction: column !important;
    gap: 0.85rem !important;
    align-items: stretch !important;
    padding: 0.85rem 0.5rem !important;
  }

  .tool-add-controls,
  .tool-export-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    width: 100% !important;
    justify-content: center !important;
  }

  .tool-add-controls button,
  .tool-export-actions button {
    flex: 1 1 calc(50% - 0.5rem) !important;
    min-width: 120px !important;
    justify-content: center !important;
    font-size: 0.8125rem !important;
    padding: 0.55rem 0.5rem !important;
    white-space: nowrap !important;
  }

  .hide-mobile {
    display: none !important;
  }
}

/* ==================================================================
   PRINT & PDF EXPORT STYLESHEET (OPTIMIZED FOR 5+ COLUMNS & CLEAN PDF)
   ================================================================== */
@media print {
  /* Force Landscape Orientation and Tight Margins for Maximum Canvas Width */
  @page {
    size: landscape;
    margin: 6mm;
  }

  /* 1. Hide Non-Essential Elements */
  header.global-header,
  footer.global-footer,
  .hero-section,
  .below-tool-grid,
  .homepage-guides-section,
  .tool-bottom-bar,
  .toolbar-button-group,
  .col-delete-btn,
  .row-delete-btn,
  #tour-overlay,
  #tour-bubble,
  .mobile-nav-drawer {
    display: none !important;
  }

  /* 2. Page & Color Adjustments */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-sizing: border-box !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 8.5pt;
    margin: 0 !important;
    padding: 0 !important;
  }

  .container,
  .main-tool-view,
  .tool-workspace-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .tool-card-panel {
    border: none !important;
    box-shadow: none !important;
    background: #FFFFFF !important;
  }

  /* 3. Header & Title (Prevents Truncation) */
  .tool-toolbar {
    border-bottom: 2px solid #0F172A !important;
    padding: 0 0 8px 0 !important;
    margin-bottom: 12px !important;
  }

  .matrix-title-input-wrap,
  .matrix-name-field {
    max-width: 100% !important;
    width: 100% !important;
  }

  .matrix-name-field {
    font-size: 18pt !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    border: none !important;
    padding: 0 !important;
  }

  /* 4. Score Cards Grid (Scales down for 5-6+ options) */
  .score-summary-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 12px !important;
    border-bottom: none !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .score-card {
    flex: 1 1 0px !important;
    min-width: 0 !important;
    border: 1px solid #CBD5E1 !important;
    box-shadow: none !important;
    padding: 0.5rem !important;
    page-break-inside: avoid;
  }

  .score-card.is-winner {
    border: 2px solid #10B981 !important;
  }

  .card-option-name {
    font-size: 8pt !important;
    word-break: break-word !important;
  }

  .card-score-number {
    font-size: 14pt !important;
    margin-bottom: 0.2rem !important;
  }

  /* 5. Matrix Table Fixed 100% Auto-Scaling */
  .matrix-table-container {
    overflow: visible !important;
    width: 100% !important;
  }

  .matrix-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important; /* Forces strict 100% width fitting */
    border-collapse: collapse !important;
    font-size: 8pt !important;
  }

  /* Column Width Allocations */
  .col-criteria {
    width: 22% !important;
    min-width: 0 !important;
  }

  .col-weight {
    width: 10% !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .col-option-header {
    width: auto !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .col-option-header .criteria-input {
    font-size: 7.5pt !important;
    line-height: 1.1 !important;
    white-space: normal !important;
  }

  /* Cell Padding & Wrapping Rules */
  .matrix-table th, 
  .matrix-table td {
    border: 1px solid #CBD5E1 !important;
    padding: 4px 5px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }

  .matrix-table th {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
  }

  /* Form Element Clean-Up (Removes UI arrows & spinners) */
  .criteria-input,
  .rating-val-input,
  .weight-select-box {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 8pt !important;
    width: 100% !important;
    text-align: inherit !important;
  }

  select.weight-select-box {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding-right: 0 !important;
  }

  input[type=number]::-webkit-inner-spin-button,
  input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
  }

  input[type=number] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
  }

  /* Rating Cells Layout (Prevents parenthesis vertical stacking) */
  .rating-input-group {
    border: none !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  .rating-val-input {
    width: auto !important;
    min-width: 12px !important;
    padding: 0 !important;
  }

  .rating-weighted-calc {
    white-space: nowrap !important;
    font-size: 7.5pt !important;
    margin-left: 2px !important;
    display: inline-block !important;
  }

  /* 6. Footer Stamp */
  .tool-card-panel::after {
    content: "Generated via DecisionMatrixGenerator.com — Objective Multi-Criteria Decision Framework";
    display: block;
    margin-top: 15px;
    text-align: center;
    font-size: 8pt;
    color: #64748B;
    border-top: 1px solid #E2E8F0;
    padding-top: 8px;
  }
}

/* ==========================================================================
   EXECUTIVE PDF & NATIVE PRINT STYLESHEET
   ========================================================================== */

/* Compact PDF Report Mode (Applied temporarily during html2pdf download) */
.pdf-export-mode {
  background: #FFFFFF !important;
  box-shadow: none !important;
  border: 1px solid var(--border-color) !important;
  padding: 1rem 1.25rem !important;
  width: 860px !important; /* Scaled precisely to fit 11" landscape letter canvas */
  max-width: 860px !important;
  margin: 0 auto !important;
}

.pdf-export-mode .toolbar-button-group,
.pdf-export-mode .col-delete-btn,
.pdf-export-mode .row-delete-btn,
.pdf-export-mode .tool-bottom-bar,
.pdf-export-mode .tool-toolbar {
  display: none !important;
}

.pdf-export-mode .winner-banner-strip {
  padding: 0.5rem 0.85rem !important;
  margin-bottom: 0.75rem !important;
}

.pdf-export-mode .score-summary-grid {
  gap: 0.75rem !important;
  margin-bottom: 0.85rem !important;
}

.pdf-export-mode .score-card {
  padding: 0.5rem 0.75rem !important;
}

.pdf-export-mode .card-score-number {
  font-size: 1.35rem !important;
}

.pdf-export-mode .matrix-table th,
.pdf-export-mode .matrix-table td {
  padding: 0.35rem 0.5rem !important;
  font-size: 0.8rem !important;
}

.pdf-export-mode input,
.pdf-export-mode select {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 0.825rem !important;
  padding: 0 !important;
}


/* Native Print Stylesheet (Hides FAQs, Header, Footer, and Sidebars) */
@media print {
  /* Explicitly remove all non-tool page sections */
  header, 
  footer, 
  nav, 
  .breadcrumb-nav, 
  .hero-section, 
  .below-tool-grid, 
  .homepage-faq-section, 
  .homepage-guides-section,
  .toolbar-button-group,
  .col-delete-btn,
  .row-delete-btn,
  .tool-bottom-bar {
    display: none !important;
  }

  body {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  main, .container, .tool-workspace-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #tool-app {
    width: 100% !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  input, select {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
  }

  @page {
    size: landscape;
    margin: 1cm;
  }
}