:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f0f0f2;
  --surface-dark: #1d1d1f;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(29, 29, 31, 0.12);
  --line-strong: rgba(29, 29, 31, 0.2);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #e8f3ff;
  --green: #248a3d;
  --orange: #b25000;
  --red: #d70015;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 22px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.18);
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 16px;
  --header-h: 72px;
  --action-h: 92px;
  --max: 1440px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.26);
  outline-offset: 3px;
}
.hidden { display: none !important; }

.app-shell { min-height: 100vh; padding-bottom: var(--action-h); }

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 3vw, 48px);
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
  background: rgba(251, 251, 253, 0.86);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  background: none;
  font-weight: 740;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.brand-mark {
  display: inline-flex;
  align-items: end;
  gap: 3px;
  width: 21px;
  height: 24px;
  padding: 2px 3px;
  border: 1.5px solid currentColor;
  border-radius: 6px 6px 4px 4px;
}
.brand-mark i { display: block; width: 3px; border-radius: 4px; background: currentColor; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 11px; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 620;
  white-space: nowrap;
  transition: color 180ms var(--ease), background 180ms var(--ease), transform 180ms var(--ease);
}
.stepper-item:not(:disabled) { cursor: pointer; }
.stepper-item:not(:disabled):hover { background: rgba(0,0,0,.04); color: var(--text); }
.stepper-item.active { color: var(--text); background: rgba(0, 113, 227, 0.08); }
.stepper-item.complete { color: var(--text); }
.stepper-item:disabled { opacity: .58; }
.step-index {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #e5e5e7;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 720;
  transition: all 180ms var(--ease);
}
.stepper-item.active .step-index { background: var(--blue); color: white; box-shadow: 0 5px 14px rgba(0,113,227,.28); }
.stepper-item.complete .step-index { background: var(--text); color: white; }
.step-line { width: 44px; height: 1px; background: rgba(29,29,31,.16); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border: 1px solid rgba(29,29,31,.12);
  border-radius: 999px;
  background: white;
}
.lang-btn {
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.lang-btn:hover {
  color: var(--text);
}
.lang-btn.active {
  background: var(--text);
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.lang-divider {
  color: rgba(29,29,31,.25);
  font-size: 11px;
  user-select: none;
}
.text-button {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
}
.text-button:hover { text-decoration: underline; }

/* Generic */
.main-stage { min-height: calc(100vh - var(--header-h)); }
.page-view { display: none; animation: pageIn 420ms var(--ease) both; }
.page-view.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.hero, .config-page-head, .content-section, .product-detail-shell, .configuration-layout, .document-section, .result-layout, .result-actions {
  width: min(calc(100% - 80px), var(--max));
  margin-inline: auto;
}
.content-section, .product-detail-shell, .configuration-layout, .document-section {
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.hero { padding: 86px 0 66px; text-align: center; }
.eyebrow {
  display: inline-block;
  margin-bottom: 13px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 740;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow.small { margin-bottom: 6px; font-size: 10px; }
.hero h1, .config-page-head h1, .result-hero h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 690;
}
.hero p, .config-page-head > p, .result-hero > p {
  max-width: 690px;
  margin: 22px auto 0;
  color: var(--text-2);
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}
.content-section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 30px; }
.split-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-number, .option-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 35px;
  height: 24px;
  margin-bottom: 12px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .05em;
}
.section-number.compact { margin: 0 0 7px; }
.section-heading h2, .choice-block-title h3, .option-heading h2, .review-head h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 680;
}
.section-heading p, .option-heading p {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.5;
}
.icon-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #e8e8ed;
  color: var(--text);
  font-size: 19px;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.icon-button:hover { background: #dedee3; transform: scale(1.03); }
.icon-button:disabled { opacity: .4; cursor: default; transform: none; }
.rail-controls { display: flex; gap: 10px; }
.page-bottom-spacer { height: 66px; }

/* Product category shelf */
.category-section { padding-top: 22px; }
.category-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 20px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.category-rail::-webkit-scrollbar { display: none; }
.category-card {
  position: relative;
  flex: 0 0 206px;
  height: 244px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 26px;
  background: var(--surface);
  text-align: left;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 190ms var(--ease), box-shadow 190ms var(--ease), border-color 190ms var(--ease);
}
.category-card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(0,0,0,.09); }
.category-card.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 20px 42px rgba(0,113,227,.13); }
.category-card-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 135px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cat-a), var(--cat-b));
}
.category-card-visual::before {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -45px;
  top: -55px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  filter: blur(1px);
}
.category-card-visual::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  left: -32px;
  bottom: -35px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
}
.category-card-visual svg { position: relative; z-index: 1; width: 88px; height: 88px; color: rgba(255,255,255,.94); filter: drop-shadow(0 12px 18px rgba(0,0,0,.12)); }
.category-card-copy { display: block; padding: 15px 4px 0; }
.category-card-copy strong { display: block; margin-bottom: 4px; font-size: 16px; line-height: 1.25; letter-spacing: -.01em; }
.category-card-copy small { display: block; color: var(--text-2); font-size: 11px; line-height: 1.35; }
.category-card-check {
  position: absolute;
  top: 23px;
  right: 23px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: scale(.7);
  transition: all 170ms var(--ease);
}
.category-card.selected .category-card-check { opacity: 1; transform: scale(1); }
.category-card-count {
  position: absolute;
  left: 25px;
  top: 24px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  backdrop-filter: blur(9px);
  color: rgba(29,29,31,.74);
  font-size: 10px;
  font-weight: 700;
}

