/* Bitmap Animator: the parts and animations (left), the stage (centre) over the timeline. */
#main { display: flex; flex-direction: row; flex: 1; min-width: 0; min-height: 0; background: var(--panel); }

/* left: parts and animations (bitmap/panels.js) */
#bm-left { min-height: 0; }
#bm-side { min-height: 0; }
.bm-pane { display: flex; flex-direction: column; min-height: 0; }
.bm-pane.grow { flex: 1; }
.bm-lists { overflow: auto; padding-bottom: 12px; }
.bm-sec { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.bm-add { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-xs); background: none; color: var(--muted); cursor: pointer; padding: 0; }
.bm-add:hover { background: var(--hover); color: var(--text); }
.bm-add .material-symbols-outlined { font-size: var(--ic); }
.bm-row { display: flex; align-items: center; gap: 6px; height: 28px; padding-right: 6px; color: var(--text); font-size: var(--fs-m); cursor: default; outline: none; }
.bm-row:hover { background: var(--hover-soft); }
.bm-row.on { background: var(--prog-soft); color: var(--prog-strong); }
.bm-row:focus-visible { box-shadow: inset 0 0 0 2px var(--prog); }
.bm-row.off .bm-name { color: var(--faint); }
.bm-row.drop-before { box-shadow: inset 0 2px 0 var(--sel); }
.bm-row.drop-after { box-shadow: inset 0 -2px 0 var(--sel); }
.bm-row.drop-into { background: var(--sel-soft); }
.bm-ic { flex: none; display: inline-flex; color: var(--muted); }
.bm-thumb { flex: none; width: 26px; height: 26px; border-radius: var(--radius-xs); background: var(--sunk); }
.bm-row:has(.bm-thumb) { height: 32px; }
.bm-row.on .bm-ic { color: inherit; }
.bm-ic .material-symbols-outlined { font-size: var(--ic-s); }
.bm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-meta { flex: none; color: var(--muted); font-size: var(--fs-xs); }
.bm-sec .bm-view { text-transform: none; letter-spacing: 0; font-weight: 500; }
.bm-sec .bm-view .seg-btn { height: 20px; padding: 0 7px; gap: 3px; font-size: var(--fs-xs); }
.bm-list-hint { padding: 0 10px 4px; font-size: var(--fs-xs); }
.bm-eye { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-xs); background: none; color: var(--muted); cursor: pointer; padding: 0; opacity: 0; }
.bm-row:hover .bm-eye, .bm-row.off .bm-eye, .bm-eye:focus-visible { opacity: 1; }
.bm-eye:hover { background: var(--hover); color: var(--text); }
.bm-eye .material-symbols-outlined { font-size: var(--ic-s); }
.bm-empty { padding: 8px 12px; font-size: var(--fs-s); }
/* an empty asset's parts list: where its picture comes from; then the next step (panels.js startBox, nextBox) */
.bm-start, .bm-next { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 6px 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); font-size: var(--fs-s); }
.bm-next { border-style: solid; background: var(--surface-2); }
.bm-start-title { font-weight: 600; color: var(--text); }
.bm-start p, .bm-next p { margin: 0 0 4px; }
.bm-start .small { margin: 2px 0 0; font-size: var(--fs-xs); }
.bm-start-btn { justify-content: flex-start; }

/* centre: the stage over the timeline */
#bm-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#bm-stage { position: relative; flex: 1; min-height: 120px; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; touch-action: none; }
#bm-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--prog); }
.bm-cv { position: absolute; left: 0; top: 0; display: block; }
#bm-empty { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; background: var(--surface); }
#bm-empty[hidden] { display: none; }

/* the Rig · Animate switch on the top bar */
.bm-mode { display: inline-flex; }
.bm-mode .seg-b { display: inline-flex; align-items: center; gap: 4px; }
.bm-mode .seg-b .material-symbols-outlined { font-size: var(--ic-s); }

