:root {
  --merah: #0F6A45; --merah-tua: #0A4A31; --merah-muda: #E3F2EA; --bahaya: #B3202A; --bahaya-tua: #8E1B23; --bahaya-muda: #FBE8EA; --latar: #F3F7F5; --teks: #231C1C; --abu: #6B6262;
  --garis: #ECE6E4; --garis-isian: #D9D0CD; --hijau: #1B6B43; --hijau-muda: #E4F3EA; --wa: #0F7A3E;
  --atas: env(safe-area-inset-top, 0px); --bawah: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--latar); color: var(--teks); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--latar); }
.layar { padding-bottom: calc(76px + var(--bawah)); }
h1, h2, p { margin: 0; }
h2 { font-size: 16px; margin-top: 4px; }

.kepala { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--merah); color: #fff; padding: calc(10px + var(--atas)) 12px 10px; min-height: 56px; }
.kepala .judul { flex: 1; min-width: 0; }
.kepala h1 { font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kepala p { font-size: 12px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kepala .logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; padding: 2px; }
.kepala .kanan { display: flex; align-items: center; gap: 4px; }
.ikon { appearance: none; border: 0; background: transparent; color: inherit; font-size: 26px; line-height: 1; min-width: 44px; height: 44px; border-radius: 22px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.ikon.merah { color: var(--merah); }
.avatar-tombol { min-width: 40px; height: 40px; }

.isi { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.abu { color: var(--abu); } .kecil { font-size: 12.5px; } .tengah { display: flex; flex-direction: column; align-items: center; gap: 8px; } .tengah-teks { text-align: center; }

.kartu { background: #fff; border: 1px solid var(--garis); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.kartu.klik { cursor: pointer; } .kartu.klik:active { background: #f1f8f4; }
.kartu.profil { align-items: center; padding: 20px; gap: 10px; }
.kartu.profil .info-baris { width: 100%; text-align: center; }
.baris-atas { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.waktu { color: var(--merah); font-weight: 700; font-size: 13px; }
.acara { font-weight: 700; font-size: 15.5px; } .acara.besar { font-size: 17px; }
.daftar { display: flex; flex-direction: column; gap: 12px; }
.grup { font-weight: 700; color: var(--merah-tua); font-size: 14px; padding-top: 4px; }
.info-baris { display: flex; flex-direction: column; }
.narasi { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.lencana { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.lencana.hijau { background: var(--hijau-muda); color: var(--hijau); } .lencana.merah { background: var(--bahaya-muda); color: var(--bahaya-tua); } .lencana.abu { background: var(--garis); color: var(--abu); }
.pelapor-blok { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 2px; }
.pelapor { appearance: none; border: 0; background: transparent; color: var(--merah); font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: underline; padding: 8px 2px; min-height: 36px; cursor: pointer; text-align: left; }

.tgl-nav { display: flex; align-items: center; gap: 4px; }
.tgl-tengah { flex: 1; text-align: center; cursor: pointer; padding: 4px 0; }
.tgl-judul { font-weight: 700; font-size: 16px; }

.tombol { appearance: none; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--merah); font: inherit; font-weight: 700; font-size: 15.5px; cursor: pointer; text-decoration: none; text-align: center; }
.tombol.utama { background: var(--merah); color: #fff; }
.tombol.garis { background: #fff; color: var(--merah); }
.tombol.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.tombol:disabled { opacity: .55; cursor: default; }
.tombol.sibuk::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: putar .8s linear infinite; }
.tautan { appearance: none; border: 0; background: none; color: var(--merah); font: inherit; font-weight: 600; text-decoration: underline; padding: 8px; cursor: pointer; }
.tautan.merah { font-size: 14px; }
.kotak-bagikan { display: flex; flex-direction: column; gap: 10px; }
.info { background: #fff8e1; border: 1px solid #f0dca0; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }

.isian { display: flex; flex-direction: column; gap: 4px; }
.isian > span { font-size: 13px; font-weight: 600; color: var(--abu); }
.isian small { color: var(--abu); font-size: 12px; }
input, textarea { font: inherit; font-size: 16px; /* 16px mencegah iOS memperbesar layar */ width: 100%; padding: 12px; border: 1.5px solid var(--garis-isian); border-radius: 12px; background: #fff; color: var(--teks); -webkit-appearance: none; appearance: none; min-height: 48px; }
textarea { resize: vertical; min-height: 140px; }
input:focus, textarea:focus { outline: none; border-color: var(--merah); }
input[type=date], input[type=month] { text-align: left; }
input[hidden] { display: none; }
[hidden] { display: none !important; }

.pil-baris { display: flex; gap: 8px; flex-wrap: wrap; }
.pil { appearance: none; border: 1px solid var(--garis-isian); background: #fff; color: var(--merah); font: inherit; font-size: 13.5px; font-weight: 600; border-radius: 99px; padding: 9px 14px; min-height: 40px; cursor: pointer; }
.pil.aktif { background: var(--merah); border-color: var(--merah); color: #fff; }

.galat { background: var(--bahaya-muda); color: var(--bahaya-tua); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.sukses { background: var(--hijau-muda); color: var(--hijau); border-radius: 12px; padding: 12px 14px; }
.sukses p { margin-top: 2px; font-size: 14px; }
.catatan { background: #fff8e1; border: 1px solid #f0dca0; border-radius: 12px; padding: 12px; font-size: 14px; }
.kosong { text-align: center; color: var(--abu); padding: 28px 8px; }
.memuat { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--abu); padding: 24px 0; }
.putar { width: 18px; height: 18px; border: 2.5px solid var(--garis-isian); border-top-color: var(--merah); border-radius: 50%; animation: putar .8s linear infinite; display: inline-block; }
.putar.kecil { width: 14px; height: 14px; }
@keyframes putar { to { transform: rotate(360deg); } }

.avatar { border-radius: 50%; background: var(--merah-muda); color: var(--merah-tua); font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.besar { width: 96px; height: 96px; font-size: 34px; }

.galeri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sel-foto { position: relative; aspect-ratio: 1; background: var(--garis); border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.sel-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sel-foto .hapus { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.lapisan { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--atas) 8px var(--bawah); }
.lapisan img { max-width: 100%; max-height: 88%; object-fit: contain; }
.lapisan .tutup { color: #ddd; font-size: 13px; margin-top: 10px; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; max-width: 640px; margin: 0 auto; display: flex; background: #fff; border-top: 1px solid var(--garis); padding-bottom: var(--bawah); }
.bar button { flex: 1; appearance: none; border: 0; background: transparent; color: var(--abu); font: inherit; font-size: 12px; font-weight: 600; padding: 8px 0 7px; min-height: 56px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.bar button.aktif { color: var(--merah); }
.bar .ik { font-size: 20px; line-height: 1.1; filter: grayscale(1); opacity: .7; } .bar .aktif .ik { filter: none; opacity: 1; }

@media (min-width: 700px) { .layar { box-shadow: 0 0 0 1px var(--garis); } }

.kode-besar { font: 700 26px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; color: var(--merah-tua); user-select: all; }
.kartu.mati { opacity: .6; }

.thumbs { display: flex; gap: 6px; margin-top: 4px; }
.thumb { flex: 1; max-width: 140px; aspect-ratio: 4 / 3; background: var(--garis); border-radius: 8px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galeri.satu { grid-template-columns: 1fr; }
.galeri.satu .sel-foto { aspect-ratio: 4 / 3; }
.pratinjau-kolase { display: flex; flex-direction: column; gap: 6px; }
.pratinjau-kolase img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--garis); border-radius: 12px; display: block; }
.cek { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.cek input { width: 22px; min-height: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--merah); }

/* ---------- lightbox foto ---------- */
.zm { position: fixed; inset: 0; z-index: 80; background: #080606; display: flex; flex-direction: column; }
.zm-bar { display: flex; justify-content: space-between; gap: 10px; padding: calc(var(--atas) + 10px) 12px 10px; }
.zm-btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: rgba(255,255,255,.14); color: #fff; font: inherit; font-weight: 600; }
.zm-btn:disabled { opacity: .4; }
.zm-panggung { flex: 1; overflow: hidden; touch-action: none; display: flex; align-items: center; justify-content: center; padding-bottom: var(--bawah); }
.zm-panggung img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center; }
.zm-pesan { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; color: #ddd; font-size: 14px; }
.thumb.bisa { cursor: zoom-in; }
.narasi { user-select: text; -webkit-user-select: text; }
.kartu .pil { margin: 6px 0 4px; }

/* ---------- lompat tanggal ---------- */
.tgl-tengah { position: relative; }
.tgl-judul-baris { display: flex; align-items: center; justify-content: center; gap: 6px; }
.tgl-ikon { font-size: 15px; }
.tgl-pemilih { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.tgl-pemilih::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.tgl-hariini { display: flex; justify-content: center; }
.tgl-hariini .pil[hidden] { display: none; }

/* ---------- filter rentang tanggal (arsip) ---------- */
.rentang { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rentang label { display: grid; gap: 3px; min-width: 0; }
.rentang input { width: 100%; min-height: 46px; padding: 8px 10px; border: 1.5px solid var(--garis-isian); border-radius: 12px; background: #fff; font: inherit; font-size: 15px; color: var(--teks); }

/* kotak centang: gaya umum input mematikan tampilan bawaan, jadi penandanya dibuat sendiri */
.cek input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; min-height: 26px; padding: 0; border: 2px solid var(--merah); border-radius: 7px; background: #fff; cursor: pointer; position: relative; flex: none; margin-top: 1px; }
.cek input[type=checkbox]:checked { background: var(--merah) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 82% no-repeat; }
.cek input[type=checkbox]:focus-visible { outline: 3px solid rgba(15,106,69,.35); outline-offset: 2px; }
.cek span { padding-top: 2px; }
.sukses + .tombol, .tombol + .tombol { margin-top: 10px; }

/* ---- pilihan (dropdown) dan peringatan ---- */
select { font: inherit; font-size: 16px; width: 100%; padding: 12px 36px 12px 12px; border: 1.5px solid var(--garis-isian); border-radius: 12px; color: var(--teks); -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
select:focus { outline: none; border-color: var(--merah); }
.kartu.peringatan { border-color: #e8c25a; background: #fff8e1; display: flex; flex-direction: column; gap: 8px; }
.kartu .isian { margin-top: 8px; }
.baca-saja { padding: 12px; border: 1.5px solid var(--garis-isian); border-radius: 12px; background: #f1eeee; color: var(--teks); font-size: 16px; }
.feedback { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--garis-isian); display: flex; flex-direction: column; gap: 8px; }
.fb-item { background: #f7f3f3; border-radius: 12px; padding: 10px 12px; }
.fb-item p { margin: 6px 0 0; white-space: pre-wrap; }
.fb-item .tautan.kecil { font-size: 13px; margin-top: 4px; }
.feedback textarea { min-height: 80px; }
.pil-baris.aksi-ikon { justify-content: center; gap: 14px; }
.pil-baris.aksi-ikon .pil { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 44px; padding: 0; }
.pil-baris.tengah-baris { justify-content: center; gap: 16px; }
.pil.pil-ikon { width: 48px; height: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.pil.pil-ikon svg { display: block; }

/* ---- kalender Beranda ---- */
button.tgl-tengah { background: none; border: 0; font: inherit; color: inherit; }
.kalender { background: #fff; border: 1px solid var(--garis-isian); border-radius: 16px; padding: 10px 10px 12px; }
.kalender[hidden] { display: none; }
.kal-kepala { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.kal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.kal-nama { text-align: center; font-size: 12px; font-weight: 600; color: var(--abu); padding: 4px 0; }
.kal-hari { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 44px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 15px; color: var(--teks); padding: 0; }
.kal-hari.hari-ini span { font-weight: 800; color: var(--merah); }
.kal-hari.dipilih { background: var(--merah); color: #fff; }
.kal-hari.dipilih span { color: #fff; }
.kal-titik { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.kal-titik.hijau { background: #1e9e5a; } .kal-titik.kuning { background: #f0b400; } .kal-titik.merah { background: #d63a3a; }
.kal-hari.dipilih .kal-titik { box-shadow: 0 0 0 1.5px #fff; }
.kal-legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--abu); }

.banner-demo { position: sticky; top: 0; z-index: 50; display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #fff3cd; color: #5c4400; border-bottom: 1px solid #e8c25a; padding: 8px 12px; font-size: 13px; }
.banner-demo button { background: #5c4400; color: #fff; border: 0; border-radius: 999px; padding: 7px 12px; font: inherit; font-weight: 600; white-space: nowrap; }
ol.langkah { margin: 8px 0 12px 20px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

/* ---------- halaman sambutan (tema hijau, hero bergradasi) ---------- */
.sb { min-height: 100vh; min-height: 100dvh; background: #f1f8f4; color: var(--teks); }
.sb-hero { display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; padding: calc(var(--atas, 0px) + 60px) 24px 84px;
  background: radial-gradient(ellipse at 25% 0%, #1b8a5c 0%, #0F6A45 45%, #0A4A31 100%); border-radius: 0 0 50% 50% / 0 0 34px 34px; }
.sb-logo { width: 128px; height: 128px; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 0 0 7px rgba(255, 255, 255, .22), 0 12px 32px rgba(0, 0, 0, .28); }
.sb-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sb-instansi { margin-top: 26px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 255, 255, .88); font-weight: 500; }
.sb-hero h1 { margin: 12px 0 0; font-size: 46px; line-height: 1.05; letter-spacing: -.02em; font-weight: 800; color: #fff; }
.sb-hero h1 span { color: #ebb94c; }
.sb-sub { margin: 10px 0 0; max-width: 340px; font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .88); }
.sb-wrap { max-width: 520px; margin: -40px auto 0; position: relative; padding: 0 16px calc(var(--bawah, 0px) + 22px); display: flex; flex-direction: column; }
.sb-fitur { display: flex; flex-direction: column; gap: 12px; }
.sb-f { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 4px 16px rgba(10, 74, 49, .08); }
.sb-ik { flex: none; width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; line-height: 1; }
.sb-i1 { background: #e4f3ea; } .sb-i2 { background: #fdf0d0; } .sb-i3 { background: #ece8f7; } .sb-i4 { background: #e3edf9; }
.sb-f b { display: block; font-size: 17px; font-weight: 700; line-height: 1.25; }
.sb-f small { display: block; color: #7b7272; font-size: 14.5px; line-height: 1.4; margin-top: 2px; }
.sb-pasang { margin-top: 12px; text-align: center; }
.sb-pasang-tgl { background: none; border: 0; font: inherit; font-size: 14px; color: #7b7272; padding: 8px 4px; cursor: pointer; }
.sb-pasang-tgl u { color: var(--merah); text-underline-offset: 3px; font-weight: 600; }
.sb-panel { margin-top: 6px; text-align: left; background: #fff; border: 1.5px dashed #a9d3bd; border-radius: 18px; padding: 14px 16px; }
.sb-panel[hidden] { display: none; }
.sb-tab { display: flex; gap: 8px; margin: 0 0 10px; }
.sb-tab button { flex: 1; min-height: 40px; border: 1.5px solid #cfe3d8; border-radius: 12px; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: #6b6262; }
.sb-tab button.aktif { background: var(--merah); border-color: var(--merah); color: #fff; }
.sb-langkah ol { margin: 0; padding-left: 20px; font-size: 14.5px; color: #4a4242; display: flex; flex-direction: column; gap: 4px; }
.sb-pasang-btn { width: 100%; min-height: 44px; margin-bottom: 10px; border: 0; border-radius: 12px; background: var(--merah); color: #fff; font: inherit; font-weight: 650; }
.sb-tombol { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; margin-top: 14px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #1b8a5c, #0F6A45); color: #fff; font: inherit; font-size: 18px; font-weight: 700; box-shadow: 0 10px 24px rgba(15, 106, 69, .32); cursor: pointer; }
.sb-tombol:active { transform: scale(.98); }
.sb-hak { padding-top: 14px; text-align: center; font-size: 11px; color: #b0a6a4; }
.sb-unit { font-size: clamp(9.5px, 2.9vw, 12px); color: #8a7f7f; white-space: nowrap; margin-bottom: 3px; }
@media (max-height: 720px) { .sb-hero { padding-top: calc(var(--atas, 0px) + 40px); padding-bottom: 76px; } .sb-logo { width: 100px; height: 100px; }  }
@media (prefers-reduced-motion: no-preference) { .sb-f { animation: sb-masuk .5s both; } .sb-f:nth-child(2) { animation-delay: .06s; } .sb-f:nth-child(3) { animation-delay: .12s; } .sb-f:nth-child(4) { animation-delay: .18s; } }
@keyframes sb-masuk { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.klaim-daftar { display: flex; flex-direction: column; gap: 6px; }
.pil-nama { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; padding: 10px 14px; border: 1.5px solid var(--garis-isian); border-radius: 12px; background: #fff; font: inherit; color: var(--teks); }
.pil-nama:active { border-color: var(--merah); }

.aksi-agenda { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--garis); }
.aksi-agenda .pil-ikon { width: 44px; height: 44px; color: var(--merah); }

.rata-kanan { text-align: right; }
