/* Stagecraft editor chrome */
:root {
  --bg0: #090b11; --bg1: #0e1119; --bg2: #131722; --bg3: #191e2b; --bg4: #202637;
  --line: #222838; --line2: #2e3549; --text: #ece9e1; --text2: #b2afa7; --text3: #7c7f8f;
  --blue: #7ea6ff; --amber: #ffab4d; --green: #6dd4a2; --violet: #b59dff; --coral: #ff7d6c; --pink: #ff8ec6; --slate: #9fb0cf; --yellow: #f5c84f;
  --brand: #f5c84f; --onbrand: #14161f;
  --r: 12px; --ease: cubic-bezier(.16, 1, .3, 1); --io: cubic-bezier(.65, 0, .35, 1);
  --ui: "SC Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", "SC Lora", Georgia, serif;
  --mono: "SC Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--text); font: 13px/1.4 var(--ui); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; }
kbd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--bg4); border: 1px solid var(--line2); color: var(--text2); white-space: nowrap; }
code { font: 12px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--bg4); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #262c3c; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }
body.ed-dragging, body.ed-dragging * { cursor: grabbing !important; user-select: none; }
body.ed-scrubbing, body.ed-scrubbing * { cursor: ew-resize !important; user-select: none; }

/* ── buttons ── */
.ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; white-space: nowrap; font-weight: 600; transition: background .2s, border-color .2s, transform .35s var(--ease), box-shadow .3s; }
.ed-btn:hover:not(:disabled) { background: var(--bg4); border-color: #3a4259; transform: translateY(-1px); }
.ed-btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.ed-btn:disabled { opacity: .5; cursor: default; }
.ed-btn.primary { background: var(--brand); color: var(--onbrand); border-color: transparent; box-shadow: 0 8px 24px -12px var(--brand); }
.ed-btn.primary:hover:not(:disabled) { background: #ffd56a; }
.ed-btn.ghost { background: transparent; }
.ed-btn.danger { color: var(--coral); }
.ed-btn.danger:hover { border-color: var(--coral); }
.ed-btn.small { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.ed-btn.full { width: 100%; }
.ed-btn .ic { width: 16px; height: 16px; }
.ed-icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text2); transition: background .2s, color .2s, border-color .2s, transform .3s var(--ease); flex: none; }
.ed-icon-btn:hover:not(:disabled) { background: var(--bg4); color: var(--text); }
.ed-icon-btn:disabled { opacity: .3; cursor: default; }
.ed-icon-btn.on { background: color-mix(in srgb, var(--c, var(--blue)) 18%, transparent); color: var(--c, var(--blue)); border-color: color-mix(in srgb, var(--c, var(--blue)) 40%, transparent); }
.ed-icon-btn.xs { width: 26px; height: 26px; border-radius: 7px; } .ed-icon-btn.xs .ic { width: 15px; height: 15px; }
.ed-icon-btn.danger:hover:not(:disabled) { color: var(--coral); }
.ed-flex { flex: 1; }

/* ── top bar ── */
.ed-top { height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: var(--bg1); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.ed-tleft { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.ed-tright { display: flex; align-items: center; gap: 8px; }
.ed-tgrp { display: flex; align-items: center; gap: 4px; padding-left: 12px; border-left: 1px solid var(--line); }
.ed-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.ed-brand b { font: 600 19px/1 var(--serif); letter-spacing: -.01em; }
.ed-logo { width: 30px; height: 30px; border-radius: 9px; background: #10131f; position: relative; box-shadow: inset 0 0 0 1px #2a3048; }
.ed-logo i { position: absolute; height: 2px; left: 6px; right: 6px; bottom: 9px; background: #3a4259; border-radius: 2px; }
.ed-logo i:nth-child(2) { width: 7px; height: 7px; border-radius: 50%; left: 7px; bottom: 6.5px; background: var(--brand); right: auto; }
.ed-logo i:nth-child(3) { width: 12px; height: 3px; left: 7px; top: 8px; bottom: auto; background: #f3f0e8; }
.ed-title { flex: 1; min-width: 80px; max-width: 420px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: 9px; padding: 0 10px; font: 500 14px var(--ui); color: var(--text); transition: border-color .2s, background .2s; }
.ed-title:hover { border-color: var(--line2); } .ed-title:focus { outline: none; border-color: var(--blue); background: var(--bg2); }
.ed-tone-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; }
.ed-tone-btn i { width: 16px; height: 16px; border-radius: 50%; }
.ed-tone-btn .ic { width: 14px; height: 14px; color: var(--text3); }
.ed-save { display: inline-flex; align-items: center; gap: 6px; color: var(--text3); font-size: 12px; margin-right: 6px; }
.ed-save .ic { width: 14px; height: 14px; } .ed-save.ok .ic { color: var(--green); }

/* ── layout ── */
.ed-main { display: grid; grid-template-columns: 232px 1fr 356px; height: calc(100% - 56px); }
.ed-left { background: var(--bg1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ed-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg0); }
.ed-right { background: var(--bg1); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; --c: var(--blue); }

/* ── insert bar ── */
.ed-insert { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg1); overflow-x: auto; flex: none; }
.ed-ins-t { font: 700 10px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text3); margin-right: 6px; }
.ed-ins { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 8px 0 5px; flex: none; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; transition: background .2s, border-color .2s, transform .35s var(--ease); white-space: nowrap; }
.ed-ins:hover { background: var(--bg3); border-color: var(--line2); transform: translateY(-1px); }
.ed-ins .ii { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 17%, transparent); color: var(--c); }
.ed-ins .ii .ic { width: 16px; height: 16px; }
.ed-ins .il { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.ed-ins .car { width: 12px; height: 12px; color: var(--text3); }
.ed-zoom { display: flex; align-items: center; gap: 2px; margin-left: 8px; padding: 2px; border-radius: 9px; border: 1px solid var(--line2); }
.ed-zoom-l { min-width: 46px; height: 26px; border: 0; background: none; cursor: pointer; color: var(--text2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── canvas ── */
.ed-canvas { flex: 1; position: relative; overflow: hidden; background: radial-gradient(circle at 1px 1px, #1a1f2c 1px, transparent 0) 0 0 / 22px 22px, var(--bg0); }
.ed-canvas.ed-drop::after { content: "Drop images, video or a .pptx / .pdf"; position: absolute; inset: 14px; border: 2px dashed var(--blue); border-radius: 18px; display: grid; place-items: center; font: 600 16px var(--ui); color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); pointer-events: none; }
.ed-viewport { position: absolute; inset: 0; overflow: auto; }
.ed-stagewrap { position: relative; border-radius: 6px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.05); }
.ed-stagewrap .sc-stage { border-radius: 0; }
.ed-stage .sc-el { cursor: default; }
.ed-stage .sc-el.ed-editing .sc-txt { outline: none; cursor: text; user-select: text; -webkit-user-select: text; caret-color: var(--sc-accent); }
.ed-stage .sc-transit.ed-ghost { opacity: .85; pointer-events: none; }
.ed-stage iframe, .ed-stage video, .ed-stage audio { pointer-events: none; }
.ed-overlay { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; pointer-events: none; --inv: 1; }
.ed-sel { position: absolute; border: calc(1.6px * var(--inv)) solid var(--tc, var(--blue)); transform-origin: 50% 50%; box-shadow: 0 0 0 calc(1px * var(--inv)) rgba(0,0,0,.25); }
.ed-sel.faint { border-style: dashed; border-color: color-mix(in srgb, var(--tc, var(--blue)) 65%, transparent); box-shadow: none; }
.ed-sel.ed-hover { border: calc(1.2px * var(--inv)) solid color-mix(in srgb, var(--tc, var(--blue)) 60%, transparent); }
.ed-sel.locked { border-color: var(--amber); }
.ed-sel.group { border-style: solid; border-color: var(--violet); }
.ed-h { position: absolute; width: calc(11px * var(--inv)); height: calc(11px * var(--inv)); margin: calc(-5.5px * var(--inv)) 0 0 calc(-5.5px * var(--inv)); background: #fff; border: calc(1.6px * var(--inv)) solid var(--tc, var(--blue)); border-radius: calc(3px * var(--inv)); pointer-events: auto; box-shadow: 0 calc(2px * var(--inv)) calc(6px * var(--inv)) rgba(0,0,0,.35); transition: transform .2s var(--ease); }
.ed-h:hover { transform: scale(1.3); }
.ed-rot { position: absolute; left: 50%; top: calc(-34px * var(--inv)); width: calc(14px * var(--inv)); height: calc(14px * var(--inv)); margin-left: calc(-7px * var(--inv)); border-radius: 50%; background: var(--tc, var(--blue)); border: calc(2px * var(--inv)) solid #fff; pointer-events: auto; cursor: grab; box-shadow: 0 calc(2px * var(--inv)) calc(8px * var(--inv)) rgba(0,0,0,.4); }
.ed-rot::after { content: ""; position: absolute; left: 50%; top: 100%; width: calc(1.5px * var(--inv)); height: calc(20px * var(--inv)); background: var(--tc, var(--blue)); transform: translateX(-50%); }
.ed-guide { position: absolute; background: var(--pink); pointer-events: none; }
.ed-guide.v { width: calc(1px * var(--inv)); } .ed-guide.h { height: calc(1px * var(--inv)); }
.ed-marquee { position: absolute; border: calc(1px * var(--inv)) solid var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.ed-size-tag { position: absolute; transform: translate(-50%, calc(10px * var(--inv))) scale(var(--inv)); transform-origin: 50% 0; padding: 3px 8px; border-radius: 6px; background: var(--tc, var(--blue)); color: #0c1020; font: 600 11px var(--ui); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-fit-badge { position: absolute; right: 0; bottom: 0; transform: translate(0, 110%) scale(var(--inv)); transform-origin: 100% 0; display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; background: var(--amber); color: #1a1205; font: 700 11px var(--ui); white-space: nowrap; }
.ed-fit-badge .ic { width: 12px; height: 12px; }
.ed-lock-badge { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) scale(var(--inv)); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); color: #1a1205; }
.ed-lock-badge .ic { width: 13px; height: 13px; }
.ed-step-badge { position: absolute; transform: translate(-40%, -40%) scale(var(--inv)); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--violet); color: #160f2b; font: 800 11px var(--ui); box-shadow: 0 4px 12px -4px rgba(0,0,0,.6); }
.ed-step-badge.out { background: var(--coral); }

/* floating text toolbar */
.ed-textbar { position: fixed; z-index: 40; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 12px; background: rgba(20,24,35,.92); backdrop-filter: blur(14px); border: 1px solid var(--line2); box-shadow: 0 18px 40px -16px rgba(0,0,0,.8); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .4s var(--ease); }
.ed-textbar.in { opacity: 1; transform: none; }
.ed-textbar button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text2); cursor: pointer; display: grid; place-items: center; }
.ed-textbar button:hover { background: var(--bg4); color: var(--amber); }
.ed-textbar .sep { width: 1px; height: 18px; background: var(--line2); margin: 0 3px; }
.ed-textbar .ic { width: 16px; height: 16px; }

/* ── sorter ── */
.ed-sorter-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.ed-sorter-t { display: flex; align-items: center; gap: 7px; } .ed-sorter-t .ic { color: var(--pink); }
.ed-count { font-style: normal; color: var(--text3); font-size: 12px; margin-left: 2px; }
.ed-sorter-list { flex: 1; overflow-y: auto; padding: 8px 10px 40px; position: relative; outline: none; }
.ed-sec { display: flex; align-items: center; gap: 8px; margin: 12px 2px 6px; font: 700 10px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text2); cursor: default; }
.ed-sec .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hue) 22%, transparent); }
.ed-sec .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-sec .ed-icon-btn { opacity: 0; } .ed-sec:hover .ed-icon-btn { opacity: 1; }
.ed-trow { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; padding: 4px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.ed-trow:hover { background: var(--bg2); }
.ed-trow.dragging { opacity: .45; }
.ed-tnum { font: 600 11px var(--ui); color: var(--text3); text-align: right; padding-top: 4px; font-variant-numeric: tabular-nums; }
.ed-thumb { position: relative; width: 184px; height: 103.5px; border-radius: 8px; overflow: hidden; outline: 1px solid var(--line2); transition: outline-color .2s, box-shadow .3s; }
.ed-thumb .sc-stage { pointer-events: none; }
.ed-trow.cur .ed-thumb { outline: 2px solid var(--brand); box-shadow: 0 10px 26px -12px rgba(245,200,79,.45); }
.ed-trow.cur .ed-tnum { color: var(--brand); }
.ed-trow.hidden .ed-thumb { opacity: .45; }
.ed-tbadges { position: absolute; left: 30px; bottom: 9px; display: flex; gap: 4px; pointer-events: none; }
.ed-tbadges i { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px; border-radius: 6px; background: rgba(9,11,17,.82); color: var(--text2); font-style: normal; }
.ed-tbadges i .ic { width: 12px; height: 12px; } .ed-tbadges i b { font-size: 10px; }
.ed-tbadges i.q { color: var(--coral); } .ed-tbadges i.m { color: var(--violet); }
.ed-tacts { position: absolute; right: 8px; top: 8px; display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(9,11,17,.88); opacity: 0; transform: translateY(-3px); transition: opacity .2s, transform .3s var(--ease); }
.ed-trow:hover .ed-tacts { opacity: 1; transform: none; }
.ed-gap { position: relative; height: 8px; display: flex; align-items: center; justify-content: center; }
.ed-gap.sugg { height: 34px; }
.ed-gap-plus { position: absolute; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line2); background: var(--bg3); color: var(--text2); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .2s; z-index: 2; }
.ed-gap-plus .ic { width: 12px; height: 12px; }
.ed-gap:hover .ed-gap-plus { opacity: 1; }
.ed-sugg { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 7px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--coral) 70%, transparent); background: color-mix(in srgb, var(--coral) 9%, transparent); color: var(--coral); font-size: 11px; font-weight: 600; cursor: pointer; transition: background .2s, transform .3s var(--ease); margin-left: 18px; }
.ed-sugg:hover { background: color-mix(in srgb, var(--coral) 18%, transparent); transform: translateY(-1px); }
.ed-sugg .ic { width: 14px; height: 14px; }
.ed-drop-line { position: absolute; left: 30px; right: 8px; height: 3px; border-radius: 3px; background: var(--brand); box-shadow: 0 0 12px var(--brand); pointer-events: none; }

