:root {
  --ink: #1f201d;
  --ink-soft: #52534f;
  --muted: #8c8b84;
  --line: #e7e2d9;
  --paper: #f4f1ea;
  --surface: #fbfaf6;
  --white: #ffffff;
  --accent: #f35d35;
  --accent-dark: #d84321;
  --accent-soft: #ffe8df;
  --sage: #bfd4c6;
  --sage-dark: #406653;
  --yellow: #f3cb64;
  --blue: #bcd9e8;
  --shadow-sm: 0 2px 8px rgba(31, 32, 29, 0.05);
  --shadow-md: 0 16px 40px rgba(31, 32, 29, 0.09);
  --shadow-lg: 0 30px 80px rgba(31, 32, 29, 0.16);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --sidebar-width: 236px;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Baskerville", "Iowan Old Style", "Songti SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button,
[role="button"],
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(243, 93, 53, 0.25);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 26px;
  color: var(--ink);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 6px;
  color: var(--white);
  border-radius: 11px;
  background: var(--ink);
  transform: rotate(-3deg);
}

.brand-mark span {
  border-radius: 3px;
  background: currentColor;
}

.brand-mark span:nth-child(2) {
  border-radius: 50%;
  background: var(--accent);
}

.brand-mark span:nth-child(3) {
  opacity: 0.45;
}

.brand-text {
  display: grid;
  line-height: 1;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-text small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.nav-label {
  padding: 13px 12px 8px;
  color: #aaa79f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: #696963;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: #f1eee6;
}

.nav-item.is-active {
  color: var(--ink);
  border-color: #e3ded4;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.nav-item.is-active .icon {
  color: var(--accent);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
}

.nav-item-badge {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 6px;
  color: var(--accent-dark);
  border-radius: 20px;
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.sidebar-spacer {
  flex: 1;
}

.plan-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  color: #eae9e2;
  border-radius: 16px;
  background: #292a27;
}

.plan-card::after {
  position: absolute;
  right: -28px;
  bottom: -46px;
  width: 110px;
  height: 110px;
  border: 18px solid rgba(243, 93, 53, 0.24);
  border-radius: 50%;
  content: "";
}

.plan-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

.plan-card-top .icon {
  width: 15px;
  height: 15px;
  color: var(--yellow);
}

.plan-meter {
  position: relative;
  z-index: 1;
  height: 4px;
  margin: 13px 0 8px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
}

.plan-meter span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.plan-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #a9aaa3;
  font-size: 10px;
}

.plan-card button {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 7px 10px;
  color: var(--ink);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 8px 6px 0;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #25322a;
  border-radius: 50%;
  background: var(--sage);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
}

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

.sidebar-user strong,
.sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  font-size: 12px;
}

.sidebar-user span {
  color: var(--muted);
  font-size: 10px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  border-color: #d6d0c6;
}

.main {
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(231, 226, 217, 0.86);
  background: rgba(244, 241, 234, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 700;
}

.topbar-title span {
  color: var(--muted);
  font-weight: 500;
}

.topbar-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-spacer {
  flex: 1;
}

.credit-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.install-topbar {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
}

.ai-provider-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.ai-provider-chip .icon {
  width: 14px;
  height: 14px;
}

.ai-provider-chip.is-connected {
  color: var(--sage-dark);
  border-color: #d4e3d8;
  background: #eff6f1;
}

.ai-provider-chip.is-connected .icon {
  color: #4e8a65;
}

.ai-provider-chip:hover {
  color: var(--ink);
  border-color: #c9c2b6;
}

.credit-chip .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.mobile-menu {
  display: none;
}

.page {
  width: min(100%, 1420px);
  margin: 0 auto;
  padding: 32px 34px 64px;
  animation: page-in 380ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 1px;
  background: currentColor;
  content: "";
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.page-subtitle {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.page-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button .icon {
  width: 17px;
  height: 17px;
}

.button-primary {
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 32, 29, 0.14);
}

.button-primary:hover {
  background: #0e0f0d;
  box-shadow: 0 12px 24px rgba(31, 32, 29, 0.2);
}

.button-accent {
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(243, 93, 53, 0.2);
}

.button-accent:hover {
  background: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--white);
}

.button-secondary:hover {
  border-color: #cbc5ba;
}

.button-ghost {
  color: var(--ink-soft);
  background: transparent;
}

.button-ghost:hover {
  color: var(--ink);
  background: rgba(31, 32, 29, 0.05);
}

.button-soft {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.button-sm {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 11px;
}

.button-lg {
  min-height: 50px;
  padding: 13px 21px;
  border-radius: 14px;
  font-size: 13px;
}

.button-wide {
  width: 100%;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: 350px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  border-radius: var(--radius-lg);
  color: var(--white);
  background:
    radial-gradient(circle at 8% 8%, rgba(243, 93, 53, 0.18), transparent 30%),
    #232420;
  box-shadow: var(--shadow-md);
}

.hero::before {
  position: absolute;
  inset: 0;
  opacity: 0.11;
  background-image: radial-gradient(circle, #fff 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  content: "";
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 45px clamp(28px, 4vw, 62px);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 9px;
  color: #e8e1d3;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hero-kicker .icon {
  width: 14px;
  height: 14px;
  color: var(--yellow);
}

.hero h1 {
  max-width: 650px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.2vw, 64px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.hero h1 em {
  color: #f6825e;
  font-style: italic;
}

.hero p {
  max-width: 470px;
  margin: 18px 0 26px;
  color: #bbbdb5;
  font-size: 13px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero .button-primary {
  color: var(--ink);
  background: var(--white);
}

.hero .button-secondary {
  color: #e6e6df;
  border-color: rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.06);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 350px;
  padding: 30px 42px 0;
}

.hero-visual::before {
  position: absolute;
  top: 8%;
  left: 8%;
  width: 84%;
  height: 84%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
}

.hero-visual .studio-panel {
  position: relative;
  width: min(100%, 380px);
  min-height: 310px;
  border-radius: 26px 26px 0 0;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(233, 224, 207, 0.94)),
    #e8e1d3;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

.floating-tag {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(31, 32, 29, 0.16);
  backdrop-filter: blur(12px);
  font-size: 10px;
  font-weight: 700;
  animation: float 5s ease-in-out infinite;
}

.floating-tag .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.floating-tag.tag-a {
  top: 58px;
  right: 13px;
}

.floating-tag.tag-b {
  top: 184px;
  left: 7px;
  animation-delay: -2.5s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 30px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stat-icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--sage);
}

.stat-card:nth-child(2) .stat-icon {
  background: var(--accent-soft);
}

.stat-card:nth-child(3) .stat-icon {
  background: #edf0cd;
}

.stat-card:nth-child(4) .stat-icon {
  background: #e3e1f3;
}

.stat-icon .icon {
  width: 18px;
  height: 18px;
}

.stat-copy span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.stat-copy strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.stat-copy small {
  margin-left: 5px;
  color: var(--sage-dark);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2,
.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--accent-dark);
}

.text-button .icon {
  width: 14px;
  height: 14px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition:
    transform 200ms ease,
    box-shadow 200ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.project-cover {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: #ebe6db;
}

.project-cover .bag-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}

.project-status {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 3;
  padding: 5px 8px;
  color: var(--ink);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.89);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 800;
}

.project-status.done {
  color: var(--sage-dark);
}

.project-more {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 29px;
  min-width: 29px;
  height: 29px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
}

.project-info {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
}

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

.project-info h3 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.project-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.progress-ring {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress, 0%), #eee9df 0);
}

