:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: #1c221e;
  background: var(--bg, #f4f6f2);
  --accent: #1f5f46;
  --surface: #ffffff;
  --edge: #d7dfd6;
  --radius: 14px;
  --heading-font: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg, #f4f6f2); color: #1c221e; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#app { max-width: 1360px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 42px) 56px; }
.top { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--edge); flex-wrap: wrap; padding: 8px 0; }
.top > a:first-child { font-size: 1.12rem; font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.platform-brand img { flex: 0 0 36px; object-fit: contain; display: block; border-radius: 6px; }
.top span { font-size: .84rem; font-weight: 600; color: #546158; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.intro { padding: 26px 0 14px; }
.eyebrow { font-size: .76rem; font-weight: 800; letter-spacing: .12em; color: #4d5b52; text-transform: uppercase; margin-bottom: 6px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: var(--heading-font); font-size: clamp(1.85rem, 4.2vw, 3.1rem); line-height: 1.07; letter-spacing: -.03em; margin-bottom: 12px; }
h2 { font-family: var(--heading-font); font-size: 1.2rem; margin-bottom: 14px; }
h3 { font-family: var(--heading-font); font-size: 1.04rem; margin-bottom: 8px; }

.panel { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: clamp(16px, 2.2vw, 26px); margin: 14px 0; min-width: 0; }
.highlight-pulse { box-shadow: 0 0 0 4px var(--accent); transition: box-shadow .3s ease; }

.fields, .admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.themes, .tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
label, fieldset { display: grid; gap: 5px; margin: 0 0 11px; font-size: .92rem; font-weight: 550; }
fieldset { border: 0; padding: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox],[type=radio]), select, textarea {
  width: 100%; color: inherit; background: #fff; border: 1px solid #b9c5ba; border-radius: 9px; padding: 9px 12px; min-height: 40px;
}
textarea { resize: vertical; }

button, .sf-btn-primary, .sf-btn-secondary, .secondary-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; border: 1px solid transparent; min-height: 42px; padding: 8px 16px;
  background: var(--accent); color: #fff; font-weight: 680; cursor: pointer; text-decoration: none;
}
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary, .sf-btn-secondary, .secondary-link {
  border-color: var(--edge); background: #fff; color: #1f2a23;
}
button.active-vp { border-color: var(--accent); background: #eaf3ee; color: var(--accent); }
.sf-full-btn { width: 100%; }
.sf-btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sf-inline-input { display: flex; gap: 8px; align-items: center; }

.check, .sf-check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; cursor: pointer; }
.check input, .sf-check input { margin-top: 4px; }
.theme { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 11px; border: 2px solid transparent; background: #e8efe7; cursor: pointer; }
.theme.stitch-atelier, .theme.atelier { background: #fbe5db; }
.theme.product-showcase, .theme.supply { background: #dfeaff; }
.theme.selected { border-color: var(--accent); }
.theme small { display: block; font-weight: 400; color: #47524a; margin-top: 3px; }

.wiz-steps, .admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--edge); }
.wiz-step, .tab-btn { background: #fff; color: #2b352e; border: 1px solid var(--edge); min-height: 36px; padding: 6px 12px; font-size: .86rem; white-space: nowrap; }
.wiz-step.active, .tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiz-nav-row { display: flex; justify-content: space-between; margin-top: 14px; }

.admin-hero { padding: 18px 0 8px; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; margin-right: 6px; margin-bottom: 8px; }
.status-pill.live { background: #d5f2df; color: #115732; }
.status-pill.draft { background: #e6ebe7; color: #39453d; }

.conf-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 750; vertical-align: middle; white-space: nowrap; }
.conf-real { background: #d6f5e1; color: #0e5a31; }
.conf-est { background: #fff1cc; color: #7c5000; }
.conf-miss { background: #ffe0de; color: #8c1d18; }

.launch-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); gap: 18px; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.chk-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 10px; background: #fbfcfa; }
.chk-badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; margin-right: 6px; }
.chk-badge.pass { background: #d6f5e1; color: #0e5a31; }
.chk-badge.action_required { background: #ffe0de; color: #8c1d18; }
.chk-badge.warning { background: #fff1cc; color: #7c5000; }
.chk-jump { white-space: nowrap; font-size: .84rem; min-height: 34px; }

.preview-panel { position: sticky; top: 12px; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.preview-stage { background: #e3e8e3; border-radius: 14px; padding: 12px; display: flex; justify-content: center; overflow: hidden; }
.preview-stage iframe { border: 1px solid #c2ccc2; border-radius: 12px; background: #fff; height: 680px; transition: width .2s ease; }
.preview-stage.mobile iframe { width: 390px; max-width: 100%; }
.preview-stage.desktop iframe { width: 100%; }

.sbx-box { background: #f2f7f3; border: 1px solid #c6dacb; border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--edge); border-radius: 0; padding: 10px 6px; text-align: left; font-weight: 500; }
.row.active-row { background: #edf4ef; font-weight: 700; }
.order-card, .proposal-card, .tpl-card { border: 1px solid var(--edge); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: #fff; }
.order-ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--edge); }
.seo-snippet { background: #f8fafc; border: 1px solid #dce3ec; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.seo-snippet h3 { color: #1a0dab; margin: 2px 0 4px; }
.seo-snippet small { color: #006621; }
.job-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.step-tag { display: inline-block; background: #e8efe9; padding: 2px 7px; border-radius: 6px; font-size: .76rem; }
.chip-btn { min-height: 32px; padding: 4px 10px; font-size: .82rem; }

.feedback { margin: 6px 0; color: #9c2b23; font-weight: 600; }
.feedback:empty { margin: 0; }
.field-error, .error-text { color: #9c2b23; font-size: .84rem; }
.ok-text { color: #136236; font-weight: 650; }
.hint { font-size: .86rem; color: #526057; }

/* Storefront SSR Styles */
.sf-header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--edge); }
.sf-header-inner { max-width: 1280px; margin: 0 auto; padding: 10px clamp(14px, 3vw, 40px); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sf-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.08rem; }
.sf-logo { height: 34px; width: auto; max-width: 240px; object-fit: contain; display: block; }
.sf-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .92rem; font-weight: 600; }
.sf-nav a { text-decoration: none; }
.sf-cart-link { background: var(--accent); color: #fff; padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.sf-cart-badge { background: rgba(255,255,255,.22); padding: 1px 7px; border-radius: 999px; font-size: .8rem; }
.sf-preview-banner { background: #1e293b; color: #f8fafc; text-align: center; font-size: .8rem; padding: 6px 12px; }
.sf-preview-banner.warn { background: #7c2d12; }

.sf-main { max-width: 1280px; margin: 0 auto; padding: 18px clamp(14px, 3vw, 40px) 64px; }
.sf-breadcrumbs ol { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; font-size: .86rem; color: #546158; }
.sf-breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: #94a399; }

.sf-hero { background: var(--hero-bg, #dbead6); border-radius: calc(var(--radius) + 4px); padding: clamp(22px, 5vw, 52px); margin-bottom: 24px; display: grid; gap: 24px; align-items: center; }
.sf-hero.split { grid-template-columns: 1.15fr .85fr; }
.sf-hero.center { text-align: center; justify-items: center; }
.sf-subhero { font-size: 1.02rem; color: #36433b; margin-bottom: 18px; }
.sf-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sf-hero-visual img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); display: block; box-shadow: 0 10px 28px rgba(0,0,0,.08); }

.sf-strip { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 22px; }
.sf-strip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sf-strip-item { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .92rem; }

.sf-categories { margin-bottom: 22px; }
.sf-cat-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sf-pill { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--edge); background: var(--surface); text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.sf-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.sf-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sf-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sf-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sf-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sf-card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.sf-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: #eef2ee; overflow: hidden; }
.sf-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-type-pill, .sf-stock-pill { position: absolute; top: 10px; padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 800; }
.sf-type-pill { left: 10px; background: rgba(24,32,28,.82); color: #fff; }
.sf-stock-pill { right: 10px; }
.sf-stock-pill.ok { background: #d6f5e1; color: #0e5a31; }
.sf-stock-pill.out { background: #ffe0de; color: #8c1d18; }
.sf-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sf-card-cat { font-size: .76rem; color: #5b685f; margin: 0; }
.sf-card-body h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.sf-card-body h3 a { text-decoration: none; }
.sf-card-price { font-weight: 780; margin: 2px 0; }
.sf-card-cta { margin-top: auto; text-align: center; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--edge); text-decoration: none; font-weight: 650; font-size: .88rem; }
.sf-card-cta:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.sf-pdp-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 28px; align-items: start; margin-bottom: 28px; }
.sf-pdp-stage { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--edge); background: var(--surface); aspect-ratio: 4 / 3; }
.sf-pdp-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-emb-overlay { position: absolute; bottom: 14px; right: 14px; background: rgba(24,24,26,.88); color: #fff; padding: 10px 14px; border-radius: 10px; border: 1px dashed rgba(212,175,55,.7); min-width: 150px; text-align: center; }
.sf-emb-place { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #cbd5e1; margin-bottom: 3px; }
.sf-emb-overlay strong { font-size: 1.25rem; display: block; }

.sf-pdp-price-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sf-pdp-price { font-size: 1.65rem; font-weight: 800; }
.sf-stock-badge { padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 750; }
.sf-stock-badge.ok { background: #d6f5e1; color: #0e5a31; }
.sf-stock-badge.out { background: #ffe0de; color: #8c1d18; }
.sf-eta-callout { background: var(--surface); border: 1px solid var(--edge); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; margin: 12px 0 16px; display: grid; gap: 3px; font-size: .9rem; }
.sf-proof-callout { background: #fef7ea; border: 1px solid #ecd4a4; border-radius: 8px; padding: 8px 10px; font-size: .85rem; margin: 6px 0 0; }

.sf-variant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sf-variant-option { border: 1.5px solid var(--edge); border-radius: 10px; padding: 9px 11px; background: var(--surface); cursor: pointer; display: grid; gap: 2px; margin: 0; }
.sf-variant-option input { position: absolute; opacity: 0; pointer-events: none; }
.sf-variant-option.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: rgba(31,95,70,.04); }
.sf-variant-option.unavailable { opacity: .62; background: #f3f4f6; }
.sf-var-label { font-weight: 700; font-size: .9rem; }
.sf-var-meta { font-size: .82rem; color: #546158; }
.sf-unavailable-reason { color: #9c2b23; font-size: .86rem; margin: 8px 0 0; font-weight: 600; }

.sf-eod-box, .sf-ds-eta-box { background: var(--surface); border: 1px solid var(--edge); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.sf-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sf-field-hint { font-size: .8rem; color: #546158; }
.sf-field-hint.error { color: #9c2b23; font-weight: 600; }
.sf-field-hint.ok { color: #136236; }

.sf-qty-cta-bar { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.sf-qty-label { width: 82px; margin: 0; font-size: .78rem; }
.sf-qty-cta-bar button { flex: 1; font-size: 1rem; }

.sf-accordion { border-top: 1px solid var(--edge); padding: 12px 0; }
.sf-accordion summary { font-weight: 700; cursor: pointer; }
.sf-specs-block { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px; }
.sf-spec-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.sf-spec-table th, .sf-spec-table td { border-bottom: 1px solid var(--edge); padding: 9px 10px; text-align: left; vertical-align: top; }
.sf-spec-table th { width: 32%; color: #46534a; font-weight: 650; }

.sf-banner { background: #fff4d6; border: 1px solid #eed28a; color: #614400; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.sf-fallback-note { background: #eef4ff; border: 1px solid #c7d9fa; color: #1e3a8a; padding: 9px 14px; border-radius: 8px; font-size: .86rem; }
.sf-cart-item { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--edge); align-items: start; }
.sf-cart-thumb { border-radius: 8px; border: 1px solid var(--edge); object-fit: cover; }
.sf-cart-item-main { display: grid; gap: 6px; }
.sf-cart-inline-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.sf-mini-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: .84rem; }
.sf-mini-label select { width: auto; min-height: 34px; padding: 4px 8px; }
.sf-qty-stepper { display: inline-flex; align-items: center; gap: 6px; }
.sf-qty-stepper button { min-height: 32px; padding: 2px 10px; }
.sf-remove-btn { min-height: 32px; padding: 2px 10px; font-size: .82rem; }

.sf-cart-totals { margin-top: 18px; max-width: 520px; margin-left: auto; }
.sf-promo-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.sf-cost-list { margin: 0; display: grid; gap: 8px; }
.sf-cost-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.sf-cost-list dd { margin: 0; font-weight: 650; }
.sf-cost-list .discount { color: #136236; }
.sf-cost-list .total { border-top: 2px solid var(--edge); padding-top: 10px; font-size: 1.12rem; font-weight: 800; }
.sf-tax-note { font-size: .83rem; color: #546158; margin-top: 8px; }

.sf-checkout-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: start; }
.sf-co-lines { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.sf-co-lines li { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; border-bottom: 1px solid var(--edge); padding-bottom: 8px; }
.sf-quote-change { background: #fff4d6; border: 1px solid #e6c670; padding: 10px 12px; border-radius: 9px; margin: 10px 0; }
.sf-shipment-card { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 10px; margin-bottom: 8px; }
.sf-order-items { list-style: none; padding: 0; display: grid; gap: 10px; }
.sf-pers-tag { display: block; color: var(--accent); font-weight: 600; margin-top: 2px; }

.sf-footer { border-top: 1px solid var(--edge); background: var(--surface); margin-top: 40px; padding: 28px clamp(14px, 3vw, 40px); }
.sf-footer-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; font-size: .9rem; }
.sf-footer-links { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }

@media (max-width: 960px) {
  .launch-split, .sf-pdp-layout, .sf-checkout-grid, .sf-hero.split { grid-template-columns: 1fr; }
  .sf-grid, .sf-grid.cols-4, .themes, .tpl-grid, .sf-strip-grid, .sf-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .fields, .sf-grid, .sf-grid.cols-2, .sf-grid.cols-4, .themes, .tpl-grid, .sf-strip-grid, .sf-footer-grid, .sf-variant-grid, .sf-field-row {
    grid-template-columns: 1fr;
  }
  .sf-cart-item { grid-template-columns: 68px 1fr; }
  .sf-cart-line-price { grid-column: 2; }
  .sf-qty-cta-bar {
    position: sticky; bottom: 0; z-index: 25;
    background: var(--surface); padding: 10px; margin-inline: -14px;
    border-top: 1px solid var(--edge); box-shadow: 0 -6px 18px rgba(0,0,0,.06);
  }
}
