/* The production desk uses Parl.ai's existing palette; previews own their art. */
.studio-topbar {
  padding: 18px 3vw;
  min-height: 72px;
}
.studio-topbar strong {
  font-size: 30px;
}
.studio-word {
  font:
    14px system-ui,
    sans-serif;
  color: var(--muted);
  padding-left: 14px;
  margin-left: 14px;
  border-left: 1px solid var(--line);
}
.studio-top-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.studio-top-meta > .quiet {
  margin-left: 18px;
}
.studio-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
main {
  padding: 25px 3vw 60px;
  max-width: 1680px;
}
.studio-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.studio-intro h1 {
  font:
    500 28px/1.15 system-ui,
    sans-serif;
  letter-spacing: -0.035em;
  margin: 7px 0 0;
}
.studio-intro .eyebrow {
  color: var(--muted);
  font-size: 10px;
}
.studio-intro p {
  font-size: 13px;
  margin: 0;
}
main > nav {
  margin: 22px 0 12px;
  border-bottom: 1px solid var(--line);
  gap: 26px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
main > nav button {
  border: 0;
  border-radius: 0;
  white-space: nowrap;
  padding: 13px 0 15px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
main > nav button.active {
  color: var(--text);
  border-bottom-color: var(--brand);
}
.nav-count {
  font: 10px monospace;
  margin-left: 5px;
  color: var(--muted);
}
main > nav .nav-refresh {
  margin-left: auto;
  font-weight: 400;
  font-size: 12px;
}
#message {
  min-height: 0;
  font-size: 12px;
  margin: 0;
}
#message:not(:empty) {
  padding: 8px 0 12px;
}
.studio-section-heading {
  padding: 20px 0 25px;
}
.studio-section-heading h2 {
  font:
    500 28px/1.15 system-ui,
    sans-serif;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
}
.studio-section-heading p {
  margin: 0;
  max-width: 750px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}
.template-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px 22px;
}
.template-tile {
  border: 0;
  padding: 0;
  text-align: left;
  min-width: 0;
  background: transparent;
}
.template-tile-preview {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--base);
}
.template-tile-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.template-tile:hover img {
  transform: scale(1.015);
}
.template-number {
  position: absolute;
  right: 12px;
  top: 12px;
  font: 10px monospace;
  color: var(--muted);
  background: var(--base);
  padding: 4px 7px;
  border: 1px solid var(--line);
}
.template-open {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--text);
  color: var(--base);
  font: 11px system-ui;
  padding: 7px 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: 0.15s ease;
}
.template-tile:hover .template-open,
.template-tile:focus-visible .template-open {
  opacity: 1;
  transform: none;
}
.template-tile-copy {
  padding: 15px 0;
}
.template-tile-copy > span {
  font: 10px monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}
.template-tile h3 {
  font: 500 18px/1.3 system-ui;
  margin: 6px 0;
  color: var(--text);
}
.template-tile p {
  font-size: 12px;
  margin: 0;
}
.template-modal {
  width: min(1160px, 94vw);
  max-height: 92dvh;
  padding: 48px 28px 26px;
  background: var(--base);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}
