:root {
  --bg: #efeae2;
  --ink: #1d1914;
  --muted: #5e564c;
  --faint: #8a8176;
  --line: #d4cdc2;
  --card: #fbf8f3;
  --navy: #1b3038;
  --sea: #245566;
  --clay: #8a4b32;
  --sand: #f3e6cf;
  --theory: #e4eef0;
  --prov: #f4ead4;
  --hole: #f6e7e1;
  --grey: #8d867c;
  --white: #fffcf7;
  --focus: #9a4e22;
  color-scheme: light;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button, a { font: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  background: var(--navy);
  color: #f6f1e8;
  padding: 28px 24px 22px;
}

.site-header-inner,
.nav-inner,
.wrap {
  max-width: 1080px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: #c8bfb2;
}

.site-header h1 {
  margin: 0;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
}

.subtitle { margin: 8px 0 0; font-size: 18px; color: #f0e6d6; }

.disclaimer { margin: 10px 0 0; color: #c8bfb2; font-size: 14px; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f3ec;
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 24px;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.tab[aria-current="page"] {
  background: var(--navy);
  color: #f6f1e8;
}

.tab.needs-cluster:not([aria-current="page"]) { color: var(--muted); }

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

#bacaan,
#daftar-referensi {
  scroll-margin-top: 120px;
}

.chip {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--sea);
}

main { padding: 28px 24px 64px; }

#app { display: grid; gap: 22px; }

h2, h3 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
}

h2 { font-size: 28px; margin: 0 0 8px; }
h3 { font-size: 20px; margin: 0 0 8px; }

p { margin: 0 0 12px; }

.lead { font-size: 18px; max-width: 68ch; }

.layer { display: grid; gap: 10px; }

.figure {
  margin: 0;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 40px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }

.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 28px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.markets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}

