/* app/public/... is templates; this lives in app/static/css/public-design-system.css
   Phase 1b design system — public SaaS surface only (landing, explore, feed,
   pricing). Namespaced with `ph-` prefix and scoped under html[data-theme]
   so it never collides with the existing admin/superadmin/tenant CSS
   (design-system.css, admin.css, etc.) — see AUDIT_REPORT.md §5. */

:root {
  --ph-radius-sm: 8px;
  --ph-radius-md: 14px;
  --ph-radius-lg: 22px;
  --ph-shadow-sm: 0 2px 8px rgba(0,0,0,0.12);
  --ph-shadow-md: 0 8px 24px rgba(0,0,0,0.18);
  --ph-shadow-lg: 0 20px 60px rgba(0,0,0,0.35);
  --ph-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --ph-max-w: 1180px;
  --ph-gradient: linear-gradient(135deg, #6d5efc 0%, #a55eea 45%, #f368e0 100%);
}

html[data-theme="dark"] {
  --ph-bg: #0b0c14;
  --ph-bg-alt: #12131e;
  --ph-surface: rgba(255,255,255,0.04);
  --ph-surface-strong: rgba(255,255,255,0.07);
  --ph-border: rgba(255,255,255,0.09);
  --ph-text: #f3f3f7;
  --ph-text-dim: #a6a6b8;
  --ph-accent: #8b7bff;
  --ph-accent-2: #f368e0;
}

html[data-theme="light"] {
  --ph-bg: #fbfbfe;
  --ph-bg-alt: #f2f1f9;
  --ph-surface: rgba(20,20,40,0.035);
  --ph-surface-strong: rgba(20,20,40,0.06);
  --ph-border: rgba(20,20,40,0.10);
  --ph-text: #17172a;
  --ph-text-dim: #5c5c72;
  --ph-accent: #6d5efc;
  --ph-accent-2: #d63aad;
}

body:has(.ph-nav) { margin: 0; font-family: var(--ph-font); background: var(--ph-bg); color: var(--ph-text); -webkit-font-smoothing: antialiased; }

.ph-skip-link { position: absolute; left: -999px; top: 0; background: var(--ph-accent); color: #fff; padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0; }
.ph-skip-link:focus { left: 0; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.ph-nav { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--ph-bg) 78%, transparent); border-bottom: 1px solid var(--ph-border); }
.ph-nav-inner { max-width: var(--ph-max-w); margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 14px 24px; }
.ph-nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--ph-text); text-decoration: none; }
.ph-nav-logo { width: 36px; height: 24px; object-fit: contain; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.ph-nav-links { display: flex; gap: 22px; margin-left: 12px; flex: 1; }
.ph-nav-links a { color: var(--ph-text-dim); text-decoration: none; font-size: 0.92rem; font-weight: 500; transition: color .15s; }
.ph-nav-links a:hover { color: var(--ph-text); }
.ph-nav-actions { display: flex; align-items: center; gap: 10px; }
.ph-nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 4px; }
.ph-nav-toggle span { width: 22px; height: 2px; background: var(--ph-text); border-radius: 2px; }

.ph-theme-toggle { background: var(--ph-surface); border: 1px solid var(--ph-border); color: var(--ph-text); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 0.95rem; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.ph-btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 18px; border-radius: var(--ph-radius-sm); font-weight: 600; font-size: 0.9rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; white-space: nowrap; }
.ph-btn:hover { transform: translateY(-1px); }
.ph-btn-primary { background: var(--ph-gradient); color: #fff; box-shadow: var(--ph-shadow-sm); }
.ph-btn-ghost { color: var(--ph-text); background: transparent; }
.ph-btn-ghost:hover { background: var(--ph-surface); }
.ph-btn-outline { border-color: var(--ph-border); color: var(--ph-text); background: var(--ph-surface); }
.ph-btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--ph-radius-md); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.ph-hero { position: relative; overflow: hidden; padding: 96px 24px 80px; text-align: center; }
.ph-hero::before { content: ''; position: absolute; inset: -20% -10% auto -10%; height: 480px; background: var(--ph-gradient); opacity: 0.22; filter: blur(90px); z-index: 0; }
.ph-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.ph-eyebrow { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--ph-surface-strong); border: 1px solid var(--ph-border); font-size: 0.78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ph-accent); margin-bottom: 20px; }
.ph-hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.08; margin: 0 0 18px; font-weight: 800; letter-spacing: -0.02em; }
.ph-hero p.ph-sub { font-size: 1.1rem; color: var(--ph-text-dim); max-width: 560px; margin: 0 auto 34px; line-height: 1.55; }
.ph-hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }

