.pf-article-wrap[style*="max-width"] {
  max-width: min(1320px, calc(100vw - 1rem)) !important;
}

.pf-article-inner[style*="max-width"],
.ts-home-article[style*="max-width"] {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.pf-article-inner {
  --pf-pad-x: clamp(1rem, 2.5vw, 1.65rem);
  --pf-pad-y: clamp(1.35rem, 2.5vw, 1.85rem);
  max-width: 100%;
  width: 100%;
  background: linear-gradient(180deg, var(--pf-bg-top, #fff) 0%, var(--pf-bg-bot, #f8f9ff) 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.12);
  color: var(--pf-text, #0f172a);
}

/* Panel editor HTML (headings/paragraphs without pf-block wrappers) */
.pf-article-inner > h1,
.pf-article-inner > h2,
.pf-article-inner > h3,
.pf-article-inner > h4,
.pf-article-inner > p,
.pf-article-inner > ul,
.pf-article-inner > ol,
.pf-article-inner > blockquote,
.pf-article-inner > figure,
.pf-article-inner > hr,
.pf-article-inner > .article-prose,
.pf-article-inner > .faq-section,
.pf-article-inner > .art-tip,
.pf-article-inner > .art-card-grid,
.pf-article-inner > div[class^="art-"],
.pf-article-inner > section:not(.pf-block) {
  padding-left: var(--pf-pad-x);
  padding-right: var(--pf-pad-x);
  box-sizing: border-box;
}

.pf-article-inner > h1:first-child,
.pf-article-inner > h2:first-child,
.pf-article-inner > h3:first-child,
.pf-article-inner > .article-prose:first-child,
.pf-article-inner > p:first-child {
  padding-top: var(--pf-pad-y);
}

.pf-article-inner > :last-child {
  padding-bottom: var(--pf-pad-y);
}

.pf-article-inner .article-prose {
  margin: 0;
  line-height: 1.78;
  font-size: 1rem;
  color: #374151;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding-top: var(--pf-pad-y);
  padding-bottom: 0.5rem;
}

.pf-article-inner .article-prose h2 {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 1rem;
  text-align: center;
}

.pf-article-inner .article-prose h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: #1e293b;
  margin: 1.35rem 0 0.65rem;
}

.pf-article-inner .article-prose p {
  margin: 0 0 1.1rem;
  max-width: none;
}

.pf-article-inner .article-prose ul,
.pf-article-inner .article-prose ol {
  margin: 0 0 1.1rem 1.35rem;
}

.pf-hero {
  text-align: center;
  padding: var(--pf-pad-y, 2rem) var(--pf-pad-x, 1.5rem) 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.pf-hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4f46e5;
  background: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  margin-bottom: 0.75rem;
}

.pf-hero-title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
  line-height: 1.25;
  color: #0f172a;
}

.pf-hero-sub { color: #64748b; margin: 0 0 1rem; font-size: 0.95rem; }

.pf-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.pf-seo-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  background: #fff;
  color: #4f46e5;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.pf-block {
  padding: var(--pf-pad-y, 1.75rem) var(--pf-pad-x, 1.75rem);
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}
.pf-block:last-of-type { border-bottom: none; }

.pf-block-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.pf-block-head.pf-center { justify-content: center; }
.pf-block-head span { font-size: 1.25rem; }
.pf-block-head h2 { font-size: 1.1rem; font-weight: 800; margin: 0; color: #0f172a; }

.pf-prose p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #475569;
  margin: 0 0 1rem;
}
.pf-prose p:last-child { margin-bottom: 0; }

.pf-prose-editorial p {
  font-size: 1.02rem;
  line-height: 1.88;
  color: #374151;
  margin: 0 0 1.2rem;
  letter-spacing: 0.01em;
}
.pf-prose-editorial p:last-child { margin-bottom: 0; }
.pf-prose-editorial strong,
.pf-prose-editorial .pf-kw {
  font-weight: 600;
  color: #111827;
  background: none;
  padding: 0;
}

.pf-prose strong,
.pf-prose .pf-kw,
.pf-callout strong,
.pf-summary strong,
.pf-when-card strong {
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(180deg, transparent 65%, rgba(225, 48, 108, 0.14) 65%);
  padding: 0 0.12em;
}

.pf-inline-code,
.pf-prose code {
  font-size: 0.88em;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  background: #f1f5f9;
  color: #9d174d;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid rgba(225, 48, 108, 0.12);
}
.pf-center { text-align: center; }
.pf-center p { max-width: 640px; margin-left: auto; margin-right: auto; }

.pf-columns { column-count: 1; }
@media (min-width: 720px) {
  .pf-columns { column-count: 2; column-gap: 1.5rem; }
  .pf-columns p { break-inside: avoid; }
}

.pf-when-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}
.pf-when-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.12);
}
.pf-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 8px;
}
.pf-when-card p { margin: 0; font-size: 0.85rem; line-height: 1.55; color: #475569; }

.pf-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}
.pf-feat-card {
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 14px;
  padding: 1.05rem 1.1rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.06);
}
.pf-feat-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}
.pf-feat-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #64748b;
}