/* ── inspector ── */
.ed-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.ed-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 9px; border: 0; background: transparent; cursor: pointer; border-radius: 10px 10px 0 0; transition: background .2s, opacity .2s; }
.ed-tab .ti { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); transition: background .25s, color .25s, transform .35s var(--ease); }
.ed-tab .ti .ic { width: 17px; height: 17px; }
.ed-tab .tl { font-size: 10.5px; font-weight: 600; color: var(--text3); transition: color .2s; }
.ed-tab:hover .ti { transform: translateY(-1px); }
.ed-tab:hover .tl { color: var(--text2); }
.ed-tab.on .ti { background: var(--c); color: #10121a; }
.ed-tab.on .tl { color: var(--c); }
.ed-tab.on::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--c); }
.ed-tab.dim { opacity: .38; }
.ed-insp-body { flex: 1; overflow-y: auto; padding: 12px 12px 60px; }
.ed-panel-title { display: flex; align-items: center; gap: 10px; margin: 2px 2px 12px; }
.ed-panel-title .chip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #10121a; }
.ed-panel-title b { display: block; font: 600 16px/1.1 var(--serif); }
.ed-panel-title small { color: var(--text3); font-size: 12px; }
.ed-grp { position: relative; margin-bottom: 10px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; --c2: var(--c); }
.ed-grp::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); opacity: .85; }
.ed-grp-head { display: flex; align-items: center; gap: 9px; padding: 10px 10px 10px 13px; cursor: pointer; user-select: none; }
.ed-grp-head .chip { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.ed-grp-head .chip .ic { width: 14px; height: 14px; }
.ed-grp-head .t { flex: 1; font-weight: 700; font-size: 12.5px; }
.ed-grp-head .badge { font-size: 10px; padding: 2px 6px; border-radius: 6px; background: var(--bg4); color: var(--text2); }
.ed-grp-head .tw { color: var(--text3); transition: transform .35s var(--ease); display: grid; }
.ed-grp-head .tw .ic { width: 15px; height: 15px; }
.ed-grp.closed .tw { transform: rotate(-90deg); }
.ed-grp-act { width: 24px; height: 24px; border-radius: 7px; border: 0; background: transparent; color: var(--text3); cursor: pointer; display: grid; place-items: center; } .ed-grp-act:hover { background: var(--bg4); color: var(--text); }
.ed-grp-body { padding: 2px 12px 12px 15px; display: flex; flex-direction: column; gap: 9px; }
.ed-grp.closed .ed-grp-body { display: none; }
.ed-row { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.ed-lbl { width: 74px; flex: none; color: var(--text2); font-size: 12px; }
.ed-ctrls { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.ed-ctrls > * { min-width: 0; }
.ed-row2 { display: flex; gap: 6px; flex-wrap: wrap; } .ed-row2 > .ed-btn { flex: 1; }
.ed-col { display: flex; flex-direction: column; gap: 9px; }
.ed-iconrow { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.ed-iconrow .ed-icon-btn { border: 1px solid var(--line2); background: var(--bg3); }
.ed-iconrow .ed-icon-btn:hover { border-color: var(--c); color: var(--c); }
.ed-hint { margin: 0; color: var(--text3); font-size: 11.5px; line-height: 1.45; }
.ed-hint .ic { width: 13px; height: 13px; vertical-align: -2px; color: var(--green); }
.ed-hint b { color: var(--text2); }
.ed-p { margin: 0; color: var(--text2); line-height: 1.5; } .ed-p.dim { color: var(--text3); }
.ed-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 22px 16px; margin: 4px 0 10px; border-radius: 14px; border: 1px dashed var(--line2); color: var(--text3); }
.ed-empty .chip { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.ed-empty p { margin: 0; max-width: 260px; line-height: 1.5; }

/* inputs */
.ed-input { width: 100%; min-height: 32px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg3); color: var(--text); font: 13px var(--ui); transition: border-color .2s, box-shadow .2s; resize: vertical; }
.ed-input:focus { outline: none; border-color: var(--c, var(--blue)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--blue)) 22%, transparent); }
.ed-input.mono { font-family: var(--mono); font-size: 12px; }
.ed-input.small { min-height: 28px; padding: 5px 9px; font-size: 12px; color: var(--text2); }
.ed-num { display: inline-flex; align-items: center; height: 30px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg3); flex: 1; min-width: 64px; transition: border-color .2s; }
.ed-num:focus-within { border-color: var(--c); }
.ed-num-l { padding: 0 4px 0 9px; color: var(--c); font-weight: 700; font-size: 11px; cursor: ew-resize; user-select: none; min-width: 16px; }
.ed-num input { width: 100%; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font: 13px var(--ui); padding: 0 8px; font-variant-numeric: tabular-nums; }
.ed-num.has-lbl input { padding-left: 2px; }
.ed-num input:focus { outline: none; }
.ed-num-u { padding-right: 8px; color: var(--text3); font-size: 11px; }
.ed-slider { flex: 1; display: flex; align-items: center; gap: 8px; --p: 50%; }
.ed-slider input { flex: 1; -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; }
.ed-slider input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--c) var(--p), var(--bg4) var(--p)); }
.ed-slider input::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--c) var(--p), var(--bg4) var(--p)); }
.ed-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 3px solid var(--c); box-shadow: 0 2px 8px rgba(0,0,0,.4); transition: transform .2s var(--ease); }
.ed-slider input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--c); }
.ed-slider input:active::-webkit-slider-thumb { transform: scale(1.2); }
.ed-slider output { min-width: 50px; text-align: right; color: var(--text2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ed-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--line2); max-width: 100%; }
.ed-seg.wrap { flex-wrap: wrap; }
.ed-seg-b { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 26px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text2); cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .2s, color .2s; flex: 1 1 auto; }
.ed-seg-b:hover { color: var(--text); background: var(--bg4); }
.ed-seg-b.on { background: color-mix(in srgb, var(--c, var(--blue)) 22%, var(--bg4)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--blue)) 55%, transparent); }
.ed-seg-b .ic { width: 15px; height: 15px; }
.ed-seg-b .sw { width: 14px; height: 14px; border-radius: 50%; display: block; }
.ed-seg.small .ed-seg-b { height: 24px; padding: 0 7px; font-size: 11.5px; }
.ed-mode .ed-seg { --c: var(--brand); }
.ed-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--text2); font-size: 12px; }
.ed-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.ed-toggle .tr { position: relative; width: 32px; height: 18px; border-radius: 10px; background: var(--bg4); border: 1px solid var(--line2); transition: background .25s, border-color .25s; flex: none; }
.ed-toggle .th { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text3); transition: transform .35s var(--ease), background .25s; }
.ed-toggle input:checked + .tr { background: color-mix(in srgb, var(--c, var(--green)) 30%, var(--bg4)); border-color: var(--c, var(--green)); }
.ed-toggle input:checked + .tr .th { transform: translateX(14px); background: var(--c, var(--green)); }
.ed-toggle input:focus-visible + .tr { outline: 2px solid var(--c); outline-offset: 2px; }
.ed-insert .ed-icon-btn { border: 1px solid var(--line2); }
.ed-insert .ed-icon-btn.on { --c: var(--blue); }
.ed-select-w { position: relative; flex: 1; }
.ed-select { width: 100%; height: 30px; padding: 0 28px 0 10px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg3); color: var(--text); font: 13px var(--ui); appearance: none; -webkit-appearance: none; cursor: pointer; }
.ed-select:focus { outline: none; border-color: var(--c); }
.ed-select-w::after { content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; border-right: 1.6px solid var(--text3); border-bottom: 1.6px solid var(--text3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.ed-color { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 5px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; flex: 1; min-width: 0; transition: border-color .2s; }
.ed-color:hover { border-color: var(--c); }
.ed-color .sw { width: 20px; height: 20px; border-radius: 6px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.ed-color .sw.none { background: repeating-linear-gradient(45deg, #2a3042 0 4px, #1a1f2c 4px 8px) !important; }
.ed-color span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ed-color .cr { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 5px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.ed-color .cr.ok { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green); }
.ed-color .cr.mid { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); }
.ed-color .cr.bad { background: color-mix(in srgb, var(--coral) 22%, transparent); color: var(--coral); }
.ed-fontbtn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-size: 15px; }
.ed-fontbtn:hover { border-color: var(--c); }
.ed-fontbtn .ic { width: 14px; height: 14px; color: var(--text3); }
.ed-fitpill { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--bg4); color: var(--text3); font-size: 11px; font-weight: 700; flex: none; }
.ed-fitpill .ic { width: 13px; height: 13px; }
.ed-fitpill.on { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); }

/* grids inside panels */
.ed-fx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ed-fx { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px 6px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; transition: border-color .2s, background .2s, transform .3s var(--ease); }
.ed-fx:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); transform: translateY(-1px); }
.ed-fx.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--bg3)); }
.ed-fx-stage { position: relative; width: 46px; height: 26px; border-radius: 6px; background: var(--bg1); overflow: hidden; display: grid; place-items: center; }
.ed-fx-dot { display: block; width: 26px; height: 12px; border-radius: 4px; background: var(--c); }
.ed-fx-n { font-size: 10.5px; font-weight: 600; color: var(--text2); text-align: center; line-height: 1.15; }
.ed-fx.on .ed-fx-n { color: var(--text); }
.ed-shape-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.ed-shape-b { aspect-ratio: 1.2; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; display: grid; place-items: center; color: var(--green); transition: border-color .2s, background .2s, transform .3s var(--ease); padding: 6px; }
.ed-shape-b svg { width: 100%; height: 100%; }
.ed-shape-b:hover { border-color: var(--green); transform: translateY(-1px); }
.ed-shape-b.on { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, var(--bg3)); }
.ed-shape-pop { width: 330px; padding: 10px; }
.ed-lay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.ed-lay { display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; text-align: left; font-size: 11px; font-weight: 600; color: var(--text2); transition: border-color .2s, transform .3s var(--ease); }
.ed-lay:hover { border-color: var(--pink); transform: translateY(-1px); color: var(--text); }
.ed-lay.on { border-color: var(--pink); }
.ed-lay-svg { width: 100%; aspect-ratio: 16/9; border-radius: 6px; background: #10131f; display: block; }
.ed-lay-pop { width: 380px; padding: 10px; } .ed-lay-pop .ed-lay-grid { grid-template-columns: repeat(3, 1fr); }
.ed-tr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ed-tr { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-size: 10.5px; font-weight: 600; color: var(--text2); transition: border-color .2s; }
.ed-tr:hover { border-color: var(--pink); } .ed-tr.on { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 12%, var(--bg3)); color: var(--text); }
.ed-tr-demo { position: relative; width: 52px; height: 30px; border-radius: 6px; overflow: hidden; background: var(--bg1); }
.ed-tr-demo i { position: absolute; inset: 0; }
.ed-tr-demo i:nth-child(1) { background: linear-gradient(135deg, #3b4560, #2a3146); }
.ed-tr-demo i:nth-child(2) { background: linear-gradient(135deg, var(--pink), #8f5cff); opacity: 0; }
.ed-tr-demo .sc-slab { position: absolute; inset: 0; background: var(--brand); }
.ed-tones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ed-tone { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 9px 9px 7px; border-radius: 11px; border: 1px solid rgba(255,255,255,.08); cursor: pointer; transition: transform .35s var(--ease), box-shadow .3s; overflow: hidden; }
.ed-tone b { font: 600 20px/1 var(--serif); }
.ed-tone .sw { display: flex; gap: 3px; } .ed-tone .sw i { width: 9px; height: 9px; border-radius: 50%; }
.ed-tone em { font-style: normal; font-size: 10.5px; font-weight: 600; opacity: .8; }
.ed-tone:hover { transform: translateY(-2px); }
.ed-tone.on { box-shadow: 0 0 0 2px var(--brand); }
.ed-pairs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ed-pairb { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: center; padding: 8px 9px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; text-align: left; transition: border-color .2s; }
.ed-pairb b { grid-row: span 2; font-size: 24px; font-weight: 500; }
.ed-pairb span { font-size: 13px; } .ed-pairb small { font-size: 10px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-pairb:hover, .ed-pairb.on { border-color: var(--c); } .ed-pairb.on { background: color-mix(in srgb, var(--c) 10%, var(--bg3)); }
.ed-bg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ed-bgb { display: flex; flex-direction: column; gap: 5px; padding: 5px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text2); transition: border-color .2s, transform .3s var(--ease); }
.ed-bgb:hover { border-color: var(--c); transform: translateY(-1px); } .ed-bgb.on { border-color: var(--brand); color: var(--text); }
.ed-bgb-pv { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; }
.ed-bgb-pv canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-contrast { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; border: 1px solid var(--line2); }
.ed-contrast .ic { width: 20px; height: 20px; flex: none; }
.ed-contrast b { display: block; font-size: 12.5px; } .ed-contrast small { color: var(--text3); }
.ed-contrast.ok .ic, .ed-contrast.fixed .ic { color: var(--green); } .ed-contrast.bad .ic { color: var(--coral); }
.ed-contrast.bad { border-color: color-mix(in srgb, var(--coral) 50%, transparent); }
.ed-order { display: flex; flex-direction: column; gap: 4px; }
.ed-order-row { display: grid; grid-template-columns: 24px 1fr auto auto auto; gap: 6px; align-items: center; padding: 5px 6px; border-radius: 9px; background: var(--bg3); border: 1px solid transparent; cursor: pointer; }
.ed-order-row:hover { border-color: var(--line2); } .ed-order-row.on { border-color: var(--violet); }
.ed-order-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 12px; }
.ed-order-row .fx { font-size: 11px; color: var(--text3); white-space: nowrap; }
.ed-step { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg4); color: var(--violet); font-size: 10px; font-weight: 800; }
.ed-step.click { background: var(--violet); color: #160f2b; }
.ed-list { display: flex; flex-direction: column; gap: 5px; }
.ed-list-row { display: flex; gap: 5px; align-items: flex-start; padding: 5px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--line); }
.ed-list-ord { display: flex; flex-direction: column; }
.ed-list-ord .ed-icon-btn { width: 20px; height: 16px; } .ed-list-ord .ic { width: 12px; height: 12px; }
.ed-list-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-list-body > .ed-num { flex: none; width: 100%; }
.ed-opt-top { display: flex; gap: 5px; align-items: center; }
.ed-correct { width: 28px; height: 28px; flex: none; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text3); cursor: pointer; display: grid; place-items: center; transition: all .25s; }
.ed-correct.on { background: var(--green); border-color: var(--green); color: #0c1a12; }
.ed-correct .ic { width: 15px; height: 15px; }
.ed-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 5px; align-items: center; color: var(--text3); }
.ed-qtypes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ed-qtypes.compact { grid-template-columns: repeat(4, 1fr); }
.ed-qtype { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; text-align: left; transition: border-color .2s, transform .3s var(--ease); }
.ed-qtype .chip { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral); flex: none; }
.ed-qtype .chip .ic { width: 15px; height: 15px; }
.ed-qtype b { font-size: 11.5px; line-height: 1.15; }
.ed-qtypes.compact .ed-qtype { flex-direction: column; gap: 4px; padding: 7px 3px; text-align: center; } .ed-qtypes.compact .ed-qtype b { font-size: 10px; font-weight: 600; }
.ed-qtype:hover { border-color: var(--coral); transform: translateY(-1px); }
.ed-qtype.on { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 14%, var(--bg3)); }
.ed-qtype.on .chip { background: var(--coral); color: #2a0f0a; }
.ed-tbl-edit { display: grid; gap: 3px; }
.ed-tbl-edit .ed-input { min-height: 28px; padding: 4px 7px; font-size: 12px; }
.ed-tbl-edit .ed-input.head { font-weight: 700; border-color: color-mix(in srgb, var(--green) 40%, var(--line2)); }
.ed-cp { display: flex; gap: 5px; align-items: center; } .ed-cp .ed-num { flex: none; width: 100px; }
.ed-cp-q { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); font-size: 12px; }
.ed-cp-inner { margin: 6px 0 10px; padding-left: 8px; border-left: 2px solid var(--coral); }

