:root {
  color-scheme: light;
  --bg: #f6f3ef;
  --surface: #fffdf9;
  --surface-2: #f0ebe4;
  --text: #23201d;
  --muted: #716b63;
  --line: #ddd5ca;
  --accent: #8f3f45;
  --accent-2: #235d61;
  --accent-soft: #f3d9d8;
  --shadow: 0 18px 48px rgba(52, 42, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body[data-active-view="admin"] {
  min-width: 320px;
}

body[data-store-locked="true"] .app-shell {
  display: none;
}

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

button,
.file-btn,
.file-drop {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-card h1 {
  margin-bottom: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

body[data-active-view="customer"] .app-shell,
body[data-active-view="employee"] .app-shell {
  width: min(430px, calc(100% - 18px));
}

body[data-active-view="admin"] .app-shell {
  width: min(1180px, calc(100% - 28px));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 18px;
}

.top-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.store-session {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  padding: 8px 10px;
  text-align: right;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 760;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 16px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.view-switch,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.switch-btn,
.primary-btn,
.secondary-btn,
.danger-btn,
.file-btn,
.inline-btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 720;
}

.switch-btn {
  background: var(--surface-2);
  color: var(--muted);
}

.switch-btn.active,
.primary-btn {
  background: var(--text);
  color: #fff;
}

.secondary-btn,
.file-btn,
.inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.inline-btn {
  width: max-content;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.danger-btn {
  background: #f5d3cc;
  color: #7c2d23;
}

.file-btn input,
.file-drop input {
  display: none;
}

.notice-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.notice-band > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ef;
}

.guide-box {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef7f4;
}

.guide-box span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.store-brand-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.store-visual {
  display: grid;
  gap: 8px;
  min-height: 150px;
}

.store-hero-main {
  width: 100%;
  min-height: 150px;
  height: 150px;
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: cover;
}

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

.store-hero-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--surface-2);
  object-fit: cover;
}

.store-hero-placeholder {
  display: grid;
  place-items: center;
  min-height: 150px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

.store-info {
  display: grid;
  gap: 9px;
  align-content: center;
}

.store-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-title img,
.store-logo-placeholder {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.store-logo-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notice-band span,
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  gap: 18px;
}

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

#customerView .grid.two,
#employeeView .grid.two,
#customerView .form-grid,
#employeeView .form-grid {
  grid-template-columns: 1fr;
}

body[data-active-view="customer"] .notice-band,
body[data-active-view="employee"] .notice-band {
  grid-template-columns: 1fr;
}

body[data-active-view="customer"] .topbar,
body[data-active-view="employee"] .topbar {
  align-items: stretch;
  flex-direction: column;
}

body[data-active-view="customer"] .top-actions,
body[data-active-view="employee"] .top-actions {
  justify-items: stretch;
}

body[data-active-view="customer"] .store-session,
body[data-active-view="employee"] .store-session {
  text-align: left;
}

body[data-active-view="customer"] .panel-head,
body[data-active-view="employee"] .panel-head {
  align-items: stretch;
  flex-direction: column;
}

body[data-active-view="customer"] .view-switch,
body[data-active-view="employee"] .view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-active-view="customer"] .actions,
body[data-active-view="employee"] .actions {
  display: grid;
  grid-template-columns: 1fr;
}

body[data-active-view="customer"] .store-brand-card,
body[data-active-view="employee"] .store-brand-card {
  grid-template-columns: 1fr;
}

body[data-active-view="customer"] h1,
body[data-active-view="employee"] h1 {
  font-size: 30px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

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

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

.stacked-form {
  display: grid;
  gap: 11px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

select[multiple] {
  min-height: 146px;
}

select[multiple] option {
  padding: 8px;
}

select.enhanced-multi {
  display: none;
}

.check-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f4ef;
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.check-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-chip span::before {
  content: "";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  vertical-align: -2px;
}

.check-chip:has(input:checked) {
  border-color: var(--accent-2);
  background: #e6f3f1;
  color: var(--accent-2);
}

.check-chip:has(input:checked) span::before {
  content: "✓";
  border-color: var(--accent-2);
  background: var(--accent-2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(35, 93, 97, 0.13);
}

.file-drop {
  min-height: 72px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--accent-2);
  border-radius: 8px;
  background: #eef7f4;
  color: var(--accent-2);
  cursor: pointer;
  text-align: center;
}

.camera-box {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(35, 93, 97, 0.3) 50%, transparent 51%),
    linear-gradient(#f8f0e9, #ebe4db);
}

.camera-box video,
.camera-box img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-box video.active,
.camera-box img.active {
  display: block;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.camera-placeholder::after {
  content: "";
  position: absolute;
  bottom: 42px;
  width: 94px;
  height: 18px;
  border-radius: 999px;
  background: rgba(143, 63, 69, 0.22);
  box-shadow: 0 30px 0 rgba(143, 63, 69, 0.16);
}

.card-list,
.plan-list,
.thumb-grid {
  display: grid;
  gap: 12px;
}

.thumb-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.empty-state {
  min-height: 86px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
}

.data-card,
.garment-card,
.plan-card,
.thumb-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.garment-card,
.plan-card,
.thumb-card {
  display: grid;
  gap: 10px;
}

.row-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
}

.cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.admin-inventory-list .cover {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f5f2ee;
}

.add-stock-size-btn {
  margin-top: 8px;
}
.portrait-small {
  width: 72px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border-radius: 999px;
  background: #eef1f1;
  color: var(--accent-2);
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.25;
}

.tag button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(35, 93, 97, 0.12);
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-actions button,
.mini-actions a {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.mini-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.generated-box {
  margin-top: 14px;
}
.stage-indicator {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  display: inline-block;
}
.stage-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.stage-actions button {
  flex: 1;
  min-width: 120px;
}
.stage-revert-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.option-manager {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ef;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.merchant-workspace {
  display: grid;
  gap: 18px;
}

.staff-panel {
  display: grid;
  gap: 14px;
}

.staff-badge {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: #eef7f4;
  color: var(--accent-2);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.staff-list {
  display: grid;
  gap: 8px;
}

.staff-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.membership-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ef;
  padding: 14px;
}

.served-customers {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.mini-customer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-customer-list button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #eef7f4;
  color: var(--accent-2);
  cursor: pointer;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 760;
}

.analytics-box {
  display: grid;
  gap: 12px;
}

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

.stat-grid div {
  display: none;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.stat-grid strong {
  font-size: 23px;
}

.stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-block {
  display: grid;
  gap: 7px;
}

.size-stock-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ef;
}

.size-stock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.size-stock-rows,
.inventory-list {
  display: grid;
  gap: 8px;
}

.size-stock-row,
.inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inventory-row {
  grid-template-columns: 70px minmax(0, 100px) auto;
}

.inventory-row strong {
  font-size: 13px;
}

.tryon-canvas {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  padding: 12px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

@media (max-width: 820px) {
  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-band,
  .grid.two,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .view-switch,
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .panel {
    padding: 14px;
  }
}

@media (max-width: 460px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 12px;
  }

  .thumb-grid,
  .row-card {
    grid-template-columns: 1fr;
  }

  .view-switch,
  .actions,
  .option-row,
  .staff-card,
  .size-stock-row,
  .inventory-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .size-stock-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* v2 AI outfit workbench additions */
body[data-active-view="platform"] .app-shell,
body[data-active-view="admin"] .app-shell {
  width: min(1180px, calc(100% - 28px));
}

body[data-active-view="employee"] .app-shell {
  width: min(520px, calc(100% - 18px));
}

body[data-active-view="platform"] {
  min-width: 1024px;
}

body[data-active-view="platform"] .grid.two,
body[data-active-view="admin"] .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-active-view="employee"] .grid.two,
body[data-active-view="employee"] .form-grid {
  grid-template-columns: 1fr;
}

.panel-head.compact {
  margin-top: 16px;
  margin-bottom: 10px;
}

.share-builder {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.share-check-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--text);
}

.share-check-card > input {
  width: 20px;
  min-height: 20px;
  margin-top: 8px;
}

.compact-plan {
  border: 0;
  padding: 0;
  box-shadow: none;
}

.compact-plan .tryon-canvas {
  max-height: 220px;
  object-fit: cover;
}

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

.goods-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  padding: 8px;
  font-size: 13px;
}

.goods-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.goods-line em,
.goods-line small {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

.garment-card.is-disabled {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.share-link-card {
  display: grid;
  gap: 10px;
}

.share-page {
  min-height: 100vh;
  background: var(--bg);
}

.share-shell {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 12px 96px;
}

.share-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.share-hero h1 {
  font-size: 25px;
  line-height: 1.18;
}

.share-hero p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.share-plans {
  display: grid;
  gap: 14px;
}

.share-plan-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.share-plan-card img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.share-plan-card h2 {
  font-size: 20px;
}

.share-plan-total {
  border-radius: 8px;
  background: #eef7f4;
  color: var(--accent-2);
  padding: 10px;
  font-weight: 800;
}

.share-footer {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  width: min(520px, 100%);
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(246, 243, 239, 0.96);
  padding: 10px 12px 14px;
  backdrop-filter: blur(10px);
}

.share-footer .primary-btn,
.share-footer .secondary-btn {
  min-width: 0;
  padding: 0 8px;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 820px) {
  body[data-active-view="platform"] {
    min-width: 320px;
  }

  body[data-active-view="platform"] .grid.two,
  body[data-active-view="admin"] .grid.two {
    grid-template-columns: 1fr;
  }

  .goods-line {
    grid-template-columns: 1fr auto;
  }

  .goods-line em,
  .goods-line small {
    justify-self: start;
  }
}

/* employee mobile app layout */
body[data-active-view="employee"] .topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  border-bottom: 1px solid rgba(221, 213, 202, 0.8);
  background: rgba(246, 243, 239, 0.96);
  backdrop-filter: blur(10px);
}

body[data-active-view="employee"] .notice-band,
body[data-active-view="employee"] .store-brand-card {
  display: none;
}

body[data-active-view="employee"] .staff-panel {
  margin-bottom: 12px;
}

.employee-section-nav {
  position: sticky;
  top: 118px;
  z-index: 11;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
  padding: 7px;
  box-shadow: 0 10px 24px rgba(52, 42, 34, 0.08);
  backdrop-filter: blur(10px);
}

.employee-section-btn {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0 4px;
}

.employee-section-btn.active {
  background: var(--text);
  color: #fff;
}

.mobile-dashboard {
  display: grid;
  gap: 12px;
}

.mobile-hero-card,
.mobile-next-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.mobile-hero-card h2 {
  font-size: 24px;
}

.mobile-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-stat-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 8px;
  text-align: center;
}

.mobile-stat-row strong {
  font-size: 22px;
}

.mobile-stat-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

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

.mobile-action-grid button {
  display: grid;
  gap: 6px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.mobile-action-grid strong {
  font-size: 16px;
}

.mobile-action-grid span,
.mobile-next-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.merchant-workspace[data-employee-section="home"] .employee-section-panel {
  display: none;
}

.merchant-workspace[data-employee-section="home"] #employeeDashboard {
  display: grid;
}

.merchant-workspace:not([data-employee-section="home"]) #employeeDashboard {
  display: none;
}

.merchant-workspace[data-employee-section="intake"] .employee-section-panel:not([data-employee-panel="intake"]),
.merchant-workspace[data-employee-section="inventory"] .employee-section-panel:not([data-employee-panel="inventory"]),
.merchant-workspace[data-employee-section="styling"] .employee-section-panel:not([data-employee-panel="styling"]),
.merchant-workspace[data-employee-section="follow"] .employee-section-panel:not([data-employee-panel="styling"]) {
  display: none;
}

.merchant-workspace[data-employee-section="follow"] [data-employee-panel="styling"] {
  grid-template-columns: 1fr;
}

.merchant-workspace[data-employee-section="follow"] [data-employee-panel="styling"] > article:not(.follow-panel) {
  display: none;
}

body[data-active-view="employee"] .panel {
  padding: 14px;
}

body[data-active-view="employee"] .panel-head {
  margin-bottom: 12px;
}

body[data-active-view="employee"] input,
body[data-active-view="employee"] select,
body[data-active-view="employee"] textarea,
body[data-active-view="employee"] .primary-btn,
body[data-active-view="employee"] .secondary-btn,
body[data-active-view="employee"] .file-btn {
  min-height: 46px;
}

@media (max-width: 460px) {
  .employee-section-nav {
    top: 146px;
    gap: 4px;
    padding: 6px;
  }

  .employee-section-btn {
    font-size: 12px;
  }

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

/* styling core workbench */
.styling-workbench {
  display: grid;
  gap: 12px;
}

.styling-customer-panel {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.styling-customer-photo {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.styling-customer-photo img,
.portrait-empty {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.styling-customer-info {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.body-chip-grid .tag {
  margin: 0 5px 5px 0;
}

.styling-goods-panel {
  display: grid;
  gap: 10px;
}

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

.styling-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 5px;
}

.styling-tab.active {
  border-color: var(--accent-2);
  background: #e6f3f1;
  color: var(--accent-2);
}

.styling-goods-pool {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  max-height: 430px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.styling-goods-pool::-webkit-scrollbar {
  height: 5px;
}
.styling-goods-pool::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 5px;
}

.styling-good-card {
  display: grid;
  gap: 7px;
  flex-shrink: 0;
  width: 88px;
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  text-align: left;
  scroll-snap-align: start;
}

.styling-good-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 7px;
  background: var(--surface-2);
  object-fit: contain;
}

.styling-good-card span {
  min-height: 36px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.styling-good-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.styling-good-card.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(35, 93, 97, 0.13);
}

.styling-good-card.disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.45);
}

.styling-selected-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ef;
  padding: 12px;
}

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

.selected-good-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  font-size: 13px;
}

.selected-good-row span {
  overflow-wrap: anywhere;
}

.selected-good-row button {
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  padding: 7px 9px;
  font-weight: 800;
}

.styling-submit-form select[name="garmentIds"] {
  display: none;
}

.styling-submit-form select[name="customerId"] {
  min-height: 46px;
}

@media (max-width: 460px) {
  .styling-customer-panel {
    grid-template-columns: 110px minmax(0, 1fr);
  }

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

  .styling-goods-pool {
    max-height: 360px;
  }
}

/* enlarged customer visual comparison workspace */
.styling-customer-panel {
  grid-template-columns: 1fr;
}

.styling-visual-workspace {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.visual-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.visual-toolbar h3 {
  font-size: 22px;
}

.visual-mode-switch {
  display: flex;
  gap: 6px;
}

.visual-mode-switch button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.visual-mode-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.visual-mode-switch .revert-stage-btn {
  background: #fef3c7;
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.visual-mode-switch .revert-stage-btn[hidden] { display: none; }

.visual-toolbar .stage-hint {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--accent-2);
  font-weight: 700;
}

.visual-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.visual-image {
  display: grid;
  gap: 6px;
  margin: 0;
}


.visual-image.result-image {
  position: relative;
}

.ai-debug-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(30, 30, 28, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  pointer-events: none;
}
.ai-debug-meta {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px dashed #cdbfb0;
  border-radius: 8px;
  background: #fffaf2;
  color: #6f655d;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
}

.ai-debug-meta p {
  margin: 0;
}

.ai-debug-meta strong {
  display: inline-block;
  margin-right: 6px;
  color: #9f3f3f;
}

.visual-image img,
.visual-image .portrait-empty {
  width: 100%;
  min-height: 300px;
  max-height: 80vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: contain;
}

.visual-image figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.styling-visual-workspace[data-compare-mode="original"] .result-image,
.styling-visual-workspace[data-compare-mode="result"] .original-image {
  display: none;
}

.styling-visual-workspace[data-compare-mode="original"] .visual-stage,
.styling-visual-workspace[data-compare-mode="result"] .visual-stage {
  grid-template-columns: 1fr;
}

.styling-visual-workspace[data-compare-mode="original"] .visual-image img,
.styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
.styling-visual-workspace[data-compare-mode="result"] .visual-image img,
.styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
  min-height: 540px;
}

.styling-customer-info {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef7f4;
  padding: 10px;
}

@media (max-width: 460px) {
  .visual-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .visual-mode-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .visual-stage {
    grid-template-columns: 1fr;
  }

  .styling-visual-workspace[data-compare-mode="compare"] .visual-image img,
  .styling-visual-workspace[data-compare-mode="compare"] .visual-image .portrait-empty {
    min-height: 380px;
  }

  .styling-visual-workspace[data-compare-mode="original"] .visual-image img,
  .styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
  .styling-visual-workspace[data-compare-mode="result"] .visual-image img,
  .styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
    min-height: 520px;
  }
}