.progress-ring::after {
  grid-area: 1 / 1;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--white);
  content: "";
}

.progress-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  font-size: 8px;
  font-weight: 800;
}

.new-project-card {
  display: grid;
  min-height: 258px;
  place-items: center;
  padding: 24px;
  color: var(--ink-soft);
  border: 1px dashed #ccc5b9;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  text-align: center;
  transition: 180ms ease;
}

.new-project-card:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.new-project-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
}

.new-project-card strong {
  display: block;
  font-size: 12px;
}

.new-project-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

/* Community work gallery */
.works-section {
  margin-top: 36px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.works-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.works-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.works-heading > div:first-child > p:last-child {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.works-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.creator-wallet {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 12px;
  min-width: 156px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
}

.creator-wallet span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.creator-wallet strong {
  grid-row: 2;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.creator-wallet .icon {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.works-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.works-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #e9e5dd;
}

.works-tabs button {
  padding: 6px 10px;
  color: var(--muted);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.works-tabs button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.works-tabs button span {
  margin-left: 3px;
  color: var(--accent-dark);
}

.works-rule {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.works-rule .icon {
  width: 13px;
  height: 13px;
  color: var(--sage-dark);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
}

.user-work-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.user-work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.user-work-card:focus-visible {
  outline: 3px solid rgba(243, 93, 53, 0.25);
  outline-offset: 2px;
}

.user-work-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.15;
  background: #e8e2d7;
}

.user-work-cover .bag-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}

.user-work-cover .bag-object {
  --bag-width: 46%;
  top: 57%;
}

.work-price {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 4;
  padding: 5px 7px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(31, 32, 29, 0.84);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 900;
}

.work-price small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 7px;
  font-weight: 600;
}

.work-own-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 4;
  padding: 4px 7px;
  color: #3c4e43;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  font-size: 7px;
  font-weight: 900;
}

.work-cover-copy {
  position: absolute;
  right: 9px;
  bottom: 9px;
  left: 9px;
  z-index: 3;
  color: var(--ink);
}

.user-work-cover.dark .work-cover-copy,
.user-work-card[data-work-id="black-editorial"] .work-cover-copy {
  color: var(--white);
}

.work-cover-copy small {
  display: block;
  margin-bottom: 3px;
  color: currentColor;
  opacity: 0.67;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.work-cover-copy strong {
  display: block;
  max-width: 90%;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.4vw, 19px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.work-card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
}

.creator-avatar {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  flex: 0 0 auto;
  color: #35473c;
  border-radius: 50%;
  background: var(--sage);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
}

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

.work-card-copy strong,
.work-card-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-copy strong {
  font-size: 9px;
}

.work-card-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
}

.work-use-arrow {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  border-radius: 50%;
  background: #f3f0e9;
}

.work-use-arrow .icon {
  width: 12px;
  height: 12px;
}

/* Bag product rendering */
.bag-scene {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.82), transparent 24%),
    linear-gradient(145deg, #ebe5d9 0%, #d9d1c2 100%);
}

.bag-scene::before {
  position: absolute;
  right: -25%;
  bottom: -42%;
  width: 110%;
  height: 90%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  content: "";
  transform: rotate(-12deg);
}

.bag-scene.studio {
  background:
    radial-gradient(ellipse at 50% 46%, #fff 0 17%, transparent 55%),
    linear-gradient(145deg, #f8f5ef, #e9e4d9);
}

.bag-scene.dark {
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.12), transparent 25%),
    linear-gradient(145deg, #35362f, #1f201d);
}

.bag-scene.sage {
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.5), transparent 25%),
    linear-gradient(145deg, #d4dfd5, #b7c9bb);
}

.bag-scene.warm {
  background:
    radial-gradient(circle at 72% 16%, rgba(255, 255, 255, 0.72), transparent 25%),
    linear-gradient(145deg, #f1d6c3, #ddb89f);
}

.bag-scene.ocean {
  background:
    radial-gradient(circle at 72% 16%, rgba(255, 255, 255, 0.65), transparent 25%),
    linear-gradient(145deg, #cbdfe6, #a8c6d1);
}

.bag-object {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: var(--bag-width, 43%);
  max-width: 176px;
  aspect-ratio: 0.82;
  transform: translate(-50%, -47%) rotate(var(--bag-rotate, -2deg));
  filter: drop-shadow(0 24px 15px rgba(39, 34, 27, 0.18));
}

.bag-object::before {
  position: absolute;
  top: -8%;
  left: 24%;
  width: 52%;
  height: 20%;
  border: clamp(5px, 0.6vw, 8px) solid #30302d;
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  content: "";
}

.bag-body {
  position: absolute;
  inset: 8% 0 8%;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 18% 18% 15% 15% / 10% 10% 8% 8%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.19), transparent 18% 78%, rgba(0, 0, 0, 0.1)),
    linear-gradient(165deg, color-mix(in srgb, var(--bag) 86%, white), var(--bag) 54%, color-mix(in srgb, var(--bag) 84%, black));
  box-shadow:
    inset 0 3px 7px rgba(255, 255, 255, 0.27),
    inset -7px 0 12px rgba(0, 0, 0, 0.08);
}

.bag-body::before {
  position: absolute;
  inset: 9% 7% auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.34);
  content: "";
}

.bag-ridges {
  position: absolute;
  inset: 20% 5% 19%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  opacity: 0.38;
}

.bag-ridges span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
}

.bag-handle {
  position: absolute;
  top: 38%;
  right: -3%;
  width: 7%;
  height: 21%;
  border: 2px solid #343431;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: transparent;
}

.bag-brand {
  position: absolute;
  top: 51%;
  left: 50%;
  display: inline-flex;
  width: 22%;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--bag) 50%, #28251f);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: clamp(10px, 1.5vw, 19px);
  font-weight: 800;
  letter-spacing: -0.08em;
  transform: translate(-50%, -50%);
}

.bag-wheel {
  position: absolute;
  bottom: 0;
  width: 15%;
  aspect-ratio: 1;
  border: 3px solid #31312e;
  border-radius: 50%;
  background: #53524c;
  box-shadow: inset 0 0 0 2px #252522;
}

.bag-wheel.left {
  left: 14%;
}

.bag-wheel.right {
  right: 14%;
}

.bag-shadow {
  position: absolute;
  bottom: 8%;
  left: 50%;
  width: 43%;
  height: 7%;
  border-radius: 50%;
  background: rgba(39, 34, 27, 0.18);
  filter: blur(8px);
  transform: translateX(-50%);
}

