/* StyleTwin Interactive Funnel Tools (styletwin.app)
   Warm editorial surface system (#FAF7F2 / #FFFFFF / #131317 / #B7613F).
   Strict CSP safe: zero inline style attributes required anywhere in tool JS. */

:root {
  --st-bg: #FAF7F2;
  --st-surface: #FFFFFF;
  --st-surface-soft: #F3ECE2;
  --st-surface-deep: #EDE5D8;
  --st-ink: #131317;
  --st-muted: #5B554E;
  --st-line: #E6DDD0;
  --st-line-strong: #D4C8B8;
  --st-accent: #B7613F;
  --st-accent-dark: #9B4E30;
  --st-accent-soft: #FBF0EA;
  --st-accent-line: #E9C6B6;
  --st-ok: #296949;
  --st-ok-soft: #ECF6F0;
  --st-warn: #945B14;
  --st-warn-soft: #FDF5E6;
  --st-bad: #8E2E39;
  --st-bad-soft: #FAEDEF;
  --st-radius: 20px;
  --st-radius-sm: 12px;
  --st-shadow: 0 12px 32px -18px rgba(19, 19, 23, 0.16), 0 1px 3px rgba(19, 19, 23, 0.05);
  --st-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

/* ── Shared mount container & shell ───────────────────────────────────── */
.st-tool-mount {
  margin: 26px 0 34px;
  color-scheme: light;
}

.st-tool-card {
  background: var(--st-bg);
  color: var(--st-ink);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  padding: 22px;
  box-shadow: var(--st-shadow);
  font-family: var(--st-font);
  line-height: 1.48;
}

.st-tool-card *,
.st-tool-card *::before,
.st-tool-card *::after {
  box-sizing: border-box;
}

.st-tool-card button,
.st-tool-card input,
.st-tool-card select {
  font-family: inherit;
  color: inherit;
}

.st-tool-card button:focus-visible,
.st-tool-card input:focus-visible,
.st-tool-card a:focus-visible {
  outline: 2px solid var(--st-accent);
  outline-offset: 2px;
}

.st-tool-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.st-tool-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--st-accent);
  margin: 0 0 4px;
}

.st-tool-title {
  margin: 0;
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--st-ink);
}

.st-tool-sub {
  margin: 4px 0 0;
  font-size: 14.5px;
  color: var(--st-muted);
}

/* ── Control bars, chips, segmented toggles, steppers, sliders ────────── */
.st-controls {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.st-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.st-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.st-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--st-muted);
}

.st-label strong {
  color: var(--st-ink);
  font-variant-numeric: tabular-nums;
}

.st-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.st-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--st-line-strong);
  background: var(--st-surface);
  color: var(--st-ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.st-chip:hover {
  border-color: var(--st-ink);
  background: var(--st-surface-soft);
}

.st-chip[aria-pressed="true"],
.st-chip.is-active {
  background: var(--st-ink);
  border-color: var(--st-ink);
  color: #FFFFFF;
}

.st-chip-accent[aria-pressed="true"],
.st-chip-accent.is-active {
  background: var(--st-accent);
  border-color: var(--st-accent);
  color: #FFFFFF;
}

.st-seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: var(--st-surface-deep);
  border: 1px solid var(--st-line);
}

.st-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--st-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.st-seg button[aria-pressed="true"] {
  background: var(--st-surface);
  color: var(--st-ink);
  box-shadow: 0 1px 4px rgba(19, 19, 23, 0.12);
}

.st-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--st-surface);
  border: 1px solid var(--st-line-strong);
  border-radius: 12px;
  overflow: hidden;
}

.st-stepper button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 38px;
  height: 38px;
  font-size: 18px;
  font-weight: 700;
  color: var(--st-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.st-stepper button:hover:not(:disabled) {
  background: var(--st-surface-soft);
}

.st-stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.st-stepper-val {
  min-width: 56px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
}

.st-range {
  width: 100%;
  height: 6px;
  accent-color: var(--st-accent);
  cursor: pointer;
  margin: 6px 0;
}

.st-search-wrap {
  position: relative;
  flex: 1 1 240px;
}

.st-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--st-line-strong);
  background: var(--st-surface);
  color: var(--st-ink);
  font-size: 15px;
  font-weight: 500;
}

.st-input::placeholder {
  color: #877F75;
}

.st-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 25;
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 250px;
  overflow-y: auto;
  background: var(--st-surface);
  border: 1px solid var(--st-line-strong);
  border-radius: 14px;
  box-shadow: 0 18px 36px -12px rgba(19, 19, 23, 0.22);
}

