/*
  Hypecast — "Night Workshop" design system.
  Warm charcoal edit-suite surfaces; amber = your move, green = done.
  Display: Bricolage Grotesque · Text: Inter · Numbers: JetBrains Mono.
*/
:root {
  --bg: #100f0e;
  --sunken: #141311;
  --panel: #181715;
  --raised: #211f1c;
  --line: #2c2925;
  --line-2: #3a3631;
  --text: #f3efe8;
  --muted: #a39b8f;
  --amber: #f5b544;
  --amber-hi: #ffc964;
  --amber-ink: #1a1306;
  --amber-soft: rgba(245, 181, 68, 0.14);
  --amber-line: rgba(245, 181, 68, 0.4);
  --green: #58d39b;
  --green-ink: #0e1a13;
  --green-soft: rgba(88, 211, 155, 0.12);
  --blue: #8ab4ff;
  --blue-soft: rgba(138, 180, 255, 0.13);
  /* Cost services: Claude = blue, HypiHub = violet, ElevenLabs = rose. */
  --violet: #b9a2ff;
  --violet-soft: rgba(185, 162, 255, 0.13);
  --rose: #ff9fc6;
  --rose-soft: rgba(255, 159, 198, 0.12);
  --red: #ff8a7a;
  --red-soft: rgba(255, 138, 122, 0.12);
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --serif: "Playfair Display", Georgia, serif;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --med: 320ms;
  color-scheme: dark;
}

/* ── Page-to-page transitions: header and sidebar stay, content cross-fades */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 260ms;
  animation-timing-function: var(--ease);
}
::view-transition-old(stage) {
  animation: vt-out 180ms var(--ease) both;
}
::view-transition-new(stage) {
  animation: vt-in 320ms var(--ease) both;
}
::view-transition-old(preview),
::view-transition-new(preview) {
  animation-duration: 320ms;
}
@keyframes vt-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}
@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--amber);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}
a:hover {
  color: var(--amber-hi);
}
h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  margin: 0;
}
p {
  margin: 0;
}
::selection {
  background: var(--amber);
  color: var(--amber-ink);
}
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ── Top bar */
.topbar {
  view-transition-name: topbar;
  height: 3.75rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.brand:hover {
  color: var(--text);
}
.brand-mark {
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 8px;
  background: var(--amber);
  color: var(--amber-ink);
  display: grid;
  place-items: center;
}
.nav {
  display: flex;
  gap: 0.25rem;
}
.nav a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  transition:
    background var(--fast) var(--ease),
    color var(--fast) var(--ease);
}
.nav a:hover {
  color: var(--text);
  background: var(--panel);
}
.nav a.active {
  color: var(--text);
  font-weight: 600;
  background: var(--raised);
}
.health {
  margin-left: auto;
  display: flex;
  gap: 0.875rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
}
.health span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.account {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}
.account:empty {
  display: none;
}
.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--amber);
  color: var(--amber-ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
}
.account-name {
  font-size: 0.875rem;
  font-weight: 600;
}
@media (max-width: 820px) {
  .account {
    margin-left: auto;
    border-left: none;
  }
  .account-name {
    display: none;
  }
}
/* Phones: brand + account on top, the tabs on their own swipeable row. */
@media (max-width: 640px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.625rem 1rem 0.375rem;
  }
  .nav {
    order: 3;
    flex: 1 0 100%;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    white-space: nowrap;
  }
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-2);
}
.dot.ok {
  background: var(--green);
}
.dot.warn {
  background: var(--amber);
}
.dot.bad {
  background: var(--red);
}

