/* ==========================================================================
   design-studio.css — Design Studio's own composition.

   Same MATERIAL as the rest of Orcheum — warm paper, Libre Baskerville,
   hairlines, restrained motion. A different ARGUMENT from Research: Research
   is a sheet you read, Design is a screen you look at. So the room is built
   around one rule.

     THE SCREEN IS THE LARGEST, BRIGHTEST, MOST CENTRED THING IN THE ROOM,
     AND EVERYTHING ELSE IS QUIETER THAN IT.

   The stage is a soft recessed field so a bright generated screen lifts off
   it. The panel to its right is ink on paper with no fills of its own — it
   must never read as a second card competing with the work. The rail above is
   one hairline of metadata. Nothing here is a dashboard.

   Loaded after studios-entry.css; inherits --se-ease, --se-hair, --se-accent.
   ========================================================================== */

.ds {
  /* Ratified reading ink (Amendment 007), measured on warm paper. */
  --ds-ink: #2a1d16;
  --ds-ink-soft: rgba(42, 29, 22, 0.8);
  --ds-ink-mute: rgba(42, 29, 22, 0.68);
  --ds-ink-faint: rgba(42, 29, 22, 0.54);
  --ds-hair: rgba(42, 29, 22, 0.13);
  --ds-hair-soft: rgba(42, 29, 22, 0.07);
  --ds-ok: #2f6b4f;
  --ds-work: #8b5a32;
  --ds-serif: var(--se-serif, "Libre Baskerville", Georgia, serif);
  --ds-panel-w: clamp(232px, 22vw, 296px);
  --ds-gutter: clamp(20px, 2.6vw, 36px);
  --ds-field: rgba(42, 29, 22, 0.045);

  /* Required on the root — `.ds *` does not include `.ds` itself. Without
     this, outcome padding is clipped by overflow:hidden parents. */
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ds-panel-w);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0 var(--ds-gutter);
  width: 100%;
  height: 100%;
  min-height: 0;
  color: var(--ds-ink);
  font-family: var(--font-sans, "Geist", system-ui, sans-serif);
}

.ds *,
.ds *::before,
.ds *::after { box-sizing: border-box; }

/* Only the result state earns a margin. Everything else keeps the full width
   so the invitation and the run are never squeezed beside an empty column. */
.ds:not([data-state="screen"]) { grid-template-columns: minmax(0, 1fr); }
.ds:not([data-state="screen"]) .ds-panel { display: none; }

.ds-label {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ds-ink-mute);
}

/* ══ Rail ══════════════════════════════════════════════════════════════════ */
.ds-rail {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px 14px;
  min-height: 30px;
  margin-bottom: clamp(10px, 1.6vh, 18px);
  padding-bottom: 11px;
  border-bottom: 1px solid var(--ds-hair-soft);
}

.ds-rail__id {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ds-chip {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-ink-mute);
  white-space: nowrap;
}

.ds-chip--version { color: var(--ds-ink); font-weight: 500; }

.ds-chip--status::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.ds-chip--status[data-status="approved"] { color: var(--ds-ok); }
.ds-chip--status[data-status="superseded"] { color: var(--ds-ink-faint); }

.ds-rail__intent {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--ds-serif);
  font-size: 13.5px;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--ds-ink-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-devices {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  border: 1px solid var(--ds-hair);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.ds-device {
  position: relative;
  min-height: 25px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ds-ink-mute);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: color 0.3s var(--se-ease-soft), background 0.3s var(--se-ease-soft);
}

