/* Studio design system. Keep theme tokens and component rules here.
   Order preserves the reviewed desktop/mobile layouts during consolidation. */
/* studio-workspace.css */
@font-face {
  font-family: Archivo;
  src: url('/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #120e18;
  --surface: #1c1624;
  --soft: #231b2e;
  --raised: #2b2137;
  --text: #f8f2fc;
  --muted: #b3a3c2;
  --line: #3b2d48;
  --pink: #ff6190;
  --accent: #ff85aa;
  --selected: #362443;
  --user: #352137;
  --shadow: #0004;
  --green: #86d9b9;
  --green-bg: #193b32;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f8f5fc;
  --surface: #fff;
  --soft: #f6f1fb;
  --raised: #fff;
  --text: #251731;
  --muted: #7b698c;
  --line: #e8dff0;
  --pink: #f42d71;
  --accent: #bc2158;
  --selected: #f0e5fc;
  --user: #fff0f6;
  --shadow: #3a1c5b0c;
  --green: #24755b;
  --green-bg: #e6f6ef;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.6 Archivo,
    Arial,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  background: none;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #a985d7;
  outline-offset: 3px;
}
button:hover {
  filter: brightness(0.97);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.03em;
}
h1 {
  font-size: 22px;
}
h2 {
  font-size: 24px;
}
h3 {
  font-size: 17px;
}
img {
  display: block;
  max-width: 100%;
}
textarea {
  resize: vertical;
}
svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip {
  position: absolute;
  top: -100px;
  z-index: 100;
}
.skip:focus {
  top: 8px;
  left: 12px;
  background: var(--surface);
  padding: 12px;
}
.topbar {
  height: 78px;
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 0 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand img {
  width: 125px;
  height: 64px;
  object-fit: contain;
}
.dark-logo {
  display: none;
}
:root[data-theme='dark'] .dark-logo {
  display: block;
}
:root[data-theme='dark'] .light-logo {
  display: none;
}
.header-divider {
  height: 26px;
  border-left: 1px solid var(--line);
}
.studio-label {
  font-weight: 650;
}
.local-badge {
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 5px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
#save-status {
  font-size: 11px;
  color: var(--muted);
}
.credit-button {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 15px;
  min-height: 40px;
  color: var(--accent);
  font-size: 12px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--selected);
  color: var(--accent);
  font-weight: 650;
}
.icon-button {
  height: 38px;
  width: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 21px;
  flex-shrink: 0;
}
.mobile-only {
  display: none;
}
.workspace {
  height: calc(100dvh - 78px);
  display: grid;
  grid-template-columns: 230px minmax(360px, 1fr) 340px;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.side-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 11px;
}
.side-heading h2 {
  font-size: 18px;
}
.primary {
  background: linear-gradient(115deg, #ff2f79, #ff6b5e);
  color: #fff;
  border-radius: 12px;
  min-height: 44px;
  padding: 11px 19px;
  font-weight: 650;
  font-size: 13px;
  box-shadow: 0 8px 20px #f72c6d16;
}
.wide {
  width: 100%;
}
.side-label {
  font-size: 10px;
  letter-spacing: 0.13em;
  font-weight: 600;
  color: var(--muted);
  margin: 0 10px 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  min-height: 43px;
  border-radius: 9px;
  padding: 9px 12px;
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
}
.nav-item.selected {
  background: var(--selected);
  color: var(--text);
  font-weight: 650;
}
.nav-item:hover {
  background: var(--soft);
}
.nav-item > span:not(.count) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item .count {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
.project-dot {
  height: 25px;
  width: 25px;
  border-radius: 7px;
  background: linear-gradient(145deg, #f63a7d, #7258bd);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  flex-shrink: 0;
}
.project-dot.alt {
  background: linear-gradient(145deg, #5485a7, #495173);
}
.side-bottom {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.side-bottom a {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px;
}
.centre {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: radial-gradient(ellipse at 80% 0, #ba96e112, transparent 65%);
}
.project-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 25px 30px 18px;
}
.project-heading p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.project-heading .assistant-label {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.09em;
  margin-bottom: 6px;
}
.content {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 5px 30px 25px;
  scroll-behavior: smooth;
}
.chat-intro {
  padding: 24px 0 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.assistant-symbol {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--user);
  color: var(--pink);
  font-size: 26px;
  flex-shrink: 0;
}
.chat-intro h2 {
  font-size: 20px;
}
.chat-intro p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}
.message {
  margin-bottom: 24px;
  max-width: 740px;
}
.message.user {
  margin-left: auto;
  max-width: 85%;
  background: var(--user);
  border: 1px solid #ed589017;
  border-radius: 16px 16px 3px 16px;
  padding: 15px 20px;
  font-size: 13px;
}
.message.assistant {
  padding: 0 0 0 0;
}
.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  margin: 0 0 10px;
}
.message-meta > span:first-child {
  color: var(--pink);
  font-size: 18px;
}
.message-text {
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.asset-result {
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 7px 20px var(--shadow);
}
.asset-result-top {
  display: flex;
  gap: 16px;
  padding: 18px;
  align-items: center;
}
.asset-thumb {
  height: 80px;
  width: 60px;
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 20%;
  flex-shrink: 0;
}
.asset-symbol {
  height: 70px;
  width: 60px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--soft);
  color: var(--accent);
  font-size: 25px;
  flex-shrink: 0;
}
.asset-result h3 {
  font-size: 17px;
}
.asset-result p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0;
}
.tag {
  display: inline-block;
  font-size: 9px;
  padding: 3px 7px;
  background: var(--soft);
  color: var(--muted);
  border-radius: 5px;
}
.tag.approved {
  color: var(--green);
  background: var(--green-bg);
}
.result-actions {
  display: flex;
  gap: 5px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.result-actions button,
.subtle-button {
  font-size: 11px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 35px;
  background: var(--surface);
  color: var(--accent);
}
.linked-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 13px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.welcome {
  margin: 40px auto;
  max-width: 530px;
}
.welcome h2 {
  font-size: 32px;
  line-height: 1.15;
}
.welcome > p {
  font-size: 14px;
  color: var(--muted);
  margin: 15px 0 25px;
}
.starter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.starter-grid button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 17px;
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
}
.starter-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
}
.composer-wrap {
  padding: 0 25px 12px;
}
.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  box-shadow: 0 8px 25px var(--shadow);
}
.composer textarea {
  background: transparent;
  border: 0;
  min-height: 48px;
  max-height: 170px;
  resize: none;
  width: 100%;
  font-size: 13px;
  line-height: 1.7;
  padding: 0;
  outline-offset: 6px;
}
.composer textarea::placeholder {
  color: var(--muted);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.prompt-tools {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.prompt-tools button {
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 99px;
  font-size: 10px;
  padding: 6px 10px;
}
.send {
  margin-left: auto;
  border-radius: 50%;
  height: 38px;
  width: 38px;
  flex-shrink: 0;
  background: linear-gradient(130deg, #ff317a, #ff6b5e);
  color: white;
  font-size: 25px;
}
.composer-note {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  margin: 9px 0 0;
}
.context-strip {
  font-size: 10px;
  color: var(--muted);
  padding: 8px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.context-strip button {
  color: var(--accent);
  font-size: 10px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspector {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 23px;
  overflow: auto;
}
.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.inspector-head > span {
  font-size: 11px;
  color: var(--muted);
}
.inspector-head .icon-button {
  width: 30px;
  height: 30px;
  font-size: 17px;
}
.inspector-image {
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  background: var(--soft);
  margin-bottom: 20px;
}
.inspector-image img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  background: var(--soft);
}
.inspector-image small {
  position: absolute;
  bottom: 7px;
  left: 9px;
  font-size: 9px;
  color: #fff;
  background: #211429bb;
  border-radius: 5px;
  padding: 2px 6px;
}
.inspector-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
.inspector-title h2 {
  font-size: 25px;
  overflow-wrap: anywhere;
}
.asset-kind {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.inspector-description {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.85;
  margin: 18px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 190px;
  overflow: auto;
}
.inspector .primary {
  margin: 6px 0 10px;
}
.inspector-section {
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.inspector-section h3 {
  font-size: 12px;
  margin-bottom: 12px;
}
.inspector-section p {
  font-size: 11px;
  color: var(--muted);
}
.reference-link {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  width: 100%;
  text-align: left;
}
.reference-link .asset-symbol {
  height: 35px;
  width: 35px;
  font-size: 17px;
}
.reference-link b {
  font-size: 11px;
  display: block;
}
.reference-link small {
  font-size: 10px;
  color: var(--muted);
}
.empty-inspector {
  padding: 65px 5px;
  text-align: center;
}
.empty-inspector .assistant-symbol {
  margin: 0 auto 20px;
}
.empty-inspector h2 {
  font-size: 20px;
}
.empty-inspector p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 15px;
}
.folder-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}
.folder-heading h2 {
  font-size: 22px;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.library-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  padding: 17px;
  text-align: left;
  min-width: 0;
}
.library-card h3 {
  margin: 14px 0 8px;
  overflow-wrap: anywhere;
}
.library-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.library-card .asset-thumb {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: var(--soft);
}
.empty-state {
  padding: 35px 10px;
  color: var(--muted);
  font-size: 13px;
}
.proposal {
  border: 1px solid var(--pink);
  border-radius: 14px;
  padding: 17px;
  background: var(--surface);
  margin: 15px 0;
}
.proposal h3 {
  font-size: 15px;
}
.proposal p {
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
  margin: 10px 0;
}
.proposal-actions {
  display: flex;
  gap: 10px;
}
.proposal-actions button {
  font-size: 11px;
}
.proposal-actions .primary {
  box-shadow: none;
}
.version {
  font-size: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  width: min(540px, calc(100% - 32px));
  max-height: 90dvh;
  box-shadow: 0 30px 100px #0004;
}
dialog::backdrop {
  background: #150b234f;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.dialog-head h2 {
  font-size: 23px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
dialog label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 16px 0;
}
dialog input:not([type='checkbox']),
dialog textarea,
dialog select {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 9px;
  padding: 12px;
  font-size: 13px;
}
dialog fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 20px 0;
  padding: 14px;
}
dialog legend {
  font-size: 12px;
  font-weight: 600;
}
.field-note,
.review-note {
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0;
}
.review-note {
  color: var(--accent);
}
#reference-options {
  max-height: 150px;
  overflow: auto;
}
#reference-options label {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 10px 0;
  font-weight: 400;
}
#info-body p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 17px;
}
#info-body .subtle-button {
  margin: 10px 7px 0 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 13px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 25px #0003;
  z-index: 100;
  max-width: 90%;
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 250px minmax(500px, 1fr) 390px;
  }
  .content {
    padding-inline: 50px;
  }
  .composer-wrap {
    padding-inline: 45px;
  }
  .inspector {
    padding: 28px;
  }
  .inspector-image img {
    height: 310px;
  }
}
@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .inspector {
    display: none;
  }
  .inspector.open {
    display: block;
    position: fixed;
    right: 0;
    top: 78px;
    bottom: 0;
    z-index: 30;
    width: 350px;
    max-width: 100%;
    box-shadow: -20px 0 80px #0003;
  }
  .project-heading {
    padding-inline: 24px;
  }
  .content {
    padding-inline: 24px;
  }
  .local-badge {
    display: none;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 66px;
    padding: 0 14px;
    gap: 10px;
  }
  .brand img {
    width: 101px;
    height: 52px;
  }
  .header-divider,
  .studio-label,
  #save-status,
  .credit-button span {
    display: none;
  }
  .top-actions {
    gap: 8px;
  }
  .credit-button {
    padding: 7px 10px;
    font-size: 14px;
  }
  .avatar {
    display: none;
  }
  .icon-button {
    width: 34px;
    height: 34px;
  }
  .mobile-only {
    display: inline-grid;
  }
  .workspace {
    height: calc(100dvh - 66px);
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
    position: fixed;
    top: 66px;
    bottom: 0;
    left: 0;
    width: min(285px, 85%);
    z-index: 40;
    box-shadow: 20px 0 60px #0003;
  }
  .inspector.open {
    top: 66px;
    width: min(390px, 100%);
  }
  .project-heading {
    padding: 19px 19px 12px;
  }
  .project-heading h1 {
    font-size: 19px;
  }
  .content {
    padding: 0 19px 20px;
  }
  .chat-intro {
    padding: 14px 0 23px;
  }
  .chat-intro h2 {
    font-size: 18px;
  }
  .chat-intro p {
    font-size: 11px;
  }
  .assistant-symbol {
    width: 35px;
    height: 35px;
  }
  .message.user {
    max-width: 94%;
    padding: 13px 15px;
    font-size: 12px;
  }
  .message-text {
    font-size: 12px;
  }
  .asset-result-top {
    padding: 14px;
  }
  .composer-wrap {
    padding: 0 12px 9px;
  }
  .composer {
    padding: 12px;
    border-radius: 14px;
  }
  .composer-note {
    font-size: 8px;
  }
  .prompt-tools {
    gap: 5px;
  }
  .prompt-tools button {
    font-size: 9px;
    padding: 5px 7px;
  }
  .prompt-tools button:nth-child(4) {
    display: none;
  }
  .context-strip {
    padding-inline: 5px;
  }
  .welcome {
    margin: 22px 0;
  }
  .welcome h2 {
    font-size: 27px;
  }
  .starter-grid {
    grid-template-columns: 1fr;
  }
  .asset-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .library-card {
    padding: 12px;
  }
  .library-card h3 {
    font-size: 14px;
  }
  .library-card .asset-thumb {
    height: 130px;
  }
  dialog {
    padding: 20px;
  }
  .inspector-image img {
    height: 240px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

@media (min-width: 1181px) {
  .inspector-collapsed .workspace {
    grid-template-columns: 230px minmax(360px, 1fr);
  }
  .inspector-collapsed .inspector {
    display: none;
  }
}

[hidden] {
  display: none !important;
}
#connection-notice {
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 2px solid #f36;
  color: var(--text);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  flex: none;
  max-height: 35dvh;
  overflow: auto;
}
#connection-notice p {
  flex: 1;
  min-width: 200px;
}
#connection-notice button {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