.ph-hero-visual { position: relative; z-index: 1; max-width: var(--ph-max-w); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0 24px; }
.ph-floating-card { background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: var(--ph-radius-lg); padding: 18px; text-align: left; box-shadow: var(--ph-shadow-md); animation: ph-float 6s ease-in-out infinite; }
.ph-floating-card:nth-child(2) { animation-delay: 1.2s; margin-top: 26px; }
.ph-floating-card:nth-child(3) { animation-delay: 2.4s; }
@keyframes ph-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.ph-floating-card h5 { margin: 0 0 6px; font-size: 0.9rem; }
.ph-floating-card p { margin: 0; font-size: 0.78rem; color: var(--ph-text-dim); }
.ph-floating-thumb { width: 100%; height: 90px; border-radius: var(--ph-radius-sm); background: var(--ph-gradient); opacity: .5; margin-bottom: 12px; }

/* ── Sections ────────────────────────────────────────────────────────── */
.ph-section { max-width: var(--ph-max-w); margin: 0 auto; padding: 64px 24px; }
.ph-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.ph-section-head h2 { font-size: 1.7rem; margin: 0 0 6px; font-weight: 750; }
.ph-section-head p { margin: 0; color: var(--ph-text-dim); }
.ph-section-link { color: var(--ph-accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; }

.ph-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.ph-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ── Creator / project cards ─────────────────────────────────────────── */
.ph-card { background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: var(--ph-radius-md); padding: 20px; transition: transform .18s, border-color .18s, box-shadow .18s; text-decoration: none; color: var(--ph-text); display: block; }
.ph-card:hover { transform: translateY(-4px); border-color: var(--ph-accent); box-shadow: var(--ph-shadow-md); }

.ph-creator-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: var(--ph-gradient); margin-bottom: 14px; }
.ph-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.ph-card .ph-role { color: var(--ph-text-dim); font-size: 0.85rem; margin: 0 0 12px; }
.ph-tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ph-tag { font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; background: var(--ph-surface-strong); color: var(--ph-text-dim); border: 1px solid var(--ph-border); }
.ph-tag-admin { background: rgba(109,94,252,0.14); color: var(--ph-accent); border-color: rgba(109,94,252,0.35); font-weight: 600; }
.ph-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 0.78rem; color: var(--ph-text-dim); }

.ph-project-thumb { width: 100%; aspect-ratio: 16/10; border-radius: var(--ph-radius-sm); background: var(--ph-surface-strong); object-fit: cover; margin-bottom: 14px; }
.ph-project-thumb.ph-placeholder { background: var(--ph-gradient); opacity: .35; }

.ph-empty-state { text-align: center; padding: 60px 20px; color: var(--ph-text-dim); border: 1px dashed var(--ph-border); border-radius: var(--ph-radius-md); }

