:root {
  --bg: #f1f1f1; --panel: #ffffff; --ink: #303030; --muted: #616161; --line: #e3e3e3; --soft: #f7f7f7;
  --accent: #303030; --accent-ink: #fff; --ok-bg: #affebf; --ok: #014b40; --off-bg: #e3e3e3; --bad: #8e1f0b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1a1a1a; --panel: #262626; --ink: #e6e6e6; --muted: #a3a3a3; --line: #3a3a3a; --soft: #2f2f2f; --accent: #e6e6e6; --accent-ink: #1a1a1a; --ok-bg: #0f5132; --ok: #b7f0cc; --off-bg: #3a3a3a; --bad: #f2a194; }
}
:root[data-theme="dark"] { --bg: #1a1a1a; --panel: #262626; --ink: #e6e6e6; --muted: #a3a3a3; --line: #3a3a3a; --soft: #2f2f2f; --accent: #e6e6e6; --accent-ink: #1a1a1a; --ok-bg: #0f5132; --ok: #b7f0cc; --off-bg: #3a3a3a; --bad: #f2a194; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 13px/1.45 -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 0.4rem 0.55rem; border: 1px solid #8a8a8a66; border-radius: 8px; background: var(--panel); min-height: 2rem; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
input[type=color] { padding: 2px; height: 2rem; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); padding: 0.4rem 0.8rem; font-weight: 550; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 -1px 0 1px rgba(0,0,0,.8) inset, 0 0 0 1px #303030 inset, 0 .5px 0 1.5px #fff6 inset; }
button.ghost { background: var(--panel); box-shadow: 0 -1px 0 0 #b5b5b5 inset, 0 0 0 1px #0000001a inset; border: 0; }
button.sm { padding: 0.25rem 0.6rem; font-size: 12px; }
button.wide { width: 100%; padding: 0.6rem; }
button.danger, .icon.danger { color: var(--bad); }
button.on { box-shadow: 0 0 0 2px #3fae4c inset; }
button.link { border: 0; background: none; padding: 0; color: inherit; text-align: left; font-weight: 550; }
button.link:hover { text-decoration: underline; }
.icon { padding: 0.2rem 0.45rem; border: 1px solid transparent; background: transparent; line-height: 1.2; font-weight: 400; }
.icon:hover { border-color: var(--line); }
.icon.box { border: 1px solid #c9c9c9; min-width: 2.4rem; }
.page { max-width: 1500px; margin: 0 auto; padding: 1rem; display: grid; gap: 1rem; }
@media (max-width: 720px) { .page { padding: 0.75rem 16px; } }
.card { background: var(--panel); border-radius: 12px; box-shadow: 0 1px 0 0 #1a1a1a12, 0 0 0 1px #1a1a1a08; padding: 0.9rem 1rem; min-width: 0; }
.card.inner { box-shadow: 0 0 0 1px var(--line) inset; margin-top: 0.75rem; }
.h { font-size: 14px; font-weight: 650; margin: 0.2rem 0 0.6rem; }
.muted { color: var(--muted); }
.pad { padding: 0 0.25rem; }
.warn { color: var(--bad); margin: 0; }
.grow { flex: 1; }
.row { display: flex; align-items: flex-end; }
.row.gap { gap: 0.5rem; } .row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 0.8rem; margin-top: 0.75rem; }
label { display: grid; gap: 0.25rem; }
.check { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.check.wrap { flex-wrap: wrap; padding: 0.35rem 0; }
.f { display: grid; gap: 0.25rem; min-width: 8rem; flex: 1; }
.f-l { font-weight: 550; }
.f-h { font-size: 12px; color: var(--muted); }
.f-h.block { flex-basis: 100%; margin-left: 1.6rem; }
.tag { font-size: 10px; padding: 0 0.35rem; border-radius: 4px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); margin-left: 0.4rem; }
.toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.toolbar .search { flex: 1 1 18rem; max-width: 26rem; }
.toolbar select { width: auto; }
.bulk { display: flex; gap: 0.5rem; align-items: center; padding: 0.4rem 0.6rem; background: var(--soft); border-radius: 8px; margin-bottom: 0.5rem; }
.tablewrap { overflow-x: auto; margin: 0 -1rem; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: left; font-weight: 550; color: var(--muted); background: var(--soft); padding: 0.5rem 0.75rem; }
.table td { padding: 0.55rem 0.75rem; border-top: 1px solid var(--line); vertical-align: middle; }
.table .cb { width: 2.5rem; padding-left: 1rem; }
.table .r { text-align: right; }
.table .empty { text-align: center; color: var(--muted); padding: 1.5rem; }
.acts { display: inline-flex; gap: 0.25rem; }
.pill { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 8px; font-size: 12px; font-weight: 550; }
.pill.on { background: var(--ok-bg); color: var(--ok); }
.pill.off { background: var(--off-bg); color: var(--muted); }
.pager { display: flex; align-items: center; gap: 0.35rem; padding-top: 0.75rem; }
.pg { min-width: 2rem; padding: 0.25rem 0.5rem; }
.pg.on { background: var(--accent); color: var(--accent-ink); }
/* editor */
.ed-top { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.tabs { display: flex; flex: 1 1 26rem; border-bottom: 1px solid var(--line); }
.tab { flex: 1; border: 0; background: none; border-radius: 0; padding: 0.55rem 0.5rem; color: var(--muted); }
.tab.on { color: var(--ink); box-shadow: 0 -2px 0 0 var(--accent) inset; }
.ed-meta { display: flex; gap: 0.5rem; align-items: center; flex: 1 1 22rem; }
.ed-meta select { width: auto; }
.inl { display: flex; align-items: center; gap: 0.4rem; border: 1px solid #8a8a8a66; border-radius: 8px; padding: 0 0.5rem; background: var(--panel); flex: 1; }
.inl > span { color: var(--muted); white-space: nowrap; }
.inl input { border: 0; padding-left: 0; background: transparent; }
.inl.sm-w { flex: 0 0 5.5rem; }
.ed-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 980px) { .ed-cols { grid-template-columns: 1fr; } }
.ed-preview { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow: auto; }
.olist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.orow { border-radius: 10px; box-shadow: 0 0 0 1px var(--line) inset; background: var(--panel); }
.orow.child { margin-left: 1.25rem; }
.orow.off .olabel strong { opacity: 0.5; text-decoration: line-through; }
.orow.dragging { opacity: 0.4; }
.orow.over { box-shadow: 0 -2px 0 0 #3fae4c inset, 0 0 0 1px var(--line) inset; }
.orow-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem; }
.oicon { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; background: var(--soft); font-size: 12px; flex: none; }
.olabel { flex: 1; text-align: left; border: 0; background: none; padding: 0.2rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.otools { display: flex; gap: 0.2rem; }
.otools .icon { border: 1px solid #c9c9c9; }
.drag { cursor: grab; padding: 0 0.4rem; color: var(--muted); }
.orow-body { padding: 0 0.8rem 0.6rem; border-top: 1px solid var(--line); }
.add-wrap { border: 1px dashed #b5b5b5; border-radius: 10px; padding: 0.75rem; margin-top: 0.6rem; }
.sec { border-top: 1px solid var(--line); padding: 0.4rem 0; }
.sec > summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0; }
.sec-body { display: grid; gap: 0.65rem; padding: 0.4rem 0 0.5rem; }
.vals { display: grid; gap: 0.6rem; }
.val { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem; display: grid; gap: 0.5rem; }
.vthumb { width: 2.4rem; height: 2.4rem; border-radius: 6px; background: #eee center / cover; flex: none; border: 1px solid var(--line); align-self: center; }
.rule { padding: 0.4rem; border-radius: 6px; background: var(--soft); }
.rule > * { flex: 1; min-width: 7rem; }
.rule > .icon { flex: none; min-width: 0; }
.conds { display: grid; gap: 0.5rem; }
.conds .row > select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; border: 1px solid #8a8a8a66; border-radius: 8px; padding: 0.3rem; flex: 1; min-width: 14rem; }
.chip { display: inline-flex; align-items: center; gap: 0.15rem; background: var(--soft); border-radius: 6px; padding: 0 0 0 0.45rem; }
.chip-in { border: 0; flex: 1; min-width: 10rem; min-height: 1.6rem; padding: 0.1rem 0.3rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.4rem; margin-bottom: 0.75rem; }
/* preview */
.pv-ctl { margin-bottom: 0.75rem; }
.pv-ctl .inl { flex: 1 1 9rem; }
.pv-product { background: #fff; color: #222; border-radius: 8px; padding: 1rem; box-shadow: 0 0 0 1px var(--line) inset; }
.pv-fake { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; margin-bottom: 1rem; }
.pv-img { aspect-ratio: 3 / 4; background: #e9e9e9; border-radius: 6px; }
.pv-lines { display: grid; gap: 0.6rem; align-content: start; }
.pv-lines i { display: block; height: 0.7rem; background: #ececec; border-radius: 4px; }
.pv-lines i:first-child { width: 55%; height: 1.1rem; }
.pv-product .primary { margin-top: 1rem; background: #fff; color: #222; border: 1px solid #222; box-shadow: none; letter-spacing: .04em; }
/* modal */
.modal { border: 0; border-radius: 12px; padding: 0; width: min(36rem, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal--wide { width: min(58rem, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0,0,0,.45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.modal-body { padding: 1rem; display: grid; gap: 0.75rem; max-height: 70vh; overflow: auto; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
.tgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 640px) { .tgrid { grid-template-columns: 1fr; } }
.tcol h4 { margin: 0 0 0.4rem; font-size: 13px; }
.tcol + .tcol { margin-top: 0.75rem; }
.tbtn { display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left; border: 0; background: none; padding: 0.35rem 0.25rem; font-weight: 400; border-radius: 6px; }
.tbtn:hover, .tbtn:focus-visible { background: var(--soft); }
.settings { display: grid; gap: 1rem; max-width: 56rem; }
.settings .card { display: grid; gap: 0.5rem; }
.busy { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 0.55rem 1rem; border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 70; max-width: min(28rem, calc(100vw - 32px)); padding: 0.75rem 1rem; border-radius: 8px; background: var(--ink); color: var(--bg); }
.toast.bad { background: #8e1f0b; color: #fff; }
.savebar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; gap: 0.5rem; justify-content: flex-end; align-items: center; padding: 0.5rem 1rem; background: #1a1a1a; color: #fff; }
.savebar span { margin-right: auto; font-weight: 600; }
.empty { padding: 0.75rem; }
.savebar[hidden] { display: none; }
/* home */
.home-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .home-row { grid-template-columns: 1fr; } }
.home-card { display: grid; gap: 0.4rem; align-content: start; }
.home-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.home-head .h { margin: 0; }
.home-body p { margin: 0 0 0.5rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding-top: 0.75rem; }
.stat { display: grid; gap: 0.2rem; }
.stat strong { font-size: 20px; font-weight: 600; }
select.auto { width: auto; }
.steps { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.35rem; }
.faq { background: var(--soft); border-radius: 8px; padding: 0.55rem 0.8rem; margin-top: 0.5rem; }
.faq summary { cursor: pointer; font-weight: 550; }
.faq ul { margin: 0.5rem 0 0.2rem; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
.notice { box-shadow: 0 0 0 1px #e8c34b inset; background: #fff8db; color: #4a3b00; display: grid; gap: 0.35rem; }
.notice p { margin: 0; }

/* ---- option panel (drawer) ---- */
.dr-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.12); z-index: 30; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(1800px, 92vw); z-index: 31; background: var(--panel); box-shadow: 6px 0 30px rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; }
@media (max-width: 900px) { .drawer { width: 100vw; } }
.dr-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
.dr-title { font-size: 14px; }
.dr-tabs { flex: none; padding: 0 0.5rem; }
.dr-body { overflow: auto; padding: 1rem 1.1rem 3rem; display: grid; gap: 0.9rem; align-content: start; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.25rem; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.grid4 { display: grid; grid-template-columns: 1.2fr 1fr 2fr 2fr; gap: 0.9rem; }
@media (max-width: 700px) { .cols2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem 1rem; align-items: end; }
.span-all { grid-column: 1 / -1; display: grid; gap: 0.3rem; }
.half { max-width: 50%; }
@media (max-width: 700px) { .half { max-width: none; } }
.row-sb { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.check.sm { font-size: 12px; font-weight: 400; }
.qhelp { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid currentColor; font-size: 9px; font-weight: 600; color: var(--muted); cursor: help; vertical-align: middle; }
.dash { border-top: 2px dashed var(--line); margin: 0.2rem 0; }
.sub { font-size: 14px; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.sub::before { content: ""; width: 1.3rem; height: 4px; border-radius: 2px; background: var(--ink); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid #8a8a8a66; border-radius: 8px; overflow: hidden; }
.seg-b { border: 0; border-radius: 0; border-right: 1px solid var(--line); background: var(--panel); padding: 0.35rem 0.25rem; font-weight: 400; }
.seg-b:last-child { border-right: 0; }
.seg-b.on { background: var(--ink); color: var(--panel); font-weight: 600; }
/* values table */
.vtable-wrap { display: grid; gap: 0.6rem; }
.vtable { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.vrow { display: grid; grid-template-columns: 1.4rem 3.5rem minmax(10rem, 1fr) 15rem 4.2rem 10rem; gap: 0.6rem; align-items: center; padding: 0.45rem 0.6rem; border-top: 1px solid var(--line); min-width: 640px; }
.vtable.has-media .vrow { grid-template-columns: 1.4rem 3.5rem 11rem minmax(10rem, 1fr) 15rem 4.2rem 10rem; }
.vtable.has-sale .vrow { grid-template-columns: 1.4rem 3.5rem minmax(10rem, 1fr) 15rem 7rem 4.2rem 10rem; }
.vtable.has-link .vrow { grid-template-columns: 1.4rem 3.5rem minmax(10rem, 1fr) 15rem 10rem 4.2rem 10rem; }
.vtable.has-media.has-sale .vrow { grid-template-columns: 1.4rem 3.5rem 11rem minmax(10rem, 1fr) 15rem 7rem 4.2rem 10rem; }
.vtable.has-media.has-link .vrow { grid-template-columns: 1.4rem 3.5rem 11rem minmax(10rem, 1fr) 15rem 10rem 4.2rem 10rem; }
.vtable.has-sale.has-link .vrow { grid-template-columns: 1.4rem 3.5rem minmax(10rem, 1fr) 15rem 7rem 10rem 4.2rem 10rem; }
.vtable.has-media.has-sale.has-link .vrow { grid-template-columns: 1.4rem 3.5rem 11rem minmax(10rem, 1fr) 15rem 7rem 10rem 4.2rem 10rem; }
.vhead { background: var(--soft); border-top: 0; font-weight: 550; color: var(--muted); font-size: 12px; }
.vrow.off { opacity: 0.55; }
.vrow.over { box-shadow: 0 -2px 0 0 #3fae4c inset; }
.vrow.dragging { opacity: 0.4; }
.vmedia { display: flex; align-items: center; gap: 0.35rem; }
.vmedia input[type=color] { width: 2.2rem; }
.vprice { display: flex; align-items: center; gap: 0.3rem; }
.vprice input[type=number] { min-width: 4.5rem; }
.vprice .cur { font-size: 12px; }
.vacts { display: flex; gap: 0.1rem; justify-content: flex-end; }
.vacts .icon.on { color: #1a7f37; font-weight: 700; }
.vbtns .primary.on { box-shadow: 0 0 0 2px #3fae4c; }
.vthumb { width: 2rem; height: 2rem; }
.r { text-align: right; }
.ctr select { width: auto; }
/* rich text */
.rte { border: 1px solid #8a8a8a66; border-radius: 8px; overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 0.15rem; padding: 0.35rem; border-bottom: 1px solid var(--line); background: var(--soft); align-items: center; }
.rte-btn { border: 0; background: none; padding: 0.25rem 0.45rem; min-width: 1.9rem; font-weight: 400; }
.rte-btn:hover { background: var(--panel); }
.rte-sel { width: auto; min-height: 1.8rem; padding: 0.1rem 0.4rem; }
.rte-color { display: inline-flex; align-items: center; gap: 0.15rem; padding: 0 0.35rem; font-weight: 700; text-decoration: underline; }
.rte-color input { width: 1.4rem; height: 1.4rem; padding: 0; border: 0; min-height: 0; }
.rte-area { min-height: 16rem; padding: 0.75rem; outline: none; background: var(--panel); overflow: auto; }
.rte-area table { border-collapse: collapse; }
.rte-area td, .rte-area th { border: 1px solid var(--line); padding: 0.3rem 0.5rem; min-width: 4rem; }
.rte-area img { max-width: 100%; }
.rte-src { border: 0; border-radius: 0; min-height: 16rem; }
/* product options */
.pthumb { width: 2.2rem; height: 2.2rem; object-fit: cover; border-radius: 6px; display: inline-block; vertical-align: middle; background: var(--soft); }
.table .c { text-align: center; }
.link.blue { color: #2c6ecb; font-weight: 400; }
.ed-thumb { width: 2.2rem; height: 2.2rem; border-radius: 6px; object-fit: cover; }
.orow.linked { background: var(--soft); }
.add-row { display: grid; gap: 0.75rem; margin-top: 0.6rem; }
.add-row.two { grid-template-columns: 1fr 1fr; }
.add-row .add-wrap { margin-top: 0; }
.pv-img.real { width: 100%; height: auto; aspect-ratio: auto; object-fit: cover; }
.pv-title { font-size: 14px; color: #222; }
.pick-list { display: grid; gap: 0.15rem; max-height: 50vh; overflow: auto; }
.check.pick { padding: 0.35rem 0.25rem; border-bottom: 1px solid var(--line); }
.ed-main { display: grid; gap: 1rem; }
.ed-top select { width: auto; }
.olist > li, .orow-head { min-width: 0; }
.olabel strong { overflow: hidden; text-overflow: ellipsis; }
/* file picker */
.ftop { display: flex; gap: 0.5rem; align-items: center; }
.fsearch { max-width: 28rem; }
.fdrop { border: 2px dashed #c9c9c9; border-radius: 10px; padding: 1.75rem; display: grid; justify-items: center; gap: 0.5rem; }
.fdrop.over { border-color: #3fae4c; background: #3fae4c11; }
.fdrop p { margin: 0; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.9rem; max-height: 44vh; overflow: auto; padding: 0.25rem; }
.fitem { position: relative; display: grid; gap: 0.35rem; padding: 0; border: 0; background: none; text-align: left; font-weight: 400; }
.fitem img, .fimg-empty { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--soft); display: grid; place-items: center; font-size: 11px; color: var(--muted); box-shadow: 0 0 0 1px var(--line); }
.fitem.on img { box-shadow: 0 0 0 3px #3fae4c; }
.fbox { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px #8a8a8a; display: grid; place-items: center; font-size: 11px; color: #fff; }
.fitem.on .fbox { background: #3fae4c; box-shadow: none; }
.fname { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmore { display: flex; justify-content: center; }
/* settings page */
.set-tabs { padding: 0; overflow: hidden; }
.set-tabs .tabs { border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-tabs .tab { font-weight: 600; padding: 0.7rem 0.5rem; }
.subtabs { background: var(--soft); }
.subtabs .tab { font-weight: 500; font-size: 12.5px; padding: 0.55rem 0.4rem; }
.set-body { display: grid; gap: 1rem; }
.sset { display: grid; gap: 0.55rem; padding-bottom: 0.9rem; border-bottom: 2px dashed var(--line); }
.sset:last-child { border-bottom: 0; }
.srow { padding: 0.15rem 0; }
.stack1 { display: grid; gap: 0.6rem; }
.chip-t { border: 1px solid var(--line); background: var(--soft); border-radius: 6px; padding: 0.15rem 0.5rem; font-weight: 400; font-size: 12px; }
.chip-t.on { background: var(--panel); box-shadow: 0 0 0 1px #8a8a8a; font-weight: 600; }
.colorin { display: flex; align-items: center; gap: 0.35rem; border: 1px solid #8a8a8a66; border-radius: 8px; padding: 0 0.35rem; background: var(--panel); }
.colorin input[type=color] { width: 1.7rem; height: 1.5rem; min-height: 0; border: 0; padding: 0; }
.colorin input[type=text] { border: 0; padding-left: 0; }
.unitin { display: flex; align-items: center; border: 1px solid #8a8a8a66; border-radius: 8px; background: var(--panel); overflow: hidden; }
.unitin input { border: 0; border-radius: 0; }
.unitin span { padding: 0 0.6rem; color: var(--muted); border-left: 1px solid var(--line); align-self: stretch; display: grid; place-items: center; font-size: 12px; }
.radios { display: grid; gap: 0.15rem; }
.pv-product .qty { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.pv-product .qty input { width: 5rem; }
/* Import picker */
.imp-list { display: grid; gap: 6px; max-height: 46vh; overflow: auto; padding: 2px; }
.imp-row { border: 1px solid var(--line); border-radius: 10px; padding: 0.45rem 0.7rem; background: var(--panel); }
.imp-row.on { box-shadow: 0 0 0 1px var(--a1, #3fae4c) inset; }
.imp-main { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; flex-wrap: wrap; }
.imp-name { flex: 1 1 18rem; min-width: 0; }
.imp-more { margin: 0.25rem 0 0 1.8rem; font-size: 12px; }
.imp-more summary { cursor: pointer; color: var(--muted); }
.imp-more ul { margin: 0.3rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.15rem; }
.imp-kinds { max-width: 34rem; }
.imp-foot { border-top: 1px solid var(--line); padding-top: 0.75rem; align-items: center; }
.pill.warn { background: rgba(255, 207, 92, .16); color: #8a6100; }
body[data-look]:not([data-look="classic"]):not([data-look="arctic"]) .pill.warn { color: #ffcf5c; }
.imp-rename { font-weight: 600; border: 1px solid transparent; background: transparent; padding: 0.15rem 0.35rem; min-height: 0; width: min(100%, 26rem); margin-right: 0.35rem; }
.imp-rename:hover, .imp-rename:focus { border-color: var(--line); background: var(--panel); }
/* products tab: assignment cards */
.acard { background: var(--panel); border-radius: 14px; box-shadow: 0 1px 0 0 #1a1a1a12, 0 0 0 1px var(--line); overflow: hidden; }
.acard.on { box-shadow: 0 0 0 1.5px var(--a1, #303030); }
.acard-head { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.9rem 1.1rem; cursor: pointer; }
.acard-head input { margin-top: 0.2rem; }
.acard-head > span { display: grid; gap: 0.2rem; }
.acard-body { border-top: 1px solid var(--line); padding: 0.9rem 1.1rem 1.1rem; display: grid; gap: 0.8rem; }
.rules { display: grid; gap: 0.5rem; }
.rgroup { border: 1.5px dashed color-mix(in srgb, currentColor 30%, transparent); border-radius: 12px; padding: 0.7rem; display: grid; gap: 0.45rem; }
.rrow { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(8rem, 1.4fr) auto auto auto; gap: 0.5rem; align-items: center; }
@media (max-width: 760px) { .rrow { grid-template-columns: 1fr 1fr; } }
.rule-or, .rule-and { font: 600 10.5px/1 var(--display, inherit); letter-spacing: .16em; color: var(--muted); text-align: center; }
.rule-or { padding: 0.1rem 0; }
.matchbox:empty { display: none; }
.matchlist { list-style: none; margin: 0.3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.35rem; max-height: 16rem; overflow: auto; }
.matchlist li { display: flex; align-items: center; gap: 0.5rem; font-size: 12.5px; }
.matchlist img { width: 1.8rem; height: 1.8rem; border-radius: 5px; object-fit: cover; }
/* Home → Product analytics */
.cov { display: grid; gap: 0.75rem; }
.cov-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--soft); }
.cov-bar span { display: block; height: 100%; }
.cov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cov-tile { display: grid; gap: 2px; text-align: left; padding: 0.75rem 0.9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); font-weight: 400; cursor: pointer; }
.cov-tile.on { box-shadow: 0 0 0 1.5px var(--a1, #303030); }
.cov-lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cov-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cov-n { font-size: 24px; font-weight: 600; }
.cov-panel { border-top: 1px solid var(--line); padding-top: 0.75rem; display: grid; gap: 0.6rem; }
.cov-panel input[type=search] { width: min(100%, 15rem); }
.cov-list { display: grid; max-height: 32rem; overflow: auto; }
.cov-item { display: grid; grid-template-columns: 20px 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .cov-item { grid-template-columns: 20px 40px minmax(0, 1fr); } .cov-acts { grid-column: 2 / -1; } }
.cov-img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--soft); display: block; }
.cov-title { font-weight: 550; }
.cov-meta { font-size: 12px; }
.cov-bulk { align-items: center; }
body[data-look]:not([data-look="classic"]) .cov-n { font-family: var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vthumb.lg { width: 4.5rem; height: 3.4rem; }

/* Option values table: fixed columns, nothing overlaps */
.vrow > * { min-width: 0; }
.vrow > input { width: 100%; }
.vmedia { flex-wrap: nowrap; }
.vmedia select { width: 5.6rem; flex: none; }
.vprice select { width: 7.2rem; flex: none; }
.vprice input[type=number] { min-width: 0; width: 4.8rem; flex: none; }
.vacts { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: nowrap; }
.vacts .icon { flex: none; }
/* Change image → photo matching */
.imgsub { display: grid; gap: 0.35rem; margin: 0.2rem 0 0.4rem 1.6rem; }
.imgsub[hidden] { display: none; }
.photo-check { display: grid; max-height: 26rem; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.photo-check .pc-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; align-items: center; padding: 0.35rem 0.6rem; border-top: 1px solid var(--line); }
.photo-check .pc-row:first-child { border-top: 0; }
.photo-check .bad { color: #b42318; }
/* Product page: display order of option sets */
.orow .onum { width: 1.2rem; text-align: right; color: var(--muted); font-size: 12px; flex: none; }
.orow .drag { cursor: grab; color: var(--muted); flex: none; }
.orow.own { background: color-mix(in srgb, var(--a1, #3fae4c) 6%, transparent); }
.orow.over { box-shadow: 0 -2px 0 0 #3fae4c inset; }
.orow.dragging { opacity: 0.4; }
.orow .otools .icon[disabled] { opacity: 0.3; cursor: default; }
.order-head { font-size: 12.5px; margin: 0.2rem 0 0.4rem; flex-wrap: wrap; }
/* Shopify variants on the product page */
.vrow-opt .olabel { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.pill.vtag { background: color-mix(in srgb, #378ADD 14%, transparent); color: #185FA5; }
.pill.warn { background: #FAEEDA; color: #854F0B; }
.vvals { font-size: 12px; }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vchip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px; background: var(--panel); }
.vchip.new { border-style: dashed; }
.vchip input { border: 0; background: transparent; min-width: 4rem; padding: 2px 4px; }
.vchip .drag { cursor: grab; color: var(--muted); }
.vcard-head { align-items: center; }
.vtable-scroll { overflow-x: auto; max-height: 30rem; overflow-y: auto; }
.vtbl input[type=text], .vtbl input[type=number] { width: 7.5rem; }
.vtbl input.changed { border-color: #EF9F27; background: #FAEEDA44; }
.vsum { margin: 0.2rem 0 0.6rem; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
.vsum .bad { color: #b42318; }
.vvar .vrow { grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1.2fr) 4rem !important; min-width: 0 !important; }
.vvar .vname { font-weight: 550; }
/* Photo names: hand-picked photos */
.photo-check .pc-row { grid-template-columns: 2.4rem minmax(0, 1.3fr) minmax(0, 1fr) auto; }
.photo-check .hand { color: #185FA5; }
.photo-check .pc-acts { justify-content: flex-end; flex-wrap: nowrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; max-height: 60vh; overflow: auto; }
.photo-tile { display: grid; gap: 0.3rem; padding: 0.35rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; text-align: left; font-weight: 400; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--soft); }
.photo-tile span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-tile.on { box-shadow: 0 0 0 2px #3fae4c; }
.photo-tile.up { border-style: dashed; place-items: center; min-height: 9rem; }
.photo-tile .up-ic { font-size: 22px; }
/* Variant picker panel (Ymq style) */
input.readonly, input:disabled.readonly { background: var(--soft); color: var(--muted); cursor: not-allowed; }
.vvar .vchip.ro { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font-size: 13px; }
.vrow-opt .olabel strong { font-weight: 600; }
