/* Reel My Property — film studio layout. Tokens: /assets/tokens.css · shared components: /assets/base.css */

body { background: var(--paper); }
#app { min-height: 100svh; }

/* ---------- Small shared pieces ---------- */
.link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  color: var(--link);
  font: 500 var(--t-small) / 1.3 var(--font-sans);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.link:hover { text-decoration-thickness: 2px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border-radius: 50%;
  color: var(--fg-2);
}
.icon-button:hover { background: var(--paper-2); color: var(--fg); }
.chip[aria-pressed] { cursor: pointer; min-height: 2.25rem; padding-inline: 0.9rem; font-size: var(--t-small); letter-spacing: 0; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.badge .icon { width: 1em; height: 1em; }

/* Loading, maintenance, offline */
.splash, .state {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-5);
  min-height: 100svh;
  padding: var(--gutter);
  text-align: center;
}
.splash .spinner { color: var(--cf-700); font-size: 1.5rem; }
.state__body { display: grid; justify-items: center; gap: var(--s-4); max-width: 30rem; }
.unsupported {
  max-width: 34rem;
  margin: 18vh auto 0;
  padding: var(--s-5) var(--gutter);
  display: grid;
  gap: var(--s-3);
}

/* ---------- Frame ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.bar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
  width: min(100% - 2 * var(--gutter), var(--wrap-wide));
  height: var(--header-h);
  margin-inline: auto;
}
.bar__right { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); grid-column: 3; }
.tabs { display: flex; gap: 0.25rem; padding: 0.25rem; border-radius: var(--r-pill); background: var(--paper-2); }
.tabs a {
  display: grid;
  place-items: center;
  min-height: 2.5rem;
  padding: 0 1.1rem;
  border-radius: var(--r-pill);
  color: var(--fg-2);
  font: 500 var(--t-small) / 1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--d-1) ease, color var(--d-1) ease;
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  color: var(--fg);
  font: 500 var(--t-small) / 1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
}
.credit-chip:hover { border-color: var(--fg); }
.credit-chip i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--cf-500); }
.account { position: relative; }
.account summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border-radius: var(--r-pill);
  font: 500 var(--t-small) / 1 var(--font-sans);
  cursor: pointer;
  list-style: none;
}
.account summary::-webkit-details-marker { display: none; }
.account summary:hover { background: var(--paper-2); }
.account summary span { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__chevron { width: 1em; height: 1em; transition: rotate var(--d-2) var(--ease-out); }
.account[open] .account__chevron { rotate: 180deg; }
.account__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 5;
  display: grid;
  gap: var(--s-3);
  width: 15rem;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
  box-shadow: var(--shadow-1);
}
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.7rem var(--gutter);
  background: var(--cf-100);
  color: var(--cf-900);
  font: 500 var(--t-small) / 1.45 var(--font-sans);
  text-align: center;
}
.banner--warn { background: var(--warn-bg); color: var(--warn); }
.studio__main {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 4rem) 8rem;
  outline: none;
}
.tabbar { display: none; }

.page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
  margin-bottom: clamp(1.5rem, 4vw, 2.75rem);
}
.page__head h1 + p { margin-top: 0.5rem; }
.page__fine { margin-top: var(--s-4); }
.page__note { margin-bottom: var(--s-4); }

/* ---------- My films ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--s-5); }
.film-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: clamp(1rem, 2.4vw, 1.75rem); }
.film-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
  transition: box-shadow var(--d-3) ease;
}
.film-card.is-focus { box-shadow: 0 0 0 3px var(--cf-500), var(--shadow-1); }
.film-card__media { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.film-card__media video, .film-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-card__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(15 15 18 / 0.55);
  color: #fff;
}
.film-card__veil .icon { width: 2rem; height: 2rem; opacity: 0.9; }
.film-card__pulse {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--cf-400);
  box-shadow: 0 0 0 0 rgb(132 170 241 / 0.6);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { to { box-shadow: 0 0 0 1.75rem rgb(132 170 241 / 0); } }
.film-card__body { display: grid; gap: 0.6rem; padding: 1.1rem 1.15rem 1.15rem; flex: 1; align-content: start; }
.film-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.film-card__top h3 { font: 400 1.5rem / 1.15 var(--font-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.film-card__held { color: var(--warn); }
.film-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin-top: 0.25rem; }
.film-card__actions:empty { display: none; }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin: 0.15rem 0; padding: 0; }
.stepper li { display: grid; gap: 0.4rem; font: 500 var(--t-micro) / 1.2 var(--font-sans); color: var(--fg-3); }
.stepper i { height: 4px; border-radius: 99px; background: var(--paper-3); }
.stepper .is-done { color: var(--fg-2); }
.stepper .is-done i { background: var(--cf-500); }
.stepper .is-current { color: var(--fg); }
.stepper .is-current i {
  background: linear-gradient(90deg, var(--cf-500) 40%, var(--cf-200) 50%, var(--cf-500) 60%) 0 0 / 300% 100%;
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { to { background-position: -150% 0; } }

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  padding: clamp(2.5rem, 8vw, 6rem) var(--s-5);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sheet);
  text-align: center;
}
.empty p { max-width: 30rem; }
.empty__art { display: flex; align-items: center; gap: 0.5rem; margin-bottom: var(--s-3); }
.empty__art span {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--fg-2);
}
.empty__art span.is-on { border-color: transparent; background: var(--cf-500); color: var(--ink); }
.empty__art i { width: 1.75rem; height: 1px; background: var(--line-2); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s-3) var(--s-5); margin-top: var(--s-2); }

/* ---------- Make a film ---------- */
.steps-nav { display: flex; gap: 0.35rem; margin: 0; padding: 0; }
.steps-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0 0.9rem 0 0.45rem;
  border-radius: var(--r-pill);
  color: var(--fg-2);
  font: 500 var(--t-small) / 1 var(--font-sans);
  text-decoration: none;
}
.steps-nav__n {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  font-size: var(--t-micro);
}
.steps-nav__n .icon { width: 0.9rem; height: 0.9rem; }
.steps-nav a:hover { color: var(--fg); }
.steps-nav a.is-done .steps-nav__n { border-color: transparent; background: var(--cf-100); color: var(--cf-800); }
.steps-nav a[aria-current="step"] { background: var(--white); color: var(--fg); box-shadow: 0 0 0 1px var(--line); }
.steps-nav a[aria-current="step"] .steps-nav__n { border-color: transparent; background: var(--ink); color: var(--paper); }

