/* ============================================================================
   Warm Studio · Warm Linen Daylight
   ============================================================================

   Staged verbatim to /assets/warm_studio.css and loaded only by the dedicated
   Warm Studio document roots. Every rule is scoped to the body marker
   `.restory-ds[data-warm-studio]`, so legacy controller pages and the Home
   workbench keep their own stylesheets. The vendored faces live in
   priv/static/fonts/home_workbench/ and are served same-origin; the strict
   browser CSP never needs a CDN, inline style or external import.
   ========================================================================== */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/home_workbench/figtree.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Gabarito";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/home_workbench/gabarito.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/home_workbench/jetbrains-mono.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

.restory-ds[data-warm-studio] {
  --ds-rail: #efece4;
  --ds-canvas: #f4f1ea;
  --ds-chrome: #f7f4ee;
  --ds-chrome-hi: #efece4;
  --ds-panel: #fcfbf8;
  --ds-panel-2: #ffffff;
  --ds-terminal: #1c1e1c;
  --ds-terminal-ink: #efece4;

  --ds-display: "Gabarito", "Figtree", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --ds-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --ds-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas,
    monospace;

  --ds-line: rgba(26, 32, 38, 0.08);
  --ds-line-2: rgba(26, 32, 38, 0.13);
  --ds-panel-border: #dfd9ce;
  --ds-input-border: #8a8275;
  --ds-btn-border: #cfc7ba;
  --ds-control-border-hover: #b6ae9f;
  --ds-btn-hover: #eae5db;

  --ds-ink: #1a2026;
  --ds-ink-2: #283038;
  --ds-muted: #464f59;
  --ds-faint: #565f69;

  --ds-accent: #196456;
  --ds-accent-hover: #134e43;
  --ds-accent-fill: #196456;
  --ds-accent-fill-hover: #134e43;
  --ds-accent-ink: #ffffff;
  --ds-selection-bg: #e5f2ee;
  --ds-selection-border: #8cc5b7;

  --ds-waypoint: #c45b2c;
  --ds-waypoint-bg: #fbece4;
  --ds-waypoint-fg: #a5481f;
  --ds-waypoint-border: #e5b7a1;

  /* List chrome: one shared decision frame colour and the CSS-only mineral
     wells later list cards use for artifact previews. */
  --ds-list-decision-border: rgba(196, 91, 44, 0.42);
  --ds-artifact-sky: #e4effa;
  --ds-artifact-sage: #e3efe8;
  --ds-artifact-sand: #f2e9d8;
  --ds-artifact-lilac: #ece8f6;

  --ds-status-info-bg: #e7f0fb;
  --ds-status-info-fg: #1f5386;
  --ds-status-info-border: #b9d3ed;
  --ds-status-success-bg: #e5f3e8;
  --ds-status-success-fg: #1b6334;
  --ds-status-success-border: #b8ddc3;
  --ds-status-warn-bg: #f9e8c4;
  --ds-status-warn-fg: #663c06;
  --ds-status-warn-border: #e3c383;
  --ds-status-error-bg: #fbe9e7;
  --ds-status-error-fg: #8f2c20;
  --ds-status-error-border: #e8bbb3;
  --ds-status-neutral-bg: #f0ece4;
  --ds-status-neutral-fg: #464f59;
  --ds-status-neutral-border: #d8d1c5;

  --ds-radius-badge: 5px;
  --ds-radius-control: 8px;
  --ds-radius-panel: 12px;
  --ds-radius-pill: 999px;

  --ds-shadow-xs: 0 1px 2px rgba(26, 32, 38, 0.04);
  --ds-shadow-card: 0 1px 3px rgba(26, 32, 38, 0.05),
    0 8px 20px -12px rgba(26, 32, 38, 0.09);
  --ds-shadow-lg: 0 20px 44px -20px rgba(26, 32, 38, 0.22),
    0 2px 6px rgba(26, 32, 38, 0.06);
}

.restory-ds[data-warm-studio],
.restory-ds[data-warm-studio] *,
.restory-ds[data-warm-studio] *::before,
.restory-ds[data-warm-studio] *::after {
  box-sizing: border-box;
}

body.restory-ds[data-warm-studio] {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--ds-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ds-ink-2);
  background: var(--ds-canvas);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

.restory-ds[data-warm-studio] h1,
.restory-ds[data-warm-studio] h2,
.restory-ds[data-warm-studio] h3,
.restory-ds[data-warm-studio] h4,
.restory-ds[data-warm-studio] h5,
.restory-ds[data-warm-studio] h6,
.restory-ds[data-warm-studio] p,
.restory-ds[data-warm-studio] ul,
.restory-ds[data-warm-studio] ol,
.restory-ds[data-warm-studio] dl,
.restory-ds[data-warm-studio] figure {
  margin: 0;
}

.restory-ds[data-warm-studio] h1,
.restory-ds[data-warm-studio] h2,
.restory-ds[data-warm-studio] h3,
.restory-ds[data-warm-studio] h4,
.restory-ds[data-warm-studio] h5,
.restory-ds[data-warm-studio] h6 {
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.restory-ds[data-warm-studio] h1 {
  font-size: 30px;
}

.restory-ds[data-warm-studio] h2 {
  font-size: 22px;
}

.restory-ds[data-warm-studio] h3 {
  font-size: 18px;
}

.restory-ds[data-warm-studio] h4 {
  font-size: 16px;
}

.restory-ds[data-warm-studio] ul,
.restory-ds[data-warm-studio] ol {
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] button,
.restory-ds[data-warm-studio] input,
.restory-ds[data-warm-studio] textarea,
.restory-ds[data-warm-studio] select {
  font: inherit;
  color: inherit;
}

.restory-ds[data-warm-studio] button {
  cursor: pointer;
}

.restory-ds[data-warm-studio] a {
  color: var(--ds-accent);
  text-decoration: none;
}

.restory-ds[data-warm-studio] a:hover {
  text-decoration: underline;
}

.restory-ds[data-warm-studio] :focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

.restory-ds[data-warm-studio] [hidden] {
  display: none !important;
}

.restory-ds[data-warm-studio] .ds-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.restory-ds[data-warm-studio] .ds-tabular {
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .ds-mono,
.restory-ds[data-warm-studio] code,
.restory-ds[data-warm-studio] pre,
.restory-ds[data-warm-studio] kbd {
  font-family: var(--ds-mono);
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] code {
  font-size: 13.5px;
  line-height: 1.62;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-hint {
  color: var(--ds-ink-2);
  font-size: 12.5px;
}

/* ============================================================================
   Frame, rail and gate
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .ds-app--fallback {
  grid-template-columns: minmax(0, 1fr);
}

.restory-ds[data-warm-studio] .ds-main {
  min-width: 0;
  min-height: 100dvh;
  padding: 40px 48px 64px;
  overflow-y: auto;
}

.restory-ds[data-warm-studio] .pg-rail {
  display: flex;
  flex-direction: column;
  width: 248px;
  max-width: 248px;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: 20px 16px 16px;
  background: var(--ds-rail);
  border-right: 1px solid var(--ds-panel-border);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-rail__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 0 4px 18px;
}

.restory-ds[data-warm-studio] .ds-rail__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ds-accent);
  color: var(--ds-accent-ink);
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-rail__brand-name {
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .ds-rail__scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 2px 12px;
}

.restory-ds[data-warm-studio] .ds-rail__nav {
  display: grid;
  gap: 4px;
}

.restory-ds[data-warm-studio] .ds-rail__section {
  display: grid;
  gap: 4px;
  padding-top: 18px;
}

.restory-ds[data-warm-studio] .ds-rail__label {
  padding: 0 8px 6px;
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-control);
  color: var(--ds-ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-nav-link:hover {
  background: var(--ds-chrome);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-nav-link[aria-current="page"] {
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-nav-link[aria-disabled="true"],
.restory-ds[data-warm-studio] .ds-nav-link--unavailable {
  color: var(--ds-muted);
  cursor: default;
  opacity: 0.75;
}

.restory-ds[data-warm-studio] .ds-rail__footer {
  flex-shrink: 0;
  padding: 14px 4px 0;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin-bottom: 10px;
}

.restory-ds[data-warm-studio] .ds-identity__name {
  overflow: hidden;
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-identity__meta {
  overflow: hidden;
  color: var(--ds-muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-workspace-switcher {
  margin-bottom: 16px;
}

.restory-ds[data-warm-studio] .ds-disclosure {
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .ds-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.restory-ds[data-warm-studio] .ds-disclosure summary::-webkit-details-marker {
  display: none;
}

.restory-ds[data-warm-studio] .ds-disclosure summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.restory-ds[data-warm-studio] .ds-disclosure[open] summary::after {
  transform: rotate(225deg);
}

.restory-ds[data-warm-studio] .ds-disclosure__body {
  display: grid;
  gap: 4px;
  padding: 4px 6px 8px;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-gate {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .ds-gate__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .ds-gate__body {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  padding: 48px 24px;
}

.restory-ds[data-warm-studio] .ds-gate__card {
  width: min(100%, 560px);
}

/* ============================================================================
   Public sign-in gate

   `gate_frame/1` owns the frame; the `:sign_in` variant only sizes that frame's
   own regions and the sign-in card's head, body and foot bands. The card keeps
   the shared focal-panel surface, so the gate stays one card on a canvas.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__bar {
  min-height: 56px;
  padding: 0 28px;
}

.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__bar .ds-rail__brand {
  padding: 0;
  gap: 9px;
}

/* The designed gate brand is the woven mark itself, not the rail's button well. */
.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-rail__brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: none;
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-rail__brand-name {
  font-size: 18px;
  letter-spacing: -0.025em;
}

/* The designed gate column is top-aligned: the card and its meta line stay
   together instead of centring in the stretched body row. */
.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__body {
  align-content: start;
  row-gap: 18px;
  padding: 60px 20px 48px;
}

.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__card {
  width: min(100%, 480px);
}

.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-panel-focal {
  padding: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__meta {
  width: min(100%, 480px);
}

.restory-ds[data-warm-studio] .ds-gate__header-link {
  display: inline-block;
  padding: 8px 6px;
  border-radius: 6px;
  color: var(--ds-ink-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--ds-btn-border);
  text-underline-offset: 3px;
}

.restory-ds[data-warm-studio] .ds-gate__header-link:hover {
  color: var(--ds-ink);
  text-decoration-color: var(--ds-ink-2);
}

/* The skip link is the document's first focusable element and paints only once
   focused, so the closed composition is unchanged. It precedes the header
   access link exactly as the pinned screen orders it. */
.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__skip {
  position: fixed;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__skip:focus {
  left: 12px;
  color: var(--ds-accent-ink);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-sign-in {
  display: block;
}

.restory-ds[data-warm-studio] .ds-sign-in__head {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ds-sign-in__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.restory-ds[data-warm-studio] .ds-sign-in__title:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

.restory-ds[data-warm-studio] .ds-sign-in__intro {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 15px;
  line-height: 1.55;
}

.restory-ds[data-warm-studio] .ds-sign-in__body {
  display: grid;
  gap: 20px;
  padding: 24px 32px 28px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ds-sign-in__form {
  display: grid;
  gap: 16px;
}

.restory-ds[data-warm-studio] .ds-sign-in__field {
  display: grid;
  gap: 6px;
}

.restory-ds[data-warm-studio] .ds-sign-in__label {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-sign-in__field .ds-input {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 15px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-sign-in__field .ds-input[aria-invalid="true"] {
  border-color: var(--ds-status-error-fg);
  background: #fffdfc;
}

.restory-ds[data-warm-studio] .ds-sign-in__error {
  margin: 0;
  color: var(--ds-status-error-fg);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-sign-in__body .ds-btn {
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-xs);
  font-size: 14.5px;
}

.restory-ds[data-warm-studio] .ds-sign-in__body .ds-btn--primary {
  background: var(--ds-accent-fill);
}

.restory-ds[data-warm-studio] .ds-sign-in__body .ds-btn--primary:hover {
  background: var(--ds-accent-fill-hover);
}

.restory-ds[data-warm-studio] .ds-sign-in__body .ds-btn--full {
  width: 100%;
}

.restory-ds[data-warm-studio] .ds-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ds-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .ds-divider::before,
.restory-ds[data-warm-studio] .ds-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-sign-in__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 32px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .ds-sign-in__link {
  color: var(--ds-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(25, 100, 86, 0.35);
  text-underline-offset: 3px;
}

.restory-ds[data-warm-studio] .ds-sign-in__link:hover {
  color: var(--ds-accent-fill-hover);
  text-decoration-color: var(--ds-accent-fill-hover);
}

.restory-ds[data-warm-studio] .ds-sign-in__meta {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13.5px;
  text-align: center;
}

/* Sign-in state deltas. The sent confirmation and the recovery document are
   request-local states of this one gate: only the bands below change per state,
   and the frame, brand bar, skip link and footers stay shared. */
.restory-ds[data-warm-studio] [data-sign-in-state="sent"] .ds-sign-in__head {
  gap: 10px;
}

.restory-ds[data-warm-studio] [data-sign-in-state="sent"] .ds-sign-in__body {
  gap: 12px;
}

.restory-ds[data-warm-studio] [data-sign-in-state="sent"] .ds-sign-in__head .ds-badge__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: var(--ds-radius-pill);
  background: currentColor;
}

/* The alert-bearing recovery document tightens its top offset and head band,
   and promotes the email submit to the primary action even with the provider
   enabled. Keying on the alert keeps the field-only 422 branch, which shares
   `data-sign-in-state="recovery"` but renders no alert, at the base wrapper
   geometry (spec.md:48). */
.restory-ds[data-warm-studio] .ds-gate__body:has(.ds-sign-in--alert) {
  padding-top: 48px;
}

.restory-ds[data-warm-studio] .ds-gate__body:has(.ds-sign-in--alert) .ds-sign-in__head {
  padding: 26px 32px 20px;
}

/* The invalid-or-expired alert is a sibling above the one focal surface: the
   shared wrapper drops its frame and the sign-in section paints it instead, so
   the alert is never enclosed in the card's painted edge. The sibling gap sits
   on `main`, the alert's actual parent, and the unframed wrapper restores
   `overflow: visible` so the alert's own card shadow paints. */
.restory-ds[data-warm-studio] .ds-gate__card:has(.ds-sign-in--alert),
.restory-ds[data-warm-studio] .ds-gate__card:has(.ds-sign-in--alert) > .ds-panel-focal > main {
  display: grid;
  gap: 16px;
}

.restory-ds[data-warm-studio] .ds-gate__card:has(.ds-sign-in--alert) > .ds-panel-focal {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.restory-ds[data-warm-studio] .ds-sign-in--alert {
  overflow: hidden;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
}

/* The sign-in gate qualifier raises this rule above the shared
   `.restory-ds[data-warm-studio] .ds-notice` defaults, which it also matches;
   equal specificity would let the later shared rule repaint the alert. */
.restory-ds[data-warm-studio] .ds-gate--sign-in .ds-sign-in__alert {
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--ds-radius-panel);
  font-size: 14.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ds-sign-in__alert-icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .ds-sign-in__alert-title {
  margin: 0 0 2px;
  color: var(--ds-status-error-fg);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-sign-in__alert-body {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 14px;
}

@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__bar {
    padding: 0 16px;
  }

  .restory-ds[data-warm-studio] .ds-gate--sign-in .ds-gate__body {
    padding: 28px 16px 32px;
  }

  .restory-ds[data-warm-studio] .ds-sign-in__head {
    padding: 22px 20px 18px;
  }

  /* The alert-bearing recovery document keeps the reviewed mobile offsets;
     the field-only 422 branch keeps the base mobile body and head geometry. */
  .restory-ds[data-warm-studio] .ds-gate__body:has(.ds-sign-in--alert) {
    padding-top: 24px;
  }

  .restory-ds[data-warm-studio] .ds-gate__body:has(.ds-sign-in--alert) .ds-sign-in__head {
    padding: 22px 20px 18px;
  }

  .restory-ds[data-warm-studio] .ds-sign-in__body {
    padding: 20px 20px 22px;
  }

  .restory-ds[data-warm-studio] .ds-sign-in__foot {
    padding: 14px 20px;
  }

  .restory-ds[data-warm-studio] .ds-sign-in__title {
    font-size: 23px;
  }

  .restory-ds[data-warm-studio] .ds-sign-in__field .ds-input {
    font-size: 16px;
  }
}

/* ============================================================================
   Surfaces and controls
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-panel,
.restory-ds[data-warm-studio] .ds-panel-focal,
.restory-ds[data-warm-studio] .ds-terminal {
  border-radius: var(--ds-radius-panel);
  border: 1px solid var(--ds-panel-border);
  padding: 22px;
}

.restory-ds[data-warm-studio] .ds-panel {
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .ds-panel-focal {
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .ds-terminal {
  background: var(--ds-terminal);
  border-color: var(--ds-terminal);
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio] .ds-terminal pre,
.restory-ds[data-warm-studio] .ds-terminal code {
  margin: 0;
  color: var(--ds-terminal-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
  color: var(--ds-ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.restory-ds[data-warm-studio] .ds-btn:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-btn--primary {
  border-color: var(--ds-accent-fill);
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
}

.restory-ds[data-warm-studio] .ds-btn--primary:hover {
  border-color: var(--ds-accent-fill-hover);
  background: var(--ds-accent-fill-hover);
  color: var(--ds-accent-ink);
}

.restory-ds[data-warm-studio] .ds-btn--danger {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ds-btn--danger:hover {
  border-color: var(--ds-status-error-fg);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ds-btn--withheld,
.restory-ds[data-warm-studio] .ds-btn:disabled {
  border-color: var(--ds-panel-border);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-muted);
  cursor: not-allowed;
}

.restory-ds[data-warm-studio] .ds-input,
.restory-ds[data-warm-studio] .ds-select,
.restory-ds[data-warm-studio] input[type="text"],
.restory-ds[data-warm-studio] input[type="email"],
.restory-ds[data-warm-studio] input[type="search"],
.restory-ds[data-warm-studio] input[type="password"],
.restory-ds[data-warm-studio] input[type="number"],
.restory-ds[data-warm-studio] input[type="url"],
.restory-ds[data-warm-studio] textarea,
.restory-ds[data-warm-studio] select {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-input::placeholder,
.restory-ds[data-warm-studio] textarea::placeholder {
  color: var(--ds-muted);
  opacity: 1;
}

/* The reference paints its own chevron instead of the platform arrow. */
.restory-ds[data-warm-studio] .ds-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23555E68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px 15px;
}

.restory-ds[data-warm-studio] .ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-badge);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-badge--success {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .ds-badge--warn {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .ds-badge--info {
  border-color: var(--ds-status-info-border);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .ds-badge--error {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ds-badge--neutral {
  border-color: var(--ds-status-neutral-border);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-status-neutral-fg);
}

.restory-ds[data-warm-studio] .ds-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--ds-radius-badge);
  background: var(--ds-waypoint-fg);
  color: #ffffff;
  font-family: var(--ds-mono);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ds-status-neutral-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-status-neutral-fg);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .ds-notice--info {
  border-color: var(--ds-status-info-border);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .ds-notice--success {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .ds-notice--warn {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .ds-notice--error {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ds-skeleton {
  display: block;
  min-height: 14px;
  border-radius: var(--ds-radius-badge);
  background: var(--ds-status-neutral-bg);
}

@media (prefers-reduced-motion: no-preference) {
  .restory-ds[data-warm-studio] .ds-skeleton {
    animation: ds-skeleton-pulse 1.6s ease-in-out infinite;
  }

  @keyframes ds-skeleton-pulse {
    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0.55;
    }
  }
}

.restory-ds[data-warm-studio] .ds-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 40;
  max-width: min(90vw, 560px);
  padding: 10px 14px;
  border: 1px solid var(--ds-terminal);
  border-radius: var(--ds-radius-control);
  background: var(--ds-terminal);
  color: var(--ds-terminal-ink);
  box-shadow: var(--ds-shadow-lg);
  font-size: 13.5px;
  text-align: center;
  transform: translateX(-50%);
}

.restory-ds[data-warm-studio] .ds-toast:empty {
  display: none;
}

/* ============================================================================
   Workspace Setup Overview
   One delimited, overview-scoped block. It uses the existing Warm Studio
   tokens and primitives; it does not redefine the shell or the shared frame.
   ========================================================================== */

.restory-ds[data-warm-studio] .setup-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: -40px -48px -64px;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .setup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 28px;
  background: var(--ds-panel);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .setup-head__main {
  min-width: 0;
}

.restory-ds[data-warm-studio] .setup-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .setup-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.restory-ds[data-warm-studio] .setup-subtitle {
  max-width: 72ch;
  margin: 2px 0 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .setup-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}

.restory-ds[data-warm-studio] .setup-membership-note {
  max-width: 210px;
  color: var(--ds-muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .setup-body {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 1120px;
  padding: 10px 28px 12px;
}

.restory-ds[data-warm-studio] .setup-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.restory-ds[data-warm-studio] .setup-fact {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 14px;
  background: var(--ds-panel);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
}

.restory-ds[data-warm-studio] .setup-fact__label {
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .setup-fact__value {
  overflow: hidden;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .setup-fact__sub {
  overflow: hidden;
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .setup-checks {
  overflow: hidden;
}

.restory-ds[data-warm-studio] .setup-checks__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .setup-checks__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .setup-check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .setup-check {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 8px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .setup-check:last-child {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .setup-check__num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border: 1px solid rgba(42, 140, 75, 0.3);
  border-radius: 50%;
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .setup-check[data-verified="false"] .setup-check__num {
  border-color: rgba(196, 122, 20, 0.34);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .setup-check__body {
  min-width: 0;
}

.restory-ds[data-warm-studio] .setup-check__title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .setup-check__title {
  margin: 0;
  color: var(--ds-ink);
  font-size: 15px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .setup-check__desc {
  margin: 2px 0 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .setup-check__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  color: var(--ds-ink-2);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .setup-check__meta code {
  padding: 1px 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 4px;
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .setup-check__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.restory-ds[data-warm-studio] .setup-terminal {
  overflow: hidden;
  background: var(--ds-terminal);
  color: var(--ds-terminal-ink);
  border: 1px solid var(--ds-terminal-border);
  border-radius: var(--ds-radius-panel);
}

.restory-ds[data-warm-studio] .setup-terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  background: var(--ds-terminal-bar);
  border-bottom: 1px solid var(--ds-terminal-border);
  color: var(--ds-terminal-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .setup-terminal__bar strong {
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio] .setup-terminal__copy {
  padding: 4px 10px;
  border: 1px solid #4b4f4b;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-terminal-ink);
  font-family: var(--ds-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .setup-terminal__copy:hover {
  background: #303330;
}

.restory-ds[data-warm-studio] .setup-terminal__code {
  margin: 0;
  padding: 8px 14px;
  color: var(--ds-terminal-ink);
  font-family: var(--ds-mono);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.restory-ds[data-warm-studio] .setup-terminal__code code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ds-muted);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .setup-footer code {
  color: var(--ds-ink-2);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .setup-footer__hint {
  flex-shrink: 0;
}

/* ============================================================================
   Home inside the shared frame
   Home keeps its own two-pane workbench, but the rail, top bar and status
   strip belong to Warm Studio. It fills the main column below the top bar
   instead of claiming a viewport of its own, so the one document scrolls
   nowhere and the rail is never duplicated.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app:has(.home-workbench) > .ds-main {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.restory-ds[data-warm-studio] .ds-app:has(.home-workbench) .home-workbench {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

/* The expanded 240px rail leaves the stage narrower than Home's standalone
   frame, so trim the conversation column rather than hiding the stage counts.
   The collapsed rail has the full width and keeps Home's designed split. */
@media (min-width: 1181px) {
  html[data-shell-rail="expanded"]
    .restory-ds[data-warm-studio]
    .ds-app:has(.home-workbench)
    .hw-split {
    grid-template-columns: 380px minmax(0, 1fr);
  }

  html[data-shell-rail="expanded"]
    .restory-ds[data-warm-studio]
    .home-workbench
    .hw-stage-head {
    padding: 0 16px;
    gap: 8px;
  }

  html[data-shell-rail="expanded"]
    .restory-ds[data-warm-studio]
    .home-workbench
    .hw-stage-head-right,
  html[data-shell-rail="expanded"]
    .restory-ds[data-warm-studio]
    .home-workbench
    .hw-quick-nav {
    gap: 8px;
  }
}

/* ============================================================================
   Storage & Mac Mount guide
   One delimited, screen-scoped block. It reuses the Warm Studio tokens,
   buttons, badges and rail. Only this screen scrolls inside the frame.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app:has(.storage-screen) {
  height: 100dvh;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-app:has(.storage-screen) > .ds-main {
  min-height: 0;
  height: 100dvh;
}

.restory-ds[data-warm-studio] .storage-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: -40px -48px -64px;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .storage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 28px;
  background: var(--ds-panel);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .storage-head__main {
  min-width: 0;
}

.restory-ds[data-warm-studio] .storage-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .storage-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.restory-ds[data-warm-studio] .storage-subtitle {
  max-width: 78ch;
  margin: 2px 0 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .storage-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}

.restory-ds[data-warm-studio] .storage-body {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 1120px;
  padding: 10px 28px 20px;
}

.restory-ds[data-warm-studio] .storage-panel {
  overflow: hidden;
  padding: 0;
}

.restory-ds[data-warm-studio] .storage-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .storage-panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .storage-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 50%;
  background: var(--ds-status-neutral-bg);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 13px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .storage-step-pill--active {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .storage-panel-body {
  display: grid;
  gap: 7px;
  padding: 8px 18px 10px;
}

.restory-ds[data-warm-studio] .storage-prereq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 18px 12px;
}

.restory-ds[data-warm-studio] .storage-prereq-item {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .storage-note {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.42;
}

.restory-ds[data-warm-studio] .storage-inline-code {
  padding: 1px 5px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 4px;
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .storage-cmd {
  overflow: hidden;
  border: 1px solid var(--ds-terminal-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-terminal);
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio] .storage-cmd-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--ds-terminal-border);
  background: var(--ds-terminal-bar);
  color: var(--ds-terminal-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .storage-cmd-copy {
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid #4b4f4b;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-terminal-ink);
  font-family: var(--ds-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .storage-cmd-copy:hover {
  background: #303330;
}

.restory-ds[data-warm-studio] .storage-cmd-code {
  margin: 0;
  padding: 8px 12px;
  color: var(--ds-terminal-ink);
  font-family: var(--ds-mono);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.restory-ds[data-warm-studio] .storage-cmd-code code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .storage-cmd-code--annotated {
  display: grid;
  white-space: normal;
}

.restory-ds[data-warm-studio] .storage-cmd-line {
  display: flex;
  flex-wrap: wrap;
  column-gap: 18px;
  align-items: baseline;
}

.restory-ds[data-warm-studio] .storage-cmd-line-code {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .storage-cmd-comment {
  color: inherit;
  opacity: 0.74;
}

.restory-ds[data-warm-studio] .storage-cmd-code--hidden {
  display: none;
}

.restory-ds[data-warm-studio] .storage-path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.restory-ds[data-warm-studio] .storage-path-card {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .storage-path-label {
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .storage-path-value {
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 13px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .storage-path-segment {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.restory-ds[data-warm-studio] .storage-path-meta {
  color: var(--ds-ink-2);
  font-size: 12.5px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .storage-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  align-items: stretch;
}

.restory-ds[data-warm-studio] .storage-command-legend {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 12.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .storage-facts {
  margin: 0;
  padding: 2px 18px 8px;
}

.restory-ds[data-warm-studio] .storage-fact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ds-panel-border);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .storage-fact-row:last-child {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .storage-fact-row dt {
  flex-shrink: 0;
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .storage-fact-row dd {
  min-width: 0;
  margin: 0;
  color: var(--ds-ink);
  text-align: right;
  overflow-wrap: break-word;
}

.restory-ds[data-warm-studio] .storage-fact-row dd code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .storage-fact-meta {
  margin-left: 4px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .storage-facts + .storage-note {
  padding: 0 18px 12px;
}

.restory-ds[data-warm-studio] .storage-head__actions .ds-btn,
.restory-ds[data-warm-studio] .storage-panel-head .ds-btn {
  box-shadow: none;
}

.restory-ds[data-warm-studio] .storage-withheld {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--ds-status-warn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .storage-withheld__title {
  font-weight: 700;
}

.restory-ds[data-warm-studio] .storage-withheld__body {
  margin: 0;
}

.restory-ds[data-warm-studio] .storage-checkpoints {
  margin-bottom: 4px;
}

.restory-ds[data-warm-studio] .storage-stage-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.restory-ds[data-warm-studio] .storage-stage {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) auto minmax(0, 1.3fr);
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ds-panel-border);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .storage-stage:last-child {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .storage-stage-name {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .storage-stage-note {
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .storage-recorded-fact {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
  color: var(--ds-ink-2);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .storage-recorded-label {
  color: var(--ds-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .storage-placeholder .storage-panel-body {
  justify-items: start;
}

.restory-ds[data-warm-studio] .storage-active-head {
  align-items: flex-start;
  padding: 13px 20px;
}

.restory-ds[data-warm-studio] .storage-active-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .storage-active-endpoint {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .storage-active-stages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .storage-active-stage {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 11px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .storage-active-stage:last-child {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .storage-active-stage--active {
  background: color-mix(in srgb, var(--ds-status-info-bg) 35%, var(--ds-panel));
}

.restory-ds[data-warm-studio] .storage-active-stage-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 50%;
  font-family: var(--ds-mono);
  font-size: 12px;
  font-weight: 700;
}

.restory-ds[data-warm-studio] .storage-active-stage-num--done {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .storage-active-stage-num--active {
  border-color: rgba(47, 116, 181, 0.34);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .storage-active-stage-num--queued {
  background: var(--ds-status-neutral-bg);
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .storage-active-stage-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .storage-active-stage-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.restory-ds[data-warm-studio] .storage-active-stage-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .storage-active-stage-desc {
  margin: 3px 0 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .storage-active-stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
}

.restory-ds[data-warm-studio] .storage-meta-chip {
  padding: 1px 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 4px;
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  line-height: 1.4;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .storage-active-stage-trail {
  padding-top: 4px;
  color: var(--ds-muted);
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .storage-active-stage--active .storage-active-stage-trail {
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .storage-recovery .storage-active-stage--failed {
  background: color-mix(in srgb, var(--ds-status-error-bg) 44%, var(--ds-panel));
}

.restory-ds[data-warm-studio] .storage-active-stage-num--failed {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .storage-recovery .storage-active-stage--failed .storage-active-stage-trail {
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .storage-recovery-region {
  display: grid;
  gap: 16px;
}

.restory-ds[data-warm-studio] .storage-recovery-body {
  display: grid;
  gap: 10px;
  padding: 12px 18px 0;
}

.restory-ds[data-warm-studio] .storage-failure-notice {
  padding: 12px 14px;
}

.restory-ds[data-warm-studio] .storage-failure-notice .ds-notice__icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.restory-ds[data-warm-studio] .storage-failure-notice__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .storage-failure-notice__title {
  margin: 0;
  color: var(--ds-status-error-fg);
  font-family: var(--ds-sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .storage-failure-notice__body {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .storage-failure-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px;
}

.restory-ds[data-warm-studio] .storage-failure-refs code {
  color: var(--ds-ink-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .storage-recovery-stages {
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .storage-recovery-note {
  margin: 0 0 10px;
  padding: 0 2px;
}

.restory-ds[data-warm-studio] .storage-recovery-stage {
  padding-block: 8px;
}

.restory-ds[data-warm-studio] .storage-recovery-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 18px;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .storage-failure-audit {
  margin: 0 20px 20px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .storage-failure-audit .storage-panel-head {
  padding: 12px 14px;
}

.restory-ds[data-warm-studio] .storage-failure-audit__body {
  padding: 0 14px 12px;
}

.restory-ds[data-warm-studio] .storage-failure-audit__body .storage-facts {
  margin: 0;
}

@media (max-width: 720px) {
  .restory-ds[data-warm-studio] .storage-recovery-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}


.restory-ds[data-warm-studio] .storage-skeleton .storage-panel-head {
  align-items: flex-start;
  padding: 14px 20px 0;
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .storage-skeleton .storage-panel-head > div {
  display: grid;
  gap: 2px;
}

.restory-ds[data-warm-studio] .storage-skeleton .storage-panel-body {
  gap: 12px;
  padding: 14px 20px;
}

.restory-ds[data-warm-studio] .storage-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.restory-ds[data-warm-studio] .storage-skeleton-well,
.restory-ds[data-warm-studio] .storage-skeleton-command {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .storage-skeleton-command {
  padding: 12px 14px;
}

.restory-ds[data-warm-studio] .storage-skeleton-bar {
  height: 12px;
  border-radius: var(--ds-radius-badge);
  background: linear-gradient(
    90deg,
    var(--ds-chrome) 25%,
    var(--ds-panel-border) 50%,
    var(--ds-chrome) 75%
  );
  background-size: 200% 100%;
  animation: storage-skeleton-shimmer 1.6s ease-in-out infinite;
}

.restory-ds[data-warm-studio] .storage-skeleton-bar--label {
  width: 48%;
  height: 10px;
  opacity: 0.85;
}

.restory-ds[data-warm-studio] .storage-skeleton-bar--value {
  width: 82%;
  height: 16px;
}

.restory-ds[data-warm-studio] .storage-skeleton-bar--command {
  width: 64%;
  height: 16px;
}

.restory-ds[data-warm-studio] .storage-context-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0 2px;
  color: var(--ds-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .storage-context-row code {
  font-size: 11px;
}

@keyframes storage-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .restory-ds[data-warm-studio] .storage-skeleton-bar {
    animation: none;
  }
}

@media (max-width: 1080px) {
  .restory-ds[data-warm-studio] .storage-prereq-grid,
  .restory-ds[data-warm-studio] .storage-path-grid,
  .restory-ds[data-warm-studio] .storage-bottom-grid,
  .restory-ds[data-warm-studio] .storage-skeleton-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .storage-active-stage {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .storage-active-stage-trail {
    grid-column: 2;
    padding-top: 0;
  }
}


/* Workspace creation state. These rules stay scoped to the creation grid so
   the shared shell, Setup Overview and Warm Studio primitives are unchanged. */
.restory-ds[data-warm-studio] .setup-body--create {
  padding: 18px 28px 24px;
  gap: 16px;
}

.restory-ds[data-warm-studio] .create-grid {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.restory-ds[data-warm-studio] .create-panel {
  padding: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .create-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .create-panel__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .create-panel .ds-form {
  display: grid;
  gap: 16px;
  padding: 18px 22px 20px;
}

.restory-ds[data-warm-studio] .create-panel .ds-field {
  display: grid;
  gap: 6px;
}

.restory-ds[data-warm-studio] .create-panel .ds-label {
  color: var(--ds-ink);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .create-panel .ds-input {
  width: 100%;
  max-width: 440px;
  height: 42px;
  min-height: 42px;
  padding: 8px 12px;
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 15px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .create-panel .ds-input.ds-mono {
  max-width: 360px;
  font-family: var(--ds-mono);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .create-panel .ds-input::placeholder {
  color: var(--ds-faint);
  opacity: 0.85;
}

.restory-ds[data-warm-studio] .create-panel .ds-input[aria-invalid="true"] {
  border-color: var(--ds-status-error-fg);
  background: #fffbfb;
}

.restory-ds[data-warm-studio] .create-grid .ds-hint {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .create-panel .ds-field-error {
  margin: 0;
  color: var(--ds-status-error-fg);
  font-size: 14px;
  font-weight: 500;
}

.restory-ds[data-warm-studio] .derived-targets {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .derived-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .derived-row code {
  padding: 1px 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 4px;
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .storage-summary {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .storage-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .storage-summary__tag {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  font-weight: 400;
}

.restory-ds[data-warm-studio] .storage-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

.restory-ds[data-warm-studio] .storage-kv {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .storage-kv-key {
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

.restory-ds[data-warm-studio] .create-panel .ds-btn--primary {
  min-height: 40px;
  padding: 0 18px;
}

.restory-ds[data-warm-studio] .next-panel {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}

.restory-ds[data-warm-studio] .next-panel__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .next-panel > div > .ds-hint {
  margin-top: 3px;
}

.restory-ds[data-warm-studio] .next-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .next-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .next-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .next-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 50%;
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .next-title {
  margin: 0;
  color: var(--ds-ink);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .next-desc {
  margin: 3px 0 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.48;
}

.restory-ds[data-warm-studio] .next-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ds-panel-border);
  color: var(--ds-muted);
  font-size: 13px;
}

/* Creation is the only screen with setup-body--create, so these rules cannot
   reach the Storage & Mac guide's storage-* block. */
@media (max-width: 1080px) {
  .restory-ds[data-warm-studio] .setup-body--create .create-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .setup-body--create .derived-row,
  .restory-ds[data-warm-studio] .setup-body--create .storage-summary-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .restory-ds[data-warm-studio] .setup-body--create .storage-kv-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .setup-body--create .storage-kv {
    align-items: flex-start;
  }

  .restory-ds[data-warm-studio] .setup-body--create .derived-row code,
  .restory-ds[data-warm-studio] .setup-body--create .storage-kv span {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ============================================================================
   Repositories & GitHub settings
   One delimited, screen-scoped block. It reuses the Warm Studio tokens,
   buttons, badges, panels and rail. Only the github table, picker and OAuth
   fact cards add feature rules.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app:has(.github-screen) {
  height: 100dvh;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-app:has(.github-screen) > .ds-main {
  min-height: 0;
  height: 100dvh;
}

.restory-ds[data-warm-studio] .github-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: -40px -48px -64px;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .github-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 28px;
  background: var(--ds-panel);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .github-head__main {
  min-width: 0;
}

.restory-ds[data-warm-studio] .github-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-crumb__status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: var(--ds-radius-badge);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-ink-2);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-crumb__status--ok {
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .github-crumb__status--warn {
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .github-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.restory-ds[data-warm-studio] .github-subtitle {
  max-width: 78ch;
  margin: 2px 0 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .github-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}

.restory-ds[data-warm-studio] .github-body {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 1120px;
  padding: 14px 28px 20px;
}

.restory-ds[data-warm-studio] .github-panel,
.restory-ds[data-warm-studio] .github-oauth {
  padding: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .github-install-tools {
  padding: 4px 20px;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .github-repo-chip {
  padding: 2px 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 4px;
  background: var(--ds-chrome);
  font-family: var(--ds-mono);
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .github-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .github-panel__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .github-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 50%;
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-weight: 600;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .github-step-pill--active {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .github-step-pill--warn {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .github-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.restory-ds[data-warm-studio] .github-install-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--ds-chrome);
  border-bottom: 1px solid var(--ds-panel-border);
  color: var(--ds-ink-2);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .github-install-strip__account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .github-install-strip__account strong {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-install-strip__state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .github-install-strip__synced {
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-repo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.restory-ds[data-warm-studio] .github-repo-table th {
  padding: 9px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .github-repo-table td {
  padding: 11px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
  vertical-align: middle;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .github-repo-table tbody tr:last-child td {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .github-repo-table tbody tr:hover {
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .github-repo-name {
  display: block;
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-repo-path {
  display: block;
  margin-top: 1px;
  color: var(--ds-muted);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .github-repo-coverage {
  display: block;
  margin-top: 2px;
  color: var(--ds-status-warn-fg);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-actions-head {
  text-align: right;
}

.restory-ds[data-warm-studio] .github-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .github-mirror {
  color: var(--ds-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .github-mirror.is-ok {
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .github-mirror.is-warn {
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .github-partial {
  margin: 0;
  padding: 8px 20px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 24px 20px;
}

.restory-ds[data-warm-studio] .github-empty__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-empty__copy {
  max-width: 72ch;
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .github-empty__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .github-picker {
  display: grid;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .github-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.restory-ds[data-warm-studio] .github-picker__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-picker__hint {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .github-picker__row {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.5fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr)
    auto auto;
  align-items: end;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .github-picker__repo {
  display: grid;
  gap: 1px;
  align-self: center;
}

.restory-ds[data-warm-studio] .github-picker__repo strong {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-picker__path,
.restory-ds[data-warm-studio] .github-picker__branch {
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-picker__field {
  display: grid;
  gap: 3px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-picker__check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-ink-2);
  font-size: 13px;
  align-self: center;
}

.restory-ds[data-warm-studio] .github-loading,
.restory-ds[data-warm-studio] .github-unavailable {
  display: grid;
  gap: 8px;
  padding: 24px 20px;
}

.restory-ds[data-warm-studio] .github-loading__label {
  margin: 0;
  color: var(--ds-muted);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .github-unavailable__copy {
  max-width: 78ch;
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .github-unavailable__reason {
  margin: 0;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-notice {
  padding: 10px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .github-notice--success {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .github-notice--warning {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .github-notice--error {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .github-oauth-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 20px 0;
}

.restory-ds[data-warm-studio] .github-fact-card {
  display: grid;
  gap: 3px;
  padding: 10px 13px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .github-fact-card p {
  margin: 0;
}

.restory-ds[data-warm-studio] .github-fact-label {
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-fact-val {
  color: var(--ds-ink);
  font-size: 14.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .github-fact-sub {
  color: var(--ds-ink-2);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-guardrail-strip {
  margin: 12px 20px 0;
  padding: 10px 13px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.48;
}

.restory-ds[data-warm-studio] .github-guardrail-strip .github-shield {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  color: var(--ds-accent);
  vertical-align: text-bottom;
}

.restory-ds[data-warm-studio] .github-oauth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px 16px;
  color: var(--ds-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .github-oauth-foot__copy {
  margin: 0;
}

.restory-ds[data-warm-studio] .github-oauth-foot form {
  margin: 0;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .github-oauth-empty {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 16px 20px;
}

.restory-ds[data-warm-studio] .github-oauth-empty__copy {
  max-width: 78ch;
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.45;
}

/* Recovery panel: the promoted focal Step 2 section. It reuses the shared
   focal panel, warning badge and uniform 1px warning notice; only the inner
   recovery body, return target and white fact cards add rules here. */
.restory-ds[data-warm-studio] .github-oauth--recovery .github-panel-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .github-oauth--recovery .github-panel__title {
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.restory-ds[data-warm-studio] .github-oauth-return {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .github-oauth-body {
  display: grid;
  gap: 12px;
  padding: 14px 20px 16px;
}

.restory-ds[data-warm-studio] .github-oauth-body .github-oauth-facts {
  padding: 0;
}

.restory-ds[data-warm-studio] .github-oauth-body .github-guardrail-strip {
  margin: 0;
}

.restory-ds[data-warm-studio] .github-oauth-body .github-oauth-foot {
  padding: 0;
}

.restory-ds[data-warm-studio] .github-oauth--recovery .github-fact-card {
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .github-recovery-notice {
  gap: 11px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .github-recovery-notice svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 2px;
}

@media (max-width: 1080px) {
  .restory-ds[data-warm-studio] .github-oauth-facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================================
   Model provider keys (design screen 8)
   ============================================================================

   Appended block for the routed Cloud model provider keys screen only. Every
   rule is scoped to `.providers-screen`, so the create/setup, storage and
   GitHub blocks above are untouched. Design-system names that this screen
   alone needs (`ds-btn--quiet`, `ds-btn--sm`, `ds-badge--live`,
   `ds-badge__dot`, `ds-field__*`, `ds-action-bar`) are added here scoped to
   the same screen instead of editing a shared block.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app:has(.providers-screen) > .ds-main {
  min-height: 0;
  height: 100dvh;
}

.restory-ds[data-warm-studio] .providers-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: -40px -48px -64px;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .providers-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 28px;
  background: var(--ds-panel);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .providers-head__main {
  min-width: 0;
}

.restory-ds[data-warm-studio] .providers-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .providers-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .providers-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.restory-ds[data-warm-studio] .providers-subtitle {
  margin: 3px 0 0;
  max-width: 78ch;
  color: var(--ds-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .providers-precedence {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .providers-body {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 1120px;
  padding: 14px 28px 20px;
}

.restory-ds[data-warm-studio] .providers-screen .ds-panel,
.restory-ds[data-warm-studio] .providers-screen .ds-panel-focal {
  padding: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-xs);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .providers-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .providers-screen .ds-panel-focal > .providers-panel-bar {
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .providers-panel-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .providers-panel-meta {
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .providers-focal__ident {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .providers-inline-code {
  padding: 1px 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 4px;
  background: var(--ds-chrome);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 13.5px;
}

/* Precedence matrix */

.restory-ds[data-warm-studio] .providers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.restory-ds[data-warm-studio] .providers-table th {
  padding: 9px 16px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .providers-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--ds-panel-border);
  color: var(--ds-ink-2);
  vertical-align: middle;
}

.restory-ds[data-warm-studio] .providers-table tbody tr:last-child td {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .providers-table tbody tr:hover td {
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .providers-table tbody tr.is-selected td {
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .providers-table__actions {
  text-align: right;
}

.restory-ds[data-warm-studio] .providers-provider {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .providers-provider-id {
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .providers-optional {
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .providers-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-ink-2);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .providers-slot--unset {
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .providers-fallback {
  display: inline-block;
  margin-left: 8px;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .providers-screen .ds-badge__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--ds-radius-pill);
  background: currentColor;
}

.restory-ds[data-warm-studio] .providers-screen .ds-badge--live {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .providers-screen .ds-btn--sm {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .providers-screen .ds-btn--quiet {
  border-color: var(--ds-btn-border);
  background: transparent;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .providers-screen .ds-btn--quiet:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .providers-screen .ds-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Focal credential form */

.restory-ds[data-warm-studio] .providers-form {
  display: grid;
  gap: 12px;
  padding: 14px 18px 16px;
}

.restory-ds[data-warm-studio] .providers-fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.restory-ds[data-warm-studio] .providers-legend {
  padding: 0;
  color: var(--ds-ink);
  font-size: 13.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .providers-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.restory-ds[data-warm-studio] .providers-scope-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 13px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  cursor: pointer;
}

.restory-ds[data-warm-studio] .providers-scope-card:hover {
  border-color: var(--ds-btn-border);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .providers-scope-card.is-selected {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .providers-scope-card:has(input:disabled) {
  border-style: dashed;
  background: var(--ds-chrome);
  cursor: not-allowed;
  opacity: 0.92;
}

.restory-ds[data-warm-studio] .providers-scope-card input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--ds-accent);
  cursor: inherit;
}

.restory-ds[data-warm-studio] .providers-scope-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .providers-scope-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .providers-scope-title {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .providers-scope-desc {
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.44;
}

.restory-ds[data-warm-studio] .providers-field {
  display: grid;
  gap: 5px;
}

.restory-ds[data-warm-studio] .providers-field__label {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .providers-field__help {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.44;
}

.restory-ds[data-warm-studio] .providers-field__error {
  margin: 0;
  color: var(--ds-status-error-fg);
  font-size: 14px;
  font-weight: 500;
}

.restory-ds[data-warm-studio] .providers-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  max-width: 680px;
}

.restory-ds[data-warm-studio] .providers-input-row .ds-input {
  min-height: 38px;
  padding: 7px 12px;
  font-family: var(--ds-mono);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .providers-input-row .ds-input::placeholder {
  color: var(--ds-faint);
  font-family: var(--ds-sans);
  font-size: 14px;
}

/* The design system's single focus ring, recoloured for a refused value: the
   border and the ring both carry the error colour while the field keeps focus. */
.restory-ds[data-warm-studio] .providers-input-row .ds-input[aria-invalid="true"] {
  border-color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio]
  .providers-input-row
  .ds-input[aria-invalid="true"]:focus-visible {
  outline-color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .providers-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .providers-danger {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.restory-ds[data-warm-studio] .providers-danger__note {
  margin: 0;
  max-width: 44ch;
  color: var(--ds-status-error-fg);
  font-size: 14px;
  line-height: 1.38;
  text-align: right;
}

.restory-ds[data-warm-studio] .providers-withheld {
  margin: 0;
  padding: 14px 18px 16px;
  color: var(--ds-muted);
  font-size: 14px;
}

/* Notices, unavailable and footer */

.restory-ds[data-warm-studio] .providers-screen .ds-notice__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .providers-screen .ds-notice__title {
  margin: 0;
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .providers-screen .ds-notice__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.48;
}

.restory-ds[data-warm-studio] .providers-unavailable {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px 18px;
}

.restory-ds[data-warm-studio] .providers-unavailable__copy {
  margin: 0;
  max-width: 76ch;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .providers-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .providers-footer__links {
  display: flex;
  gap: 16px;
}

.restory-ds[data-warm-studio] .providers-link {
  color: var(--ds-muted);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .providers-link:hover {
  color: var(--ds-ink);
  text-decoration: underline;
}

@media (max-width: 1080px) {
  .restory-ds[data-warm-studio] .providers-scope-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================================
   Pending account approvals (design screen 12)
   ============================================================================

   Appended block for the routed approvals queue only. Every rule is scoped to
   `.approvals-screen`, so the shell, setup, storage, GitHub and provider blocks
   above are untouched. Design-system names this screen alone needs
   (`ds-badge--live`, `ds-badge__dot`, `ds-btn--sm`, `ds-btn--quiet`) are added
   here scoped to the same screen rather than editing a shared block. Tokens,
   focus rules and the existing `ds-` panel/button/input primitives are reused.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app:has(.approvals-screen) > .ds-main {
  min-height: 0;
  height: 100dvh;
}

.restory-ds[data-warm-studio] .approvals-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: -40px -48px -64px;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .approvals-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 28px;
  background: var(--ds-panel);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .approvals-head__main {
  min-width: 0;
}

.restory-ds[data-warm-studio] .approvals-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .approvals-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .approvals-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.restory-ds[data-warm-studio] .approvals-subtitle {
  margin: 3px 0 0;
  max-width: 78ch;
  color: var(--ds-ink-2);
  font-size: 14.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .approvals-body {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 1120px;
  padding: 14px 28px 20px;
}

/* Panels and notices */

.restory-ds[data-warm-studio] .approvals-decision,
.restory-ds[data-warm-studio] .approvals-queue {
  padding: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .approvals-panel {
  display: grid;
  gap: 8px;
  padding: 18px 20px 20px;
}

.restory-ds[data-warm-studio] .approvals-panel__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.restory-ds[data-warm-studio] .approvals-panel__text {
  margin: 0;
  max-width: 76ch;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .approvals-panel__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.restory-ds[data-warm-studio] .approvals-screen .ds-notice__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .approvals-screen .ds-notice__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.48;
}

/* Selected applicant decision card */

.restory-ds[data-warm-studio] .approvals-decision__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .approvals-decision__ident {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.restory-ds[data-warm-studio] .approvals-decision__name {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.restory-ds[data-warm-studio] .approvals-decision__handle {
  color: var(--ds-ink-2);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .approvals-decision__id {
  margin: 0;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .approvals-decision__id .ds-mono {
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .approvals-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px 20px;
  background: var(--ds-panel);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .approvals-fact {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .approvals-fact dt {
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .approvals-fact dd {
  margin: 0;
  overflow: hidden;
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .approvals-origin-note {
  margin: 0;
  padding: 10px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 13px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .approvals-decision form {
  display: grid;
  gap: 10px;
  padding: 14px 20px 16px;
}

.restory-ds[data-warm-studio] .approvals-note-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
}

.restory-ds[data-warm-studio] .approvals-note-label {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .approvals-note-optional {
  color: var(--ds-muted);
  font-weight: 400;
}

.restory-ds[data-warm-studio] .approvals-note-count {
  color: var(--ds-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .approvals-note-count.is-over-limit {
  color: var(--ds-error-text);
  font-weight: 700;
}

.restory-ds[data-warm-studio] .approvals-note {
  max-width: 720px;
  min-height: 56px;
  resize: vertical;
}

.restory-ds[data-warm-studio] .approvals-note.is-invalid {
  border-color: var(--ds-status-error-dot);
}

.restory-ds[data-warm-studio] .approvals-note.is-invalid:focus-visible {
  outline: 2px solid var(--ds-status-error-dot);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .approvals-note-error {
  margin: 0;
  max-width: 720px;
  color: var(--ds-error-text);
  font-size: 13px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .approvals-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.restory-ds[data-warm-studio] .approvals-reject {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .approvals-consequence {
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .approvals-consequence .ds-mono {
  font-size: 13px;
}

/* Keyset-paginated queue table */

.restory-ds[data-warm-studio] .approvals-queue__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .approvals-range {
  color: var(--ds-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .approvals-table-wrap {
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .approvals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.restory-ds[data-warm-studio] .approvals-table th {
  padding: 9px 16px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .approvals-table th:first-child,
.restory-ds[data-warm-studio] .approvals-table td:first-child {
  padding-left: 20px;
}

.restory-ds[data-warm-studio] .approvals-table th:last-child,
.restory-ds[data-warm-studio] .approvals-table td:last-child {
  padding-right: 20px;
  text-align: right;
}

.restory-ds[data-warm-studio] .approvals-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--ds-panel-border);
  color: var(--ds-ink-2);
  vertical-align: middle;
}

.restory-ds[data-warm-studio] .approvals-table tbody tr:last-child td {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .approvals-table tbody tr:hover td {
  background: var(--ds-chrome-hi);
}

.restory-ds[data-warm-studio] .approvals-table tbody tr.is-selected td {
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .approvals-row-name {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .approvals-row-handle {
  margin-left: 6px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .approvals-row-time {
  font-size: 12.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .approvals-row-action {
  text-align: right;
}

.restory-ds[data-warm-studio] .approvals-queue__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  border-radius: 0 0 var(--ds-radius-panel) var(--ds-radius-panel);
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .approvals-pager {
  display: flex;
  gap: 8px;
}

/* Scoped design-system names this screen needs */

.restory-ds[data-warm-studio] .approvals-screen .ds-badge__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--ds-radius-pill);
  background: currentColor;
}

.restory-ds[data-warm-studio] .approvals-screen .ds-badge--live {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .approvals-screen .ds-btn--sm {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .approvals-screen .ds-btn--quiet {
  border-color: var(--ds-btn-border);
  background: transparent;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .approvals-screen .ds-btn--quiet:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

@media (max-width: 1080px) {
  .restory-ds[data-warm-studio] .approvals-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* ============================================================================
   Model provider keys — member scope (design screen 9)
   ============================================================================

   The member delta only. Every rule is scoped to the provider screen carrying
   `data-model-provider-variant="member"`, which the view sets only for a ready
   projection reporting `can_manage_workspace: false` and
   `can_manage_operator: true`. Screen 8 (admin, read-only, loading and
   unavailable) renders without that attribute, so none of these rules reach
   it. Density, withheld treatment and the lock pill follow the step 9 design;
   no global token or sibling screen is touched.
   ========================================================================== */

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-head {
  padding: 11px 28px;
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-body {
  gap: 9px;
  padding: 10px 28px 14px;
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-table
  td {
  padding: 7px 16px;
}

/* `Not set` keeps readable contrast on the member screen, matching the design
   review note; the admin screen keeps its existing muted treatment. */
.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-slot--unset {
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-form {
  gap: 9px;
  padding: 11px 18px 13px;
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-scope-card {
  padding: 8px 12px;
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-scope-card--withheld:hover {
  border-color: var(--ds-panel-border);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-badge);
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .providers-lock-pill
  svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .ds-notice {
  padding: 7px 12px;
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .ds-notice__icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .ds-notice__text {
  line-height: 1.46;
}

/* The precedence notice explains the member's fallback; it is not the admin
   subtitle's emphasis. It keeps the design's uniform notice treatment: panel
   fill and border, with normal-weight ink-2 body text. Scoping by id leaves
   the base `.providers-precedence` helper and the admin `<strong>` alone. */
.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  #model-provider-precedence {
  background: var(--ds-panel);
  border-color: var(--ds-panel-border);
}

.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  #model-provider-precedence
  .ds-notice__text {
  color: var(--ds-ink-2);
  font-weight: 400;
}

/* The withheld action is an explanation of a denial, not a busy control, so it
   keeps the dashed affordance even though it is natively disabled. */
.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .ds-btn--withheld,
.restory-ds[data-warm-studio]
  .providers-screen[data-model-provider-variant="member"]
  .ds-btn--withheld:disabled {
  border: 1px dashed var(--ds-btn-border);
  background: transparent;
  color: var(--ds-ink-2);
  cursor: not-allowed;
  opacity: 0.92;
}

/* ============================================================================
   List chrome, frames and non-ideal states
   ============================================================================

   Shared by the four Warm Studio list screens. Everything here is composed by
   `WarmStudioListComponents`; no list route ships with this file. Every
   rounded surface keeps one uniform four-sided 1px frame from the same token
   family, and the decision state only recolors that frame (the caller still
   renders the visible non-color status). Nothing here loads Home styles. */

.restory-ds[data-warm-studio] .ws-list-head {
  display: grid;
  gap: 14px;
}

.restory-ds[data-warm-studio] .ws-list-head__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.restory-ds[data-warm-studio] .ws-list-head__identity {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-list-breadcrumb {
  color: var(--ds-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.restory-ds[data-warm-studio] a.ws-list-breadcrumb:hover {
  color: var(--ds-accent);
  text-decoration: underline;
}

.restory-ds[data-warm-studio] .ws-list-head__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.12;
}

.restory-ds[data-warm-studio] .ws-list-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* The tabs row owns the single bottom hairline; the current tab's 2px
   underline meets it and never decorates a rounded card edge. */
.restory-ds[data-warm-studio] .ws-list-head__tabs-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ws-list-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.restory-ds[data-warm-studio] .ws-list-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-list-tab:hover {
  background: var(--ds-chrome);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-list-tab[aria-current="page"] {
  border-bottom-color: var(--ds-accent);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-list-tab--unavailable,
.restory-ds[data-warm-studio] .ws-list-tab--unavailable:hover {
  background: transparent;
  color: var(--ds-faint);
  cursor: not-allowed;
}

.restory-ds[data-warm-studio] .ws-list-tab:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
}

.restory-ds[data-warm-studio] .ws-list-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-badge);
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.restory-ds[data-warm-studio] .ws-list-pulse {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  padding-bottom: 8px;
  color: var(--ds-muted);
  font-size: 13px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-list-utility {
  display: grid;
  gap: 10px;
}

.restory-ds[data-warm-studio] .ws-list-search {
  position: relative;
  display: block;
  max-width: 420px;
}

/* The screen owns one clear control; Chrome's native search cancel button
   would stack a second × beside it. */
.restory-ds[data-warm-studio] .ws-list-search__input::-webkit-search-cancel-button {
  display: none;
}

.restory-ds[data-warm-studio] .ws-list-search .ws-list-search__input {
  padding-right: 34px;
  border-color: var(--ds-panel-border);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-list-search .ws-list-search__input:focus-visible {
  border-color: var(--ds-accent);
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .ws-list-search__clear {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-badge);
  background: transparent;
  color: var(--ds-muted);
  font-size: 16px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-list-search__clear:hover {
  border-color: var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-list-search__clear:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .ws-list-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.restory-ds[data-warm-studio] .ws-list-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.restory-ds[data-warm-studio] .ws-list-filters:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

.restory-ds[data-warm-studio] .ws-list-filter[aria-pressed="true"] {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ws-list-sort {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .ws-list-sort .ws-list-sort__option {
  border-color: transparent;
  background: transparent;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ws-list-sort .ws-list-sort__option[aria-pressed="true"] {
  border-color: var(--ds-panel-border);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-list-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: 8px;
  color: var(--ds-muted);
  font-size: 13px;
}

/* Uniform four-sided frames: 1px on every side, one 12px panel radius. */
.restory-ds[data-warm-studio] .ws-list-card,
.restory-ds[data-warm-studio] .ws-list-frame,
.restory-ds[data-warm-studio] .ws-list-filtered-empty {
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
}

.restory-ds[data-warm-studio] .ws-list-card--decision {
  border-color: var(--ds-list-decision-border);
}

.restory-ds[data-warm-studio] .ws-list-card {
  padding: 18px 20px;
}

.restory-ds[data-warm-studio] .ws-list-frame {
  padding: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ws-list-frame__scroll {
  max-width: 100%;
  padding: 8px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.restory-ds[data-warm-studio] .ws-list-frame__scroll:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
}

.restory-ds[data-warm-studio] .ws-list-table {
  width: 100%;
  border-collapse: collapse;
}

.restory-ds[data-warm-studio] .ws-list-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.restory-ds[data-warm-studio] .ws-list-empty__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 18px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ws-list-empty__description {
  max-width: 52ch;
  margin: 0;
  color: var(--ds-muted);
  font-size: 14px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ws-list-empty__action {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.restory-ds[data-warm-studio] .ws-list-filtered-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 18px 20px;
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ws-list-filtered-empty__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ws-list-filtered-empty__description {
  margin: 0;
  color: var(--ds-muted);
  font-size: 14px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ws-list-skeleton {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.restory-ds[data-warm-studio] .ws-list-skeleton__bars {
  display: grid;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ws-list-skeleton__bar {
  width: 100%;
  min-height: 12px;
}

.restory-ds[data-warm-studio] .ws-list-skeleton__bar--short {
  width: 62%;
}

/* The notice keeps the shared four-sided status frame and the panel radius;
   the tone only changes the existing `.ds-notice--*` colour family. */
.restory-ds[data-warm-studio] .ws-list-notice {
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-radius: var(--ds-radius-panel);
}

.restory-ds[data-warm-studio] .ws-list-notice__message {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ws-list-notice__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

/* CSS-only mineral wells for artifact previews; the modifier supplies only the
   fill, so callers keep one framed `.ds-artifact-well` element. */
.restory-ds[data-warm-studio] .ds-artifact-well {
  padding: 12px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ds-artifact-well--sky {
  background: var(--ds-artifact-sky);
}

.restory-ds[data-warm-studio] .ds-artifact-well--sage {
  background: var(--ds-artifact-sage);
}

.restory-ds[data-warm-studio] .ds-artifact-well--sand {
  background: var(--ds-artifact-sand);
}

.restory-ds[data-warm-studio] .ds-artifact-well--lilac {
  background: var(--ds-artifact-lilac);
}

/* ---------------------------------------------------------------------------
   Attention disclosure, native dialogs and the opt-in drop seam
   ------------------------------------------------------------------------- */

/* The disclosure is a local popover anchored to its trigger. It keeps the
   shared four-sided frame and panel radius, and the badge is the only
   Terracotta waypoint accent. */
.restory-ds[data-warm-studio] .ws-list-attention {
  position: relative;
  display: inline-flex;
}

.restory-ds[data-warm-studio] .ws-list-attention__trigger {
  gap: 8px;
}

.restory-ds[data-warm-studio] .ws-list-attention__glyph {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .ws-list-attention__label {
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-list-attention__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ds-waypoint);
  color: #ffffff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

.restory-ds[data-warm-studio] .ws-list-attention__panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 48px));
  max-height: min(70vh, 460px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-lg);
}

.restory-ds[data-warm-studio] .ws-list-attention__panel[hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .ws-list-attention__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-list-attention__item {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.restory-ds[data-warm-studio] .ws-list-attention__item:hover {
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ws-list-attention__item-label {
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ws-list-attention__detail {
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.restory-ds[data-warm-studio] .ws-list-attention__empty {
  margin: 0;
  padding: 8px 10px;
  color: var(--ds-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ws-list-attention__quick-filter {
  width: 100%;
  margin-top: 8px;
}

/* Native dialogs: the panel itself is the dialog, so the browser owns the top
   layer, background inertness and focus containment. Closed dialogs keep the
   user agent's `display: none`, so the panel is only laid out while `[open]`. */
.restory-ds[data-warm-studio] .ws-list-dialog {
  padding: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-lg);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ws-list-dialog[open] {
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
}

.restory-ds[data-warm-studio] .ws-list-dialog--drawer[open] {
  width: min(440px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  margin: 16px 16px 16px auto;
}

.restory-ds[data-warm-studio] .ws-list-dialog--modal[open] {
  margin: auto;
}

.restory-ds[data-warm-studio] .ws-list-dialog::backdrop {
  background: rgba(26, 32, 38, 0.38);
}

.restory-ds[data-warm-studio] .ws-list-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.restory-ds[data-warm-studio] .ws-list-dialog__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .ws-list-dialog__icon-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-list-dialog__icon-close:hover {
  background: var(--ds-chrome);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-list-dialog__description {
  padding: 8px 20px 0;
  color: var(--ds-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ws-list-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px;
}

.restory-ds[data-warm-studio] .ws-list-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ws-list-dialog__open {
  margin-right: auto;
}

/* Opt-in page drop seam: the root only names the native upload input, and the
   overlay is a decorative veil that never takes pointer or keyboard input. */
.restory-ds[data-warm-studio] .ws-list-drop {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px dashed var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ws-list-drop__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ws-list-drop__description {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] #research-head .ws-list-pulse {
  display: flex;
  align-items: center;
  gap: 12px;
}

.restory-ds[data-warm-studio] #research-drop {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.restory-ds[data-warm-studio] #research-drop[data-ws-drop-enabled="false"] {
  display: none;
}

.restory-ds[data-warm-studio] #research-drop .ws-list-drop__title {
  color: var(--ds-muted);
  font-size: 12px;
  font-weight: 500;
}

.restory-ds[data-warm-studio] .ws-list-drop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: rgba(244, 241, 234, 0.86);
}

.restory-ds[data-warm-studio] .ws-list-drop-overlay::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed var(--ds-accent);
  border-radius: var(--ds-radius-panel);
}

.restory-ds[data-warm-studio] .ws-list-drop-overlay__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
  padding: 20px 26px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
  text-align: center;
}

.restory-ds[data-warm-studio] .ws-list-drop-overlay__title {
  margin: 0;
  font-family: var(--ds-serif, "Newsreader", Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-list-drop-overlay__hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ds-ink-2);
}

/* The drop hook reveals the veil through this root attribute; no rule shows it
   at rest. */
.restory-ds[data-warm-studio] [data-ws-drop-active="true"] .ws-list-drop-overlay {
  display: block;
}

@keyframes ws-list-dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .restory-ds[data-warm-studio] .ws-list-dialog[open] {
    animation: ws-list-dialog-enter 160ms ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  .restory-ds[data-warm-studio] .ws-list-dialog[open] {
    animation: none;
    transition: none;
  }
}


/* ============================================================================
   Personal search API keys (`/account/search-keys`)

   Every rule in this block is scoped under `.search-keys-screen`, so the
   account screen never restyles the shell, the workspace destinations or the
   test-only probes. Shared surfaces (panel, badge, notice, button, focus ring)
   come from the design system above; only the table, the empty state, the
   disclosure and the key toolbar are new here.
   ============================================================================ */

/* The frame grid already reserves the 44px top bar. The base `.ds-main`
   min-height of 100dvh would overflow that row by the top bar's height and
   let the frame scroll the top bar out of view, so this screen keeps its main
   column inside the row and scrolls only that column. */
.restory-ds[data-warm-studio] .ds-app:has(.search-keys-screen) > .ds-main {
  max-width: 1080px;
  min-height: 0;
}

.restory-ds[data-warm-studio] .search-keys-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 32px 32px;
}

.restory-ds[data-warm-studio] .search-keys-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .search-keys-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 62ch;
}

.restory-ds[data-warm-studio] .search-keys-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .search-keys-subtitle {
  margin: 0;
  max-width: 76ch;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .search-keys-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px 18px;
}

.restory-ds[data-warm-studio] .search-keys-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .search-keys-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .search-keys-panel__hint {
  margin: 0;
  max-width: 58ch;
  color: var(--ds-ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .search-keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

/* Members rosters keep their columns reachable on a narrow viewport instead of
   clipping the role controls and row actions. */
.restory-ds[data-warm-studio] .members-table-wrap {
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .members-table-wrap .search-keys-table {
  min-width: 420px;
}

/* The members screen is scoped here: at a phone viewport the shared 32px screen
   padding and the collapsed rail leave too little room for the roster panels. */
@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .search-keys-screen[data-members-screen] {
    padding: 16px 12px 24px;
  }
}

.restory-ds[data-warm-studio] .search-keys-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-ink-2);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .search-keys-table td {
  padding: 11px 10px;
  vertical-align: top;
  color: var(--ds-ink);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .search-keys-table tbody tr:last-child td {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .search-keys-prefix {
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .search-keys-status-detail {
  margin-left: 8px;
  color: var(--ds-ink-2);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .search-keys-actions {
  text-align: right;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .search-keys-empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 20px;
  border: 1px dashed var(--ds-panel-border);
  border-radius: 10px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .search-keys-empty__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .search-keys-empty__body {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .search-keys-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ds-panel-border);
  border-left: 3px solid var(--ds-danger, #9a3b2f);
  border-radius: 8px;
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-size: 13px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .search-keys-pager {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.restory-ds[data-warm-studio] .search-keys-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Per-screen design-system variants. The base `.ds-badge` has a transparent
   border and no fill, so a screen that uses `--live` (and the quiet/small button
   variants) has to declare them itself; these stay scoped to this screen. */
.restory-ds[data-warm-studio] .search-keys-screen .ds-badge--live {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .search-keys-screen .ds-btn--sm {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .search-keys-screen .ds-btn--quiet {
  border-color: var(--ds-btn-border);
  background: transparent;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .search-keys-screen .ds-btn--quiet:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .search-keys-reveal__trust {
  margin: 0;
  max-width: 92ch;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.48;
}

/* Show-once reveal, secret wells and inline create bar. These rules are still
   scoped under `.search-keys-screen`, so no other Warm Studio surface changes. */
.restory-ds[data-warm-studio] .search-keys-reveal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
}

/* The SHA-256 warning keeps one uniform hairline border and no accent edge. */
.restory-ds[data-warm-studio] .search-keys-reveal .ds-notice {
  border: 1px solid var(--ds-status-warn-border, #e2c56b);
  border-left-width: 1px;
  border-radius: 8px;
}

.restory-ds[data-warm-studio] .search-keys-reveal__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .search-keys-reveal__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .search-keys-reveal__facts {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--ds-ink-2);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .search-keys-chip {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 999px;
  background: var(--ds-panel-2);
  font-size: 12px;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .search-keys-secret-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .search-keys-secret {
  flex: 1 1 420px;
  min-width: 260px;
  padding: 12px 14px;
  border: 1px solid var(--ds-terminal);
  border-radius: 8px;
  background: var(--ds-terminal);
  color: var(--ds-terminal-ink);
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .search-keys-secret code {
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px;
  color: var(--ds-terminal-ink);
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .search-keys-export {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ds-terminal);
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio] .search-keys-export__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .search-keys-export__title {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.72;
}

.restory-ds[data-warm-studio] .search-keys-export__code {
  margin: 8px 0 0;
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .search-keys-export__code code {
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px;
  color: var(--ds-terminal-ink);
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .search-keys-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.restory-ds[data-warm-studio] .search-keys-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.2fr) 180px auto;
  gap: 12px 18px;
  align-items: end;
}

.restory-ds[data-warm-studio] .search-keys-form > button[type="submit"] {
  justify-self: start;
}

@media (max-width: 1200px) {
  .restory-ds[data-warm-studio] .search-keys-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .restory-ds[data-warm-studio] .search-keys-form > button[type="submit"] {
    grid-column: 1 / -1;
  }
}

.restory-ds[data-warm-studio] .search-keys-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .search-keys-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.restory-ds[data-warm-studio] .search-keys-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .search-keys-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 8px;
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font: inherit;
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .search-keys-input:focus-visible {
  outline: 2px solid var(--ds-focus, #2f6f5e);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .search-keys-scopes {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.restory-ds[data-warm-studio] .search-keys-scope {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .search-keys-field-error {
  margin: 0;
  color: var(--ds-danger, #9a3b2f);
  font-size: 12.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .search-keys-mono {
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .search-keys-path {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .search-keys-path__route {
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

/* ============================================================================
   API access tokens (`/tokens`)

   Same scoping rule as the personal search keys above: every rule is scoped
   under `.api-tokens-screen`, so the shell, the workspace destinations and the
   test-only probes are untouched. Panels, badges, notices, buttons and focus
   rings come from the design system; only the bearer stage, the create form,
   the token table and the reveal's row-action suppression are new here.
   ============================================================================ */

.restory-ds[data-warm-studio] .ds-app:has(.api-tokens-screen) > .ds-main {
  max-width: 1080px;
}

.restory-ds[data-warm-studio] .api-tokens-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 32px 32px;
}

.restory-ds[data-warm-studio] .api-tokens-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .api-tokens-head-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 62ch;
}

.restory-ds[data-warm-studio] .api-tokens-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .api-tokens-mono,
.restory-ds[data-warm-studio] .api-tokens-curl,
.restory-ds[data-warm-studio] .api-tokens-secret-label {
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.restory-ds[data-warm-studio] .api-tokens-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .api-tokens-subtitle {
  margin: 0;
  max-width: 76ch;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .api-tokens-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px 18px;
}

.restory-ds[data-warm-studio] .api-tokens-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .api-tokens-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .api-tokens-panel-meta {
  color: var(--ds-ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .api-tokens-notice {
  padding: 10px 14px;
}

.restory-ds[data-warm-studio] .api-tokens-notice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.45;
}

/* Create form: one row that stacks on a narrow document. */
.restory-ds[data-warm-studio] .api-tokens-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .api-tokens-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .api-tokens-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .api-tokens-label-optional {
  font-weight: 400;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .api-tokens-input {
  width: 100%;
}

.restory-ds[data-warm-studio] .api-tokens-field-error {
  margin: 0;
  color: var(--ds-status-error-ink, #9a2f24);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .api-tokens-submit {
  flex: 0 0 auto;
}

/* First use promotes the same form into a focal, single-column card with its
   own help copy. The column direction means the base row sizing (a 220px
   flex-basis, which is a height in this axis) must not apply, and the base
   rule's cross-axis `flex-end` must not leave the fields fit-content sized
   against the right edge: `stretch` makes both fields fill the column, as the
   reference's grid does. The sole primary submit keeps its own auto width on
   the desktop layout and only fills the column at ≤640px. */
.restory-ds[data-warm-studio] .api-tokens-first-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  max-width: 520px;
}

.restory-ds[data-warm-studio] .api-tokens-first-form .api-tokens-field {
  flex: 0 0 auto;
}

.restory-ds[data-warm-studio] .api-tokens-intro {
  margin: 0;
  max-width: 64ch;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .api-tokens-intro .api-tokens-mono {
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .api-tokens-help {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .api-tokens-first-submit {
  align-self: flex-start;
}

/* The first-use zero-list band replaces the base placeholder inside the same
   panel, so the panel head and the quiet Search action stay where they are. */
.restory-ds[data-warm-studio] .api-tokens-empty-band {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .api-tokens-empty-title {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .api-tokens-empty-copy {
  margin: 0;
  max-width: 62ch;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .api-tokens-link {
  color: var(--ds-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(25, 100, 86, 0.35);
  text-underline-offset: 3px;
}

.restory-ds[data-warm-studio] .api-tokens-link:hover {
  color: var(--ds-accent-fill-hover);
  text-decoration-color: var(--ds-accent-fill-hover);
}

@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .api-tokens-first-form .api-tokens-first-submit {
    align-self: stretch;
    width: 100%;
  }
}

/* Token table and its empty state. */
.restory-ds[data-warm-studio] .api-tokens-table-wrap {
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .api-tokens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .api-tokens-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-ink-2);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .api-tokens-table td {
  padding: 11px 10px;
  vertical-align: middle;
  color: var(--ds-ink);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .api-tokens-table tbody tr:last-child td {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .api-tokens-table th.api-tokens-col-right,
.restory-ds[data-warm-studio] .api-tokens-table td.api-tokens-col-right {
  text-align: right;
}

.restory-ds[data-warm-studio] .api-tokens-cell-primary {
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .api-tokens-cell-action {
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .api-tokens-revoked-at {
  color: var(--ds-ink-2);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .api-tokens-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  border: 1px dashed var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  text-align: center;
}

.restory-ds[data-warm-studio] .api-tokens-empty-line {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .api-tokens-pager {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Per-screen variants: the base badge carries a transparent border and no
   fill, the base button has no small/quiet/dark variant and no badge dot, so
   this screen declares the four it uses. They stay scoped to `.api-tokens-screen`. */
.restory-ds[data-warm-studio] .api-tokens-screen .ds-badge__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--ds-radius-pill);
  background: currentColor;
}

.restory-ds[data-warm-studio] .api-tokens-screen .ds-badge--live {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .api-tokens-screen .ds-btn--sm {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .api-tokens-screen .ds-btn--quiet {
  border-color: var(--ds-btn-border);
  background: transparent;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .api-tokens-screen .ds-btn--quiet:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

/* The secondary copy action sits on the dark stage, so its ink and hairline
   invert while the primary action stays the screen's one pine button. */
.restory-ds[data-warm-studio] .api-tokens-screen .ds-btn--dark {
  border-color: rgba(239, 236, 228, 0.28);
  background: transparent;
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio] .api-tokens-screen .ds-btn--dark:hover {
  border-color: rgba(239, 236, 228, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.restory-ds[data-warm-studio] .api-tokens-nowrap {
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .api-tokens-revoke {
  white-space: nowrap;
}

/* A narrow document turns the token table into stacked, labeled rows instead
   of five squeezed columns, and every control keeps a 44px touch target. */
@media (max-width: 720px) {
  .restory-ds[data-warm-studio] .api-tokens-screen {
    padding: 16px 18px 28px;
  }

  .restory-ds[data-warm-studio] .api-tokens-screen .ds-btn,
  .restory-ds[data-warm-studio] .api-tokens-screen .ds-input {
    min-height: 44px;
  }

  .restory-ds[data-warm-studio] .api-tokens-screen .ds-input {
    font-size: 16px;
  }

  .restory-ds[data-warm-studio] .api-tokens-submit {
    flex: 1 1 100%;
  }

  .restory-ds[data-warm-studio] .api-tokens-table-wrap {
    overflow-x: visible;
  }

  .restory-ds[data-warm-studio] .api-tokens-table thead {
    display: none;
  }

  .restory-ds[data-warm-studio] .api-tokens-table,
  .restory-ds[data-warm-studio] .api-tokens-table tbody,
  .restory-ds[data-warm-studio] .api-tokens-table tr,
  .restory-ds[data-warm-studio] .api-tokens-table td {
    display: block;
    width: 100%;
  }

  .restory-ds[data-warm-studio] .api-tokens-table tr {
    padding: 10px 12px;
    border: 1px solid var(--ds-panel-border);
    border-radius: var(--ds-radius-control);
  }

  .restory-ds[data-warm-studio] .api-tokens-table tr + tr {
    margin-top: 10px;
  }

  .restory-ds[data-warm-studio] .api-tokens-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0;
    border-bottom: 0;
    text-align: left;
  }

  .restory-ds[data-warm-studio] .api-tokens-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ds-ink-2);
  }

  /* Accounts accepts names up to 255 characters, and a name need not contain
     spaces. In a stacked row the name wraps inside the viewport instead of
     forcing the document sideways. */
  .restory-ds[data-warm-studio] .api-tokens-table td.api-tokens-cell-primary {
    font-size: 14.5px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }

  .restory-ds[data-warm-studio] .api-tokens-table td.api-tokens-cell-primary::before {
    content: none;
  }

  .restory-ds[data-warm-studio] .api-tokens-table th.api-tokens-col-right,
  .restory-ds[data-warm-studio] .api-tokens-table td.api-tokens-col-right {
    text-align: right;
  }
}

/* Show-once reveal: focal panel, one amber hash warning, one dark bearer
   stage. The stage is the only place the plaintext is rendered, and it wraps
   rather than scrolling sideways on a narrow document. */
.restory-ds[data-warm-studio] .api-tokens-reveal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
}

.restory-ds[data-warm-studio] .api-tokens-reveal-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* The shared `.ds-notice` is a flex row for an icon plus one label, which
   turns a prose sentence into gapped flex items. The reveal warning is
   running text, so it keeps the amber tokens and renders as a block. */
.restory-ds[data-warm-studio] .api-tokens-warn {
  display: block;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--ds-status-warn-border, #e2c56b);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 12.5px;
  line-height: 1.48;
}

.restory-ds[data-warm-studio] .api-tokens-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--ds-terminal);
  border-radius: var(--ds-radius-control);
  background: var(--ds-terminal);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.restory-ds[data-warm-studio] .api-tokens-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .api-tokens-secret-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(239, 236, 228, 0.72);
}

/* The bearer line stays one unbroken string and scrolls inside its well, so a
   narrow document never shows a token split by the wrap point. */
.restory-ds[data-warm-studio] .api-tokens-curl {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ds-terminal-ink);
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .api-tokens-curl span[data-reveal-text] {
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio] .api-tokens-reveal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .api-tokens-dialog-copy {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .api-tokens-dialog-form {
  display: inline-flex;
  margin: 0;
}

/* While the show-once reveal is live the controller seam marks the document,
   and every row action stays out of reach so a revoke cannot race the copy.
   The marker is the only state: retiring the reveal restores the actions. */
html[data-ws-reveal-open="true"]
  .restory-ds[data-warm-studio]
  .api-tokens-revoke {
  visibility: hidden;
  pointer-events: none;
}

/* ============================================================================
   Option A app shell: 44px top bar over a collapsible rail
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: 44px minmax(0, 1fr);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .ds-app--fallback {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 44px minmax(0, 1fr);
}

.restory-ds[data-warm-studio] .ds-app [hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .ds-backdrop {
  position: fixed;
  inset: 44px 0 0;
  z-index: 35;
  background: rgba(26, 32, 38, 0.18);
}

/* Top bar ---------------------------------------------------------------- */

.restory-ds[data-warm-studio] .ds-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 12px 0 10px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .ds-topbar__left,
.restory-ds[data-warm-studio] .ds-topbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-topbar__right {
  justify-content: flex-end;
}

.restory-ds[data-warm-studio] .ds-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  min-width: 0;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--ds-ink);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-brand:hover {
  background: var(--ds-btn-hover);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-brand__mark {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-brand__name {
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-topbar__sep {
  width: 1px;
  height: 18px;
  background: var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-scope,
.restory-ds[data-warm-studio] .ds-project,
.restory-ds[data-warm-studio] .ds-status,
.restory-ds[data-warm-studio] .ds-account {
  position: relative;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-project-slash {
  flex: none;
  margin: 0 -2px;
  color: var(--ds-faint);
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.restory-ds[data-warm-studio] .ds-project {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.restory-ds[data-warm-studio] .ds-project--scoped {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .ds-project__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ds-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-project__trigger:hover,
.restory-ds[data-warm-studio] .ds-project__trigger[aria-expanded="true"] {
  background: var(--ds-panel-2);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-project--scoped .ds-project__trigger {
  padding-right: 4px;
  color: var(--ds-accent);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-project--scoped .ds-project__trigger:hover {
  background: transparent;
}

.restory-ds[data-warm-studio] .ds-project__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-project__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 3px;
  border-radius: 5px;
  color: var(--ds-accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-project__clear:hover {
  background: rgba(25, 100, 86, 0.14);
}

.restory-ds[data-warm-studio] .ds-popover__foot {
  margin: 0;
  padding: 6px 10px;
  color: var(--ds-muted);
  font-size: 12px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-menu-item__count {
  margin-left: auto;
  color: var(--ds-muted);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .ds-scope__trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  height: 30px;
  padding: 0 8px 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--ds-ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-scope__trigger:hover,
.restory-ds[data-warm-studio] .ds-scope__trigger[aria-expanded="true"] {
  border-color: var(--ds-panel-border);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ds-scope__dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-scope__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-scope__chevron,
.restory-ds[data-warm-studio] .ds-account__chevron {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ds-iconbtn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--ds-ink-2);
  font: inherit;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-iconbtn:hover {
  background: var(--ds-btn-hover);
}

.restory-ds[data-warm-studio] .ds-iconbtn--wide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-iconbtn--bordered {
  border-color: var(--ds-panel-border);
  background: var(--ds-panel);
}

/* A rail that is always expanded keeps its toggle where the control has always
   been, published as unavailable instead of disappearing. */
.restory-ds[data-warm-studio] .ds-iconbtn:disabled {
  background: none;
  color: var(--ds-faint);
  cursor: default;
}

.restory-ds[data-warm-studio] .ds-icon {
  width: 17px;
  height: 17px;
  flex: none;
}

.restory-ds[data-warm-studio] .ds-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 5px;
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
}

.restory-ds[data-warm-studio] .ds-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 8px;
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-xs);
  color: var(--ds-muted);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-search:hover {
  border-color: var(--ds-input-border);
}

.restory-ds[data-warm-studio] .ds-search__text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ds-live__dot[data-phase="online"] {
  background: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .ds-live__dot[data-phase="offline"] {
  background: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ds-live__dot[data-phase="unknown"] {
  background: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .ds-live__dot[data-phase="withheld"],
.restory-ds[data-warm-studio] .ds-live__dot[data-phase="unchecked"] {
  background: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ds-live__count {
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid var(--ds-panel-border);
  color: var(--ds-ink-2);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-account__trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 7px 0 3px;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-pill);
  background: none;
  color: var(--ds-ink-2);
  font: inherit;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-account__trigger:hover,
.restory-ds[data-warm-studio] .ds-account__trigger[aria-expanded="true"] {
  border-color: var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ds-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ds-accent);
  color: var(--ds-accent-ink);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Popovers and menus ----------------------------------------------------- */

.restory-ds[data-warm-studio] .ds-popover {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 70;
  display: grid;
  gap: 1px;
  width: max-content;
  min-width: 260px;
  max-width: 340px;
  max-height: min(70dvh, 560px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-lg);
}

.restory-ds[data-warm-studio] .ds-popover--left {
  left: 0;
}

.restory-ds[data-warm-studio] .ds-popover--right {
  right: 0;
}

.restory-ds[data-warm-studio] .ds-popover__label {
  padding: 6px 10px 4px;
  color: var(--ds-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-popover__rule {
  height: 1px;
  margin: 5px 3px;
  background: var(--ds-panel-border);
}

/* Agent Box status facts, counts and bounded previews -------------------- */

.restory-ds[data-warm-studio] .ds-status__facts {
  display: grid;
  gap: 1px;
}

.restory-ds[data-warm-studio] .ds-status__fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 10px;
}

.restory-ds[data-warm-studio] .ds-status__fact-label {
  color: var(--ds-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-status__fact-value {
  overflow: hidden;
  color: var(--ds-ink-2);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-status__counts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 6px 10px;
  border-top: 1px solid var(--ds-panel-border);
  color: var(--ds-ink-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .ds-status__qualifier {
  padding: 1px 6px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-chrome);
  color: var(--ds-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-status__previews {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ds-status__preview {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
}

.restory-ds[data-warm-studio] .ds-status__preview-title {
  overflow: hidden;
  color: var(--ds-ink-2);
  font-size: 13px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-status__preview-title:hover {
  text-decoration: underline;
}

.restory-ds[data-warm-studio] .ds-status__preview-status {
  flex: none;
  color: var(--ds-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-status__preview-status[data-status="running"] {
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .ds-status__preview-status[data-status="interrupted"] {
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .ds-status__cta {
  display: block;
  padding: 7px 10px;
  border-top: 1px solid var(--ds-panel-border);
  color: var(--ds-accent);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-status__cta:hover {
  text-decoration: underline;
}

.restory-ds[data-warm-studio] .ds-menu-group {
  display: grid;
  gap: 1px;
}

.restory-ds[data-warm-studio] .ds-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--ds-ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-menu-item:hover {
  background: var(--ds-chrome);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-menu-item--active {
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-menu-item--disabled {
  color: var(--ds-muted);
  cursor: default;
  opacity: 0.7;
}

.restory-ds[data-warm-studio] .ds-menu-item__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-menu-item__sub {
  display: block;
  overflow: hidden;
  color: var(--ds-muted);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .ds-menu-identity {
  display: grid;
  gap: 2px;
  padding: 5px 9px 7px;
}

.restory-ds[data-warm-studio] .ds-menu-identity__name {
  overflow: hidden;
  color: var(--ds-ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-menu-identity__meta {
  overflow: hidden;
  color: var(--ds-muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rail ------------------------------------------------------------------- */

.restory-ds[data-warm-studio] .pg-rail {
  grid-column: 1;
  grid-row: 2;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 0;
  max-height: none;
  padding: 10px 8px 12px;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-rail__scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
}

.restory-ds[data-warm-studio] .ds-rail__nav {
  display: grid;
  gap: 2px;
}

.restory-ds[data-warm-studio] .ds-rail__group {
  display: grid;
  gap: 2px;
  padding-top: 14px;
}

.restory-ds[data-warm-studio] .ds-rail__group:first-child {
  padding-top: 0;
}

.restory-ds[data-warm-studio] .ds-rail__label {
  padding: 0 10px 4px;
  color: var(--ds-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ds-ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-nav-link__icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ds-nav-link:hover .ds-nav-link__icon {
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-nav-link[aria-current="page"] .ds-nav-link__icon {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-nav-link__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-nav-link--child {
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--ds-muted);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-rail__row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
}

.restory-ds[data-warm-studio] .ds-rail__row > .ds-nav-link {
  grid-column: 1;
}

.restory-ds[data-warm-studio] .ds-rail__disclosure {
  display: grid;
  place-items: center;
  grid-column: 2;
  width: 28px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ds-muted);
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-rail__disclosure:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-rail__disclosure .ds-icon {
  width: 14px;
  height: 14px;
  transition: transform 140ms ease;
}

.restory-ds[data-warm-studio] .ds-rail__disclosure[aria-expanded="true"] .ds-icon {
  transform: rotate(90deg);
}

.restory-ds[data-warm-studio] .ds-rail__children {
  grid-column: 1 / -1;
  display: grid;
  gap: 1px;
  margin: 2px 0 4px 19px;
  padding: 0 0 0 19px;
  border-left: 1px solid var(--ds-panel-border);
  list-style: none;
}

.restory-ds[data-warm-studio] .ds-rail__footer {
  flex: none;
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-rail__back {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: var(--ds-radius-control);
  color: var(--ds-ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-rail__back:hover {
  background: var(--ds-chrome);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-rail__back-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Settings environment badge --------------------------------------------- */

/* One reserved trailing slot on every badge-capable Settings row, so the label
   column keeps a stable edge whether or not the caller supplied a snapshot.
   The slot only ever renders the caller's own projection. */
.restory-ds[data-warm-studio] .ds-nav-link__badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 22px;
  margin-left: auto;
  padding-left: 6px;
}

/* Collapsed rail --------------------------------------------------------- */

html[data-shell-rail="collapsed"] .restory-ds[data-warm-studio] .ds-app {
  grid-template-columns: 58px minmax(0, 1fr);
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail
  .ds-nav-link {
  flex: 0 0 auto;
  width: 40px;
  height: 38px;
  justify-content: center;
  gap: 0;
  padding: 0;
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-nav-link__label,
html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail__label,
html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail__disclosure,
html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail__children,
html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail__back-label {
  display: none;
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail__row {
  grid-template-columns: minmax(0, 1fr);
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail__group {
  padding-top: 10px;
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-rail__back {
  justify-content: center;
  padding: 6px;
}

/* The collapsed rail hides its own labels and disclosures, while the flyout
   anchored to a row keeps full labels and normal link rhythm. */
html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-flyout
  .ds-nav-link {
  flex: 1 1 auto;
  width: auto;
  height: 32px;
  justify-content: flex-start;
  gap: 8px;
  padding: 7px 9px;
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-flyout
  .ds-nav-link__label {
  display: inline;
}

/* The collapsed rail keeps each environment status spoken but drops the pill,
   so a 40px row never has to carry a visible count. */
html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-nav-link__badge {
  min-width: 0;
  padding-left: 0;
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-nav-link__badge
  .ds-badge {
  display: none;
}

/* Flyout (collapsed rail only) ------------------------------------------- */

.restory-ds[data-warm-studio] .ds-flyout {
  display: none;
}

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app
  .ds-flyout:not([hidden]) {
  display: grid;
  gap: 2px;
  position: fixed;
  left: 62px;
  top: var(--flyout-top, 96px);
  z-index: 55;
  min-width: 208px;
  padding: 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-lg);
}

.restory-ds[data-warm-studio] .ds-flyout__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 4px;
  color: var(--ds-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-flyout__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Files panel ------------------------------------------------------------ */

html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app.files-open {
  grid-template-columns: 58px 270px minmax(0, 1fr);
}

.restory-ds[data-warm-studio] .ds-app.files-open .ds-main {
  grid-column: 3;
}

.restory-ds[data-warm-studio] .ds-files {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: auto;
  overflow: hidden;
  border-right: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ds-files__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-files__title {
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-files__body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 8px;
}

/* Alerts drawer ---------------------------------------------------------- */

.restory-ds[data-warm-studio] .ds-drawer[hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .ds-drawer {
  position: fixed;
  top: 44px;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: 620px;
  max-width: calc(100vw - 48px);
  min-width: 0;
  border-left: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-lg);
}

.restory-ds[data-warm-studio] .ds-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ds-drawer__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .ds-drawer__title:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.restory-ds[data-warm-studio] .ds-drawer__body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 24px 28px;
}

/* Search palette --------------------------------------------------------- */

.restory-ds[data-warm-studio] .ds-palette {
  position: fixed;
  top: 84px;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-lg);
  color: var(--ds-ink);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-palette::backdrop {
  background: rgba(26, 32, 38, 0.28);
}

.restory-ds[data-warm-studio] .ds-palette__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-palette__input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ds-ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.restory-ds[data-warm-studio] .ds-palette > .ds-body {
  padding: 8px 16px;
}

/* Rail and top bar at narrow widths -------------------------------------- */

@media (max-width: 900px) {
  .restory-ds[data-warm-studio] .ds-topbar {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 220px) minmax(0, auto);
    gap: 8px;
    padding: 0 8px;
  }

  /* The mark alone carries the brand; the switcher keeps its label and the
     search collapses to its icon and key hint. */
  .restory-ds[data-warm-studio] .ds-brand__name,
  .restory-ds[data-warm-studio] .ds-search__text,
  .restory-ds[data-warm-studio] .ds-search .ds-kbd,
  .restory-ds[data-warm-studio] .ds-iconbtn__text,
  .restory-ds[data-warm-studio] .ds-iconbtn .ds-kbd,
  .restory-ds[data-warm-studio] .ds-live__label {
    display: none;
  }

  .restory-ds[data-warm-studio] .ds-topbar__left,
  .restory-ds[data-warm-studio] .ds-topbar__right {
    gap: 4px;
  }

  .restory-ds[data-warm-studio] .ds-scope {
    min-width: 0;
  }

  .restory-ds[data-warm-studio] .ds-files,
  .restory-ds[data-warm-studio] .ds-drawer {
    width: min(320px, calc(100vw - 24px));
  }
}

/* ============================================================================
   Journeys portfolio and Canonical Surfaces tab
   ============================================================================

   Scoped to `.journeys-screen`; the shell, Home, Setup, Storage, GitHub,
   provider, approvals and search-key blocks above are untouched. Tabs and
   filters reuse the shared `.ws-list-*` chrome, including the list header's
   tab strip. Journey detail (`data-journey-detail`) keeps the same screen
   scope so badges and IDs read the same as the portfolio. */

.restory-ds[data-warm-studio] .journeys-screen {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 1360px;
}

/* The shared search input is `type="search"`; the screen already renders one
   explicit clear control, so suppress the native WebKit cancel affordance. */
.restory-ds[data-warm-studio] .journeys-screen .ws-list-search__input::-webkit-search-cancel-button,
.restory-ds[data-warm-studio] .journeys-screen .ws-list-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.restory-ds[data-warm-studio] .journeys-screen .ws-list-frame__scroll {
  padding: 0;
}

.restory-ds[data-warm-studio] .journeys-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.restory-ds[data-warm-studio] .journeys-table th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .journeys-table th:first-child,
.restory-ds[data-warm-studio] .journeys-table td:first-child {
  padding-left: 20px;
}

.restory-ds[data-warm-studio] .journeys-table th:last-child,
.restory-ds[data-warm-studio] .journeys-table td:last-child {
  padding-right: 20px;
}

.restory-ds[data-warm-studio] .journeys-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ds-panel-border);
  color: var(--ds-ink-2);
  vertical-align: top;
}

.restory-ds[data-warm-studio] .journeys-table tbody tr:last-child td {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .journeys-table tbody tr:hover td {
  background: var(--ds-chrome);
}

/* Right-aligned tabular numbers; IDs and route patterns stay in the mono face. */
.restory-ds[data-warm-studio] .journeys-cell--num {
  font-family: var(--ds-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .journeys-num {
  font-family: var(--ds-mono);
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .journeys-id {
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .journeys-row-title {
  display: block;
  color: var(--ds-ink);
  font-weight: 600;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .journeys-actor {
  display: block;
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .journeys-row-meta {
  display: block;
  margin-top: 3px;
  color: var(--ds-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .journeys-table .ds-badge {
  margin-top: 4px;
}

.restory-ds[data-warm-studio] .journeys-table td:first-child .ds-badge {
  margin-left: 4px;
}

.restory-ds[data-warm-studio] .journeys-table .journeys-row-meta .ds-badge {
  margin-top: 0;
}

.restory-ds[data-warm-studio] .journeys-shared {
  margin: 0 4px 2px 0;
}

/* Balance the surfaces title column against the short route-pattern column. */
.restory-ds[data-warm-studio] .journeys-table--surfaces td:first-child,
.restory-ds[data-warm-studio] .journeys-table--surfaces th:first-child {
  min-width: 360px;
}

.restory-ds[data-warm-studio] .journeys-table--surfaces th:nth-child(2),
.restory-ds[data-warm-studio] .journeys-table--surfaces td:nth-child(2) {
  width: 22%;
}

.restory-ds[data-warm-studio] .journeys-table--surfaces td:nth-child(2) {
  overflow-wrap: anywhere;
}

/* The base `.ds-badge` has no dot; this screen declares the shared matte dot. */
.restory-ds[data-warm-studio] .journeys-screen .ds-badge__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--ds-radius-pill);
  background: currentColor;
}

/* ============================================================================
   Journey detail (`:show`)
   ============================================================================

   Header, ordered step strip, selected-step inspector, seam ledger and graph
   context. Scoped to the same `.journeys-screen` surface so badges, IDs and
   panel chrome read exactly as they do on the portfolio. */

.restory-ds[data-warm-studio] .journey-detail {
  gap: 16px;
}

.restory-ds[data-warm-studio] .journey-detail__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .journey-detail__crumb-sep {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .journey-detail__head {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
}

.restory-ds[data-warm-studio] .journey-detail__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 24px;
  line-height: 1.2;
}

.restory-ds[data-warm-studio] .journey-detail__badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.restory-ds[data-warm-studio] .journey-detail__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 20px;
  margin: 0;
}

.restory-ds[data-warm-studio] .journey-detail__meta-item {
  min-width: 0;
}

.restory-ds[data-warm-studio] .journey-detail__meta-item dt {
  color: var(--ds-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .journey-detail__meta-item dd {
  margin: 2px 0 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Horizontal step strip: long journeys scroll instead of wrapping. */
.restory-ds[data-warm-studio] .journey-step-strip {
  display: flex;
  gap: 10px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.restory-ds[data-warm-studio] .journey-step {
  display: grid;
  flex: 0 0 190px;
  gap: 3px;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  text-align: left;
  text-decoration: none;
}

.restory-ds[data-warm-studio] a.journey-step:not(.journey-step--current):hover {
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .journey-step:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
}

.restory-ds[data-warm-studio] .journey-step--current {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  box-shadow: inset 0 0 0 1px var(--ds-selection-border);
}

.restory-ds[data-warm-studio] .journey-step--inert {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .journey-step__num {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .journey-step__label {
  color: var(--ds-ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}

.restory-ds[data-warm-studio] .journey-step__route,
.restory-ds[data-warm-studio] .journey-step__seam {
  overflow: hidden;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .journey-step__seam {
  color: var(--ds-waypoint-fg);
}

/* Inspector + side column. */
.restory-ds[data-warm-studio] .journey-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.restory-ds[data-warm-studio] .journey-detail__side {
  display: grid;
  gap: 16px;
}

.restory-ds[data-warm-studio] .journey-inspector,
.restory-ds[data-warm-studio] .journey-seams,
.restory-ds[data-warm-studio] .journey-context {
  padding: 18px 20px;
}

.restory-ds[data-warm-studio] .journey-inspector__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .journey-inspector__identity {
  flex: 1 1 auto;
  min-width: 0;
}

.restory-ds[data-warm-studio] .journey-inspector__title,
.restory-ds[data-warm-studio] .journey-panel__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .journey-panel__title {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.restory-ds[data-warm-studio] .journey-inspector__fields,
.restory-ds[data-warm-studio] .journey-context__fields {
  display: grid;
  gap: 0;
  margin: 6px 0 0;
}

.restory-ds[data-warm-studio] .journey-field {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .journey-field:last-child {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .journey-field__label {
  color: var(--ds-muted);
  font-size: 12px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .journey-field__value {
  margin: 0;
  min-width: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .journey-surface {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.restory-ds[data-warm-studio] .journey-surface__name {
  color: var(--ds-ink);
  font-weight: 600;
}

/* Seam ledger. */
.restory-ds[data-warm-studio] .journey-seam-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .journey-seam {
  padding: 10px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .journey-seam__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.restory-ds[data-warm-studio] .journey-seam__head .ds-badge {
  margin: 0;
}

.restory-ds[data-warm-studio] .journey-seam__journey {
  margin: 5px 0 0;
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .journey-seam__crossing {
  margin: 4px 0 0;
  color: var(--ds-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

/* Graph context links keep the mono ID face. */
.restory-ds[data-warm-studio] .journey-context__links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.restory-ds[data-warm-studio] .journey-context__links a {
  color: var(--ds-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 1080px) {
  .restory-ds[data-warm-studio] .journeys-screen {
    max-width: 100%;
  }

  .restory-ds[data-warm-studio] .journey-detail__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================================
   Features triage list
   ============================================================================

   The routed Features screen composes the shared list chrome above. Every
   card and row frame is a uniform four-sided 1px border from one token family;
   only the row separator inside a frame is a single hairline. Stage segments
   are the owner's four-stage pipeline: done, running, blocked, unknown and
   pending are states, never colors alone (each segment keeps its label). */

.restory-ds[data-warm-studio] .features {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-stack {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.restory-ds[data-warm-studio] .features-section__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.restory-ds[data-warm-studio] .features-section__meta {
  color: var(--ds-faint);
  font-size: 12px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .features-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--ds-line-2);
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .features-count--needs_decision {
  border-color: var(--ds-list-decision-border);
  background: var(--ds-waypoint-bg);
  color: var(--ds-waypoint-fg);
}

.restory-ds[data-warm-studio] .features-count--running {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-muted);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .features-pulse__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ds-faint);
  font-size: 11px;
}

.restory-ds[data-warm-studio] .features-legend__label {
  font-family: var(--ds-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .features-legend__key {
  display: inline-flex;
  gap: 8px;
}

.restory-ds[data-warm-studio] .features-legend__dot {
  color: var(--ds-muted);
}

/* Recently generated shelf ------------------------------------------------- */

.restory-ds[data-warm-studio] .features-recent {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.restory-ds[data-warm-studio] .features-recent-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 12px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .features-recent-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.restory-ds[data-warm-studio] .features-recent-card__title {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .features-recent-card__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .features-recent-card__stage {
  font-family: var(--ds-mono);
  font-size: 11px;
}

/* Rows --------------------------------------------------------------------- */

.restory-ds[data-warm-studio] .features-rows {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .features-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px 16px;
  padding: 12px 14px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-row + .features-row {
  border-top: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .features-row--archive {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.restory-ds[data-warm-studio] .features-row:hover {
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .features-row__main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-row__title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-title {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.32;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] a.features-title:hover {
  color: var(--ds-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.restory-ds[data-warm-studio] .features-pill {
  padding: 1px 7px;
  border: 1px solid var(--ds-line-2);
  border-radius: 999px;
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .features-pill--decision {
  border-color: var(--ds-list-decision-border);
  background: var(--ds-waypoint-bg);
  color: var(--ds-waypoint-fg);
}

.restory-ds[data-warm-studio] .features-pill--ready {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  color: var(--ds-faint);
  font-size: 12px;
  line-height: 1.4;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-parent {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}

.restory-ds[data-warm-studio] .features-origin {
  font-family: var(--ds-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .features-sep {
  color: var(--ds-line-2);
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ds-control-border-hover);
  color: transparent;
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .features-stage {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.restory-ds[data-warm-studio] .features-stage__seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: 1px solid var(--ds-line-2);
  border-radius: 5px;
  background: transparent;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.restory-ds[data-warm-studio] .features-stage__seg--done {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-stage__seg--running {
  border-color: var(--ds-accent);
  background: var(--ds-accent);
  color: var(--ds-accent-ink);
}

.restory-ds[data-warm-studio] .features-stage__seg--blocked {
  border-color: var(--ds-waypoint-border);
  background: var(--ds-waypoint-bg);
  color: var(--ds-waypoint-fg);
}

.restory-ds[data-warm-studio] .features-stage__seg--unknown {
  border-style: dashed;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .features-readiness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-muted);
  font-size: 12px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .features-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ds-faint);
}

.restory-ds[data-warm-studio] .features-dot--ready {
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-dot--waiting_on_deps {
  background: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .features-dot--unknown {
  background: var(--ds-line-2);
}

.restory-ds[data-warm-studio] .features-row__foot {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .features-archive {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .features-archive__pr {
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .features-time {
  color: var(--ds-faint);
  font-variant-numeric: tabular-nums;
}

/* Reveal bar --------------------------------------------------------------- */

.restory-ds[data-warm-studio] .features-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 10px;
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .features-more__caption {
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .features-more__button {
  font-size: 12px;
}

@media (max-width: 1080px) {
  .restory-ds[data-warm-studio] .features-recent {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .features-row,
  .restory-ds[data-warm-studio] .features-row--archive {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .features-row__foot,
  .restory-ds[data-warm-studio] .features-archive {
    justify-content: flex-start;
  }
}

/* The routed search field draws its own clear control, so the platform's
   second cancel affordance stays hidden for this screen only. */
.restory-ds[data-warm-studio] .features .ws-list-search__input::-webkit-search-cancel-button,
.restory-ds[data-warm-studio] .features .ws-list-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.restory-ds[data-warm-studio] .features-skeleton {
  display: grid;
  gap: 22px;
  padding-top: 4px;
}

.restory-ds[data-warm-studio] .features-skeleton__group {
  display: grid;
  gap: 10px;
}

.restory-ds[data-warm-studio] .features-skeleton__head {
  width: 168px;
  height: 12px;
  border-radius: 6px;
}

.restory-ds[data-warm-studio] .features-skeleton__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .features-skeleton__bar {
  flex: 1 1 auto;
  max-width: 320px;
  height: 10px;
  border-radius: 5px;
}

.restory-ds[data-warm-studio] .features-skeleton__segs {
  flex: 0 0 auto;
  width: 132px;
  height: 10px;
  border-radius: 5px;
}


/* ============================================================================
   Features inspection drawer

   The drawer is the shared native `ws-list-dialog--drawer` panel: the browser
   owns the top layer, the backdrop, inertness and focus containment, and the
   `WarmStudioDialog` hook owns open/close. This block only styles what the
   Features consumer puts inside it — the four-stage stepper, the decision and
   pull-request callouts, the meta card and the lifecycle log — and it makes the
   triage row and the shelf card real buttons so a whole row is one opener.

   Every rule is scoped under `.features` or the Features drawer id, so no other
   list screen inherits a Features layout.
   ============================================================================ */

/* A row is a button, so the dialog hook can return focus to the opener. */
.restory-ds[data-warm-studio] .features-row-item {
  display: block;
  min-width: 0;
}

.restory-ds[data-warm-studio] button.features-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] button.features-row:focus-visible,
.restory-ds[data-warm-studio] button.features-recent-card:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
  border-radius: 10px;
}

.restory-ds[data-warm-studio] .features .features-row-item + .features-row-item button.features-row {
  border-top: 1px solid var(--ds-line);
}

/* Backlog rows pair the dialog opener with the one start action beside it, so
   the reference's feature / readiness / action columns hold for a queued row.
   The opener is a sibling of the action, never a parent of it. */
.restory-ds[data-warm-studio] .features-rows--backlog .features-row {
  grid-template-columns: minmax(0, 1fr) 140px;
}

.restory-ds[data-warm-studio] .features .features-rows--backlog .features-row-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  gap: 6px 16px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features .features-rows--backlog .features-row-item + .features-row-item {
  border-top: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio]
  .features .features-rows--backlog .features-row-item + .features-row-item button.features-row {
  border-top: 0;
}

.restory-ds[data-warm-studio] .features-backlog-act {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 128px;
  padding: 12px 14px 12px 0;
}

.restory-ds[data-warm-studio] .features-backlog-act .ds-btn--sm {
  height: 30px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .features-backlog-act__start {
  min-width: 0;
  white-space: nowrap;
}

/* The reference pairs a queued title with a monospace repository chip. */
.restory-ds[data-warm-studio] .features-origin-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-origin[data-features-origin-chip] {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-badge);
  background: var(--ds-chrome);
  color: var(--ds-ink-2);
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow-wrap: normal;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-origin:not([data-features-origin-chip]) {
  font-family: inherit;
  font-size: 12px;
  color: var(--ds-faint);
  overflow-wrap: normal;
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-row__meta {
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-parent {
  max-width: 440px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .features-backlog-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 14px 10px;
  color: var(--ds-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .features-backlog-note--ok {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-backlog-note--warn {
  color: var(--ds-waypoint-fg);
}

/* Backlog draws one framed queue: a column head, the rows and a foot that
   states the cap. The head repeats the row columns so the references line up. */
.restory-ds[data-warm-studio] .features-backlog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 128px;
  align-items: center;
  gap: 0 16px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-faint);
  font-size: 12px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .features-backlog-head > span:nth-child(3) {
  text-align: right;
}

.restory-ds[data-warm-studio] .features-backlog-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--ds-line);
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .features-backlog-foot__back {
  color: var(--ds-accent);
  font-weight: 600;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .features-backlog-foot__back:hover {
  text-decoration: underline;
}

/* A queued row states readiness as a badge in the reference's second column. */
.restory-ds[data-warm-studio] .features-rows--backlog .features-readiness {
  justify-content: center;
  justify-self: start;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-badge);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-readiness .features-dot {
  display: none;
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-readiness--ready {
  border-color: color-mix(in srgb, var(--ds-accent) 22%, transparent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-readiness--waiting_on_deps {
  border-color: var(--ds-panel-border);
  background: var(--ds-btn-hover);
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .features-rows--backlog .features-readiness--unknown {
  border-color: var(--ds-panel-border);
  background: var(--ds-btn-hover);
  color: var(--ds-muted);
}

/* The backlog toolbar is one row: search, repository pills, then the summary.
   Scope-guarded so the active lifecycle bar keeps its own layout. */
.restory-ds[data-warm-studio] .features[data-features-scope="backlog"] .ws-list-utility {
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  align-items: center;
}

.restory-ds[data-warm-studio] .features[data-features-scope="backlog"] .ws-list-legend {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.restory-ds[data-warm-studio] .features-backlog-tools {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-backlog-summary {
  margin-left: auto;
  color: var(--ds-faint);
  font-size: 12px;
  white-space: nowrap;
}

/* The repository pills scope the backlog inventory only. */
.restory-ds[data-warm-studio] .features-repos {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
}

.restory-ds[data-warm-studio] .features-repo {
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .features-repo:hover {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-repo--active {
  background: var(--ds-selection-bg);
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .features-repo:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

/* The reference drawer is a full-height panel flush to the right edge, not the
   shared floating card, so this consumer pins its own frame. Everything else
   (top layer, backdrop, inertness, focus containment) is still the browser's. */
.restory-ds[data-warm-studio] #features-drawer[open] {
  width: min(476px, 100vw);
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border: 0;
  border-left: 1px solid var(--ds-panel-border);
  border-radius: 0;
}

.restory-ds[data-warm-studio] #features-drawer::backdrop {
  background: rgba(26, 32, 38, 0.22);
}

.restory-ds[data-warm-studio] #features-drawer .ws-list-dialog__head {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] #features-drawer .ws-list-dialog__body {
  padding: 18px 22px 24px;
}

.restory-ds[data-warm-studio] #features-drawer .ws-list-dialog__description {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .features-drawer {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.restory-ds[data-warm-studio] .features-drawer__pill {
  border-radius: 999px;
}

.restory-ds[data-warm-studio] .features-drawer__pill--needs_decision {
  background: var(--ds-waypoint-bg);
  border-color: rgba(196, 91, 44, 0.28);
  color: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .features-drawer__pill--ready_to_merge,
.restory-ds[data-warm-studio] .features-drawer__pill--merged {
  background: var(--ds-status-success-bg);
  border-color: var(--ds-status-success-border);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .features-drawer__pill--running {
  background: var(--ds-status-info-bg);
  border-color: var(--ds-status-info-border);
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .features-drawer__pill--planning,
.restory-ds[data-warm-studio] .features-drawer__pill--backlog {
  background: var(--ds-status-neutral-bg);
  border-color: var(--ds-status-neutral-border);
  color: var(--ds-status-neutral-fg);
}

.restory-ds[data-warm-studio] .features-drawer__repo {
  font-family: var(--ds-mono);
  font-size: 11.5px;
  color: var(--ds-muted);
  padding: 1px 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 6px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .features-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .features-stepper__node {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-stepper__bar {
  height: 6px;
  border-radius: 3px;
  background: var(--ds-line-2);
}

.restory-ds[data-warm-studio] .features-stepper__bar--done {
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .features-stepper__bar--running {
  background: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .features-stepper__bar--blocked {
  background: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .features-stepper__bar--unknown {
  background: repeating-linear-gradient(
    90deg,
    var(--ds-line-2) 0 4px,
    transparent 4px 8px
  );
}

.restory-ds[data-warm-studio] .features-stepper__label {
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .features-stepper__state {
  font-size: 11.5px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .features-callout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid rgba(196, 91, 44, 0.28);
  border-radius: var(--ds-radius-control);
  background: var(--ds-waypoint-bg);
}

.restory-ds[data-warm-studio] .features-callout--pr {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
}

.restory-ds[data-warm-studio] .features-callout__title {
  font-size: 13px;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .features-callout__body,
.restory-ds[data-warm-studio] .features-callout__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .features-callout__note {
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .features-callout__blockers {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .features-callout__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.restory-ds[data-warm-studio] .features-callout__feedback {
  margin: 0;
  padding-top: 2px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .features-callout__feedback--warn {
  color: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .features-meta-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .features-meta-card dt {
  color: var(--ds-faint);
  font-weight: 500;
}

.restory-ds[data-warm-studio] .features-meta-card dd {
  margin: 0;
  min-width: 0;
  color: var(--ds-ink);
  font-weight: 500;
}

.restory-ds[data-warm-studio] .features-meta-card__mono {
  font-family: var(--ds-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .features-drawer__subtitle {
  margin: 0 0 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .features-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .features-log__item {
  padding: 10px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .features-log__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .features-log__time {
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .features-log__empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--ds-muted);
}

@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .features-meta-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ============================================================================
   Add-feature dialog
   ============================================================================

   The modal reuses the shared `ws-list-dialog--modal` frame; only its measure,
   body rhythm and footer surface follow the Add-feature reference. Every
   control, note and the panel itself keep one uniform four-sided border from
   the control-fill token family, and the footer reads Cancel-then-create even
   though the shared component appends its own cancel last. */

.restory-ds[data-warm-studio] #features-create[open] {
  width: min(500px, calc(100vw - 32px));
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] #features-create .ws-list-dialog__head {
  align-items: center;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] #features-create .ws-list-dialog__body {
  padding: 18px 24px;
}

.restory-ds[data-warm-studio] #features-create .ws-list-dialog__footer {
  padding: 14px 24px 18px;
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] #features-create .ws-list-dialog__close {
  order: -1;
}

.restory-ds[data-warm-studio] .features-create {
  display: grid;
  gap: 15px;
  margin: 0;
}

.restory-ds[data-warm-studio] .features-create__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-create__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-create__label {
  color: var(--ds-ink);
  font-size: 13px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .features-create__hint {
  color: var(--ds-faint);
  font-size: 12px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .features-create__textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .features-create__feedback,
.restory-ds[data-warm-studio] .features-create-note {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--ds-status-warn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 12.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .features-create__feedback--ok,
.restory-ds[data-warm-studio] .features-create-note--ok {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .features-create-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.restory-ds[data-warm-studio] .features-create-note__text {
  margin: 0;
  min-width: 0;
}

.restory-ds[data-warm-studio] .features-create-note__dismiss {
  flex: none;
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
}

/* ============================================================================
   Designs gallery and package list
   ============================================================================

   The routed Designs screen composes the shared list chrome above. Package
   previews sit on the one recessed warm stone stage the list system owns; every
   card and row frame is a uniform four-sided 1px border from one token family.
   Readiness is a labelled pill, never a colour alone, and a package without a
   capture keeps a typographic placeholder instead of an invented image. */

.restory-ds[data-warm-studio] .designs {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-stack {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}

.restory-ds[data-warm-studio] .designs-section__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.restory-ds[data-warm-studio] .designs-section__meta {
  color: var(--ds-faint);
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

/* The routed search keeps one clear control: the styled one, not the browser's
   native search cancel alongside it. */
.restory-ds[data-warm-studio] .designs .ws-list-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.restory-ds[data-warm-studio] .designs-count {
  color: var(--ds-faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-muted);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .designs-pulse__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.restory-ds[data-warm-studio] .designs-pulse__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.restory-ds[data-warm-studio] .designs-pulse__dot--ready {
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .designs-pulse__dot--linked {
  background: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .designs-pulse__sep {
  color: var(--ds-line-2);
}

/* Four-up studio gallery ---------------------------------------------------- */

.restory-ds[data-warm-studio] .designs-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.restory-ds[data-warm-studio] .designs-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: 14px;
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.restory-ds[data-warm-studio] .designs-card:hover {
  transform: translateY(-2px);
  border-color: var(--ds-control-border-hover);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .designs-card__stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 158px;
  padding: 14px 14px 0;
  overflow: hidden;
  background: var(--ds-status-neutral-bg);
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .designs-card__badge {
  position: absolute;
  top: 9px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--ds-radius-pill);
  background: rgba(26, 32, 38, 0.72);
  color: #f7f4ee;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.restory-ds[data-warm-studio] .designs-card__mini {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 142px;
  overflow: hidden;
  border: 1px solid rgba(26, 32, 38, 0.14);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--ds-canvas);
  box-shadow: var(--ds-shadow-xs);
  transition: transform 0.2s ease;
}

.restory-ds[data-warm-studio] .designs-card:hover .designs-card__mini {
  transform: translateY(-2px);
}

.restory-ds[data-warm-studio] .designs-card__chrome {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  height: 14px;
  padding: 0 7px;
  background: var(--ds-chrome);
  border-bottom: 1px solid rgba(26, 32, 38, 0.08);
}

.restory-ds[data-warm-studio] .designs-card__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(26, 32, 38, 0.2);
}

.restory-ds[data-warm-studio] .designs-card__url {
  margin-left: 5px;
  width: 46%;
  height: 6px;
  border-radius: 3px;
  background: rgba(26, 32, 38, 0.08);
}

.restory-ds[data-warm-studio] .designs-card__viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .designs-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.restory-ds[data-warm-studio] .designs-card__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .designs-card__initial {
  font-family: var(--ds-display);
  font-size: 26px;
  font-weight: 650;
  color: var(--ds-control-border-hover);
  line-height: 1;
}

.restory-ds[data-warm-studio] .designs-card__placeholder-label {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.restory-ds[data-warm-studio] .designs-card__foot {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 13px 15px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .designs-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 38px;
  margin: 0;
  color: var(--ds-ink);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .designs-card__summary {
  margin: 0;
  overflow: hidden;
  color: var(--ds-muted);
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .designs-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--ds-line);
  color: var(--ds-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .designs-card__meta-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-card__capture {
  overflow: hidden;
  color: var(--ds-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .designs-card__date {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Readiness pills ----------------------------------------------------------- */

.restory-ds[data-warm-studio] .designs-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--ds-radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-pill__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .designs-pill--ready,
.restory-ds[data-warm-studio] .designs-pill--linked {
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .designs-pill--produced {
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .designs-pill--progress {
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .designs-pill--neutral {
  background: var(--ds-status-neutral-bg);
  color: var(--ds-muted);
}

/* Framed package table ------------------------------------------------------ */

.restory-ds[data-warm-studio] .designs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.restory-ds[data-warm-studio] .designs-table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-faint);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-table__design {
  width: 49%;
}

.restory-ds[data-warm-studio] .designs-table th.designs-table__num,
.restory-ds[data-warm-studio] .designs-table td.designs-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-table tbody tr {
  border-top: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .designs-table tbody tr:first-child {
  border-top: 0;
}

.restory-ds[data-warm-studio] .designs-table tbody tr:hover {
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .designs-table td {
  padding: 10px 16px;
  vertical-align: middle;
}

.restory-ds[data-warm-studio] .designs-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 88px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--ds-panel-border);
  border-radius: 7px;
  background: var(--ds-status-neutral-bg);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .designs-thumb__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.restory-ds[data-warm-studio] .designs-card__image[hidden],
.restory-ds[data-warm-studio] .designs-thumb__image[hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .designs-thumb__initial {
  font-family: var(--ds-display);
  font-size: 18px;
  font-weight: 650;
  color: var(--ds-control-border-hover);
}

.restory-ds[data-warm-studio] .designs-row__text {
  flex: 1;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.restory-ds[data-warm-studio] .designs-row__title {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .designs-row__slug {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .designs-row__summary {
  max-width: 62ch;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ds-muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .designs-screens {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .designs-screens__icon {
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .designs-screens__icon--complete {
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .designs-screens__icon--partial {
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .designs-used {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.restory-ds[data-warm-studio] .designs-used--empty {
  color: var(--ds-faint);
  opacity: 0.55;
  font-size: 14px;
}

.restory-ds[data-warm-studio] .designs-used__chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-row__date {
  color: var(--ds-muted);
  font-size: 13px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--ds-line);
  background: var(--ds-chrome);
  color: var(--ds-faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* Design workflow skills catalog -------------------------------------------

   The Skills tab reuses the shared utility bar and the one recessed list frame.
   Rows are separated by a single hairline and carry a soft mineral swatch per
   category, a monospace skill id, a neutral category pill, one description line
   and the quiet Run skill control. */

.restory-ds[data-warm-studio] .designs-skills {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* This tab has no filters or sort, so the search field and the count share one
   line the way the reference lays them out. */
.restory-ds[data-warm-studio] #designs-skills-utility {
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  align-items: center;
}

/* The frame's shared inset is cancelled here so the row hairlines reach the
   frame edge while every row keeps its own inset text. */
.restory-ds[data-warm-studio] .designs-skills__list {
  display: grid;
  margin: -8px -10px;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .designs-skill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border-top: 1px solid var(--ds-line);
  transition: background 0.12s ease;
}

.restory-ds[data-warm-studio] .designs-skill:first-child {
  border-top: 0;
}

.restory-ds[data-warm-studio] .designs-skill:hover {
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .designs-skill__main {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-skill__swatch {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.restory-ds[data-warm-studio] .designs-skill__swatch svg {
  width: 16px;
  height: 16px;
}

.restory-ds[data-warm-studio] .designs-skill__swatch--sage {
  background: var(--ds-artifact-sage);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .designs-skill__swatch--sky {
  background: var(--ds-artifact-sky);
  color: #24578a;
}

.restory-ds[data-warm-studio] .designs-skill__swatch--lilac {
  background: var(--ds-artifact-lilac);
  color: #543d8a;
}

.restory-ds[data-warm-studio] .designs-skill__swatch--sand {
  background: var(--ds-artifact-sand);
  color: #845512;
}

.restory-ds[data-warm-studio] .designs-skill__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-skill__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .designs-skill__name {
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .designs-skill__category {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-skill__desc {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-skill__action {
  display: flex;
  align-items: center;
}

.restory-ds[data-warm-studio] .designs-skills-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 44px 24px;
  text-align: center;
}

.restory-ds[data-warm-studio] .designs-skills-empty__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .designs-skills-empty__body {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-skills__feedback {
  display: grid;
  gap: 6px;
}

.restory-ds[data-warm-studio] .designs-skills__answer,
.restory-ds[data-warm-studio] .designs-skills__offline {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-skills__answer {
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .designs-skills__offline {
  color: var(--ds-faint);
}

@media (max-width: 860px) {
  .restory-ds[data-warm-studio] .designs-skill {
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
  }
}

/* Empty workspace launch and delayed skeleton ------------------------------- */

.restory-ds[data-warm-studio] .designs-launch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.restory-ds[data-warm-studio] .designs-launch__answer {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-launch__offline {
  margin: 0;
  color: var(--ds-faint);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-skeleton {
  display: grid;
  gap: 14px;
  width: 100%;
}

.restory-ds[data-warm-studio] .designs-skeleton__gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.restory-ds[data-warm-studio] .designs-skeleton--static {
  visibility: hidden;
  animation: designs-show-skeleton 0s 300ms forwards;
}

@keyframes designs-show-skeleton {
  to { visibility: visible; }
}

.restory-ds[data-warm-studio] .designs-skeleton__card {
  height: 210px;
  border-radius: 12px;
}

.restory-ds[data-warm-studio] .designs-skeleton__head {
  width: 32%;
  height: 14px;
  border-radius: 7px;
}

.restory-ds[data-warm-studio] .designs-skeleton__row {
  height: 44px;
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .restory-ds[data-warm-studio] .designs-gallery,
  .restory-ds[data-warm-studio] .designs-skeleton__gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .restory-ds[data-warm-studio] .designs-gallery,
  .restory-ds[data-warm-studio] .designs-skeleton__gallery {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .designs-row__summary {
    max-width: 34ch;
  }
}

/* Design preview drawer ----------------------------------------------------- */

/* The reference drawer is a full-height panel flush to the right edge rather
   than the shared floating card, so this consumer pins its own frame. Top
   layer, backdrop, background inertness and focus containment stay the
   browser's. */
.restory-ds[data-warm-studio] #designs-drawer[open] {
  width: min(500px, 100vw);
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border: 0;
  border-left: 1px solid var(--ds-panel-border);
  border-radius: 0;
}

.restory-ds[data-warm-studio] #designs-drawer::backdrop {
  background: rgba(26, 32, 38, 0.22);
}

.restory-ds[data-warm-studio] #warm-studio-main:has(#designs-drawer[open]) {
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.restory-ds[data-warm-studio] #designs-drawer .ws-list-dialog__head {
  padding-top: 12px;
}

.restory-ds[data-warm-studio] #designs-drawer .ws-list-dialog__body {
  padding: 12px 22px;
}

.restory-ds[data-warm-studio] #designs-drawer .ws-list-dialog__footer {
  padding-block: 8px;
}

.restory-ds[data-warm-studio] #designs-drawer .ws-list-dialog__description {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Add-design dialog --------------------------------------------------------- */

/* The list's create modal is separate from the inspection drawer and follows
   the reference's compact 468px panel. The shared component appends Cancel
   last, so the footer keeps the visual and sequential Cancel-then-create
   order. */
.restory-ds[data-warm-studio] #designs-create-dialog[open] {
  width: min(468px, calc(100vw - 32px));
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] #designs-create-dialog::backdrop {
  background: rgba(28, 30, 28, 0.48);
}

.restory-ds[data-warm-studio] #designs-create-dialog .ws-list-dialog__head {
  align-items: center;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] #designs-create-dialog .ws-list-dialog__body {
  padding: 18px 24px;
}

.restory-ds[data-warm-studio] #designs-create-dialog .ws-list-dialog__footer {
  padding: 14px 24px 18px;
  background: var(--ds-chrome);
  reading-flow: flex-visual;
}

.restory-ds[data-warm-studio] .designs-dialog-primary {
  order: 1;
}

.restory-ds[data-warm-studio] .designs-create {
  display: grid;
  gap: 15px;
  margin: 0;
}

.restory-ds[data-warm-studio] .designs-create__field {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.restory-ds[data-warm-studio] .designs-create__label {
  padding: 0;
  color: var(--ds-ink);
  font-size: 13px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .designs-create__input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  color: var(--ds-ink);
  font: inherit;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .designs-create__input:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .designs-create__directory {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: var(--ds-faint);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .designs-create__slug {
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .designs-create__choices {
  display: grid;
  gap: 8px;
}

.restory-ds[data-warm-studio] .designs-create__choices--type {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.restory-ds[data-warm-studio] .designs-create__choices--posture {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.restory-ds[data-warm-studio] .designs-create__choice {
  padding: 7px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font: inherit;
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .designs-create__choice:hover:not(:disabled) {
  border-color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .designs-create__choice--selected {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .designs-create__choice:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.restory-ds[data-warm-studio] .designs-create__choice:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .designs-create__hint {
  margin: 0;
  color: var(--ds-faint);
  font-size: 11.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .designs-create__feedback {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--ds-status-warn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 12.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .designs-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid var(--ds-selection-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-lg);
}

.restory-ds[data-warm-studio] .designs-toast::before {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--ds-accent);
  content: "";
}

.restory-ds[data-warm-studio] .designs-toast--warn::before {
  background: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .designs-toast__text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-toast__dismiss {
  flex: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
}

@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .designs-toast {
    right: 16px;
    bottom: 16px;
  }
}

/* Opener controls: the card and row titles stay the only tab stop that opens a
   package, and they keep the text metrics they had as plain headings. */
.restory-ds[data-warm-studio] .designs-card__open,
.restory-ds[data-warm-studio] .designs-row__open {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .designs-card__open {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .designs-row__open {
  display: block;
}

.restory-ds[data-warm-studio] .designs-card__open:hover,
.restory-ds[data-warm-studio] .designs-row__open:hover {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .designs-card__open:focus-visible,
.restory-ds[data-warm-studio] .designs-row__open:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

.restory-ds[data-warm-studio] .designs-drawer__path {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .designs-drawer__type {
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .designs-drawer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Preview well: the caption names the file, the chrome frame is decorative and
   the viewport keeps the reference's 214px stage. */
.restory-ds[data-warm-studio] .designs-drawer-well {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .designs-drawer-well__caption {
  position: absolute;
  z-index: 1;
  top: 30px;
  left: 14px;
  max-width: calc(100% - 28px);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ds-panel);
  overflow: hidden;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .designs-drawer-frame {
  overflow: hidden;
  border: 1px solid rgba(26, 32, 38, 0.14);
  border-radius: 8px;
  background: var(--ds-canvas);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .designs-drawer-chrome {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(26, 32, 38, 0.08);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .designs-drawer-viewport {
  position: relative;
  height: 214px;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .designs-drawer-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .designs-drawer-image[hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .designs-drawer-image-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ds-canvas);
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .designs-drawer-image-error {
  display: none;
}

.restory-ds[data-warm-studio] [data-designs-image-state="loaded"] .designs-drawer-image-status,
.restory-ds[data-warm-studio] [data-designs-image-state="error"] .designs-drawer-image-loading,
.restory-ds[data-warm-studio] .designs-drawer-well:has([data-designs-image-state="error"]) .designs-drawer-well__actions {
  display: none;
}

.restory-ds[data-warm-studio] [data-designs-image-state="error"] .designs-drawer-image-error {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .designs-drawer-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  color: var(--ds-faint);
  text-align: center;
}

.restory-ds[data-warm-studio] .designs-drawer-placeholder__label {
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-drawer-well__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Owner brief and the three verification tiles. */
.restory-ds[data-warm-studio] .designs-drawer-brief {
  display: grid;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .designs-drawer-brief__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ds-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .designs-drawer-brief__prose {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .designs-drawer-brief__meta {
  margin: 0;
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .designs-drawer-health {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.restory-ds[data-warm-studio] .designs-drawer-tile {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 8px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .designs-drawer-tile__label {
  color: var(--ds-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .designs-drawer-tile__value {
  overflow: hidden;
  color: var(--ds-ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* An unmeasured tile stays muted instead of borrowing a state colour. */
.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-lint="unknown"],
.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-captures="unknown"],
.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-posture="unknown"] {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-lint="unknown"] .designs-drawer-tile__value,
.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-captures="unknown"] .designs-drawer-tile__value,
.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-posture="unknown"] .designs-drawer-tile__value {
  color: var(--ds-muted);
  font-weight: 500;
}

.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-captures="partial"] .designs-drawer-tile__value {
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .designs-drawer-tile[data-designs-drawer-captures="verified"] .designs-drawer-tile__value {
  color: var(--ds-status-success-fg);
}

/* Ordered screen switcher. */
.restory-ds[data-warm-studio] .designs-drawer-section {
  display: grid;
  gap: 8px;
}

.restory-ds[data-warm-studio] .designs-drawer-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .designs-drawer-subtitle__meta {
  color: var(--ds-faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.restory-ds[data-warm-studio] .designs-drawer-screens {
  display: grid;
  gap: 6px;
  max-height: 186px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.restory-ds[data-warm-studio] .designs-drawer-screen__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .designs-drawer-screen__btn:hover {
  border-color: var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .designs-drawer-screen__btn--active {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .designs-drawer-screen__btn:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .designs-drawer-screen__index {
  flex-shrink: 0;
  width: 18px;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .designs-drawer-screen__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .designs-drawer-screen__tag {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-drawer-screen__tag--captured {
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .designs-drawer-screen__tag--draft {
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .designs-drawer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.restory-ds[data-warm-studio] .designs-drawer-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .designs-drawer-empty {
  margin: 0;
  color: var(--ds-faint);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Footer keeps the unused launch control focusable and the honest answer on its
   own line, with the withheld Open action simply absent. */
.restory-ds[data-warm-studio] .designs-drawer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-right: auto;
}

.restory-ds[data-warm-studio] .designs-drawer-foot__answer,
.restory-ds[data-warm-studio] .designs-drawer-foot__offline,
.restory-ds[data-warm-studio] .designs-drawer-foot__note {
  flex-basis: 100%;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .designs-drawer-foot__answer {
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .designs-drawer-foot__offline,
.restory-ds[data-warm-studio] .designs-drawer-foot__note {
  color: var(--ds-faint);
}

@media (max-width: 720px) {
  .restory-ds[data-warm-studio] .designs-drawer-health {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================================
   Research · routed list, dossier shelf, drawer and upload dialog
   ============================================================================

   Only the Research LiveView composes these `research-*` classes; the shell,
   head, utility bar, list frame, dialog frame and drop veil stay on the shared
   `ws-list-*` primitives. Tokens come from the Warm Linen Daylight block, so a
   screen never redefines colour or type.
   ========================================================================== */

.restory-ds[data-warm-studio] .research {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* --- header pulse and legend ---------------------------------------------- */

.restory-ds[data-warm-studio] .research-pulse {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-pulse__dot {
  width: 7px;
  height: 7px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .research-pulse[data-research-pulse="loading"] .research-pulse__dot,
.restory-ds[data-warm-studio] .research-pulse[data-research-pulse="unavailable"] .research-pulse__dot {
  background: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .research-pulse[data-research-pulse="partial"] .research-pulse__dot {
  background: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .research-legend {
  font-size: 12px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-legend[data-research-legend="partial"],
.restory-ds[data-warm-studio] .research-legend[data-research-legend="stale"] {
  color: var(--ds-waypoint-fg);
}

/* --- sections ------------------------------------------------------------- */

.restory-ds[data-warm-studio] .research-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.restory-ds[data-warm-studio] .research-section__title {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-section__meta {
  font-size: 12px;
  color: var(--ds-faint);
  font-variant-numeric: tabular-nums;
}

/* --- dossier shelf -------------------------------------------------------- */

.restory-ds[data-warm-studio] .research-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.restory-ds[data-warm-studio] .research-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 16px 16px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  isolation: isolate;
}

.restory-ds[data-warm-studio] .research-card--sky {
  background: var(--ds-artifact-sky);
}

.restory-ds[data-warm-studio] .research-card--sage {
  background: var(--ds-artifact-sage);
}

.restory-ds[data-warm-studio] .research-card--sand {
  background: var(--ds-artifact-sand);
}

.restory-ds[data-warm-studio] .research-card--lilac {
  background: var(--ds-artifact-lilac);
}

/* Back sheets appear only for a known multi-file topic: a folder of documents,
   not a guess about an uninventoried one. */
.restory-ds[data-warm-studio] .research-card[data-research-card-stack="true"]::before,
.restory-ds[data-warm-studio] .research-card[data-research-card-stack="true"]::after {
  content: "";
  position: absolute;
  height: 12px;
  border: 1px solid var(--ds-panel-border);
  border-top: 0;
  border-radius: 0 0 var(--ds-radius-panel) var(--ds-radius-panel);
  background: var(--ds-chrome);
  z-index: -1;
}

/* Two centred sheets peek below the card, widest at the back, so the folder
   reads as stacked paper instead of one sheet with an offset shadow. */
.restory-ds[data-warm-studio] .research-card[data-research-card-stack="true"]::before {
  inset: auto 22px -8px 22px;
  background: #f1ece2;
}

.restory-ds[data-warm-studio] .research-card[data-research-card-stack="true"]::after {
  inset: auto 13px -4px 13px;
}

.restory-ds[data-warm-studio] .research-card:hover {
  border-color: var(--ds-control-border-hover);
}

.restory-ds[data-warm-studio] .research-card:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

.restory-ds[data-warm-studio] .research-card__badge {
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: var(--ds-radius-badge);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--ds-line-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-card__title {
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.28;
  color: var(--ds-ink);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .research-card__summary {
  font-family: var(--ds-serif, "Newsreader", Georgia, serif);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ds-ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .research-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ds-faint);
  font-variant-numeric: tabular-nums;
}

/* --- topic rows ----------------------------------------------------------- */

.restory-ds[data-warm-studio] .research-rows,
.restory-ds[data-warm-studio] .research-side-rows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .research-row-item + .research-row-item,
.restory-ds[data-warm-studio] .research-side-row + .research-side-row {
  border-top: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .research-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .research-row:hover {
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .research-row:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
}

.restory-ds[data-warm-studio] .research-row--current {
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .research-row__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--ds-radius-control);
  border: 1px solid var(--ds-line-2);
  background: var(--ds-chrome);
  font-family: var(--ds-display);
  font-size: 12px;
  font-weight: 650;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .research-row-item[data-research-tone="sky"] .research-row__mark {
  background: var(--ds-artifact-sky);
}

.restory-ds[data-warm-studio] .research-row-item[data-research-tone="sage"] .research-row__mark {
  background: var(--ds-artifact-sage);
}

.restory-ds[data-warm-studio] .research-row-item[data-research-tone="sand"] .research-row__mark {
  background: var(--ds-artifact-sand);
}

.restory-ds[data-warm-studio] .research-row-item[data-research-tone="lilac"] .research-row__mark {
  background: var(--ds-artifact-lilac);
}

.restory-ds[data-warm-studio] .research-row__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-row__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-ink);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .research-row__summary {
  font-size: 12.5px;
  color: var(--ds-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .research-row__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ds-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .research-row__used {
  padding: 1px 6px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-line-2);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .research-row__chevron {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--ds-faint);
}

/* --- idea and link inventories ------------------------------------------- */

.restory-ds[data-warm-studio] .research-side-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 14px;
}

.restory-ds[data-warm-studio] .research-side-row__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-side-row__file,
.restory-ds[data-warm-studio] .research-side-row__url {
  font-family: var(--ds-mono);
  font-size: 11.5px;
  color: var(--ds-muted);
  overflow-wrap: anywhere;
}

/* --- inspection drawer ---------------------------------------------------- */

.restory-ds[data-warm-studio] #research-drawer[open] {
  width: min(460px, 100vw);
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border: 0;
  border-left: 1px solid var(--ds-panel-border);
  border-radius: 0;
}

.restory-ds[data-warm-studio] #research-drawer .ws-list-dialog__body {
  padding: 16px 20px 24px;
}

.restory-ds[data-warm-studio] .research-drawer {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.restory-ds[data-warm-studio] .research-drawer__path {
  font-family: var(--ds-mono);
  font-size: 11.5px;
  color: var(--ds-faint);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .research-drawer__summary {
  margin: 0;
  font-family: var(--ds-serif, "Newsreader", Georgia, serif);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .research-drawer__summary--missing {
  color: var(--ds-faint);
  font-style: italic;
}

.restory-ds[data-warm-studio] .research-drawer__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.restory-ds[data-warm-studio] .research-drawer__heading {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-drawer__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.restory-ds[data-warm-studio] .research-drawer__fact {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-drawer__fact dt {
  font-size: 11px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-drawer__fact dd {
  margin: 0;
  font-size: 13px;
  color: var(--ds-ink-2);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .research-drawer__files,
.restory-ds[data-warm-studio] .research-drawer__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .research-drawer__file {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ds-line);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .research-drawer__file-name {
  font-family: var(--ds-mono);
  font-size: 12px;
  color: var(--ds-ink-2);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .research-drawer__file-size {
  flex: none;
  color: var(--ds-faint);
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .research-drawer__hint {
  margin: 0;
  font-size: 12px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-drawer__link {
  font-size: 13px;
}

.restory-ds[data-warm-studio] #research-add-file {
  border: 1px solid var(--ds-btn-border);
  background: var(--ds-panel);
}

/* --- add-topic and upload dialogs ---------------------------------------- */

.restory-ds[data-warm-studio] #research-topic-dialog[open] {
  width: min(420px, calc(100vw - 32px));
}

.restory-ds[data-warm-studio] #research-topic-dialog .ws-list-dialog__body,
.restory-ds[data-warm-studio] #research-upload-dialog .ws-list-dialog__body {
  padding: 16px 20px 20px;
}

.restory-ds[data-warm-studio] .research-form,
.restory-ds[data-warm-studio] .research-upload {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.restory-ds[data-warm-studio] .research-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.restory-ds[data-warm-studio] .research-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-field__input,
.restory-ds[data-warm-studio] .research-field__textarea {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .research-field__textarea {
  min-height: 72px;
  resize: vertical;
}

.restory-ds[data-warm-studio] .research-form__hint,
.restory-ds[data-warm-studio] .research-upload__hint {
  margin: 0;
  font-size: 12px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-form__hint code {
  font-family: var(--ds-mono);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .research-form__error,
.restory-ds[data-warm-studio] .research-upload__error {
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--ds-status-error-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
  font-size: 12.5px;
}

/* --- upload staging, routing and feedback -------------------------------- */

.restory-ds[data-warm-studio] .research-upload__picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px;
  border: 1px dashed var(--ds-control-border-hover);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .research-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.restory-ds[data-warm-studio] .research-upload__files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .research-upload__file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 9px 11px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .research-upload__name {
  font-family: var(--ds-mono);
  font-size: 12px;
  color: var(--ds-ink-2);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .research-upload__size {
  font-size: 11.5px;
  color: var(--ds-faint);
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .research-upload__gist {
  grid-column: 1 / -1;
  font-family: var(--ds-serif, "Newsreader", Georgia, serif);
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-upload__progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
}

.restory-ds[data-warm-studio] .research-route__set {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.restory-ds[data-warm-studio] .research-route__legend {
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-route__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  font-size: 13px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .research-route__option:has(input:checked) {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .research-route__detail {
  margin-left: 4px;
  font-size: 12px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-route__select,
.restory-ds[data-warm-studio] .research-route__title {
  width: 100%;
  font: inherit;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .research-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-consent input {
  margin-top: 3px;
}

.restory-ds[data-warm-studio] .research-status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--ds-status-info-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .research-status--success {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .research-status--warn {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .research-status__text {
  margin: 0;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-status__dismiss,
.restory-ds[data-warm-studio] .research-status-dismiss {
  flex: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
}

@media (max-width: 1100px) {
  .restory-ds[data-warm-studio] .research-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .restory-ds[data-warm-studio] .research-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .research-row {
    grid-template-columns: 32px minmax(0, 1fr) 16px;
  }

  .restory-ds[data-warm-studio] .research-row__meta {
    display: none;
  }
}

/* ============================================================================
   Plans list
   ============================================================================

   The routed Plans screen composes the shared list chrome above. Every frame
   is a uniform four-sided 1px border from one token family; only the row
   separator inside a frame is a single hairline. A segmented delivery bar
   carries done, in-flight and queued as data-bearing state, never colour
   alone, and a plan with more than twelve members renders one continuous
   three-part bar instead of a comb of hairlines. */

.restory-ds[data-warm-studio] .plans {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-add {
  flex: none;
}

/* -- pulse summary ------------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plans-pulse__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.restory-ds[data-warm-studio] .plans-pulse__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ds-line-2);
}

.restory-ds[data-warm-studio] .plans-pulse__dot--decision {
  background: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .plans-pulse__dot--ready {
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .plans-pulse__sep {
  color: var(--ds-faint);
}

/* -- legend -------------------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ds-faint);
  font-size: 11.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plans-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.restory-ds[data-warm-studio] .plans-legend__swatch {
  width: 10px;
  height: 8px;
  border-radius: 2px;
  background: var(--ds-status-neutral-bg);
}

.restory-ds[data-warm-studio] .plans-legend__swatch--done {
  background: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .plans-legend__swatch--flight {
  background: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .plans-legend__swatch--queued {
  background: var(--ds-status-warn-bg);
  border: 1px solid var(--ds-status-warn-border);
}

/* -- section heads ------------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-section,
.restory-ds[data-warm-studio] .plans-shelf {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.restory-ds[data-warm-studio] .plans-section-head__left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.restory-ds[data-warm-studio] .plans-section-head__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.restory-ds[data-warm-studio] .plans-section-head__meta,
.restory-ds[data-warm-studio] .plans-completed-meta {
  color: var(--ds-faint);
  font-size: 12px;
  line-height: 1.4;
}

/* -- ready shelf --------------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-shelf__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.restory-ds[data-warm-studio] .plans-shelf-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-shelf-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.restory-ds[data-warm-studio] .plans-shelf-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--ds-muted);
  font-size: 12px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .plans-shelf-card__readiness strong {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .plans-shelf-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.restory-ds[data-warm-studio] .plans-backlog-action {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--ds-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plans-backlog-action:hover {
  color: var(--ds-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.restory-ds[data-warm-studio] .plans-backlog-action:focus-visible,
.restory-ds[data-warm-studio] .plans-title-btn:focus-visible,
.restory-ds[data-warm-studio] .plans-feature-link:focus-visible,
.restory-ds[data-warm-studio] .plans-disclose:focus-visible,
.restory-ds[data-warm-studio] .plans-state-inspect:focus-visible,
.restory-ds[data-warm-studio] .plans-completed-row:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -- plan rows ----------------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-focus-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-col-head,
.restory-ds[data-warm-studio] .plans-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px 98px;
  gap: 14px;
  align-items: center;
}

.restory-ds[data-warm-studio] .plans-col-head {
  padding: 8px 16px;
  border-bottom: 1px solid var(--ds-line);
  color: var(--ds-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .plans-col-head--completed {
  grid-template-columns: minmax(0, 1fr) 232px 98px 24px;
}

.restory-ds[data-warm-studio] .plans-plan-row {
  padding: 13px 16px;
}

.restory-ds[data-warm-studio] .plans-item + .plans-item .plans-plan-row,
.restory-ds[data-warm-studio] .plans-item + .plans-item .plans-completed-row {
  border-top: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .plans-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-title-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .plans-title-btn:hover {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .plans-shelf-card .plans-title-btn {
  font-size: 15.5px;
}

.restory-ds[data-warm-studio] .plans-plan-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ds-muted);
  font-size: 12px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .plans-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--ds-line-2);
}

.restory-ds[data-warm-studio] .plans-when,
.restory-ds[data-warm-studio] .plans-time-col,
.restory-ds[data-warm-studio] .plans-ctx-time {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plans-disclose {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .plans-disclose:hover {
  color: var(--ds-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.restory-ds[data-warm-studio] .plans-progress-col {
  display: flex;
  align-items: center;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-progress-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .plans-bar {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  width: 144px;
  height: 8px;
  flex: none;
}

.restory-ds[data-warm-studio] .plans-bar--compact {
  width: 120px;
}

.restory-ds[data-warm-studio] .plans-seg {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--ds-status-neutral-bg);
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="2"] {
  flex-grow: 2;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="3"] {
  flex-grow: 3;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="4"] {
  flex-grow: 4;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="5"] {
  flex-grow: 5;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="6"] {
  flex-grow: 6;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="7"] {
  flex-grow: 7;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="8"] {
  flex-grow: 8;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="9"] {
  flex-grow: 9;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="10"] {
  flex-grow: 10;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="11"] {
  flex-grow: 11;
}

.restory-ds[data-warm-studio] .plans-seg[data-grow="12"] {
  flex-grow: 12;
}

@supports (flex-grow: attr(data-grow type(<number>), 1)) {
  .restory-ds[data-warm-studio] .plans-seg[data-grow] {
    flex-grow: attr(data-grow type(<number>), 1);
  }
}

.restory-ds[data-warm-studio] .plans-seg--done {
  background: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .plans-seg--inflight {
  background: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .plans-seg--queued {
  background: var(--ds-status-warn-bg);
  border: 1px solid var(--ds-status-warn-border);
}

.restory-ds[data-warm-studio] .plans-seg--planned {
  background: transparent;
  border: 1px dashed var(--ds-line-2);
}

.restory-ds[data-warm-studio] .plans-seg--muted.plans-seg--done {
  background: var(--ds-status-success-border);
}

.restory-ds[data-warm-studio] .plans-ratio {
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .plans-ratio--muted {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .plans-progress-unknown {
  color: var(--ds-faint);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .plans-state-inspect {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* -- status pills -------------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--ds-status-neutral-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-status-neutral-fg);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plans-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.restory-ds[data-warm-studio] .plans-pill--ready,
.restory-ds[data-warm-studio] .plans-pill--complete {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .plans-pill--draft,
.restory-ds[data-warm-studio] .plans-pill--planning,
.restory-ds[data-warm-studio] .plans-pill--backlog {
  border-color: var(--ds-line-2);
  background: var(--ds-panel);
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plans-pill--decision,
.restory-ds[data-warm-studio] .plans-pill--conflict {
  border-color: var(--ds-waypoint-border);
  background: var(--ds-waypoint-bg);
  color: var(--ds-waypoint-fg);
}

.restory-ds[data-warm-studio] .plans-pill--unavailable {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .plans-pill--pr,
.restory-ds[data-warm-studio] .plans-pill--running {
  border-color: var(--ds-status-info-border);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
}

/* -- linked context chips ------------------------------------------------ */

.restory-ds[data-warm-studio] .plans-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 1px 7px;
  border: 1px solid var(--ds-line-2);
  border-radius: var(--ds-radius-badge);
  background: var(--ds-panel);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plans-chip__dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 999px;
  background: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .plans-chip--research .plans-chip__dot {
  background: var(--ds-waypoint);
}

/* -- nested active items ------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-context {
  padding: 0 16px 12px;
}

.restory-ds[data-warm-studio] .plans-ctx-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--ds-line);
  list-style: none;
}

.restory-ds[data-warm-studio] .plans-ctx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px 98px;
  gap: 14px;
  align-items: center;
  padding: 5px 0;
}

.restory-ds[data-warm-studio] .plans-ctx-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-feature-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 12px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .plans-feature-link:hover {
  color: var(--ds-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.restory-ds[data-warm-studio] .plans-ctx-note {
  color: var(--ds-faint);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .plans-stage-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-muted);
  font-size: 11.5px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-stage-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 999px;
  background: var(--ds-line-2);
}

.restory-ds[data-warm-studio] .plans-stage-dot--live {
  background: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .plans-stage-dot--blocked {
  background: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .plans-stage-dot--done {
  background: var(--ds-status-success-fg);
}

/* -- more bar ------------------------------------------------------------ */

.restory-ds[data-warm-studio] .plans-more-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 16px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .plans-more-bar--completed {
  border: 0;
  border-top: 1px solid var(--ds-line);
  border-radius: 0;
  background: transparent;
}

.restory-ds[data-warm-studio] .plans-more-bar__caption {
  color: var(--ds-faint);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .plans-more-bar__button {
  flex: none;
}

/* -- completed scope ----------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-completed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px 98px 24px;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .plans-completed-row:hover {
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .plans-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-faint);
}

/* -- creation feedback --------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--ds-status-info-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .plans-toast--success {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .plans-toast--warn {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .plans-toast--error {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .plans-toast__text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .plans-toast__dismiss {
  flex: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
}

/* -- create dialog ------------------------------------------------------- */

.restory-ds[data-warm-studio] #plans-create-dialog form {
  display: grid;
  gap: 12px;
}

.restory-ds[data-warm-studio] .plans-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-label {
  color: var(--ds-ink-2);
  font-size: 12px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .plans-input {
  width: 100%;
}

.restory-ds[data-warm-studio] .plans-input--brief {
  resize: vertical;
  min-height: 72px;
  font-family: var(--ds-sans);
}

.restory-ds[data-warm-studio] .plans-hint {
  margin: 0;
  color: var(--ds-faint);
  font-size: 11.5px;
  line-height: 1.4;
}

/* -- inspection drawer --------------------------------------------------- */

.restory-ds[data-warm-studio] .plans-drawer {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-drawer__identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .plans-drawer__meta {
  color: var(--ds-faint);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .plans-drawer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.restory-ds[data-warm-studio] .plans-drawer__section {
  display: grid;
  gap: 8px;
}

.restory-ds[data-warm-studio] .plans-drawer__heading {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 13.5px;
  font-weight: 650;
}

.restory-ds[data-warm-studio] .plans-drawer__empty {
  margin: 0;
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .plans-callout {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .plans-callout--decision {
  border-color: var(--ds-waypoint-border);
  background: var(--ds-waypoint-bg);
}

.restory-ds[data-warm-studio] .plans-callout--conflict {
  border-color: var(--ds-waypoint-border);
  background: var(--ds-waypoint-bg);
}

.restory-ds[data-warm-studio] .plans-callout--unavailable {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
}

.restory-ds[data-warm-studio] .plans-callout__title {
  margin: 0;
  color: var(--ds-ink);
  font-size: 12.5px;
  font-weight: 650;
}

.restory-ds[data-warm-studio] .plans-callout__body {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .plans-members {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .plans-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .plans-member:first-child {
  border-top: 0;
}

.restory-ds[data-warm-studio] .plans-member__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plans-member__slug {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 12px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .plans-member__slug:hover {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .plans-member__stage {
  grid-column: 1;
  color: var(--ds-muted);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .plans-member__time {
  grid-column: 2;
  grid-row: 1;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .restory-ds[data-warm-studio] .plans-shelf__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .plans-col-head,
  .restory-ds[data-warm-studio] .plans-plan-row,
  .restory-ds[data-warm-studio] .plans-ctx-row,
  .restory-ds[data-warm-studio] .plans-col-head--completed,
  .restory-ds[data-warm-studio] .plans-completed-row {
    grid-template-columns: minmax(0, 1fr) 200px;
  }

  .restory-ds[data-warm-studio] .plans-col-head > :nth-child(3),
  .restory-ds[data-warm-studio] .plans-ctx-row > :nth-child(3),
  .restory-ds[data-warm-studio] .plans-completed-row > .plans-time-col,
  .restory-ds[data-warm-studio] .plans-completed-row > .plans-chev {
    display: none;
  }
}

.restory-ds[data-warm-studio] .plans-more-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Shared dialogs append their own dismiss control. Keep it first visually
   and in sequential focus order where CSS reading-flow is supported. */
.restory-ds[data-warm-studio] .plans [data-ws-dialog-footer] {
  reading-flow: flex-visual;
}

.restory-ds[data-warm-studio] .plans-dialog-primary {
  order: 1;
}

.restory-ds[data-warm-studio] .plans-dialog-primary--unavailable {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Draw a decorative glyph on the existing Plans search forms. */
.restory-ds[data-warm-studio] .plans form[role="search"]::before,
.restory-ds[data-warm-studio] .plans form[role="search"]::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  color: var(--ds-muted);
  content: "";
  pointer-events: none;
}

.restory-ds[data-warm-studio] .plans form[role="search"]::before {
  inset-inline-start: 11px;
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transform: translateY(-65%);
}

.restory-ds[data-warm-studio] .plans form[role="search"]::after {
  inset-inline-start: 18px;
  width: 5px;
  height: 1.5px;
  background: currentColor;
  transform: translateY(3px) rotate(45deg);
}

.restory-ds[data-warm-studio] .plans form[role="search"] input[type="search"] {
  padding-inline-start: 30px;
}

/* ============================================================================
   Account narrow frame
   ============================================================================

   Account is the one Warm Studio section with a published compact frame. At or
   below 900px the desktop two-column grid becomes one column: the 44px top bar
   first, then the rail as a full-width row carrying Back above one three-link
   row, then the main column. Back and all three links stay one set of ordinary
   links at every width — nothing is duplicated, hidden, clipped or truncated,
   and the labels wrap instead of ending in an ellipsis.

   A stored collapsed workspace preference still applies to workspace
   documents; on this section the rail is always effectively expanded and the
   toggle publishes that state instead of rewriting the preference. */

@media (max-width: 900px) {
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] {
    grid-template-areas:
      "topbar"
      "rail"
      "main";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px auto minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] > .ds-topbar {
    grid-area: topbar;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px;
    height: 44px;
    min-height: 44px;
    padding: 0 4px;
  }

  /* The workspace switcher keeps its label but yields width to the utility
     cluster instead of spilling under it. */
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .ds-scope,
  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    .ds-scope__trigger {
    min-width: 0;
    max-width: 100%;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] > .ds-rail {
    grid-area: rail;
    width: auto;
    max-width: none;
    min-height: 0;
    max-height: none;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--ds-panel-border);
    overflow: hidden;
  }

  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    > .ds-rail
    > .ds-rail__scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 4px;
    overflow: visible;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .ds-rail__back {
    min-height: 44px;
    margin: 0;
    padding: 0 4px;
    border-radius: 0;
    font-size: 12px;
  }

  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    > .ds-rail
    .ds-rail__nav,
  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    > .ds-rail
    .ds-rail__group {
    display: grid;
    gap: 0;
  }

  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    > .ds-rail
    .ds-rail__group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .ds-rail__label {
    grid-column: 1 / -1;
    padding: 0 4px;
    font-size: 11px;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .ds-nav-link {
    height: auto;
    min-height: 44px;
    padding: 0 6px;
    border-radius: 0;
    font-size: 12px;
    justify-content: center;
    text-align: center;
  }

  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    .ds-nav-link__label,
  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    .ds-rail__back-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] > .ds-main {
    grid-area: main;
    min-height: 0;
    padding: 0;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-screen {
    gap: 12px;
    padding: 16px 8px 32px;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-title {
    font-size: 20px;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-panel {
    padding: 12px 8px;
    overflow-x: auto;
  }

  /* Six columns do not fit a 390px frame at a readable size, so the panel keeps
     them at their own width and scrolls inside its card with a visible thin
     scrollbar; the page itself never scrolls sideways. */
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-panel {
    padding: 12px 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    .search-keys-panel::-webkit-scrollbar {
    height: 8px;
  }

  .restory-ds[data-warm-studio]
    .ds-app[data-warm-studio-section="account"]
    .search-keys-panel::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(26, 32, 38, 0.24);
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-table {
    min-width: 30rem;
  }
}

/* The compact step of the same frame: 12px text, 4px side padding, zero gap
   between the rail rows and 44px minimum targets, so three full labels fit one
   row at 390px. The icons step out of that row to give the labels the width. */
@media (max-width: 560px) {
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .ds-nav-link {
    padding: 0 4px;
    font-size: 12px;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .ds-nav-link__icon {
    display: none;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-screen {
    padding: 12px 4px 24px;
    font-size: 12px;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-panel {
    padding: 12px 4px;
    /* At this width the six-column table always overflows its panel, so a
       right-edge shadow says "scrolls" while the panel cover hides the same
       shadow on the left until the table is actually scrolled. */
    background-image:
      linear-gradient(to right, var(--ds-panel) 40%, rgba(252, 251, 248, 0)),
      linear-gradient(to left, var(--ds-panel) 40%, rgba(252, 251, 248, 0)),
      linear-gradient(to right, rgba(26, 32, 38, 0.16), rgba(26, 32, 38, 0)),
      linear-gradient(to left, rgba(26, 32, 38, 0.16), rgba(26, 32, 38, 0));
    background-position:
      left center,
      right center,
      left center,
      right center;
    background-repeat: no-repeat;
    background-size:
      20px 100%,
      20px 100%,
      14px 100%,
      14px 100%;
    background-attachment: local, local, scroll, scroll;
  }

  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-subtitle,
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-panel__hint,
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-label,
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-input,
  .restory-ds[data-warm-studio] .ds-app[data-warm-studio-section="account"] .search-keys-table {
    font-size: 12px;
  }
}

/* ============================================================================
   Organization invitation gate (`/invites/accept`)

   Invite-only overrides scoped to the shared CSS-only gate frame. The shared
   gate keeps its own width, padding and panel treatment for every other
   caller; these rules reach the frame only through `:has(.invite-screen)`.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-gate:has(.invite-screen) .ds-gate__bar {
  min-height: 56px;
  padding: 0 28px;
}

/* The shared gate centers its single card vertically. The invitation screen
   keeps the design's top-aligned 540px track (500px card plus 20px gutters). */
.restory-ds[data-warm-studio] .ds-gate:has(.invite-screen) .ds-gate__body {
  align-items: start;
  justify-items: center;
  padding: 52px 20px 48px;
}

.restory-ds[data-warm-studio] .ds-gate__card:has(.invite-screen) {
  display: grid;
  /* The shared frame stacks a notice directly on the focal panel. The gate
     design keeps one card gap between an alert and the invitation card. */
  gap: 16px;
  width: min(100%, 500px);
}

/* The rail brand carries rail-only bottom padding and a filled mark tile.
   The public gate paints the outlined woven mark instead. */
.restory-ds[data-warm-studio] .ds-gate:has(.invite-screen) .ds-rail__brand {
  padding: 0;
}

.restory-ds[data-warm-studio] .ds-gate:has(.invite-screen) .ds-rail__brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: transparent;
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-gate:has(.invite-screen) .ds-rail__brand-name {
  font-size: 18px;
  letter-spacing: -0.025em;
}

/* The invitation card owns its own bands, so the shared focal surface drops its
   padding, border, radius and shadow rather than double-framing the card. */
.restory-ds[data-warm-studio] .ds-gate__card:has(.invite-screen) .ds-panel-focal {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.restory-ds[data-warm-studio] .invite-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent);
  color: var(--ds-accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .invite-skip:focus {
  left: 12px;
}

.restory-ds[data-warm-studio] .invite-screen {
  display: grid;
  gap: 18px;
}

/* The skip link targets the invitation region; the programmatic focus it moves
   is not a control outline. Controls keep the shared focus-visible ring. */
.restory-ds[data-warm-studio] .invite-screen[tabindex="-1"]:focus-visible {
  outline: none;
}

.restory-ds[data-warm-studio] .invite-header-link {
  padding: 8px 6px;
  border-radius: 6px;
  color: var(--ds-ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ds-btn-border);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .invite-header-link:hover {
  color: var(--ds-ink);
  text-decoration-color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .invite-card {
  overflow: hidden;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .invite-card__head {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 26px 32px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .invite-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .invite-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .invite-intro {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 15px;
  line-height: 1.55;
}

.restory-ds[data-warm-studio] .invite-details {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 20px 32px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .invite-detail {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  font-size: 14.5px;
}

.restory-ds[data-warm-studio] .invite-detail dt {
  color: var(--ds-muted);
  font-weight: 500;
}

.restory-ds[data-warm-studio] .invite-detail dd {
  margin: 0;
  color: var(--ds-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .invite-body {
  display: grid;
  gap: 18px;
  padding: 24px 32px 28px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .invite-form {
  display: grid;
  gap: 16px;
  margin: 0;
}

.restory-ds[data-warm-studio] .invite-field {
  display: grid;
  gap: 6px;
}

.restory-ds[data-warm-studio] .invite-label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .invite-optional {
  color: var(--ds-muted);
  font-size: 13px;
  font-weight: 400;
}

.restory-ds[data-warm-studio] .invite-help {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .invite-input.ds-input {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 15px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .invite-submit.ds-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14.5px;
}

.restory-ds[data-warm-studio] .invite-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 32px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .invite-foot .ds-link {
  color: var(--ds-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(25, 100, 86, 0.35);
  text-underline-offset: 3px;
}

.restory-ds[data-warm-studio] .invite-foot .ds-link:hover {
  color: var(--ds-accent-hover);
  text-decoration-color: var(--ds-accent-hover);
}

@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .ds-gate:has(.invite-screen) .ds-gate__bar {
    padding: 0 16px;
  }

  .restory-ds[data-warm-studio] .ds-gate:has(.invite-screen) .ds-gate__body {
    padding: 24px 16px 32px;
  }

  .restory-ds[data-warm-studio] .invite-card__head {
    padding: 22px 20px 18px;
  }

  .restory-ds[data-warm-studio] .invite-details {
    padding: 16px 20px;
  }

  .restory-ds[data-warm-studio] .invite-detail {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .restory-ds[data-warm-studio] .invite-body {
    padding: 20px 20px 22px;
  }

  .restory-ds[data-warm-studio] .invite-foot {
    padding: 14px 20px;
  }

  .restory-ds[data-warm-studio] .invite-title {
    font-size: 23px;
  }

  .restory-ds[data-warm-studio] .invite-input.ds-input {
    font-size: 16px;
  }
}

/* Step 7 recovery delta. Every rule stays under the `.invite-recovery`
   modifier so the valid preview and contextual retry states keep the base
   invitation treatment; the design's list reset is restored only here. */
.restory-ds[data-warm-studio] .ds-gate:has(.invite-recovery) .ds-gate__body {
  padding: 60px 20px 48px;
}

.restory-ds[data-warm-studio] .invite-recovery .invite-card__head {
  padding: 28px 32px 22px;
}

.restory-ds[data-warm-studio] .invite-recovery-band {
  display: grid;
  gap: 10px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .invite-recovery-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .invite-recovery-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  list-style: decimal;
  color: var(--ds-ink-2);
  font-size: 14.5px;
}

.restory-ds[data-warm-studio] .invite-recovery .invite-body {
  gap: 12px;
}

.restory-ds[data-warm-studio] .invite-recovery .ds-btn {
  width: 100%;
  min-height: 44px;
}

.restory-ds[data-warm-studio] .invite-recovery-meta {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13.5px;
  text-align: center;
}

@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .ds-gate:has(.invite-recovery) .ds-gate__body {
    padding: 28px 16px 32px;
  }

  .restory-ds[data-warm-studio] .invite-recovery .invite-card__head {
    padding: 22px 20px 18px;
  }

  .restory-ds[data-warm-studio] .invite-recovery-band {
    padding: 18px 20px;
  }

  .restory-ds[data-warm-studio] .invite-recovery .invite-body {
    padding: 20px 20px 22px;
  }
}

/* --------------------------------------------------------------------------
   Feature workbench shell

   One 1px vertical separator divides the feature pane from the Pi/agent pane.
   The 3fr/2fr rule is the no-script 60/40 default; the WarmStudioFeatureSplitter
   hook writes the live ratio through CSSOM on the root marked with
   `data-ws-workbench-split`, so no server markup carries an inline style. The
   separator is the only pointer/keyboard target and owns the accessible
   current/min/max values.
   ------------------------------------------------------------------------ */
.restory-ds[data-warm-studio] .feature-workbench {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .feature-workbench__split {
  display: grid;
  grid-template-columns: minmax(0, 3fr) 1px minmax(0, 2fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .feature-workbench__main,
.restory-ds[data-warm-studio] .feature-workbench__agent {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .feature-workbench__splitter {
  width: 1px;
  min-width: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ds-panel-border);
  cursor: col-resize;
  touch-action: none;
  transition: background 0.12s ease;
}

.restory-ds[data-warm-studio] .feature-workbench__splitter:hover,
.restory-ds[data-warm-studio] .feature-workbench__splitter:focus-visible,
.restory-ds[data-warm-studio] .feature-workbench__splitter[data-ws-split-dragging="true"] {
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .feature-workbench__splitter:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Feature Steps tab: concurrent Gantt timeline and step inspector

   Everything here is scoped to the Steps panel (`.feature-workbench__panel`
   carrying `data-feature-delegate="steps"`), so the Overview, Files, Relations,
   Tour and Skills panels keep the shell's defaults. The server publishes one
   axis window and per-attempt percentages as data attributes; the staged
   WarmStudioFeatureSteps hook draws the clock lane, the axis and the bars
   through CSSOM. Without that hook the durations stay in the mono right-hand
   column and the rows stay selectable, so nothing here depends on script.
   ------------------------------------------------------------------------ */
.restory-ds[data-warm-studio] .feature-workbench__panel[data-feature-delegate="steps"] {
  --feature-steps-columns: minmax(0, 1.35fr) minmax(0, 1.9fr) 7.5ch;

  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 12px 16px 14px;
  overflow: hidden;
  color: var(--ds-ink);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__summary {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  font-family: var(--ds-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__summary
  > span:first-child {
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__degraded,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  [data-feature-steps-empty] {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--ds-status-warn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 12px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__degraded
  p {
  margin: 0;
}

/* Bounded timeline body: many waves scroll inside the panel instead of pushing
   the inspector off screen. The chart row (clock lane + axis) stays pinned. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps {
  flex: 0 1 auto;
  max-height: 264px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  list-style: none;
  scrollbar-width: thin;
  border-top: 1px solid var(--ds-line);
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__chart {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--feature-steps-columns);
  column-gap: 10px;
  align-items: end;
  margin: 0;
  padding: 4px 0 2px;
  list-style: none;
  background: var(--ds-panel);
  box-shadow: 0 1px 0 var(--ds-line);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__chart-spacer {
  display: none;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__now-lane {
  position: relative;
  grid-column: 2;
  height: 17px;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__now-label {
  position: absolute;
  top: 0;
  padding: 2px 6px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-waypoint-fg);
  color: var(--ds-chrome);
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__now-label--start {
  transform: none;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__now-label--end {
  transform: translateX(-100%);
}

/* A disconnected, hidden or stale panel keeps the chart but stops claiming a
   live now: the lane tag is hidden and the dashed line is removed. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"][data-feature-gantt-clock="suspended"]
  .feature-steps__now-lane {
  visibility: hidden;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__chart-duration {
  grid-column: 3;
  justify-self: end;
  font-family: var(--ds-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__axis {
  position: relative;
  grid-column: 2;
  height: 16px;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__tick {
  position: absolute;
  top: 3px;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ds-faint);
  white-space: nowrap;
  transform: translateX(-50%);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__tick[data-feature-gantt-tick-left="0.00"] {
  transform: none;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__tick[data-feature-gantt-tick-left="100.00"] {
  transform: translateX(-100%);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__wave {
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__wave-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 2px 3px;
  border-top: 1px dotted var(--ds-panel-border);
  font-family: var(--ds-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__wave-title {
  font-weight: 700;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__wave-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__row {
  display: grid;
  grid-template-columns: var(--feature-steps-columns);
  column-gap: 10px;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__row:last-child {
  border-bottom: 0;
}

/* The row control keeps its full title: the name wraps instead of truncating. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__select {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__select:hover {
  background: rgba(25, 100, 86, 0.06);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__row[data-feature-step-selected="true"]
  .feature-steps__select {
  background: var(--ds-selection-bg);
}

/* Selection is a tint; keyboard focus adds a high-contrast ring so the two stay
   separable on screen and the arrow-key move is visible. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__select:focus-visible {
  outline: 2px solid var(--ds-ink);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 4px var(--ds-selection-bg);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__number {
  flex: 0 0 auto;
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__name {
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__status {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid var(--ds-status-neutral-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-status-neutral-fg);
  font-family: var(--ds-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__row[data-feature-step-active="true"]
  .feature-steps__status {
  border-color: var(--ds-status-info-border);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__track {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(26, 32, 38, 0.045);
}

/* The dashed live now line, published as one percentage on the panel. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"][data-feature-gantt-clock="now"]
  .feature-steps__track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--feature-steps-now-left, 100%);
  z-index: 1;
  border-left: 1px dashed var(--ds-waypoint);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar {
  position: absolute;
  top: 3px;
  left: 2px;
  z-index: 2;
  display: block;
  width: auto;
  max-width: calc(100% - 4px);
  height: 10px;
  border-radius: 4px;
  background: var(--ds-accent-fill);
  transition: width 0.16s ease, left 0.16s ease;
}

/* A second timed attempt under the first keeps both intervals visible; the
   untimed/unavailable chips keep their own row and text. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar--observed
  ~ .feature-steps__bar--observed,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar--observed
  ~ .feature-steps__bar--zero,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar--zero
  ~ .feature-steps__bar--observed {
  top: 14px;
  height: 6px;
  opacity: 0.72;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar[data-feature-gantt-timing="zero"] {
  min-width: 3px;
  border-radius: 2px;
}

/* An attempt without a usable interval keeps no bar: it stays a dashed chip at
   the track start whose only text is the word the duration column also shows. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar[data-feature-gantt-timing="untimed"],
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar[data-feature-gantt-timing="unavailable"] {
  display: flex;
  align-items: center;
  width: auto;
  max-width: calc(100% - 4px);
  height: 12px;
  padding: 0 6px;
  border: 1px dashed var(--ds-input-border);
  background: none;
  color: var(--ds-muted);
  opacity: 1;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar[data-feature-gantt-timing="untimed"]
  .feature-steps__bar-label,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar[data-feature-gantt-timing="unavailable"]
  .feature-steps__bar-label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  font-family: var(--ds-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar--none {
  display: flex;
  align-items: center;
  width: auto;
  padding: 0 6px;
  border: 1px dashed var(--ds-panel-border);
  background: none;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Durations are repeated in the aligned mono column, not crowded into bars. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__bar-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__duration {
  justify-self: end;
  font-family: var(--ds-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--ds-ink);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .restory-ds[data-warm-studio]
    .feature-workbench__panel[data-feature-delegate="steps"]
    .feature-steps__bar {
    transition: none;
  }
}

/* --- selected step inspector --------------------------------------------- */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding-top: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector-head {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector-meta
  > span {
  padding: 1px 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector-title {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__objective {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ds-muted);
}

/* The one solid Path Pine action of this view. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__focus {
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent-fill);
  box-shadow: var(--ds-shadow-xs);
  color: var(--ds-accent-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__focus:hover {
  background: var(--ds-accent-fill-hover);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__focus:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

/* The truthful stand-in for the action: a short reason, not a dead control. */
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__focus-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__inspector-panel
  h3 {
  margin: 4px 0 0;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__attempts,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__reviews,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__findings,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__attempt,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__review,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__finding,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__check {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__attempt-head,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__review-head,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__finding-head,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__check-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-ink);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__attempt-meta,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__review-meta,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__finding-meta,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__check-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ds-muted);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__notice,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__note {
  margin: 0;
  padding: 5px 8px;
  border-left: 2px solid var(--ds-status-warn-border);
  background: rgba(249, 232, 196, 0.35);
  color: var(--ds-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__receipt,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__write {
  display: inline-block;
  max-width: 100%;
  align-self: flex-start;
  margin: 0;
  padding: 2px 7px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-panel);
  color: var(--ds-accent);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  cursor: pointer;
  overflow-wrap: anywhere;
  text-align: left;
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__receipt:hover,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__write:hover {
  border-color: var(--ds-control-border-hover);
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__receipt:focus-visible,
.restory-ds[data-warm-studio]
  .feature-workbench__panel[data-feature-delegate="steps"]
  .feature-steps__write:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

@media (max-width: 720px) {
  .restory-ds[data-warm-studio]
    .feature-workbench__panel[data-feature-delegate="steps"] {
    --feature-steps-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) 6.5ch;
  }

  .restory-ds[data-warm-studio]
    .feature-workbench__panel[data-feature-delegate="steps"]
    .feature-steps__inspector-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================================
   Closed-demo signup gate (opt-in, WSAA-04)
   ============================================================================

   The shared frame owns the brand bar, the one focal card and the flash
   notices; `/pending-approval` keeps every one of those defaults. Both signup
   gates opt in through the `.ds-signup-gate` marker their own `<main>` renders,
   so frame ancestors are reached with `:has()` and nothing else changes:

   - `.ds-gate__body:has(.ds-signup-gate)` becomes a top-aligned column at the
     pinned 44/48 desktop offsets and the reviewed 16/24 mobile offsets,
     instead of the shared centred 560px gate.
   - `.ds-gate__card:has(.ds-signup-gate)` narrows the column to the pinned
     500px card inside the 540px composition and stacks any flash notice above
     it, which is where the design puts the rate-limit alert.
   - the focal-panel padding is zeroed only under that marker because the card
     now paints its own full-bleed head, approval band, body and foot sections.

   Controls reuse the shared `.ds-btn*`, `.ds-input`, `.ds-badge` and
   `.ds-notice` primitives. Only the pinned 44px control height, the field
   group, the section rules and the signup-only modifiers are declared here,
   named so the sibling gates keep the shared 34/36px defaults. */

/* The pinned header is one 56px bar whose brand is a bare accent mark, not the
   rail's boxed monogram, so the column starts on the reviewed 100px line. */
.restory-ds[data-warm-studio] .ds-gate:has(.ds-signup-gate) .ds-gate__bar {
  min-height: 56px;
  padding: 0 28px;
}

.restory-ds[data-warm-studio] .ds-gate:has(.ds-signup-gate) .ds-rail__brand {
  padding: 0;
}

.restory-ds[data-warm-studio] .ds-gate:has(.ds-signup-gate) .ds-rail__brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: transparent;
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-gate:has(.ds-signup-gate) .ds-rail__brand-name {
  font-size: 18px;
  letter-spacing: -0.025em;
}

.restory-ds[data-warm-studio] .ds-gate__body:has(.ds-signup-gate) {
  display: block;
  padding: 44px 20px 48px;
}

.restory-ds[data-warm-studio] .ds-gate__card:has(.ds-signup-gate) {
  display: grid;
  gap: 14px;
  width: min(100%, 500px);
  margin: 0 auto;
}

.restory-ds[data-warm-studio] .ds-gate__card:has(.ds-signup-gate) > .ds-panel-focal {
  padding: 0;
  overflow: hidden;
  border-color: var(--ds-btn-border);
}

.restory-ds[data-warm-studio] .ds-signup-gate {
  display: block;
  color: var(--ds-ink-2);
  font-size: 15px;
  line-height: 1.58;
}

/* The skip link is the first focusable element on the document. It lives in
   the brand bar so it precedes every later control, and it only paints once
   focused. */
.restory-ds[data-warm-studio] .ds-signup-gate__skip {
  position: fixed;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-signup-gate__skip:focus {
  left: 12px;
  color: var(--ds-accent-ink);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-signup-gate__signin {
  padding: 8px 6px;
  border-radius: 6px;
  color: var(--ds-ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ds-btn-border);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-signup-gate__signin:hover {
  color: var(--ds-ink);
  text-decoration-color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .ds-signup-gate__head {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 26px 32px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-signup-gate__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.restory-ds[data-warm-studio] .ds-signup-gate__intro {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 15px;
  line-height: 1.55;
}

.restory-ds[data-warm-studio] .ds-signup-gate__band {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ds-signup-gate__band strong {
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-signup-gate__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: #c47a14;
}

.restory-ds[data-warm-studio] .ds-signup-gate__body {
  display: grid;
  gap: 20px;
  padding: 24px 32px 28px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ds-signup-gate__form {
  display: grid;
  gap: 16px;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-field {
  display: grid;
  gap: 6px;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-field__label {
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-field__help {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-field__error {
  margin: 0;
  color: var(--ds-status-error-fg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

/* 44px is the reviewed control height on both gates; the shared defaults are
   smaller because the list surfaces are denser. */
.restory-ds[data-warm-studio] .ds-signup-gate .ds-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-color: var(--ds-input-border);
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 15px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-input::placeholder {
  color: var(--ds-faint);
  opacity: 1;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-input[aria-invalid="true"] {
  border-color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-btn {
  min-height: 44px;
  padding: 0 16px;
  font-family: var(--ds-sans);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-signup-gate__primary {
  width: 100%;
  margin-top: 4px;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-signup-gate__github {
  width: 100%;
  border-color: var(--ds-btn-border);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-signup-gate__github:hover {
  border-color: var(--ds-control-border-hover);
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-signup-gate__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ds-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .ds-signup-gate__divider::before,
.restory-ds[data-warm-studio] .ds-signup-gate__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-signup-gate__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 32px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font-size: 14px;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-signup-gate__link {
  color: var(--ds-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(25, 100, 86, 0.35);
  text-underline-offset: 3px;
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-signup-gate__link:hover {
  color: var(--ds-accent-hover);
  text-decoration-color: var(--ds-accent-hover);
}

/* The three opt-in markers this card publishes: `.ds-signup-gate--email` on the
   email gate, `.ds-signup-gate--github` on the GitHub completion gate and
   `.ds-signup-gate--entry` on the throttled entry. All three reuse the sections
   above, so only the completion gate's verified identity band and the entry's
   recovery actions need declarations of their own. */
.restory-ds[data-warm-studio] .ds-signup-gate .detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px 32px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ds-signup-gate .detail-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  font-size: 14.5px;
}

.restory-ds[data-warm-studio] .ds-signup-gate .detail-row dt {
  color: var(--ds-muted);
  font-weight: 500;
}

.restory-ds[data-warm-studio] .ds-signup-gate .detail-row dd {
  margin: 0;
  color: var(--ds-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The reviewed "GitHub identity verified" badge; other screens publish the same
   live tone locally, so the signup gate carries its own copy. */
.restory-ds[data-warm-studio] .ds-signup-gate .ds-badge--live {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-signup-gate .ds-badge__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--ds-radius-pill);
  background: currentColor;
}

/* The throttled entry offers recovery actions instead of a form. */
.restory-ds[data-warm-studio] .ds-signup-gate--entry .ds-btn {
  width: 100%;
}

/* The reviewed 390px composition: the whole card including its footer stays
   above the first 900px fold. */
@media (max-width: 640px) {
  .restory-ds[data-warm-studio] .ds-gate:has(.ds-signup-gate) .ds-gate__bar {
    min-height: 50px;
    padding: 0 16px;
  }

  .restory-ds[data-warm-studio] .ds-gate__body:has(.ds-signup-gate) {
    padding: 16px 16px 24px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate__head {
    gap: 6px;
    padding: 18px 18px 14px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate__title {
    font-size: 22px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate__band {
    padding: 11px 18px;
    font-size: 13.5px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate__body {
    gap: 14px;
    padding: 16px 18px 18px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate .ds-input {
    font-size: 16px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate__foot {
    padding: 12px 18px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate .detail-list {
    gap: 10px;
    padding: 14px 18px;
  }

  .restory-ds[data-warm-studio] .ds-signup-gate .detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
    font-size: 14px;
  }
}

/* ============================================================================
   Reports — Overview
   Owner data only; geometry uses SVG attributes and staged classes.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-overview {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.restory-ds[data-warm-studio] .ds-report-panel__status {
  margin: 0 0 4px;
  color: var(--ds-faint);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.restory-ds[data-warm-studio] .ds-kpi {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .ds-kpi__label {
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-kpi__value {
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 31px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.restory-ds[data-warm-studio] .ds-kpi__detail {
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 15px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-kpi__note {
  color: var(--ds-faint);
  font-size: 13.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-overview__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.restory-ds[data-warm-studio] .ds-card {
  min-width: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-xs);
  padding: 20px;
}

.restory-ds[data-warm-studio] .ds-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.restory-ds[data-warm-studio] .ds-card__head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-eyebrow {
  margin: 0;
  color: var(--ds-accent);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-card__sub {
  max-width: 58ch;
  color: var(--ds-muted);
  font-size: 15px;
  line-height: 1.45;
}

/* The SVG viewBox is the rendered text floor: never scale a chart below its
   natural 512px width, and scroll the figure instead of shrinking its ticks. */
.restory-ds[data-warm-studio] .ds-chart {
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: hidden;
}

.restory-ds[data-warm-studio] .ds-chart__svg {
  display: block;
  width: 100%;
  min-width: 512px;
  height: auto;
  overflow: visible;
}

.restory-ds[data-warm-studio] .ds-chart__grid {
  stroke: var(--ds-line-2);
  stroke-width: 1;
}

.restory-ds[data-warm-studio] .ds-chart__axis {
  stroke: var(--ds-panel-border);
  stroke-width: 1;
}

.restory-ds[data-warm-studio] .ds-chart__tick {
  fill: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .ds-chart__overflow {
  fill: var(--ds-waypoint-fg);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-chart__caption {
  margin-top: 6px;
  color: var(--ds-faint);
  font-size: 13.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-chart__bar {
  fill: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-model-1 {
  fill: #3d617d;
  background-color: #3d617d;
}

.restory-ds[data-warm-studio] .ds-model-2 {
  fill: #7466a1;
  background-color: #7466a1;
}

.restory-ds[data-warm-studio] .ds-model-3 {
  fill: #a98236;
  background-color: #a98236;
}

.restory-ds[data-warm-studio] .ds-model-4 {
  fill: #5b7768;
  background-color: #5b7768;
}

.restory-ds[data-warm-studio] .ds-model-5 {
  fill: #8b8b84;
  background-color: #8b8b84;
}

.restory-ds[data-warm-studio] .ds-cohort-clean {
  fill: #2f7d4f;
  background-color: #2f7d4f;
}

.restory-ds[data-warm-studio] .ds-cohort-repair {
  fill: var(--ds-waypoint);
  background-color: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .ds-cohort-stalled {
  fill: #66707b;
  background-color: #66707b;
}

.restory-ds[data-warm-studio] .ds-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
}

.restory-ds[data-warm-studio] .ds-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.restory-ds[data-warm-studio] .ds-legend__item.ds-model-1 .ds-legend__swatch {
  background: #3d617d;
}

.restory-ds[data-warm-studio] .ds-legend__item.ds-model-2 .ds-legend__swatch {
  background: #7466a1;
}

.restory-ds[data-warm-studio] .ds-legend__item.ds-model-3 .ds-legend__swatch {
  background: #a98236;
}

.restory-ds[data-warm-studio] .ds-legend__item.ds-model-4 .ds-legend__swatch {
  background: #5b7768;
}

.restory-ds[data-warm-studio] .ds-legend__item.ds-model-5 .ds-legend__swatch {
  background: #8b8b84;
}

.restory-ds[data-warm-studio] .ds-token-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ds-line-2);
}

.restory-ds[data-warm-studio] .ds-token-totals > div {
  display: grid;
  gap: 2px;
}

.restory-ds[data-warm-studio] .ds-token-totals dt {
  color: var(--ds-muted);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-token-totals dd {
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .ds-cohort-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ds-line-2);
}

.restory-ds[data-warm-studio] .ds-cohort-list > div {
  display: grid;
  grid-template-columns: minmax(132px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.restory-ds[data-warm-studio] .ds-cohort-list dt {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-cohort-list dd {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .ds-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--ds-radius-pill);
  background: currentColor;
}

.restory-ds[data-warm-studio] .ds-dot.ds-cohort-clean {
  background: #2f7d4f;
}

.restory-ds[data-warm-studio] .ds-dot.ds-cohort-repair {
  background: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .ds-dot.ds-cohort-stalled {
  background: #66707b;
}

.restory-ds[data-warm-studio] .ds-runs {
  margin-top: 2px;
}

.restory-ds[data-warm-studio] .ds-runs__count {
  flex: none;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-caveat {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid var(--ds-waypoint-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-waypoint-bg);
  color: var(--ds-waypoint-fg);
  font-size: 15px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .ds-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .ds-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.restory-ds[data-warm-studio] .ds-table th {
  padding: 7px 10px;
  border-bottom: 1px solid var(--ds-panel-border);
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ds-line);
  color: var(--ds-ink-2);
  font-size: 15px;
  vertical-align: baseline;
}

.restory-ds[data-warm-studio] .ds-table td.ds-mono {
  font-size: 13.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-runs__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ds-line-2);
}

.restory-ds[data-warm-studio] .ds-slowest {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-slowest__label {
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-runs__actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ds-overview .ds-btn--quiet {
  background: var(--ds-panel-2);
  border-color: var(--ds-btn-border);
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .ds-overview .ds-btn--quiet:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-nowrap {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .restory-ds[data-warm-studio] .ds-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .restory-ds[data-warm-studio] .ds-overview__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .restory-ds[data-warm-studio] .ds-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .ds-token-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .restory-ds[data-warm-studio] .ds-runs__foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Reports page chrome and compact overview composition. */
.restory-ds[data-warm-studio] .ds-reports {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 1240px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.restory-ds[data-warm-studio] .ds-page-head h1 {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.restory-ds[data-warm-studio] .ds-page-head .ds-eyebrow {
  margin: 0 0 1px;
}

.restory-ds[data-warm-studio] .ds-page-head .ds-muted {
  margin: 3px 0 0;
  color: var(--ds-muted);
  font-size: 15px;
}

.restory-ds[data-warm-studio] .ds-muted {
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ds-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-tab {
  margin-bottom: -1px;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  color: var(--ds-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-tab:hover {
  color: var(--ds-ink);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-tab--active {
  border-bottom-color: var(--ds-accent);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ds-segmented {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ds-segment {
  padding: 4px 12px;
  border-radius: var(--ds-radius-pill);
  color: var(--ds-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-segment:hover {
  color: var(--ds-ink);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ds-segment--active {
  background: var(--ds-panel);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .ds-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ds-report-meta > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-report-meta dt {
  color: var(--ds-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-report-meta dd {
  margin: 0;
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .ds-report-meta dd[data-reports-bounds] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.restory-ds[data-warm-studio] .ds-report-panel {
  display: grid;
  gap: 0;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-report-panel__status {
  margin: 0;
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-report-panel__notice {
  margin: 0 0 4px;
  color: var(--ds-status-warn-fg);
  font-size: 13.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-overview {
  gap: 12px;
  margin-top: 0;
}

.restory-ds[data-warm-studio] .ds-kpis {
  gap: 10px;
}

.restory-ds[data-warm-studio] .ds-kpi {
  gap: 3px;
  padding: 12px 14px;
}

.restory-ds[data-warm-studio] .ds-kpi__label {
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .ds-kpi__value {
  font-size: 27px;
}

.restory-ds[data-warm-studio] .ds-kpi__detail {
  font-size: 15px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-kpi__note {
  font-size: 15px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-overview__grid {
  gap: 12px;
}

.restory-ds[data-warm-studio] .ds-card {
  padding: 16px;
}

.restory-ds[data-warm-studio] .ds-card h2 {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.restory-ds[data-warm-studio] .ds-card__head {
  gap: 10px;
}

.restory-ds[data-warm-studio] .ds-card__head > .ds-btn {
  flex: none;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-card__sub {
  font-size: 15px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-chart {
  margin-top: 8px;
}

.restory-ds[data-warm-studio] .ds-spend .ds-chart__svg {
  max-height: 176px;
}

.restory-ds[data-warm-studio] .ds-chart__caption {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-legend {
  gap: 4px 14px;
  margin-top: 6px;
}

.restory-ds[data-warm-studio] .ds-legend__item {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-token-totals {
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
}

.restory-ds[data-warm-studio] .ds-token-totals dt {
  font-size: 12px;
}

.restory-ds[data-warm-studio] .ds-token-totals dd {
  font-size: 14px;
}

.restory-ds[data-warm-studio] .ds-cohort-list {
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
}

.restory-ds[data-warm-studio] .ds-cohort-list dt {
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .ds-cohort-list dd {
  font-size: 13.5px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-runs {
  margin-top: 0;
}

.restory-ds[data-warm-studio] .ds-table-wrap {
  margin-top: 8px;
}

.restory-ds[data-warm-studio] .ds-table th {
  padding: 6px 9px;
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .ds-table td {
  padding: 6px 9px;
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-table td.ds-mono {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-caveat {
  margin-top: 8px;
  padding: 7px 10px;
  font-size: 13.5px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-runs__foot {
  margin-top: 10px;
  padding-top: 10px;
}

.restory-ds[data-warm-studio] .ds-reports__controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .ds-reports__controls .ds-tabs {
  margin-bottom: -1px;
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .ds-reports__controls .ds-segmented {
  margin-bottom: 5px;
}

.restory-ds[data-warm-studio] .ds-card {
  padding: 12px 14px;
}

.restory-ds[data-warm-studio] .ds-card h2 {
  font-size: 18px;
}

.restory-ds[data-warm-studio] .ds-card__sub {
  font-size: 15px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-chart {
  margin-top: 6px;
}

.restory-ds[data-warm-studio] .ds-spend .ds-chart__svg {
  max-height: none;
}

.restory-ds[data-warm-studio] .ds-chart__caption {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-legend {
  gap: 2px 12px;
  margin-top: 4px;
}

.restory-ds[data-warm-studio] .ds-legend__item {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-token-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 6px;
  padding-top: 6px;
}

.restory-ds[data-warm-studio] .ds-token-totals > div {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.restory-ds[data-warm-studio] .ds-token-totals dt {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-token-totals dd {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-cohort-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding-top: 6px;
}

.restory-ds[data-warm-studio] .ds-cohort-list > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ds-cohort-list dt {
  font-size: 15px;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .ds-cohort-list dd {
  font-size: 13.5px;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .ds-cohort-list dt {
  flex: none;
}

.restory-ds[data-warm-studio] .ds-cohort-list dd {
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-legend__item.ds-model-1,
.restory-ds[data-warm-studio] .ds-legend__item.ds-model-2,
.restory-ds[data-warm-studio] .ds-legend__item.ds-model-3,
.restory-ds[data-warm-studio] .ds-legend__item.ds-model-4,
.restory-ds[data-warm-studio] .ds-legend__item.ds-model-5 {
  background: transparent;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .ds-runs .ds-card__head {
  align-items: baseline;
}

.restory-ds[data-warm-studio] .ds-runs {
  margin-top: -2px;
}

.restory-ds[data-warm-studio] .ds-reports {
  gap: 8px;
}

.restory-ds[data-warm-studio] .ds-tab {
  padding: 6px 10px;
}

.restory-ds[data-warm-studio] .ds-segmented {
  padding: 2px;
}

.restory-ds[data-warm-studio] .ds-segment {
  padding: 3px 10px;
}

.restory-ds[data-warm-studio] .ds-report-meta {
  gap: 4px 22px;
  padding: 5px 12px;
}

.restory-ds[data-warm-studio] .ds-report-meta dt {
  font-size: 10.5px;
}

.restory-ds[data-warm-studio] .ds-report-meta dd {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-overview {
  gap: 8px;
}

.restory-ds[data-warm-studio] .ds-kpis {
  gap: 8px;
}

.restory-ds[data-warm-studio] .ds-kpi {
  padding: 10px 12px;
}

.restory-ds[data-warm-studio] .ds-kpi__label {
  font-size: 11px;
}

.restory-ds[data-warm-studio] .ds-kpi__value {
  font-size: 25px;
}

.restory-ds[data-warm-studio] .ds-kpi__detail {
  font-size: 15px;
}

.restory-ds[data-warm-studio] .ds-kpi__note {
  font-size: 15px;
}

.restory-ds[data-warm-studio] .ds-overview__grid {
  gap: 10px;
}

.restory-ds[data-warm-studio] .ds-card {
  padding: 10px 12px;
}

.restory-ds[data-warm-studio] .ds-card h2 {
  font-size: 17px;
}

.restory-ds[data-warm-studio] .ds-caveat {
  margin-top: 6px;
  padding: 5px 8px;
  font-size: 15px;
}

.restory-ds[data-warm-studio] .ds-runs__count {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-table-wrap {
  margin-top: 6px;
}

.restory-ds[data-warm-studio] .ds-table th {
  padding: 5px 8px;
  font-size: 11px;
}

.restory-ds[data-warm-studio] .ds-table td {
  padding: 5px 8px;
  font-size: 15px;
}

.restory-ds[data-warm-studio] .ds-table td.ds-mono {
  font-size: 13.5px;
}

/* The run-table cost basis and the slowest-stage footer inherit the mono data
   surface from their cell; keep that inherited hint at the 13.5px data floor. */
.restory-ds[data-warm-studio] .ds-overview .ds-hint {
  font-size: 13.5px;
}

@media (max-width: 760px) {
  .restory-ds[data-warm-studio] .ds-page-head,
  .restory-ds[data-warm-studio] .ds-runs__foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .restory-ds[data-warm-studio] .ds-tabs {
    overflow-x: auto;
  }

  .restory-ds[data-warm-studio] .ds-reports__controls {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 6px;
  }

  .restory-ds[data-warm-studio] .ds-reports__controls .ds-segmented {
    margin-bottom: 0;
  }
}

/* ============================================================================
   Reports — Stage bottlenecks
   One shared axis; overflow keeps its exact value in the p90 cell. Geometry
   stays in SVG attributes, so no inline style is needed here.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-bottlenecks {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__lanes,
.restory-ds[data-warm-studio] .ds-bottlenecks__tail {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__empty {
  margin: 6px 0 0;
  padding: 8px 10px;
  border: 1px dashed var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-size: 15px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-bottlenecks .ds-hint {
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .ds-lanes {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}

.restory-ds[data-warm-studio] .ds-lanes th {
  padding: 5px 8px;
  border-bottom: 1px solid var(--ds-panel-border);
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-lanes tbody tr:hover th,
.restory-ds[data-warm-studio] .ds-lanes tbody tr:hover td,
.restory-ds[data-warm-studio] .ds-bottlenecks__tail-table tbody tr:hover td {
  background: var(--ds-chrome-hi);
}

.restory-ds[data-warm-studio] .ds-lanes td,
.restory-ds[data-warm-studio] .ds-lanes tbody th {
  padding: 4px 8px;
  border-bottom: 1px solid var(--ds-line);
  color: var(--ds-ink-2);
  font-size: 13.5px;
  vertical-align: middle;
}

.restory-ds[data-warm-studio] .ds-lanes tbody th {
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-lanes__stage {
  width: 270px;
}

.restory-ds[data-warm-studio] .ds-lanes__track-col {
  width: auto;
}

.restory-ds[data-warm-studio] .ds-lanes__num {
  width: 84px;
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-lanes__label {
  display: inline-block;
  margin-right: 8px;
}

.restory-ds[data-warm-studio] .ds-lanes tbody th .ds-hint {
  display: inline-block;
  margin-right: 8px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .ds-lanes__axis {
  display: block;
  width: 100%;
  min-width: 460px;
  height: auto;
  overflow: visible;
}

.restory-ds[data-warm-studio] .ds-lanes__grid {
  stroke: var(--ds-line-2);
  stroke-width: 1;
}

.restory-ds[data-warm-studio] .ds-lanes__tick {
  fill: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .ds-lanes__track {
  display: block;
  width: 100%;
  height: 14px;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-lanes__bar {
  fill: var(--ds-accent);
  opacity: 0.28;
}

.restory-ds[data-warm-studio] .ds-lanes__p90 {
  fill: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .ds-lanes__overflow {
  margin-left: 3px;
  color: var(--ds-waypoint-fg);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-weight: 700;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__rows {
  display: grid;
  gap: 1px;
  margin: 6px 0 0;
  padding: 0;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 70px;
  align-items: baseline;
  gap: 10px;
  padding: 4px 2px;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .ds-bottlenecks__rows dt {
  min-width: 0;
  color: var(--ds-ink-2);
  font-size: 15px;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__rows dd {
  margin: 0;
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__rows--findings > div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__row--untyped {
  border-left: 2px solid var(--ds-waypoint);
  padding-left: 8px;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__row--untyped dt {
  color: var(--ds-waypoint-fg);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__row--untyped .ds-dot {
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__basis {
  margin: 6px 0 0;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .ds-bottlenecks__tail-table {
  min-width: 640px;
}

.restory-ds[data-warm-studio] .ds-bottlenecks__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ds-line-2);
}

.restory-ds[data-warm-studio] .ds-bottlenecks__caveat {
  margin-top: 0;
}

@media (max-width: 1180px) {
  .restory-ds[data-warm-studio] .ds-bottlenecks__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .restory-ds[data-warm-studio] .ds-bottlenecks__summary,
  .restory-ds[data-warm-studio] .ds-bottlenecks__split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .restory-ds[data-warm-studio] .ds-bottlenecks__foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ============================================================================
   Reports — Model & cost
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .ds-model-cost {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Quiet cost-basis strip: one uniform 1px border on all four sides. */
.restory-ds[data-warm-studio] .ds-cost-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 11px 16px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .ds-cost-strip__text {
  min-width: 0;
  max-width: 96ch;
}

.restory-ds[data-warm-studio] .ds-cost-strip .ds-mono,
.restory-ds[data-warm-studio] .ds-cost-strip .ds-badge {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-cost-strong {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-cost-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 14px;
  align-items: stretch;
}

.restory-ds[data-warm-studio] .ds-cost-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.restory-ds[data-warm-studio] .ds-cost-panel__total {
  color: var(--ds-ink-2);
  font-size: 13.5px;
  white-space: nowrap;
}

/* Mono data never drops below the 13.5px floor on this view. */
.restory-ds[data-warm-studio] .ds-model-cost .ds-hint {
  font-size: 13.5px;
  line-height: 1.35;
}

.restory-ds[data-warm-studio] .ds-model-cost .ds-quiet-link {
  color: var(--ds-accent);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-model-cost .ds-quiet-link:hover,
.restory-ds[data-warm-studio] .ds-model-cost .ds-quiet-link:focus-visible {
  text-decoration: underline;
}

.restory-ds[data-warm-studio] .ds-cost-empty {
  margin: 6px 0 0;
  padding: 8px 10px;
  border: 1px dashed var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-size: 15px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-cost-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.restory-ds[data-warm-studio] .ds-cost-bar {
  display: grid;
  grid-template-columns: minmax(148px, 1.2fr) minmax(0, 2fr) 64px 76px;
  gap: 10px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
}

.restory-ds[data-warm-studio] .ds-cost-bar__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-cost-bar__role {
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 15px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-cost-bar__model {
  color: var(--ds-ink-2);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-cost-bar__model--quiet {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .ds-cost-track {
  display: block;
  width: 100%;
  height: 16px;
  border-radius: 5px;
  background: var(--ds-rail);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-cost-neutral {
  fill: var(--ds-faint);
  background-color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .ds-cost-bar__calls,
.restory-ds[data-warm-studio] .ds-cost-bar__share {
  color: var(--ds-faint);
  font-size: 13.5px;
  text-align: right;
}

.restory-ds[data-warm-studio] .ds-cost-bar__spend {
  color: var(--ds-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: right;
}

.restory-ds[data-warm-studio] .ds-cost-models {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ds-cost-model {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 52px 76px;
  gap: 10px;
  align-items: center;
  padding: 5px 6px;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .ds-cost-model:last-child {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .ds-cost-swatch {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.restory-ds[data-warm-studio] .ds-cost-model__id {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-cost-model__key {
  color: var(--ds-ink);
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-cost-model__share {
  color: var(--ds-faint);
  font-size: 13.5px;
  text-align: right;
}

.restory-ds[data-warm-studio] .ds-cost-model__spend {
  color: var(--ds-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: right;
}

/* Pinned panel footer: it stays at the panel's bottom edge, above the fold
   wherever both focal panels share one row. */
.restory-ds[data-warm-studio] .ds-cost-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--ds-line-2);
  color: var(--ds-faint);
  font-size: 13.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-cost-unpriced + .ds-cost-unpriced::before {
  content: "· ";
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .ds-cost-note {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--ds-line-2);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .ds-cost-accounting .ds-table td,
.restory-ds[data-warm-studio] .ds-cost-accounting .ds-table th {
  vertical-align: top;
}

.restory-ds[data-warm-studio] .ds-cost-table {
  min-width: 900px;
}

.restory-ds[data-warm-studio] .ds-cost-table .ds-mono {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-cost-table .ds-badge {
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .ds-cost-table__num {
  text-align: right;
}

.restory-ds[data-warm-studio] .ds-cost-table__spend {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-cost-table__models {
  display: block;
  color: var(--ds-faint);
  letter-spacing: normal;
  text-transform: none;
}

@media (max-width: 1180px) {
  .restory-ds[data-warm-studio] .ds-cost-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .restory-ds[data-warm-studio] .ds-cost-strip,
  .restory-ds[data-warm-studio] .ds-cost-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ============================================================================
   Design package detail shell (`/designs/:slug`, step 1)
   ============================================================================

   Host-level rules only: the sub-header, the one withheld-command notice and
   the single body state region. The design canvas module owns its own scoped
   stage, strip and inspector rules; nothing from that module is copied here. */

.restory-ds[data-warm-studio] .design-detail {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 1360px;
}

.restory-ds[data-warm-studio] .design-detail__subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .design-detail__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.restory-ds[data-warm-studio] .design-detail__crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .design-detail__crumb {
  color: inherit;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .design-detail__crumb:hover {
  color: var(--ds-pine);
}

.restory-ds[data-warm-studio] .design-detail__crumb-sep {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .design-detail__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.restory-ds[data-warm-studio] .design-detail__path {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .design-detail__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .design-detail__modes {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .design-detail__mode {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--ds-radius-control);
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .design-detail__mode[aria-current="page"] {
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 32, 0.08);
}

.restory-ds[data-warm-studio] .design-detail__mode:disabled,
.restory-ds[data-warm-studio] .design-detail__publish:disabled,
.restory-ds[data-warm-studio] .design-detail__start:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.restory-ds[data-warm-studio] .design-detail__notice {
  margin: 0;
  padding: 9px 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-canvas);
  color: var(--ds-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .design-detail__state {
  display: grid;
  gap: 12px;
  padding: 22px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .design-detail__body {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.restory-ds[data-warm-studio] .design-detail__body-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 18px;
  line-height: 1.25;
}

.restory-ds[data-warm-studio] .design-detail__body-copy {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.restory-ds[data-warm-studio] .design-detail__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 20px;
  margin: 4px 0 0;
}

.restory-ds[data-warm-studio] .design-detail__fact dt {
  color: var(--ds-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .design-detail__fact dd {
  margin: 2px 0 0;
  color: var(--ds-ink-2);
  font-size: 14px;
}

/* ----------------------------------------------------------------------------
   Package health (Relations & health tab, findings state)

   The owner's findings are the reason this state exists, so each one is a
   bordered row with its own severity chip, location and one repair entry point.
   The row tones come from the same status tokens the rest of the shell uses;
   nothing here re-derives a level or hides a row.
   ------------------------------------------------------------------------- */

.restory-ds[data-warm-studio] .design-health {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .design-health__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .design-health__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .design-health__findings {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One compact row: the level and its location lead, the single repair entry
   point sits beside them, and the message spans the row under both. The whole
   finding set then fits the inspector's first viewport instead of pushing its
   last row under the panel edge. */
.restory-ds[data-warm-studio] .design-health__finding {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid var(--ds-panel-border);
  border-left-width: 3px;
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
}

/* The chip carries the level; the left edge repeats it as a tone. */
.restory-ds[data-warm-studio] .design-health__finding[data-design-health-finding="fail"] {
  border-left-color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .design-health__finding[data-design-health-finding="missing_capture"] {
  border-left-color: var(--ds-status-warn-border);
}

.restory-ds[data-warm-studio] .design-health__finding[data-design-health-finding="warning"] {
  border-left-color: var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .design-health__finding-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  grid-column: 1;
  gap: 6px 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .design-health__finding-where {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .design-health__finding-copy {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .design-health__finding > .ds-btn {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
}

/* ----------------------------------------------------------------------------
   Produced inspector footer (Relations & health tab, findings state)

   The reference pins a status strip at the bottom of the inspector. This one
   reports only the facts the owner supplies: the active tab, the linked scope
   (or the package path when nothing is linked), the capture accounting and the
   owner's lint state. Its container is the canvas inspector's footer region,
   outside the body's scrollport, so the strip holds the panel edge while the
   body scrolls.
   ------------------------------------------------------------------------- */

.restory-ds[data-warm-studio] .design-inspector__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 16px;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .design-inspector__footer-scope {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .design-inspector__footer-link {
  overflow: hidden;
  color: var(--ds-ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .design-inspector__footer-facts {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   Scaffold state (`:empty` with planned entries, `/designs/:slug` step 4)

   One centered card on the canvas stage: the owner's ordered planned inventory,
   the withheld generate control and the thread entry point. The canvas module
   still owns the stage, the strip, the inspector and the thread; only this card,
   the planned badge and the truthful scaffold footer are added here.
   ------------------------------------------------------------------------- */

/* The scaffold composes the full canvas + inspector split, so it is not held to
   the single-column body width the other state panels use. */
.restory-ds[data-warm-studio] .design-detail__body--scaffold {
  max-width: none;
}

/* The reference centers the planned-inventory card in the dot-grid stage. */
.restory-ds[data-warm-studio] .design-detail__body--scaffold .ws-dc__slot {
  flex: 1;
  justify-content: center;
}

.restory-ds[data-warm-studio] .design-detail__planned {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-canvas);
  color: var(--ds-ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* The produced header's capture tally is the owner's own accounting for the
   canvas set, printed beside the view-mode controls. */
.restory-ds[data-warm-studio] .design-detail__tally {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-canvas);
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 12px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .design-scaffold {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .design-scaffold__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.restory-ds[data-warm-studio] .design-scaffold__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 10px;
  background: var(--ds-canvas);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .design-scaffold__icon svg {
  width: 20px;
  height: 20px;
}

.restory-ds[data-warm-studio] .design-scaffold__summary {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .design-scaffold__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.restory-ds[data-warm-studio] .design-scaffold__copy {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.restory-ds[data-warm-studio] .design-scaffold__path {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ds-canvas);
  font-family: var(--ds-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .design-scaffold__list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-canvas);
  list-style: none;
}

.restory-ds[data-warm-studio] .design-scaffold__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .design-scaffold__row:first-child {
  border-top: 0;
}

.restory-ds[data-warm-studio] .design-scaffold__select {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .design-scaffold__select:hover {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .design-scaffold__select[aria-pressed="true"] {
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .design-scaffold__step {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .design-scaffold__label {
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .design-scaffold__meta {
  color: var(--ds-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .design-scaffold__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .design-scaffold__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--ds-panel-border);
  color: var(--ds-muted);
  font-size: 12.5px;
}

/* ----------------------------------------------------------------------------
   Scaffold fold geometry (`:empty` with planned entries, step 4 parity repair)

   The reference screen is a full-height page: the sub-header and the withheld
   notice keep their natural height, the canvas split takes the remainder and
   the inspector column owns the fold. Without that chain the inspector grows
   with its content, so its body is cut at the viewport edge and the owner-fact
   footer sits below the fold. Only height is composed here; the canvas module
   keeps its own stage, strip, tab and inspector tones. The single-column layout
   below 1181px keeps the normally scrolling page.
   ------------------------------------------------------------------------- */

@media (min-width: 1181px) {
  .restory-ds[data-warm-studio] .ds-app:has(.design-detail__body--scaffold) > .ds-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* The full-height split owns the fold, so the page keeps only the gutter
       the reference leaves under the inspector's footer strip. */
    padding-bottom: 24px;
    overflow: hidden;
  }

  .restory-ds[data-warm-studio] .ds-app:has(.design-detail__body--scaffold) .design-detail {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .restory-ds[data-warm-studio]
    .ds-app:has(.design-detail__body--scaffold)
    .design-detail
    > * {
    flex: 0 0 auto;
  }

  .restory-ds[data-warm-studio]
    .ds-app:has(.design-detail__body--scaffold)
    .design-detail__state {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .restory-ds[data-warm-studio] .design-detail__body--scaffold {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .restory-ds[data-warm-studio] .design-detail__body--scaffold > * {
    flex: 1 1 auto;
    min-height: 0;
  }

  .restory-ds[data-warm-studio] .design-detail__body--scaffold .ws-dc__layout {
    flex: 1 1 auto;
    align-items: stretch;
    min-height: 0;
  }

  .restory-ds[data-warm-studio] .design-detail__body--scaffold .ws-dc__inspector {
    min-height: 0;
  }

  /* One bounded scroll region: the inspector's own body scrolls and its last
     row is the docked owner-fact footer instead of an unreachable sentence.
     The scaffold's inspector supplies its own padding so the footer strip can
     reach the panel edge; the row then owns the scrollport. */
  .restory-ds[data-warm-studio] .design-detail__body--scaffold .ws-dc__inspector-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }

  /* The thread pane replaces the inspector body and keeps the padded, scrolled
     column the pane list was drawn against. */
  .restory-ds[data-warm-studio]
    .design-detail__body--scaffold
    .ws-dc__inspector-body[data-ws-dc-thread-pane] {
    padding: 16px;
    overflow-y: auto;
  }

  .restory-ds[data-warm-studio] .design-detail__body--scaffold .design-inspector {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 16px 16px 0;
    overflow-y: auto;
  }

  .restory-ds[data-warm-studio] .design-detail__body--scaffold .design-scaffold__footer {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin: 4px -16px 0;
    padding: 10px 16px 12px;
    background: var(--ds-panel);
  }
}

/* The produced route composes the same full-height split on its own canvas:
   the sub-header and the withheld notice keep their natural height, the canvas
   split takes the remainder and the inspector column owns the fold. Without the
   chain the produced canvas and inspector grow together, so the inspector's
   last finding row is cut at the viewport edge and its owner-fact footer sits
   below it. The stage becomes the scrollport for the card grid, so a card below
   the fold stays reachable instead of being clipped by the composed height.
   Only height is composed here; the canvas module keeps its own stage, strip,
   tab and inspector tones, and the single-column layout below 1181px keeps the
   normally scrolling page. */

@media (min-width: 1181px) {
  .restory-ds[data-warm-studio] .ds-app:has([data-design-body="produced"]) > .ds-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 24px;
    overflow: hidden;
  }

  .restory-ds[data-warm-studio]
    .ds-app:has([data-design-body="produced"])
    .design-detail {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .restory-ds[data-warm-studio]
    .ds-app:has([data-design-body="produced"])
    .design-detail
    > * {
    flex: 0 0 auto;
  }

  .restory-ds[data-warm-studio]
    .ds-app:has([data-design-body="produced"])
    .design-detail__state {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  /* The produced body is the canvas host itself, so it is selected by its
     owner-fact attribute rather than by a body class. */
  .restory-ds[data-warm-studio] [data-design-body="produced"] {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .restory-ds[data-warm-studio] [data-design-body="produced"] > * {
    flex: 1 1 auto;
    min-height: 0;
  }

  .restory-ds[data-warm-studio] [data-design-body="produced"] .ws-dc {
    flex: 1 1 auto;
    min-height: 0;
  }

  .restory-ds[data-warm-studio] [data-design-body="produced"] .ws-dc__layout {
    flex: 1 1 auto;
    align-items: stretch;
    min-height: 0;
  }

  /* The stage scrolls its own card grid: the split now owns the fold, so a
     second and third card row would otherwise be cut by the composed height. */
  .restory-ds[data-warm-studio] [data-design-body="produced"] .ws-dc__stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .restory-ds[data-warm-studio] [data-design-body="produced"] .ws-dc__inspector {
    min-height: 0;
  }

  /* One bounded scroll region for the inspector column: the relations, health
     and guide rows scroll inside the panel instead of running past the fold. */
  .restory-ds[data-warm-studio] [data-design-body="produced"] .ws-dc__inspector-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}

/* The scaffold inspector's document head is compact: the reference puts the
   document name and its path on one line above the body instead of a title
   block that pushes the body past the fold. */
.restory-ds[data-warm-studio] .design-detail__body--scaffold .design-doc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.restory-ds[data-warm-studio] .design-detail__body--scaffold .design-doc__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .design-detail__body--scaffold .design-doc__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 15px;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .design-detail__body--scaffold .design-doc__path {
  margin: 0;
  overflow: hidden;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The brief head already names the document, so the editor's own path crumb has
   no room in the narrow inspector and would be squeezed to a clipped glyph.
   The host keeps one path and the editor toolbar keeps its controls right. */
.restory-ds[data-warm-studio]
  .design-detail__body--scaffold
  .design-doc[data-design-doc="brief"]
  .ws-files__crumb {
  display: none;
}

.restory-ds[data-warm-studio]
  .design-detail__body--scaffold
  .design-doc[data-design-doc="brief"]
  .ws-files__toolbar {
  justify-content: flex-end;
}

/* The thread composer is a reserved, withheld command surface: it keeps the
   composer shape but reads as inert, never as a live field awaiting input. */
.restory-ds[data-warm-studio]
  .design-detail
  .ds-input.design-thread__input--withheld,
.restory-ds[data-warm-studio]
  .design-detail
  .design-thread__input--withheld:disabled {
  border: 1px dashed var(--ds-panel-border);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-input-border);
  cursor: not-allowed;
  opacity: 0.85;
  resize: none;
}

.restory-ds[data-warm-studio]
  .design-detail
  .design-thread__input--withheld::placeholder {
  color: var(--ds-input-border);
  opacity: 1;
}

@media (max-width: 900px) {
  .restory-ds[data-warm-studio] .design-detail {
    max-width: 100%;
  }

  .restory-ds[data-warm-studio] .design-detail__subheader {
    align-items: flex-start;
  }
}
/* ============================================================================
   Account & emails (`/account`)

   Screen 8 consolidates the legacy dashboard and email pages. Every rule in
   this block is scoped under `.account-screen`, so the shell, the workspace
   destinations and the sibling account screens are unchanged. Shared surfaces
   (panel, focal panel, badge, notice, button, select) come from the design
   system above; only the header, the two rosters, the inline add band, the
   removal dialog body and the narrow-document stacking are new here.
   ============================================================================ */

/* The frame grid already reserves the 44px top bar. The base `.ds-main`
   min-height of 100dvh would overflow that row by the top bar's height and
   let the frame scroll the top bar out of view, including when the removal
   dialog's focus fallback targets `#warm-studio-main`. */
.restory-ds[data-warm-studio] .ds-app:has(.account-screen) > .ds-main {
  max-width: 1080px;
  min-height: 0;
}

.restory-ds[data-warm-studio] .account-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 32px 32px;
}

.restory-ds[data-warm-studio] .account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .account-head-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .account-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .account-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .account-subtitle {
  margin: 0;
  max-width: 76ch;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .account-notice-text {
  flex: 1 1 auto;
  min-width: 0;
}

.restory-ds[data-warm-studio] .account-notice-action {
  flex: 0 0 auto;
}

.restory-ds[data-warm-studio] .account-mono {
  font-family: var(--ds-mono);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .account-strong {
  color: var(--ds-ink);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .account-focal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
}

.restory-ds[data-warm-studio] .account-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px 18px;
}

.restory-ds[data-warm-studio] .account-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .account-panel-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .account-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .account-panel-meta {
  color: var(--ds-ink-2);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .account-focal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.restory-ds[data-warm-studio] .account-focal-copy {
  margin: 0;
  max-width: 82ch;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

.restory-ds[data-warm-studio] .account-focal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Per-screen design-system variants: the base `.ds-badge` has a transparent
   border and no fill and declares no dot, so this screen declares the two
   variants and the dot it uses. They stay scoped to `.account-screen`. */
.restory-ds[data-warm-studio] .account-screen .ds-badge--live {
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .account-screen .ds-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.restory-ds[data-warm-studio] .account-screen .ds-btn--sm {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .account-screen .ds-btn--quiet {
  border-color: var(--ds-btn-border);
  background: transparent;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .account-screen .ds-btn--quiet:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .account-table-wrap {
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .account-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-ink-2);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .account-table td {
  padding: 11px 10px;
  vertical-align: top;
  color: var(--ds-ink);
  border-bottom: 1px solid var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .account-table tbody tr:last-child td {
  border-bottom: 0;
}

.restory-ds[data-warm-studio] .account-table .account-cell-primary {
  color: var(--ds-ink);
  font-weight: 500;
}

.restory-ds[data-warm-studio] .account-table .account-verified-cell {
  white-space: nowrap;
  color: var(--ds-ink-2);
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .account-table .account-col-right {
  text-align: right;
}

.restory-ds[data-warm-studio] .account-table .account-cell-action {
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .account-cell-action .ds-btn + .ds-btn {
  margin-left: 8px;
}

.restory-ds[data-warm-studio] .account-status-detail {
  display: block;
  margin-top: 4px;
  color: var(--ds-ink-2);
  font-size: 12px;
  white-space: normal;
}

.restory-ds[data-warm-studio] .account-inline-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px dashed var(--ds-panel-border);
}

.restory-ds[data-warm-studio] .account-inline-form-title {
  margin: 0;
  color: var(--ds-ink);
  font-size: 13px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .account-form-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
}

.restory-ds[data-warm-studio] .account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .account-field-label {
  color: var(--ds-ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.restory-ds[data-warm-studio] .account-input {
  width: 100%;
}

.restory-ds[data-warm-studio] .account-field-error {
  margin: 0;
  color: var(--ds-status-error-fg);
  font-size: 12.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .account-help {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .account-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px;
  border: 1px dashed var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
}

.restory-ds[data-warm-studio] .account-empty-title {
  margin: 0;
  color: var(--ds-ink);
  font-size: 13.5px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .account-empty-body {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .account-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.restory-ds[data-warm-studio] .account-dialog-copy {
  margin: 0;
  color: var(--ds-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

/* Below the account rail's collapse the screen keeps the same composition but
   stacks the add band and gives every control a 44px touch target. */
@media (max-width: 900px) {
  .restory-ds[data-warm-studio] .account-screen {
    padding: 16px 12px 24px;
  }

  .restory-ds[data-warm-studio] .account-form-grid {
    grid-template-columns: 1fr;
  }

  .restory-ds[data-warm-studio] .account-screen .ds-btn,
  .restory-ds[data-warm-studio] .account-screen .ds-input,
  .restory-ds[data-warm-studio] .account-screen .ds-select {
    min-height: 44px;
  }

  /* The removal dialog is a sibling of the screen container, so its own
     actions opt into the same narrow-document target. */
  .restory-ds[data-warm-studio] #account-remove-dialog .ds-btn {
    min-height: 44px;
  }

  .restory-ds[data-warm-studio] .account-screen .ds-input,
  .restory-ds[data-warm-studio] .account-screen .ds-select {
    font-size: 16px;
  }

  .restory-ds[data-warm-studio] .account-form-grid .ds-btn {
    width: 100%;
  }

  /* Screen 8 keeps the focal pair on one row at a phone width, as the
     prototype does: `Confirm email` sizes to its label and the danger
     `Remove pending email` takes the remaining width. Neither label wraps or
     truncates, both keep the 44px tap target above, and the pair keeps its
     10px gap. Only when the pair genuinely cannot fit does it wrap. */
  .restory-ds[data-warm-studio] .account-focal-actions .ds-btn {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    white-space: nowrap;
  }

  .restory-ds[data-warm-studio] .account-focal-actions .ds-btn--danger {
    flex: 1 1 auto;
  }
}

/* Below ~360px the labels no longer fit side by side: wrap to two full-width
   rows instead of squeezing or shrinking either 44px tap target. */
@media (max-width: 359px) {
  .restory-ds[data-warm-studio] .account-focal-actions {
    flex-wrap: wrap;
  }

  .restory-ds[data-warm-studio] .account-focal-actions .ds-btn {
    flex: 1 1 100%;
  }
}

/* A narrow document turns both rosters into stacked, labeled rows instead of
   five squeezed columns, so the action cell never crosses the right edge. */
@media (max-width: 720px) {
  .restory-ds[data-warm-studio] .account-table-wrap {
    overflow-x: visible;
  }

  .restory-ds[data-warm-studio] .account-table thead {
    display: none;
  }

  .restory-ds[data-warm-studio] .account-table,
  .restory-ds[data-warm-studio] .account-table tbody,
  .restory-ds[data-warm-studio] .account-table tr,
  .restory-ds[data-warm-studio] .account-table td {
    display: block;
    width: 100%;
  }

  .restory-ds[data-warm-studio] .account-table tr {
    padding: 10px 12px;
    border: 1px solid var(--ds-panel-border);
    border-radius: var(--ds-radius-control);
  }

  .restory-ds[data-warm-studio] .account-table tr + tr {
    margin-top: 10px;
  }

  .restory-ds[data-warm-studio] .account-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0;
    border-bottom: 0;
    text-align: left;
  }

  .restory-ds[data-warm-studio] .account-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ds-ink-2);
  }

  .restory-ds[data-warm-studio] .account-table td.account-cell-primary {
    font-size: 14.5px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }

  .restory-ds[data-warm-studio] .account-table td.account-cell-primary::before {
    content: none;
  }

  .restory-ds[data-warm-studio] .account-table th.account-col-right,
  .restory-ds[data-warm-studio] .account-table td.account-col-right {
    text-align: left;
  }

  .restory-ds[data-warm-studio] .account-table td.account-cell-action {
    flex-wrap: wrap;
    justify-content: flex-end;
    white-space: normal;
  }

  .restory-ds[data-warm-studio] .account-table td.account-cell-action::before {
    margin-right: auto;
  }
}

/* --------------------------------------------------------------------------
   Plan workbench (single view)

   One routed shell composes the Warm Studio rail with a Plan-specific head,
   the four-value tab strip, the truthful progress strip, the wave rows and a
   docked conversation region. The split reuses the feature workbench's 3fr/2fr
   no-script default and the same `WarmStudioFeatureSplitter` hook, so no server
   markup carries an inline ratio and the separator stays the only pointer
   target. Everything below is presentation for the Plan surface and its
   Overview/decision/Relations panels; the tab strip, progress strip and wave
   rows are the only new layout primitives.
   ------------------------------------------------------------------------ */
.restory-ds[data-warm-studio] .plan-workbench {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  gap: 14px;
  padding: 16px 20px 18px;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .plan-workbench__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 18px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-workbench__crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-workbench__crumb .ds-link {
  color: var(--ds-muted);
  text-decoration: none;
}

.restory-ds[data-warm-studio] .plan-workbench__crumb .ds-link:hover {
  color: var(--ds-ink);
  text-decoration: underline;
}

.restory-ds[data-warm-studio] .plan-workbench__crumb-workspace {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-workbench__crumb code {
  font-family: var(--ds-mono);
  font-size: 11.5px;
  color: var(--ds-ink-2);
  background: var(--ds-panel);
  border: 1px solid var(--ds-line-2);
  border-radius: 5px;
  padding: 2px 6px;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-workbench__identity {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-workbench__identity h1 {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-workbench__state,
.restory-ds[data-warm-studio] .plan-workbench__mode,
.restory-ds[data-warm-studio] .plan-workbench__health {
  font-size: 11.5px;
  line-height: 1;
  color: var(--ds-muted);
  border: 1px solid var(--ds-line-2);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-workbench__state[data-plan-state-label="ready"] {
  color: var(--ds-accent);
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .plan-workbench__state[data-plan-state-label="stale"],
.restory-ds[data-warm-studio] .plan-workbench__state[data-plan-state-label="unavailable"] {
  color: var(--ds-waypoint);
  border-color: var(--ds-waypoint);
  background: var(--ds-waypoint-bg);
}

.restory-ds[data-warm-studio] .plan-workbench__head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.restory-ds[data-warm-studio] .plan-workbench__missing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 24px 20px;
  background: var(--ds-panel);
  border: 1px solid var(--ds-panel-border);
  border-radius: 10px;
  color: var(--ds-muted);
  font-size: 13.5px;
}

.restory-ds[data-warm-studio] .plan-workbench__split {
  display: grid;
  grid-template-columns: minmax(0, 3fr) 1px minmax(0, 2fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--ds-panel);
  border: 1px solid var(--ds-panel-border);
  border-radius: 12px;
}

.restory-ds[data-warm-studio] .plan-workbench__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .plan-workbench__splitter {
  width: 1px;
  min-width: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ds-panel-border);
  cursor: col-resize;
  touch-action: none;
  transition: background 0.12s ease;
}

.restory-ds[data-warm-studio] .plan-workbench__splitter:hover,
.restory-ds[data-warm-studio] .plan-workbench__splitter:focus-visible,
.restory-ds[data-warm-studio] .plan-workbench__splitter[data-ws-split-dragging="true"] {
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .plan-workbench__splitter:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .plan-workbench__conversation {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .plan-workbench__conversation[data-plan-conversation="local_draft"],
.restory-ds[data-warm-studio]
  .plan-workbench__conversation[data-plan-conversation="local_draft_stale"] {
  padding: 0;
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio]
  .plan-workbench__conversation[data-plan-conversation="local_draft"]
  > [data-warm-studio-agent-pane],
.restory-ds[data-warm-studio]
  .plan-workbench__conversation[data-plan-conversation="local_draft_stale"]
  > [data-warm-studio-agent-pane] {
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.restory-ds[data-warm-studio] .plan-workbench__conversation-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 0;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-progress__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-progress__total {
  font-family: var(--ds-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-progress__other {
  color: var(--ds-muted);
  border: 1px solid var(--ds-line-2);
  border-radius: 999px;
  padding: 1px 7px;
}

.restory-ds[data-warm-studio] .plan-progress__unknown {
  margin: 0;
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-progress__bar {
  display: flex;
  gap: 3px;
  height: 26px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-progress__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1;
  color: var(--ds-ink-2);
  background: var(--ds-rail);
  overflow: hidden;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-progress__segment--done {
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
}

.restory-ds[data-warm-studio] .plan-progress__segment--running {
  background: var(--ds-status-neutral-bg);
  border: 1px solid var(--ds-status-neutral-border);
  color: var(--ds-status-neutral-fg);
}

.restory-ds[data-warm-studio] .plan-progress__decision {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--ds-waypoint);
  color: #fff;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .plan-progress__segment--ready {
  background: var(--ds-selection-bg);
  border: 1px solid var(--ds-selection-border);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .plan-progress__segment--conflict {
  background: var(--ds-status-error-bg);
  border: 1px solid var(--ds-status-error-border);
  color: var(--ds-status-error-fg);
}

/* Evidence conflict and degraded recovery banner: one four-sided 1px frame, no
   nested inner border, and the retained rows below stay untouched. */
.restory-ds[data-warm-studio] .plan-conflict {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--ds-status-error-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .plan-conflict__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .plan-conflict__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-conflict__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.restory-ds[data-warm-studio] .plan-conflict__time {
  font-size: 11.5px;
  color: var(--ds-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-conflict__title {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-conflict__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ds-ink-2);
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-conflict__body p,
.restory-ds[data-warm-studio] .plan-conflict__diff-item p {
  margin: 0;
}

.restory-ds[data-warm-studio] .plan-conflict__body code,
.restory-ds[data-warm-studio] .plan-conflict__diff code {
  font-family: var(--ds-mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-ink);
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .plan-conflict__values {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-conflict__diff-kind {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-conflict__reason {
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-conflict__step {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-conflict__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.restory-ds[data-warm-studio] .plan-conflict__link {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ds-muted);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .plan-conflict__link:hover {
  color: var(--ds-ink);
}

/* The disclosure and the retry notice carry a tinted well instead of a second
   frame, so the banner keeps one uniform four-sided 1px border. */
.restory-ds[data-warm-studio] .plan-conflict__diff {
  padding: 10px 12px;
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .plan-conflict__diff-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .plan-conflict__diff-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .plan-conflict__notice {
  margin: 0;
  padding: 8px 11px;
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .plan-tabs__pulse {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-tabs__pulse-time {
  color: var(--ds-muted);
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .plan-workbench__sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-workbench__sync-time {
  color: var(--ds-muted);
  font-variant-numeric: tabular-nums;
}

.restory-ds[data-warm-studio] .plan-progress__segment-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.restory-ds[data-warm-studio] .plan-progress__segment-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .plan-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .plan-tabs__link {
  padding: 7px 10px;
  border-radius: 7px 7px 0 0;
  font-size: 12.5px;
  color: var(--ds-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.restory-ds[data-warm-studio] .plan-tabs__link:hover {
  color: var(--ds-ink);
  background: var(--ds-btn-hover);
}

.restory-ds[data-warm-studio] .plan-tabs__link[aria-selected="true"] {
  color: var(--ds-ink);
  font-weight: 600;
  border-bottom-color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .plan-workbench__panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.restory-ds[data-warm-studio] .plan-workbench__panel[hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .plan-workbench__unavailable {
  margin: 16px;
  padding: 18px 16px;
  border: 1px dashed var(--ds-line-2);
  border-radius: 10px;
  color: var(--ds-muted);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .plan-workbench__unavailable p {
  margin: 0;
}

.restory-ds[data-warm-studio] .plan-overview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px 18px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-overview__notice,
.restory-ds[data-warm-studio] .plan-overview__effect {
  margin: 0;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ds-ink-2);
  background: var(--ds-rail);
  border: 1px solid var(--ds-line-2);
}

.restory-ds[data-warm-studio] .plan-overview__effect {
  color: var(--ds-accent);
  background: var(--ds-selection-bg);
  border-color: var(--ds-selection-border);
}

.restory-ds[data-warm-studio] .plan-overview__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Pre-epic draft body: owner status strip, one bounded draft-scope brief and
   the empty wave placeholder for a plan that has no epic yet. */
.restory-ds[data-warm-studio] .plan-draft {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px 18px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-draft__context {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .plan-draft__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--ds-status-neutral-border);
  border-radius: var(--ds-radius-badge);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-status-neutral-fg);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-draft__fact {
  font-size: 12.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-draft__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] a.plan-draft__chip:hover {
  border-color: var(--ds-control-border-hover);
}

.restory-ds[data-warm-studio] .plan-draft__chip--inert {
  border-style: dashed;
  background: transparent;
  color: var(--ds-muted);
  font-weight: 500;
}

.restory-ds[data-warm-studio] .plan-draft__path {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-draft__path code {
  font-family: var(--ds-mono);
  font-size: 12px;
  color: var(--ds-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-draft__summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-draft__eyebrow {
  margin: 0;
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-draft__prose {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 68ch;
}

.restory-ds[data-warm-studio] .plan-draft__prose > * {
  margin: 0;
}

.restory-ds[data-warm-studio] .plan-draft__p {
  margin: 0;
  font-family: var(--ds-serif, "Newsreader", Georgia, serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-draft__h {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-draft__list {
  display: block;
  margin: 0;
  padding-left: 20px;
  list-style: disc;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] ol.plan-draft__list {
  list-style: decimal;
}

.restory-ds[data-warm-studio] .plan-draft__list > li + li {
  margin-top: 5px;
}

.restory-ds[data-warm-studio] .plan-draft__code {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--ds-line-2);
  border-radius: var(--ds-radius-control);
  background: var(--ds-rail);
  font-family: var(--ds-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ds-ink);
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .plan-draft__code-inline {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ds-rail);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-draft__table {
  border-collapse: collapse;
  font-size: 13px;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .plan-draft__table th,
.restory-ds[data-warm-studio] .plan-draft__table td {
  padding: 5px 10px;
  border: 1px solid var(--ds-line-2);
  text-align: left;
  vertical-align: top;
}

.restory-ds[data-warm-studio] .plan-draft__literal {
  margin: 0;
  font-family: var(--ds-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ds-muted);
  white-space: pre-wrap;
}

.restory-ds[data-warm-studio] .plan-draft__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-draft__summary .ds-btn {
  align-self: flex-start;
}

.restory-ds[data-warm-studio] .plan-draft__waves {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .plan-draft__waves-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-draft__waves h2 {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-draft__waves p {
  margin: 0;
  max-width: 56ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .plan-draft__notice {
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--ds-status-neutral-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-status-neutral-fg);
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .plan-decision {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 14px;
  border: 1px solid var(--ds-waypoint);
  border-radius: 10px;
  background: var(--ds-waypoint-bg);
}

.restory-ds[data-warm-studio] .plan-decision__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.restory-ds[data-warm-studio] .plan-decision__head h2 {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .plan-decision__since {
  font-family: var(--ds-mono);
  font-size: 11px;
  color: var(--ds-waypoint);
}

.restory-ds[data-warm-studio] .plan-decision__summary,
.restory-ds[data-warm-studio] .plan-decision__prompt {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .plan-decision__prompt {
  font-weight: 600;
}

.restory-ds[data-warm-studio] .plan-decision__options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.restory-ds[data-warm-studio] .plan-decision__options legend {
  padding: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-decision__option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--ds-line-2);
  border-radius: 8px;
  background: var(--ds-panel-2);
  font-size: 13px;
  color: var(--ds-ink-2);
  cursor: pointer;
}

.restory-ds[data-warm-studio] .plan-decision__offline {
  margin: 0;
  font-size: 12px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .plan-waves {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-wave {
  border: 1px solid var(--ds-line);
  border-radius: 10px;
  background: var(--ds-panel-2);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .plan-wave__head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--ds-line);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .plan-wave__head h2 {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .plan-wave__rows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .plan-wave__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--ds-line);
  font-size: 13px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-wave__row:first-child {
  border-top: 0;
}

.restory-ds[data-warm-studio] .plan-wave__identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .plan-wave__title {
  color: var(--ds-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-wave__repo {
  font-family: var(--ds-mono);
  font-size: 11px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .plan-wave__stages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.restory-ds[data-warm-studio] .plan-wave__stages span {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--ds-line-2);
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ds-faint);
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-wave__stages span[data-plan-stage-state="done"] {
  color: var(--ds-accent);
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .plan-wave__requires {
  font-size: 11.5px;
  color: var(--ds-muted);
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .plan-wave__row[data-plan-node-bucket="done"] .plan-wave__title {
  color: var(--ds-muted);
}

/* ============================================================================
   Persistent Files drawer and Code Peek (WSFS-03)
   ============================================================================

   The rail owns the 58px column; `.ds-app.files-open` adds the 270px explorer
   and keeps `.ds-main` in the third grid column. Code Peek replaces only the
   subject region of the feature/main column, so the conversation stays live on
   the right. Dense bodies remain one plain pre with native find, never a
   virtualized line list.
   ------------------------------------------------------------------------- */

.restory-ds[data-warm-studio] .ds-files__head {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
}

.restory-ds[data-warm-studio] .ds-files__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ds-files__head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.restory-ds[data-warm-studio] .ds-files__tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  margin-top: 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 7px;
  background: var(--ds-panel-sunken, var(--ds-panel));
}

.restory-ds[data-warm-studio] .ds-files__tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 5px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-files__tab:hover {
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ds-files__tab[data-ws-drawer-tab-active="true"] {
  background: var(--ds-panel);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-sm, 0 1px 2px rgb(0 0 0 / 8%));
}

.restory-ds[data-warm-studio] .ds-files__filter {
  margin-top: 8px;
}

.restory-ds[data-warm-studio] .ds-files__filter-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-files__filter-input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 6px;
  background: var(--ds-canvas, var(--ds-panel));
  color: var(--ds-ink);
  font: inherit;
  font-size: 12px;
}

.restory-ds[data-warm-studio] .ds-files__filter-input:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.restory-ds[data-warm-studio] .ds-files__section {
  margin: 0 0 12px;
}

.restory-ds[data-warm-studio] .ds-files__section-label {
  margin: 0 0 5px;
  padding: 0 6px;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-files__group,
.restory-ds[data-warm-studio] .ds-files__repo,
.restory-ds[data-warm-studio] .ds-files__node {
  min-width: 0;
}

/* An expanded directory's child projection nests under its row. */
.restory-ds[data-warm-studio] .ds-files__branch > .ds-files__node {
  margin-left: 14px;
}

.restory-ds[data-warm-studio] .ds-files__row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ds-ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-files__row--depth-1 { padding-left: 22px; }
.restory-ds[data-warm-studio] .ds-files__row--depth-2 { padding-left: 36px; }
.restory-ds[data-warm-studio] .ds-files__row--depth-3 { padding-left: 50px; }
.restory-ds[data-warm-studio] .ds-files__row--depth-4 { padding-left: 64px; }
.restory-ds[data-warm-studio] .ds-files__row--depth-5 { padding-left: 78px; }
.restory-ds[data-warm-studio] .ds-files__row--depth-6 { padding-left: 92px; }

.restory-ds[data-warm-studio] .ds-files__row:hover,
.restory-ds[data-warm-studio] .ds-files__row:focus-visible {
  background: var(--ds-hover, rgb(0 0 0 / 5%));
}

.restory-ds[data-warm-studio] .ds-files__row:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -1px;
}

.restory-ds[data-warm-studio] .ds-files__row--repo {
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-files__row--unbound {
  cursor: default;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ds-files__chevron {
  flex: 0 0 10px;
  color: var(--ds-muted);
  text-align: center;
}

.restory-ds[data-warm-studio] .ds-files__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-files__tier,
.restory-ds[data-warm-studio] .ds-files__size,
.restory-ds[data-warm-studio] .ds-files__reason {
  margin-left: auto;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ds-files__more {
  display: block;
  width: calc(100% - 16px);
  margin: 2px 8px 6px;
  padding: 4px 6px;
  border: 1px dashed var(--ds-panel-border);
  border-radius: 5px;
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-files__empty,
.restory-ds[data-warm-studio] .ds-files__hint {
  margin: 4px 8px;
  color: var(--ds-muted);
  font-size: 12px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .ds-files__error {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 4px 8px;
  padding: 7px 8px;
  border: 1px solid var(--ds-danger-border, #d9b3ae);
  border-radius: 6px;
  background: var(--ds-danger-soft, #fbeeec);
  color: var(--ds-ink);
  font-size: 12px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ds-files__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--ds-panel-border);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
}

/* Code Peek and full viewer ------------------------------------------------ */

.restory-ds[data-warm-studio] .feature-workbench__main--peek > .feature-workbench__subject {
  display: none;
}

.restory-ds[data-warm-studio] .feature-workbench__main--peek {
  min-width: 0;
}

.ws-code-sheet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: 10px;
  background: var(--ds-panel);
  color: var(--ds-ink);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ws-code-sheet--peek {
  flex: 1 1 auto;
}

.restory-ds[data-warm-studio] .ws-code-sheet--full {
  flex: 1 1 auto;
  min-height: 0;
}

.ws-code-sheet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.ws-code-sheet__file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ws-code-sheet__repo {
  padding: 2px 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 999px;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
  white-space: nowrap;
}

.ws-code-sheet__path {
  min-width: 0;
  overflow: hidden;
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-code-sheet__source,
.ws-code-sheet__truth,
.ws-code-sheet__meta,
.ws-code-sheet__muted {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
}

.ws-code-sheet__truth {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ds-panel-sunken, var(--ds-panel));
}

.ws-code-sheet__tools,
.ws-code-sheet__selection-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ws-code-sheet__selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel-sunken, var(--ds-panel));
}

.ws-code-sheet__selection-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.ws-code-sheet__selection-info strong {
  flex: 0 0 auto;
  font-size: 12px;
  white-space: nowrap;
}

.ws-code-sheet__selection-info {
  flex: 1 1 24rem;
}

.ws-code-sheet__reference {
  min-width: 0;
  max-width: 76ch;
  overflow: hidden;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-code-sheet__handoff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 5px 12px;
  color: var(--ds-muted);
  border-bottom: 1px solid var(--ds-panel-border);
  font-size: 10.5px;
}

.ws-code-sheet__handoff-hint {
  font-weight: 600;
  white-space: nowrap;
}

.ws-code-sheet__handoff-location {
  min-width: 0;
  overflow: hidden;
  font-family: var(--ds-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-code-sheet__range {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-code-sheet__range-label {
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
}

.ws-code-sheet__range-input {
  width: 4.5rem;
  padding: 3px 5px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 4px;
  background: var(--ds-panel);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 11px;
}

.ws-code-sheet__error {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 10px 12px 0;
  padding: 8px 10px;
  border: 1px solid var(--ds-danger-border, #d9b3ae);
  border-radius: 6px;
  background: var(--ds-danger-soft, #fbeeec);
  font-size: 12px;
}

.ws-code-sheet__body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  background: var(--ds-canvas, var(--ds-panel));
}

.ws-code-sheet__dense {
  max-width: 100%;
  margin: 0;
  padding: 10px 14px;
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 11px;
  line-height: 1.55;
  overflow: auto;
  tab-size: 2;
  white-space: pre;
}

.ws-code-sheet__findbar[hidden] {
  display: none;
}

.ws-code-sheet__findbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.ws-code-sheet__find-input {
  min-width: 12rem;
  flex: 1 1 14rem;
  padding: 3px 6px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 5px;
  font: inherit;
}

.ws-code-sheet__find-label {
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ws-code-sheet__line[data-ws-code-find-match="true"] {
  outline: 1px solid var(--ds-accent);
  outline-offset: -1px;
  background: var(--ds-hover, rgb(0 0 0 / 6%));
}

.ws-code-sheet__lines {
  min-width: max-content;
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.ws-code-sheet__line {
  display: grid;
  grid-template-columns: 3.2rem 0.9rem minmax(0, 1fr);
  align-items: baseline;
  min-height: 1.55em;
  font-family: var(--ds-mono);
  font-size: 11px;
  line-height: 1.55;
}

.ws-code-sheet__line:hover {
  background: var(--ds-hover, rgb(0 0 0 / 4%));
}

.ws-code-sheet__gutter {
  padding: 0 6px 0 0;
  border: 0;
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  text-align: right;
  cursor: pointer;
  user-select: none;
}

.ws-code-sheet__gutter:hover,
.ws-code-sheet__gutter:focus-visible {
  color: var(--ds-ink);
}

.ws-code-sheet__fold {
  display: inline-block;
  width: 0.9rem;
}

.ws-code-sheet__fold-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.ws-code-sheet__fold-button:hover,
.ws-code-sheet__fold-button:focus-visible {
  color: var(--ds-ink);
}

.ws-code-sheet__fold-button[aria-expanded="false"] > span {
  display: inline-block;
  transform: rotate(-90deg);
}

.ws-code-sheet__text {
  padding-right: 14px;
  font: inherit;
  white-space: pre;
}

.ws-code-sheet__empty {
  margin: 0;
  padding: 18px 14px;
  color: var(--ds-muted);
  font-size: 12px;
}

.ws-code-sheet__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-top: 1px solid var(--ds-panel-border);
  color: var(--ds-muted);
  font-size: 11px;
}

.ws-code-sheet__related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ws-code-sheet__pill {
  padding: 2px 7px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 999px;
  color: var(--ds-ink);
  font-size: 10px;
  text-decoration: none;
}

.ws-code-sheet__pill--inert {
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ds-code-route {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-code-route__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px 10px;
}

.restory-ds[data-warm-studio] .ds-code-route__refusal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 18px 14px;
  padding: 10px 12px;
  border: 1px solid var(--ds-danger-border, #d9b3ae);
  border-radius: 8px;
  background: var(--ds-danger-soft, #fbeeec);
}

.restory-ds[data-warm-studio] .ds-code-route > .ws-code-sheet {
  margin: 0 18px 18px;
}

body.phx-disconnected .ds-files,
body.phx-disconnected .ws-code-sheet {
  visibility: hidden;
}


/* ============================================================================
   Settings appearance bridge and shared primitives
   ============================================================================

   The bridge is opt-in through the published Settings frame marker alone. The
   rail emits `data-warm-studio-section="settings"` on `.ds-app`, and the
   appearance owner hydrates `data-theme`, `data-text-scale` and `data-density`
   on the document element before first paint. Home, Account, the approval gate
   and legacy documents carry a different marker (or none), so they keep the
   light, normal, comfortable defaults.

   Scale, density and the dark palette are custom properties on the frame, so
   the shared primitives below consume them once instead of asking each future
   consumer to repeat a selector. `.senv-measure` bounds width only; no theme,
   scale or density rule depends on it.
   ========================================================================== */

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"] {
  --ds-fs: 1;
  --ds-pad-card: 20px;
  --ds-pad-row-y: 12px;
  --ds-control-h: 38px;
  --ds-danger-solid: #b42828;
  --ds-danger-solid-hover: #9c2121;
  --ds-danger-solid-ink: #ffffff;
  /* The frame owns its own foreground: a descendant that sets no colour of its
     own must not keep the light theme's ink after the palette flips. */
  color: var(--ds-ink);
  color-scheme: light;
}

html[data-text-scale="large"]
  .restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"] {
  --ds-fs: 1.2;
}

html[data-density="compact"]
  .restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"] {
  --ds-pad-card: 14px;
  --ds-pad-row-y: 8px;
  --ds-control-h: 34px;
}

/* Dark palette. Each ink keeps AA contrast on the surface it is painted on,
   and the status chips carry dark ink on a light tint of the same family. */
html[data-theme="dark"]
  .restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"] {
  color-scheme: dark;
  --ds-rail: #1b1916;
  --ds-canvas: #161412;
  --ds-chrome: #201e1b;
  --ds-panel: #201e1b;
  --ds-panel-2: #2c2925;
  --ds-terminal: #1c1e1c;
  --ds-terminal-ink: #efece4;
  --ds-line: rgba(239, 236, 228, 0.12);
  --ds-line-2: rgba(239, 236, 228, 0.2);
  --ds-panel-border: #3a352e;
  --ds-input-border: #6e6659;
  --ds-btn-border: #4b453d;
  --ds-control-border-hover: #6e6659;
  --ds-btn-hover: #2c2925;
  --ds-ink: #f4f1ea;
  --ds-ink-2: #e2ddd3;
  --ds-muted: #bcb5a8;
  --ds-faint: #a8a194;
  --ds-accent: #8fe0cc;
  --ds-accent-hover: #b3ebdd;
  --ds-accent-fill: #2f8f7a;
  --ds-accent-fill-hover: #37a58d;
  --ds-accent-ink: #06110f;
  --ds-selection-bg: #1f3a33;
  --ds-selection-border: #3f7a6a;
  --ds-waypoint: #f0a97f;
  --ds-waypoint-bg: #33251d;
  --ds-waypoint-fg: #f0a97f;
  --ds-waypoint-border: #5c3a28;
  --ds-status-info-bg: #1b2a3a;
  --ds-status-info-fg: #c3ddf5;
  --ds-status-info-border: #2f5478;
  --ds-status-success-bg: #162c1e;
  --ds-status-success-fg: #bfe6c9;
  --ds-status-success-border: #2f5c3b;
  --ds-status-warn-bg: #3a2f16;
  --ds-status-warn-fg: #f3d69b;
  --ds-status-warn-border: #6b5324;
  --ds-status-error-bg: #3a1d1a;
  --ds-status-error-fg: #f6c9c2;
  --ds-status-error-border: #7a3a32;
  --ds-status-neutral-bg: #2a2823;
  --ds-status-neutral-fg: #cfc9bd;
  --ds-status-neutral-border: #4a453d;
}

/* The rail counting chip is a dark amber fill with white ink in both themes:
   the waypoint *ink* inverts for dark text, so it cannot be the fill there. */
html[data-theme="dark"]
  .restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-count-badge {
  background: #a5481f;
  color: #ffffff;
}

/* The offline snapshot is a state, not an absence: it renders the amber
   waypoint pill instead of the neutral slot grey. The spoken status text stays
   the only carrier of the state name, so the pill is never colour-only. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-nav-link__badge[data-warm-studio-badge-state="offline"]
  .ds-badge {
  border-color: var(--ds-waypoint-border);
  background: var(--ds-waypoint-bg);
  color: var(--ds-waypoint-fg);
}

/* Typography and control rhythm ------------------------------------------ */

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-body {
  color: var(--ds-ink-2);
  font-size: calc(15px * var(--ds-fs));
  line-height: 1.55;
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-hint {
  font-size: calc(12.5px * var(--ds-fs));
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-nav-link {
  height: var(--ds-control-h);
  font-size: calc(14px * var(--ds-fs));
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-rail__label {
  font-size: calc(11.5px * var(--ds-fs));
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-btn {
  min-height: var(--ds-control-h);
  font-size: calc(13.5px * var(--ds-fs));
}

/* The rail's nested grids bound their single track here. Without it a long
   label plus the reserved badge footprint sizes the row to max-content, and the
   pill is clipped at the rail edge instead of the label truncating. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-rail
  .ds-rail__nav,
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-rail
  .ds-rail__group {
  grid-template-columns: minmax(0, 1fr);
  min-inline-size: 0;
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-rail
  .ds-nav-link__label {
  flex: 1 1 auto;
  min-inline-size: 0;
}

/* The collapsed rail paints icon-only squares; compact density keeps their
   height on the same control token. */
html[data-density="compact"]
  .restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-rail
  .ds-nav-link {
  height: var(--ds-control-h);
}

/* Cards and rows ---------------------------------------------------------- */

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-panel,
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-panel-focal,
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-terminal {
  padding: var(--ds-pad-card);
}

/* One shared row rhythm inside a card. The separator is a full-width rule on a
   square row, never a framed box, so proximity carries the grouping. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .senv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-inline-size: 0;
  padding-block: var(--ds-pad-row-y);
  border-top: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .senv-row:first-of-type {
  border-top: 0;
}

/* The trailing badge footprint is reserved by the slot, not by the content, so
   the label column keeps one edge for a count, a word, the cap or nothing. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-nav-link__badge {
  flex: 0 0 6em;
  justify-content: flex-end;
  overflow: hidden;
  font-size: calc(12.5px * var(--ds-fs));
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-nav-link__badge
  .ds-badge {
  justify-content: center;
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  font-size: inherit;
}

/* The collapsed rail paints 40px icon-only rows and drops the pill, so the
   reserved footprint must collapse with it; otherwise the 6em slot pushes the
   icon outside the link. The spoken status stays in the slot for assistive
   technology. */
html[data-shell-rail="collapsed"]
  .restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-nav-link__badge {
  flex: 0 0 0;
  min-inline-size: 0;
  margin-left: 0;
}

/* Measure ----------------------------------------------------------------- */

/* Width only: a centered column that never forces page overflow. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .senv-measure {
  display: flex;
  flex-direction: column;
  gap: 16px;
  inline-size: 100%;
  min-inline-size: 0;
  margin-inline: auto;
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .senv-measure--tabular {
  max-inline-size: 1120px;
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .senv-measure--form {
  max-inline-size: 840px;
}

/* Log islands ------------------------------------------------------------- */

/* A bounded, scrollable preformatted region on Warm charcoal in both themes.
   Its type is independent of the prose scale. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-terminal.senv-log {
  --senv-log-size: 13.5px;
  padding: 16px;
  border: 1px solid #1c1e1c;
  background: #1c1e1c;
  color: var(--ds-terminal-ink);
  font-size: var(--senv-log-size);
  max-block-size: 320px;
  overflow: auto;
}

/* Warm charcoal and the dark card are near-neighbours, so the island draws its
   own hairline instead of relying on the fill difference. */
html[data-theme="dark"]
  .restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-terminal.senv-log {
  box-shadow: inset 0 0 0 1px rgba(239, 236, 228, 0.14);
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-terminal.senv-log
  pre,
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-terminal.senv-log
  code {
  font-family: var(--ds-mono);
  font-size: var(--senv-log-size);
  line-height: 1.55;
  white-space: pre;
  overflow-wrap: normal;
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-terminal.senv-log.senv-log--large {
  --senv-log-size: 15px;
}

/* Destructive action ------------------------------------------------------ */

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-btn.ds-btn--danger-solid {
  border-color: var(--ds-danger-solid);
  background: var(--ds-danger-solid);
  color: var(--ds-danger-solid-ink);
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-btn.ds-btn--danger-solid:hover {
  border-color: var(--ds-danger-solid-hover);
  background: var(--ds-danger-solid-hover);
  color: var(--ds-danger-solid-ink);
}

/* The withheld control looks unavailable while its reason keeps full contrast. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .ds-btn.ds-btn--danger-solid:disabled {
  border-color: var(--ds-panel-border);
  background: var(--ds-status-neutral-bg);
  color: var(--ds-muted);
  cursor: not-allowed;
}

/* Command strip ----------------------------------------------------------- */

/* The code shrinks and scrolls inside the strip; the copy action keeps its own
   box and is never clipped by the row. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .cmd-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
  padding: 8px 10px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-terminal);
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .cmd-strip
  .cmd-code {
  flex: 1 1 auto;
  min-inline-size: 0;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  font-family: var(--ds-mono);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ds-terminal-ink);
}

.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .cmd-strip
  .ds-btn {
  flex: 0 0 auto;
}

/* Withheld reason --------------------------------------------------------- */

/* The reason sits beside the dimmed control, never inside it, so it keeps full
   contrast and readable prose while only the action looks unavailable. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .withheld-reason {
  margin: 0;
  color: var(--ds-ink);
  opacity: 1;
  font-size: calc(14px * var(--ds-fs));
  font-weight: 500;
  line-height: 1.5;
}

/* Screen 4 — workspace document editor. */
.restory-ds[data-warm-studio] .ds-doc-route {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-doc-route__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px 18px;
  padding: 22px 24px 14px;
}

.restory-ds[data-warm-studio] .ds-doc-route__crumb {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ds-ink-3, #6f6a60);
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-doc-route__title {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-doc-route__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ds-doc-route__context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 24px 12px;
  padding: 8px 10px;
  border: 1px solid var(--ds-line, #ded7c8);
  border-radius: 9px;
  background: var(--ds-paper-2, #fbf8f1);
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-doc-route__context-label {
  color: var(--ds-ink-3, #6f6a60);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ds-doc-route__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid var(--ds-line, #ded7c8);
  border-radius: 999px;
  background: var(--ds-paper, #fffdf8);
  color: var(--ds-ink-1, #2d2a24);
  font-size: 12px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-doc-route__chip--inert {
  border-style: dashed;
  color: var(--ds-ink-3, #6f6a60);
}

.restory-ds[data-warm-studio] .ds-doc-route__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 24px 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-doc-route__segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--ds-line, #ded7c8);
  border-radius: 8px;
  background: var(--ds-paper-2, #fbf8f1);
}

.restory-ds[data-warm-studio] .ds-doc-route__segment {
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  background: transparent;
  color: var(--ds-ink-2, #565149);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-doc-route__segment.is-selected {
  background: var(--ds-paper, #fffdf8);
  color: var(--ds-ink-1, #2d2a24);
  box-shadow: 0 1px 2px rgb(45 42 36 / 12%);
}

.restory-ds[data-warm-studio] .ds-doc-route__segment:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.restory-ds[data-warm-studio] .ds-doc-route__status {
  min-width: 0;
  color: var(--ds-ink-3, #6f6a60);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .ds-doc-route__status.is-unsaved,
.restory-ds[data-warm-studio] .ds-doc-route__status.is-blocked {
  color: var(--ds-ink-1, #2d2a24);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-doc-route__retry {
  border: 1px solid var(--ds-line, #ded7c8);
  border-radius: 7px;
  padding: 4px 10px;
  background: var(--ds-paper, #fffdf8);
  color: var(--ds-ink-1, #2d2a24);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ds-doc-route__rejection {
  min-width: 0;
  color: var(--ds-ink-1, #2d2a24);
  font-size: 12px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ds-doc-route__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.restory-ds[data-warm-studio] .ds-doc-route__cta-arrow {
  width: 13px;
  height: 13px;
  flex: none;
}

.restory-ds[data-warm-studio] .ds-doc-route__paper {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 24px 24px;
  padding: 26px 30px;
  border: 1px solid var(--ds-line, #ded7c8);
  border-radius: 10px;
  background: var(--ds-paper, #fffdf8);
  box-shadow: 0 1px 2px rgb(45 42 36 / 6%);
  overflow: auto;
}

.restory-ds[data-warm-studio] .ds-doc-route__rendered {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 78ch;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-doc-route__heading {
  margin: 10px 0 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-doc-route__prose {
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-doc-route__paragraph-block {
  position: relative;
  margin: 0;
  min-width: 0;
  border-radius: 8px;
  padding-right: 52px;
}

.restory-ds[data-warm-studio] .ds-doc-route__paragraph-block:hover {
  background: color-mix(in srgb, var(--ds-paper-2, #fbf8f1) 70%, transparent);
}

.restory-ds[data-warm-studio] .ds-doc-route__edit {
  position: absolute;
  top: 2px;
  right: 0;
  padding: 2px 8px;
  border: 1px solid var(--ds-line, #ded7c8);
  border-radius: 999px;
  background: var(--ds-paper, #fffdf8);
  color: var(--ds-ink-3, #6f6a60);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
}

.restory-ds[data-warm-studio] .ds-doc-route__paragraph-block:hover .ds-doc-route__edit,
.restory-ds[data-warm-studio] .ds-doc-route__edit:focus-visible {
  opacity: 1;
}

.restory-ds[data-warm-studio] .ds-doc-route__paragraph {
  margin: 0;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ds-doc-route__paragraph-input {
  width: 100%;
  min-height: 2.6em;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-doc-route__paragraph-input:hover,
.restory-ds[data-warm-studio] .ds-doc-route__paragraph-input:focus {
  border-color: var(--ds-line, #ded7c8);
  background: var(--ds-paper-2, #fbf8f1);
}

.restory-ds[data-warm-studio] .ds-doc-route__markdown,
.restory-ds[data-warm-studio] .ds-doc-route__source {
  width: 100%;
  min-height: 46vh;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--ds-line, #ded7c8);
  border-radius: 8px;
  background: var(--ds-paper-2, #fbf8f1);
  color: var(--ds-ink-1, #2d2a24);
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
}

.restory-ds[data-warm-studio] .ds-doc-route__code,
.restory-ds[data-warm-studio] .ds-doc-route__frontmatter {
  margin: 0 0 4px;
  padding: 10px 14px;
  border-left: 2px solid var(--ds-line, #ded7c8);
  border-radius: 6px;
  background: var(--ds-paper-2, #fbf8f1);
  color: var(--ds-ink-3, #6f6a60);
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.restory-ds[data-warm-studio] .ds-doc-route__literal {
  margin: 4px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ds-paper-2, #fbf8f1);
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.restory-ds[data-warm-studio] .ds-doc-route__list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.6;
}

.restory-ds[data-warm-studio] .ds-doc-route__table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.restory-ds[data-warm-studio] .ds-doc-route__table {
  border-collapse: collapse;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .ds-doc-route__table th,
.restory-ds[data-warm-studio] .ds-doc-route__table td {
  padding: 6px 10px;
  border: 1px solid var(--ds-line, #ded7c8);
  text-align: left;
}

.restory-ds[data-warm-studio] .ds-doc-route__code-token {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--ds-paper-2, #fbf8f1);
  font-family: var(--ds-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.94em;
}

.restory-ds[data-warm-studio] .ds-doc-route__code-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.restory-ds[data-warm-studio] .ds-doc-route__hint {
  margin: 8px 0 0;
  color: var(--ds-ink-3, #6f6a60);
  font-size: 12px;
}

@media (max-width: 900px) {
  .restory-ds[data-warm-studio] .ds-doc-route__head,
  .restory-ds[data-warm-studio] .ds-doc-route__bar,
  .restory-ds[data-warm-studio] .ds-doc-route__paper {
    margin-left: 14px;
    margin-right: 14px;
  }

  .restory-ds[data-warm-studio] .ds-doc-route__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .restory-ds[data-warm-studio] .ds-doc-route__actions {
    justify-content: flex-start;
  }
}

/* ============================================================================
   Top Page-Loading Progress Bar (CSP-safe, class-driven)
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-page-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease-out;
}

.restory-ds[data-warm-studio] .ds-page-progress__bar {
  width: 100%;
  height: 100%;
  background: var(--ds-accent, #196456);
  box-shadow: 0 0 8px rgba(25, 100, 86, 0.35);
  transform-origin: left center;
  transform: scaleX(0);
}

.restory-ds[data-warm-studio] .ds-page-progress--active {
  opacity: 1;
}

.restory-ds[data-warm-studio] .ds-page-progress--active .ds-page-progress__bar {
  animation: ds-page-progress-creep 12s cubic-bezier(0.08, 0.72, 0.22, 1) forwards;
}

.restory-ds[data-warm-studio] .ds-page-progress--finishing {
  opacity: 0;
  transition: opacity 220ms ease-out 110ms;
}

.restory-ds[data-warm-studio] .ds-page-progress--finishing .ds-page-progress__bar {
  animation: none;
  transform: scaleX(1);
  transition: transform 110ms ease-out;
}

@keyframes ds-page-progress-creep {
  0% {
    transform: scaleX(0.06);
  }
  12% {
    transform: scaleX(0.42);
  }
  40% {
    transform: scaleX(0.72);
  }
  100% {
    transform: scaleX(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  .restory-ds[data-warm-studio] .ds-page-progress--active .ds-page-progress__bar {
    animation: none;
    transform: scaleX(0.65);
  }

  .restory-ds[data-warm-studio] .ds-page-progress--finishing .ds-page-progress__bar {
    transition: none;
  }
}

/* ============================================================================
   Warm Studio · Files, Relations and Tour
   ============================================================================

   Scoped component surface for the reusable Files tree/editor, Relations cards
   with the elevated picker, and the framed Tour. Tokens come from the Warm
   Studio shell; no rule escapes the body marker. The picker deliberately keeps
   the card and the relations column overflow-visible so the dropdown can layer
   over the following card instead of being clipped.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Files
   ------------------------------------------------------------------------ */

.restory-ds[data-warm-studio] .ws-files {
  display: grid;
  grid-template-columns: minmax(236px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  color: var(--ds-ink);
  font-family: var(--ds-sans);
}

.restory-ds[data-warm-studio] .ws-files * {
  box-sizing: border-box;
}

/* Document-only variant: the host owns the inventory, so the tree column is
   absent and the document keeps the full width. */
.restory-ds[data-warm-studio] .ws-files--document {
  grid-template-columns: minmax(0, 1fr);
}

.restory-ds[data-warm-studio] .ws-files__conflict--document {
  flex-direction: column;
  align-items: flex-start;
}

.restory-ds[data-warm-studio] .ws-files__tree {
  display: flex;
  flex-direction: column;
  min-height: 620px;
  max-height: 720px;
  overflow: hidden;
  background: var(--ds-panel);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .ws-files__tree-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--ds-line);
}

.restory-ds[data-warm-studio] .ws-files__tree-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ws-files__tree-title {
  font-family: var(--ds-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .ws-files__tree-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.restory-ds[data-warm-studio] .ws-files__filter {
  width: 100%;
  margin: 0;
}

.restory-ds[data-warm-studio] .ws-files__filter input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 12.5px;
  outline: none;
}

.restory-ds[data-warm-studio] .ws-files__filter input:focus {
  border-color: var(--ds-focus, var(--ds-accent));
  box-shadow: 0 0 0 3px rgba(25, 100, 86, 0.12);
}

.restory-ds[data-warm-studio] .ws-files__tree-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 8px 12px;
  scrollbar-width: thin;
}

.restory-ds[data-warm-studio] .ws-files__rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-files__row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-files__row[data-depth="1"] {
  margin-left: 14px;
}

.restory-ds[data-warm-studio] .ws-files__row[data-depth="2"] {
  margin-left: 28px;
}

.restory-ds[data-warm-studio] .ws-files__row[data-depth="3"] {
  margin-left: 42px;
}

.restory-ds[data-warm-studio] .ws-files__row[data-depth="4"] {
  margin-left: 56px;
}

.restory-ds[data-warm-studio] .ws-files__row-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 12.5px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__row-main:hover {
  background: var(--ds-btn-hover);
}

.restory-ds[data-warm-studio] .ws-files__row-main[aria-current="true"],
.restory-ds[data-warm-studio] .ws-files__row-main[aria-selected="true"],
.restory-ds[data-warm-studio] .ws-files__row[aria-selected="true"] .ws-files__row-main {
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ws-files__row-caret {
  display: inline-flex;
  width: 12px;
  flex: 0 0 12px;
  align-items: center;
  justify-content: center;
  color: var(--ds-faint);
  font-size: 0;
}

.restory-ds[data-warm-studio] .ws-files__row-caret::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 4px solid currentColor;
}

.restory-ds[data-warm-studio] .ws-files__row[aria-expanded="true"] .ws-files__row-caret::before {
  transform: rotate(90deg);
}

.restory-ds[data-warm-studio] .ws-files__row:not(.ws-files__row--dir) .ws-files__row-main::before {
  content: "";
  display: block;
  width: 12px;
  flex: 0 0 12px;
}

.restory-ds[data-warm-studio] .ws-files__row-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-files__row-menu {
  position: relative;
  flex: 0 0 auto;
}

.restory-ds[data-warm-studio] .ws-files__row-menu-btn,
.restory-ds[data-warm-studio] .ws-files__menu-btn,
.restory-ds[data-warm-studio] .ws-files__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-files__row-menu-btn:hover,
.restory-ds[data-warm-studio] .ws-files__menu-btn:hover,
.restory-ds[data-warm-studio] .ws-files__icon-btn:hover {
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-files__row-menu-btn[aria-expanded="true"] {
  border-color: var(--ds-btn-border);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-files__row-menu-body {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  padding: 5px;
  background: var(--ds-panel-2);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  box-shadow: var(--ds-shadow-lg);
}

.restory-ds[data-warm-studio] .ws-files__menu-details {
  display: flex;
  flex-direction: column;
}

.restory-ds[data-warm-studio] .ws-files__menu-btn {
  justify-content: flex-start;
  width: 100%;
  padding: 7px 9px;
  text-align: left;
}

.restory-ds[data-warm-studio] .ws-files__menu-btn--danger {
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ws-files__tree-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--ds-line);
  color: var(--ds-faint);
  font-size: 11px;
}

.restory-ds[data-warm-studio] .ws-files__doc {
  min-width: 0;
  overflow: hidden;
  background: var(--ds-panel);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .ws-files__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ds-line);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-files__crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
}

/* The crumb keeps its copy control compact so the toolbar's save state and view
   toggle stay in their own slot instead of being crowded by a default button. */
.restory-ds[data-warm-studio] .ws-files__crumb-copy {
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 2px 7px;
  border: 1px solid var(--ds-line);
  border-radius: 6px;
  background: var(--ds-panel);
  color: var(--ds-muted);
  font-family: var(--ds-sans, inherit);
  font-size: 10.5px;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__crumb-copy:hover {
  border-color: var(--ds-line-2);
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .ws-files__crumb-root {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .ws-files__crumb-sep {
  color: var(--ds-line-2);
}

.restory-ds[data-warm-studio] .ws-files__crumb-file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ds-ink-2);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ws-files__toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.restory-ds[data-warm-studio] .ws-files__save-state {
  color: var(--ds-faint);
  font-size: 11.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-files__segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .ws-files__segment {
  padding: 4px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 11.5px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__segment[aria-pressed="true"] {
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .ws-files__body {
  padding: 22px 28px 30px;
}

.restory-ds[data-warm-studio] .ws-files__paper {
  max-width: 760px;
  margin: 0 auto;
  color: var(--ds-ink);
  font-size: 14.5px;
  line-height: 1.65;
}

.restory-ds[data-warm-studio] .ws-files__paper[hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .ws-files__h1,
.restory-ds[data-warm-studio] .ws-files__h2,
.restory-ds[data-warm-studio] .ws-files__h3,
.restory-ds[data-warm-studio] .ws-files__h4,
.restory-ds[data-warm-studio] .ws-files__h5,
.restory-ds[data-warm-studio] .ws-files__h6 {
  margin: 1.2em 0 0.45em;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.restory-ds[data-warm-studio] .ws-files__h1 {
  margin-top: 0;
  font-size: 1.7rem;
}

.restory-ds[data-warm-studio] .ws-files__h2 {
  font-size: 1.28rem;
}

.restory-ds[data-warm-studio] .ws-files__h3 {
  font-size: 1.08rem;
}

.restory-ds[data-warm-studio] .ws-files__p {
  margin: 0.7em 0;
}

.restory-ds[data-warm-studio] .ws-files__list {
  margin: 0.7em 0;
  padding-left: 1.35em;
  list-style: disc;
}

.restory-ds[data-warm-studio] ol.ws-files__list {
  list-style: decimal;
}

.restory-ds[data-warm-studio] .ws-files__item {
  margin: 0.25em 0;
}

.restory-ds[data-warm-studio] .ws-files__item--task {
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-files__task-mark {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin: 0 6px 0 -22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ds-selection-border);
  border-radius: 4px;
  color: var(--ds-accent);
  font-size: 0;
  vertical-align: -2px;
}

.restory-ds[data-warm-studio] .ws-files__item[data-task="done"] .ws-files__task-mark {
  border-color: var(--ds-accent);
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ws-files__item[data-task="done"] .ws-files__task-mark::after {
  content: "";
  width: 5px;
  height: 8px;
  margin-top: -2px;
  border-right: 1.5px solid var(--ds-chrome);
  border-bottom: 1.5px solid var(--ds-chrome);
  transform: rotate(45deg);
}

.restory-ds[data-warm-studio] .ws-files__inline-code {
  padding: 1px 5px;
  border: 1px solid var(--ds-line);
  border-radius: 4px;
  background: var(--ds-chrome);
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 0.88em;
}

.restory-ds[data-warm-studio] .ws-files__table-wrap {
  margin: 1em 0;
  overflow-x: auto;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
}

.restory-ds[data-warm-studio] .ws-files__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.restory-ds[data-warm-studio] .ws-files__table th,
.restory-ds[data-warm-studio] .ws-files__table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ds-line);
  text-align: left;
  vertical-align: top;
}

.restory-ds[data-warm-studio] .ws-files__table th {
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ws-files__source {
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-control);
  background: var(--ds-terminal);
  color: var(--ds-terminal-ink);
  font-family: var(--ds-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.restory-ds[data-warm-studio] .ws-files__editor {
  margin-top: 22px;
  border-top: 1px solid var(--ds-line);
  padding-top: 16px;
}

/* A consumer that gives the editor its own view keeps it mounted and withholds
   it on the other view, so the draft and the CAS fence survive a tab switch. */
.restory-ds[data-warm-studio] .ws-files__editor[hidden] {
  display: none;
}

.restory-ds[data-warm-studio] .ws-files__editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.restory-ds[data-warm-studio] .ws-files__editor-meta {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 10.5px;
}

.restory-ds[data-warm-studio] .ws-files__editor-save {
  padding: 6px 11px;
  border: 1px solid var(--ds-accent-fill);
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__editor-save:hover {
  background: var(--ds-accent-fill-hover);
}

.restory-ds[data-warm-studio] .ws-files__editor-input {
  display: block;
  width: 100%;
  min-height: 170px;
  padding: 12px 14px;
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-family: var(--ds-mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}

.restory-ds[data-warm-studio] .ws-files__editor-input:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: 0 0 0 3px rgba(25, 100, 86, 0.12);
}

/* Exact single-document mode keeps the document bar full width: there is no
   tree column, no second grid track, and the paper/editor owns the panel. */
.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] .ws-files__doc {
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] .ws-files__toolbar {
  min-height: 46px;
  padding: 8px 12px;
  border-top: 1px solid var(--ds-line);
  border-bottom: 1px solid var(--ds-line);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ws-files__doc-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] .ws-files__save-state {
  min-width: 96px;
  text-align: right;
}

.restory-ds[data-warm-studio] .ws-files__doc-save-form {
  display: none;
}

.restory-ds[data-warm-studio] .ws-files__primary-save {
  padding: 6px 14px;
  border: 1px solid var(--ds-accent-fill);
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
  font-family: var(--ds-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__primary-save:hover {
  background: var(--ds-accent-fill-hover);
}

.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] .ws-files__body {
  padding: 18px 14px 30px;
}

.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] .ws-files__paper {
  max-width: 780px;
  margin: 0;
  padding: 28px 34px 34px;
  background: var(--ds-panel-2);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] .ws-files__editor {
  max-width: 780px;
  margin: 0;
  padding: 22px 28px 28px;
  background: var(--ds-panel-2);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .ws-files[data-ws-files-mode="exact"] .ws-files__editor-input {
  min-height: 480px;
}

.restory-ds[data-warm-studio] .ws-files__dirty-marker {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-files__dirty-marker[data-dirty="true"] {
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .ws-files__info,
.restory-ds[data-warm-studio] .ws-files__conflict,
.restory-ds[data-warm-studio] .ws-files__confirm {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--ds-status-info-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
}

.restory-ds[data-warm-studio] .ws-files__conflict {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .ws-files__confirm {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ws-files__info-text,
.restory-ds[data-warm-studio] .ws-files__conflict-text,
.restory-ds[data-warm-studio] .ws-files__confirm-text {
  flex: 1 1 auto;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.restory-ds[data-warm-studio] .ws-files__info-action,
.restory-ds[data-warm-studio] .ws-files__conflict-actions,
.restory-ds[data-warm-studio] .ws-files__confirm-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ws-files__info-action {
  padding: 6px 10px;
  border: 1px solid var(--ds-status-info-fg);
  border-radius: 6px;
  background: transparent;
  color: var(--ds-status-info-fg);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__conflict-update,
.restory-ds[data-warm-studio] .ws-files__confirm-delete,
.restory-ds[data-warm-studio] .ws-files__confirm-cancel,
.restory-ds[data-warm-studio] .ws-files__retry {
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__placeholder,
.restory-ds[data-warm-studio] .ws-files__unsupported,
.restory-ds[data-warm-studio] .ws-files__filtered-empty {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--ds-muted);
  text-align: center;
}

.restory-ds[data-warm-studio] .ws-files__placeholder-title,
.restory-ds[data-warm-studio] .ws-files__filtered-empty-title {
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 700;
}

.restory-ds[data-warm-studio] .ws-files__filtered-empty-text {
  margin: 0;
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .ws-files__filtered-empty-reset {
  margin-top: 6px;
  padding: 5px 10px;
  border: 1px solid var(--ds-btn-border);
  border-radius: 6px;
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-size: 12px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-files__retry-row {
  display: flex;
  justify-content: center;
  padding: 12px;
}

.restory-ds[data-warm-studio] .ws-files__inline-form {
  display: flex;
  gap: 6px;
  padding: 6px;
}

.restory-ds[data-warm-studio] .ws-files__inline-submit {
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
  font-size: 11px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Relations
   ------------------------------------------------------------------------ */

.restory-ds[data-warm-studio] .ws-relations {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  overflow: visible;
}

.restory-ds[data-warm-studio] .ws-relations * {
  box-sizing: border-box;
}

.restory-ds[data-warm-studio] .ws-relations__lead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
}

.restory-ds[data-warm-studio] .ws-relations__intro {
  margin: 0;
  color: var(--ds-muted);
  font-size: 13px;
  line-height: 1.5;
}

.restory-ds[data-warm-studio] .ws-relations__total {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-relations__card {
  position: relative;
  overflow: visible;
  padding: 16px 18px 18px;
  background: var(--ds-panel);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .ws-relations__card.is-open {
  z-index: 5;
}

.restory-ds[data-warm-studio] .ws-relations__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.restory-ds[data-warm-studio] .ws-relations__card-title-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-relations__badge {
  display: inline-flex;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--ds-accent);
  box-shadow: 0 0 0 3px var(--ds-selection-bg);
}

.restory-ds[data-warm-studio] .ws-relations__card-title {
  margin: 0;
  overflow: hidden;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-relations__card-meta {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-relations__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-relations__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-relations__row-link {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none;
}

.restory-ds[data-warm-studio] .ws-relations__row-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.restory-ds[data-warm-studio] .ws-relations__row-title {
  overflow: hidden;
  color: var(--ds-ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-relations__row-sub {
  display: flex;
  min-width: 0;
  gap: 8px;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  line-height: 1.4;
}

.restory-ds[data-warm-studio] .ws-relations__row-meta {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .ws-relations__remove {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 11.5px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-relations__remove:hover {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ws-relations__empty-line {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px dashed var(--ds-line-2);
  border-radius: var(--ds-radius-control);
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .ws-relations__picker {
  position: relative;
  width: 100%;
}

.restory-ds[data-warm-studio] .ws-relations__combo {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-relations__combo:hover {
  border-color: var(--ds-control-border-hover);
}

.restory-ds[data-warm-studio] .ws-relations__picker.is-open .ws-relations__combo {
  border-color: var(--ds-accent);
  box-shadow: 0 0 0 3px rgba(25, 100, 86, 0.12);
}

.restory-ds[data-warm-studio] .ws-relations__combo-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-relations__combo-caret {
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid var(--ds-faint);
  font-size: 0;
  line-height: 0;
}

.restory-ds[data-warm-studio] .ws-relations__picker.is-open .ws-relations__combo-caret {
  transform: rotate(180deg);
}

.restory-ds[data-warm-studio] .ws-relations__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  max-height: 350px;
  overflow: hidden;
  background: var(--ds-panel-2);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-lg), 0 20px 40px -24px rgba(26, 32, 38, 0.35);
}

.restory-ds[data-warm-studio] .ws-relations__dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--ds-line);
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ws-relations__dropdown-kbd {
  color: var(--ds-faint);
  letter-spacing: 0.01em;
  text-transform: none;
}

.restory-ds[data-warm-studio] .ws-relations__query {
  width: calc(100% - 16px);
  height: 34px;
  margin: 8px;
  padding: 0 10px;
  border: 1px solid var(--ds-input-border);
  border-radius: 6px;
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 12.5px;
  outline: none;
}

.restory-ds[data-warm-studio] .ws-relations__query:focus {
  border-color: var(--ds-accent);
  box-shadow: 0 0 0 3px rgba(25, 100, 86, 0.12);
}

.restory-ds[data-warm-studio] .ws-relations__options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0 8px 8px;
  overflow: auto;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-relations__options > li {
  margin: 0;
  padding: 0;
}

.restory-ds[data-warm-studio] .ws-relations__option {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-relations__option:hover,
.restory-ds[data-warm-studio] .ws-relations__option:focus,
.restory-ds[data-warm-studio] .ws-relations__option[aria-selected="true"] {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  outline: none;
}

.restory-ds[data-warm-studio] .ws-relations__option-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}

.restory-ds[data-warm-studio] .ws-relations__option-meta {
  overflow: hidden;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-relations__dropdown-empty {
  margin: 0;
  padding: 14px 12px;
  color: var(--ds-faint);
  font-size: 12px;
  text-align: center;
}

.restory-ds[data-warm-studio] .ws-relations__picker-disabled {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--ds-line-2);
  border-radius: var(--ds-radius-control);
  color: var(--ds-faint);
  font-size: 12px;
}

.restory-ds[data-warm-studio] .ws-relations__banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ds-status-info-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .ws-relations__undo {
  flex: 0 0 auto;
}

.restory-ds[data-warm-studio] .ws-relations__empty {
  padding: 8px;
}

.restory-ds[data-warm-studio] .ws-relations__confirm-copy {
  margin: 0 0 12px;
  color: var(--ds-ink-2);
  font-size: 13px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Tour
   ------------------------------------------------------------------------ */

.restory-ds[data-warm-studio] .ws-tour {
  overflow: hidden;
  background: var(--ds-panel);
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  box-shadow: var(--ds-shadow-card);
  color: var(--ds-ink);
  font-family: var(--ds-sans);
}

.restory-ds[data-warm-studio] .ws-tour * {
  box-sizing: border-box;
}

.restory-ds[data-warm-studio] .ws-tour__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ds-line);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-tour__head-col {
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-tour__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.restory-ds[data-warm-studio] .ws-tour__file {
  display: inline-flex;
  max-width: 300px;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid var(--ds-line-2);
  border-radius: var(--ds-radius-badge);
  background: var(--ds-chrome);
  color: var(--ds-ink-2);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-tour__file::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 10px;
  border: 1px solid var(--ds-faint);
  border-radius: 1px;
  opacity: 0.8;
}

.restory-ds[data-warm-studio] .ws-tour__verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--ds-status-info-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-status-info-bg);
  color: var(--ds-status-info-fg);
  font-size: 11px;
  font-weight: 600;
}

.restory-ds[data-warm-studio] .ws-tour__verdict[data-tone="success"] {
  border-color: var(--ds-status-success-border);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
}

.restory-ds[data-warm-studio] .ws-tour__verdict[data-tone="warn"],
.restory-ds[data-warm-studio] .ws-tour__verdict[data-tone="warning"] {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .ws-tour__verdict[data-tone="error"] {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ws-tour__verdict-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.restory-ds[data-warm-studio] .ws-tour__stamp {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 10.5px;
}

.restory-ds[data-warm-studio] .ws-tour__title {
  margin: 0;
  color: var(--ds-ink);
  font-family: var(--ds-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.restory-ds[data-warm-studio] .ws-tour__actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ws-tour__refresh,
.restory-ds[data-warm-studio] .ws-tour__overview,
.restory-ds[data-warm-studio] .ws-tour__retry {
  padding: 7px 11px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-tour__refresh:hover,
.restory-ds[data-warm-studio] .ws-tour__overview:hover,
.restory-ds[data-warm-studio] .ws-tour__retry:hover {
  background: var(--ds-btn-hover);
}

.restory-ds[data-warm-studio] .ws-tour__full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--ds-accent-fill);
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent-fill);
  color: var(--ds-accent-ink);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-tour__full:hover {
  background: var(--ds-accent-fill-hover);
}

.restory-ds[data-warm-studio] .ws-tour__full[aria-disabled="true"],
.restory-ds[data-warm-studio] .ws-tour__full[data-ws-tour-expired="true"] {
  border-color: var(--ds-btn-border);
  background: var(--ds-chrome);
  color: var(--ds-faint);
  cursor: not-allowed;
  pointer-events: none;
}

.restory-ds[data-warm-studio] .ws-tour__body {
  padding: 16px 18px 18px;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .ws-tour__receipts {
  margin-bottom: 14px;
}

.restory-ds[data-warm-studio] .ws-tour__receipt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-tour__receipt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--ds-line-2);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .ws-tour__receipt-label {
  font-family: var(--ds-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ws-tour__receipt-count {
  color: var(--ds-accent);
  font-weight: 700;
}

.restory-ds[data-warm-studio] .ws-tour__frame-wrap {
  overflow: hidden;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: #ffffff;
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .ws-tour__frame {
  display: block;
  width: 100%;
  height: 560px;
  border: 0;
  background: #ffffff;
}

.restory-ds[data-warm-studio] .ws-tour__retry-row {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.restory-ds[data-warm-studio] .ws-tour[data-state="empty"] .ws-tour__body {
  padding: 18px;
}

@media (max-width: 980px) {
  .restory-ds[data-warm-studio] .ws-files {
    grid-template-columns: 1fr;
  }

  .restory-ds[data-warm-studio] .ws-files__tree {
    min-height: 280px;
    max-height: 360px;
  }

  .restory-ds[data-warm-studio] .ws-tour__head {
    flex-direction: column;
  }
}

/* ============================================================================
   Warm Studio · Reusable Agent / Terminal pane
   ============================================================================

   Modular stylesheet for `RestoryBackendWeb.WarmStudioAgentPaneComponent`.
   The workbench staging composes this file after the base rules into the one
   staged `warm_studio.css`; it stays standalone so the component can be
   rendered in an isolated test document. Every rule is scoped to the pane
   marker, reuses the Warm Studio custom properties when the host provides
   them, and supplies neutral fallbacks.

   No screen presentation is asserted by tests. This file only implements the
   project warm-charcoal terminal island, readable metadata pills, focus rings,
   announcements and an unclipped narrow layout.
   ========================================================================== */

[data-warm-studio-agent-pane] {
  --ws-agent-surface: var(--ds-panel, #fcfbf8);
  --ws-agent-canvas: var(--ds-canvas, #f4f1ea);
  --ws-agent-panel-border: var(--ds-panel-border, #dfd9ce);
  --ws-agent-line: var(--ds-line, rgba(26, 32, 38, 0.08));
  --ws-agent-ink: var(--ds-ink, #1a2026);
  --ws-agent-muted: var(--ds-muted, #464f59);
  --ws-agent-faint: var(--ds-faint, #565f69);
  --ws-agent-accent: var(--ds-accent, #196456);
  --ws-agent-accent-ink: var(--ds-accent-ink, #ffffff);
  --ws-agent-terminal: var(--ds-terminal, #1c1e1c);
  --ws-agent-terminal-ink: var(--ds-terminal-ink, #efece4);
  --ws-agent-warn-bg: var(--ds-status-warn-bg, #f9e8c4);
  --ws-agent-warn-fg: var(--ds-status-warn-fg, #663c06);
  --ws-agent-error-bg: var(--ds-status-error-bg, #fbe9e7);
  --ws-agent-error-fg: var(--ds-status-error-fg, #8f2c20);
  --ws-agent-radius: var(--ds-radius-panel, 12px);
  --ws-agent-radius-control: var(--ds-radius-control, 8px);
  --ws-agent-mono: var(--ds-mono, "JetBrains Mono", ui-monospace, monospace);
  --ws-agent-sans: var(
    --ds-sans,
    "Figtree",
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif
  );

  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
  padding: 1rem;
  color: var(--ws-agent-ink);
  background: var(--ws-agent-surface);
  border: 1px solid var(--ws-agent-panel-border);
  border-radius: var(--ws-agent-radius);
  font-family: var(--ws-agent-sans);
  overflow-wrap: anywhere;
}

[data-warm-studio-agent-pane] *,
[data-warm-studio-agent-pane] *::before,
[data-warm-studio-agent-pane] *::after {
  box-sizing: inherit;
}

[data-warm-studio-agent-pane]:focus-visible,
[data-warm-studio-agent-pane] [tabindex]:focus-visible,
[data-warm-studio-agent-pane] button:focus-visible,
[data-warm-studio-agent-pane] textarea:focus-visible {
  outline: 2px solid var(--ws-agent-accent);
  outline-offset: 2px;
}

.ws-agent-pane__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  min-width: 0;
}

.ws-agent-pane__identity {
  flex: 1 1 12rem;
  min-width: 0;
}

.ws-agent-pane__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.ws-agent-pane__subject {
  margin: 0.2rem 0 0;
  color: var(--ws-agent-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ws-agent-pane__status {
  margin: 0;
  align-self: center;
  padding: 0.15rem 0.5rem;
  color: var(--ws-agent-muted);
  background: var(--ws-agent-canvas);
  border: 1px solid var(--ws-agent-line);
  border-radius: var(--ds-radius-pill, 999px);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: normal;
}

.ws-agent-pane__status[data-ws-agent-status="denied"],
.ws-agent-pane__status[data-ws-agent-status="unavailable"] {
  color: var(--ws-agent-error-fg);
  background: var(--ws-agent-error-bg);
}

.ws-agent-pane__status[data-ws-agent-status="offline"],
.ws-agent-pane__status[data-ws-agent-status="partial"] {
  color: var(--ws-agent-warn-fg);
  background: var(--ws-agent-warn-bg);
}

.ws-agent-pane__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ws-agent-pane__mode {
  padding: 0.25rem 0.55rem;
  color: var(--ws-agent-muted);
  background: transparent;
  border: 1px solid var(--ws-agent-panel-border);
  border-radius: var(--ws-agent-radius-control);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.ws-agent-pane__mode[aria-pressed="true"] {
  color: var(--ws-agent-accent-ink);
  background: var(--ws-agent-accent);
  border-color: var(--ws-agent-accent);
}

.ws-agent-pane__read-only,
.ws-agent-pane__notice,
.ws-agent-pane__omission,
.ws-agent-pane__help,
.ws-agent-pane__placeholder {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ws-agent-pane__read-only,
.ws-agent-pane__omission {
  color: var(--ws-agent-muted);
}

.ws-agent-pane__notice {
  padding: 0.55rem 0.7rem;
  color: var(--ws-agent-warn-fg);
  background: var(--ws-agent-warn-bg);
  border: 1px solid var(--ws-agent-line);
  border-radius: var(--ws-agent-radius-control);
}

.ws-agent-pane__notice[data-ws-agent-notice="denied"],
.ws-agent-pane__notice[data-ws-agent-notice="unavailable"] {
  color: var(--ws-agent-error-fg);
  background: var(--ws-agent-error-bg);
}

.ws-agent-pane__placeholder,
.ws-agent-pane__help {
  color: var(--ws-agent-faint);
}

.ws-agent-pane__transcript {
  min-width: 0;
}

.ws-agent-pane__turns {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ws-agent-pane__turn {
  min-width: 0;
  padding: 0.6rem 0.7rem;
  background: var(--ws-agent-canvas);
  border: 1px solid var(--ws-agent-line);
  border-radius: var(--ws-agent-radius-control);
}

.ws-agent-pane__turn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 0.35rem;
}

.ws-agent-pane__pill {
  max-width: 100%;
  padding: 0.1rem 0.45rem;
  color: var(--ws-agent-muted);
  background: var(--ws-agent-surface);
  border: 1px solid var(--ws-agent-panel-border);
  border-radius: var(--ds-radius-pill, 999px);
  font-family: var(--ws-agent-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ws-agent-pane__timestamp {
  color: var(--ws-agent-faint);
  font-family: var(--ws-agent-mono);
  font-size: 0.7rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ws-agent-pane__thinking,
.ws-agent-pane__turn-text {
  margin: 0;
  font-family: var(--ws-agent-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ws-agent-pane__thinking {
  margin-bottom: 0.35rem;
  padding-left: 0.55rem;
  color: var(--ws-agent-muted);
  border-left: 2px solid var(--ws-agent-panel-border);
}

.ws-agent-pane__terminal-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.ws-agent-pane__terminal {
  min-height: 9rem;
  max-width: 100%;
  margin: 0;
  padding: 0.8rem 0.9rem;
  color: var(--ws-agent-terminal-ink);
  background: var(--ws-agent-terminal);
  border: 1px solid var(--ws-agent-terminal);
  border-radius: var(--ws-agent-radius-control);
  font-family: var(--ws-agent-mono);
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.ws-agent-pane__composer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ws-agent-pane__commands {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.ws-agent-pane__command {
  min-height: 1.9rem;
  padding: 0.28rem 0.8rem;
  color: var(--ws-agent-terminal-ink);
  background: #2c302c;
  border: 1px solid #4c524c;
  border-radius: var(--ws-agent-radius-control);
  font-family: var(--ws-agent-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.ws-agent-pane__command:hover:not(:disabled) {
  background: #363b36;
  border-color: #5d645d;
}

.ws-agent-pane__command:active:not(:disabled) {
  background: #232723;
}

.ws-agent-pane__command:disabled,
.ws-agent-pane__command[aria-disabled="true"] {
  color: var(--ws-agent-faint);
  background: var(--ws-agent-canvas);
  border-color: var(--ws-agent-line);
  cursor: not-allowed;
}

.ws-agent-pane__label {
  color: var(--ws-agent-muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.ws-agent-pane__draft {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.55rem 0.65rem;
  color: var(--ws-agent-ink);
  background: var(--ws-agent-surface);
  border: 1px solid var(--ws-agent-panel-border);
  border-radius: var(--ws-agent-radius-control);
  font-family: var(--ws-agent-mono);
  font-size: 0.8125rem;
  line-height: 1.45;
  resize: vertical;
}

@media (max-width: 480px) {
  [data-warm-studio-agent-pane] {
    padding: 0.75rem;
    gap: 0.6rem;
  }

  .ws-agent-pane__header {
    flex-direction: column;
    align-items: stretch;
  }

  .ws-agent-pane__status {
    align-self: flex-start;
  }

  .ws-agent-pane__mode {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-warm-studio-agent-pane] * {
    scroll-behavior: auto;
  }
}

/* ============================================================================
   Research reader (research-single-view screen 1)
   One delimited, screen-scoped block. It reuses the Warm Studio tokens, the
   shell frame, the document-only Files reader and the agent pane. Only the
   reader surface owns the frame height; the list route keeps its own block.
   ========================================================================== */

.restory-ds[data-warm-studio] .ds-app:has(.research-detail) {
  height: 100dvh;
  grid-template-rows: 44px minmax(0, 1fr);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ds-app:has(.research-detail) > .ds-main {
  min-height: 0;
  height: auto;
  padding: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .research-detail {
  --rd-chrome-hi: var(--ds-chrome-hi, #f2ecdf);
  --rd-well: var(--ds-surface-well, #f6f1e6);
  --rd-control-border: var(--ds-control-border, var(--ds-line));
  --rd-editorial: var(--ds-editorial, "Newsreader", Georgia, "Times New Roman", serif);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 456px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--ds-canvas);
  color: var(--ds-ink);
}

/* Header ------------------------------------------------------------------ */

.restory-ds[data-warm-studio] .research-detail__subject {
  /* Flex column, not a fixed two-row grid: the header and any status or notice
     rows keep their intrinsic height, and only the body flexes. A fixed
     `auto minmax(0, 1fr)` grid gave the second row to the first notice, so a
     refused switch (or a loading/empty note) pushed the inventory and the
     retained draft into an implicit row that this overflow clipped. */
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .research-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px 14px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .research-detail__ident {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-detail__tile {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-xs);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .research-detail__tile-icon {
  width: 18px;
  height: 18px;
}

.restory-ds[data-warm-studio] .research-detail__ident-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-detail__crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-family: var(--ds-mono);
  font-size: 11.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__crumb {
  color: var(--ds-muted);
  text-decoration: none;
  border-radius: 4px;
}

.restory-ds[data-warm-studio] .research-detail__crumb:hover {
  color: var(--ds-accent);
  text-decoration: underline;
}

.restory-ds[data-warm-studio] .research-detail__crumb-sep {
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-detail__path-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ds-ink-2);
}

.restory-ds[data-warm-studio] .research-detail__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-detail__title {
  margin: 0;
  font-family: var(--ds-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__pill {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--ds-radius-pill);
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .research-detail__pill--warn {
  border-color: var(--ds-status-warn-border);
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .research-detail__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 4px;
}

.restory-ds[data-warm-studio] .research-detail__design {
  position: relative;
}

.restory-ds[data-warm-studio] .research-detail__design > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.restory-ds[data-warm-studio] .research-detail__design > summary::-webkit-details-marker {
  display: none;
}

.restory-ds[data-warm-studio] .research-detail__design-form {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 6px;
  width: 268px;
  padding: 14px;
  border-radius: var(--ds-radius-panel);
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-lg);
}

.restory-ds[data-warm-studio] .research-detail__design-form label {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__design-form input[type="text"],
.restory-ds[data-warm-studio] .research-detail__design-form select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--ds-radius-control);
  border: 1px solid var(--rd-control-border);
  background: var(--ds-panel);
  color: var(--ds-ink);
  font-size: 13px;
}

.restory-ds[data-warm-studio] .research-detail__design-form button[type="submit"] {
  margin-top: 8px;
}

.restory-ds[data-warm-studio] .research-detail__design-receipt {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ds-muted);
}

/* Status ------------------------------------------------------------------ */

.restory-ds[data-warm-studio] .research-detail__status {
  margin: 0;
  padding: 10px 22px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--rd-well);
  color: var(--ds-muted);
  font-size: 12.5px;
}

.restory-ds[data-warm-studio] .research-detail__status--error {
  background: var(--ds-status-warn-bg);
  color: var(--ds-status-warn-fg);
}

/* Interior inventory + reader --------------------------------------------- */

.restory-ds[data-warm-studio] .research-detail__body {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .research-detail__rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 14px 12px 20px;
  background: var(--ds-chrome);
  border-right: 1px solid var(--ds-panel-border);
  overflow-y: auto;
}

.restory-ds[data-warm-studio] .research-detail__rail-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-detail__rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
}

.restory-ds[data-warm-studio] .research-detail__rail-title {
  margin: 0;
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__rail-count {
  font-family: var(--ds-mono);
  font-size: 11px;
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-detail__file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .research-detail__file {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .research-detail__file:hover {
  background: var(--rd-chrome-hi);
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__file[aria-current="true"] {
  background: var(--ds-selection-bg);
  border-color: var(--ds-selection-border);
  color: var(--ds-accent);
  font-weight: 600;
}

.restory-ds[data-warm-studio] .research-detail__file-ext {
  flex: 0 0 auto;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .research-detail__file[aria-current="true"] .research-detail__file-ext {
  color: var(--ds-accent);
  border-color: var(--ds-selection-border);
}

.restory-ds[data-warm-studio] .research-detail__file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .research-detail__rail-empty,
.restory-ds[data-warm-studio] .research-detail__rail-note {
  margin: 0;
  padding: 0 6px;
  color: var(--ds-faint);
  font-size: 12px;
  line-height: 1.55;
}

.restory-ds[data-warm-studio] .research-detail__rail-note {
  color: var(--ds-status-warn-fg);
}

.restory-ds[data-warm-studio] .research-detail__used-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .research-detail__used {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  text-decoration: none;
}

.restory-ds[data-warm-studio] a.research-detail__used:hover {
  background: var(--ds-panel-2);
  border-color: var(--rd-control-border);
}

.restory-ds[data-warm-studio] .research-detail__used--inert {
  color: var(--ds-faint);
  border-style: dashed;
  background: transparent;
  cursor: default;
}

.restory-ds[data-warm-studio] .research-detail__used-kind {
  font-family: var(--ds-sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__used-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__used--inert .research-detail__used-title {
  color: var(--ds-faint);
}

/* Reader column ----------------------------------------------------------- */

.restory-ds[data-warm-studio] .research-detail__reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--ds-canvas);
}

.restory-ds[data-warm-studio] .research-detail__files {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__doc {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 42px;
  padding: 6px 22px;
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__body {
  padding: 26px 28px 40px;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__paper {
  max-width: 62ch;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__p {
  margin: 0.72em 0;
  font-family: var(--rd-editorial);
  font-size: 16.5px;
  line-height: 1.66;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__h1 {
  font-size: 21px;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__editor-input {
  font-family: var(--ds-mono);
  font-size: 13.5px;
  line-height: 1.65;
  min-height: 46vh;
}

/* The reader names the open document itself, so the adapter's own path crumb
   would repeat it. The document identity band below carries that identity
   together with the owner-backed revision and access facts. */
.restory-ds[data-warm-studio] .research-detail__files .ws-files__crumb {
  display: none;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__toolbar {
  justify-content: flex-end;
}

/* Document identity band -------------------------------------------------- */

/* One band above the reader pairs the selected document with what its owner
   read established: content revision, size, modification age and the
   owner-authorized access state. */
.restory-ds[data-warm-studio] .research-detail__docmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 22px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  font-family: var(--ds-ui);
  font-size: 12px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__docmeta-name {
  font-family: var(--ds-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__docmeta-rev,
.restory-ds[data-warm-studio] .research-detail__docmeta-size,
.restory-ds[data-warm-studio] .research-detail__docmeta-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .research-detail__docmeta-rev::before,
.restory-ds[data-warm-studio] .research-detail__docmeta-size::before,
.restory-ds[data-warm-studio] .research-detail__docmeta-updated::before {
  content: "·";
  color: var(--ds-faint);
}

.restory-ds[data-warm-studio] .research-detail__docmeta-rev {
  font-family: var(--ds-mono);
  font-size: 11px;
}

.restory-ds[data-warm-studio] .research-detail__docmeta-access {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 999px;
  background: var(--ds-panel-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ds-ink);
}

/* The status slot keeps the mode toggle and the primary action still while the
   save state changes. */
.restory-ds[data-warm-studio] .research-detail__files .ws-files__save-state--slot {
  min-width: 108px;
  text-align: right;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__editor-save--primary {
  padding: 6px 14px;
  border-radius: 8px;
  border: 0;
  background: var(--ds-accent);
  color: var(--ds-accent-ink, #fff);
  font-family: var(--ds-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .research-detail__files .ws-files__mode {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 8px;
  background: var(--ds-panel);
}

/* Intake (flush drop target for this topic) -------------------------------- */

/* The intake sits flush above the inventory it grows: the rail supplies the
   frame, so the zone is a dashed seam rather than a second boxed panel. */
.restory-ds[data-warm-studio] .research-detail__intake {
  margin: 10px 12px 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.restory-ds[data-warm-studio] .research-detail__drop {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 13px 12px;
  border: 1px dashed var(--rd-control-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ds-panel) 88%, transparent);
  color: var(--ds-muted);
  font-size: 12.5px;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.restory-ds[data-warm-studio] .research-detail__drop.phx-drop-target-active {
  border-style: solid;
  border-color: var(--ds-accent);
  background: var(--ds-selection-bg);
  padding: 10px 12px;
}

/* A file drag over this one scoped target replaces the idle intake copy with
   the release state. The pinned LiveView client owns the active class on this
   form, so no page-wide listener is involved. */
.restory-ds[data-warm-studio] .research-detail__drop-ghost {
  display: none;
}

.restory-ds[data-warm-studio] .research-detail__drop.phx-drop-target-active .research-detail__drop-ghost {
  display: flex;
  align-items: center;
  gap: 10px;
}

.restory-ds[data-warm-studio] .research-detail__drop.phx-drop-target-active .research-detail__drop-label,
.restory-ds[data-warm-studio] .research-detail__drop.phx-drop-target-active .research-detail__drop-input {
  display: none;
}

.restory-ds[data-warm-studio] .research-detail__drop-ghost-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ds-panel-border);
  border-radius: 8px;
  background: var(--ds-panel-2);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .research-detail__drop-ghost-icon svg {
  width: 15px;
  height: 15px;
}

.restory-ds[data-warm-studio] .research-detail__drop-ghost-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-detail__drop-ghost-title {
  font-family: var(--ds-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__drop-ghost-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__drop-label {
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .research-detail__drop-title {
  font-family: var(--ds-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__drop-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__drop-input {
  width: 100%;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__drop-input::file-selector-button {
  margin-right: 8px;
  padding: 5px 10px;
  border: 1px solid var(--rd-control-border);
  border-radius: 8px;
  background: var(--ds-panel);
  color: var(--ds-ink);
  font: inherit;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .research-detail__drop-queue {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
  font-size: 11.5px;
}

.restory-ds[data-warm-studio] .research-detail__drop-receipt {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ds-muted);
}

.restory-ds[data-warm-studio] .research-detail__drop-saved {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  font-family: var(--ds-mono);
  font-size: 10.5px;
  color: var(--ds-ink);
}

/* Persistent conversation pane -------------------------------------------- */

.restory-ds[data-warm-studio] .research-detail__pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
  overflow: hidden;
}

.restory-ds[data-warm-studio] .research-detail__pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .research-detail__pane-ident {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .research-detail__pane-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-accent);
}

.restory-ds[data-warm-studio] .research-detail__pane-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--ds-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .research-detail__pane-open {
  flex: 0 0 auto;
}

.restory-ds[data-warm-studio] .research-detail__agent {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .research-detail__agent [data-warm-studio-agent-pane] {
  flex: 1;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 15px;
}

/* Narrow frames keep the three regions usable without a horizontal scroll. */

@media (max-width: 1180px) {
  .restory-ds[data-warm-studio] .research-detail {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  .restory-ds[data-warm-studio] .research-detail__body {
    grid-template-columns: 196px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .restory-ds[data-warm-studio] .research-detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 42vh);
    height: auto;
    max-height: 100dvh;
    overflow-y: auto;
  }

  .restory-ds[data-warm-studio] .research-detail__pane {
    border-left: 0;
    border-top: 1px solid var(--ds-panel-border);
  }
}

/*
 * Warm Studio design canvas — modular stylesheet.
 *
 * Everything here is scoped under `.restory-ds[data-warm-studio]` and reads the
 * design tokens declared in `assets/css/warm_studio.css`; nothing here declares
 * a token, a global element style or a font. The file is imported once by the
 * screen that mounts the component and is never a dependency of the shared
 * shell.
 *
 * Layout is CSS-only and CSP-safe: no inline style, no `onclick`, no script.
 * Thumbnails are scaled by the stylesheet, never by the caller and never by the
 * preview document, and the Focus stage is never scaled.
 */

/* ------------------------------------------------------------------ frame */

.restory-ds[data-warm-studio] .ws-dc {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  color: var(--ds-ink);
  font-family: var(--ds-sans);
}

.restory-ds[data-warm-studio] .ws-dc__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.restory-ds[data-warm-studio] .ws-dc__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1180px) {
  .restory-ds[data-warm-studio] .ws-dc__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.restory-ds[data-warm-studio] .ws-dc__stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background-color: var(--ds-rail);
  background-image: radial-gradient(circle, rgba(26, 32, 38, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  background-position: 0 0;
  box-shadow: var(--ds-shadow-card);
}

/* ------------------------------------------------------- ordered selector */

.restory-ds[data-warm-studio] .ws-dc__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restory-ds[data-warm-studio] .ws-dc__strip-item {
  display: flex;
  margin: 0;
}

.restory-ds[data-warm-studio] .ws-dc__pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 240px;
  padding: 5px 10px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__pill:hover {
  border-color: var(--ds-control-border-hover);
  background: var(--ds-btn-hover);
}

.restory-ds[data-warm-studio] .ws-dc__pill--selected,
.restory-ds[data-warm-studio] .ws-dc__pill[aria-pressed="true"] {
  border-color: var(--ds-selection-border);
  background: var(--ds-selection-bg);
  color: var(--ds-accent);
}

.restory-ds[data-warm-studio] .ws-dc__pill-step {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11px;
}

/* The strip prints the step token beside the item's own label, so the label is
   the only flexible part and stays on one line until the pill's own width. */
.restory-ds[data-warm-studio] .ws-dc__pill-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------- mode switch */

.restory-ds[data-warm-studio] .ws-dc__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.restory-ds[data-warm-studio] .ws-dc__modes {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .ws-dc__mode {
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__mode:hover {
  color: var(--ds-ink);
}

.restory-ds[data-warm-studio] .ws-dc__mode--selected,
.restory-ds[data-warm-studio] .ws-dc__mode[aria-pressed="true"] {
  background: var(--ds-panel-2);
  color: var(--ds-accent);
  box-shadow: var(--ds-shadow-xs);
}

/* ------------------------------------------------- small-multiple card grid */

.restory-ds[data-warm-studio] .ws-dc__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0;
}

.restory-ds[data-warm-studio] .ws-dc__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .ws-dc__card--selected,
.restory-ds[data-warm-studio] .ws-dc__card[data-selected="true"] {
  border-color: var(--ds-selection-border);
  box-shadow: var(--ds-shadow-card), 0 0 0 1px var(--ds-selection-border);
}

.restory-ds[data-warm-studio] .ws-dc__card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ds-line);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .ws-dc__card-select {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 12px;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__card-step {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11px;
}

.restory-ds[data-warm-studio] .ws-dc__card-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restory-ds[data-warm-studio] .ws-dc__badges {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}

.restory-ds[data-warm-studio] .ws-dc__card-focus {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__card-focus:hover {
  border-color: var(--ds-control-border-hover);
  background: var(--ds-btn-hover);
  color: var(--ds-ink);
}

/* -------------------------------------------------------------- apertures */

.restory-ds[data-warm-studio] .ws-dc__aperture {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-dc__capture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

/*
 * The preview document is authored at the desktop viewport width, so the
 * thumbnail is scaled down by the stylesheet rather than by the caller. The
 * frame keeps its authored width and is never resized: the transform only
 * shrinks what is already painted, which keeps text legible and the sandboxed
 * document untouched.
 */
.restory-ds[data-warm-studio] .ws-dc__thumb {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.restory-ds[data-warm-studio] .ws-dc__thumb-scale {
  width: 1440px;
  height: 900px;
  transform: scale(0.1875);
  transform-origin: top left;
  pointer-events: none;
}

@supports (transform: scale(tan(atan2(100cqw, 1440px)))) {
  .restory-ds[data-warm-studio] .ws-dc__thumb-scale {
    transform: scale(min(1, tan(atan2(100cqw, 1440px))));
  }
}

.restory-ds[data-warm-studio] .ws-dc__thumb-frame {
  display: block;
  width: 1440px;
  height: 900px;
  border: 0;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-dc__unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  background: var(--ds-chrome);
  box-sizing: border-box;
}

.restory-ds[data-warm-studio] .ws-dc__unavailable-text {
  margin: 0;
  color: var(--ds-faint);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

/* ------------------------------------------------------------ focus stage */

.restory-ds[data-warm-studio] .ws-dc__focus {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-dc__focus-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ws-dc__field {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-dc__field-label {
  color: var(--ds-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 14px;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ws-dc__picker {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink);
  font-family: var(--ds-sans);
  font-size: 12px;
  line-height: 18px;
}

.restory-ds[data-warm-studio] .ws-dc__segmented {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-chrome);
}

.restory-ds[data-warm-studio] .ws-dc__seg {
  min-width: 46px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__seg--selected,
.restory-ds[data-warm-studio] .ws-dc__seg[aria-pressed="true"] {
  background: var(--ds-panel-2);
  color: var(--ds-accent);
  box-shadow: var(--ds-shadow-xs);
}

.restory-ds[data-warm-studio] .ws-dc__stepper {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ws-dc__step {
  padding: 5px 10px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__step:hover:enabled {
  border-color: var(--ds-control-border-hover);
  background: var(--ds-btn-hover);
}

.restory-ds[data-warm-studio] .ws-dc__step:disabled {
  border-color: var(--ds-line-2);
  background: var(--ds-chrome);
  color: var(--ds-faint);
  opacity: 0.55;
  cursor: default;
}

.restory-ds[data-warm-studio] .ws-dc__step-count {
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 11px;
  white-space: nowrap;
}

/*
 * The Focus stage is never scaled or cropped. The viewport switcher changes
 * only the width of the frame; when the stage is narrower than the authored
 * logical width the paper scrolls locally instead of reflowing the document.
 */
.restory-ds[data-warm-studio] .ws-dc__paper {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-start;
  min-height: 420px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-dc__paper[data-ws-dc-viewport="desktop"] .ws-dc__frame {
  width: 1440px;
}

.restory-ds[data-warm-studio] .ws-dc__paper[data-ws-dc-viewport="mobile"] .ws-dc__frame {
  width: 390px;
}

.restory-ds[data-warm-studio] .ws-dc__frame {
  flex: 0 0 auto;
  height: 900px;
  margin-inline: auto;
  border: 1px solid var(--ds-line-2);
  border-radius: 6px;
  background: var(--ds-panel-2);
}

.restory-ds[data-warm-studio] .ws-dc__paper .ws-dc__capture {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

/* ---------------------------------------------- focus actions and path rows */

.restory-ds[data-warm-studio] .ws-dc__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-dc__paths {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-dc__path {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-dc__path-label {
  flex: 0 0 auto;
  min-width: 46px;
  color: var(--ds-faint);
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restory-ds[data-warm-studio] .ws-dc__path-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ds-muted);
  font-family: var(--ds-mono);
  font-size: 13.5px;
  line-height: 20px;
}

.restory-ds[data-warm-studio] .ws-dc__path-text--missing {
  color: var(--ds-faint);
  font-family: var(--ds-sans);
  font-size: 14px;
  font-style: italic;
  line-height: 20px;
}

.restory-ds[data-warm-studio] .ws-dc__action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.restory-ds[data-warm-studio] .ws-dc__action {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--ds-btn-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  color: var(--ds-ink-2);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__action:hover:enabled {
  border-color: var(--ds-control-border-hover);
  background: var(--ds-btn-hover);
}

.restory-ds[data-warm-studio] .ws-dc__action:disabled {
  color: var(--ds-faint);
  opacity: 0.55;
  cursor: default;
}

.restory-ds[data-warm-studio] .ws-dc__action--danger {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.restory-ds[data-warm-studio] .ws-dc__confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--ds-status-error-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-error-bg);
}

.restory-ds[data-warm-studio] .ws-dc__confirm-text {
  margin: 0;
  color: var(--ds-status-error-fg);
  font-size: 14px;
  line-height: 20px;
}

.restory-ds[data-warm-studio] .ws-dc__confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ------------------------------------------------------- empty / alternate */

.restory-ds[data-warm-studio] .ws-dc__slot {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-dc__blank {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 20px;
  border: 1px dashed var(--ds-line-2);
  border-radius: var(--ds-radius-control);
  background: var(--ds-panel-2);
  text-align: center;
}

.restory-ds[data-warm-studio] .ws-dc__blank-title {
  margin: 0;
  color: var(--ds-ink-2);
  font-family: var(--ds-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

.restory-ds[data-warm-studio] .ws-dc__blank-body {
  margin: 0;
  color: var(--ds-muted);
  font-size: 14px;
  line-height: 20px;
}

/* ------------------------------------------------------- right inspector */

.restory-ds[data-warm-studio] .ws-dc__inspector {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-card);
}

.restory-ds[data-warm-studio] .ws-dc__inspector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 0;
}

.restory-ds[data-warm-studio] .ws-dc__ref {
  display: flex;
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.restory-ds[data-warm-studio] .ws-dc__tabs {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.restory-ds[data-warm-studio] .ws-dc__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ds-muted);
  font-family: var(--ds-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}

.restory-ds[data-warm-studio] .ws-dc__tab:hover {
  color: var(--ds-ink);
}

/* The reference marks the active section with the accent text and an underline
   bar, not with a boxed outline, so the tab strip reads as one row of labels. */
.restory-ds[data-warm-studio] .ws-dc__tab--selected,
.restory-ds[data-warm-studio] .ws-dc__tab[aria-selected="true"] {
  border-bottom-color: var(--ds-accent);
  background: transparent;
  color: var(--ds-accent);
}

/* The health tab badge is the owner's blocking finding count. It is only
   rendered for a positive count, and it carries the error tone because a
   blocking finding is what keeps the package from handoff. */
.restory-ds[data-warm-studio] .ws-dc__tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
  font-family: var(--ds-sans);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.restory-ds[data-warm-studio] .ws-dc__thread-toggle {
  margin-inline-start: auto;
}

.restory-ds[data-warm-studio] .ws-dc__inspector-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

/* The inspector's status strip is a sibling of the scrolling body, so it keeps
   the panel's bottom edge while the body scrolls above it. */
.restory-ds[data-warm-studio] .ws-dc__inspector-footer {
  flex: 0 0 auto;
  min-width: 0;
  border-top: 1px solid var(--ds-line);
  border-radius: 0 0 var(--ds-radius-panel) var(--ds-radius-panel);
  background: var(--ds-panel);
}

.restory-ds[data-warm-studio] .ws-dc__inspector-empty {
  margin: 0;
  color: var(--ds-faint);
  font-size: 14px;
  line-height: 20px;
}

/* ---------------------------------------------------------- focus states */

.restory-ds[data-warm-studio] .ws-dc__pill:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__mode:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__card-select:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__card-focus:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__seg:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__step:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__picker:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__action:focus-visible,
.restory-ds[data-warm-studio] .ws-dc__tab:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .restory-ds[data-warm-studio] .ws-dc__thumb-scale {
    transition: none;
  }
}

/* Feature-scoped Secrets document. Reuses Warm Studio primitives and never
   changes the shared rail, top bar or neighboring screens. */

.secrets-screen {
  max-width: 840px;
  padding: 14px 28px 22px;
  display: grid;
  gap: 11px;
}

.secrets-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.secrets-head .page-kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-muted);
}

.secrets-head .page-title {
  font-family: var(--ds-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ds-ink);
}

.secrets-head .page-subtitle {
  margin-top: 4px;
  max-width: 74ch;
  color: var(--ds-ink-2);
  font-size: 14.5px;
}

.secrets-mono {
  font-family: var(--ds-mono);
  font-size: 0.94em;
  font-variant-numeric: tabular-nums;
}

.secrets-link {
  color: var(--ds-accent-fill);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.secrets-boundary {
  display: grid;
  gap: 11px;
  min-width: 0;
}

/* Checking and withheld stay one quiet card so the document never looks empty
   when it simply has not answered yet. */
.secrets-screen [data-secrets-checking],
.secrets-screen [data-secrets-withheld] {
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
  padding: 22px;
  display: grid;
  gap: 10px;
  color: var(--ds-ink-2);
}

.secrets-screen [data-secrets-pairing] {
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin-top: 12px;
}

.secrets-screen [data-secrets-pairing] .ds-field__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-ink);
}

.secrets-screen [data-secrets-pairing] .ds-btn {
  justify-self: start;
}

/* ----- custody notice ----- */

.secrets-custody {
  border: 1px solid var(--ds-panel-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel);
  box-shadow: var(--ds-shadow-xs);
  padding: 11px 16px;
}

.secrets-custody-body {
  display: grid;
  gap: 4px;
}

.secrets-custody-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.secrets-custody-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-ink);
}

.secrets-custody-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ds-ink-2);
}

.secrets-screen .ds-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ----- list ----- */

/* The shell's settings card rule (`--ds-pad-card`, specificity 0,5,0) outranks
   a bare `.secrets-panel`, so the card kept a 20px inset: the card head and
   full-bleed table chrome sat inside the card edge and the Step 6 Save footer
   fell past the 1440×900 first fold. Match the settings scope so the card
   itself is edge-to-edge. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .secrets-screen
  .secrets-panel {
  padding: 0;
  overflow: hidden;
}

/* Keep the design's 11px inter-block rhythm between the custody notice, list
   and form (the connected island is one grid child of `.secrets-boundary`),
   and the more spacious 20px section gap above Step 7's retained table. */
.secrets-screen [data-secrets-connected] > * + * {
  margin-top: 11px;
}

.secrets-screen [data-secrets-connected] > .secrets-danger + * {
  margin-top: 20px;
}

/* Step 7's own page rhythm: the prototype's 24/32/44 screen inset and 20px
   section gap, kept for the confirmation state only. The retained table is
   also the more spacious 12px-row variant while the confirmation is open. */
.secrets-screen:has([data-secrets-confirm]) {
  padding: 24px 32px 44px;
  gap: 20px;
}

.secrets-screen:has([data-secrets-confirm]) .secrets-table tbody td {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* The 15+ filter is an undesigned deviation, but its control still needs the
   card's 20px content inset now that the card itself is edge-to-edge. */
.secrets-screen [data-secrets-filter-field] {
  padding: 12px 20px;
}

.secrets-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.secrets-card-title {
  font-family: var(--ds-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ds-ink);
}

.secrets-card-meta {
  font-size: 13px;
  color: var(--ds-muted);
}

.secrets-table {
  width: 100%;
  border-collapse: collapse;
}

.secrets-table thead th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
  color: var(--ds-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.secrets-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--ds-line);
  color: var(--ds-ink-2);
  font-size: 14px;
  vertical-align: middle;
}

.secrets-table thead th:first-child,
.secrets-table tbody td:first-child {
  padding-left: 20px;
}

.secrets-table thead th:last-child,
.secrets-table tbody td:last-child {
  padding-right: 20px;
}

.secrets-table tbody tr:last-child td {
  border-bottom: 0;
}

.secrets-col-name {
  width: 44%;
}

.secrets-col-time {
  width: 30%;
}

.secrets-col-actions {
  width: 26%;
  text-align: right;
}

.secrets-name {
  font-family: var(--ds-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ds-ink);
  overflow-wrap: anywhere;
}

.secrets-time {
  font-family: var(--ds-mono);
  font-size: 13px;
  color: var(--ds-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.secrets-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* The shell's settings button rule (0,5,0) outranks a bare
   `.secrets-screen .secrets-btn-sm`, so the row controls kept the 38px
   settings control height instead of the prototype's 36px `.ds-btn--sm`.
   Match the scope the other screens use for their small buttons. */
.restory-ds[data-warm-studio]
  .ds-app[data-warm-studio-section="settings"]
  .secrets-screen
  .secrets-btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: calc(13.5px * var(--ds-fs));
}

.secrets-screen .ds-btn--danger-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--ds-status-error-fg);
}

.secrets-screen .ds-btn--danger-quiet:hover {
  border-color: var(--ds-status-error-border);
  background: var(--ds-status-error-bg);
  color: var(--ds-status-error-fg);
}

.secrets-table tbody tr.secrets-row-pending td {
  background: var(--ds-status-error-bg);
}

.secrets-pending-copy {
  color: var(--ds-status-error-fg);
  font-weight: 600;
}

.secrets-empty {
  padding: 18px 20px 22px;
  color: var(--ds-ink-2);
  font-size: 14px;
}

.secrets-results {
  padding: 16px 20px 0;
  color: var(--ds-ink-2);
  font-size: 14px;
}

/* ----- form ----- */

.secrets-form {
  display: grid;
}

.secrets-form-body {
  display: grid;
  gap: 10px;
  max-width: 640px;
  padding: 12px 20px;
}

.secrets-field {
  display: grid;
  gap: 4px;
}

.secrets-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ds-ink);
}

.secrets-form .ds-input {
  min-height: 40px;
  font-size: 14px;
}

.secrets-input-mono {
  font-family: var(--ds-mono);
  font-size: 14px;
}

.secrets-screen .ds-input[aria-invalid="true"] {
  border-color: var(--ds-status-error-fg);
  background: #fffbfb;
}

.secrets-help {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ds-muted);
}

.secrets-error {
  min-height: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ds-status-error-fg);
}

.secrets-error:empty {
  display: none;
}

.secrets-outcome {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ds-ink-2);
}

.secrets-outcome:empty {
  display: none;
}

.secrets-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 20px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
}

.secrets-announcement {
  border: 1px solid var(--ds-status-success-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-status-success-bg);
  color: var(--ds-status-success-fg);
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ----- delete confirmation ----- */

.secrets-danger {
  border: 1px solid var(--ds-status-error-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-panel-2);
  box-shadow: var(--ds-shadow-card);
  overflow: hidden;
}

.secrets-danger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px 20px;
  border-bottom: 1px solid var(--ds-panel-border);
}

.secrets-danger-title {
  font-family: var(--ds-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ds-ink);
}

.secrets-danger-body {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
}

.secrets-danger-prose {
  max-width: 72ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ds-ink-2);
}

.secrets-danger-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ds-muted);
}

.secrets-danger-meta strong {
  color: var(--ds-ink);
  font-weight: 600;
}

.secrets-danger-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--ds-panel-border);
  background: var(--ds-chrome);
}

/* ----- focus ----- */

.secrets-screen .ds-btn:focus-visible,
.secrets-screen .ds-input:focus-visible,
.secrets-screen a:focus-visible {
  outline: 2px solid var(--ds-accent-fill);
  outline-offset: 2px;
}

.secrets-screen h1:focus-visible,
.secrets-screen h2:focus-visible {
  outline: 2px solid var(--ds-accent-fill);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .secrets-screen * {
    transition: none !important;
  }
}
