/* ApexFlow — one identity across the workspace, Studio and every overlay. */
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/manrope-400.ttf") format("truetype");
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/manrope-500.ttf") format("truetype");
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/manrope-600.ttf") format("truetype");
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/manrope-700.ttf") format("truetype");
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/manrope-800.ttf") format("truetype");
}
:root {
  --bg: #101114;
  --canvas: #0b0d10;
  --panel: #191b20;
  --raised: #23262c;
  --surface: var(--panel);
  --surface-hover: #2b2f36;
  --line: #32363e;
  --line-soft: #24272e;
  --text: #f3f2ed;
  --muted: #a5a9b3;
  --subtle: #8b929e;
  --accent: #efb865;
  --accent-hover: #f8c982;
  --accent-ink: #251b0d;
  --accent-soft: #efb86514;
  --accent-line: #efb86565;
  --field-focus-border: var(--accent-line);
  --field-focus-ring: 0 0 0 3px var(--accent-soft);
  --success: #8dd5b0;
  --danger: #f2a6a1;
  --warning: #efbf75;
  --radius-sm: 8px;
  --radius-control: 10px;
  --radius-panel: 18px;
  --radius-dialog: 22px;
  --shadow-panel: 0 8px 28px #05080d30;
  --shadow-float: 0 18px 60px #05080d99;
  --sidebar: 224px;
  --dur-fast: 140ms;
  --dur-med: 220ms;
  --dur-slow: 280ms;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-synthesis: none;
  color-scheme: dark;
}
html {
  background: var(--bg);
  scrollbar-color: #4a505c transparent;
  scrollbar-width: thin;
}
body {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.modal-open {
  overflow: hidden;
}
::selection {
  background: #efb86542;
  color: var(--text);
}
input,
textarea {
  caret-color: var(--accent);
}
input::placeholder,
textarea::placeholder {
  color: var(--subtle);
  opacity: 1;
}
h1,
h2,
h3 {
  text-wrap: balance;
  font-weight: 650;
  letter-spacing: -0.035em;
}
p {
  text-wrap: pretty;
}
button,
a {
  -webkit-user-select: none;
  user-select: none;
}
button:hover:not(:disabled) {
  filter: none;
}
button:disabled {
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
main:focus {
  outline: none;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.icon {
  stroke-width: 1.65;
}
.icon-button {
  border-radius: var(--radius-control);
  width: 38px;
  height: 38px;
}
.icon-button:hover {
  background: var(--surface-hover);
}
.primary-button,
.generate-button {
  background: linear-gradient(160deg, var(--accent-hover), var(--accent));
  color: var(--accent-ink);
  border: 1px solid #ffd99b55;
  border-radius: var(--radius-control);
  min-height: 42px;
  font-size: 13px;
  font-weight: 750;
  box-shadow:
    0 3px 12px #efb8650c,
    inset 0 1px 0 #fff4;
  transition:
    box-shadow var(--dur-med) var(--ease-out),
    background var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}
.subtle-button {
  background: var(--raised);
  border-color: var(--line);
  border-radius: var(--radius-control);
  min-height: 40px;
  font-size: 12px;
  font-weight: 600;
}
.subtle-button:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: #454b55;
}
.subtle-button.danger,
.danger {
  color: var(--danger);
}
.text-input,
.modal
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
    [type="file"]
  ),
.modal select,
.modal textarea,
.studio-page textarea,
.studio-page
  input:not([type="checkbox"]):not([type="range"]):not([type="file"]),
.studio-page select,
.studio-page .studio-brief select,
.studio-page .studio-brief input[type="number"],
.studio-create-form .studio-film-name input,
#studio-key,
#ref-prompt {
  background: var(--canvas);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 11px 13px;
  font-size: 13px;
  min-height: 44px;
  transition:
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}
.text-input:focus,
.modal
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
    [type="file"]
  ):focus,
.modal textarea:focus,
.modal select:focus,
.studio-page textarea:focus,
.studio-page
  input:not([type="checkbox"]):not([type="range"]):not([type="file"]):focus,
