:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #5f6b64;
  --line: #e4e2db;
  --accent: #1f7a4d;
  --accent-soft: #e3f2e9;
  --warn: #b4441c;
  --warn-soft: #fbe9e1;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo { font-weight: 800; font-size: 1.3rem; color: var(--accent); text-decoration: none; letter-spacing: -0.02em; }
nav { display: flex; gap: 16px; font-size: 0.95rem; }
nav a { color: var(--text); text-decoration: none; }
nav a:hover { color: var(--accent); }

/* hero */
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 620px; margin: 0; }

/* panel / form */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.panel h2 { margin-top: 0; font-size: 1.2rem; }
.field { margin-bottom: 18px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); cursor: pointer; font-size: 0.93rem; user-select: none;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
select, input[type="search"] {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); width: 100%;
}
.btn {
  display: inline-block; font: inherit; font-weight: 600; padding: 11px 20px; border-radius: 10px; border: 0;
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* filters */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.filters label { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 4px; }
.filters .lbl-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.filters .lbl-row label { margin-bottom: 0; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 32px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 1.05rem; }
.card .emoji { font-size: 1.6rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card.waspada { border-color: var(--warn); background: var(--warn-soft); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { font-size: 0.78rem; padding: 3px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.good { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tag.bad { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 600; }
.score { font-size: 0.8rem; font-weight: 700; color: var(--accent); }

/* detail */
.back { display: inline-block; margin: 20px 0 0; text-decoration: none; }
.detail-head { display: flex; gap: 16px; align-items: flex-start; margin: 16px 0; }
.detail-head .emoji { font-size: 3rem; line-height: 1; }
.detail-head h1 { margin: 0 0 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat .k { font-size: 0.8rem; color: var(--muted); }
.stat .v { font-weight: 700; }
.alert { border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
ol.steps li { margin-bottom: 6px; }
ul.risiko { margin: 0; padding-left: 20px; }
ul.risiko li + li { margin-top: 8px; }
ul.risiko .lapor { margin-top: 4px; font-size: 0.86rem; color: var(--text); }
.alert.warn .tip { color: var(--warn); }

/* judul bagian + ikon edit */
h2.sec { display: flex; align-items: center; gap: 8px; }
.edit-link {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 8px; color: var(--muted); text-decoration: none; flex-shrink: 0;
}
.edit-link:hover, .edit-link:focus-visible { color: var(--accent); background: var(--accent-soft); }

/* pembeli */
.buyers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 12px; }
.buyer { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.buyer-who { font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.buyer-where { font-size: 0.92rem; color: var(--muted); }

/* kompetitor */
ul.kompetitor { padding-left: 20px; }
ul.kompetitor li + li { margin-top: 8px; }
.panel.empty-cta { border-style: dashed; }
.panel.empty-cta p { margin: 0 0 6px; }

/* tanya jawab */
.faq { display: grid; gap: 8px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.faq-item summary { font-weight: 700; cursor: pointer; }
.faq-item[open] summary { margin-bottom: 6px; }
.faq-a p { margin: 0 0 4px; }
.faq-sub { font-size: 1rem; margin: 18px 0 4px; }
ul.faq-open { padding-left: 20px; }
ul.faq-open li + li { margin-top: 6px; }
ul.faq-open a { white-space: nowrap; margin-left: 4px; }

/* cerita, visi, misi (halaman tentang) */
.panel.story p { font-size: 1.04rem; }
.persona { margin: 20px 0 0; padding: 16px 18px; background: var(--bg); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; }
.persona p { margin: 0 0 10px; font-style: italic; }
.persona figcaption { font-size: 0.82rem; color: var(--muted); }
.visi { font-size: 1.12rem; font-weight: 600; line-height: 1.5; margin: 0 0 20px; }
ol.misi li { margin-bottom: 8px; }
.closing { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.refs { margin-top: 14px; }
sup a { text-decoration: none; font-weight: 700; padding: 0 1px; }

/* halaman sumber */
.quote { margin: 0 0 20px; padding: 14px 18px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
.sources { display: grid; gap: 12px; margin-bottom: 16px; }
.panel.source { margin: 0; }
.panel.source h3 { margin: 0 0 4px; font-size: 1rem; }
.panel.source p { margin: 6px 0 0; }
table.buy { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.buy th, table.buy td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.buy th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.links a { margin-right: 10px; white-space: nowrap; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* menu dukung */
nav a.nav-dukung { color: var(--accent); font-weight: 600; }

/* tag tambahan */
.tag.warn { background: #fdf3dc; border-color: transparent; color: #8a5a00; font-weight: 600; }

/* tingkat bukti */
.lvl { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.lvl-1 { background: #efece4; color: #6b6457; }
.lvl-2 { background: #e5edf9; color: #2a5ea8; }
.lvl-3 { background: var(--accent-soft); color: var(--accent); }
.lvl-4 { background: var(--accent); color: #fff; }
.stat .k { display: flex; align-items: center; gap: 6px; }

/* tooltip "?": tap di HP, hover di desktop */
.tipwrap { position: relative; display: inline-flex; vertical-align: middle; }
.tip {
  position: relative; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid currentColor; background: transparent; color: var(--muted);
  font: 700 11px/1 system-ui, sans-serif; cursor: pointer;
}
.tip::after { content: ""; position: absolute; inset: -12px; } /* area tap lebih besar buat jari */
.tip:hover, .tip:focus-visible, .tipwrap.open .tip { color: var(--accent); }
.tip-pop {
  display: none; position: absolute; top: calc(100% + 8px); left: -12px; z-index: 30;
  width: 250px; max-width: calc(100vw - 16px);
  background: var(--text); color: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: 0.82rem; font-weight: 400; line-height: 1.45; text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.tip-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* jembatan hover */
.tip-pop strong, .tip-pop span, .tip-pop a { display: block; }
.tip-pop strong { margin-bottom: 2px; }
.tip-pop span { margin-top: 4px; }
.tip-pop a { color: #9fe0bd; margin-top: 6px; }
.tip-pop span a { display: inline; margin: 0; }
.tipwrap.open .tip-pop { display: block; }
@media (hover: hover) { .tipwrap:hover .tip-pop { display: block; } }

/* halaman cara menilai */
ul.defs { list-style: none; padding: 0; }
ul.defs li { margin-bottom: 10px; }
td ul.defs { margin: 6px 0 4px; }
td ul.defs li { margin-bottom: 2px; }

/* halaman dukung */
.donate { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.btn.disabled { background: var(--line); color: var(--muted); cursor: default; }
.btn.disabled:hover { filter: none; }
.vendor-cta { font-size: 0.9rem; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.small { font-size: 0.85rem; }
.rencana { display: grid; gap: 4px; }
.rencana-item { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.rencana-item:first-child { border-top: 0; padding-top: 4px; }
.rencana-icon { font-size: 1.6rem; line-height: 1.2; }
.rencana-item h3 { margin: 0 0 4px; font-size: 1.02rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rencana-item p { margin: 0 0 4px; }
.rencana-cta { background: var(--accent-soft); border-radius: 10px; padding: 14px; border-top: 0; margin-top: 8px; }
.rencana-cta .actions { margin: 10px 0 0; }
.tag.status-prioritas { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 600; }
.tag.status-berjalan { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.tag.status-selesai { background: var(--accent); border-color: transparent; color: #fff; }
#laporan h3 { font-size: 1rem; margin: 20px 0 8px; }
td.in { color: var(--accent); font-weight: 600; white-space: nowrap; }
td.out { color: var(--warn); font-weight: 600; white-space: nowrap; }

.footer { border-top: 1px solid var(--line); padding: 24px 0; margin-top: 40px; font-size: 0.9rem; }
.footer p { margin: 4px 0; }

@media (max-width: 560px) {
  nav { gap: 12px; font-size: 0.88rem; }
  nav a:first-child { display: none; } /* logo sudah ke halaman jelajah */
  nav .long { display: none; }
  .donate { grid-template-columns: 1fr; }
  .detail-head .emoji { font-size: 2.4rem; }
  .links a { display: block; margin: 0 0 4px; }
}

/* jenis sumber + peringatan */
.tip-pop .src-warn { display: block; font-style: normal; color: #f5c97a; font-size: 0.78rem; margin-top: 2px; }
ul.src-warns { margin: 0 0 8px; padding: 0; list-style: none; font-size: 0.86rem; color: var(--warn); }
ul.src-warns li + li { margin-top: 2px; }
table.buy .tag { white-space: nowrap; }

/* skor bukti per ide */
.skor { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.skor strong { color: var(--text); }
.skor-bar { position: relative; display: inline-block; width: 56px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.skor-bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.skor-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
