* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a1a; background: #f8f9fa; line-height: 1.7;
}
.guide-header {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  color: white; padding: 60px 20px 50px; text-align: center;
}
.guide-header h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; max-width: 800px; margin-left: auto; margin-right: auto; }
.guide-header p { font-size: 18px; opacity: 0.92; max-width: 650px; margin: 0 auto 24px; }
.guide-cta {
  display: inline-block; background: white; color: #6366f1; padding: 14px 32px;
  border-radius: 8px; font-weight: 700; font-size: 16px; text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2); transition: all 0.2s;
}
.guide-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.guide-nav {
  background: white; border-bottom: 1px solid #e5e7eb; padding: 12px 20px;
  display: flex; align-items: center; gap: 8px; font-size: 14px; color: #6b7280;
  position: sticky; top: 0; z-index: 40;
}
.guide-nav a { color: #6366f1; text-decoration: none; font-weight: 500; }
.guide-nav a:hover { text-decoration: underline; }
.guide-nav .sep { color: #9ca3af; }
/* Three-column layout: TOC | Content | Affiliates */
.guide-layout {
  max-width: 1320px; margin: 0 auto; padding: 40px 20px 60px;
  display: grid; grid-template-columns: 200px 1fr 170px; gap: 32px; align-items: start;
}
.guide-content { max-width: none; padding: 0; min-width: 0; }

/* Left sidebar — Table of Contents */
.guide-toc-sidebar { position: sticky; top: 60px; }
.guide-toc {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 14px;
}
.guide-toc-title {
  font-size: 12px; font-weight: 700; color: #6366f1; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px;
}
.guide-toc ul { list-style: none; margin: 0; padding: 0; }
.guide-toc li { margin-bottom: 0; }
.guide-toc a {
  display: block; padding: 5px 0; font-size: 12.5px; color: #475569; text-decoration: none;
  border-left: 2px solid transparent; padding-left: 10px; transition: all 0.15s; line-height: 1.4;
}
.guide-toc a:hover { color: #6366f1; border-left-color: #6366f1; }
.guide-toc a.active { color: #6366f1; border-left-color: #6366f1; font-weight: 600; }

/* Right sidebar — Affiliate banners */
.guide-aff-sidebar { position: sticky; top: 60px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-aff-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px;
  text-align: center; text-decoration: none; color: inherit; display: block;
  transition: all 0.2s;
}
.sidebar-aff-card:hover { border-color: #6366f1; box-shadow: 0 4px 14px rgba(99,102,241,0.12); transform: translateY(-1px); }
.sidebar-aff-badge {
  display: inline-block; font-size: 8px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 2px 6px; border-radius: 3px; margin-bottom: 4px;
}
.sidebar-aff-badge.rec { background: #dcfce7; color: #166534; }
.sidebar-aff-badge.deal { background: #fef3c7; color: #92400e; }
.sidebar-aff-badge.tool { background: #e0e7ff; color: #3730a3; }
.sidebar-aff-icon { font-size: 18px; margin-bottom: 2px; }
.sidebar-aff-icon img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; }
.sidebar-aff-title { font-size: 11px; font-weight: 700; color: #0f172a; margin-bottom: 2px; line-height: 1.25; }
.sidebar-aff-desc { font-size: 9px; color: #64748b; line-height: 1.3; margin-bottom: 5px; }
.sidebar-aff-btn {
  display: inline-block; font-size: 9px; font-weight: 600; padding: 4px 10px;
  border-radius: 5px; color: #fff; text-decoration: none; transition: opacity 0.15s;
}
.sidebar-aff-btn:hover { opacity: 0.9; color: #fff; }
.sidebar-aff-btn.green { background: #16a34a; }
.sidebar-aff-btn.blue { background: #2563eb; }
.sidebar-aff-btn.indigo { background: #6366f1; }
.sidebar-aff-btn.orange { background: #ea580c; }

/* Responsive: hide sidebars on smaller screens */
@media (max-width: 1024px) {
  .guide-layout { grid-template-columns: 1fr; gap: 0; }
  .guide-toc-sidebar { display: none; }
  .guide-aff-sidebar { display: none; }
  .guide-content { padding: 0; }
}

/* Fallback for pages without .guide-layout wrapper */
.guide-content:not(.guide-layout .guide-content) { max-width: 800px; margin: 0 auto; padding: 40px 20px 60px; }
.guide-content h2 { font-size: 26px; font-weight: 700; margin: 36px 0 16px; color: #111827; }
.guide-content h3 { font-size: 20px; font-weight: 600; margin: 28px 0 12px; color: #1f2937; }
.guide-content p { margin-bottom: 16px; color: #374151; font-size: 16px; }
.guide-content ul, .guide-content ol { margin: 0 0 16px 24px; color: #374151; }
.guide-content li { margin-bottom: 8px; }
.guide-content strong { color: #111827; }
.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 15px; }
.spec-table th { background: #6366f1; color: white; padding: 12px 16px; text-align: left; font-weight: 600; }
.spec-table td { padding: 10px 16px; border-bottom: 1px solid #e5e7eb; }
.spec-table tr:nth-child(even) { background: #f9fafb; }
.tip-box {
  background: #eef2ff; border-left: 4px solid #6366f1; padding: 16px 20px;
  border-radius: 0 8px 8px 0; margin: 20px 0; font-size: 15px;
}
.tip-box strong { color: #4338ca; }
.warning-box {
  background: #fef3c7; border-left: 4px solid #f59e0b; padding: 16px 20px;
  border-radius: 0 8px 8px 0; margin: 20px 0; font-size: 15px;
}
.cta-box {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white; padding: 32px; border-radius: 16px; text-align: center; margin: 40px 0;
}
.cta-box h3 { color: white; font-size: 22px; margin-bottom: 12px; }
.cta-box p { color: rgba(255,255,255,0.9); margin-bottom: 20px; }
.cta-box .guide-cta { background: white; color: #6366f1; }
.guide-footer {
  background: #111827; color: #9ca3af; padding: 40px 20px; text-align: center; font-size: 14px;
}
.guide-footer a { color: #818cf8; text-decoration: none; margin: 0 12px; }
.guide-footer a:hover { color: #a5b4fc; }
.related-guides { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 24px 0; }
.related-card {
  background: white; border: 1px solid #e5e7eb; border-radius: 12px;
  text-decoration: none; color: inherit; transition: all 0.2s; overflow: hidden;
  display: flex; flex-direction: column;
}
.related-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.related-card-img {
  width: 100%; height: 140px; object-fit: cover; display: block;
}
.related-card-body { padding: 16px 20px 20px; }
.related-card h4 { color: #6366f1; font-size: 16px; margin-bottom: 6px; }
.related-card p { font-size: 13px; color: #6b7280; margin: 0; }
/* Fallback for cards without images (keeps old padding) */
.related-card:not(:has(.related-card-img)) { padding: 20px; }
.related-card:not(:has(.related-card-img)) .related-card-body { padding: 0; }
@media (max-width: 768px) {
  .guide-header h1 { font-size: 26px; }
  .guide-header p { font-size: 16px; }
  .guide-content h2 { font-size: 22px; }
  .related-guides { grid-template-columns: 1fr; }
  .guide-layout { padding: 24px 16px 40px; }
}

.official-source {
  background: #f0fdf4; border-left: 4px solid #22c55e; padding: 16px 20px;
  border-radius: 0 8px 8px 0; margin: 20px 0; font-size: 15px;
}
.official-source strong { color: #15803d; }
.official-source a { color: #6366f1; font-weight: 500; word-break: break-all; }
.official-source a:hover { text-decoration: underline; }

.guide-example-img {
  display: block; max-width: 280px; margin: 20px auto; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); border: 1px solid #e5e7eb;
}
.guide-example-caption {
  text-align: center; font-size: 13px; color: #6b7280; margin: -12px 0 20px; font-style: italic;
}

/* Affiliate Boxes */
.affiliate-box {
  background: white; border: 2px solid #e5e7eb; border-radius: 12px; padding: 24px;
  margin: 20px 0; transition: all 0.2s;
}
.affiliate-box:hover { border-color: #6366f1; box-shadow: 0 4px 16px rgba(99,102,241,0.15); }
.affiliate-box h4 { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 8px; }
.affiliate-box p { font-size: 14px; color: #374151; margin-bottom: 12px; }
.affiliate-box .affiliate-features { list-style: none; margin: 0 0 16px; padding: 0; }
.affiliate-box .affiliate-features li { font-size: 14px; color: #374151; padding: 4px 0 4px 24px; position: relative; }
.affiliate-box .affiliate-features li::before { content: "✓"; position: absolute; left: 0; color: #22c55e; font-weight: 700; }
.affiliate-btn {
  display: inline-block; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white; padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 15px;
  text-decoration: none; transition: all 0.2s; box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}
.affiliate-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(99,102,241,0.6); color: white; }
.affiliate-btn-secondary {
  display: inline-block; background: white; color: #6366f1; border: 2px solid #6366f1;
  padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 14px;
  text-decoration: none; transition: all 0.2s; margin-left: 8px;
}
.affiliate-btn-secondary:hover { background: #6366f1; color: white; }
.affiliate-disclosure {
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 18px;
  font-size: 13px; color: #6b7280; margin: 24px 0; line-height: 1.6;
}
.affiliate-disclosure strong { color: #374151; }
.affiliate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; }
.price-tag { display: inline-block; background: #ecfdf5; color: #059669; font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 6px; margin-bottom: 8px; }
.comparison-winner { background: #f0fdf4; border-color: #22c55e; }

/* AdSense Ad Containers */
.guide-ad {
  max-width: 800px; margin: 24px auto; padding: 0 20px; text-align: center;
}
.guide-ad ins { display: block; }
.guide-ad-label {
  font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ── Embedded Tool CTA (above the fold, after header) ── */
.guide-tool-embed {
  background: #f0f4ff;
  border: 2px solid #c7d2fe;
  border-radius: 16px;
  padding: 24px 28px;
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.2s;
}
.guide-tool-embed:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 20px rgba(99,102,241,0.15);
}
.guide-tool-embed-icon {
  font-size: 40px;
  flex-shrink: 0;
}
.guide-tool-embed-text {
  flex: 1;
}
.guide-tool-embed-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 4px;
}
.guide-tool-embed-desc {
  font-size: 14px;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}
.guide-tool-embed-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
  transition: all 0.2s;
}
.guide-tool-embed-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.6);
  color: #fff;
}
@media (max-width: 768px) {
  .guide-tool-embed {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 12px;
  }
  .guide-tool-embed-btn {
    width: 100%;
    justify-content: center;
  }
}