.ds-device:hover { color: var(--ds-ink-soft); }
.ds-device:focus-visible { outline: 2px solid var(--se-accent, #fc9b4c); outline-offset: 1px; }

.ds-device.is-on {
  color: var(--ds-ink);
  background: #fff;
  box-shadow: 0 1px 0 var(--ds-hair-soft);
}

/* The frame the screen on screen was actually made for, marked so the control
   never implies it re-rendered something it did not. */
.ds-device.is-made:not(.is-on)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: var(--se-accent, #fc9b4c);
}

/* ══ Stage ═════════════════════════════════════════════════════════════════ */
.ds-stage {
  position: relative;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* ══ Approved Design entry — Figma 683:5075 ════════════════════════════════
   The ready state is one bounded composition. The Composer remains the
   canonical shared component; this host owns only its width and placement. */
.ds-entry-open {
  --ds-entry-surface: #fefaf3;
  --ds-entry-border: #d9d1cb;
  --ds-entry-shadow: 0 26px 38.8px -40px rgba(0, 0, 0, 0.15);
  --ds-suggestion-shadow: 0 10px 38px -12px rgba(0, 0, 0, 0.1);
  --oc-studio-entry-surface: var(--ds-entry-surface);
  --oc-studio-entry-border: var(--ds-entry-border);
  --oc-studio-entry-serif: var(--ds-serif);
  --oc-studio-suggestion-shadow: var(--ds-suggestion-shadow);

  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: clip;
  overflow-y: hidden;
}

.ds[data-state="ready"] .ds-entry-open { display: flex; }
.ds[data-state="ready"] .ds-rail { display: none; }
.ds[data-state="ready"] .ds-stage {
  grid-row: 1 / -1;
  height: 100%;
  min-height: min(640px, 100%);
}

.ds-entry-open__card {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: min(1110px, 100%);
  height: auto;
  min-height: 0;
  max-height: 683px;
  padding: 0 20px clamp(20px, 5.5vh, 53px);
  overflow: hidden;
  background: var(--ds-entry-surface);
  border: 1px solid var(--ds-entry-border);
  border-radius: 20px;
  box-shadow: var(--ds-entry-shadow);
}

.ds-entry-open__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 556px;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.ds-entry-open__hero {
  display: block;
  flex: 1 1 417px;
  width: 556px;
  height: 417px;
  max-width: 100%;
  min-height: 0;
  aspect-ratio: 556 / 417;
  border: 0;
  overflow: hidden;
  pointer-events: none;
}

.ds-entry-open__headline {
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--ds-serif);
  font-size: 24px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: normal;
  color: #000;
  text-align: center;
  white-space: nowrap;
}

.ds-entry-open__composer-host {
  width: 556px;
  max-width: 100%;
  min-width: 0;
}

.ds-entry-open__composer-host .oc-composer {
  width: 100%;
  max-width: none;
  margin: 0;
}

.ds-entry-open__suggestions {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  width: min(1001px, 100%);
  min-width: 0;
}

.ds-entry-open__suggestion-item {
  flex: 0 0 319px;
  display: flex;
  width: 319px;
  min-width: 0;
}

@media (max-width: 720px) {
  .ds-entry-open {
    gap: 16px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .ds-entry-open__card {
    width: 100%;
    max-width: 100%;
    padding: 0 16px 18px;
  }

  .ds-entry-open__stack {
    gap: clamp(14px, 2.4vh, 22px);
    width: min(556px, 100%);
  }

  .ds-entry-open__hero {
    flex-basis: 300px;
    width: min(556px, calc(100vw - 62px));
    height: auto;
  }

  .ds-entry-open__headline {
    font-size: clamp(19px, 5.7vw, 24px);
    white-space: normal;
    text-wrap: balance;
  }

  .ds-entry-open__suggestions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ds-entry-open__suggestion-item {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (max-height: 760px) {
  .ds-entry-open { gap: 12px; }
  .ds-entry-open__card { padding-bottom: 14px; }
  .ds-entry-open__stack { gap: 12px; }
  .ds-entry-open__headline { font-size: 19px; }
}

/* ══ Ready — invitation, tools, starters. Never a hero block. ══════════════ */
.ds-ready {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "lead     frame"
    "starters starters"
    "recent   recent";
  /* Centred in the room rather than pinned to the top: the invitation sits
     where the screen will, and there is no dead band above the composer.
     `safe` so a short room scrolls from the top instead of clipping it. */
  align-content: safe center;
  gap: clamp(16px, 2.4vh, 26px) clamp(24px, 4vw, 52px);
  width: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 29, 22, 0.18) transparent;
}

.ds[data-state="ready"] .ds-ready { display: grid; }

.ds-ready__lead { grid-area: lead; align-self: center; min-width: 0; }

.ds-ready__eyebrow {
  margin: 0 0 7px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ds-ink-mute);
}

.ds-ready__title {
  margin: 0 0 8px;
  max-width: 20ch;
  font-family: var(--ds-serif);
  font-size: clamp(21px, 2.5vw, 29px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.03em;
  color: var(--ds-ink);
  text-wrap: balance;
}

.ds-ready__sub {
  margin: 0;
  max-width: 52ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ds-ink-soft);
}

/* The device choice, drawn. It changes with the control, so the reader can see
   what they are asking for before they ask for it. */
.ds-ready__frame {
  grid-area: frame;
  align-self: center;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.ds-ready__frame-caption {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-ink-faint);
}

.ds-blank {
  position: relative;
  width: 176px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--ds-hair);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  transition: width 0.5s var(--se-ease), aspect-ratio 0.5s var(--se-ease);
}

.ds[data-device="TABLET"] .ds-blank { width: 132px; aspect-ratio: 3 / 4; }
.ds[data-device="MOBILE"] .ds-blank { width: 92px; aspect-ratio: 9 / 18; border-radius: 12px; }
.ds[data-device="AGNOSTIC"] .ds-blank { width: 160px; aspect-ratio: 4 / 3; }

.ds-blank__chrome {
  position: absolute;
  inset: 0 0 auto;
  height: 11%;
  min-height: 7px;
  background: rgba(42, 29, 22, 0.05);
  border-bottom: 1px solid var(--ds-hair-soft);
}

.ds[data-device="MOBILE"] .ds-blank__chrome {
  inset: 4px 34% auto 34%;
  height: 4px;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(42, 29, 22, 0.14);
}

.ds-blank__mark {
  position: absolute;
  inset: 14% 10% 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-ink);
  overflow: hidden;
}

.ds-blank__mark .sm {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

/* ── Starters ─────────────────────────────────────────────────────────────— */
.ds-starters { grid-area: starters; min-width: 0; }

.ds-starters__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(14px, 2.2vw, 26px);
}

.ds-starter {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-height: 62px;
  padding: 11px 2px;
  border: 0;
  border-top: 1px solid var(--ds-hair);
  border-bottom: 1px solid var(--ds-hair);
  background: transparent;
  color: var(--ds-ink-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.28s var(--se-ease-soft), padding-left 0.35s var(--se-ease);
}

.ds-starter:hover,
.ds-starter:focus-visible {
  color: var(--ds-ink);
  padding-left: 6px;
  outline: none;
}

.ds-starter__text { font-size: 14px; line-height: 1.4; }

.ds-starter__note {
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ds-ink-faint);
}

/* ── Recent ──────────────────────────────────────────────────────────────— */
.ds-recent { grid-area: recent; min-width: 0; }
.ds-recent[hidden] { display: none; }
.ds-recent__list { display: flex; flex-direction: column; }

.ds-recent__row {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--ds-hair-soft);
}