.studio-page select:focus,
.studio-page .studio-brief select:focus,
#studio-key:focus,
#ref-prompt:focus {
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-ring);
  outline: none;
}
input[type="checkbox"],
input[type="radio"],
input[type="range"] {
  accent-color: var(--accent);
}
.crop-controls input[type="range"] {
  accent-color: var(--accent);
}
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
select option {
  background: var(--panel);
  color: var(--text);
}
.field-label,
.studio-page label,
.studio-create-form .field-label,
.studio-create-form .studio-film-name,
.studio-create-form .studio-workflow-field {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.brand {
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.055em;
}
.brand-light {
  color: var(--text);
  font-weight: 450;
}
.brand-mark {
  display: inline-flex;
  color: var(--accent);
}
.brand-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-mark .icon {
  width: 36px;
  height: 36px;
}
.brand-dialog-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-dialog-heading .brand-logo {
  width: 38px;
  height: 38px;
}
.skip-link {
  position: fixed;
  z-index: 60;
  top: 8px;
  left: 12px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: none;
}
.startup-loading {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  color: var(--muted);
}
.startup-mark {
  display: block;
  width: 72px;
  height: 72px;
}
.loading-track {
  width: 100px;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.loading-track::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: loading-slide 1s ease-in-out infinite alternate;
}
@keyframes loading-slide {
  to {
    transform: translateX(150%);
  }
}

/* A shared light composition. The workspace uses a quieter exposure. */
.home-page {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow: hidden;
}
.ambient-field {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 1050px;
  overflow: hidden;
  pointer-events: none;
  contain: paint;
  mask-image: linear-gradient(black 65%, transparent);
}
.ambient-glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  animation: ambient-light 18s ease-in-out infinite alternate;
}
.glow-amber {
  width: 1100px;
  height: 920px;
  top: -280px;
  right: -240px;
  background: radial-gradient(
    ellipse,
    #e99b3542 0%,
    #d18b321c 34%,
    transparent 68%
  );
}
.glow-copper {
  width: 850px;
  height: 700px;
  top: 150px;
  left: -480px;
  background: radial-gradient(ellipse, #bd764331, transparent 67%);
  animation-duration: 22s;
  animation-delay: -9s;
  animation-direction: alternate-reverse;
}
.glow-mist {
  width: 940px;
  height: 620px;
  top: 430px;
  right: -160px;
  background: radial-gradient(ellipse, #499b9229, transparent 67%);
  animation-duration: 25s;
  animation-delay: -12s;
}
.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.48;
  background-image:
    radial-gradient(circle, #dfc79d48 1px, transparent 1.5px),
    linear-gradient(#a7a9b212 1px, transparent 1px),
    linear-gradient(90deg, #a7a9b212 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 65% 30%, black, transparent 75%);
}
.ambient-flow {
  position: absolute;
  width: 100%;
  height: 900px;
  inset: 0;
  opacity: 0.52;
}
.flow-lines {
  transform-origin: center;
  animation: flow-breathe 16s ease-in-out infinite alternate;
}
.flow-lines-far {
  opacity: 0.5;
  animation-duration: 23s;
  animation-delay: -7s;
  animation-direction: alternate-reverse;
}
.ambient-particles {
  position: absolute;
  inset: 0;
}
.ambient-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f2ce94;
  opacity: 0.45;
  box-shadow: 0 0 10px 2px #efb86526;
  animation: mote-drift var(--cycle) ease-in-out var(--phase) infinite;
}
.ambient-particles span:nth-child(3n) {
  width: 2px;
  height: 2px;
  background: #8bcbc1;
}
@keyframes mote-drift {
  0%,
  100% {
    transform: translate3d(0, 20px, 0);
    opacity: 0.1;
  }
  40% {
    opacity: 0.7;
  }
  65% {
    opacity: 0.5;
  }
  90% {
    transform: translate3d(var(--drift), -44px, 0);
    opacity: 0.1;
  }
}
@keyframes flow-breathe {
  from {
    transform: translate3d(-24px, 12px, 0) rotate(-2deg);
    opacity: 0.45;
  }
  to {
    transform: translate3d(24px, -12px, 0) rotate(2deg);
    opacity: 1;
  }
}
@keyframes ambient-light {
  from {
    transform: translate3d(-60px, -35px, 0) scale(0.9);
    opacity: 0.65;
  }
  to {
    transform: translate3d(80px, 65px, 0) scale(1.12);
    opacity: 1;
  }
}
.home-header {
  height: 84px;
  max-width: 1600px;
  margin: auto;
  padding: 0 5vw;
  border-bottom-color: var(--line-soft);
}
.home-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 30px;
  margin-left: 50px;
  margin-right: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.home-nav a,
.home-nav button {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
}
.home-nav [aria-current] {
  color: var(--text);
}
.home-nav [aria-current]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}
.pool-pill {
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  background: #191b20cc;
  color: var(--muted);
  gap: 7px;
  min-height: 36px;
}
.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 9px #8dd5b03d;
}
.avatar {
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  flex-shrink: 0;
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-weight: 700;
}
.avatar .brand-logo {
  width: 26px;
  height: 26px;
}
.home-main {
  max-width: 1376px;
  padding: 54px 48px 26px;
}
.home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 70px;
  min-height: 385px;
  padding: 20px 0 52px;
}
.home-title h1 {
  font-size: 68px;
  line-height: 1.07;
  font-weight: 650;
  letter-spacing: -0.045em;
  margin: 0 0 22px;
}
.home-title h1 em {
  font-style: normal;
  color: var(--accent);
}
.home-title p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 47ch;
}
.hero-create {
  gap: 10px;
  padding: 14px 19px;
  font-size: 13px;
}
.hero-create .icon:last-child {
  margin-left: 18px;
}
.hero-workflow {
  display: flex;
  gap: 22px;
  margin-top: 25px;
  color: var(--muted);
  font-size: 11px;
}
.hero-workflow span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-workflow .icon {
  width: 15px;
  height: 15px;
  color: var(--subtle);
}
.hero-showcase {
  position: relative;
  padding: 18px 9px 20px;
  min-width: 0;
  perspective: 1000px;
}
.hero-showcase::before,
.hero-showcase::after {
  content: "";
  position: absolute;
  inset: 20px 16px 20px;
  border: 1px solid #efb86526;
  border-radius: 20px;
  transform: rotate(-5deg) translate(-5px, 0);
  background: #efb86503;
  z-index: -1;
  --frame-angle: -5deg;
  animation: frame-float 9s ease-in-out infinite alternate;
}
.hero-showcase::after {
  transform: rotate(4deg) translate(5px, 2px);
  border-color: #efb86514;
  --frame-angle: 4deg;
  animation-delay: -4s;
  animation-duration: 12s;
}
@keyframes frame-float {
  from {
    transform: rotate(var(--frame-angle)) translate3d(-3px, 4px, 0);
  }
  to {
    transform: rotate(var(--frame-angle)) translate3d(4px, -6px, 0);
  }
}
.hero-frame {
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #ffffff1f;
  background: var(--panel);
  box-shadow: 0 24px 70px #05080d70;
  transform: rotate(-1deg);
  transition:
    transform var(--dur-slow) var(--ease-out),
    border-color var(--dur-med) ease;
}
.hero-frame-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--raised);
}
.hero-frame-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.hero-frame-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--panel);
}
.hero-frame-caption span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.hero-frame-caption strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-top: 2px;
}
.hero-frame-caption .hero-frame-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
}
.hero-frame-empty {
  min-height: 300px;
  display: grid;
  place-content: center;
  gap: 24px;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(ellipse at center, #efb86512, transparent 65%), var(--panel);
}
.aperture-mark {
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  margin-inline: auto;
}
.aperture-mark .brand-logo {
  width: 144px;
  height: 144px;
}
.logo-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  pointer-events: none;
}
.logo-placeholder > .brand-logo,
.project-cover .logo-placeholder > .brand-logo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transform: none;
  filter: none;
}
.logo-placeholder-card {
  width: 96px;
  height: 96px;
  z-index: 1;
}
.hero-frame.hero-frame-empty {
  transform: none;
}
.projects-section {
  border-top: 1px solid var(--line-soft);
  padding-top: 32px;
}
.section-bar {
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.section-bar h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0;
}
.section-bar h2 span,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 23px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  margin-left: 10px;
  padding: 0 6px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.section-description {
  color: var(--subtle);
  font-size: 12px;
  margin: 5px 0 0;
}
.home-search {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #191b2080;
  height: 40px;
  padding: 0 12px;
  gap: 8px;
}
.home-search input {
  width: 180px;
  font-size: 12px;
}
:is(.home-search, .search-box, .pool-search, .ingredient-top label) {
  transition:
    border-color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}
