/* The level editor (admin/editor.php, assets/editor.js). */
body.editor { height: 100vh; display: flex; flex-direction: column; overflow: hidden; font-size: 14px; }
.ed-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--band); flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; }
.editor .btn { padding: 5px 11px; font-size: 13px; gap: 6px; }
.ed-bar .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; margin-right: 8px; }
.ed-bar label, .ed-tools label, .ed-timeline label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.ed-spacer { flex: 1; }
.ed-bar > *, .ed-bar label > * { flex-shrink: 0; }
.ed-bar > label { flex-shrink: 1; min-width: 0; }
.ed-bar select { width: 190px; flex-shrink: 1; min-width: 90px; }
.ed-bar #file { width: 210px; }
.ed-bar #kind { width: auto; min-width: 0; flex-shrink: 0; }
.badge.off { visibility: hidden; }
.editor select, .editor input:not([type=checkbox]):not([type=range]):not([type=file]), .editor textarea {
    background: #0b0c14; color: var(--text); border: 1px solid #2c2f44; border-radius: 4px; padding: 4px 6px; font: 500 13px var(--sans);
}
.editor input[type=number] { width: 72px; font-family: var(--mono); font-size: 12px; }
.editor select:focus, .editor input:focus, .editor textarea:focus { outline: none; border-color: var(--amber); }
.badge { background: var(--amber); color: #000; font: 700 11px var(--sans); padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.ed-main { flex: 1; display: flex; min-height: 0; }
.ed-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ed-tools, .ed-timeline { display: flex; align-items: center; gap: 14px; padding: 6px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-timeline { border-bottom: 0; border-top: 1px solid var(--line); }
.ed-tools { flex-wrap: nowrap; white-space: nowrap; }
#hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.ed-timeline input[type=range] { flex: 1; accent-color: var(--amber); }
#frame-label { min-width: 90px; }
#field { flex: 1; width: 100%; min-height: 0; background: #04050a; cursor: crosshair; outline: none; }
.chk { cursor: pointer; }
.seg { display: inline-flex; border: 1px solid #2c2f44; border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 5px 10px; font: 600 13px var(--sans); cursor: pointer; }
.seg button + button { border-left: 1px solid #2c2f44; }
.seg button.on { background: var(--amber); color: #000; }
.ed-side { width: 400px; flex: 0 0 400px; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--band); }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: transparent; border: 0; color: var(--muted); padding: 10px 4px; font: 600 13px var(--sans); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--amber); }
.tab { flex: 1; overflow: auto; padding: 12px 14px; }
.tab h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tab h4:first-child { margin-top: 0; }
.f { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.f > span { color: var(--muted); font-size: 13px; }
.f input:not([type=checkbox]), .f select { width: 100%; }
.pair { display: flex; gap: 6px; }
.pair input { min-width: 0; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.btns .btn { padding: 4px 9px; font-size: 12px; }
table.ed { width: 100%; border-collapse: collapse; font-size: 12px; }
table.ed th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 4px; position: sticky; top: 0; background: var(--band); }
table.ed td { padding: 1px 4px; font-family: var(--mono); }
table.ed td input, table.ed td select { width: 100% !important; min-width: 0; padding: 2px 4px !important; font-size: 12px !important; }
table.ed tr.sel td { background: rgba(255, 181, 71, .14); }
table.ed tr.pick { cursor: pointer; }
table.ed tr.pick:hover td { background: rgba(255, 255, 255, .05); }
.ed-side textarea { width: 100%; min-height: 60vh; font: 12px/1.4 var(--mono); }
.note { font-size: 12px; color: var(--muted); margin: 6px 0; }
.warn { font-size: 12px; color: #ff9a7a; margin: 6px 0; }
#status { padding: 6px 14px; margin: 0; border-top: 1px solid var(--line); min-height: 30px; }
.alien-row { display: grid; grid-template-columns: 22px 40px 1fr 70px 70px; gap: 6px; align-items: center; margin-bottom: 6px; }
.alien-row canvas { width: 32px; height: 32px; image-rendering: pixelated; background: #000; border-radius: 3px; }
.ed-dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; min-width: 520px; max-width: 90vw; }
.ed-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.ed-dialog table { margin: 10px 0; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.ed-bar label .step { padding: 4px 9px; font-size: 15px; line-height: 1; }
.ed-help { max-width: 760px; max-height: 92vh; overflow: auto; }
.ed-help dl { display: grid; grid-template-columns: 96px 1fr; gap: 8px 14px; margin: 12px 0; font-size: 13px; line-height: 1.5; }
.ed-help dt { font-weight: 700; color: var(--amber); }
.ed-help dd { margin: 0; }
.warn.err, .meter-total .err { color: #ff6b6b; font-weight: 700; }
.tabs button.mark::after { content: ' •'; color: var(--amber); }
.bar { height: 6px; background: #22253a; border-radius: 3px; margin: 6px 0; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }
.meter-total { font-size: 13px; }
table.ed.meter td { font-family: var(--sans); }
table.ed.meter td.ok { color: var(--green); font-weight: 700; }
table.ed.meter td.mid { color: var(--amber); font-weight: 700; }
table.ed.meter td.low { color: #ff6b6b; font-weight: 700; }
.ed-side textarea[rows] { min-height: 0; }
.editor .btn:disabled { opacity: .35; cursor: default; }
.ed-side .label { display: block; color: var(--muted); font-size: 13px; margin: 6px 0 4px; }
.ed-langs { display: flex; gap: 6px; font: 600 12px var(--mono); }
.ed-langs a { color: var(--muted); text-decoration: none; }
.ed-langs a.active { color: var(--text); }
