body.stitch-replica {
  --replica-bg: #f4f7fb;
  --replica-panel: rgba(255, 255, 255, 0.84);
  --replica-card: rgba(255, 255, 255, 0.72);
  --replica-border: rgba(255, 255, 255, 0.92);
  --replica-ink: #0f172a;
  --replica-muted: #64748b;
  --replica-indigo: #6366f1;
  --replica-purple: #8b5cf6;
  --replica-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
  margin: 0;
  color: var(--replica-ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96) 0, rgba(255, 255, 255, 0) 38%),
    linear-gradient(135deg, #f7faff 0%, var(--replica-bg) 58%, #eef3fb 100%);
  font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stitch-replica .app-frame {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.stitch-replica .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 16px;
  background: var(--replica-panel);
  border: 1px solid var(--replica-border);
  border-width: 0 1px 0 0;
  box-shadow: var(--replica-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.stitch-replica .side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.stitch-replica .brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--replica-indigo), var(--replica-purple));
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.22);
}

.stitch-replica .side-brand strong {
  color: #111827;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stitch-replica .side-nav {
  display: grid;
  gap: 6px;
}

.stitch-replica .side-nav a,
.stitch-replica .top-nav a,
.stitch-replica .side-safety-card,
.stitch-replica .hard-btn,
.stitch-replica .ghost-btn {
  border: 0;
  box-shadow: none;
  letter-spacing: 0;
  font-family: inherit;
}

.stitch-replica .side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  color: #64748b;
  font-weight: 650;
  background: transparent;
}

.stitch-replica .side-nav a.is-active,
.stitch-replica .side-nav a:hover {
  color: var(--replica-indigo);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.stitch-replica .side-nav span {
  width: 20px;
  color: currentColor;
  font-size: 17px;
  line-height: 1;
  text-align: center;
}

.stitch-replica .side-safety-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.76), rgba(250, 245, 255, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.86);
  color: #0f172a;
}

.stitch-replica .side-safety-card strong,
.stitch-replica .side-safety-card span {
  display: block;
}

.stitch-replica .side-safety-card strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.stitch-replica .side-safety-card span {
  color: var(--replica-muted);
  font-size: 12px;
}

.stitch-replica .main-frame {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stitch-replica .topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  padding: 0 32px;
  border: 0;
  background: rgba(244, 247, 251, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stitch-replica .top-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #64748b;
  font-size: 15px;
  font-weight: 650;
}

.stitch-replica .top-nav a {
  padding: 8px 2px;
  border-radius: 12px;
}

.stitch-replica .top-nav a.is-active {
  color: var(--replica-indigo);
}

.stitch-replica .top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stitch-replica .hard-btn,
.stitch-replica .ghost-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  transform: none;
}

.stitch-replica .hard-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--replica-indigo), var(--replica-purple));
  box-shadow: 0 14px 26px rgba(99, 102, 241, 0.22);
}

.stitch-replica .ghost-btn {
  color: #334155;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.stitch-replica .hard-btn:hover,
.stitch-replica .ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.stitch-replica .credit-badge {
  min-height: 42px;
  color: #0f172a;
  border: 1px solid rgba(226, 232, 240, 0.72);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.stitch-replica .credit-badge span {
  color: #94a3b8;
}

.stitch-replica .credit-badge strong {
  color: #0f172a;
}

.stitch-replica .replica-main {
  flex: 1;
  overflow: visible;
  padding: 0 32px 38px;
}

.stitch-replica .replica-home {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 0 34px;
}

.stitch-replica .home-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.stitch-replica .home-head h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stitch-replica .home-head p {
  margin: 0;
  color: var(--replica-muted);
  font-size: 14px;
}

.stitch-replica .search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(290px, 100%);
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.stitch-replica .search-pill input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
}

.stitch-replica .home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
}

.stitch-replica .hero-agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.stitch-replica .hero-agent-card {
  position: relative;
  display: block;
  min-height: 286px;
  overflow: hidden;
  padding: 34px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 32px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.05);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.stitch-replica .hero-agent-card.ecommerce-hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.stitch-replica .hero-agent-card:hover,
.stitch-replica .hero-agent-card.is-active {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.08);
}

.stitch-replica .hero-agent-card .tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(224, 231, 255, 0.68);
  color: #4f46e5;
  font-size: 12px;
  font-weight: 800;
}

