*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #050508;
  --card: rgba(255, 255, 255, 0.03);
  --card2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --txt: #f3f5fb;
  --muted: #9098ad;
  --acc: #14f195;
  --acc2: #9945ff;
  --page-w: 1400px;
  --page-pad: 1rem;
  --sidebar-w: 340px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-bottom: 1.5rem;
}

html,
body {
  min-height: 100%;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
}

body {
  padding-bottom: 1.25rem;
}

.hidden {
  display: none !important;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(153, 69, 255, 0.16), transparent 40%),
    radial-gradient(circle at 90% 5%, rgba(20, 241, 149, 0.1), transparent 35%),
    var(--bg);
  z-index: -2;
}

.page-shell {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.top-stack {
  padding-bottom: 0.5rem;
}

.site-header {
  padding: 0.75rem 0 0;
}

.header-shell {
  position: relative;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(20, 241, 149, 0.4), rgba(153, 69, 255, 0.3), rgba(255, 255, 255, 0.06));
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.header-glow {
  position: absolute;
  inset: -30px 20% auto;
  height: 70px;
  background: radial-gradient(circle, rgba(20, 241, 149, 0.14), transparent 70%);
  pointer-events: none;
}

.header-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(10, 11, 18, 0.98), rgba(7, 8, 14, 0.98));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 241, 149, 0.25);
  background: rgba(20, 241, 149, 0.08);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 0.35rem;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc);
}

.brand h1 {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.15rem;
  background: linear-gradient(180deg, #fff 30%, #b8bfd4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.desc {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.contract-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.55rem 0.55rem 0.75rem;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card2);
}

.contract-meta {
  flex: 1;
  min-width: 0;
}

.lbl {
  display: block;
  font-size: 0.58rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.mint {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.64rem;
  word-break: break-all;
  line-height: 1.35;
}

.icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--txt);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn:hover:not(:disabled) {
  border-color: rgba(20, 241, 149, 0.4);
  background: rgba(20, 241, 149, 0.08);
}

.icon-btn.ok {
  border-color: rgba(20, 241, 149, 0.5);
  color: var(--acc);
}

.header-actions {
  display: flex;
  gap: 0.45rem;
}

.btn {
  border: none;
  border-radius: 11px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, var(--acc), #0bd89a);
  color: #04120d;
}

.btn.x {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  align-items: center;
  background: var(--card2);
  color: #fff;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.btn.x svg {
  width: 17px;
  height: 17px;
  display: block;
}

.btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 13, 20, 0.95);
  backdrop-filter: blur(12px);
}

.info-copy {
  min-width: 0;
  flex: 1;
}

.info-copy strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.info-copy p {
  font-size: 0.74rem;
  color: #a8b0c4;
  line-height: 1.45;
  max-width: 720px;
}

.info-copy em {
  font-style: normal;
  color: var(--acc);
  font-weight: 600;
}

.info-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.info-pill {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 241, 149, 0.25);
  background: rgba(20, 241, 149, 0.08);
  color: var(--acc);
  white-space: nowrap;
}

.main-empty {
  display: none;
}

.start-screen {
  margin-bottom: 1.25rem;
  padding: 1.35rem;
  border-radius: 20px;
  border: 1px solid rgba(20, 241, 149, 0.22);
  background:
    linear-gradient(180deg, rgba(20, 241, 149, 0.05), transparent 40%),
    linear-gradient(180deg, rgba(12, 13, 20, 0.98), rgba(8, 9, 14, 0.98));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.start-screen.hidden {
  display: none;
}

.start-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.start-title {
  font-size: 1.45rem;
  margin: 0.35rem 0 0.45rem;
  letter-spacing: -0.02em;
}

.start-lead {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 540px;
}

.start-controls {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.prompt-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(90deg, var(--acc2), var(--acc), var(--acc2));
  background-size: 220% 100%;
  animation: promptBorder 5s linear infinite;
}

.prompt-wrap:focus-within {
  animation-duration: 2.5s;
  box-shadow: 0 0 20px rgba(20, 241, 149, 0.15);
}

.prompt-wrap #prompt {
  width: 100%;
  min-height: 44px;
  padding: 0 0.95rem;
  font-size: 0.88rem;
  line-height: 1.4;
  border: none;
  border-radius: 11px;
  background: rgba(10, 12, 20, 0.96);
  color: #fff;
  outline: none;
}