/* ── Three-pane workspace */
.shell {
  display: grid;
  grid-template-columns: 18.5rem minmax(0, 1fr) 22.5rem;
  min-height: calc(100vh - 3.75rem);
}
.shell.two-pane {
  grid-template-columns: 18.5rem minmax(0, 1fr);
}
.sidebar {
  view-transition-name: sidebar;
  background: var(--sunken);
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 3.75rem;
  height: calc(100vh - 3.75rem);
  overflow-y: auto;
}
.work {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.stage {
  view-transition-name: stage;
  padding: 1.75rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.preview-pane {
  view-transition-name: preview;
  background: var(--sunken);
  border-left: 1px solid var(--line);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  position: sticky;
  top: 3.75rem;
  height: calc(100vh - 3.75rem);
  overflow-y: auto;
}
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 16rem minmax(0, 1fr);
  }
  .preview-pane {
    grid-column: 2;
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 820px) {
  .shell,
  .shell.two-pane {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    height: auto;
    max-height: 16rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .preview-pane {
    grid-column: 1;
  }
  .health {
    display: none;
  }
  .stage {
    padding: 1.25rem 1rem 3rem;
  }
}

/* ── Sidebar items */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.eyebrow.amber {
  color: var(--amber);
}
.side-label {
  padding: 0.75rem 0.25rem 0.25rem;
}
.side-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.625rem;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  transition:
    background var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
.side-item:hover {
  color: var(--text);
  background: var(--panel);
}
.side-item:active {
  transform: scale(0.99);
}
.side-item.active {
  background: var(--raised);
  border-color: var(--amber-line);
}
.side-item .thumb {
  width: 2.75rem;
  height: 4.875rem;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--raised);
}
.side-item .thumb.round {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}
.initial {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  color: var(--amber);
  background: var(--raised);
  text-transform: uppercase;
}
.lib-card .cover.initial {
  font-size: 4.5rem;
  background: radial-gradient(circle at 50% 40%, #2a2622, var(--raised) 70%);
}
.side-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  flex-grow: 1;
}
.side-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
}
.strip span {
  height: 3px;
  border-radius: 2px;
  background: var(--line-2);
  transition: background var(--med) var(--ease);
}
.strip .done {
  background: var(--green);
}
.strip .current {
  background: var(--amber);
}
.strip .working {
  background: var(--blue);
  animation: breathe 1.6s ease-in-out infinite;
}
.strip .failed {
  background: var(--red);
}
.state-text {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
}
.state-text.needs {
  color: var(--amber);
}
.state-text.done {
  color: var(--green);
}
.state-text.working {
  color: var(--blue);
}
.state-text.failed {
  color: var(--red);
}

