/* Owner: W2-DESIGNS (Designs library, design drawers, design importers and layout editors).
   Root classes: .designs-page (the page), .design-drawer (its drawers), .design-editor (the artwork
   dialogs), .design-picker (the campaign's design picker), .design-compare (inside the Replace
   confirm), and the panelPicker's own .zone-pick — not scoped, because the slide editor's
   "Adjust text area" dialog uses it too.  .design-preview stays in app.css (the slide editor uses it). */

/* =====================================================================
   Library page
   ===================================================================== */
.designs-page .page-head { margin-bottom: 4px; }
.designs-page details.explain { margin: 0 0 12px; }
.designs-page .callout { margin-bottom: 12px; }
.designs-page .lib-issues { margin: 4px 0 0; padding-left: 18px; }
.designs-page .lib-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; min-height: 34px; }
.designs-page .lib-search { position: relative; flex: 0 0 220px; }
.designs-page .lib-search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.designs-page .lib-search .input { padding-left: 32px; width: 100%; }
/* Chrome's own clear cross would sit beside ours (Firefox has none). */
.designs-page .lib-search .input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
/* Searching: the box is outlined in the accent and carries a Clear button. */
.designs-page .lib-search.is-filtered .input { padding-right: 64px; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.designs-page .lib-search.is-filtered .ico { color: var(--accent-ink); }
.designs-page .search-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 26px; padding: 0 10px; border: 0;
  border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.designs-page .search-clear:hover { background: var(--accent-line); }
.designs-page .search-clear[hidden] { display: none; }
.designs-page .lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.designs-page .lib-toolbar .switch { margin-left: auto; }

.designs-page .design-tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.designs-page .design-tile .meta { gap: 5px; }
.designs-page .design-tile .tile-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.designs-page .tile-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.designs-page .type-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-strong); white-space: nowrap;
}
.designs-page .design-tile.incomplete .thumb { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface-hover) 8px 16px); }
.designs-page .design-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.designs-page .design-tile .thumb .design-preview svg { border-radius: 0; box-shadow: none; }
/* A design with both sizes: its vertical size, small, in the corner of the card's picture */
.designs-page .design-tile .thumb { position: relative; }
.designs-page .design-tile .thumb-vert { position: absolute; right: 6px; bottom: 6px; width: 19%; border: 2px solid var(--surface); border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .35); background: var(--surface); line-height: 0; }
.designs-page .design-tile .thumb-vert svg { height: auto; }

/* =====================================================================
   Drawers (campaign and slide designs)
   ===================================================================== */