.panel.domain-a { border-top: 4px solid var(--sea); }
.panel.domain-b { border-top: 4px solid #8d7342; }
.panel.domain-c { border-top: 4px solid var(--clay); }

.kicker {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.notice {
  background: var(--sand);
  border-left: 4px solid var(--clay);
  padding: 12px 14px;
  border-radius: 8px;
}

.notice strong { display: block; margin-bottom: 4px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.scores { grid-template-columns: repeat(3, 1fr); }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.stat b,
.stat span { display: block; }

.stat b {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.sankey-figure { display: grid; gap: 12px; }
.sankey-scroll { overflow-x: auto; }
.sankey { width: 100%; height: auto; display: block; }
.sankey-box { fill: var(--white); stroke: var(--line); }
.sankey text { font-size: 14px; font-family: "Segoe UI", "Helvetica Neue", sans-serif; fill: var(--ink); }
.sankey text.sub { font-size: 11px; fill: var(--muted); }
.sankey text.col { font-size: 12px; fill: var(--sea); }
.sankey g.shell .sankey-box, .sankey g.shell-pasar .sankey-box, .sankey g.shell-total .sankey-box { fill: #e7eef0; stroke: #1b3038; stroke-width: 1.5; }
.sankey g.shell-total .sankey-box { fill: #f4f0e6; }
.sankey g.shell text, .sankey g.shell-pasar text, .sankey g.shell-total text, .sankey g.shell-supply text { fill: #1b3038; }
.sankey g.shell text.sub, .sankey g.shell-pasar text.sub, .sankey g.shell-total text.sub, .sankey g.shell-supply text.sub { fill: #245566; }
.sankey g.shell-supply .sankey-box { fill: #e5f0ea; stroke: #3f6b58; stroke-width: 1.5; }
.sankey g.supply-card .sankey-box { fill: #f7fbf8; stroke: #3f6b58; }
.sankey g.supply-card text { fill: #1b3038; font-size: 13px; }
.sankey g.supply-card text.sub { fill: #245566; font-size: 12px; }
.sankey g.jenis-gedung .sankey-box { fill: #f8ebe3; stroke: #c47a45; }
.sankey g.jenis-sipil .sankey-box { fill: #e4eef0; stroke: #245566; }
.sankey g.jenis-khusus .sankey-box { fill: #eeeae4; stroke: #6e675f; }
.sankey g.penawaran .sankey-box { fill: #3f6b58; stroke: #3f6b58; }
.sankey g.penawaran text { fill: #f6f1e8; }
.sankey g.penawaran text.sub { fill: #e4ddd2; }
.sankey g.grup-a .sankey-box { fill: #e4eef0; stroke: #245566; }
.sankey g.grup-b .sankey-box { fill: #f3e6cf; stroke: #8d7342; }
.sankey g.grup-c .sankey-box { fill: #f6e7e1; stroke: #8a4b32; }
.sankey-flow.flow-a { fill: #245566; opacity: 0.55; }
.sankey-flow.flow-b { fill: #8d7342; opacity: 0.45; }
.sankey-flow.flow-c { fill: #8a4b32; opacity: 0.4; }
.sankey-flow.supply { fill: #3f6b58; opacity: 0.35; }
.sankey-figure figcaption { margin: 0; color: var(--muted); font-size: 14px; }

.bars { display: grid; gap: 12px; }

.bar-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr auto;
  gap: 10px;
  align-items: center;
}

.bar-name { font-size: 14px; }

.bar-track {
  display: block;
  height: 16px;
  background: #e7e1d8;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-fill.gedung { background: #c47a45; }
.bar-fill.sipil { background: var(--sea); }
.bar-fill.khusus { background: #8d867c; }

.bar-value {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-align: right;
}

.mix {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
}

.mix i { display: block; height: 100%; }
.mix .gedung { background: #c47a45; }
.mix .sipil { background: var(--sea); }
.mix .khusus { background: #8d867c; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 0; margin: 8px 0 0; list-style: none; }
.legend li { font-size: 14px; color: var(--muted); }
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
}
.swatch.gedung { background: #c47a45; }
.swatch.sipil { background: var(--sea); }
.swatch.khusus { background: #8d867c; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 15px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th { font-size: 13px; color: var(--muted); font-weight: 600; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }

.cluster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cluster-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: inherit;
}

.cluster-card.selected { border-color: var(--sea); background: #f3f7f8; }
.cluster-card .code { font-weight: 700; color: var(--sea); margin-right: 8px; }
.card-facts { display: block; margin-top: 8px; color: var(--ink); font-size: 14px; line-height: 1.45; }
.cluster-card.domain-b .code { color: #6d5a30; }
.cluster-card.domain-c .code { color: var(--clay); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.button {
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #f6f1e8;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--navy);
}

.rack { margin-top: 8px; }
.rack caption {
  text-align: left;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 20px;
  padding: 0 0 8px;
  caption-side: top;
}

.rack td.theory { background: var(--theory); }
.rack td.provisional { background: var(--prov); }
.rack td.hole { background: var(--hole); }
.rack td.empty { color: var(--grey); background: #f3f0ea; }

.refs { margin-top: 6px; }
.refs button {
  border: 0;
  background: transparent;
  color: var(--sea);
  padding: 0 8px 0 0;
  cursor: pointer;
  text-decoration: underline;
}

.scenario-row { display: flex; flex-wrap: wrap; gap: 8px; }

.arrows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.arrow {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  min-height: 120px;
}

.arrow.grey { color: var(--grey); background: #f3f0ea; }
.arrow .dir { font-size: 18px; margin: 8px 0 0; }

ol.steps { margin: 0; padding-left: 20px; }
ol.steps li { margin: 0 0 8px; }

pre {
  background: var(--navy);
  color: #f6f1e8;
  padding: 14px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 24px 28px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 800px) {
  .site-header h1 { font-size: 28px; }
  .figure { font-size: 32px; }
  .split, .markets, .stats, .scores, .cluster-grid, .arrows { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .bar-value { text-align: left; }
  .chip { margin-left: 0; }
}