/* ── Buttons */
.btn,
button {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition:
    background var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    box-shadow var(--med) var(--ease),
    transform var(--fast) var(--ease),
    opacity var(--fast) var(--ease);
}
button:hover:not(:disabled),
.btn:hover {
  border-color: #4d483f;
  background: var(--raised);
  color: var(--text);
}
button:active:not(:disabled),
.btn:active {
  transform: translateY(1px) scale(0.985);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.primary,
button.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(245, 181, 68, 0.22);
}
.btn.primary:hover,
button.primary:hover:not(:disabled) {
  background: var(--amber-hi);
  border-color: var(--amber-hi);
  color: var(--amber-ink);
  box-shadow: 0 8px 30px rgba(245, 181, 68, 0.34);
}
.btn.big,
button.big {
  font-size: 0.9375rem;
  min-height: 3rem;
  padding: 0.8125rem 1.25rem;
  border-radius: 12px;
}
.btn.quiet,
button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.quiet:hover,
button.quiet:hover:not(:disabled) {
  background: var(--raised);
  border-color: transparent;
  color: var(--text);
}
.btn.dashed,
button.dashed {
  background: transparent;
  border-style: dashed;
  border-color: #4a453e;
}
button.danger:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
}
button.icon {
  padding: 0;
  width: 2.75rem;
}
button.small,
.btn.small {
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 8px;
}
button.is-busy {
  opacity: 0.85;
  cursor: progress;
}
button.is-busy::before {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

/* ── Title band + journey */
.band {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.band-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}
.band-title {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}
@media (max-width: 900px) {
  .band-top {
    flex-wrap: wrap;
  }
  .band-action {
    align-items: flex-start;
  }
}
.band-title h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.band-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.caption {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3125rem 0.75rem;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
}
.chip.strong {
  color: var(--text);
  font-weight: 600;
}
.chip.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
}
.chip img {
  width: 1.5rem;
  height: 1.5rem;
  margin-left: -0.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
}
.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.jstep {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
}
.jtrack {
  display: flex;
  align-items: center;
}
.jnode {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid var(--line-2);
  color: var(--muted);
  background: transparent;
  transition:
    background var(--med) var(--ease),
    border-color var(--med) var(--ease),
    color var(--med) var(--ease),
    box-shadow var(--med) var(--ease),
    transform var(--med) var(--ease);
}
.jline {
  height: 3px;
  flex-grow: 1;
  margin: 0 0.5rem;
  border-radius: 2px;
  background: var(--line-2);
  position: relative;
  overflow: hidden;
}
.jline::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 600ms var(--ease);
}
.jstep.done .jline::after {
  transform: scaleX(1);
}
.jlabel {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}
button.jlabel:hover:not(:disabled) {
  background: none;
  color: var(--text);
}
.jsub {
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jstep.done .jnode {
  background: var(--green);
  border-color: var(--green);
  color: var(--green-ink);
}
.jstep.done .jlabel {
  color: var(--text);
}
.jstep.done .jsub {
  color: var(--green);
  background: var(--green-soft);
  font-family: var(--sans);
}
.jstep.current .jnode {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
  animation: glow 2.6s ease-in-out infinite;
}
.jstep.current .jlabel {
  color: var(--amber);
  font-weight: 800;
}
.jstep.current .jsub {
  background: var(--amber);
  color: var(--amber-ink);
  font-family: var(--sans);
}
.jstep.working .jnode {
  border-color: var(--blue);
  color: var(--blue);
  border-right-color: transparent;
  animation: spin 1.1s linear infinite;
}
.jstep.working .jnode > * {
  animation: spin 1.1s linear infinite reverse;
}
.jstep.working .jlabel {
  color: var(--blue);
}
.jstep.working .jsub {
  color: var(--blue);
  background: var(--blue-soft);
  font-family: var(--sans);
}
.jstep.failed .jnode {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}
.jstep.failed .jlabel {
  color: var(--red);
}
.jstep.failed .jsub {
  color: var(--red);
  background: var(--red-soft);
  font-family: var(--sans);
}
.jstep.viewing .jnode {
  transform: scale(1.12);
}
.jstep.viewing .jlabel {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
@media (max-width: 700px) {
  .journey {
    grid-template-columns: repeat(5, minmax(4.5rem, 1fr));
    overflow-x: auto;
  }
  .jsub {
    display: none;
  }
}

/* ── Content */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.panel-head .titles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.panel-head h2 {
  font-size: 1.375rem;
  font-weight: 700;
}
.lede {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition:
    border-color var(--med) var(--ease),
    box-shadow var(--med) var(--ease);
}
.card.focus {
  border-color: var(--amber-line);
}
.card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}
.row {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  align-items: center;
}
.row.spread {
  justify-content: space-between;
}
.grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}
.two {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
  .two {
    grid-template-columns: minmax(0, 1fr);
  }
}
.muted {
  color: var(--muted);
  font-size: 0.8125rem;
}
.mono {
  font-family: var(--mono);
}
.num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--line);
  color: var(--text);
}
.num.amber {
  background: var(--amber);
  color: var(--amber-ink);
}
.tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1875rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.tag.amber {
  color: var(--amber);
  border-color: var(--amber-line);
}
.tag.green {
  color: var(--green);
  border-color: rgba(88, 211, 155, 0.4);
}

/* ── Form controls */
label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.375rem;
}
input,
select,
textarea {
  width: 100%;
  background: var(--sunken);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease),
    background var(--fast) var(--ease);
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-2);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--amber-line);
  box-shadow: 0 0 0 3px var(--amber-soft);
  background: #12110f;
}
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
}
textarea {
  min-height: 4.5rem;
  resize: vertical;
  line-height: 1.5;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--amber);
}
input[type="range"] {
  accent-color: var(--amber);
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
input[type="file"] {
  padding: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  margin-right: 0.75rem;
  padding: 0.4375rem 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--raised);
  color: var(--text);
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
input[type="file"]::file-selector-button:hover {
  background: #2a2723;
}
.check {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  cursor: pointer;
  line-height: 1.4;
}
.check input {
  margin-top: 0.15rem;
}
.field {
  display: flex;
  flex-direction: column;
}
audio {
  width: 100%;
  height: 2.5rem;
  color-scheme: dark;
}
video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  display: block;
}
/*
  Full screen shows the WHOLE 9:16 reel, letterboxed. Without this, layout
  rules for small frames (the phone preview's object-fit: cover, size caps)
  stay active and crop the video to a zoomed-in slice of the screen.
*/
video:fullscreen,
video:-webkit-full-screen {
  object-fit: contain !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  background: #000 !important;
}

