/* Lightning Flipbook Studio: the page's arrangement and the tool's own drawing only. Every control's look (buttons,
   fields, switches, menus, dialogs, toasts) and every colour of the chrome comes from Myth Engine's editor kit
   (vendor/myth-ui/myth-ui.css) and its theme tokens, as Myth's UI standards ask (Myth/docs/UI-STANDARDS.md, "Local CSS
   may"). */

.lightning-host { flex: 1 1 auto; min-height: 0; display: flex; }
.lightning-host > .myth-editor-layout { flex: 1 1 auto; min-width: 0; }
/* Whatever the page hides stays hidden, whatever its arrangement. */
.lightning-host [hidden] { display: none !important; }

/* The Preview Area: its toolbar, the view, the flipbook's timeline, the status line. */
.lightning-preview { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.lightning-preview > .myth-preview-viewport { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; }
/* (The toolbar is the kit's: in a narrow window what does not fit moves into its More menu.) */
.lightning-viewport { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }

/* The view: the frame on a dark ground, the same in every theme, since the frames are drawn for a dark scene. The
   frame (the board) is placed and sized by the view's zoom and pan; its handles sit on it as shares of the frame. */
.lightning-stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; outline-offset: -2px;
  background: radial-gradient(ellipse at 50% 44%, #293651, #121929); }
.lightning-board { position: absolute; left: 0; top: 0; width: 256px; height: 256px; outline: 1px solid #4e5772;
  background-color: #162139; background-image: radial-gradient(#35435d 1px, transparent 1px); background-size: 12px 12px; background-position: center;
  box-shadow: 0 12px 35px #0e1421; }
.lightning-board > canvas { display: block; width: 100%; height: 100%; }
.lightning-handle { position: absolute; z-index: 1; transform: translate(-50%, -50%); width: 23px; height: 23px; padding: 0; display: grid; place-items: center;
  border: 1px solid #f8f5ff; border-radius: 50%; background: #35264c; color: #ffffff; font: 12px/1 Consolas, monospace; touch-action: none; cursor: grab; }
.lightning-handle:active { cursor: grabbing; }
.lightning-handle:focus-visible { outline: 2px solid #a9d7fc; outline-offset: 2px; }
.lightning-target { background: #30435b; }
.lightning-target[aria-pressed="true"] { outline: 2px solid #ffcc96; outline-offset: 1px; }
/* Work under way: in the middle of the view. */
.lightning-busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 14px; background: var(--myth-ui-surface-raised, var(--panel)); border: 1px solid var(--myth-ui-border, var(--border)); white-space: nowrap; }
.lightning-busy > .myth-ui-progress { width: 90px; }

/* The flipbook's timeline under the view: play, the frame and the time, Loop, and six frames at a glance. */
.lightning-timeline { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.lightning-transport { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lightning-transport > #play { min-width: 86px; justify-content: center; }
.lightning-transport > .myth-ui-range-number { flex: 1 1 auto; min-width: 0; }
.lightning-transport > #loop { flex: none; }
.lightning-count, .lightning-clock { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lightning-clock { min-width: 52px; text-align: right; }
.lightning-reel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.lightning-frame { position: relative; height: 56px; min-width: 0; padding: 2px; overflow: hidden; border-radius: 4px; cursor: pointer;
  background: #141d30; border: 1px solid var(--myth-ui-border-soft, var(--border)); color: inherit; }
.lightning-frame:hover { border-color: var(--myth-ui-border, var(--border)); }
.lightning-frame[aria-current="true"] { border: 2px solid var(--myth-ui-accent, var(--accent)); }
.lightning-frame > canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.lightning-frame > small { position: absolute; left: 4px; bottom: 1px; font-size: 10px; color: #c0d3ea; font-variant-numeric: tabular-nums; }

/* The status strip (the kit's myth-editor-statusbar): the effect's name and size, and what just happened. */
.lightning-status { gap: 12px; min-width: 0; }
.lightning-title { flex: none; white-space: nowrap; }
.lightning-meta { flex: none; white-space: nowrap; color: var(--myth-ui-text-muted, var(--text-muted)); font-variant-numeric: tabular-nums; }
.lightning-note { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--myth-ui-text-muted, var(--text-muted)); }
.lightning-note.error { color: var(--myth-ui-danger, #e5534b); }

/* The toolbar's menus: Import, and Settings (the theme, the side panels, the keys). */
.lightning-menu-list { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 190px; }
.lightning-settings { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.lightning-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

/* The Library drawer: the collection, the effect, and the effects as cards, each with its contact path. */
.lightning-library { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 14px; }
.lightning-cards > h3 { margin: 10px 0 6px; font-size: 13px; font-weight: 600; }
.lightning-card-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.lightning-card-grid > .myth-ui-choice-card { flex-direction: column; align-items: center; gap: 4px; min-width: 0; min-height: 0; height: auto; padding: 6px 4px; text-align: center; }
.lightning-card-grid .myth-ui-choice-card-glyph { display: block; width: 100%; }
.lightning-card-grid .myth-ui-choice-card-glyph > canvas { display: block; width: 100%; max-width: 100px; height: auto; margin: 0 auto; border-radius: 3px; background: #1e2334; }
.lightning-card-grid .myth-ui-choice-card-text { align-items: center; }
.lightning-card-grid .myth-ui-choice-card-title { font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.lightning-card-grid .myth-ui-choice-card-desc { font-size: 10.5px; line-height: 1.25; }

/* The properties. Reset to Defaults sits beside the filter box at the top; the filter takes the rest of the row. */
.lightning-host .myth-ui-property-inspector-toolbar { display: flex; align-items: center; gap: 6px; }
.lightning-host .myth-ui-property-inspector-toolbar > .myth-ui-property-inspector-search { flex: 1 1 auto; min-width: 0; }
.lightning-host .myth-ui-property-inspector-toolbar > #resetDefaults { flex: none; white-space: nowrap; }
.lightning-switch-row { display: flex; }
.lightning-impact-thumb { display: block; width: 64px; height: 64px; object-fit: contain; border-radius: 5px; background: #1b2029; }
.lightning-readout { display: block; color: var(--myth-ui-text-muted, var(--text-muted)); font-size: 12px; line-height: 1.5; }

/* Export's dialog. Its options for the pack alone hide while This Frame Only is chosen. */
.lightning-export { width: min(520px, 94vw); }
.lightning-export [hidden] { display: none !important; }
.lightning-export .myth-ui-dialog-body { display: flex; flex-direction: column; gap: 12px; }
.lightning-export-about { margin: 0; }
.lightning-atlas-sizes { display: flex; flex-direction: column; }

/* In a narrow window Myth's editor layout stacks its columns (the kit's own query: the editor 980 px wide or less). The
   effect then comes first and fills the screen but for the top of the drawers' row, which shows below it so it is
   plain there is more (the library, the properties and the animation, on the drawers' rail) as the editor scrolls. */
@container (max-width: 980px) {
  .lightning-host .myth-editor-layout-main { order: -1 !important; height: calc(100svh - 56px) !important; }
  .lightning-host .myth-editor-layout-main > .lightning-preview { height: 100%; }
}
/* A phone: the frames at a glance give way to the view, and the timeline's slider takes a row of its own. */
@media (max-width: 700px) {
  .lightning-reel { display: none; }
  .lightning-transport { flex-wrap: wrap; }
  .lightning-transport > .myth-ui-range-number { order: 1; flex: 1 1 100%; }
  .lightning-clock { margin-left: auto; }
}