/* Product gallery */
.product-section { transition: opacity 240ms var(--ease); }
.product-section.is-muted { opacity: .58; }
.product-gallery-placeholder, .category-empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 48px;
  border-radius: 30px;
  background: rgba(255,255,255,.72);
  text-align: center;
}
.product-gallery-placeholder strong, .category-empty-state strong { margin-top: 18px; font-size: 22px; }
.product-gallery-placeholder p, .category-empty-state p { max-width: 460px; margin: 9px 0 0; color: var(--text-2); line-height: 1.55; }
.empty-illustration { display: flex; align-items: end; gap: 9px; height: 100px; }
.empty-illustration span { display: block; width: 34px; border-radius: 14px 14px 8px 8px; background: linear-gradient(#e8e8ed, #d2d2d7); }
.empty-illustration span:nth-child(1) { height: 75px; }
.empty-illustration span:nth-child(2) { height: 100px; }
.empty-illustration span:nth-child(3) { height: 84px; }
.empty-illustration.small { height: 78px; }
.empty-illustration.small span { width: 27px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.product-card {
  position: relative;
  min-height: 486px;
  padding: 22px;
  border: 1px solid transparent;
  border-radius: 30px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: transform 190ms var(--ease), box-shadow 190ms var(--ease), border-color 190ms var(--ease);
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 22px 54px rgba(0,0,0,.10); }
.product-card.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 24px 56px rgba(0,113,227,.13); }
.product-card-visual {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  height: 318px;
  border-radius: 23px;
  background: linear-gradient(145deg, var(--prod-bg-a), var(--prod-bg-b));
  overflow: hidden;
}
.product-reference-image { display: block; min-width: 0; min-height: 0; width: 100%; height: 100%; max-height: 100%; object-fit: contain; background: white; }
.product-reference-preview { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 16px 54px; }
.product-reference-preview img { min-height: 0; height: 88%; max-width: 100%; object-fit: contain; }
.product-reference-preview p { margin: 8px 0; color: var(--text-2); font-size: 12px; text-align: center; }
.asset-placeholder.three-ready:has(.three-host-overlay:not(.hidden)) > .product-reference-preview { visibility: hidden; }
.fixed-formula { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.fixed-formula span { display: block; color: var(--text-2); font-size: 14px; }
.fixed-formula strong { display: block; margin-top: 10px; font-size: 20px; }
.product-card-copy { display: block; padding: 22px 5px 2px; }
.product-card-copy .product-en { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 760; letter-spacing: .08em; }
.product-card-copy strong { display: block; font-size: 26px; letter-spacing: -.025em; }
.product-card-copy small { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--text-2); font-size: 14px; }
.product-card-copy small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--prod-accent); }
.product-select-check {
  position: absolute;
  top: 35px;
  right: 35px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-weight: 800;
  opacity: 0;
  transform: scale(.7);
  transition: all 180ms var(--ease);
}
.product-card.selected .product-select-check { opacity: 1; transform: scale(1); }

