﻿:root {
  /* Color tokens */
  --color-bg: #f8f3ea;
  --color-surface: #ffffff;
  --color-surface-elevated: #fffaf2;
  --color-border: #ddd7ce;
  --color-text: #202124;
  --color-text-muted: #5f686f;
  --color-primary: #0b6b57;
  --color-primary-dark: #064d3e;
  --color-primary-soft: #e4f2ec;
  --color-accent: #d98c24;
  --color-info: #2563eb;
  --color-info-soft: #eff6ff;
  --color-success: #0b6b57;
  --color-success-soft: #edf7f3;
  --color-warning: #b7791f;
  --color-warning-soft: #fff7df;
  --color-danger: #b3261e;
  --color-danger-soft: #fff0ee;

  /* Backward-compatible legacy tokens */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --primary: var(--color-primary);
  --primary-dark: var(--color-primary-dark);
  --primary-soft: var(--color-primary-soft);
  --accent: var(--color-accent);
  --danger: var(--color-danger);

  /* Spacing tokens */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 40px;

  /* Radius tokens */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadow tokens */
  --shadow-sm: 0 6px 18px rgb(26 44 37 / 0.08);
  --shadow-md: 0 18px 50px rgb(26 44 37 / 0.10);
  --shadow-lg: 0 28px 70px rgb(26 44 37 / 0.14);
  --shadow: var(--shadow-md);

  /* Typography tokens */
  --font-body: Tahoma, Arial, sans-serif;
  --font-size-caption: 12px;
  --font-size-small: 14px;
  --font-size-body: 16px;
  --font-size-lead: 18px;
  --font-size-h3: 20px;
  --font-size-h2: 24px;
  --font-size-h1: clamp(30px, 5vw, 48px);
  --line-height-body: 1.7;
  --line-height-heading: 1.25;

  /* Layout tokens */
  --content-max-width: 1080px;
  --grid-gap: 16px;
  --section-spacing: 24px;
  --z-sticky: 20;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgb(11 107 87 / 0.13), transparent 34rem),
    linear-gradient(180deg, #fffaf2 0%, var(--bg) 42%, #f3efe8 100%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: var(--line-height-body);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--primary-dark);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page {
  width: min(var(--content-max-width), calc(100% - 32px));
  margin: 32px auto;
}

.hero,
.panel,
.page-heading {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow);
}

.hero {
  min-height: 420px;
  display: grid;
  align-items: center;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.92), rgb(228 242 236 / 0.86)),
    radial-gradient(circle at 18% 18%, rgb(217 140 36 / 0.18), transparent 18rem);
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.narrow {
  width: min(560px, 100%);
  margin-inline: auto;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: var(--font-size-h1);
  line-height: 1.25;
  margin-bottom: 12px;
}