/* ── Segmented control + choice cards */
.seg {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 12px;
  background: var(--sunken);
  border: 1px solid var(--line);
  gap: 0.25rem;
  flex-wrap: wrap;
}
.seg button {
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
}
.seg button:hover:not(:disabled) {
  background: var(--raised);
  border: none;
}
.seg button[aria-pressed="true"] {
  background: var(--raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--amber-line);
}
.choice {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    border-color var(--fast) var(--ease),
    background var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
.choice:hover {
  border-color: var(--line-2);
  background: var(--raised);
}
.choice:has(input:checked) {
  border-color: var(--amber);
  background: var(--raised);
  box-shadow: 0 0 0 3px var(--amber-soft);
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
}
.choice small {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.75rem;
}
.choice > span {
  min-width: 0;
}

/* ── Script editor */
.take-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.take-head .attitude {
  flex: 1 1 14rem;
  font-style: italic;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  padding: 0.375rem 0.5rem;
  min-height: 0;
}
.take-head .attitude:hover,
.take-head .attitude:focus {
  border-color: var(--line);
  background: var(--sunken);
  color: var(--text);
}
.line {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 5.5rem;
  gap: 0.625rem;
  align-items: start;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  transition: background var(--fast) var(--ease);
}
.line .say {
  font-size: 1rem;
  min-height: 2.75rem;
}
.line .panel-side {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.line .kind {
  display: inline-flex;
  gap: 0.25rem;
}
.line .kind button {
  min-height: 1.75rem;
  padding: 0.125rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.line .kind button[aria-pressed="true"] {
  color: var(--amber);
  border-color: var(--amber-line);
  background: var(--amber-soft);
}
.line .panel-side input,
.line .panel-side textarea {
  font-size: 0.8125rem;
  min-height: 2.5rem;
}
.line img.mini {
  width: 5.5rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}
.line .slot {
  width: 5.5rem;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px dashed var(--line-2);
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--muted);
  padding: 0.25rem;
}
.line.previewing .say {
  border-color: var(--amber-line);
}
@media (max-width: 900px) {
  .line {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Pictures grid */
.pics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.pic {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--med) var(--ease),
    transform var(--med) var(--ease);
}
.pic:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.pic .frame {
  aspect-ratio: 4 / 3;
  background: var(--raised);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pic .frame.tall {
  aspect-ratio: 9 / 16;
  max-height: 22rem;
}
.pic .frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pic .frame .word {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 1.375rem;
  color: #ffe27a;
  text-align: center;
  padding: 1rem;
  letter-spacing: -0.02em;
}
.pic .frame.navy {
  background: linear-gradient(180deg, #0f172a, #1e3a8a);
}
.pic .body {
  padding: 0.875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* ── Notices, errors, toasts */
.notice {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
}
.notice.amber {
  background: var(--amber-soft);
  border-color: var(--amber-line);
}
.notice.blue {
  background: var(--blue-soft);
  border-color: rgba(138, 180, 255, 0.35);
}
.notice.green {
  background: var(--green-soft);
  border-color: rgba(88, 211, 155, 0.35);
}
.notice.red,
.error {
  background: var(--red-soft);
  border: 1px solid rgba(255, 138, 122, 0.4);
  color: #ffd3cc;
  border-radius: 12px;
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  white-space: pre-wrap;
  line-height: 1.45;
}
.notice .grow {
  flex-grow: 1;
}
#error:empty {
  display: none;
}
.toasts {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 50;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: toast-in 320ms var(--ease) both;
}
.toast.out {
  animation: toast-out 240ms var(--ease) both;
}

/* ── Phone preview */
.phone {
  position: relative;
  width: 14.5rem;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  border: 6px solid var(--line);
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}
.phone > img,
.phone .layer {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  object-fit: cover;
}
.phone video {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.phone .full {
  top: 0;
  height: 100%;
}
.phone .top {
  top: 0;
  height: 48%;
}
.phone .bottom {
  top: 48%;
  height: 52%;
  object-position: 50% 25%;
}
.phone .navy {
  background: linear-gradient(180deg, #0f172a, #1e3a8a);
}
.phone .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0) 28%,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
}
.phone .ph-title {
  position: absolute;
  top: 1.1rem;
  left: 0.75rem;
  right: 0.75rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.875rem;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.phone .ph-word {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  text-align: center;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.1;
  color: #ffe27a;
  letter-spacing: -0.02em;
}
.phone .ph-caption {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.875rem;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  transition: opacity var(--med) var(--ease);
}
.phone .ph-caption mark {
  background: none;
  color: #ffd84d;
}
.phone .ph-empty {
  position: absolute;
  inset: auto 0.75rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: #e3e6eb;
}
.phone .ph-slot {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  background: #1b1a18;
}
.phone .layer,
.phone > img {
  transition: opacity var(--med) var(--ease);
}
.scrub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.scrub .dots {
  display: flex;
  gap: 0.25rem;
}
.scrub .dots span {
  width: 0.75rem;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  transition:
    width var(--med) var(--ease),
    background var(--med) var(--ease);
}
.scrub .dots span.on {
  width: 1.5rem;
  background: var(--amber);
}
.stats {
  align-self: stretch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  font-size: 0.8125rem;
}
.stats div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.stats dt,
.stats .k {
  color: var(--muted);
}
.stats .v {
  font-family: var(--mono);
  text-align: right;
}

/* ── Character cards, picks */
.pick {
  border-radius: 14px;
  border: 2px solid transparent;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition:
    border-color var(--med) var(--ease),
    transform var(--med) var(--ease);
}
.pick img {
  width: 100%;
  border-radius: 10px;
  display: block;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.pick:hover {
  transform: translateY(-2px);
}
.pick.selected {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--raised);
  color: var(--muted);
}
.badge.LOCKED,
.badge.DONE,
.badge.green {
  background: var(--green-soft);
  color: var(--green);
}
.badge.amber,
.badge.DRAFT {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge.FAILED {
  background: var(--red-soft);
  color: var(--red);
}
.ident {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.ident .portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  object-fit: cover;
  background: var(--raised);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.ident .portrait.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8125rem;
  border: 1px dashed var(--line-2);
  box-shadow: none;
}
.ident h2 {
  font-size: 1.5rem;
  font-weight: 800;
}
.lib {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}
.lib-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition:
    transform var(--med) var(--ease),
    border-color var(--med) var(--ease),
    box-shadow var(--med) var(--ease);
}
.lib-card:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.lib-card .cover {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
  background: var(--raised);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8125rem;
}
.lib-card .meta {
  padding: 0.875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lib-card .meta strong {
  font-family: var(--display);
  font-size: 1.125rem;
}
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.875rem;
}
details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform var(--med) var(--ease);
  flex-shrink: 0;
}
details[open] > summary::before {
  transform: rotate(45deg);
}
details[open] > :not(summary) {
  animation: fade-up var(--med) var(--ease) both;
}

/* ── Loading states */
.skeleton {
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--raised) 0%,
    #2a2723 50%,
    var(--raised) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.working-card {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--blue);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
img.fade {
  opacity: 0;
  transition: opacity 420ms var(--ease);
}
img.fade.loaded {
  opacity: 1;
}

/* ── Motion */
.enter {
  animation: fade-up var(--med) var(--ease) both;
}
.enter-list > * {
  animation: fade-up var(--med) var(--ease) both;
}
.enter-list > *:nth-child(2) {
  animation-delay: 40ms;
}
.enter-list > *:nth-child(3) {
  animation-delay: 80ms;
}
.enter-list > *:nth-child(4) {
  animation-delay: 120ms;
}
.enter-list > *:nth-child(n + 5) {
  animation-delay: 160ms;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}
@keyframes glow {
  0%,
  100% {
    box-shadow:
      0 0 0 6px rgba(245, 181, 68, 0.14),
      0 0 18px rgba(245, 181, 68, 0.25);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(245, 181, 68, 0.2),
      0 0 30px rgba(245, 181, 68, 0.42);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}
/* ── Costs: per-step blocks, items, service split, breakdown sheet */
.eyebrow.green {
  color: var(--green);
}
[data-step-cost]:empty {
  display: none;
}
.cost-step {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.625rem 0.875rem;
}
.cost-step > summary,
.cost-step.empty {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  flex-wrap: wrap;
  min-height: 1.75rem;
}
.cost-step > summary::before {
  align-self: center;
}
.cost-step .label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cost-step .total {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}
.cost-step .facts {
  font-size: 0.75rem;
  color: var(--muted);
}
.cost-step[open] > summary {
  margin-bottom: 0.5rem;
}
.cost-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.cost-item {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
}
.cost-item .what {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.cost-item .name {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
  color: var(--text);
}
.cost-item .how {
  font-size: 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.cost-item .amt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-align: right;
  white-space: nowrap;
}
.cost-item.failed .name,
.cost-item.failed .amt {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--red);
}
.cost-item.ahead .name,
.cost-item.ahead .amt {
  color: var(--amber);
}
.svc {
  justify-self: start;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.4375rem;
  border-radius: 6px;
  background: var(--raised);
  color: var(--muted);
  white-space: nowrap;
}
.svc.claude {
  background: var(--blue-soft);
  color: var(--blue);
}
.svc.hypihub {
  background: var(--violet-soft);
  color: var(--violet);
}
.svc.eleven {
  background: var(--rose-soft);
  color: var(--rose);
}
.svc.ahead {
  background: var(--amber-soft);
  color: var(--amber);
}
.cost-split {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cost-bar {
  display: flex;
  height: 0.5rem;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  background: var(--raised);
}
.cost-bar span {
  min-width: 4px;
  transition: flex-grow var(--med) var(--ease);
}
.cost-bar .claude,
.cost-legend i.claude {
  background: var(--blue);
}
.cost-bar .hypihub,
.cost-legend i.hypihub {
  background: var(--violet);
}
.cost-bar .eleven,
.cost-legend i.eleven {
  background: var(--rose);
}
.cost-legend i.local {
  background: var(--line-2);
}
.cost-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.cost-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.cost-legend i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
}
.cost-legend b {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}
.cost-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.cost-hero > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cost-big {
  font-family: var(--mono);
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.cost-big.amber {
  color: var(--amber);
}
.cost-big.green {
  color: var(--green);
}
.cost-facts {
  margin: 0;
  padding-left: 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.cost-how {
  font-size: 0.8125rem;
  color: var(--muted);
}
.cost-how ul {
  margin: 0.5rem 0 0;
  padding-left: 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  line-height: 1.45;
}
/* The band's cost chip opens the breakdown. */
button.cost-chip {
  min-height: 0;
  padding: 0.3125rem 0.75rem;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  gap: 0.375rem;
}
button.cost-chip:hover:not(:disabled) {
  border-color: var(--amber-line);
  background: var(--raised);
}
button.cost-chip .ahead {
  color: var(--amber);
}
.side-cost {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
}
dialog.sheet {
  margin: 0 0 0 auto;
  height: 100dvh;
  max-height: none;
  width: min(36rem, 100vw);
  max-width: none;
  padding: 0;
  border: none;
  border-left: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--text);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
  animation: sheet-in var(--med) var(--ease) both;
}
dialog.sheet::backdrop {
  background: rgba(8, 7, 6, 0.6);
  backdrop-filter: blur(2px);
  animation: fade-in var(--med) var(--ease) both;
}
.sheet-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@keyframes sheet-in {
  from {
    transform: translateX(2.5rem);
    opacity: 0;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@media (max-width: 560px) {
  .cost-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .cost-item .svc {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
