.scene-analysis {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.analysis-flow {
  display: grid;
  gap: 12px;
}

.dropzone {
  position: relative;
  min-height: 208px;
  padding: 16px 14px 14px;
  border: 1.5px dashed rgba(15, 139, 83, 0.48);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 253, 247, 0.84)),
    #fffefb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.64),
    0 12px 30px rgba(103, 83, 51, 0.08);
}

.upload-ghost {
  position: absolute;
  top: 18px;
  left: 50%;
  width: min(78%, 330px);
  aspect-ratio: 760 / 480;
  background: url("/assets/floorplan-sample.svg") center / contain no-repeat;
  filter: grayscale(1);
  opacity: 0.16;
  transform: translateX(-50%);
}

.dropzone .upload-icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 16px 30px rgba(3, 116, 68, 0.23);
  object-fit: contain;
}

.dropzone .upload-title {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 4px;
  color: #101112;
  font-size: clamp(22px, 6.4vw, 28px);
  font-weight: 800;
}

.dropzone .upload-format,
.dropzone .upload-limit {
  position: relative;
  z-index: 1;
  display: block;
  color: #7b7c79;
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 600;
  line-height: 1.35;
}

.dropzone #previewImage:not([hidden]) {
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(30vh, 232px);
  max-height: none;
  object-fit: cover;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(25, 39, 36, 0.12);
}

.dropzone.has-preview { min-height: 252px; padding: 10px; }

.dropzone.has-preview .upload-ghost,
.dropzone.has-preview .upload-icon,
.dropzone.has-preview .upload-format,
.dropzone.has-preview .upload-limit {
  display: none;
}

.dropzone.has-preview .upload-title {
  display: none;
}

.reselect-button {
  justify-self: end;
  min-height: 34px;
  margin-top: -2px;
  padding: 0 12px;
  border: 1px solid rgba(15, 139, 83, 0.22);
  border-radius: 999px;
  background: rgba(15, 139, 83, 0.08);
  color: var(--home-green);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.reselect-button[hidden] {
  display: none;
}

.recognition-result {
  display: grid;
  gap: 8px;
  animation: resultRise 300ms ease both;
}

.recognition-result[hidden] {
  display: none;
}

.recognition-result .primary-button {
  min-height: 46px;
  margin-top: 0;
}

.analysis-progress {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(15, 139, 83, 0.24);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 12px 28px rgba(103, 83, 51, 0.08);
}

.analysis-progress[hidden] {
  display: none;
}

.analysis-progress__orb {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(31, 122, 90, 0.18);
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: analysisSpin 900ms linear infinite;
}

.analysis-progress__copy {
  display: grid;
  gap: 6px;
}

.analysis-progress__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.analysis-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.analysis-progress__bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 122, 90, 0.12);
}

.analysis-progress__bar span {
  display: block;
  width: 3%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--home-green), var(--gold));
  transition: width 220ms ease;
}

.analysis-progress.is-error {
  border-color: rgba(182, 64, 42, 0.42);
}

.analysis-progress.is-error .analysis-progress__orb {
  border-color: rgba(182, 64, 42, 0.28);
  border-top-color: var(--cinnabar);
}

@keyframes resultRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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