:root {
  color-scheme: light;
  --navy: #151c31;
  --navy-soft: #2a3145;
  --purple: #5146f3;
  --purple-dark: #3f35d8;
  --lime: #c8f000;
  --muted: #707586;
  --line: #e4e7ef;
  --surface: #ffffff;
  --background: #f5f7fb;
  --danger: #bd3a48;
  --shadow: 0 24px 70px rgba(21, 28, 49, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--background); color: var(--navy); }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1320px; width: 100%; margin: 0 auto; padding: 24px 36px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { width: 58px; height: 58px; border-radius: 13px; object-fit: cover; border: 1px solid var(--line); background: white; }
.brand-divider { width: 1px; height: 30px; background: #cdd1dc; }
.brand-product { font-size: 12px; font-weight: 800; letter-spacing: .16em; color: var(--muted); }
.back-link { color: var(--navy-soft); font-size: 14px; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--purple); }

.main-content { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; flex: 1; }
.intro { max-width: 720px; margin-bottom: 40px; }
.eyebrow, .section-kicker { margin: 0 0 14px; color: var(--purple); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.intro h1 { margin: 0; font-size: clamp(54px, 8vw, 98px); line-height: .9; letter-spacing: -.075em; font-weight: 850; }
.intro h1 em { color: var(--purple); font-style: normal; }
.intro-copy { max-width: 680px; margin: 28px 0 0; color: var(--muted); font-size: 20px; line-height: 1.55; }

.progress { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; color: #a0a5b2; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.progress-step { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.progress-step::first-letter { display: inline-flex; }
.progress-step.is-active { color: var(--navy); }
.progress-step.is-active::before, .progress-step.is-complete::before { content: ""; display: none; }
.progress-line { height: 1px; min-width: 30px; flex: 0 1 80px; background: #dfe2ea; }
.progress-step span { font-weight: 600; letter-spacing: .02em; text-transform: none; }

.studio-card { padding: clamp(24px, 5vw, 54px); border: 1px solid rgba(217, 221, 232, .9); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.is-hidden { display: none !important; }
.card-heading h2, .result-topline h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; letter-spacing: -.04em; }
.card-heading > p:last-child { max-width: 650px; margin: 14px 0 0; color: var(--muted); line-height: 1.6; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.product-option { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px; min-height: 96px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--navy); text-align: left; transition: border .2s, box-shadow .2s, transform .2s; }
.product-option:hover, .product-option:focus-visible { border-color: var(--purple); box-shadow: 0 10px 28px rgba(81, 70, 243, .12); transform: translateY(-2px); outline: none; }
.product-option strong, .product-option small { display: block; }
.product-option strong { font-size: 15px; }
.product-option small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.option-arrow { color: var(--purple); font-size: 22px; }
.product-icon { display: block; width: 40px; height: 40px; background: var(--lime); border: 1px solid var(--navy); }
.product-icon-circle { border-radius: 50%; }
.product-icon-outline { background: white; }
.product-icon-stubby { width: 28px; margin-left: 6px; border-radius: 6px 6px 9px 9px; transform: perspective(40px) rotateY(-5deg); }
.product-icon-flatpack { width: 36px; height: 27px; margin-left: 2px; border-radius: 4px; transform: skewY(-8deg); }

.change-product, .text-button { border: 0; padding: 0; background: transparent; color: var(--purple); font-size: 14px; font-weight: 800; }
.change-product:hover { color: var(--purple-dark); }
.selected-product { display: inline-flex; align-items: center; gap: 8px; margin: 26px 0 32px; padding: 8px 12px; border-radius: 999px; background: #f0efff; color: var(--purple-dark); font-size: 13px; font-weight: 800; }
.selected-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.brief-heading { margin-bottom: 28px; }
.field-label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 800; }
.optional { margin-left: 6px; color: #9b9fac; font-size: 10px; letter-spacing: .12em; }
textarea { width: 100%; resize: vertical; min-height: 118px; padding: 17px 18px; border: 1px solid #d6dae4; border-radius: 14px; outline: 0; background: #fff; color: var(--navy); line-height: 1.5; transition: border .2s, box-shadow .2s; }
textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(81, 70, 243, .1); }
textarea::placeholder { color: #a2a6b2; }
.field-meta { display: flex; justify-content: space-between; gap: 16px; margin: 8px 2px 28px; color: #999eac; font-size: 12px; }
.upload-block { padding: 24px 0 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.upload-heading { display: flex; justify-content: space-between; gap: 20px; }
.upload-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.upload-count { color: var(--purple); font-size: 12px; font-weight: 800; }
.upload-dropzone { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 17px; border: 1px dashed #b9bdd0; border-radius: 14px; color: var(--navy-soft); font-size: 14px; }
.upload-dropzone:hover { border-color: var(--purple); background: #fafaff; }
.upload-dropzone strong { color: var(--purple); }
.upload-dropzone small { margin-left: auto; color: #9b9fac; font-size: 11px; }
.upload-plus { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: var(--navy); font-size: 22px; line-height: 1; }
.reference-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.reference-item { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 9px 6px 6px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy-soft); font-size: 12px; }
.reference-item img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.reference-item span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-item button { border: 0; background: transparent; color: #9297a6; font-size: 20px; line-height: 1; }
.notice { display: flex; gap: 12px; margin: 26px 0; padding: 14px 16px; border-radius: 12px; background: #f7f8fc; color: var(--muted); }
.notice-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 19px; height: 19px; border: 1px solid #969ba9; border-radius: 50%; font-size: 12px; font-weight: 800; }
.notice p { margin: 0; font-size: 13px; line-height: 1.5; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 54px; padding: 15px 22px; border-radius: 999px; font-size: 14px; font-weight: 850; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-button { border: 1px solid var(--purple); background: var(--purple); color: white; box-shadow: 0 10px 22px rgba(81, 70, 243, .2); }
.primary-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) { transform: translateY(-2px); }
.primary-button:hover:not(:disabled) { background: var(--purple-dark); }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.secondary-button { border: 1px solid #d8dbe6; background: white; color: var(--navy); }
.secondary-button:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); }
.full-width { width: 100%; }
.button-arrow { font-size: 20px; line-height: 0; }
.permission-note, .privacy-line, .result-warning { color: #9297a6; font-size: 12px; line-height: 1.5; }
.permission-note { margin: 12px 0 0; text-align: center; }
.status-message { min-height: 20px; margin-top: 14px; font-size: 13px; line-height: 1.45; }
.status-message.loading { color: var(--purple); }
.status-message.error { color: var(--danger); }
.is-loading { position: relative; }
.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.result-product { padding: 8px 12px; border-radius: 999px; background: #f0efff; color: var(--purple-dark); font-size: 12px; font-weight: 800; }
.image-stage { display: grid; place-items: center; min-height: min(640px, 70vw); overflow: hidden; border-radius: 18px; background: #f7f8fc; }
.image-stage img { display: block; width: 100%; max-height: 720px; object-fit: contain; }
.image-placeholder { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid #cfd3df; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
.revision-area { margin-top: 28px; }
.revision-area textarea { min-height: 94px; }
.revision-area .secondary-button { margin-top: 12px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.result-actions > * { flex: 1 1 220px; }
.result-warning { margin: 20px 0 0; }
.privacy-line { margin: 22px auto 0; text-align: center; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1320px; width: 100%; margin: 0 auto; padding: 24px 36px 30px; color: #979cab; font-size: 12px; }

@media (max-width: 680px) {
  .site-header { align-items: flex-start; padding: 18px 20px; }
  .brand { gap: 9px; }
  .brand img { width: 44px; height: 44px; border-radius: 10px; }
  .brand-product { font-size: 9px; letter-spacing: .1em; }
  .brand-divider { height: 23px; }
  .back-link { padding-top: 13px; font-size: 12px; }
  .main-content { width: min(100% - 28px, 1120px); padding-top: 34px; }
  .intro-copy { font-size: 17px; }
  .progress { gap: 7px; font-size: 10px; letter-spacing: .02em; }
  .progress-line { min-width: 12px; }
  .progress-step span { display: none; }
  .studio-card { padding: 24px 18px; border-radius: 20px; }
  .product-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
  .product-option { min-height: 76px; padding: 13px 14px; }
  .upload-dropzone { flex-wrap: wrap; }
  .upload-dropzone small { width: 100%; margin-left: 38px; }
  .result-topline { flex-direction: column; }
  .image-stage { min-height: 82vw; }
  .site-footer { padding: 20px; font-size: 11px; }
}