.bag-object.small {
  --bag-width: 49%;
}

.bag-object.hero-size {
  --bag-width: 41%;
  top: 53%;
}

/* Studio workflow */
.workflow {
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(251, 250, 246, 0.8);
}

.workflow-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.workflow-step {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.workflow-step:hover {
  color: var(--ink);
  background: rgba(31, 32, 29, 0.035);
}

.workflow-step.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.workflow-step.is-done {
  color: var(--sage-dark);
}

.step-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #d9d3c8;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.workflow-step.is-active .step-number {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent);
}

.workflow-step.is-done .step-number {
  color: var(--sage-dark);
  border-color: var(--sage);
  background: #e6efe9;
}

.step-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.studio-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 17px;
}

.studio-heading h1 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.studio-heading p {
  max-width: 600px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.project-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.project-code::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75a17d;
  content: "";
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 16px;
}

.studio-layout.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.studio-layout.wide-left {
  grid-template-columns: minmax(0, 1.42fr) minmax(310px, 0.58fr);
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.panel.soft {
  background: var(--surface);
}

.panel.dark {
  color: var(--white);
  border-color: #30312d;
  background: #232420;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel-head .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.count-pill {
  padding: 4px 8px;
  color: var(--sage-dark);
  border-radius: 20px;
  background: #e6efe9;
  font-size: 9px;
  font-weight: 800;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.capture-card {
  position: relative;
  display: flex;
  min-height: 150px;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px 10px;
  border: 1px dashed #d5cec2;
  border-radius: 13px;
  background: #f8f6f1;
  cursor: pointer;
  text-align: center;
  transition: 160ms ease;
}

.capture-card:hover {
  border-color: var(--accent);
  background: #fff8f4;
}

.capture-card.is-filled {
  border-style: solid;
  border-color: #dcd7ce;
  background: #f1eee7;
}

.capture-preview {
  position: absolute;
  inset: 0;
}

.capture-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-preview .bag-scene {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

.capture-card.is-filled::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, rgba(20, 20, 18, 0.64));
  content: "";
}

.capture-icon {
  position: relative;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.capture-icon .icon {
  width: 16px;
  height: 16px;
}

.capture-card strong {
  position: relative;
  z-index: 2;
  font-size: 11px;
}

.capture-card span {
  position: relative;
  z-index: 2;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.capture-card.is-filled strong,
.capture-card.is-filled span {
  position: absolute;
  right: 8px;
  bottom: 20px;
  left: 8px;
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.capture-card.is-filled span {
  bottom: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.capture-done {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--white);
  border-radius: 50%;
  background: var(--sage-dark);
}

.capture-done .icon {
  width: 12px;
  height: 12px;
}

.capture-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 11px;
  color: #6b5d39;
  border-radius: 11px;
  background: #fbf4d8;
  font-size: 9px;
  line-height: 1.6;
}

.capture-tip .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.capture-stage {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border-radius: 15px;
}

.capture-stage .bag-scene {
  min-height: 340px;
  border-radius: 15px;
}

.guide-corner {
  position: absolute;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-color: rgba(255, 255, 255, 0.75);
  border-style: solid;
  pointer-events: none;
}

.guide-corner.tl {
  top: 16px;
  left: 16px;
  border-width: 1px 0 0 1px;
}

.guide-corner.tr {
  top: 16px;
  right: 16px;
  border-width: 1px 1px 0 0;
}

.guide-corner.bl {
  bottom: 16px;
  left: 16px;
  border-width: 0 0 1px 1px;
}

.guide-corner.br {
  right: 16px;
  bottom: 16px;
  border-width: 0 1px 1px 0;
}

.stage-label {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 4;
  padding: 5px 9px;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: rgba(22, 23, 20, 0.35);
  backdrop-filter: blur(8px);
  font-size: 8px;
  font-weight: 700;
  transform: translateX(-50%);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}

.color-dot {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #d7d2c8;
  cursor: pointer;
}

.color-dot.is-active::after {
  position: absolute;
  inset: -5px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  content: "";
}

.add-color {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed #ccc5b9;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.add-color .icon {
  width: 13px;
  height: 13px;
}

.color-meta {
  min-width: 0;
  margin-left: auto;
  text-align: right;
}

.color-meta strong,
.color-meta span {
  display: block;
}

.color-meta strong {
  font-size: 11px;
}

.color-meta span {
  color: var(--muted);
  font-size: 9px;
}

.product-ai-summary {
  margin-top: 13px;
  padding: 11px;
  border: 1px solid #dfe8e1;
  border-radius: 10px;
  background: #f2f7f3;
}

.product-ai-summary > span {
  display: block;
  color: var(--sage-dark);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.product-ai-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}

.product-ai-summary p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-ai-summary small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 7px;
}

.studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.save-state .icon {
  width: 14px;
  height: 14px;
  color: var(--sage-dark);
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Retouch */
.retouch-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  background: #eeeae2;
}

.retouch-stage .bag-scene {
  min-height: 430px;
  border-radius: 15px;
}

.retouch-stage.compare-before .bag-scene {
  filter: brightness(0.88) saturate(0.8);
  background:
    linear-gradient(20deg, transparent 46%, rgba(90, 87, 79, 0.2) 47% 48%, transparent 49%),
    linear-gradient(145deg, #cdc8bf, #8f918c);
}

.retouch-stage.compare-before::before {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 12px solid rgba(255, 255, 255, 0.18);
  content: "";
  pointer-events: none;
}

.retouch-labels {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.retouch-labels span {
  padding: 5px 8px;
  color: var(--ink);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  font-size: 8px;
  font-weight: 800;
}

.source-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 9px;
}

.source-switcher button {
  padding: 5px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.source-switcher button.is-active {
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}

.retouch-source-image {
  position: relative;
  z-index: 2;
  display: block;
  width: auto;
  max-width: 82%;
  height: auto;
  max-height: 390px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 18px 45px rgba(31, 32, 29, 0.11);
}

.retouch-source-image.is-generated {
  box-shadow: 0 16px 40px rgba(31, 32, 29, 0.09);
}

.retouch-source-image.is-pending {
  opacity: 0.62;
  filter: saturate(0.82);
}

.retouch-pending-source {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
}

.retouch-pending-source > span {
  position: absolute;
  bottom: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  color: var(--ink);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  font-size: 7px;
  font-weight: 800;
}

.retouch-pending-source > span .icon {
  width: 11px;
  height: 11px;
  color: var(--accent);
}

.retouch-sample-source {
  position: relative;
  width: min(72%, 390px);
  overflow: hidden;
  border-radius: 10px;
}

.retouch-sample-source .bag-scene {
  min-height: 330px;
  border-radius: 10px;
}

.retouch-sample-source > span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 4px 7px;
  color: var(--ink);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 7px;
  font-weight: 800;
}

.retouch-empty-source {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 360px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.retouch-empty-source .icon {
  width: 32px;
  height: 32px;
  margin-bottom: 9px;
  color: #aaa49a;
}

.retouch-empty-source strong {
  color: var(--ink);
  font-size: 11px;
}

.retouch-empty-source span {
  margin-top: 4px;
  font-size: 8px;
}

.retouch-source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.retouch-source-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
}

.retouch-source-card:hover {
  border-color: #c6bfb4;
}

.retouch-source-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(31, 32, 29, 0.05);
}

.retouch-source-card.is-empty {
  opacity: 0.62;
  border-style: dashed;
}

.retouch-source-preview {
  display: grid;
  width: 46px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #ece8e0;
}

.retouch-source-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.retouch-source-preview .bag-scene {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

.retouch-source-preview .bag-object {
  --bag-width: 57%;
}

.retouch-source-preview .icon {
  width: 15px;
  height: 15px;
  color: #aaa49a;
}

.retouch-source-meta {
  min-width: 0;
}

.retouch-source-meta strong,
.retouch-source-meta small {
  display: block;
}

.retouch-source-meta strong {
  font-size: 8px;
}

.retouch-source-meta small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 6px;
}

.retouch-generate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}

.retouch-generate-actions .button {
  min-height: 40px;
  padding-inline: 8px;
}

.ai-stream-status {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #e4ded4;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.ai-stream-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-stream-head > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
}

.ai-stream-head .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.ai-stream-head strong {
  color: var(--accent-dark);
  font-size: 8px;
}

.ai-stream-track {
  height: 3px;
  margin: 7px 0 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #e9e4dc;
}

.ai-stream-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f3b24f);
  transition: width 300ms ease;
}