:is(
  .home-search,
  .search-box,
  .pool-search,
  .ingredient-top label
):focus-within {
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-ring);
}
/* The rounded search shell owns focus, including keyboard focus. */
:is(.home-search, .search-box, .pool-search, .ingredient-top label) input:focus,
:is(.home-search, .search-box, .pool-search, .ingredient-top label)
  input:focus-visible {
  outline: none;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.project-card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 7px;
  animation: none;
  box-shadow: var(--shadow-panel);
  transition:
    transform var(--dur-med) var(--ease-out),
    border-color var(--dur-med) ease,
    box-shadow var(--dur-med) ease;
}
.project-cover {
  border-radius: 11px;
  aspect-ratio: 16/10;
}
.project-info {
  padding: 13px 9px 7px;
}
.project-name > button:first-child {
  font-weight: 650;
  font-size: 15px;
}
.project-meta {
  font-size: 11px;
  margin-top: 9px;
  color: var(--muted);
}
.project-meta .created,
.last-generation {
  color: var(--subtle);
  font-size: 11px;
}
.last-generation {
  margin: 12px 0 3px;
}
.project-delete {
  opacity: 0;
  border: 1px solid #ffffff25;
  background: #101114d9;
  color: var(--text);
  border-radius: 8px;
  top: 17px;
  right: 17px;
  min-height: 32px;
  transition: opacity var(--dur-fast) ease;
}
.project-card:hover .project-delete,
.project-card:focus-within .project-delete {
  opacity: 1;
}
.empty-cover {
  background:
    radial-gradient(ellipse at 70% 15%, #efb86517, transparent 65%),
    var(--canvas);
}
.empty-cover > .brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.no-projects {
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
  min-height: 220px;
}
.no-projects h3 {
  font-size: 17px;
  color: var(--text);
}
.no-projects p {
  font-size: 13px;
}
.no-projects > .brand-logo {
  width: 48px;
  height: 48px;
}
.home-footer {
  color: var(--subtle);
  border-color: var(--line-soft);
  font-size: 11px;
  margin-top: 50px;
  padding: 22px 0 0;
  align-items: center;
}
.home-footer > span:first-child {
  font-size: 11px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.home-footer .footer-brand .brand-logo {
  width: 24px;
  height: 24px;
}
.footer-dot {
  color: var(--accent);
  margin: 0 6px;
}
.home-footer button {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.home-footer .icon {
  width: 14px;
  height: 14px;
}

/* Workspace shell */
.workspace {
  background: var(--bg);
  --header: 72px;
  isolation: isolate;
}
.ambient-workspace {
  position: fixed;
  inset: var(--header) 0 0 var(--sidebar);
  height: auto;
  opacity: 0.6;
  mask-image: linear-gradient(black, transparent 85%);
}
.ambient-workspace .ambient-particles {
  display: none;
}
.ambient-workspace .ambient-flow {
  opacity: 0.2;
}
.ambient-workspace .glow-amber {
  top: -400px;
}
.ambient-workspace .glow-mist {
  top: 120px;
}
.ambient-workspace .ambient-grid {
  opacity: 0.22;
}
.workspace-header [data-action="motion"] {
  color: var(--muted);
}
.workspace-header [data-action="motion"][aria-pressed="true"] {
  color: var(--accent);
}
.home-header [data-action="motion"][aria-pressed="true"] {
  color: var(--accent);
}
.home-header [data-action="motion"] .icon,
.workspace-header [data-action="motion"] .icon {
  transition: transform var(--dur-med) var(--ease-out);
}
[data-action="motion"][aria-pressed="false"] .icon {
  transform: rotate(-45deg);
}
.home-header {
  background: #1011149c;
}
.workspace-header {
  background: #14161af5;
  backdrop-filter: none;
  border-color: var(--line-soft);
  padding: 0 24px 0 20px;
  gap: 20px;
}
.project-heading {
  min-width: 240px;
  gap: 5px;
}
.project-heading > a {
  color: var(--accent);
}
.breadcrumb-divider {
  color: #515761;
  font-size: 20px;
  font-weight: 400;
  margin: 0 6px;
}
.project-title {
  font-size: 13px;
  font-weight: 650;
}
.search-box {
  border-radius: var(--radius-control);
  background: var(--canvas);
  height: 38px;
}
.circle {
  background: var(--panel);
  border-radius: var(--radius-control);
}
.sidebar {
  background: #14161a;
  border-right: 1px solid var(--line-soft);
  bottom: 0;
  padding: 22px 14px 18px;
}
.sidebar-brand {
  display: none;
}
.nav-group-label {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 500;
  padding: 0 13px 11px;
}
.nav-item {
  height: 43px;
  border-radius: 10px;
  color: var(--muted);
  gap: 11px;
  font-size: 12px;
  font-weight: 550;
  position: relative;
  border: 1px solid transparent;
}
.nav-item > .icon {
  color: var(--subtle);
}
.nav-item.active {
  background: var(--accent-soft);
  border-color: #efb86520;
  color: var(--accent);
}
.nav-item.active > .icon {
  color: var(--accent);
}
.nav-divider {
  background: var(--line-soft);
  margin: 21px 12px;
}
.nav-soon {
  font-size: 9px;
  color: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 4px;
  margin-left: auto;
}
.sidebar-bottom {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.collapsed {
  --sidebar: 72px;
}
.collapsed .nav-group-label {
  display: none;
}
.collapsed .nav-divider {
  margin: 18px 4px;
}
.collapsed .nav-item {
  height: 44px;
}
.mobile-menu,
.nav-scrim {
  display: none;
}
.gallery-main {
  padding: 30px 32px 230px;
  background: transparent;
  scrollbar-gutter: stable;
}
.gallery-main.trash-view,
.trash-view .gallery-main {
  padding-bottom: 40px;
}
.gallery-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}
.gallery-heading h1 {
  font-size: 25px;
  margin: 0;
  font-weight: 650;
}
.gallery-heading p {
  font-size: 12px;
  color: var(--subtle);
  margin: 5px 0 0;
}
.gallery-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.activity-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
.gallery {
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.media-card {
  border-radius: 13px;
  border-color: var(--line-soft);
  background: var(--panel);
  animation: none;
}
.media-card:hover {
  box-shadow: var(--shadow-panel);
  border-color: #5c5141;
  transform: none;
}
.media-open img,
.media-open video {
  filter: none;
}
.media-top .icon-button,
.media-bottom .icon-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 8px;
  background: #101114e8;
}
.media-top .card-trash {
  opacity: 0;
}
.media-card:hover .card-trash,
.media-card:focus-within .card-trash {
  opacity: 1;
}
.media-hover {
  background: linear-gradient(transparent 45%, #05070bd9);
}
.video-badge {
  width: 27px;
  height: 27px;
  background: #101114e8;
  color: var(--text);
  border: 1px solid #ffffff26;
}
.gallery-empty {
  min-height: 52dvh;
}
.gallery-empty > .icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  stroke-width: 1;
  filter: drop-shadow(0 0 20px #efb86533);
}
.gallery-empty h2 {
  font-size: 28px;
  font-weight: 550;
}
.gallery-empty p {
  color: var(--muted);
}
.empty-suggestions button {
  background: var(--panel);
  border-radius: 9px;
  color: var(--muted);
}
.job-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.job-failed {
  border-color: #f2a6a136;
  background: linear-gradient(150deg, #f2a6a108, transparent 65%), var(--panel);
}
.job-failed .job-bar {
  display: none;
}
.job-center {
  gap: 9px;
}
.job-center strong {
  font-size: 14px;
  font-weight: 650;
}
.job-center p {
  font-size: 12px;
  color: var(--muted);
}
.job-center .subtle-button {
  font-size: 11px;
  min-height: 30px;
  border-radius: 7px;
}
.job-percent {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.job-bar {
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  height: 2px;
  transition: transform var(--dur-med) var(--ease-out);
}
.spinner {
  border-color: var(--line);
  border-top-color: var(--accent);
}
.composer-wrap {
  width: 760px;
  bottom: 18px;
  max-width: calc(100% - var(--sidebar) - 70px);
}
.composer {
  background: #1b1e24;
  border-color: #44433c;
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-shadow:
    var(--shadow-float),
    0 0 35px #efb86505;
  transition:
    border-color var(--dur-med) ease,
    box-shadow var(--dur-med) ease;
}
.composer:focus-within {
  border-color: var(--field-focus-border);
  box-shadow: var(--shadow-float), var(--field-focus-ring);
}
.composer-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.composer-label span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.composer-label .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
kbd {
  font-family: inherit;
  font-size: 10px;
  color: var(--subtle);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 400;
}
.composer textarea {
  font-size: 14px;
  min-height: 58px;
  padding: 0 0 12px;
}
.composer-bottom {
  gap: 8px;
}
.add-button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
}
.mode-hint {
  background: transparent;
  padding: 8px 3px;
  font-size: 11px;
  color: var(--muted);
}
.settings-trigger {
  font-size: 11px;
  font-weight: 550;
  min-height: 36px;
  border-radius: 9px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
}
.generate-button {
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 9px;
  font-size: 12px;
}
.generate-button:disabled {
  color: var(--muted);
  background: var(--raised);
  border-color: var(--line);
  box-shadow: none;
}
.composer-footnote {
  color: var(--subtle);
  font-size: 10px;
  gap: 5px;
}
.settings-popover {
  width: 338px;
  right: 12px;
  bottom: 57px;
  padding: 14px;
  background: #20232a;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-float);
  transform-origin: bottom right;
  max-height: min(640px, 70dvh);
  overflow: auto;
}
.popover-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 10px;
}
.popover-heading .icon-button {
  width: 26px;
  height: 26px;
}
.segmented,
.studio-choices,
.studio-page .studio-film-controls .studio-view-tabs {
  background: var(--canvas);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.segmented button,
.studio-choices button {
  color: var(--muted);
  font-weight: 550;
  border-radius: 7px;
  min-height: 33px;
  font-size: 11px;
}
.segmented .selected,
.segmented:first-child .selected,
.segmented:nth-child(2) .selected,
.studio-choices button[aria-pressed="true"],
.studio-page .studio-view-tabs button[aria-pressed="true"] {
  color: var(--accent);
  background: #efb8651c;
  box-shadow: inset 0 0 0 1px #efb86540;
}
.model-select {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.model-select select {
  font-size: 12px;
  min-height: 40px;
}
.cost-note {
  color: var(--muted);
  font-size: 11px;
}

/* Shared overlays and auxiliary tools */
.modal-overlay {
  background: #05070ab8;
  backdrop-filter: blur(7px);
  padding: 28px;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
.modal {
  background: #1b1e24;
  border: 1px solid #444850;
  border-radius: var(--radius-dialog);
  padding: 28px;
  min-width: 0;
  max-width: 100%;
  box-shadow:
    0 32px 100px #03060b99,
    inset 0 1px 0 #ffffff06;
}
.modal h2 {
  font-size: 22px;
  font-weight: 650;
}
.modal > .muted {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}
.modal-heading {
  margin-bottom: 6px;
}
.modal .eyebrow {
  display: none;
}
.modal p {
  line-height: 1.75;
}
.modal-actions,
.dialog-actions {
  border-top: 1px solid var(--line-soft);
  padding-top: 20px;
  margin-top: 24px;
}
.menu-row {
  font-size: 13px;
  padding: 15px 12px;
  border-radius: 9px;
  border-bottom-color: var(--line-soft);
}
.menu-row:hover {
  background: var(--raised);
}
.preview-modal {
  padding: 0;
  border-radius: 20px;
}
.preview-top {
  border-color: var(--line);
  color: var(--muted);
  padding: 12px 18px;
}
.preview-stage {
  background: var(--canvas);
  padding: 20px;
}
.preview-details {
  background: var(--panel);
  border-color: var(--line);
}
.preview-details h2 {
  font-size: 17px;
}
.saved-prompt {
  font-size: 13px;
  color: var(--muted);
}
.preview-stage img,
.preview-stage video {
  border-radius: 6px;
}
.library-item {
  background: var(--panel);
  border-radius: 10px;
}
.library-item.chosen {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.ingredient-modal {
  padding: 18px;
  background: #1b1e24;
}
.ingredient-top {
  margin-bottom: 15px;
}
.ingredient-top label {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.modal #ingredient-search {
  border: 0;
  background: transparent;
  padding-left: 0;
  box-shadow: none;
}
#ingredient-preview {
  background: var(--panel);
}
.ingredient-media-preview {
  background: var(--canvas);
}
.ingredient-tabs button {
  color: var(--muted);
  font-size: 12px;
  border-radius: 9px;
}
.ingredient-tabs button[aria-selected="true"],
#ingredient-list [aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px #efb86525;
}
.ingredient-list-pane {
  border-color: var(--line);
  padding-right: 12px;
}
#ingredient-list [role="option"] {
  padding: 9px;
  border-radius: 9px;
}
#ingredient-list strong {
  font-size: 12px;
}
#ingredient-list small {
  font-size: 11px;
  color: var(--muted);
}
.crop-stage {
  background: var(--canvas);
}
.pool-toolbar p,
.pool-footnote {
  color: var(--muted);
  font-size: 12px;
}
.pool-stat {
  background: var(--canvas);
  border-color: var(--line);
  border-radius: 11px;
}
.pool-stat strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pool-stat span {
  color: var(--muted);
}
.pool-stat.selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.pool-stat.selected span {
  color: var(--accent);
}
.pool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.pool-card.requires-attention {
  background: #efb86508;
  border-color: #efb86540;
}
.pool-card.account-disabled {
  background: var(--canvas);
}
.pool-alert {
  background: #efb8650e;
  border-color: #efb86540;
  color: var(--warning);
  border-radius: 10px;
}
.pool-search {
  background: var(--canvas);
  border-color: var(--line);
}
.modal #pool-search {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.modal .ingredient-top input[id] {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.account-avatar {
  border-radius: 10px;
  width: 38px;
  height: 38px;
  background: var(--raised);
  color: var(--accent);
  border: 1px solid var(--line);
}
.account-state {
  font-size: 11px;
  color: var(--muted);
}
.account-check {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 4px;
}
.account-check:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.pool-balance strong,
.pool-budget strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.video-rights-setting,
.pool-budget {
  border-color: var(--line);
  background: var(--canvas);
  border-radius: 10px;
}
.placeholder-content {
  padding: 30px 10px;
}
.placeholder-content > .icon {
  color: var(--accent);
}
#toast {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: min(580px, calc(100vw - 32px));
  background: #242831;
  border: 1px solid #525764;
  border-radius: 13px;
  padding: 14px 20px;
  color: var(--text);
  box-shadow: var(--shadow-float);
  font-size: 13px;
  bottom: 26px;
  transition:
    opacity 180ms ease,
    transform 220ms var(--ease-out),
    visibility 180ms;
}
.toast-undo {
  color: var(--accent);
  white-space: nowrap;
  font-weight: 650;
}

/* Studio: the same controls, with dedicated space for frames and editing. */
.gallery-main.studio-page {
  background: transparent;
  padding: 25px 32px 40px;
}
.studio-toolbar {
  padding-bottom: 18px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-soft);
  gap: 10px;
}
.studio-toolbar-title > .icon {
  color: var(--accent);
}
.studio-toolbar-title strong {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.studio-toolbar-title .muted {
  color: var(--subtle);
}
.studio-film-carousel {
  margin-top: 18px;
}
.studio-film-strip {
  border-color: var(--line-soft);
  gap: 12px;
  padding-bottom: 18px;
}
.studio-film-strip .studio-film {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  border-radius: 11px;
  padding: 7px;
  flex-basis: 177px;
}
.studio-film-strip .studio-film.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.studio-film-cover {
  border-radius: 7px;
  background: var(--canvas);
}
.studio-film small {
  color: var(--muted);
}
.studio-film-arrow {
  background: var(--raised);
  border-radius: 8px;
}
.studio-film-delete {
  background: #101114e6;
  border-radius: 6px;
  top: 11px;
  right: 11px;
}
.studio-film-strip > p {
  padding: 2px 0 0;
  margin: 0;
}
.studio-page #studio-body {
  padding-top: 25px;
}
.studio-create-heading {
  margin-bottom: 24px;
}
.studio-create-heading h1,
.studio-page .studio-title h1 {
  font-size: 25px;
  font-weight: 650;
  margin-bottom: 6px;
}
.studio-create-heading p {
  font-size: 13px;
  color: var(--muted);
}
.studio-page .studio-brief.studio-create-form {
  gap: 22px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}