/* ── Pricing (reused across /pricing and landing teaser) ────────────── */
.ph-pricing-grid, .ph-grid.ph-pricing-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.ph-pricing-card { background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: var(--ph-radius-lg); padding: 28px; display: flex; flex-direction: column; position: relative; }
.ph-pricing-card.ph-popular { border-color: var(--ph-accent); box-shadow: 0 0 0 1px var(--ph-accent); position: relative; }
.ph-pricing-card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.ph-price { font-size: 2.1rem; font-weight: 800; margin: 8px 0 4px; }
.ph-price small { font-size: 0.85rem; font-weight: 500; color: var(--ph-text-dim); }
.ph-price-savings { font-size: 0.8rem; font-weight: 600; color: var(--ph-accent); margin: 0 0 8px; }
.ph-pricing-card ul { list-style: none; padding: 0; margin: 18px 0; flex: 1; }
.ph-pricing-card li { padding: 6px 0; font-size: 0.88rem; color: var(--ph-text-dim); border-top: 1px solid var(--ph-border); }
.ph-pricing-card li:first-child { border-top: none; }
.ph-plan-badge { position: absolute; top: -12px; left: 24px; background: var(--ph-accent); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.ph-billing-toggle { display: inline-flex; gap: 4px; background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: 999px; padding: 4px; }
.ph-toggle-btn { border: none; background: transparent; padding: 8px 18px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--ph-text-dim); cursor: pointer; transition: background .15s, color .15s; }
.ph-toggle-btn.active { background: var(--ph-accent); color: #fff; }
.ph-pricing-note { text-align: center; color: var(--ph-text-dim); margin-top: 24px; font-size: 0.88rem; }

/* ── Explore / feed toolbars ─────────────────────────────────────────── */
.ph-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.ph-input, .ph-select { background: var(--ph-surface); border: 1px solid var(--ph-border); color: var(--ph-text); border-radius: var(--ph-radius-sm); padding: 10px 14px; font-size: 0.9rem; font-family: inherit; }
.ph-input { flex: 1; min-width: 200px; }
.ph-pagination { display: flex; gap: 10px; justify-content: center; margin-top: 36px; }
.ph-pagination .ph-btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.ph-pagination-status { font-size: 0.82rem; color: var(--ph-text-dim); display: flex; align-items: center; padding: 0 6px; }

/* ── Project cards (explore / feed) ──────────────────────────────────── */
.ph-project-card { background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: var(--ph-radius-md); padding: 20px; transition: transform .18s, border-color .18s, box-shadow .18s; }
.ph-project-card:hover { transform: translateY(-4px); border-color: var(--ph-accent); box-shadow: var(--ph-shadow-md); }
.ph-project-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.ph-project-card h3 a { color: inherit; text-decoration: none; }
.ph-project-card .ph-creator-byline { font-size: 0.82rem; color: var(--ph-text-dim); margin: 0 0 12px; text-decoration: none; }
.ph-project-card .ph-creator-byline:hover { color: var(--ph-accent); }
.ph-project-card p.ph-project-desc { font-size: 0.86rem; color: var(--ph-text-dim); margin: 0 0 14px; line-height: 1.5; }

.ph-like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ph-surface-strong); border: 1px solid var(--ph-border);
  color: var(--ph-text-dim); border-radius: 999px; padding: 6px 12px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: color .15s, border-color .15s, transform .1s;
}
.ph-like-btn:hover { color: var(--ph-accent); border-color: var(--ph-accent); }
.ph-like-btn:active { transform: scale(0.96); }
.ph-like-btn.is-liked { color: #fff; background: var(--ph-gradient); border-color: transparent; }
.ph-like-btn:disabled { opacity: 0.6; cursor: wait; }
.ph-view-count { font-size: 0.78rem; color: var(--ph-text-dim); }

/* ── Toast (shared by public-reactions.js) ───────────────────────────── */
.ph-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  background: rgba(220, 38, 38, 0.95); color: #fff; padding: 12px 20px;
  border-radius: 999px; font-size: 0.9rem; box-shadow: var(--ph-shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 999; max-width: 90%; text-align: center;
}
.ph-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.ph-footer { border-top: 1px solid var(--ph-border); margin-top: 60px; padding: 48px 24px 24px; }
.ph-footer-inner { max-width: var(--ph-max-w); margin: 0 auto; display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 32px; }
.ph-footer-brand p { color: var(--ph-text-dim); font-size: 0.85rem; margin-top: 8px; max-width: 280px; }
.ph-footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ph-text-dim); margin: 0 0 12px; }
.ph-footer-col a { display: block; color: var(--ph-text); text-decoration: none; font-size: 0.88rem; padding: 4px 0; opacity: .85; }
.ph-footer-col a:hover { opacity: 1; }
.ph-footer-bottom { max-width: var(--ph-max-w); margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--ph-border); font-size: 0.78rem; color: var(--ph-text-dim); text-align: center; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .ph-nav-links { position: absolute; top: 100%; left: 0; right: 0; background: var(--ph-bg); flex-direction: column; padding: 16px 24px; border-bottom: 1px solid var(--ph-border); display: none; }
  .ph-nav-links.is-open { display: flex; }
  .ph-nav-toggle { display: flex; }
  .ph-nav-actions .ph-btn-outline { display: none; }
  .ph-hero-visual, .ph-grid, .ph-pricing-grid { grid-template-columns: 1fr; }
  .ph-footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) and (min-width: 861px) {
  .ph-grid, .ph-pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Legal pages used by /privacy and /terms */
.ph-legal-page { padding: 72px 24px; }
.ph-legal-shell { max-width: 920px; margin: 0 auto; }
.ph-legal-hero { text-align: center; margin-bottom: 28px; }
.ph-legal-hero h1 { margin: 12px 0 10px; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; }
.ph-legal-hero p { color: var(--ph-text-dim); margin: 0 auto; max-width: 680px; line-height: 1.6; }
.ph-legal-updated { margin-top: 12px !important; font-size: 0.86rem; opacity: .82; }
.ph-legal-card { border: 1px solid var(--ph-border); background: var(--ph-surface); border-radius: var(--ph-radius-lg); padding: clamp(22px, 4vw, 42px); box-shadow: var(--ph-shadow-md); }
.ph-legal-card h2 { margin: 1.65rem 0 0.55rem; font-size: 1.05rem; }
.ph-legal-card h2:first-child { margin-top: 0; }
.ph-legal-card p { color: var(--ph-text-dim); line-height: 1.72; margin: 0 0 0.9rem; }
.ph-legal-card a { color: var(--ph-accent); font-weight: 700; }

@media (min-width: 861px) {
  .ph-footer-inner { grid-template-columns: 2fr repeat(4, 1fr); }
}

/* ──────────────────────────────────────────────────────────────
   Modern public pricing page refresh (/pricing)
   Keeps the legacy ph-* public shell but visually aligns it with
   the current MyPortfolioHub landing page.
────────────────────────────────────────────────────────────── */
body:has(.ph-pricing-page) {
  background:
    radial-gradient(circle at 18% 8%, rgba(126, 87, 255, 0.18), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(36, 203, 255, 0.12), transparent 30%),
    var(--ph-bg);
  overflow-x: hidden;
}

.ph-nav {
  background: color-mix(in srgb, var(--ph-bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ph-border) 85%, transparent);
}

.ph-nav-inner {
  min-height: 68px;
}

.ph-nav-brand span {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ph-nav-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  filter: drop-shadow(0 10px 22px rgba(109, 94, 252, 0.22));
}

.ph-nav-links {
  justify-content: center;
  gap: clamp(12px, 1.6vw, 22px);
}

.ph-nav-links a {
  font-weight: 650;
}

.ph-nav-actions .ph-btn-primary {
  border-radius: 12px;
  padding-inline: 20px;
  color: #070812;
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6 0%, #45c9ff 100%);
}

.ph-pricing-page {
  position: relative;
  min-height: 100vh;
  padding: clamp(54px, 7vw, 92px) 20px 84px;
  isolation: isolate;
}

.ph-pricing-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.ph-pricing-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.ph-pricing-hero {
  text-align: center;
  max-width: 790px;
  margin: 0 auto clamp(30px, 5vw, 48px);
}

.ph-eyebrow-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.25);
  color: #67e8f9;
  box-shadow: 0 0 36px rgba(34, 211, 238, 0.12);
}

