:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #eeebe3;
  --text: #16202f;
  --muted: #5b6573;
  --line: #dcd8ce;
  --ink: #12203a;
  --ink-2: #1c2f52;
  --on-ink: #f4f1ea;
  --on-ink-muted: #b4bccb;
  --brass: #e0ae4b;
  --accent: #1c3a6e;
  --accent-text: #ffffff;
  --link: #1c4a8f;
  --high: #a32a22;
  --high-bg: #fae6e3;
  --mid: #80530a;
  --mid-bg: #fbf0d6;
  --low: #35566f;
  --low-bg: #e3ecf3;
  --ok: #17614f;
  --ok-bg: #dff0ea;
  --shadow: 0 1px 2px rgba(18, 32, 58, .06), 0 6px 18px rgba(18, 32, 58, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1522;
    --surface: #182233;
    --surface-2: #232f44;
    --text: #e9ecf1;
    --muted: #a3adbd;
    --line: #2f3c52;
    --ink: #0a111d;
    --ink-2: #16233b;
    --accent: #e0ae4b;
    --accent-text: #1a1305;
    --link: #8fb8f2;
    --high: #ff9d94;
    --high-bg: #47201d;
    --mid: #eec26a;
    --mid-bg: #40321a;
    --low: #a8c6dd;
    --low-bg: #24323d;
    --ok: #7fd8bf;
    --ok-bg: #1d3a32;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 24px; background: var(--ink); color: var(--on-ink); border-bottom: 2px solid var(--brass); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--on-ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.save-state { margin-left: auto; color: var(--on-ink-muted); font-size: 13px; }
.save-state.error { color: #ffb4ac; font-weight: 600; }
.account { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 13px; }
.account .muted { color: var(--on-ink-muted); }
.account a, .account button.link { color: var(--on-ink); }
.demo-banner { background: var(--mid-bg); color: var(--mid); text-align: center; font-size: 13px; font-weight: 600; padding: 6px 16px; }

main { max-width: 1160px; margin: 0 auto; padding: 28px 24px 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

button, .button { font: inherit; font-size: 14px; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; transition: background .12s, border-color .12s; }
button:hover, .button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover { background: var(--accent); filter: brightness(1.15); }
button.danger { color: var(--high); }
button.link { border: 0; background: none; padding: 0; color: var(--link); text-align: left; text-decoration: underline; }
button.link:hover { background: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); margin-top: 12px; }
.auth-hero { background: linear-gradient(155deg, var(--ink-2), var(--ink)); color: var(--on-ink); padding: 40px; display: flex; flex-direction: column; gap: 18px; min-height: 480px; }
.auth-tagline { font-family: var(--serif); font-size: 30px; line-height: 1.2; margin: 6px 0 0; }
.auth-hero img.hero-graph { width: 100%; max-width: 420px; margin-top: auto; opacity: .95; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--on-ink-muted); font-size: 14px; }
.auth-points li { padding-left: 18px; position: relative; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }
.auth-form { padding: 40px; align-self: center; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form button[type=submit] { width: 100%; padding: 10px; margin-top: 4px; }
.auth-card { max-width: 420px; margin: 48px auto; padding: 28px; }
.auth-card h1 { margin-bottom: 6px; }
.form-error { color: var(--high); font-size: 13px; margin: 0 0 10px; }
.temp-password { font-family: ui-monospace, Menlo, monospace; font-size: 16px; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; overflow-wrap: anywhere; user-select: all; }

.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.case-row { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; border-top: 3px solid var(--ink-2); transition: transform .12s, border-color .12s; }
.case-row:hover { border-color: var(--brass); transform: translateY(-2px); }
.case-row strong { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.3; font-weight: 600; }
.case-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; }
.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.empty img { width: 56px; height: 56px; margin-bottom: 12px; }
.empty p { margin: 0 0 14px; color: var(--muted); }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
@media (min-width: 760px) { .tabs { flex-wrap: wrap; overflow-x: visible; } }
.tabs a { padding: 9px 12px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; font-size: 14px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--brass); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.section-gap { margin-top: 18px; }

.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; }
input, textarea, select { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); }
textarea { min-height: 84px; resize: vertical; }
.checks { display: grid; gap: 4px; max-height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; padding: 8px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.checks input { width: auto; }
.hint { font-size: 12px; color: var(--muted); }

.item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.item-body { min-width: 0; overflow-wrap: anywhere; }
.item-body p { margin: 4px 0 0; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.source { font-size: 13px; color: var(--muted); }
.source.missing { color: var(--mid); }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.tinggi, .pill.kosong { background: var(--high-bg); color: var(--high); }
.pill.sedang, .pill.kurang { background: var(--mid-bg); color: var(--mid); }
.pill.rendah { background: var(--low-bg); color: var(--low); }
.pill.cukup { background: var(--ok-bg); color: var(--ok); }
.pill.netral { background: var(--surface-2); color: var(--muted); }

.weak { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.weak:first-of-type { border-top: 0; }
.weak > .pill { width: 62px; text-align: center; flex-shrink: 0; }
.weak-body { overflow-wrap: anywhere; min-width: 0; }

.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 20px; display: grid; gap: 12px; }
.timeline .card { position: relative; }
.timeline .card::before { content: ""; position: absolute; left: -27px; top: 21px; width: 11px; height: 11px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px var(--bg); }

.scroll { overflow-x: auto; }
.matrix { border-collapse: collapse; width: 100%; font-size: 14px; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: middle; }
.matrix thead th { background: var(--surface-2); font-size: 13px; font-weight: 600; }
.matrix .unsur-col { min-width: 220px; }
.matrix .bukti-col { min-width: 96px; max-width: 130px; text-align: center; overflow-wrap: anywhere; }
.matrix td.cell { text-align: center; }
.matrix td.cell input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
.matrix th.disputed { color: var(--mid); }
.audit-table { font-size: 13px; }
.audit-table td { overflow-wrap: anywhere; }

.graph-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: auto; box-shadow: var(--shadow); }
.graph-wrap svg { display: block; }
.node rect { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.2; }
.node text { fill: var(--text); font-size: 12px; }
.node { cursor: pointer; }
.node.pihak rect { fill: var(--low-bg); stroke: var(--low); }
.node.peristiwa rect { stroke: var(--muted); }
.node.bukti rect { fill: var(--ok-bg); stroke: var(--ok); }
.node.unsur rect { fill: var(--mid-bg); stroke: var(--mid); }
.node.flag rect { fill: var(--high-bg); stroke: var(--high); }
.node.dim { opacity: .25; }
.edge { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .55; }
.edge.dim { opacity: .08; }
.edge.on { stroke: var(--accent); stroke-width: 2; opacity: 1; }
.col-title { fill: var(--muted); font-size: 12px; font-weight: 600; }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(12, 20, 36, .55); }
dialog form { padding: 18px 20px; }
dialog h2 { margin-bottom: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.law-transition { background: var(--mid-bg); color: var(--mid); padding: 7px 11px; border-radius: 7px; margin: 0 0 8px; }
.law-results { max-height: 45vh; overflow: auto; }
.law-row { display: block; width: 100%; text-align: left; }
.law-snippet { display: block; overflow-wrap: anywhere; font-weight: 400; }
.law-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; font-family: var(--serif); font-size: 15px; line-height: 1.6; }
.law-bunyi { margin-bottom: 10px; }

.report { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.report h1 { margin-bottom: 4px; }
.report h2 { margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.report h3 { margin: 12px 0 6px; }
.report .report-title { margin-top: 0; border-bottom: 0; }
.report table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report th, .report td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; }
.report th { background: var(--surface-2); }

@media (max-width: 860px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { min-height: 0; padding: 24px; }
  .auth-tagline { font-size: 23px; }
  .auth-hero img.hero-graph, .auth-points { display: none; }
  .auth-form { padding: 24px; }
}
@media (max-width: 760px) {
  main { padding: 18px 16px 48px; }
  .topbar { padding: 10px 16px; }
  .account .muted { display: none; }
  h1 { font-size: 24px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .item { flex-direction: column; }
  .report { padding: 14px; }
  .report table { display: block; overflow-x: auto; }
}
.kv { margin-bottom: 14px; }
.kv:last-child { margin-bottom: 0; }
.kv h3 { margin: 0 0 3px; }
.kv p { margin: 0; }

@media print {
  .topbar, .demo-banner, .tabs, .page-head, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .report { border: 0; padding: 0; background: #fff; box-shadow: none; }
  .report th { background: #eee; }
  .report th, .report td { border-color: #888; }
}