.ds-recent__open {
  flex: 1 1 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  padding: 11px 2px;
  border: 0;
  background: transparent;
  color: var(--ds-ink-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.28s var(--se-ease-soft), padding-left 0.3s var(--se-ease);
}

.ds-recent__open:hover { color: var(--ds-ink); padding-left: 6px; }

.ds-recent__q {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-recent__meta {
  flex: 0 0 auto;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-ink-faint);
}

.ds-recent__del {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ds-ink-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s var(--se-ease-soft), color 0.25s var(--se-ease-soft);
}

.ds-recent__del svg { width: 14px; height: 14px; }
.ds-recent__row:hover .ds-recent__del,
.ds-recent__del:focus-visible { opacity: 1; }
.ds-recent__del:hover { color: var(--ds-ink); }

/* ══ Making — the request, a frame taking shape, one real beat ═════════════ */
.ds-making {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2vh, 22px);
  min-height: 0;
  padding: clamp(8px, 2vh, 20px) 0;
  text-align: center;
}

.ds[data-state="making"] .ds-making { display: flex; }

.ds-making__quote {
  max-width: 46ch;
  margin: 0;
  font-family: var(--ds-serif);
  font-size: clamp(15px, 1.8vw, 18px);
  font-style: italic;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ds-ink-soft);
  text-wrap: balance;
}

.ds-blank--making {
  flex: 0 1 auto;
  width: min(420px, 62%);
  min-height: 0;
  max-height: 46vh;
  background: rgba(255, 255, 255, 0.55);
}

.ds[data-device="TABLET"] .ds-blank--making { width: min(280px, 46%); }
.ds[data-device="MOBILE"] .ds-blank--making { width: min(190px, 34%); }
.ds[data-device="AGNOSTIC"] .ds-blank--making { width: min(380px, 56%); }

.ds-blank__block {
  position: absolute;
  background: rgba(42, 29, 22, 0.07);
  animation: ds-block 2.9s var(--se-ease-soft, ease) infinite;
}

.ds-blank__block--a { top: 22%; left: 11%; width: 44%; height: 8%; animation-delay: 0s; }
.ds-blank__block--b { top: 38%; left: 11%; width: 70%; height: 27%; animation-delay: 0.45s; }
.ds-blank__block--c { top: 72%; left: 11%; width: 27%; height: 10%; animation-delay: 0.9s; }

@keyframes ds-block {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.75; }
}

.ds-beat {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
}

.ds-beat__dot {
  align-self: center;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--se-accent, #fc9b4c);
  animation: ds-breathe 2.4s ease-in-out infinite;
}

@keyframes ds-breathe {
  0%, 100% { opacity: 0.34; transform: scale(0.84); }
  50% { opacity: 1; transform: scale(1); }
}

.ds-beat__text {
  font-family: var(--ds-serif);
  font-size: 15px;
  letter-spacing: -0.012em;
  color: var(--ds-ink);
}

.ds-beat__time {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--ds-ink-faint);
  min-width: 4ch;
  text-align: left;
}

.ds-making__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ds-making__hint {
  margin: 0;
  max-width: 40ch;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ds-ink-faint);
}

/* ══ Screen — the hero ═════════════════════════════════════════════════════ */
.ds-screen {
  display: none;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}

.ds[data-state="screen"] .ds-screen { display: flex; }

/* Two honest banners above the work. Neither ever hides the screen. */
.ds-viewing,
.ds-reframe {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 12px;
  border: 1px solid var(--ds-hair);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ds-ink-soft);
}

