/* PD-PAYWALL — Project Diamond palette */
:root, .pd-theme {
  --pd-navy: #021024;
  --pd-royal: #052659;
  --pd-steel: #5483B3;
  --pd-soft: #7DA0CA;
  --pd-ice: #C1E8FF;
  --pd-radius: 1.25rem;
  --pd-radius-pill: 999px;
}
.pd-theme {
  color: var(--pd-navy);
}
.pd-theme .pd-hero {
  background: linear-gradient(160deg, var(--pd-navy) 0%, var(--pd-royal) 55%, #0a3a7a 100%);
  color: var(--pd-ice);
  border-radius: var(--pd-radius);
  padding: 2rem 1.5rem;
}
.pd-theme .pd-hero h1,
.pd-theme .pd-hero .pd-title { color: #fff; }
.pd-theme .pd-hero p,
.pd-theme .pd-hero .pd-sub { color: var(--pd-ice); opacity: 0.92; }
.pd-theme .pd-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: rgba(193,232,255,0.15);
  color: var(--pd-ice);
}
.pd-theme .pd-tier-card.is-glass {
  background: rgba(255,255,255,.55) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.4);
}
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--pd-steel) 35%, transparent);
  border-radius: var(--pd-radius);
  box-shadow: 0 10px 30px rgba(2,16,36,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pd-theme .pd-tier-card.is-featured {
  border-color: var(--pd-royal);
  box-shadow: 0 14px 36px rgba(5,38,89,0.18);
}
.pd-theme .pd-tier-accent {
  height: 4px;
  width: 100%;
  background: var(--pd-steel);
}
.pd-theme .pd-price {
  color: var(--pd-royal);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pd-theme .pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--pd-radius-pill);
  font-weight: 600;
  padding: 0.7rem 1.15rem;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}
.pd-theme .pd-btn:active { transform: translateY(1px); }
.pd-theme .pd-btn-primary {
  background: var(--pd-royal);
  color: #fff;
}
.pd-theme .pd-btn-primary:hover { background: var(--pd-navy); color: #fff; }
.pd-theme .pd-btn-secondary {
  background: var(--pd-ice);
  color: var(--pd-royal);
  border-color: color-mix(in srgb, var(--pd-soft) 50%, transparent);
}
.pd-theme .pd-btn-secondary:hover {
  background: var(--pd-soft);
  color: var(--pd-navy);
}
.pd-theme .pd-btn-ghost {
  background: transparent;
  color: var(--pd-ice);
  border-color: color-mix(in srgb, var(--pd-ice) 45%, transparent);
}
.pd-theme .pd-btn-ghost:hover {
  background: rgba(193,232,255,0.12);
  color: #fff;
}
.pd-theme .pd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--pd-radius-pill);
  background: var(--pd-ice);
  color: var(--pd-royal);
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.pd-theme .pd-panel {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--pd-steel) 30%, transparent);
  border-radius: var(--pd-radius);
  padding: 1.25rem;
}
.pd-theme .pd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pd-theme .pd-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pd-royal);
  margin-bottom: 0.35rem;
}
.pd-theme .pd-input,
.pd-theme .pd-select,
.pd-theme .pd-textarea {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--pd-steel) 45%, transparent);
  border-radius: 0.9rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  color: var(--pd-navy);
}
.pd-theme .pd-input:focus,
.pd-theme .pd-select:focus,
.pd-theme .pd-textarea:focus {
  outline: 2px solid var(--pd-soft);
  border-color: var(--pd-steel);
}
.pd-theme .pd-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--pd-ice) 70%, transparent);
}
.pd-theme .pd-switch-row:last-child { border-bottom: 0; }
.pd-theme .pd-note {
  background: var(--pd-ice);
  color: var(--pd-royal);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}
.pd-theme .pd-check { color: var(--pd-steel); }
.pd-theme .pd-muted { color: color-mix(in srgb, var(--pd-navy) 55%, transparent); }
.pd-theme .pd-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.pd-theme .pd-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--pd-steel);
  padding: 0.5rem;
}
.pd-theme .pd-table td {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid color-mix(in srgb, var(--pd-ice) 80%, transparent);
  vertical-align: top;
}
.pd-theme .pd-method-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--pd-radius-pill);
  border: 1px solid color-mix(in srgb, var(--pd-steel) 40%, transparent);
  padding: 0.45rem 0.85rem;
  background: #fff;
  color: var(--pd-royal);
  font-size: 0.85rem;
  font-weight: 600;
}
.pd-theme .pd-method-pill.is-on {
  background: var(--pd-ice);
  border-color: var(--pd-soft);
}