.design-drawer .dd-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.design-drawer .dd-preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.design-drawer .dd-preview-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; min-height: 28px; }
.design-drawer .dd-preview-bar .field { margin: 0; flex: 1 1 auto; }
.design-drawer .dd-size { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.design-drawer .dd-stage img { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.design-drawer .dd-caption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.design-drawer .dd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.design-drawer .dd-hint { margin: 0; }
.design-drawer .dd-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.design-drawer .dd-section h3 { margin-bottom: 4px; color: var(--ink); }
.design-drawer .dd-section > .hint { margin: 0; }
/* The design's vertical size */
.design-drawer .dd-vertical-row { display: flex; gap: 14px; align-items: flex-start; }
.design-drawer .dd-vertical-thumb { flex: 0 0 120px; }
.design-drawer .dd-vertical-thumb svg { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.design-drawer .dd-vertical-text { flex: 1 1 auto; min-width: 0; }
.design-drawer .dd-vertical .dd-actions { margin: 10px 0 0; }
.design-drawer .dd-vertical select.input { width: auto; max-width: 100%; }
.design-drawer .art-rows { display: flex; flex-direction: column; margin-top: 8px; }
.design-drawer .art-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; }
.design-drawer .art-row + .art-row { border-top: 1px solid var(--line); }
.design-drawer .art-thumb {
  width: 128px; aspect-ratio: 16 / 9; background: var(--stage); border-radius: var(--r-sm); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.design-drawer .art-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.design-drawer .art-thumb .none { font-size: 12px; color: var(--muted); }
.design-drawer .art-name { font-weight: 600; }
.design-drawer .dd-drawn { margin: 10px 0 0; }
.design-drawer .used-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.design-drawer .used-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.design-drawer .used-list a { min-width: 110px; font-weight: 600; font-variant-numeric: tabular-nums; }
.design-drawer .callout { margin-bottom: 12px; }

/* How the app uses the artwork (drawer and the campaign importer) */
.design-drawer .use-mode, .design-editor .use-mode { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.design-drawer .use-mode legend, .design-editor .use-mode legend { padding: 0; margin-bottom: 6px; }
.design-drawer .use-opt, .design-editor .use-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.design-drawer .use-opt + .use-opt, .design-editor .use-opt + .use-opt { margin-top: 6px; }
.design-drawer .use-opt:hover, .design-editor .use-opt:hover { border-color: var(--accent-line); }
.design-drawer .use-opt:has(input:checked), .design-editor .use-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.design-drawer .use-opt input, .design-editor .use-opt input { margin-top: 2px; }
.design-drawer .use-text, .design-editor .use-text { display: flex; flex-direction: column; min-width: 0; }
.design-drawer .use-title, .design-editor .use-title { font-weight: 600; }
.design-drawer .use-hint, .design-editor .use-hint { font-size: 12px; color: var(--muted); }

/* Replace artwork: old and new side by side in the confirm */
.design-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.design-compare figure { margin: 0; }
.design-compare img, .design-compare .none {
  width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--stage); border-radius: var(--r-sm);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px;
}
.design-compare figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: center; }
.design-compare-arrow { color: var(--muted); display: inline-flex; }

/* Empty preview boxes (drawers, editors, picker) */
.design-drawer .de-empty, .design-editor .de-empty, .design-picker .de-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 16 / 9;
  border: 2px dashed var(--line-strong); border-radius: var(--r-md); color: var(--muted); background: var(--surface); text-align: center; padding: 16px;
}
/* The stage around these is a .design-preview, whose "svg { width: 100% }" (app.css) is meant for
   the rendered artwork: keep the icon at its own size. */
.design-drawer .de-empty .ico, .design-editor .de-empty .ico, .design-picker .de-empty .ico {
  color: var(--accent-ink); width: 22px; height: 22px; flex: 0 0 auto; box-shadow: none; border-radius: 0; display: inline-block;
}

/* =====================================================================
   Artwork dialogs: Adjust layout, Add design from artwork, Edit colours & text.
   The controls scroll on their own; the preview column stays in view.
   ===================================================================== */
.modal.design-editor { height: calc(100vh - 32px); }
.design-editor .modal-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.design-editor .editor-split {
  flex: 1 1 auto; min-height: 0; display: grid; gap: 0; align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr);
}
.design-editor .editor-split > .de-controls-col {
  max-height: none; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 16px 20px 32px; border-right: 1px solid var(--line);
}
.design-editor .editor-split > .de-preview-col {
  position: static; min-height: 0; overflow: auto; padding: 16px 20px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px;
}
@media (max-width: 900px) {
  .design-editor .editor-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .design-editor .editor-split > .de-preview-col { order: -1; max-height: 42vh; border-bottom: 1px solid var(--line); }
  .design-editor .editor-split > .de-controls-col { border-right: 0; }
}

