body.editor { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.ed-top { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 14px; background: var(--ink-2); border-bottom: 1px solid var(--line); flex: none; }
.ed-title { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.ed-title-input { background: none; border: 1px solid transparent; border-radius: 8px; font-family: var(--display); font-weight: 700; font-size: 18px; padding: 3px 8px; min-width: 120px; width: 28ch; max-width: 100%; }
.ed-title-input:hover { border-color: var(--line); }
.ed-title-input:focus { outline: none; border-color: var(--pink); background: var(--ink); }
.ed-diff { color: var(--pink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.ed-save { color: var(--faint); font-size: 12px; white-space: nowrap; }
.ed-actions { display: flex; align-items: center; gap: 10px; }

.ed-main { flex: 1; display: grid; grid-template-columns: 280px minmax(0, 1fr) 270px; min-height: 0; }
.ed-side { background: var(--ink-2); overflow-y: auto; min-height: 0; }
.ed-left { border-right: 1px solid var(--line); }
.ed-right { border-left: 1px solid var(--line); display: flex; flex-direction: column; }

.tabs { display: flex; gap: 2px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--ink-2); z-index: 1; }
.tab { flex: 1; background: none; border: 0; color: var(--muted); padding: 8px 4px 10px; font-weight: 600; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--pink); }
.ed-pane { display: none; flex-direction: column; gap: 12px; padding: 14px; }
.ed-pane.active { display: flex; }
.field-btn { flex: none; }
.file-btn { position: relative; }
.side-h { font-family: var(--ui); font-size: 13px; font-weight: 700; color: var(--text); margin-top: 6px; }

.ed-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ink); }
.ed-overview { height: 44px; width: 100%; display: block; flex: none; border-bottom: 1px solid var(--line); cursor: pointer; }
.ed-canvas-wrap { position: relative; flex: 1; min-height: 160px; }
.ed-timeline { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.ed-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(27,23,52,.92); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 22px; max-width: 380px; text-align: center; pointer-events: none; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.ed-empty strong { color: var(--text); font-size: 15px; }

.ed-transport { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--ink-2); border-top: 1px solid var(--line); flex: none; }
.play-btn { min-width: 84px; }
.play-btn.is-playing { background: var(--ink-3); color: var(--text); border-color: var(--pink); }
.ed-time { font-family: var(--mono); font-size: 15px; min-width: 190px; }
.ed-time-total { color: var(--faint); font-size: 12px; margin-left: 6px; }
.mini-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 500; }
.mini-field select { height: 28px; width: auto; padding: 0 6px; font-size: 12.5px; }
.mini-field input[type="range"] { width: 90px; }
.ed-status { margin-left: auto; color: var(--mint); font-size: 12.5px; font-weight: 500; min-height: 1em; }

.pad-wrap { padding: 14px; border-bottom: 1px solid var(--line); }
.pad { width: 100%; aspect-ratio: 1; display: block; cursor: pointer; }
.panel { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sel-count { font-weight: 600; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-grid .btn { padding: 0 6px; }
.stats-top { display: flex; gap: 14px; align-items: center; }
.stats-list { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.stat { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.stat-k { color: var(--muted); }
.stat-v { font-weight: 600; text-align: right; }
.problems { margin: 4px 0 0; padding-left: 18px; color: #ffb3c2; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.hint.ok { color: var(--mint); }

.drop-overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(18,15,36,.85); border: 3px dashed var(--pink); font-family: var(--display); font-size: 26px; font-weight: 700; z-index: 950; opacity: 0; pointer-events: none; transition: opacity .12s; }
.drop-overlay.on { opacity: 1; }

.lib-list { display: flex; flex-direction: column; max-height: 55vh; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.lib-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.lib-item:hover { background: var(--ink-3); }
.lib-title { font-weight: 600; }
.lib-diff { color: var(--pink); font-size: 12.5px; font-weight: 600; }
.lib-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13px; }
.keys dt { font-family: var(--mono); font-size: 12px; color: var(--pink-2); white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }
.publish { gap: 12px; }

@media (max-width: 1180px) {
    .ed-main { grid-template-columns: 240px minmax(0, 1fr) 230px; }
    .btn-group .btn-ghost { padding: 0 7px; }
}
@media (max-width: 900px) {
    body.editor { overflow: auto; height: auto; }
    .ed-top { flex-wrap: wrap; height: auto; padding: 10px; }
    .ed-main { grid-template-columns: 1fr; }
    .ed-canvas-wrap { height: 52vh; }
    .ed-left, .ed-right { border: 0; border-top: 1px solid var(--line); }
    .pad-wrap { max-width: 260px; }
}

.side-h.first { margin-top: 0; }
.audio-card { padding: 10px 12px; border-radius: 10px; background: var(--ink); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.audio-progress { height: 4px; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.audio-progress i { display: block; height: 100%; width: 40%; background: var(--pink); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.src-seg { align-self: stretch; }
.src-seg .seg-btn { flex: 1; }
.src-pane { display: flex; flex-direction: column; gap: 10px; }
.recut { display: flex; flex-direction: column; gap: 8px; }
.file-mini { font-size: 11.5px; color: var(--muted); margin-top: -6px; }
.check.small { font-size: 12.5px; color: var(--muted); }
.fx-color { flex: 0 0 70px; }
.fx-color input { padding: 2px; }
.publish-sum { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.publish-sum dt { color: var(--muted); }
.publish-sum dd { margin: 0; font-weight: 600; }
.test-overlay { position: fixed; inset: 0; z-index: 940; background: #0d0b1b; display: flex; flex-direction: column; }
.test-bar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.test-bar .btn { margin-left: auto; }
.test-overlay iframe { flex: 1; border: 0; width: 100%; }
.gate { position: fixed; inset: 0; z-index: 990; display: grid; place-items: center; background: rgba(18,15,36,.96); padding: 20px; }
.gate-card { max-width: 440px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.gate-card h1 { font-size: 30px; font-weight: 800; }
.gate-card p { color: var(--muted); }
.fx-preset-row { display: flex; gap: 6px; }
.fx-preset-row .btn { flex: 1; white-space: normal; height: auto; min-height: 30px; padding: 4px 8px; line-height: 1.2; }
#fxSelCount, .sel-count { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