.ds-viewing[hidden],
.ds-reframe[hidden] { display: none; }

.ds-viewing__text,
.ds-reframe__text { flex: 1 1 200px; min-width: 0; }

.ds-viewing__back,
.ds-reframe__go,
.ds-reframe__off {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--ds-hair);
  border-radius: 999px;
  background: #fff;
  color: var(--ds-ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.25s var(--se-ease-soft), background 0.25s var(--se-ease-soft);
}

.ds-viewing__back svg { width: 13px; height: 13px; }
.ds-viewing__back:hover,
.ds-reframe__go:hover { border-color: rgba(42, 29, 22, 0.3); }

.ds-reframe__off {
  border-color: transparent;
  background: transparent;
  color: var(--ds-ink-mute);
}
.ds-reframe__off:hover { color: var(--ds-ink); }

/* ── The shot ─────────────────────────────────────────────────────────────—
   A recessed field, and the screen lifted off it. The FRAME follows the
   artifact's own proportions: assuming a device geometry would letterbox a
   square screenshot inside a widescreen lie. */
.ds-shot {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(10px, 2vh, 22px) clamp(10px, 2vw, 26px);
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.5), transparent 70%),
    var(--ds-field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.ds-shot__frame {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  aspect-ratio: var(--ds-shot-ratio, 16 / 10);
  width: min(var(--ds-shot-w, 100%), 100%);
  border: 1px solid rgba(42, 29, 22, 0.16);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(42, 29, 22, 0.06),
    0 26px 60px -34px rgba(42, 29, 22, 0.5);
  animation: ds-lift 0.6s var(--se-ease) both;
}

@keyframes ds-lift {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.ds[data-made-for="MOBILE"] .ds-shot__frame { border-radius: 18px; }

/* A whisper of device: a browser lip on the wide frames, nothing on a phone. */
.ds-shot__chrome {
  flex: 0 0 auto;
  height: 22px;
  border-bottom: 1px solid var(--ds-hair-soft);
  background: linear-gradient(180deg, #fbf8f3, #f4efe7);
  background-image:
    radial-gradient(circle at 13px 11px, rgba(42, 29, 22, 0.16) 2.5px, transparent 3px),
    radial-gradient(circle at 25px 11px, rgba(42, 29, 22, 0.13) 2.5px, transparent 3px),
    radial-gradient(circle at 37px 11px, rgba(42, 29, 22, 0.1) 2.5px, transparent 3px),
    linear-gradient(180deg, #fbf8f3, #f4efe7);
}

.ds[data-made-for="MOBILE"] .ds-shot__chrome,
.ds[data-canvas="code"] .ds-shot__chrome { display: none; }

/* Live can reflow the same document through a selected viewport without
   pretending the stored screenshot was regenerated for that device. */
.ds[data-canvas="sandbox"] .ds-shot__chrome { display: block; }
.ds[data-canvas="sandbox"][data-device="MOBILE"] .ds-shot__chrome { display: none; }

.ds-shot__body {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.ds[data-zoom="actual"] .ds-shot__body { overflow: auto; }

.ds-shot__img,
.ds-shot__sandbox,
.ds-shot__code { display: none; }

.ds[data-canvas="preview"] .ds-shot__img { display: block; }
.ds[data-canvas="sandbox"] .ds-shot__sandbox { display: block; }
.ds[data-canvas="code"] .ds-shot__code { display: block; }

.ds-shot__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: #f7f3eb;
}

.ds[data-zoom="actual"] .ds-shot__img {
  height: auto;
  max-width: none;
  object-fit: none;
}

.ds-shot__sandbox {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 100%;
  max-width: none;
  transform-origin: top left;
  border: 0;
  background: #fff;
}

.ds-shot__code {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  background: #fbf8f3;
  color: var(--ds-ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.ds-stamp {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--ds-ok) 38%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ds-ok);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ds-stamp[hidden] { display: none; }
.ds[data-canvas="code"] .ds-stamp { display: none; }

/* ── Shot bar — what you are looking at, and how ───────────────────────────*/
.ds-shotbar {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 0 2px;
}

.ds-shotbar__label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ds-ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-canvasmodes {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--ds-hair);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.ds-canvasmode {
  min-height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ds-ink-mute);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: color 0.28s var(--se-ease-soft), background 0.28s var(--se-ease-soft);
}

.ds-canvasmode:hover { color: var(--ds-ink-soft); }
.ds-canvasmode.is-on { color: var(--ds-ink); background: #fff; }

.ds-zoom {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--ds-hair);
  border-radius: 999px;
  background: transparent;
  color: var(--ds-ink-mute);
  font: inherit;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.28s var(--se-ease-soft), border-color 0.28s var(--se-ease-soft);
}

.ds-zoom svg { width: 13px; height: 13px; }
.ds-zoom[hidden] { display: none; }
.ds-zoom:hover { color: var(--ds-ink); border-color: rgba(42, 29, 22, 0.26); }

/* ── Inline failure — beside the screen, never instead of it ──────────────—*/
.ds-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--ds-work) 30%, var(--ds-hair));
  border-left-width: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ds-ink-soft);
}