h2 {
  font-size: 20px;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

.muted,
.empty {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.actions,
.form {
  display: grid;
  gap: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgb(11 107 87 / 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  background: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgb(11 107 87 / 0.22);
}

.button.secondary {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}

.button.small {
  min-height: 36px;
  padding: 6px 12px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.inline-form {
  margin: 0;
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgb(11 107 87 / 0.12);
  outline: none;
}

.alert,
.notice {
  border-radius: 6px;
  padding: 12px 14px;
}

.alert {
  background: #fff0ee;
  color: var(--danger);
  border: 1px solid #f3c2bd;
}

.hidden {
  display: none;
}

.notice {
  background: #edf7f3;
  color: var(--primary-dark);
  border: 1px solid #bcd9cf;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  margin: 2px;
  border-radius: 999px;
  background: #f1ece4;
  color: var(--muted);
  font-size: 12px;
}

.badge.success {
  background: #e3f4ec;
  color: var(--primary-dark);
}

.dashboard-heading {
  align-items: flex-start;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.site-demo-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
}

.metric-card {
  display: grid;
  gap: 6px;
}

.metric-card strong {
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.3;
}

.metric-card-primary {
  border-color: #bcd9cf;
  background: linear-gradient(135deg, #edf7f3, #fff);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.integration-note,
.install-secret-box {
  border: 1px solid #bcd9cf;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #edf7f3, #fff);
  margin-bottom: 18px;
}

.platform-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.platform-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  cursor: pointer;
}

.platform-card input {
  width: auto;
  min-height: auto;
}

.platform-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(11 107 87 / 0.12);
}

.integration-layout {
  display: grid;
  gap: 18px;
}

.section-title-row,
.site-demo-card-header,
.site-demo-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.site-card-grid {
  display: grid;
  gap: 14px;
}

.site-demo-card {
  display: grid;
  gap: 14px;
}

.site-url {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.compact-meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}

.compact-meta-list div {
  display: grid;
  gap: 4px;
}

.compact-meta-list dt {
  color: var(--muted);
  font-size: 12px;
}

.compact-meta-list dd {
  margin: 0;
  font-weight: 700;
}

.empty-state {
  display: grid;
  gap: 10px;
  place-items: start;
}

.placeholder-grid,
.tryon-placeholder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.status-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.status-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.status-list span {
  color: var(--muted);
}

.status-list strong {
  overflow-wrap: anywhere;
}

.technical-details,
.debug-products {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfaf7;
}

.technical-details summary,
.debug-products summary {
  cursor: pointer;
  font-weight: 700;
}

.snapshot-section {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.snapshot-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
}

.snapshot-overlay-stage {
  position: relative;
  width: 100%;
}

.snapshot-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.snapshot-product-box {
  position: absolute;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  pointer-events: auto;
}

.snapshot-overlay-stage.show-debug-boxes .snapshot-product-box {
  border: 1px dashed var(--accent);
  background: rgb(217 140 36 / 0.08);
}

.overlay-product-number {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 6px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgb(32 33 36 / 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.overlay-product-cta {
  position: absolute;
  inset-inline: 8px;
  inset-block-end: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgb(11 107 87 / 0.98), rgb(6 77 62 / 0.98));
  box-shadow: 0 10px 22px rgb(0 0 0 / 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.snapshot-product-box:hover .overlay-product-cta {
  background: var(--primary-dark);
}

.snapshot-product-box.is-selected {
  background: transparent;
}

.snapshot-overlay-stage.show-debug-boxes .snapshot-product-box.is-selected {
  border-color: var(--primary);
  background: rgb(11 107 87 / 0.12);
}

.snapshot-product-box.is-selected .overlay-product-number,
.snapshot-product-box.is-selected .overlay-product-cta {
  background: var(--primary);
}

.products-section {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.selection-summary {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 26px rgb(26 44 37 / 0.08);
}

.demo-selection-bar {
  margin: 18px 0;
}

.selected-count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1ece4;
  color: var(--primary-dark);
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  direction: rtl;
}

.debug-products {
  margin-top: 24px;
}

.extracted-product-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  direction: rtl;
}

.extracted-product-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgb(11 107 87 / 0.12);
}

.extracted-product-card.is-active-product {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(217 140 36 / 0.18);
}

.extracted-product-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 6px;
  background: #f4f0e9;
}

.extracted-product-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.5;
}

.price {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-weight: 700;
}

.upload-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #faf8f4;
  color: var(--muted);
  text-align: center;
}

.upload-status-message {
  min-height: 28px;
  margin-bottom: 0;
  font-weight: 700;
}

.upload-status-message.is-loading {
  color: var(--muted);
}

.upload-status-message.is-success {
  color: var(--primary);
}

.upload-status-message.is-error {
  color: var(--danger);
}

.tryon-session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 20px;
}

.tryon-session-layout > section {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgb(255 255 255 / 0.92);
}

.result-placeholder-panel {
  grid-column: 1 / -1;
  background: #fbfaf7;
}

.tryon-credit-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
  padding: 12px;
  border: 1px solid #bcd9cf;
  border-radius: 16px;
  background: linear-gradient(135deg, #edf7f3, #fffaf2);
  box-shadow: 0 12px 26px rgb(26 44 37 / 0.08);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  align-items: stretch;
}

.auth-value-card {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 520px;
  border: 1px solid #cfe3da;
  border-radius: 22px;
  padding: clamp(24px, 5vw, 48px);
  background:
    linear-gradient(140deg, rgb(6 77 62 / 0.96), rgb(11 107 87 / 0.90)),
    radial-gradient(circle at 20% 12%, rgb(255 255 255 / 0.18), transparent 18rem);
  box-shadow: var(--shadow);
  color: #fff;
}

.auth-value-card .lead,
.auth-value-card .muted {
  color: rgb(255 255 255 / 0.82);
}

.auth-form-card {
  align-self: center;
}

.onboarding-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.onboarding-checklist li,
.prep-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.onboarding-checklist span,
.prep-steps span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.prep-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 24px;
  align-items: stretch;
}

.prep-copy,
.prep-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(24px, 5vw, 44px);
  background: rgb(255 255 255 / 0.92);
  box-shadow: var(--shadow);
}