/* employee app shell v3 */
body[data-active-view="employee"] {
  background: #f7ead0;
}

body[data-active-view="employee"] .app-shell {
  width: min(430px, 100%);
  min-height: 100vh;
  padding: 0 10px 96px;
}

body[data-active-view="employee"] .topbar {
  display: none;
}

#employeeView.staff-logged-in .staff-panel {
  display: none;
}

.employee-app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -10px 10px;
  border-bottom: 1px solid rgba(221, 213, 202, 0.9);
  background: rgba(255, 248, 235, 0.96);
  padding: 10px 12px;
  backdrop-filter: blur(12px);
}

.employee-store-mark,
.employee-staff-chip,
.mine-profile-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.employee-store-mark img,
.store-logo-dot,
.wechat-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.store-logo-dot,
.wechat-avatar {
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  background: #8a9679;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(52, 42, 34, 0.12);
}

.employee-store-mark strong,
.employee-staff-chip strong,
.mine-profile-row strong {
  display: block;
  max-width: 180px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-store-mark span,
.employee-staff-chip span,
.mine-profile-row span {
  display: block;
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-section-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  top: auto;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(430px, 100%);
  margin: 0 auto;
  border: 0;
  border-top: 1px solid rgba(221, 213, 202, 0.95);
  border-radius: 12px 12px 0 0;
  background: rgba(255, 248, 235, 0.98);
  box-shadow: 0 -8px 20px rgba(52, 42, 34, 0.1);
  padding: 6px 6px 8px;
}

.employee-section-btn {
  position: relative;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d96758;
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.15;
  padding: 0 2px;
}

.employee-section-btn span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-section-btn.active {
  outline: 2px dashed #ff4d5d;
  outline-offset: -4px;
  background: transparent;
  color: #d96758;
}

.merchant-workspace {
  display: grid;
  gap: 10px;
}

.merchant-workspace[data-employee-section="my"] .employee-section-panel:not([data-employee-panel="my"]),
.merchant-workspace[data-employee-section="inventory"] .employee-section-panel:not([data-employee-panel="inventory"]) {
  display: none;
}

.merchant-workspace[data-employee-section="my"] #employeeDashboard,
.merchant-workspace[data-employee-section="inventory"] #employeeDashboard {
  display: none;
}

.employee-my-panel {
  display: grid;
}

.merchant-workspace:not([data-employee-section="my"]) .employee-my-panel {
  display: none;
}

body[data-active-view="employee"] .panel {
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 10px 28px rgba(52, 42, 34, 0.08);
}

body[data-active-view="employee"] .employee-section-panel[data-employee-panel="styling"] {
  grid-template-columns: 1fr;
}

body[data-active-view="employee"] .employee-section-panel[data-employee-panel="styling"] > article:not(.follow-panel) {
  order: 1;
}

body[data-active-view="employee"] .employee-section-panel[data-employee-panel="styling"] > .follow-panel {
  order: 2;
}

.merchant-workspace[data-employee-section="styling"] .follow-panel {
  display: none;
}

.merchant-workspace[data-employee-section="follow"] .follow-panel {
  display: block;
}

.styling-goods-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  padding: 10px;
}

.styling-source-tabs,
.styling-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.styling-source-tabs::-webkit-scrollbar,
.styling-tabs::-webkit-scrollbar,
.styling-goods-pool::-webkit-scrollbar {
  display: none;
}

.styling-source-tab,
.styling-tab {
  min-width: max-content;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  padding: 0 14px;
}

.styling-source-tab.active,
.styling-tab.active {
  border-color: var(--accent-2);
  background: #e6f3f1;
  color: var(--accent-2);
}

