:root {
  --coklat: #5b3a1e; --coklat-tua: #3f2814; --lurik: #7a4f2b; --krim: #fff4dc;
  --kertas: #fffaf0; --hijau: #2f8f4e; --merah: #c4302b; --teks: #2e1f12;
  --huruf: "Arial Rounded MT Bold", "Nunito", ui-rounded, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--huruf); color: var(--teks);
  background: #bfe6f6 linear-gradient(#9fd9f2, #e4f5fb 55%, #a8d98a 55.1%, #8cc764);
  background-attachment: fixed;
}
.atas {
  display: flex; align-items: baseline; gap: 10px; padding: 14px 16px;
  background: repeating-linear-gradient(90deg, #7a4f2b 0 14px, #8e6036 14px 28px);
  border-bottom: 5px solid var(--coklat-tua); color: #fff;
}
.merek { color: #fff; text-decoration: none; font-weight: 900; font-size: 1.35rem; letter-spacing: .02em; }
.sub { color: #ffe8b8; font-weight: 800; }
main { max-width: 640px; margin: 0 auto; padding: 18px 16px 8px; outline: none; }
.muat { text-align: center; font-weight: 800; color: var(--coklat); }
.kartu-besar {
  background: var(--kertas); border: 4px solid var(--coklat-tua); border-radius: 24px;
  padding: 20px 18px 22px; box-shadow: 0 6px 0 var(--coklat-tua);
}
h1, h2 { margin: 0 0 12px; color: var(--coklat); line-height: 1.1; }
h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
h2 { font-size: 1.6rem; }
.lead { font-size: 1.05rem; line-height: 1.5; }
.hitung { font-weight: 900; font-size: 1.15rem; color: var(--hijau); }
.hitung span { font-size: 1.6rem; }
.profesi-rekap { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.profesi-rekap li { background: var(--krim); border: 2px solid #e2c99a; border-radius: 999px; padding: 4px 10px; font-size: .9rem; }
.ktp { display: block; width: 100%; height: auto; margin: 4px 0 16px; border-radius: 14px; }
form { display: grid; gap: 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, label { font-weight: 800; color: var(--coklat); }
label { display: grid; gap: 6px; }
small, .kecil { font-weight: 600; color: #8a6a4a; font-size: .85rem; }
input[type=text], input:not([type]), input[name] {
  font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 14px;
  border: 3px solid #d9bd8c; background: #fff; color: var(--teks); width: 100%;
}
input:focus-visible { outline: 3px solid #3b7dd8; outline-offset: 1px; border-color: var(--coklat); }
.pilih-baris, .pilih-grid, .pilih-warna { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pilih-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pilih-baris input, .pilih-grid input, .pilih-warna input { position: absolute; opacity: 0; pointer-events: none; }
.chip {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  padding: 8px 14px; border-radius: 14px; border: 3px solid #d9bd8c; background: #fff; cursor: pointer; font-weight: 800;
}
input:checked + .chip { border-color: var(--coklat-tua); background: #ffe2a8; box-shadow: 0 3px 0 var(--coklat-tua); }
input:focus-visible + .chip { outline: 3px solid #3b7dd8; outline-offset: 2px; }
.pilih-warna .chip { padding: 5px; border-radius: 999px; min-height: 0; }
.bulatan { display: block; width: 34px; height: 34px; border-radius: 50%; }
.centang { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; }
.centang input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--coklat); }
.tombol-tumpuk { display: grid; gap: 10px; margin-top: 8px; }
.tombol {
  display: block; text-align: center; font: inherit; font-weight: 900; font-size: 1.05rem; text-decoration: none;
  padding: 13px 18px; border-radius: 16px; border: 3px solid var(--coklat-tua); background: #fff; color: var(--coklat);
  box-shadow: 0 4px 0 var(--coklat-tua); cursor: pointer;
}
.tombol:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--coklat-tua); }
.tombol.utama { background: #f2a33a; color: #2e1f12; }
.tombol.merah { background: var(--merah); color: #fff; }
.tombol:disabled { opacity: .5; cursor: not-allowed; }
.galat:empty, .info:empty { display: none; }
.galat { margin: 0; color: var(--merah); font-weight: 800; }
.info { font-weight: 800; color: var(--hijau); word-break: break-all; }
.kode-kotak { background: #fff1c9; border: 3px dashed var(--coklat); border-radius: 18px; padding: 14px; margin-bottom: 14px; }
.kode { font-size: clamp(1.5rem, 7vw, 2.2rem); font-weight: 900; text-align: center; letter-spacing: .04em;
  background: #fff; border-radius: 12px; padding: 12px 6px; margin: 10px 0; user-select: all; word-break: break-word; }
.bahaya { margin-top: 6px; }
.bahaya summary { cursor: pointer; font-weight: 800; color: #8a6a4a; padding: 8px 0; }
.bahaya .pilih-baris { display: grid; }
.turnstile { min-height: 65px; }
.bawah { max-width: 640px; margin: 10px auto 30px; padding: 0 16px; font-size: .85rem; color: #2e4a1f; font-weight: 700; line-height: 1.45; }

/* ---------- Obrolan desa ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-kepala { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chat-kepala .pilih-baris { margin: 0; }
.chat-kepala .chip { text-decoration: none; color: var(--coklat); }
.chip.terpilih { border-color: var(--coklat-tua); background: #ffe2a8; box-shadow: 0 3px 0 var(--coklat-tua); }
.online { font-weight: 800; color: var(--hijau); font-size: .9rem; }
.online::before { content: "● "; }
.aturan { background: #fff1c9; border: 2px dashed #c9a46a; border-radius: 14px; padding: 6px 12px; font-size: .9rem; }
.aturan summary { cursor: pointer; font-weight: 900; color: var(--coklat); padding: 4px 0; }
.aturan ul { margin: 4px 0 6px; padding-left: 18px; line-height: 1.45; }
.pesan-daftar {
  list-style: none; margin: 0; padding: 8px; height: min(58vh, 520px); overflow-y: auto;
  background: #fff; border: 3px solid #d9bd8c; border-radius: 16px; display: flex; flex-direction: column; gap: 8px;
  overscroll-behavior: contain;
}
.pesan-daftar li { position: relative; background: var(--krim); border-radius: 14px; padding: 8px 10px; max-width: 92%; align-self: flex-start; }
.pesan-daftar li.milik-saya { background: #dff3d3; align-self: flex-end; }
.pesan-daftar li.kosong { background: none; color: #8a6a4a; font-weight: 700; align-self: center; }
.pesan-kepala { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; }
.titik { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.nama { font-weight: 900; color: var(--coklat); text-decoration: none; }
.akun { color: #8a6a4a; font-weight: 700; overflow-wrap: anywhere; }
.teks { margin: 4px 0 0; overflow-wrap: anywhere; line-height: 1.4; font-weight: 600; }
.teks.tersembunyi { color: #8a6a4a; font-style: italic; margin: 0; }
.menu-pesan { margin-left: auto; position: relative; }
.menu-pesan summary { list-style: none; cursor: pointer; font-weight: 900; padding: 0 8px; border-radius: 8px; color: #8a6a4a; }
.menu-pesan summary::-webkit-details-marker { display: none; }
.menu-isi { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; gap: 4px; padding: 6px;
  background: #fff; border: 2px solid var(--coklat-tua); border-radius: 12px; box-shadow: 0 4px 0 var(--coklat-tua); width: max-content; }
.menu-pesan button { font: inherit; font-weight: 800; font-size: .85rem; text-align: left; padding: 8px 10px; border-radius: 10px;
  border: 2px solid #d9bd8c; background: #fff; color: var(--coklat); cursor: pointer; }
.kirim { display: flex; gap: 8px; }
.kirim input { flex: 1; min-width: 0; }
.kirim .tombol { padding: 12px 16px; }
.ganti-kode { margin-top: 8px; gap: 12px; }
.ganti-kode input[type=password] { font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 14px; border: 3px solid #d9bd8c; background: #fff; width: 100%; }