.ph-pricing-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 950;
  color: var(--ph-text);
}

.ph-pricing-hero p {
  margin: 0 auto;
  max-width: 680px;
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.65;
  color: var(--ph-text-dim);
}

.ph-pricing-alert {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px auto 0;
  padding: 12px 16px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--ph-text) 88%, var(--ph-text-dim));
  background: rgba(139, 123, 255, 0.10);
  border: 1px solid rgba(139, 123, 255, 0.22);
  font-size: 0.92rem;
  line-height: 1.45;
}

.ph-pricing-alert-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: rgba(139, 123, 255, 0.22);
  color: #c4b5fd;
  font-weight: 900;
}

.ph-pricing-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.ph-pricing-grid-modern {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.ph-pricing-card-modern {
  min-height: 100%;
  padding: clamp(24px, 3vw, 34px);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.072), rgba(255,255,255,0.032)),
    var(--ph-surface);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
  overflow: hidden;
}

.ph-pricing-card-modern::before {
  content: '';
  position: absolute;
  inset: 0;
  height: 5px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.8), rgba(34, 211, 238, 0.8));
  opacity: 0.0;
  transition: opacity .18s ease;
}

.ph-pricing-card-modern:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 123, 255, 0.38);
  box-shadow: 0 28px 90px rgba(0,0,0,0.32), 0 0 0 1px rgba(139, 123, 255, 0.18);
}