/* ── popovers, menus, modals, toasts ── */
.ed-pop { position: fixed; z-index: 85; min-width: 180px; max-height: calc(100vh - 20px); overflow: auto; border-radius: 14px; background: rgba(19,23,34,.97); backdrop-filter: blur(16px); border: 1px solid var(--line2); box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.3); opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left; transition: opacity .18s, transform .3s var(--ease); --c: var(--blue); }
.ed-pop.in { opacity: 1; transform: none; }
.ed-pop-t { display: flex; align-items: center; gap: 6px; font-weight: 700; margin: 2px 2px 10px; color: var(--text2); }
.ed-pop-t .ic { width: 15px; height: 15px; }
.ed-menu { padding: 5px; min-width: 220px; }
.ed-menu-item { display: grid; grid-template-columns: 20px 1fr auto; grid-template-rows: auto auto; column-gap: 9px; align-items: center; width: 100%; padding: 7px 9px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; }
.ed-menu-item .ic { width: 16px; height: 16px; color: var(--c, var(--text3)); grid-row: span 2; }
.ed-menu-item small { grid-column: 2 / 4; color: var(--text3); font-size: 11px; }
.ed-menu-item:hover:not(:disabled) { background: var(--bg4); }
.ed-menu-item:disabled { opacity: .4; cursor: default; }
.ed-menu-item.danger { color: var(--coral); } .ed-menu-item.danger .ic { color: var(--coral); }
.ed-menu-item.active { background: color-mix(in srgb, var(--c, var(--blue)) 14%, transparent); }
.ed-menu-item kbd { font-size: 10px; }
.ed-menu-sep { height: 1px; margin: 5px 6px; background: var(--line2); }
.ed-menu-head { padding: 6px 9px 4px; font: 700 10px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text3); }
.ed-colorpop { width: 252px; padding: 10px; }
.ed-colorpop.compact { width: auto; display: flex; gap: 5px; padding: 8px; flex-wrap: wrap; max-width: 260px; }
.ed-cp-t { font: 700 10px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text3); margin: 8px 0 5px; }
.ed-cp-t:first-child { margin-top: 0; }
.ed-cp-row { display: flex; flex-wrap: wrap; gap: 5px; }
.ed-cp-sw { width: 24px; height: 24px; border-radius: 7px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); transition: transform .25s var(--ease); }
.ed-cp-sw:hover { transform: scale(1.15); }
.ed-cp-sw.on { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--text); }
.ed-cp-sw.none { background: repeating-linear-gradient(45deg, #2a3042 0 4px, #1a1f2c 4px 8px) !important; }
.ed-cp-custom { display: flex; gap: 6px; align-items: center; }
.ed-cp-custom input[type=color] { width: 36px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; }
.ed-fontpop { width: 300px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ed-font-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ed-font-cat { font: 700 10px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text3); margin: 8px 6px 2px; }
.ed-font-item { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 17px; text-align: left; }
.ed-font-item small { font-size: 12px; color: var(--text3); }
.ed-font-item:hover { background: var(--bg4); } .ed-font-item.on { background: color-mix(in srgb, var(--amber) 16%, transparent); }
.ed-modal-back { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(4,5,9,.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.ed-modal-back.in { opacity: 1; }
.ed-modal { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 20px; background: var(--bg1); border: 1px solid var(--line2); box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); transform: translateY(16px) scale(.98); transition: transform .5s var(--ease); overflow: hidden; --c: var(--blue); }
.ed-modal::before { content: ""; height: 3px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 30%, transparent)); flex: none; }
.ed-modal.wide { width: min(780px, 100%); }
.ed-modal-back.in .ed-modal { transform: none; }
.ed-modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 6px 20px; }
.ed-modal-head .chip { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.ed-modal-head h2 { flex: 1; margin: 0; font: 600 21px/1.2 var(--serif); }
.ed-modal-body { padding: 12px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ed-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--bg2); }
.ed-toasts { position: fixed; left: 50%; bottom: 22px; z-index: 90; display: flex; flex-direction: column-reverse; gap: 8px; align-items: center; transform: translateX(-50%); pointer-events: none; }
.ed-toast { display: flex; align-items: center; gap: 9px; max-width: 560px; padding: 11px 16px; border-radius: 12px; background: rgba(24,28,40,.96); border: 1px solid var(--line2); box-shadow: 0 20px 40px -16px rgba(0,0,0,.8); opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .3s, transform .5s var(--ease); }
.ed-toast.in { opacity: 1; transform: none; }
.ed-toast .ic { color: var(--blue); } .ed-toast.good .ic { color: var(--green); } .ed-toast.bad .ic { color: var(--coral); }