.stitch-replica .hero-agent-card h2 {
  position: relative;
  z-index: 2;
  max-width: 58%;
  margin: 34px 0 8px;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stitch-replica .hero-agent-card p {
  position: relative;
  z-index: 2;
  max-width: 52%;
  min-height: 44px;
  margin: 0 0 28px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}

.stitch-replica .hero-agent-card em {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #4f46e5;
  font-style: normal;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.stitch-replica .hero-agent-card img {
  position: absolute;
  right: -10px;
  bottom: -18px;
  z-index: 1;
  width: 48%;
  height: 112%;
  object-fit: cover;
  object-position: left top;
  -webkit-mask-image: linear-gradient(to right, transparent, black 20%);
  mask-image: linear-gradient(to right, transparent, black 20%);
  transition: transform 500ms ease;
}

.stitch-replica .hero-agent-card:hover img {
  transform: scale(1.04);
}

.stitch-replica .replica-agent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stitch-replica button.agent-card-select {
  min-height: 168px;
  padding: 20px !important;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.stitch-replica .agent-card-select:hover,
.stitch-replica .agent-card-select.is-active {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.28);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(99, 102, 241, 0.1);
}

.stitch-replica .agent-card-select b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #4f46e5;
  background: #eef2ff;
  font-size: 13px;
}

.stitch-replica button.agent-card-select h3 {
  margin: 18px 0 8px;
  font-size: 17px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

.stitch-replica .agent-card-select p {
  margin: 0;
  color: var(--replica-muted);
  font-size: 13px;
  line-height: 1.5;
}

.stitch-replica .home-aside {
  display: grid;
  gap: 20px;
  align-content: start;
}

.stitch-replica .side-panel,
.stitch-replica .workspace-panel,
.stitch-replica .ecom-panel,
.stitch-replica .result-card {
  border: 1px solid var(--replica-border);
  border-radius: 24px;
  background: var(--replica-panel);
  box-shadow: var(--replica-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stitch-replica .side-panel {
  padding: 22px;
}

.stitch-replica .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.stitch-replica .panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.stitch-replica .panel-head a {
  color: var(--replica-indigo);
  font-size: 13px;
  font-weight: 750;
}

.stitch-replica .mini-task {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid rgba(226, 232, 240, 0.72);
}

.stitch-replica .mini-task span,
.stitch-replica .mini-task strong,
.stitch-replica .work-row em {
  display: block;
}

.stitch-replica .mini-task span,
.stitch-replica .work-row em {
  color: var(--replica-muted);
  font-size: 12px;
}

.stitch-replica .mini-task strong {
  font-size: 14px;
}

.stitch-replica .mini-task i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--replica-indigo), #a78bfa);
}

.stitch-replica .work-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(226, 232, 240, 0.72);
}

.stitch-replica .thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #ede9fe, #c4b5fd);
}

.stitch-replica .thumb.product {
  background: linear-gradient(135deg, #e0f2fe, #7dd3fc);
}

.stitch-replica .workspace-zone {
  max-width: 1600px;
  margin: 0 auto;
  padding: 34px 0 0;
}

.stitch-replica:not(.agent-detail-page) .workspace-zone {
  display: none;
}

.stitch-replica.agent-detail-page .replica-main {
  min-height: calc(100vh - 80px);
}

.stitch-replica .agent-detail-top {
  max-width: 1180px;
  margin: 0 auto 22px;
}

.stitch-replica .agent-back-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.stitch-replica .agent-back-row .back-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #475569;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.stitch-replica .agent-back-row h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.stitch-replica .agent-stepper {
  display: grid;
  grid-template-columns: auto minmax(20px, 1fr) auto minmax(20px, 1fr) auto minmax(20px, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto 24px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 750;
}

.stitch-replica .agent-stepper span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.stitch-replica .agent-stepper b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 12px;
}

.stitch-replica .agent-stepper span:first-child {
  color: var(--replica-indigo);
}

.stitch-replica .agent-stepper span:first-child b {
  color: #fff;
  background: var(--replica-indigo);
}

