/* Theme editor — modelled on the Shopify theme customizer */
body.editing { overflow: hidden; }
body.editing .top, body.editing .side, body.editing .main, body.editing .savebar { display: none !important; }
.ed { position: fixed; inset: 0; z-index: 60; background: #f1f1f1; display: grid; grid-template-rows: 52px 1fr; font-size: 13px; color: #303030; }
.ed * { box-sizing: border-box; }
.ed-top { background: #1a1a1a; color: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-inline: 10px 14px; gap: 12px; }
.ed-top .l, .ed-top .r, .ed-top .c { display: flex; align-items: center; gap: 8px; }
.ed-top .r { justify-content: flex-end; }
.ed-top .ib { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: #e3e3e3; display: grid; place-items: center; cursor: pointer; }
.ed-top .ib:hover:not([disabled]) { background: #303030; } .ed-top .ib[disabled] { opacity: .35; cursor: default; } .ed-top .ib.on { background: #4a4a4a; color: #fff; }
.ed-top .ttl { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.ed-top .ttl .badge { background: #cdfee1; color: #0c5132; }
.ed-top .sep { width: 1px; height: 20px; background: #4a4a4a; margin-inline: 4px; }
.ed-top select { height: 30px; border-radius: 8px; border: 0; background: #303030; color: #fff; padding: 0 26px 0 10px; font: inherit; font-weight: 500; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23b5b5b5' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; cursor: pointer; }
.ed-top .save { height: 32px; padding: 0 16px; border-radius: 8px; border: 0; font: inherit; font-weight: 600; background: #fff; color: #1a1a1a; cursor: pointer; }
.ed-top .save[disabled] { background: #3a3a3a; color: #8a8a8a; cursor: default; }
.ed-top .exit { display: flex; gap: 6px; align-items: center; height: 32px; padding: 0 10px 0 6px; border-radius: 8px; border: 0; background: none; color: #fff; font: inherit; font-weight: 550; cursor: pointer; }
.ed-top .exit:hover { background: #303030; }
.ed-top svg { width: 20px; height: 20px; fill: currentColor; }
.ed-body { display: grid; grid-template-columns: 64px 336px minmax(0, 1fr); min-height: 0; }
.ed-rail { background: #ebebeb; border-inline-end: 1px solid #d5d5d5; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; }
.ed-rail button { width: 54px; height: 48px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; align-content: center; gap: 2px; color: #616161; font-size: 10px; font-weight: 550; cursor: pointer; }
.ed-rail button svg { width: 20px; height: 20px; fill: currentColor; }
.ed-rail button:hover { background: rgba(0, 0, 0, .06); } .ed-rail button.on { background: #fff; color: #1a1a1a; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.ed-panel { background: #fff; border-inline-end: 1px solid #d5d5d5; overflow: auto; min-height: 0; }
.ed-ph { position: sticky; top: 0; z-index: 3; background: #fff; display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid #ebebeb; min-height: 48px; }
.ed-ph h3 { margin: 0; font-size: 14px; font-weight: 650; flex: 1; }
.ed-ph .bk { width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; } .ed-ph .bk:hover { background: rgba(0, 0, 0, .06); }
.ed-ph svg { width: 18px; height: 18px; fill: currentColor; }
.ed-grp { padding: 14px 12px 4px; font-size: 12px; font-weight: 650; color: #616161; text-transform: none; }
.ed-row { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; height: 40px; cursor: pointer; border: 0; background: none; width: 100%; text-align: start; font: inherit; color: inherit; border-radius: 8px; }
.ed-row:hover { background: #f5f5f5; } .ed-row.sel { background: #f0f0f0; }
.ed-row .dr { color: #b5b5b5; width: 16px; } .ed-row .dr svg { width: 16px; height: 16px; fill: currentColor; }
.ed-row .nm { flex: 1; font-weight: 500; } .ed-row.off .nm { color: #8a8a8a; }
.ed-row .ey { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: #616161; }
.ed-row .ey:hover { background: rgba(0, 0, 0, .08); } .ed-row svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ed-list { padding: 0 4px 12px; }
.ed-fields { padding: 12px 16px 28px; }
.ed-fields .fl { display: grid; gap: 4px; margin-bottom: 14px; }
.ed-fields .fl > .lb { display: flex; justify-content: space-between; align-items: center; font-weight: 450; }
.ed-fields .fl > .lb .rs { border: 0; background: none; color: #005bd3; padding: 0; font: inherit; font-size: 12px; cursor: pointer; }
.ed-fields .fl > .lb .lg { font-size: 10px; font-weight: 700; letter-spacing: .04em; background: #ebebeb; border-radius: 4px; padding: 1px 5px; color: #616161; margin-inline-start: 6px; }
.ed-fields input[type=text], .ed-fields input[type=number], .ed-fields textarea, .ed-fields select { width: 100%; border: 1px solid #8a8a8a; border-radius: 8px; padding: 6px 10px; min-height: 32px; font: inherit; background: #fff; color: #303030; }
.ed-fields textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.ed-fields input:focus, .ed-fields textarea:focus, .ed-fields select:focus { outline: 2px solid #005bd3; outline-offset: 1px; border-color: transparent; }
.ed-fields .hn { color: #616161; font-size: 12px; }
.ed-fields .hd { font-size: 12px; font-weight: 650; color: #616161; margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid #ebebeb; } .ed-fields .hd:first-child { margin-top: 0; padding-top: 0; border: 0; }
.ed-fields .tg { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; cursor: pointer; }
.ed-fields .tg input { position: absolute; opacity: 0; }
.ed-fields .tg i { width: 36px; height: 20px; border-radius: 10px; background: #8a8a8a; position: relative; transition: background .15s; flex: none; }
.ed-fields .tg i::after { content: ""; position: absolute; inset: 2px auto 2px 2px; width: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ed-fields .tg input:checked + i { background: #303030; } .ed-fields .tg input:checked + i::after { transform: translateX(16px); }
.ed-fields .tg input:focus-visible + i { outline: 2px solid #005bd3; outline-offset: 2px; }
.ed-fields .img { display: flex; gap: 10px; align-items: center; border: 1px dashed #b5b5b5; border-radius: 10px; padding: 8px; }
.ed-fields .img .pv { width: 64px; height: 64px; border-radius: 8px; background: #f1f1f1 center/cover no-repeat; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.ed-fields .img .pv.dk { background-color: #d9c2a0; background-size: contain; }
.ed-fields .img .bt { display: grid; gap: 6px; }
.ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 8px; border: 0; font: inherit; font-weight: 550; cursor: pointer; background: linear-gradient(#fff, #fafafa); color: #303030; box-shadow: 0 -1px 0 0 rgba(0, 0, 0, .17) inset, 0 0 0 1px rgba(0, 0, 0, .08) inset; }
.ed-btn:hover { background: #f3f3f3; } .ed-btn.crit { color: #8e1f0b; } .ed-btn.pri { background: #303030; color: #fff; box-shadow: none; } .ed-btn.sm { height: 24px; padding: 0 8px; font-size: 12px; }
.ed-btn svg { width: 14px; height: 14px; fill: currentColor; }
.ed-fields .col { display: flex; gap: 8px; align-items: center; }
.ed-fields .col input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid #8a8a8a; border-radius: 8px; background: #fff; cursor: pointer; flex: none; }
.ed-fields .col input[type=text] { flex: 1; font-family: ui-monospace, Menlo, monospace; }
.ed-blk { border: 1px solid #d5d5d5; border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.ed-blk > .bh { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; background: #f7f7f7; font-weight: 550; }
.ed-blk > .bh span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-blk > .bh button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; display: grid; place-items: center; cursor: pointer; color: #616161; } .ed-blk > .bh button:hover:not([disabled]) { background: rgba(0, 0, 0, .08); } .ed-blk > .bh button[disabled] { opacity: .3; cursor: default; }
.ed-blk > .bh svg { width: 16px; height: 16px; fill: currentColor; }
.ed-blk > .bb { padding: 12px; } .ed-blk .fl:last-child { margin-bottom: 0; }
.ed-prev { display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; background: #e3e3e3; }
.ed-prev.m { padding: 20px; }
.ed-prev iframe { border: 0; background: #fff; width: 100%; height: 100%; display: block; }
.ed-prev.m iframe { width: 390px; height: min(844px, 100%); border-radius: 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, .22), 0 0 0 8px #1a1a1a; }
.ed-toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 16px); background: #1a1a1a; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; font-weight: 500; }
.ed-toast.on { opacity: 1; transform: translate(-50%, 0); }
.ed-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 150; display: grid; place-items: center; padding: 16px; }
.ed-dlg { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 12px 24px rgba(0, 0, 0, .25); overflow: hidden; }
.ed-dlg .h { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e3e3e3; font-weight: 650; font-size: 14px; }
.ed-dlg .b { padding: 16px; overflow: auto; } .ed-dlg .f { padding: 12px 16px; background: #f7f7f7; border-top: 1px solid #e3e3e3; display: flex; justify-content: flex-end; gap: 8px; }
.ed-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ed-lib button { border: 2px solid transparent; padding: 0; background: #f1f1f1; border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 1; position: relative; }
.ed-lib button img { width: 100%; height: 100%; object-fit: cover; display: block; } .ed-lib button.dk img { object-fit: contain; background: #d9c2a0; }
.ed-lib button:hover { border-color: #005bd3; } .ed-lib button.sel { border-color: #303030; }
.ed-lib button small { position: absolute; inset: auto 0 0 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; padding: 2px 6px; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .ed-body { grid-template-columns: 48px 1fr; } .ed-prev { display: none; } .ed-top .c .ib.dev { display: none; } }
