* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #f1f3f5;
  color: #111827;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.mobile-wrapper {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.screen-view {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hidden {
  display: none !important;
}

/* Nav & Header */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #111827;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #374151;
  cursor: pointer;
}

.accent-bar {
  width: 100%;
  height: 3px;
  background: #f1f3f5;
  margin-bottom: 20px;
}

.accent-bar-inner {
  height: 100%;
  background: #2563eb;
}

.form-hero {
  margin-bottom: 20px;
}

.form-hero h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.form-hero p {
  font-size: 0.88rem;
  color: #6b7280;
  margin-top: 4px;
}

/* Form */
.field-box {
  margin-bottom: 15px;
}

.field-box label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.field-box input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  outline: none;
  background: #fafafa;
}

.field-box input:focus {
  border-color: #2563eb;
  background: #fff;
}

.gender-pills {
  display: flex;
  gap: 10px;
}

.gender-label {
  flex: 1;
  text-align: center;
  border: 1px solid #d1d5db;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fafafa;
}

.gender-label input { display: none; }

.gender-label:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
}

/* Buttons */
.btn-solid-blue {
  width: 100%;
  background-color: #2563eb;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 15px;
  border-radius: 35px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-outline {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 14px;
  border-radius: 35px;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  margin-top: 10px;
}

/* Instructions Screen */
.page-title-center {
  text-align: center;
  margin-bottom: 24px;
}

.page-title-center h1 {
  font-size: 1.55rem;
  font-weight: 700;
}

.page-title-center p {
  font-size: 1.25rem;
  margin-top: 4px;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fcfaf8;
  border: 1px solid #f3ece6;
  border-radius: 14px;
  padding: 14px 16px;
}

.guide-thumb {
  width: 50px;
  height: 50px;
  background: #ede3dc;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.guide-desc {
  font-size: 0.96rem;
  font-weight: 500;
  color: #1f2937;
}

.footer-privacy {
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: auto;
  margin-bottom: 16px;
}

/* Camera & Timer */
.cam-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9/13;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  margin-bottom: 16px;
}

#webcam, #freezeCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.green-oval-ring {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68%;
  height: 60%;
  border: 3.5px solid #22c55e;
  border-radius: 50%;
  pointer-events: none;
}

.timer-countdown {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.hold-text {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #22c55e;
  font-size: 0.95rem;
  font-weight: 600;
  pointer-events: none;
}

/* Page 5: Loading Process */
.text-center { text-align: center; }

.tailor-preview-box {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 20px;
  overflow: hidden;
  margin: 30px auto 20px auto;
  border: 3px solid #e5e7eb;
}

#analyzingImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-laser-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #2563eb;
  box-shadow: 0 0 10px #2563eb;
  animation: scanLaser 1.5s infinite ease-in-out alternate;
}

@keyframes scanLaser {
  0% { top: 0%; }
  100% { top: 96%; }
}

.tailor-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.tailor-checklist {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 280px;
  margin: 0 auto;
  text-align: left;
}

.check-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6b7280;
}

.check-step.active {
  color: #111827;
  font-weight: 600;
}

/* Page 6: Results Horizontal Scroll */
.trust-banner {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  margin-bottom: 8px;
}

.greeting-box {
  margin: 10px 0 16px 0;
}

.greeting-box h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.greeting-box p {
  font-size: 0.9rem;
  color: #374151;
}

.analysis-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.result-scroll-wrapper {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.result-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}

.result-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}

.analysis-card {
  min-width: 250px;
  max-width: 250px;
  background: #faf8f5;
  border: 1px solid #eee5dc;
  border-radius: 20px;
  overflow: hidden;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  background: #000;
}

.card-img-wrap canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-meta {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.m-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #111827;
}

.circle-score {
  border: 1.5px solid #ef4444;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
}

.circle-score small {
  font-size: 0.6rem;
  color: #6b7280;
}

.tag-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 8px;
  background: #f1f3f5;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #4b5563;
  font-weight: 600;
}

.tag-badge.warning {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fee2e2;
}

.btn-detail {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
  cursor: pointer;
}