.prep-card {
  display: grid;
  gap: 18px;
  align-content: start;
}

.loader-ring {
  width: 74px;
  height: 74px;
  border: 6px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 900ms linear infinite;
}

.prep-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prep-steps li.is-active {
  border-color: #bcd9cf;
  background: #edf7f3;
}

.prep-steps li.is-done span {
  background: var(--primary);
  color: #fff;
}

.prep-status {
  min-height: 34px;
  margin: 0;
  color: var(--primary-dark);
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tryon-work-card {
  background: var(--surface);
}

.tryon-session-products {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.tryon-session-products .active-product-button {
  width: 100%;
  min-height: 38px;
  padding-inline: 10px;
}

.tryon-result-panel {
  display: grid;
  gap: 12px;
}

.run-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.run-status-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.run-status-grid strong {
  color: var(--primary-dark);
}

.user-image-preview {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 14px;
}

.vton-result-image {
  width: 100%;
  max-height: 640px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin: 12px 0;
}

.vton-run-status {
  min-height: 28px;
  margin: 8px 0 12px;
  font-weight: 700;
}

.vton-run-status.is-loading {
  color: var(--muted);
}

.vton-run-status.is-success {
  color: var(--primary);
}

.vton-run-status.is-error {
  color: var(--danger);
}

.sync-fallback-details {
  margin-top: 14px;
}

.technical-json {
  direction: ltr;
  overflow-x: auto;
  padding: 12px;
  border-radius: 6px;
  background: #202124;
  color: #f5f5f5;
}

.selected-product-ids {
  padding: 10px 12px;
  border-radius: 6px;
  background: #f7f4ef;
  overflow-wrap: anywhere;
  margin-bottom: 16px;
}

.tryon-selected-products [hidden] {
  display: none;
}

.product-placeholder,
.tryon-placeholder > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.fake-image {
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  background: linear-gradient(135deg, #e3ded6, #c9d8d1);
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .site-header,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
  }

  .section-title-row,
  .site-demo-card-header,
  .site-demo-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .status-list > div {
    grid-template-columns: 1fr;
  }

  .tryon-session-layout {
    grid-template-columns: 1fr;
  }

  .auth-shell,
  .prep-hero {
    grid-template-columns: 1fr;
  }

  .auth-value-card {
    min-height: 320px;
  }
}

.widget-room-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.widget-room-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(11, 107, 87, 0.16);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #fffaf1, #eef8f3);
  box-shadow: 0 18px 60px rgba(31, 41, 55, 0.08);
}

.widget-room-hero h1 {
  margin: 0.25rem 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.widget-room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: start;
}

.widget-room-products,
.widget-room-next-step,
.widget-room-empty {
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.08);
}

.widget-room-products,
.widget-room-next-step {
  padding: 1.25rem;
}

.widget-room-empty {
  padding: 2rem;
  text-align: center;
}

.storefront-room-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.storefront-room-product {
  display: grid;
  gap: 0.85rem;
  padding: 0.8rem;
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 16px;
  background: #fff;
}

.storefront-room-product.is-active {
  border-color: rgba(11, 107, 87, 0.5);
  box-shadow: 0 10px 30px rgba(11, 107, 87, 0.12);
}

.storefront-room-product img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  background: #efe8dc;
}

.storefront-room-product h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.storefront-room-product .price {
  margin: 0 0 0.5rem;
  color: #0b6b57;
  font-weight: 800;
}

.widget-room-next-step {
  position: sticky;
  top: 1rem;
}

.widget-room-next-step .button:disabled {
  width: 100%;
  opacity: 0.65;
  cursor: not-allowed;
}

.widget-room-upload-form {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.widget-room-upload-form label {
  color: #202124;
  font-weight: 800;
}

.widget-room-upload-form input[type="file"] {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid rgba(31, 41, 55, 0.16);
  border-radius: 12px;
  background: #fffaf1;
}

.upload-guidance {
  margin: 0;
  padding-inline-start: 1.15rem;
  color: #5f686f;
  font-size: 0.92rem;
}

.storefront-user-image-preview {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0;
}

.storefront-user-image-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 14px;
  background: #efe8dc;
}

.inline-alert {
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  font-weight: 700;
}

.inline-alert.error {
  border: 1px solid rgba(185, 28, 28, 0.22);
  background: #fff1f2;
  color: #991b1b;
}

.inline-alert.success {
  border: 1px solid rgba(11, 107, 87, 0.22);
  background: #edf7f3;
  color: #064d3e;
}