.ai-stream-status p {
  margin: 0;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.5;
}

.ai-stream-status.is-complete {
  border-color: #cfe0d4;
  background: #f1f7f3;
}

.ai-stream-status.is-complete .ai-stream-head strong {
  color: var(--sage-dark);
}

.ai-stream-status.is-complete .ai-stream-track span {
  background: var(--sage-dark);
}

.compare-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(8px);
}

.compare-switch button {
  padding: 5px 8px;
  color: var(--muted);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.compare-switch button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.control-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid #eeeae2;
  border-radius: 11px;
}

.toggle-row-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #f2efe8;
}

.toggle-row-icon .icon {
  width: 15px;
  height: 15px;
}

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

.toggle-copy strong,
.toggle-copy span {
  display: block;
}

.toggle-copy strong {
  font-size: 10px;
}

.toggle-copy span {
  color: var(--muted);
  font-size: 8px;
}

.switch {
  position: relative;
  width: 34px;
  height: 21px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: #d9d5cd;
  cursor: pointer;
  transition: 180ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  content: "";
  transition: 180ms ease;
}

.switch.is-on {
  background: var(--ink);
}

.switch.is-on::after {
  transform: translateX(13px);
}

.variant-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.variant-card {
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}

.variant-card .bag-scene {
  min-height: 86px;
  border-radius: 8px;
}

.variant-card .bag-object {
  --bag-width: 47%;
}

.variant-card .bag-brand {
  font-size: 8px;
}

.variant-card .bag-wheel {
  border-width: 1.5px;
}

.variant-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 3px 2px;
  font-size: 8px;
  font-weight: 700;
}

.variant-meta span {
  color: var(--sage-dark);
  font-size: 7px;
}

.generation-note {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  padding: 11px;
  color: #4f5f55;
  border-radius: 10px;
  background: #eff5f0;
  font-size: 9px;
  line-height: 1.6;
}

.generation-note .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* Asset studio */
.asset-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.template-card {
  position: relative;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: 160ms ease;
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.template-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(31, 32, 29, 0.06);
}

.template-preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #e9e5dc;
}

.template-preview .bag-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}

.template-product-image {
  position: absolute;
  top: 54%;
  left: 58%;
  z-index: 2;
  width: 58%;
  height: 62%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 9px 5px rgba(31, 32, 29, 0.12));
}

.template-card .bag-object {
  --bag-width: 47%;
}

.template-copy {
  position: absolute;
  top: 9%;
  left: 8%;
  z-index: 3;
  max-width: 46%;
}

.template-copy small {
  display: block;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 5px;
  font-style: italic;
  letter-spacing: 0.08em;
}

.template-copy strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 0.95;
}

.template-copy em {
  display: block;
  margin-top: 4px;
  color: var(--accent-dark);
  font-family: var(--font-sans);
  font-size: 5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.template-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 3px 3px;
  font-size: 8px;
  font-weight: 800;
}

.template-name .icon {
  width: 11px;
  height: 11px;
  color: var(--muted);
}

.asset-tabs {
  display: flex;
  gap: 3px;
  margin-bottom: 12px;
  padding: 3px;
  border-radius: 10px;
  background: #f2efe8;
}

.asset-tab {
  flex: 1;
  padding: 7px 9px;
  color: var(--muted);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.asset-tab.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
}

.select {
  min-height: 33px;
  padding: 6px 30px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--white);
  background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%);
  background-position:
    calc(100% - 12px) 14px,
    calc(100% - 8px) 14px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  appearance: none;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.editor-toolbar-spacer {
  flex: 1;
}

.asset-canvas-wrap {
  display: grid;
  min-height: 480px;
  place-items: center;
  padding: 24px;
  border-radius: 14px;
  background:
    linear-gradient(45deg, #e9e5de 25%, transparent 25%),
    linear-gradient(-45deg, #e9e5de 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9e5de 75%),
    linear-gradient(-45deg, transparent 75%, #e9e5de 75%),
    #f2efe9;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-size: 16px 16px;
}

.asset-canvas {
  position: relative;
  width: min(100%, 430px);
  overflow: hidden;
  aspect-ratio: 1;
  background: #f1eee7;
  box-shadow: var(--shadow-md);
}

.asset-canvas .bag-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}

.asset-canvas .bag-object {
  --bag-width: 41%;
  top: 56%;
}

.asset-retouched-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.asset-retouched-bg .bag-scene {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

.asset-product-image {
  position: absolute;
  top: 57%;
  left: 58%;
  z-index: 2;
  width: 64%;
  height: 68%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 22px 12px rgba(31, 32, 29, 0.18));
}

.asset-generated-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-asset-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #f0c7b7;
  border-radius: 11px;
  background:
    radial-gradient(circle at 93% 10%, rgba(243, 93, 53, 0.15), transparent 38%),
    #fff7f2;
}

.ai-asset-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  border-radius: 9px;
  background: var(--accent);
}

.ai-asset-icon .icon {
  width: 15px;
  height: 15px;
}

.ai-asset-callout > div {
  min-width: 0;
  flex: 1;
}

.ai-asset-callout strong,
.ai-asset-callout div span {
  display: block;
}

.ai-asset-callout strong {
  font-size: 9px;
}

.ai-asset-callout div span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.5;
}

.ai-asset-callout .button {
  flex: 0 0 auto;
}

.editorial-copy {
  position: absolute;
  top: 8%;
  left: 8%;
  z-index: 3;
  width: 53%;
}