.ds-inline[hidden] { display: none; }
.ds-inline__text { flex: 1 1 200px; margin: 0; min-width: 0; }

.ds-inline__retry {
  min-height: 27px;
  padding: 0 11px;
  border: 1px solid var(--ds-hair);
  border-radius: 999px;
  background: #fff;
  color: var(--ds-ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ds-inline__retry:hover { border-color: rgba(42, 29, 22, 0.3); }

/* ══ Panel — creation support. Ink on paper, never a second card. ══════════ */
.ds-panel {
  grid-column: 2;
  display: none;
  min-height: 0;
  min-width: 0;
  padding-left: var(--ds-gutter);
  border-left: 1px solid var(--ds-hair);
  overflow: hidden;
}

.ds[data-state="screen"] .ds-panel { display: block; }

.ds-panel__scroll {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.2vh, 24px);
  height: 100%;
  padding: 2px 2px 18px 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 29, 22, 0.18) transparent;
}

/* ── Versions ────────────────────────────────────────────────────────────— */
.ds-versions__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-version {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px;
  margin: 0 -7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.24s var(--se-ease-soft);
}

.ds-version:hover { background: rgba(42, 29, 22, 0.04); }
.ds-version.is-shown { background: rgba(42, 29, 22, 0.06); }
.ds-version.is-lost { cursor: default; opacity: 0.72; }
.ds-version.is-lost:hover { background: transparent; }

.ds-version__thumb {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 34px;
  border: 1px solid var(--ds-hair);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.ds-version__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.ds-version__num {
  font-family: var(--ds-serif);
  font-size: 13px;
  color: var(--ds-ink-faint);
}

.ds-version__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ds-version__head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.ds-version__n { font-size: 13px; color: var(--ds-ink); }

.ds-version__tag {
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--se-accent, #fc9b4c);
}

.ds-version__sub {
  font-size: 11px;
  color: var(--ds-ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-versions__note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ds-ink-faint);
}

/* ── Decide ──────────────────────────────────────────────────────────────— */
.ds-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ds-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 33px;
  padding: 0 13px;
  border: 1px solid var(--ds-hair);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ds-ink);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition:
    background 0.26s var(--se-ease-soft),
    border-color 0.26s var(--se-ease-soft),
    color 0.26s var(--se-ease-soft);
}

.ds-action svg { width: 14px; height: 14px; flex: 0 0 auto; }
.ds-action:hover { background: #fff; border-color: rgba(42, 29, 22, 0.28); }
.ds-action:disabled { opacity: 0.42; cursor: not-allowed; }
.ds-action:disabled:hover { background: rgba(255, 255, 255, 0.6); border-color: var(--ds-hair); }
.ds-action.is-done { border-color: var(--ds-ok); color: var(--ds-ok); }

.ds-action--primary {
  background: var(--ds-ink);
  border-color: var(--ds-ink);
  color: #fbf7ef;
}

.ds-action--primary:hover { background: #3a2a22; border-color: #3a2a22; color: #fbf7ef; }
.ds-action--primary:disabled:hover { background: var(--ds-ink); border-color: var(--ds-ink); }
.ds-action--ghost { background: transparent; }

.ds-approved {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  color: var(--ds-ok);
}

.ds-approved svg { width: 15px; height: 15px; }

.ds-decide__note {
  margin: 9px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ds-ink-faint);
}

.ds-decide__note:empty { display: none; }

/* ── Export (extensible targets beside Approve) ─────────────────────────── */
.ds-export {
  position: relative;
  display: inline-flex;
}

.ds-export__btn svg:last-child {
  width: 12px;
  height: 12px;
  opacity: 0.72;
}

.ds-export.is-open .ds-export__btn {
  background: #fff;
  border-color: rgba(42, 29, 22, 0.28);
}

.ds-export__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 8;
  min-width: 168px;
  padding: 4px;
  border: 1px solid var(--ds-hair);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.98);
  box-shadow: 0 10px 28px rgba(42, 29, 22, 0.12);
}

.ds-export__item {
  display: block;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ds-ink);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s var(--se-ease-soft);
}

.ds-export__item:hover {
  background: rgba(42, 29, 22, 0.06);
}

/* ── Ask for a change ────────────────────────────────────────────────────— */
.ds-adjust__list { display: flex; flex-direction: column; }

.ds-adjust__opt {
  width: 100%;
  padding: 9px 2px;
  border: 0;
  border-top: 1px solid var(--ds-hair-soft);
  background: transparent;
  color: var(--ds-ink-soft);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: color 0.26s var(--se-ease-soft), padding-left 0.3s var(--se-ease);
}