.widget-room-vton-panel {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(11, 107, 87, 0.14);
  border-radius: 14px;
  background: #fbfaf7;
}

.widget-room-vton-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.widget-room-vton-form {
  display: grid;
}

@media (max-width: 860px) {
  .widget-room-hero,
  .widget-room-grid {
    display: block;
  }

  .widget-room-hero > * + *,
  .widget-room-next-step {
    margin-top: 1rem;
  }

  .widget-room-next-step {
    position: static;
  }
}

.tryon-gallery-panel,
.merchant-tryon-entry-panel {
  margin-bottom: 20px;
}

.tryon-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.tryon-filter-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tryon-gallery-list,
.tryon-detail-images {
  display: grid;
  gap: 16px;
}

.tryon-job-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.tryon-job-card-body {
  display: grid;
  gap: 14px;
}

.tryon-job-media-row,
.tryon-detail-images {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tryon-job-media-row {
  display: grid;
  gap: 10px;
}

.tryon-thumb-box,
.tryon-image-panel {
  display: grid;
  gap: 8px;
}

.tryon-thumb-box span,
.tryon-image-panel h2 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tryon-thumb-box img,
.tryon-image-panel img,
.tryon-thumb-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f3ed;
}

.tryon-thumb-box img,
.tryon-image-panel img {
  display: block;
  object-fit: cover;
}

.tryon-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.tryon-detail-panel {
  margin-bottom: 20px;
}

.tryon-detail-meta {
  margin-top: 18px;
}

.tryon-safe-error {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #ead0cd;
  border-radius: 12px;
  background: #fff6f5;
  color: var(--danger);
}

@media (max-width: 820px) {
  .tryon-job-card,
  .tryon-detail-images {
    grid-template-columns: 1fr;
  }
}

.hosted-room-trust-card {
  display: grid;
  gap: 0.25rem;
  min-width: 180px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.hosted-room-photo-tips {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 14px;
  background: #fffaf1;
}

.hosted-room-photo-tips h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.hosted-room-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.85rem 0;
}

.hosted-room-action-row .button,
.hosted-room-primary-action {
  min-height: 44px;
}

.hosted-room-recovery-actions {
  padding: 0.85rem;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 14px;
  background: #fff7f7;
}

.storefront-vton-result-panel {
  display: grid;
  gap: 0.85rem;
}

.storefront-vton-result-panel[hidden],
.hosted-room-recovery-actions[hidden] {
  display: none;
}

.storefront-vton-result-panel img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 14px;
  background: #f8f5ee;
}

.small-copy {
  font-size: 0.92rem;
}

.widget-room-upload-form input[type="file"]:focus-visible,
.hosted-room-action-row .button:focus-visible,
.hosted-room-primary-action:focus-visible {
  outline: 3px solid rgba(11, 107, 87, 0.35);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .widget-room-shell.hosted-room-mobile-trust {
    padding: 0 0.25rem;
  }

  .hosted-room-trust-card,
  .hosted-room-action-row .button,
  .hosted-room-primary-action {
    width: 100%;
  }

  .hosted-room-action-row {
    display: grid;
  }

  .widget-room-products,
  .widget-room-next-step {
    padding: 1rem;
  }
}

/* R1R1 core design-system components */
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: var(--space-2xl);
  align-items: center;
  margin-bottom: var(--section-spacing);
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.96), rgb(228 242 236 / 0.72)),
    radial-gradient(circle at 8% 12%, rgb(217 140 36 / 0.16), transparent 18rem);
  box-shadow: var(--shadow-md);
}

.page-hero__content,
.page-hero__visual,
.visual-card,
.copy-card,
.support-card,
.trust-card {
  min-width: 0;
}

.page-hero__visual,
.visual-card {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: var(--space-xl);
  border: 1px solid rgb(11 107 87 / 0.14);
  border-radius: var(--radius-xl);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-sm);
}

.metric-card,
.copy-card,
.support-card,
.trust-card,
.preview-card,
.qa-frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.copy-card,
.support-card,
.trust-card,
.preview-card,
.qa-frame {
  padding: var(--space-xl);
}

.trust-card {
  border-color: rgb(11 107 87 / 0.18);
  background: linear-gradient(180deg, var(--color-surface), var(--color-success-soft));
}

.support-card {
  border-color: rgb(37 99 235 / 0.16);
  background: linear-gradient(180deg, var(--color-surface), var(--color-info-soft));
}

