/* Pasar Warga - satu kolom untuk HP, grid melebar di layar besar. */
:root {
  --bg: #faf5f5;
  --surface: #ffffff;
  --surface-2: #f4ecec;
  --ink: #231719;
  --ink-soft: #66575a;
  --line: #ead9dc;
  --brand: #9b1c31;
  --brand-deep: #6e1222;
  --brand-ink: #ffffff;
  --brand-soft: #f8e3e7;
  --accent: #c2410c;
  --wa: #128c4b;
  --wa-ink: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff4dc;
  --warn-ink: #6b4500;
  --shadow: 0 6px 20px rgba(60, 20, 28, 0.08);
  --radius: 14px;
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}

/* Tema gelap: hanya jika pengguna memilihnya di menu Saya (atau "Ikuti HP"). */
:root[data-theme="dark"] {
  --bg: #141012;
  --surface: #1e181a;
  --surface-2: #282023;
  --ink: #f1e9eb;
  --ink-soft: #b8a9ad;
  --line: #3a2e32;
  --brand: #e57388;
  --brand-deep: #f4a3b1;
  --brand-ink: #2a0710;
  --brand-soft: #3d1820;
  --accent: #ff8a4c;
  --wa: #2fbf71;
  --wa-ink: #04220f;
  --danger: #ff8a80;
  --danger-soft: #3a1d1a;
  --warn-soft: #3a2f16;
  --warn-ink: #f5d48a;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Bilah atas ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--brand); color: var(--brand-ink);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.mode-badge {
  font-size: .8rem; font-weight: 700; text-decoration: none;
  background: var(--warn-soft); color: var(--warn-ink);
  padding: 4px 10px; border-radius: 999px;
}

main { max-width: 1040px; margin: 0 auto; padding: 16px; outline: none; }

