:root {
  --color-bg: #f4f5f6;
  --color-card: #ffffff;
  --color-text: #14171a;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --color-primary: #0e9f6e;
  --color-primary-dark: #0b7d57;
  --color-primary-tint: #e7f7f1;
  --color-black: #14171a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-bg);
}

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  min-height: 100vh;
  position: relative;
}

.test-btn {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: 14px;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--color-border);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  z-index: 5;
}

.test-panel {
  margin-bottom: 20px;
}

.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--color-text);
}

.header h1 {
  font-size: 20px;
  margin: 0;
}

.brand {
  text-align: left;
  margin-bottom: 32px;
}

.brand h1 {
  font-size: 26px;
  margin: 0 0 4px;
}

.brand p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.qr-frame {
  width: 220px;
  height: 220px;
  margin: 24px auto;
  border-radius: 24px;
  background: var(--color-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-frame::before {
  content: "";
  width: 90px;
  height: 90px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.qr-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-primary);
}
.qr-corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.qr-corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.qr-corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.qr-corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

.scan-caption {
  text-align: center;
  margin-bottom: 32px;
}
.scan-caption strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}
.scan-caption span {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.spacer { flex: 1; }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:active { background: var(--color-primary-dark); }
.btn-primary:disabled { background: #a9d9c6; cursor: not-allowed; }
.btn-dark { background: var(--color-black); color: #fff; }
.btn-link {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  padding: 12px;
  cursor: pointer;
  text-align: center;
}

.tabbar {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
  cursor: pointer;
}
.tabbar .badge {
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.map-preview {
  height: 160px;
  border-radius: 20px;
  background: repeating-linear-gradient(135deg, var(--color-primary-tint), var(--color-primary-tint) 10px, #dcf3ea 10px, #dcf3ea 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}
.map-pin {
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  background: var(--color-primary-dark);
  transform: rotate(-45deg);
}

.card {
  background: var(--color-card);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--color-text-secondary); font-size: 14px; line-height: 1.5; }
.tag {
  display: inline-block;
  margin-top: 10px;
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  margin: 4px 0 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.chip {
  border: 1px solid var(--color-border);
  background: var(--color-card);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text);
}
.chip.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

textarea {
  width: 100%;
  min-height: 90px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  padding: 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 20px;
}
textarea:focus { outline: 2px solid var(--color-primary); }

.photo-row { display: flex; gap: 10px; margin-bottom: 24px; }
.photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: repeating-linear-gradient(135deg, #eee, #eee 6px, #e2e2e2 6px, #e2e2e2 12px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.photo-add {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px dashed var(--color-border);
  background: none;
  color: var(--color-text-secondary);
  font-size: 22px;
  cursor: pointer;
}

.status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 20px;
}

.status-title { text-align: center; margin-bottom: 28px; }
.status-title h2 { margin: 0 0 4px; font-size: 20px; }
.status-title p { margin: 0; color: var(--color-text-secondary); font-size: 14px; }

.stepper {
  display: flex;
  align-items: flex-start;
  background: var(--color-card);
  border-radius: 20px;
  padding: 20px 12px;
  margin-bottom: 20px;
}
.step { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--color-text-secondary); }
.step .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  margin: 0 auto 8px;
  position: relative;
  z-index: 1;
}
.step::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}
.step:first-child::before { display: none; }
.step.active { color: var(--color-text); font-weight: 600; }
.step.active .dot, .step.done .dot { background: var(--color-primary); }
.step.done::before, .step.active::before { background: var(--color-primary); }

.help-text {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.demo-note {
  border: 1px dashed var(--color-border);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
  font-size: 12px;
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.photo-compare { display: flex; gap: 10px; margin-bottom: 20px; }
.photo-compare figure { flex: 1; margin: 0; text-align: center; }
.photo-compare img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  background: var(--color-border);
}
.photo-compare figcaption { font-size: 12px; color: var(--color-text-secondary); margin-top: 6px; }

.stars { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.star {
  font-size: 34px;
  cursor: pointer;
  color: var(--color-border);
}
.star.filled { color: #f5a623; }

.list-item {
  background: var(--color-card);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.list-item .meta h4 { margin: 0 0 4px; font-size: 15px; }
.list-item .meta p { margin: 0; font-size: 13px; color: var(--color-text-secondary); }
.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
  white-space: nowrap;
}
.status-badge.done { background: #eef0f2; color: var(--color-text-secondary); }

.empty-state {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-top: 40px;
}
