* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f6f4;
  color: #1c231c;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

.app {
  width: 100%;
  max-width: 480px;
}

.logo {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  margin: 0 auto 1rem;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #55605a;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.camera-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 50vh;
  background: #11150f;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#video,
#preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roi-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  aspect-ratio: 1 / 1;
  border: 3px dashed rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

button {
  flex: 1 1 auto;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #2f7d3c;
  color: white;
  cursor: pointer;
}

button:disabled {
  background: #9db99f;
  cursor: not-allowed;
}

button.secondary {
  background: #45514a;
}

.result {
  margin-top: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.result h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.feedback-buttons {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.feedback-buttons button {
  flex: 1 1 auto;
}

.learn-box {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.learn-box textarea {
  width: 100%;
  min-height: 4rem;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #c7d0c9;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.feedback-thanks {
  margin-top: 0.75rem;
  color: #2f7d3c;
  font-weight: 600;
}

.error {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fdecea;
  color: #7a1f13;
  border-radius: 10px;
}

.footer {
  text-align: center;
  color: #8a948d;
  font-size: 0.8rem;
  margin-top: 2rem;
  padding-bottom: 1rem;
}
