body.editor { background: var(--surface); color: var(--ink); overflow: hidden; }
.ed { display: grid; grid-template-columns: 1fr 380px; height: 100vh; }
.ed__stage { position: relative; background: #000; }
#ed-viewer { position: absolute; inset: 0; }
.ed__side { overflow-y: auto; background: var(--paper); border-left: 1px solid #e3ddcf; padding: 16px 18px 40px; }
.ed__head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; }
.ed__head h1 { font-family: var(--font-heading); font-size: 20px; margin: 2px 0 0; }
.ed__actions { display: flex; gap: 6px; }
.ed__actions .btn { padding: 10px 14px; font-size: 11px; min-height: 38px; }
.btn--ghost-dark { background: var(--surface); color: var(--ink); }

.ed__block { border-top: 1px solid #ece6d8; padding: 12px 0; }
.ed__block summary { font-family: var(--font-heading); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; list-style: none; }
.ed__block summary::-webkit-details-marker { display: none; }
.ed__block summary .count { color: var(--accent); }
.ed__sub { font-family: var(--font-heading); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 6px; color: #666; }
.ed__help { font-size: 13px; color: #666; margin: 6px 0 8px; }

.ed__nodes { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.ed__nodes button { width: 100%; display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; border: 0; border-radius: 10px; background: var(--surface); padding: 6px; text-align: left; color: var(--ink); }
.ed__nodes button[aria-current="true"] { outline: 2px solid var(--accent); }
.ed__nodes img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; background: #ddd; }
.ed__nodes small { color: #777; font-size: 11px; }
.tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--accent); color: var(--accent-ink); padding: 2px 6px; border-radius: 999px; }
.tag--warn { background: #F3D9C9; color: #8A3B12; }

.ed__file { display: block; border: 1.5px dashed #cfc6b2; border-radius: 10px; padding: 12px; font-size: 13px; color: #555; cursor: pointer; text-align: center; }
.ed__file:hover { border-color: var(--accent); color: var(--ink); }
.ed__file input { display: none; }

.ed__node-form, .ed__meta { display: grid; gap: 8px; margin-top: 10px; }
.ed__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed label.f { display: grid; gap: 3px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #666; }
.ed label.f input, .ed label.f textarea, .ed label.f select { font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); padding: 8px 10px; border: 1px solid #d8d0c0; border-radius: 8px; background: #fff; }
.ed label.f textarea { min-height: 60px; resize: vertical; }

.ed__hotspots { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ed__hotspots li { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.ed__hotspots li span { flex: 1; }
.ed__hotspots li.is-sel { outline: 2px solid var(--accent); }
.ed__hotspots button { border: 0; background: none; color: #A33; font-size: 18px; line-height: 1; padding: 2px 6px; }
.ed__hotspots .kind { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #777; width: 44px; }

.ed__plan { position: relative; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid #e3ddcf; cursor: crosshair; margin-bottom: 8px; }
.ed__plan img { display: block; width: 100%; height: auto; }
.ed__plan-dots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.ed__modebar { position: absolute; z-index: 20; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; background: rgba(0,0,0,.65); padding: 4px; border-radius: 999px; backdrop-filter: blur(8px); }
.ed__modebar button { border: 0; background: none; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.ed__modebar button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ed__status { position: absolute; z-index: 20; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.7); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.ed__status:empty { display: none; }
.ed__popover { position: absolute; z-index: 30; width: 280px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.45); display: grid; gap: 8px; }
.ed__popover h4 { margin: 0; font-family: var(--font-heading); font-size: 14px; }
.ed__popover .choices { display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.ed__popover .choices button { border: 0; background: var(--surface); border-radius: 8px; padding: 8px 10px; text-align: left; color: var(--ink); }
.ed__popover .choices button:hover { background: var(--accent); }
.ed__popover .row { display: flex; gap: 6px; justify-content: flex-end; }
.ed__popover .row button { border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.ed__popover .ok { background: var(--ink); color: #fff; }
.ed__popover .cancel { background: var(--surface); color: var(--ink); }
.ed__popover label.chk { display: flex; gap: 6px; align-items: center; font-size: 13px; }

.ed-marker-link { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; display: grid; place-items: center; color: #111; font-weight: 800; font-size: 11px; box-shadow: 0 2px 12px rgba(0,0,0,.5); }
.ed-marker-link.is-sel, .ed-marker-info.is-sel { outline: 3px solid #4FC3F7; outline-offset: 2px; }
.ed-marker-info { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 2px 12px rgba(0,0,0,.5); }
.ed-marker-start { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 16px solid #4FC3F7; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

@media (max-width: 860px) {
  .ed { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; }
  body.editor { overflow: auto; }
  .ed__side { border-left: 0; }
}
.ed__row > * { min-width: 0; }
.ed label.f input, .ed label.f textarea { width: 100%; min-width: 0; }
.ed__row .btn { padding: 10px 8px; font-size: 11px; justify-content: center; }
.ed__side { overflow-x: hidden; }
.ed__hotspots li .kind { flex: none; }
.ed__status { bottom: 62px; }
