/* Folien-Editor */
body.editor-mode .content { padding: 0; max-width: none; }
body.editor-mode .top { display: none; }
.ed { display: grid; grid-template-columns: 200px 1fr 340px; grid-template-rows: auto 1fr; height: calc(100vh - 52px); background: var(--bg); }
.ed-ctx { width: auto; max-width: 280px; height: 32px; font-weight: 700; }
.ed-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: relative; z-index: 20; }
.ed-bar .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.ed-bar .name { font-weight: 700; border: 1px solid transparent; background: transparent; padding: 5px 8px; width: 220px; }
.ed-bar .name:hover, .ed-bar .name:focus { border-color: var(--line2); background: var(--panel); }
.ed-bar .status { font-size: 12px; color: var(--muted); min-width: 140px; }
.ed-bar .status.dirty { color: var(--warn); font-weight: 600; }
.ed-btn { border: 1px solid transparent; background: transparent; color: var(--text); padding: 6px 9px; border-radius: 7px; cursor: pointer; font: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ed-btn:hover { background: var(--panel2); border-color: var(--line); }
.ed-btn.on { background: var(--accentBg); color: var(--accent); border-color: var(--accent); }
.ed-btn:disabled { opacity: .4; cursor: default; }
.ed-dd { position: relative; }
.ed-menu { position: absolute; top: calc(100% + 4px); left: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.22); padding: 6px; z-index: 60; min-width: 230px; max-height: 75vh; overflow-y: auto; }
.ed-menu .mi { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.ed-menu .mi:hover { background: var(--accentBg); color: var(--accent); }
.ed-menu .mi .ic { width: 22px; text-align: center; font-size: 16px; }
.ed-menu .mi small { display: block; color: var(--muted); font-size: 11.5px; }
.ed-menu .mh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px 4px; }
.ed-menu.grid-menu { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; min-width: 320px; }
.ed-menu.grid-menu .mi { justify-content: center; font-size: 22px; padding: 6px; }
.ed-menu.shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; min-width: 300px; }
.ed-menu.shapes .mi { flex-direction: column; gap: 3px; font-size: 11px; text-align: center; }
.ed-menu.shapes .mi svg { width: 36px; height: 28px; }

.ed-slides { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.ed-slide { position: relative; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; background: #000; overflow: hidden; }
.ed-slide.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accentBg); }
.ed-slide.off { opacity: .45; }
.ed-slide.drop-before { box-shadow: 0 -4px 0 var(--accent); }
.ed-slide .thumb { aspect-ratio: var(--ar, 16/9); position: relative; overflow: hidden; pointer-events: none; }
.ed-slide .lab { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff; font-size: 11px; padding: 10px 6px 4px; display: flex; gap: 4px; }
.ed-slide .lab b { flex: none; } .ed-slide .lab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-slide .dur { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; }
.ed-slide .cond { position: absolute; top: 4px; left: 4px; background: rgba(37,99,235,.85); color: #fff; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; }
.ed-slides .add { border: 2px dashed var(--line2); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; background: transparent; font: inherit; font-weight: 600; }
.ed-slides .add:hover { border-color: var(--accent); color: var(--accent); }

.ed-canvas { position: relative; overflow: auto; background: var(--panel2); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.ed-canvas-in { position: relative; margin: 40px auto; }
.ed-stage { position: absolute; left: 0; top: 0; box-shadow: 0 10px 40px rgba(0,0,0,.35); background: #000; overflow: hidden; }
.ed-stage .sv { pointer-events: auto; }
.ed-stage .se { cursor: move; }
.ed-stage .se * { pointer-events: none !important; }
.ed-stage .se.locked { cursor: default; }
.ed-ov { position: absolute; left: 0; top: 0; pointer-events: none; }
.ed-sel { position: absolute; border: 1.5px solid #3b82f6; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.ed-sel.multi { border-style: dashed; }
.ed-sel.locked { border-color: #f59e0b; }
.ed-h { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid #3b82f6; border-radius: 2px; pointer-events: auto; transform: translate(-50%, -50%); }
.ed-h.rot { border-radius: 50%; cursor: grab; background: #3b82f6; border-color: #fff; }
.ed-h.rot::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 18px; background: #3b82f6; }
.ed-guide { position: absolute; background: #ec4899; pointer-events: none; }
.ed-guide.v { width: 1px; } .ed-guide.h { height: 1px; }
.ed-marq { position: absolute; border: 1px solid #3b82f6; background: rgba(59,130,246,.12); pointer-events: none; }
.ed-hover { position: absolute; border: 1px dashed rgba(59,130,246,.75); pointer-events: none; }
.ed-tip { position: absolute; background: #0f172a; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; pointer-events: none; white-space: nowrap; transform: translate(-50%, 8px); font-variant-numeric: tabular-nums; }
.ed-gridlines { position: absolute; inset: 0; pointer-events: none; }
.ed-zoom { position: sticky; left: 10px; bottom: 10px; display: inline-flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; z-index: 5; float: left; margin: -50px 0 0 10px; }

.ed-props { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.ed-props .tabs { margin: 0; padding: 0 8px; position: sticky; top: 0; background: var(--panel); z-index: 3; }
.ed-props .tabs a { padding: 10px 9px; font-size: 13px; }
.ed-pbody { padding: 12px 14px 40px; }
.ed-sec { border-bottom: 1px solid var(--line); padding: 10px 0; }
.ed-sec:last-child { border-bottom: 0; }
.ed-sec > h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.ed-sec.closed > :not(h4) { display: none; }
.ed-sec > h4::before { content: '▾'; font-size: 10px; } .ed-sec.closed > h4::before { content: '▸'; }
.pf { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 6px; margin-bottom: 7px; }
.pf > label { font-size: 12px; color: var(--muted); }
.pf.full { grid-template-columns: 1fr; }
.pf input, .pf select, .pf textarea { padding: 5px 7px; font-size: 13px; }
.pf textarea { min-height: 70px; font-family: inherit; }
.pf textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-height: 140px; }
.pf .colorrow { display: flex; gap: 6px; align-items: center; }
.pf .colorrow input[type=color] { width: 34px; height: 30px; flex: none; }
.pf .colorrow input[type=text] { flex: 1; }
.pf .seg { display: flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.pf .seg button { flex: 1; border: 0; background: transparent; padding: 5px 0; cursor: pointer; color: var(--text); font: inherit; }
.pf .seg button + button { border-left: 1px solid var(--line2); }
.pf .seg button.on { background: var(--accentBg); color: var(--accent); font-weight: 700; }
.xy { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 8px; }
.xy label { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.xy input { padding: 4px 6px; font-size: 13px; }
.chips { display: flex; flex-direction: column; gap: 4px; }
.chip { display: flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }
.chip span { flex: 1; } .chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 3px; }
.layers .ly { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.layers .ly:hover { background: var(--panel2); } .layers .ly.on { background: var(--accentBg); color: var(--accent); }
.layers .ly span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layers .ly button { border: 0; background: transparent; cursor: pointer; opacity: .7; padding: 0 2px; }
.ed-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; padding: 4px; }
.emoji-grid button { border: 0; background: transparent; font-size: 20px; cursor: pointer; border-radius: 5px; padding: 2px; }
.emoji-grid button:hover { background: var(--accentBg); }
@media (max-width: 1200px) { .ed { grid-template-columns: 150px 1fr 290px; } }
body.editor-mode .content { padding: 0; }