.wizard__body { display: grid; gap: var(--s-4); }
.panel {
  display: grid;
  gap: var(--s-4);
  align-content: start;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
}
.panel__title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font: 400 clamp(1.375rem, 1.2rem + 0.7vw, 1.625rem) / 1.2 var(--font-display);
  letter-spacing: -0.01em;
}
.panel__title > .num {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border-radius: 50%;
  background: var(--paper-2);
  font: 500 var(--t-micro) / 1 var(--font-sans);
  letter-spacing: 0;
}
.panel__title small { font: 400 var(--t-small) / 1 var(--font-sans); color: var(--fg-3); letter-spacing: 0; }
.listing { display: grid; gap: var(--s-3); max-width: 30rem; }
.listing .link { justify-self: start; min-height: 2rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: 0.65rem; }
.tiles--types { grid-template-columns: 1fr; }
@media (min-width: 38rem) { .tiles--types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 68rem) { .tiles--types { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tiles--shape { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 30rem; }
.tile {
  position: relative;
  display: grid;
  gap: 0.3rem;
  align-content: start;
  padding: 0.95rem 1rem 1.05rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-control);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--d-1) ease, background-color var(--d-1) ease, box-shadow var(--d-1) ease;
}
.tile strong { font: 500 0.9375rem / 1.3 var(--font-sans); }
.tile__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.35rem;
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--fg-2);
  transition: background-color var(--d-1) ease, color var(--d-1) ease;
}
.tile:hover { border-color: var(--fg-3); }
.tile.is-on { border-color: var(--cf-700); background: var(--cf-50); box-shadow: inset 0 0 0 1px var(--cf-700); }
.tile.is-on .tile__icon { background: var(--cf-500); color: var(--ink); }
.tile:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.tile.is-disabled { cursor: not-allowed; opacity: 0.5; }
.tile--small { padding: 0.75rem 0.8rem 0.85rem; }
.tile--small .small { display: none; }
@media (min-width: 34rem) { .tile--small .small { display: block; } }

.dropzone {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: clamp(1.5rem, 5vw, 2.75rem) var(--s-4);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-control);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--d-1) ease, background-color var(--d-1) ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--cf-700); background: var(--cf-50); }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.dropzone__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: var(--cf-500);
  color: var(--ink);
}
.dropzone__pick { color: var(--link); text-decoration: underline; text-underline-offset: 0.2em; }

.paywall {
  display: grid;
  gap: var(--s-4);
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: var(--r-control);
  background: var(--cf-100);
}
.paywall h3 { font: 400 1.5rem / 1.2 var(--font-display); letter-spacing: -0.01em; margin-bottom: 0.3rem; }
.paywall__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--white);
  color: var(--cf-800);
}