.st-dropdown[hidden] {
  display: none;
}

.st-dropdown li {
  margin: 0;
}

.st-dropdown button {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.st-dropdown button:hover {
  background: var(--st-surface-soft);
}

.st-dropdown-meta {
  font-size: 12.5px;
  color: var(--st-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Panels, badges, metrics, action buttons ──────────────────────────── */
.st-panel {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 16px;
  padding: 16px;
}

.st-panel-soft {
  background: var(--st-surface-soft);
  border: 1px solid var(--st-line);
  border-radius: 16px;
  padding: 14px 16px;
}

.st-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--st-surface-soft);
  color: var(--st-ink);
  border: 1px solid var(--st-line);
}

.st-badge-accent {
  background: var(--st-accent-soft);
  color: var(--st-accent-dark);
  border-color: var(--st-accent-line);
}

.st-badge-ok {
  background: var(--st-ok-soft);
  color: var(--st-ok);
  border-color: #C3E3D0;
}

.st-badge-warn {
  background: var(--st-warn-soft);
  color: var(--st-warn);
  border-color: #ECD3A3;
}

.st-badge-bad {
  background: var(--st-bad-soft);
  color: var(--st-bad);
  border-color: #E7BFC4;
}

.st-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 550;
  background: var(--st-accent-soft);
  border: 1px solid var(--st-accent-line);
  color: var(--st-ink);
  margin-top: 12px;
}

.st-alert-ok {
  background: var(--st-ok-soft);
  border-color: #C3E3D0;
}

.st-alert-warn {
  background: var(--st-warn-soft);
  border-color: #ECD3A3;
}

.st-btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.st-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--st-line-strong);
  background: var(--st-surface);
  color: var(--st-ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.st-btn:hover {
  background: var(--st-surface-soft);
  border-color: var(--st-ink);
}

.st-btn-primary {
  background: var(--st-ink);
  border-color: var(--st-ink);
  color: #FFFFFF;
}

.st-btn-primary:hover {
  background: #2A2A32;
  border-color: #2A2A32;
  color: #FFFFFF;
}

.st-btn-accent {
  background: var(--st-accent);
  border-color: var(--st-accent);
  color: #FFFFFF;
}

.st-btn-accent:hover {
  background: var(--st-accent-dark);
  border-color: var(--st-accent-dark);
  color: #FFFFFF;
}

.st-btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

/* ── Dynamic App Bridge CTA Banner (.st-tool-bridge) ──────────────────── */
.st-tool-bridge {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #171619 0%, #26211F 100%);
  color: #FAF7F2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
}

.st-tool-bridge-copy {
  flex: 1 1 260px;
  min-width: 0;
}

.st-tool-bridge-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #E8A68B;
  margin-bottom: 4px;
}

.st-tool-bridge-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #FFFFFF;
}

.st-tool-bridge-sub {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(250, 247, 242, 0.8);
}

.st-tool-bridge-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(250, 247, 242, 0.72);
}

.st-tool-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  background: #FAF7F2;
  color: #131317;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  transition: transform 0.14s ease, background-color 0.16s ease;
}

.st-tool-cta:hover {
  background: #FFFFFF;
  color: #131317;
  transform: translateY(-1px);
  text-decoration: none;
}

.st-tool-bridge.is-highlighted {
  box-shadow: 0 0 0 2px var(--st-accent), 0 14px 28px -12px rgba(183, 97, 63, 0.45);
}

/* ── Upgraded existing calculators (.tool in tools.js) ────────────────── */
.tool[data-tool] {
  background: var(--st-bg);
  color: var(--st-ink);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  padding: 20px;
  box-shadow: var(--st-shadow);
  color-scheme: light;
}

.tool[data-tool] .tool-field {
  color: var(--st-muted);
}

.tool[data-tool] .tool-field input {
  background: var(--st-surface);
  color: var(--st-ink);
  border-color: var(--st-line-strong);
}

.st-calc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--st-line);
}

.st-calc-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.st-calc-presets-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-muted);
  margin-right: 4px;
}

.st-calc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
}

.st-calc-insight {
  font-size: 14px;
  font-weight: 550;
  color: var(--st-muted);
  margin: 0;
}

.st-calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ── Garment visual cards (Weather, Generator, Trip, Try-On) ──────────── */
.st-garment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}

.st-garment-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 14px;
  padding: 10px 8px 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.st-garment-card.is-locked {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 1px var(--st-accent);
  background: var(--st-accent-soft);
}

.st-garment-thumb {
  width: 100%;
  height: 92px;
  display: grid;
  place-items: center;
  background: var(--st-bg);
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}