/* Studio chrome: reserve the viewport for the current task. */
body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --bar-height: 54px;
  --sidebar-width: 200px;
  --inspector-width: 300px;
}
.topbar {
  height: var(--bar-height);
  min-height: var(--bar-height);
  padding: 0 16px;
  gap: 12px;
}
.brand img {
  width: 96px;
  height: 46px;
}
.header-divider {
  height: 20px;
}
.studio-label {
  font-size: 12px;
}
.top-actions {
  gap: 10px;
}
.credit-button {
  padding: 5px 12px;
  min-height: 34px;
}
.workspace,
.inspector-collapsed .workspace {
  height: auto;
  min-height: 0;
  flex: 1;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}
.inspector {
  display: none;
  padding: 18px;
}
body:not(.inspector-collapsed) .workspace {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--inspector-width);
}
body:not(.inspector-collapsed) .inspector {
  display: block;
}
.sidebar {
  padding: 14px 10px;
  gap: 16px;
}
.side-heading {
  display: none;
}
.side-label {
  margin-bottom: 6px;
}
.sidebar .primary {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  box-shadow: none;
}
.nav-item {
  min-height: 36px;
  padding: 6px 9px;
  margin: 2px 0;
  gap: 9px;
}
.side-bottom {
  padding-top: 10px;
}
.sidebar-collapsed .sidebar {
  display: none;
}
.sidebar-collapsed .workspace {
  grid-template-columns: minmax(0, 1fr);
}
.sidebar-collapsed:not(.inspector-collapsed) .workspace {
  grid-template-columns: minmax(0, 1fr) var(--inspector-width);
}
.project-heading {
  padding: 10px 20px 6px;
  min-height: 48px;
  flex: none;
}
.project-identity {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.project-identity h1 {
  font-size: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.project-heading .project-identity p {
  margin: 0;
  white-space: nowrap;
  font-size: 11px;
}
.project-heading > .icon-button {
  height: 30px;
  width: 30px;
}
.content {
  padding: 12px 20px 20px;
}
.chat-intro {
  display: none;
}
.message {
  margin-bottom: 18px;
  max-width: 900px;
}
.composer-wrap {
  padding: 0 20px 10px;
  flex: none;
}
.composer {
  padding: 9px 12px;
  border-radius: 12px;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.composer textarea {
  min-height: 28px;
  max-height: 120px;
  field-sizing: content;
  flex: 1;
  min-width: 0;
}
.composer-note {
  margin-top: 4px;
}
.prompt-menu {
  position: relative;
  flex: none;
}
.prompt-menu summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  font-size: 23px;
  color: var(--muted);
}
.prompt-menu summary::-webkit-details-marker {
  display: none;
}
.prompt-menu summary:focus-visible {
  outline: 3px solid #a985d7;
}
.prompt-menu .prompt-tools {
  position: absolute;
  right: 0;
  bottom: calc(100% + 16px);
  width: 175px;
  padding: 8px;
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 25px #0003;
  z-index: 10;
}
.prompt-menu .prompt-tools button {
  display: block;
  text-align: left;
  min-height: 38px;
  font-size: 12px;
  border: 0;
  border-radius: 6px;
}
.prompt-menu .prompt-tools button:hover {
  background: var(--soft);
}
.context-strip {
  padding: 4px 0;
}
.context-strip:empty {
  display: none;
}
.prompt-tools button {
  padding: 4px 9px;
}
.inspector-head {
  margin-bottom: 12px;
}
.inspector-description {
  margin: 12px 0;
}
.inspector-section {
  padding-top: 14px;
  margin-top: 14px;
}
.inspector-image {
  margin-bottom: 14px;
}
.inspector-image img {
  height: 220px;
}
.inspector-title h2 {
  font-size: 21px;
}
.welcome {
  margin: 20px auto;
}
.welcome h2 {
  font-size: 28px;
}
.welcome > p {
  margin: 12px 0 20px;
}
.asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.folder-heading {
  margin: 0 0 14px;
}
@media (max-width: 1180px) {
  body:not(.inspector-collapsed) .workspace {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .sidebar-collapsed:not(.inspector-collapsed) .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  body:not(.inspector-collapsed) .inspector {
    position: fixed;
    right: 0;
    top: var(--bar-height);
    bottom: 0;
    z-index: 30;
    width: 340px;
    max-width: 100%;
    box-shadow: -20px 0 80px #0003;
  }
}
@media (max-width: 700px) {
  body {
    --bar-height: 50px;
  }
  .topbar {
    padding: 0 10px;
    gap: 8px;
  }
  .brand img {
    width: 86px;
    height: 40px;
  }
  .top-actions {
    gap: 6px;
  }
  .avatar {
    display: block;
    width: 30px;
    height: 30px;
  }
  .credit-button {
    min-height: 32px;
    padding: 4px 9px;
  }
  .topbar .icon-button {
    width: 34px;
    height: 34px;
  }
  .workspace,
  .inspector-collapsed .workspace,
  .sidebar-collapsed .workspace,
  body:not(.inspector-collapsed) .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
    top: var(--bar-height);
    padding: 14px;
    width: min(285px, 85%);
  }
  .sidebar.open .side-heading {
    display: flex;
  }
  .nav-item {
    min-height: 42px;
  }
  .project-heading {
    padding: 8px 12px 4px;
    min-height: 44px;
  }
  .project-identity {
    display: block;
  }
  .project-identity h1 {
    font-size: 17px;
  }
  .project-identity p {
    display: none;
  }
  .content {
    padding: 12px;
  }
  .composer-wrap {
    padding: 0 10px max(6px, env(safe-area-inset-bottom));
  }
  .composer textarea {
    font-size: 16px;
    min-height: 28px;
  }
  .prompt-tools button {
    min-height: 30px;
  }
  .composer-note {
    display: none;
  }
  .composer-tools {
    gap: 4px;
  }
  .context-strip {
    font-size: 10px;
  }
  .inspector.open,
  body:not(.inspector-collapsed) .inspector {
    top: var(--bar-height);
    width: min(390px, 100%);
  }
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .welcome {
    margin: 12px 0;
  }
  .starter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .starter-grid button {
    padding: 12px;
  }
}

/* studio-flow.css */
#flow-navigation {
  padding: 0 30px 8px;
  flex: none;
}
.workspace-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.workspace-tabs button {
  padding: 9px 0;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.workspace-tabs button[aria-current] {
  color: var(--accent);
  border-bottom-color: var(--pink);
  font-weight: 650;
}
.workspace-tabs button:last-child {
  margin-left: auto;
}
.workspace-tabs button span {
  background: var(--selected);
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 9px;
}
.next-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 16px;
}
.next-action strong {
  display: block;
  font-size: 14px;
  margin-top: 3px;
}
.next-action small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.next-action .primary {
  min-height: 36px;
  padding: 8px 15px;
  font-size: 11px;
  white-space: nowrap;
}
.journey-steps {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 2px;
  gap: 5px;
}
.journey-steps button {
  font-size: 9px;
  color: var(--muted);
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.journey-steps button span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 8px;
}
.journey-steps button[aria-current] {
  color: var(--accent);
  font-weight: 650;
}
.journey-steps button[aria-current] span {
  background: var(--pink);
  border-color: var(--pink);
  color: white;
}
.chat-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(125deg, var(--surface), var(--soft));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 12px;
}
.chat-plan-card h3 {
  font-size: 16px;
  margin: 7px 0;
}
.chat-plan-card p {
  font-size: 12px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
}
.chat-plan-card button {
  flex-shrink: 0;
}
.flow-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 24px 0;
}
.flow-title h2 {
  font-size: 25px;
  margin: 7px 0 11px;
}
.flow-title p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 550px;
}
.flow-title > .tag {
  flex-shrink: 0;
}
.entry-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin: 20px 0;
}
.entry-modes button {
  text-align: left;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
}
.entry-modes button:hover {
  border-color: var(--pink);
  background: var(--user);
}
.entry-modes b {
  display: block;
  font-size: 12px;
  color: var(--accent);
}
.entry-modes span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
.flow-form {
  background: var(--surface);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 20px 0;
}
.flow-form label,
.edit-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 17px;
}
.flow-form input:not([type='checkbox']),
.flow-form textarea,
.flow-form select,
.edit-row input {
  width: 100%;
  display: block;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  margin-top: 8px;
  font-size: 13px;
  min-width: 0;
}
.flow-form textarea {
  line-height: 1.8;
}
.form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.flow-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin: 14px 0 0;
}
.flow-form .flow-actions {
  margin-top: 24px;
}
.flow-actions .primary {
  font-size: 12px;
}
.flow-notice,
.voice-brief {
  font-size: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 15px;
  color: var(--muted);
  margin: 18px 0;
  line-height: 1.8;
}
.voice-brief button {
  margin: 10px 8px 0 0;
}
.voice-brief audio {
  width: 100%;
  margin-top: 15px;
}
.flow-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 35px 25px;
  margin: 25px 0;
  text-align: center;
}
.flow-empty > span {
  font-size: 28px;
  display: block;
  color: var(--pink);
  margin-bottom: 15px;
}
.flow-empty h2 {
  font-size: 23px;
}
.flow-empty p {
  font-size: 13px;
  color: var(--muted);
  margin: 15px auto 22px;
  max-width: 440px;
}
.world-grid {
  display: grid;
  gap: 18px;
  margin-top: 23px;
}
.world-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  align-items: start;
}
.world-card > img {
  width: 140px;
  height: 190px;
  object-fit: contain;
  background: var(--soft);
  border-radius: 10px;
}
.world-placeholder {
  display: grid;
  place-items: center;
  width: 140px;
  height: 160px;
  font-size: 40px;
  color: var(--accent);
  background: var(--soft);
  border-radius: 10px;
}
.world-card h3 {
  font-size: 20px;
  margin: 5px 0 12px;
}
.world-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.review-lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  font-size: 11px;
}
.review-lines b {
  color: var(--green);
  font-size: 10px;
}
.review-lines small {
  color: var(--muted);
}
.world-card .field-note {
  display: block;
  margin-top: 14px;
  line-height: 1.6;
}
.flow-callout {
  display: flex;
  align-items: center;
  gap: 25px;
  justify-content: space-between;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px;
  margin: 25px 0;
}
.flow-callout p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.flow-callout button {
  flex-shrink: 0;
}
.episode-switch {
  font-size: 10px;
  color: var(--muted);
  display: grid;
  gap: 7px;
  max-width: 180px;
  flex-shrink: 0;
}
.episode-switch select {
  max-width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
}
.episode-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.episode-strip button {
  min-width: 150px;
  max-width: 230px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 13px 16px;
  flex-shrink: 0;
}
.episode-strip button[aria-current] {
  border-color: var(--pink);
  background: var(--user);
}
.episode-strip span {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.episode-strip b {
  display: block;
  font-size: 13px;
  margin: 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.episode-strip small {
  font-size: 10px;
  color: var(--muted);
}
.script-metrics {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted);
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.flow-subheading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 30px 0 18px;
}
.flow-subheading h3 {
  font-size: 20px;
}
.flow-subheading p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.shot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.shot-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
  min-width: 0;
}
.shot-visual {
  height: 150px;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(130deg, var(--soft), var(--selected));
  overflow: hidden;
}
.shot-visual img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.shot-visual > span {
  font-size: 48px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.45;
}
.shot-visual small {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 8px;
  letter-spacing: 0.08em;
  background: var(--surface);
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--muted);
}
.shot-copy {
  padding: 18px;
}
.shot-copy h3 {
  font-size: 16px;
  margin-bottom: 10px;
}
.shot-copy p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.reference-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.reference-chips span {
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--muted);
}
.shot-copy .change-note {
  color: var(--accent);
  padding: 8px 0;
}
.production-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.production-summary strong {
  font-size: 23px;
  display: block;
  letter-spacing: -0.03em;
}
.production-summary span {
  font-size: 10px;
  color: var(--muted);
}
.take-history {
  font-size: 11px;
  margin-top: 13px;
}
.take-history button {
  display: block;
  margin: 8px 0;
}
.cut-monitor {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.cut-screen {
  aspect-ratio: 9/16;
  width: 100%;
  background: #16111c;
  color: #e1d6e9;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
}
.cut-screen > span {
  font-size: 12px;
  text-align: center;
  padding: 20px;
}
.cut-screen img,
.cut-screen video {
  height: 100%;
  width: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
}
.cut-screen small {
  position: absolute;
  bottom: 6px;
  left: 5px;
  right: 5px;
  text-align: center;
  background: #181020c9;
  border-radius: 5px;
  padding: 5px;
  font-size: 8px;
}
.cut-details h3 {
  font-size: 21px;
  margin: 9px 0 15px;
}
.cut-details > p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.cut-total {
  margin: 20px 0;
}
.cut-total b {
  font-size: 26px;
  display: block;
  letter-spacing: -0.03em;
}
.cut-total span {
  font-size: 11px;
  color: var(--muted);
}
.timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 20px 0;
}
.timeline button {
  flex: 0 0 155px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  min-width: 0;
}
.timeline button[aria-current] {
  border-color: var(--pink);
  box-shadow: inset 0 -3px var(--pink);
}
.timeline span {
  font-size: 9px;
  color: var(--accent);
}
.timeline b {
  font-size: 12px;
  display: block;
  margin: 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline small {
  font-size: 10px;
  color: var(--muted);
}
.edit-rows {
  display: grid;
  gap: 14px;
}
.edit-row {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.edit-row-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}
.edit-row-title b {
  font-size: 14px;
}
.edit-row-title span {
  display: flex;
  gap: 7px;
}
.edit-row button:disabled {
  opacity: 0.35;
  cursor: default;
}
.release-status {
  font-size: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}
.release-status.ready {
  color: var(--green);
  background: var(--green-bg);
}
.release-status button {
  margin-left: 10px;
}
.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 400 !important;
  font-size: 12px !important;
  line-height: 1.7;
}
.check-row input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.destination-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 25px 0;
}
.destination-cards article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.destination-cards h3 {
  font-size: 17px;
  margin: 10px 0 14px;
}
.destination-cards p,
.export-panel > p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.export-panel {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  margin: 25px 0;
}
.export-panel h3 {
  font-size: 21px;
  margin-bottom: 13px;
}
.export-panel > .subtle-button {
  margin: 7px 6px 0 0;
}
.review-destinations {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.proposal-reference {
  max-height: 250px;
  max-width: 100%;
  object-fit: contain;
  margin: 15px 0;
}
.flow-form fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
  margin: 20px 0;
}
.flow-form legend {
  font-size: 12px;
}
.flow-form fieldset p {
  font-size: 12px;
  color: var(--muted);
}
.flow-form fieldset .check-row:last-child {
  margin-bottom: 0;
}
#info-body > .flow-form {
  padding: 0;
  border: 0;
}
.flow-form input::placeholder,
.flow-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
@media (max-width: 1180px) {
  #flow-navigation {
    padding-inline: 24px;
  }
}
@media (max-width: 700px) {
  #flow-navigation {
    padding-inline: 19px;
  }
  .workspace-tabs {
    gap: 14px;
    overflow-x: auto;
    margin-bottom: 11px;
  }
  .workspace-tabs button {
    font-size: 10px;
  }
  .next-action {
    padding: 11px 12px;
    gap: 10px;
  }
  .next-action strong {
    font-size: 12px;
  }
  .next-action small {
    display: none;
  }
  .next-action .eyebrow {
    font-size: 8px;
  }
  .next-action .primary {
    font-size: 10px;
    padding: 7px 11px;
    min-height: 34px;
  }
  .journey-steps {
    padding-top: 8px;
  }
  .journey-steps button {
    font-size: 8px;
    gap: 3px;
  }
  .journey-steps button span {
    width: 14px;
    height: 14px;
    font-size: 7px;
  }
  .flow-title {
    margin: 18px 0;
    flex-wrap: wrap;
    gap: 13px;
  }
  .flow-title h2 {
    font-size: 23px;
  }
  .flow-title p {
    font-size: 12px;
  }
  .entry-modes {
    gap: 7px;
  }
  .entry-modes button {
    padding: 11px 8px;
  }
  .entry-modes b {
    font-size: 10px;
  }
  .entry-modes span {
    font-size: 9px;
  }
  .flow-form {
    padding: 17px;
  }
  .flow-form input,
  .flow-form textarea,
  .flow-form select {
    font-size: 16px !important;
  }
  .form-columns {
    gap: 12px;
  }
  .world-card {
    grid-template-columns: 85px 1fr;
    gap: 13px;
    padding: 15px;
  }
  .world-card > img {
    width: 85px;
    height: 150px;
  }
  .world-placeholder {
    width: 85px;
    height: 110px;
  }
  .world-card h3 {
    font-size: 18px;
  }
  .world-card .review-lines {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .world-card .review-lines > span {
    margin-top: 7px;
  }
  .world-card .flow-actions button {
    font-size: 10px;
    padding: 6px 8px;
  }
  .flow-callout {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 17px;
  }
  .episode-switch {
    max-width: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .episode-switch select {
    flex: 1;
    min-width: 0;
  }
  .shot-grid {
    grid-template-columns: 1fr;
  }
  .shot-visual {
    height: 180px;
  }
  .shot-copy {
    padding: 17px;
  }
  .shot-copy h3 {
    font-size: 18px;
  }
  .shot-copy p {
    font-size: 12px;
  }
  .production-summary {
    flex-wrap: wrap;
    padding: 17px;
  }
  .cut-monitor {
    grid-template-columns: 130px 1fr;
    gap: 14px;
    padding: 14px;
  }
  .cut-details h3 {
    font-size: 17px;
  }
  .cut-details > p {
    font-size: 10px;
  }
  .cut-details .field-note {
    display: none;
  }
  .cut-total {
    margin: 15px 0;
  }
  .cut-total b {
    font-size: 23px;
  }
  .cut-details .flow-actions {
    gap: 5px;
  }
  .cut-details .flow-actions button {
    font-size: 10px;
    padding: 6px 8px;
  }
  .edit-row {
    padding: 16px;
  }
  .edit-row input {
    font-size: 16px;
  }
  .destination-cards {
    grid-template-columns: 1fr;
  }
  .chat-plan-card {
    padding: 15px;
    gap: 13px;
  }
  .chat-plan-card p {
    display: none;
  }
  .chat-plan-card h3 {
    font-size: 14px;
  }
  .chat-plan-card .subtle-button {
    font-size: 10px;
  }
  .chat-intro {
    padding-top: 19px;
  }
  .project-heading {
    padding-top: 14px;
    padding-bottom: 9px;
  }
  .project-heading .assistant-label {
    display: none;
  }
  .project-heading p:last-child {
    margin-top: 4px;
  }
  .flow-title > .tag {
    font-size: 9px;
  }
  .review-destinations {
    gap: 7px;
  }
  .review-destinations button {
    font-size: 10px;
  }
  .flow-form .flow-actions {
    gap: 8px;
  }
  .flow-form .flow-actions button {
    font-size: 11px;
  }
  .entry-modes button {
    min-height: 65px;
  }
  .export-panel {
    padding: 18px;
  }
}
@media (max-width: 360px) {
  .journey-steps button {
    flex-direction: column;
    gap: 2px;
  }
  .workspace-tabs {
    gap: 10px;
  }
  .workspace-tabs button {
    font-size: 9px;
  }
  .cut-monitor {
    grid-template-columns: 110px 1fr;
  }
  .entry-modes span {
    font-size: 8px;
  }
  .world-card {
    grid-template-columns: 1fr;
  }
  .world-card > img {
    width: 100%;
    height: 160px;
  }
  .world-placeholder {
    width: 100%;
    height: 70px;
  }
}

.file-download {
  display: inline-flex;
  margin: 0 0 20px;
}
.export-preview-label {
  display: block;
  font-size: 12px;
}
.export-preview-label textarea {
  display: block;
  width: 100%;
  font: 11px/1.6 monospace;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

/* One navigation row; guidance is available on demand. */
#flow-navigation {
  padding: 0 20px;
  position: relative;
  z-index: 5;
}
.workspace-tabs {
  gap: 20px;
  margin: 0;
  align-items: center;
  overflow: visible;
}
.workspace-tabs > button {
  min-height: 38px;
  padding: 7px 0;
}
.workspace-tabs button:last-child {
  margin-left: 0;
}
.workflow-menu {
  margin-left: auto;
  position: relative;
  font-size: 12px;
  flex: none;
}
.workflow-menu summary {
  cursor: pointer;
  list-style: none;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.workflow-menu summary::-webkit-details-marker {
  display: none;
}
.workflow-menu summary:focus-visible {
  outline: 3px solid #a985d7;
  outline-offset: 2px;
}
.workflow-menu[open] summary {
  color: var(--accent);
}
.workflow-popover {
  position: absolute;
  right: 0;
  top: 100%;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 16px 45px #0003;
  max-height: calc(100dvh - 160px);
  overflow: auto;
}
.workflow-popover .journey-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  gap: 4px;
}
.workflow-popover .journey-steps button {
  font-size: 12px;
  min-height: 38px;
  padding: 6px;
  gap: 8px;
  text-align: left;
}
.workflow-popover .next-action {
  display: block;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-top: 10px;
  padding: 12px 0 0;
}
.workflow-popover .next-action strong {
  font-size: 13px;
}
.workflow-popover .next-action small {
  display: block;
}
.workflow-popover .next-action button {
  margin-top: 8px;
}
.flow-title {
  margin: 4px 0 16px;
  gap: 14px;
}
.flow-title h2 {
  font-size: 23px;
  margin: 4px 0 7px;
}
.flow-title p {
  font-size: 12px;
}
.flow-form {
  padding: 18px;
  margin: 14px 0;
}
.flow-form label {
  margin-bottom: 13px;
}
.flow-form input:not([type='checkbox']),
.flow-form textarea,
.flow-form select {
  margin-top: 5px;
  padding: 9px;
}
.entry-modes {
  margin: 14px 0;
}
.entry-modes button {
  padding: 12px;
}
.world-grid {
  margin-top: 14px;
}
.flow-subheading {
  margin: 22px 0 14px;
}
.chat-plan-card {
  padding: 12px 16px;
  margin: 0 0 14px;
}
.chat-plan-card p {
  display: none;
}
.chat-plan-card h3 {
  font-size: 14px;
  margin: 4px 0;
}
@media (max-width: 700px) {
  #flow-navigation {
    padding: 0 12px;
  }
  .workspace-tabs {
    gap: 12px;
    justify-content: space-between;
  }
  .workspace-tabs > button {
    font-size: 11px;
    min-height: 40px;
  }
  .workflow-menu {
    font-size: 11px;
    margin-left: 0;
  }
  .workflow-menu summary {
    min-height: 40px;
    gap: 3px;
  }
  .workspace-tabs button span {
    font-size: 9px;
    padding: 1px 4px;
  }
  .flow-title {
    margin: 2px 0 14px;
  }
  .flow-title h2 {
    font-size: 21px;
  }
  .flow-form {
    padding: 14px;
  }
  .entry-modes button {
    min-height: 60px;
    padding: 10px 8px;
  }
}
@media (max-width: 360px) {
  .workspace-tabs {
    gap: 8px;
  }
  .workspace-tabs > button,
  .workflow-menu {
    font-size: 10px;
  }
  .workflow-popover .journey-steps button {
    flex-direction: row;
  }
}