.editorial-copy small {
  display: block;
  color: #6f6d66;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.editorial-copy h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(27px, 3.3vw, 46px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.editorial-copy p {
  max-width: 130px;
  margin: 9px 0 0;
  color: #5c5a53;
  font-size: 7px;
  line-height: 1.6;
}

.editorial-copy .button {
  min-height: 25px;
  margin-top: 12px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 6px;
}

.canvas-tag {
  position: absolute;
  right: 6%;
  bottom: 7%;
  z-index: 3;
  width: 28%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

.canvas-tag span {
  display: block;
  color: #73716b;
  font-size: 5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.canvas-tag strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 12px;
}

.asset-properties {
  margin-top: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  font-size: 10px;
}

.input:focus {
  border-color: #aaa49a;
}

.platform-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.white-source-panel {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #dce6df;
  border-radius: 11px;
  background: #f3f8f4;
}

.white-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.white-source-head strong {
  font-size: 9px;
}

.white-source-head span {
  color: var(--muted);
  font-size: 7px;
}

.white-source-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.white-source-strip button {
  position: relative;
  overflow: hidden;
  padding: 3px;
  border: 1px solid #d8e5dc;
  border-radius: 7px;
  background: var(--white);
  cursor: pointer;
}

.white-source-strip button.is-active {
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 2px rgba(64, 102, 83, 0.08);
}

.white-source-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.white-source-strip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 6px;
  text-align: center;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 8px;
  font-weight: 700;
}

.platform-logo {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  color: var(--white);
  border-radius: 4px;
  background: var(--platform-color, var(--ink));
  font-size: 7px;
  font-weight: 900;
}

/* Models */
.model-filter-panel {
  margin-bottom: 13px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eeeae2;
}

.filter-row:last-child {
  border-bottom: 0;
}

.filter-label {
  width: 50px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.segment {
  padding: 5px 9px;
  color: var(--muted);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.segment:hover {
  color: var(--ink);
  background: #f4f1ea;
}

.segment.is-active {
  color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.model-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: 160ms ease;
}

.model-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.model-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(31, 32, 29, 0.07);
}

.portrait {
  position: relative;
  overflow: hidden;
  aspect-ratio: 0.86;
  background: #e7ded1;
}

.portrait svg {
  width: 100%;
  height: 100%;
}

.model-select-indicator {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
}

.model-select-indicator .icon {
  width: 12px;
  height: 12px;
}

.model-card.is-selected .model-select-indicator {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent);
}

.model-info {
  padding: 7px 8px;
}

.model-info strong,
.model-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-info strong {
  font-size: 9px;
}

.model-info span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
}

.model-stage {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  border-radius: 15px;
  background: #ded5c8;
}

.model-stage-bg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.84), transparent 38%),
    linear-gradient(145deg, #e9e1d5, #cbbfab);
}

.model-stage-bg svg {
  width: 94%;
  height: 100%;
}

.model-overlay-bag {
  position: absolute;
  z-index: 4;
  top: 52%;
  left: 62%;
  width: 30%;
  aspect-ratio: 0.82;
  transform: translate(-50%, -30%) rotate(2deg);
  filter: drop-shadow(0 22px 12px rgba(0, 0, 0, 0.24));
}

.model-overlay-bag .bag-object {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  transform: none;
  filter: none;
}

.generated-scene-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-model-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  padding: 5px 8px;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  background: rgba(31, 32, 29, 0.58);
  backdrop-filter: blur(8px);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.scene-caption {
  position: absolute;
  right: 13px;
  bottom: 13px;
  left: 13px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
}

.scene-caption-copy strong,
.scene-caption-copy span {
  display: block;
}

.scene-caption-copy strong {
  font-family: var(--font-display);
  font-size: 15px;
}

.scene-caption-copy span {
  color: var(--ink-soft);
  font-size: 8px;
}

.scene-caption .button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 8px;
}

.scene-options {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.scene-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
}

.scene-option span {
  color: var(--muted);
  font-weight: 500;
}

.scene-option .select {
  max-width: 150px;
}

/* Video */
.video-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
}

.phone-stage {
  display: grid;
  min-height: 580px;
  place-items: center;
  padding: 26px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.32), transparent 30%),
    #252622;
}

.phone-preview {
  position: relative;
  width: min(100%, 260px);
  overflow: hidden;
  aspect-ratio: var(--video-ratio, 9 / 16);
  border: 6px solid #11120f;
  border-radius: 25px;
  background: #eae4da;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  transition: aspect-ratio 300ms ease;
}

.phone-preview.ratio-1-1 {
  width: min(100%, 390px);
  border-radius: 18px;
}

.phone-preview.ratio-16-9 {
  width: min(100%, 530px);
  border-radius: 14px;
}

.phone-preview .bag-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}

.phone-preview .bag-object {
  --bag-width: 48%;
  top: 56%;
}