.pf-prose ul,
.pf-prose-editorial ul {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
  color: #475569;
}
.pf-prose li,
.pf-prose-editorial li {
  margin: 0.4rem 0;
  line-height: 1.65;
}

.pf-faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pf-faq-narrow { max-width: 640px; margin: 0 auto; }

.pf-faq {
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 12px;
  overflow: hidden;
}
.pf-faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  list-style: none;
  color: var(--pf-heading, #0f172a);
}
.pf-faq summary::-webkit-details-marker { display: none; }
.pf-faq-chevron {
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") center/contain no-repeat;
}
.pf-faq[open] summary { color: #4f46e5; background: rgba(99, 102, 241, 0.06); }
.pf-faq-body { padding: 0 1rem 0.9rem; }
.pf-faq-body p { margin: 0; font-size: 0.88rem; line-height: 1.65; color: #64748b; }

.pf-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.pf-related-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.12);
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  transition: transform 0.2s, border-color 0.2s;
}
.pf-related-card:hover { transform: translateY(-2px); border-color: #6366f1; color: #4f46e5; }

.pf-summary {
  padding: var(--pf-pad-y, 1.75rem) var(--pf-pad-x, 1.75rem) clamp(2rem, 4vw, 2.75rem);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.08));
  text-align: center;
}
.pf-summary p { font-size: 0.92rem; line-height: 1.75; color: #475569; margin: 0 0 0.75rem; max-width: 640px; margin-left: auto; margin-right: auto; }

.pf-callout {
  padding: 1.15rem 1.25rem;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.06));
  border-left: 4px solid #6366f1;
  border-radius: 0 12px 12px 0;
  max-width: 680px;
  margin: 0 auto;
}
.pf-callout p { font-size: 0.92rem; line-height: 1.75; color: #475569; margin: 0 0 0.75rem; text-align: left; }
.pf-callout p:last-child { margin-bottom: 0; }

.pf-kw-intro {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 1rem;
  max-width: 720px;
}
.pf-kw-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.55rem;
  padding: 0.25rem 0 0.5rem;
}
.pf-kw-pill {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  color: #831843;
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.1), rgba(131, 58, 180, 0.12));
  border: 1px solid rgba(225, 48, 108, 0.22);
  border-radius: 999px;
  white-space: nowrap;
}
.pf-kw-pill:hover {
  border-color: #e1306c;
  color: #be185d;
  transform: translateY(-1px);
}

/* Dark mode — full page dark (articles + hero match site) */
html[data-theme="dark"] .pf-article-inner,
[data-theme="dark"] .pf-article-inner {
  --pf-bg-top: #14141c;
  --pf-bg-bot: #0a0a12;
  --pf-text: #f5f5f7;
  --pf-heading: #f5f5f7;
  --pf-muted: #b4b4c8;
  --pf-body: #9a9ab0;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  color: var(--pf-text);
}

html[data-theme="dark"] .pf-hero,
[data-theme="dark"] .pf-hero {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.14), rgba(64, 93, 230, 0.1));
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .pf-hero-badge,
[data-theme="dark"] .pf-hero-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #fda4cf;
  border-color: rgba(253, 29, 122, 0.35);
}

html[data-theme="dark"] .pf-hero-title,
html[data-theme="dark"] .pf-hero-sub,
html[data-theme="dark"] .pf-block-head h2,
html[data-theme="dark"] .pf-prose strong,
html[data-theme="dark"] .pf-prose-editorial strong,
[data-theme="dark"] .pf-hero-title,
[data-theme="dark"] .pf-hero-sub,
[data-theme="dark"] .pf-block-head h2,
[data-theme="dark"] .pf-prose strong,
[data-theme="dark"] .pf-prose-editorial strong {
  color: var(--pf-heading);
}

html[data-theme="dark"] .pf-prose p,
html[data-theme="dark"] .pf-prose-editorial p,
html[data-theme="dark"] .pf-when-card p,
html[data-theme="dark"] .pf-summary p,
html[data-theme="dark"] .pf-callout p,
html[data-theme="dark"] .pf-faq-body p,
[data-theme="dark"] .pf-prose p,
[data-theme="dark"] .pf-prose-editorial p,
[data-theme="dark"] .pf-when-card p,
[data-theme="dark"] .pf-summary p,
[data-theme="dark"] .pf-callout p,
[data-theme="dark"] .pf-faq-body p {
  color: var(--pf-muted);
}