/* episode-editor.css */
.episode-editor {
  margin: 20px 0;
  padding: 24px !important;
  min-width: 0;
  scroll-margin-top: 90px;
}
.cut-heading {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.cut-heading h3 {
  font-size: 1.8rem;
  margin: 4px 0;
}
.cut-heading p {
  margin: 0;
  max-width: 46ch;
}
.cut-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--accent, #ee4d83);
}
.cut-heading > .field {
  min-width: 190px;
}
.cut-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.cut-save {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.cut-layout {
  display: grid;
  grid-template-columns: minmax(210px, 290px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.cut-player {
  background: #100b19;
  border-radius: 16px;
  padding: 12px;
  color: #fff;
  min-width: 0;
}
.cut-player canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: 360px;
  aspect-ratio: 9/16;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
  background: #100b19;
}
.cut-player .muted {
  color: #bcb3c7 !important;
  font-size: 11px;
  text-align: center;
  margin: 8px 0;
}
.cut-transport {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
}
.cut-transport .btn {
  color: #fff !important;
  border-color: #5c4d69 !important;
  font-size: 12px;
  min-height: 40px;
  background: #221a2f !important;
  padding: 8px 12px;
}
.cut-transport span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cut-scrubber {
  display: block;
}
.cut-scrubber input {
  width: 100%;
  accent-color: #ee4d83;
}
.cut-sequence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cut-sequence-heading h4 {
  margin: 0;
  font-size: 1rem;
}
.cut-sequence-heading h4 span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 5px;
}
.cut-sequence-heading .btn {
  min-height: 40px;
  font-size: 12px;
  padding: 8px 10px;
}
.cut-order-hint {
  font-size: 12px;
}
.cut-work {
  min-width: 0;
}
.cut-sequence {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  min-height: 136px;
  scrollbar-width: thin;
}
.cut-tile {
  flex: 0 0 124px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface2);
  overflow: hidden;
}
.cut-tile.selected {
  border-color: #ee4d83;
}
.cut-tile > button {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  border: 0;
  padding: 10px;
  color: var(--text);
  background: none;
  cursor: pointer;
}
.cut-tile-picture {
  display: grid;
  place-items: center;
  height: 48px;
  background: linear-gradient(135deg, #38223e, #171121);
  color: #f3a1bf;
  border-radius: 6px;
  margin-bottom: 8px;
}
.cut-tile-number {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 11px;
  color: #fff;
}
.cut-tile strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cut-tile button > span:last-child {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.cut-drop-hint {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  width: 100%;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.cut-inspector {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}
.cut-trim {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.cut-trim input,
.cut-inspector > label input {
  min-width: 0;
  width: 100%;
  font-size: 16px !important;
}
.cut-volume {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  margin-top: 16px;
}
.cut-volume input {
  flex: 1;
  min-width: 0;
  accent-color: #ee4d83;
}
.cut-volume output {
  width: 38px;
}
.cut-clip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.cut-clip-actions .btn {
  font-size: 12px;
  min-height: 40px;
  padding: 8px 12px;
}
.cut-clip-actions details {
  width: 100%;
  font-size: 13px;
  margin-top: 6px;
}
.cut-clip-actions details > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.cut-inspector > p {
  font-size: 11px;
  margin-top: 12px;
}
.cut-export {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
}
.cut-export > div {
  flex: 1;
  min-width: 190px;
}
.cut-export p {
  font-size: 12px;
  max-width: 56ch;
  margin: 5px 0;
}
.cut-export progress {
  width: 100%;
  accent-color: #ee4d83;
}
.cut-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cut-result p {
  font-size: 12px;
}
.cut-project-tools {
  margin-top: 20px;
  font-size: 13px;
}
.cut-project-tools > div {
  margin-top: 12px;
}
.cut-project-tools p {
  font-size: 12px;
}
.episode-editor summary {
  cursor: pointer;
  min-height: 32px;
  padding: 6px 0;
}
.episode-editor [hidden] {
  display: none !important;
}
.episode-editor #cutMessage {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
.cut-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.cut-player .sr-only {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@media (max-width: 760px) {
  .episode-editor {
    padding: 16px !important;
    margin: 16px 0;
  }
  .cut-heading {
    display: block;
  }
  .cut-heading h3 {
    font-size: 1.5rem;
  }
  .cut-heading > .field {
    margin-top: 16px;
  }
  .cut-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .cut-player canvas {
    height: 240px;
    max-height: 36vh;
  }
  .cut-player {
    padding: 10px 14px;
  }
  .cut-toolbar {
    gap: 8px;
  }
  .cut-toolbar .btn {
    font-size: 12px;
    padding: 10px 12px;
    min-height: 44px;
  }
  .cut-save {
    margin-left: 0;
    flex: 1;
  }
  .cut-trim {
    grid-template-columns: 1fr 1fr;
  }
  .cut-trim > .btn {
    grid-column: 1/-1;
  }
  .cut-export > .btn {
    width: 100%;
    min-height: 48px;
  }
  .cut-sequence {
    min-height: 132px;
  }
  .cut-volume {
    font-size: 12px;
  }
  .cut-heading p {
    font-size: 14px;
  }
  .cut-tile {
    flex-basis: 116px;
  }
}

.cut-result video {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #100b19;
  border-radius: 10px;
  margin: 12px 0;
}

/* Empty and populated previews share the same portrait viewport. */
.cut-portrait {
  position: relative;
  width: 100%;
  max-width: 203px;
  aspect-ratio: 9/16;
  margin: auto;
}
.cut-portrait #cutCanvas {
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
}
.cut-empty-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  text-align: center;
  border: 1px dashed #635371;
  border-radius: 8px;
  background: linear-gradient(155deg, #302139, #100b19);
  color: #fff;
}
.cut-empty-preview span,
.cut-empty-phone > span {
  position: absolute;
  top: 14px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #d2c4dc;
}
.cut-empty-preview strong {
  font-size: 18px;
  line-height: 1.4;
}
.cut-empty-preview p {
  font-size: 12px;
  line-height: 1.6;
  color: #d2c4dc;
  margin: 0;
}
.cut-empty {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}
.cut-empty-phone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 12px;
  width: 150px;
  aspect-ratio: 9/16;
  flex-shrink: 0;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--soft, var(--surface2));
  padding: 16px;
}
.cut-empty-phone > span {
  color: var(--muted);
}
.cut-empty-phone strong {
  font-size: 16px;
  line-height: 1.4;
}
.cut-empty-phone p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.cut-empty > div:last-child {
  flex: 1;
  min-width: 160px;
}
.cut-tile-picture {
  width: 54px;
  height: auto;
  aspect-ratio: 9/16;
  margin: 0 auto 8px;
}
.cut-result video {
  width: auto;
  max-width: 100%;
  height: 360px;
  aspect-ratio: 9/16;
  margin: 12px auto;
}
@media (max-width: 760px) {
  .cut-portrait {
    max-width: 158px;
  }
  .cut-empty {
    padding: 16px;
    gap: 18px;
  }
  .cut-result video {
    height: 280px;
  }
}

/* studio-visual.css */
.visual-workspace {
  margin: 24px 0;
  min-width: 0;
  color: var(--text);
}
.visual-intro {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(130deg, var(--surface2), var(--surface));
}
.visual-intro h3 {
  font-size: clamp(22px, 3vw, 30px);
  margin: 8px 0;
}
.visual-intro p {
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.6;
}
.visual-card {
  margin: 20px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  min-width: 0;
}
.visual-card h3 {
  margin: 0 0 12px;
}
.visual-card h4 {
  font-size: 18px;
  margin: 0 0 16px;
}
.visual-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.visual-reference-grid > section {
  min-width: 0;
}
.visual-versions {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 0 18px;
  max-width: 100%;
}
.visual-version {
  flex: 0 0 145px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.visual-version img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: contain;
  background: #0d0913;
  border-radius: 8px;
}
.visual-version figcaption {
  font-size: 12px;
  padding: 8px 0;
  color: var(--muted);
}
.visual-version .btn {
  font-size: 12px;
  white-space: normal;
  width: 100%;
  padding: 10px;
}
.visual-version.is-approved {
  border-color: #ed4c8f;
  background: color-mix(in srgb, var(--pink) 8%, var(--surface));
}
.visual-approved-frame,
.visual-clip video {
  display: block;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 9/16;
  object-fit: contain;
  border-radius: 12px;
  background: #09070d;
}
.visual-empty-frame {
  padding: 35px 15px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  text-align: center;
}
.visual-card fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 0 0 16px;
}
.visual-card legend {
  font-size: 13px;
}
.visual-check {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  margin: 8px 0;
}
.visual-check input {
  width: auto;
  flex: 0 0 auto;
}
.visual-card textarea {
  min-height: 90px;
  width: 100%;
  box-sizing: border-box;
}
.visual-card .btn {
  white-space: normal;
  max-width: 100%;
}
.visual-error {
  padding: 14px;
  border: 1px solid #ff7f94;
  border-radius: 10px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.visual-job {
  padding: 12px;
  background: var(--surface2);
  border-radius: 10px;
}
.visual-clip {
  margin-top: 20px;
}
.visual-clip button {
  margin-top: 10px;
}
.visual-crop-dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  width: min(460px, calc(100vw - 32px));
  max-height: 90dvh;
  overflow: auto;
  box-sizing: border-box;
}
.visual-crop-dialog::backdrop {
  background: #000b;
}
.visual-crop-dialog p {
  line-height: 1.5;
  color: var(--muted);
}
.visual-crop-preview {
  position: relative;
  width: min(220px, 100%);
  aspect-ratio: 9/16;
  overflow: hidden;
  margin: 16px auto;
  background: #000;
}
.visual-crop-preview img {
  position: absolute;
  top: 0;
  width: 118.518519%;
  max-width: none;
  height: 100%;
}
.visual-crop-dialog input {
  width: 100%;
}
.image-first-studio .legacy-paid-control {
  display: none;
}
@media (max-width: 700px) {
  .visual-reference-grid {
    grid-template-columns: 1fr;
  }
  .visual-card,
  .visual-intro {
    padding: 16px;
  }
  .visual-reference-grid > section + section {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .visual-crop-dialog {
    padding: 16px;
  }
  .visual-crop-preview {
    max-height: 45dvh;
    width: auto;
    height: 45dvh;
    max-width: 100%;
    aspect-ratio: 9/16;
  }
  .visual-approved-frame {
    max-width: 180px;
  }
}

.visual-intro a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.visual-workspace .field {
  display: block;
  margin: 14px 0;
}
.visual-workspace .field > span {
  display: block;
  margin-bottom: 8px;
}
.visual-workspace textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
}

/* story-writing.css */
.story-writing {
  padding: 22px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  min-width: 0;
}
.story-writing [hidden] {
  display: none !important;
}
.writing-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.writing-intro h3 {
  font-size: 1.3rem;
  margin: 8px 0;
}
.writing-intro p,
#writingStatus,
#writingCostHelp {
  color: var(--muted);
  line-height: 1.6;
  margin: 8px 0;
}
.writing-intro > .btn {
  flex-shrink: 0;
}
#writingQuote {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--pink);
  border-radius: 14px;
  background: var(--surface2);
}
.writing-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}
#writingDraftActions {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
#writingDraftActions .field {
  flex: 1;
  min-width: 0;
}
.writing-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}
#writingMessage {
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
  color: var(--muted);
}
#writingMessage[data-error='true'] {
  color: #d33;
}
#writingRefresh {
  font-size: 0.78rem;
  flex-shrink: 0;
  padding: 9px 12px;
}
#writingReviewDialog {
  width: min(820px, calc(100% - 24px));
  max-height: 90dvh;
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
}
#writingReviewDialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
.writing-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.writing-review-head h2 {
  font-size: 1.8rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 6px 0;
}
#writingReviewDialog > p {
  line-height: 1.6;
  color: var(--muted);
}
.writing-review-fields {
  display: grid;
  gap: 18px;
}
.writing-review-fields textarea {
  width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  line-height: 1.6;
  resize: vertical;
}
.writing-review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  align-items: start;
}
.writing-review-actions details {
  width: 100%;
}
.writing-review-actions summary {
  font-size: 0.9rem;
  cursor: pointer;
  padding: 12px 0;
  min-height: 24px;
}
@media (max-width: 650px) {
  .story-writing {
    padding: 18px;
  }
  .writing-intro,
  .writing-status-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .writing-intro > .btn {
    width: 100%;
  }
  .writing-actions > .btn {
    flex: 1;
  }
  .writing-status-row #writingRefresh {
    align-self: flex-start;
  }
  .writing-review-actions > .btn {
    width: 100%;
  }
  #writingReviewDialog {
    padding: 18px;
    max-height: 94dvh;
  }
  .writing-review-head h2 {
    font-size: 1.45rem;
  }
  .writing-review-head .btn {
    padding: 10px;
  }
}

