/* =====================================================================
   TopWebsites theme — Ahrefs-inspired visual language.
   Blue brand band, white report cards, orange accents, Inter type.
   ===================================================================== */
:root {
  --tw-brand: #3a57fc;
  --tw-brand-dark: #2338c4;
  --tw-brand-ink: #1a2bb0;
  --tw-link: #2e4be0;
  --tw-orange: #ff8800;
  --tw-orange-dark: #e67700;
  --tw-ink: #0f1115;
  --tw-text: #2b2f36;
  --tw-muted: #555d6b;
  --tw-subtle: #7d8491;
  --tw-bg: #f4f5f7;
  --tw-surface: #ffffff;
  --tw-surface-2: #f6f7f9;
  --tw-border: #e3e5e9;
  --tw-border-soft: #eceef1;
  --tw-green: #13894f;
  --tw-red: #d93036;
  --tw-radius: 8px;
  --tw-radius-sm: 4px;
  --tw-btn-radius: 3px;
  --tw-page: 1170px;
  --tw-font: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
}

html { background: var(--tw-bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--tw-bg) !important;
  color: var(--tw-ink) !important;
  font-family: var(--tw-font) !important;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--tw-link); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Logo ---------- */
.tw-logo { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -0.04em; line-height: 1; }
.tw-logo__mark { flex: 0 0 26px; width: 26px; height: 26px; }
.tw-logo__word b { color: var(--tw-orange); font-weight: 800; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 50; background: var(--tw-brand); color: #fff; }
.site-header__inner {
  display: flex; align-items: center; gap: 28px;
  width: min(var(--tw-page), calc(100% - 32px)); min-height: 64px; margin: 0 auto;
}
.site-header__nav { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 24px; }
.site-header__menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-header__menu a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  color: #fff; font-size: 15px; font-weight: 500; text-decoration: none; border-radius: var(--tw-btn-radius);
}
.site-header__menu a:hover, .site-header__menu a:focus-visible { background: rgb(255 255 255 / 12%); }
.site-header__menu a[aria-current="page"] { background: rgb(255 255 255 / 16%); }
.site-header__actions { display: flex; align-items: center; gap: 10px; }
.site-header__cta {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px;
  border-radius: var(--tw-btn-radius); background: #fff; color: var(--tw-brand) !important;
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.site-header__cta:hover { background: #eef1ff; }
.site-header__cta--orange { background: var(--tw-orange); color: #fff !important; }
.site-header__cta--orange:hover { background: var(--tw-orange-dark); }
.site-header__menu-toggle {
  display: none; margin-left: auto; width: 42px; height: 42px; padding: 0; border: 0;
  border-radius: var(--tw-btn-radius); background: transparent; color: #fff; cursor: pointer;
}
.site-header__menu-icon, .site-header__menu-icon::before, .site-header__menu-icon::after {
  display: block; width: 20px; height: 2px; margin: 0 auto; background: currentColor; border-radius: 2px; content: ""; transition: transform .2s ease;
}
.site-header__menu-icon { position: relative; }
.site-header__menu-icon::before { position: absolute; top: -6px; }
.site-header__menu-icon::after { position: absolute; top: 6px; }
.site-header.is-open .site-header__menu-icon { background: transparent; }
.site-header.is-open .site-header__menu-icon::before { transform: translateY(6px) rotate(45deg); }
.site-header.is-open .site-header__menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Page hero (blue band) ---------- */
.page-hero { background: var(--tw-brand); color: #fff; padding: 22px 0 92px; }
.page-hero__inner { width: min(var(--tw-page), calc(100% - 32px)); margin: 0 auto; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.breadcrumbs a { color: rgb(255 255 255 / 78%); text-decoration: none; }
.breadcrumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs .separator { color: rgb(255 255 255 / 45%); }
.breadcrumbs [aria-current="page"] { color: #fff; font-weight: 600; }
.page-hero__title {
  max-width: 900px; margin: 26px 0 0; color: #fff;
  font-size: clamp(30px, 4.4vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08;
}
.page-hero__subtitle { max-width: 760px; margin: 14px 0 0; color: rgb(255 255 255 / 86%); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.5; }
.page-hero--compact { padding-bottom: 84px; }

/* Content overlaps the blue band, like Ahrefs product shots. */
html body .page-hero ~ .wrap,
html body .page-hero ~ main.wrap,
html body .page-hero ~ .main-wrapper {
  position: relative; z-index: 2;
  width: min(var(--tw-page), calc(100% - 32px)) !important;
  max-width: var(--tw-page) !important;
  margin: -64px auto 64px !important;
  padding: 0 !important;
}
html body .page-hero ~ .wrap > .back-nav,
html body .page-hero ~ .wrap > .back-nav .back-btn {
  display: inline-flex; margin: 0 0 14px !important; padding: 0 !important;
  border: 0 !important; background: transparent !important; box-shadow: none !important;
  color: rgb(255 255 255 / 88%) !important; font-size: 13px !important; font-weight: 500 !important; text-decoration: none;
}
html body .page-hero ~ .wrap > .back-nav:hover,
html body .page-hero ~ .wrap > .back-nav .back-btn:hover { color: #fff !important; text-decoration: underline !important; text-underline-offset: 3px; }

/* Homepage: hero sits above the rankings instead of overlapping them. */
.page-hero--home { padding-bottom: 56px; }
.page-hero--home .page-hero__title { max-width: 820px; }
html body .page-hero--home ~ .main-wrapper { margin: 32px auto 64px !important; }
.page-title { color: var(--tw-ink) !important; font-weight: 700 !important; letter-spacing: -0.035em !important; }
.filter-controls-card { border-color: var(--tw-border) !important; border-radius: var(--tw-radius) !important; }
.mode-btn[aria-pressed="true"], .mode-btn.active { color: var(--tw-brand) !important; }
.domain-search-wrap:focus-within { border-color: var(--tw-brand) !important; box-shadow: 0 0 0 3px rgb(58 87 252 / 15%) !important; }
.table-container { border-color: var(--tw-border) !important; border-radius: var(--tw-radius) !important; }
.table-row:hover { background: #f7f8ff !important; }
.rank-number { color: var(--tw-muted) !important; font-weight: 600; }
.traffic-change.is-positive { color: var(--tw-green) !important; }
.traffic-change.is-negative { color: var(--tw-red) !important; }
.category-tag { border-radius: var(--tw-radius-sm) !important; }
.nav-btn { border-radius: var(--tw-btn-radius) !important; }
.nav-btn.active, .nav-btn[aria-current="page"] { background: var(--tw-brand) !important; border-color: var(--tw-brand) !important; color: #fff !important; }

/* ---------- Report cards (all three report layouts) ---------- */
html body .hero-banner, html body .editorial-card, html body .pillar-card, html body .hero-card, html body .info-card,
html body .metric-data-report, html body .competitor-card, html body .domain-section {
  border: 1px solid var(--tw-border) !important;
  border-radius: var(--tw-radius) !important;
  background: var(--tw-surface) !important;
  box-shadow: 0 1px 2px rgb(15 17 21 / 5%), 0 8px 24px rgb(15 17 21 / 4%) !important;
}
html body .hero-banner, html body .hero-card { border-top: 4px solid var(--tw-orange) !important; }
.domain-h1, .domain-info h1 { color: var(--tw-ink) !important; font-weight: 700 !important; letter-spacing: -0.035em !important; }
.site-ico, .domain-favicon { border-radius: var(--tw-radius-sm) !important; background: var(--tw-surface-2) !important; }
html body .chip, html body .badge {
  border-radius: var(--tw-radius-sm) !important; border: 1px solid var(--tw-border) !important;
  background: var(--tw-surface-2) !important; color: var(--tw-muted) !important; font-weight: 600 !important;
}
html body .chip-rank, html body .badge-country, html body .ed-tag {
  background: #fff4e5 !important; color: #b35c00 !important; border-color: #ffd9a8 !important;
}
.chip-period { color: var(--tw-subtle) !important; }
.metric-lbl, .metric-label, .box-lbl, .m-lbl, .metric-data-kpi dt {
  color: var(--tw-subtle) !important; font-size: 11px !important; font-weight: 600 !important; letter-spacing: .06em !important; text-transform: uppercase;
}
.metric-val, .metric-value, .box-val, .metric-data-kpi dd { font-family: var(--tw-font) !important; font-weight: 700 !important; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
html body .metric-card, html body .box-subtle, html body .matrix-box {
  border: 1px solid var(--tw-border-soft) !important; border-radius: 6px !important; background: var(--tw-surface-2) !important;
}
.delta-pos { color: var(--tw-green) !important; }
.delta-neg { color: var(--tw-red) !important; }
.info-card h2, .ed-title, .pillar-title-block h2, .metric-data-heading h2, .domain-summary h2 {
  color: var(--tw-ink) !important; font-weight: 700 !important; letter-spacing: -0.03em !important;
}
.metric-data-eyebrow { color: var(--tw-orange-dark) !important; }
.metric-data-source { color: var(--tw-link) !important; }
.metric-data-kpi dd.traffic { color: var(--tw-orange-dark) !important; }
.metric-data-kpi dd.backlinks { color: var(--tw-brand) !important; }
html body .metric-data-panel { border-color: var(--tw-border-soft) !important; border-radius: 6px !important; }
.domain-rating-title { color: var(--tw-subtle) !important; }
.domain-rating-value { color: var(--tw-ink) !important; }
.domain-rating-track { stroke: #f1f2f4 !important; }
.domain-rating-status { color: var(--tw-orange-dark) !important; }

/* Ahrefs-style data tables: dense, light header, blue links. */
.metric-data-table-wrap th, .clean-table th, .data-table th, .ahrefs-table th {
  background: var(--tw-surface-2) !important; color: var(--tw-muted) !important;
  font-size: 11px !important; font-weight: 600 !important; letter-spacing: .05em !important; text-transform: uppercase;
}
.metric-data-table-wrap td, .clean-table td { border-color: var(--tw-border-soft) !important; }
.metric-data-table-wrap tbody tr:hover td, .clean-table tr:hover td { background: #f7f8ff !important; }
.metric-data-table-wrap a, .clean-table a, .site-name, .action-link { color: var(--tw-link) !important; }
.serp-badge { border-radius: var(--tw-radius-sm) !important; background: #eef1ff !important; color: var(--tw-brand-dark) !important; border-color: #d5dcff !important; font-family: var(--tw-font) !important; }
html body .comp-chip { border-radius: var(--tw-radius-sm) !important; background: #fff !important; border-color: var(--tw-border) !important; color: var(--tw-link) !important; }
html body .comp-chip:hover { background: #eef1ff !important; border-color: #d5dcff !important; }
.progress-fill { background: var(--tw-orange) !important; }
.traffic-series-toggle, .traffic-chart-filters select { border-radius: var(--tw-btn-radius) !important; }
.traffic-series-toggle.is-active { border-color: var(--tw-brand) !important; color: var(--tw-brand) !important; background: #eef1ff !important; }
.traffic-series-dot { background: var(--tw-orange) !important; }
.traffic-series-dot-value { background: var(--tw-brand) !important; }
.traffic-compare-toggle input { accent-color: var(--tw-brand) !important; }
:where(a, button, input, select, summary):focus-visible { outline: 2px solid var(--tw-orange) !important; outline-offset: 2px; }

/* ---------- FAQ (Ahrefs accordion) ---------- */
.faq {
  width: 100%; max-width: var(--tw-page); margin: 32px auto 0 !important; padding: 32px;
  border: 1px solid var(--tw-border); border-radius: var(--tw-radius); background: var(--tw-surface);
  box-sizing: border-box;
}
.faq__heading { margin: 0 0 14px; color: var(--tw-ink); font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.2; }
.faq .section-desc { margin: 0 0 8px; color: var(--tw-muted); font-size: 15px; }
.faq__list { display: block; border-top: 1px solid var(--tw-border); }
.faq__item { border-bottom: 1px solid var(--tw-border); }
.faq__item > summary {
  display: flex; align-items: center; gap: 14px; padding: 18px 0; cursor: pointer; list-style: none;
  color: var(--tw-ink); font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary:hover { color: var(--tw-brand); }
.faq__icon {
  position: relative; display: inline-block; flex: 0 0 20px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--tw-orange); font-size: 0; color: transparent;
}
.faq__icon::before, .faq__icon::after {
  position: absolute; top: 50%; left: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px;
  border-radius: 1px; background: #fff; content: ""; transition: transform .2s ease;
}
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon::after { transform: rotate(0deg); }
.faq__answer { padding: 0 0 20px 34px; color: var(--tw-text); font-size: 15px; line-height: 1.7; }
.faq__answer p { margin: 0 0 10px; }
.faq__answer p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { clear: both; box-sizing: border-box; width: 100%; max-width: none; margin: 0; background: #0b0c0e; color: #c4c8cf; font-size: 14px; }
.site-footer__inner {
  display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 40px clamp(32px, 5vw, 96px);
  box-sizing: border-box; width: 100%; max-width: none; margin: 0; padding: 56px clamp(16px, 4vw, 64px) 40px;
}
.site-footer__brand p { max-width: 360px; margin: 16px 0 0; color: #9aa0aa; line-height: 1.6; }
.site-footer__col h2 { margin: 0 0 14px; color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.site-footer__col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.site-footer__col a { color: #c4c8cf; text-decoration: none; }
.site-footer__col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  box-sizing: border-box; width: 100%; max-width: none; margin: 0; padding: 20px clamp(16px, 4vw, 64px) 28px;
  border-top: 1px solid #23262b; color: #7e848e; font-size: 13px;
}
.site-footer__bottom p { margin: 0; }
.site-footer__bottom a { color: #9aa0aa; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .site-header__menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-header__inner { flex-wrap: wrap; gap: 0; }
  .site-header__nav {
    display: none; flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 8px; padding: 6px 0 16px;
  }
  .site-header.is-open .site-header__nav { display: flex; }
  .site-header__menu { flex-direction: column; align-items: stretch; }
  .site-header__menu a { width: 100%; box-sizing: border-box; min-height: 44px; }
  .site-header__actions { flex-direction: column; align-items: stretch; }
  .site-header__cta { justify-content: center; min-height: 44px; }
  .site-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .page-hero { padding: 16px 0 76px; }
  .page-hero__inner { width: calc(100% - 32px); }
  .page-hero__title { margin-top: 18px; }
  html body .page-hero ~ .wrap, html body .page-hero ~ main.wrap, html body .page-hero ~ .main-wrapper {
    width: calc(100% - 32px) !important; margin-top: -56px !important; margin-bottom: 40px !important;
  }
  html body .hero-card, html body .info-card { padding: 18px !important; }
  .faq { padding: 20px 16px; }
  .faq__item > summary { font-size: 16px; }
  .faq__answer { padding-left: 0; }
}
@media (max-width: 480px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* Profile explanations: after the metric reports, directly before FAQs. */
html body .domain-summary.domain-summary--after-metrics {
  box-sizing: border-box;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 44px !important;
  padding: 20px 20px 0 !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
}
html body .domain-summary.domain-summary--after-metrics h2 {
  max-width: 34ch;
  margin: 0 auto 20px !important;
  font-size: clamp(22px, 2.2vw, 28px) !important;
  line-height: 1.3;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-align: center;
  text-wrap: balance;
}
html body .domain-summary.domain-summary--after-metrics h3 {
  max-width: 48ch;
  margin: 32px auto 12px;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.015em;
  text-align: center;
  text-wrap: balance;
}
html body .domain-summary.domain-summary--after-metrics p {
  max-width: 76ch !important;
  margin: 0 auto !important;
  font-size: 15px !important;
  line-height: 1.8 !important;
  text-align: center;
  text-wrap: pretty;
}
html body .domain-summary.domain-summary--after-metrics p + p {
  margin-top: 16px !important;
}
html body .domain-summary.domain-summary--after-metrics .report-data-note {
  margin-top: 32px !important;
  padding-top: 24px;
  border-top: 1px solid var(--tw-border, #e2e7ee);
  font-size: 13px !important;
  line-height: 1.65 !important;
}
@media (max-width: 600px) {
  html body .domain-summary.domain-summary--after-metrics {
    margin-bottom: 32px !important;
    padding: 16px 4px 0 !important;
  }
  html body .domain-summary.domain-summary--after-metrics h3 {
    margin-top: 26px;
    font-size: 17px;
  }
  html body .domain-summary.domain-summary--after-metrics p {
    font-size: 14px !important;
    line-height: 1.75 !important;
  }
}
html body .domain-summary--after-metrics + .faq {
  margin-top: 0 !important;
}

/* One brief context note inside the report's existing metric panel. */
html body .metric-context-note {
  grid-column: 1 / -1;
  margin: 0 0 16px !important;
  padding: 0 0 14px !important;
  border-bottom: 1px solid var(--tw-border-soft, #eceef1);
  color: var(--tw-muted, #555d6b);
  font-size: 13px !important;
  font-weight: 400;
  line-height: 1.65 !important;
  text-align: left;
  overflow-wrap: anywhere;
}
html body .summary-bar > .metric-context-note {
  margin-bottom: 0 !important;
}