.st-garment-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.st-garment-slot {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-muted);
}

.st-garment-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--st-ink);
  line-height: 1.25;
  margin-top: 2px;
}

.st-lock-btn {
  margin-top: 8px;
  width: 100%;
  appearance: none;
  border: 1px solid var(--st-line-strong);
  background: var(--st-surface);
  color: var(--st-ink);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.st-lock-btn[aria-pressed="true"] {
  background: var(--st-accent);
  border-color: var(--st-accent);
  color: #FFFFFF;
}

/* ── Weather Tool specifics ───────────────────────────────────────────── */
.st-weather-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  margin-bottom: 14px;
}

.st-weather-temp {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.st-weather-city {
  font-size: 17px;
  font-weight: 700;
}

.st-weather-note {
  font-size: 13.5px;
  color: var(--st-muted);
  margin-top: 3px;
}

.st-formula-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.st-formula-list li {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--st-bg);
  font-size: 14px;
  margin: 0;
}

.st-formula-layer {
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-accent-dark);
}

/* ── Generator Tool specifics ─────────────────────────────────────────── */
.st-harmony-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  margin-bottom: 14px;
}

.st-harmony-text {
  font-size: 14px;
  color: var(--st-ink);
  margin: 0;
}

.st-harmony-text small {
  display: block;
  color: var(--st-muted);
  font-size: 13px;
  margin-top: 2px;
}

.st-swatch-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Trip Packer specifics ────────────────────────────────────────────── */
.st-meter-box {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.st-meter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.st-meter-stat {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.st-progress {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
  background: var(--st-surface-deep);
}

.st-progress::-webkit-progress-bar {
  background: var(--st-surface-deep);
  border-radius: 999px;
}

.st-progress::-webkit-progress-value {
  background: var(--st-ok);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.st-progress::-moz-progress-bar {
  background: var(--st-ok);
  border-radius: 999px;
}

.st-progress.is-over::-webkit-progress-value {
  background: var(--st-warn);
}

.st-progress.is-over::-moz-progress-bar {
  background: var(--st-warn);
}

.st-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.st-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.st-check-group {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 14px;
  padding: 12px;
}

.st-check-group h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-muted);
}

.st-check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px;
  border-radius: 9px;
  font-size: 13.5px;
  cursor: pointer;
}

.st-check-item:hover {
  background: var(--st-bg);
}

.st-check-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--st-accent);
  flex: none;
}

.st-check-thumb {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--st-bg);
  padding: 2px;
  flex: none;
}

.st-check-item.is-checked .st-check-name {
  text-decoration: line-through;
  color: var(--st-muted);
}

.st-wear-pill {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--st-surface-soft);
  color: var(--st-muted);
  white-space: nowrap;
}

.st-day-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.st-day-card {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 14px;
  padding: 12px;
}

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

.st-day-head strong {
  font-size: 14px;
}

.st-day-line {
  font-size: 13px;
  color: var(--st-muted);
  margin: 4px 0;
}

.st-day-line b {
  color: var(--st-ink);
}

/* ── Virtual Try-On Studio & On-Device Photo Check ────────────────────── */
.st-tryon-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: start;
}

.st-wipe-stage {
  --split: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 480px;
  border-radius: 18px;
  overflow: hidden;
  background: #EFECE6;
  border: 1px solid var(--st-line);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.st-wipe-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
}

.st-wipe-img-contain {
  object-fit: contain;
  padding: 12px;
  background: #EFECE6;
}

.st-wipe-after {
  clip-path: inset(0 0 0 var(--split));
  z-index: 2;
}

.st-wipe-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: #FFFFFF;
  box-shadow: 0 0 10px rgba(19, 19, 23, 0.35);
  z-index: 3;
  pointer-events: none;
}

.st-wipe-knob {
  position: absolute;
  top: 50%;
  left: var(--split);
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--st-ink);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(19, 19, 23, 0.25);
  z-index: 4;
  pointer-events: none;
}

.st-wipe-tag {
  position: absolute;
  bottom: 12px;
  z-index: 4;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(19, 19, 23, 0.78);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

.st-wipe-tag-left { left: 12px; }
.st-wipe-tag-right { right: 12px; }

.st-wipe-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--st-muted);
}

.st-tryon-pieces {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.st-mini-piece {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 12px;
  padding: 6px 4px;
  text-align: center;
}

.st-mini-piece img {
  width: 100%;
  height: 52px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
}

.st-mini-piece span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--st-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-photo-box {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 16px;
  padding: 16px;
}

.st-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--st-ok-soft);
  color: var(--st-ok);
  border: 1px solid #C3E3D0;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.st-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 18px 14px;
  border: 1.5px dashed var(--st-line-strong);
  border-radius: 14px;
  background: var(--st-bg);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.st-dropzone:hover {
  border-color: var(--st-accent);
  background: var(--st-accent-soft);
}