.studio-create-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-panel);
}
.studio-create-card-heading h2 {
  font-size: 16px;
  font-weight: 650;
}
.studio-create-card-heading > .icon {
  color: var(--accent);
}
.studio-page .studio-create-form #film-prompt {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.85;
  height: 245px;
  padding: 16px;
}
.studio-page .studio-create-form #film-prompt:focus {
  border-color: var(--accent-line);
}
.studio-create-settings {
  scrollbar-color: #454b56 transparent;
}
.studio-choices {
  margin-top: 7px;
}
.studio-choices button {
  padding: 9px 7px;
  font-size: 11px;
  min-height: 36px;
}
.studio-choices button .icon {
  width: 15px;
  height: 15px;
  margin-right: 5px;
}
.studio-style-cards {
  gap: 9px;
}
.studio-style-cards button {
  position: relative;
  padding: 14px 12px;
  border-radius: 11px;
  background: var(--canvas);
  border-color: var(--line);
  color: var(--muted);
  overflow: hidden;
  min-height: 101px;
}
.studio-style-cards button::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -65px;
  top: -60px;
  border: 1px solid #efb86520;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 0 12px #efb86505,
    0 0 0 25px #efb86503;
}
.studio-style-cards button[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.studio-style-cards strong {
  font-weight: 600;
}
.studio-style-cards small {
  color: var(--muted);
  font-size: 11px;
}
.studio-create-extra {
  border-color: var(--line);
}
summary {
  cursor: pointer;
}
.studio-create-extra summary {
  font-size: 12px;
  color: var(--text);
  padding: 4px 0;
}
.studio-create-extra .muted {
  font-size: 12px;
  line-height: 1.75;
}
.studio-create-path {
  color: var(--subtle);
  font-size: 11px;
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
  margin-top: 22px;
  justify-content: space-between;
}
.studio-create-path .icon {
  color: var(--accent);
}
.studio-create-footer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 17px 20px;
}
.studio-create-footer #film-estimate {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.studio-create-footer .primary-button {
  padding: 13px 21px;
}
.studio-create-materials .studio-brief-ref {
  background: var(--canvas);
  border: 1px solid var(--line-soft);
}
.studio-page .studio-pipeline {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px 18px;
}
.studio-pipeline .current {
  color: var(--accent);
}
.studio-pipeline .current b {
  background: var(--accent);
  color: var(--accent-ink);
}
.studio-pipeline .done {
  color: var(--success);
}
.studio-pipeline .done b {
  background: #8dd5b01a;
  color: var(--success);
}
.studio-page .studio-view-tabs button {
  border-radius: 7px;
  font-size: 12px;
}
.studio-page .studio-preview {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.studio-page .studio-inspector {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 20px;
  scrollbar-color: #454b56 transparent;
}
.studio-page .studio-inspector h2 {
  font-size: 17px;
}
.studio-page .studio-transport {
  min-height: 42px;
}
.studio-page .studio-board-cards article {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}
.studio-page .studio-board-cards article.selected {
  border-color: var(--accent-line);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.studio-board-card-heading .eyebrow {
  color: var(--accent);
  letter-spacing: 0.04em;
  font-size: 11px;
}
.studio-board-card h3 {
  font-size: 17px;
}
.studio-story {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 15px 18px;
}
.studio-story summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.studio-page .studio-timeline {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.studio-page .tl-toolbar {
  border-color: var(--line);
  background: var(--panel);
  gap: 6px;
  padding: 10px;
  border-radius: 13px 13px 0 0;
}
.tl-clock {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tl-toolbar [aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}
.tl-ruler {
  color: var(--subtle);
  background: var(--canvas);
  border-color: var(--line-soft);
}
.tl-canvas,
.tl-video-track {
  background: var(--canvas);
}
.tl-clip {
  background: var(--raised);
  border-color: var(--line);
  border-radius: 7px;
}
.tl-clip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.tl-clip-art video {
  opacity: 0.7;
}
.tl-clip-label {
  font-size: 11px;
}
.tl-handle {
  background: var(--accent);
  color: var(--accent-ink);
}
.tl-audio-clip {
  background: #263d36;
  border-color: #496a5d;
  color: #b9e7d0;
}
.tl-audio-clip.selected {
  border-color: var(--success);
}
.tl-add-music {
  border-color: #496a5d;
  background: #8dd5b00a;
  color: var(--success);
  border-radius: 7px;
}
.tl-playhead {
  background: var(--accent);
  left: 0;
}
.tl-audio-clip .icon,
.tl-add-music .icon {
  width: 14px;
  height: 14px;
}
.tl-add-music {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}
.system-overview {
  width: 640px;
}
.system-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 17px 0;
  color: var(--muted);
}
.system-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 5px 0 24px;
}
.system-metrics > div {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px;
}
.system-metrics strong {
  display: block;
  color: var(--text);
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.system-metrics span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.system-budget {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.system-budget strong {
  color: var(--accent);
}
.tl-playhead b {
  background: var(--accent);
}
.tl-snap-guide {
  background: var(--accent);
}
.tl-footer {
  border-color: var(--line);
  color: var(--muted);
  padding: 12px;
}
.studio-error {
  color: var(--danger);
}

.primary-button,
.generate-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.primary-button::after,
.generate-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 24%,
    #fff5 47%,
    transparent 70%
  );
  transform: translateX(-110%);
  opacity: 0;
  transition:
    transform 240ms var(--ease-out),
    opacity 140ms ease;
}
.hero-frame-arrow .icon,
.hero-create > .icon:last-child {
  transition: transform 200ms var(--ease-out);
}
.composer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 10%;
  width: 80%;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffd18a, transparent);
  opacity: 0;
  transform: scaleX(0.6);
  transition:
    opacity 200ms ease,
    transform 240ms var(--ease-out);
}
.composer:focus-within::before {
  opacity: 0.9;
  transform: scaleX(1);
}
.modal::before {
  content: "";
  position: absolute;
  inset: 0 16% auto;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #efb86560, transparent);
}
@media (hover: hover) and (pointer: fine) {
  .primary-button:hover:not(:disabled)::after,
  .generate-button:hover:not(:disabled)::after {
    transform: translateX(110%);
    opacity: 0.7;
  }
  .hero-frame:hover .hero-frame-arrow .icon,
  .hero-create:hover > .icon:last-child {
    transform: translateX(3px);
  }
  .primary-button:hover:not(:disabled),
  .generate-button:hover:not(:disabled) {
    box-shadow:
      0 5px 22px #efb8652a,
      inset 0 1px 0 #fff5;
    transform: translateY(-1px);
  }
  .hero-frame:hover {
    transform: rotate(0deg) translateY(-3px);
    border-color: var(--accent-line);
  }
  .project-card:hover {
    border-color: #63513a;
    transform: translateY(-4px);
    box-shadow: 0 16px 40px #05080d75;
  }
  .nav-item:hover:not(.active) {
    color: var(--text);
    background: var(--raised);
  }
  .studio-style-cards button:hover:not([aria-pressed="true"]) {
    border-color: #686050;
    background: var(--raised);
  }
  .home-nav a:hover,
  .home-nav button:hover {
    color: var(--text);
  }
}
@media (hover: none) {
  button:hover,
  .media-card:hover,
  .media-card:hover .media-open img,
  .media-card:hover .media-open video,
  .project-card:hover,
  .hero-frame:hover {
    transform: none;
    filter: none;
  }
  .media-top > :not(.card-trash),
  .media-top .card-trash,
  .project-delete {
    opacity: 1;
    pointer-events: auto;
  }
  .media-hover {
    opacity: 1;
  }
}
@media (max-width: 1200px) {
  :root {
    --sidebar: 204px;
  }
  .home-nav {
    margin-left: 35px;
    gap: 22px;
  }
  .home-hero {
    gap: 40px;
  }
  .home-title h1 {
    font-size: 56px;
  }
  .project-heading {
    min-width: 210px;
  }
  .gallery-main,
  .gallery-main.studio-page {
    padding-left: 24px;
    padding-right: 24px;
  }
  .studio-create-card {
    padding: 20px;
  }
}
@media (min-width: 761px) and (max-width: 1000px) {
  :root {
    --sidebar: 72px;
  }
  .sidebar {
    padding-left: 12px;
    padding-right: 12px;
  }
  .nav-item {
    padding: 0;
    justify-content: center;
    height: 44px;
  }
  .nav-item span,
  .nav-group-label {
    display: none;
  }
  .nav-divider {
    margin: 18px 4px;
  }
  .home-nav {
    gap: 16px;
    margin-left: 28px;
  }
  .pool-label,
  .home-header .avatar {
    display: none;
  }
  .studio-page .studio-brief.studio-create-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 1000px) {
  .studio-create-settings {
    contain: none;
    overflow: visible;
  }
  .home-main {
    padding: 35px 30px 24px;
  }
  .home-hero {
    gap: 30px;
    min-height: 350px;
  }
  .home-title h1 {
    font-size: 48px;
  }
  .hero-workflow {
    gap: 12px;
  }
  .home-title p {
    font-size: 13px;
  }
  .desktop-break {
    display: none;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .studio-create-form .studio-model-fields {
    grid-template-columns: 1fr;
  }
  .studio-page .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-page .montage-mode .studio-inspector {
    contain: none;
    max-height: none;
  }
}
@media (max-width: 760px) {
  .ambient-home {
    height: 1100px;
  }
  .ambient-flow {
    width: 150%;
    left: -25%;
    opacity: 0.35;
  }
  .glow-amber {
    right: -640px;
    top: -230px;
  }
  .glow-copper {
    width: 600px;
    height: 650px;
    left: -390px;
    top: 230px;
  }
  .glow-mist {
    right: -700px;
    top: 440px;
  }
  .ambient-particles span:nth-child(n + 7) {
    display: none;
  }
  .workspace-header [data-action="motion"] {
    width: 32px;
  }
  :root {
    --sidebar: 0px;
  }
  .collapsed {
    --sidebar: 0px;
  }
  .home-header {
    height: 72px;
    padding: 0 22px;
  }
  .home-header .brand {
    font-size: 22px;
  }
  .home-nav {
    display: none;
  }
  .home-header .avatar {
    display: none;
  }
  .header-end {
    gap: 6px;
  }
  .home-main {
    padding: 30px 22px 24px;
  }
  .home-hero {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 8px 0 34px;
  }
  .home-title h1 {
    font-size: 52px;
    letter-spacing: -0.045em;
    margin-bottom: 18px;
  }
  .home-title p {
    font-size: 14px;
    margin-bottom: 23px;
  }
  .hero-workflow {
    margin-top: 20px;
    gap: 20px;
  }
  .hero-showcase {
    max-width: 480px;
    width: 100%;
    padding: 8px 5px;
    justify-self: center;
  }
  .hero-frame-media {
    aspect-ratio: 16/8;
  }
  .hero-frame-caption {
    padding: 12px 16px;
  }
  .projects-section {
    padding-top: 25px;
  }
  .section-bar {
    flex-wrap: wrap;
    gap: 16px;
  }
  .home-search {
    width: 100%;
  }
  .home-search input {
    width: 100%;
    font-size: 13px;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .project-meta {
    gap: 9px;
    flex-wrap: wrap;
  }
  .project-meta .created {
    width: 100%;
    margin-left: 0;
  }
  .home-footer {
    flex-wrap: wrap;
    gap: 16px;
  }
  .workspace {
    --header: 62px;
  }
  .workspace-header {
    height: 62px;
    padding: 0 12px;
    gap: 5px;
  }
  .mobile-menu {
    display: inline-flex;
    flex-shrink: 0;
  }
  .workspace-header .project-heading {
    min-width: 0;
    max-width: none;
    flex: 1;
    gap: 0;
    overflow: hidden;
  }
  .project-heading > a,
  .breadcrumb-divider {
    display: none;
  }
  .project-title {
    max-width: none;
    flex: 1;
    font-size: 12px;
  }
  .workspace-header .header-end {
    margin: 0;
    gap: 1px;
  }
  .workspace-header .pool-pill,
  .workspace-header [data-action="grid"] {
    display: none;
  }
  .workspace-header .search-tools {
    display: none;
  }
  .sidebar,
  .collapsed .sidebar {
    top: 62px;
    width: 264px;
    bottom: 0;
    left: 0;
    padding: 22px 15px;
    border-right: 1px solid var(--line);
    z-index: 12;
    transform: translateX(-101%);
    transition: transform 240ms var(--ease-drawer);
    visibility: hidden;
    background: #17191e;
  }
  .sidebar,
  .collapsed .sidebar {
    justify-content: flex-start;
    overflow-y: auto;
  }
  .sidebar-brand {
    display: flex;
    margin: 0 12px 28px;
    font-size: 23px;
  }
  .sidebar-bottom {
    margin-top: auto;
  }
  .sidebar .nav-group-label {
    display: block;
    padding-left: 13px;
  }
  .sidebar .nav-item,
  .collapsed .sidebar .nav-item {
    padding: 0 13px;
    justify-content: flex-start;
    height: 44px;
    font-size: 13px;
  }
  .sidebar .nav-item span {
    display: inline;
  }
  .sidebar .nav-item > .icon {
    width: 19px;
    height: 19px;
  }
  .sidebar [data-action="collapse"] {
    display: none;
  }
  .nav-open .sidebar {
    visibility: visible;
    transform: none;
    box-shadow: 20px 0 50px #05080d60;
  }
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 62px 0 0;
    z-index: 11;
    background: #05070ab3;
    opacity: 0;
    pointer-events: none;
    border-radius: 0;
    transition: opacity 220ms ease;
  }
  .nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .gallery-main,
  .gallery-main.studio-page {
    left: 0;
    padding: 23px 18px 240px;
  }
  .gallery-main.studio-page {
    padding-bottom: 34px;
  }
  .gallery-heading {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }
  .gallery-heading h1 {
    font-size: 22px;
  }
  .gallery-heading p {
    font-size: 11px;
    max-width: 26ch;
  }
  .gallery-heading-actions .subtle-button {
    padding: 8px;
    min-height: 36px;
  }
  .gallery-heading-actions .subtle-button span,
  .activity-badge {
    display: none;
  }
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .gallery.large {
    grid-template-columns: 1fr;
  }
  .media-card {
    border-radius: 10px;
    aspect-ratio: 4/3;
  }
  .gallery-empty {
    min-height: 46dvh;
    padding: 24px 0;
  }
  .gallery-empty h2 {
    font-size: 24px;
  }
  .gallery-empty p {
    font-size: 13px;
  }
  .empty-suggestions {
    gap: 8px;
  }
  .empty-suggestions button {
    font-size: 12px;
  }
  .job-center {
    padding: 15px 9px;
    gap: 6px;
  }
  .job-card {
    min-height: 215px;
    aspect-ratio: auto;
  }
  .job-center strong {
    font-size: 12px;
  }
  .job-center p {
    font-size: 11px;
  }
  .job-center .subtle-button {
    font-size: 10px;
    min-height: 27px;
  }
  .composer-wrap {
    left: 50%;
    width: calc(100% - 24px);
    max-width: none;
    bottom: max(9px, env(safe-area-inset-bottom));
  }
  .composer {
    padding: 12px;
    border-radius: 15px;
  }
  .composer textarea {
    font-size: 14px;
    min-height: 57px;
  }
  .composer-label {
    margin-bottom: 10px;
  }
  .composer-label kbd {
    display: none;
  }
  .composer-bottom {
    gap: 6px;
  }
  .composer-left {
    gap: 5px;
  }
  .mode-hint {
    display: none;
  }
  .composer-right {
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
    gap: 6px;
  }
  .settings-trigger {
    min-width: 0;
    overflow: hidden;
    font-size: 10px;
    padding: 7px 8px;
  }
  .generate-button {
    padding: 0 11px;
    min-width: 36px;
  }
  .generate-button span {
    display: none;
  }
  .composer-footnote {
    font-size: 9px;
    margin-top: 5px;
  }
  .settings-popover {
    right: 0;
    bottom: 56px;
    width: min(338px, calc(100vw - 28px));
  }
  .modal-overlay {
    padding: 14px;
  }
  .modal {
    padding: 22px;
    max-height: 92dvh;
    border-radius: 18px;
  }
  .modal h2 {
    font-size: 20px;
  }
  .modal input,
  .modal textarea,
  .modal select,
  .studio-page input,
  .studio-page select,
  .studio-page textarea {
    font-size: 16px !important;
  }
  .preview-modal {
    padding: 0;
    height: 92dvh;
  }
  .preview-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .preview-stage {
    min-height: 220px;
    max-height: 48dvh;
    padding: 12px;
  }
  .preview-details {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
    padding: 20px;
  }
  .preview-details h2 {
    font-size: 17px;
  }
  .ingredient-modal {
    padding: 12px;
  }
  .pool-modal {
    padding: 20px;
  }
  .pool-toolbar {
    flex-wrap: wrap;
    gap: 14px;
  }
  .pool-stat {
    min-width: 85px;
    padding: 11px;
  }
  .pool-stats {
    gap: 7px;
  }
  .pool-controls {
    flex-wrap: wrap;
  }
  .pool-search {
    flex-basis: 100%;
  }
  .pool-card {
    padding: 15px;
  }
  .pool-card-actions {
    flex-wrap: wrap;
  }
  .pool-balance {
    margin-left: 0;
  }
  .studio-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .studio-toolbar-title {
    flex-basis: 100%;
    margin-bottom: 4px;
  }
  .studio-toolbar-title .muted {
    display: inline;
    font-size: 11px;
  }
  .studio-toolbar-title strong {
    font-size: 22px;
  }
  .studio-toolbar .primary-button {
    margin-left: auto;
  }
  .studio-page .studio-brief.studio-create-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
  }
  .studio-create-heading h1,
  .studio-page .studio-title h1 {
    font-size: 23px;
  }
  .studio-create-card {
    padding: 18px;
    border-radius: 13px;
  }
  .studio-page .studio-create-form #film-prompt {
    height: 240px;
  }
  .studio-style-cards button {
    padding: 12px 9px;
    min-height: 109px;
  }
  .studio-style-cards strong {
    font-size: 11px;
  }
  .studio-style-cards small {
    font-size: 10px;
  }
  .studio-create-path {
    gap: 8px;
    font-size: 10px;
  }
  .studio-create-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 17px;
  }
  .studio-create-footer .primary-button {
    width: 100%;
    margin-top: 6px;
  }
  .studio-create-settings {
    contain: none;
    overflow: visible;
  }
  .studio-page .studio-title {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .studio-page .studio-film-controls {
    display: flex;
    flex-wrap: wrap;
  }
  .studio-page .studio-film-controls .studio-view-tabs {
    justify-self: start;
  }
  .studio-page .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .studio-page .studio-inspector {
    padding: 17px;
  }
  .studio-pipeline {
    gap: 12px;
    overflow-x: auto;
  }
  .studio-pipeline span {
    flex-shrink: 0;
  }
  .studio-page .tl-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .tl-clock {
    min-width: 155px;
  }
  .tl-footer {
    flex-wrap: wrap;
  }
  .studio-timeline-notes {
    justify-content: flex-start;
  }
}
@media (max-width: 480px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  .project-meta .created {
    width: auto;
    margin-left: auto;
  }
  .home-header {
    padding: 0 18px;
  }
  .home-header .pool-pill {
    font-size: 10px;
    padding: 7px;
  }
  .home-header .pool-label {
    display: none;
  }
  .home-header .header-end > .icon-button {
    width: 32px;
    height: 32px;
  }
  .home-main {
    padding-left: 20px;
    padding-right: 20px;
  }
  .home-title h1 {
    font-size: 49px;
  }
  .hero-frame-caption span {
    font-size: 10px;
  }
  .section-bar h2 {
    font-size: 20px;
  }
}
html[data-visibility="hidden"] .ambient-field *,
html[data-visibility="hidden"] .hero-showcase::before,
html[data-visibility="hidden"] .hero-showcase::after,
.modal-open .ambient-field *,
.modal-open .hero-showcase::before,
.modal-open .hero-showcase::after {
  animation-play-state: paused;
}
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after,
html[data-input="keyboard"] .sidebar,
html[data-input="keyboard"] .nav-scrim {
  animation: none !important;
  transition-duration: 0ms !important;
  scroll-behavior: auto !important;
}
html[data-motion="reduced"] .hero-frame,
html[data-motion="reduced"] .project-card:hover,
html[data-motion="reduced"] .hero-frame-arrow .icon,
html[data-motion="reduced"] .hero-create > .icon:last-child,
html[data-motion="reduced"] button:active,
html[data-input="keyboard"] button:active {
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
  .hero-frame,
  .project-card:hover,
  .hero-frame-arrow .icon,
  .hero-create > .icon:last-child,
  button:active {
    transform: none !important;
  }
}

