/*!
 * Cineskill native · Director gallery (Claude · Opus 5.5, 2026-12-03). Pairs with director-gallery.html.
 * Scope: body[data-host="native"] #director-gallery — Creature and Mounty (body[data-theme]). Web untouched.
 * Window 410 × 590 pt. Header, filter drawer and chips stay fixed; .dg-scroll scrolls internally on short windows.
 *
 * Material: colourless optical glass, read at its edge (same recipe as projector/web-optical.css):
 *   clear face · darker, slightly refracting edge band · 1 px inner edge light · 1.5 px top-left bevel specular.
 *   Every edge is a border-radius painted by masks: no clip-path, no rotation, so edges stay anti-aliased.
 * Colour: film stills at true colour, never filtered, tinted, dimmed or cropped (the main still is contained).
 *   Lime (#d5ff38) appears only on a selection (scene, reference, mode) and on the primary action, Copy Skill.
 * Focus: 2 px white ring. Reduced motion: no movement; state changes are instant.
 */
@property --dg-light { syntax: '<number>'; inherits: true; initial-value: .16; }

body[data-host="native"] #director-gallery {
  --dg-ink: #f4f5f2;
  --dg-muted: #a3a6a0;
  --dg-quiet: #7d807b;
  --dg-hair: rgba(255, 255, 255, .08);
  --dg-lime-rgb: 213, 255, 56;       /* the selection / primary accent (Creature lime) */
  --dg-lime: rgb(var(--dg-lime-rgb));
  --dg-lime-hi: #e2ff77;
  --dg-lime-ink: #10120a;
  --dg-ring: rgba(255, 255, 255, .92);
  --dg-ease: cubic-bezier(.2, .8, .2, 1);
  /* theme knobs (Creature defaults: thin smoke-black glass, crisp bevel) */
  --dg-radius: 30px;
  --dg-edge: 8px;
  --dg-edge-dark: .55;
  --dg-spec: .9;
  --dg-spec-soft: 0px;

  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: var(--dg-height, 100vh);
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;              /* the bottom inset lives outside the scroller */
  overflow: hidden;
  color: var(--dg-ink);
  background: rgba(6, 7, 7, .94);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
  font: 13px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
/* Mounty: the same colourless glass, thicker and softer, like a cloth-wrapped lens. */
body[data-host="native"][data-theme="mounty"] #director-gallery {
  /* Mounty's accent is gold (owner): selection, primary action, focus glows */
  --dg-lime-rgb: 242, 193, 78;
  --dg-lime-hi: #ffd978;
  --dg-lime-ink: #1d1406;
  --dg-radius: 34px;
  --dg-edge: 11px;
  --dg-edge-dark: .68;
  --dg-spec: .72;
  --dg-spec-soft: .6px;
}
body[data-host="native"] #director-gallery *,
body[data-host="native"] #director-gallery *::before,
body[data-host="native"] #director-gallery *::after { box-sizing: border-box; }
body[data-host="native"] #director-gallery [hidden] { display: none !important; }
body[data-host="native"] #director-gallery :is(h2, p, figure) { margin: 0; }
body[data-host="native"] #director-gallery :is(button, select) {
  font: inherit; color: inherit; margin: 0; border: 0; background: none;
  -webkit-appearance: none; appearance: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
/* controls are not text: a double-click on a chip or key never paints a selection highlight */
body[data-host="native"] #director-gallery button { -webkit-user-select: none; user-select: none; }
body[data-host="native"] #director-gallery button:disabled { cursor: default; }

