.editor { margin-top: 1rem; }
.editor-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: .6rem; }
.editor-heading p, .editor-help { color: var(--muted); font-size: .88rem; }
.editor-heading h3 { font-size: 1.55rem; margin-bottom: .27rem; }
.editor-message { margin-top: .9rem; padding: .58rem .72rem; border-radius: .4rem; color: var(--purple-dark); background: var(--lavender); font-size: .91rem; }
#reload-editor { margin-top: .62rem; }
.editor-grid { display: grid; grid-template-columns: minmax(10rem, .39fr) minmax(0, 1.61fr); gap: 1rem; margin-top: .85rem; align-items: start; }
.editor-preview { position: sticky; top: 1rem; display: grid; justify-items: center; align-content: center; min-height: 10rem; padding: 1rem; color: #eee6f2; border: 1px solid #554163; border-radius: .7rem; background: radial-gradient(ellipse at center, #503b70 0%, #241b33 84%); }
.editor-preview video { display: block; max-height: min(30rem, 65vh); max-width: 100%; border-radius: .3rem; object-fit: contain; }
.editor-group { border: 1px solid #e0d6e4; border-radius: .6rem; background: #fcf8fe; }
.editor-group + .editor-group { margin-top: .46rem; }
.editor-group summary { padding: .71rem .82rem; display: flex; align-items: center; justify-content: space-between; gap: .65rem; cursor: pointer; list-style: none; font-weight: 730; }
.editor-group summary::-webkit-details-marker { display: none; }
.editor-group summary::after { content: "+"; display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: .32rem; background: #eee3f8; color: var(--purple); font-family: var(--font); }
.editor-group[open] summary::after { content: "−"; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .62rem .75rem; padding: .35rem .82rem .82rem; }
.editor-full { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: .24rem; font-size: .85rem; font-weight: 660; }
.field select, .field input:not([type="range"]) { width: 100%; min-width: 0; padding: .42rem .48rem; color: var(--ink); background: #fff; border-radius: .31rem; border: 1px solid #d6cadc; font-size: .9rem; font-weight: 500; }
.field [type="range"] { width: 100%; accent-color: var(--purple); margin: 0; }
.check { display: flex; align-items: center; gap: .4rem; font-size: .86rem; font-weight: 660; }
.check input { width: 1rem; height: 1rem; accent-color: var(--purple); }
.editor-fields legend { margin: .28rem 0 .37rem; font-size: .86rem; font-weight: 660; }
.editor-words { display: flex; flex-wrap: wrap; gap: .27rem; align-content: start; max-height: 12rem; overflow: auto; padding: .4rem; border: 1px solid #e0d6e4; border-radius: .45rem; background: #fff; }
.editor-word { min-height: 1.9rem; padding: .13rem .39rem; border: 1px solid #e0d6e4; border-radius: .3rem; background: #fbf7fd; color: var(--ink); font-size: .84rem; font-weight: 650; overflow-wrap: anywhere; }
.editor-word:hover, .editor-word[aria-pressed="true"] { border-color: var(--purple); }
.editor-word[data-changed="true"] { background: #eee2f9; color: var(--purple-dark); }
.editor-submit { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .72rem; margin-top: .76rem; }
.editor-cuts { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.editor-cuts li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .28rem .5rem; border: 1px solid #e0d6e4; border-radius: .35rem; background: #fff; font-size: .85rem; }
.editor-cuts .quiet { font-size: .8rem; }

@media (max-width: 760px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { position: static; min-height: 7.4rem; }
  .editor-preview video { max-height: 24rem; }
}

@media (max-width: 390px) {
  .editor-fields { grid-template-columns: minmax(0, 1fr); }
}
.overlay-item + .overlay-item { margin-top: .4rem; }
.overlay-item { border: 1px solid #dfd1e1; border-radius: .42rem; background: #fff; }
.overlay-item summary { justify-content: start; padding: .42rem .55rem; font-size: .85rem; }
.overlay-item summary::after { margin-left: auto; }
.overlay-item img { width: 2.2rem; height: 2.2rem; object-fit: contain; border-radius: .27rem; background: #ece3f3; }
.overlay-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .44rem .57rem; padding: .35rem .55rem .6rem; }
.field output { color: var(--muted); font-size: .8rem; }
.overlay-controls .quiet { justify-self: start; grid-column: 1 / -1; }
#editor-overlay-input::file-selector-button { font: inherit; padding: .18rem .33rem; color: var(--purple-dark); background: var(--lavender); border: 0; border-radius: .18rem; margin-right: .38rem; cursor: pointer; }
@media (max-width: 390px) { .overlay-controls { grid-template-columns: minmax(0, 1fr); } }
