/* Sản phẩm — module riêng: thông tin + mục tuỳ chỉnh + prompt riêng */
.zl-prods { display: none; }
.zl-app.is-products { grid-template-columns: var(--zl-nav-w) minmax(0, 1fr) !important; }
.zl-app.is-products > .zl-sidebar,
.zl-app.is-products > .zl-chat,
.zl-app.is-products > .zl-profile,
.zl-app.is-products > .zl-board,
.zl-app.is-products > .zl-autopost,
.zl-app.is-products > .zl-cmts,
.zl-app.is-products > .zl-config { display: none !important; }
.zl-app.is-products > .zl-prods { display: flex; }
@media (max-width: 820px) {
  .zl-app.is-products { grid-template-columns: minmax(0, 1fr) !important; }
}

.zl-prods {
  --ph-accent: #2563eb;
  --ph-green: #10b981;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  background: #f4f6f9;
}
.zl-prods *, .ph-ov *, .ph-toast * { box-sizing: border-box; }
.zl-prods button, .ph-ov button { font-family: inherit; }

.ph-btn { appearance: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dfe6ef; background: #fff; color: #1e293b; font: inherit; font-size: 13px; font-weight: 650; padding: 8px 14px; border-radius: 11px; cursor: pointer; white-space: nowrap; transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, color .15s; }
.ph-btn svg { flex: none; }
.ph-btn:hover { border-color: #c7d2e0; background: #f8fafc; }
.ph-btn:active { transform: scale(.97); }
.ph-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ph-btn-ghost { background: rgba(255, 255, 255, .7); }
.ph-btn-primary { background: #0f172a; border-color: #0f172a; color: #fff; box-shadow: 0 6px 16px -6px rgba(15, 23, 42, .5); }
.ph-btn-primary:hover { background: #1e293b; border-color: #1e293b; box-shadow: 0 10px 22px -8px rgba(15, 23, 42, .55); transform: translateY(-1px); }
.ph-btn-danger { color: #b91c1c; border-color: #fbd5d5; }
.ph-btn-danger:hover { border-color: #f87171; background: #fff7f7; }
.ph-btn-sm { padding: 6px 12px; font-size: 12.5px; }

.ph-scroll { flex: 1; min-height: 0; overflow: auto; }
.ph-wrap { max-width: 1180px; margin: 0 auto; padding: 26px 28px 48px; }

.ph-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; animation: phFade .35s ease both; }
.ph-hero-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #1d4ed8; background: #e8f0fe; flex: none; }
.ph-title { min-width: 0; }
.ph-title h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.ph-title p { margin: 3px 0 0; color: #64748b; font-size: 14px; }
.ph-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.ph-sec-h p.ph-stats { display: flex; flex-wrap: wrap; gap: 4px 0; }
.ph-stats span { white-space: nowrap; }
.ph-stats span + span::before { content: "·"; margin: 0 8px; color: #cbd5e1; }
.ph-stats b { color: #0f172a; font-weight: 750; }
.ph-stats b.good { color: #059669; }
.ph-stats b.mid { color: #b45309; }

.ph-hint { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid #fde7c7; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); animation: phFade .3s ease both; }
.ph-hint-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #fff7ed; color: #ea580c; flex: none; }
.ph-hint b { display: block; font-size: 14px; }
.ph-hint small { display: block; font-size: 13px; color: #64748b; margin-top: 1px; }
.ph-hint .ph-btn { margin-left: auto; }

.ph-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ph-search { display: flex; align-items: center; gap: 8px; width: min(320px, 100%); padding: 0 12px; height: 38px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #94a3b8; transition: border-color .15s, box-shadow .15s; }
.ph-search:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(59, 130, 246, .1); color: #2563eb; }
.ph-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; color: #0f172a; }

/* Cards */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ph-card { position: relative; display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: box-shadow .2s, border-color .2s, opacity .25s, filter .25s; animation: phFade .3s ease both; }
.ph-card:hover { box-shadow: 0 6px 18px -10px rgba(15, 23, 42, .22); border-color: #d3dbe6; }
.ph-card.is-off { opacity: .6; filter: grayscale(.7); }
.ph-card.is-saved { animation: phSaved 1.1s ease both; }
.ph-card-top { display: flex; align-items: center; gap: 12px; }
.ph-ava { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 17px; font-weight: 750; color: #475569; background: #eef2f7; }
.ph-card-info { flex: 1; min-width: 0; }
.ph-card-info b { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-price { display: block; margin-top: 2px; color: #0f172a; font-weight: 750; font-size: 14.5px; letter-spacing: -0.01em; }
.ph-price i { color: #94a3b8; font-weight: 600; font-size: 13px; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: #f1f4f8; color: #475569; }
.ph-tag.conv { background: #f1f4f8; color: #475569; }
.ph-tag.promo { background: #fff4ed; color: #c2410c; }
.ph-tag.more { background: #f1f4f8; color: #64748b; }
.ph-note { display: flex; gap: 8px; padding: 9px 11px; border-radius: 10px; background: #f8fafc; border: 1px solid #eef2f6; color: #334155; }
.ph-note svg { flex: none; margin-top: 2px; color: #64748b; }
.ph-note p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #334155; white-space: pre-line; }
.ph-card-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid #f1f4f8; }
.ph-ring { --c: #f97316; width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #eef2f7 0); transition: background .3s; }
.ph-ring.mid { --c: #f59e0b; }
.ph-ring.good { --c: #10b981; }
.ph-ring span { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #334155; }
.ph-ring-txt { flex: 1; min-width: 0; }
.ph-ring-txt b { display: block; font-size: 13.5px; font-weight: 750; }
.ph-ring-txt small { display: block; font-size: 12.5px; color: #94a3b8; margin-top: 1px; }
.ph-edit { appearance: none; display: inline-flex; align-items: center; gap: 2px; border: 0; background: #f4f6f9; color: #0f172a; font: inherit; font-size: 13.5px; font-weight: 700; padding: 7px 8px 7px 12px; border-radius: 10px; cursor: pointer; transition: background .15s, gap .2s; }
.ph-edit:hover { background: #e9edf3; gap: 5px; }
.ph-card-add { appearance: none; align-items: center; justify-content: center; gap: 10px; min-height: 160px; border: 1.5px dashed #d5dde8; background: transparent; box-shadow: none; color: #64748b; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.ph-card-add span { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: #fff; border: 1px solid #e2e8f0; transition: transform .25s cubic-bezier(.3, 1.5, .5, 1), background .2s, color .2s; }
.ph-card-add:hover { border-color: #0f172a; color: #0f172a; background: #fff; }
.ph-card-add:hover span { transform: rotate(90deg) scale(1.05); background: #0f172a; color: #fff; border-color: #0f172a; }
/* Shop switcher */
.ph-shops { margin: 0 0 18px; }
.ph-shops-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.ph-shops-h b { font-size: 12.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.ph-shops-h small { font-size: 12.5px; color: #94a3b8; }
.ph-shop-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ph-shop { appearance: none; position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid #e3e8ef; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: border-color .15s, box-shadow .15s, background .15s; }
.ph-shop:hover { border-color: #cbd5e1; }
.ph-shop:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.ph-shop.is-active { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); background: #f7faff; }
.ph-shop-ava { width: 36px; height: 36px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 750; font-size: 15px; color: #475569; background: #eef2f7; }
.ph-shop-ava.has-img { background: #f1f5f9; padding: 0; overflow: hidden; }
.ph-shop-ava.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-sec-title { display: flex; align-items: center; gap: 12px; }
.ph-sec-title > div { min-width: 0; }
.ph-sec-ava { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
.ph-shop-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; padding-right: 18px; }
.ph-shop-txt b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-shop-txt small { font-size: 12.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-shop-txt small em { font-style: normal; font-weight: 700; color: #0f172a; }
.ph-shop-pages { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-shop-del { appearance: none; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: #94a3b8; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.ph-shop:hover .ph-shop-del, .ph-shop:focus-within .ph-shop-del { opacity: 1; }
.ph-shop-del:hover { background: #fee2e2; color: #dc2626; }
.ph-shop-new { border-style: dashed; border-color: #cbd5e1; background: transparent; }
.ph-shop-new .ph-shop-ava { background: transparent; color: #64748b; }
.ph-shop-new:hover { border-color: #94a3b8; background: #fff; }
@media (hover: none) { .ph-shop-del { opacity: 1; } }

/* Sections */
.ph-sec-h { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 10px 0 16px; }
.ph-sec-h > div { flex: 1; min-width: 220px; }
.ph-sec-h h3 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.25; color: #0f172a; }
.ph-sec-h p { margin: 4px 0 0; color: #64748b; font-size: 13.5px; line-height: 1.5; }
.ph-sec-demo { align-items: center; margin-top: 32px; padding-top: 22px; border-top: 1px solid #e5eaf1; }

.ph-ind-ico { --c: #2563eb; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.ph-ind-ico.lg { width: 46px; height: 46px; border-radius: 14px; color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); box-shadow: 0 10px 24px -10px var(--c); }

/* Folder (ngành có trên 2 sản phẩm) */
.ph-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 14px; }
.ph-folder { appearance: none; position: relative; display: flex; flex-direction: column; gap: 12px; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; animation: phRise .42s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
.ph-folder-stack { position: relative; display: block; }
.ph-folder-stack::before, .ph-folder-stack::after { display: none; }
.ph-folder-stack::before, .ph-folder-stack::after { content: ""; position: absolute; left: 10%; right: 10%; height: 20px; border-radius: 14px 14px 0 0; background: #fff; border: 1px solid #e3e9f1; border-bottom: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.ph-folder-stack::before { top: 0; left: 16%; right: 16%; background: #f1f4f8; }
.ph-folder-stack::after { top: 5px; left: 8%; right: 8%; background: #f8fafc; }
.ph-folder-cover { position: relative; z-index: 1; display: grid; gap: 3px; aspect-ratio: 4 / 3; padding: 3px; border-radius: 18px; background: #fff; border: 1px solid #e3e9f1; overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 28px -18px rgba(15, 23, 42, .3); transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.ph-folder-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; min-height: 0; transition: transform .5s ease; }
.ph-folder-cover.n1 { grid-template-columns: 1fr; }
.ph-folder-cover.n2 { grid-template-columns: 1fr 1fr; }
.ph-folder-cover.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.ph-folder-cover.n3 img:first-child { grid-row: 1 / 3; }
.ph-folder-cover.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.ph-folder-cover img:first-child { border-top-left-radius: 15px; }
.ph-folder-play { position: absolute; right: 10px; bottom: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 23, 42, .72); color: #fff; backdrop-filter: blur(4px); }
.ph-folder:hover .ph-folder-cover { box-shadow: 0 6px 18px -10px rgba(15, 23, 42, .3); border-color: #cbd5e1; }
.ph-folder:hover .ph-folder-stack::before { transform: translateY(-6px) rotate(-2deg); }
.ph-folder:hover .ph-folder-stack::after { transform: translateY(-3px) rotate(1.5deg); }
.ph-folder-meta { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.ph-folder-meta b { display: block; font-size: 15.5px; font-weight: 750; }
.ph-folder-meta small { display: block; font-size: 13px; color: #64748b; }
.ph-folder-foot { display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.ph-folder-foot em { font-style: normal; font-size: 12.5px; font-weight: 650; color: #475569; background: #eef2f7; padding: 3px 8px; border-radius: 7px; }
.ph-folder-foot i { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #94a3b8; transition: all .2s; }
.ph-folder:hover .ph-folder-foot i { background: #0f172a; color: #fff; transform: translateX(2px); }
.ph-flat-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; }
.ph-flat-h .ph-ind-ico { width: 28px; height: 28px; border-radius: 9px; }
.ph-flat-h small { color: #64748b; }

/* Folder view */
.ph-back { appearance: none; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 6px 8px 6px 2px; margin-bottom: 10px; color: #475569; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; border-radius: 8px; transition: color .15s, gap .2s; }
.ph-back:hover { color: #0f172a; gap: 7px; }
.ph-folder-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-bottom: 20px; animation: phRise .4s ease both; }
.ph-folder-top.no-video { grid-template-columns: minmax(0, 1fr); }
.ph-video { margin: 0; border-radius: 20px; overflow: hidden; background: #0f172a; box-shadow: 0 16px 36px -20px rgba(15, 23, 42, .55); }
.ph-video video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0f172a; }
.ph-video figcaption { display: flex; align-items: center; gap: 6px; padding: 10px 14px; color: #cbd5e1; font-size: 12.5px; font-weight: 600; }
.ph-shopinfo { padding: 16px 18px; background: #fff; border: 1px solid #e8edf4; border-radius: 20px; overflow: auto; max-height: 360px; }
.ph-shopinfo h4 { margin: 0 0 10px; font-size: 13.5px; font-weight: 800; }
.ph-shopinfo dl { margin: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 12px; font-size: 12.5px; }
.ph-shopinfo dt { color: #94a3b8; font-weight: 650; }
.ph-shopinfo dd { margin: 0; color: #334155; line-height: 1.5; }
.ph-shopinfo details { margin-top: 12px; font-size: 12.5px; }
.ph-shopinfo summary { cursor: pointer; font-weight: 700; color: #2563eb; }
.ph-shopinfo details p { white-space: pre-line; color: #475569; line-height: 1.55; margin: 8px 0 0; }

/* Cover ảnh trên thẻ */
.ph-cover { position: relative; margin: -16px -16px 2px; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 19px 19px 0 0; background: #f1f5f9; }
.ph-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.ph-card:hover .ph-cover img { transform: scale(1.05); }
.ph-cover-tag { position: absolute; left: 10px; bottom: 10px; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(15, 23, 42, .55); backdrop-filter: blur(4px); padding: 3px 8px; border-radius: 6px; }
.ph-card .ph-cover + .ph-card-top .ph-sw { align-self: flex-start; }
.ph-desc { margin: 0; font-size: 13.5px; color: #475569; line-height: 1.55; }
.ph-facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 10px; font-size: 13px; }
.ph-facts:empty { display: none; }
.ph-facts dt { color: #94a3b8; font-weight: 650; white-space: nowrap; }
.ph-facts dd { margin: 0; color: #334155; }
.ph-more { margin-top: -4px; }
.ph-more summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; font-weight: 700; color: #2563eb; padding: 2px 0; user-select: none; }
.ph-more summary::-webkit-details-marker { display: none; }
.ph-more summary::after { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.ph-more[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.ph-more[open] summary { margin-bottom: 6px; }
.ph-more[open] .ph-facts { animation: phRise .3s ease both; }
.ph-demo-badge { font-size: 12.5px; font-weight: 650; color: #94a3b8; flex: 1; }
.ph-card-demo > .ph-card-info { flex: none; }
.ph-card-demo .ph-edit svg { margin-right: 4px; }

/* Ảnh trong form */
.ph-img { margin-bottom: 12px; border-radius: 14px; transition: box-shadow .2s; }
.ph-img.is-drag { box-shadow: 0 0 0 3px #3b82f6; }
.ph-img-empty { appearance: none; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px; border: 1.5px dashed #cbd5e1; border-radius: 14px; background: linear-gradient(135deg, #f8fafc, #fff); color: #475569; font: inherit; cursor: pointer; transition: all .2s; }
.ph-img-empty span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #eff6ff; color: #2563eb; margin-bottom: 4px; transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.ph-img-empty b { font-size: 13px; }
.ph-img-empty small { font-size: 11.5px; color: #94a3b8; text-align: center; }
.ph-img-empty:hover { border-color: #3b82f6; background: #f8fbff; }
.ph-img-empty:hover span { transform: scale(1.08) rotate(-4deg); }
.ph-img.has-img { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #f1f5f9; animation: phPop .3s ease both; }
.ph-img.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-img-acts { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.ph-img-acts button { appearance: none; display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 6px 10px; border-radius: 9px; background: rgba(15, 23, 42, .7); color: #fff; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; backdrop-filter: blur(4px); transition: background .15s; }
.ph-img-acts button:hover { background: rgba(15, 23, 42, .9); }

.ph-none { grid-column: 1 / -1; padding: 30px; text-align: center; color: #94a3b8; }

/* Switch */
.ph-sw { position: relative; display: inline-flex; flex: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ph-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ph-sw-track { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #cbd5e1; box-shadow: inset 0 1px 3px rgba(15, 23, 42, .18); transition: background .3s ease, box-shadow .3s ease; }
.ph-sw-thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: transparent; box-shadow: 0 2px 5px rgba(15, 23, 42, .25); transition: transform .38s cubic-bezier(.68, -0.4, .27, 1.4), width .2s ease, color .2s ease; }
.ph-sw:active .ph-sw-thumb { width: 25px; }
.ph-sw input:checked + .ph-sw-track { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 4px rgba(16, 185, 129, .14); }
.ph-sw input:checked + .ph-sw-track .ph-sw-thumb { transform: translateX(20px); color: #10b981; }
.ph-sw:active input:checked + .ph-sw-track .ph-sw-thumb { transform: translateX(15px); }
.ph-sw input:focus-visible + .ph-sw-track { outline: 2px solid #93c5fd; outline-offset: 2px; }
.ph-sw-lg .ph-sw-track { width: 56px; height: 30px; }
.ph-sw-lg .ph-sw-thumb { width: 26px; height: 26px; }
.ph-sw-lg:active .ph-sw-thumb { width: 32px; }
.ph-sw-lg input:checked + .ph-sw-track .ph-sw-thumb { transform: translateX(26px); }
.ph-sw-lg:active input:checked + .ph-sw-track .ph-sw-thumb { transform: translateX(20px); }

.ph-empty { text-align: center; padding: 52px 20px; background: #fff; border: 1.5px dashed #d3deeb; border-radius: 18px; animation: phRise .4s ease both; }
.ph-empty-ico { width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; color: #ea580c; background: linear-gradient(135deg, #fff7ed, #ffedd5); animation: phFloat 3s ease-in-out infinite; }
.ph-empty b { font-size: 15px; }
.ph-empty p { margin: 6px 0 16px; color: #526071; }

/* Editor */
.ph-ov { position: fixed; inset: 0; z-index: 1200; background: rgba(15, 23, 42, 0); display: flex; justify-content: flex-end; transition: background .25s ease; }
.ph-ov[hidden] { display: none; }
.ph-ov.is-open { background: rgba(15, 23, 42, 0.38); backdrop-filter: blur(2px); }
.ph-panel { width: min(580px, 100%); height: 100%; background: #f8fafc; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(15, 23, 42, 0.2); color: #0f172a; font-size: 13.5px; transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.ph-ov.is-open .ph-panel { transform: none; }
.ph-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 12px; background: #fff; border-bottom: 1px solid #e2e9f2; }
.ph-panel-head > div { flex: 1; min-width: 0; }
.ph-panel-head h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.ph-x { appearance: none; border: 0; background: #f1f5f9; width: 32px; height: 32px; border-radius: 10px; font-size: 20px; line-height: 1; color: #64748b; cursor: pointer; transition: background .15s, transform .2s; }
.ph-x:hover { background: #e2e8f0; transform: rotate(90deg); }

.ph-meter { display: flex; align-items: center; gap: 10px; }
.ph-meter-bar { flex: 1; max-width: 200px; height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.ph-meter-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f97316, #fb923c); transition: width .45s cubic-bezier(.2, .8, .2, 1), background .3s; }
.ph-meter-bar i.mid { background: linear-gradient(90deg, #f59e0b, #facc15); }
.ph-meter-bar i.good { background: linear-gradient(90deg, #10b981, #34d399); }
.ph-meter span { font-size: 11.5px; font-weight: 700; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ph-panel-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.ph-step { background: #fff; border: 1.5px solid #e8eef6; border-radius: 16px; padding: 14px; transition: border-color .2s, box-shadow .2s; opacity: 0; transform: translateY(10px); }
.ph-ov.is-open .ph-step { animation: phRise .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(120ms + var(--i, 0) * 60ms); }
.ph-step:focus-within { border-color: #bfdbfe; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.06); }
.ph-step-h { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.ph-step-n { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 3px 8px rgba(37, 99, 235, .25); transition: transform .25s; }
.ph-step:focus-within .ph-step-n { transform: scale(1.1) rotate(-6deg); }
.ph-step-h h4 { margin: 2px 0 0; font-size: 14px; font-weight: 800; }
.ph-step-h p { margin: 2px 0 0; color: #64748b; font-size: 12px; line-height: 1.45; }

.ph-panel-body input:not([type="checkbox"]), .ph-panel-body textarea { width: 100%; border: 1.5px solid #e2e9f2; border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 13px; color: #0f172a; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.ph-panel-body input:not([type="checkbox"]):focus, .ph-panel-body textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.ph-panel-body textarea { resize: vertical; line-height: 1.5; }
.ph-panel-body input.ph-name { font-size: 17px; font-weight: 800; padding: 8px 2px 10px; border-width: 0 0 2px; border-radius: 0; background: transparent; }
.ph-panel-body input.ph-name:focus { box-shadow: none; border-color: #2563eb; }
.ph-name.shake { animation: phShake .4s ease; border-color: #f87171 !important; }
.ph-price-wrap { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; padding: 4px 4px 4px 12px; border: 1.5px solid #fed7aa; border-radius: 12px; background: linear-gradient(135deg, #fff7ed, #fff); }
.ph-price-wrap span { font-size: 12px; font-weight: 800; color: #c2410c; }
.ph-panel-body .ph-price-wrap input { border: 0; background: transparent; font-size: 15px; font-weight: 800; color: #ea580c; box-shadow: none; padding: 7px 8px; }
.ph-fld { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.ph-fld > span { font-size: 12px; font-weight: 700; color: #475569; }
.ph-fld > span small { font-weight: 600; color: #94a3b8; }

.ph-chip-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 5px 8px; border: 1.5px solid #e2e9f2; border-radius: 10px; background: #fff; cursor: text; transition: border-color .15s, box-shadow .15s; }
.ph-chip-in:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.ph-chip-list { display: contents; }
.ph-chip-t { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 700; animation: phPop .25s cubic-bezier(.3, 1.5, .5, 1) both; }
.ph-chip-t button { appearance: none; border: 0; background: rgba(37, 99, 235, .12); color: inherit; width: 18px; height: 18px; border-radius: 50%; font-size: 13px; line-height: 1; cursor: pointer; transition: background .15s; }
.ph-chip-t button:hover { background: rgba(37, 99, 235, .25); }
.ph-panel-body .ph-chip-in input { flex: 1; min-width: 120px; border: 0; padding: 4px 2px; box-shadow: none; }

.ph-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ph-sg { appearance: none; border: 1.5px dashed #cbd5e1; background: #fff; color: #475569; font: inherit; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; cursor: pointer; transition: all .18s; }
.ph-sg:hover { border-style: solid; border-color: #2563eb; color: #1d4ed8; background: #eff6ff; transform: translateY(-1px); }
.ph-sg:active { transform: scale(.95); }
.ph-sg-new { border-color: #c4b5fd; color: #6d28d9; }

.ph-extras { display: flex; flex-direction: column; gap: 6px; }
.ph-extra { display: grid; grid-template-columns: 130px minmax(0, 1fr) 30px; gap: 6px; animation: phSlide .28s ease both; }
.ph-panel-body .ph-extra input[data-ex="label"] { font-weight: 700; background: #f8fafc; }
.ph-extra-x { appearance: none; border: 0; background: none; color: #94a3b8; font-size: 18px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.ph-extra-x:hover { background: #fef2f2; color: #dc2626; }

.ph-prompt-in.flash { animation: phFlash .7s ease; }
.ph-cnt { text-align: right; font-size: 11px; color: #94a3b8; margin-top: 4px; }

.ph-conv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ph-conv-opt { appearance: none; display: flex; align-items: center; gap: 9px; text-align: left; border: 1.5px solid #e2e9f2; background: #fff; color: #334155; font: inherit; font-size: 12.5px; font-weight: 700; padding: 10px; border-radius: 12px; cursor: pointer; transition: all .2s cubic-bezier(.2, .8, .2, 1); }
.ph-conv-opt:hover { border-color: #a7f3d0; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(15, 40, 80, .07); }
.ph-conv-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #f1f5f9; color: #64748b; transition: all .2s; }
.ph-conv-opt.on { border-color: #10b981; background: #ecfdf5; color: #065f46; box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
.ph-conv-opt.on .ph-conv-ico { background: #10b981; color: #fff; transform: scale(1.06); }

.ph-ch-empty { padding: 14px; border: 1.5px dashed #e2e8f0; border-radius: 12px; color: #94a3b8; font-size: 12px; text-align: center; }
.ph-onoff { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 12px; background: #f8fafc; }
.ph-onoff b { display: block; font-size: 13px; }
.ph-onoff small { display: block; color: #64748b; font-size: 11.5px; margin-top: 2px; }

.ph-panel-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 18px; background: #fff; border-top: 1px solid #e2e9f2; flex-wrap: wrap; }
.ph-panel-foot .ph-btn-danger { margin-right: auto; }
.ph-err { color: #b91c1c; font-size: 12px; font-weight: 700; margin-right: auto; animation: phFade .2s ease; }
.ph-err:empty { display: none; }
.ph-err:not(:empty) + .ph-btn-danger { margin-right: 0; }

.ph-toast { position: fixed; left: 50%; bottom: 24px; z-index: 1300; display: flex; align-items: center; gap: 8px; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3); animation: phToastIn .35s cubic-bezier(.3, 1.4, .5, 1) both; }
.ph-toast svg { color: #34d399; flex: none; }
.ph-toast.out { animation: phToastOut .3s ease both; }

@keyframes phRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes phFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes phPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes phSlide { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes phShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes phFlash { 0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .35); } 100% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); } }
@keyframes phSaved { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .45); border-color: #10b981; } 100% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); } }
@keyframes phPulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); } 70%, 100% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } }
@keyframes phFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes phToastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes phToastOut { to { opacity: 0; transform: translate(-50%, 10px); } }
.ph-toast { transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) {
  .zl-prods *, .ph-ov *, .ph-toast { animation: none !important; transition: none !important; }
  .ph-step { opacity: 1; transform: none; }
}

@media (max-width: 1024px) {
  .ph-folder-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .ph-wrap { padding: 16px 12px 96px; }
  .ph-hero-ico { width: 40px; height: 40px; }
  .ph-title h2 { font-size: 19px; }
  .ph-sec-h h3 { font-size: 18px; }
  .ph-sec-h p { font-size: 13.5px; }
  .ph-actions { margin-left: 0; width: 100%; }
  .ph-actions .ph-btn-primary { margin-left: auto; }
  .ph-hint { flex-wrap: wrap; }
  .ph-grid { grid-template-columns: minmax(0, 1fr); }
  .ph-folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .ph-shop-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .ph-shop { scroll-snap-align: start; }
  .ph-ov { align-items: flex-end; }
  .ph-panel { width: 100%; height: 92vh; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .ph-extra { grid-template-columns: 100px minmax(0, 1fr) 28px; }
  .ph-conv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Cấu hình → Shop & Page */
#sa-sp-root { contain: inline-size; }
.sa-sp-steps { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; margin-top: 6px; }
.sa-sp-col { display: flex; flex-direction: column; min-width: 0; background: #f8fafc; border: 1px solid #e7ecf3; border-radius: 16px; padding: 12px; }
.sa-sp-col-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sa-sp-col-h b { font-size: 13.5px; font-weight: 800; flex: 1; }
.sa-sp-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: #0f172a; }
.sa-sp-link { appearance: none; border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 12px; font-weight: 700; color: #2563eb; cursor: pointer; border-radius: 6px; }
.sa-sp-link:hover { background: #eff6ff; }
.sa-sp-list { display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow: auto; padding: 2px; }
.sa-sp-shop, .sa-sp-prod, .sa-sp-ch { appearance: none; position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 1px solid #e3e9f1; border-radius: 12px; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s, transform .15s; }
.sa-sp-shop:hover, .sa-sp-prod:hover, .sa-sp-ch:hover { border-color: #cbd5e1; transform: translateX(2px); }
.sa-sp-shop.is-on, .sa-sp-prod.is-on, .sa-sp-ch.is-on { border-color: #3b82f6; background: #f5f9ff; box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.sa-sp-prod input, .sa-sp-ch input { position: absolute; opacity: 0; pointer-events: none; }
.sa-sp-prod:focus-within, .sa-sp-ch:focus-within { outline: 2px solid #93c5fd; outline-offset: 1px; }
.sa-sp-prod.is-off { opacity: .55; cursor: not-allowed; transform: none; }
.sa-sp-ava, .sa-sp-thumb { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(140deg, hsl(var(--h) 70% 62%), hsl(calc(var(--h) + 30) 65% 48%)); }
img.sa-sp-ava { object-fit: cover; background: #f1f5f9; }
.sa-sp-prod img { width: 34px; height: 34px; flex: none; border-radius: 10px; object-fit: cover; }
.sa-sp-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sa-sp-txt b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-sp-txt small { font-size: 11.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-sp-txt small.is-bound { color: #059669; font-weight: 650; }
.sa-sp-radio { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid #cbd5e1; transition: border .15s; }
.sa-sp-shop.is-on .sa-sp-radio { border: 6px solid #3b82f6; }
.sa-sp-check { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid #cbd5e1; display: grid; place-items: center; color: transparent; transition: all .15s; }
.is-on > .sa-sp-check { background: #3b82f6; border-color: #3b82f6; color: #fff; animation: phPop .25s ease; }
.sa-sp-ch-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px; }
.sa-sp-ch-ico.fb { background: linear-gradient(140deg, #3b82f6, #7c3aed); }
.sa-sp-ch-ico.zalo { background: #0068ff; }
.sa-sp-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 6px; font-size: 12.5px; color: #64748b; }
.sa-sp-apply { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(120deg, #eff6ff, #f5f3ff); border: 1px solid #dbe5ff; }
.sa-sp-apply p { flex: 1; margin: 0; font-size: 13px; color: #334155; min-width: 200px; }
.sa-sp-apply .oa-crm-btn:disabled { opacity: .5; cursor: not-allowed; }
.sa-sp-running { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.sa-sp-running.is-empty { font-size: 12.5px; color: #64748b; padding: 10px 2px; }
.sa-sp-running-h { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.sa-sp-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e3e9f1; border-radius: 14px; background: #fff; animation: phRise .3s ease both; }
.sa-sp-row.is-edit { border-color: #3b82f6; }
.sa-sp-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sa-sp-acts .oa-crm-btn { padding: 6px 10px; font-size: 12px; }
.sa-sp-danger { color: #b91c1c !important; }
@media (max-width: 1024px) {
  .sa-sp-steps { grid-template-columns: minmax(0, 1fr); }
  .sa-sp-list { max-height: 260px; }
  .sa-sp-row { flex-wrap: wrap; }
  .sa-sp-acts { width: 100%; justify-content: flex-start; }
}