/* Equal-height contact sheet: each card keeps its source aspect ratio. */
.gallery {
  --tile-height: 180px;
  container-type: inline-size;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}
.gallery .media-card {
  flex: 0 0 auto;
  container: media-card / inline-size;
  width: calc(var(--tile-height) * var(--ratio, 1.33333));
  max-width: 100%;
  height: auto;
  aspect-ratio: var(--ratio, 1.33333);
  min-width: 0;
  min-height: 0;
  align-self: flex-start;
}
.gallery .job-card {
  flex: 0 0 auto;
  height: var(--tile-height);
  width: calc(var(--tile-height) * 16 / 9);
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: auto;
}
.gallery.large {
  --tile-height: 260px;
}
.gallery.large .media-card {
  width: calc(var(--tile-height) * var(--ratio, 1.33333));
  height: auto;
  aspect-ratio: var(--ratio, 1.33333);
}
.gallery.large .job-card {
  width: calc(var(--tile-height) * 16 / 9);
  height: var(--tile-height);
  aspect-ratio: auto;
}
.gallery .media-open {
  position: absolute;
  inset: 0;
}
.gallery .media-open img,
.gallery .media-open video,
.gallery .media-card:hover .media-open img,
.gallery .media-card:hover .media-open video {
  object-fit: contain;
  transform: none;
}
.gallery .media-card {
  background:
    radial-gradient(ellipse at top, #ffffff04, transparent 80%), var(--canvas);
}
.gallery .job-center {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 5px 7px;
  padding: 10px;
  max-height: 100%;
  overflow: auto;
}
.gallery .job-center > strong,
.gallery .job-center > p {
  flex-basis: 100%;
  margin: 0;
}
.gallery .job-center > .spinner {
  width: 18px;
  height: 18px;
}
.gallery .job-center > .icon {
  width: 18px;
  height: 18px;
}
.gallery .job-center p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.gallery .gallery-empty {
  width: 100%;
}
@media (max-width: 760px) {
  .gallery {
    --tile-height: 160px;
  }
  .gallery.large {
    --tile-height: min(240px, calc((100cqw - 2px) * 9 / 16));
  }
  .gallery .job-card {
    min-height: 0;
  }
  .system-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .system-metrics > div {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
  }
}
@media (max-width: 520px) {
  .gallery {
    grid-template-columns: 1fr;
  }
  .ingredient-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 8px;
  }
  .ingredient-top select {
    width: 100%;
  }
  .ingredient-top label {
    grid-row: 2;
    grid-column: 1/-1;
    min-width: 0;
  }
  .ingredient-top > button {
    grid-column: 2;
    grid-row: 1;
  }
  .ingredient-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px 150px minmax(0, 1fr);
    height: min(650px, calc(100dvh - 200px));
    gap: 10px;
  }
  .ingredient-tabs {
    flex-direction: row;
    overflow-x: auto;
    padding: 0;
  }
  .ingredient-tabs button {
    flex: 0 0 38px;
    padding: 9px;
    justify-content: center;
  }
  .ingredient-tabs #ingredient-upload {
    margin-top: 0;
  }
  .ingredient-list-pane {
    border: 0;
    padding-right: 0;
  }
  .modal .ingredient-sort select {
    padding: 5px 8px;
    min-height: 34px;
  }
  #ingredient-list {
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }
  #ingredient-list [role="option"] {
    flex: 0 0 108px;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
    padding: 7px;
  }
  #ingredient-list [role="option"] > span:last-child {
    width: 100%;
  }
  #ingredient-list img,
  #ingredient-list video,
  .voice-art {
    width: 100%;
    height: 42px;
    border-radius: 5px;
  }
  #ingredient-list small {
    display: none;
  }
  #ingredient-preview {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .ingredient-media-preview {
    min-height: 100px;
    max-height: 190px;
    flex: 0 0 auto;
  }
  .ingredient-media-preview img,
  .ingredient-media-preview video {
    max-height: 190px;
  }
  .ingredient-name {
    font-size: 13px;
  }
  #ingredient-add {
    flex-shrink: 0;
  }
}
.tl-clip-art {
  height: 46px;
}
.tl-clip-label,
.tl-clip small {
  line-height: 17px;
}