/* ───────── optical glass recipe ───────── */
body[data-host="native"] #director-gallery :is(.dg-slab, .dg-back, .dg-refine, .dg-add, .dg-step, .dg-quiet, .dg-modes, .dg-agent) {
  --dg-e: 4px;
  position: relative;
  isolation: isolate;
  background-color: rgba(255, 255, 255, .014);
  transition: --dg-light .14s ease-out, transform .16s var(--dg-ease), opacity .14s ease-out;
}
body[data-host="native"] #director-gallery .dg-slab { --dg-e: var(--dg-edge); }
/* edge band: only this ring darkens and refracts what is behind it */
body[data-host="native"] #director-gallery :is(.dg-slab, .dg-back, .dg-refine, .dg-add, .dg-step, .dg-quiet, .dg-modes, .dg-agent)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  padding: var(--dg-e);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background: rgba(255, 255, 255, .02);
  -webkit-backdrop-filter: blur(3px) brightness(var(--dg-edge-dark)) contrast(1.12) saturate(.85);
  backdrop-filter: blur(3px) brightness(var(--dg-edge-dark)) contrast(1.12) saturate(.85);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6);
  outline: 1px solid rgba(255, 255, 255, var(--dg-light));
  outline-offset: calc(1px - var(--dg-e));
}
/* bevel specular: neutral light on a 1.5 px ring, lit toward the top-left only */
body[data-host="native"] #director-gallery :is(.dg-slab, .dg-back, .dg-refine, .dg-add, .dg-step, .dg-quiet, .dg-modes, .dg-agent)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background: conic-gradient(from 300deg,
    rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, var(--dg-spec)) 20deg, rgba(255, 255, 255, .42) 38deg, rgba(255, 255, 255, 0) 66deg,
    rgba(255, 255, 255, 0) 172deg, rgba(255, 255, 255, .2) 198deg, rgba(255, 255, 255, 0) 226deg, rgba(255, 255, 255, 0) 360deg);
  filter: blur(var(--dg-spec-soft));
}
@media (hover: hover) {
  body[data-host="native"] #director-gallery :is(.dg-back, .dg-refine, .dg-add, .dg-step, .dg-quiet, .dg-agent):hover:not(:disabled) { --dg-light: .36; background-color: rgba(255, 255, 255, .045); }
}
body[data-host="native"] #director-gallery :is(.dg-back, .dg-refine, .dg-add, .dg-step, .dg-quiet):active:not(:disabled) { transform: scale(.97); }

/* chevrons drawn as two 1.5 px strokes (no glyph fonts, no images) */
body[data-host="native"] #director-gallery .dg-chev {
  display: inline-block; width: 7px; height: 7px; flex: none;
  border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; border-radius: 1px;
  transform: translateX(1.5px) rotate(45deg);
}
body[data-host="native"] #director-gallery .dg-step-next .dg-chev { transform: translateX(-1.5px) rotate(-135deg); }

/* ───────── header: Back to choices + Filters (outside the scroller) ───────── */
body[data-host="native"] #director-gallery .dg-bar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px 8px;
  min-height: 52px;
}
body[data-host="native"] #director-gallery :is(.dg-back, .dg-refine) {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; border-radius: 17px;
  font-weight: 600; font-size: 13px; letter-spacing: -.01em;
}
body[data-host="native"] #director-gallery .dg-back { padding: 0 14px 0 11px; gap: 6px; }
/* The character rides in Back: the button returns you to it. Original art, never tinted or redrawn. */
body[data-host="native"] #director-gallery .dg-pet {
  flex: none; width: 34px; height: 26px; margin: -2px 0;
  background: no-repeat center / contain url("/projector/assets/hero-cat-projector.webp");
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55));
  transition: transform .2s var(--dg-ease);
}
body[data-host="native"][data-theme="mounty"] #director-gallery .dg-pet {
  width: 26px; background-image: url("/projector/assets/hero-mounty.webp");
}
@media (hover: hover) { body[data-host="native"] #director-gallery .dg-back:hover .dg-pet { transform: translateY(-1.5px); } }
body[data-host="native"] #director-gallery .dg-refine { padding: 0 14px 0 12px; color: var(--dg-ink); }
/* neutral open state: brighter edge, no lime (it is a toggle, not a selection) */
body[data-host="native"] #director-gallery .dg-refine[aria-expanded="true"] { --dg-light: .62; background-color: rgba(255, 255, 255, .07); }
/* filter glyph: three 1.5 px rails with stops, drawn in CSS */
body[data-host="native"] #director-gallery .dg-sliders {
  position: relative; width: 13px; height: 10px; flex: none;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 100% 1.5px no-repeat,
    linear-gradient(currentColor 0 0) 0 50% / 100% 1.5px no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 100% 1.5px no-repeat;
  opacity: .9;
}
body[data-host="native"] #director-gallery .dg-sliders::before,
body[data-host="native"] #director-gallery .dg-sliders::after {
  content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #0b0c0b; box-shadow: 0 0 0 1.5px currentColor;
}
body[data-host="native"] #director-gallery .dg-sliders::before { left: 2px; top: -1.25px; }
body[data-host="native"] #director-gallery .dg-sliders::after { right: 2px; top: 3.25px; }

