/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * Copyright © 2026 Marcel Rymenhout and IniqDash contributors */
/* the ANIMATION EDITOR dialog (components/animation/editor.js) */
dialog.iqae {
  --ed-chrome: var(--nav-bg, #16171c); --ed-chrome-2: var(--surface-tertiary, #242428); --ed-primary: var(--accent); --ed-on-primary: var(--accent-on);
  width: min(1180px, calc(100vw - 24px)); height: min(860px, calc(100vh - 24px)); display: none; flex-direction: column; overflow: hidden;
  background: var(--surface-secondary, #111113); color: var(--text-primary, #f1f1f3);
}
dialog.iqae[open] { display: flex; }
.iqae-head { flex-wrap: wrap; justify-content: flex-start; padding-bottom: 8px; padding-right: 18px; }
.iqae-head h3 { flex: none; margin-right: 8px; }
.iqae-head .iqae-pick { flex: 0 1 200px; width: auto; min-width: 140px; }
.iqae-head .iqae-modes { flex: none; margin-left: auto; }
.iqae-name { min-width: 120px; flex: 1 1 160px; max-width: 240px; padding: 7px 10px; border: 0; border-radius: 10px; font: 600 13px var(--font); color: var(--text-primary); background: var(--ed-chrome-2); box-shadow: 0 0 0 1px var(--border-primary) inset; }
.iqae-ro { margin: 0 18px 6px; padding: 8px 12px; border-radius: 10px; font-size: 12px; color: var(--text-secondary); background: var(--accent-soft); }
.iqae-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr); gap: 14px; padding: 6px 18px 10px; }
.iqae-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.iqae-stage { position: relative; flex: 1; min-height: 240px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--border-primary) inset; }
.iqae-stage[data-bg="checker"] { background: repeating-conic-gradient(#c9ccd3 0 25%, #f4f5f7 0 50%) 0 0 / 22px 22px; }
.iqae-stage[data-bg="light"] { background: #f6f7f9; }
.iqae-stage[data-bg="dark"] { background: #111317; }
.iqae-stage[data-stale]::after { content: 'Showing the last valid version'; position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; border-radius: 8px; font: 600 11px var(--font); color: #fff; background: rgba(200, 40, 40, .85); }
.iqae-stagebar, .iqae-row, .iqae-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iqae-inline > span { font-size: 12px; color: var(--text-muted); }
.iqae-tb { padding: 6px 10px; font-size: 12px; }
.iqae-right { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding-right: 4px; }
.iqae-panel { display: flex; flex-direction: column; gap: 10px; }
.iqae-set { margin: 0; padding: 8px 12px 10px; border: 0; border-radius: 12px; background: var(--ed-chrome-2); box-shadow: 0 0 0 1px var(--border-primary) inset; display: flex; flex-direction: column; gap: 8px; }
.iqae-set legend { padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.iqae-f { display: flex; flex-direction: column; gap: 4px; }
.iqae-lab { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.iqae-range { display: flex; align-items: center; gap: 8px; } .iqae-range input { flex: 1; } .iqae-range output { min-width: 52px; text-align: right; font-size: 12px; }
.iqae-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.iqae-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.iqae-sw { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; } .iqae-sw input { width: 38px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.iqae-layers { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow: auto; }
.iqae-layer { display: flex; align-items: center; gap: 8px; font-size: 12px; } .iqae-layer--in { padding-left: 22px; }
.iqae-layer__n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .iqae-layer small { color: var(--text-muted); }
.iqae-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .iqae-grid2 .iqae-f:last-child { grid-column: 1 / -1; }
.iqae-set input[type="text"], .iqae-set input[type="number"] { padding: 6px 8px; border: 0; border-radius: 8px; font: 500 12px var(--font); color: var(--text-primary); background: var(--ed-chrome); box-shadow: 0 0 0 1px var(--border-primary) inset; }
.iqae-muted { margin: 0; font-size: 11px; color: var(--text-muted); }
.iqae-code { position: relative; height: 300px; border-radius: 10px; overflow: hidden; background: #0d0f13; box-shadow: 0 0 0 1px var(--border-primary) inset; }
.iqae-hl, .iqae-src { position: absolute; inset: 0; margin: 0; padding: 10px 12px; font: 500 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; tab-size: 2; overflow: auto; }
.iqae-hl { pointer-events: none; color: #c8ccd4; }
.iqae-src { width: 100%; height: 100%; box-sizing: border-box; border: 0; resize: none; color: transparent; background: transparent; caret-color: #fff; outline: none; }
.iqae-src::selection { background: rgba(120, 160, 255, .35); color: transparent; }
.iqae-hl-tag { color: #7fb4ff; } .iqae-hl-a { color: #e0b46c; } .iqae-hl-s { color: #8fd18a; } .iqae-hl-c { color: #7a808c; font-style: italic; }
.iqae-css { min-height: 120px; padding: 10px 12px; border: 0; border-radius: 10px; resize: vertical; font: 500 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #e6e8ec; background: #0d0f13; box-shadow: 0 0 0 1px var(--border-primary) inset; white-space: pre; }
.iqae-valid p { margin: 0; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.iqae-err { color: #fff; background: rgba(200, 40, 40, .8); } .iqae-warn { color: var(--text-primary); background: rgba(230, 160, 30, .25); } .iqae-ok { color: var(--text-secondary); background: rgba(60, 170, 90, .18); }
.iqae-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 18px 8px; padding: 10px 12px; border-radius: 12px; background: var(--ed-chrome-2); box-shadow: 0 0 0 1px var(--accent-line) inset; }
.iqae-confirm[hidden] { display: none; } .iqae-confirm p { flex: 1 1 260px; margin: 0; font-size: 13px; }
.iqae-status { min-height: 18px; margin: 0 18px 6px; font-size: 12px; color: var(--text-secondary); }
.iqae-status[data-kind="error"] { color: var(--danger); } .iqae-status[data-kind="ok"] { color: var(--success, #3aa55a); }
.iqae-foot { flex-wrap: wrap; } .iqae-grow { flex: 1; }
.iqae-danger { color: var(--danger); }
@media (max-width: 820px) {
  .iqae-head h3 { width: 100%; } .iqae-head .iqae-modes { margin-left: 0; }
  dialog.iqae { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .iqae-body { grid-template-columns: 1fr; overflow: auto; } .iqae-stage { min-height: 220px; } .iqae-right { overflow: visible; }
}
.iqae [hidden] { display: none !important; }