.ph-pricing-card-modern:hover::before,
.ph-pricing-card-modern.ph-popular::before {
  opacity: 1;
}

.ph-pricing-card-modern.ph-popular {
  border-color: rgba(139, 123, 255, 0.55);
  box-shadow: 0 30px 100px rgba(109, 94, 252, 0.18), 0 0 0 1px rgba(139, 123, 255, 0.18);
}

.ph-plan-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ph-plan-kicker {
  margin: 0 0 6px;
  color: #67e8f9;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  font-weight: 850;
}

.ph-pricing-card-modern h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  letter-spacing: -0.025em;
}

.ph-pricing-card-modern .ph-plan-badge {
  position: static;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #00ff99, #00d4ff);
  color: #061011;
  border: 0;
  box-shadow: 0 10px 28px rgba(0, 212, 255, 0.18);
}

.ph-pricing-card-modern .ph-price {
  margin: 12px 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.ph-plan-description {
  color: var(--ph-text-dim);
  font-size: 0.94rem;
  line-height: 1.6;
  min-height: 3em;
  margin: 16px 0 18px;
}

.ph-plan-features {
  display: grid;
  gap: 0;
  margin: 18px 0 28px !important;
}

.ph-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0 !important;
  border-top: 1px solid var(--ph-border);
  color: color-mix(in srgb, var(--ph-text) 82%, var(--ph-text-dim));
}

.ph-plan-features li span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 900;
}

.ph-plan-cta {
  width: 100%;
  min-height: 52px;
  gap: 10px;
  border-radius: 16px;
  margin-top: auto;
}

.ph-pricing-note-modern {
  max-width: 760px;
  margin-inline: auto;
  line-height: 1.6;
}

.ph-pricing-faq-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding: clamp(22px, 4vw, 30px);
  border-radius: 28px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
  box-shadow: var(--ph-shadow-md);
}

.ph-pricing-faq-strip > div {
  min-width: 0;
}

.ph-pricing-faq-strip h2 {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.ph-pricing-faq-strip p {
  margin: 0;
  color: var(--ph-text-dim);
  line-height: 1.55;
  max-width: 720px;
}

.ph-mini-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(139, 123, 255, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 123, 255, 0.28);
  font-weight: 900;
}

@media (max-width: 1040px) {
  .ph-pricing-grid-modern { grid-template-columns: 1fr; max-width: 720px; margin-inline: auto; }
}

@media (max-width: 860px) {
  .ph-nav-inner { gap: 12px; padding-inline: 16px; }
  .ph-nav-links { gap: 10px; background: color-mix(in srgb, var(--ph-bg) 96%, black); }
  .ph-nav-actions { margin-left: auto; }
  .ph-nav-actions .ph-theme-toggle { display: none; }
  .ph-nav-actions .ph-btn-ghost { display: none; }
  .ph-pricing-page { padding-inline: 16px; padding-top: 46px; }
  .ph-pricing-alert { border-radius: 18px; text-align: left; align-items: flex-start; }
  .ph-pricing-faq-strip { align-items: stretch; flex-direction: column; }
  .ph-pricing-faq-strip .ph-btn { width: 100%; }
}

@media (max-width: 480px) {
  .ph-nav-brand span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ph-nav-actions .ph-btn-primary { padding: 10px 14px; font-size: 0.84rem; }
  .ph-pricing-card-modern { border-radius: 22px; }
  .ph-pricing-hero h1 { font-size: clamp(2.05rem, 12vw, 3rem); }
  .ph-billing-toggle { width: 100%; }
  .ph-toggle-btn { flex: 1; }
}

/* ──────────────────────────────────────────────────────────────
   Pricing page final UI polish (fixes clipped/old-looking card area)
   ────────────────────────────────────────────────────────────── */