.video-scene-image,
.video-result-player {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-result-player {
  background: #11120f;
}

.video-source-empty {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  color: var(--muted);
  background: #eee9df;
  font-size: 7px;
  text-align: center;
}

.video-source-empty .icon {
  width: 25px;
  height: 25px;
}

.video-source-empty strong {
  color: var(--ink);
  font-size: 10px;
}

.video-source-empty.large {
  min-height: 360px;
}

.phone-preview.playing .bag-object {
  animation: campaign-bag 8s cubic-bezier(0.3, 0.7, 0.3, 1) infinite;
}

.phone-preview.playing .video-copy {
  animation: copy-reveal 8s ease infinite;
}

@keyframes campaign-bag {
  0%,
  100% {
    transform: translate(-50%, -47%) rotate(-2deg) scale(1);
  }
  45% {
    transform: translate(-49%, -51%) rotate(3deg) scale(1.12);
  }
  70% {
    transform: translate(-55%, -47%) rotate(-5deg) scale(1.04);
  }
}

@keyframes copy-reveal {
  0%,
  8% {
    opacity: 0;
    transform: translateY(12px);
  }
  20%,
  82% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.video-copy {
  position: absolute;
  top: 11%;
  right: 8%;
  left: 8%;
  z-index: 4;
  color: var(--ink);
  text-align: center;
}

.video-copy small {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid rgba(31, 32, 29, 0.22);
  border-radius: 20px;
  font-size: clamp(5px, 0.6vw, 8px);
  font-weight: 800;
  letter-spacing: 0.16em;
}

.video-copy h2 {
  margin: 7px 0 0;
  font-family: var(--font-display);
  font-size: clamp(25px, 3.7vw, 46px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.video-tagline {
  position: absolute;
  bottom: 8%;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: var(--white);
  border-radius: 20px;
  background: rgba(31, 32, 29, 0.83);
  font-size: clamp(6px, 0.7vw, 9px);
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
}

.video-tagline .icon {
  width: 12px;
  height: 12px;
  color: var(--yellow);
}

.video-controls {
  display: grid;
  gap: 14px;
}

.ratio-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ratio-card {
  display: grid;
  min-height: 78px;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  font-size: 8px;
  font-weight: 700;
}

.ratio-card:hover {
  border-color: #c8c1b5;
}

.ratio-card.is-active {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.ratio-shape {
  display: block;
  margin-bottom: 5px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.ratio-shape.r-9-16 {
  width: 17px;
  height: 30px;
}

.ratio-shape.r-1-1 {
  width: 23px;
  height: 23px;
}

.ratio-shape.r-16-9 {
  width: 34px;
  height: 19px;
}

.storyboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.storyboard-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 0.85;
  border-radius: 8px;
  background: #eee9df;
}

.storyboard-frame .bag-scene {
  min-height: 0;
  height: 100%;
  border-radius: 0;
}

.storyboard-frame .bag-object {
  --bag-width: 55%;
}

.storyboard-generated-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.storyboard-frame:hover .storyboard-generated-image {
  transform: scale(1.28) !important;
}

.storyboard-frame span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 3;
  padding: 2px 4px;
  color: var(--white);
  border-radius: 3px;
  background: rgba(31, 32, 29, 0.6);
  font-size: 5px;
  font-weight: 800;
}

.timeline-panel {
  margin-top: 12px;
}

.timeline {
  position: relative;
  display: flex;
  gap: 4px;
  height: 44px;
  overflow: hidden;
  border-radius: 8px;
  background: #e8e3da;
}

.timeline-segment {
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: #f6f2ea;
  font-size: 6px;
  font-weight: 800;
}

.timeline-segment:nth-child(2) {
  background: #ead7c6;
}

.timeline-segment:nth-child(3) {
  background: #d8e5dc;
}

.timeline-segment:nth-child(4) {
  background: #f2e6bc;
}

.timeline-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--play-progress, 0%);
  background: rgba(243, 93, 53, 0.22);
  border-right: 2px solid var(--accent);
  pointer-events: none;
}

.play-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.play-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}

.play-button .icon {
  width: 15px;
  height: 15px;
}

.play-time {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.video-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

/* Publish */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.package-card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.package-card:hover {
  border-color: #c6bfb3;
}

.package-card.is-selected {
  border-color: var(--ink);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(31, 32, 29, 0.04);
}

.package-card.recommended {
  color: var(--white);
  border-color: #2e2f2b;
  background: #242521;
}

.package-recommend {
  position: absolute;
  top: -7px;
  right: 10px;
  padding: 3px 7px;
  color: var(--ink);
  border-radius: 20px;
  background: var(--yellow);
  font-size: 7px;
  font-weight: 900;
}

.package-card small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.package-card.recommended small {
  color: #a8aaa3;
}

.package-card h3 {
  margin: 5px 0 0;
  font-size: 14px;
}

.package-price {
  display: flex;
  align-items: baseline;
  margin: 13px 0 11px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.package-price span {
  margin-left: 3px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
}

.package-card.recommended .package-price span {
  color: #a8aaa3;
}

.package-feature {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 8px;
}

.package-card.recommended .package-feature {
  color: #cdcec8;
}

.package-feature .icon {
  width: 11px;
  height: 11px;
  color: var(--sage-dark);
}

.package-card.recommended .package-feature .icon {
  color: #a9cbb6;
}

.order-summary {
  margin-top: 13px;
  padding: 13px;
  border-radius: 12px;
  background: #f5f2eb;
}

.delivery-offer {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 20%, rgba(243, 93, 53, 0.12), transparent 30%),
    var(--surface);
}

.delivery-offer.is-free {
  border-color: #efb49f;
  background:
    radial-gradient(circle at 90% 15%, rgba(243, 93, 53, 0.2), transparent 32%),
    linear-gradient(135deg, #fff8f4, #fff2e9);
}

.delivery-offer.is-unlocked {
  border-color: #b9d0c0;
  background:
    radial-gradient(circle at 90% 15%, rgba(96, 139, 113, 0.14), transparent 32%),
    #f2f7f3;
}

.delivery-price {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(31, 32, 29, 0.1);
  text-align: center;
}

.delivery-price small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.delivery-price strong {
  margin: 2px 0;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.delivery-price span {
  color: var(--accent-dark);
  font-size: 8px;
  font-weight: 800;
}

.delivery-offer.is-unlocked .delivery-price span {
  color: var(--sage-dark);
}

.delivery-offer-copy h3 {
  margin: 0;
  font-size: 13px;
}

.delivery-offer-copy p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.7;
}

.delivery-offer-copy .button {
  min-height: 29px;
  margin-top: 9px;
  padding: 5px 9px;
  font-size: 8px;
}

.delivery-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.delivery-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 47px;
  padding: 9px 10px;
  border: 1px solid #eeeae2;
  border-radius: 10px;
  background: var(--white);
}

.delivery-rule-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--sage-dark);
  border-radius: 8px;
  background: #eaf2ec;
}

.delivery-rule-icon .icon {
  width: 13px;
  height: 13px;
}

.delivery-rule:nth-child(4) .delivery-rule-icon {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.delivery-rule strong,
.delivery-rule span {
  display: block;
}

.delivery-rule strong {
  font-size: 9px;
}

.delivery-rule span {
  color: var(--muted);
  font-size: 7px;
}

.revision-callout {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 11px;
  color: #48564d;
  border: 1px solid #dce9e0;
  border-radius: 11px;
  background: #f1f7f3;
}

.revision-callout > .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--sage-dark);
}

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

.revision-copy strong,
.revision-copy span {
  display: block;
}

.revision-copy strong {
  color: var(--ink);
  font-size: 9px;
}

.revision-copy span {
  color: #718078;
  font-size: 8px;
  line-height: 1.5;
}

.revision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.revision-actions button {
  min-height: 27px;
  padding: 5px 8px;
  color: var(--sage-dark);
  border: 1px solid #cfe0d4;
  border-radius: 7px;
  background: var(--white);
  cursor: pointer;
  font-size: 7px;
  font-weight: 800;
}

.revision-actions button:hover {
  border-color: var(--sage-dark);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.summary-row strong {
  color: var(--ink);
}

.summary-row.total {
  margin-top: 4px;
  padding-top: 10px;
  color: var(--ink);
  border-top: 1px solid #e0dbd2;
  font-size: 10px;
}

.summary-row.total strong {
  font-family: var(--font-display);
  font-size: 22px;
}

.summary-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.platform-list {
  display: grid;
  gap: 7px;
}

.platform-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.platform-row:hover {
  background: var(--white);
}

.platform-row.is-connected {
  background: var(--white);
}

.platform-icon-lg {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  border-radius: 9px;
  background: var(--platform-color, var(--ink));
  font-size: 9px;
  font-weight: 900;
}

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

.platform-copy strong,
.platform-copy span {
  display: block;
}

.platform-copy strong {
  font-size: 10px;
}

.platform-copy span {
  color: var(--muted);
  font-size: 8px;
}

.checkbox {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  flex: 0 0 auto;
  color: transparent;
  border: 1px solid #cec8bd;
  border-radius: 5px;
  background: var(--white);
}

.platform-row.is-connected .checkbox {
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}

.checkbox .icon {
  width: 11px;
  height: 11px;
}

.ready-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  color: #43544a;
  border-radius: 11px;
  background: #eaf2ec;
}