.status-chip,
.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.status-chip--success,
.severity-badge--success {
  border-color: rgb(11 107 87 / 0.24);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.status-chip--warning,
.severity-badge--warning {
  border-color: rgb(183 121 31 / 0.24);
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.status-chip--danger,
.severity-badge--danger {
  border-color: rgb(179 38 30 / 0.24);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.status-chip--info,
.severity-badge--info {
  border-color: rgb(37 99 235 / 0.22);
  background: var(--color-info-soft);
  color: var(--color-info);
}

.stepper {
  display: grid;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.stepper-item::before {
  content: '';
  width: 14px;
  height: 14px;
  margin-top: 0.45rem;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
}

.stepper-item--done::before {
  border-color: var(--color-success);
  background: var(--color-success);
}

.stepper-item--active {
  border-color: rgb(11 107 87 / 0.32);
  box-shadow: 0 0 0 4px rgb(11 107 87 / 0.08);
}

.stepper-item--active::before {
  border-color: var(--color-primary);
}

.stepper-item--manual::before {
  border-color: var(--color-warning);
  background: var(--color-warning-soft);
}

.empty-state {
  text-align: center;
}

.empty-state__icon,
.ui-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-xl);
}

.preview-card {
  display: grid;
  gap: var(--space-md);
}

.preview-card__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f4efe6;
}

.preview-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.qa-frame {
  display: grid;
  gap: var(--space-md);
  border-color: rgb(37 99 235 / 0.18);
}

.responsive-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.illustration {
  display: block;
  max-width: 100%;
  height: auto;
  color: var(--color-primary);
}

.illustration--sm {
  width: 96px;
}

.illustration--md {
  width: 180px;
}

.illustration--lg {
  width: min(320px, 100%);
}

a:focus-visible,
button:focus-visible,
.button:focus-visible,
.link-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(11 107 87 / 0.34);
  outline-offset: 3px;
}

button:active,
.button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgb(11 107 87 / 0.16);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 820px) {
  .page-hero,
  .preview-triptych {
    grid-template-columns: 1fr;
  }

  .page-hero__visual,
  .visual-card {
    min-height: 180px;
  }
}

/* R1R2 merchant dashboard and WooCommerce setup polish */
.dashboard-hero,
.setup-wizard-hero {
  align-items: stretch;
}

.dashboard-hero-actions,
.wizard-action-row {
  margin-top: var(--space-xl);
}

.dashboard-hero-visual,
.setup-wizard-visual {
  align-content: center;
  gap: var(--space-lg);
}

.dashboard-hero-metrics,
.wizard-success-card {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
}

.next-action-card {
  border-color: rgb(11 107 87 / 0.22);
  background: linear-gradient(180deg, var(--color-surface), var(--color-primary-soft));
}

.dashboard-paths-panel,
.setup-stepper-panel,
.setup-summary-panel {
  display: grid;
  gap: var(--space-xl);
}

.onboarding-path-grid {
  align-items: stretch;
}

.onboarding-path-card {
  align-content: start;
  justify-items: stretch;
  text-align: start;
}

.onboarding-path-card .stepper {
  width: 100%;
  margin-top: var(--space-md);
}

.onboarding-path-card .stepper-item,
.setup-stepper-grid .stepper-item {
  align-items: start;
  text-align: start;
}

.onboarding-path-card .status-chip,
.setup-stepper-grid .status-chip {
  margin-inline-start: var(--space-sm);
}

.config-copy-grid {
  display: grid;
  gap: var(--grid-gap);
}

.config-copy-grid code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
  overflow-wrap: anywhere;
  direction: ltr;
}

.wizard-success-card {
  place-items: stretch;
  min-height: auto;
}

.setup-stepper-grid {
  counter-reset: setup-step;
}

.setup-stepper-grid .stepper-item {
  counter-increment: setup-step;
}

.setup-stepper-grid .stepper-item::before {
  content: counter(setup-step);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 0;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-weight: 900;
}

.setup-stepper-grid .stepper-item--done::before {
  color: #fff;
}

@media (max-width: 720px) {
  .dashboard-hero-actions .button,
  .wizard-action-row .button {
    width: 100%;
  }
}
.onboarding-path-card .stepper-item::before {
  display: none;
}
/* R1R3 support, credits, and gallery polish */
.support-hero,
.credits-balance-hero,
.gallery-hero,
.gallery-detail-hero {
  align-items: stretch;
}

.support-hero-visual,
.credits-balance-visual,
.gallery-hero-visual,
.gallery-detail-actions {
  align-content: center;
}

.support-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--grid-gap);
  margin-bottom: var(--section-spacing);
}

