/* Simple Calculator Tools — rebuild stylesheet.
   Written fresh for the rebuild. Brand colors match the original site;
   structure and rules do not — no inherited override chains. */

:root {
  --navy: #10213f;
  --blue: #2463eb;
  --green: #20b486;
  --border: #dbe3ee;
  --bg: #f4f7fb;
  --text: #334155;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: #fff; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.site-logo-link { line-height: 0; }
.site-logo { display: block; width: 230px; height: 46px; object-fit: contain; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 22px; height: 22px; }
.brand-mark i { display: block; border-radius: 3px; }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(4) { background: var(--blue); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--green); }
.nav-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 9px; min-width: 0; }
.nav-links a { white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--navy); padding: 7px 8px; border-radius: 7px; }
.nav-links a:hover { color: var(--blue); }
.nav-links .nav-center-link { background: #eef8f8; color: #155e75; border: 1px solid #cfe5e7; }
.nav-links .nav-center-link:hover { background: #dff3f4; color: #104d5d; }
.menu-btn { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

/* ---------- Hero / breadcrumb ---------- */
.page-hero { padding: 32px 0 22px; background: #f5f8fd; }
.breadcrumb { font-size: .85rem; margin-bottom: 10px; }
.breadcrumb a { color: var(--blue); font-weight: 600; }
.breadcrumb span { color: #8a96a8; }
.page-hero h1 { font-size: 2.6rem; margin: 4px 0 10px; color: var(--navy); }
.page-hero p { color: #5b6b82; max-width: 700px; margin: 0; }
.page-hero-icon-row { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.page-hero-icon { flex-shrink: 0; width: 27px; height: 27px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.page-hero-icon.category-badge-img { width: 100px; height: 40px; border-radius: 6px; object-fit: contain; background: none; }

/* ---------- 3-column calculator layout: 250 / 600 / 250 ---------- */
.calculator-section-template { padding: 28px 0 50px; }
.calculator-layout-template {
  display: grid;
  grid-template-columns: 250px 600px 250px;
  gap: 24px;
  align-items: start;
  justify-content: center;
}
.template-sidebar-stack { display: flex; flex-direction: column; gap: 16px; }
.template-side-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(16,33,63,.05);
}
.template-side-card h3 { margin: 0 0 12px; font-size: 1rem; color: var(--navy); }
.template-fact-grid { display: grid; gap: 8px; }
.template-fact { display: flex; justify-content: space-between; font-size: .88rem; }
.template-fact span { color: #8a96a8; }
.template-tip-list, .template-side-list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; }
.template-tip-list li { padding-left: 16px; position: relative; }
.template-tip-list li::before { content: "•"; position: absolute; left: 0; color: var(--blue); }
.template-side-list a { color: var(--blue); font-size: .88rem; font-weight: 600; }
.template-side-list a:hover { text-decoration: underline; }

/* Professional affiliate recommendation cards — built from real offer data only */
.sponsored-card-professional {
  overflow: hidden;
  padding: 0;
  background: #fff;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  box-shadow: 0 5px 16px rgba(16,33,63,.08);
}
.sponsored-feature-bar {
  padding: 9px 13px;
  background: linear-gradient(180deg,#0f5b93 0%,#0a4777 100%);
  color: #fff;
  font-size: .78rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: .01em;
}
.sponsored-card-body { padding: 12px 13px 10px; }
.sponsored-network-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.sponsored-network {
  color: #6b7788;
  font-size: .62rem;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sponsored-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff3d6;
  color: #a85b00;
  font-size: .58rem;
  line-height: 1;
  font-weight: 800;
}
.sponsored-card-professional .sponsored-header {
  margin: 0 0 6px;
  padding: 0;
  color: #10233f;
  font-size: .88rem;
  line-height: 1.25;
}
.sponsored-card-professional .sponsored-description {
  margin: 0 0 10px;
  color: #59697e;
  font-size: .75rem;
  line-height: 1.42;
}
.sponsored-card-professional .btn.btn-sponsored {
  display: block;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #e2a400;
  border-radius: 7px;
  background: linear-gradient(180deg,#ffd96b 0%,#ffc43d 100%);
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  text-align: center;
  font-size: .75rem;
  line-height: 1.15;
  font-weight: 800;
}
.sponsored-card-professional .btn.btn-sponsored:hover {
  background: linear-gradient(180deg,#ffd05a 0%,#f4b900 100%);
  color: #111827;
}
.sponsored-card-professional .sponsored-disclosure {
  margin: 7px 0 0;
  color: #98a3b1;
  font-size: 8px;
  line-height: 1.3;
}

.sct-helpful-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; }
.sct-helpful-btn:hover { border-color: var(--blue); }
.sct-helpful-status { font-size: .82rem; color: var(--green); margin: 8px 0 0; min-height: 1em; }

/* ---------- Calculator card (light, per explicit preference) ---------- */
.template-calculator-main { display: flex; flex-direction: column; gap: 20px; }
.calc-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(16,33,63,.06);
}
.calc-instructions { margin: 0 0 16px; color: #5b6b82; font-size: .92rem; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 20px; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--border);
  font-size: .95rem; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,99,235,.12); }
.btn { padding: 11px 22px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; margin-right: 10px; font-weight: 600; }
.btn-primary { background: var(--blue); color: #fff; border: none; }
.btn-primary:hover { background: #1d54c9; }
.result-panel { margin-top: 22px; padding: 18px; background: var(--bg); border-radius: 10px; }
.result-panel h3 { margin: 0 0 6px; font-size: .85rem; color: #5b6b82; text-transform: uppercase; letter-spacing: .04em; }
.result-value { font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.mode-select { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mode-btn { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 600; font-size: .88rem; }
.mode-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Content cards ---------- */
.content-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.content-card h2 { color: var(--navy); font-size: 1.2rem; margin-top: 0; }
.content-card details { border-top: 1px solid var(--border); padding: 12px 0; }
.content-card summary { cursor: pointer; font-weight: 600; color: var(--navy); }

/* ---------- Our Journey page ---------- */
.journey-hero { display: flex; gap: 24px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 28px; margin-bottom: 24px; }
.journey-avatar { flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--green)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2.1rem; font-weight: 800; }
.journey-hero-text .eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.journey-hero-text h2 { margin: 4px 0 2px; color: var(--navy); font-size: 1.5rem; }
.journey-hero-text .founder-title { color: #5b6b82; font-size: .92rem; margin: 0 0 8px; }
.journey-hero-text .founder-quote { font-style: italic; color: #334155; margin: 0; }

.journey-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.journey-stat-card { background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--accent, var(--blue)); border-radius: 12px; padding: 18px; text-align: center; }
.journey-stat-card .stat-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft, #eaf1fe); color: var(--accent, var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin: 0 auto 10px; }
.journey-stat-card strong { display: block; font-size: 1.5rem; color: var(--navy); }
.journey-stat-card span { font-size: .8rem; color: #8a96a8; }
.journey-stat-card:nth-child(1) { --accent: #2463eb; --accent-soft: #eaf1fe; }
.journey-stat-card:nth-child(2) { --accent: #d97706; --accent-soft: #fef3c7; }
.journey-stat-card:nth-child(3) { --accent: #db2777; --accent-soft: #fce7f3; }
.journey-stat-card:nth-child(4) { --accent: #20b486; --accent-soft: #e2f9f0; }

.journey-reason-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 16px 0 24px; }
.journey-reason-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.journey-reason-card .reason-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft, #eaf1fe); color: var(--accent, var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: 10px; }
.journey-reason-card h3 { font-size: .95rem; color: var(--navy); margin: 0 0 6px; }
.journey-reason-card p { font-size: .84rem; color: #5b6b82; margin: 0; }
.journey-reason-card:nth-child(1) { --accent: #2463eb; --accent-soft: #eaf1fe; }
.journey-reason-card:nth-child(2) { --accent: #db2777; --accent-soft: #fce7f3; }
.journey-reason-card:nth-child(3) { --accent: #20b486; --accent-soft: #e2f9f0; }
.journey-reason-card:nth-child(4) { --accent: #7c3aed; --accent-soft: #ede9fe; }

.journey-timeline { position: relative; margin: 32px 0; padding-top: 8px; }
.journey-timeline-line { position: absolute; top: 24px; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #2463eb, #db2777, #20b486, #d97706, #7c3aed, #2463eb); opacity: .35; }
.journey-timeline-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; position: relative; }
.journey-timeline-step { text-align: center; }
.journey-timeline-dot { width: 44px; height: 44px; border-radius: 50%; background: var(--accent, var(--blue)); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 1.2rem; position: relative; z-index: 1; box-shadow: 0 4px 10px -2px rgba(0,0,0,.25); }
.journey-timeline-step h4 { font-size: .82rem; color: var(--navy); margin: 0 0 4px; }
.journey-timeline-step p { font-size: .74rem; color: #8a96a8; margin: 0; }
.journey-timeline-step:nth-child(1) .journey-timeline-dot { --accent: #2463eb; }
.journey-timeline-step:nth-child(2) .journey-timeline-dot { --accent: #d97706; }
.journey-timeline-step:nth-child(3) .journey-timeline-dot { --accent: #db2777; }
.journey-timeline-step:nth-child(4) .journey-timeline-dot { --accent: #20b486; }
.journey-timeline-step:nth-child(5) .journey-timeline-dot { --accent: #7c3aed; }
.journey-timeline-step:nth-child(6) .journey-timeline-dot { --accent: #2463eb; }

.journey-avatar { flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 16px -4px rgba(36,99,235,.4); border: 3px solid #fff; outline: 1px solid var(--border); }
.journey-milestone-badge { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; font-weight: 700; font-size: .8rem; padding: 6px 14px; border-radius: 20px; margin-top: 10px; }

.journey-offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 24px; }
.journey-offer-card { background: #fffaf0; border: 1px solid #f5d99b; border-radius: 12px; padding: 18px; }
.journey-offer-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.journey-offer-icon { width: 34px; height: 34px; border-radius: 8px; background: #fef3c7; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.journey-offer-sponsored { font-size: .68rem; font-weight: 700; color: #a16207; text-transform: uppercase; letter-spacing: .04em; }
.journey-offer-card h3 { font-size: .98rem; color: #1c1917; margin: 0 0 6px; }
.journey-offer-card p { font-size: .84rem; color: #78716c; margin: 0 0 14px; }
.journey-offer-btn { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1c1917; font-weight: 700; font-size: .88rem; padding: 10px 20px; border-radius: 24px; }
.journey-offer-btn:hover { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }

@media (max-width: 860px) {
  .journey-offer-grid { grid-template-columns: 1fr; }
}

.journey-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
.journey-two-col ul { margin: 10px 0 0; padding-left: 20px; }
.journey-two-col li { font-size: .88rem; margin-bottom: 6px; }

@media (max-width: 860px) {
  .journey-stat-grid, .journey-reason-grid { grid-template-columns: repeat(2, 1fr); }
  .journey-timeline-steps { grid-template-columns: repeat(3, 1fr); row-gap: 24px; }
  .journey-timeline-line { display: none; }
  .journey-two-col { grid-template-columns: 1fr; }
  .journey-hero { flex-direction: column; text-align: center; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cbd5e1; padding: 40px 0 20px; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid h4 { color: #fff; font-size: .9rem; margin: 0 0 12px; }
.footer-grid a { display: block; color: #cbd5e1; font-size: .88rem; margin-bottom: 8px; }
.footer-grid a:hover { color: #fff; }
.footer-grid p { color: #8ea0bb; font-size: .85rem; }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 18px; border-top: 1px solid #23324d; font-size: .8rem; color: #8ea0bb; }

/* ---------- Listing pages (categories, all-calculators, category index) ---------- */
.listing-section { padding: 30px 0 60px; }
.listing-count { color: #5b6b82; font-size: .9rem; margin-bottom: 16px; }
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.listing-card {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; transition: box-shadow .15s, border-color .15s;
}
.listing-card:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(16,33,63,.08); }
.listing-card strong { color: var(--navy); font-size: 1rem; }
.listing-card span { color: #5b6b82; font-size: .85rem; }
.category-card { display: block; }
.category-card > a { display: block; text-decoration: none; color: inherit; }
.subcat-links { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px; }
.subcat-links a { font-size: .78rem; color: var(--blue); background: #eff4ff; padding: 3px 9px; border-radius: 12px; text-decoration: none; }
.subcat-links a:hover { background: var(--blue); color: #fff; }
.search-input {
  width: 100%; padding: 14px 18px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 1rem; background: #fff;
}
.search-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,99,235,.12); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .5; pointer-events: none; }

.eyebrow-badge { display: inline-block; background: #eaf1fe; color: var(--blue); font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 12px; border-radius: 12px; margin-bottom: 8px; }

.trust-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .82rem; color: #8a96a8; flex-wrap: wrap; }
.trust-stars { color: #f59e0b; letter-spacing: 1px; }
.trust-actions { display: flex; gap: 4px; margin-left: auto; }
.trust-action { background: none; border: 1px solid var(--border); color: #5b6b82; font-size: .78rem; padding: 5px 12px; border-radius: 16px; cursor: pointer; transition: background .15s, border-color .15s; }
.trust-action:hover { background: #eaf1fe; border-color: var(--blue); color: var(--blue); }

.az-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0; }
.az-filter-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); color: var(--navy); font-size: .82rem; font-weight: 600; text-decoration: none; }
.az-filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.az-filter-btn.az-active { background: var(--blue); border-color: var(--blue); color: #fff; }

.listing-grid-cards { grid-template-columns: repeat(4, 1fr); }
.listing-card-rich { display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; transition: box-shadow .15s, border-color .15s; }
.listing-card-rich:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(16,33,63,.08); }
.listing-card-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.listing-card-icon.category-badge-img { width: 65px; height: 26px; border-radius: 5px; object-fit: contain; background: none; }
.listing-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.listing-card-text strong { color: var(--navy); font-size: .9rem; }
.listing-card-category { color: #8a96a8; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.listing-card-arrow { display: none; }

.advanced-banner-wrap { display: flex; justify-content: center; margin: 10px 0; }
.advanced-banner { max-width: 100%; height: auto; border-radius: 10px; }

@media (max-width: 1000px) {
  .listing-grid-cards { grid-template-columns: repeat(2, 1fr); }
  .trust-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .listing-grid-cards { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .calculator-layout-template { grid-template-columns: 220px 1fr; }
  .template-sidebar-right { grid-column: 2; grid-row: 2; }
}
@media (max-width: 980px) {
  .calculator-layout-template { grid-template-columns: 1fr; }
  .template-sidebar-right { grid-column: 1; grid-row: auto; }
  .nav-links { display: none; }
  .menu-btn { display: block; }
}
@media (max-width: 480px) {
  .site-logo { width: 210px; height: 42px; }
}
@media (max-width: 760px) {
  .page-hero h1 { font-size: 1.9rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Homepage hero ---------- */
.home-hero { display: grid; grid-template-columns: 1fr 280px; gap: 32px; padding: 50px 0; align-items: start; }
.home-hero-main h1 { font-size: 2.6rem; color: var(--navy); margin: 0 0 14px; line-height: 1.15; }
.home-hero-main p { color: #5b6b82; margin: 0 0 22px; }
.home-search { display: flex; gap: 10px; }
.home-search .search-input { flex: 1; }
.home-hero-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.home-hero-panel h3 { margin: 0 0 12px; color: var(--navy); font-size: 1rem; }
.home-hero-panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: .88rem; color: #475569; }
@media (max-width: 760px) {
  .home-hero { grid-template-columns: 1fr; }
}

.home-banner { display: flex; align-items: center; gap: 20px; background: #fffaf0; border: 1px solid #f5d99b; border-radius: 12px; padding: 16px 22px; position: relative; margin-bottom: 10px; }
.home-banner .sponsored-tag { position: static; margin-right: 6px; }
.home-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.home-banner-text strong { color: var(--navy); font-size: .95rem; }
.home-banner-text span { color: #78716c; font-size: .85rem; }
.home-banner .btn-sponsored { white-space: nowrap; margin: 0; }

/* Phase 7: Categories page right sidebar */
.categories-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 28px;
  align-items: start;
}
.categories-main-column {
  min-width: 0;
  width: calc(100% - 50px);
}
.categories-main-column > .category-banner-directory.container {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.categories-right-sidebar {
  width: 300px;
  min-width: 300px;
  padding-top: 10px;
}
.categories-sidebar-sticky {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
}
.categories-sidebar-slot {
  width: 300px;
  min-height: 300px;
}
/* Until the affiliate manager supplies content, don't show empty boxes. */
.categories-sidebar-slot:empty { display: none; }

.category-card-directory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.category-card-block { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fff; }
.category-card-link { display: flex; align-items: flex-start; gap: 10px; text-decoration: none; }
.category-card-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.category-card-icon.category-badge-img { width: 65px; height: 26px; border-radius: 5px; object-fit: contain; background: none; }
.category-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.category-card-text strong { color: var(--navy); font-size: .92rem; }
.category-card-count { color: var(--blue); font-size: .8rem; font-weight: 600; }
.category-card-desc { color: #8a96a8; font-size: .78rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.category-card-link:hover strong { color: var(--blue); }

@media (max-width: 1000px) {
  .category-card-directory { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .category-card-directory { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .categories-with-sidebar { grid-template-columns: 1fr; }
  .categories-right-sidebar { width: 100%; min-width: 0; }
  .categories-sidebar-sticky {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 250px));
    justify-content: center;
  }
}
@media (max-width: 620px) {
  .categories-sidebar-sticky {
    grid-template-columns: minmax(0, 250px);
  }
}


/* ==========================================================
   Phase 10 - Central affiliate ad spaces
   ========================================================== */
.sct-global-ad-wrap {
  width: min(100%, 1160px);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: center;
}
.sct-global-ad-top { padding: 16px 16px 4px; }
.sct-global-ad-bottom { padding: 26px 16px 0; }

.sct-ad-space {
  position: relative;
  width: var(--ad-w);
  max-width: 100%;
  line-height: 0;
  margin-left: auto;
  margin-right: auto;
}
.sct-ad-space > a { display: block; line-height: 0; }
.sct-ad-space img {
  display: block;
  width: var(--ad-w);
  max-width: 100%;
  height: auto;
  aspect-ratio: var(--ad-w) / var(--ad-h);
  object-fit: contain;
}
.sct-ad-label {
  position: absolute;
  top: -13px;
  left: 0;
  color: #8a96a8;
  font-size: .62rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* A 300x250 creative stays 300x250 when the sidebar permits it.
   In the current 250px calculator sidebars it scales down cleanly
   instead of breaking the 250/600/250 layout. */
.template-sidebar .sct-ad-space {
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .sct-global-ad-top { padding-top: 12px; }
  .sct-global-ad-bottom { padding-top: 18px; }
}