html[data-theme="dark"] .pf-when-card,
html[data-theme="dark"] .pf-feat-card,
html[data-theme="dark"] .pf-faq,
html[data-theme="dark"] .pf-related-card,
[data-theme="dark"] .pf-when-card,
[data-theme="dark"] .pf-feat-card,
[data-theme="dark"] .pf-faq,
[data-theme="dark"] .pf-related-card {
  background: #16161f;
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .pf-feat-card h3,
html[data-theme="dark"] .pf-related-card,
[data-theme="dark"] .pf-feat-card h3,
[data-theme="dark"] .pf-related-card {
  color: var(--pf-heading);
}

html[data-theme="dark"] .pf-feat-card p,
[data-theme="dark"] .pf-feat-card p {
  color: var(--pf-body);
}

html[data-theme="dark"] .pf-faq summary,
[data-theme="dark"] .pf-faq summary {
  color: var(--pf-heading);
}

html[data-theme="dark"] .pf-inline-code,
html[data-theme="dark"] .pf-prose code,
[data-theme="dark"] .pf-inline-code,
[data-theme="dark"] .pf-prose code {
  background: rgba(255, 255, 255, 0.08);
  color: #fda4cf;
  border-color: rgba(253, 29, 122, 0.25);
}

html[data-theme="dark"] .pf-summary,
[data-theme="dark"] .pf-summary {
  background: linear-gradient(180deg, rgba(64, 93, 230, 0.1), rgba(225, 48, 108, 0.08));
}

html[data-theme="dark"] .pf-callout,
[data-theme="dark"] .pf-callout {
  background: linear-gradient(90deg, rgba(64, 93, 230, 0.12), rgba(131, 58, 180, 0.08));
  border-left-color: #833ab4;
}

html[data-theme="dark"] .pf-seo-tag,
[data-theme="dark"] .pf-seo-tag {
  background: rgba(255, 255, 255, 0.08);
  color: #c4b5fd;
  border-color: rgba(131, 58, 180, 0.35);
}

html[data-theme="dark"] .ts-home-article.pf-article-inner,
[data-theme="dark"] .ts-home-article.pf-article-inner {
  background: linear-gradient(180deg, #14141c 0%, #0a0a12 100%);
}

/* Light theme — article matches site */
[data-theme="light"] {
  --pf-bg-top: #ffffff;
  --pf-bg-bot: #f1f5f9;
  --pf-text: #0f172a;
  --pf-heading: #0f172a;
  --pf-muted: #475569;
  --pf-body: #64748b;
}

[data-theme="light"] .pf-article-inner {
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  border-color: rgba(131, 58, 180, 0.14);
}

/* Rich blocks from admin editor (live pages) */
.pf-article-inner .art-tip {
  background: #eff6ff;
  border-left: 4px solid #405de6;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 1rem var(--pf-pad-x);
  color: #1e3a8a;
}
.pf-article-inner .art-tip p { margin: 0; line-height: 1.7; }

.pf-article-inner .art-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem var(--pf-pad-x);
  padding: 0;
}

.pf-article-inner .art-mini-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.pf-article-inner .faq-section {
  margin: 0;
  padding-bottom: 0.5rem;
}

.pf-article-inner details.art-faq {
  margin-left: var(--pf-pad-x);
  margin-right: var(--pf-pad-x);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 0.55rem;
  background: #fff;
}

.pf-article-inner details.art-faq summary {
  padding: 0.9rem 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: #0f172a;
}

.pf-article-inner details.art-faq summary::-webkit-details-marker { display: none; }

.pf-article-inner details.art-faq .art-faq-a {
  padding: 0 1rem 1rem;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.65;
}

.pf-article-inner figure,
.pf-article-inner .art-img-card {
  margin: 1rem var(--pf-pad-x);
  padding: 0;
}

.pf-article-inner figure img,
.pf-article-inner .art-img-card img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

@media (max-width: 768px) {
  .pf-article-wrap {
    margin: 0.65rem auto 1.25rem;
    padding: 0 max(0.35rem, env(safe-area-inset-left, 0));
  }

  .pf-article-inner {
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.08);
  }

  .pf-article-inner {
    --pf-pad-x: clamp(0.85rem, 4vw, 1.15rem);
    --pf-pad-y: clamp(1rem, 3vw, 1.35rem);
  }

  .pf-block-head h2 {
    font-size: clamp(1.05rem, 4.5vw, 1.25rem);
  }

  .pf-prose,
  .pf-prose-editorial {
    font-size: 0.94rem;
    line-height: 1.65;
  }

  .pf-faq summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .pf-related-grid {
    grid-template-columns: 1fr !important;
    gap: 0.55rem;
  }

  .pf-related-card {
    min-height: 44px;
    padding: 0.75rem 0.85rem;
  }
}