.prompt-tw {
  position: absolute;
  left: 0.95rem;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #8a93a8;
  font-size: 0.88rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-tw.hidden {
  visibility: hidden;
}

.prompt-cursor {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: var(--acc);
  box-shadow: 0 0 6px rgba(20, 241, 149, 0.6);
  animation: promptBlink 1s step-end infinite;
}

@keyframes promptBorder {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 220% 50%;
  }
}

@keyframes promptBlink {
  50% {
    opacity: 0;
  }
}

.start-note {
  margin: 0;
  padding: 0.25rem 0 0;
  font-size: 0.72rem;
  color: #ffb020;
  min-height: 0;
}

.start-note:empty {
  display: none;
}

.start-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.studio-block.idle {
  opacity: 0.72;
  border-color: rgba(255, 255, 255, 0.08);
}

.studio-block.idle .block-n {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.studio-block.idle .block-st {
  color: var(--muted);
}

.idle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.idle-grid span {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.idle-aud {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.idle-aud span {
  height: 36px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.idle-vid {
  aspect-ratio: 16 / 9;
  max-width: 420px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.15);
}

.idle-vid svg {
  width: 36px;
  height: 36px;
}

.layout {
  display: flex;
  gap: 1rem;
  padding: 0.25rem 0;
  align-items: flex-start;
}

.main-col {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a0b12;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  align-self: flex-start;
  overflow: hidden;
  min-height: 0;
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 1.5rem);
}

.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.sidebar-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-count {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(20, 241, 149, 0.12);
  color: var(--acc);
  border: 1px solid rgba(20, 241, 149, 0.25);
}

.sidebar-list {
  flex: 1;
  min-height: 0;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 241, 149, 0.35) transparent;
  max-height: none;
}

.sidebar-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(20, 241, 149, 0.3);
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 241, 149, 0.45);
}

.sidebar-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.sb-card--fresh {
  border: 2px solid var(--acc);
  box-shadow: 0 0 0 1px rgba(20, 241, 149, 0.35), 0 0 28px rgba(20, 241, 149, 0.3);
}

.sb-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sidebar-live {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(20, 241, 149, 0.15);
  margin-bottom: 0;
  max-height: 42%;
  min-height: 0;
}

.sidebar-live.hidden {
  display: none;
}

.sidebar-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem 0.55rem;
  flex-shrink: 0;
}

.sidebar-live-head h3 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--acc);
}

.sidebar-live-count {
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(20, 241, 149, 0.15);
  color: var(--acc);
  border: 1px solid rgba(20, 241, 149, 0.3);
}

.sidebar-live-list {
  padding: 0 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-live-empty {
  padding: 0 0.75rem 0.85rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

.live-card {
  border-radius: 12px;
  border: 1px solid rgba(20, 241, 149, 0.25);
  background: rgba(20, 241, 149, 0.06);
  overflow: hidden;
  flex-shrink: 0;
}

.live-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem 0.5rem;
}

.live-spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(20, 241, 149, 0.2);
  border-top-color: var(--acc);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.live-meta {
  flex: 1;
  min-width: 0;
}

.live-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.15rem;
  color: #fff;
}

.live-prompt {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-thumb {
  position: relative;
  height: 72px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.live-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.live-thumb-ph {
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  padding: 0.45rem 0.7rem 0.6rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
}

.live-stats span {
  color: var(--acc);
}

.step-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 0.55rem var(--page-pad) 0.65rem;
  background: linear-gradient(to top, rgba(5, 5, 8, 0.98) 70%, rgba(5, 5, 8, 0.88));
  border-top: 1px solid rgba(20, 241, 149, 0.28);
  backdrop-filter: blur(10px);
}

.step-dock-inner {
  max-width: var(--page-w);
  margin: 0 auto;
}

.step-dock-head {
  display: grid;
  grid-template-columns: minmax(0, max-content) 1fr;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1rem 1.25rem;
}

.step-dock-head-l {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex-shrink: 0;
}

.step-dock-progress {
  width: 100%;
  min-width: 0;
}

.step-dock-bar-global {
  position: relative;
  width: 100%;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-dock-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #0a9e6e, #0bd89a, var(--acc));
  border-radius: inherit;
  transition: width 0.6s ease;
  box-shadow: 0 0 14px rgba(20, 241, 149, 0.4);
}

.step-dock-pct {
  position: relative;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 10px rgba(0, 0, 0, 0.75),
    0 0 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  line-height: 1;
}

.step-dock-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0;
}

