/* Layar kamera: satu layar penuh, tombol ditaruh di jangkauan jempol. */

html.kamera, html.kamera body {
  height: 100%;
  overflow: hidden;
  background: #000;
}

.lensa {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
}

#video, #bayangan {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Foto "sebelum" ditumpuk transparan supaya sudut ambil foto "sesudah" sama. */
#bayangan {
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: contrast(1.15);
}
#bayangan.aktif { opacity: var(--tebal, .4); }

.garis-bantu {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right,  transparent 33.2%, rgba(255,255,255,.14) 33.2%, rgba(255,255,255,.14) 33.5%, transparent 33.5%,
                               transparent 66.4%, rgba(255,255,255,.14) 66.4%, rgba(255,255,255,.14) 66.7%, transparent 66.7%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.14) 33.2%, rgba(255,255,255,.14) 33.5%, transparent 33.5%,
                               transparent 66.4%, rgba(255,255,255,.14) 66.4%, rgba(255,255,255,.14) 66.7%, transparent 66.7%);
  opacity: 0;
  transition: opacity .15s;
}
.garis-bantu.aktif { opacity: 1; }

/* ---------- rel titik di atas ---------- */

.rel-atas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(10px + env(safe-area-inset-top)) 12px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,.78), transparent);
  z-index: 10;
}

.rel-baris {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutup {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: 20px;
  text-decoration: none;
}

.titik-kini {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.titik-kini .kd {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.titik-kini .ket {
  font-size: 12px;
  color: rgba(255,255,255,.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.titik-kini.belum .kd { color: var(--aksi); }

.ikon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.ikon-btn[aria-pressed="true"] {
  background: var(--aksi);
  border-color: var(--aksi);
  color: #17200a;
}

.hitung-atas {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255,255,255,.7);
  font-variant-numeric: tabular-nums;
}
.bar-maju {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
}
.bar-maju i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--aksi);
  transition: width .25s;
}

/* ---------- kendali bawah ---------- */

.rel-bawah {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,.82) 55%, transparent);
  z-index: 10;
}

.tahap-pilih {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  margin-bottom: 16px;
}
.tahap-pilih button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255,255,255,.66);
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}
.tahap-pilih button[aria-pressed="true"] { color: #10151b; }
.tahap-pilih button[data-tahap="sebelum"][aria-pressed="true"] { background: var(--sebelum); }
.tahap-pilih button[data-tahap="proses"][aria-pressed="true"]  { background: var(--proses); }
.tahap-pilih button[data-tahap="sesudah"][aria-pressed="true"] { background: var(--sesudah); }

.shutter-baris {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.jepret {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.9);
  background: var(--aksi);
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
.jepret:active { transform: scale(.94); }
.jepret[disabled] { opacity: .5; }
.jepret:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.sisi {
  width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: none;
}
.sisi .lbl { font-size: 11px; color: rgba(255,255,255,.6); }

.terakhir {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.4);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.terakhir img { width: 100%; height: 100%; object-fit: cover; }

/* Penggeser ketebalan bayangan, ditaruh di tepi kanan supaya kena jempol. */
.tebal-geser {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(270deg);
  transform-origin: center;
  width: 150px;
  z-index: 12;
  display: none;
}
.tebal-geser.tampil { display: block; }
.tebal-geser input { width: 100%; accent-color: var(--sebelum); }

/* ---------- lembar geser ---------- */

.lembar {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,.6);
  display: none;
}
.lembar.tampil { display: block; }
.lembar-isi {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--line);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
}
.pegangan {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 6px auto 12px;
}
.lembar h2 {
  margin: 4px 0 2px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.015em;
}
.lembar .bantu { margin: 0 0 12px; font-size: 13.5px; color: var(--mute); }

.daftar-titik { margin: 6px 0 0; }
.pilih-titik {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pilih-titik:active { background: var(--panel); }

.blitz-mati { filter: none; }