/* import / export */
.ed-imp-pane { display: flex; flex-direction: column; gap: 10px; }
.ed-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border-radius: 16px; border: 1.5px dashed var(--line2); background: var(--bg2); cursor: pointer; text-align: center; transition: border-color .2s, background .2s; }
.ed-drop .ic { width: 30px; height: 30px; color: var(--blue); }
.ed-drop b { font-size: 15px; } .ed-drop span { color: var(--text3); font-size: 12px; }
.ed-drop:hover, .ed-drop.over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--bg2)); }
.ed-drop.has { border-style: solid; border-color: color-mix(in srgb, var(--green) 60%, transparent); } .ed-drop.has .ic { color: var(--green); }
.ed-imp-h { display: flex; align-items: center; gap: 6px; font: 700 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text3); margin-bottom: -4px; }
.ed-imp-h .ic { width: 14px; height: 14px; }
.ed-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.ed-modecard { display: flex; flex-direction: column; gap: 5px; padding: 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; text-align: left; transition: border-color .2s, transform .35s var(--ease), background .2s; }
.ed-modecard .chip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.ed-modecard b { font-size: 13px; } .ed-modecard small { color: var(--text3); font-size: 11.5px; line-height: 1.4; }
.ed-modecard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 50%, transparent); }
.ed-modecard.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, var(--bg2)); }
.ed-modecard.on .chip { background: var(--blue); color: #0c1020; }
.ed-imp-opts { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.ed-import .ed-modal-body > .ed-seg { align-self: flex-start; }
.ed-progress { padding: 30px 6px; display: flex; flex-direction: column; gap: 12px; }
.ed-progress-bar { height: 6px; border-radius: 6px; background: var(--bg4); overflow: hidden; }
.ed-progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--violet)); transform-origin: 0 50%; transform: scaleX(.03); transition: transform .6s var(--ease); }
.ed-progress p { margin: 0; color: var(--text2); }
.ed-err { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--coral) 50%, transparent); background: color-mix(in srgb, var(--coral) 8%, var(--bg2)); }
.ed-err .ic { color: var(--coral); width: 22px; height: 22px; } .ed-err p { margin: 4px 0 0; color: var(--text2); line-height: 1.5; }
.ed-xcard { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; border: 1px solid var(--line2); background: var(--bg2); }
.ed-xcard .chip { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.ed-xcard b { display: block; font-size: 14px; margin-bottom: 2px; } .ed-xcard small { color: var(--text3); line-height: 1.45; }
.ed-hosting { display: flex; flex-direction: column; gap: 6px; }
.ed-host { border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); }
.ed-host summary { padding: 10px 12px; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.ed-host summary::before { content: "›"; color: var(--green); font-size: 16px; transition: transform .3s var(--ease); }
.ed-host[open] summary::before { transform: rotate(90deg); }
.ed-host p { margin: 0; padding: 0 12px 12px 26px; color: var(--text2); line-height: 1.55; }
.ed-code { margin: 0; padding: 12px; border-radius: 12px; background: var(--bg0); border: 1px solid var(--line); font: 12px/1.5 var(--mono); white-space: pre-wrap; color: var(--text2); max-height: 320px; overflow: auto; }
.ed-help { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.ed-help-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--text2); }
.ed-help .ed-hint { grid-column: 1 / -1; margin-top: 8px; }