/* CSS product renders */
.product-render {
  --can-color: #f5f5f7;
  --can-color-2: #c5c7cc;
  --label: #242426;
  --accent: #5e5ce6;
  position: relative;
  width: 124px;
  height: 270px;
  border-radius: 44px 44px 26px 26px;
  background: linear-gradient(90deg, #9c9ea3 0%, var(--can-color) 17%, #fff 38%, var(--can-color-2) 72%, #8f9196 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 35px 44px rgba(0,0,0,.18);
  transform: perspective(700px) rotateY(-12deg);
}
.product-render::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
  top: -20px;
  height: 32px;
  border-radius: 13px 13px 8px 8px;
  background: linear-gradient(90deg, #141416, #55565a 45%, #111113);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.product-render::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  height: 10px;
  border-radius: 50%;
  border-bottom: 3px solid rgba(0,0,0,.35);
}
.product-render .render-label, .product-render > span {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 76px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--label), #050506);
  color: white;
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
  font-weight: 800;
  letter-spacing: .11em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.product-render .render-label::after, .product-render > span::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 -9px 0 rgba(255,255,255,.22), 0 -18px 0 rgba(255,255,255,.12);
}
.product-render.product-hair-spray { --can-color: #e7e8eb; --can-color-2: #afb4bb; --label: #151a1b; --accent: #54d2ca; }
.product-render.product-dry-shampoo { --can-color: #f5eadf; --can-color-2: #d5c0aa; --label: #49372d; --accent: #f0a36b; }
.product-render.product-hair-mousse { --can-color: #e6e2f4; --can-color-2: #b6a9d6; --label: #29223a; --accent: #a897ff; }
.product-render-large { width: 164px; height: 350px; border-radius: 54px 54px 32px 32px; }
.product-render-large::before { left: 25px; right: 25px; top: -24px; height: 38px; }
.product-render-large > span, .product-render-large .render-label { top: 98px; height: 160px; font-size: 14px; }
.product-render-result { width: 170px; height: 365px; margin-bottom: 28px; }

.product-detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr);
  gap: 28px;
  padding: 58px 0 70px;
  border-top: 1px solid var(--line);
  animation: expandIn 420ms var(--ease) both;
}
@keyframes expandIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.detail-preview-card, .detail-choice-card, .visual-card, .option-section, .review-card, .result-preview-card, .result-summary-card, .document-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.detail-preview-card { padding: 24px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.preview-toolbar > div:first-child span { display: block; color: var(--text-2); font-size: 12px; }
.preview-toolbar > div:first-child strong { display: block; margin-top: 4px; font-size: 16px; letter-spacing: .02em; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: #ececef; }
.segmented button {
  min-width: 50px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 690;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.segmented button.active { background: white; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.asset-placeholder {
  position: relative;
  min-height: 490px;
  display: grid;
  place-items: center;
  border-radius: 25px;
  overflow: hidden;
  background: radial-gradient(circle at 54% 30%, #fff 0%, #f5f5f7 44%, #e9e9ed 100%);
}
.asset-placeholder::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(29,29,31,.06);
  box-shadow: 0 0 0 48px rgba(255,255,255,.22), 0 0 0 96px rgba(255,255,255,.10);
}
.asset-caption {
  position: absolute;
  z-index: 5;
  left: 20px;
  right: 20px;
  bottom: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  color: var(--text-2);
  font-size: 12px;
}
.asset-caption span { font-weight: 650; }
.asset-caption small { color: var(--text-3); }
.detail-choice-card { padding: clamp(28px, 4vw, 52px); }
.detail-kicker { display: block; max-width: 380px; margin-bottom: 17px; color: var(--blue); font-size: 11px; font-weight: 740; letter-spacing: .12em; line-height: 1.5; }
.detail-choice-card > h2 { margin: 0; font-size: clamp(40px, 4vw, 58px); line-height: 1; letter-spacing: -.045em; }
.detail-cn-name { margin: 10px 0 42px; color: var(--text-2); font-size: 23px; }
.choice-block { padding-top: 32px; border-top: 1px solid var(--line); }
.choice-block-title { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.choice-block-title h3 { font-size: 25px; }
.choice-block-title small { color: var(--text-3); font-size: 12px; }
.efficacy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.efficacy-card {
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.efficacy-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.efficacy-card.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-soft); }
.efficacy-card strong { display: block; font-size: 15px; line-height: 1.25; }
.efficacy-card span { display: block; margin-top: 14px; color: var(--text-3); font-size: 11px; }
.texture-info-card { display: flex; align-items: center; gap: 16px; margin-top: 26px; padding: 19px; border-radius: 20px; background: #f5f5f7; }
.texture-symbol { position: relative; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(145deg, #fff, #dadbe0); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.texture-symbol.mist::before { content: ""; position: absolute; left: 13px; top: 23px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); box-shadow: 9px -7px 0 0 rgba(0,113,227,.75), 17px 4px 0 -1px rgba(0,113,227,.55), 26px -4px 0 -2px rgba(0,113,227,.4), 10px 10px 0 -2px rgba(0,113,227,.35); }
.texture-symbol.mousse::before { content: ""; position: absolute; left: 13px; right: 13px; bottom: 13px; height: 22px; border-radius: 50% 50% 40% 40%; background: white; box-shadow: inset 0 -3px 7px rgba(0,0,0,.08), 0 2px 7px rgba(0,0,0,.08); }
.texture-info-card span, .texture-info-card strong, .texture-info-card small { display: block; }
.texture-info-card span { color: var(--text-2); font-size: 12px; }
.texture-info-card strong { margin-top: 3px; font-size: 18px; }
.texture-info-card small { margin-top: 3px; color: var(--text-3); }

/* Configuration pages */
.config-page-head { padding: 48px 0 32px; }
.config-page-head h1 { font-size: clamp(32px, 3.6vw, 46px); }
.config-page-head > p { margin: 12px 0 0; font-size: 16px; }
.configuration-layout { display: grid; grid-template-columns: minmax(400px, .92fr) minmax(500px, 1.08fr); gap: 32px; align-items: start; }
.sticky-visual { position: sticky; top: calc(var(--header-h) + 24px); padding: 22px; }
.visual-card { min-width: 0; }
.can-placeholder { min-height: 520px; }
.can-render-stage { position: relative; z-index: 1; display: grid; place-items: end center; width: 100%; height: 100%; min-height: 380px; padding-bottom: 34px; }
.can-render-shadow { position: absolute; bottom: 29px; width: 190px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.16); filter: blur(14px); transform: scaleX(.9); }
.can-render {
  --render-w: 145px;
  --render-h: 330px;
  --body-a: #f2f3f5;
  --body-b: #b8bbc1;
  --body-c: #fdfdfd;
  --cap-color: #1d1d1f;
  position: relative;
  z-index: 2;
  width: var(--render-w);
  height: var(--render-h);
  filter: drop-shadow(0 30px 24px rgba(0,0,0,.16));
  transition: width 260ms var(--ease), height 260ms var(--ease), filter 260ms var(--ease);
}
.can-render-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  bottom: 9px;
  display: grid;
  place-items: center;
  border-radius: 23px 23px 12px 12px;
  overflow: hidden;
  background: linear-gradient(90deg, #8d9095 0%, var(--body-a) 17%, var(--body-c) 45%, var(--body-b) 77%, #8d9095 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
}
.can-render-body::before { content: ""; position: absolute; top: 13px; bottom: 13px; left: 18px; width: 10px; border-radius: 50%; background: rgba(255,255,255,.52); filter: blur(4px); }
.can-render-body span { position: relative; z-index: 2; color: rgba(29,29,31,.68); font-size: 13px; font-weight: 770; letter-spacing: .14em; transform: rotate(-90deg); }
.can-render-top {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  height: 55px;
  border-radius: 50% 50% 14px 14px;
  background: linear-gradient(90deg, #8e9095 0%, var(--body-a) 17%, var(--body-c) 45%, var(--body-b) 77%, #8e9095 100%);
  clip-path: polygon(0 100%, 13% 38%, 25% 12%, 75% 12%, 87% 38%, 100% 100%);
}
.can-render.round .can-render-top { clip-path: ellipse(50% 48% at 50% 96%); height: 68px; top: -13px; }
.can-render-bottom { position: absolute; left: 3px; right: 3px; bottom: 0; height: 17px; border-radius: 50%; border-bottom: 4px solid rgba(0,0,0,.36); }
.can-render.steel { --body-a: #dfe5e8; --body-b: #8fa0aa; --body-c: #f7fafb; }
.can-render.steel .can-render-body::after { content: ""; position: absolute; right: 7px; top: 8px; bottom: 8px; width: 2px; background: rgba(70,82,90,.28); }
.can-render.with-cap { margin-top: 48px; }
.cap-render-part {
  position: absolute;
  z-index: 5;
  left: 18%;
  right: 18%;
  top: -50px;
  height: 69px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(90deg, #09090a, var(--cap-color) 45%, #050506);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 8px 12px rgba(0,0,0,.13);
  transition: all 220ms var(--ease);
}
.cap-render-part.outer { left: 10%; right: 10%; height: 87px; top: -62px; border-radius: 24px 24px 10px 10px; }
.cap-render-part.transparent { background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.76), rgba(200,210,219,.36)); border: 1px solid rgba(255,255,255,.7); backdrop-filter: blur(2px); }
.cap-render-part.white { background: linear-gradient(90deg, #c9c9cc, #fff 48%, #d1d1d4); }
.cap-render-part.matte { box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 8px 12px rgba(0,0,0,.1); filter: saturate(.85); }
.drawing-placeholder { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 500px; color: #56565c; }
.drawing-placeholder svg { width: min(86%, 420px); height: 100%; overflow: visible; }
.drawing-can, .drawing-cap { fill: none; stroke: currentColor; stroke-width: 2; }
.drawing-dim { stroke: currentColor; stroke-width: 1.4; }
.drawing-guide { stroke: rgba(86,86,92,.45); stroke-width: 1; stroke-dasharray: 4 4; }
.drawing-placeholder text { fill: currentColor; font-size: 15px; font-weight: 620; }
.preview-spec-list { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.preview-spec-list div { min-width: 0; padding: 14px 13px; border-radius: 15px; background: #f5f5f7; }
.preview-spec-list span, .preview-spec-list strong { display: block; }
.preview-spec-list span { color: var(--text-3); font-size: 10px; }
.preview-spec-list strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.options-column { display: grid; gap: 22px; }
.option-section { padding: clamp(24px, 3vw, 38px); }
.option-heading { display: flex; gap: 16px; margin-bottom: 26px; }
.option-index { flex: 0 0 auto; margin: 3px 0 0; background: #e8e8ed; color: var(--text-2); }
.option-heading h2 { font-size: 29px; }
.option-heading p { margin-top: 6px; font-size: 14px; }
.option-card-grid { display: grid; gap: 14px; }
.option-card-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.option-card-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.option-card {
  position: relative;
  min-height: 152px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: white;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: all 160ms var(--ease);
}
.option-card:hover:not(:disabled) { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,.04); }
.option-card.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: linear-gradient(145deg, white, #f2f8ff); }
.option-card:disabled { cursor: not-allowed; background: #f4f4f6; color: var(--text-3); opacity: .72; }
.option-card-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 21px; border-radius: 15px; background: #f0f0f2; color: var(--text); font-weight: 800; }
.option-card.selected .option-card-icon { background: var(--blue); color: white; }
.option-card strong { display: block; font-size: 19px; line-height: 1.2; }
.option-card small { display: block; margin-top: 6px; color: var(--text-2); line-height: 1.4; }
.option-card .option-check { position: absolute; top: 17px; right: 17px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: white; font-size: 12px; font-weight: 800; opacity: 0; transform: scale(.7); transition: all 150ms var(--ease); }
.option-card.selected .option-check { opacity: 1; transform: scale(1); }
.option-card .disabled-reason { margin-top: 12px; color: var(--orange); font-size: 11px; line-height: 1.35; }
.compact-cards .option-card { min-height: 122px; }
.compact-cards .option-card-icon { margin-bottom: 15px; }
.locked-placeholder { display: grid; place-items: center; min-height: 100px; border: 1px dashed rgba(29,29,31,.17); border-radius: 18px; background: #f8f8fa; color: var(--text-3); font-size: 14px; }
.chip-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.option-chip {
  min-height: 52px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  font-weight: 680;
  cursor: pointer;
  transition: all 150ms var(--ease);
}
.option-chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.option-chip.selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); color: #0058ad; }
.number-field-shell { max-width: 430px; }
.number-field-shell > label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 650; }
.number-field { display: flex; align-items: center; height: 62px; padding: 0 17px; border: 1px solid var(--line-strong); border-radius: 17px; background: white; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.number-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.number-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 22px; font-weight: 650; }
.number-field span { color: var(--text-2); font-size: 14px; }
.number-field-shell > small { display: block; margin-top: 9px; color: var(--text-2); }
.field-error { margin: 7px 0 0; color: var(--red); font-size: 12px; }
.expandable { animation: expandIn 300ms var(--ease) both; }
.color-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.color-option {
  min-height: 148px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.color-option:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.color-option.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-soft); }
.cap-swatch { display: block; width: 68px; height: 60px; margin-bottom: 20px; border-radius: 18px 18px 9px 9px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), 0 8px 14px rgba(0,0,0,.08); }
.cap-swatch.transparent { background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(205,217,228,.3)); border: 1px solid rgba(130,145,158,.28); backdrop-filter: blur(2px); }
.color-option strong { font-size: 17px; }
.color-option small { display: block; margin-top: 5px; color: var(--text-3); }
.review-card { padding: clamp(26px, 3vw, 38px); }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.review-head h2 { font-size: 30px; }
.review-status { padding: 7px 11px; border-radius: 999px; background: #ededf0; color: var(--text-2); font-size: 12px; font-weight: 680; }
.review-status.ready { background: #eaf6ed; color: var(--green); }
.review-groups { display: grid; gap: 14px; padding-top: 20px; }
.review-group { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 14px 0; }
.review-group + .review-group { border-top: 1px solid var(--line); }
.review-group > span { color: var(--text-3); font-size: 12px; }
.review-group > div { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; }
.review-group strong { font-weight: 620; }
.review-empty { color: var(--text-3); font-size: 14px; }

/* Sticky CTA */
.sticky-action-bar {
  position: fixed;
  z-index: 90;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--action-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 0 max(40px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid rgba(29,29,31,.08);
  background: rgba(251,251,253,.91);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.sticky-summary { min-width: 0; }
.sticky-summary span, .sticky-summary strong { display: block; }
.sticky-summary span { color: var(--text-3); font-size: 11px; }
.sticky-summary strong { margin-top: 4px; max-width: min(62vw, 760px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.sticky-buttons { display: flex; flex-shrink: 0; gap: 11px; }
.sticky-buttons button { white-space: nowrap; }
.primary-button, .secondary-button, .danger-button {
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 15px;
  font-weight: 680;
  cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease), opacity 150ms var(--ease);
}
.primary-button { background: var(--blue); color: white; box-shadow: 0 8px 18px rgba(0,113,227,.19); }
.primary-button:hover:not(:disabled) { background: var(--blue-hover); transform: translateY(-1px); }
.primary-button:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.secondary-button { background: #e8e8ed; color: var(--text); }
.secondary-button:hover { background: #dedee3; }
.danger-button { background: var(--red); color: white; }
.danger-button:hover { background: #c50013; }

/* Result */
.result-view { padding-bottom: 80px; }
.result-hero { width: min(calc(100% - 80px), 900px); margin: 0 auto; padding: 78px 0 52px; text-align: center; }
.result-check { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 22px; border-radius: 50%; background: var(--green); color: white; font-size: 29px; font-weight: 800; box-shadow: 0 12px 26px rgba(36,138,61,.2); }
.result-hero h1 { font-size: clamp(42px, 5vw, 64px); }
.result-layout { display: grid; grid-template-columns: minmax(0, .92fr) minmax(500px, 1.08fr); gap: 28px; }
.result-preview-card { min-height: 560px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; overflow: hidden; background: radial-gradient(circle at 50% 40%, white, #f1f1f4 60%, #e7e7ea); padding-bottom: 18px; }
.result-preview-card > span { display: none !important; }
.result-preview-card > small { margin-top: auto; color: var(--text-3); }
.result-summary-card { padding: clamp(30px, 4vw, 52px); }
.result-summary-card > span { display: inline-block; margin-bottom: 24px; color: var(--blue); font-size: 12px; font-weight: 740; letter-spacing: .12em; text-transform: uppercase; }
.result-summary-card > h2 { margin: 10px 0 30px; font-size: 38px; letter-spacing: -.035em; }
.result-summary-group { padding: 20px 0; border-top: 1px solid var(--line); }
.result-summary-group > span { display: block; margin-bottom: 11px; color: var(--text-3); font-size: 12px; }
.result-summary-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px 16px; }
.result-summary-list div { min-width: 0; }
.result-summary-list small, .result-summary-list strong { display: block; }
.result-summary-list small { color: var(--text-3); font-size: 10px; }
.result-summary-list strong { margin-top: 3px; font-size: 14px; overflow-wrap: anywhere; }
.document-section { padding: 60px 0 30px; }
.document-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.document-section-head .section-heading {
  margin-bottom: 0;
}
.doc-status-hint {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
.spec-doc-wrapper { width: 100%; }
.spec-doc-card {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 28px 36px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.spec-doc-card:hover {
  border-color: #d2d2d7;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}
.spec-doc-preview-box {
  width: 156px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.spec-doc-thumb {
  width: 100%;
  padding: 6px 6px 2px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-doc-svg {
  width: 100%;
  height: auto;
  display: block;
}
.spec-doc-preview-btn {
  width: 100%;
  border: 0;
  background: #114b76;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 140ms ease;
}
.spec-doc-preview-btn:hover {
  background: #0d3b5c;
}
.spec-doc-preview-btn:disabled {
  background: #c7c7cc;
  cursor: not-allowed;
}

.spec-doc-content {
  display: flex;
  flex-direction: column;
}
.spec-doc-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 4px;
}
.spec-doc-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.spec-doc-sub {
  margin: 6px 0 0;
  font-size: 15px;
  color: #515154;
  font-weight: 500;
}
.spec-doc-download {
  margin-top: 22px;
  align-self: flex-start;
  color: #0b4d75;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 140ms ease;
}
.spec-doc-download:hover {
  text-decoration: underline;
}

.spec-doc-card.unmatched {
  background: #fafafc;
  border-style: dashed;
}
.spec-doc-card.unmatched .spec-doc-preview-box {
  opacity: 0.55;
}
.spec-doc-card.unmatched .spec-doc-download {
  display: none;
}
.result-actions { display: flex; justify-content: center; gap: 12px; padding: 36px 0 24px; }
.result-view.active ~ .sticky-action-bar, body.result-mode .sticky-action-bar { display: none; }
body.result-mode .app-shell { padding-bottom: 0; }

/* Modal */
.modal-backdrop {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: backdropIn 180ms ease both;
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  width: min(100%, 620px);
  padding: 40px;
  border-radius: 30px;
  background: white;
  box-shadow: var(--shadow-lg);
  animation: modalIn 240ms var(--ease) both;
}
.modal-card.compact { width: min(100%, 520px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ececef; color: var(--text-2); font-size: 23px; cursor: pointer; }
.modal-close.inline { position: static; display: inline-grid; }
.modal-symbol { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 20px; border-radius: 50%; font-size: 22px; font-weight: 800; }
.modal-symbol.success { background: #eaf6ed; color: var(--green); }
.modal-symbol.warning { background: #fff2e4; color: var(--orange); }
.modal-card h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.modal-card > p { margin: 13px 0 24px; color: var(--text-2); line-height: 1.55; }
.confirm-summary { display: grid; gap: 9px; padding: 18px; border-radius: 18px; background: #f5f5f7; }
.confirm-summary div { display: flex; justify-content: space-between; gap: 18px; font-size: 13px; }
.confirm-summary span { color: var(--text-3); }
.confirm-summary strong { text-align: right; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.report-modal { padding: 18px; }
.report-modal-card {
  width: min(96vw, 1160px);
  height: min(94vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: #f5f5f7;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
.report-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: white;
  flex-shrink: 0;
}
.report-modal-meta { display: flex; flex-direction: column; gap: 2px; }
.report-modal-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}
.report-modal-meta strong { font-size: 15px; font-weight: 700; color: var(--text); }
.report-modal-meta small { color: var(--text-2); font-size: 11px; }

.report-modal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.report-view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #ebebee;
  gap: 2px;
}
.report-view-toggle .toggle-btn {
  padding: 5px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
}
.report-view-toggle .toggle-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.report-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 8px;
  background: #f0f0f2;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
}
.zoom-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: white;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.zoom-btn:hover { background: #e2e2e5; }
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 140ms ease;
}
.download-button:hover { background: #0060c2; }
.download-button svg { flex-shrink: 0; }

.report-modal-body {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
}
.report-modal-body iframe {
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f5f5f7;
}

/* Toast */
.toast {
  position: fixed;
  z-index: 500;
  left: 50%;
  bottom: calc(var(--action-h) + 18px);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(90vw, 520px);
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(29,29,31,.94);
  color: white;
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  transform: translateX(-50%);
  font-size: 13px;
  animation: toastIn 220ms var(--ease) both;
}
.toast-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 11px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
body.result-mode .toast { bottom: 24px; }

/* Desktop Synchronized Height Layout for Configuration Pages (Steps 2 & 3) */
@media (min-width: 900px) and (min-height: 760px) {
  body.config-lock {
    overflow: hidden;
  }
  body.config-lock .app-shell {
    height: 100vh;
    overflow: hidden;
    padding-bottom: 0;
  }
  body.config-lock .main-stage {
    height: calc(100vh - var(--header-h));
    overflow: hidden;
  }
  .page-view[data-view="can"].active,
  .page-view[data-view="cap"].active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h) - var(--action-h));
    overflow: hidden;
    padding-bottom: 8px;
    box-sizing: border-box;
  }
  .page-view[data-view="can"] .config-page-head,
  .page-view[data-view="cap"] .config-page-head {
    flex: 0 0 auto;
    padding: 14px 0 10px;
  }
  .page-view[data-view="can"] .config-page-head .eyebrow,
  .page-view[data-view="cap"] .config-page-head .eyebrow {
    margin-bottom: 2px;
    font-size: 11px;
    letter-spacing: .12em;
  }
  .page-view[data-view="can"] .config-page-head h1,
  .page-view[data-view="cap"] .config-page-head h1 {
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -.02em;
  }
  .page-view[data-view="can"] .config-page-head > p,
  .page-view[data-view="cap"] .config-page-head > p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--text-2);
  }
  .configuration-layout {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 10px;
  }
  .visual-column {
    height: 100%;
    min-height: 0;
  }
  .visual-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .sticky-visual {
    position: static;
    top: auto;
  }
  .visual-card .preview-toolbar {
    flex: 0 0 auto;
    margin-bottom: 12px;
  }
  .can-placeholder {
    flex: 1 1 0;
    min-height: 180px;
    height: auto;
  }
  .can-render-stage {
    height: 100%;
    min-height: 200px;
    padding-bottom: 20px;
  }
  .drawing-placeholder {
    height: 100%;
    min-height: 200px;
  }
  .preview-spec-list {
    flex: 0 0 auto;
    margin-top: 12px;
  }
  .options-column {
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-right: 12px;
    padding-bottom: 28px;
    padding-top: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(29, 29, 31, 0.22) transparent;
  }
  .options-column > * {
    flex-shrink: 0;
  }
  .options-column::-webkit-scrollbar {
    width: 6px;
  }
  .options-column::-webkit-scrollbar-track {
    background: transparent;
  }
  .options-column::-webkit-scrollbar-thumb {
    background: rgba(29, 29, 31, 0.22);
    border-radius: 999px;
  }
  .options-column::-webkit-scrollbar-thumb:hover {
    background: rgba(29, 29, 31, 0.38);
  }
  .page-view[data-view="can"] .page-bottom-spacer,
  .page-view[data-view="cap"] .page-bottom-spacer {
    display: none;
  }
}

/* Short desktop windows scroll normally instead of squeezing the model to a sliver. */
@media (min-width: 900px) and (max-height: 759px) {
  .configuration-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .sticky-visual { position: static; }
  .can-placeholder { height: 400px; min-height: 400px; }
}

/* Responsive */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .step-line { width: 24px; }
  .step-label { display: none; }
  .hero, .config-page-head, .content-section, .product-detail-shell, .configuration-layout, .document-section, .result-layout, .result-actions { width: min(calc(100% - 48px), var(--max)); }
  .product-detail-shell { grid-template-columns: 1fr; }
  .result-layout { grid-template-columns: 1fr; }
  .result-preview-card { min-height: 500px; }
  .sticky-action-bar { padding-inline: 24px; }
}

@media (max-width: 899px) {
  .configuration-layout { grid-template-columns: 1fr; }
  .sticky-visual { position: relative; top: auto; }
  .can-placeholder { min-height: 480px; }
  .visual-card { max-width: 760px; margin: 0 auto; }
}

@media (max-width: 820px) {
  :root { --header-h: 60px; --action-h: 80px; }
  .topbar { padding: 0 16px; }
  .brand > span:last-child { display: none; }
  .demo-pill { display: none; }
  .topbar-actions { gap: 0; }
  .stepper { gap: 4px; }
  .step-line { width: 14px; }
  .stepper-item { gap: 0; padding: 6px; }
  .step-index { width: 24px; height: 24px; }
  .hero, .config-page-head, .content-section, .product-detail-shell, .configuration-layout, .document-section, .result-layout, .result-actions { width: calc(100% - 32px); }
  .hero { padding: 58px 0 44px; text-align: left; }
  .hero h1, .config-page-head h1, .result-hero h1 { font-size: 42px; }
  .hero p, .config-page-head > p, .result-hero > p { font-size: 16px; }
  .content-section { padding: 42px 0; }
  .split-heading { align-items: center; }
  .section-heading h2 { font-size: 32px; }
  .category-card { flex-basis: 174px; height: 222px; }
  .category-card-visual { height: 124px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { min-height: 420px; }
  .product-card-visual { height: 270px; }
  .product-detail-shell { padding-top: 42px; }
  .detail-preview-card, .detail-choice-card, .visual-card, .option-section, .review-card, .result-preview-card, .result-summary-card { border-radius: 25px; }
  .asset-placeholder { min-height: 420px; }
  .detail-choice-card { padding: 28px 22px; }
  .detail-choice-card > h2 { font-size: 43px; }
  .efficacy-grid { grid-template-columns: 1fr; }
  .efficacy-card { min-height: 82px; }
  .config-page-head { padding: 48px 0 32px; }
  .can-placeholder { min-height: 480px; }
  .can-render-stage { height: 390px; }
  .options-column { gap: 16px; }
  .option-section { padding: 24px 20px; }
  .option-card-grid.two, .option-card-grid.three { grid-template-columns: 1fr; }
  .compact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .chip-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .color-option-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .preview-spec-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .document-grid { grid-template-columns: 1fr; }
  .document-card { grid-template-columns: auto 1fr; }
  .document-action { grid-column: 1 / -1; width: 100%; }
  .sticky-action-bar { padding: 0 16px; }
  .sticky-summary strong { max-width: 48vw; }
  .primary-button, .secondary-button, .danger-button { min-height: 44px; padding-inline: 18px; }
  .result-hero { width: calc(100% - 32px); padding-top: 56px; }
  .result-summary-list { grid-template-columns: 1fr; }
  .report-modal { padding: 0; }
  .report-modal-card { width: 100vw; height: 100vh; border-radius: 0; }
}

@media (max-width: 520px) {
  .text-button#resetButton { font-size: 12px; }
  .hero h1, .config-page-head h1, .result-hero h1 { font-size: 37px; }
  .hero { padding-top: 46px; }
  .section-heading h2 { font-size: 29px; }
  .category-card { flex-basis: 158px; height: 210px; }
  .category-card-copy strong { font-size: 14px; }
  .category-card-copy small { font-size: 10px; }
  .rail-controls { display: none; }
  .product-card { min-height: 390px; padding: 16px; }
  .product-card-visual { height: 250px; }
  .asset-caption { align-items: flex-start; flex-direction: column; gap: 3px; }
  .asset-placeholder { min-height: 380px; }
  .preview-toolbar { align-items: flex-start; }
  .detail-cn-name { margin-bottom: 32px; }
  .choice-block-title { align-items: flex-start; flex-direction: column; }
  .texture-info-card { align-items: flex-start; }
  .option-heading { gap: 11px; }
  .option-heading h2 { font-size: 25px; }
  .option-card-grid.two, .option-card-grid.three, .compact-cards { grid-template-columns: 1fr !important; }
  .color-option-grid { grid-template-columns: 1fr; }
  .color-option { min-height: 118px; }
  .cap-swatch { margin-bottom: 12px; }
  .chip-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sticky-summary span { display: none; }
  .sticky-summary strong { max-width: 38vw; font-size: 12px; }
  .sticky-buttons { gap: 7px; }
  .sticky-buttons .secondary-button { padding-inline: 13px; }
  .sticky-buttons .primary-button { padding-inline: 17px; }
  .review-head { align-items: flex-start; flex-direction: column; }
  .review-group { grid-template-columns: 1fr; gap: 7px; }
  .result-preview-card { min-height: 460px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-card { width: 100%; padding: 31px 22px calc(24px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; }
  .modal-actions { display: grid; grid-template-columns: 1fr; }
  .modal-actions > * { width: 100%; }
}

@media (max-width: 380px) {
  .topbar { padding-inline: 12px; gap: 4px; }
  .stepper { gap: 2px; }
  .stepper-item { padding: 4px; }
  .step-line { width: 6px; }
  .topbar-actions { gap: 6px; }
  .lang-btn { padding-inline: 5px; }
  #resetButton { white-space: nowrap; }
  .sticky-buttons button { font-size: 14px; }
  .sticky-buttons .primary-button, .sticky-buttons .secondary-button { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.product-line-art {
  position: relative;
  z-index: 2;
  width: min(82%, 430px);
  color: #57575d;
}
.product-line-art svg { display: block; width: 100%; height: auto; }

/* =========================================================
   Realtime Three.js viewer layer (v2.1)
   The current geometry is a demo model. Company GLB assets
   can replace it later without changing the configurator UI.
   ========================================================= */
.three-host-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
  background: transparent;
  touch-action: none;
}
.three-host-overlay.hidden { display: none !important; }
.three-host-overlay.result-three-host { inset: 0 0 46px; }
.result-preview-card { position: relative; }
.result-preview-card > span,
.result-preview-card > small,
.asset-caption { position: absolute; z-index: 8; }

.three-host-bootstrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  color: var(--text-2);
  text-align: center;
  pointer-events: none;
}
.three-host-bootstrap strong { font-size: 13px; }
.three-host-bootstrap small { color: var(--text-3); font-size: 11px; }
.three-bootstrap-ring {
  width: 30px;
  height: 30px;
  margin-bottom: 5px;
  border: 2px solid rgba(0,113,227,.16);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: threeSpin .8s linear infinite;
}
@keyframes threeSpin { to { transform: rotate(360deg); } }

.three-shared-viewer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  isolation: isolate;
  background: radial-gradient(circle at 50% 38%, #ffffff 0%, #f4f5f8 55%, #e7e9ee 100%);
}
.three-shared-viewer:fullscreen,
.three-shared-viewer:-webkit-full-screen {
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f2f3f6 55%, #e4e7ec 100%) !important;
}
.three-shared-viewer:fullscreen canvas,
.three-shared-viewer:-webkit-full-screen canvas {
  top: 72px;
  bottom: 72px;
  height: calc(100% - 144px);
}
.three-shared-viewer:fullscreen .three-runtime-controls,
.three-shared-viewer:-webkit-full-screen .three-runtime-controls {
  top: 24px;
  right: 28px;
}
.three-shared-viewer:fullscreen .three-runtime-hint,
.three-shared-viewer:-webkit-full-screen .three-runtime-hint {
  bottom: 32px;
}
.three-shared-viewer::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 50% 31%, rgba(255,255,255,.96), rgba(255,255,255,.12) 41%, transparent 67%),
    linear-gradient(160deg, rgba(255,255,255,.20), rgba(207,213,223,.06));
  pointer-events: none;
}
.three-shared-viewer canvas {
  position: absolute;
  z-index: 1;
  inset: 56px 0 80px;
  display: block;
  width: 100%;
  height: calc(100% - 136px);
  outline: none;
  cursor: grab;
  touch-action: none;
}
.three-shared-viewer canvas:active { cursor: grabbing; }

.three-runtime-badges {
  display: none !important;
}

.three-runtime-controls {
  position: absolute;
  z-index: 6;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 7px;
}
.three-runtime-controls button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 50%;
  background: rgba(255,255,255,.76);
  color: rgba(29,29,31,.78);
  box-shadow: 0 6px 18px rgba(0,0,0,.07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease), color 150ms var(--ease);
}
.three-runtime-controls button:hover { transform: translateY(-1px); background: white; color: var(--text); }
.three-runtime-controls button.active { background: var(--text); color: white; }
.three-runtime-controls svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.three-preview-status { position: absolute; top: 18px; left: 16px; right: 140px; color: var(--text-2); font-size: 11px; line-height: 1.5; pointer-events: none; z-index: 3; }
.result-reference-image { position: absolute; inset: 20px 20px 50px; display: flex; flex-direction: column; align-items: center; }
.result-reference-image img { height: 90%; max-width: 100%; object-fit: contain; }
.three-ready .result-reference-image { visibility: hidden; }
.drawing-selector-label { display: block; margin: 18px 0 8px; font-size: 13px; }
#drawingReference { max-width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; font: inherit; font-size: 14px; }
.original-pdf-icon { display: grid; place-items: center; height: 100%; font-size: 32px; letter-spacing: 3px; color: #687c83; background: #f4f6f7; }
.three-runtime-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 150px);
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  color: var(--text-2);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 650;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.three-runtime-hint svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.doc-status-hint { white-space: normal; overflow-wrap: anywhere; }
.spec-doc-content { min-width: 0; }
.modal-card { max-height: calc(100dvh - 32px); overflow-y: auto; }
@media (max-width: 700px) {
  .document-section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .doc-status-hint { max-width: 100%; text-align: left; }
  .spec-doc-card { flex-direction: column; align-items: stretch; }
  .spec-doc-content { width: 100%; }
  #drawingReference { width: 100%; min-width: 0; }
  .spec-doc-preview-box { align-self: center; }
  .spec-doc-label, .spec-doc-title { overflow-wrap: anywhere; }
  .three-runtime-hint { bottom: 66px; }
  .three-shared-viewer:not(:fullscreen) canvas { bottom: 110px; height: calc(100% - 166px); }
}

.three-runtime-error {
  position: absolute;
  z-index: 8;
  left: 16px;
  right: 16px;
  bottom: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  color: var(--text-2);
  box-shadow: 0 10px 28px rgba(0,0,0,.09);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  font-size: 11px;
  line-height: 1.45;
}
.three-runtime-error strong { display: block; color: var(--text); font-size: 11px; }
.three-runtime-error i { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #fff2e4; color: var(--orange); font-style: normal; font-weight: 800; }

.asset-placeholder.three-ready::before { opacity: .35; }
.asset-placeholder.three-ready .can-render-stage,
.asset-placeholder.three-ready > .product-render { opacity: 0; pointer-events: none; }
.result-preview-card.three-ready > .product-render { opacity: 0; pointer-events: none; }
.asset-placeholder.three-ready .three-host-bootstrap,
.result-preview-card.three-ready .three-host-bootstrap { display: none; }

@media (max-width: 820px) {
  .three-runtime-badges { top: 12px; left: 12px; }
  .three-runtime-controls { top: 11px; right: 11px; }
  .three-runtime-controls button { width: 34px; height: 34px; }
  .three-runtime-hint { bottom: 45px; max-width: calc(100% - 44px); }
}

@media (max-width: 520px) {
  .three-runtime-badges span:nth-child(2) { display: none; }
  .three-runtime-hint { display: none; }
  .three-shared-viewer:not(:fullscreen) .three-preview-status { top: 54px; right: 16px; font-size: 10px; }
  .three-shared-viewer:not(:fullscreen) canvas { top: 100px; bottom: 64px; height: calc(100% - 164px); }
  .three-host-overlay.result-three-host { bottom: 64px; }
}