body:has(.ph-pricing-page) .ph-nav {
  position: sticky;
  top: 0;
  z-index: 200;
}

.ph-pricing-page {
  padding-top: clamp(72px, 8vw, 112px);
  padding-bottom: clamp(72px, 8vw, 112px);
}

.ph-pricing-shell {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vw, 34px);
}

.ph-pricing-hero {
  margin-bottom: 0;
}

.ph-pricing-grid-modern {
  width: 100%;
  margin: 0;
  align-items: stretch;
}

.ph-pricing-card-modern {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 560px;
  padding: clamp(26px, 3vw, 36px);
}

.ph-pricing-card-modern .ph-price,
.ph-pricing-card-modern .ph-price-amount {
  word-break: keep-all;
  overflow-wrap: normal;
}

.ph-plan-description {
  min-height: 0;
}

.ph-plan-features {
  flex: 1 1 auto;
  min-height: 0;
}

.ph-plan-features li {
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}

.ph-plan-cta {
  flex: 0 0 auto;
  margin-top: clamp(22px, 3vw, 32px);
  position: relative;
  z-index: 2;
}

.ph-pricing-note-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: min(720px, 100%);
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(139, 123, 255, 0.22);
  background: rgba(139, 123, 255, 0.08);
  color: color-mix(in srgb, var(--ph-text) 78%, var(--ph-text-dim));
  text-align: center;
  clear: both;
  position: relative;
  z-index: 1;
}

.ph-pricing-faq-strip {
  margin-top: 0;
}

body:has(.ph-pricing-page) .ph-footer {
  margin-top: 0;
}

@media (max-width: 1040px) {
  .ph-pricing-grid-modern {
    grid-template-columns: 1fr;
    max-width: 680px;
    margin-inline: auto;
  }

  .ph-pricing-card-modern {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .ph-pricing-page {
    padding-top: 48px;
    padding-inline: 16px;
  }

  .ph-pricing-shell {
    gap: 22px;
  }

  .ph-pricing-note-modern {
    width: 100%;
    border-radius: 18px;
    line-height: 1.5;
  }
}

@media (max-width: 520px) {
  body:has(.ph-pricing-page) .ph-nav-inner {
    flex-wrap: nowrap;
    padding: 12px 14px;
  }

  body:has(.ph-pricing-page) .ph-nav-brand {
    min-width: 0;
  }

  body:has(.ph-pricing-page) .ph-nav-brand span {
    max-width: 132px;
  }

  body:has(.ph-pricing-page) .ph-nav-actions {
    gap: 8px;
  }

  body:has(.ph-pricing-page) .ph-nav-actions .ph-btn-primary {
    min-height: 40px;
    padding: 10px 12px;
  }

  .ph-pricing-card-modern {
    padding: 22px;
    border-radius: 22px;
  }

  .ph-plan-topline {
    align-items: flex-start;
  }

  .ph-pricing-card-modern .ph-plan-badge {
    max-width: 112px;
    white-space: normal;
    text-align: center;
  }

  .ph-pricing-card-modern .ph-price {
    font-size: clamp(2rem, 12vw, 2.65rem);
  }

  .ph-plan-cta {
    min-height: 48px;
    padding-inline: 16px;
  }
}

/* ──────────────────────────────────────────────────────────────
   Pricing page deep fix — compact cards/no stretched CTA footer
   Resolves oversized bottom action panels and awkward note placement.
   ────────────────────────────────────────────────────────────── */
body:has(.ph-pricing-page) {
  overflow-x: hidden;
}

.ph-pricing-page .ph-pricing-shell {
  width: min(1160px, calc(100vw - 40px));
}

.ph-pricing-page .ph-pricing-grid-modern {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 24px);
  align-items: start;
}

.ph-pricing-page .ph-pricing-card-modern {
  min-height: 0 !important;
  height: auto !important;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: clamp(24px, 2.6vw, 32px) !important;
  overflow: visible;
}

.ph-pricing-page .ph-plan-topline {
  margin-bottom: 14px;
}

.ph-pricing-page .ph-price {
  margin: 10px 0 12px !important;
}

.ph-pricing-page .ph-plan-description {
  margin: 0 0 18px !important;
  min-height: 0 !important;
}