.ds-adjust__opt:hover { color: var(--ds-ink); padding-left: 5px; }
.ds-adjust__list .ds-adjust__opt:last-child { border-bottom: 1px solid var(--ds-hair-soft); }

/* ── Review ──────────────────────────────────────────────────────────────— */
.ds-review__head {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ds-ink);
}

.ds-review__head.is-work { color: var(--ds-work); }

.ds-review__list { margin: 0; padding: 0; list-style: none; }

.ds-review__item {
  display: flex;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--ds-hair-soft);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ds-ink-mute);
}

.ds-review__area {
  flex: 0 0 auto;
  min-width: 7ch;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-top: 1px;
}

.ds-review__item.is-good .ds-review__area { color: var(--ds-ok); }
.ds-review__item.is-work .ds-review__area { color: var(--ds-work); }
.ds-review__detail { min-width: 0; }

/* ── Folds ───────────────────────────────────────────────────────────────— */
.ds-fold {
  border-top: 1px solid var(--ds-hair);
  padding-top: 12px;
}

.ds-fold[hidden] { display: none; }

.ds-fold__summary {
  display: flex;
  align-items: center;
  gap: 7px;
  list-style: none;
  cursor: pointer;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ds-ink-mute);
  transition: color 0.24s var(--se-ease-soft);
}

.ds-fold__summary:hover { color: var(--ds-ink); }
.ds-fold__summary::-webkit-details-marker { display: none; }
.ds-fold__summary svg { width: 13px; height: 13px; }

.ds-fold__body { margin-top: 11px; }

.ds-fold__note {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ds-ink-faint);
}

.ds-fold__row { display: flex; flex-wrap: wrap; gap: 7px; }

.ds-receipt .sr-receipt { border-color: var(--ds-hair); }

/* ══ Note — the whole-room honest state, only with no screen to protect ════ */
.ds-note {
  display: none;
  max-width: 30rem;
  margin: auto;
  padding: clamp(12px, 2vh, 24px) 4px;
}

.ds[data-state="note"] .ds-note { display: block; }

.ds-note__text {
  margin: 0 0 16px;
  font-family: var(--ds-serif);
  font-size: clamp(17px, 2.1vw, 21px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ds-ink);
}

