/* Native order pages use the public light theme, including legacy summary rules. */
.fm-order-page .order-item{grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:14px 0}
.fm-order-page .order-item.with-image{grid-template-columns:54px minmax(0,1fr) auto}
.fm-order-page .order-item>div{min-width:0;gap:4px;overflow-wrap:anywhere}
.fm-order-page .order-item strong{font-size:15px}
.fm-order-page .order-item>b{white-space:nowrap}
.fm-order-page .order-summary b{color:inherit;font-variant-numeric:tabular-nums}
.fm-order-page .order-summary{gap:12px}
.fm-order-page form{display:grid;gap:12px}
.fm-order-page .field{margin:0}
.fm-order-page form>.btn{justify-self:start}
.fm-order-page .order-actions{display:flex;gap:10px;flex-wrap:wrap}
.fm-order-page .shadow-flash.ok,.fm-commerce-dashboard .shadow-flash.ok{background:#ecfdf5;color:#166534!important;border-color:#a7f3d0;box-shadow:0 4px 16px rgba(18,33,63,.08)}
.fm-order-page .shadow-flash.bad,.fm-commerce-dashboard .shadow-flash.bad{background:#fff1f2;color:#9f1239!important;border-color:#fecdd3;box-shadow:0 4px 16px rgba(18,33,63,.08)}
.fm-order-page .shadow-flash ul{margin:0;padding-left:20px}
.fm-commerce-dashboard nav[aria-label="หน้าคำสั่งซื้อ"]{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
@media(max-width:600px){
 .fm-order-page .order-item,.fm-order-page .order-item.with-image{grid-template-columns:minmax(0,1fr)}
 .fm-order-page .order-item>b{justify-self:end}
 .fm-order-page .hero{align-items:flex-start;flex-direction:column}
 .fm-order-page .order-actions .btn{flex:1 1 150px}
 .fm-order-page .card{padding:16px}
}

.fm-cart-item{display:flex;justify-content:space-between;gap:20px;padding:20px 0;border-bottom:1px solid #e2e8f0}
.fm-cart-item>div{min-width:0;overflow-wrap:anywhere}
.fm-cart-item-actions{display:grid;gap:12px;min-width:150px}
.fm-cart-item-actions input{max-width:150px}
.fm-cart-warning{color:#9f1239;background:#fff1f2;border-radius:8px;padding:10px}
.fm-cart-checkout{margin-top:20px}
.fm-product-page .commerce-detail-copy{min-width:0;overflow-wrap:anywhere;display:grid;gap:14px;align-content:start}
.fm-product-page .commerce-detail-copy p{margin:0}
.fm-product-description{white-space:pre-line}
.fm-product-page .commerce-detail-media{align-self:start;border-radius:14px;overflow:hidden;min-height:220px;background:#f1f5f9;display:grid;place-items:center;font-size:64px}
.fm-product-page .commerce-detail-media img{max-width:100%;height:auto;object-fit:contain}
@media(max-width:700px){.fm-cart-item{flex-direction:column}.fm-cart-item-actions{grid-template-columns:1fr 1fr;align-items:end}.fm-cart-page .two-col,.fm-product-page .commerce-detail{grid-template-columns:minmax(0,1fr)}}

/* Semantic headings come from the page; inherited replacement pseudo text must not repeat it. */
.fm-v283.fm-marketplace-page .fm-directory-head h1::after,.fm-v283.fm-community-directory-page .fm-directory-head h1::after{content:none!important}
.fm-v283.fm-marketplace-page .fm-directory-head h1,.fm-v283.fm-community-directory-page .fm-directory-head h1{font-size:20px!important}
.fm-editor-product-image{max-width:240px;width:100%;height:auto;border-radius:12px}
.fm-product-editor .two-col{gap:16px}.fm-product-editor .order-actions form{display:block}
@media(max-width:700px){.fm-product-editor .two-col{grid-template-columns:minmax(0,1fr)}}
/* Keep forms readable despite earlier compact/dark-theme overrides. */
body.fm-order-page .card{padding:24px}
body.fm-order-page .field>span{color:#475569!important;opacity:1;font-size:14px;font-weight:600;line-height:1.5}
body.fm-order-page .field input,body.fm-order-page .field select,body.fm-order-page .field textarea{color:#0f172a;background:#fff;border:1px solid #cbd5e1;min-height:42px;padding:10px 12px;font-size:15px}
body.fm-order-page p{font-size:14px;line-height:1.6}
body.fm-order-page .btn{font-size:14px;min-height:40px;padding:9px 14px}
body.fm-cart-page .two-col{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.85fr);gap:24px}
body.fm-product-editor .two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body.fm-order-page h1{font-size:24px;line-height:1.35}
body.fm-order-page h2{font-size:19px;line-height:1.4}
@media(max-width:700px){body.fm-order-page .card{padding:18px}body.fm-cart-page .two-col,body.fm-product-editor .two-col{grid-template-columns:minmax(0,1fr)}body.fm-cart-page .fm-cart-item-actions input{max-width:none}body.fm-cart-page .fm-cart-item-actions .field>span{display:block;white-space:normal}}
body.fm-product-page .commerce-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
body.fm-product-page .commerce-kpis>span{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;color:#475569;padding:12px;font-size:13px}
body.fm-product-page .commerce-kpis b{display:block;color:#0f172a;font-size:16px}
body.fm-product-page .commerce-price.big strong{font-size:28px;color:#334155}
body.fm-product-page .commerce-detail-copy p,body.fm-order-page .muted{color:#475569!important}
@media(max-width:700px){body.fm-product-page .commerce-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Keep external product cards readable in the public light interface. */
.affiliate-card,.product-tag-card{background:#fff!important;color:#172033!important;border:1px solid #dce2ec!important}
.affiliate-card strong,.affiliate-card small,.affiliate-card p,.product-tag-card strong,.product-tag-card small{color:#172033!important;white-space:normal;overflow-wrap:anywhere}
.affiliate-card b,.product-tag-card b{color:#4338ca!important;font-size:18px}
.affiliate-card img,.product-tag-card img{background:#f3f5fa;object-fit:cover}
.phase4-product-card{background:#fff!important;color:#172033!important;border:1px solid #dce2ec}
.phase4-product-card h3,.phase4-product-card h3 a,.phase4-product-card p,.phase4-product-card small{color:#172033!important;overflow-wrap:anywhere}
.phase4-product-card b{color:#4338ca!important}
.phase4-product-card .product-placeholder{background:#f3f5fa!important}
.community-phase4-head{margin-top:0!important;top:auto!important;transform:none!important;position:relative;display:flex;flex-wrap:wrap;gap:18px;padding:18px;align-items:center}
.community-phase4-copy{margin:0!important;min-width:0;flex:1 1 260px}
.community-phase4-copy h1{font-size:clamp(22px,2.5vw,34px);line-height:1.25;margin:8px 0;overflow-wrap:anywhere}
.community-phase4-actions{display:flex;flex-wrap:wrap;gap:8px}
.commerce-product,.commerce-copy{background:#fff!important;color:#172033!important}
.commerce-copy h3,.commerce-copy h3 a,.commerce-copy p,.commerce-copy small,.commerce-meta{color:#172033!important;overflow-wrap:anywhere}
.commerce-price{color:#4338ca!important;font-size:18px!important;font-weight:700}
.commerce-media{background:#f3f5fa!important;color:#4338ca!important}
.fm-single-heading h1{font-size:28px!important;line-height:1.25}
.fm-directory-head .hero-actions .btn{min-height:40px;padding:10px 16px;font-size:14px}
.commerce-search input,.commerce-search select{min-height:40px;font-size:14px}

/* Native membership and premium tools v284 */
.fm-membership-page .community-phase4-cover:not([style]){background:linear-gradient(120deg,#efeaff,#e9f0ff);height:120px}
.fm-membership-page .community-phase4-copy .stat-row,.fm-membership-page .community-phase4-copy .stat-row span{color:#526178}
.fm-membership-page .community-phase4-tabs{display:flex;flex-wrap:wrap;white-space:normal;overflow:visible;gap:6px}
.fm-membership-page .community-phase4-tabs a{color:#526178;font-size:14px;padding:9px 12px;white-space:normal}
.fm-membership-page .membership-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.fm-membership-page .membership-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;background:#fff;color:#263044;border:1px solid #e2e6ed;border-radius:18px;padding:22px;box-shadow:0 4px 18px #1c294407}
.fm-membership-page .membership-card h3,.fm-membership-page .membership-card p{margin:0;overflow-wrap:anywhere}.fm-membership-page .membership-card strong{color:#6e42d3;font-size:25px}.fm-membership-page .membership-card em,.fm-membership-page .membership-card small{color:#647084}.fm-membership-page .membership-card form{width:100%}.fm-membership-page .membership-card .btn{white-space:normal}
.fm-membership-tabs,.fm-membership-pagination{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.fm-membership-tabs a{background:#fff;color:#594099;border:1px solid #ded5f4;border-radius:12px;padding:12px 16px;text-decoration:none}
.fm-membership-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.fm-membership-row{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;border-top:1px solid #e2e6ed;padding:20px 0}.fm-membership-row>div{min-width:0}.fm-membership-row form{display:flex;gap:8px;flex-wrap:wrap}.fm-membership-row p{margin:6px 0;color:#657084}.fm-membership-message{white-space:pre-wrap;overflow-wrap:anywhere}
.fm-premium-entry{padding:24px 0;border-top:1px solid #e2e6ed}.fm-premium-entry h3{margin:0 0 14px}.fm-premium-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;color:#283347}.fm-membership-request{width:100%;border-top:1px solid #e2e6ed;padding-top:14px;margin-top:10px}.fm-membership-request summary{cursor:pointer;color:#6140b4;font-weight:600}.fm-membership-request p,.fm-membership-status{font-size:14px}.fm-membership-page .card,.fm-membership-page .membership-card{overflow-wrap:anywhere}
@media(max-width:1000px){.fm-membership-page .membership-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.fm-membership-page .membership-grid,.fm-membership-fields{grid-template-columns:1fr}.fm-membership-row{flex-direction:column}.fm-membership-row form{width:100%}.fm-membership-tabs a{flex:1 1 auto;text-align:center}.fm-membership-page .membership-card{padding:18px}}

.fm-membership-page .community-phase4-copy .stat-row b{color:#17213a}
@media(max-width:640px){.fm-membership-page .community-phase4-cover:not([style]){height:56px}.fm-membership-page .community-phase4-head{gap:16px}.fm-membership-page .community-phase4-tabs a{padding:8px 10px;min-height:40px}}

.fm-post-detail-page .shadow-file-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.fm-post-detail-page .shadow-file-row>div{flex:1;min-width:140px;overflow-wrap:anywhere}.fm-post-detail-page .shadow-files-detail{color:#17213a;background:#f5f7ff}.fm-post-detail-page .shadow-file-row strong,.fm-post-detail-page .shadow-files-title strong{color:#17213a}

html.fm-page-light{background:#f7f9ff}
.fm-public-area .post-detail-content,.fm-public-area .shadow-comment p{color:#17213a}
.fm-public-area .post-detail-head small,.fm-public-area .shadow-comment small,.fm-public-area .stage-a-comment-form small{color:#526178}
.fm-public-area .stage-a-comment-form textarea,.fm-public-area .stage-a-reply textarea{color:#17213a;background:#f8faff;border:1px solid #dce3f0}
.fm-public-area .stage-a-comment-form textarea::placeholder,.fm-public-area .stage-a-reply textarea::placeholder{color:#65728b;opacity:1}
.fm-marketplace-page .commerce-search input,.fm-marketplace-page .commerce-search select{color:#17213a}

.fm-public-area .community-phase4-cover:not([style]){background:linear-gradient(120deg,#efeaff,#e9f0ff);height:120px}
.fm-public-area .community-phase4-copy .stat-row,.fm-public-area .community-phase4-copy .stat-row span{color:#526178}.fm-public-area .community-phase4-copy .stat-row b{color:#17213a}
.fm-public-area .community-phase4-tabs{display:flex;flex-wrap:wrap;white-space:normal;overflow:visible;gap:6px}.fm-public-area .community-phase4-tabs a{color:#526178;font-size:14px;padding:9px 12px;white-space:normal}
@media(max-width:640px){.fm-public-area .community-phase4-cover:not([style]){height:56px}.fm-public-area .community-phase4-head{gap:16px}.fm-public-area .community-phase4-tabs a{padding:8px 10px;min-height:40px}}

.fm-public-area .stat-row,.fm-public-area .stat-row span{color:#526178}.fm-public-area .stat-row b{color:#17213a}
.fm-public-area .info-grid small{color:#526178}.fm-public-area .info-grid b{color:#17213a}
.fm-profile-page .profile-cover:not([style]){background:linear-gradient(120deg,#efeaff,#e9f0ff)}
.fm-profile-page .profile-copy .eyebrow{display:inline-flex;color:#5f52b6;background:#fff;border-radius:12px;padding:4px 8px}
.fm-profile-page .muted,.fm-post-detail-page .muted,.fm-order-page .muted,.fm-membership-page .muted{color:#526178}
.fm-public-area .fm-native-pager{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin:24px 0;color:#526178}
.fm-public-area .people-list strong,.fm-public-area .people-list small{overflow-wrap:anywhere}
.fm-public-area .phase4-kpis small{color:#526178}.fm-public-area .phase4-kpis b{color:#17213a}
