/* The styles of the ASO pages of the console (console/aso/): every class here begins with ed-.
   The approved look is docs/design/aso-editor-mockup.src.html: its own classes, under their names here. Everything
   else the pages use is a class of app.css. The page's policy admits no inline style, so a colour or a proportion
   that follows a setting is set as a property of its node by the script. */

/* The editor's page is wider than the other pages of the console; the side menu stays where it is. */
.shell:has(.ed-page) { max-width: 1240px; }
.ed-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; --ed-stage: #e8e8eb; --ed-lift: 0 10px 24px rgb(0 0 0 / 0.16); --ed-art: 0 1px 2px rgb(0 0 0 / 0.1), 0 10px 28px rgb(0 0 0 / 0.12); }
@media (prefers-color-scheme: dark) { .ed-page { --ed-stage: #19191c; --ed-lift: 0 10px 24px rgb(0 0 0 / 0.55); --ed-art: 0 0 0 1px rgb(255 255 255 / 0.06), 0 10px 28px rgb(0 0 0 / 0.5); } }
.ed-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ed-name { width: 240px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.ed-cost { margin-left: auto; padding-bottom: 8px; }
/* The switch of the game's own art, and the one of the real covers beside it, stand in the row of the format: lifted
   to the middle of the fields beside them. */
.ed-from-game .ed-toggle, .ed-from-catalog .ed-toggle { margin-bottom: 6px; }
/* A sentence that is pressed: it goes to the place it names. */
.ed-problem { display: block; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.ed-problem:hover { text-decoration: underline; }

.ed-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ed-tab { flex: none; height: 36px; padding: 0 12px; border: 0; background: none; font-size: 13px; color: var(--text-muted); white-space: nowrap; border-radius: var(--r-input) 6px 0 0; }
.ed-tab:hover { color: var(--text); }
.ed-tab[aria-selected="true"] { color: var(--text); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }
.ed-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: none; border-radius: var(--r-input) 6px 0 0; }
.ed-tab[aria-selected="true"]:focus-visible { box-shadow: inset 0 -2px 0 var(--accent); }
.ed-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }

/* The strip of ten slots. */
.ed-strip { display: grid; grid-template-columns: repeat(10, minmax(0, 78px)); gap: 6px; padding: 12px 20px 16px; }
.ed-slot { position: relative; display: grid; gap: 6px; min-width: 0; padding: 4px 4px 6px; border: 2px solid transparent; border-radius: var(--r-card); background: none; text-align: center; cursor: grab; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ed-slot canvas { display: block; width: 100%; border-radius: var(--r-chip); background: var(--surface-elev); box-shadow: 0 0 0 1px var(--border); pointer-events: none; }
.ed-slot-name { font-size: 11px; line-height: 1.2; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-slot:hover { background: var(--surface-elev); }
.ed-slot[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ed-slot[aria-pressed="true"] .ed-slot-name { color: var(--accent); font-weight: 500; }
.ed-slot.empty canvas { background: none; box-shadow: none; outline: 1px dashed var(--text-faint); outline-offset: -1px; }
.ed-slot.empty .ed-slot-name { color: var(--text-faint); }
.ed-slot.bad .ed-slot-name { color: var(--danger); }
.ed-slot.lift { z-index: 3; cursor: grabbing; background: var(--bg); border-color: var(--border); box-shadow: var(--ed-lift); }
.ed-slot.over { border-color: var(--accent); border-style: dashed; }

/* The stage and the inspector beside it. */
.ed-editor { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ed-stage-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.ed-stage-bar { padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ed-stage-bar select.input { width: auto; max-width: 100%; padding-right: 8px; }
.ed-stage-ground { background: var(--ed-stage); border-block: 1px solid var(--border); padding: 24px 20px; display: grid; place-items: center; }
.ed-stage { display: block; width: min(330px, 100%); max-width: 100%; border-radius: var(--r-chip); background: var(--surface-elev); box-shadow: var(--ed-art); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ed-stage.lying { width: min(390px, 100%); }
.ed-stage:focus-visible { border-radius: var(--r-chip); box-shadow: var(--shadow-focus), var(--ed-art); }
.ed-stage-foot { padding: 12px 20px 16px; display: grid; gap: 10px; }
.ed-beside { flex: 1 1 170px; min-width: 0; }
.ed-blk { padding: 16px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.ed-blk + .ed-blk { border-top: 1px solid var(--border); }
.ed-blk-title { margin: 0; font-size: 13px; font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-sq { width: 32px; padding: 0; }
.ed-sq .ico { width: 14px; height: 14px; }
.ed-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 12px; }
.ed-figs .stat b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ed-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.ed-swatch { width: 28px; height: 28px; padding: 0; border-radius: var(--r-input); border: 1px solid var(--border); }
.ed-swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.ed-slider { display: grid; gap: 2px; min-width: 0; }
.ed-slider .rowline { font-size: 12px; color: var(--text-muted); }
.ed-slider output { font-family: var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.ed-range { width: 100%; height: 22px; margin: 0; accent-color: var(--accent); }
.ed-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ed-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-page select.input { width: auto; max-width: 100%; padding-right: 8px; }
.ed-page textarea.input { display: block; line-height: 1.5; }
.ed-page .field { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ed-page .chip:disabled { opacity: 0.5; cursor: default; }

/* A switch: of a preset in the list, of the pill in the editor. */
.ed-toggle { position: relative; width: 36px; height: 20px; border-radius: 10px; border: 0; background: var(--border); flex: none; transition: background-color 150ms var(--ease); padding: 0; }
.ed-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); transition: transform 150ms var(--ease); box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); }
.ed-toggle[aria-checked="true"] { background: var(--accent); }
.ed-toggle[aria-checked="true"]::after { transform: translateX(16px); }
.ed-toggle:focus-visible { border-radius: 10px; }

/* What the image model is told. */
.ed-req-title { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.ed-req { margin: 0; font: 11.5px/1.75 var(--font-mono); padding: 12px 14px; border-radius: var(--r-input); background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.ed-own { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 1px 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ed-game { color: var(--text-muted); font-style: italic; }
.ed-num { font-weight: 500; text-decoration: underline dotted var(--accent); text-underline-offset: 3px; }
.ed-legend { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; font: 11px/1.6 var(--font-mono); color: var(--text); }

/* The references, and the icon. */
.ed-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.ed-ref { min-width: 0; }
.ed-ref-pic { position: relative; height: 220px; background: var(--surface-elev); border-bottom: 1px solid var(--border); display: grid; place-items: center; }
.ed-ref-pic img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.ed-ref-pic .ed-ph { width: 101px; height: 100%; border-radius: 0; }
.ed-ref-n { position: absolute; top: 8px; left: 8px; padding: 2px 6px; border-radius: var(--r-chip); background: var(--text); color: var(--bg); font: 500 11px/1.4 var(--font-mono); }
.ed-ref-body { padding: 12px 16px 16px; display: grid; gap: 12px; }
.ed-ref-add { display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; min-height: 220px; padding: 24px; border: 1px dashed var(--text-faint); border-radius: var(--r-card); cursor: pointer; color: var(--text-muted); }
.ed-ref-add:hover, .ed-ref-add.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ed-ref-add:focus-within { box-shadow: var(--shadow-focus); }
.ed-ref-add b { font-size: 14px; font-weight: 500; color: var(--text); }
.ed-icon-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.ed-icon-pic { display: grid; gap: 8px; justify-items: center; flex: none; width: 120px; text-align: center; }
.ed-icon-pic img, .ed-icon-pic .ed-ph { width: 96px; height: 96px; border-radius: 22px; border: 1px solid var(--border); display: block; }
.ed-ph { background: var(--surface-elev); border: 1px dashed var(--border); }

@media (max-width: 1100px) {
  .ed-editor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .ed-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 10px 12px 14px; }
  .ed-stage-bar { padding: 12px 16px; } .ed-stage-ground { padding: 14px 0; } .ed-stage-foot { padding: 12px 16px 14px; }
  .ed-blk { padding: 14px 16px; }
  .ed-two { grid-template-columns: minmax(0, 1fr); }
  .ed-name { width: min(240px, 100%); }
  .ed-cost { margin-left: 0; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { .ed-page *, .ed-page *::before, .ed-page *::after, .ed-toggle, .ed-toggle::after { transition: none !important; animation: none !important; } }