.ds-note__retry {
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid var(--ds-hair);
  border-radius: 999px;
  background: transparent;
  color: var(--ds-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.26s var(--se-ease-soft), border-color 0.26s var(--se-ease-soft);
}

.ds-note__retry:hover { background: #fff; border-color: rgba(42, 29, 22, 0.28); }
.ds[data-state="note"] .ds-rail { display: none; }

/* ══ Responsive ════════════════════════════════════════════════════════════ */
@media (max-width: 1000px) {
  .ds { --ds-panel-w: clamp(210px, 26vw, 250px); }
}

@media (max-width: 860px) {
  .ds,
  .ds[data-state="screen"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  /* Three explicit rows keep the result shelf out of the preview's hit area.
     The room itself scrolls while the shared composer remains anchored below
     it, so neither a long proof panel nor a short viewport can create two
     competing scroll owners. */
  .ds[data-state="screen"] {
    grid-template-rows: auto minmax(300px, 46vh) auto;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 29, 22, 0.18) transparent;
  }

  .ds[data-state="screen"] .ds-panel {
    grid-column: 1;
    grid-row: 3;
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid var(--ds-hair);
    max-height: none;
    overflow: visible;
  }

  .ds[data-state="screen"] .ds-stage {
    grid-row: 2;
    min-height: 300px;
  }

  .ds[data-state="screen"] .ds-panel__scroll {
    height: auto;
    overflow: visible;
  }

  .ds-ready {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "lead" "starters" "recent";
  }

  .ds-ready__frame { display: none; }
  .ds-starters__list { grid-template-columns: minmax(0, 1fr); }
  .ds-starter { min-height: 52px; }
}

@media (max-width: 560px) {
  .ds-rail { flex-wrap: wrap; }
  .ds-rail__intent { order: 3; flex-basis: 100%; white-space: normal; }
  .ds-devices { margin-left: auto; }
  .ds-device { padding: 0 9px; font-size: 11px; }
  .ds-shot { padding: 8px; }
  .ds-shotbar { gap: 6px 10px; }
  .ds-shotbar__label { flex-basis: 100%; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .ds-blank,
  .ds-blank__block,
  .ds-beat__dot,
  .ds-shot__frame,
  .ds-starter,
  .ds-recent__open,
  .ds-adjust__opt,
  .ds-action,
  .ds-device,
  .ds-canvasmode { animation: none; transition: none; }
  .ds-blank__block { opacity: 0.5; }
  .ds-shot__frame { opacity: 1; transform: none; }
  .ds-starter:hover,
  .ds-recent__open:hover,
  .ds-adjust__opt:hover { padding-left: 2px; }
}

/* ══ Unified outcome — FULL PAGE Figma 668:7456 / 680:3486 ═════════════════ */
.ds[data-outcome="1"] {
  --ds-outcome-panel: 389px;
  --ds-outcome-gap: 16px;
  /* Figma content row sits ~27px above the fold; keep within 24–32px. */
  --ds-outcome-inset: 28px;
  display: grid;
  grid-template-columns: var(--ds-outcome-panel) minmax(0, 1fr);
  /* Explicit bottom track — survives overflow clipping better than padding. */
  grid-template-rows: 56px minmax(0, 1fr) var(--ds-outcome-inset);
  gap: 0;
  column-gap: var(--ds-outcome-gap);
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 var(--ds-outcome-inset) 0;
  box-sizing: border-box !important;
  overflow: hidden;
  background: #fbf7ef;
}

.ds[data-outcome="1"] .ds-rail { display: none; }
.ds[data-outcome="1"] .ds-shotbar { display: none; }
.ds[data-outcome="1"] .ds-viewing { display: none; }
.ds[data-outcome="1"] .ds-reframe { display: none; }

.ds-outcome-masthead {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 10px;
  background: #fbf7ef;
  min-width: 0;
}
.ds-outcome-masthead[hidden] { display: none !important; }

.ds-outcome-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  flex: none;
}
.ds-outcome-back:hover { background: #fff; }
.ds-outcome-back:focus-visible {
  outline: 2px solid #272720;
  outline-offset: 2px;
}

.ds-outcome-title {
  margin: 0;
  font-family: "Readex Pro", var(--font-sans, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 400;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ds-outcome-toolbar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 56px;
  padding: 10px;
  border-bottom: 0.845px solid rgba(189, 196, 198, 0.5);
  background: rgba(251, 247, 239, 0.92);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  position: relative;
  z-index: 4;
  overflow: visible;
  flex-wrap: nowrap;
}
.ds-outcome-toolbar[hidden] { display: none !important; }

.ds-outcome-toolbar__left,
.ds-outcome-toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: static;
  flex: 0 0 auto;
}
.ds-outcome-toolbar__right {
  margin-left: auto;
}

.ds-outcome-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  z-index: 5;
}

.ds-view-switch {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 4px;
  border: 1px solid #d9d1cb;
  border-radius: 8px;
  background: #fff;
}

.ds-view-switch__btn {
  height: 22px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #19213d;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
}

.ds-view-switch__btn.is-on {
  background: #272720;
  color: #fbf7ef;
}

.ds-outcome-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  min-height: 30px;
  padding: 0 8px 0 4px;
  border: 1px solid #d9d1cb;
  border-radius: 4px;
  background: #fff;
  color: #19213d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
}

.ds-outcome-select__label { white-space: nowrap; }
.ds-outcome__icon { display: block; width: 15px; height: 15px; flex: none; }

.ds-outcome-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 140px;
  padding: 4px;
  border: 1px solid #d9d1cb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.ds-outcome-menu.is-fixed {
  position: fixed;
  top: auto;
  left: auto;
  z-index: 80;
}

.ds-outcome-menu__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #19213d;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.ds-outcome-menu__item.is-on,
.ds-outcome-menu__item:hover { background: rgba(39, 39, 32, 0.06); }