/* ───────── inline filter drawer: image + text, two rows (category keys / value shelf) ───────── */
body[data-host="native"] #director-gallery .dg-drawer {
  flex: none;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  margin: 0 12px 6px; padding: 6px;
  border-radius: 22px;
  background: rgba(10, 11, 10, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
}
/* category keys: art + name in a glass segmented pill; the chosen one is a selection (lime) */
body[data-host="native"] #director-gallery .dg-axes {
  display: flex; gap: 3px; padding: 3px; border-radius: 17px;
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
body[data-host="native"] #director-gallery .dg-axes > button {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 8px 0 4px; border-radius: 14px;
  font-weight: 600; font-size: 12.5px; color: var(--dg-muted);
  transition: background-color .14s ease-out, box-shadow .14s ease-out, color .14s ease-out;
}
@media (hover: hover) { body[data-host="native"] #director-gallery .dg-axes > button:hover { background-color: rgba(255, 255, 255, .07); color: var(--dg-ink); } }
body[data-host="native"] #director-gallery .dg-axes > button[aria-checked="true"] {
  color: var(--dg-lime);
  background-color: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1.5px var(--dg-lime), 0 0 10px -3px rgba(var(--dg-lime-rgb), .45);
}
body[data-host="native"] #director-gallery .dg-axes canvas,
body[data-host="native"] #director-gallery .dg-axes img { flex: none; width: 26px; height: 26px; }

/* value shelf: art + name + how many scenes still match; scrolls sideways */
body[data-host="native"] #director-gallery .dg-values {
  display: flex; gap: 5px; padding: 1px 22px 1px 1px; min-height: 38px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}
body[data-host="native"] #director-gallery .dg-values::-webkit-scrollbar { display: none; }
body[data-host="native"] #director-gallery .dg-values > button {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; max-width: 170px; padding: 0 10px 0 4px; border-radius: 13px;
  font-weight: 600; font-size: 12.5px; color: var(--dg-ink); white-space: nowrap;
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background-color .14s ease-out, box-shadow .14s ease-out, transform .16s var(--dg-ease);
}
@media (hover: hover) {
  body[data-host="native"] #director-gallery .dg-values > button:hover { background-color: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .36); }
}
body[data-host="native"] #director-gallery .dg-values > button:active { transform: scale(.96); }
body[data-host="native"] #director-gallery .dg-values canvas,
body[data-host="native"] #director-gallery .dg-values img { flex: none; width: 30px; height: 30px; }
body[data-host="native"] #director-gallery .dg-values > button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body[data-host="native"] #director-gallery .dg-values .dg-n {
  flex: none; font: 500 10px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--dg-quiet); font-variant-numeric: tabular-nums;
}
/* generated art keeps its proportions */
body[data-host="native"] #director-gallery :is(.dg-axes, .dg-values, .dg-chips) :is(canvas, img) {
  display: block; object-fit: contain; pointer-events: none;
}