/* studio-journey.css */
/* Episode-first workspace. Shared tokens keep both themes consistent. */
.project-picker {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 12px;
}
.project-picker select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.sidebar .nav-item {
  font-size: 13px;
  min-height: 42px;
}
.side-label {
  font-size: 11px;
}
.sidebar .side-episodes {
  flex: none;
}
.episode-number {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 23px;
}
.library-menu summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 10px;
  font-size: 14px;
}
.library-menu summary span {
  float: right;
  color: var(--muted);
}
.library-menu .nav-item {
  padding-left: 15px;
}
.side-bottom {
  padding-top: 16px;
}
.flow-title {
  margin: 12px 0 20px;
}
.flow-title h2 {
  font-size: 28px;
  line-height: 1.2;
}
.flow-title p,
.world-card p,
.shot-copy p,
.flow-callout p {
  font-size: 14px;
  line-height: 1.65;
}
.flow-form label,
.review-lines,
.flow-actions .primary,
.flow-form .flow-actions button {
  font-size: 14px;
}
.flow-form input:not([type='checkbox']),
.flow-form textarea,
.flow-form select {
  font-size: 16px;
  line-height: 1.6;
}
.field-note {
  font-size: 12px;
  line-height: 1.6;
}
.entry-modes b {
  font-size: 14px;
}
.entry-modes span {
  font-size: 12px;
}
.entry-modes button {
  min-height: 76px;
}
.plan-details summary {
  font-size: 14px;
  padding: 10px 0;
  cursor: pointer;
}
.plan-details[open] summary {
  margin-bottom: 14px;
}
.episode-stages {
  display: flex;
  gap: 0;
  justify-content: space-between;
  overflow-x: auto;
}
.episode-stages button {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
}
.episode-stages button span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
}
.episode-stages button[aria-current] span {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}
.series-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 30px;
}
.series-actions button {
  font-size: 14px;
  min-height: 42px;
}
.episode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: 18px;
}
.episode-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}
.episode-card h3 {
  font-size: 22px;
}
.episode-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.episode-card > button {
  align-self: start;
  margin-top: auto;
}
.episode-readiness {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.episode-readiness span {
  background: var(--soft);
  border-radius: 6px;
  padding: 5px 8px;
}
.world-card .flow-actions button,
.shot-copy .flow-actions button {
  font-size: 13px;
  min-height: 40px;
}
.review-lines b {
  font-size: 12px;
}
.reference-chips span {
  font-size: 12px;
}
.script-metrics {
  font-size: 12px;
}
.episode-switch {
  font-size: 12px;
  max-width: 240px;
}
.episode-switch select {
  font-size: 14px;
  min-height: 42px;
}
.flow-empty p {
  font-size: 15px;
}
.message-text {
  font-size: 15px;
  line-height: 1.7;
}
.composer-note {
  font-size: 12px;
}
.studio-tools {
  --surface2: var(--soft);
  padding: 20px;
  min-height: 0;
  overflow: auto;
  flex: 1;
}
.studio-tools[hidden],
.studio-tools [hidden],
.studio-tools .hidden {
  display: none !important;
}
.studio-tools[data-tool='assembly'] #sceneImages,
.studio-tools[data-tool='production'] #episodeEditor {
  display: none;
}
.studio-tools .v3-head:empty {
  display: none;
}
.studio-tools .v3-head h2 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.studio-tools .v3-head p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
  margin-bottom: 20px;
}
.studio-tools .eyebrow {
  margin-bottom: 8px;
}
.studio-tools .btn,
.studio-tools .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  font: inherit;
  font-size: 14px;
  padding: 10px 15px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.studio-tools .btn.primary {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}