.uploads { display: grid; gap: 0.5rem; margin: 0; padding: 0; }
.upload {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
}
.upload img { width: 3rem; height: 3rem; object-fit: cover; border-radius: 8px; }
.upload__main { display: grid; gap: 0.4rem; min-width: 0; }
.upload__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 var(--t-small) / 1.3 var(--font-sans); }
.upload__state { min-width: 3.5rem; text-align: right; }
.upload.is-error { border-color: var(--bad); background: var(--bad-bg); }
.upload__error { color: var(--bad); }

.library__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.65rem; }
.library__head h3 { font: 600 var(--t-small) / 1.3 var(--font-sans); letter-spacing: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr)); gap: 0.6rem; margin: 0; padding: 0; }
.photo { position: relative; }
.photo__pick {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-print);
  background: var(--paper-3);
  outline: 0 solid var(--cf-500);
  transition: outline-width var(--d-1) ease;
}
.photo__pick img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--d-3) var(--ease-out); }
.photo__pick:hover img { transform: scale(1.05); }
.photo.is-on .photo__pick { outline-width: 3px; outline-offset: 2px; }
.photo__pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.photo__n {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--cf-500);
  color: var(--ink);
  font: 600 var(--t-micro) / 1 var(--font-sans);
  box-shadow: 0 0 0 2px #fff;
}
.photo__remove {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgb(15 15 18 / 0.6);
  color: #fff;
  opacity: 0;
  transition: opacity var(--d-1) ease;
}
.photo__remove .icon { width: 1rem; height: 1rem; }
.photo:hover .photo__remove, .photo__remove:focus-visible { opacity: 1; }
@media (hover: none) { .photo__remove { opacity: 1; } }

.tray__list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; padding: 0; }
.shot-chip {
  position: relative;
  display: grid;
  width: 8.5rem;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--r-control);
  background: var(--white);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.shot-chip img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; pointer-events: none; }
.shot-chip__label { padding: 0.4rem 0.6rem 0; font: 500 var(--t-micro) / 1.2 var(--font-sans); letter-spacing: 0.04em; color: var(--fg-2); }
.shot-chip__tools { display: flex; justify-content: space-between; padding: 0 0.2rem 0.15rem; }
.shot-chip__tools button { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; color: var(--fg-2); }
.shot-chip__tools button:hover:not(:disabled) { background: var(--paper-2); color: var(--fg); }
.shot-chip__tools button:disabled { opacity: 0.3; cursor: default; }
.shot-chip__tools .icon { width: 1rem; height: 1rem; }
.shot-chip.is-dragging { cursor: grabbing; border-color: var(--cf-700); box-shadow: var(--shadow-1); }

.fine { border-top: 1px solid var(--line); padding-top: var(--s-2); }
.fine summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font: 500 var(--t-small) / 1 var(--font-sans);
  cursor: pointer;
  list-style: none;
}
.fine summary::-webkit-details-marker { display: none; }
.fine__chevron { width: 1em; height: 1em; transition: rotate var(--d-2) var(--ease-out); }
.fine[open] .fine__chevron { rotate: 180deg; }
.fine__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: var(--s-3); padding-top: var(--s-2); }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: var(--s-5) var(--s-6); }
.setting { display: grid; gap: 0.55rem; align-content: start; justify-items: start; }
.setting .tiles { width: 100%; }

.review { align-items: start; }
@media (min-width: 58rem) { .review { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.review__strip { display: flex; gap: 0.5rem; margin: 0; padding: 0; overflow-x: auto; }
.review__strip li { position: relative; flex: 0 0 7.5rem; }
.review__strip img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-print); }
.review__strip small { display: block; margin-top: 0.35rem; color: var(--fg-2); font-size: var(--t-micro); }
.review__strip span {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--cf-500);
  color: var(--ink);
  font: 600 0.6875rem / 1 var(--font-sans);
}
.review__prompt { margin: 0; padding: 0.9rem 1.1rem; border-left: 3px solid var(--cf-500); background: var(--paper); font-size: var(--t-small); line-height: 1.55; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.9rem 1.5rem; margin: 0; }
.facts dt { font: 500 var(--t-micro) / 1.3 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.facts dd { margin: 0.2rem 0 0; font-weight: 500; }
.review__cost { position: sticky; top: calc(var(--header-h) + 1rem); gap: var(--s-3); }
.review__credits { font: 400 clamp(2.75rem, 2rem + 3vw, 3.75rem) / 1 var(--font-display); letter-spacing: -0.02em; }

.costbar { position: fixed; inset: auto 0 0 0; z-index: var(--z-float); padding: 0 var(--gutter) 1rem; pointer-events: none; }
.costbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding: 0.6rem 0.6rem 0.6rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--white) 92%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1);
  pointer-events: auto;
}
/* Messages rise above the bar instead of covering it */
body:has(.costbar) .toasts { bottom: 6.25rem; }
.costbar__sum { display: grid; gap: 0.1rem; }
.costbar__sum strong { font: 400 1.5rem / 1 var(--font-display); letter-spacing: -0.01em; }
.costbar__nav { display: flex; gap: 0.5rem; }