/* ───────── current filters: removable chips, one quiet row ───────── */
body[data-host="native"] #director-gallery .dg-chips {
  flex: none;
  display: flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 2px 12px 6px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  scroll-padding-inline: 12px;
  -webkit-mask: linear-gradient(90deg, #000 calc(100% - 18px), transparent);   /* soft exit when chips overflow */
  mask: linear-gradient(90deg, #000 calc(100% - 18px), transparent);
}
body[data-host="native"] #director-gallery .dg-chips::-webkit-scrollbar { display: none; }
body[data-host="native"] #director-gallery .dg-chips:not(:has(> *)) { display: none; }
body[data-host="native"] #director-gallery .dg-chips > button {
  flex: none; max-width: 230px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 9px 0 11px; border-radius: 13px;
  font-weight: 600; font-size: 12px; color: var(--dg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, .035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), inset 0 1px 0 rgba(255, 255, 255, .13);
  transition: background-color .14s ease-out, box-shadow .14s ease-out;
}
body[data-host="native"] #director-gallery .dg-chips > button[data-axis]::before {
  content: attr(data-axis);
  font: 600 9px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dg-quiet);
}
body[data-host="native"] #director-gallery .dg-chips > button::after {
  content: "×"; font-size: 15px; font-weight: 400; line-height: 1; color: var(--dg-muted); margin-left: 1px;
}
@media (hover: hover) {
  body[data-host="native"] #director-gallery .dg-chips > button:hover { background-color: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .34); }
  body[data-host="native"] #director-gallery .dg-chips > button:hover::after { color: var(--dg-ink); }
}
/* image + text chips: the value's art, its name, and the × */
body[data-host="native"] #director-gallery .dg-chips > button:has(canvas, img) {
  height: 32px; max-width: 200px; padding: 0 9px 0 3px; gap: 6px; border-radius: 12px;
}
body[data-host="native"] #director-gallery .dg-chips > button[data-axis]:has(canvas, img)::before,
body[data-host="native"] #director-gallery .dg-chips > button:has(canvas, img)::before { content: none; display: none; }
body[data-host="native"] #director-gallery .dg-chips > button :is(canvas, img) { flex: none; width: 26px; height: 26px; }
body[data-host="native"] #director-gallery .dg-chips > button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body[data-host="native"] #director-gallery .dg-chips:has(> button canvas, > button img) { min-height: 42px; }


/* ───────── scroller ───────── */
/* The area below the header no longer scrolls as a whole: it holds the glass card as a complete, fixed frame. */
body[data-host="native"] #director-gallery .dg-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 2px 8px 0;
  display: flex; flex-direction: column;
}

/* ───────── the slab: one clear glass card ───────── */
body[data-host="native"] #director-gallery .dg-slab {
  flex: 1 1 auto;                   /* fits the space; its rounded glass edge is always whole */
  min-height: 0;
  display: flex; flex-direction: column;
  gap: 0;
  padding: 7px;
  border-radius: var(--dg-radius);
  box-shadow: 0 30px 52px -32px rgba(0, 0, 0, .95);
}
/* Inside the frame: the still, shelf and action well scroll; the action well stays pinned to the frame's bottom. */
body[data-host="native"] #director-gallery .dg-slab-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex; flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  border-radius: calc(var(--dg-radius) - 7px);
}
body[data-host="native"] #director-gallery .dg-slab-scroll::-webkit-scrollbar { display: none; }

/* screen: the whole frame, uncropped, on true black */
body[data-host="native"] #director-gallery .dg-screen {
  position: relative;
  flex: none;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--dg-radius) - 7px);
  overflow: hidden;
  background: #000;
}
body[data-host="native"] #director-gallery #gallery-image {
  display: block; width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  opacity: 1;
  transition: opacity .2s ease-out;
  -webkit-user-drag: none; user-select: none;
}
body[data-host="native"] #director-gallery #gallery-image[data-state="loading"] { opacity: .35; }
body[data-host="native"] #director-gallery #gallery-image:is([data-state="error"], [data-state="missing"]) { visibility: hidden; }
/* a hairline rim above the picture: border only, the picture itself is never covered */
body[data-host="native"] #director-gallery .dg-screen::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
body[data-host="native"] #director-gallery .dg-screen:has(#gallery-image:is([data-state="error"], [data-state="missing"]))::before {
  content: "No preview"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; color: var(--dg-quiet);
}