/* Shared live light field and short, interruptible navigation transitions. */
.ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ambient-canvas[hidden] {
  display: none;
}
.ambient-field[data-live] .ambient-flow {
  opacity: 0.3;
}
::view-transition-old(root) {
  animation: page-out 130ms ease-out both;
}
::view-transition-new(root) {
  animation: page-in 280ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
@keyframes page-out {
  to {
    opacity: 0;
  }
}
@keyframes page-in {
  from {
    opacity: 0;
  }
}
.studio-static-value {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field, #101114);
}
.studio-page .studio-view-tabs {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.studio-page .studio-view-tabs::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc((100% - 16px) / 3);
  border-radius: 7px;
  background: #efb8651c;
  box-shadow: inset 0 0 0 1px #efb86530;
  transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1);
  z-index: -1;
}
.studio-page
  .studio-view-tabs:has(
    [data-studio-view="storyboard"][aria-pressed="true"]
  )::before {
  transform: translateX(calc(100% + 4px));
}
.studio-page
  .studio-view-tabs:has(
    [data-studio-view="montage"][aria-pressed="true"]
  )::before {
  transform: translateX(calc(200% + 8px));
}
.studio-page .studio-view-tabs button[aria-pressed="true"] {
  background: transparent;
  box-shadow: none;
}
.studio-create-card,
.studio-inspector,
.studio-board-card {
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}
.studio-create-card:focus-within,
.studio-inspector:focus-within {
  border-color: #efb86555;
  box-shadow:
    0 0 0 1px #efb8650c,
    0 16px 48px #00000018;
}
select {
  color-scheme: dark;
}
select option {
  color: #f3f2ed;
  background: #1b1e24;
}
/* Native semantics and top-layer placement, with our own branded picker. */
@supports (appearance: base-select) {
  select:not([multiple]),
  select:not([multiple])::picker(select) {
    appearance: base-select;
  }
  select:not([multiple]) {
    align-items: center;
  }
  select::picker-icon {
    color: #a5a9b3;
    transition: rotate 180ms ease;
  }
  select:open::picker-icon {
    rotate: 180deg;
    color: #efb865;
  }
  select::picker(select) {
    color-scheme: dark;
    background: #1b1e24;
    color: #f3f2ed;
    border: 1px solid #efb86545;
    border-radius: 12px;
    padding: 5px;
    margin-block: 5px;
    max-height: min(360px, 60dvh);
    box-shadow: 0 18px 50px #0008;
    font: inherit;
  }
  select option {
    padding: 9px 12px;
    border-radius: 7px;
    gap: 10px;
    min-height: 36px;
    cursor: pointer;
  }
  select option:hover,
  select option:focus {
    background: #ffffff0c;
  }
  select option:checked {
    background: #efb86520;
    color: #ffd293;
  }
  select option::checkmark {
    color: #efb865;
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
html[data-motion="reduced"]::view-transition-group(*),
html[data-motion="reduced"]::view-transition-old(*),
html[data-motion="reduced"]::view-transition-new(*) {
  animation: none !important;
}

/* Film surfaces carry the same warm light as the project canvas. */
.studio-page .studio-film-strip .studio-film {
  flex-basis: 160px;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}
.studio-page .studio-film-cover {
  height: 66px;
}
.studio-film-strip .studio-film.active {
  box-shadow: 0 6px 24px #efb86508;
}
.studio-page .studio-board-cards article {
  display: grid;
  grid-template-columns: minmax(110px, 28%) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
}
.studio-page .studio-board-cards article.selected {
  background: linear-gradient(120deg, #efb86507, transparent 55%), var(--panel);
  box-shadow:
    inset 0 0 0 1px var(--accent-soft),
    0 10px 36px #00000024;
}
.studio-board-art {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--canvas);
  color: var(--accent);
}
.studio-board-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 320ms var(--ease-out),
    filter 220ms ease;
}
.studio-board-duration {
  position: absolute;
  bottom: 7px;
  right: 7px;
  padding: 3px 6px;
  border: 1px solid #ffffff18;
  border-radius: 5px;
  background: #0d0e11d9;
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.studio-board-placeholder {
  display: grid;
  place-content: center;
  gap: 8px;
  height: 100%;
  background: radial-gradient(ellipse at top right, #efb86512, transparent 75%);
  color: var(--subtle);
  font-size: 24px;
  font-weight: 600;
}
.studio-board-placeholder .icon {
  width: 22px;
  height: 22px;
  margin: auto;
  color: var(--accent);
  opacity: 0.7;
}
.studio-board-copy {
  min-width: 0;
}
.studio-board-copy h3 {
  margin-top: 9px;
}
.studio-scene-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.studio-scene-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
[data-state="succeeded"] .studio-scene-status {
  color: var(--success);
}
[data-state="failed"] .studio-scene-status {
  color: var(--danger);
}
[data-state="running"] .studio-scene-status,
[data-state="downloading"] .studio-scene-status,
[data-state="preparing"] .studio-scene-status {
  color: var(--accent);
}
.studio-provider-note {
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--text);
}
.studio-page[data-creating] .studio-pipeline .current b {
  position: relative;
}
.studio-page[data-creating] .studio-pipeline .current b::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid #efb86575;
  border-radius: inherit;
  animation: active-stage 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes active-stage {
  0% {
    transform: scale(0.86);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}
.modal {
  background:
    radial-gradient(ellipse at 90% 0, #efb8650b, transparent 45%), var(--panel);
}
.pool-card {
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .studio-page .studio-film-strip .studio-film:hover {
    border-color: #efb86550;
    background: #efb8650b;
    box-shadow: 0 6px 24px #00000024;
  }
  .studio-board-art:hover:not(:disabled) img {
    transform: scale(1.045);
    filter: brightness(1.05);
  }
  .studio-page .studio-board-cards article:hover {
    border-color: #efb86545;
  }
  .pool-card:hover {
    border-color: #efb86535;
  }
}
@media (max-width: 520px) {
  .studio-page .studio-board-cards article {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }
  .studio-board-art {
    aspect-ratio: 3/4;
  }
  .studio-board-copy h3 {
    font-size: 15px;
  }
  .studio-board-copy .subtle-button {
    font-size: 11px;
    padding: 8px 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .studio-board-art:hover:not(:disabled) img {
    transform: none;
  }
}
html[data-motion="reduced"] .studio-board-art:hover:not(:disabled) img {
  transform: none;
}
html[data-visibility="hidden"] .studio-pipeline .current b::after,
.modal-open .studio-pipeline .current b::after {
  animation-play-state: paused;
}
::view-transition {
  pointer-events: none;
}
@supports (appearance: base-select) {
  .model-select > .icon {
    display: none;
  }
}
@container media-card (max-width: 150px) {
  .media-top {
    inset: 8px 8px auto auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }
  .media-top .icon-button {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
  .media-bottom {
    justify-content: flex-end;
  }
  .media-bottom > span {
    display: none;
  }
}
.studio-export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin-top: 24px;
  border: 1px solid var(--accent-line, #efb86538);
  border-radius: 14px;
  background: linear-gradient(120deg, #efb8650a, transparent 65%), var(--panel);
}
.studio-stages-intro {
  margin: 24px 0 20px;
}
.studio-stages-intro h2 {
  margin: 6px 0;
  font-size: 22px;
}
.studio-stages-intro p {
  margin: 0;
}
.studio-stage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.studio-stage-card {
  position: relative;
  padding: 20px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--panel);
}
.studio-stage-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.studio-stage-card .eyebrow {
  font-size: 9px;
}
.studio-stage-card h3 {
  margin: 6px 0;
  font-size: 16px;
}
.studio-stage-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.studio-stage-card.current {
  border-color: #efb86566;
  background: linear-gradient(145deg, #efb86512, transparent 75%), var(--panel);
}
.studio-stage-card.current .studio-stage-number {
  color: var(--accent);
  background: #efb86514;
  border-color: #efb86542;
}
.studio-stage-card.done .studio-stage-number {
  color: #8fc5b2;
  background: #8fc5b214;
  border-color: #8fc5b22b;
}
.studio-stage-details {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}
.studio-status-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.studio-status-card > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--accent);
}
.studio-status-card > header h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}
.studio-status-card > div {
  padding: 6px 20px 20px;
  overflow-wrap: anywhere;
}
.studio-status-card details {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.studio-status-card summary {
  color: var(--muted);
  cursor: pointer;
}
.studio-status-card > div > section {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 14px;
  margin: 14px 0;
  background: var(--canvas);
}
.studio-edit-layout[hidden],
#studio-stages[hidden] {
  display: none;
}
@media (max-width: 1100px) {
  .studio-stage-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .studio-stage-details {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .studio-stage-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .studio-stage-card {
    padding: 16px 12px;
  }
  .studio-status-card > header {
    padding: 16px;
  }
  .studio-status-card > div {
    padding: 4px 16px 16px;
  }
}
.studio-export h2 {
  font-size: 18px;
  margin: 5px 0;
}
.studio-export p {
  color: var(--muted);
  margin: 0;
  max-width: 75ch;
}
.studio-export .primary-button {
  flex-shrink: 0;
}
#film-export-hint {
  margin: 12px 0;
}
@media (max-width: 760px) {
  .studio-export {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
  }
}