/* PD-CONTRAST: member dashboard readability (light cards = navy text, navy = ice/white) */
.pd-theme .pd-panel, .pd-theme .pd-tier-card, .pd-theme .pd-club-card { background:#fff !important; color:#021024 !important; }
.pd-theme .pd-panel h2, .pd-theme .pd-club-card h2 { color:#052659 !important; }
.pd-theme .pd-club-card p, .pd-theme .pd-club-card div { color:#2a4466 !important; }
.pd-theme .pd-muted { color:#3d5a80 !important; }
.pd-theme .pd-panel .pd-btn-ghost, .pd-theme .pd-club-card .pd-btn-ghost { color:#052659; border-color:#5483B3; background:#fff; }
.pd-theme .pd-panel .pd-btn-ghost:hover { background:#C1E8FF; color:#021024; }
.pd-theme .pd-panel .pd-btn-ghost[style*="#052659"] { color:#C1E8FF !important; }
.pd-theme .pd-panel a.underline { color:#052659; font-weight:700; }

/* PD-UI: standalone modal (no framework .modal dependency) */
dialog.pd-modal { padding:0; border:0; background:transparent; max-width:min(560px,94vw); width:100%; max-height:90vh; overflow:auto; margin:auto; }
dialog.pd-modal:not([open]) { display:none; }
dialog.pd-modal[open] { display:block; opacity:1; visibility:visible; pointer-events:auto; }
dialog.pd-modal::backdrop { background:rgba(2,16,36,.6); }
dialog.pd-modal .pd-panel { background:#fff; color:#021024; box-shadow:0 20px 60px rgba(2,16,36,.35); }
/* PD-UI: visible switches */
.pd-switch { position:relative; display:inline-flex; align-items:center; cursor:pointer; flex-shrink:0; }
.pd-switch input { position:absolute; opacity:0; width:1px; height:1px; }
.pd-switch-track { width:46px; height:26px; border-radius:999px; background:#c7d3e3; position:relative; transition:background .15s; }
.pd-switch-track::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:transform .15s; }
.pd-switch input:checked + .pd-switch-track { background:#052659; }
.pd-switch input:checked + .pd-switch-track::after { transform:translateX(20px); }
.pd-switch input:focus-visible + .pd-switch-track { outline:2px solid #5483B3; outline-offset:2px; }
.pd-switch input:disabled + .pd-switch-track { opacity:.45; cursor:not-allowed; }
/* PD-UI: method pills are informational labels */
.pd-theme .pd-method-label { cursor:default; pointer-events:none; user-select:none; box-shadow:none; }


/* PD-PAYWALL-BUILDER */
.pd-theme .pd-tier-card.pd-style-compact .pd-price { font-size: 1.5rem; }
.pd-theme .pd-tier-card.pd-style-compact { font-size: 0.92rem; }
.pd-theme .pd-tier-card.pd-style-bold {
  border-width: 2px;
  box-shadow: 0 16px 40px rgba(5,38,89,0.22);
}
.pd-theme .pd-tier-card.pd-style-bold .pd-price { font-size: 2.1rem; }
.pd-theme .pd-builder-hero { min-height: 12rem; }
.pd-theme .pd-check { color: var(--pd-steel); }
.pd-theme details.pd-panel summary { list-style: none; }
.pd-theme details.pd-panel summary::-webkit-details-marker { display: none; }

/* PD-IMG: constrain logos/media so preview (no Tailwind) and subscribe never overflow */
.pd-theme img {
  max-width: 100%;
}
.pd-theme .pd-hero,
.pd-theme .pd-builder-hero,
.pd-theme #pd-hero,
.pd-theme #pd-media .pd-panel {
  overflow: hidden;
}
.pd-theme .pd-hero-logo,
.pd-theme #pd-hero img.pd-hero-logo,
.pd-theme .pd-builder-hero img.pd-hero-logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
  width: auto;
  max-width: min(100%, 280px);
  height: auto;
  max-height: 72px;
  object-fit: contain;
  object-position: center;
}
@media (min-width: 640px) {
  .pd-theme .pd-hero-logo,
  .pd-theme #pd-hero img.pd-hero-logo,
  .pd-theme .pd-builder-hero img.pd-hero-logo {
    max-height: 88px;
  }
}
/* Fallback when Tailwind h-20 missing (preview iframe) */
.pd-theme #pd-hero > div > img,
.pd-theme .pd-builder-hero > div > img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
  width: auto !important;
  max-width: min(100%, 280px) !important;
  height: auto !important;
  max-height: 72px !important;
  object-fit: contain !important;
}
@media (min-width: 640px) {
  .pd-theme #pd-hero > div > img,
  .pd-theme .pd-builder-hero > div > img {
    max-height: 88px !important;
  }
}
.pd-theme .pd-media-img,
.pd-theme #pd-media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
}
.pd-theme #pd-media video,
.pd-theme .pd-media-video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 420px;
}
.pd-theme .pd-testimonial-avatar,
.pd-theme #pd-testimonials img {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}
.pd-theme .pd-tier-icon,
.pd-theme .pd-tier-card img {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
}


/* PD-DASHBOARD-IMAGES: explicit dimensions independent of theme utilities. */
.pd-theme .pd-dashboard-header {
  display:flex; flex-direction:row; flex-wrap:wrap; align-items:center;
  justify-content:space-between; gap:1rem; min-width:0;
}
.pd-theme .pd-dashboard-brand {
  display:flex; align-items:center; gap:1rem; min-width:0; max-width:100%;
  flex:1 1 240px;
}
.pd-theme .pd-dashboard-heading { min-width:0; overflow-wrap:anywhere; }
.pd-theme img.pd-dashboard-wordmark {
  box-sizing:border-box; display:block; width:80px; max-width:80px;
  height:80px; max-height:80px; flex:0 0 80px; object-fit:contain;
}
.pd-theme img.pd-dashboard-icon {
  box-sizing:border-box; width:48px; max-width:48px; height:48px;
  max-height:48px; flex:0 0 48px; object-fit:contain;
}
.pd-theme img.pd-dashboard-club-image {
  display:block; width:96px; max-width:100%; height:96px; max-height:96px;
  flex:0 0 auto; object-fit:cover;
}
@media (max-width:639px) {
  .pd-theme .pd-dashboard-brand { gap:.75rem; }
  .pd-theme img.pd-dashboard-wordmark {
    width:64px; max-width:64px; height:64px; max-height:64px; flex-basis:64px;
  }
  .pd-theme img.pd-dashboard-icon { display:none; }
  .pd-theme img.pd-dashboard-club-image { width:80px; height:80px; max-height:80px; }
}


/* PD-SETTINGS-IMAGES: scoped header and branding thumbnails, not builder media. */
.pd-theme .pd-settings-header {
  display:flex; flex-direction:row; flex-wrap:wrap; align-items:center;
  justify-content:space-between; gap:1rem; min-width:0;
}
.pd-theme .pd-settings-brand {
  display:flex; align-items:center; gap:1rem; min-width:0; max-width:100%; flex:1 1 260px;
}
.pd-theme .pd-settings-heading { min-width:0; overflow-wrap:anywhere; }
.pd-theme img.pd-settings-wordmark {
  box-sizing:border-box; display:block; width:80px; max-width:80px;
  height:80px; max-height:80px; flex:0 0 80px; object-fit:contain;
}
.pd-theme img.pd-settings-panel-icon {
  box-sizing:border-box; width:36px; max-width:36px; height:36px;
  max-height:36px; flex:0 0 36px; object-fit:contain;
}
.pd-theme .pd-settings-preview-row { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; }
.pd-theme img.pd-settings-logo-preview {
  box-sizing:border-box; display:block; width:48px; max-width:48px;
  height:48px; max-height:48px; flex:0 0 48px; object-fit:contain;
}
@media (max-width:639px) {
  .pd-theme .pd-settings-brand { gap:.75rem; }
  .pd-theme img.pd-settings-wordmark {
    width:64px; max-width:64px; height:64px; max-height:64px; flex-basis:64px;
  }
}