.styling-goods-pool {
  display: flex;
  gap: 10px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
}

.styling-good-card {
  flex: 0 0 158px;
  scroll-snap-align: start;
}

.styling-good-card img {
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.styling-selected-panel,
.share-builder,
#generatedPlan {
  margin-top: 2px;
}

.visual-image img,
.visual-image .portrait-empty {
  min-height: 470px;
}

.styling-visual-workspace[data-compare-mode="original"] .visual-image img,
.styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
.styling-visual-workspace[data-compare-mode="result"] .visual-image img,
.styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
  min-height: 560px;
}

.mine-card {
  display: grid;
  gap: 14px;
}

.wechat-avatar.large {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.mine-info-grid {
  display: grid;
  gap: 8px;
}

.mine-info-grid div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.mine-info-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mine-info-grid strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.compact-actions {
  margin-top: 12px;
}

@media (max-width: 460px) {
  .employee-store-mark strong,
  .employee-store-mark span {
    max-width: 190px;
  }

  .employee-staff-chip strong,
  .employee-staff-chip span {
    max-width: 92px;
  }

  .visual-toolbar h3 {
    font-size: 20px;
  }

  .visual-image img,
  .visual-image .portrait-empty {
    min-height: 420px;
  }

  .styling-visual-workspace[data-compare-mode="original"] .visual-image img,
  .styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
  .styling-visual-workspace[data-compare-mode="result"] .visual-image img,
  .styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
    min-height: 520px;
  }
}



.employee-section-nav {
  min-height: 78px;
}

/* workbench now focuses on store material capture */
.merchant-workspace[data-employee-section="home"] #employeeDashboard {
  display: none;
}

.merchant-workspace[data-employee-section="home"] .employee-section-panel {
  display: none;
}

.merchant-workspace[data-employee-section="home"] [data-employee-panel="inventory"] {
  display: grid;
}

.merchant-workspace[data-employee-section="home"] [data-employee-panel="inventory"] .panel {
  min-height: 0;
}

.tag-picker-label {
  gap: 10px;
}