.template-modal::backdrop {
  background: rgb(4 8 16/0.85);
  backdrop-filter: blur(5px);
}
.template-close {
  position: absolute;
  right: 20px;
  top: 12px;
  border: 0;
  font-size: 12px;
  color: var(--muted);
  padding: 5px;
}
.template-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.85fr);
  gap: 36px;
}
.template-stage {
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: start;
}
.template-stage > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(65vh, 680px);
  object-fit: contain;
  background: var(--base);
  border: 1px solid var(--line);
}
.slide-controls {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
}
.slide-controls span {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.slide-controls button {
  font-size: 11px;
  padding: 6px 9px;
}
.template-info h2 {
  font: 500 28px/1.2 system-ui;
  letter-spacing: -0.03em;
  margin: 10px 0;
}
.template-info p {
  font-size: 13px;
}
.template-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}
.template-spec span {
  border: 1px solid var(--line);
  padding: 5px 8px;
  font: 10px monospace;
  color: var(--muted);
}
.template-info ul {
  padding-left: 19px;
  color: var(--muted);
  font-size: 13px;
}
.template-info li {
  margin-bottom: 7px;
}
.template-info h3 {
  font-size: 13px;
}
.template-note {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.template-storyboard {
  list-style: none;
  padding: 0;
  counter-reset: beat;
}
.template-storyboard li {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.template-storyboard p {
  margin: 5px 0;
}
.template-storyboard small {
  color: var(--muted);
  font-size: 11px;
}
.production-banner {
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  padding: 20px;
}
.production-banner strong {
  font-size: 14px;
  font-weight: 500;
}
.production-banner p {
  margin: 5px 0 0;
  font-size: 12px;
}
.production-state {
  margin-left: auto;
  white-space: nowrap;
  color: var(--muted);
  font: 11px monospace;
}
.production-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 32px 0 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.production-flow > div {
  padding: 24px 18px 25px 0;
  margin-right: 18px;
  min-width: 0;
}
.production-flow > div + div {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.production-flow > div > span {
  font: 12px monospace;
  color: var(--brand);
}
.production-flow h3 {
  font: 500 18px system-ui;
  margin: 12px 0;
}
.production-flow p {
  font-size: 13px;
  margin: 0 0 14px;
}
.production-flow small {
  font-size: 11px;
  color: var(--muted);
}
.production-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}
.production-columns h2 {
  font: 500 23px system-ui;
  letter-spacing: -0.02em;
}
.production-columns p {
  font-size: 13px;
}
.reel-beats {
  list-style: none;
  padding: 0;
}
.reel-beats li {
  display: grid;
  grid-template-columns: 95px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.reel-beats strong {
  font-weight: 500;
}
.reel-beats span {
  color: var(--muted);
}
.cost-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  font-size: 13px;
}
.cost-row strong {
  font-weight: 500;
}
.cost-row span {
  color: var(--muted);
}
.production-columns a {
  font-size: 12px;
}
#drafts > details {
  margin: 0 0 26px;
}
#drafts > details > summary {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
#drafts .split {
  grid-template-columns: 250px minmax(0, 1fr);
}
.queue-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}
.queue-thumb {
  width: 48px;
  height: 62px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.queue-placeholder {
  width: 48px;
  height: 62px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}
.queue-label {
  min-width: 0;
}
.queue-label strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-label .quiet {
  font-size: 11px;
}
.queue-label .tag {
  font-size: 10px;
}
#review > h2 {
  font: 500 25px system-ui;
}
.preview figure {
  flex-basis: 340px;
}
.preview img,
.preview video {
  max-height: 500px;
}
.queue-history {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}
.queue-history button {
  opacity: 0.65;
}
#review > .notice {
  margin-top: 30px;
}
.setup-grid h2 {
  font: 500 24px system-ui;
}
@media (max-width: 1100px) {
  .template-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .studio-intro p {
    display: none;
  }
  .production-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .production-flow > div + div {
    border-left: 0;
    padding-left: 0;
  }
  .production-columns {
    gap: 28px;
  }
}
@media (max-width: 760px) {
  .studio-topbar {
    padding: 14px 18px;
    min-height: 60px;
  }
  .studio-topbar strong {
    font-size: 25px;
  }
  .studio-top-meta {
    font-size: 10px;
  }
  .studio-top-meta > .quiet {
    display: none;
  }
  .studio-word {
    margin-left: 8px;
    padding-left: 8px;
    font-size: 12px;
  }
  main {
    padding: 18px 16px 40px;
  }
  .studio-intro h1 {
    font-size: 23px;
  }
  .studio-intro .eyebrow {
    display: none;
  }
  main > nav {
    gap: 20px;
    margin-top: 17px;
    font-size: 13px;
  }
  .nav-refresh {
    display: none;
  }
  .template-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
  }
  .template-tile h3 {
    font-size: 15px;
  }
  .template-tile-copy {
    padding: 10px 0;
  }
  .template-open {
    display: none;
  }
  .template-modal {
    padding: 44px 18px 22px;
  }
  .template-modal-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .template-stage {
    position: static;
  }
  .template-stage > img {
    height: auto;
    max-height: 62vh;
  }
  .production-flow {
    grid-template-columns: 1fr 1fr;
  }
  .production-flow > div {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .production-columns {
    grid-template-columns: 1fr;
  }
  .production-state {
    display: none;
  }
  #drafts .split {
    grid-template-columns: 1fr;
  }
  .cost-row {
    grid-template-columns: 125px 1fr;
    gap: 12px;
  }
  .studio-section-heading {
    padding: 15px 0 22px;
  }
  .studio-section-heading h2 {
    font-size: 24px;
  }
  .preview figure {
    flex-basis: min(320px, 82vw);
  }
}
@media (prefers-reduced-motion: reduce) {
  .template-tile-preview img,
  .template-open {
    transition: none;
  }
}
