:root {
  font-family: 'PingFang SC', 'Microsoft YaHei UI', sans-serif;
  color: #302b29;
  background: #eee9e5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #302b29;
  --muted: #817571;
  --faint: #aca19d;
  --surface: #fffdfb;
  --canvas: #faf7f4;
  --line: #e9e1dc;
  --rose: #bd5962;
  --rose-dark: #9f424c;
  --rose-soft: #f8e9e7;
  --shadow: 0 18px 50px rgba(68, 47, 40, .10);
  --phone-min-width: 320px;
  --phone-max-width: 440px;
}

* { box-sizing: border-box; }
html { min-width: 320px; height: 100%; overflow: hidden; background: #eee9e5; }
body { margin: 0; min-width: 320px; width: 100%; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, label:focus-within {
  outline: 3px solid rgba(189, 89, 98, .26); outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }

.app-stage {
  display: grid; width: 100%; height: 100dvh; overflow: hidden; place-items: center;
  grid-template-columns: auto minmax(0, var(--phone-max-width)) auto;
  gap: 10px;
  padding: 0 8px;
  background: radial-gradient(circle at 50% 20%, #faf6f2 0, #ede7e3 70%);
}
.mobile-shell {
  position: relative;
  width: clamp(var(--phone-min-width), 100vw, var(--phone-max-width));
  height: 100dvh; min-height: 0;
  padding: max(22px, env(safe-area-inset-top)) clamp(15px, 5vw, 22px) max(56px, calc(env(safe-area-inset-bottom) + 36px));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  background: var(--canvas);
  grid-column: 2;
}
.demo-pager {
  z-index: 40;
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(233, 225, 220, .95);
  border-radius: 50%;
  background: rgba(255, 253, 251, .96);
  color: var(--rose-dark);
  font-size: 28px; line-height: 1;
  box-shadow: 0 8px 22px rgba(61, 43, 37, .12);
  cursor: pointer;
}
.demo-pager:hover { background: #fff; }
.demo-pager:active { transform: scale(.96); }
.demo-pager.is-disabled,
.demo-pager:disabled {
  opacity: .28; cursor: not-allowed; transform: none;
}
.demo-pager-meta {
  position: fixed; z-index: 40;
  left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 5px 12px;
  color: #6e615e;
  border: 1px solid rgba(233, 225, 220, .9);
  border-radius: 999px;
  background: rgba(255, 253, 251, .94);
  font-size: 11px;
  box-shadow: 0 6px 18px rgba(61, 43, 37, .1);
  pointer-events: none;
}
.mobile-shell::-webkit-scrollbar { display: none; }
.preview-page {
  background-image: linear-gradient(180deg, rgba(250,247,244,.34), rgba(250,247,244,.92) 55%),
    radial-gradient(ellipse at 30% 0%, rgba(248, 225, 220, .55), transparent 55%);
  background-position: top center; background-size: 100% auto;
}
.practice-page, .adjust-page {
  background-image: linear-gradient(180deg, rgba(250,247,244,.5), rgba(250,247,244,.96) 48%);
}

.page-kicker, .section-eyebrow {
  display: block; color: var(--rose); font-size: 10px; line-height: 1.4;
  font-weight: 700; letter-spacing: .14em;
}
.detail-header {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  margin-bottom: 18px; text-align: center;
}
.detail-header h1 { margin: 2px 0 0; font-size: 18px; }
.icon-button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.icon-button:active { background: #efe8e4; transform: scale(.96); }
.header-spacer { width: 44px; }

.makeup-summary, .decision-card, .placeholder-card {
  margin-top: 14px; padding: 17px; border: 1px solid rgba(233,225,220,.88);
  border-radius: 16px; background: rgba(255,255,255,.84);
  box-shadow: 0 8px 26px rgba(61,43,37,.055); backdrop-filter: blur(12px);
}
.section-heading, .summary-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: 15px; }
.section-heading > span { min-height: 32px; padding: 4px 0; color: var(--rose); font-size: 11px; }
.summary-heading h2 { margin: 3px 0 0; font-size: 15px; }
.difficulty-pill {
  padding: 5px 8px; color: var(--rose); border-radius: 12px;
  background: var(--rose-soft); font-size: 9px;
}
.palette { display: flex; gap: 6px; margin-top: 13px; }
.palette button {
  height: 28px; flex: 1; border: 2px solid white; border-radius: 7px;
  box-shadow: 0 0 0 1px #eee5e0; padding: 0; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.palette button.is-active { transform: scale(1.06); box-shadow: 0 0 0 2px var(--rose); }
.summary-meta { display: flex; margin-top: 12px; flex-wrap: wrap; gap: 6px; }
.summary-meta span {
  display: flex; padding: 5px 7px; align-items: center; gap: 4px;
  color: #6e615e; border-radius: 10px; background: #f6f1ee; font-size: 9px;
}

.comparison { margin: 0 -2px; }
.comparison__frame {
  position: relative; height: 325px; overflow: hidden; border-radius: 18px;
  background: #e9dfda; box-shadow: var(--shadow); touch-action: none; user-select: none;
}
.comparison__frame--sized {
  width: min(100%, min(72vh, 520px)); height: auto; max-height: none; margin-inline: auto;
}
.comparison__image, .comparison__after { position: absolute; inset: 0; width: 100%; height: 100%; }
.comparison__image { object-fit: cover; object-position: 50% 50%; }
.comparison__image--before { z-index: 1; mix-blend-mode: multiply; }
.comparison__after { z-index: 2; overflow: hidden; }
.comparison__after .comparison__image { max-width: none; }
.comparison__label {
  position: absolute; z-index: 3; top: 12px; padding: 6px 9px; color: #514946;
  border-radius: 14px; background: rgba(255,255,255,.82); backdrop-filter: blur(8px); font-size: 9px;
}
.comparison__label--before { left: 12px; }
.comparison__label--after { right: 12px; }
.comparison__divider {
  position: absolute; z-index: 4; top: 0; bottom: 0; width: 2px; background: white;
  transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 10px rgba(57,38,34,.2);
}
.comparison__divider > span {
  position: absolute; top: 50%; left: 50%; display: grid; width: 42px; height: 42px;
  place-items: center; color: var(--rose); border: 3px solid white; border-radius: 50%;
  background: #fff8f6; transform: translate(-50%,-50%); box-shadow: 0 4px 15px rgba(57,38,34,.18);
  font-size: 14px; font-weight: 700;
}
.comparison__range {
  position: absolute; z-index: 5; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize;
}
.comparison__actions {
  display: grid; grid-template-columns: 68px 1fr 68px; min-height: 42px;
  align-items: center; text-align: center;
}
.comparison__actions button {
  min-height: 40px; color: var(--rose); border: 0; background: transparent;
  font-size: 10px; cursor: pointer;
}
.comparison__actions span { color: var(--faint); font-size: 9px; }

.adaptation-section { margin-top: 20px; }
.hint-list { display: grid; gap: 8px; margin-top: 10px; }
.hint-card {
  display: grid; grid-template-columns: 34px 1fr; padding: 11px; gap: 9px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.74);
}
.hint-card > span {
  display: grid; width: 31px; height: 31px; place-items: center; color: var(--rose);
  border-radius: 9px; background: var(--rose-soft); font-size: 12px;
}
.hint-card h3 { margin: 0; font-size: 11px; }
.hint-card p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.decision-card { margin-bottom: 4px; text-align: center; }
.decision-card h2 { margin-bottom: 4px; font-size: 14px; }
.decision-card > p { margin-bottom: 12px; color: var(--muted); font-size: 9px; }
.decision-actions { display: grid; gap: 7px; }
.decision-actions button {
  display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 11px; cursor: pointer;
}
.decision-actions button.is-positive {
  color: white; border-color: var(--rose); background: var(--rose);
}

.tutorial-intro { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.tutorial-step-list { display: grid; gap: 10px; margin: 14px 0 8px; padding: 0; list-style: none; }
.tutorial-step-card {
  padding: 14px; border: 1px solid rgba(233,225,220,.88); border-radius: 14px;
  background: rgba(255,255,255,.84); box-shadow: 0 6px 20px rgba(61,43,37,.04);
}
.tutorial-step-card h3 { margin: 0 0 10px; font-size: 12px; }
.tutorial-step-segments { display: grid; gap: 12px; }
.tutorial-step-segment + .tutorial-step-segment {
  padding-top: 12px; border-top: 1px solid rgba(233,225,220,.75);
}
.tutorial-step-segment__title { margin: 0 0 8px; font-size: 11px; font-weight: 600; color: var(--ink); }
.tutorial-step-fields { display: grid; gap: 8px; margin: 0; }
.tutorial-step-fields div { display: grid; gap: 2px; }
.tutorial-step-fields dt { margin: 0; color: var(--faint); font-size: 9px; font-weight: 600; letter-spacing: .04em; }
.tutorial-step-fields dd { margin: 0; color: var(--ink); font-size: 11px; line-height: 1.55; word-break: break-word; }
.step-clip-trigger {
  display: flex; width: 100%; min-height: 40px; margin-top: 10px; align-items: center;
  justify-content: center; gap: 6px; color: var(--rose); border: 1px solid rgba(189,89,98,.28);
  border-radius: 11px; background: var(--rose-soft); font-size: 11px; font-weight: 600; cursor: pointer;
}
.step-clip-trigger:disabled { opacity: .42; cursor: not-allowed; }

.step-clip-overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: 18px; background: rgba(28, 18, 16, .55);
}
.step-clip-overlay[hidden] { display: none; }
.step-clip-panel {
  width: min(100%, 420px); overflow: hidden; border-radius: 16px;
  background: #1c1210; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.step-clip-panel__header {
  display: flex; min-height: 48px; align-items: center; justify-content: space-between;
  gap: 8px; padding: 4px 6px 4px 14px; color: #f7efeb;
}
.step-clip-panel__header h2 { margin: 0; flex: 1; font-size: 12px; font-weight: 600; line-height: 1.35; }
.step-clip-panel__header .icon-button { color: #f7efeb; }
.step-clip-panel__header .icon-button:active { background: rgba(255,255,255,.1); }
.step-clip-panel__video {
  display: block; width: 100%; max-height: min(70dvh, 520px); background: #000;
}

.adjust-intro {
  display: flex; padding: 12px 13px; align-items: flex-start; gap: 9px; color: #795b57;
  border: 1px solid rgba(219,171,168,.48); border-radius: 13px; background: rgba(250,235,232,.88);
}
.adjust-intro p { margin: 0; font-size: 10px; line-height: 1.65; }
.adjust-form { display: grid; gap: 12px; margin-top: 12px; }
.choice-section {
  margin: 0; padding: 14px; border: 1px solid rgba(233,225,220,.9); border-radius: 15px;
  background: rgba(255,255,255,.88); box-shadow: 0 8px 25px rgba(61,43,37,.045);
}
.choice-section__heading {
  display: flex; width: 100%; padding: 0 0 11px; align-items: center; gap: 9px; color: var(--rose);
}
.choice-section__heading h2 { color: var(--ink); font-size: 12px; margin: 0; }
.choice-question + .choice-question {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(231,219,213,.86);
}
.choice-question > h3 {
  display: inline; margin: 0; color: var(--ink); font-size: 11px; line-height: 1.55;
}
.choice-question > small { margin-left: 6px; color: var(--rose); font-size: 7px; }
.choice-question > .choice-grid { margin-top: 9px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.choice-chip {
  position: relative; display: flex; min-height: 42px; padding: 9px 10px;
  align-items: center; justify-content: center; gap: 5px; color: #6f625e;
  border: 1px solid #e8dfda; border-radius: 10px; background: #fbf8f6;
  cursor: pointer; font-size: 10px; text-align: center;
}
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip.is-selected {
  color: var(--rose-dark); border-color: #d99b9d; background: var(--rose-soft); font-weight: 700;
}

.primary-button {
  display: flex; width: 100%; min-height: 48px; margin-top: 14px; align-items: center;
  justify-content: center; gap: 7px; border-radius: 13px; font-size: 14px; font-weight: 700;
  cursor: pointer; color: white; border: 1px solid var(--rose); background: var(--rose);
  box-shadow: 0 8px 18px rgba(189,89,98,.18);
}
.primary-button:hover { background: var(--rose-dark); }
.primary-button:active { transform: scale(.985); }

.demo-badge {
  display: inline-block; margin-bottom: 4px; padding: 3px 8px; color: var(--rose-dark);
  border-radius: 999px; background: rgba(248, 233, 231, .95); font-size: 9px; font-weight: 600;
}
.demo-toast {
  position: fixed; z-index: 90; left: 50%; bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%); max-width: min(90vw, 360px); padding: 10px 16px;
  color: #fff; border-radius: 12px; background: rgba(48, 43, 41, .92); font-size: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}
.demo-toast[hidden] { display: none; }

.preview-generation-error {
  display: grid; margin-top: 36px; place-items: center; text-align: center; gap: 10px;
  color: var(--rose); padding: 24px 16px; border: 1px solid var(--line);
  border-radius: 16px; background: rgba(255,255,255,.72);
}
.preview-generation-error h2 { margin: 0; color: var(--ink); font-size: 16px; }
.preview-generation-error p { margin: 0; max-width: 280px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.page-heading { padding: 9px 2px 17px; }
.page-heading h1 { margin: 4px 0 6px; font-size: 25px; line-height: 1.25; letter-spacing: -.02em; }
.upload-page {
  background-image: linear-gradient(180deg, rgba(250,247,244,.2), rgba(250,247,244,.94) 55%);
}
.upload-card {
  position: relative; display: block; width: 100%; border: 1.5px dashed rgba(190,145,139,.72);
  border-radius: 15px; background: rgba(255,255,255,.42); font: inherit; color: inherit; text-align: inherit;
}
.upload-card.has-file { border-style: solid; border-color: #d9aaa7; background: #fff9f7; }
.upload-card--preview { cursor: pointer; transition: box-shadow .18s ease, transform .18s ease; }
.upload-card--preview:hover { box-shadow: 0 10px 28px rgba(91,58,52,.1); }
.upload-card--preview:active { transform: scale(.995); }
.upload-card__label {
  display: flex; min-height: 166px; padding: 25px 18px; align-items: center;
  justify-content: center; flex-direction: column; text-align: center;
}
.upload-card__icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px;
  border-radius: 50%; color: var(--rose); background: var(--rose-soft); font-size: 22px;
}
.upload-card__title {
  max-width: 92%; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 700;
  text-overflow: ellipsis; white-space: nowrap;
}
.upload-card__meta { margin-top: 7px; color: var(--muted); font-size: 11px; }
.upload-card__hint { margin: 8px 4px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.upload-card__check {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center;
  width: 24px; height: 24px; color: white; border-radius: 50%; background: var(--rose); font-size: 12px;
}
.option-row {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 14px 15px;
  border: 1px solid rgba(233,225,220,.88); border-radius: 14px; background: rgba(255,255,255,.88);
}
.option-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--rose); flex-shrink: 0; }
.option-row__icon {
  display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0;
  color: var(--rose); border-radius: 10px; background: var(--rose-soft); font-size: 14px;
}
.option-row__body { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.option-row__body strong { font-size: 14px; }
.option-row__body small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.requirement-card, .photo-value-card, .stage-card {
  margin-top: 14px; padding: 17px; border: 1px solid rgba(233,225,220,.88);
  border-radius: 16px; background: rgba(255,255,255,.84);
  box-shadow: 0 8px 26px rgba(61,43,37,.055);
}
.section-title-row { display: flex; align-items: center; gap: 11px; }
.section-icon {
  display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto;
  color: var(--rose); border-radius: 11px; background: var(--rose-soft);
}
.section-title-row h2 { margin: 2px 0 0; font-size: 14px; }
.requirement-list {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 14px 0 0;
  padding: 0; list-style: none;
}
.requirement-list li {
  display: flex; min-height: 56px; padding: 9px 5px; align-items: center; justify-content: center;
  gap: 4px; flex-direction: column; color: #5e5552; border-radius: 10px; background: #f7f2ef;
  font-size: 10px; text-align: center;
}

.photo-page {
  background-image: linear-gradient(180deg, rgba(250,247,244,.25), rgba(250,247,244,.94) 52%);
}
.photo-preview {
  position: relative; display: grid; min-height: 252px; place-items: center; overflow: hidden;
  border-radius: 18px; background: linear-gradient(145deg,#ece4df,#f8f2ee);
}
.portrait-placeholder {
  position: relative; display: grid; width: 170px; height: 190px; place-items: center; color: #7d6862;
}
.portrait-placeholder__halo {
  position: absolute; width: 155px; height: 155px; border-radius: 50%; background: #ead9d2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.portrait-placeholder__face { position: relative; z-index: 1; font-size: 64px; line-height: 1; opacity: .55; }
.photo-preview__badge {
  position: absolute; bottom: 12px; left: 50%; display: flex; padding: 7px 10px; align-items: center;
  gap: 5px; color: #5d504c; border: 1px solid rgba(255,255,255,.7); border-radius: 20px;
  background: rgba(255,255,255,.84); font-size: 10px; transform: translateX(-50%);
}
.photo-skip { margin-top: 18px; }
.photo-skip__button { margin-top: 0; min-height: 54px; font-size: 15px; }
.skip-explainer { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.photo-value-card > p { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.photo-tips { margin: 13px 0 0; padding: 0; list-style: none; }
.photo-tips li {
  display: grid; grid-template-columns: 34px 1fr 20px; padding: 10px 0; align-items: center;
  gap: 8px; border-top: 1px solid #eee7e3;
}
.photo-tips li > span:first-child {
  display: grid; width: 30px; height: 30px; place-items: center; color: var(--rose);
  border-radius: 9px; background: #faf0ee; font-size: 13px;
}
.photo-tips strong, .photo-tips small { display: block; }
.photo-tips strong { font-size: 11px; }
.photo-tips small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.privacy-note { display: flex; margin: 12px 3px 0; gap: 8px; color: #8d7a75; }
.privacy-note p { margin: 0; font-size: 10px; line-height: 1.6; }

.parsing-page {
  background-image: linear-gradient(180deg, rgba(250,247,244,.35), rgba(250,247,244,.94) 50%);
}
.centered-heading { padding: 12px 0 8px; text-align: center; }
.centered-heading h1 { font-size: 21px; }
.centered-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.progress-hero { display: flex; padding: 17px 0 19px; align-items: center; flex-direction: column; }
.progress-ring {
  --progress: 0; display: grid; width: 148px; height: 148px; padding: 11px; place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--rose) calc(var(--progress) * 1%), #e7dfdb 0);
  box-shadow: 0 12px 35px rgba(91,58,52,.12);
}
.progress-ring__inner {
  display: grid; width: 100%; height: 100%; place-items: center; align-content: center;
  border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px #eee6e1;
}
.progress-ring__inner strong {
  font-family: 'Baskerville', 'Songti SC', serif; font-size: 41px; font-variant-numeric: tabular-nums;
}
.progress-ring__inner strong small { font-family: inherit; font-size: 17px; }
.progress-ring__inner span { color: var(--muted); font-size: 10px; }
.current-stage {
  display: grid; grid-template-columns: 20px auto; margin-top: 18px; align-items: center;
  column-gap: 5px; color: var(--rose); text-align: center;
}
.current-stage span { color: var(--muted); font-size: 9px; }
.current-stage strong { grid-column: 1 / -1; margin-top: 4px; color: var(--ink); font-size: 12px; }
.current-stage-detail {
  margin: 10px 0 0; padding: 0 8px; color: var(--muted); font-size: 11px; line-height: 1.5;
  word-break: break-word; text-align: center;
}
.stage-list { margin: 10px 0 0; padding: 0; list-style: none; }
.stage-list__item {
  position: relative; display: grid; grid-template-columns: 32px 1fr auto; min-height: 47px;
  align-items: center; gap: 7px; color: var(--faint); font-size: 11px;
}
.stage-list__item:not(:last-child)::after {
  content: ''; position: absolute; top: 35px; bottom: -12px; left: 15px; width: 1px; background: #e4dcd8;
}
.stage-list__icon {
  z-index: 1; display: grid; width: 30px; height: 30px; place-items: center;
  border-radius: 50%; background: #f1ece9; font-size: 12px;
}
.stage-list__item small { font-size: 9px; }
.stage-list__item.is-completed { color: #6c625e; }
.stage-list__item.is-completed .stage-list__icon { color: var(--rose); background: var(--rose-soft); }
.stage-list__item.is-active { color: var(--ink); font-weight: 600; }
.stage-list__item.is-active .stage-list__icon { color: white; background: var(--rose); }

.practice-footer { margin: 20px 0 28px; padding-top: 8px; }
.practice-footer__cta { width: 100%; min-height: 46px; font-size: 12px; }

.diagram-gallery-page { padding-bottom: 24px; }
.diagram-gallery-layout { position: relative; width: 100%; }
.diagram-gallery { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; width: 100%; }
.diagram-card {
  width: 100%; height: fit-content; padding: 12px; border: 1px solid var(--line);
  border-radius: 14px; background: rgba(255,255,255,.72); scroll-margin-top: 12px;
}
.diagram-card h2 { margin: 0 0 10px; font-size: 12px; font-weight: 600; }
.diagram-card__media {
  display: grid; width: 100%; overflow: hidden; border-radius: 12px; background: #f0ebe8;
}
.diagram-card__media img {
  display: block; width: 100%; max-width: 100%; height: auto;
  max-height: min(72dvh, 640px); object-fit: contain; object-position: center;
}
.diagram-card__placeholder {
  display: grid; width: 100%; min-height: clamp(120px, 38vw, 200px); place-items: center;
  align-content: center; gap: 8px; padding: 16px; color: var(--faint); font-size: 11px; text-align: center;
}
.diagram-card__placeholder.is-error { color: #8b3a3a; background: rgba(180, 80, 80, .06); }
.diagram-card__error { margin: 0; max-width: 100%; color: #8b3a3a; font-size: 10px; line-height: 1.5; word-break: break-word; }
.diagram-card__technique { margin: 10px 0 0; color: var(--ink); font-size: 12px; line-height: 1.55; }
.diagram-card__prompt { margin-top: 8px; font-size: 10px; color: var(--faint); }
.diagram-card__prompt summary { cursor: pointer; color: var(--faint); font-weight: 500; }
.diagram-card__prompt p { margin: 8px 0 0; color: var(--faint); line-height: 1.55; }
.analysis-error { padding-top: 15px; text-align: center; }
.analysis-error p { color: #9e4149; font-size: 11px; }

.diagram-step-index {
  position: sticky; bottom: 8px; z-index: 5; margin-top: 14px; padding: 8px;
  border: 1px solid rgba(233,225,220,.9); border-radius: 14px;
  background: rgba(255,253,251,.94); box-shadow: 0 8px 24px rgba(61,43,37,.08);
}
.diagram-step-index__list {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin;
}
.diagram-step-index__btn {
  display: flex; flex: 0 0 auto; min-width: 64px; max-width: 88px; padding: 6px 8px;
  flex-direction: column; align-items: flex-start; gap: 2px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left;
}
.diagram-step-index__btn:hover { border-color: #d99b9d; background: var(--rose-soft); }
.diagram-step-index__num { color: var(--rose); font-size: 10px; font-weight: 700; }
.diagram-step-index__name {
  display: -webkit-box; overflow: hidden; color: #5e5552; font-size: 9px; line-height: 1.3;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.diagram-step-index__top {
  display: flex; width: 100%; min-height: 32px; margin-top: 4px; align-items: center;
  justify-content: center; color: var(--rose); border: 0; background: transparent;
  font-size: 11px; font-weight: 600; cursor: pointer;
}

.diagram-step-index.is-collecting {
  border-color: rgba(189, 89, 98, .55);
  background: rgba(248, 233, 231, .96);
}
.diagram-step-index__btn.is-selected {
  color: white; border-color: var(--rose); background: var(--rose);
}
.diagram-step-index__btn.is-selected .diagram-step-index__num,
.diagram-step-index__btn.is-selected .diagram-step-index__name { color: white; }
.diagram-progress-banner {
  margin: 0 0 12px; padding: 8px 10px; color: var(--muted); border-radius: 10px;
  background: var(--rose-soft); font-size: 11px; text-align: center;
}
.diagram-gallery-page.is-collecting { padding-bottom: 8px; }
.diagram-collect-footer { margin-top: 16px; }

.collect-success {
  display: grid; min-height: 55vh; place-items: center; align-content: center;
  gap: 14px; text-align: center; color: var(--rose);
}
.collect-success__icon { font-size: 36px; line-height: 1; }
.collect-success h2 { margin: 0; color: var(--ink); font-size: 22px; font-weight: 700; }
.collect-success__meta { margin: 0; max-width: 260px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.collect-success .primary-button { width: min(100%, 220px); margin-top: 8px; }

@media (min-width: 768px) {
  .mobile-shell {
    height: min(932px, calc(100dvh - 32px));
    border: 1px solid rgba(255,255,255,.8); border-radius: 34px;
    box-shadow: 0 28px 80px rgba(67,48,41,.16);
  }
  .demo-pager-meta { bottom: max(24px, calc(50% - min(466px, 50dvh) + 16px)); }
}
@media (max-width: 640px) {
  .app-stage { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 4px; padding: 0 4px; }
  .demo-pager { width: 36px; height: 36px; font-size: 24px; }
}
@media (max-width: 350px) {
  .mobile-shell { padding-left: 15px; padding-right: 15px; }
  .comparison__frame { height: 292px; }
  .photo-preview { min-height: 230px; }
}