.native-multi-select {
  display: none;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.tag-choice {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  padding: 0 14px;
}

.tag-choice.active {
  border-color: var(--accent-2);
  background: #e6f3f1;
  color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(35, 93, 97, 0.1);
}

.capture-flow-actions {
  display: grid;
  gap: 10px;
}

.capture-confirm-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.subtle-file-btn {
  justify-content: center;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
}

/* styling desk v4: large effect image, category-first, 4 recommended goods */
.merchant-workspace[data-employee-section="styling"] .employee-section-panel[data-employee-panel="styling"] {
  gap: 8px;
}

.merchant-workspace[data-employee-section="styling"] .employee-section-panel[data-employee-panel="styling"] > article:not(.follow-panel) {
  padding: 10px;
}

.merchant-workspace[data-employee-section="styling"] .employee-section-panel[data-employee-panel="styling"] > article:not(.follow-panel) > .panel-head {
  display: none;
}

.merchant-workspace[data-employee-section="styling"] .styling-workbench {
  gap: 8px;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-panel {
  border: 0;
  background: transparent;
  padding: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace {
  gap: 8px;
  padding: 8px;
}

.merchant-workspace[data-employee-section="styling"] .visual-toolbar {
  align-items: center;
  flex-direction: row;
}

.merchant-workspace[data-employee-section="styling"] .visual-toolbar h3 {
  font-size: 20px;
}

.merchant-workspace[data-employee-section="styling"] .visual-mode-switch button {
  min-height: 32px;
  padding: 0 9px;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
  min-height: min(58vh, 560px);
  max-height: 620px;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-info {
  display: block;
  max-height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(238, 247, 244, 0.75);
  padding: 8px;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-info .body-chip-grid,
.merchant-workspace[data-employee-section="styling"] .styling-customer-info p:nth-of-type(n+3) {
  display: none;
}

.merchant-workspace[data-employee-section="styling"] .styling-goods-panel {
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.merchant-workspace[data-employee-section="styling"] .styling-tab {
  flex: 0 0 auto;
  min-height: 38px;
  min-width: 72px;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  padding: 0 12px;
}

.merchant-workspace[data-employee-section="styling"] .styling-source-tabs {
  justify-content: flex-end;
  gap: 6px;
  padding: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-source-tab {
  min-height: 28px;
  border-radius: 999px;
  font-size: 11px;
  padding: 0 10px;
}

.merchant-workspace[data-employee-section="styling"] .styling-goods-pool {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.merchant-workspace[data-employee-section="styling"] .styling-goods-pool::-webkit-scrollbar {
  height: 4px;
}
.merchant-workspace[data-employee-section="styling"] .styling-goods-pool::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card {
  display: grid;
  gap: 4px;
  flex-shrink: 0;
  width: 85px;
  min-width: 85px;
  padding: 5px;
  scroll-snap-align: start;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card img {
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  width: 100%;
  object-fit: contain;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card span {
  min-height: 30px;
  font-size: 11px;
  line-height: 1.25;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card small {
  font-size: 10px;
  line-height: 1.25;
}

.merchant-workspace[data-employee-section="styling"] .styling-selected-panel {
  padding: 9px;
}

.merchant-workspace[data-employee-section="styling"] .styling-submit-form,
.merchant-workspace[data-employee-section="styling"] .share-builder,
.merchant-workspace[data-employee-section="styling"] #generatedPlan {
  margin-top: 8px;
}

/* styling desk v4 adjustment: keep 4 goods visible in first screen */
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
  min-height: min(50vh, 480px);
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-info {
  max-height: 48px;
}

.merchant-workspace[data-employee-section="styling"] .styling-goods-pool {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card {
  flex-shrink: 0;
  width: 85px;
  min-width: 85px;
  scroll-snap-align: start;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card span {
  font-size: 12px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card small {
  font-size: 10.5px;
}

/* styling desk final override: scrollable recommendation cards */
.merchant-workspace[data-employee-section="styling"] .styling-good-card {
  flex-shrink: 0;
  width: 85px;
  min-width: 85px;
}


/* styling desk final layout: effect image + 3 product cards in one phone view */
.merchant-workspace[data-employee-section="styling"] .styling-workbench {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-panel,
.merchant-workspace[data-employee-section="styling"] .styling-goods-panel {
  display: contents;
  border: 0;
  background: transparent;
  padding: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace {
  order: 1;
  padding: 6px;
  gap: 4px;
}

.merchant-workspace[data-employee-section="styling"] .visual-toolbar {
  min-height: 34px;
  gap: 6px;
}

.merchant-workspace[data-employee-section="styling"] .visual-toolbar .eyebrow {
  display: none;
}

.merchant-workspace[data-employee-section="styling"] .visual-toolbar h3 {
  font-size: 16px;
}

.merchant-workspace[data-employee-section="styling"] .visual-mode-switch button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.merchant-workspace[data-employee-section="styling"] .visual-stage {
  min-height: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
  min-height: clamp(330px, 45vh, 430px);
  max-height: 430px;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace figcaption {
  padding: 4px 0 0;
  font-size: 12px;
}

.merchant-workspace[data-employee-section="styling"] .styling-goods-pool {
  order: 2;
  margin-top: 0;
  padding: 0 0 2px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card {
  flex-shrink: 0;
  width: 85px;
  min-width: 85px;
  padding: 4px;
  gap: 3px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card img {
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card span {
  min-height: 18px;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card small {
  display: none;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-info {
  order: 3;
  max-height: 42px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-info p {
  margin: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-tabs {
  order: 4;
  gap: 6px;
  padding: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-tab {
  min-height: 32px;
  min-width: 60px;
  padding: 0 10px;
  font-size: 13px;
}

.merchant-workspace[data-employee-section="styling"] .styling-source-tabs {
  order: 5;
  justify-content: flex-end;
  padding: 0;
}

.merchant-workspace[data-employee-section="styling"] .styling-source-tab {
  min-height: 24px;
  padding: 0 9px;
  font-size: 11px;
}

.merchant-workspace[data-employee-section="styling"] .styling-selected-panel {
  order: 6;
}

/* styling desk final layout v2: customer first, all key controls in one phone viewport */
.merchant-workspace[data-employee-section="styling"] .styling-customer-picker {
  order: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 5px 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.94);
  padding: 6px 8px;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-picker strong {
  display: block;
  font-size: 13px;
  line-height: 1.15;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-picker span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-picker input,
.merchant-workspace[data-employee-section="styling"] .styling-customer-picker select {
  min-height: 30px;
  height: 30px;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-picker select {
  grid-column: 2;
}

.merchant-workspace[data-employee-section="styling"] .styling-workbench {
  gap: 5px;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace {
  padding: 5px;
}

.merchant-workspace[data-employee-section="styling"] .visual-toolbar {
  min-height: 28px;
}

.merchant-workspace[data-employee-section="styling"] .visual-toolbar h3 {
  font-size: 15px;
}

.merchant-workspace[data-employee-section="styling"] .visual-mode-switch button {
  min-height: 24px;
  padding: 0 7px;
  font-size: 11px;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
  min-height: clamp(250px, 32vh, 315px);
  max-height: 315px;
}

.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace figcaption {
  padding-top: 2px;
  font-size: 11px;
}

.merchant-workspace[data-employee-section="styling"] .styling-goods-pool {
  gap: 7px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card {
  flex-shrink: 0;
  width: 85px;
  min-width: 85px;
  padding: 3px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card img {
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card span {
  min-height: 16px;
  font-size: 11px;
}

.merchant-workspace[data-employee-section="styling"] .styling-customer-info {
  max-height: 32px;
  padding: 4px 7px;
  font-size: 11px;
}

.merchant-workspace[data-employee-section="styling"] .styling-tabs {
  gap: 5px;
}

.merchant-workspace[data-employee-section="styling"] .styling-tab {
  min-height: 28px;
  min-width: 54px;
  padding: 0 9px;
  font-size: 12px;
}

.merchant-workspace[data-employee-section="styling"] .styling-source-tab {
  min-height: 22px;
  padding: 0 8px;
  font-size: 10px;
}

/* styling flow console: replace basket with generation workflow */
.merchant-workspace[data-employee-section="styling"] .styling-flow-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.98);
  padding: 10px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head h3 {
  margin: 0;
  font-size: 16px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head p,
.merchant-workspace[data-employee-section="styling"] .flow-hint {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.35;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head .secondary-btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-list {
  display: grid;
  gap: 5px;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row span {
  display: grid;
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row em {
  color: var(--accent);
  font-style: normal;
  font-size: 10px;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row strong {
  font-size: 11px;
  white-space: nowrap;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row button {
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: var(--rose);
  color: var(--accent);
  font-weight: 900;
  padding: 0 9px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-actions button {
  min-height: 38px;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1.15;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-actions .final-action {
  background: var(--ink);
}

.merchant-workspace[data-employee-section="styling"] .styling-submit-form {
  display: none;
}

/* styling flow final: selection happens on product cards, console only keeps actions */
.merchant-workspace[data-employee-section="styling"] .styling-flow-panel {
  gap: 6px;
  padding: 8px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head {
  align-items: center;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head h3 {
  font-size: 15px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head p {
  display: none;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head .secondary-btn {
  min-height: 28px;
  padding: 0 10px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-actions button {
  min-height: 36px;
}

.merchant-workspace[data-employee-section="styling"] .flow-hint {
  margin: 0;
  font-size: 10.5px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(143, 63, 69, 0.18);
  position: relative;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card.active::after {
  content: "已选";
  position: absolute;
  right: 6px;
  top: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 6px;
}

/* styling flow final v2: first row actions, second row save */
.merchant-workspace[data-employee-section="styling"] .styling-flow-panel {
  padding: 8px;
  gap: 7px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-head,
.merchant-workspace[data-employee-section="styling"] .flow-hint {
  display: none;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.merchant-workspace[data-employee-section="styling"] .styling-flow-actions button,
.merchant-workspace[data-employee-section="styling"] .save-plan-action {
  min-height: 38px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.1;
}

.merchant-workspace[data-employee-section="styling"] .save-plan-action {
  width: 100%;
  background: var(--ink);
}

.merchant-workspace[data-employee-section="styling"] .model-selector-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 0 8px;
}
.merchant-workspace[data-employee-section="styling"] .model-selector-row label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  padding: 2px 8px;
}
.merchant-workspace[data-employee-section="styling"] .model-selector-row label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.merchant-workspace[data-employee-section="styling"] .model-selector-row label select {
  min-width: 0;
  width: 100%;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  outline: none;
}

/* saved plans live in follow tab customer records, not below styling desk */
.merchant-workspace[data-employee-section="styling"] .share-builder,
.merchant-workspace[data-employee-section="styling"] #generatedPlan {
  display: none;
}

.customer-follow-card {
  align-items: flex-start;
}

.customer-plan-box {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.customer-plan-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.customer-plan-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  padding: 7px;
}

.customer-plan-item img {
  width: 76px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.customer-plan-item h4 {
  margin: 0 0 3px;
  font-size: 14px;
}

.customer-plan-item .mini-actions {
  margin-top: 5px;
}

.customer-plan-item.is-confirmed {
  border-color: rgba(143, 63, 69, 0.35);
}

/* styling desk should not show saved/preview plan lists below the workspace */
body[data-active-view="employee"] #generatedPlan,
body[data-active-view="employee"] .share-builder {
  display: none !important;
}

/* make archive action unmistakable */
.merchant-workspace[data-employee-section="styling"] .save-plan-action,
body[data-active-view="employee"] .merchant-workspace[data-employee-section="styling"] .save-plan-action {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  background: #1f1b18 !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: 0 8px 18px rgba(31, 27, 24, 0.18);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  opacity: 1 !important;
}

/* keep styling action console above the fixed bottom navigation */
.merchant-workspace[data-employee-section="styling"] .styling-flow-panel {
  position: sticky;
  bottom: 88px;
  z-index: 12;
  box-shadow: 0 10px 26px rgba(52, 42, 34, 0.14);
}

body[data-active-view="employee"] .app-shell {
  padding-bottom: 124px;
}

/* follow desk: compact customer list first, expand plans only after tapping a customer */
body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-list {
  gap: 8px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  align-items: start;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card .admin-inventory-list .cover {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f5f2ee;
}

.add-stock-size-btn {
  margin-top: 8px;
}
.portrait-small {
  width: 72px;
  height: 88px;
  border-radius: 8px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card h3,
body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card p {
  margin-top: 0;
  margin-bottom: 3px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-top span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card .meta {
  margin-top: 4px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card .mini-actions {
  margin-top: 6px;
  gap: 6px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card .mini-actions button {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-plan-box {
  margin: 8px 0 0;
  gap: 7px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-plan-item {
  grid-template-columns: 68px minmax(0, 1fr);
  padding: 6px;
  gap: 8px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-plan-item img {
  width: 68px;
  height: 84px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-plan-item h4 {
  font-size: 13px;
  margin-bottom: 2px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-plan-item .mini-actions button {
  min-height: 30px;
  padding: 5px 9px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-plan-item.is-shared {
  border-color: rgba(35, 93, 97, 0.28);
}

/* follow desk tools: search, sorting, and hidden-customer recovery */
body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .follow-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  margin-bottom: 8px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .follow-tools input,
body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .follow-tools select,
body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .follow-tools button {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .follow-tools input {
  grid-column: 1 / -1;
  font-weight: 700;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .follow-hidden-toggle.active {
  background: rgba(35, 93, 97, 0.12);
  border-color: rgba(35, 93, 97, 0.35);
  color: var(--teal);
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card.is-important {
  border-color: rgba(143, 63, 69, 0.38);
  box-shadow: inset 3px 0 0 rgba(143, 63, 69, 0.65);
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .customer-follow-card.is-hidden-customer {
  opacity: 0.72;
  background: #f7f3ec;
}

body[data-active-view="employee"] .merchant-workspace[data-employee-section="follow"] .follow-empty {
  min-height: 88px;
  border-radius: 8px;
}

/* customer share page: plan feedback can include hesitation */
.share-plan-card .mini-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.share-plan-card .mini-actions button {
  min-height: 38px;
  padding: 8px 10px;
}

/* customer share page: large effect image first, product cards below */
.share-plan-card.share-plan-mobile {
  gap: 10px;
}

.share-plan-card .share-effect-image {
  display: block;
  width: 100%;
  max-height: none;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.share-product-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 16px) / 3);
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 1px 0 6px;
  scrollbar-width: thin;
}

.share-product-card {
  scroll-snap-align: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  padding: 6px;
}

.share-product-card img {
  width: 100%;
  aspect-ratio: 1 / 1.16;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.share-product-card strong,
.share-product-card span,
.share-product-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-product-card strong {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.25;
}

.share-product-card span,
.share-product-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

@media (min-width: 640px) {
  .share-plan-card .share-effect-image {
    aspect-ratio: 4 / 5;
    object-fit: contain;
  }
}

/* bottom employee nav with compact icons */
.employee-section-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 7px 3px 5px;
}

.employee-section-btn::before {
  display: none;
}

.employee-section-btn .nav-label {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



.employee-section-btn .nav-label {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}









/* bottom nav: make the collect tab the same size as the other tabs */








/* customer intake: use tap-friendly preference tags instead of native multi-select lists */
#merchantCustomerForm .native-multi-select {
  display: none;
}

#merchantCustomerForm .tag-picker-label {
  gap: 8px;
}

#merchantCustomerForm .tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

#merchantCustomerForm .tag-choice {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
}

#merchantCustomerForm .tag-choice.active {
  border-color: rgba(35, 93, 97, 0.45);
  background: rgba(35, 93, 97, 0.1);
  color: var(--teal);
}

#merchantCustomerForm #saveMerchantCustomerBtn {
  margin-top: 6px;
  min-height: 48px;
}

.employee-my-panel .compact-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.employee-my-panel .compact-actions button {
  min-height: 86px;
  padding: 12px 8px;
  text-align: center;
}
.employee-my-panel .compact-actions strong {
  font-size: 15px;
}
.employee-my-panel .compact-actions span {
  font-size: 12px;
}
@media (max-width: 380px) {
  .employee-my-panel .compact-actions {
    grid-template-columns: 1fr;
  }
}


.mine-entry-grid button {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  text-align: left;
}
.mine-entry-grid button span,
.mine-store-info span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}
.mine-entry-grid button strong,
.mine-store-info strong {
  font-size: 18px;
}
.mine-entry-grid button em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}
.mine-entry-grid button:active {
  border-color: var(--accent-2);
  background: #eef7f4;
}


.mine-points-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.mine-points-card > div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(143, 63, 69, 0.22);
  border-radius: 8px;
  background: #fff6f1;
  padding: 12px;
}
.mine-points-card span,
.mine-points-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}
.mine-points-card strong {
  color: var(--accent);
  font-size: 24px;
  line-height: 1.1;
}
.mine-settings-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.mine-settings-list button {
  display: grid;
  grid-template-columns: minmax(0, 76px) minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}
.mine-settings-list button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.mine-settings-list button strong {
  font-size: 15px;
}
.mine-settings-list button em {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 380px) {
  .mine-points-card {
    grid-template-columns: 1fr;
  }
}





/* final compact employee nav */
.employee-section-nav {
  min-height: 44px;
  border-radius: 10px 10px 0 0;
  padding: 4px 6px 6px;
  box-shadow: 0 -6px 16px rgba(52, 42, 34, 0.09);
}
.employee-section-btn {
  min-height: 34px;
  border-radius: 7px;
  color: #9a928a;
  font-size: 12px;
  font-weight: 820;
  padding: 0 2px;
}
.employee-section-btn.active {
  outline: 0;
  background: rgba(217, 103, 88, 0.12);
  color: #d96758;
}
.employee-section-btn:focus {
  outline: 0;
}


/* align compact nav text */
.employee-section-btn {
  display: grid;
  place-items: start center;
  align-content: start;
  min-height: 32px;
  padding: 5px 2px 0;
  line-height: 1;
}
.employee-section-btn .nav-label {
  line-height: 1.05;
}
.employee-section-nav {
  min-height: 40px;
  padding-top: 4px;
  padding-bottom: 4px;
}


/* unified customer intake flow */
body[data-active-view="employee"] .merchant-workspace[data-employee-section="intake"] .employee-section-panel[data-employee-panel="intake"] {
  grid-template-columns: 1fr;
}

body[data-active-view="employee"] .intake-flow-panel {
  padding-bottom: 14px;
}

body[data-active-view="employee"] .intake-photo-step {
  display: grid;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

body[data-active-view="employee"] .intake-photo-step .panel-head {
  margin: 0 0 2px;
}

body[data-active-view="employee"] .intake-photo-step .camera-box {
  max-height: 520px;
}

body[data-active-view="employee"] .intake-save-btn {
  margin-top: 4px;
}

/* customer birthday wheel-like pickers */
.birth-date-field {
  display: grid;
  gap: 8px;
}

.birth-date-picker {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
}

.birth-date-picker select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  padding: 0 10px;
}

.birth-date-picker select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 103, 88, 0.16);
  outline: none;
}

/* styling customer info as compact modal */
.merchant-workspace[data-employee-section="styling"] .compact-info-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 6px;
  overflow: hidden;
}

.merchant-workspace[data-employee-section="styling"] .compact-info-entry button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
}

.merchant-workspace[data-employee-section="styling"] .compact-info-entry span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-info-modal.hidden {
  display: none;
}

.customer-info-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  padding: 18px;
}

.customer-info-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 32, 29, 0.34);
}

.customer-info-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 0 auto 64px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf3;
  box-shadow: 0 18px 50px rgba(52, 42, 34, 0.24);
  padding: 16px;
}

.customer-info-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.customer-info-sheet-head button {
  border: 0;
  border-radius: 999px;
  background: #f1e7dc;
  color: var(--accent-dark);
  font-weight: 800;
  padding: 8px 12px;
}

.customer-info-sheet p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

/* customer info button lives in goods source row */
.merchant-workspace[data-employee-section="styling"] .styling-source-tabs {
  justify-content: flex-start;
  gap: 6px;
}

.merchant-workspace[data-employee-section="styling"] .customer-info-tab {
  margin-right: auto;
  border-color: rgba(35, 93, 97, 0.32);
  background: rgba(35, 93, 97, 0.08);
  color: #235d61;
  font-weight: 850;
}

.merchant-workspace[data-employee-section="styling"] .customer-info-tab::before {
  content: "";
}

/* keep source row compact after removing all source */
.merchant-workspace[data-employee-section="styling"] .customer-info-tab {
  margin-right: 0;
}

/* split customer info and product source controls */
.merchant-workspace[data-employee-section="styling"] .styling-source-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.merchant-workspace[data-employee-section="styling"] .customer-info-tab {
  margin-right: auto;
}

/* compact styling filter row with two selects */
.merchant-workspace[data-employee-section="styling"] .styling-source-tabs {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  overflow: visible;
}

.merchant-workspace[data-employee-section="styling"] .styling-tabs {
  min-width: 0;
  overflow: visible;
}

.merchant-workspace[data-employee-section="styling"] .styling-filter-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.merchant-workspace[data-employee-section="styling"] .styling-category-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  padding: 4px 8px;
}

.merchant-workspace[data-employee-section="styling"] .styling-category-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.merchant-workspace[data-employee-section="styling"] .styling-category-select select {
  min-width: 0;
  width: 100%;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  outline: none;
}

.merchant-workspace[data-employee-section="styling"] .styling-category-select:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 103, 88, 0.14);
}

@media (max-width: 420px) {
  .merchant-workspace[data-employee-section="styling"] .styling-source-tabs {
    grid-template-columns: 1fr;
  }

  .merchant-workspace[data-employee-section="styling"] .customer-info-tab {
    width: 100%;
  }
}

.mine-entry-grid button.is-active {
  border-color: var(--accent-2);
  background: #eef7f4;
}
.mine-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf5;
  padding: 12px;
}
.mine-detail-panel.empty-state {
  color: var(--muted);
  font-weight: 760;
  text-align: center;
}
.mine-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mine-detail-head strong {
  font-size: 16px;
}
.mine-detail-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.mine-inventory-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}
.mine-inventory-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.mine-inventory-item img {
  width: 74px;
  height: 92px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee8df;
}
.mine-inventory-item h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.mine-inventory-item p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.mine-inventory-item.is-disabled {
  opacity: 0.58;
}
.mine-inventory-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 0 10px;
}
.mine-inventory-filter .styling-category-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  padding: 2px 8px;
}
.mine-inventory-filter .styling-category-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.mine-inventory-filter .styling-category-select select {
  min-width: 0;
  width: 100%;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  outline: none;
}
.mine-inventory-filter .styling-category-select:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 103, 88, 0.14);
}

.avatar-change-btn {
  margin-left: auto;
  min-width: 78px;
  min-height: 32px;
  border: 1px solid rgba(143, 63, 69, 0.22);
  border-radius: 999px;
  background: #f7e5e2;
  color: var(--accent-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 850;
  padding: 0 12px;
  white-space: nowrap;
}
.avatar-change-btn:active {
  transform: translateY(1px);
}
.mine-profile-row .wechat-avatar.large {
  overflow: hidden;
}

/* Customer portrait capture: phone photo with 3:4 styling-safe frame */
.customer-camera-box {
  width: min(100%, 420px);
  justify-self: center;
  aspect-ratio: 9 / 16;
  background:
    linear-gradient(90deg, transparent 49%, rgba(35, 93, 97, 0.24) 50%, transparent 51%),
    linear-gradient(#f8f0e9, #ebe4db);
}

#merchantCustomerForm .intake-photo-step .capture-flow-actions {
  width: min(100%, 420px);
  justify-self: center;
}
.customer-camera-box video,
.customer-camera-box img {
  object-fit: cover;
}
.customer-camera-box::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 86%;
  max-height: 82%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(35, 93, 97, 0.88);
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(35, 93, 97, 0.08), inset 0 0 0 1px rgba(255,255,255,0.75);
  pointer-events: none;
}
.customer-camera-box::after {
  content: "3:4安全框 · 人物完整放入框内";
  position: absolute;
  left: 50%;
  top: calc(50% + min(41%, 310px));
  z-index: 4;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(35, 93, 97, 0.86);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 7px 10px;
  pointer-events: none;
  white-space: nowrap;
}
.customer-camera-box .camera-placeholder {
  z-index: 2;
}
.customer-camera-box video.active + img + .camera-placeholder,
.customer-camera-box img.active + .camera-placeholder {
  display: none;
}

/* AI try-on result: show full model body without cropping */
.merchant-workspace[data-employee-section="styling"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .visual-image .portrait-empty {
  width: 100%;
  min-height: 360px;
  max-height: 75vh;
  object-fit: contain;
  background: #f2e8df;
}
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="original"] .visual-image .portrait-empty,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .styling-visual-workspace[data-compare-mode="result"] .visual-image .portrait-empty {
  min-height: 360px;
  max-height: 75vh;
}

.flow-selected-row.is-tryon {
  border-color: rgba(35, 93, 97, 0.3);
  background: rgba(35, 93, 97, 0.06);
}
.flow-selected-row.is-addon {
  border-color: rgba(143, 63, 69, 0.24);
  background: rgba(247, 229, 226, 0.72);
}
.flow-selected-row.is-addon strong {
  color: var(--accent-dark);
}

.accessory-selected-divider {
  padding: 6px 10px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
  border-top: 2px dashed var(--accent-2);
}
.flow-selected-row.is-accessory {
  border-color: rgba(35, 93, 97, 0.24);
  background: #e6f3f1;
}
.flow-selected-row.is-accessory strong {
  color: var(--accent-2);
}

/* AI styling selected goods: show the chosen image so staff can verify the picked item at a glance. */
.merchant-workspace[data-employee-section="styling"] .flow-selected-row {
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  min-height: 56px;
  gap: 7px;
  padding: 6px;
}

.merchant-workspace[data-employee-section="styling"] .selected-good-thumb-btn {
  width: 42px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: zoom-in;
  line-height: 0;
}

.merchant-workspace[data-employee-section="styling"] .selected-good-thumb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.merchant-workspace[data-employee-section="styling"] .selected-good-thumb {
  width: 42px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid rgba(214, 200, 184, 0.8);
}

.merchant-workspace[data-employee-section="styling"] .selected-good-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row .selected-good-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.1;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row .selected-good-copy em {
  font-size: 10px;
  color: var(--accent);
  font-style: normal;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row .selected-good-copy b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row strong {
  font-size: 11px;
  white-space: nowrap;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-row button {
  min-height: 30px;
  padding: 0 8px;
}

@media (max-width: 420px) {
  .merchant-workspace[data-employee-section="styling"] .flow-selected-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .merchant-workspace[data-employee-section="styling"] .selected-good-thumb-btn {
  width: 42px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: zoom-in;
  line-height: 0;
}

.merchant-workspace[data-employee-section="styling"] .selected-good-thumb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.merchant-workspace[data-employee-section="styling"] .selected-good-thumb {
    width: 40px;
    height: 48px;
  }

  .merchant-workspace[data-employee-section="styling"] .flow-selected-row strong {
    grid-column: 2;
    font-size: 10px;
  }

  .merchant-workspace[data-employee-section="styling"] .flow-selected-row button {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

/* Inventory form: clearer joint-product opt-in switch. */
.joint-toggle-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
}

.joint-toggle-field strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.joint-toggle-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 178px;
  padding: 3px;
  border: 1px solid rgba(214, 200, 184, 0.95);
  border-radius: 999px;
  background: var(--surface-2);
}

.joint-toggle-control label {
  min-width: 0;
  display: block;
  cursor: pointer;
}

.joint-toggle-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.joint-toggle-control span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.joint-toggle-control input:checked + span {
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 6px 14px rgba(35, 93, 97, 0.18);
}

@media (max-width: 420px) {
  .joint-toggle-field {
    grid-template-columns: 1fr;
  }

  .joint-toggle-control {
    width: 100%;
  }
}

/* Inventory stock mode: clothing uses sizes, shoes use shoe sizes, accessories use total stock only. */
.size-stock-rows.is-accessory-stock {
  grid-template-columns: 1fr;
}

.size-stock-row.is-accessory-row {
  grid-template-columns: 1fr;
}

.size-stock-row.is-accessory-row input[name="sizeName"],
.size-stock-row.is-accessory-row button {
  display: none;
}

.size-stock-row.is-accessory-row input[name="sizeStock"] {
  width: 100%;
}

.merchant-workspace[data-employee-section="styling"] .flow-selected-empty {
  min-height: 36px;
  padding: 8px;
  border: 1px dashed rgba(214, 200, 184, 0.95);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--muted);
  font-size: 12px;
}

/* Final nav alignment: each bottom tab owns one equal centered hit area. */
.employee-section-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  justify-items: stretch;
  gap: 4px;
  min-height: 44px;
  padding: 4px 8px;
}

.employee-section-btn {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-content: center;
  padding: 0 2px;
  text-align: center;
  line-height: 1;
}

.employee-section-btn .nav-label {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1.05;
  white-space: nowrap;
}

/* ============================================================
   AI 生成进度指示器
   ============================================================ */

/* 进度覆盖层 — 在视觉工作区结果图位置显示 */
.generation-progress-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  min-height: 280px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98) 0%, rgba(255, 250, 243, 0.96) 100%);
  border-radius: 14px;
  border: 1.5px dashed rgba(143, 63, 69, 0.25);
  text-align: center;
  animation: progressPulse 2.4s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { border-color: rgba(143, 63, 69, 0.2); }
  50% { border-color: rgba(143, 63, 69, 0.45); }
}

.generation-progress-overlay .progress-stage-icon {
  font-size: 48px;
  line-height: 1;
  animation: iconBounce 1.2s ease-in-out infinite;
}

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

.generation-progress-overlay h3 {
  font-size: 16px;
  font-weight: 800;
  color: #23201d;
  margin: 0;
}

/* CSS 旋转加载动画 */
.progress-spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid rgba(143, 63, 69, 0.12);
  border-top-color: var(--accent, #8f3f45);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 2px;
}

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

/* 进度条 */
.progress-bar-track {
  width: 100%;
  max-width: 280px;
  height: 8px;
  background: rgba(214, 200, 184, 0.4);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8f3f45 0%, #235d61 100%);
  border-radius: 999px;
  transition: width 0.6s ease;
  min-width: 0;
}

.progress-hint {
  font-size: 13px;
  font-weight: 700;
  color: #716b63;
  margin: 0;
}

.progress-wait-hint {
  font-size: 11px;
  color: #a09888;
  margin: 0;
  max-width: 240px;
  line-height: 1.4;
}

/* 取消按钮 */
.cancel-gen-btn {
  margin-top: 4px;
  font-size: 12px;
  min-height: 32px;
  padding: 0 16px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.cancel-gen-btn:hover {
  opacity: 1;
}

/* 生成错误提示 */
.generation-error-box {
  text-align: center;
  padding: 24px 16px;
}
.generation-error-box h3 {
  font-size: 16px;
  color: var(--accent-dark);
  margin: 0 0 8px;
}
.generation-error-box .error-detail {
  font-size: 13px;
  color: #8f3f45;
  margin: 0 0 8px;
  line-height: 1.5;
  word-break: break-all;
}

/* 生成中按钮状态 */
.primary-btn.is-loading {
  background: #a09888 !important;
  color: #fff !important;
  cursor: not-allowed;
  opacity: 0.75;
  position: relative;
  pointer-events: none;
}

.primary-btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

.secondary-btn.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Mobile 适配 */
@media (max-width: 420px) {
  .generation-progress-overlay {
    min-height: 200px;
    padding: 24px 16px;
    gap: 8px;
  }

  .generation-progress-overlay .progress-stage-icon {
    font-size: 36px;
  }

  .generation-progress-overlay h3 {
    font-size: 14px;
  }

  .progress-bar-track {
    max-width: 220px;
    height: 6px;
  }
}

/* ============================================================
   图片灯箱放大查看
   ============================================================ */
.image-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lightboxFadeIn 0.2s ease;
}
@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.image-lightbox-overlay img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.image-lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

/* 方案缩略图 + 顾客头像 可点击提示 */
.customer-plan-item img,
.admin-inventory-list .cover {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f5f2ee;
}

.add-stock-size-btn {
  margin-top: 8px;
}
.portrait-small {
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.customer-plan-item img:hover,
.portrait-small:hover {
  opacity: 0.85;
}

/* ============================================================
   配件搭配按钮禁用态
   ============================================================ */
button[data-flow-action="modify"]:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
  pointer-events: none;
}

/* ============================================================
   配件选择面板
   ============================================================ */
.accessory-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  padding: 18px;
}
.accessory-picker-overlay.hidden { display: none; }

.accessory-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 32, 29, 0.4);
}

.accessory-picker-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 0 auto 64px;
  max-height: 72vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  background: #fffaf3;
  box-shadow: 0 -4px 40px rgba(52, 42, 34, 0.2);
  padding: 16px;
}

.accessory-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.accessory-picker-head h3 { margin: 0; font-size: 17px; }

/* 已选配件展示条 */
.accessory-selected-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-2);
  min-height: 42px;
  align-items: center;
}
.accessory-selected-bar.empty {
  justify-content: center;
  padding: 10px;
}
.accessory-selected-bar.empty .muted {
  font-size: 12px;
  color: var(--muted);
}
.accessory-picked-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--accent-2);
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
  font-size: 12px;
  font-weight: 700;
}
.accessory-picked-chip img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}
.accessory-picked-chip span {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-remove-btn {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chip-remove-btn:hover {
  background: #e74c3c;
  color: #fff;
}

.accessory-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px 0;
}

.accessory-card {
  display: grid;
  gap: 6px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.accessory-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
}
.accessory-card strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.accessory-card .muted { font-size: 11px; }
.accessory-card.selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(35, 93, 97, 0.13);
  background: #e6f3f1;
}

.accessory-picker-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.accessory-picker-actions .primary-btn { flex: 1; }
.accessory-picker-actions .primary-btn:disabled { opacity: 0.45; }

@media (max-width: 460px) {
  .accessory-picker-grid { grid-template-columns: repeat(2, 1fr); }
  .accessory-picker-sheet { margin-bottom: 0; max-height: 85vh; }
}

.mine-image-placeholder {
  width: 74px;
  height: 92px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #eee8df;
  color: #8a8178;
  font-size: 12px;
  font-weight: 800;
  border: 1px dashed rgba(124, 111, 101, 0.38);
}
.mine-item-actions {
  margin-top: 6px;
}
.image-replace-btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

/* Boss admin v1 */
.admin-top-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  margin-bottom: 10px;
}

.admin-top-panel h2 {
  margin: 0;
  font-size: 22px;
}

.admin-range-bar,
.admin-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.admin-range-bar input,
.admin-range-bar select,
.admin-filter-bar input,
.admin-filter-bar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: var(--text);
}

.admin-section-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
  padding: 6px;
  margin-bottom: 10px;
}

.admin-section-btn {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.admin-section-btn.active {
  background: var(--accent-2);
  color: #fff;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.admin-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.admin-summary-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.admin-staff-list,
.admin-inventory-list,
.admin-order-list {
  display: grid;
  gap: 10px;
}

.admin-staff-card,
.admin-garment-card {
  border-radius: 8px;
}

.admin-staff-card.is-disabled,
.admin-garment-card.is-off-shelf {
  background: #f8f6f2;
  opacity: 0.82;
}

.ok-tag {
  background: #e7f4ef;
  color: #27614d;
}

.warn-tag {
  background: #f8e8dd;
  color: #8a3d24;
}

.admin-filter-bar {
  grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) minmax(120px, 1fr);
  margin-bottom: 12px;
}

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

.admin-performance-grid article {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.admin-performance-grid span,
.admin-performance-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

@media (max-width: 720px) {
  body[data-active-view="admin"] .app-shell {
    width: min(100% - 16px, 560px);
    padding-top: 10px;
  }

  .admin-top-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-range-bar,
  .admin-filter-bar {
    grid-template-columns: 1fr;
  }

  .admin-section-nav {
    grid-template-columns: repeat(6, minmax(56px, 1fr));
    overflow-x: auto;
  }

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

  .admin-summary-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-performance-grid {
    grid-template-columns: 1fr;
  }

  .admin-garment-card.row-card,
  .admin-staff-card {
    grid-template-columns: 1fr;
  }
}

/* Keep cross-terminal switch reachable after employee mobile restyle */
body[data-active-view="employee"] .topbar {
  display: flex;
}

body[data-active-view="employee"] .top-actions {
  display: grid;
}

/* Season and secondary category filters */
.season-picker-field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.season-picker-field strong {
  font-size: 13px;
}

.season-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.season-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.season-chip.active {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}

.admin-filter-bar {
  grid-template-columns: minmax(180px, 2fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(190px, 1.5fr) minmax(110px, 1fr);
}

.admin-season-picker {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.admin-season-picker.hidden,
.styling-season-picker.hidden {
  display: none;
}

.styling-season-picker {
  min-width: 220px;
}

.muted .season-inline,
.season-inline {
  color: var(--accent-2);
  font-weight: 800;
}

@media (max-width: 720px) {
  .admin-filter-bar {
    grid-template-columns: 1fr;
  }

  .styling-season-picker {
    min-width: 100%;
  }
}

/* Store option manager */
.store-option-manager {
  display: grid;
  gap: 12px;
}

.option-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.option-editor-head {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.option-editor-head > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.option-editor-head input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.option-editor-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.option-editor-head button,
.option-admin-chip button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #eef7f4;
  color: var(--accent-2);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.option-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px;
}

.option-admin-chip b {
  padding: 0 4px;
}

@media (max-width: 720px) {
  .option-editor-head,
  .option-editor-head > div {
    grid-template-columns: 1fr;
  }
}




/* Styling filters: main pool is clothing only; accessory goods move into the shoe/bag/accessory picker. */
.merchant-workspace[data-employee-section="styling"] .styling-source-tabs {
  align-items: stretch;
}

.merchant-workspace[data-employee-section="styling"] .styling-tabs {
  flex: 1 1 auto;
  min-width: 0;
}

.accessory-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.accessory-type-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.accessory-type-tabs button.active {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}

.accessory-picker-grid.empty-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  grid-template-columns: 1fr;
  text-align: center;
}


.merchant-workspace[data-employee-section="styling"] .styling-season-dropdown {
  position: relative;
}

.merchant-workspace[data-employee-section="styling"] .styling-season-trigger {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.merchant-workspace[data-employee-section="styling"] .styling-season-trigger::after {
  content: "⌄";
  color: var(--muted);
  font-weight: 900;
}

.merchant-workspace[data-employee-section="styling"] .styling-season-trigger strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.merchant-workspace[data-employee-section="styling"] .styling-season-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: min(210px, 72vw);
  display: none;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 10px 28px rgba(52, 42, 34, 0.16);
  padding: 6px;
}

.merchant-workspace[data-employee-section="styling"] .styling-season-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border-radius: 7px;
  padding: 3px 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.merchant-workspace[data-employee-section="styling"] .styling-season-menu label:has(input:checked) {
  background: rgba(35, 93, 97, 0.1);
  color: var(--accent-2);
}

.merchant-workspace[data-employee-section="styling"] .styling-season-dropdown.is-open .styling-season-menu {
  display: grid;
}




.merchant-workspace[data-employee-section="styling"] .styling-season-menu input {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: 0 0 16px;
}

.admin-staff-card.is-selected,
.admin-performance-card.is-selected {
  border-color: var(--accent-2);
  background: rgba(35, 93, 97, 0.08);
}

.admin-performance-card {
  cursor: pointer;
}

.admin-performance-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-staff-detail-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(35, 93, 97, 0.22);
  border-radius: 8px;
  background: #fffdf9;
}

.staff-detail-head,
.staff-transfer-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.staff-detail-head h3,
.staff-detail-columns h4 {
  margin: 0;
}

.staff-transfer-box {
  align-items: stretch;
  padding: 12px;
  border: 1px dashed rgba(35, 93, 97, 0.28);
  border-radius: 8px;
  background: rgba(35, 93, 97, 0.06);
}

.staff-transfer-box > div {
  min-width: 0;
  flex: 1;
}

.staff-transfer-box select {
  min-width: 150px;
}

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

.staff-detail-list {
  display: grid;
  gap: 8px;
}

.staff-detail-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.staff-detail-item img,
.detail-thumb-placeholder {
  width: 64px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.detail-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.compact-empty {
  min-height: 90px;
  padding: 18px;
}

@media (max-width: 720px) {
  .staff-detail-head,
  .staff-transfer-box {
    align-items: stretch;
    flex-direction: column;
  }

  .staff-transfer-box select,
  .staff-transfer-box button {
    width: 100%;
  }

  .staff-detail-columns {
    grid-template-columns: 1fr;
  }
}


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

.staff-detail-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  color: var(--text);
  font-weight: 900;
}

.staff-detail-tabs button.active {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}

.staff-detail-content {
  display: grid;
  gap: 10px;
}

.staff-detail-content h4 {
  margin: 0;
}

.staff-customer-card {
  grid-template-columns: 72px minmax(0, 1fr);
}

.staff-customer-card > img,
.staff-customer-card > .detail-thumb-placeholder {
  width: 72px;
  height: 96px;
}

.staff-customer-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.staff-customer-metrics span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(35, 93, 97, 0.08);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.admin-customer-actions {
  margin-top: 10px;
}

.admin-customer-actions [data-admin-delete-customer] {
  color: #9d3f3f;
  background: #f8e5e3;
}

.staff-plan-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow: hidden;
}

.staff-plan-thumb-btn,
.staff-plan-thumbs span {
  width: 48px;
  height: 64px;
  flex: 0 0 48px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  cursor: zoom-in;
}

.staff-plan-thumb-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staff-plan-thumb-btn:hover {
  border-color: var(--accent-2);
}

.staff-plan-thumbs span,
.staff-plan-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.staff-plan-empty {
  justify-items: start;
  min-height: 28px;
  margin-top: 6px;
}


.admin-customer-filter-bar {
  grid-template-columns: minmax(0, 1.7fr) minmax(120px, 1fr) minmax(130px, 1fr) minmax(120px, 1fr);
}

.admin-customer-list {
  display: grid;
  gap: 10px;
}

.admin-customer-card {
  border-radius: 8px;
}

.admin-customer-card .customer-follow-top span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(35, 93, 97, 0.08);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.admin-customer-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.admin-customer-metrics span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3eee6;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.admin-customer-plan-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow: hidden;
}

.admin-customer-plan-thumbs img,
.admin-customer-plan-thumbs span {
  width: 52px;
  height: 68px;
  flex: 0 0 52px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}

.admin-customer-plan-thumbs span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .admin-customer-filter-bar {
    grid-template-columns: 1fr;
  }

  .admin-customer-card.row-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .admin-customer-card .admin-inventory-list .cover {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f5f2ee;
}

.add-stock-size-btn {
  margin-top: 8px;
}
.portrait-small {
    width: 72px;
    height: 96px;
  }
}


.admin-performance-filter-bar {
  grid-template-columns: minmax(160px, 260px);
}

.admin-performance-report {
  display: grid;
  gap: 12px;
}

.admin-performance-stat-grid {
  margin-bottom: 0;
}

.admin-performance-section {
  display: grid;
  gap: 8px;
}

.admin-performance-section h3 {
  margin: 0;
  font-size: 18px;
}

.admin-feedback-grid,
.admin-performance-table {
  display: grid;
  gap: 8px;
}

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

.admin-feedback-grid article,
.admin-performance-table article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  padding: 10px;
}

.admin-feedback-grid article {
  display: grid;
  gap: 2px;
  text-align: center;
}

.admin-feedback-grid strong {
  color: var(--accent-2);
  font-size: 22px;
}

.admin-feedback-grid span,
.admin-performance-table span,
.admin-performance-table em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.admin-performance-table article {
  display: grid;
  grid-template-columns: minmax(100px, 1.4fr) repeat(4, minmax(82px, 1fr)) minmax(120px, 1.2fr);
  gap: 8px;
  align-items: center;
}

@media (max-width: 720px) {
  .admin-performance-filter-bar {
    grid-template-columns: 1fr;
  }

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

  .admin-performance-table article {
    grid-template-columns: 1fr 1fr;
  }

  .admin-performance-table article strong,
  .admin-performance-table article em {
    grid-column: 1 / -1;
  }
}


/* dashboard overview */
.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-hero-line,
.dashboard-mini-grid,
.dashboard-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.dashboard-hero-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.dashboard-hero-line strong {
  display: block;
  font-size: 18px;
  color: var(--text);
}

.dashboard-hero-line span,
.dashboard-hero-line em,
.dashboard-mini-card small {
  color: var(--muted);
  font-style: normal;
}

.dashboard-hero-line em {
  font-weight: 900;
  color: var(--teal);
  white-space: nowrap;
}

.dashboard-mini-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.dashboard-mini-card {
  min-width: 0;
  border-radius: 8px;
  padding: 12px;
  background: #f7f4ee;
  border-left: 4px solid var(--teal);
}

.dashboard-mini-card span,
.dashboard-mini-card strong,
.dashboard-mini-card small {
  display: block;
}

.dashboard-mini-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-mini-card strong {
  margin: 4px 0;
  font-size: 22px;
  color: var(--text);
}

.dashboard-mini-rose { border-left-color: #b65b5b; }
.dashboard-mini-blue { border-left-color: #4d7f95; }
.dashboard-mini-gold { border-left-color: #b0894f; }

.dashboard-section {
  min-width: 0;
  padding: 12px;
}

.dashboard-section-wide {
  grid-column: 1 / -1;
}

.dashboard-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

.dashboard-bar-row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.dashboard-funnel-grid .dashboard-bar-row {
  margin-bottom: 0;
}

.dashboard-bar-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.dashboard-bar-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-row strong {
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.dashboard-bar {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe9df;
}

.dashboard-bar em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.dashboard-bar-rose em { background: #b65b5b; }
.dashboard-bar-blue em { background: #4d7f95; }
.dashboard-bar-gold em { background: #b0894f; }
.dashboard-bar-dark em { background: #1f1b18; }

@media (max-width: 720px) {
  .dashboard-overview,
  .dashboard-mini-grid,
  .dashboard-funnel-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-line {
    align-items: flex-start;
    flex-direction: column;
  }
}


.store-upload-preview {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store-upload-preview > img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.store-upload-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 54px);
  justify-content: center;
  gap: 8px;
}

.store-upload-thumbs img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.store-map-link { margin-left: 6px; text-decoration: none; }
.share-map-link { margin-top: 12px; text-decoration: none; }

/* OutfitAnyone+ multi-candidate picker */
.tryon-candidate-panel {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #e5d2b7;
  border-radius: 10px;
  background: #fffaf2;
}

.tryon-candidate-panel > p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 12px;
}

.tryon-candidate-panel > p span { color: var(--muted); }

.tryon-candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
}

.tryon-candidate {
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.tryon-candidate img {
  width: 100%;
  height: 112px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--surface-2);
}

.tryon-candidate.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(159, 63, 63, 0.12);
}

/* AI input debug thumbnails */
.ai-debug-inputs {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px dashed #d8c0a3;
  border-radius: 10px;
  background: #fffdf8;
}

.ai-debug-inputs > p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 12px;
}

.ai-debug-inputs > p span {
  color: var(--muted);
}

.ai-debug-inputs > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.ai-debug-inputs figure {
  margin: 0;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #eee0cf;
}

.ai-debug-inputs img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-2);
}

.ai-debug-inputs figcaption {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
}

.ai-debug-inputs small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.ai-official-notice {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #c9d8df;
  border-radius: 8px;
  background: #f7fbfc;
  color: var(--text);
}

.ai-official-notice p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 12px;
}

.ai-official-notice p span {
  color: var(--muted);
  font-weight: 700;
}

.official-slot-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.official-slot-grid em {
  padding: 7px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2ecef;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.ai-official-notice ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: #8f3f45;
  font-size: 12px;
  font-weight: 700;
}

/* v3 完整搭配：手机端三步工作台 */
.merchant-workspace[data-employee-section="styling"] .styling-step-panel,
.merchant-workspace[data-employee-section="styling"] .styling-joint-panel,
.merchant-workspace[data-employee-section="styling"] .styling-flow-panel { margin-top: 14px; border: 1px solid #eaded4; border-radius: 16px; background: #fffdf9; padding: 14px; }
.merchant-workspace[data-employee-section="styling"] .styling-step-heading { display:flex; gap:10px; align-items:center; margin:0 0 12px; }
.merchant-workspace[data-employee-section="styling"] .styling-step-heading > span { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#2a2421; color:#fff; font-weight:800; }
.merchant-workspace[data-employee-section="styling"] .styling-step-heading strong { display:block; color:#2a2421; font-size:16px; }
.merchant-workspace[data-employee-section="styling"] .styling-step-heading small { display:block; margin-top:2px; color:#867a72; font-size:12px; }
.merchant-workspace[data-employee-section="styling"] .styling-joint-panel.hidden { display:none; }
.merchant-workspace[data-employee-section="styling"] .joint-recommendation-group { padding:12px 0; border-top:1px dashed #e7d8ce; }
.merchant-workspace[data-employee-section="styling"] .joint-recommendation-group:first-of-type { border-top:0; }
.merchant-workspace[data-employee-section="styling"] .joint-group-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:9px; }
.merchant-workspace[data-employee-section="styling"] .joint-group-head strong { color:#4d3831; }
.merchant-workspace[data-employee-section="styling"] .joint-group-head span,.merchant-workspace[data-employee-section="styling"] .joint-empty { color:#9a847a; font-size:12px; }
.merchant-workspace[data-employee-section="styling"] .joint-good-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.merchant-workspace[data-employee-section="styling"] .joint-good-card { min-width:0; padding:5px; text-align:left; border:1px solid #e5d9cf; border-radius:10px; background:#fff; color:#342925; }
.merchant-workspace[data-employee-section="styling"] .joint-good-card.active { border:2px solid #ab554d; background:#fff2ed; box-shadow:0 0 0 2px #f8ddd5; }
.merchant-workspace[data-employee-section="styling"] .joint-good-card img { display:block; width:100%; aspect-ratio: .78; object-fit:cover; border-radius:7px; background:#f3eee8; }
.merchant-workspace[data-employee-section="styling"] .joint-good-card span { display:block; margin:5px 2px 1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:700; }
.merchant-workspace[data-employee-section="styling"] .joint-good-card small { display:block; margin:0 2px 2px; color:#96655e; font-size:11px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.merchant-workspace[data-employee-section="styling"] .styling-flow-actions .primary-btn.full { width:100%; min-height:50px; }
.merchant-workspace[data-employee-section="styling"] .selected-good-section-title { margin:4px 0 7px; color:#765148; font-size:12px; font-weight:800; }
.merchant-workspace[data-employee-section="styling"] .flow-selected-row.is-accessory { border-color:#e8c4aa; background:#fff9f2; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer { gap:8px; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer-toggle { display:flex; width:100%; align-items:center; justify-content:space-between; gap:10px; padding:8px 2px; border:0; background:transparent; color:#3e302b; text-align:left; cursor:pointer; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer-toggle span { display:grid; gap:1px; min-width:0; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer-toggle b { font-size:14px; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer-toggle small { color:#907d73; font-size:11px; font-weight:700; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer-toggle i { flex:0 0 auto; color:#9b4f48; font-size:12px; font-style:normal; font-weight:850; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer-body { display:grid; gap:5px; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer.is-collapsed { gap:0; padding-bottom:0; }
.merchant-workspace[data-employee-section="styling"] .selection-drawer.is-collapsed .selection-drawer-body { display:none; }
@media (max-width: 520px) { .merchant-workspace[data-employee-section="styling"] .styling-step-panel,.merchant-workspace[data-employee-section="styling"] .styling-joint-panel,.merchant-workspace[data-employee-section="styling"] .styling-flow-panel { padding:12px; border-radius:14px; } }
/* v3 筛选栏：本店/联营 + 紧凑筛选 */
.merchant-workspace[data-employee-section="styling"] .styling-filter-selects { grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.merchant-workspace[data-employee-section="styling"] .styling-source-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; padding:3px; min-height:36px; border:1px solid var(--line); border-radius:8px; background:#fffaf3; }
.merchant-workspace[data-employee-section="styling"] .styling-source-switch button { border:0; border-radius:6px; background:transparent; color:var(--muted); font-size:12px; font-weight:850; padding:0; }
.merchant-workspace[data-employee-section="styling"] .styling-source-switch button.active { background:#2a2421; color:#fff; }
.merchant-workspace[data-employee-section="styling"] .styling-category-select { min-height:34px; padding:3px 6px; gap:4px; }
.merchant-workspace[data-employee-section="styling"] .styling-category-select span { font-size:11px; }
.merchant-workspace[data-employee-section="styling"] .styling-category-select select { height:26px; font-size:12px; }
@media (max-width:420px) { .merchant-workspace[data-employee-section="styling"] .styling-filter-selects { grid-template-columns:96px minmax(0,1fr) minmax(0,1fr); gap:5px; } }
.merchant-workspace[data-employee-section="styling"] .styling-joint-panel.is-locked { padding:10px 14px; background:#fffdf9; }
.merchant-workspace[data-employee-section="styling"] .styling-joint-panel.is-locked .styling-step-heading { margin:0; opacity:.72; }
/* 紧凑下拉：仅显示当前选择值 */
.merchant-workspace[data-employee-section="styling"] .styling-category-select.compact-select { display:block; padding:3px 5px; }
.merchant-workspace[data-employee-section="styling"] .styling-category-select.compact-select select { display:block; width:100%; }
.merchant-workspace[data-employee-section="styling"] .styling-season-trigger { display:flex; justify-content:space-between; gap:4px; }
.platform-route-config { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; border:1px solid var(--line); border-radius:10px; padding:12px; }
.platform-route-config legend { padding:0 5px; font-weight:850; color:var(--ink); }
.platform-route-config label { min-width:0; }
.platform-route-config input[type="checkbox"] { width:auto; margin-left:6px; accent-color:var(--accent-2); }
@media (max-width:520px) { .platform-route-config { grid-template-columns:1fr; } }
.platform-route-config { display:grid; grid-template-columns:1fr; gap:8px; }
.platform-route-config > .muted { margin:0; font-size:12px; }
.platform-route-row { display:grid; grid-template-columns:70px minmax(0,1fr) 66px 112px; gap:8px; align-items:center; padding:8px; border:1px solid var(--line); border-radius:8px; background:#fffaf3; }
.platform-route-row strong { font-size:14px; }
.platform-route-row select { min-width:0; }
.platform-route-row .route-enabled { display:flex; align-items:center; gap:4px; margin:0; white-space:nowrap; }
.platform-route-row .route-move { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.platform-route-row .route-move button { min-height:30px; padding:0 5px; border:1px solid var(--line); border-radius:6px; background:#fff; font-size:12px; font-weight:750; }
.platform-route-row .route-move button:disabled { opacity:.38; }
@media (max-width:620px) { .platform-route-row { grid-template-columns:62px minmax(0,1fr); } .platform-route-row .route-enabled,.platform-route-row .route-move { grid-column:2; } }
.plan-detail-overlay { position:fixed; inset:0; z-index:1200; display:grid; place-items:end center; }
.plan-detail-backdrop { position:absolute; inset:0; background:rgba(24,18,15,.48); }
.plan-detail-sheet { position:relative; z-index:1; width:min(680px,100%); max-height:90vh; overflow:auto; padding:18px; border-radius:20px 20px 0 0; background:#fffdf9; box-shadow:0 -10px 30px rgba(0,0,0,.18); }
.plan-detail-sheet header { display:flex; justify-content:space-between; gap:12px; align-items:start; margin-bottom:12px; }
.plan-detail-sheet h3,.plan-detail-sheet h4 { margin:0; color:var(--ink); }
.plan-detail-sheet header p { margin:4px 0 0; color:var(--muted); font-size:13px; }
.plan-detail-sheet header button { border:0; background:#f2ece6; border-radius:7px; padding:7px 10px; font-weight:800; }
.plan-detail-image { display:block; width:100%; padding:0; border:0; border-radius:12px; overflow:hidden; background:#f3eee8; cursor:zoom-in; }
.plan-detail-image img { display:block; width:100%; max-height:52vh; object-fit:contain; }
.plan-detail-sheet h4 { margin:16px 0 8px; font-size:15px; }
.plan-detail-goods { display:grid; gap:8px; }
.plan-detail-good { display:grid; grid-template-columns:60px minmax(0,1fr); gap:9px; align-items:center; padding:7px; border:1px solid var(--line); border-radius:10px; }
.plan-detail-good img { width:60px; height:72px; object-fit:cover; border-radius:7px; background:#f3eee8; }
.plan-detail-good div { display:grid; gap:3px; }
.plan-detail-good span { color:var(--muted); font-size:12px; }
.plan-detail-good b { color:var(--accent); }
.plan-detail-sheet footer { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:15px; }
.plan-detail-sheet footer button { min-height:42px; }
/* 图片规范：商品、顾客、效果图统一 3:4 */
.customer-camera-box {
  aspect-ratio: 3 / 4;
}

.merchant-workspace[data-employee-section="styling"] .styling-goods-pool {
  gap: 6px;
  padding-bottom: 4px;
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card {
  flex: 0 0 calc((100% - 12px) / 3);
  width: calc((100% - 12px) / 3);
  min-width: calc((100% - 12px) / 3);
}

.merchant-workspace[data-employee-section="styling"] .styling-good-card img,
.share-product-card img {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f7f3ed;
}

.merchant-workspace[data-employee-section="styling"] .visual-image img,
.merchant-workspace[data-employee-section="styling"] .visual-image .portrait-empty {
  aspect-ratio: 3 / 4;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: contain;
}
.permission-hidden { display: none !important; }
.auth-card .stacked-form textarea{min-height:86px;padding:12px;border:1px solid var(--line,#ddd3c8);border-radius:10px;font:inherit;resize:vertical}.application-check{display:flex;align-items:center;gap:8px;color:#6f6660;font-size:14px}.application-check input{width:auto;height:auto}.auth-card{max-height:92vh;overflow:auto}
