:root {
  --merah: #B3202A; --merah-tua: #8E1B23; --merah-muda: #FBE8EA; --latar: #F7F4F3; --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: #fdf7f7; }
.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(--merah-muda); color: var(--merah-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(--merah-muda); color: var(--merah-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); }

/* ---------- halaman sambutan ---------- */
.sb { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #FFF6EE; }
.sb-hero { position: relative; overflow: hidden; color: #fff; text-align: center; padding: calc(var(--atas) + 44px) 26px 104px;
  background: radial-gradient(120% 80% at 85% -10%, #d9414b 0%, transparent 55%), radial-gradient(90% 70% at 0% 100%, #5f0e15 0%, transparent 60%), linear-gradient(160deg, #B3202A 0%, #7E141C 100%); }
.sb-hero > * { position: relative; z-index: 2; }
.sb-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 54px; z-index: 3;
  background: #FFF6EE; -webkit-mask: radial-gradient(120% 100% at 50% 100%, #000 62%, transparent 63%); mask: radial-gradient(120% 100% at 50% 100%, #000 62%, transparent 63%); }
.sb-selubung { position: absolute !important; inset: 0; z-index: 1 !important; pointer-events: none;
  background: radial-gradient(70% 55% at 50% 52%, rgba(110,14,22,.72) 0%, rgba(110,14,22,.35) 70%, transparent 100%), linear-gradient(180deg, rgba(126,20,28,.35), rgba(126,20,28,.62)); }
.sb-mozaik { position: absolute !important; inset: -8% -4%; z-index: 0 !important; display: flex; gap: 10px; opacity: 0; transition: opacity 1.6s ease; transform: rotate(-6deg) scale(1.12); }
.sb-mozaik.tampil { opacity: .55; }
.sb-kol { flex: 1; overflow: hidden; min-width: 0; }
.sb-jalur { display: flex; flex-direction: column; gap: 10px; animation: sb-naik 70s linear infinite; will-change: transform; }
.sb-kol1 .sb-jalur { animation-name: sb-turun; animation-duration: 85s; }
.sb-kol2 .sb-jalur { animation-duration: 95s; }
.sb-ubin { border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.08); flex: none; }
.sb-ubin.datar { aspect-ratio: 4 / 3; } .sb-ubin.tegak { aspect-ratio: 3 / 4; }
.sb-ubin img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(.35) saturate(1.1) contrast(1.05); mix-blend-mode: luminosity; opacity: .9; }
@keyframes sb-naik { to { transform: translateY(calc(-50% - 5px)); } }
@keyframes sb-turun { from { transform: translateY(calc(-50% - 5px)); } to { transform: translateY(0); } }
.sb-logo { width: 104px; height: 104px; border-radius: 50%; background: #fff; margin: 0 auto 20px; display: grid; place-items: center; box-shadow: 0 0 0 6px rgba(255,255,255,.2), 0 14px 34px rgba(0,0,0,.3); }
.sb-logo img { width: 78px; height: 78px; object-fit: contain; }
.sb-instansi { font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase; opacity: .92; }
.sb h1 { margin: 10px 0; font-size: 34px; line-height: 1.12; font-weight: 800; letter-spacing: -.01em; text-shadow: 0 2px 14px rgba(60,6,12,.45); }
.sb h1 span { color: #E9B949; }
.sb-sub { max-width: 30ch; margin: 0 auto; font-size: 16px; opacity: .96; text-shadow: 0 1px 8px rgba(60,6,12,.5); }
.sb-isi { padding: 0 22px; margin-top: -54px; position: relative; z-index: 4; flex: 1; display: grid; gap: 14px; align-content: start; }
.sb-fitur { display: grid; gap: 12px; }
.sb-f { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 6px 22px rgba(126,20,28,.1), 0 1px 0 rgba(0,0,0,.03); }
.sb-ik { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: #FBE8EA; }
.sb-f:nth-child(2) .sb-ik { background: #FFF1D6; } .sb-f:nth-child(3) .sb-ik { background: #E4F3EA; } .sb-f:nth-child(4) .sb-ik { background: #E7EEF9; }
.sb-f b { display: block; font-size: 16px; line-height: 1.25; } .sb-f small { display: block; color: #6B6262; font-size: 13.5px; line-height: 1.35; margin-top: 2px; }
.sb-pasang { background: #fff; border: 1.5px dashed #E3C9CB; border-radius: 18px; padding: 14px 16px; }
.sb-pasang-judul { font-weight: 700; font-size: 15px; } .sb-pasang-judul span { color: #8a7f7d; font-weight: 500; font-size: 13px; }
.sb-tab { display: flex; gap: 6px; margin: 10px 0 8px; }
.sb-tab button { flex: 1; min-height: 38px; border: 1.5px solid #E3C9CB; background: #fff; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; color: #6B6262; }
.sb-tab button.aktif { background: #B3202A; border-color: #B3202A; color: #fff; }
.sb-langkah ol { margin: 0; padding-left: 20px; font-size: 14px; color: #4a4141; } .sb-langkah li { margin: 3px 0; }
.sb-pasang-btn { width: 100%; min-height: 44px; margin-bottom: 8px; border: 0; border-radius: 12px; background: #0F7A3E; color: #fff; font: inherit; font-weight: 700; }
.sb-aksi { padding: 22px 22px calc(var(--bawah) + 22px); text-align: center; }
.sb-tombol { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; border: 0; border-radius: 18px; font: inherit; font-size: 18px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #c42631, #B3202A); box-shadow: 0 10px 24px rgba(179,32,42,.38), inset 0 1px 0 rgba(255,255,255,.25); }
.sb-tombol:active { transform: scale(.98); }
.sb-kaki { margin-top: 14px; font-size: 12.5px; color: #8a7f7d; }
@media (prefers-reduced-motion: reduce) { .sb-jalur { animation: none !important; } }
@media (prefers-reduced-motion: no-preference) { .sb-f { animation: sb-muncul .5s both; } .sb-f:nth-child(2) { animation-delay: .08s; } .sb-f:nth-child(3) { animation-delay: .16s; } .sb-f:nth-child(4) { animation-delay: .24s; } @keyframes sb-muncul { from { opacity: 0; transform: translateY(14px); } } }

/* ---------- 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); }