/* preview */
.ed-preview { position: fixed; inset: 0; z-index: 80; background: #000; opacity: 0; transition: opacity .35s; }
.ed-preview.in { opacity: 1; }
.ed-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ed-preview-x { position: absolute; left: 16px; top: 16px; z-index: 2; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(12,14,22,.7); backdrop-filter: blur(12px); color: #f3f0e8; cursor: pointer; opacity: .55; transition: opacity .3s; }
.ed-preview-x:hover { opacity: 1; }

@media (max-width: 1500px) { .ed-ins .il { font-size: 12px; } .ed-ins-t { display: none; } }
@media (max-width: 1280px) { .ed-main { grid-template-columns: 232px 1fr 330px; } .ed-ins .il { display: none; } .ed-ins { padding: 0 5px; } .ed-tone-btn span { display: none; } }
@media (max-width: 900px) { .ed-main { grid-template-columns: 1fr; grid-template-rows: 1fr 40%; } .ed-left { display: none; } .ed-right { border-left: 0; border-top: 1px solid var(--line); } .ed-tgrp:nth-of-type(2) { display: none; } }

/* scene gallery */
.ed-scene-pop { width: 560px; padding: 10px; }
.ed-scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.ed-scene-b { display: flex; flex-direction: column; gap: 5px; padding: 5px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text2); text-align: left; transition: border-color .2s, transform .3s var(--ease); }
.ed-scene-b:hover { border-color: var(--violet); color: var(--text); transform: translateY(-1px); }
.ed-scene-pv { position: relative !important; width: 160px !important; height: 90px !important; transform: none !important; border-radius: 6px; overflow: hidden; contain: strict; }
.ed-scene-pv .sc-scene { position: absolute; left: 0; top: 0; width: 480px; height: 270px; transform: scale(.3333); transform-origin: 0 0; }
.ed-img-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.ed-img-opt { aspect-ratio: 1.4; border-radius: 8px; border: 2px solid transparent; background: var(--bg4) center / cover no-repeat; cursor: pointer; display: grid; place-items: center; color: var(--text3); }
.ed-img-opt.on { border-color: var(--green); } .ed-img-opt.add { border: 1.5px dashed var(--line2); }
.ed-lbl.wide { width: auto; }

/* cropper */
.ed-cropper .ed-modal-body { align-items: center; }
.ed-crop-stage { position: relative; max-width: 100%; max-height: 60vh; width: min(100%, calc(60vh * var(--ar, 1.6))); user-select: none; touch-action: none; cursor: crosshair; border-radius: 8px; overflow: hidden; background: #000; }
.ed-crop-stage img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.ed-crop-shade { position: absolute; inset: 0; background: rgba(5,6,10,.62); pointer-events: none; }
.ed-crop-box { position: absolute; border: 2px solid var(--green); box-shadow: 0 0 0 1px rgba(0,0,0,.4); cursor: move; }
.ed-crop-box > i { position: absolute; background: rgba(255,255,255,.28); pointer-events: none; }
.ed-crop-box .g1, .ed-crop-box .g2 { top: 0; bottom: 0; width: 1px; } .ed-crop-box .g1 { left: 33.33%; } .ed-crop-box .g2 { left: 66.66%; }
.ed-crop-box .g3, .ed-crop-box .g4 { left: 0; right: 0; height: 1px; } .ed-crop-box .g3 { top: 33.33%; } .ed-crop-box .g4 { top: 66.66%; }
.ed-crop-h { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 4px; background: #fff; border: 2px solid var(--green); cursor: nwse-resize; }
.ed-crop-h[data-hx="0"] { cursor: ns-resize; } .ed-crop-h[data-hy="0"] { cursor: ew-resize; } .ed-crop-h[data-hx="1"][data-hy="-1"], .ed-crop-h[data-hx="-1"][data-hy="1"] { cursor: nesw-resize; }
.ed-crop-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; --c: var(--green); }
.ed-crop-info { margin-left: auto; color: var(--text3); font-variant-numeric: tabular-nums; font-size: 12px; }
/* picture review */
.ed-review .ed-modal-body { gap: 10px; }
.ed-rv-row { padding: 12px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.ed-rv-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; } .ed-rv-head b { color: var(--green); } .ed-rv-head span { color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-rv-strip { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.ed-rv-page { position: relative; width: 240px; border-radius: 8px; background: center / cover no-repeat; outline: 1px solid var(--line2); flex: none; }
.ed-rv-page i { position: absolute; border: 2px solid var(--green); background: rgba(109,212,162,.14); border-radius: 3px; }
.ed-rv-page i.off { border-color: var(--coral); border-style: dashed; background: none; }
.ed-rv-page i b, .ed-rv-img b { position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #0c1a12; font: 800 10px/18px var(--ui); text-align: center; }
.ed-rv-card { display: flex; flex-direction: column; gap: 6px; width: 150px; transition: opacity .25s; }
.ed-rv-card.off { opacity: .45; }
.ed-rv-img { position: relative; width: 150px; height: 100px; border-radius: 8px; background: #000 center / contain no-repeat; outline: 1px solid var(--line2); }
.ed-rv-acts { display: flex; gap: 3px; } .ed-rv-acts .ed-icon-btn { border: 1px solid var(--line2); background: var(--bg3); }
.ed-rv-acts .keep { --c: var(--green); } .ed-rv-acts .drop { color: var(--coral); }
.ed-rv-add { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 150px; min-height: 100px; border-radius: 8px; border: 1.5px dashed var(--line2); background: transparent; color: var(--text2); cursor: pointer; font-size: 12px; }
.ed-rv-add:hover { border-color: var(--green); color: var(--green); }

/* AI assist */
.ed-btn.ai { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 45%, var(--line2)); }
.ed-btn.ai:hover:not(:disabled) { background: color-mix(in srgb, var(--violet) 14%, var(--bg3)); }
.ai-modal .ed-modal { width: min(1000px, 100%); }
.ai-modal .ed-modal-body { --c: var(--violet); }
.ai-tabs { align-self: flex-start; }
.ai-status { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; color: var(--text2); border: 1px solid var(--line2); }
.ai-status.on { border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: color-mix(in srgb, var(--violet) 8%, transparent); } .ai-status.on .ic { color: var(--violet); }
.ai-card { display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.ai-card > b { font-size: 13px; }
.ai-types { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg3); color: var(--text3); cursor: pointer; font-weight: 600; font-size: 12px; }
.ai-chip.on { border-color: var(--coral); color: var(--text); background: color-mix(in srgb, var(--coral) 14%, var(--bg3)); }
.ai-go { display: flex; gap: 8px; justify-content: flex-end; }
.ai-prog { display: flex; flex-direction: column; gap: 12px; padding: 8px 2px; } .ai-prog > .ed-btn { align-self: flex-end; }
.ai-segs { display: flex; flex-direction: column; gap: 5px; max-height: 46vh; overflow: auto; }
.ai-seg { display: grid; grid-template-columns: 18px 130px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg2); font-size: 12.5px; }
.ai-seg em { color: var(--text3); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ai-seg small { color: var(--text3); }
.ai-seg .st { width: 12px; height: 12px; border-radius: 50%; background: var(--line2); }
.ai-seg.busy .st { background: var(--violet); animation: aipulse 1s ease-in-out infinite; } .ai-seg.ok .st { background: var(--green); } .ai-seg.err .st { background: var(--coral); } .ai-seg.err small { color: var(--coral); }
@keyframes aipulse { 50% { transform: scale(.6); opacity: .5; } }
.ai-rv-head { display: flex; flex-direction: column; gap: 2px; } .ai-rv-head b { font: 600 17px var(--serif); } .ai-rv-head span { color: var(--text3); font-size: 12px; }
.ai-rv-list { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow: auto; padding-right: 4px; }
.ai-q { padding: 12px 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--coral); transition: opacity .25s; }
.ai-q.off { opacity: .45; }
.ai-q-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 11.5px; }
.ai-q-top .chip { padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--coral) 18%, transparent); color: var(--coral); font-weight: 700; }
.ai-q-top .after { color: var(--text3); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; } .src.gemini, em.gemini { color: var(--violet); } .src.rules, em.rules { color: var(--text3); }
.src.gemini { background: color-mix(in srgb, var(--violet) 15%, transparent); } .src.rules { background: var(--bg4); }
.ai-q-p { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ai-q ul, .ai-q ol { margin: 0 0 6px; padding-left: 18px; color: var(--text2); font-size: 12.5px; } .ai-q ul { list-style: none; padding-left: 2px; }
.ai-q li { margin: 3px 0; } .ai-q li.ok { color: var(--green); } .ai-q li small { display: block; color: var(--text3); margin-left: 14px; }
.ai-q .ans { margin: 0 0 6px; color: var(--text2); font-size: 12.5px; } .ai-q mark { background: color-mix(in srgb, var(--green) 25%, transparent); color: var(--text); border-radius: 3px; padding: 0 3px; }
.ai-q-h { font-size: 11.5px; color: var(--text3); margin-bottom: 8px; }
.ai-q-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .ai-q-acts .ed-select-w { flex: 0 1 260px; }
.ai-q-acts .keep { background: color-mix(in srgb, var(--green) 18%, var(--bg3)); border-color: var(--green); color: var(--text); }
.ai-q-edit { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); --c: var(--coral); }
.ai-il-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.ai-il { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--violet); transition: opacity .25s; }
.ai-il.off { opacity: .45; }
.ai-il-pv { position: relative; width: 320px; height: 180px; border-radius: 8px; overflow: hidden; outline: 1px solid var(--line2); }
.ai-il-pv .sc-stage { position: absolute; }
.ai-il-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; } .ai-il-meta span { color: var(--text2); } .ai-il-meta em { font-style: normal; font-weight: 700; } .ai-il-meta small { color: var(--text3); }
.ai-rv-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 6px; }