.studio-tools button:disabled {
  opacity: 0.5;
  cursor: default;
}
.studio-tools .text-link {
  padding: 0;
  min-height: auto;
  color: var(--accent);
  border: 0;
  background: none;
}
.studio-tools .muted {
  color: var(--muted);
  line-height: 1.6;
}
.studio-tools .v3-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 22px;
}
.studio-tools .episode-editor {
  margin: 0;
}
.studio-tools .field {
  display: grid;
  gap: 7px;
  font-size: 14px;
  margin-bottom: 16px;
}
.studio-tools input:not([type='checkbox']):not([type='range']),
.studio-tools textarea,
.studio-tools select {
  width: 100%;
  min-width: 0;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 16px;
}
.studio-tools .v3-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.studio-tools .hero-actions,
.studio-tools .v3-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.studio-tools .v3-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 20px;
}
.studio-tools .v3-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.studio-tools .v3-help h3 {
  margin-bottom: 16px;
}
.studio-tools #publishMsg {
  margin-top: 18px;
  line-height: 1.6;
  font-size: 14px;
}
.studio-tools .visual-workspace {
  margin: 0;
}
.studio-tools .visual-intro h3 {
  font-size: 26px;
}
.studio-tools .visual-card h3 {
  font-size: 21px;
}
.studio-tools #characterList {
  display: none;
}
.studio-tools #saved-story-bible {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}
.studio-tools #saved-story-bible p {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin-top: 10px;
}
.studio-tools #saved-story-bible section {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
@media (max-width: 1100px) {
  .studio-tools .v3-grid {
    grid-template-columns: 1fr;
  }
  .studio-tools .v3-help {
    display: block;
  }
}
@media (max-width: 700px) {
  .content,
  .studio-tools {
    padding: 16px;
  }
  .flow-title h2 {
    font-size: 25px;
  }
  .entry-modes {
    gap: 8px;
  }
  .entry-modes button {
    padding: 12px 9px;
  }
  .entry-modes b {
    font-size: 13px;
  }
  .entry-modes span {
    font-size: 11px;
  }
  .episode-stages {
    width: 100%;
  }
  .episode-stages button {
    font-size: 13px;
    padding: 10px 5px;
    gap: 4px;
    min-width: 0;
  }
  .episode-stages button span {
    display: none;
  }
  #flow-navigation {
    padding: 0 12px;
  }
  .flow-form {
    padding: 17px;
  }
  .flow-form .flow-actions button {
    font-size: 13px;
  }
  .flow-title p {
    font-size: 14px;
  }
  .project-heading {
    min-height: 55px;
  }
  .project-heading h1 {
    font-size: 17px;
  }
  .project-heading p:last-child {
    font-size: 12px;
  }
  .world-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  .world-card > img {
    width: 80px;
    height: 120px;
  }
  .world-card h3 {
    font-size: 19px;
  }
  .world-card .flow-actions {
    grid-column: 1/-1;
  }
  .world-placeholder {
    width: 80px;
  }
  .series-actions {
    gap: 8px;
  }
  .series-actions button {
    flex: 1;
    min-width: 130px;
    font-size: 13px;
  }
  .studio-tools .v3-two {
    grid-template-columns: 1fr;
  }
  .studio-tools .v3-card {
    padding: 16px;
  }
  .studio-tools .v3-head h2 {
    font-size: 25px;
  }
  .flow-actions button {
    min-height: 42px;
  }
  .world-card p {
    font-size: 13px;
  }
  .world-card .field-note {
    font-size: 12px;
  }
  .episode-switch {
    max-width: 100%;
  }
}