/* ---------- Menu bawah ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-soft); text-decoration: none; font-size: .75rem; font-weight: 600;
}
.bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav a[aria-current="page"] { color: var(--brand); }
.bottomnav a[aria-current="page"] svg { fill: var(--brand-soft); }
.bottomnav .nav-sell svg {
  width: 40px; height: 40px; padding: 8px; margin-top: -14px;
  background: var(--accent); color: #fff; border-radius: 50%; stroke-width: 3;
  box-shadow: var(--shadow);
}
.bottomnav .nav-sell[aria-current="page"] svg { fill: none; }
.bottomnav .nav-sell span { color: var(--accent); }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--surface-2); color: var(--ink);
}
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.wa { background: var(--wa); color: var(--wa-ink); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: .9rem; }

/* ---------- Beranda ---------- */
.search { position: relative; }
.search input {
  width: 100%; height: 50px; padding: 0 16px 0 46px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow); font-size: 1rem;
}
.search svg { position: absolute; left: 14px; top: 13px; width: 24px; height: 24px; fill: none; stroke: var(--ink-soft); stroke-width: 2; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 8px 0 4px; }
.filters label { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-soft); }
.filters select, .filters input[type="text"] {
  height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.filters input[type="text"] { width: 150px; }
.count { color: var(--ink-soft); font-size: .9rem; margin: 6px 0 10px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

.card { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-link { display: block; color: inherit; text-decoration: none; }
.card.sold .thumb img, .card.sold .thumb .ph { filter: grayscale(1); opacity: .6; }
.card-body { padding: 10px 12px 12px; }
.price { font-weight: 800; color: var(--accent); margin: 0; font-size: 1.05rem; }
.card .title { font-size: .95rem; font-weight: 600; margin: 2px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.meta { color: var(--ink-soft); font-size: .8rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thumb { position: relative; aspect-ratio: 1; background: hsl(var(--h, 160) 45% 88%); }
:root[data-theme="dark"] .thumb { background: hsl(var(--h, 160) 25% 22%); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 3rem; }
.badge { position: absolute; left: 8px; padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 800; }
.sold-badge { top: 8px; background: #1b1b1b; color: #fff; }
.new-badge { bottom: 8px; background: var(--brand); color: var(--brand-ink); }
.demo-badge { top: 8px; left: auto; right: 48px; background: var(--warn-soft); color: var(--warn-ink); }

.fav {
  position: absolute; top: 6px; right: 6px; width: 38px; height: 38px;
  display: grid; place-items: center; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: #3a3a3a; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.fav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav[aria-pressed="true"] { color: #e0245e; }
.fav[aria-pressed="true"] svg { fill: currentColor; }

.more { display: flex; justify-content: center; margin: 18px 0; }

.empty { text-align: center; padding: 40px 16px; color: var(--ink-soft); }
.empty .big { font-size: 3rem; display: block; margin-bottom: 8px; }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- Kerangka pemuatan ---------- */
.skeleton { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.skeleton .sk-img { aspect-ratio: 1; background: var(--surface-2); }
.skeleton .sk-line { height: 12px; margin: 12px; border-radius: 6px; background: var(--surface-2); }
.skeleton .sk-line.short { width: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton .sk-img, .skeleton .sk-line { animation: pulse 1.2s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Detail ---------- */
.detail { display: grid; gap: 16px; }
@media (min-width: 860px) { .detail { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.gallery-wrap { position: relative; margin: -16px -16px 0; }
@media (min-width: 860px) { .gallery-wrap { margin: 0; border-radius: var(--radius); overflow: hidden; } }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #111; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img, .gallery .thumb { flex: none; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; scroll-snap-align: center; }
.gallery .thumb .ph { font-size: 5rem; }
.gal-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0, 0, 0, .65); color: #fff; padding: 2px 10px; border-radius: 999px; font-size: .85rem; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); color: #fff; font-size: 1.4rem; cursor: pointer; }
.gal-nav.prev { left: 10px; }
.gal-nav.next { right: 10px; }

.panel { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 12px; }
.detail .price { font-size: 1.6rem; }
.detail h1 { margin: 4px 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.tag.sold { background: #1b1b1b; color: #fff; }
.tag.hidden { background: var(--danger-soft); color: var(--danger); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .95rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.actions.row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.seller { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; background: var(--brand-soft); color: var(--brand-deep); flex: none; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); font-size: .92rem; }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.muted { color: var(--ink-soft); font-size: .9rem; }

/* ---------- Formulir ---------- */
.form { max-width: 640px; margin: 0 auto; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .label, fieldset legend { font-weight: 700; }
.field small, .hint { color: var(--ink-soft); font-size: .85rem; font-weight: 400; }
.field input[type="text"], .field input[type="tel"], .field input[type="password"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.field textarea { min-height: 130px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field .err { color: var(--danger); font-size: .85rem; font-weight: 600; }
.field .err:empty { display: none; }
fieldset { border: 0; margin: 0; padding: 0; }
.radios { display: flex; gap: 10px; flex-wrap: wrap; }
.radios label {
  flex: 1; min-width: 110px; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 600;
}
.radios label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radios input, .check input { width: 20px; height: 20px; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.price-input { position: relative; }
.price-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--ink-soft); }
.price-input input { padding-left: 46px !important; font-weight: 700; }
.counter { text-align: right; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 8px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .rm { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.photo-tile .cover { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: .72rem; text-align: center; padding: 2px; font-weight: 700; }
.photo-tile .mv { position: absolute; left: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: #222; cursor: pointer; font-size: .8rem; }
.add-photo {
  aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface);
  display: grid; place-items: center; align-content: center; gap: 4px; cursor: pointer; color: var(--ink-soft); font-weight: 600; font-size: .85rem;
}
.add-photo svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; }
.form-error:empty { display: none; }
.form-error { margin: 0; }

/* ---------- Halaman Saya ---------- */
.stack { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.stack h2 { margin-bottom: 10px; }
.mine { display: grid; gap: 10px; }
.mine-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.mine-row .thumb { width: 72px; border-radius: 10px; overflow: hidden; }
.mine-row .ph { font-size: 1.8rem; }
.mine-row h3 { font-size: .98rem; }
.mine-row h3 a { color: inherit; text-decoration: none; }
.mine-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; grid-column: 1 / -1; }
.inline-form { display: grid; gap: 12px; }
.tips { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.tips li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.tips .ic { font-size: 1.6rem; line-height: 1.3; text-align: center; }
.tips strong { display: block; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 440px); padding: 12px 18px; border-radius: 12px;
  background: #1d2925; color: #fff; font-weight: 600; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
:root[data-theme="dark"] .toast.error { color: #2a0703; }

/* ---------- Pesan ---------- */
.nav-icon { position: relative; display: inline-flex; }
.nav-badge {
  position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800;
  display: grid; place-items: center; line-height: 1;
}
.inbox { display: grid; gap: 8px; }
.inbox-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
}
.inbox-row .thumb { width: 56px; border-radius: 10px; overflow: hidden; }
.inbox-row .ph { font-size: 1.6rem; }
.inbox-main { min-width: 0; }
.inbox-top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-sub, .inbox-last { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-last { color: var(--ink-soft); }
.inbox-row.unread .inbox-last { color: var(--ink); font-weight: 700; }
.unread-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.role-tag { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); }

.chat { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; position: sticky; top: 58px; z-index: 10; }
.chat-listing { flex: 1; min-width: 0; display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.chat-listing .thumb { width: 48px; border-radius: 10px; overflow: hidden; }
.chat-listing .ph { font-size: 1.4rem; }
.chat-listing .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-start { width: 48px; padding: 0; font-size: 1.3rem; flex: none; }
.meet { display: grid; gap: 8px; border: 2px solid var(--brand); }
.meet-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.meet .muted { margin: 0; }
.meet-hint { text-align: center; margin: 4px 0; }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; min-height: 30vh; }
.msg { max-width: 82%; padding: 8px 12px 6px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.msg p { margin: 0; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: var(--brand-soft); border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-time { display: block; text-align: right; font-size: .72rem; color: var(--ink-soft); margin-top: 2px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-system { align-self: center; text-align: center; font-size: .85rem; padding: 6px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); max-width: 92%; }
.composer {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 10;
  display: grid; gap: 8px; padding: 10px 0; background: var(--bg);
}
.tools { display: flex; gap: 8px; overflow-x: auto; }
.tools .btn { flex: none; background: var(--surface); }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1; min-height: 46px; max-height: 140px; resize: none; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}

/* ---------- Layar telepon ---------- */
.call-screen {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 32px);
  background: linear-gradient(180deg, #6e1222, #2a0710); color: #fff; text-align: center;
}
.call-screen[hidden] { display: none; }
.call-avatar { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; font-size: 3rem; font-weight: 800; background: rgba(255, 255, 255, .15); margin-bottom: 8px; }
.call-screen h2 { font-size: 1.6rem; }
.call-screen p { margin: 0; opacity: .9; }
.call-note { font-size: .85rem; opacity: .7 !important; }
.call-btns { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; justify-content: center; }
.call-btn { min-width: 110px; min-height: 56px; padding: 0 20px; border-radius: 999px; border: 0; font-weight: 800; font-size: 1rem; cursor: pointer; background: rgba(255, 255, 255, .18); color: #fff; }
.call-btn.accept { background: #1f9d55; }
.call-btn.end { background: #d92d20; }
.call-btn[aria-pressed="true"] { background: #fff; color: #2a0710; }
@media (prefers-reduced-motion: no-preference) {
  .call-avatar { animation: pulse 1.6s ease-in-out infinite; }
}
.chat-listing > div { min-width: 0; }

/* ---------- Pembayaran ---------- */
.pay { display: grid; gap: 10px; border: 2px solid var(--accent); }
.pay.pay-cek { border-color: #c98a00; }
.pay.pay-lunas { border-color: var(--brand); }
.pay-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.pay-top strong { font-size: 1.1rem; }
.pay-chip { flex: none; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); }
.pay-cek .pay-chip { background: var(--warn-soft); color: var(--warn-ink); }
.pay-lunas .pay-chip { background: var(--brand-soft); color: var(--brand-deep); }
.pay .desc, .pay p { margin: 0; }
.pay-methods { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pay-methods li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.pay-pick { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.pay-pick input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .03em; }
.qris-item { flex-direction: column; align-items: stretch !important; }
.qris-img { width: 100%; max-width: 260px; margin: 6px auto 0; border-radius: 10px; background: #fff; padding: 6px; }
.qris-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #fff; }
.proof-img { max-width: 220px; max-height: 260px; object-fit: cover; border-radius: 10px; margin-top: 6px; border: 1px solid var(--line); }
.pay-done { font-weight: 700; color: var(--brand-deep); }
.msg-system.pay-ok { background: var(--brand-soft); color: var(--brand-deep); }
.msg-system.pay-msg { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* ---------- Peringatan keamanan ---------- */
.warn-box { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid #e3b341; }
.warn-box ul { margin: 6px 0 8px; padding-left: 20px; }
.warn-box li { margin: 2px 0; }
.warn-box a { color: inherit; font-weight: 700; }
.warn-bar { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: .85rem; font-weight: 600; background: var(--warn-soft); color: var(--warn-ink); }
.pay-warn { padding: 10px 12px; border-radius: 10px; font-size: .9rem; background: var(--warn-soft); color: var(--warn-ink); border-left: 4px solid #e3b341; }
.scam-hint { margin-top: 6px !important; padding: 6px 8px; border-radius: 8px; font-size: .82rem; font-weight: 600; white-space: normal !important; background: var(--danger-soft); color: var(--danger); }

/* ---------- Dokumen hukum ---------- */
.legal-doc h1 { margin-bottom: 4px; }
.legal h2 { font-size: 1.05rem; margin-bottom: 6px; }
.legal p { margin: 6px 0; }
.legal ul { margin: 6px 0; padding-left: 20px; }
.legal li { margin: 4px 0; }
.check.agree { align-items: flex-start; font-size: .92rem; }
.check.agree input { margin-top: 2px; flex: none; }

/* ---------- Kamera di dalam aplikasi ---------- */
body.cam-open { overflow: hidden; }
.cam-screen { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; align-items: center; justify-content: center; }
.cam-screen[hidden] { display: none; }
.cam-screen video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam-screen video.mirror { transform: scaleX(-1); }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: camflash .25s ease-out; }
@keyframes camflash { from { opacity: .85; } to { opacity: 0; } }
.cam-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; background: linear-gradient(rgba(0,0,0,.6), transparent); color: #fff; font-weight: 700;
}
.cam-close { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 800; background: #fff; color: #111; cursor: pointer; }
.cam-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; height: calc(130px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.cam-last { grid-column: 1; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 2px solid #fff; }
.cam-shutter {
  grid-column: 2; width: 76px; height: 76px; border-radius: 50%; cursor: pointer;
  border: 5px solid #fff; background: rgba(255,255,255,.35); box-shadow: 0 0 0 3px rgba(0,0,0,.25);
}
.cam-shutter:active { background: #fff; transform: scale(.94); }
.cam-switch { grid-column: 3; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 1.4rem; cursor: pointer; }

/* ---------- Video iklan ---------- */
.video-badge { bottom: 8px; left: auto; right: 8px; background: rgba(0, 0, 0, .7); color: #fff; }
.listing-video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; margin-top: 8px; }
.video-tile { display: grid; gap: 8px; margin-top: 8px; }
.video-tile video { width: 100%; max-height: 360px; border-radius: 12px; background: #000; }
.video-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cam-shutter.video { background: #e5251b; }
.cam-shutter.video.recording { background: #e5251b; border-radius: 18px; transform: scale(.8); }

.call-sound-hint {
  margin-top: 10px; padding: 10px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: #fff; color: #2a0710; font-weight: 800;
}

/* ---------- Gerbang wilayah ---------- */
.region-tag { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
body.gated .bottomnav, body.gated #modeBadge { display: none !important; }
.gate { max-width: 520px; margin: 24px auto; display: grid; gap: 14px; text-align: center; }
.gate h1 { font-size: 1.5rem; }
.gate p { margin: 0; }
.gate .notice { text-align: left; }
.gate-icon { font-size: 3.4rem; }
.gate-status { font-weight: 700; padding: 18px 0; }
.gate-steps { text-align: left; margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.gate-admin { text-align: left; margin-top: 18px; color: var(--ink-soft); }
.gate-admin summary { cursor: pointer; font-size: .9rem; }
.gate-admin form { margin-top: 10px; }

/* ---------- Jarak ---------- */
.geo-box { display: grid; gap: 6px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); }
.geo-box p { margin: 0; }
.field > .label small { font-weight: 400; }
.gate-open { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gate-open ul { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 18px; font-size: .9rem; }
.gate-open li { break-inside: avoid; margin: 2px 0; }
.gate-open summary { cursor: pointer; }
.gate-open h3 { margin: 12px 0 0; font-size: .85rem; color: var(--brand); text-transform: uppercase; letter-spacing: .02em; }
@media (max-width: 380px) { .gate-open ul { columns: 1; } }
.radius-note { margin: -4px 0 10px; font-size: .9rem; color: var(--ink-soft); }
.radius-note .linkbtn { font-weight: 700; color: var(--brand); }
.empty .btn + .btn { margin-left: 6px; }
.pulau-badge { top: 8px; background: #0b5394; color: #fff; }