/* effect library search + group chips */
.ed-fx-wrap { display: grid; gap: 8px; }
.ed-fx-tools { display: flex; gap: 6px; }
.ed-fx-q { flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 6px 9px; font: inherit; font-size: 12px; }
.ed-fx-q:focus { outline: none; border-color: var(--c, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--brand)) 25%, transparent); }
.ed-fx-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-fx-chip { border: 1px solid var(--line); background: transparent; color: var(--text2); border-radius: 99px; padding: 3px 9px; font: inherit; font-size: 11px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.ed-fx-chip i { font-style: normal; opacity: .6; font-size: 10px; }
.ed-fx-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--c, var(--brand)) 60%, var(--line)); }
.ed-fx-chip.on { background: color-mix(in srgb, var(--c, var(--brand)) 22%, transparent); border-color: var(--c, var(--brand)); color: var(--text); }
.ed-fx-chip.rnd { margin-left: auto; font-size: 14px; padding: 1px 8px; }
.ed-fx[hidden] { display: none !important; }

/* question editor extras */
.ed-qpic-row { display: flex; gap: 8px; align-items: center; }
.ed-qpic { flex: 1; min-height: 48px; max-height: 90px; border: 1px dashed var(--line2); border-radius: 8px; display: grid; place-items: center; overflow: hidden; color: var(--text3); font-size: 12px; }
.ed-qpic img { max-width: 100%; max-height: 90px; display: block; }
.ed-qpic span { display: inline-flex; gap: 6px; align-items: center; }
.ed-pinmap { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line2); line-height: 0; touch-action: none; }
.ed-pinmap img { width: 100%; display: block; pointer-events: none; }
.ed-pinmap i { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--coral); color: #111; font: 700 11px/22px var(--mono); text-align: center; font-style: normal; cursor: grab; box-shadow: 0 0 0 3px rgba(0,0,0,.5); }
.ed-pinmap i:active { cursor: grabbing; transform: scale(1.2); }
.ed-pin-n { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--coral); color: #111; font: 700 11px/22px var(--mono); text-align: center; }
.ed-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin: 6px 0 -2px; }
.ed-inline { display: flex; gap: 6px; align-items: center; } .ed-inline > * { min-width: 0; flex: 1; } .ed-inline span { flex: none; color: var(--text3); }

