.editor-page { max-width: 1320px; }
.editor-page .ed-card { --line-2: #3a4a5e; --sunken: #0f151c; --field: #0b0f14; --r-ctl: 9px; --accent-tint: rgba(61, 139, 253, .15); --text-2: #c6d1dc; --warn-text: #e3b341; --bad: #e5534b; --bad-text: #ff9c94;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.4vw, 28px); margin: 8px 0 40px; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: clamp(28px, 5vw, 56px) 0 12px; }
.editor-head h1 { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -1px; margin-bottom: 8px; }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; font-size: 12px; font-weight: 700; letter-spacing: .6px; background: var(--panel-2); color: var(--muted); }
.pill.ok { background: rgba(63, 185, 80, .15); color: #7ee2a8; }
.pill.warn { background: rgba(227, 179, 65, .14); color: var(--warn); }
.btn.ghost { background: transparent; }
.btn.small-btn { height: 34px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ibtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ibtn svg.ic { width: 16px; height: 16px; fill: currentColor; }
.preview-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preview-label select { height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; font-size: 12px; text-transform: none; }
.ed-help.warn { color: var(--warn); }
.finish { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.finish h3 { margin-bottom: 6px; }
.finish .choice { margin-top: 12px; }
.finish .choice .panel { gap: 8px; }
.finish label.author { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.finish input { height: 40px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: #0b0f14; color: var(--text); font: inherit; font-size: 15px; text-transform: none; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(30px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; background: #1e2a38; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; max-width: min(92vw, 560px); z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { border-color: var(--ok); }
#toast.err { border-color: #e5534b; }
.ed-titlebar { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ed-titlebar h3 { margin: 0; font-size: 16px; }
.ed-shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.ed-shape { text-align: left; padding: 10px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit; }
.ed-shape b { font-size: 14px; }
.ed-shape span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.ed-shape:hover { border-color: var(--line-2); }
.ed-shape.on { border-color: var(--accent); background: var(--accent-tint); }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.ed-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-field.check { flex-direction: row; align-items: center; gap: 8px; }
.ed-label { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--muted); text-transform: uppercase; }
.ed-help { font-size: 12px; color: var(--muted); }
.ed-field input[type=text], .ed-field input[type=number], .ed-field select, .ed-action select, .ed-field textarea, .ed-json {
  width: 100%; height: 36px; padding: 0 10px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; font-size: 14px;
}
.ed-field textarea, .ed-json { height: auto; padding: 8px 10px; font-family: Consolas, monospace; font-size: 12px; }
.ed-field textarea.bad { border-color: var(--bad); }
.ed-field input.tpl { font-family: Consolas, monospace; font-size: 13px; }
.ed-icon { position: relative; display: flex; gap: 6px; align-items: center; }
.ed-icongrid { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; max-height: 240px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--panel); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.ed-icongrid[hidden] { display: none; }
.ed-ic { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 1px solid transparent; border-radius: 8px; background: var(--sunken); color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.ed-ic svg.ic { width: 24px; height: 24px; fill: currentColor; color: var(--text); }
.ed-ic small { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-ic:hover { border-color: var(--line-2, var(--line)); }
.ed-ic.on { border-color: var(--accent); }
button.ed-swatch { border: 1px solid var(--line); color: inherit; cursor: pointer; padding: 0; }
.ed-swatch { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--r-ctl); background: var(--sunken); }
.ed-swatch svg.ic { width: 26px; height: 26px; }
.ed-block { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.ed-list { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ed-item { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--sunken); }
.ed-item-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.ed-action { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ed-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.ed-fields-head { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; gap: 10px; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; }
.ed-chipgroup { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px dashed var(--line); border-radius: 10px; }
.ed-subchips { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 10px; }
.ed-chip { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; max-width: 240px; }
.ed-chip b { font-size: 12px; }
.ed-chip span { font-size: 11px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-chip:hover { border-color: var(--accent); }
.ed-frame { width: 100%; height: 160px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #0b0f14; }
.ed-problems { margin: 0; padding-left: 18px; color: var(--warn-text); font-size: 13px; }
.ed-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.ed-pre { max-height: 200px; overflow: auto; background: var(--sunken); padding: 8px; border-radius: var(--r-ctl); font-size: 11px; white-space: pre-wrap; word-break: break-all; }
.ed-json { height: 260px; margin: 6px 0; }
.ed-mine-title { margin: 10px 0 0; font-size: 15px; }
.ed-mine-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ed-mine-ico { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.ed-mine-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-mine-row .name { font-weight: 600; }
.ed-mine-row .desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-mine-row .desc.err { color: var(--bad-text); }
.ed-field .ed-help, .ed-help { text-transform: none; letter-spacing: 0; font-weight: 400; }

.ed-workspace { display: grid; grid-template-columns: 290px minmax(0, 1fr) 370px; gap: 18px; margin-top: 12px; align-items: start; }
@media (max-width: 1180px) { .ed-workspace { grid-template-columns: 260px minmax(0, 1fr); } .ed-props { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ed-workspace { grid-template-columns: minmax(0, 1fr); } .ed-palette { order: 2; } .ed-stage { order: 1; } .ed-props { order: 3; } }
.ed-palette, .ed-props { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ed-stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (min-width: 1181px) and (min-height: 1100px) { .ed-stage { position: sticky; top: 12px; } }
.ed-ptitle { margin: 0; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.ed-hint { margin: 0; font-size: 12px; color: var(--muted); }
.ed-group { border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--panel-2); padding: 0 12px; }
.ed-group > summary { cursor: pointer; font-weight: 700; font-size: 13px; padding: 10px 0; }
.ed-group[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.ed-group > div { padding-bottom: 12px; }
.ed-palette .ed-shapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ed-palette .ed-shape span { display: none; }
.ed-palette .ed-shape { padding: 8px 10px; cursor: grab; }
.ed-chip, .ed-act { cursor: grab; }
.ed-chip[draggable=true]:active, .ed-shape[draggable=true]:active, .ed-act:active { cursor: grabbing; }
.ed-search { width: 100%; height: 32px; padding: 0 10px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; font-size: 13px; margin-bottom: 8px; }
.ed-palette-actions { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; }
.ed-act { display: inline-flex; flex-direction: column; gap: 1px; text-align: left; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--sunken); color: var(--text); font: inherit; font-size: 12px; }
.ed-act small { color: var(--muted); font-size: 10px; }
.ed-act:hover { border-color: var(--accent); }
.ed-slots-head { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
.ed-slots-head span { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.ed-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ed-slot { position: relative; min-height: 52px; padding: 7px 10px; border: 1px dashed var(--line-2, var(--line)); border-radius: var(--r-ctl); background: var(--sunken); color: var(--text); text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ed-slot b { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.ed-slot span { font-size: 13px; font-family: Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-slot.empty span { color: var(--muted); font-family: inherit; font-style: italic; }
.ed-slot.over { border-color: var(--accent); background: var(--accent-tint); border-style: solid; }
.ed-slot.on { border-color: var(--accent-2); border-style: solid; }
.ed-slot .clear { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 20px; padding: 0; }
.ed-slot .clear:hover { color: var(--text); background: var(--hover, var(--line)); }
.ed-frame.over { outline: 2px solid var(--accent); }
@media (hover: none) { .ed-chip, .ed-shape, .ed-act { cursor: pointer; } }
.ed-frame-wrap { position: relative; }
.ed-dropcover { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; align-items: center; justify-content: center; background: rgba(61, 139, 253, .12); border: 2px dashed var(--accent); border-radius: var(--r-ctl); color: var(--accent-2); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: 13px; z-index: 5; }
.ed-dragging .ed-dropcover { display: flex; }
.ed-dropcover.over { background: rgba(61, 139, 253, .28); }

.cv-block { grid-column: 1 / -1; }
.cv-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.cv-board { display: grid; gap: 4px; padding: 6px; max-width: 620px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--sunken); touch-action: none; user-select: none; -webkit-user-select: none; }
.cv-cell { border: 1px dashed var(--line); border-radius: 6px; opacity: .6; }
.cv-piece { position: relative; z-index: 1; display: block; min-width: 0; padding: 4px 22px 4px 8px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-tint); color: var(--text); font-size: 12px; font-weight: 650; cursor: grab; overflow: hidden; touch-action: none; }
.cv-piece:active { cursor: grabbing; }
.cv-piece.on { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-2); z-index: 2; }
.cv-piece.over { background: var(--accent); color: #fff; }
.cv-piece:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.cv-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-rs { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--accent-2) 50%); border-bottom-right-radius: 7px; touch-action: none; }
.cv-props { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--sunken); }
.cv-bar .cv-name, .cv-icon .cv-name { font-weight: 600; }