.release-destinations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0 24px;
}
.release-destinations article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.release-destinations h3 {
  font-size: 18px;
  margin-bottom: 10px;
}
.release-destinations p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 14px;
}
@media (max-width: 700px) {
  .release-destinations {
    grid-template-columns: 1fr;
  }
}

.studio-tools .cut-heading > .field {
  display: none;
}
@media (max-width: 700px) {
  .project-heading p:last-child {
    display: block !important;
    font-size: 12px;
    margin-top: 5px;
  }
}

/* studio-chat.css */
/* Conversation is the primary canvas; the library holds only saved work. */
.chat-primary {
  font-weight: 700;
  border: 1px solid var(--line);
  min-height: 46px;
}
.saved-library .side-label {
  margin-top: 4px;
}
.production-menu {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.production-menu summary {
  cursor: pointer;
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
}
.production-menu summary span {
  float: right;
}
.chat-stage {
  max-width: 880px;
  margin-inline: auto;
  padding-bottom: 20px;
}
.chat-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 28px;
}
.chat-heading h2 {
  font-size: 19px;
}
.chat-heading p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
.chat-welcome {
  padding: 24px 0 40px;
  max-width: 680px;
}
.chat-welcome > p {
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 26px;
}
.chat-starters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.chat-starters button {
  display: flex;
  justify-content: space-between;
  text-align: left;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}
.chat-starters span {
  color: var(--pink);
}
.chat-draft {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 20px;
  margin: 15px 0;
}
.draft-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 14px;
}
.chat-draft h3 {
  font-size: 20px;
  margin-bottom: 14px;
}
.draft-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.75;
  max-height: 420px;
  overflow: auto;
}
.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.draft-shots {
  padding-left: 23px;
  font-size: 13px;
  max-height: 360px;
  overflow: auto;
}
.draft-shots li {
  padding: 10px 0;
}
.draft-shots p {
  color: var(--muted);
}
.text-button {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
  font-size: 12px;
  min-height: 38px;
}
.chat-quote,
.chat-error {
  border: 1px solid var(--line);
  border-left: 3px solid var(--pink);
  background: var(--surface);
  border-radius: 12px;
  padding: 18px;
  margin: 20px 0;
}
.chat-quote p,
.chat-error p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0 14px;
}
.chat-progress {
  padding: 20px;
  color: var(--accent);
  font-size: 14px;
}
.earlier {
  display: block;
  margin: 0 auto 22px;
}
.asset-open {
  padding: 0;
  display: block;
  text-align: left;
  width: 100%;
}
.library-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.project-heading > .subtle-button {
  margin-left: auto;
  white-space: nowrap;
}
.composer-wrap {
  max-width: 940px;
  width: 100%;
  align-self: center;
}
.context-strip:empty {
  display: none;
}
.composer textarea {
  min-height: 65px !important;
  font-size: 15px !important;
}
.composer .text-button {
  font-size: 12px;
}
.chat-stage .message {
  max-width: 100%;
}
.chat-stage .message.user {
  max-width: 80%;
}
.chat-stage .message-text {
  font-size: 15px;
}
.chat-stage .message-meta {
  font-size: 11px;
}
.chat-stage .message.user {
  margin-top: 20px;
}
body[data-view='chat'] .project-heading {
  border-bottom: 1px solid var(--line);
}
.composer-note {
  font-size: 11px !important;
}
@media (max-width: 700px) {
  .chat-heading {
    margin: 16px 0;
  }
  .chat-heading p {
    font-size: 12px;
  }
  .chat-welcome {
    padding: 12px 0 20px;
  }
  .chat-welcome > p {
    font-size: 17px;
  }
  .chat-starters {
    grid-template-columns: 1fr 1fr;
  }
  .chat-starters button {
    padding: 13px;
    font-size: 13px;
  }
  .chat-draft {
    padding: 15px;
  }
  .chat-draft h3 {
    font-size: 18px;
  }
  .chat-stage .message.user {
    max-width: 94%;
  }
  .chat-stage .message-text,
  .draft-content {
    font-size: 14px;
  }
  .draft-actions .primary {
    width: 100%;
  }
  .composer-note {
    font-size: 10px !important;
  }
  .composer textarea {
    min-height: 52px !important;
  }
  .project-heading > .subtle-button {
    font-size: 11px;
    padding: 6px;
  }
  .draft-heading {
    flex-wrap: wrap;
  }
  .asset-grid {
    grid-template-columns: 1fr;
  }
  .chat-stage {
    padding-bottom: 8px;
  }
}
body[data-view='chat'] .content {
  scroll-behavior: auto;
}
.composer-wrap {
  flex-shrink: 0;
}
/* Images remain inside the conversation, with a separate explicit cost confirmation. */
.chat-images {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: 24px;
  margin: 24px 0;
  scroll-margin-top: 20px;
}
.chat-images header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.chat-images h3 {
  font-size: 23px;
  margin: 8px 0;
}
.chat-images header p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 540px;
}
.image-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
}
.image-field select,
.image-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  font-size: 14px;
  padding: 12px;
  resize: vertical;
}
.image-notes {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.chat-images .field-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 12px 0;
}
.image-cost {
  border: 1px solid var(--pink);
  border-radius: 12px;
  padding: 18px;
  margin: 20px 0;
  background: var(--bg);
}
.image-cost p {
  font-size: 13px;
  line-height: 1.6;
  margin: 10px 0;
  color: var(--muted);
}
.image-progress,
.image-error {
  font-size: 14px;
  line-height: 1.6;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 14px 0;
}
.image-error {
  border-color: var(--pink);
}
.chat-image-versions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 220px));
  gap: 16px;
  margin-top: 24px;
}
.chat-image-version {
  margin: 0;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 220px;
  background: var(--bg);
}
.chat-image-version.is-selected {
  border-color: var(--pink);
}
.chat-image-version img {
  display: block;
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface);
}
.chat-image-version figcaption {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 12px 0;
  font-size: 13px;
}
.chat-image-version figcaption span {
  color: var(--muted);
  font-size: 11px;
}
.chat-image-version > .primary,
.chat-image-version > .subtle-button {
  width: 100%;
  font-size: 12px;
}
.image-unavailable {
  aspect-ratio: 2/3;
  display: grid;
  place-items: center;
  padding: 15px;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 700px) {
  .chat-images {
    padding: 16px;
  }
  .chat-images h3 {
    font-size: 20px;
  }
  .image-notes {
    grid-template-columns: 1fr;
  }
  .image-field select,
  .image-field textarea {
    font-size: 16px;
  }
  .image-actions > .primary,
  .image-actions > .subtle-button {
    width: 100%;
  }
  .chat-image-versions {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .chat-image-version {
    padding: 7px;
  }
  .chat-image-version > .primary,
  .chat-image-version > .subtle-button {
    font-size: 11px;
    padding: 10px 6px;
  }
  .chat-images header {
    gap: 4px;
  }
  .chat-images .eyebrow {
    font-size: 10px;
  }
}

.image-settings {
  margin: 16px 0;
}
.image-settings summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
}

/* Shot planning uses the same theme and controls as the conversation. */
#shot-plan-editor {
  width: min(760px, calc(100vw - 24px));
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: var(--surface);
  color: var(--text);
}
#shot-plan-editor::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
#shot-plan-editor form > label,
.shot-plan-row > label,
.shot-plan-timing > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
  font-size: 13px;
}
#shot-plan-editor input:not([type='checkbox']),
#shot-plan-editor textarea,
#shot-plan-editor select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}
.shot-plan-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 24px 0;
  padding: 16px;
  min-width: 0;
}
.shot-plan-row > legend {
  font-weight: 700;
  padding: 0 8px;
}
.shot-plan-timing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 16px;
}
.shot-plan-refs {
  border: 0;
  padding: 0;
  margin: 10px 0;
  min-width: 0;
}
.shot-plan-refs label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}
.shot-plan-refs small {
  color: var(--muted);
}
.shot-plan-refs input {
  accent-color: var(--pink);
}
#shot-plan-editor .field-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
#shot-plan-editor [role='alert'] {
  color: var(--pink);
  margin: 12px 0;
}
.chat-reference-gaps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
@media (max-width: 700px) {
  #shot-plan-editor {
    padding: 16px;
  }
  #shot-plan-editor input:not([type='checkbox']),
  #shot-plan-editor textarea,
  #shot-plan-editor select {
    font-size: 16px;
  }
  .shot-plan-row {
    padding: 12px;
  }
  .shot-plan-timing {
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 10px;
  }
  .chat-next > div:last-child {
    flex-wrap: wrap;
  }
}