.stitch-replica .agent-stepper i {
  flex: 1;
  min-width: 28px;
  height: 1px;
  background: repeating-linear-gradient(to right, #e2e8f0 0, #e2e8f0 4px, transparent 4px, transparent 8px);
}

.stitch-replica .workspace-intro {
  margin-bottom: 18px;
}

.stitch-replica .workspace-intro span {
  color: var(--replica-indigo);
  font-size: 13px;
  font-weight: 800;
}

.stitch-replica .workspace-intro h2 {
  max-width: 780px;
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.stitch-replica .workspace-panel {
  padding: 28px;
}

.stitch-replica .workspace-head,
.stitch-replica .module-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.stitch-replica .workspace-kicker {
  margin: 0 0 8px;
  color: var(--replica-indigo);
  font-size: 13px;
  font-weight: 800;
}

.stitch-replica .workspace-head h3,
.stitch-replica .module-head h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.stitch-replica .workspace-alert {
  margin: 8px 0 0;
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
}

.stitch-replica .workspace-cost {
  margin: 0 0 20px;
  color: #475569;
  font-size: 14px;
}

.stitch-replica .lab-form,
.stitch-replica .field-row {
  display: grid;
  gap: 16px;
}

.stitch-replica .field-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stitch-replica .field {
  display: grid;
  gap: 8px;
}

.stitch-replica .field > span,
.stitch-replica .ecom-field > span,
.stitch-replica .ecom-block-label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.stitch-replica .upload-field {
  min-height: 148px;
  place-items: center;
  text-align: center;
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.72);
}

.stitch-replica .upload-field input {
  max-width: 280px;
}

.stitch-replica .upload-field em,
.stitch-replica .ecom-field em {
  color: var(--replica-muted);
  font-style: normal;
  font-size: 12px;
}

.stitch-replica select,
.stitch-replica textarea,
.stitch-replica input[type="number"],
.stitch-replica input[type="email"],
.stitch-replica input[type="password"] {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  outline: none;
}

.stitch-replica select,
.stitch-replica input[type="number"] {
  min-height: 44px;
  padding: 0 14px;
}

.stitch-replica textarea {
  min-height: 112px;
  padding: 14px;
  resize: vertical;
}

.stitch-replica .status-line {
  margin: 16px 0 0;
  color: var(--replica-muted);
  font-size: 14px;
}

.stitch-replica .result-shell,
.stitch-replica .reference-preview {
  margin-top: 18px;
}

.stitch-replica .module-pane {
  border-radius: 24px;
}

.stitch-replica .ecommerce-suite-grid,
.stitch-replica .face-transform-grid,
.stitch-replica .ecom-result-grid {
  gap: 18px;
}

.stitch-replica .ecom-panel {
  padding: 22px;
}

.stitch-replica .ecom-type-card,
.stitch-replica .face-upload-card {
  border-color: #e2e8f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

@media (max-width: 1180px) {
  .stitch-replica .home-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 860px) {
  .stitch-replica .app-frame {
    grid-template-columns: 1fr;
  }

  .stitch-replica .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .stitch-replica .side-brand,
  .stitch-replica .side-safety-card {
    flex: 0 0 auto;
  }

  .stitch-replica .side-nav {
    display: flex;
    min-width: max-content;
  }

  .stitch-replica .topbar {
    height: auto;
    padding: 16px;
    align-items: center;
    gap: 14px;
    flex-direction: row;
    justify-content: flex-end;
  }

  .stitch-replica .top-nav {
    display: none !important;
  }

  .stitch-replica .top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .stitch-replica .replica-main {
    padding: 0 16px 28px;
  }

  .stitch-replica .home-head,
  .stitch-replica .hero-agent-grid,
  .stitch-replica .home-aside,
  .stitch-replica .field-row {
    grid-template-columns: 1fr;
  }

  .stitch-replica .home-head {
    display: grid;
  }

  .stitch-replica .hero-agent-card h2,
  .stitch-replica .hero-agent-card p {
    max-width: 68%;
  }
}

@media (max-width: 560px) {
  .stitch-replica .agent-detail-top {
    margin-bottom: 16px;
  }

  .stitch-replica .agent-back-row {
    margin-bottom: 16px;
  }

  .stitch-replica .agent-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }

  .stitch-replica .agent-stepper span {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
  }

  .stitch-replica .agent-stepper i {
    display: none;
  }

  .stitch-replica .replica-agent-grid {
    grid-template-columns: 1fr;
  }

  .stitch-replica .hero-agent-card {
    min-height: 250px;
    padding: 24px;
  }

  .stitch-replica .hero-agent-card img {
    width: 56%;
    opacity: 0.78;
  }
}