/* the timeline (bitmap/timeline.js) */
.bm-tl { position: relative; flex: none; display: flex; flex-direction: column; min-height: 110px; border-top: 1px solid var(--line); background: var(--tl-bg); }
.bm-tl-grip { position: absolute; left: 0; right: 0; top: -3px; height: 6px; cursor: ns-resize; z-index: 2; }
.bm-tl-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--surface); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.bm-tl-bar .material-symbols-outlined { font-size: var(--ic); }
.bm-tl-frame { min-width: 104px; font-variant-numeric: tabular-nums; color: var(--text); font-size: var(--fs-s); }
.bm-tl-num { width: 58px; height: 28px; }
.bm-tl-check { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-s); color: var(--text); }
.bm-tl-sp { flex: 1; }
.bm-tl-wrap { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.bm-tl-cv { display: block; outline: none; }
.bm-tl-cv:focus-visible { box-shadow: inset 0 0 0 2px var(--prog); }

/* the AI windows (bitmap/ai.js) */
.bm-ai-top { display: flex; align-items: center; gap: 10px; }
.bm-ai-top canvas { border-radius: var(--radius-xs); background: var(--sunk); }
.bm-ai-list { font-size: var(--fs-s); margin: 6px 0 0; }
.bm-ai-res { display: flex; flex-direction: column; gap: 10px; }
.bm-ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.bm-ai-cell { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--sunk); }
.bm-ai-cell.missing { border-style: dashed; }
.bm-ai-cell.wrong { border-color: var(--warn); background: var(--warn-soft); }
.bm-ai-cell.fixed { border-color: var(--ok); }
.bm-ai-review { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--warn); border-radius: var(--radius-s); background: var(--warn-soft); }
.bm-ai-review ul { margin: 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.bm-ai-review label { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-s); }
.bm-ai-review-head { font-weight: 600; }
.bm-ai-review-go { display: flex; align-items: center; gap: 8px; }
.bm-ai-cell figcaption { font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.bm-ai-play { align-self: flex-start; max-width: 100%; border-radius: var(--radius-xs); background: var(--sunk); }
.bm-ai-full { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.bm-ai-full > summary { cursor: pointer; color: var(--text); font-size: var(--fs-s); font-weight: 600; }
.bm-ai-fulltext { width: 100%; margin-top: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-xs); line-height: 1.45; resize: vertical; }
.bm-ai-note { font-size: var(--fs-xs); margin: 4px 0 6px; }

/* a part on its own (bitmap/stage.js drawPart): the bar over the stage */
.bm-partbar { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.bm-partbar .material-symbols-outlined { font-size: var(--ic); }
.bm-partbar-name { font-weight: 600; color: var(--text); }
.bm-partbar-tools .seg-b { display: inline-flex; align-items: center; gap: 4px; }
.bm-partbar-size { width: 110px; }
.bm-layers { position: absolute; right: 10px; z-index: 2; width: 214px; display: flex; flex-direction: column; gap: 8px; }
.bm-layer { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.bm-layer:hover { border-color: var(--sel); }
.bm-layer.on { border-color: var(--sel); box-shadow: inset 0 0 0 1px var(--sel); }
.bm-layer-head { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.bm-layer-swatch { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); }
.bm-layer-swatch.back { background: var(--info); border-color: var(--info); }
.bm-layer-pic { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 4px; border-radius: var(--radius-s); background: repeating-conic-gradient(var(--sunk) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; font-size: var(--fs-xs); text-align: center; }
.bm-layer-where { font-size: var(--fs-xs); }
@media (max-width: 900px) { .bm-layers { display: none; } }
.bm-partbar-hint { font-size: var(--fs-xs); }
.bm-ai-morelab { display: block; margin-top: 12px; }
.bm-ai-more { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; align-items: flex-start; }
.bm-ai-more-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: 'name par del' 'look look look'; gap: 4px 6px; width: 100%; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.bm-ai-more-name { grid-area: name; }
.bm-ai-more-par { grid-area: par; }
.bm-ai-more-del { grid-area: del; }
.bm-ai-more-look { grid-area: look; }
/* Bring the picture to life (bitmap/life.js) – in the AI window: the picture to paint on over the words, what it is,
   its settings; a try playing over the picture */
.bml-top { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.bml-pic { width: 100%; height: auto; align-self: center; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: crosshair; touch-action: none; }
.bml-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bml-size { flex: 1; min-width: 60px; }
.bml-form { display: flex; flex-direction: column; gap: 6px; }
/* what it is: chips, an icon and a name each, wrapping */
.bml-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.bml-card { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); font: inherit; font-size: var(--fs-s); color: var(--text); cursor: pointer; }
.bml-card:hover { border-color: var(--accent); }
.bml-card.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.bml-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bml-card .material-symbols-outlined { font-size: var(--ic-s); }
.bml-ai { font-size: var(--fs-xs); font-weight: 600; color: var(--ai-spark); }
/* its settings: two side by side, the tick boxes in a row under them */
.bml-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.bml-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bml-l { font-size: var(--fs-s); font-weight: 500; color: var(--text-2); }
.bml-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.bml-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); }
.bml-many { width: auto; }
.bml-res { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bml-play { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--sunk); }
/* a frames part's pictures (Properties › Its pictures): small, numbered – the one showing now ringed, the one opened filled */
.bm-pics { display: flex; flex-wrap: wrap; gap: 4px; }
.bm-pic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--sunk); cursor: pointer; }
.bm-pic canvas { max-width: 100%; max-height: 100%; }
.bm-pic:hover { border-color: var(--accent); }
.bm-pic.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bm-pic.on { background: var(--accent-soft); }
.bm-pic:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bm-pic-n { position: absolute; left: 3px; bottom: 1px; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; }
/* a try's pictures in Bring to life, each with a tick */
.bml-stage { display: flex; justify-content: center; }
.bml-strip-h { align-self: stretch; font-size: var(--fs-s); color: var(--text-2); }
.bml-strip { align-self: stretch; display: flex; flex-wrap: wrap; gap: 6px; }
.bml-shot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--sunk); cursor: pointer; }
.bml-shot canvas { max-width: 64px; max-height: 64px; }
.bml-shot input { position: absolute; top: 3px; right: 3px; margin: 0; }
.bml-shot.off canvas { opacity: .3; }
.bml-shot-n { position: absolute; left: 4px; bottom: 2px; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; }
/* a part with several pictures (a fire's moments): an arrow before it, its pictures under it – the one showing now marked */
.bm-twist { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: -2px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--muted); }
button.bm-twist { cursor: pointer; }
button.bm-twist:hover { background: var(--hover-soft); color: var(--text); }
.bm-twist .material-symbols-outlined { font-size: var(--ic-s); }
.bm-subrow { height: 26px; font-size: var(--fs-s); color: var(--text-2); cursor: pointer; }
.bm-subrow .bm-thumb { width: 22px; height: 22px; }
.bm-subrow.now { box-shadow: inset 2px 0 0 var(--prog); color: var(--text); }
.bm-subrow.on { background: var(--prog-soft); color: var(--prog-strong); }
/* a try’s choice of what’s under it (Animate a layer) */
.bml-under { align-self: stretch; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
/* a try: all the picture or close up, its size – and dragged to move it */
.bml-adjust { align-self: stretch; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.bml-sizeby { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 180px; }
.bml-sizeby .bml-size { flex: 1; }
.bml-pct { min-width: 40px; font-size: var(--fs-s); color: var(--text-2); font-variant-numeric: tabular-nums; }
.bml-play.bml-drag { cursor: move; touch-action: none; }
.bml-hint { align-self: stretch; margin: 0; }