.ready-card-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sage);
}

.ready-card strong,
.ready-card span {
  display: block;
}

.ready-card strong {
  font-size: 9px;
}

.ready-card span {
  color: #748077;
  font-size: 8px;
}

.publish-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.publish-footer .button-primary {
  flex: 1;
}

.work-preview-cover {
  position: relative;
  min-height: 270px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 14px;
  background: #e8e2d7;
}

.work-preview-cover .bag-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}

.work-preview-cover .bag-object {
  --bag-width: 37%;
  top: 57%;
}

.work-preview-copy {
  position: absolute;
  top: 9%;
  left: 8%;
  z-index: 3;
  display: flex;
  max-width: 53%;
  flex-direction: column;
  align-items: flex-start;
}

.work-preview-copy.is-light {
  color: var(--white);
}

.work-preview-copy small {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.65;
}

.work-preview-copy strong {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.92;
}

.work-preview-copy span {
  margin-top: 8px;
  font-size: 8px;
  opacity: 0.74;
}

.work-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.work-author-row .creator-avatar {
  width: 32px;
  height: 32px;
}

.work-author-row > div {
  min-width: 0;
  flex: 1;
}

.work-author-row strong,
.work-author-row span {
  display: block;
}

.work-author-row strong {
  font-size: 10px;
}

.work-author-row > div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.creator-balance-card {
  display: flex;
  min-height: 135px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin-top: 15px;
  padding: 18px;
  overflow: hidden;
  color: var(--white);
  border-radius: 14px;
  background:
    radial-gradient(circle at 86% 20%, rgba(243, 93, 53, 0.37), transparent 31%),
    #252622;
}

.creator-balance-card span {
  color: #b9bbb4;
  font-size: 8px;
  font-weight: 700;
}

.creator-balance-card strong {
  margin: 4px 0;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
}

.creator-balance-card small {
  color: #a6aaa3;
  font-size: 8px;
}

.install-app-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.install-app-card img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.install-app-card > div {
  min-width: 0;
  flex: 1;
}

.install-app-card strong,
.install-app-card div span {
  display: block;
}

.install-app-card strong {
  font-size: 12px;
}

.install-app-card div span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.install-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.install-method {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}

.install-method-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.install-method-head strong {
  font-size: 9px;
}

.install-method ol {
  margin: 10px 0 0;
  padding-left: 17px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.8;
}

.install-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 8px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.install-url-row > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-url-row button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  color: var(--accent-dark);
  border-radius: 6px;
  background: var(--accent-soft);
  cursor: pointer;
  font-size: 7px;
  font-weight: 800;
}

.install-url-row .icon {
  width: 11px;
  height: 11px;
}

.ai-binding-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    radial-gradient(circle at 92% 12%, rgba(71, 139, 97, 0.12), transparent 34%),
    var(--surface);
}

.ai-binding-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  border-radius: 12px;
  background: linear-gradient(145deg, #ff8a32, #e84e28);
  box-shadow: 0 8px 18px rgba(232, 78, 40, 0.2);
}

.ai-binding-icon .icon {
  width: 20px;
  height: 20px;
}

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

.ai-binding-copy strong,
.ai-binding-copy span {
  display: block;
}

.ai-binding-copy strong {
  font-size: 11px;
}

.ai-binding-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.ai-binding-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.ai-binding-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b5b0a7;
  content: "";
}

.ai-binding-status.is-online {
  color: var(--sage-dark);
}

.ai-binding-status.is-online::before {
  background: #5e9a74;
  box-shadow: 0 0 0 3px rgba(94, 154, 116, 0.14);
}

.ai-model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.ai-model-tag {
  padding: 4px 7px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 7px;
  font-weight: 700;
}

.ai-model-tag.is-selected {
  color: var(--sage-dark);
  border-color: #cfe0d4;
  background: #eef6f0;
}

.model-routing-list {
  display: grid;
  gap: 5px;
  margin-top: 11px;
}

.model-routing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 47px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.model-route-step {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent-dark);
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 7px;
  font-weight: 900;
}

.model-routing-row > div {
  min-width: 0;
  flex: 1;
}

.model-routing-row strong,
.model-routing-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-routing-row strong {
  font-size: 8px;
}

.model-routing-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
}

.model-route-status {
  flex: 0 0 auto;
  padding: 3px 6px;
  color: var(--sage-dark);
  border-radius: 20px;
  background: #edf5ef;
  font-size: 6px;
  font-weight: 800;
}

.model-routing-row:last-child .model-route-status {
  color: #8a6641;
  background: #f7edde;
}

.ai-security-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 11px 0;
  padding: 9px 10px;
  color: #5f655f;
  border-radius: 9px;
  background: #f1f3ef;
  font-size: 8px;
  line-height: 1.6;
}

.ai-security-note .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--sage-dark);
}

/* Toast & Modal */
.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 240px;
  max-width: 360px;
  padding: 11px 13px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(31, 32, 29, 0.95);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: toast-in 280ms ease both;
  font-size: 11px;
}

.toast.is-leaving {
  animation: toast-out 220ms ease both;
}

.toast .icon {
  width: 16px;
  height: 16px;
  color: var(--yellow);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(5px);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 23, 20, 0.52);
  backdrop-filter: blur(5px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(100%, 440px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  animation: modal-in 260ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.modal-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 50%;
  background: #f3f0e9;
}

.modal-close .icon {
  width: 15px;
  height: 15px;
}

.modal-order {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f5f2eb;
}

.modal-order-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
}

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

.modal-order-copy strong,
.modal-order-copy span {
  display: block;
}

.modal-order-copy strong {
  font-size: 11px;
}

.modal-order-copy span {
  color: var(--muted);
  font-size: 8px;
}

.modal-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.payment-method.is-active {
  border-color: var(--ink);
  background: var(--white);
}

.payment-logo {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--white);
  border-radius: 8px;
  background: #22a652;
  font-size: 9px;
  font-weight: 900;
}

.payment-method:nth-child(2) .payment-logo {
  background: #1677ff;
}

.payment-method strong {
  display: block;
  font-size: 10px;
}

.payment-method span {
  display: block;
  color: var(--muted);
  font-size: 7px;
}

.modal-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 8px;
}

.modal-note .icon {
  width: 12px;
  height: 12px;
}

.success-state {
  padding: 8px 0 2px;
  text-align: center;
}

.success-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--white);
  border-radius: 50%;
  background: var(--sage-dark);
  box-shadow: 0 14px 25px rgba(64, 102, 83, 0.2);
}

.success-icon .icon {
  width: 28px;
  height: 28px;
}

.success-state h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.success-state p {
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 10px;
}

/* Upload status and task progress */
.task-button {
  position: relative;
  overflow: hidden;
}

