/* Socora · personal character studio. Loaded after the compatible legacy views. */
:root {
  color-scheme: light;
  --studio: #f7f7f5; --studio-2: #efefec; --paper: #f7f7f5; --paper-2: #efefec;
  --panel: #fdfdfb; --panel-2: #f0f1ee;
  --ink: #272b2e; --ink-2: #535a60; --muted: #6c7276; --line: #dedfdb;
  --accent: #30373d; --accent-strong: #49535c; --focus: #476b9b;
  --ok: #35644d; --warn: #986227; --bad: #ad403e; --running: #456a8c;
  --cream: #f7f7f5; --void: #22282d; --slate: #202529; --on-slate: #f2f4f5;
  --font: "Manrope", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --display: var(--font); --mono: var(--font);
  --shadow: 0 8px 32px #2025290a; --sh-cta: none;
  --radius: 12px; --radius-sm: 8px; --radius-pill: 999px;
}
html { scroll-behavior: auto; scrollbar-gutter: stable; }
body { font-size: 14px; }
h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -.025em; }
button, input, select, textarea { font-family: var(--font); }
button, .btn { touch-action: manipulation; }
.btn { min-height: 42px; border-radius: 8px; font-weight: 600; letter-spacing: 0; box-shadow: none; }
.btn.primary { background: var(--accent); color: var(--on-slate); border-color: var(--accent); box-shadow: none; }
.btn.primary:hover { background: var(--accent-strong); color: var(--on-slate); transform: none; }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.ghost { color: var(--ink-2); border-color: var(--line); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--panel-2); color: var(--muted); border-color: var(--line); box-shadow: none; }
.seg-btn.is-on, .chip.is-on, .lang-btn[aria-pressed="true"] { background: #e4e8eb; color: var(--ink); border-color: #c6ced4; box-shadow: none; }
.balance, .user-chip { background: transparent; color: var(--ink-2); border-color: var(--line); font-family: var(--font); letter-spacing: 0; min-height: 38px; }
.balance { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip-link, .toast { color: var(--on-slate); }
.toast.err { background: #6d2928; }
.toast.ok { background: #2d5843; }
.shell, body.is-dance-follow .shell {
  display: block;
  max-width: 1440px; height: auto; min-height: 100dvh; max-height: none; overflow: visible;
  padding: 0 clamp(20px, 4vw, 56px) max(32px, env(safe-area-inset-bottom));
}
.topbar, body.is-dance-follow .topbar {
  display: flex; flex-direction: row; align-items: center; gap: 32px; flex-wrap: wrap;
  min-height: 88px; margin: 0; padding: 18px 0; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40; background: var(--paper);
}
.brand { gap: 10px; }
.brand-mark, body.is-dance-follow .brand-mark { background: transparent; color: var(--ink); border: 0; width: 28px; height: 28px; }
.brand h1, body.is-dance-follow .brand h1 { font: 700 25px/1.2 var(--font); letter-spacing: -.06em; }
.brand p { display: none; }
.studio-nav { display: flex; align-self: stretch; align-items: center; gap: 6px; margin-left: 24px; }
.studio-nav button {
  position: relative; border: 0; background: transparent; color: var(--muted);
  padding: 10px 16px; min-height: 44px; font: 500 14px var(--font); cursor: pointer;
}
.studio-nav button:hover { color: var(--ink); }
.studio-nav button[aria-current="page"], .studio-nav button.is-active { color: var(--ink); font-weight: 700; }
.studio-nav button[aria-current="page"]::after, .studio-nav button.is-active::after {
  content: ""; position: absolute; height: 2px; left: 16px; right: 16px; bottom: -19px; background: var(--ink);
}
.top-actions, body.is-dance-follow .top-actions { margin-left: auto; width: auto; display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px; }
.top-work { display: none; }
.top-meta, body.is-dance-follow .top-meta { display: flex; align-items: center; gap: 10px; }
.lang-toggle { background: transparent; padding: 2px; }
.health { font-size: 11px; max-width: 110px; }
.main, body.is-dance-follow .main { display: block; width: 100%; min-width: 0; overflow: visible; }
.workspace, body.is-dance-follow #workspace {
  display: block; width: 100%; min-width: 0; padding: 36px 0 0; background: transparent;
  border: 0; box-shadow: none; border-radius: 0; overflow: visible;
}
.empty-workspace { display: block; width: 100%; max-width: none; min-height: 0; padding: 0; background: transparent; border: 0; text-align: left; }
[hidden], #studio-dashboard[hidden], #studio-works[hidden], #studio-ops-photo[hidden] { display: none !important; }
body.is-logged-out .studio-nav { display: none; }
.studio-page-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 30px; }
.studio-page-head h2 { margin: 0 0 10px; font-size: clamp(25px, 2.5vw, 34px); font-weight: 600; line-height: 1.25; }
.studio-page-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
#studio-dashboard { width: 100%; max-width: 1200px; margin-inline: auto; }
#studio-dashboard > .studio-page-head { align-items: center; margin-bottom: 16px; }
#studio-dashboard > .studio-page-head h2 { margin: 0; font-size: 28px; }
.studio-dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.studio-dashboard-layout > section > .studio-section-heading { margin-top: 0; }
.studio-profile { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 24px; }
.studio-person-portrait { margin: 0; background: var(--panel-2); border-radius: 10px; overflow: hidden; }
.studio-person-portrait img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 25%; }
.studio-person-info { min-width: 0; }
.studio-person-info h3 { font-size: 24px; line-height: 1.3; margin: 0 0 8px; overflow-wrap: anywhere; }
.studio-person-info > p { color: var(--muted); max-width: 64ch; line-height: 1.6; margin: 6px 0 0; }
.studio-profile-action { max-width: 300px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.studio-profile-action .btn { min-height: 48px; white-space: normal; overflow-wrap: anywhere; width: 100%; }
.studio-profile-action .muted { margin: 0; font-size: 12px; line-height: 1.6; }
#studio-ops-photo { width: 100%; max-width: 1200px; margin-inline: auto; }
#studio-ops-photo[hidden] { display: none !important; }
.ops-photo-chip { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.ops-photo-chip img, .ops-photo-chip-ph {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--panel-2);
}
.ops-photo-chip-ph { display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.ops-photo-chip strong { display: block; font-size: 18px; }
.ops-photo-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ops-photo-types .seg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#studio-ops-photo > label.muted { display: block; margin: 0 0 6px; }
.ops-photo-intent { display: block; width: 100%; max-width: 52ch; min-height: 44px; margin: 0 0 14px; }
.ops-photo-lock { padding: 20px 22px; background: var(--panel-2); border-radius: 10px; color: var(--ink-2); line-height: 1.7; margin: 0 0 16px; }
.ops-photo-lock p { margin: 0 0 8px; }
.ops-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ops-photo-results { display: flex; flex-direction: column; gap: 14px; }
.ops-photo-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 200px)); gap: 12px; justify-content: start; }
.ops-photo-frame { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ops-photo-frame img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; background: #e9ebeb; }
.ops-photo-frame .muted { font-size: 12px; }
.ops-photo-frame .btn.sm { min-height: 32px; }
.ops-photo-caption { max-width: 52ch; white-space: pre-wrap; line-height: 1.7; margin: 0; }
.studio-section-heading { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 32px 0 18px; }
.studio-section-heading h2, .studio-section-heading h3 { margin: 0; font-size: 17px; font-weight: 600; }
.studio-section-heading .btn { min-height: 34px; font-size: 12px; }
.studio-wardrobe-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.studio-wardrobe-item { display: block; padding: 0; border: 0; background: transparent; text-align: left; color: var(--ink); cursor: pointer; min-width: 0; }
.studio-wardrobe-item img { width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; object-position: top; border-radius: 8px; background: var(--paper-2); display: block; }
.studio-wardrobe-item span, .studio-wardrobe-item p { display: block; margin: 9px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-2); }
.studio-works-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
.studio-work-card { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; text-decoration: none; }
.studio-work-thumb { position: relative; width: 100%; aspect-ratio: 3/4; background: #e9ebeb; border-radius: 10px; overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.studio-work-thumb img, .studio-work-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio-work-meta { padding-top: 12px; min-width: 0; }
.studio-work-meta h3, .studio-work-meta strong { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-work-meta p, .studio-work-meta small { color: var(--muted); margin: 0; font-size: 12px; }
.studio-work-status { font-size: 11px; border-radius: 5px; padding: 4px 8px; background: var(--panel); color: var(--ink-2); }
.studio-work-thumb .studio-work-status { position: absolute; bottom: 10px; left: 10px; }
.studio-empty { padding: 32px 24px; background: var(--panel-2); border-radius: 10px; color: var(--muted); line-height: 1.8; }
.studio-empty h3 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.studio-empty p { margin: 0 0 16px; }
#studio-dashboard > .studio-section-heading { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
#home-chars .empty-intro { margin-bottom: 24px; }
.home-char-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); justify-content: start; gap: 20px; }
.char-card, .outfit-card { box-shadow: none; border-color: var(--line); background: var(--panel); }
.char-card .name { color: var(--ink); }
.char-card .meta { color: var(--muted); }
.studio-intro { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
body.is-dance-follow #compose:not([hidden]) {
  display: grid !important; flex: none; width: 100%; max-width: none; margin: 0;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, .92fr);
  grid-template-rows: auto auto auto auto auto;
  grid-template-areas: "back back" "head head" "depth stage" "look stage" "meta dock";
  gap: 24px 56px; padding: 0 0 32px; overflow: visible;
}
body.is-dance-follow #compose > #dance-follow-head { width: 100%; justify-content: space-between; align-items: center; margin-bottom: 8px; }
body.is-dance-follow #dance-follow-head h2 { font: 600 clamp(25px, 2.5vw, 34px)/1.3 var(--font); }
body.is-dance-follow #dance-char-chip { height: 44px; max-height: none; padding: 6px 12px 6px 8px; background: var(--panel); border-radius: 999px; }
body.is-dance-follow .dance-char-chip-face { width: 30px; height: 30px; }
body.is-dance-follow #dance-connectors { display: none; }
body.is-dance-follow .dance-well, body.is-dance-follow .dance-well.is-filled {
  display: grid; grid-template-rows: auto minmax(98px, 1fr) auto;
  width: 100%; height: auto; min-height: 210px; aspect-ratio: auto; padding: 22px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  text-align: left; justify-self: stretch; justify-content: stretch; align-items: stretch;
  transition: border-color 160ms ease; overflow: hidden;
}
body.is-dance-follow .dance-well:hover { border-color: #9aa5ad; }
.studio-step-heading { display: flex; gap: 12px; align-items: center; font-weight: 600; font-size: 15px; }
body.is-dance-follow .dance-well-ord { position: static; font: 500 12px var(--font); color: var(--muted); }
.studio-selection-status { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
body.is-dance-follow .dance-well-body, body.is-dance-follow .dance-well.is-empty .dance-well-body,
body.is-dance-follow .dance-well.is-filled .dance-well-body {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 16px; width: 100%; height: 112px; padding-block: 12px;
}
.studio-media-caption { font-size: 14px; text-align: left; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.is-dance-follow .dance-well-plus { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); font: 300 24px var(--font); background: var(--paper); }
body.is-dance-follow .dance-well-copy { font: 500 15px var(--font); color: var(--ink); }
body.is-dance-follow .dance-well.is-filled .dance-well-body img,
body.is-dance-follow .dance-well.is-filled .dance-well-body video { height: 88px; width: 64px; object-fit: cover; border-radius: 6px; }
.studio-step-help { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
body.is-dance-follow #dance-shoot-preview {
  position: relative; width: 100%; height: 100%; min-height: 444px; aspect-ratio: auto;
  background: #e9ebeb; border: 0; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
}
body.is-dance-follow #dance-shoot-preview.is-filled { border: 0; background: #e9ebeb; }
body.is-dance-follow #dance-shoot-preview img { height: 444px; max-height: 100%; width: 100%; object-fit: contain; }
.studio-preview-empty { max-width: 250px; text-align: center; padding: 32px 16px; }
.studio-preview-frame { display: grid; place-items: center; width: 82px; height: 132px; margin: 0 auto 24px; border: 1px solid #abb2b6; border-radius: 8px; color: var(--muted); font-size: 12px; }
.studio-preview-empty h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.studio-preview-empty p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.studio-preview-label { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); text-align: center; border-radius: 999px; background: #fcfcfbee; color: var(--ink-2); padding: 6px 12px; font-size: 11px; }
body.is-dance-follow .dance-follow-aspect { margin: 16px; padding: 3px 8px; border-radius: 4px; background: #fcfcfbb3; color: var(--ink-2); font-family: var(--font); }
body.is-dance-follow .dance-follow-credits { justify-self: start; align-self: start; padding-top: 14px; color: var(--muted); font-size: 13px; }
body.is-dance-follow #compose > #video-workbench-footer { grid-area: dock; align-self: start; }
body.is-dance-follow #btn-create.btn.primary:not(:disabled):not([aria-disabled="true"]) { color: var(--on-slate); background: var(--accent); box-shadow: none; }
body.is-dance-follow #btn-depth-ingest, body.is-dance-follow #btn-gen-outfit { background: var(--accent); color: var(--on-slate); }
body.is-dance-follow .video-workbench-footer #btn-create { min-height: 50px; border-radius: 8px; }
body.is-dance-follow #btn-create[aria-disabled="true"], body.is-dance-follow #btn-create:disabled { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
body.is-dance-follow #gate-create { display: none; }
.studio-submit-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.modal:not([hidden]) { padding: 20px; }
body.is-dance-follow .modal:not([hidden]) { place-items: stretch end; padding: 0; }
.modal-panel { border-radius: 12px; box-shadow: var(--shadow); padding: 24px; }
body.is-dance-follow .modal-panel { width: min(680px, 92vw); height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 28px; box-shadow: -16px 0 80px #20252916; }
.modal-scrim { background: #20252950; }
.modal-head { margin-bottom: 20px; }
.modal-panel .btn { min-height: 42px; }
.modal .seg { margin-bottom: 20px; }
.modal .outfit-grid, .modal .char-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.modal .outfit-card .thumb, .modal .char-card .thumb { aspect-ratio: 3/4; }
.modal .outfit-card .thumb img, .modal .char-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.modal input, .modal textarea, .modal select { font-size: 14px; }
.auth-card { background: var(--panel); color: var(--ink); }
body.is-logged-out .shell { max-width: 1440px; padding: 0 clamp(20px, 4vw, 56px); }
.pub-bar { padding: 18px 0; background: var(--paper); backdrop-filter: none; }
.pub-offer { color: var(--muted); font-family: var(--font); letter-spacing: 0; }
.pub-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr); grid-template-rows: auto; column-gap: 72px; padding: 64px 0; text-align: left; background: transparent; }
.pub-hero::before { display: none; }
.pub-offer, .pub-title, .pub-lede, .pub-cta, .pub-meter, .pub-proof-note { grid-column: 1; }
.pub-title { font: 600 clamp(32px, 4.5vw, 56px)/1.25 var(--font); max-width: 13em; letter-spacing: -.035em; color: var(--ink); margin: 16px 0 24px; }
.pub-title em { font-style: normal; color: var(--ink); }
.pub-lede { color: var(--muted); font-size: 16px; max-width: 38em; margin: 0 0 30px; line-height: 1.9; }
.pub-cta { justify-content: flex-start; }
.pub-meter, .pub-proof-note { color: var(--muted); font-size: 12px; }
.pub-proof { grid-column: 2; grid-row: 1 / span 7; display: block; margin: 0; align-self: center; width: 100%; max-width: 340px; justify-self: end; }
.pub-clip, .pub-clip[data-clip="dance"] { min-height: 0; height: auto; aspect-ratio: 3/4; border: 0; background: var(--panel-2); transform: none; box-shadow: none; }
.pub-clip img { object-fit: cover; height: 100%; }
.pub-clip-label { color: #f7f8fa; background: #202529cc; }
.pub-clip-kind { color: #f7f8fa; }
.pub-section { padding: 32px 0; border-top: 1px solid var(--line); }
.pub-section h2 { font-size: 24px; }
.pub-flow { gap: 32px; }
.pub-flow article { background: transparent; border: 0; border-radius: 0; padding: 12px 0; box-shadow: none; }
.pub-flow article p { color: var(--muted); }
.pub-brand-name { font-family: var(--font); }
body.is-job-workbench #job-view:not([hidden]) { grid-template-columns: 88px minmax(0, 1fr); gap: 12px 16px; }
body.is-job-workbench #job-view.is-completed:not([hidden]) {
  grid-template-columns: minmax(0, 1fr);
  width: 100%; max-width: 1000px; margin-inline: auto; gap: 16px;
}
body.is-job-workbench #job-view.is-completed > #btn-job-back,
body.is-job-workbench #job-view.is-completed > #jv-type-bar,
body.is-job-workbench #job-view.is-completed > #jv-main,
body.is-job-workbench #job-view.is-completed > #jv-refs { grid-column: 1; }
body.is-job-workbench #job-view.is-completed > #jv-main { grid-row: 3; width: 100%; }
body.is-job-workbench #job-view.is-completed > #jv-refs,
body.is-job-workbench #job-view.is-completed > #jv-refs.refs-layout {
  grid-row: 4; position: static; display: grid !important;
  grid-template-columns: repeat(3, minmax(72px, 104px));
  width: 100%; max-width: none; gap: 10px; margin-top: 10px;
}
body.is-job-workbench #job-view.is-completed .ready { width: 100%; max-width: 104px; }
body.is-job-workbench #job-view.is-completed .job-deliver {
  --result-film-width: clamp(260px, calc((100dvh - 250px) * 9 / 16), 360px);
  grid-template-columns: var(--result-film-width) minmax(0, 1fr);
  width: 100%; max-width: 100%; gap: 18px 36px;
  align-items: start; justify-content: start;
}
body.is-job-workbench #job-view.is-completed .job-deliver-film {
  width: 100%; align-items: flex-start;
}
body.is-job-workbench #job-view.is-completed .job-deliver-film > h3,
body.is-job-workbench #job-view.is-completed .job-final {
  width: var(--result-film-width); max-width: 100%; align-self: flex-start;
}
body.is-job-workbench #job-view.is-completed .job-final video {
  width: 100%;
  min-width: 0; max-width: 100%; max-height: none;
  aspect-ratio: 9 / 16; object-fit: contain;
}
body.is-job-workbench #job-view.is-completed .job-final .result-actions { width: 100%; }
body.is-job-workbench #job-view.is-completed .job-download { width: 100%; min-height: 48px; }
body.is-job-workbench #job-view.is-completed .job-deliver-caps { width: 100%; max-width: 500px; }
body.is-job-workbench #job-view.is-completed .job-deliver-caps .captions,
body.is-job-workbench #job-view.is-completed .job-deliver-caps .caption {
  flex: none; min-height: 0;
}
body.is-job-workbench #job-view.is-completed .caption [data-copy] { margin-top: 16px; }
body.is-job-workbench #job-view.is-completed .job-caption-empty {
  padding: 18px; border: 1px dashed var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--muted); line-height: 1.65;
}
body.is-job-workbench #job-view.is-completed .job-caption-empty p { margin: 0; }
body.is-job-workbench #job-view.is-completed .job-reuse .btn { min-height: 44px; border: 1px solid var(--line); background: var(--panel); padding: 10px 16px; }
body.is-job-workbench #job-view.is-completed .job-deliver-caps button { min-height: 44px; }
body.is-job-workbench .jv-prompt-ro pre {
  margin: 10px 0 0; padding: 12px; max-height: 240px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  color: var(--ink-2); font: inherit; font-size: .82rem; line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
body.is-job-workbench .job-head h2 { font-size: 24px; font-weight: 600; }
body.is-job-workbench .job-id { font-size: 11px; }
body.is-job-workbench .stage { border-color: var(--line); border-radius: 10px; box-shadow: none; }
.job-chip, .badge { font-family: var(--font); letter-spacing: 0; }
.job-logs .logs { color: var(--on-slate); }
.rail { background: var(--panel); }
@media (max-width: 1000px) {
  .topbar, body.is-dance-follow .topbar { gap: 16px; }
  .studio-nav { margin-left: 0; }
  .top-meta, body.is-dance-follow .top-meta { gap: 6px; }
  .studio-works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.is-dance-follow #compose:not([hidden]) { gap: 24px 28px; }
  .pub-hero { column-gap: 36px; }
}
@media (max-width: 720px) {
  .shell, body.is-dance-follow .shell { padding: 0 20px max(24px, env(safe-area-inset-bottom)); }
  .topbar, body.is-dance-follow .topbar { gap: 12px; min-height: 0; padding: 16px 0 0; }
  .brand h1, body.is-dance-follow .brand h1 { font-size: 22px; }
  .brand-mark { width: 24px; height: 24px; }
  .top-actions, body.is-dance-follow .top-actions { margin-left: auto; flex-wrap: wrap; gap: 6px; }
  .top-meta, body.is-dance-follow .top-meta { display: flex; flex-wrap: wrap; max-width: 100%; }
  .balance, .user-chip { min-height: 44px; font-size: 12px; padding: 8px 10px; }
  .health { display: none; }
  .lang-toggle { gap: 0; }
  .lang-btn { padding: 8px; min-width: 44px; min-height: 44px; font-size: 11px; }
  .studio-nav { order: 3; width: 100%; justify-content: space-between; margin: 0; padding-top: 4px; }
  .studio-nav button { flex: 1; padding: 12px 8px; }
  .studio-nav button[aria-current="page"]::after, .studio-nav button.is-active::after { bottom: -1px; left: 16px; right: 16px; }
  .workspace, body.is-dance-follow #workspace { padding: 28px 0 0; }
  .studio-page-head { gap: 16px; margin-bottom: 24px; }
  .studio-page-head h2 { font-size: 26px; }
  .studio-dashboard-layout { gap: 28px; }
  .studio-profile { grid-template-columns: 72px minmax(0, 1fr); gap: 12px 16px; }
  .studio-profile-action { grid-column: 2; max-width: none; }
  .studio-person-info h3 { font-size: 22px; }
  .studio-person-info > p { font-size: 14px; }
  .studio-wardrobe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .studio-works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .studio-section-heading { margin-top: 24px; }
  .studio-work-meta h3 { font-size: 13px; }
  .studio-empty { padding: 24px 18px; }
  .studio-intro { font-size: 13px; }
  body.is-dance-follow #compose:not([hidden]) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto;
    grid-template-areas: "back" "head" "depth" "look" "stage" "meta" "dock";
    gap: 18px; padding: 0 0 24px;
  }
  body.is-dance-follow #compose > #dance-follow-head { gap: 16px; margin: 0; }
  body.is-dance-follow #dance-follow-head h2 { font-size: 26px; }
  body.is-dance-follow .dance-char-chip-lab { display: inline; }
  body.is-dance-follow .dance-well, body.is-dance-follow .dance-well.is-filled { min-height: 180px; padding: 18px; width: 100%; height: auto; aspect-ratio: auto; }
  body.is-dance-follow .dance-well-body { height: 100px; }
  body.is-dance-follow #dance-shoot-preview { min-height: 320px; height: auto; aspect-ratio: auto; width: 100%; }
  body.is-dance-follow #dance-shoot-preview img { height: 400px; }
  body.is-dance-follow #compose > #video-workbench-footer { position: sticky; bottom: 0; z-index: 10; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); background: var(--paper); }
  body.is-dance-follow .dance-follow-credits { padding-top: 0; }
  .studio-submit-note { font-size: 11px; }
  .modal:not([hidden]), body.is-dance-follow .modal:not([hidden]) { padding: 0; place-items: stretch; }
  .modal-panel, body.is-dance-follow .modal-panel { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 22px 18px; }
  .modal .outfit-grid, .modal .char-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-bar { flex-wrap: wrap; gap: 16px; }
  .pub-nav { gap: 8px; }
  .pub-hero { display: flex; flex-direction: column; padding: 32px 0; gap: 0; }
  .pub-title { font-size: 34px; margin: 12px 0 20px; }
  .pub-lede { font-size: 14px; }
  .pub-proof { max-width: 100%; width: 100%; margin-top: 24px; }
  .pub-clip, .pub-clip[data-clip="dance"] { aspect-ratio: 4/3; }
  .pub-clip img { object-position: center 20%; }
  .pub-flow { grid-template-columns: 1fr; gap: 8px; }
  body.is-job-workbench #job-view:not([hidden]) { display: flex; flex-direction: column; gap: 16px; }
  body.is-job-workbench #job-view > #jv-refs { order: 4; position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: auto; max-width: none; }
  body.is-job-workbench #job-view > #jv-main { order: 3; min-width: 0; }
  body.is-job-workbench #job-view > #jv-type-bar { order: 2; }
  body.is-job-workbench #job-view > #btn-job-back { order: 1; min-height: 44px; }
  body.is-job-workbench .job-deliver { width: auto; grid-template-columns: minmax(0, 1fr); }
  body.is-job-workbench .job-deliver-caps { max-width: none; }
  body.is-job-workbench #job-view.is-completed:not([hidden]) { max-width: 100%; }
  body.is-job-workbench #job-view.is-completed > #jv-refs,
  body.is-job-workbench #job-view.is-completed > #jv-refs.refs-layout {
    order: 4; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0;
  }
  body.is-job-workbench #job-view.is-completed .ready { max-width: none; }
  body.is-job-workbench #job-view.is-completed .job-deliver {
    width: 100%; grid-template-columns: minmax(0, 1fr); gap: 24px;
  }
  body.is-job-workbench #job-view.is-completed .job-final video {
    width: min(100%, 360px); max-width: 100%; max-height: none;
  }
  body.is-job-workbench #job-view.is-completed .job-deliver-film {
    --result-film-width: min(100%, 360px); align-items: flex-start;
  }
  body.is-job-workbench #job-view.is-completed .job-deliver-caps { max-width: none; }
}
.generation-cost { flex-basis: 100%; margin: 6px 0; }
.library-search { grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin:16px 0; }
.studio-work-card[hidden], .outfit-card[hidden] { display:none !important; }
.library-search label { display:grid; gap:6px; flex:1; min-width:160px; font-size:13px; color:var(--muted); }
#jv-title.is-long:not(.is-expanded) { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
#jv-title-toggle { min-height:44px; }
.library-search input, .library-search select { box-sizing:border-box; width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel, #fff); color:var(--text, #292724); font:inherit; font-size:14px; }
@media (max-width: 680px) {
  #account-view .admin-table { min-width:0; width:100%; }
  #account-view .admin-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #account-view .admin-table tbody, #account-view .admin-table tr { display:block; }
  #account-view .admin-table tr { padding:12px; border-bottom:1px solid var(--line); }
  #account-view .admin-table td { display:flex; justify-content:space-between; gap:16px; white-space:normal; overflow-wrap:anywhere; border:0; padding:6px 0; text-align:end; }
  #account-view .admin-table td::before { content:attr(data-label); flex-shrink:0; color:var(--muted); font-weight:400; }
}
/* A quiet navigation bar: controls share the studio's type and surfaces. */
body .topbar, body.is-dance-follow .topbar { min-height: 80px; padding: 16px 0; gap: 28px; }
.topbar .brand-mark svg { width: 100%; height: 100%; }
.brand-mark img { display: block; width: 100%; height: 100%; }
.topbar .brand, .pub-brand { gap: 10px; }
.brand h1, body.is-dance-follow .brand h1, .pub-brand-name { font-family: var(--font); font-weight: 650; letter-spacing: -.045em; }
.pub-brand .brand-mark { background: transparent; border: 0; box-shadow: none; }
.topbar .studio-nav { align-self: center; margin-left: 16px; gap: 4px; }
.topbar .studio-nav button { border-radius: 8px; padding: 11px 18px; font-weight: 600; line-height: 1.4; }
.topbar .studio-nav button:hover { background: var(--studio-2); }
.topbar .studio-nav button[aria-current="page"] { background: #e8e9e5; color: var(--ink); font-weight: 600; }
.topbar .studio-nav button::after { display: none; }
body .topbar .top-meta, body.is-dance-follow .topbar .top-meta { border: 0; padding: 0; gap: 16px; flex-wrap: nowrap; }
.topbar .lang-toggle { border: 0; padding: 0; background: transparent; border-radius: 0; overflow: visible; gap: 2px; }
.topbar .lang-btn { border: 0; background: transparent; box-shadow: none; font: 500 12px/1 var(--font); letter-spacing: 0; min-height: 44px; min-width: 44px; padding: 8px; border-radius: 6px; }
.topbar .lang-btn[aria-pressed="true"] { background: transparent; color: var(--ink); font-weight: 700; }
.topbar .lang-btn:hover { background: var(--studio-2); }
.topbar .balance { appearance: none; border: 0; border-radius: 8px; background: #eaece7; color: var(--ink-2); font: 600 13px/1.4 var(--font); padding: 10px 14px; min-height: 44px; }
.topbar .balance:hover { background: #e0e3dc; }
.topbar .user-chip { appearance: none; display: inline-flex; align-items: center; gap: 12px; border: 0; background: transparent; border-radius: 8px; color: var(--ink-2); font: 500 13px/1.4 var(--font); min-height: 44px; max-width: 160px; padding: 10px 6px 10px 10px; }
.topbar .user-chip::after { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.topbar .user-chip:hover, .topbar .user-chip[aria-expanded="true"] { background: var(--studio-2); }
.topbar .user-menu { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 6px; box-shadow: 0 12px 36px #272b2e12; }
.topbar .user-menu button { font: 500 13px/1.5 var(--font); min-height: 40px; padding: 10px 12px; border-radius: 7px; }
.topbar .user-menu button:hover, .topbar .user-menu button:focus-visible { background: var(--studio-2); color: var(--ink); }
.topbar .health.bad { position: absolute; top: calc(100% + 8px); right: 0; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; font: 400 11px/1.4 var(--font); color: #886d59; }
.topbar .health.bad::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.studio-character-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.studio-character-tab { display: inline-flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; min-height: 48px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); font: 500 14px/1.4 var(--font); cursor: pointer; max-width: 100%; }
.studio-character-tab img, .studio-character-placeholder { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: center 25%; flex-shrink: 0; }
.studio-character-placeholder { display: grid; place-items: center; background: var(--studio-2); }
.studio-character-tab > span:not(.studio-character-placeholder):not(.studio-character-check) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-character-tab:hover { background: var(--studio-2); color: var(--ink); }
.studio-character-tab[aria-pressed="true"] { background: #eaece7; border-color: #d5d9cf; color: var(--ink); font-weight: 600; }
.studio-character-check { margin-left: 8px; color: #56634c; }
@media (max-width: 900px) {
  body .topbar, body.is-dance-follow .topbar { gap: 16px; }
  .topbar .studio-nav { margin-left: 0; }
  .topbar .studio-nav button { padding-inline: 12px; }
  body .topbar .top-meta, body.is-dance-follow .topbar .top-meta { gap: 8px; }
}
@media (max-width: 720px) {
  body .topbar, body.is-dance-follow .topbar { min-height: 0; padding: 12px 0; gap: 10px; }
  .topbar .brand { gap: 6px; }
  .topbar .brand h1, body.is-dance-follow .topbar .brand h1 { font-size: 21px; }
  .topbar .brand-mark, body.is-dance-follow .topbar .brand-mark { width: 24px; height: 24px; }
  .topbar .studio-nav { padding: 0; gap: 4px; }
  .topbar .studio-nav button { padding: 11px 8px; }
  body .topbar .top-meta, body.is-dance-follow .topbar .top-meta { gap: 4px; }
  .topbar .balance { padding-inline: 9px; font-size: 12px; }
  .topbar .user-chip { padding-inline: 6px; font-size: 12px; gap: 8px; max-width: 90px; }
  .topbar .lang-btn { min-width: 44px; min-height: 44px; padding-inline: 8px; font-size: 11px; }
  .studio-character-tabs { gap: 8px; padding-bottom: 12px; margin-bottom: 20px; }
  #studio-dashboard > .studio-page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
  #studio-dashboard > .studio-page-head > div { display: contents; }
  #studio-dashboard > .studio-page-head h2 { grid-column: 1; grid-row: 1; margin: 0; }
  #studio-dashboard > .studio-page-head p { grid-column: 1 / -1; grid-row: 2; }
  #studio-dashboard > .studio-page-head > button { grid-column: 2; grid-row: 1; font-size: 12px; }
  .studio-character-tab { gap: 8px; padding-right: 10px; font-size: 13px; }
  .studio-character-tab img, .studio-character-placeholder { width: 36px; height: 36px; }
}
/* Settings use a stable section navigation and a calm, readable content column. */
#account-view:not([hidden]) { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px 48px; padding: 0; width: 100%; max-width: 1120px; margin: 0 auto; }
body.is-account #workspace { padding: 36px 0 0; }
#account-view > .admin-head { grid-column: 1 / -1; display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start; margin: 0 0 8px; gap: 24px; }
#account-view .admin-head-copy { order: -1; }
#account-view .admin-head-copy h2 { font: 600 clamp(26px, 2.5vw, 34px)/1.25 var(--font); margin: 0 0 12px; }
#account-view .hint { color: var(--muted); font-size: 13px; line-height: 1.8; }
#account-view #btn-me-back { border: 0; background: transparent; font-size: 12px; }
#account-view > .admin-tabs { grid-column: 1; grid-row: 2 / 4; align-self: start; display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; padding: 0; border: 0; background: transparent; }
#account-view .admin-tabs .seg-btn { min-height: 46px; text-align: left; padding: 12px 16px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font: 500 14px/1.5 var(--font); }
#account-view .admin-tabs .seg-btn.is-on { background: #e8e9e5; color: var(--ink); font-weight: 600; box-shadow: none; }
#account-view .admin-tabs .seg-btn:hover { background: var(--studio-2); color: var(--ink); }
#account-view .account-balance { grid-column: 2; grid-row: 2; background: #eff0ec; border-radius: 12px; padding: 24px 28px; }
#account-view h3 { font: 600 17px/1.5 var(--font); letter-spacing: -.02em; margin: 0 0 10px; }
#account-view #me-summary { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin: 0; }
#account-view #me-hint { margin: 8px 0 0; }
#account-view:not([data-account-tab="grants"]) #me-shop { display: none; }
#account-view[data-account-tab="profile"] #me-hint { display: none; }
#account-view > .admin-pane { grid-column: 2; grid-row: 3; min-width: 0; padding: 0; }
#account-view .me-profile { display: block; max-width: none; gap: 0; }
#account-view .account-profile-section { padding: 4px 0 30px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
#account-view .account-profile-section > .hint { margin: 0 0 24px; }
#account-view .account-profile-section > .field, #account-view .gen-form { max-width: 460px; }
#account-view .gen-form { display: flex; flex-direction: column; gap: 20px; padding: 0; margin: 20px 0 0; border: 0; background: transparent; }
#account-view .field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
#account-view .field > span { color: var(--ink-2); font: 500 13px/1.5 var(--font); }
#account-view input { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 400 14px/1.5 var(--font); box-shadow: none; }
#account-view input[readonly] { background: var(--studio-2); color: var(--muted); border-color: transparent; }
#account-view input:focus { border-color: var(--focus); }
#account-view .gen-form .btn { align-self: flex-start; min-width: 112px; font-size: 13px; }
#account-view .admin-table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: var(--panel); }
#account-view .admin-table { width: 100%; min-width: 520px; font-size: 13px; }
#account-view .admin-table th { background: var(--studio-2); color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: 0; }
#account-view .admin-table th, #account-view .admin-table td { padding: 16px 20px; line-height: 1.6; border-color: var(--line); }
#account-view .admin-table .num { font-family: var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
#account-view .admin-table .num.is-pos { color: var(--ok); }
#account-view .admin-table .num.is-neg { color: var(--ink-2); }
#account-view .admin-empty { text-align: left; padding: 36px 28px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 14px; }
#account-view .me-shop { border: 0; padding: 24px 0 0; margin: 20px 0 0; border-top: 1px solid var(--line); }
#account-view .me-plan-row { gap: 12px; }
#account-view .me-offer, #account-view .me-pack { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; color: var(--ink); box-shadow: none; }
#account-view .me-offer:hover, #account-view .me-pack:hover { border-color: var(--ink-2); background: var(--panel); }
#account-view .me-offer-price { font-family: var(--font); color: var(--ink); }
#account-view .me-pack small, #account-view .me-offer small { color: var(--muted); }
.account-modal-panel { max-width: 460px; }
.account-modal-panel .field input { min-height: 46px; border-radius: 8px; }
@media (max-width: 720px) {
  #account-view:not([hidden]) { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  body.is-account #workspace { padding: 28px 0 0; }
  #account-view > .admin-head { grid-column: 1; grid-row: 1; gap: 12px; }
  #account-view > .admin-tabs { grid-column: 1; grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  #account-view .admin-tabs .seg-btn { text-align: center; flex: 1; padding: 12px 8px; font-size: 13px; }
  #account-view .account-balance { grid-column: 1; grid-row: 3; padding: 20px; }
  #account-view > .admin-pane { grid-column: 1; grid-row: 4; }
  #account-view .admin-table th, #account-view .admin-table td { padding: 12px; }
  #account-view .admin-table { min-width: 0; }
  #account-view .admin-table td { padding:6px 0; }
  #account-view .admin-table .num { white-space:normal; }
  #account-view input { font-size: 16px; }
  #account-view #btn-me-back { padding-inline: 0; white-space: nowrap; }
  #account-view .me-plan-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .studio-work-card, .studio-wardrobe-item, .dance-well { transition: none !important; } }

/* Motion comes first: a quiet, image-led library and one deliberate preview. */
body.is-dance-follow #compose[data-motion-step]:not([hidden]) { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr); grid-template-areas: none; gap: 24px 36px; }
body.is-dance-follow #compose[data-motion-step] > #dance-follow-head { grid-column: 1 / -1; grid-row: 1; grid-area: auto; justify-content: flex-end; margin: 0; }
body.is-dance-follow #compose[data-motion-step] #dance-follow-head > div { display: none; }
body.is-dance-follow #motion-flow:not([hidden]) { display: contents; }
#motion-steps, .motion-heading, #motion-import-mount, #motion-browser, #motion-next { grid-column: 1 / -1; min-width: 0; }
.motion-steps { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.motion-steps button { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 5px 0; color: var(--muted); font: 500 14px var(--font); cursor: pointer; }
.motion-steps button span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; }
.motion-steps button[aria-current] { color: var(--accent); }
.motion-steps button[aria-current] span { background: var(--accent); color: var(--on-slate); border-color: var(--accent); }
.motion-steps button:disabled { opacity: .6; cursor: default; }
.motion-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.motion-heading h2 { font: 600 clamp(24px, 2.5vw, 32px)/1.3 var(--font); letter-spacing: -.025em; margin: 0; }
.motion-heading p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 8px 0 0; }
#motion-import-mount:has(details:not([open])) { display: none; }
#motion-import-mount details { margin: 0; }
#motion-import-mount summary { display: none; }
#motion-import-mount .depth-url-block { max-width: 720px; }
#motion-import-mount #depth-ingest-preview video { display: none; }
.motion-browser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 32%); gap: 32px; align-items: start; }
.motion-library { min-width: 0; }
.motion-search { display: block; margin-bottom: 16px; }
.motion-search input { width: 100%; min-height: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 10px 14px; font: inherit; }
#look-source-host:not([hidden]) { margin: 0 0 16px; }
#look-source-host #look-library,
#look-source-host #selected-outfit-bar,
#look-source-host .wb-side { display: none !important; }
#look-source-host .wb-split { display: block; }
#look-source-host .wb-main { max-width: 36rem; }
#look-source-host:has(#look-upload[hidden]):has(#look-generate[hidden]) .wb-split { display: none; }
#look-source-host .seg { display: flex; }
body.is-dance-follow #compose:not([data-motion-step="2"]) #look-source-host { display: none; }
body.is-dance-follow #compose[data-motion-step="2"] #look-source-host { display: block !important; margin: 0 0 16px; }
#compose[data-motion-step="2"][data-look-source="upload"] .motion-search,
#compose[data-motion-step="2"][data-look-source="generate"] .motion-search,
#compose[data-motion-step="2"][data-look-source="upload"] #motion-library-mount #depth-strip,
#compose[data-motion-step="2"][data-look-source="generate"] #motion-library-mount #depth-strip { display: none !important; }
#motion-library-mount #depth-strip { display: block; max-height: 740px; overflow-y: auto; padding: 0 8px 16px 0; scrollbar-gutter: stable; }
#motion-library-mount .depth-cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.motion-card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 10px; }
#motion-flow .motion-card-grid,
#motion-library-mount .motion-card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 10px; }
.motion-card { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; min-width: 0; color: var(--ink); }
.motion-poster { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; background: #e9e6e2; border-radius: 8px; outline: 2px solid transparent; outline-offset: 3px; transition: outline-color 120ms; }
.motion-poster img { width: 100%; height: 100%; object-fit: cover; }
.motion-card.selected .motion-poster { outline-color: var(--accent); }
.motion-card:hover .motion-poster { outline-color: var(--muted); }
.motion-duration { position: absolute; bottom: 8px; right: 8px; background: #28231fe0; color: #fffaf5; border-radius: 4px; padding: 3px 6px; font-size: 11px; }
.motion-play { position: absolute; top: 8px; right: 9px; color: #fffaf5; font-size: 24px; text-shadow: 0 1px 5px #29211a; }
.motion-card-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.5; font-weight: 600; margin: 8px 0 3px; }
.motion-card-category { display: block; font-size: 12px; line-height: 1.5; color: var(--muted); }
.motion-poster-missing, .cover-failed::after { color: var(--ink-2); font-size: 12px; padding: 12px; }
.cover-failed::after { content: '▷'; font-size: 30px; }
.motion-preview { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.motion-preview-title { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; }
.motion-preview-title h3 { font: 600 16px/1.5 var(--font); margin: 0; }
.motion-preview-title > span { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.motion-player-wrap { position: relative; width: 100%; aspect-ratio: 9 / 16; background: #262422; border-radius: 8px; overflow: hidden; }
.motion-player-wrap video { display: block; width: 100%; height: 100%; object-fit: contain; }
#motion-preview-error:not([hidden]) { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: 24px; color: #fffaf5; background: #262422ed; text-align: center; line-height: 1.7; }
#motion-confirm, #look-confirm { min-height: 48px; width: 100%; }
.motion-player-wrap img { display: block; width: 100%; height: 100%; object-fit: contain; }
.motion-preview-back { display: none; }
.motion-preview-empty { aspect-ratio: 9 / 16; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: #eeeae5; color: var(--muted); padding: 30px; border-radius: 8px; }
.motion-preview-empty span { font-size: 36px; font-weight: 300; }
.motion-preview-empty p, .motion-empty { font-size: 14px; line-height: 1.8; }
.motion-empty { padding: 40px 8px; }
body.is-dance-follow #compose[data-motion-step="1"] #dance-feed,
body.is-dance-follow #compose[data-motion-step="1"] #dance-follow-rail,
body.is-dance-follow #compose[data-motion-step="1"] #video-workbench-footer,
body.is-dance-follow #compose[data-motion-step="1"] #motion-next,
body.is-dance-follow #compose[data-motion-step="2"] #dance-feed,
body.is-dance-follow #compose[data-motion-step="2"] #dance-follow-rail,
body.is-dance-follow #compose[data-motion-step="2"] #video-workbench-footer,
body.is-dance-follow #compose[data-motion-step="2"] #motion-next { display: none !important; }
body.is-dance-follow #compose[data-motion-step="3"] #motion-browser,
body.is-dance-follow #compose:not([data-motion-step="1"]) #motion-import-toggle { display: none; }
body.is-dance-follow #compose[data-motion-step="3"] #motion-next { display: none !important; }
body.is-dance-follow #compose[data-motion-step] #dance-feed { grid-column: 1; grid-row: auto; grid-area: auto; display: flex; flex-direction: column; gap: 20px; }
body.is-dance-follow #compose[data-motion-step] #dance-follow-rail { grid-column: 2; grid-area: auto; grid-row: auto; }
body.is-dance-follow #compose[data-motion-step] #dance-depth-well,
body.is-dance-follow #compose[data-motion-step] #dance-look-well { grid-area: auto; }
body.is-dance-follow #compose[data-motion-step] #motion-next { grid-row: 8; text-align: right; }
body.is-dance-follow #compose[data-motion-step] > #video-workbench-footer { grid-column: 1 / -1; grid-area: auto; grid-row: 8; margin-left: auto; max-width: 480px; width: 100%; }
body.is-dance-follow #compose[data-motion-step] #dance-follow-guide { display: none; }
.motion-card:focus-visible, .motion-steps button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
@media (min-width: 1500px) { #motion-flow .motion-card-grid, #motion-library-mount .motion-card-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1050px) { #motion-flow .motion-card-grid, #motion-library-mount .motion-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .motion-browser { gap: 24px; } }
@media (max-width: 700px) {
  body.is-dance-follow #compose[data-motion-step]:not([hidden]) { display: flex !important; flex-direction: column; gap: 22px; }
  .motion-steps { gap: 12px; justify-content: space-between; }
  .motion-steps button { gap: 6px; font-size: 12px; text-align: left; }
  .motion-steps button span { width: 23px; height: 23px; flex-shrink: 0; }
  .motion-heading { flex-wrap: wrap; gap: 14px; }
  .motion-heading h2 { font-size: 26px; }
  .motion-heading p { font-size: 13px; }
  .motion-heading .btn { min-height: 40px; }
  .motion-browser { display: block; }
  #motion-library-mount #depth-strip { max-height: none; padding-right: 0; overflow: visible; }
  .motion-card-grid { gap: 16px 12px; }
  .motion-preview { display: none; }
  #motion-flow.is-previewing .motion-preview { display: flex; position: fixed; inset: 0; z-index: 50; background: var(--paper); padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); gap: 12px; overflow: auto; }
  .motion-preview-back { display: block; align-self: flex-start; flex-shrink: 0; min-height: 40px; }
  .motion-preview-title { flex-shrink: 0; }
  .motion-player-wrap { flex: 1 1 auto; min-height: 160px; aspect-ratio: auto; }
  .motion-player-wrap video,
  .motion-player-wrap img { position: absolute; inset: 0; }
  #motion-confirm, #look-confirm { flex-shrink: 0; }
  body.is-dance-follow #compose[data-motion-step] > #video-workbench-footer { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .motion-poster { transition: none; } }
body.is-dance-follow #compose[data-motion-step="3"] #motion-browser { display: block; }
body.is-dance-follow #compose[data-motion-step="3"] .motion-library,
body.is-dance-follow #compose[data-motion-step="3"] #motion-confirm,
body.is-dance-follow #compose[data-motion-step="3"] #look-confirm,
body.is-dance-follow #compose[data-motion-step="3"] #dance-feed { display: none; }
body.is-dance-follow #compose[data-motion-step="3"] #motion-preview { max-width: 360px; margin: 0; }
body.is-dance-follow #compose[data-motion-step="3"] .motion-preview-title { justify-content: flex-start; gap: 8px; }
body.is-dance-follow #compose[data-motion-step="3"] #dance-shoot-preview { min-height: 0; aspect-ratio: 9 / 16; max-width: 360px; margin: 0; grid-row: 2; grid-column: 1; }
body.is-dance-follow #compose[data-motion-step="3"] #dance-shoot-preview img { height: 100%; }
.cover-failed::after { content: none; }
@media(max-width:700px) {
  body.is-dance-follow #compose[data-motion-step="3"] #motion-preview { display: flex; position: static; }
  body.is-dance-follow #compose[data-motion-step="3"] .motion-player-wrap { aspect-ratio: 9 / 16; flex: none; }
  body.is-dance-follow #compose[data-motion-step="3"] .motion-preview-back { display: none; }
}
body.is-dance-follow #compose[data-motion-step] > #motion-flow:not([hidden]) { display: contents !important; }
body.is-dance-follow #compose[data-motion-step="3"] > #dance-follow-rail:not([hidden]) { display: grid !important; }
body.is-dance-follow #compose[data-motion-step="3"] > #dance-feed:not([hidden]) { display: none !important; }
@media(max-width:700px) { body.motion-preview-open { overflow: hidden; } }
/* Keep the decision and its confirmation within a normal laptop viewport. */
body.is-dance-follow #compose[data-motion-step] > #btn-wb-back { display: none !important; }
body.is-dance-follow #compose[data-motion-step] > #dance-follow-head { grid-row: 1; grid-column: 2; z-index: 1; justify-self: end; width: auto; align-self: start; }
#motion-steps { grid-row: 1; padding-right: 220px; min-height: 44px; align-items: flex-start; }
.motion-heading { grid-row: 2; }
#motion-import-mount { grid-row: 3; }
#motion-browser { grid-row: 4; }
body.is-dance-follow #compose[data-motion-step]:not([hidden]) { row-gap: 20px; }
body.is-dance-follow #compose[data-motion-step="1"] .motion-player-wrap,
body.is-dance-follow #compose[data-motion-step="2"] .motion-player-wrap { max-height: max(240px, calc(100dvh - 390px)); width: min(100%, max(135px, calc((100dvh - 390px) * .5625))); align-self: center; }
body.is-dance-follow #compose[data-motion-step="1"] #motion-library-mount #depth-strip,
body.is-dance-follow #compose[data-motion-step="2"] #motion-library-mount #depth-strip { max-height: max(360px, calc(100dvh - 300px)); }
@media(max-width:700px) {
  #motion-steps { padding-right: 0; }
  body.is-dance-follow #compose[data-motion-step] > #dance-follow-head { align-self: flex-start; }
  body.is-dance-follow #compose[data-motion-step="1"] .motion-player-wrap,
  body.is-dance-follow #compose[data-motion-step="2"] .motion-player-wrap { max-height: none; width: 100%; align-self: stretch; }
  body.is-dance-follow #compose[data-motion-step="1"] #motion-library-mount #depth-strip,
  body.is-dance-follow #compose[data-motion-step="2"] #motion-library-mount #depth-strip { max-height: none; }
}
body.is-dance-follow #compose[data-motion-step]:not([hidden]) { grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr) !important; grid-template-rows: auto auto auto auto auto !important; grid-template-areas: none !important; }
body.is-dance-follow #compose[data-motion-step] #motion-next,
body.is-dance-follow #compose[data-motion-step] > #video-workbench-footer { grid-area: 5 / 1 / 6 / 3 !important; }
body.is-dance-follow #compose[data-motion-step="3"]:not([hidden]) {
  grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr) !important;
  justify-content: center;
  align-content: start;
  align-items: start;
  column-gap: 20px;
}
body.is-dance-follow #compose[data-motion-step="3"] #motion-browser { grid-area: 4 / 2 / 5 / 3 !important; width: max-content; max-width: 360px; justify-self: end; }
body.is-dance-follow #compose[data-motion-step="3"] > #dance-follow-rail {
  grid-area: 4 / 3 / 5 / 4 !important;
  width: max-content;
  max-width: 360px;
  justify-self: start;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-self: start;
}
body.is-dance-follow #compose[data-motion-step="3"] > #dance-follow-head { grid-column: 1 / -1; }
body.is-dance-follow #compose[data-motion-step="3"] .dance-follow-aspect {
  grid-row: 2;
  grid-column: 1;
  justify-self: end;
  align-self: start;
  z-index: 2;
  width: max-content;
  margin: 8px 8px 0 0;
}
body.is-dance-follow #compose[data-motion-step="3"] > #video-workbench-footer {
  grid-area: 5 / 2 / 6 / 4 !important;
  margin-left: 0;
  max-width: none;
  width: 0;
  min-width: 100%;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
body.is-dance-follow #compose[data-motion-step="3"] .dance-follow-credits { order: 0; padding-top: 0; margin: 0; align-self: center; }
body.is-dance-follow #compose[data-motion-step="3"] #studio-cost { order: 0; margin: 0; flex: 1 1 auto; }
body.is-dance-follow #compose[data-motion-step="3"] .video-workbench-actions { order: 1; justify-content: flex-end; margin-left: auto; }
body.is-dance-follow #compose[data-motion-step="3"] .video-workbench-footer #btn-create { width: auto; min-width: 168px; }
body.is-dance-follow #compose[data-motion-step="3"] #create-msg,
body.is-dance-follow #compose[data-motion-step="3"] .video-workbench-footer > .studio-submit-note:not(#studio-cost) { order: 2; flex: 1 0 100%; }
@media(min-width:701px) {
  body.is-dance-follow #compose[data-motion-step="3"] .motion-player-wrap,
  body.is-dance-follow #compose[data-motion-step="3"] #dance-shoot-preview { height: clamp(240px, calc(100dvh - 460px), 480px); width: auto; aspect-ratio: 9 / 16; max-width: 100%; align-self: center; }
  body.is-dance-follow #compose[data-motion-step="3"] #dance-follow-rail::before { content: attr(data-look-title); display: block; font: 600 16px/1.5 var(--font); padding-bottom: 14px; max-width: none; margin: 0; }
}
@media (max-width: 700px) {
  body.is-dance-follow #compose[data-motion-step="3"] #motion-browser,
  body.is-dance-follow #compose[data-motion-step="3"] > #dance-follow-rail {
    width: min(280px, 100%);
    max-width: 100%;
    justify-self: center;
    align-self: center;
  }
  body.is-dance-follow #compose[data-motion-step="3"] #dance-shoot-preview,
  body.is-dance-follow #compose[data-motion-step="3"] .motion-player-wrap { width: 100%; height: auto; }
  body.is-dance-follow #compose[data-motion-step="3"] > #video-workbench-footer { width: 100%; min-width: 0; }
}

/* Touch controls remain usable throughout selection, recovery and reuse. */
@media (max-width: 700px) {
  .motion-steps button,
  .motion-preview-back,
  #motion-library-mount .depth-cat-chips .chip,
  #look-source-host .seg-btn,
  #studio-works .seg-btn,
  #studio-works .btn,
  #job-view .btn { min-height: 44px; }
  #motion-library-mount .depth-cat-chips .chip { min-width: 44px; font-size: 14px; }
  .motion-card-title, .motion-card-category { font-size: 14px; }
}