.ph-pricing-page .ph-plan-features {
  flex: 0 0 auto !important;
  margin: 0 0 22px !important;
}

.ph-pricing-page .ph-plan-features li {
  padding: 10px 0 !important;
}

.ph-pricing-page .ph-plan-cta {
  width: 100%;
  min-height: 48px !important;
  height: 48px !important;
  margin-top: auto !important;
  padding: 0 18px !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,0.055);
  box-shadow: none;
}

.ph-pricing-page .ph-pricing-card-modern.ph-popular .ph-plan-cta,
.ph-pricing-page .ph-plan-cta.ph-btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #45c9ff 100%);
  color: #070812;
  border-color: transparent;
  box-shadow: 0 18px 44px rgba(69, 201, 255, 0.16);
}

.ph-pricing-page .ph-pricing-note-modern {
  margin-top: 8px !important;
  margin-bottom: 6px !important;
  max-width: 620px;
  min-height: 0;
  padding: 10px 16px;
  font-size: 0.9rem;
}

.ph-pricing-page .ph-pricing-faq-strip {
  margin-top: 12px !important;
}

@media (min-width: 1041px) {
  .ph-pricing-page .ph-pricing-card-modern {
    min-height: 0 !important;
  }
}

@media (max-width: 1040px) {
  .ph-pricing-page .ph-pricing-grid-modern {
    grid-template-columns: 1fr !important;
    max-width: 680px;
    width: 100%;
  }

  .ph-pricing-page .ph-pricing-card-modern {
    min-height: 0 !important;
  }
}

@media (max-width: 560px) {
  .ph-pricing-page .ph-pricing-shell {
    width: min(100%, calc(100vw - 28px));
  }

  .ph-pricing-page .ph-pricing-card-modern {
    padding: 22px 18px !important;
    border-radius: 22px !important;
  }

  .ph-pricing-page .ph-plan-cta {
    height: 46px !important;
    min-height: 46px !important;
  }
}

/* ──────────────────────────────────────────────────────────────
   Pricing page final alignment fix — equal cards + compact CTAs
   Keeps all three desktop pricing cards the same height while making
   the Get Started button a normal, consistent CTA instead of a tall block.
   ────────────────────────────────────────────────────────────── */
.ph-pricing-page .ph-pricing-grid-modern {
  align-items: stretch !important;
}

.ph-pricing-page .ph-pricing-card-modern {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-width: 0 !important;
}

.ph-pricing-page .ph-plan-features {
  flex: 1 1 auto !important;
}

.ph-pricing-page .ph-plan-cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin-top: 22px !important;
  padding: 0 18px !important;
  border-radius: 14px !important;
  font-size: 0.95rem !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-pricing-page .ph-plan-cta span[aria-hidden="true"] {
  flex: 0 0 auto;
  margin-left: 4px;
}

.ph-pricing-page .ph-plan-cta.ph-btn-outline {
  background: rgba(255,255,255,0.055) !important;
  border: 1px solid rgba(255,255,255,0.13) !important;
  color: var(--ph-text) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

.ph-pricing-page .ph-plan-cta.ph-btn-outline:hover {
  background: rgba(139, 123, 255, 0.12) !important;
  border-color: rgba(139, 123, 255, 0.42) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,0.18) !important;
}

.ph-pricing-page .ph-pricing-card-modern.ph-popular .ph-plan-cta,
.ph-pricing-page .ph-plan-cta.ph-btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #45c9ff 100%) !important;
  color: #070812 !important;
  border: 0 !important;
  box-shadow: 0 16px 36px rgba(69, 201, 255, 0.20) !important;
}

@media (min-width: 1041px) {
  .ph-pricing-page .ph-pricing-grid-modern {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .ph-pricing-page .ph-pricing-card-modern {
    min-height: 560px !important;
  }
}

@media (max-width: 1040px) {
  .ph-pricing-page .ph-pricing-card-modern {
    height: auto !important;
    min-height: 0 !important;
  }

  .ph-pricing-page .ph-plan-features {
    flex: 0 0 auto !important;
  }
}

@media (max-width: 520px) {
  .ph-pricing-page .ph-plan-cta {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    font-size: 0.92rem !important;
  }
}