#shot-plan-editor .dialog-head {
  position: sticky;
  top: -24px;
  z-index: 2;
  background: var(--surface);
  padding-block: 16px;
  margin-top: -16px;
}
@media (max-width: 700px) {
  #shot-plan-editor .dialog-head {
    top: -16px;
  }
}

/* studio-empty-states.css */
/* Shared portrait frames and actionable empty states, in both Studio themes. */
.portrait-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 9/16;
  width: 100%;
  min-width: 0;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: linear-gradient(155deg, var(--selected), var(--soft) 72%);
  color: var(--text);
  overflow: hidden;
  text-align: center;
}
.portrait-format {
  position: absolute;
  left: 12px;
  top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.portrait-placeholder-body {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  padding: 18px 12px;
  width: 100%;
  min-width: 0;
}
.portrait-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 24px;
  font-weight: 400;
}
.portrait-placeholder strong {
  font-size: 14px;
  line-height: 1.4;
  max-width: 15ch;
  overflow-wrap: anywhere;
}
.portrait-placeholder small {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 20ch;
}
.folder-introduction {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 65ch;
  margin: 8px 0 0;
}
.asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  align-items: stretch;
}
.asset-start-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.asset-start-preview {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  width: 160px;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  color: inherit;
  cursor: pointer;
}
.asset-start-preview:hover .portrait-placeholder {
  border-color: var(--accent);
}
.asset-start-preview:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.asset-start-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
}
.asset-start-copy h3 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}
.asset-start-copy p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}
.asset-start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.asset-start-actions button,
.asset-start-copy > button {
  min-height: 44px;
  font-size: 12px;
}
.library-card .asset-open > .asset-thumb,
.library-card .asset-open > .portrait-placeholder {
  display: block;
  width: 160px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 9/16;
  margin: 0 auto 18px;
  border-radius: 14px;
  object-fit: contain;
  background: var(--soft);
}
.library-card .asset-open > .portrait-placeholder {
  display: flex;
}
.library-card .asset-open h3 {
  overflow-wrap: anywhere;
}
.asset-result-top > .portrait-placeholder {
  width: 60px;
  flex: 0 0 60px;
}
.asset-result-top > .portrait-placeholder .portrait-format,
.asset-result-top > .portrait-placeholder strong,
.asset-result-top > .portrait-placeholder small {
  display: none;
}
.asset-result-top > .portrait-placeholder .portrait-placeholder-body {
  padding: 4px;
}
.inspector-placeholder {
  width: 180px;
  max-width: 100%;
  margin: 20px auto;
}
.inspector-image img {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 9/16;
  object-fit: contain;
  margin: auto;
  background: var(--soft);
}
.world-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}
.world-card,
.world-grid > .asset-start-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.world-card > img,
.world-card > .portrait-placeholder {
  width: 112px;
  height: auto;
  aspect-ratio: 9/16;
  object-fit: contain;
  border-radius: 12px;
  background: var(--soft);
}
.world-grid .asset-start-preview {
  width: 112px;
}
.world-card > .portrait-placeholder .portrait-format {
  top: 8px;
  left: 8px;
}
.world-card .portrait-placeholder-body {
  padding: 16px 8px;
}
.world-card .portrait-placeholder strong {
  font-size: 12px;
}
.episode-cards {
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
}
.episode-card > .portrait-placeholder {
  width: 160px;
  max-width: 100%;
  margin: 0 auto 4px;
  flex-shrink: 0;
}
.episode-card h3 {
  font-size: 19px;
  overflow-wrap: anywhere;
}
.episode-start-card {
  border-style: dashed;
}
.shot-card,
.shot-grid > .shot-start-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.shot-card .shot-visual {
  display: block;
  height: auto;
  aspect-ratio: 9/16;
  width: 112px;
  padding: 0;
  background: none;
  border-radius: 12px;
}
.shot-visual > .portrait-placeholder {
  height: 100%;
}
.shot-card .shot-copy {
  padding: 0;
  min-width: 0;
}
.shot-grid .asset-start-preview {
  width: 112px;
}
.first-project-empty {
  display: grid;
  grid-template-columns: 180px minmax(0, 400px);
  gap: 32px;
  align-items: center;
  padding: 24px 0;
}
.first-project-empty p {
  color: var(--muted);
  line-height: 1.7;
  margin: 16px 0 24px;
}
@media (max-width: 700px) {
  .asset-grid {
    grid-template-columns: 1fr;
  }
  .asset-start-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }
  .asset-start-preview {
    width: 104px;
  }
  .asset-start-copy h3 {
    font-size: 17px;
  }
  .asset-start-actions {
    gap: 6px;
    flex-direction: column;
    width: 100%;
  }
  .asset-start-actions button {
    width: 100%;
    min-height: 44px;
  }
  .world-card,
  .world-grid > .asset-start-card {
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 14px;
    gap: 14px;
  }
  .world-card > img,
  .world-card > .portrait-placeholder,
  .world-grid .asset-start-preview {
    width: 96px;
  }
  .world-card .flow-actions button {
    font-size: 12px;
    min-height: 44px;
  }
  .portrait-placeholder strong {
    font-size: 12px;
  }
  .portrait-placeholder small {
    font-size: 10px;
  }
  .portrait-placeholder-body {
    gap: 7px;
    padding: 24px 7px 10px;
  }
  .portrait-format {
    left: 8px;
    top: 8px;
    font-size: 9px;
  }
  .portrait-symbol {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }
  .shot-card,
  .shot-grid > .shot-start-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }
  .shot-card .shot-visual,
  .shot-grid .asset-start-preview {
    width: 96px;
  }
  .first-project-empty {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .first-project-empty > .portrait-placeholder {
    width: 160px;
    margin: auto;
  }
}
.shot-visual > .portrait-placeholder {
  opacity: 1;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}
.shot-visual .portrait-placeholder small {
  position: static;
  letter-spacing: normal;
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 11px;
}
.chat-image-version img,
.image-unavailable,
.studio-tools .visual-version img {
  aspect-ratio: 9/16;
  object-fit: contain;
}