/* ---------- Credits ---------- */
.balance { display: grid; justify-items: end; }
.balance__number { font: 400 clamp(3rem, 2rem + 4vw, 4.5rem) / 0.95 var(--font-display); letter-spacing: -0.02em; }
.bundle-area { display: grid; gap: var(--s-3); }
.bundle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: var(--s-3); margin: 0; padding: 0; }
.bundle-card {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
}
.bundle-card__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 1.75rem; }
.bundle-card__top h3 { font: 600 1rem / 1.3 var(--font-sans); letter-spacing: 0; }
.bundle-card__price { margin-top: 0.6rem; font: 400 clamp(2.75rem, 2rem + 3vw, 3.75rem) / 1 var(--font-display); letter-spacing: -0.02em; }
.bundle-card__credits { font-weight: 500; }
.bundle-card .btn { margin-top: var(--s-4); }
.bundle-grid--compact .bundle-card { padding: var(--s-4); }
.bundle-grid--compact .bundle-card__price { font-size: 2.25rem; margin-top: 0.25rem; }
.bundle-grid--compact .bundle-card .btn { margin-top: var(--s-3); }

.explain {
  display: grid;
  gap: var(--s-5) var(--s-8);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}
@media (min-width: 52rem) { .explain { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.explain h2 { margin-bottom: var(--s-3); }
.explain p + p { margin-top: var(--s-3); }
.examples { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.examples th, .examples td { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.examples thead th { font: 500 var(--t-micro) / 1.3 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.examples thead .soft { text-transform: none; letter-spacing: 0; }
.examples tbody th { font-weight: 500; }
.history { margin-top: clamp(2.5rem, 6vw, 4rem); }
.history h2 { margin-bottom: var(--s-3); }
.history ul { margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.history__icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--paper-2); color: var(--fg-2); }
.history__what { display: grid; flex: 1; }

/* ---------- Signed out ---------- */
.gate { display: grid; min-height: 100svh; }
.gate__poster { position: relative; display: grid; min-height: 15rem; overflow: hidden; isolation: isolate; }
.gate__poster > img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: 0.72; }
.gate__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(15 15 18 / 0.85), rgb(15 15 18 / 0.15) 60%, rgb(15 15 18 / 0.45));
}
.gate__poster-body { display: grid; align-content: space-between; gap: var(--s-6); padding: clamp(1.25rem, 3.5vw, 2.5rem); }
.gate__pitch { display: grid; gap: var(--s-4); justify-items: start; max-width: 28rem; }
.gate__place { font: 500 var(--t-micro) / 1 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); }
.gate__main { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 4rem) var(--gutter); }
.gate__card { display: grid; gap: var(--s-4); width: min(100%, 25rem); }
.gate__lead { margin-top: calc(var(--s-2) * -1); }
.gate__fields { display: grid; gap: var(--s-4); margin-top: var(--s-2); }
.gate__fields .link { justify-self: start; min-height: 1.5rem; margin-top: calc(var(--s-3) * -1); }
.gate__links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.gate__row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.gate__step { margin-top: var(--s-5); }
.gate__confirm { margin-block: var(--s-2); font-size: var(--t-body); }
@media (min-width: 56rem) {
  .gate { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .gate--solo { grid-template-columns: minmax(0, 1fr); }
  .gate__poster { margin: 0.75rem; border-radius: clamp(1rem, 2vw, 1.75rem); }
}
@media (max-width: 55.99rem) {
  .gate { grid-template-rows: auto 1fr; }
  .gate__poster .t-h1 { font-size: clamp(2.25rem, 9vw, 3rem); }
  .gate__place { display: none; }
}
.password { position: relative; display: block; }
.password .input { padding-right: 3rem; }
.password__toggle {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  translate: 0 -50%;
  border-radius: 50%;
  color: var(--fg-2);
}
.password__toggle:hover { background: var(--paper-2); color: var(--fg); }
.code {
  padding: 1.1rem 1rem;
  border: 1.5px dashed var(--cf-700);
  border-radius: var(--r-control);
  background: var(--cf-50);
  text-align: center;
}
.code code {
  font: 500 clamp(1.1rem, 4.4vw, 1.4rem) / 1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- Dialog contents ---------- */
.dialog__form { display: grid; gap: var(--s-4); margin-top: var(--s-4); }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
.dialog__thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-print); }
.dialog--film { width: min(74rem, calc(100vw - 1.5rem)); padding: 0; overflow: hidden; border-radius: clamp(0.75rem, 1.5vw, 1.25rem); }
.dialog--film .player { aspect-ratio: 16 / 9; max-height: calc(100dvh - 7rem); background: #000; }
.dialog--film .player video { width: 100%; height: 100%; }
.dialog--film .player__title { padding: 0.9rem 1.25rem 1.1rem; font: 400 1.5rem / 1.2 var(--font-display); }
.dialog--film .dialog__close { background: rgb(15 15 18 / 0.6); color: #fff; }

/* ---------- Small screens: tabs move to the bottom ---------- */
@media (max-width: 47.99rem) {
  .tabs { display: none; }
  .bar__inner { grid-template-columns: 1fr auto; }
  .bar__right { grid-column: 2; }
  .account summary span, .account__chevron { display: none; }
  .studio__main { padding-bottom: 14rem; }
  /* The action bar becomes two rows: the cost, then the buttons at full width */
  .costbar { bottom: calc(3.9rem + env(safe-area-inset-bottom)); padding: 0 0.6rem 0.5rem; }
  .costbar__inner { flex-wrap: wrap; gap: 0.5rem; padding: 0.65rem; border-radius: var(--r-card); }
  .costbar__sum { display: flex; align-items: baseline; gap: 0.6rem; width: 100%; padding-inline: 0.4rem; }
  .costbar__sum strong { font-size: 1.25rem; }
  .costbar__nav { width: 100%; }
  .costbar__nav .btn { padding-inline: 1rem; }
  .costbar__nav .btn--primary, .costbar__nav .btn[disabled]:last-child { flex: 1; }
  .costbar__back { width: 3rem; padding: 0; flex: none; }
  .costbar__back-label { display: none; }
  body:has(.costbar) .toasts { bottom: 13rem; }
  .steps-nav { width: 100%; }
  .steps-nav li { flex: 1; }
  .steps-nav a { width: 100%; padding-right: 0.5rem; }
  .toasts { bottom: 9.5rem; }
  .balance { justify-items: start; }
}

@media (prefers-reduced-motion: no-preference) {
  .bar .brand, .gate .brand, .splash .brand, .state .brand { view-transition-name: brand; }
}

/* Signed-in workspace. The account and credit balance remain available in every view. */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .75rem; }
.project-card { display: flex; align-items: center; gap: .85rem; min-width: 0; padding: .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; color: var(--fg); }
.project-card:hover { border-color: var(--fg-3); }
.project-card__cover, .project-empty-icon { display: grid; place-items: center; background: var(--paper-2); color: var(--fg-2); border-radius: var(--r-control); }
.project-card__cover { flex: none; overflow: hidden; width: 3.8rem; height: 3.8rem; }
.project-card__cover img, .picture-summary__photo { width: 100%; height: 100%; object-fit: cover; }
.project-card__label { display: grid; gap: .15rem; flex: 1; min-width: 0; }
.project-card__label strong, .project-page h1, .picture-summary dd { overflow-wrap: anywhere; }
.project-card__label small { color: var(--fg-2); font-size: var(--t-micro); }
.project-card > .icon { color: var(--fg-3); }
.project-back { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: 1.25rem; }
.project-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.project-assets { display: grid; gap: 1.1rem; margin-top: 2.25rem; }
.project-empty-icon { width: 3rem; height: 3rem; }
.film-card__picture, .film-card__picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.picture-workspace, .camera-controls { display: grid; align-items: start; gap: var(--s-4); }
.picture-summary__photo { aspect-ratio: 16 / 9; height: auto; border-radius: var(--r-control); }
@media (min-width: 40rem) { .camera-controls { grid-template-columns: 1fr 1fr; } }
@media (min-width: 69rem) {
  .picture-workspace { grid-template-columns: minmax(0, 1.8fr) minmax(15rem, 1fr); }
  .picture-summary { position: sticky; top: calc(var(--header-h) + 1rem); }
}