.st-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.st-photo-preview-wrap {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 14px;
}

.st-photo-canvas {
  width: 92px;
  height: 122px;
  border-radius: 10px;
  border: 1px solid var(--st-line);
  background: var(--st-bg);
  display: block;
}

.st-check-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.st-check-results li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--st-bg);
  margin: 0;
}

/* ── Color-Combo Matcher Swatches (Pure CSS classes, CSP safe) ────────── */
.st-sw-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(19, 19, 23, 0.2);
}

.st-sw-dot-lg {
  width: 24px;
  height: 24px;
}

.st-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.st-swatch-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--st-line-strong);
  background: var(--st-surface);
  color: var(--st-ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.12s ease, background-color 0.15s ease;
}

.st-swatch-btn:hover {
  border-color: var(--st-ink);
  transform: translateY(-1px);
}

.st-swatch-btn[aria-pressed="true"] {
  background: var(--st-ink);
  border-color: var(--st-ink);
  color: #FFFFFF;
}

/* 14 core colors + complementary palette classes */
.st-sw-navy       { background-color: #2A3C5E; }
.st-sw-burgundy   { background-color: #6B2A33; }
.st-sw-olive      { background-color: #5E6B35; }
.st-sw-camel      { background-color: #C19A6B; }
.st-sw-black      { background-color: #232120; }
.st-sw-white      { background-color: #F5F4F1; }
.st-sw-cream      { background-color: #E8DFCB; }
.st-sw-charcoal   { background-color: #46484E; }
.st-sw-denim      { background-color: #4F7CAC; }
.st-sw-terracotta { background-color: #B7613F; }
.st-sw-forest     { background-color: #264B38; }
.st-sw-blush      { background-color: #E2B4B0; }
.st-sw-mustard    { background-color: #D6AE3B; }
.st-sw-chocolate  { background-color: #3A2A22; }
.st-sw-stone      { background-color: #CDC1A8; }
.st-sw-grey       { background-color: #9B9A98; }

.st-pairing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.st-pairing-card {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 14px;
  padding: 13px;
}

.st-pairing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.st-pairing-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14.5px;
}

.st-pairing-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--st-muted);
}

.st-ratio-bar {
  display: grid;
  grid-template-columns: 6fr 3fr 1fr;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--st-line-strong);
  margin: 10px 0 8px;
}

.st-ratio-seg {
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 750;
}

.st-ratio-light { color: #131317; }
.st-ratio-dark  { color: #FFFFFF; }

.st-ratio-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 13px;
}

.st-avoid-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--st-bad-soft);
  border: 1px solid #E7BFC4;
  font-size: 13.5px;
}

/* ── Closet Utilization Audit specifics ───────────────────────────────── */
.st-audit-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.st-audit-field {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 14px;
  padding: 12px 14px;
}

.st-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.st-kpi {
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 14px;
  padding: 14px;
}

.st-kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-muted);
}

.st-kpi-val {
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 5px 0 3px;
  font-variant-numeric: tabular-nums;
  color: var(--st-ink);
}

.st-kpi-sub {
  font-size: 12.5px;
  color: var(--st-muted);
}

.st-grade-pill {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 850;
}

.st-grade-a { background: var(--st-ok-soft); color: var(--st-ok); border: 1px solid #C3E3D0; }
.st-grade-b { background: #EBF2FA; color: #245082; border: 1px solid #C2D7EE; }
.st-grade-c { background: var(--st-warn-soft); color: var(--st-warn); border: 1px solid #ECD3A3; }
.st-grade-d { background: var(--st-bad-soft); color: var(--st-bad); border: 1px solid #E7BFC4; }

.st-hidden-canvas {
  display: none;
}

/* ── Responsive breakpoints ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .st-tool-card {
    padding: 16px;
    border-radius: 16px;
  }
  .st-split,
  .st-tryon-grid,
  .st-pairing-grid,
  .st-audit-inputs,
  .st-kpi-grid {
    grid-template-columns: 1fr;
  }
  .st-ratio-legend {
    grid-template-columns: 1fr;
  }
  .st-tool-bridge {
    padding: 15px;
  }
  .st-tool-cta {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .st-tryon-pieces {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .st-swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .st-formula-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-tool-card *,
  .st-tool-cta,
  .st-progress::-webkit-progress-value {
    transition: none !important;
  }
}