/* ── top bar: palette + check ── */
.ed-palbtn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text3); font: inherit; font-size: 12px; cursor: pointer; min-width: 210px; transition: border-color .2s, color .2s; }
.ed-palbtn:hover { color: var(--text); border-color: var(--slate); }
.ed-palbtn span { flex: 1; text-align: left; }
.ed-palbtn kbd, .ed-pal kbd { font: 600 10px var(--mono); padding: 2px 5px; border-radius: 4px; background: var(--bg4); color: var(--text2); border: 1px solid var(--line2); }
.ed-palbtn svg { width: 15px; height: 15px; }
.ed-checkbtn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line2); background: transparent; color: var(--text2); font: inherit; font-size: 12.5px; cursor: pointer; }
.ed-checkbtn svg { width: 15px; height: 15px; }
.ed-checkbtn[data-sev="ok"] { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, var(--line2)); }
.ed-checkbtn[data-sev="warn"] { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, var(--line2)); }
.ed-checkbtn[data-sev="error"] { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 55%, var(--line2)); background: color-mix(in srgb, var(--coral) 10%, transparent); }
.ed-checkbtn[data-n]:not([data-n=""])::after { content: attr(data-n); position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font: 700 10px/17px var(--ui); text-align: center; color: #14161f; background: currentColor; }
.ed-checkbtn[data-n]:not([data-n=""])::after { color: #14161f; }
.ed-checkbtn[data-sev="warn"]::after { background: var(--amber); } .ed-checkbtn[data-sev="error"]::after { background: var(--coral); }

/* ── command palette ── */
.ed-pal-back { position: fixed; inset: 0; z-index: 120; background: rgba(6,8,12,.55); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh; opacity: 0; transition: opacity .18s; }
.ed-pal-back.in { opacity: 1; }
.ed-pal { width: min(680px, 92vw); max-height: 70vh; display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 40px 120px -20px rgba(0,0,0,.7); overflow: hidden; transform: translateY(-8px) scale(.985); transition: transform .25s var(--ease); }
.ed-pal-back.in .ed-pal { transform: none; }
.ed-pal-top { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--text3); }
.ed-pal-top svg { width: 18px; height: 18px; flex: none; }
.ed-pal-in { flex: 1; height: 54px; background: transparent; border: 0; outline: 0; color: var(--text); font: 500 16px var(--ui); }
.ed-pal-list { overflow: auto; padding: 6px; }
.ed-pal-row { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px; cursor: pointer; border-left: 3px solid transparent; }
.ed-pal-row .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.ed-pal-row .ic svg { width: 15px; height: 15px; }
.ed-pal-row .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-pal-row .t small { display: block; color: var(--text3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.ed-pal-row .cat { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--c); padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, transparent); }
.ed-pal-row.on { background: color-mix(in srgb, var(--c) 13%, var(--bg3)); border-left-color: var(--c); }
.ed-pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--text3); font-size: 11px; }
.ed-pal-foot .n { margin-left: auto; }

