/* QR editor: form left, sticky preview right; on mobile the preview sticks to the top and can collapse. */
.editor { display: grid; gap: var(--s-6); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .editor { grid-template-columns: minmax(0, 1fr) 340px; } }
.editor-form { min-width: 0; }
.editor-step { padding: var(--s-5); border: 1px solid var(--line-200); border-radius: var(--radius-card); background: var(--white); }
.editor-step + .editor-step { margin-top: var(--s-4); }
.editor-step > h2 { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-16); margin-bottom: var(--s-4); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-50); border: 1px solid var(--line-200); font-size: var(--fs-13); font-weight: 600; color: var(--brand-900); }
.content-form .field + .field, .content-form .field + .field-row, .content-form .field-row + .field, .content-form .fieldset, .content-form .repeat + .field { margin-top: var(--s-4); }
.fieldset { margin: var(--s-4) 0 0; padding: var(--s-4); border: 1px solid var(--line-100); border-radius: var(--radius-card); }
.fieldset legend { padding: 0 6px; font-size: var(--fs-14); font-weight: 500; }
.fieldset .opt { font-weight: 400; color: var(--ink-500); }
.repeat { gap: var(--s-2); }
.repeat-row { display: flex; align-items: flex-start; gap: var(--s-2); }
.repeat-row.wrap { flex-wrap: wrap; }
.repeat-row > .select { width: auto; flex: none; }
.repeat-row .field { margin: 0; }
.repeat-row .full { flex-basis: 100%; }
.repeat-row > .btn-icon { margin-top: 3px; }
.add-row { align-self: flex-start; }

/* Design */
.design-panel { display: flex; flex-direction: column; gap: var(--s-3); }
.preset-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.preset { position: relative; display: inline-flex; padding: 6px; border: 1px solid var(--line-200); border-radius: var(--radius-control); background: var(--white); }
.preset:hover { border-color: var(--brand-600); }
.preset .pro-dot { position: absolute; top: -3px; right: -3px; border: 2px solid var(--white); }
.design-section { border: 1px solid var(--line-200); border-radius: var(--radius-card); }
.design-section summary { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); font-size: var(--fs-14); font-weight: 500; cursor: pointer; list-style: none; }
.design-section summary::-webkit-details-marker { display: none; }
.design-section summary .chev { margin-left: auto; color: var(--ink-500); transition: transform var(--t-fast) var(--ease); }
.design-section[open] summary .chev { transform: rotate(180deg); }
.design-body { padding: 0 var(--s-4) var(--s-4); }
.design-body .field + .field { margin-top: var(--s-4); }
.shape-grid, .frame-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.shape-option { position: relative; }
.shape-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shape-option > span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s-2) 4px; border: 1px solid var(--line-200); border-radius: var(--radius-control); background: var(--white); cursor: pointer; text-align: center; }
.shape-option img { width: 28px; height: 28px; }
.shape-label { font-size: 11px; line-height: 1.2; color: var(--ink-700); }
.shape-option .pro-dot { position: absolute; top: 4px; right: 4px; }
.shape-option input:checked + span { border-color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-700); }
.shape-option input:focus-visible + span { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.logo-grid { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.logo-option { position: relative; }
.logo-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.logo-option > span, .logo-upload { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border: 1px solid var(--line-200); border-radius: var(--radius-control); background: var(--surface-50); cursor: pointer; overflow: hidden; }
.logo-option img { max-width: 80%; max-height: 80%; object-fit: contain; }
.logo-option input:checked + span { border-color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-700); }
.logo-option input:focus-visible + span { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.logo-none { font-size: 11px; color: var(--ink-500); }
.logo-upload { flex-direction: column; gap: 2px; border-style: dashed; color: var(--ink-700); }
.logo-upload.is-locked { color: var(--ink-500); }

/* Preview */
.editor-preview { position: sticky; top: 76px; }
.preview-card { padding: var(--s-4); border: 1px solid var(--line-200); border-radius: var(--radius-card); background: var(--white); }
.preview-frame { position: relative; padding: var(--s-5); background: var(--surface-50); }
.preview-frame.is-loading svg { opacity: .55; transition: opacity var(--t-fast) var(--ease); }
.preview-empty { margin: 0; padding: var(--s-6); text-align: center; }
.preview-status { min-height: 44px; margin: var(--s-3) 0; font-size: var(--fs-14); }
.preview-status p { margin: 4px 0 0; }
.preview-collapse { display: none; margin: -4px 0 var(--s-2) auto; }
.pro-notice { margin-bottom: var(--s-3); }
.pro-notice p { margin-bottom: var(--s-2); }
@media (max-width: 1023px) {
    .editor-preview { top: 60px; z-index: 30; order: -1; }
    .preview-card { box-shadow: var(--shadow-pop); }
    .preview-collapse { display: flex; }
    .preview-frame { max-width: 220px; margin: 0 auto; padding: var(--s-3); }
    .editor-preview.is-collapsed .preview-frame, .editor-preview.is-collapsed .preview-status, .editor-preview.is-collapsed [data-pro-notice] { display: none; }
}