.ds-outcome-export {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ds-outcome-export .ds-export__btn {
  height: 30px;
  min-height: 30px;
  padding: 0 8px 0 4px;
  border: 1px solid #d9d1cb;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  box-sizing: border-box;
}

.ds-outcome-share,
.ds-outcome-publish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 54px;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d9d1cb;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  flex: none;
  box-sizing: border-box;
}
.ds-outcome-share {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(13.5px);
  -webkit-backdrop-filter: blur(13.5px);
  color: #19213d;
}
.ds-outcome-share .ds-outcome__icon {
  width: 15px;
  height: 15px;
}
.ds-outcome-share span {
  padding: 0;
}
.ds-outcome-share:hover { background: rgba(255, 255, 255, 0.92); }
.ds-outcome-share.is-done { background: #fff; }
.ds-outcome-publish {
  background: #272720;
  color: #fbf7ef;
}
.ds-outcome-publish:hover { background: #1c1c17; }
.ds-outcome-publish.is-done { background: #3a3a32; }
.ds-outcome-share:disabled,
.ds-outcome-publish:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ds-outcome-info {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.ds-outcome-info-drawer {
  position: absolute;
  top: calc(100% + 8px);
  right: 10px;
  z-index: 9;
  width: min(320px, 70vw);
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #d9d1cb;
  border-radius: 12px;
  background: #fbf7ef;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.ds[data-outcome="1"] .ds-panel {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  height: auto;
  align-self: stretch;
  min-height: 0;
  margin: 0;
  padding: 16px 18px 160px;
  border: 1px solid #d9d1cb;
  border-radius: 12px;
  background: #fbf7ef;
  overflow: hidden;
  box-sizing: border-box;
}

.ds-panel__chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 4px;
}

.ds-chat__user {
  align-self: flex-end;
  max-width: 92%;
  padding: 8px;
  border: 1px solid #d9d1cb;
  border-radius: 12px;
  background: rgba(245, 241, 238, 0.95);
  backdrop-filter: blur(42px);
}

.ds-chat__user-text {
  margin: 0;
  color: #4a4242;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  white-space: pre-wrap;
}

.ds-chat__argus { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.ds-chat__argus-head { display: flex; align-items: center; gap: 4px; }
.ds-chat__orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb070, #fc9b4c 55%, #c45a20);
  box-shadow: 0 0 18px rgba(252, 155, 76, 0.45);
  flex: none;
}
.ds-chat__argus-label {
  color: #9f9792;
  font-size: 11.8px;
  letter-spacing: 0.12px;
}
.ds-chat__argus-body,
.ds-chat__summary {
  margin: 0;
  color: #000;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.13px;
  white-space: pre-wrap;
}
.ds-chat__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9f9792;
  font-size: 11.8px;
}

.ds[data-outcome="1"] .ds-stage {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: stretch;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  box-sizing: border-box;
}

.ds[data-outcome="1"] .ds-screen {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ds[data-outcome="1"] .ds-inline:not([hidden]) {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  margin: 0;
}

.ds[data-outcome="1"] .ds-shot {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  background: transparent;
  box-shadow: none;
  border-radius: 12px;
}

.ds[data-outcome="1"] .ds-shot__frame {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 0 !important;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: auto !important;
}

.ds[data-outcome="1"] .ds-shot__body {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.ds[data-outcome="1"] .ds-shot__chrome {
  display: none !important;
}

.ds[data-outcome="1"] .ds-shot__sandbox,
.ds[data-outcome="1"] .ds-shot__img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  transform: none !important;
  object-fit: cover;
  object-position: top center;
}

.ds[data-outcome="1"] .ds-shot__img {
  object-fit: contain;
  background: #fff;
}

.ds[data-outcome="1"][data-view="preview"] .ds-shot__sandbox { display: block; }
.ds[data-outcome="1"][data-view="preview"][data-canvas="preview"] .ds-shot__img { display: block; }
.ds[data-outcome="1"][data-view="preview"][data-canvas="preview"] .ds-shot__sandbox { display: none; }
.ds[data-outcome="1"][data-view="code"] .ds-shot__frame { display: none; }
.ds[data-outcome="1"][data-view="code"] .ds-code { display: flex; }

.ds-code {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  border: 1px solid #d9d1cb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.ds-code__files {
  width: 220px;
  flex: 0 0 220px;
  border-right: 1px solid #e7e0d8;
  padding: 12px;
  overflow: auto;
  background: #fbf7ef;
}

.ds-code__search {
  width: 100%;
  height: 32px;
  margin-bottom: 10px;
  padding: 0 10px;
  border: 1px solid #d9d1cb;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.ds-code__file {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #19213d;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.ds-code__file.is-on,
.ds-code__file:hover { background: rgba(39, 39, 32, 0.08); }

.ds-code__editor {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ds-code__head {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 1px solid #e7e0d8;
  font-size: 12px;
  font-weight: 500;
  color: #19213d;
}

.ds-code__body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.ds-code__lines {
  padding: 12px 8px 12px 12px;
  color: #9f9792;
  text-align: right;
  user-select: none;
  background: #faf7f2;
}

.ds-code__line { display: block; }
.ds-code__source {
  margin: 0;
  padding: 12px 14px;
  white-space: pre;
  overflow: visible;
  color: #1b1818;
}

.ds-tok-tag { color: #0b6e4f; }
.ds-tok-str { color: #9a6634; }
.ds-tok-kw { color: #3d5a74; font-weight: 600; }

@media (max-width: 1100px) {
  .ds[data-outcome="1"] {
    --ds-outcome-panel: min(340px, 36vw);
  }
  .ds-code__files { width: 180px; flex-basis: 180px; }
}

@media (max-width: 860px) {
  .ds[data-outcome="1"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(280px, 1fr) var(--ds-outcome-inset);
    overflow: auto;
    column-gap: 0;
  }
  .ds[data-outcome="1"] .ds-outcome-masthead,
  .ds[data-outcome="1"] .ds-outcome-toolbar,
  .ds[data-outcome="1"] .ds-panel,
  .ds[data-outcome="1"] .ds-stage {
    grid-column: 1;
  }
  .ds[data-outcome="1"] .ds-outcome-masthead { grid-row: 1; }
  .ds[data-outcome="1"] .ds-outcome-toolbar { grid-row: 1; }
  .ds[data-outcome="1"] .ds-panel {
    grid-row: 2;
    width: 100%;
    max-height: 36vh;
    padding-bottom: 16px;
  }
  .ds[data-outcome="1"] .ds-stage { grid-row: 3; }
}