.step-dock-item {
  min-width: 0;
  padding: 0.45rem 0.5rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.step-dock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.step-dock-item dt {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
}

.step-ico {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
}

.step-ico--done {
  color: var(--acc);
}

.step-ico-svg {
  width: 13px;
  height: 13px;
  display: block;
}

.step-ico-spin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(20, 241, 149, 0.2);
  border-top-color: var(--acc);
  animation: spin 0.8s linear infinite;
}

.step-dock-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.step-dock-bar span {
  display: block;
  height: 100%;
  background: var(--acc);
  border-radius: inherit;
  transition: width 0.55s ease;
  min-width: 0;
}

.step-dock-item.running .step-dock-bar span {
  background: linear-gradient(90deg, var(--acc), #fff);
  animation: barPulse 1.2s ease-in-out infinite;
}

@keyframes barPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.step-dock-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.step-dock-item dd {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.step-dock-dur {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.step-dock-item.running {
  border-color: rgba(20, 241, 149, 0.45);
  background: rgba(20, 241, 149, 0.08);
}

.step-dock-item.running dd {
  color: var(--acc);
}

.step-dock-item.done {
  border-color: rgba(20, 241, 149, 0.5);
  background: rgba(20, 241, 149, 0.22);
}

.step-dock-item.done dt {
  color: rgba(20, 241, 149, 0.85);
}

.step-dock-item.done dd {
  color: #fff;
}

.step-dock-item.done .step-dock-dur {
  color: rgba(255, 255, 255, 0.55);
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card2);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.online-lbl {
  color: var(--muted);
  font-weight: 500;
}

.online-pill.online-up {
  color: var(--acc);
  border-color: rgba(20, 241, 149, 0.45);
  background: rgba(20, 241, 149, 0.1);
}

.online-pill.online-up .online-dot {
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc);
}

.online-pill.online-up .online-lbl {
  color: var(--acc);
}

.online-pill.online-down {
  color: #fff;
}

.online-pill.online-down .online-dot {
  background: #fff;
  box-shadow: none;
}

.step-dock-lbl {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--acc);
}

.step-dock-meta {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

body.has-step-dock {
  padding-bottom: 6.5rem;
}

body.has-step-dock .toast-stack {
  bottom: 6.75rem;
}

.asm-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.asm-msg {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  min-height: 1.4em;
}

.asm-msg .asm-cur {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: var(--acc);
  animation: promptBlink 1s step-end infinite;
}

.asm-log {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.asm-log-line {
  opacity: 0;
  animation: asmLineIn 0.35s ease forwards;
}

@keyframes asmLineIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.asm-log-line strong {
  color: var(--acc);
  font-weight: 700;
}

.asm-chapters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}

.asm-ch {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  opacity: 0.35;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

.asm-ch.active {
  opacity: 1;
  border-color: rgba(20, 241, 149, 0.35);
}

.asm-ch.done {
  opacity: 0.85;
}

.asm-ch-head {
  padding: 0.35rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--acc);
  border-bottom: 1px solid var(--border);
}

.asm-ch-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0.35rem;
}

.asm-slot {
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  font-size: 0.52rem;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  transition: background 0.25s ease;
}

.asm-slot.ready {
  background: rgba(20, 241, 149, 0.12);
  color: var(--acc);
}

.asm-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asm-ok {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--acc);
}

.sb-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #12141f;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.sb-card:hover {
  border-color: rgba(20, 241, 149, 0.35);
  transform: translateY(-2px);
}