/* Preview column */
.design-editor .de-preview-bar { display: flex; flex-wrap: wrap; gap: 0 12px; }
.design-editor .de-preview-bar:empty { display: none; }
.design-editor .de-preview-bar .field { margin: 0 0 4px; flex: 1 1 200px; min-width: 0; }
.design-editor .de-sample-field { flex: 1 1 200px; min-width: 0; }
.design-editor .de-sample-field:empty { display: none; }
.design-editor .de-caption { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.design-editor .de-caption:empty, .design-editor .de-status:empty { display: none; }
.design-editor .de-status { font-size: 13px; }
.design-editor .de-warn-list { margin: 4px 0 0; padding-left: 18px; }

/* Controls column */
.design-editor .de-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.design-editor .de-two .input { min-width: 0; }
.design-editor .de-size, .design-editor .de-slot {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 12px 14px; margin-bottom: 12px;
}
.design-editor .de-size-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; min-height: 28px; }
.design-editor .de-size-head h3 { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink); }
.design-editor .de-head-actions { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.design-editor .de-area { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.design-editor .de-controls-col > div > .de-area:first-child { margin-top: 0; }
.design-editor .de-area-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.design-editor .de-area-head h4 { margin: 0; font-size: 14px; font-weight: 700; }
.design-editor .de-hint { margin: 4px 0 8px; }
.design-editor .de-sub-area { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.design-editor .de-colours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.design-editor .de-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
.design-editor .de-num { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.design-editor .de-num .input { width: 72px; }
.design-editor .de-pick { margin-top: 10px; }
.design-editor .de-pick-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.design-editor .switch { margin: 4px 0; }
.design-editor .callout { margin: 8px 0; }
.design-editor .de-type-hint .callout { margin-top: 0; margin-bottom: 12px; }
.design-editor .de-section-title { margin: 16px 0 6px; color: var(--ink); }
.design-editor .de-progress { font-weight: 600; color: var(--ink-2); }

/* Artwork slots in the importers: each one takes a dropped file */
.design-editor .de-slot { transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.design-editor .de-slot:not(.has-art) { border-style: dashed; border-color: var(--line-strong); }
.design-editor .de-slot.drag-over { border: 2px dashed var(--accent); background: var(--accent-soft); }
.design-editor .de-drop-hint { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; margin-top: 4px; }
.design-editor .de-drop-hint .ico { flex: 0 0 auto; margin-top: 1px; color: var(--accent-ink); }
.design-editor .de-slot-thumb { display: block; width: 100%; max-width: 520px; height: auto; border-radius: var(--r-sm); border: 1px solid var(--line); margin: 6px 0; }
/* Adjust layout: a click on the preview goes to that part's settings, which flash */
.design-editor .de-pickable svg { cursor: pointer; }
.design-editor .de-area.de-flash { animation: de-flash 1.4s ease-out; }
@keyframes de-flash {
  0%, 35% { box-shadow: 0 0 0 3px var(--accent); background: var(--accent-soft); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
.design-editor .de-slot-thumb.is-vertical { width: auto; max-width: 100%; max-height: 300px; }
/* A design with both sizes: one block per size, and the prompt for the other size */
.design-editor .de-art + .de-art { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.design-editor .de-other-size { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; padding: 10px 12px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm); color: var(--muted); font-size: 13px; }
.design-editor .de-other-size > span { flex: 1 1 220px; }
.design-editor .de-other-size .ico { flex: 0 0 auto; color: var(--accent-ink); }
.design-editor .de-stages { display: flex; flex-direction: column; gap: 10px; }
.design-editor .de-stage-vert { align-self: center; width: 46%; }

/* Colour inputs with their hex code */
.design-editor .colour-field {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer; min-height: 34px;
}
.design-editor .colour-field:hover { border-color: var(--line-strong); }
.design-editor .colour-field input[type="color"] {
  width: 30px; height: 26px; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: none; cursor: pointer; flex: 0 0 auto;
}
.design-editor .colour-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.design-editor .colour-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.design-editor .colour-hex { font: 12px/1.25 var(--font-mono); color: var(--muted); }
.design-editor .colour-field.compact { padding: 2px 8px 2px 2px; gap: 6px; min-height: 30px; }
.design-editor .range-field { display: inline-flex; flex-direction: column; gap: 2px; }
.design-editor .range-row { display: inline-flex; align-items: center; gap: 8px; }
.design-editor .range-readout { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 112px; }

/* Edit colours & text: category colours as a table */
.design-editor .cat-colours { width: 100%; border-collapse: collapse; }
.design-editor .cat-colours th, .design-editor .cat-colours td { padding: 4px 6px; text-align: left; vertical-align: middle; }
.design-editor .cat-colours thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.design-editor .cat-colours tbody th { font-size: 13px; font-weight: 600; color: var(--ink); }
.design-editor .cat-colours tbody tr + tr { border-top: 1px solid var(--line); }

/* =====================================================================
   The campaign's design picker
   ===================================================================== */
.modal.design-picker { height: min(780px, calc(100vh - 32px)); }
.design-picker .modal-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.design-picker .picker-split {
  flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr);
}
.design-picker .picker-list { min-height: 0; overflow: auto; padding: 14px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.design-picker .picker-bar { display: flex; justify-content: flex-end; }
.design-picker .picker-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.design-picker .picker-tile .meta { gap: 4px; }
.design-picker .picker-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.design-picker .tile-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.design-picker .tile-tags:empty { display: none; }
.design-picker .picker-drawn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; text-align: center; }
/* Beats ".tile .thumb svg { width: 100% }", which is meant for thumbnails. */
.design-picker .tile .thumb .picker-drawn .ico { width: 20px; height: 20px; flex: 0 0 auto; }
.design-picker .picker-manage { font-size: 13px; margin-top: auto; padding-top: 4px; }
.design-picker .picker-preview { min-height: 0; overflow: auto; padding: 14px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.design-picker .picker-preview .seg { align-self: flex-start; }
.design-picker .picker-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
@media (max-width: 820px) {
  .design-picker .picker-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .design-picker .picker-preview { order: -1; }
}

/* =====================================================================
   panelPicker: a box dragged over a picture of the artwork.  Not scoped: the slide
   editor's "Adjust text area" dialog uses it as well.
   ===================================================================== */
.zone-pick {
  position: relative; width: 100%; margin: 4px 0; background-color: var(--stage); background-size: 100% 100%; background-repeat: no-repeat;
  border-radius: 6px; border: 1px solid var(--line); user-select: none; -webkit-user-select: none; touch-action: none;
}
/* Seen on any artwork: a white border, a dark dashed line just outside it and a thin dark ring inside. */
.zone-box {
  position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px dashed rgba(15, 19, 32, .9); outline-offset: 0;
  box-shadow: inset 0 0 0 1px rgba(15, 19, 32, .55); background: rgba(169, 42, 254, .16); cursor: move; touch-action: none;
}
.zone-box:hover { background: rgba(169, 42, 254, .24); }
.zone-box:focus, .zone-box:focus-visible, .zone-box.dragging {
  outline: 1px dashed rgba(15, 19, 32, .9); outline-offset: 0;
  box-shadow: inset 0 0 0 1px rgba(15, 19, 32, .55), 0 0 0 3px var(--accent);
}
/* 16px handles with a 24px hit area, centred on the corners. */
.zone-box .h {
  position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid var(--chrome); border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.zone-box .h::before { content: ''; position: absolute; inset: -6px; }
.zone-box .h.nw { left: -10px; top: -10px; cursor: nwse-resize; }
.zone-box .h.ne { right: -10px; top: -10px; cursor: nesw-resize; }
.zone-box .h.sw { left: -10px; bottom: -10px; cursor: nesw-resize; }
.zone-box .h.se { right: -10px; bottom: -10px; cursor: nwse-resize; }
.zone-label {
  position: absolute; left: 12px; bottom: calc(100% + 4px); max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  padding: 1px 6px; border-radius: 4px; background: var(--chrome); color: #fff; font-size: 12px; line-height: 16px; font-weight: 700;
  white-space: nowrap; pointer-events: none;
}
.zone-label.inside { bottom: auto; top: 10px; }
.zone-readout { margin-top: 2px; }
.zone-exact { margin-top: 2px; }
.zone-exact > summary { cursor: pointer; width: max-content; font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.zone-exact > summary:hover { text-decoration: underline; }
.zone-exact-fields { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.zone-num { display: inline-flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.zone-num .input { width: 84px; min-height: 30px; padding: 4px 8px; }

/* Motion preview (Designs › a category design › Motion background) */
.motion-stage { display: flex; flex-direction: column; gap: 10px; }
.motion-progress { width: 100%; height: 10px; }
.motion-video { display: block; width: 100%; height: auto; border-radius: var(--r-md); background: #000; }
.art-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Lettering on a text-free motion background: the switch, then its button */
.motion-letters { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.motion-letters .check-line { align-items: flex-start; }
.motion-letters .check-line input { margin-top: 3px; }
/* Lettering dialog: a part's picture, its colours, its wording */
.ml-block { margin: 6px 0 10px; }
.ml-piece { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ml-thumb { width: 120px; height: 56px; object-fit: contain; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: repeating-conic-gradient(var(--surface-2, #e8e8ee) 0% 25%, var(--surface, #fff) 0% 50%) 50% / 14px 14px; }
.ml-thumb-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3, #777); }
.ml-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ml-swatches { display: flex; gap: 6px; }
.ml-swatches input[type="color"] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: none; cursor: pointer; }
.ml-more { margin: 8px 0; }
.ml-more > summary { cursor: pointer; width: max-content; font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-bottom: 6px; }
.ml-more > .field, .de-area > .field { margin-top: 8px; }

/* Designs › New from the studio (artwork sent from Slide Builder) */
.studio-inbox { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.studio-inbox-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.studio-inbox-head h3 { margin: 0; font-size: 15px; }
.studio-inbox-head .hint { flex-basis: 100%; }
.studio-inbox-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.studio-inbox-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.studio-inbox-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sm, 6px); background: var(--surface-2, #eee); flex: none; }
.studio-inbox-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0; }
.studio-inbox-actions { display: flex; gap: 8px; }

/* Artwork studio (#/studio) */
.studio-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.studio-waiting { margin: 0 0 12px; font-weight: 600; }
.studio-section { margin-bottom: 24px; }
.studio-section h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 8px; }
.studio-section h2 .n { font-size: 12px; font-weight: 600; color: var(--muted); }
.studio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.studio-grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.studio-tile .thumb { aspect-ratio: 1 / 1; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.studio-tile .thumb.wide { aspect-ratio: 16 / 9; }
.studio-tile .thumb img { object-fit: contain; padding: 6px; }
.studio-tile .thumb.wide img { padding: 0; }

/* Artwork studio › Make a campaign slide */
.studio-make { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.studio-steps { margin: 0 0 12px; padding-left: 20px; }
.studio-brief { display: grid; gap: 12px; max-width: 760px; margin-bottom: 16px; }
.studio-brief textarea { resize: vertical; }
.studio-refs-head { margin: 4px 0 8px; }
.studio-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.studio-ref { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); font: inherit; font-size: 12px; text-align: left; cursor: pointer; color: var(--ink-2); }
.studio-ref img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sm); background: var(--stage); }
.studio-ref span { display: flex; align-items: center; gap: 4px; }
.studio-ref.on { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.studio-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); text-align: center; cursor: pointer; color: var(--ink-2); }
.studio-drop:hover, .studio-drop:focus-visible, .studio-drop.drop-active { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.studio-drop .hint { max-width: 560px; }
.studio-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; margin-top: 16px; }
.studio-result { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.studio-result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.studio-result-head strong { overflow-wrap: anywhere; }
.studio-result-stage { position: relative; aspect-ratio: 16 / 9; background: var(--stage); border-radius: var(--r-sm); overflow: hidden; }
.studio-result-stage img { width: 100%; height: 100%; display: block; }
.studio-field { position: absolute; border: 3px solid #39FF14; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); pointer-events: none; }
.studio-field.bad { border-color: #FA1C00; }
.studio-field span { position: absolute; left: 4px; top: 4px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; font-weight: 700; }
.studio-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-result .callout ul { margin: 4px 0 0; padding-left: 18px; }
.studio-checklist { display: grid; gap: 10px; }
.studio-checklist img { width: 100%; max-height: 300px; object-fit: contain; background: var(--stage); border-radius: var(--r-sm); }
.studio-prompt { width: 100%; font-family: var(--mono, monospace); font-size: 12px; }
.studio-lib-title { font-size: 18px; margin: 24px 0 4px; }
.studio-briefdoc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); max-width: 760px; }
.studio-briefdoc-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 220px; min-width: 0; }
.studio-prompt-edit { width: 100%; max-width: 760px; resize: vertical; line-height: 1.45; }
.studio-prompt-note { max-width: 760px; margin: 4px 0 12px; }
.studio-prompt-note .link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent-ink); cursor: pointer; text-decoration: underline; }
.studio-versions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Artwork studio › Make in layers */
.studio-mode { margin: 4px 0 16px; }
.studio-layers .callout { margin-bottom: 12px; }
.studio-layer-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .studio-layer-board { grid-template-columns: 1fr; } }
.studio-layer-rows { display: grid; gap: 8px; }
.studio-layer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.studio-layer-row.has { background: var(--surface); }
.studio-layer-row.drop-active { border-color: var(--accent); background: var(--accent-soft); }
.studio-layer-thumb { width: 72px; height: 54px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--stage); color: var(--muted); font-weight: 700; overflow: hidden; }
.studio-layer-thumb.see-through { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; }
.studio-layer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.studio-layer-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; }
.studio-layer-text .hint, .studio-layer-warn { font-size: 12px; overflow-wrap: anywhere; }
.studio-layer-warn { color: var(--bad, #b42318); font-weight: 600; }
.studio-layer-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-layer-preview { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 8px; }
.studio-layer-empty { display: flex; align-items: center; justify-content: center; height: 100%; padding: 16px; text-align: center; }
.studio-layer-busy { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: var(--r-sm); background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 600; }
.studio-drag { position: absolute; border: 2px dashed #39FF14; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); cursor: move; touch-action: none; }
.studio-drag-handle { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; border-radius: 3px; background: #fff; border: 2px solid #111; cursor: nwse-resize; }
.studio-adjust { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--accent-soft); }
.studio-adjust strong { margin-right: 4px; }
.studio-layer-row.hidden-layer { opacity: .55; }
.studio-fix { display: grid; gap: 10px; }
.studio-fix-stage { cursor: crosshair; touch-action: none; user-select: none; }
.studio-fix-box { position: absolute; border: 3px dashed #39FF14; background: rgba(57, 255, 20, .12); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); pointer-events: none; }
.studio-drop.small { padding: 12px; }
.studio-fix-result { display: grid; gap: 6px; }
.studio-layer-canvas { display: block; width: 100%; height: 100%; }

/* Artwork studio › Generate */
.studio-gen { display: grid; gap: 8px; margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--accent-soft); max-width: 760px; }
.studio-gen-head { display: flex; flex-direction: column; gap: 2px; }
.studio-gen .studio-actions { margin: 0; }
.studio-gen-confirm img { width: 100%; border-radius: var(--r-sm); margin-top: 6px; }
.studio-fix-marks { position: absolute; inset: 0; pointer-events: none; }
.studio-fix-num { position: absolute; top: 2px; left: 4px; font-weight: 800; font-size: 13px; color: #39FF14; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.studio-fix-info { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
