:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d2320;
  --muted: #5b655f;
  --line: #e2e0d9;
  --brand: #0f6b4f;
  --brand-soft: #e3f1ea;
  --pusat: #1f4fa3;
  --pusat-soft: #e6edf9;
  --daerah: #9a4b00;
  --daerah-soft: #fbeedd;
  --ok: #0f6b4f;
  --ok-soft: #e3f1ea;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --bad: #a3261d;
  --bad-soft: #fde9e7;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514;
    --surface: #1b201e;
    --text: #e9ece9;
    --muted: #a2aba6;
    --line: #2e3532;
    --brand: #5cc79f;
    --brand-soft: #1b3229;
    --pusat: #8fb1f0;
    --pusat-soft: #1c2638;
    --daerah: #f0b46e;
    --daerah-soft: #35261a;
    --ok: #5cc79f;
    --ok-soft: #1b3229;
    --warn: #f0c75c;
    --warn-soft: #332a14;
    --bad: #f28b82;
    --bad-soft: #3a1d1b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0.4em 0; }
h2 { font-size: 1.25rem; margin-top: 1.8em; }
h3 { font-size: 1.05rem; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Kepala dan navigasi */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.logo span { color: var(--brand); }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

main { padding: 16px 0 40px; }

/* Kotak umum */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.lead { font-size: 1.05rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.note { border-radius: var(--radius); padding: 12px 14px; margin: 16px 0; font-size: 0.95rem; }
.note-warn { background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn); }
.note-info { background: var(--brand-soft); border-left: 4px solid var(--brand); }

/* Label Pusat/Daerah */
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.tag-pusat { background: var(--pusat-soft); color: var(--pusat); }
.tag-daerah { background: var(--daerah-soft); color: var(--daerah); }
.tag-soon { background: var(--line); color: var(--muted); }
.tag-draf { background: var(--warn-soft); color: var(--warn); }

/* Peta Pajak */
.peta-grup { margin: 24px 0; }
.peta-grup h2 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.peta-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.peta-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); min-height: 56px; }
a.peta-item:hover { border-color: var(--brand); }
.peta-item .nama { font-weight: 600; }
.peta-item .ket { display: block; font-size: 0.88rem; color: var(--muted); font-weight: 400; }
.peta-item .tags { display: flex; gap: 4px; flex-shrink: 0; flex-direction: column; align-items: flex-end; }
.peta-item.soon { opacity: 0.75; }

.cta { display: block; background: var(--brand); color: #fff; text-decoration: none; text-align: center; font-weight: 700; padding: 14px; border-radius: var(--radius); margin: 16px 0; }
@media (prefers-color-scheme: dark) { .cta { color: #0d1a14; } }

/* Formulir */
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; margin: 16px 0; background: var(--surface); }
legend { font-weight: 700; padding: 0 6px; }
.q { margin: 14px 0; }
.q > p { margin: 0 0 6px; font-weight: 600; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label { flex: 1 1 0; min-width: 88px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; min-height: 48px; }
.choice input { accent-color: var(--brand); width: 18px; height: 18px; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.choice label:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }

.field { margin: 14px 0; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { display: block; font-size: 0.88rem; color: var(--muted); margin-bottom: 6px; font-weight: 400; }
.rp { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.rp span { padding: 0 12px; display: flex; align-items: center; color: var(--muted); border-right: 1px solid var(--line); }
.rp input, select { flex: 1; min-width: 0; border: 0; padding: 12px; font: inherit; font-size: 1.1rem; background: transparent; color: var(--text); }
select { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; }
.rp:focus-within, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.field .err { color: var(--bad); font-size: 0.9rem; margin-top: 4px; }

details { margin: 12px 0; }
summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 8px 0; }

button { font: inherit; font-weight: 700; border: 0; border-radius: var(--radius); padding: 14px 18px; cursor: pointer; width: 100%; min-height: 52px; }
.btn-primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0d1a14; } }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }

/* Hasil kalkulator */
.status { border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.status h2 { margin: 0 0 4px; }
.status-ok { background: var(--ok-soft); border-left: 6px solid var(--ok); }
.status-beda { background: var(--bad-soft); border-left: 6px solid var(--bad); }
.status-tolak { background: var(--warn-soft); border-left: 6px solid var(--warn); }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps > li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 12px 52px; margin: 8px 0; position: relative; }
.steps > li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: 0.9rem; }
.steps > li.beda { border-color: var(--bad); }
.steps .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.steps .judul { font-weight: 600; }
.steps .nilai { font-weight: 700; font-variant-numeric: tabular-nums; }
.steps .rumus { font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps .awam { font-size: 0.95rem; margin: 6px 0 0; }
.steps .banding { font-size: 0.9rem; margin-top: 6px; color: var(--bad); font-weight: 600; }

table { border-collapse: collapse; width: 100%; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; }
.table-scroll { overflow-x: auto; }

/* Kamus */
dl.kamus dt { font-weight: 700; margin-top: 18px; scroll-margin-top: 72px; }
dl.kamus dd { margin: 4px 0 0; }
.cari { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }

/* Kaki halaman */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0 32px; font-size: 0.9rem; color: var(--muted); }
.site-foot strong { color: var(--text); }

[hidden] { display: none !important; }