/* shelf: clear glass, title + references, then the scene scrubber on a tick scale */
body[data-host="native"] #director-gallery .dg-shelf {
  flex: 1 0 auto;                 /* spare height becomes air between the caption and the scrubber */
  display: flex; flex-direction: column;
  padding: 13px 9px 10px;
}
body[data-host="native"] #director-gallery .dg-caption {
  display: flex; align-items: flex-end; gap: 12px;
}
body[data-host="native"] #director-gallery .dg-name { flex: 1; min-width: 0; }
body[data-host="native"] #director-gallery #gallery-title {
  font-size: 22px; line-height: 1.1; font-weight: 450; letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-host="native"] #director-gallery #gallery-film {
  margin-top: 4px;
  font-size: 12px; color: var(--dg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* reference choices: numbered glass keys (the screen above shows the chosen frame) */
body[data-host="native"] #director-gallery .dg-refs {
  flex: none; display: flex; gap: 5px;
  counter-reset: dg-ref;
  max-width: 50%; overflow-x: auto; scrollbar-width: none;
  padding: 3px;
}
body[data-host="native"] #director-gallery .dg-refs::-webkit-scrollbar { display: none; }
body[data-host="native"] #director-gallery .dg-refs > button {
  counter-increment: dg-ref;
  position: relative; flex: none;
  width: 28px; height: 28px; border-radius: 9px;
  font-size: 0; color: var(--dg-muted);
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: color .14s ease-out, box-shadow .14s ease-out, background-color .14s ease-out;
}
body[data-host="native"] #director-gallery .dg-refs > button > img { display: none; }
body[data-host="native"] #director-gallery .dg-refs > button::before {
  content: counter(dg-ref);
  font: 600 11.5px/28px ui-monospace, "SF Mono", Menlo, monospace;
}
@media (hover: hover) {
  body[data-host="native"] #director-gallery .dg-refs > button:hover { color: var(--dg-ink); background-color: rgba(255, 255, 255, .07); }
}
body[data-host="native"] #director-gallery .dg-refs > button[aria-pressed="true"] {
  color: var(--dg-lime);
  background-color: rgba(255, 255, 255, .02);
  box-shadow: inset 0 0 0 1px rgba(var(--dg-lime-rgb), .8), 0 0 10px -2px rgba(var(--dg-lime-rgb), .3);
}

body[data-host="native"] #director-gallery .dg-scrub {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; padding-top: 13px;
}
body[data-host="native"] #director-gallery .dg-step {
  flex: none;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  color: var(--dg-ink);
}
body[data-host="native"] #director-gallery .dg-step:disabled { opacity: .32; }
/* nearby scenes ride a calibration scale; each scene owns one tick */
body[data-host="native"] #director-gallery .dg-scenes {
  flex: 1; min-width: 0;
  position: relative;
  display: flex; justify-content: center; gap: 6px;
  padding: 3px 2px 14px;
}
body[data-host="native"] #director-gallery .dg-scenes::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 5px; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .2) 0 1px, transparent 1px 7px);
}
body[data-host="native"] #director-gallery .dg-scenes > button {
  position: relative;
  flex: 0 1 52px; min-width: 0;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: transform .18s var(--dg-ease), box-shadow .14s ease-out;
  font-size: 0; color: transparent;
}
body[data-host="native"] #director-gallery .dg-scenes > button > img {
  display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
  -webkit-user-drag: none; pointer-events: none;
}
body[data-host="native"] #director-gallery .dg-scenes > button::after {   /* the scene's own tick */
  content: ""; position: absolute; left: 50%; bottom: -12px; width: 1px; height: 9px; margin-left: -.5px;
  background: rgba(255, 255, 255, .45);
}
@media (hover: hover) {
  body[data-host="native"] #director-gallery .dg-scenes > button:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }
}
body[data-host="native"] #director-gallery .dg-scenes > button[aria-pressed="true"] {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1.5px var(--dg-lime), 0 6px 12px -6px rgba(0, 0, 0, .9);
}
body[data-host="native"] #director-gallery .dg-scenes > button[aria-pressed="true"]::after {
  width: 1.5px; height: 12px; bottom: -15px; margin-left: -.75px; background: var(--dg-lime);
}
body[data-host="native"] #director-gallery .dg-count {
  margin-top: 5px; text-align: center;
  font: 500 10px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em;
  color: var(--dg-muted); font-variant-numeric: tabular-nums;
}

