/* ═══ COLOR MATCHER — câmera ao vivo ═══ */
.cam-wrap, .cam-wrap * {
  font-family: 'DM Sans', -apple-system, sans-serif; box-sizing: border-box;
}
.cam-wrap {
  position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; z-index: 800;
  background: #12100E; display: none; overflow: hidden;
}
.cam-wrap.on { display: block; }

#cam-video, .cam-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* topo: nome da paleta + fechar */
.cam-topo {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 26px;
  background: linear-gradient(180deg, rgba(0,0,0,.5), transparent);
}
.cam-paleta-nome {
  color: #fff; font-size: 15px; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.cam-x {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.42); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* bolhas da paleta sobrepostas */
.cam-bolhas {
  position: absolute; top: 58px; left: 0; right: 0; z-index: 3;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; padding: 12px 42px;
  pointer-events: none;
}
.cam-bolhas i {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  opacity: .88; box-shadow: 0 2px 10px rgba(0,0,0,.28);
}

/* mira central */
.cam-mira {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border: 2.5px solid rgba(255,255,255,.9);
  border-radius: 14px; z-index: 3; pointer-events: none;
  box-shadow: 0 0 0 2000px rgba(0,0,0,.12);
}

/* resultado da leitura */
.cam-resultado {
  position: absolute; left: 16px; right: 16px; bottom: 132px; z-index: 5;
  opacity: 0; transform: translateY(10px); transition: all .28s;
  pointer-events: none;
}
.cam-resultado.on { opacity: 1; transform: none; }
.cam-card {
  background: rgba(255,255,255,.96); border-radius: 18px; padding: 14px;
  text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.28);
  border-left: 5px solid #C9BCB0;
}
.cam-card.ok   { border-left-color: #17A34A; }
.cam-card.quase{ border-left-color: #E0A030; }
.cam-card.nao  { border-left-color: #C14E1A; }
.cam-amostras { display: flex; gap: 22px; justify-content: center; margin-bottom: 10px; }
.cam-amostras div { text-align: center; }
.cam-amostras span {
  display: block; width: 44px; height: 44px; border-radius: 11px;
  border: 1px solid rgba(0,0,0,.1); margin-bottom: 5px;
}
.cam-amostras b { font-size: 11px; color: #6B6055; font-weight: 500; }
.cam-veredito { font-size: 14.5px; color: #2A2520; font-weight: 600; }

/* rodapé: dica + disparo */
.cam-rodape {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0,0,0,.55), transparent);
  text-align: center;
}
.cam-dica {
  color: rgba(255,255,255,.9); font-size: 13px; margin-bottom: 14px;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.cam-disparo {
  width: 66px; height: 66px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 4px solid rgba(255,255,255,.45);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  transition: transform .12s;
}
.cam-disparo:active { transform: scale(.92); }

/* erro / sem câmera */
.cam-erro {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-size: 14.5px; text-align: center; padding: 30px; gap: 14px;
  line-height: 1.5; pointer-events: none;
}
.cam-erro:empty { display: none; }
.cam-btn-alt {
  pointer-events: auto; margin-top: 12px;
  background: #C14E1A; color: #fff; border: none; border-radius: 99px;
  padding: 13px 26px; font-size: 14.5px; cursor: pointer; font-family: inherit;
}

/* ═══ modal "Upload or Take a Photo" ═══ */
.chk-fonte { padding: 26px 6px 12px; }
.chk-fonte h2 {
  font-size: 20px; font-weight: 700; color: #2A2520;
  margin: 0 0 30px; line-height: 1.35;
}
.chk-fonte-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; margin-bottom: 14px;
  border: 1.5px solid #D9CFC2; border-radius: 12px;
  background: #fff; font-size: 15px; color: #2A2520;
  cursor: pointer; font-family: inherit; transition: opacity .16s;
}
.chk-fonte-btn:active { opacity: .6; }
.chk-fonte-btn svg { width: 18px; height: 18px; color: #4A423A; }
