:root {
  --cpbt-bg: #f7f7f4;
  --cpbt-surface: #ffffff;
  --cpbt-surface-2: #f1f2ee;
  --cpbt-ink: #111111;
  --cpbt-muted: #6b6f76;
  --cpbt-soft: #a5a8ad;
  --cpbt-line: #e5e7eb;
  --cpbt-line-strong: #d1d5db;
  --cpbt-accent: #111111;
  --cpbt-radius: 22px;
  --cpbt-radius-sm: 14px;
  --cpbt-shadow: 0 18px 50px rgba(17, 24, 39, .07);
  --cpbt-max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.creatorpage-advanced-theme {
  margin: 0;
  min-height: 100vh;
  background: var(--cpbt-bg);
  color: var(--cpbt-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.015em;
  text-rendering: optimizeLegibility;
}
body.creatorpage-advanced-theme a { color: inherit; text-decoration: none; }
body.creatorpage-advanced-theme img { max-width: 100%; height: auto; }
body.creatorpage-advanced-theme button,
body.creatorpage-advanced-theme input,
body.creatorpage-advanced-theme textarea,
body.creatorpage-advanced-theme select { font: inherit; }

.cpbt-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--cpbt-line);
}
.cpbt-nav {
  width: min(100%, var(--cpbt-max));
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cpbt-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.cpbt-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--cpbt-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.cpbt-brand strong { font-size: 18px; }
.cpbt-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #34373d;
}
.cpbt-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 999px;
}
.cpbt-links a:hover { background: var(--cpbt-surface-2); color: var(--cpbt-ink); }
.cpbt-links .cpbt-nav-cta {
  margin-left: 8px;
  background: var(--cpbt-ink);
  color: #fff;
  padding-inline: 17px;
}
.cpbt-links .cpbt-nav-cta:hover { background: #000; color: #fff; }
.cpbt-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--cpbt-line);
  border-radius: 999px;
  background: #fff;
  color: var(--cpbt-ink);
  font-weight: 800;
  cursor: pointer;
}

.cpbt-main { min-height: calc(100vh - 144px); }
.cpbt-template-clean { background: var(--cpbt-bg); }
.cpbt-content {
  width: min(100%, var(--cpbt-max));
  margin: 0 auto;
  padding: 58px 22px;
}
.cpbt-page-content { max-width: 920px; }
.cpbt-page-head h1,
.cpbt-article h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: .95;
  letter-spacing: -.07em;
}
.cpbt-article {
  background: var(--cpbt-surface);
  border: 1px solid var(--cpbt-line);
  border-radius: var(--cpbt-radius);
  padding: 34px;
  box-shadow: var(--cpbt-shadow);
}
.cpbt-entry > *:first-child { margin-top: 0; }
.cpbt-entry > *:last-child { margin-bottom: 0; }
.cpbt-kicker {
  display: inline-flex;
  margin: 0 0 10px;
  color: var(--cpbt-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.cpbt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 12px 17px;
  border-radius: 999px;
  background: var(--cpbt-ink);
  color: #fff;
  font-weight: 800;
}
.cpbt-footer {
  border-top: 1px solid var(--cpbt-line);
  padding: 28px 22px;
  background: #fff;
  text-align: center;
  color: var(--cpbt-muted);
  font-size: 14px;
}
.cpbt-footer p { margin: 0; }

.cpbt-plugin-missing {
  width: min(100%, var(--cpbt-max));
  margin: 0 auto;
  padding: 70px 22px;
}
.cpbt-plugin-missing > div {
  max-width: 880px;
  padding: 44px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--cpbt-line);
  box-shadow: var(--cpbt-shadow);
}
.cpbt-plugin-missing span {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--cpbt-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.cpbt-plugin-missing h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: .96;
  letter-spacing: -.07em;
}
.cpbt-plugin-missing p {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--cpbt-muted);
  font-size: 18px;
}

/* Plugin integration shell */
.creatorpage-plugin-active .cpb-wrap {
  width: min(100%, var(--cpbt-max));
  max-width: var(--cpbt-max);
}
.creatorpage-plugin-active .cpb-landing-v2 { padding-top: 34px; padding-bottom: 54px; }
.creatorpage-plugin-active .cpb-saas-hero { margin-top: 0; }
.creatorpage-plugin-active .cpb-template-gallery { margin-bottom: 20px; }
.creatorpage-plugin-active .cpb-auth-shell { min-height: calc(100vh - 170px); }

.page-template-template-dashboard .cpbt-header,
.page-template-template-dashboard .cpbt-footer { display: none; }
.page-template-template-dashboard.creatorpage-advanced-theme { background: #f5f6f3; }
.cpbt-dashboard-template { min-height: 100vh; background: #f5f6f3; }

@media (max-width: 780px) {
  .cpbt-nav { padding: 12px 16px; }
  .cpbt-menu-button { display: inline-flex; }
  .cpbt-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 12px;
    right: 12px;
    padding: 10px;
    border: 1px solid var(--cpbt-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--cpbt-shadow);
  }
  .cpbt-links.is-open { display: grid; }
  .cpbt-links a { justify-content: space-between; width: 100%; }
  .cpbt-links .cpbt-nav-cta { margin-left: 0; justify-content: center; }
  .cpbt-content { padding: 40px 16px; }
  .cpbt-article { padding: 24px; border-radius: 20px; }
  .cpbt-plugin-missing { padding: 44px 16px; }
  .cpbt-plugin-missing > div { padding: 28px; border-radius: 22px; }
  .cpbt-footer { padding: 24px 16px; }
}