/* console: the dark action well */
/* The action well never leaves the window: when the drawer and chips take height (or the window is short),
   it stays pinned to the bottom of the scroller and the still + shelf scroll beneath it. */
body[data-host="native"] #director-gallery .dg-console {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  border-radius: calc(var(--dg-radius) - 7px);
  background: rgb(11, 12, 11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px rgba(255, 255, 255, .04),
    0 -16px 22px -14px rgba(0, 0, 0, .95);
}
body[data-host="native"] #director-gallery .dg-row { display: flex; align-items: center; gap: 8px; min-width: 0; }

body[data-host="native"] #director-gallery .dg-modes {
  flex: none; display: flex; padding: 3px; gap: 2px;
  height: 34px; border-radius: 17px;
}
body[data-host="native"] #director-gallery .dg-modes > button {
  height: 28px; padding: 0 13px; border-radius: 14px;
  font-weight: 600; font-size: 12.5px; color: var(--dg-muted);
  transition: color .14s ease-out, background-color .14s ease-out, box-shadow .14s ease-out;
}
@media (hover: hover) { body[data-host="native"] #director-gallery .dg-modes > button:hover { color: var(--dg-ink); } }
body[data-host="native"] #director-gallery .dg-modes > button[aria-pressed="true"] {
  color: var(--dg-lime);
  background-color: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(var(--dg-lime-rgb), .7);
}
body[data-host="native"] #director-gallery .dg-agent {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 4px 0 13px; border-radius: 17px; cursor: pointer;
  font-size: 12.5px; color: var(--dg-quiet);
}

body[data-host="native"] #director-gallery .dg-actions { gap: 7px; }
body[data-host="native"] #director-gallery .dg-primary {
  flex: 1.35; min-width: 0;
  height: 42px; padding: 0 14px; border-radius: 15px;
  background: var(--dg-lime); color: var(--dg-lime-ink);
  font-weight: 680; font-size: 14px; letter-spacing: -.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .18), 0 10px 22px -14px rgba(var(--dg-lime-rgb), .55);
  transition: transform .16s var(--dg-ease), background-color .14s ease-out;
}
@media (hover: hover) { body[data-host="native"] #director-gallery .dg-primary:hover { background-color: var(--dg-lime-hi); } }
body[data-host="native"] #director-gallery .dg-primary:active { transform: scale(.975); }
body[data-host="native"] #director-gallery .dg-quiet {
  flex: 1; min-width: 0;
  height: 42px; padding: 0 12px; border-radius: 15px;
  font-weight: 600; font-size: 13px; color: var(--dg-ink);
  white-space: nowrap;
}
body[data-host="native"] #director-gallery .dg-link {
  flex: none; height: 42px; padding: 0 6px;
  font-size: 12.5px; font-weight: 550; color: var(--dg-muted);
  text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px;
}
@media (hover: hover) { body[data-host="native"] #director-gallery .dg-link:hover { color: var(--dg-ink); text-decoration-color: currentColor; } }

/* ───────── empty / loading / unavailable (the Director picker above stays usable) ───────── */
body[data-host="native"] #director-gallery .dg-empty {
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 28px 40px; text-align: center;
}
body[data-host="native"] #director-gallery .dg-empty::before {   /* an empty screen, same proportion as the plate */
  content: ""; width: 100%; max-width: 300px; aspect-ratio: 16 / 9; border-radius: 18px;
  background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  margin-bottom: 6px;
}
body[data-host="native"] #director-gallery #gallery-empty-message { font-size: 14px; color: var(--dg-muted); }
body[data-host="native"] #director-gallery .dg-empty .dg-quiet { flex: none; height: 38px; padding: 0 18px; }

