/* Sprite Atlas Studio: the page's arrangement only. Every control's look (buttons, fields, switches, lists, menus,
   dialogs, toasts) and every colour of the editor 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"). This file draws only the
   tool's own content: the atlas page, the sprites' pictures and the clip preview. */

.atlas-host { flex: 1 1 auto; min-height: 0; display: flex; }
.atlas-host > .myth-editor-layout { flex: 1 1 auto; min-width: 0; }
/* Whatever the page hides (a setting with no sprite chosen, the page choice with one page) stays hidden. */
.atlas-host [hidden], .atlas-export [hidden] { display: none !important; }

/* The Preview Area: its toolbar, the view, the status line. */
.atlas-preview { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.atlas-preview > .myth-preview-viewport { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; }
/* The bar's right end: Settings, and Export at its full width. (The kit spaces the bar's groups and buttons.) */
.atlas-toolbar-end { flex: none; overflow: visible; }
.atlas-toolbar-end > #export { flex: none; white-space: nowrap; }
.atlas-viewport { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }

/* The view: the page on show on a quiet ground, the same in every theme so the sprites' own colours read true; the
   page's clear pixels show as a checkerboard. */
.atlas-stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; background: #141d27; outline-offset: -2px; touch-action: none; }
.atlas-sheet { position: absolute; background: repeating-conic-gradient(#293742 0 25%, #33434d 0 50%) 0 0 / 18px 18px; box-shadow: 0 2px 12px #10161d; cursor: crosshair; }
.atlas-sheet > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.atlas-sheet > i { position: absolute; pointer-events: none; }
/* Frame Outlines: every frame's rectangle. The chosen sprite's frame: a light line with a dark one inside it. */
.atlas-sheet > .atlas-outline { outline: 1px solid #c6ebff66; }
.atlas-sheet > .atlas-chosen { outline: 2px solid #c6ebff; box-shadow: inset 0 0 0 1px #173748cc; }
.atlas-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
/* Work under way: in the middle of the view. */
.atlas-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)); }
.atlas-busy > .myth-ui-progress { width: 90px; }
/* The navigation, floating in the view's corner: zoom, Home, framing, the page on show, Frame Outlines. */
.atlas-navigation { position: absolute; right: 12px; bottom: 12px; z-index: 2; }
.atlas-navigation > .atlas-page-choice { flex: none; width: auto; min-width: 7.5em; }

/* The status strip (the kit's myth-editor-statusbar): the page on show and its size, the whole atlas, what just happened. */
.atlas-status-group { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1 1 auto; }
.atlas-title, .atlas-meta { white-space: nowrap; }
.atlas-meta { color: var(--myth-ui-text-muted, var(--text-muted)); font-variant-numeric: tabular-nums; }
.atlas-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--myth-ui-text-muted, var(--text-muted)); }
.atlas-note.error { color: var(--myth-ui-danger, #e5534b); }

/* Settings and Import, behind the bar's menu buttons. */
.atlas-settings, .atlas-import { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.atlas-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

/* The Library drawer: find, filter, and the samples as cards. */
.atlas-library { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 14px; }
.atlas-library-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.atlas-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.atlas-sample { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; height: auto; padding: 6px 4px; white-space: normal; text-align: center; }
.atlas-sample > img { display: block; width: 100%; height: 72px; object-fit: contain; }
.atlas-sample > .myth-ui-choice-card-title { font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.atlas-sample > small { font-size: 10.5px; line-height: 1.25; color: var(--myth-ui-text-muted, var(--text-muted)); overflow-wrap: anywhere; }

/* The Sprites drawer: one row a sprite, with its picture. */
.atlas-sprites { display: flex; flex-direction: column; padding: 10px 12px 14px; }
.atlas-sprite-list { display: flex; flex-direction: column; gap: 4px; }
.atlas-sprite-thumb { flex: none; width: 32px; height: 32px; }

/* Properties and Animation. Reset to Defaults sits beside the filter box at the top of Properties; the filter takes the
   rest of the row. */
.atlas-host .myth-ui-property-inspector-toolbar { display: flex; align-items: center; gap: 6px; }
.atlas-host .myth-ui-property-inspector-toolbar > .myth-ui-property-inspector-search { flex: 1 1 auto; min-width: 0; }
.atlas-host .myth-ui-property-inspector-toolbar > #resetDefaults { flex: none; white-space: nowrap; }
.atlas-readout { display: block; color: var(--myth-ui-text-muted, var(--text-muted)); font-size: 12px; line-height: 1.5; }
.atlas-lines { white-space: pre-line; }
.atlas-rows { display: contents; }
.atlas-switch-row { display: flex; }
/* The clip preview: the chosen sprite's clip on a checkerboard, the pivot marked. */
.atlas-clip-view { display: block; width: 100%; height: auto; border-radius: 6px; background: repeating-conic-gradient(#26343c 0 25%, #2d3d44 0 50%) 0 0 / 16px 16px; }
.atlas-clip-title { display: block; overflow-wrap: anywhere; }
.atlas-transport { display: flex; align-items: center; gap: 6px; }
.atlas-transport > #play { min-width: 86px; justify-content: center; }

/* Export's dialog. */
.atlas-export { width: min(520px, 94vw); }
.atlas-export .myth-ui-dialog-body { display: flex; flex-direction: column; gap: 12px; }
.atlas-export-about { margin: 0; }

/* In a narrow window Myth's editor layout stacks its columns (the kit's own query: the editor 980 px wide or less). The
   page 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 sprites, the properties and the clip, on the drawers' rail) as the editor scrolls. */
@container (max-width: 980px) {
  .atlas-host .myth-editor-layout-main { order: -1 !important; height: calc(100svh - 56px) !important; }
  .atlas-host .myth-editor-layout-main > .atlas-preview { height: 100%; }
}
/* A phone: the navigation closer to the corner, and the status line wraps. */
@media (max-width: 700px) {
  .atlas-navigation { right: 6px; bottom: 6px; }
  .atlas-status-group { flex-wrap: wrap; row-gap: 2px; }
}