.sb-thumb {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.sb-shade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

.sb-center {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.sb-play {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0a0b12;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
  padding: 0;
  margin: 0;
}

.sb-play:hover {
  transform: scale(1.08);
}

.sb-play svg {
  width: 18px;
  height: 18px;
  display: block;
  margin-left: 2px;
}

.sb-dur {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sb-st {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 3;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.sb-st--ready {
  color: var(--acc);
  border-color: rgba(20, 241, 149, 0.35);
}

.sb-st--processing {
  color: #ffb020;
  border-color: rgba(255, 176, 32, 0.35);
}

.sb-st--queued {
  color: #b8bfd4;
  border-color: rgba(255, 255, 255, 0.15);
}

.sb-body {
  padding: 0.75rem 0.85rem 0.85rem;
  background: #12141f;
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.sb-av {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(20, 241, 149, 0.25), rgba(153, 69, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.sb-user-txt {
  min-width: 0;
  flex: 1;
}

.sb-user-txt strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-txt time {
  display: block;
  font-size: 0.68rem;
  color: #8b93a8;
  margin-top: 0.1rem;
}

.sb-prompt {
  font-size: 0.78rem;
  color: #c8cede;
  line-height: 1.55;
  margin-bottom: 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sb-foot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sb-style {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(153, 69, 255, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(153, 69, 255, 0.3);
}

.studio {
  margin-bottom: 1.25rem;
  padding: 1.15rem;
  border-radius: 20px;
  border: 1px solid rgba(20, 241, 149, 0.2);
  background:
    linear-gradient(180deg, rgba(20, 241, 149, 0.04), transparent),
    linear-gradient(180deg, rgba(12, 13, 20, 0.98), rgba(8, 9, 14, 0.98));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.studio-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.panel-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--acc);
}

.studio-top h2 {
  font-size: 1.25rem;
  margin: 0.3rem 0 0.35rem;
  letter-spacing: -0.02em;
}

.studio-prompt {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
}

.credits-badge {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 44px;
  padding: 0.3rem 0.7rem;
  border-radius: 11px;
  border: 1px solid rgba(20, 241, 149, 0.5);
  background: rgba(20, 241, 149, 0.14);
  box-shadow: 0 0 16px rgba(20, 241, 149, 0.12);
  line-height: 1.05;
}

.credits-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--acc);
  letter-spacing: -0.02em;
}

.credits-lbl {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--acc);
}

.credits-badge.empty {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.credits-badge.empty .credits-num,
.credits-badge.empty .credits-lbl {
  color: var(--muted);
}

#prompt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dock-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.studio-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.studio-block {
  flex-shrink: 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.studio-block.active {
  border-color: rgba(20, 241, 149, 0.4);
  box-shadow: 0 0 0 1px rgba(20, 241, 149, 0.08) inset;
}

.studio-block.done {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.92;
}

.studio-block.pending {
  opacity: 0.45;
}

.studio-block.pending .block-body {
  display: none;
}

.block-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-block.pending .block-head {
  border-bottom: none;
}

.block-n {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.studio-block.active .block-n {
  border-color: rgba(20, 241, 149, 0.4);
  background: rgba(20, 241, 149, 0.12);
  color: var(--acc);
}

.studio-block.done .block-n {
  border-color: rgba(20, 241, 149, 0.35);
  background: var(--acc);
  color: #04120d;
}

.block-title {
  flex: 1;
  min-width: 0;
}

.block-title h3 {
  font-size: 0.92rem;
  margin-bottom: 0.1rem;
}

.block-title p {
  font-size: 0.72rem;
  color: var(--muted);
}

.block-st {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.studio-block.active .block-st {
  color: var(--acc);
}

.studio-block.done .block-st {
  color: var(--acc);
}

.st-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--acc);
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
}

.pipe-console {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.pipe-console-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pipe-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc);
}

.pipe-console-body {
  margin: 0;
  padding: 0.75rem 0.85rem;
  max-height: 160px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.55;
  color: #b8f5d8;
  white-space: pre-wrap;
  word-break: break-word;
}

.script-topic {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.script-topic:empty {
  display: none;
}

.script-loading {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.eta-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.eta-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.eta-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acc), #9945ff);
  transition: width 0.25s linear;
}

.eta-bar--media {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 1.55rem;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}

.media-box.loading .eta-bar--media {
  opacity: 1;
}

.script-loading.hidden {
  display: none;
}

.script-content.hidden {
  display: none;
}

.script-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.script-logline {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 0.85rem;
}

.script-scenes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 320px;
  overflow-y: auto;
}

.script-scenes li {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
}

.script-scenes li strong {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--acc);
  margin-bottom: 0.35rem;
}

.script-scenes li p {
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.block-body {
  padding: 0.85rem 1rem 1rem;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.scene-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.scene-row-h {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.scene-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.asset-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.media-box {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.media-tag {
  position: absolute;
  top: 0.4rem;
  left: 0.45rem;
  z-index: 3;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.42rem;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--acc);
  border: 1px solid rgba(20, 241, 149, 0.25);
}

.media-st {
  position: absolute;
  bottom: 0.4rem;
  right: 0.45rem;
  z-index: 3;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.media-fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.media-box.ready .media-img {
  opacity: 1;
}

.media-box.ready .media-fill {
  background: transparent !important;
}

.media-spin {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 2;
}

.media-spin::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--acc);
  animation: spin 0.8s linear infinite;
}

.media-box.loading .media-spin {
  display: grid;
}

.media-box.loading .media-st {
  color: var(--acc);
}

.media-box.ready .media-st {
  color: var(--acc);
}

.media-box.error .media-st {
  color: #f87171;
}

.media-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

.media-box.ready .media-vid {
  opacity: 1;
  pointer-events: auto;
}

.scene-slot {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.scene-n {
  display: none;
}

.scene-fill {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.scene-slot.ready .scene-fill {
  opacity: 1;
  transform: scale(1);
}

.scene-spin {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
}

.scene-spin::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--acc);
  animation: spin 0.8s linear infinite;
}

.scene-slot.loading .scene-spin {
  display: grid;
}

.audio-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.aud-slot {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.aud-el {
  width: 100%;
  height: 36px;
  min-width: 0;
}

.sb-card.sb-card--off {
  cursor: default;
}

.sb-card.sb-card--off .sb-play {
  opacity: 0.35;
  cursor: default;
}

.vid-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.vid-modal.hidden {
  display: none;
}

.vid-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}

.vid-modal-box {
  position: relative;
  width: min(920px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(20, 241, 149, 0.25);
  background: #12141f;
  padding: 1.25rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.vid-modal-x {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.vid-modal-x:hover {
  color: #fff;
}

.vid-modal-box h3 {
  margin: 0 2rem 0.75rem 0;
  font-size: 1.05rem;
}

.vid-modal-player {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.vid-modal-player video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.vid-modal-prompt {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.aud-slot.loading,
.aud-slot.ready {
  opacity: 1;
}

.aud-lbl {
  font-size: 0.72rem;
  font-weight: 600;
}

.aud-st {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.aud-slot.ready .aud-st {
  color: var(--acc);
}

@keyframes bar {
  0%, 100% { height: 15%; }
  50% { height: 90%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.video-stage {
  min-height: 280px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.video-empty,
.video-done {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 1.25rem;
  text-align: left;
}

.video-empty p {
  color: var(--muted);
  font-size: 0.85rem;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--acc);
  animation: spin 0.9s linear infinite;
}

.video-done {
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 1rem;
  padding: 1rem;
}

.final-hero {
  position: relative;
  width: 100%;
  border: none;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  aspect-ratio: 16 / 9;
}

.final-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.25s ease;
}

.final-hero:hover .final-poster-img {
  transform: scale(1.02);
}

.final-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0a0b12;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.final-play svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.final-dur {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
}

.final-meta p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.35rem 0 0.75rem;
}

.final-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.45rem 1rem;
  margin: 0;
}

.final-stats div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.final-stats dt {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
}

.final-stats dd {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--acc);
  margin: 0;
}

.final-stats .total dd {
  font-size: 0.95rem;
}

.media-actions {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 4;
  display: flex;
  gap: 0.35rem;
}

.media-actions.hidden {
  display: none;
}

.media-act {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.15s ease, color 0.15s ease;
}

.media-act:hover {
  background: var(--acc);
  color: #0a0b12;
}

.media-act svg {
  width: 14px;
  height: 14px;
}

.media-box.ready .media-fill {
  cursor: zoom-in;
}

.media-vid-wrap {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 2rem));
}

.toast {
  pointer-events: auto;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #0bd89a, #14f195);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #022a18;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 12px 40px rgba(20, 241, 149, 0.35);
  animation: toastIn 0.35s ease;
  min-width: 260px;
}

.toast strong {
  display: block;
  color: #04120d;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  font-weight: 800;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.hidden {
  display: none;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-box {
  position: relative;
  max-width: min(960px, 100%);
  max-height: 90vh;
}

.lightbox-box img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 12px;
  display: block;
}

.lightbox-x {
  position: absolute;
  top: -2rem;
  right: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
}

.lightbox-dl {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--acc);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.lightbox-dl:hover {
  text-decoration: underline;
}

.video-info p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.45rem;
}

.done-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(20, 241, 149, 0.15);
  color: var(--acc);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mob-recent {
  display: none;
  margin-top: 1.25rem;
  padding-bottom: 1rem;
}

.section-head {
  margin-bottom: 0.75rem;
}

.section-head h3 {
  font-size: 0.95rem;
}

.mob-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  padding: 0 0.25rem;
}

#prompt::placeholder {
  color: transparent;
}

.dock-btn {
  flex-shrink: 0;
  border-radius: 11px;
  padding: 0 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dock-btn:hover:not(.is-busy) {
  transform: translateY(-1px);
}

.dock-btn--ghost {
  color: #fff;
  background: var(--card2);
  border: 1px solid var(--border);
}

.dock-btn--ghost:hover:not(.is-busy) {
  border-color: rgba(20, 241, 149, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.dock-btn--run {
  color: #04120d;
  background: linear-gradient(135deg, var(--acc), #0bd89a);
  border: none;
  box-shadow: 0 4px 20px rgba(20, 241, 149, 0.4);
  min-width: 92px;
  font-weight: 700;
}

.dock-btn--run:hover:not(.is-busy) {
  box-shadow: 0 6px 28px rgba(20, 241, 149, 0.55);
}

.dock-btn.is-busy {
  pointer-events: none;
  opacity: 0.85;
}

@media (max-width: 1200px) {
  :root {
    --sidebar-w: 300px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .mob-recent {
    display: block;
  }
}

@media (max-width: 520px) {
  .step-dock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --page-pad: 0.65rem;
  }

  body.has-step-dock {
    padding-bottom: 7.5rem;
  }

  body.has-step-dock .toast-stack {
    bottom: 7.75rem;
  }

  .step-dock-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .step-dock-head {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .step-dock-bar-global {
    height: 22px;
  }

  .step-dock-pct {
    font-size: 0.72rem;
  }

  .step-dock-meta {
    font-size: 0.62rem;
  }

  .asm-chapters {
    grid-template-columns: repeat(2, 1fr);
  }

  body {
    padding-bottom: 1rem;
  }

  .top-stack {
    padding-bottom: 0.35rem;
  }

  .site-header {
    padding-top: 0.35rem;
  }

  .header-shell {
    border-radius: 14px;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "contract contract";
    gap: 0.5rem;
    padding: 0.6rem 0.65rem;
    border-radius: 13px;
  }

  .brand {
    grid-area: brand;
    min-width: 0;
  }

  .header-mid {
    grid-area: contract;
  }

  .header-actions {
    grid-area: actions;
    width: auto;
    flex-shrink: 0;
  }

  .brand .desc {
    display: none;
  }

  .brand h1 {
    font-size: 1rem;
    margin-bottom: 0;
  }

  .badge {
    margin-bottom: 0.2rem;
    font-size: 0.52rem;
    padding: 0.2rem 0.5rem;
  }

  .contract-row {
    padding: 0.45rem 0.45rem 0.45rem 0.6rem;
  }

  .mint {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
  }

  .btn.primary {
    flex: 0 1 auto;
    padding: 0.5rem 0.65rem;
    font-size: 0.72rem;
  }

  .btn.x {
    width: 36px;
    height: 36px;
  }

  .info-bar {
    display: none;
  }

  .start-screen {
    padding: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .start-top {
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
  }

  .start-title {
    font-size: 1.1rem;
    margin: 0.25rem 0 0.35rem;
  }

  .start-lead {
    font-size: 0.8rem;
  }

  .start-controls {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .start-controls #prompt,
  .start-controls .prompt-wrap {
    width: 100%;
    flex: 1 1 100%;
  }

  .start-controls .dock-btn,
  .start-controls .credits-badge {
    flex: 1;
    min-width: 0;
  }

  .credits-badge {
    flex: 0 0 auto;
    min-width: 58px;
  }

  .start-steps {
    margin-top: 0.85rem;
    gap: 0.55rem;
  }

  .idle-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }

  .asset-row {
    grid-template-columns: 1fr;
  }

  .scene-media {
    grid-template-columns: 1fr;
  }

  .aud-slot {
    grid-template-columns: 56px 1fr auto;
  }

  .studio-feed {
    gap: 0.75rem;
  }

  .video-done {
    flex-direction: column;
    text-align: center;
  }

  .video-thumb {
    width: 100%;
  }

  .mob-list {
    grid-template-columns: 1fr;
  }

  .mob-recent {
    margin-top: 0.85rem;
  }

  .studio {
    padding: 0.85rem;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 0.35rem;
  }

  .btn.primary svg {
    width: 14px;
    height: 14px;
  }

  .aud-slot {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}