/* ───────── focus ───────── */
body[data-host="native"] #director-gallery :focus { outline: none; }
body[data-host="native"] #director-gallery :is(button, select, [tabindex]):focus-visible { outline: 2px solid var(--dg-ring); outline-offset: 2px; }
body[data-host="native"] #director-gallery .dg-scenes > button:focus-visible { outline-offset: 3px; }
body[data-host="native"] #director-gallery :is(.dg-chips > button, .dg-values > button, .dg-axes > button):focus-visible { outline-offset: 1px; }
body[data-host="native"] #director-gallery #gallery-agent:focus-visible { outline: none; }
body[data-host="native"] #director-gallery .dg-agent:focus-within { outline: 2px solid var(--dg-ring); outline-offset: 2px; --dg-light: .6; }

/* ───────── short windows: tighter rhythm; the scroller takes the rest ───────── */
@media (max-height: 540px) {
  body[data-host="native"] #director-gallery .dg-bar { min-height: 44px; padding-top: 6px; padding-bottom: 4px; }
  body[data-host="native"] #director-gallery :is(.dg-back, .dg-refine) { height: 30px; }
  body[data-host="native"] #director-gallery .dg-drawer { margin-bottom: 4px; padding: 4px; }
  body[data-host="native"] #director-gallery .dg-axes > button { height: 28px; }
  body[data-host="native"] #director-gallery .dg-values > button { height: 32px; }
  body[data-host="native"] #director-gallery .dg-values :is(canvas, img) { width: 26px; height: 26px; }
  body[data-host="native"] #director-gallery .dg-chips { min-height: 32px; padding-bottom: 4px; }
  body[data-host="native"] #director-gallery .dg-shelf { padding-top: 10px; padding-bottom: 8px; }
  body[data-host="native"] #director-gallery .dg-scrub { padding-top: 9px; }
  body[data-host="native"] #director-gallery #gallery-title { font-size: 19px; }
  body[data-host="native"] #director-gallery .dg-console { gap: 8px; padding: 10px; }
}
@media (max-width: 360px) {
  body[data-host="native"] #director-gallery .dg-link { display: none; }
}

/* ───────── reduced motion: nothing moves; changes are instant ───────── */
@media (prefers-reduced-motion: reduce) {
  body[data-host="native"] #director-gallery,
  body[data-host="native"] #director-gallery *,
  body[data-host="native"] #director-gallery *::before,
  body[data-host="native"] #director-gallery *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  body[data-host="native"] #director-gallery :is(.dg-scenes > button[aria-pressed="true"], .dg-scenes > button:hover, button:active) { transform: none !important; }
}

/* ───────── high contrast ───────── */
@media (forced-colors: active) {
  body[data-host="native"] #director-gallery :is(.dg-slab, .dg-back, .dg-refine, .dg-add, .dg-step, .dg-quiet, .dg-modes, .dg-agent)::before,
  body[data-host="native"] #director-gallery :is(.dg-slab, .dg-back, .dg-refine, .dg-add, .dg-step, .dg-quiet, .dg-modes, .dg-agent)::after { display: none; }
  body[data-host="native"] #director-gallery :is(.dg-refs > button, .dg-scenes > button, .dg-modes > button)[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: 1px; }
  body[data-host="native"] #director-gallery .dg-primary { border: 2px solid ButtonText; }
  body[data-host="native"] #director-gallery :is(.dg-values > button, .dg-chips > button) { border: 1px solid ButtonText; }
  body[data-host="native"] #director-gallery .dg-axes > button[aria-checked="true"] { outline: 2px solid Highlight; }
  body[data-host="native"] #director-gallery .dg-refine[aria-expanded="true"] { outline: 2px solid Highlight; }
}
