/* Shared opt-in theme. No geometry changes in the consistent variant. */
html[data-pf-theme] {
  --pf-blue:#003b73; --pf-green:#0e7a3e; --pf-page:#edf5f4; --pf-canvas:linear-gradient(135deg,#d4e6f5 0%,#d5eee3 100%);
  --pf-surface:#fff; --pf-text:#0f172a; --pf-muted:#475569;
  --pf-text-strong:#0b172a; --pf-border:#cbd5e1; --pf-ui-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
html[data-pf-theme] body { background:var(--pf-canvas)!important; color:var(--pf-text); font-family:var(--pf-ui-font)!important; }
html[data-pf-theme] body[data-pf-page="concert-planner"] { --primary:#fff; --secondary:#f1f5f9; --accent:var(--pf-blue); --accent-light:var(--pf-green); --success:var(--pf-green); --warning:#92400e; --bg:var(--pf-page); --card:#fff; --text:var(--pf-text); --text-dim:var(--pf-muted); --border:var(--pf-border); }
html[data-pf-theme] :is(h1,h2,h3,h4,h5,h6,p,label,input,select,textarea,button,summary,table,main,section,nav,a) { font-family:var(--pf-ui-font)!important; }
/* Color-only annotations adapt legacy inline CSS without changing DOM hooks. */
html:is([data-pf-theme],[data-pf-readability="default-consistent"]) [data-pf-ink] { color:var(--pf-ink)!important; }
html:is([data-pf-theme],[data-pf-readability="default-consistent"]) [data-pf-fill] { background-color:var(--pf-fill)!important; }
html:is([data-pf-theme],[data-pf-readability]) [data-pf-gradient] { background-image:var(--pf-gradient)!important; }
html:is([data-pf-theme],[data-pf-readability="default-consistent"]) [data-pf-edge] { border-color:var(--pf-edge)!important; }
html:is([data-pf-theme],[data-pf-readability]) body [data-pf-readable][data-pf-readable][data-pf-readable][data-pf-readable] { color:var(--pf-readable)!important; }
html[data-pf-theme] .cw-shell { --cw-bg:var(--pf-page); --cw-card:var(--pf-surface); --cw-text:var(--pf-text); --cw-muted:var(--pf-muted); --cw-brand:var(--pf-blue); --cw-accent:var(--pf-green); --cw-line:var(--pf-border); }
html[data-pf-theme] .about-demo { --paper:var(--pf-page); --soft:#f1f5f9; --ink:var(--pf-text); --green:var(--pf-green); --muted:var(--pf-muted); --line:var(--pf-border); }
html[data-pf-theme] .pinfin-community-home { --community-ink:var(--pf-text); --community-muted:var(--pf-muted); --community-accent:var(--pf-green); --community-wash:#f1f5f9; }
html[data-pf-theme] { --cn-green:var(--pf-green); --cn-blue:var(--pf-blue); --cn-ink:var(--pf-text); --cn-muted:var(--pf-muted); --cn-border:var(--pf-border); }
html[data-pf-theme] :is(.cw-hero,.pinfin-friends-hero,.pinfin-community-home__hero) { background:var(--pf-blue)!important; color:white!important; }
html[data-pf-theme] footer.bg-black { background:var(--pf-blue)!important; }
html[data-pf-theme] footer.bg-black :is([data-pf-ink],.text-gray-400,.text-gray-500,.text-gray-600) { color:#e2e8f0!important; }
html[data-pf-theme] :is(.group-button,.connection-button,.pinfin-friends-page button:not(.is-muted):not(.is-danger)) { background:var(--pf-blue)!important; color:#fff!important; }
html[data-pf-theme] :is(.user-dropdown,#servicesDropdown) { background:var(--pf-surface)!important; }
html[data-pf-theme] :is(button[data-pf-fill],button[data-pf-gradient],a[data-pf-gradient]):not(:disabled):hover { filter:brightness(.92); }
/* Only Full may adjust dimensions and responsive layout. */
html[data-pf-theme="full"] body { font-size:1rem; line-height:1.6; }
html[data-pf-theme="full"] h1 { font-size:clamp(1.75rem,4vw,2.5rem)!important; }
html[data-pf-theme="full"] h2 { font-size:clamp(1.375rem,3vw,1.75rem)!important; }
html[data-pf-theme="full"] h3 { font-size:1.25rem!important; }
html[data-pf-theme="full"] :is(button[data-pf-gradient],a[data-pf-gradient]) { background-image:none!important; background-color:var(--pf-blue)!important; }
html[data-pf-theme="full"] main p a { text-decoration:underline; text-underline-offset:3px; }
html[data-pf-theme="full"] *, html[data-pf-theme="full"] *::before, html[data-pf-theme="full"] *::after { box-sizing:border-box; }
html[data-pf-theme="full"] :is(.cw-grid,.h-list,.pinfin-friends-grid)>* { min-width:0; }
html[data-pf-theme="full"] :is(img,video,iframe) { max-width:100%; }
html[data-pf-theme="full"] :is(.cw-container,.pinfin-friends-page,.humsafar-wrap,.about-demo .wrap) { max-width:1200px; margin-inline:auto; padding-inline:24px; }
html[data-pf-theme="full"] :is(.jp-wrap,.lib-wrap,.doc-page-wrap,.edu-wrap,.edu-post-wrap,.biz-detail-wrap) { max-width:1200px; margin-inline:auto; padding-inline:24px; }
html[data-pf-theme="full"] :is(.cw-post:not(.cw-note),.cw-side-card,.pinfin-friends-section,.group-panel,.h-item,.settings-section,.about-demo .service) { border-radius:12px; border:1px solid var(--pf-border); box-shadow:0 2px 10px #0f172a0d; }
html[data-pf-theme="full"] :is(.cw-post:not(.cw-note),.pinfin-friends-section,.group-panel,.settings-section) { padding:24px; }
html[data-pf-theme="full"] :is(.jp-section,.jp-card,.lib-card,.doc-section,.edu-card,.edu-post-card,.edu-form,.create-card,.edit-card,.offers-card,.reviews-card,.contact-box) { border-radius:12px; border:1px solid var(--pf-border); box-shadow:0 2px 10px #0f172a0d; }
html[data-pf-theme="full"] :is(.jp-section,.doc-section,.create-card,.edit-card) { padding:24px; }
html[data-pf-theme="full"] :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]),select,textarea) { border-radius:8px; border-color:#64748b; font-size:1rem; max-width:100%; }
html[data-pf-theme="full"] :is(button:not(.cw-reaction-btn):not(.cw-help-button):not([data-about-edit]),input[type=submit],.connection-button,.group-button) { min-height:44px; }
html[data-pf-theme="full"] :is(h1,h2,h3) { line-height:1.25; }
html[data-pf-theme="full"] :is(p,dd,td,.cw-post-body) { overflow-wrap:anywhere; }
html[data-pf-theme="full"] :is(button,a,input,select,textarea,summary):focus-visible { outline:3px solid var(--pf-blue)!important; outline-offset:3px; box-shadow:0 0 0 3px white!important; }
html[data-pf-theme="full"] :is(button,a,input,select,textarea,summary) { scroll-margin-block:7rem 2rem; }
html[data-pf-theme="full"] :is(dialog,.cw-post-modal-box) { max-width:calc(100vw - 32px); max-height:85dvh; overflow:auto; border-radius:16px; }
@media(max-width:640px) {
  html[data-pf-theme="full"] :is(.cw-container,.pinfin-friends-page,.humsafar-wrap,.about-demo .wrap) { padding-inline:16px; }
  html[data-pf-theme="full"] :is(.jp-wrap,.lib-wrap,.doc-page-wrap,.edu-wrap,.edu-post-wrap,.biz-detail-wrap,.create-container,.edit-container) { padding-inline:16px; }
  html[data-pf-theme="full"] :is(.cw-post:not(.cw-note),.pinfin-friends-section,.group-panel,.settings-section) { padding:16px; }
  html[data-pf-theme="full"] :is(.jp-section,.doc-section,.create-card,.edit-card) { padding:16px; }
  html[data-pf-theme="full"] :is(.cw-grid,.h-list,.pinfin-friends-grid,.about-demo .service-grid) { grid-template-columns:minmax(0,1fr); }
  html[data-pf-theme="full"] :is(.form-row,.ep-grid) { grid-template-columns:minmax(0,1fr); }
  html[data-pf-theme="full"] :is(.cw-filter-bar,.pinfin-friends-search>div,.h-btns) { flex-wrap:wrap; }
  html[data-pf-theme="full"] .cw-side { position:static; }
  html[data-pf-theme="full"] .admin-layout { grid-template-columns:minmax(0,1fr); }
  html[data-pf-theme="full"] .admin-container { padding:16px; }
  html[data-pf-theme="full"] .admin-header { padding:16px; }
  html[data-pf-theme="full"] .logout-btn { position:static; display:inline-block; margin-top:12px; }
}
@media(prefers-reduced-motion:reduce) {
  html[data-pf-theme="full"] { scroll-behavior:auto; }
  html[data-pf-theme="full"] :is(.cw-layout-thumb,.user-dropdown) { transition:none; }
}
@media print {
  html[data-pf-theme] body { background:white!important; }
}

/* Theme 4 draws its visual language from About, without copying its content. */
html[data-pf-theme="about"] {
  --pf-blue:#145d42; --pf-green:#145d42; --pf-text:#16392c;
  --pf-muted:#52665d; --pf-border:#d9e2da; --pf-page:#faf9f5;
  --pf-canvas:#faf9f5; --pf-ui-font:Arial,Helvetica,sans-serif;
}
html[data-pf-theme="about"] .about-demo { --paper:#faf9f5; --soft:#eef2ec; --ink:#16392c; --green:#145d42; --muted:#52665d; --line:#d9e2da; --gold:#dbb96d; }
html[data-pf-theme="about"] :is(.cw-shell,.group-panel,.pinfin-community-home__filters) { background:#eef2ec!important; }
html[data-pf-theme="about"] .about-demo em { font-family:Georgia,"Times New Roman",serif; }
html[data-pf-theme="about"] .about-demo .closing { background:#174b37!important; }
html[data-pf-theme="about"] .about-demo .services-section { background:#eef2ec!important; }
/* Explicit foreground/surface pairs; no layout or control geometry changes. */
html[data-pf-theme="about"] { --pf-inverse:#fff; --pf-inverse-muted:#e2e8f0; --pf-text-strong:#0b241b; --pf-gold-text:#805d20; }
html:is([data-pf-theme],[data-pf-readability]) :is(input,textarea)::placeholder { color:var(--pf-placeholder,var(--pf-muted))!important; opacity:1; }
html[data-pf-theme="about"] :is(#cw-quill-body,#cw-edit-quill-body,#cw-reply-quill-body)[contenteditable]:empty::before { color:var(--pf-muted)!important; }
html[data-pf-theme="about"] .about-demo .values article>span { color:var(--pf-gold-text); }
html[data-pf-theme="about"] :is(.jp-btn.red,.event-link-youtube) { background:#b91c1c!important; color:#fff!important; }
html[data-pf-theme="about"] .event-badge.register-now { background:linear-gradient(135deg,#991b1b,#9a3412)!important; color:#fff!important; opacity:1!important; }
html:is([data-pf-theme],[data-pf-readability]) .hero-gradient { background:rgba(0,0,0,.65)!important; }
html[data-pf-theme="about"] .event-image { background:#145d42!important; color:#fff; }
html[data-pf-theme="about"] .event-image img { color:#fff; }

/* Default keeps its palette/layout; only contrast repairs are enabled. */
html[data-pf-readability="current"] { --pf-text:#1f2937; --pf-muted:#475569; --pf-text-strong:#0b172a; }
html[data-pf-readability="current"] :is(.user-dropdown,#servicesDropdown) { background:#fff!important; }
html[data-pf-readability="current"] .member-profile { background:transparent!important; }
html[data-pf-readability="current"] :is(.member-profile-card,.member-profile-header-card) { background:#fff!important; }
html[data-pf-theme] .member-profile { background:var(--pf-page)!important; color:var(--pf-text); border-color:var(--pf-border)!important; }
html[data-pf-theme] :is(.member-profile-card,.member-profile-header-card) { background:var(--pf-surface)!important; border-color:var(--pf-border)!important; }
html:is([data-pf-theme],[data-pf-readability]) :is(.jp-btn.red,.event-link-youtube) { background:#b91c1c!important; color:#fff!important; }

/* Default-consistent: preserve existing typography, geometry and controls. */
html[data-pf-readability="default-consistent"] { --pf-blue:#003b73; --pf-green:#0e7a3e; --pf-text:#1f2937; --pf-muted:#475569; --pf-text-strong:#0b172a; --pf-page:#fff; --pf-surface:#fff; --pf-border:#e5e7eb; }
html[data-pf-readability="default-consistent"] body { background:linear-gradient(135deg,#003b73,#0b5a2e)!important; }
html[data-pf-readability="default-consistent"] :is(.about-demo,.about-demo .principles,.about-demo .services-section,.about-demo .values-section,.about-demo .closing,.member-profile) { background:transparent!important; }
html[data-pf-readability="default-consistent"] :is(.about-demo .service,.member-profile-card,.member-profile-header-card,.user-dropdown,#servicesDropdown) { background:#fff!important; }
html[data-pf-readability="default-consistent"] .about-demo { --paper:#fff; --soft:#fff; --green:#0e7a3e; --line:#e5e7eb; }
html[data-pf-readability="default-consistent"] .about-demo .button:not(.light) { background:linear-gradient(135deg,#0e7a3e,#0076a0)!important; color:#fff; }
