.upload-page { --upload-soft: #faf7f8; --upload-line: #e4d7dc; --upload-photo-height: 360px; }
.upload-page .site-header-inner { gap: 4px; }
.upload-back { display: grid; place-items: center; width: 44px; min-height: 44px; margin-left: -15px; }
.upload-back svg { width: 21px; height: 21px; color: var(--text); }
.upload-main { width: 100%; max-width: 680px; margin-inline: auto; padding: 0 var(--gutter) max(40px, env(safe-area-inset-bottom, 0px)); }
.upload-intro { padding: 25px 0 24px; }
.upload-intro h1 { margin: 0; color: var(--text); font-size: 24px; font-weight: 650; line-height: 1.4; letter-spacing: -.04em; }
.upload-intro h1 > #upload-title-accent { color: var(--accent); }
.upload-privacy { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; letter-spacing: -.025em; word-break: keep-all; text-wrap: pretty; }
#upload-title:focus { outline: none; }
.analysis-title-dots { display: inline-block; width: 1em; letter-spacing: .045em; animation: analysis-ellipsis 1.8s steps(1, end) infinite; }
@keyframes analysis-ellipsis {
  0%, 100% { clip-path: inset(0 66% 0 0); }
  33.333% { clip-path: inset(0 33% 0 0); }
  66.666% { clip-path: inset(0 0 0 0); }
}
.upload-drop { position: relative; overflow: hidden; border: 2px dashed #b99daa; border-radius: 10px; background: var(--upload-soft); transition: border-color .15s, background-color .15s; }
.upload-drop:has(.upload-choose:hover), .upload-drop.is-dragging { background: #f4eaee; border-color: var(--accent); }
.upload-drop:has(.upload-preview:not([hidden])) { border-style: solid; border-color: var(--line); background: var(--surface); }
.upload-drop.is-dragging::after { content: '여기에 사진을 놓아주세요'; position: absolute; display: grid; place-items: center; inset: 0; border-radius: inherit; background: #f4eaeeed; color: var(--accent); font-weight: 600; pointer-events: none; }
.upload-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: var(--upload-photo-height); padding: 24px 16px; }
.upload-choose { min-width: 160px; min-height: 46px; padding: 10px 24px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; line-height: 24px; letter-spacing: -.025em; }
.upload-choose:hover { background: #683347; }
.upload-choose:focus-visible { outline-offset: 3px; }
.file-formats { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 12px; line-height: 18px; }
.file-formats span { padding-inline: 5px; color: #c7bbc0; }
.upload-error { margin: 14px 0 0; padding: 12px 14px; border-radius: 6px; color: #9b3450; background: #fff2f4; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.upload-preview { margin: 0; }
.preview-stage { position: relative; display: flex; align-items: center; justify-content: center; height: var(--upload-photo-height); padding: 12px; }
.preview-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.preview-remove { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 44px; height: 44px; padding: 7px; border: 0; background: transparent; }
.preview-remove svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: rgb(255 255 255 / 94%); color: var(--text); box-shadow: 0 2px 8px rgb(0 0 0 / 5%); }
.photo-guide { margin-top: 28px; }
.photo-guide h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--text); font-size: 18px; font-weight: 650; line-height: 1.5; letter-spacing: -.025em; }
.photo-guide h2 svg { flex-shrink: 0; width: 22px; height: 22px; color: var(--accent); }
.guide-criteria { margin: 0 0 18px; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; letter-spacing: -.025em; }
.guide-criteria li + li { margin-top: 2px; }
.guide-criteria li::marker { color: var(--accent); font-size: 11px; }
.guide-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.guide-example { min-width: 0; margin: 0; }
.guide-image { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 5px; background: #eef0f2; }
.guide-image > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.guide-verdict { position: absolute; top: 6px; left: 6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #a1374d; box-shadow: 0 1px 4px #30263014; }
.guide-verdict svg { width: 20px; height: 20px; stroke-width: 2.5; }
.good-example .guide-verdict { color: #366656; }
.guide-example figcaption { margin-top: 7px; color: var(--muted); text-align: center; font-size: 12px; line-height: 18px; word-break: keep-all; letter-spacing: -.04em; }
.upload-submit { width: 100%; min-height: 48px; margin-top: 12px; border: 0; }
.upload-submit:disabled { opacity: 1; background: #eee8eb; color: #806976; }
.upload-submit:disabled svg { opacity: .7; }
.upload-submit:enabled:hover { background: #683347; }
/* A single rolling line follows the automatically drawn measurements. */
.analysis-progress { padding: 24px 0 0; margin: 0; }
.analysis-status-row { display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--accent); }
.analysis-status-icon { flex: 0 0 17px; height: 17px; border: 1.5px solid #e4d7dc; border-top-color: currentColor; border-radius: 50%; animation: loading-turn 1s linear infinite; }
.analysis-status-icon svg { display: none; width: 17px; height: 17px; stroke-width: 2; }
.analysis-status-row[data-state='complete'] { color: #367162; }
.analysis-status-row[data-state='complete'] .analysis-status-icon { border: 0; animation: none; }
.analysis-status-row[data-state='complete'] .analysis-status-icon svg { display: block; }
.analysis-status-window { position: relative; min-height: 32px; overflow: hidden; text-align: center; }
.analysis-status-window h2, .analysis-status-previous { margin: 0; color: inherit; font-size: 15px; font-weight: 500; line-height: 32px; letter-spacing: -.035em; word-break: keep-all; }
.analysis-status-previous { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.analysis-status-previous[data-state='working'] { color: var(--accent); }
.analysis-status-previous[data-state='complete'] { color: #367162; }
.upload-main { --analysis-photo-height: min(500px, calc((100vw - 48px) * 1.25)); }
.preview-stage { transition: height .65s cubic-bezier(.2,.7,.2,1), padding .65s; }
.preview-stage > img { transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .45s; }
.upload-main[data-state='analysing'] .upload-drop { border-color: transparent; background: transparent; }
.upload-main[data-state='analysing'] .preview-stage { height: var(--analysis-photo-height); padding: 0; }
.upload-main[data-state='analysing'] .preview-stage > img { transform: scale(1.055); }
.upload-drop[data-visual='measurements'] .preview-stage > img { opacity: 0; }
.analysis-canvas { position: absolute; inset: 0; display: flex; justify-content: center; opacity: 0; transition: opacity .65s; }
.upload-drop[data-visual='measurements'] .analysis-canvas { opacity: 1; }
.analysis-measurement-stage { position: relative; isolation: isolate; container-type: inline-size; width: auto; height: 100%; aspect-ratio: 4 / 5; overflow: hidden; }
.analysis-measurement-stage > svg { width: 100%; height: 100%; stroke: none; }
.analysis-measure-line { stroke: #437769; stroke-width: 1.5; stroke-linecap: butt; stroke-linejoin: round; }
.analysis-measure-guide { stroke: rgb(67 119 105 / 50%); stroke-width: 1; }
.analysis-measure-reference { stroke: rgb(67 119 105 / 75%); stroke-width: 1.2; }
.analysis-measure-dot { fill: #437769; }
.analysis-measure-value { position: absolute; display: flex; align-items: center; gap: 5px; padding: 4px 6px; border: 1px solid rgb(67 119 105 / 12%); border-radius: 5px; background: rgb(255 255 255 / 97%); color: #2c6254; font-size: 12px; font-weight: 400; line-height: 18px; letter-spacing: -.025em; white-space: nowrap; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.analysis-measure-value b { color: inherit; font-size: inherit; font-weight: 600; letter-spacing: 0; }
.analysis-label-left { transform: translate(-100%, -50%); }
.analysis-label-edge { right: 8px; }
@media (max-width: 359px) {
  .analysis-measure-value { font-size: 11px; gap: 3px; padding: 3px 4px; }
  .analysis-status-window h2, .analysis-status-previous { font-size: 14px; }
}
@media (min-width: 560px) {
  .upload-page { --upload-photo-height: 400px; }
  .upload-intro { padding-top: 32px; }
  .photo-guide { margin-top: 32px; }
}
@media (max-width: 359px) {
  .upload-page { --upload-photo-height: 300px; }
  .upload-intro h1 { font-size: 22px; }
  .guide-examples { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .upload-drop, .preview-stage, .preview-stage > img, .analysis-canvas { transition: none; }
  .analysis-title-dots { animation: none; }
  .analysis-status-icon { animation: none; }
}