.task-button .task-progress {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(var(--task, 0));
  transform-origin: left;
  transition: transform 200ms ease;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

/* Mobile bottom nav */
.mobile-nav {
  display: none;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .hero {
    grid-template-columns: 1fr 0.82fr;
  }

  .hero-copy {
    padding: 38px 34px;
  }

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

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

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

  .project-grid .new-project-card {
    min-height: 258px;
  }

  .studio-layout,
  .studio-layout.wide-left {
    grid-template-columns: 1fr;
  }

  .asset-layout {
    grid-template-columns: minmax(270px, 0.75fr) minmax(0, 1.25fr);
  }

  .model-stage {
    min-height: 430px;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-width: 84px;
  }

  .sidebar {
    padding: 21px 10px 14px;
  }

  .brand {
    justify-content: center;
    padding: 0 0 22px;
  }

  .brand-text,
  .nav-label,
  .nav-item span:not(.nav-item-badge),
  .plan-card,
  .sidebar-user,
  .sidebar-footer .icon-button {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 11px;
  }

  .nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .nav-item-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    padding: 1px 3px;
  }

  .sidebar-footer {
    justify-content: center;
    padding-top: 12px;
  }

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

  .hero-copy {
    padding: 38px 34px 0;
  }

  .hero-visual {
    min-height: 300px;
    padding: 20px 64px 0;
  }

  .hero-visual .studio-panel {
    min-height: 270px;
  }

  .floating-tag.tag-a {
    right: 28px;
  }

  .floating-tag.tag-b {
    left: 28px;
  }

  .studio-layout.equal,
  .asset-layout,
  .video-layout {
    grid-template-columns: 1fr;
  }

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

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

  .phone-stage {
    min-height: 490px;
  }

  .model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: 70px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 62px;
    padding: 0 17px;
  }

  .topbar-title span {
    display: none;
  }

  .credit-chip {
    padding: 7px 9px;
  }

  .credit-chip span {
    display: none;
  }

  .topbar > .button {
    display: none;
  }

  .topbar > .install-topbar {
    display: inline-grid;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    place-items: center;
  }

  .install-topbar span {
    display: none;
  }

  .ai-provider-chip span {
    display: none;
  }

  .ai-provider-chip {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }

  .page {
    padding: 22px 16px 34px;
  }

  .page-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
  }

  .page-heading-actions {
    width: 100%;
  }

  .page-heading-actions .button {
    flex: 1;
  }

  .page-title {
    font-size: 34px;
  }

  .hero {
    min-height: auto;
    border-radius: 20px;
  }

  .hero-copy {
    padding: 28px 23px 0;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero p {
    margin: 14px 0 20px;
    font-size: 11px;
  }

  .hero-actions .button {
    flex: 1;
    padding-inline: 10px;
  }

  .hero-visual {
    min-height: 245px;
    padding: 15px 34px 0;
  }

  .hero-visual .studio-panel {
    min-height: 220px;
    border-radius: 20px 20px 0 0;
  }

  .hero-visual .bag-object {
    --bag-width: 38%;
  }

  .floating-tag {
    padding: 7px 9px;
    font-size: 8px;
  }

  .floating-tag.tag-a {
    top: 36px;
    right: 7px;
  }

  .floating-tag.tag-b {
    top: 150px;
    left: 2px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
  }

  .stat-card {
    min-height: 82px;
    gap: 9px;
    padding: 11px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
  }

  .stat-copy strong {
    font-size: 21px;
  }

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

  .works-section {
    margin-top: 28px;
    padding-top: 24px;
  }

  .works-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .works-heading-actions {
    width: 100%;
  }

  .creator-wallet {
    flex: 1;
  }

  .works-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .user-work-cover {
    aspect-ratio: 1;
  }

  .project-cover {
    height: 205px;
  }

  .new-project-card {
    min-height: 150px !important;
  }

  .workflow {
    margin: 0 -16px 18px;
    padding: 9px 13px;
    overflow-x: auto;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    scrollbar-width: none;
  }

  .workflow::-webkit-scrollbar {
    display: none;
  }

  .workflow-track {
    display: flex;
    min-width: max-content;
  }

  .workflow-step {
    flex: 0 0 auto;
    padding: 7px 8px;
  }

  .studio-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .studio-heading h1 {
    font-size: 30px;
  }

  .studio-heading p {
    font-size: 11px;
  }

  .panel {
    padding: 14px;
    border-radius: 15px;
  }

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

  .capture-card {
    min-height: 135px;
  }

  .capture-stage,
  .capture-stage .bag-scene {
    min-height: 300px;
  }

  .studio-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .studio-actions {
    width: 100%;
  }

  .studio-actions .button {
    flex: 1;
  }

  .retouch-stage .bag-scene {
    min-height: 320px;
  }

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

  .asset-canvas-wrap {
    min-height: 310px;
    padding: 15px;
  }

  .editorial-copy h2 {
    font-size: 35px;
  }

  .ai-asset-callout {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ai-asset-callout > div {
    flex-basis: calc(100% - 44px);
  }

  .ai-asset-callout .button {
    width: 100%;
  }

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

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

  .model-stage {
    min-height: 390px;
  }

  .phone-stage {
    min-height: 475px;
    padding: 18px;
  }

  .phone-preview {
    width: min(100%, 225px);
  }

  .video-copy h2 {
    font-size: 35px;
  }

  .storyboard-frame {
    aspect-ratio: 1;
  }

  .video-settings {
    grid-template-columns: 1fr;
  }

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

  .package-card {
    min-height: 145px;
  }

  .summary-actions .button {
    flex: 1;
  }

  .delivery-offer {
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .delivery-price strong {
    font-size: 30px;
  }

  .delivery-rules {
    grid-template-columns: 1fr;
  }

  .revision-callout {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .revision-copy {
    flex-basis: calc(100% - 34px);
  }

  .revision-actions {
    width: 100%;
    padding-left: 29px;
  }

  .publish-footer {
    flex-direction: column-reverse;
  }

  .publish-footer .button {
    width: 100%;
  }

  .toast-root {
    right: 14px;
    bottom: 84px;
    left: 14px;
  }

  .toast {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-around;
    min-height: 58px;
    padding: 5px 6px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 17px;
    background: rgba(251, 250, 246, 0.93);
    box-shadow: 0 10px 35px rgba(31, 32, 29, 0.18);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-button {
    display: grid;
    min-width: 48px;
    gap: 2px;
    place-items: center;
    padding: 5px 8px;
    color: var(--muted);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-size: 8px;
    font-weight: 700;
  }

  .mobile-nav-button .icon {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-button.is-active {
    color: var(--accent-dark);
    background: var(--accent-soft);
  }

  .mobile-nav-button.create {
    width: 45px;
    min-width: 45px;
    height: 45px;
    margin-top: -18px;
    color: var(--white);
    border: 4px solid var(--paper);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 7px 16px rgba(243, 93, 53, 0.3);
  }

  .modal {
    padding: 18px;
  }

  .install-methods {
    grid-template-columns: 1fr;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