.support-category-grid .support-card,
.failure-summary-card {
  display: grid;
  gap: var(--space-md);
  align-content: start;
}

.credits-balance-hero .metric-card,
.credits-metric-grid .metric-card {
  align-content: start;
}

.usage-timeline {
  display: grid;
  gap: var(--space-md);
  position: relative;
}

.usage-history-row.support-card {
  border-inline-start: 4px solid var(--color-primary);
}

.gallery-result-card {
  border-color: rgb(11 107 87 / 0.14);
}

.gallery-result-card .tryon-safe-error,
.failure-summary-card {
  border-color: rgb(37 99 235 / 0.18);
  background: linear-gradient(180deg, var(--color-surface), var(--color-info-soft));
  color: var(--color-text);
}

.gallery-detail-triptych .qa-frame {
  min-width: 0;
}

.gallery-detail-triptych .tryon-image-panel img,
.gallery-detail-triptych .tryon-thumb-placeholder {
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.gallery-detail-actions .visual-card {
  gap: var(--space-md);
  justify-items: stretch;
}

@media (max-width: 820px) {
  .support-category-grid,
  .gallery-detail-triptych {
    grid-template-columns: 1fr;
  }
}
/* R1R4 hosted room final visual polish */
.hosted-room-visual-hero {
  align-items: stretch;
  direction: ltr;
}

.hosted-room-visual-hero .hosted-room-trust-card {
  justify-items: stretch;
  min-width: 0;
  min-height: auto;
}

.hosted-room-layout {
  align-items: start;
}

.hosted-room-product-context.preview-card,
.hosted-room-upload-card {
  gap: var(--space-xl);
}

.hosted-room-upload-card {
  border-color: rgb(11 107 87 / 0.18);
  background: linear-gradient(180deg, var(--color-surface), var(--color-surface-elevated));
}

.hosted-room-upload-form input[type="file"] {
  min-height: 56px;
  border-style: dashed;
  border-color: rgb(11 107 87 / 0.28);
  background: var(--color-surface-elevated);
}

.hosted-room-status-card {
  border-color: rgb(37 99 235 / 0.18);
  background: linear-gradient(180deg, var(--color-surface), var(--color-info-soft));
}

.hosted-room-result-frame {
  padding: var(--space-lg);
  border-color: rgb(11 107 87 / 0.24);
  background: linear-gradient(180deg, var(--color-surface), var(--color-success-soft));
}

.hosted-room-result-frame img {
  box-shadow: var(--shadow-sm);
}

.hosted-room-error-card,
.hosted-room-recovery-actions.failure-summary-card {
  border-color: rgb(179 38 30 / 0.20);
  background: linear-gradient(180deg, var(--color-surface), var(--color-danger-soft));
}

.storefront-room-product.preview-card {
  box-shadow: none;
}

.storefront-room-product.preview-card.is-active {
  border-color: rgb(11 107 87 / 0.44);
  background: linear-gradient(180deg, var(--color-surface), var(--color-success-soft));
}

@media (max-width: 860px) {
  .hosted-room-visual-hero {
    display: grid;
  }
}

@media (max-width: 620px) {
  .hosted-room-upload-card {
    position: static;
  }

  .hosted-room-result-frame,
  .hosted-room-status-card {
    padding: var(--space-md);
  }
}
/* R1S3C merchant launch coherence */
.form-full-row {
  grid-column: 1 / -1;
}

.support-request-form textarea {
  min-height: 140px;
  resize: vertical;
}

.merchant-launch-flow .setup-stepper-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tryon-job-card.gallery-result-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.tryon-job-card .tryon-job-media-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: stretch;
}

.tryon-job-card .compact-meta-list {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.tryon-job-card-body,
.tryon-safe-error {
  min-width: 0;
}

.tryon-thumb-box,
.tryon-image-panel {
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 980px) {
  .tryon-job-card.gallery-result-card {
    grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.05fr);
  }
}
/* integration-code-overflow-guard */
.technical-json,
.code-scroll,
.config-copy-grid code,
.code-inline-wrap {
  max-width: 100%;
  overflow-x: auto;
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.config-copy-list dd,
.copy-card dd {
  min-width: 0;
}

.tryon-thumb-placeholder {
  display: grid;
  min-height: 96px;
  place-items: center;
  padding: 0.75rem;
  text-align: center;
}

.copy-code,
.install-code,
pre,
code {
  max-width: 100%;
  overflow-x: auto;
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: pre-wrap;
  word-break: break-word;
}