/* ── deck check ── */
.ed-health-sum { display: flex; gap: 8px; margin-bottom: 12px; }
.ed-health-pill { padding: 4px 11px; border-radius: 99px; font-size: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.ed-health-group { margin: 0 0 14px; border-left: 3px solid var(--c); padding-left: 12px; }
.ed-health-gt { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--c); margin-bottom: 6px; }
.ed-health-gt svg { width: 15px; height: 15px; }
.ed-health-row { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.ed-health-row:hover { background: var(--bg3); }
.ed-health-row .sl { font: 600 11px var(--mono); color: var(--text3); }
.ed-health-row.fixed { opacity: .45; text-decoration: line-through; }
.ed-health-ok { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 12px; background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--text); }
.ed-health-ok svg { width: 34px; height: 34px; color: var(--green); flex: none; }

/* ── layers ── */
.ed-layers { width: 320px; max-height: 60vh; display: flex; flex-direction: column; }
.ed-layers .ed-pop-t small { color: var(--text3); font-weight: 400; margin-left: 6px; }
.ed-layer-list { overflow: auto; display: grid; gap: 3px; padding: 2px; }
.ed-layer { display: grid; grid-template-columns: 26px 1fr auto auto auto; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; border-left: 3px solid var(--c); background: var(--bg3); cursor: pointer; }
.ed-layer .chip { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.ed-layer .chip svg { width: 13px; height: 13px; }
.ed-layer .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.ed-layer .ty { font: 10px var(--mono); color: var(--c); text-transform: uppercase; }
.ed-layer.on { background: color-mix(in srgb, var(--c) 16%, var(--bg3)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); }
.ed-layer.locked .n { opacity: .55; }
.ed-layer.over { box-shadow: inset 0 -2px 0 var(--brand); }
.ed-layer.drag { opacity: .4; }
.ed-empty-s { color: var(--text3); padding: 14px; text-align: center; font-size: 12px; }

/* ── find & replace / versions ── */
.ed-find-bar { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.ed-find-bar .ed-in { flex: 1; }
.ed-in { background: var(--bg1); border: 1px solid var(--line2); border-radius: 9px; color: var(--text); padding: 8px 10px; font: inherit; }
.ed-in:focus { outline: 0; border-color: var(--c, var(--blue)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--blue)) 22%, transparent); }
.ed-chipbtn { border: 1px solid var(--line2); background: transparent; color: var(--text2); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.ed-chipbtn.on { border-color: var(--blue); color: var(--text); background: color-mix(in srgb, var(--blue) 18%, transparent); }
.ed-find-n { color: var(--text3); font-size: 12px; margin: 4px 0 8px; }
.ed-find-res { max-height: 46vh; overflow: auto; display: grid; gap: 3px; }
.ed-find-row { display: grid; grid-template-columns: 62px 110px 1fr; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; align-items: baseline; }
.ed-find-row:hover { background: var(--bg3); }
.ed-find-row .sl { font: 600 11px var(--mono); color: var(--blue); }
.ed-find-row .lb { color: var(--text3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-find-row mark { background: color-mix(in srgb, var(--yellow) 40%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.ed-snap-list { display: grid; gap: 6px; margin-top: 10px; }
.ed-snap { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg3); border-left: 3px solid var(--green); }
.ed-snap .chip { color: var(--green); } .ed-snap .chip svg { width: 16px; height: 16px; }
.ed-snap small { display: block; color: var(--text3); font-size: 11px; }
/* responsive top bar with palette/check/tools */
.ed-tleft { flex: 1 1 auto; }
.ed-title { min-width: 120px; }
.ed-palbtn { min-width: 0; flex: 0 1 230px; }
@media (max-width: 1800px) { .ed-palbtn span { display: none; } .ed-palbtn { flex: none; } .ed-tright .ed-btn.ghost span { font-size: 12.5px; } }
@media (max-width: 1660px) { .ed-ins-t { display: none; } .ed-ins .il { font-size: 12px; } .ed-ins { padding: 0 6px 0 4px; gap: 5px; } .ed-tright [title="Shortcuts & help (?)"] { display: none; } }
@media (max-width: 1560px) { .ed-tright .ed-btn.ghost:not(.ai) span, .ed-checkbtn span { display: none; } .ed-tright .ed-btn.ghost:not(.ai), .ed-checkbtn { padding: 0 9px; } .ed-ins[title="Code"] .il, .ed-ins[title="Table"] .il, .ed-ins[title="Diagram"] .il { display: none; } }
@media (max-width: 1380px) { .ed-ins .il { display: none; } .ed-brand b { display: none; } }
@media (max-width: 1660px) { .ed-ins[title="Code"] .il, .ed-ins[title="Table"] .il, .ed-ins[title="Diagram"] .il { display: none; } }
@media (max-width: 1500px) { .ed-ins[title="Image"] .il, .ed-ins[title="Media"] .il { display: none; } .ed-insert .ed-zoom .ed-zoom-l { min-width: 0; padding: 0 4px; } }

/* type-coloured selection: each kind of object keeps its colour everywhere */
.ed-type-tag { position: absolute; left: 0; bottom: 100%; transform: translateY(calc(-6px * var(--inv))) scale(var(--inv)); transform-origin: 0 100%; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 5px; border-radius: 6px; background: var(--tc, var(--blue)); color: #11131a; font: 700 11px/18px var(--ui); white-space: nowrap; letter-spacing: .02em; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.ed-type-tag svg { width: 12px; height: 12px; }
.ed-type-tag small { font-weight: 500; opacity: .75; }
.ed-sel.rot-tag .ed-type-tag { display: none; }

/* slide list: section stripe + colour-coded badges */
.ed-trow .ed-thumb { position: relative; }
.ed-trow::before { content: ""; position: absolute; left: 1px; top: 26px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--sec, transparent); opacity: .85; }
.ed-trow .ed-tnum { color: color-mix(in srgb, var(--sec, var(--text3)) 80%, var(--text3)); }
.ed-tbadges i.sc { color: var(--violet); } .ed-tbadges i.md { color: var(--blue); } .ed-tbadges i.nt { color: var(--slate); }
.ed-tbadges i.warn { color: #14161f; background: var(--amber); } .ed-tbadges i.err { color: #14161f; background: var(--coral); animation: ed-pulse 2.4s ease-in-out infinite; }
@keyframes ed-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 30%, transparent); } }

/* build list rows: object colour on the left, step colour by trigger */
.ed-order-row { border-left: 3px solid transparent; }
.ed-order-row .ed-ot { display: inline-grid; place-items: center; width: 18px; } .ed-order-row .ed-ot svg { width: 13px; height: 13px; }
.ed-order-row.out { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,125,108,.06) 8px 16px); }
.ed-step.click { background: var(--violet) !important; color: #14161f !important; }
.ed-order-row { grid-template-columns: 18px 24px 1fr auto auto auto; border-left-width: 3px; }
/* inspector subtitle chip follows the selected object's colour */
.ed-insp-sub-type { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 4px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #14161f; background: var(--tc); margin-right: 6px; }
.ed-insp-sub-type svg { width: 11px; height: 11px; }

.ed-mode, .ed-mode .ed-seg, .ed-tgrp { flex-wrap: nowrap; flex: none; }
.ed-save { white-space: nowrap; }
@media (max-width: 1700px) { .ed-save span { display: none; } }
.ed-fx-chip.rnd svg { width: 13px; height: 13px; }
.ed-checkbtn[data-sev="error"] { animation: ed-pulse 2.4s ease-in-out infinite; }
