/* Posko Lapak Keliling — gaya minimalis, mobile dulu */
:root {
  --ink: #17211C;
  --ink-2: #3E4641;
  --muted: #5B645E;
  --ground: #F4F4EF;
  --surface: #FFFFFF;
  --line: #DADDD3;
  --line-2: #E2E4DC;
  --accent: #F5B301;
  --accent-ink: #17211C;
  --teal: #0E6B58;
  --teal-bg: #DDEFE9;
  --teal-ink: #0B4F41;
  --warn-bg: #FFF5D6;
  --warn-ink: #5A4300;
  --bad: #B3261E;
  --radius: 18px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --aksi-tinggi: 92px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font);
  line-height: 1.45; padding-bottom: calc(var(--aksi-tinggi) + 24px + env(safe-area-inset-bottom));
}
a { color: var(--ink); }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.lewati { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 3000; }
.lewati:focus { left: 8px; }

/* ---------- kepala ---------- */
.kepala { background: var(--ground); }
.kepala-dalam { max-width: 1200px; margin: 0 auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.merek { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; background: var(--ink); color: var(--accent); display: grid; place-items: center; }
.merek-nama { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.merek-tagline { display: block; font-size: 12px; color: var(--muted); font-style: italic; }
.menu { display: flex; gap: 8px; flex-wrap: wrap; }
.menu a { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.menu a.aktif { background: var(--ink); border-color: var(--ink); color: #fff; }

.utama { max-width: 1200px; margin: 0 auto; padding: 8px 16px 0; display: flex; flex-direction: column; gap: 18px; }
.judul-bagian { margin: 0; font-size: 16px; font-weight: 700; }

/* ---------- banner ---------- */
.banner { display: flex; flex-direction: column; gap: 10px; }
.banner-jalur { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 20px; }
.banner-jalur::-webkit-scrollbar { display: none; }
.banner-kartu {
  position: relative; flex: 0 0 100%; height: 132px; border-radius: 20px; overflow: hidden; scroll-snap-align: start;
  background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 20px;
  text-decoration: none;
}
.banner-kartu img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-kartu.ada-gambar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,.65)); }
.banner-kartu .label { position: relative; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--accent); }
.banner-kartu .teks { position: relative; z-index: 1; font-size: 19px; font-weight: 700; line-height: 1.25; max-width: 32ch; }
.banner-titik { display: flex; gap: 6px; justify-content: center; }
.banner-titik button { width: 24px; height: 24px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.banner-titik button::before { content: ''; width: 7px; height: 7px; border-radius: 4px; background: #C9CCC2; transition: width .2s; }
.banner-titik button[aria-selected="true"]::before { width: 20px; background: var(--ink); }

/* ---------- tata letak ---------- */
.tata { display: flex; flex-direction: column; gap: 18px; }

/* ---------- peta ---------- */
.peta-wadah { display: flex; flex-direction: column; gap: 10px; }
.peta-kepala { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.status-lokasi { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status-lokasi.aktif { color: var(--teal); }
.status-lokasi.aktif::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: var(--teal); }
.status-lokasi.gagal { color: var(--bad); }
.peta-bingkai { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #E8EBE2; }
.peta { height: 58vh; min-height: 360px; max-height: 620px; z-index: 0; }
.chip-cari {
  position: absolute; z-index: 500; top: 12px; left: 12px; right: 64px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.chip-cari button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--ground); display: grid; place-items: center; cursor: pointer; }
.tombol-ikon { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: 0 0 44px; }
.tombol-pusat { position: absolute; z-index: 500; top: 12px; right: 12px; color: var(--teal); }

/* pin lapak (divIcon) */
.pin-lapak { background: none; border: 0; }
.pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.pin-label { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; display: flex; flex-direction: column; align-items: center; white-space: nowrap; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.pin-id { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--muted); }
.pin-jenis { font-size: 11px; font-weight: 600; color: var(--ink); max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.pin-titik { width: 28px; height: 28px; border-radius: 14px 14px 14px 2px; transform: rotate(-45deg); background: var(--ink); display: grid; place-items: center; }
.pin-titik::after { content: ''; width: 10px; height: 10px; border-radius: 5px; background: var(--accent); }
.pin.lama .pin-titik { background: #8A918C; }
.pin.dipilih .pin-label { background: var(--ink); border-color: var(--ink); }
.pin.dipilih .pin-id { color: var(--accent); }
.pin.dipilih .pin-jenis { color: #fff; }
.titik-saya { width: 18px; height: 18px; border-radius: 9px; background: var(--teal); border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(14,107,88,.18); }

/* ---------- tombol aksi ---------- */
.aksi {
  position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(244,244,239,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line-2);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.aksi-tombol {
  min-height: 72px; border-radius: 18px; border: 0; padding: 10px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 6px;
  font-size: 13px; font-weight: 700; line-height: 1.2;
}
.aksi-utama { background: var(--accent); color: var(--accent-ink); }
.aksi-gelap { background: var(--ink); color: #fff; }
.aksi-terang { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* ---------- artikel ---------- */
.artikel-wadah { display: flex; flex-direction: column; gap: 12px; }
.artikel-daftar { display: flex; flex-direction: column; gap: 12px; }
.artikel-kartu {
  display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px;
  text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%;
}
.artikel-gambar { flex: 0 0 88px; height: 88px; border-radius: 12px; background: #E8EBE2; overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.artikel-gambar img { width: 100%; height: 100%; object-fit: cover; }
.artikel-judul { font-size: 14px; font-weight: 700; line-height: 1.3; margin: 0 0 4px; }
.artikel-ringkas { font-size: 12px; color: var(--muted); margin: 0; }

.kaki { max-width: 1200px; margin: 28px auto 0; padding: 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; text-align: center; }
.kaki nav { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.kaki nav a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.kaki p { margin: 4px 0 0; }

/* ---------- sheet (pop-up) ---------- */
.lapisan { position: fixed; inset: 0; z-index: 2000; background: rgba(23,33,28,.55); }
.sheet {
  position: fixed; z-index: 2001; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: naik .22s ease-out;
}
@keyframes naik { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-pegangan { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 8px; }
.sheet-kepala { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; position: sticky; top: -10px; background: var(--surface); padding-top: 4px; z-index: 1; }
.sheet-kepala h2 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.25; }
.sheet-kepala .tombol-ikon { border: 0; background: var(--ground); border-radius: 22px; }
.sheet-isi { display: flex; flex-direction: column; gap: 16px; }

/* ---------- form ---------- */
.medan { display: flex; flex-direction: column; gap: 6px; }
.medan > label, .medan > .label, .kepala-medan label, fieldset legend { font-size: 13px; font-weight: 700; }
fieldset legend { padding: 0; }
.wajib { color: var(--bad); }
.opsional { font-weight: 500; color: var(--muted); }
.medan input[type="text"], .medan input[type="search"], .medan input:not([type]), .medan input[inputmode] {
  height: 50px; border-radius: 14px; border: 1px solid var(--line); padding: 0 14px; font: inherit; font-size: 15px; width: 100%; background: #fff; color: var(--ink);
}
.medan input:focus { border: 2px solid var(--ink); outline: none; padding: 0 13px; }
.medan input[aria-invalid="true"] { border: 2px solid var(--bad); }
.medan .bantuan { font-size: 12px; color: var(--muted); }
.medan .galat { font-size: 12px; color: var(--bad); font-weight: 600; }
.medan-baris { display: flex; gap: 8px; align-items: center; }
.awalan { height: 50px; padding: 0 12px; border-radius: 14px; background: var(--ground); display: flex; align-items: center; font-weight: 600; flex: 0 0 auto; }
.penghitung { font-size: 12px; color: var(--muted); }
.kepala-medan { display: flex; justify-content: space-between; align-items: baseline; }
fieldset { border: 0; margin: 0; padding: 0; }
.segmen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.segmen label { min-height: 50px; border-radius: 14px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 10px; text-align: center; }
.segmen input { accent-color: var(--accent); }
.segmen label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.saran { display: flex; flex-wrap: wrap; gap: 6px; }
.saran button { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 0; background: var(--ground); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }

.tombol { min-height: 54px; border-radius: 16px; border: 0; width: 100%; padding: 0 16px; font-size: 15px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.tombol[disabled] { opacity: .5; cursor: not-allowed; }
.tombol-utama { background: var(--accent); color: var(--accent-ink); letter-spacing: .3px; }
.tombol-gelap { background: var(--ink); color: #fff; }
.tombol-garis { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.tombol-teks { background: none; color: var(--ink); min-height: 44px; font-weight: 700; }

/* ---------- info ---------- */
.catatan { border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.catatan-kuning { background: var(--warn-bg); color: var(--warn-ink); }
.catatan-hijau { background: var(--teal-bg); color: var(--teal-ink); }
.catatan-abu { background: var(--ground); color: var(--ink-2); }
.catatan-merah { background: #FBE9E7; color: #7A1C14; }
.data { margin: 0; display: grid; grid-template-columns: 116px minmax(0, 1fr); row-gap: 8px; column-gap: 12px; font-size: 14px; }
.data dt { color: var(--muted); }
.data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.id-besar { font-family: var(--mono); font-weight: 700; letter-spacing: 1px; }
.lencana { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.lencana-hijau { background: var(--teal-bg); color: var(--teal-ink); }
.lencana-kuning { background: var(--warn-bg); color: #7A4F00; }
.blok-lokasi { border-radius: 16px; background: var(--ground); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.blok-lokasi .atas { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.blok-lokasi .label { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--muted); }
.blok-lokasi .waktu { font-size: 14px; font-weight: 700; }
.blok-lokasi .bawah { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.koordinat { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.tautan { font-size: 13px; font-weight: 700; color: var(--teal); }
.dua-tombol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dua-tombol .tombol { font-size: 14px; min-height: 50px; }

/* hasil barcode */
.kartu-qr { border-radius: 22px; background: var(--ink); padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kartu-qr canvas, .kartu-qr img { width: 220px; height: auto; border-radius: 14px; background: #fff; }
.kartu-qr .id-besar { color: var(--accent); font-size: 24px; }
.kartu-qr .kecil { color: #C9CCC2; font-size: 11px; letter-spacing: 1px; }

/* pemindai */
.pemindai { width: 100%; aspect-ratio: 1; max-height: 52vh; border-radius: 20px; overflow: hidden; background: #0E1411; position: relative; }
.pemindai video { object-fit: cover; }
.pemindai-pesan { position: absolute; inset: 0; display: grid; place-items: center; color: #D5D9D3; font-size: 14px; text-align: center; padding: 24px; }

/* teks halaman (markdown) */
.prosa { font-size: 15px; }
.prosa h1 { display: none; }
.prosa h2, .prosa h3 { font-size: 16px; margin: 18px 0 6px; }
.prosa p, .prosa ul, .prosa ol { margin: 0 0 12px; }
.prosa li { margin-bottom: 6px; }
.prosa blockquote { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }

/* toast */
.toast {
  position: fixed; z-index: 3000; left: 16px; right: 16px; bottom: calc(var(--aksi-tinggi) + 28px + env(safe-area-inset-bottom));
  max-width: 440px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 16px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.toast.galat { background: #7A1C14; }

/* ---------- layar lebar ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .kepala-dalam { flex-direction: row; justify-content: space-between; align-items: center; padding-top: 22px; }
  .banner-kartu { height: 150px; padding: 22px 28px; }
  .banner-kartu .teks { font-size: 24px; }
  .tata { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); grid-template-areas: "peta artikel" "aksi artikel"; gap: 18px 24px; align-items: start; }
  .peta-wadah { grid-area: peta; }
  .peta { height: 560px; max-height: none; }
  .aksi { grid-area: aksi; position: static; padding: 0; background: none; border: 0; backdrop-filter: none; }
  .aksi-tombol { min-height: 64px; flex-direction: row; align-items: center; justify-content: center; font-size: 15px; }
  .artikel-wadah { grid-area: artikel; }
  .toast { bottom: 28px; }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); border-radius: 24px; max-height: 88vh; animation: none; }
  .sheet-pegangan { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  .banner-jalur { scroll-behavior: auto; }
}