/* studio-connected.css */
.chat-next {
  margin: 20px 0 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.chat-next strong {
  display: block;
  margin-top: 5px;
}
.chat-next p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.chat-next > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.chat-journey {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.chat-journey button {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.78rem;
}
.scene-plan-list {
  display: grid;
  gap: 16px;
}
.scene-plan-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.scene-plan-card > p {
  white-space: pre-wrap;
  color: var(--muted);
}
.reference-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.reference-slots article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  min-width: 0;
}
.reference-slot-image {
  aspect-ratio: 9/16;
  display: grid;
  place-items: center;
  background: var(--surface2);
  border-radius: 8px;
  overflow: hidden;
}
.reference-slot-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.reference-slots strong,
.reference-slots small {
  display: block;
  margin-top: 6px;
}
.reference-slots small,
.reference-library > p,
.reference-versions small {
  color: var(--muted);
  font-size: 0.78rem;
}
.reference-slots button {
  font-size: 0.75rem;
  text-align: left;
}
.reference-library details {
  margin-top: 14px;
}
.reference-versions article {
  display: grid;
  grid-template-columns: 65px minmax(0, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.reference-versions img {
  width: 65px;
  aspect-ratio: 9/16;
  object-fit: contain;
  border-radius: 8px;
}
.reference-versions b,
.reference-versions small,
.reference-versions button {
  display: block;
}
.spend-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.spend-summary > div {
  padding: 15px;
  background: var(--surface2);
  border-radius: 12px;
}
.spend-summary strong {
  display: block;
  font-size: 1.5rem;
}
.spend-summary small {
  color: var(--muted);
}
.spend-ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.spend-ledger td,
.spend-ledger th {
  text-align: left;
  padding: 10px 5px;
  border-bottom: 1px solid var(--line);
}
.spend-ledger td:last-child {
  text-align: right;
}
.workspace-tabs.episode-stages {
  overflow-x: auto;
  flex-wrap: nowrap;
}
.workspace-tabs.episode-stages button {
  white-space: nowrap;
}
@media (max-width: 1000px) {
  .chat-next {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .chat-next > div:last-child {
    flex-shrink: 1;
  }
}

.release-kit {
  padding: 20px 0 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.release-kit-grid {
  display: grid;
  grid-template-columns: minmax(140px, 230px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.release-phone {
  aspect-ratio: 9/16;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.release-phone video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.release-phone .portrait-placeholder {
  height: 100%;
  padding: 16px;
  box-sizing: border-box;
}
.release-kit form {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.release-kit label {
  display: grid;
  gap: 6px;
}
.release-kit input,
.release-kit textarea,
.release-kit select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.release-destination-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.release-destination-list span {
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: 20px;
  font-size: 0.8rem;
}
.release-plan {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.release-plan p {
  color: var(--muted);
}
.release-episode-row {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  display: grid;
  gap: 8px;
}
.release-episode-row > label:first-child {
  display: flex;
  gap: 10px;
  align-items: start;
}
.release-episode-row input[type='checkbox'] {
  width: auto;
  margin-top: 5px;
}
.release-episode-row small {
  display: block;
  color: var(--muted);
}
@media (max-width: 700px) {
  .release-kit-grid {
    grid-template-columns: 1fr;
  }
  .release-phone {
    width: 150px;
    justify-self: center;
  }
  .release-kit {
    padding-top: 0;
  }
}

.library-filter {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}
.library-filter label {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.library-filter label:first-child {
  flex: 1;
  min-width: 160px;
}
.library-filter input,
.library-filter select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  min-height: 44px;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
.library-count {
  font-size: 0.8rem;
  color: var(--muted);
}
.manual-route {
  font-size: 0.8rem;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
}
.caption-heading h3 {
  margin: 0;
}
.caption-heading p {
  color: var(--muted);
  font-size: 0.85rem;
}
.caption-rows {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.caption-rows fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.caption-rows legend {
  font-size: 0.85rem;
  color: var(--muted);
}
.caption-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.caption-rows label {
  font-size: 0.85rem;
}
.caption-editor [role='status'] {
  font-size: 0.85rem;
  color: var(--muted);
}
.caption-advanced {
  font-size: 0.85rem;
}
.caption-advanced label {
  margin-top: 12px;
}
.release-phone {
  position: relative;
}
.caption-preview {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 18%;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  text-align: center;
  padding: 5px;
  border-radius: 5px;
  font-size: 0.85rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.caption-preview[hidden] {
  display: none;
}
@media (max-width: 700px) {
  .library-filter label {
    flex: 1;
    min-width: 135px;
  }
  .caption-times input {
    min-width: 0;
  }
  .caption-rows .flow-actions button {
    min-height: 44px;
  }
  .release-phone:has(video) {
    width: min(100%, 230px);
  }
  .manual-route {
    gap: 2px;
  }
  .caption-preview {
    font-size: 0.8rem;
  }
}

@media (min-width: 701px) {
  .release-phone {
    position: sticky;
    top: 0;
  }
}

/* studio-onboarding.css */
.story-start {
  width: min(880px, 100%);
  margin: 12px auto 0;
}
.story-start .chat-heading {
  margin-bottom: 38px;
}
.story-start-intro h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  margin: 12px 0;
}
.story-start-intro > p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
}
.story-start-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 14px;
}
.story-start-modes button {
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 18px;
  cursor: pointer;
  min-width: 0;
}
.story-start-modes button.active {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px var(--pink);
  background: var(--soft);
}
.story-start-modes strong {
  font-size: 16px;
}
.story-start-modes button > span:last-child {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.start-symbol {
  font-size: 24px;
  color: var(--pink);
}
.story-start-details {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 16px;
}
.story-start-details summary {
  cursor: pointer;
  font-size: 14px;
}
.story-start-details summary span {
  color: var(--muted);
  margin-left: 8px;
}
.story-start-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}
.story-start-fields label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.story-start-fields input,
.story-start-fields select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.story-start-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px;
}
.start-side-note {
  font-size: 13px;
  line-height: 1.6;
  padding: 0 8px;
  color: var(--muted);
}
#start-status {
  font-size: 14px;
  line-height: 1.5;
  min-height: 24px;
  margin-top: 14px;
}
.starting-series .composer {
  align-items: flex-end;
  flex-wrap: wrap;
}
.starting-series .composer textarea {
  flex-basis: 100%;
  min-height: 64px;
  max-height: 160px;
}
.starting-series .send {
  margin-left: auto;
  width: auto;
  padding: 10px 16px;
  height: auto;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}
.starting-series .composer-wrap {
  width: min(920px, 100%);
  margin: 0 auto;
}
.starting-series .composer-note {
  font-size: 11px;
  line-height: 1.5;
}
.starting-series .content {
  padding-bottom: 12px;
}
.starting-series button:focus-visible,
.starting-series summary:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 4px;
}
@media (max-width: 700px) {
  .story-start {
    margin: 0 auto;
  }
  .story-start .chat-heading {
    margin-bottom: 22px;
  }
  .story-start-intro > p {
    font-size: 14px;
  }
  .story-start-modes {
    gap: 7px;
    margin: 20px 0 12px;
  }
  .story-start-modes button {
    padding: 12px 9px;
    border-radius: 10px;
    gap: 7px;
  }
  .story-start-modes strong {
    font-size: 13px;
  }
  .story-start-modes button > span:last-child {
    font-size: 11px;
  }
  .start-symbol {
    font-size: 21px;
  }
  .story-start-fields {
    grid-template-columns: 1fr;
  }
  .story-start-fields input,
  .story-start-fields select {
    font-size: 16px;
  }
  .story-start-footer {
    font-size: 11px;
    gap: 6px;
  }
  .starting-series .composer-note {
    display: block;
    font-size: 10px;
  }
  .starting-series .composer textarea {
    min-height: 48px;
  }
  .starting-series .send {
    min-height: 42px;
  }
  .story-start .eyebrow {
    font-size: 10px;
  }
}

.starting-series .credit-button,
.starting-series .avatar {
  display: none;
}
@media (max-height: 650px) {
  .story-start .chat-heading {
    display: none;
  }
  .story-start-intro .eyebrow {
    display: none;
  }
  .story-start-intro h2 {
    font-size: 26px;
    margin: 0 0 8px;
  }
  .story-start-intro > p {
    font-size: 13px;
    margin: 0;
  }
  .story-start-modes {
    margin: 14px 0 10px;
  }
  .story-start-modes button {
    padding: 10px;
  }
  .story-start-modes .start-symbol {
    display: none;
  }
  .starting-series .composer textarea {
    min-height: 40px;
  }
  .story-start-details {
    margin-top: 12px;
    padding-top: 10px;
  }
}

.starting-series .story-start .chat-heading {
  display: none;
}
.starting-series .story-start {
  margin-top: 12px;
}
@media (max-width: 700px) {
  .starting-series .project-heading .project-identity p {
    display: none;
  }
  .starting-series .story-start-intro h2 {
    font-size: 28px;
  }
  .starting-series .story-start-intro > p {
    font-size: 14px;
  }
  .starting-series .story-start-modes {
    margin-top: 18px;
  }
  .starting-series .story-start-footer {
    margin-top: 16px;
  }
  .starting-series .composer textarea {
    font-size: 16px !important;
  }
}

/* studio-preparation.css */
.preparation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}
.preparation-summary button {
  color: var(--accent);
  font-weight: 650;
  min-height: 36px;
  text-align: left;
}
#preparation-dialog {
  width: min(760px, calc(100% - 24px));
  overflow-wrap: anywhere;
}
.preparation-intro {
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}
.preparation-checks {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.preparation-checks li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.preparation-checks li > div {
  min-width: 0;
}
.preparation-checks strong {
  display: inline-block;
  margin: 0 8px 4px 0;
}
.preparation-checks p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.preparation-checks button {
  flex-shrink: 0;
}
.preparation-details,
.studio-help details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}
.preparation-details summary,
.studio-help summary {
  font-weight: 650;
  cursor: pointer;
  min-height: 28px;
}
.preparation-details article {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.preparation-details article:last-child {
  border: 0;
}
.preparation-details article p {
  white-space: pre-wrap;
  margin-top: 10px;
  color: var(--muted);
}
.preparation-impact {
  border-left: 3px solid var(--pink);
  background: var(--soft);
  padding: 14px;
  margin: 14px 0;
  font-size: 13px;
}
.preparation-impact p {
  margin-top: 6px;
}
.preparation-ready {
  background: var(--green-bg);
  color: var(--green);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
#preparation-dialog .preparation-confirm {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.6;
}
#preparation-dialog input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--pink);
}
.studio-help p,
.studio-help li {
  margin: 12px 0;
  color: var(--muted);
}
.studio-help ol {
  padding-left: 22px;
}
.studio-help .subtle-button {
  display: inline-block;
}
.preparation-help {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-weight: 700;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  #preparation-dialog {
    padding: 18px;
  }
  .preparation-checks li {
    gap: 10px;
  }
  .preparation-checks .subtle-button {
    padding: 9px;
  }
  .preparation-summary {
    font-size: 11px;
  }
  .top-actions {
    gap: 6px;
  }
}

#preparation-dialog .dialog-head {
  position: sticky;
  top: -26px;
  background: var(--surface);
  z-index: 2;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) {
  #preparation-dialog .dialog-head {
    top: -18px;
  }
}

/* Practice-mode components */
/* Demo uses the Studio's theme tokens and portrait production surfaces. */
.demo-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  background: var(--selected);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  min-height: 42px;
}
.demo-banner > div {
  display: flex;
  gap: 14px;
  align-items: center;
}
.demo-banner span {
  color: var(--muted);
}
.demo-banner a {
  white-space: nowrap;
  font-weight: 700;
}
.studio-demo {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.studio-demo .topbar {
  flex: none;
}
.studio-demo .workspace {
  flex: 1;
  min-height: 0;
  height: auto;
}
.demo-tools {
  overflow: auto;
}
.demo-tools .flow-title {
  margin-bottom: 22px;
}
.demo-tools p {
  color: var(--muted);
}
.demo-phone {
  position: relative;
  aspect-ratio: 9/16;
  width: 100%;
  max-width: 240px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}
.demo-phone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.demo-phone video {
  width: 100%;
}
.demo-sample-label {
  position: absolute;
  bottom: 0;
  background: #160d24d9;
  color: white;
  padding: 8px;
  width: 100%;
  font-size: 11px;
}
.demo-takes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.demo-take {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  min-width: 0;
}
.demo-take .demo-phone {
  max-width: 170px;
  margin: 0 auto 14px;
}
.demo-take h3 {
  margin-bottom: 8px;
}
.demo-take p {
  font-size: 13px;
}
.demo-take button {
  margin-top: 12px;
}
.demo-upload {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.demo-upload input {
  display: block;
  width: 100%;
  font-size: 11px;
  margin-top: 4px;
}
.demo-editor,
.demo-release {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 26px;
}
.demo-monitor canvas {
  display: block;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 9/16;
  background: #15101d;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 auto;
}
.demo-monitor p {
  font-size: 12px;
  margin: 10px 0;
  text-align: center;
}
.demo-cut-list {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: grid;
  gap: 12px;
}
.demo-cut-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
}
.demo-cut-list li > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.demo-cut-list form {
  display: flex;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}
.demo-cut-list label {
  font-size: 11px;
  flex: 1;
  min-width: 0;
}
.demo-cut-list input {
  display: block;
  width: 100%;
  padding: 7px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.demo-field {
  display: block;
  font-size: 13px;
  margin: 14px 0;
}
.demo-field input,
.demo-field textarea,
.demo-field select {
  display: block;
  width: 100%;
  padding: 11px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.demo-viewer {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  margin-top: 30px;
  padding: 24px;
  display: grid;
  gap: 16px;
  justify-items: center;
}
.demo-viewer .demo-phone {
  max-width: 220px;
}
.demo-references {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.demo-references article {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.demo-references img {
  aspect-ratio: 9/16;
  width: 100%;
  object-fit: contain;
  background: var(--soft);
  border-radius: 12px;
}
.demo-tools .flow-actions {
  flex-wrap: wrap;
}
.demo-tools button:disabled {
  opacity: 0.5;
  cursor: default;
}
@media (max-width: 900px) {
  .demo-takes {
    grid-template-columns: 1fr 1fr;
  }
  .demo-banner > div {
    display: block;
  }
  .demo-banner span {
    display: block;
    font-size: 11px;
  }
  .demo-editor,
  .demo-release {
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .demo-banner {
    padding: 7px 12px;
    font-size: 11px;
  }
  .demo-banner span {
    font-size: 10px;
    max-width: 260px;
  }
  .studio-demo .sidebar.open,
  .studio-demo .inspector.open {
    top: 112px;
  }
  .demo-editor,
  .demo-release {
    grid-template-columns: 1fr;
  }
  .demo-takes {
    grid-template-columns: 1fr;
  }
  .demo-take {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
  }
  .demo-take .demo-phone {
    margin: 0;
  }
  .demo-monitor canvas,
  .demo-release .demo-phone {
    max-width: 190px;
    margin-inline: auto;
  }
  .demo-references {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .demo-cut-list form {
    flex-wrap: wrap;
  }
  .demo-cut-list form label {
    min-width: 70px;
  }
  .demo-tools .flow-title h2 {
    font-size: 23px;
  }
}
