:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6a66;
  --line: #e2dfd8;
  --ya: #2f8f5b;
  --sebagian: #d99a1c;
  --tidak: #c8402f;
  --na: #a8a6a0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151514;
    --surface: #20201e;
    --text: #efeee9;
    --muted: #a09e97;
    --line: #34332f;
    --ya: #3fa56d;
    --sebagian: #e0a52e;
    --tidak: #dc5a48;
    --na: #6f6d67;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }

h1 { margin: 0; font-size: 1.9rem; letter-spacing: -0.02em; }
h3 { margin: 8px 0 4px; font-size: 1.15rem; }
.lead { margin: 4px 0 16px; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.875rem; }
.small { font-size: 0.8rem; }

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

.stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 10px 0; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.8rem; }
.stat.big { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat.big strong { font-size: 2rem; }

.seatbar { display: flex; gap: 2px; margin: 12px 0; border-radius: 6px; overflow: hidden; }
.seg {
  flex-basis: 0;
  min-width: 0;
  padding: 5px 6px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seatbar.party .seg { text-align: center; font-weight: 500; padding: 6px 2px; font-size: 0.7rem; }
.seatbar.party strong { font-size: 0.95rem; }

.pos-ya { background: var(--ya); }
.pos-sebagian { background: var(--sebagian); }
.pos-tidak { background: var(--tidak); }
.pos-na { background: var(--na); }

.f-pdip { background: #c62828; }
.f-golkar { background: #c79a00; }
.f-gerindra { background: #8d4a2b; }
.f-pkb { background: #1b7f4b; }
.f-nasdem { background: #1f3f7a; }
.f-pks { background: #e06a12; }
.f-pan { background: #2577c8; }
.f-demokrat { background: #253a8e; }

.legend { display: flex; gap: 16px; font-size: 0.8rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

.sq { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }

.tabs { display: flex; gap: 8px; margin: 20px 0 14px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 10px 4px;
  margin-right: 12px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.tab.active { color: var(--text); border-bottom-color: var(--text); }

.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line); }
.status-wacana { background: var(--sebagian); color: #fff; }
.status-dalam-pembahasan { background: #2577c8; color: #fff; }
.decision { margin: 0; font-weight: 600; }

.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { color: #fff; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }

details { margin-top: 10px; }
summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; }
details ul { margin: 8px 0; padding-left: 20px; font-size: 0.9rem; }
.sources { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; font-size: 0.85rem; }
a { color: inherit; }

.filters { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
input, select, .more {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  min-width: 0;
}
.more { width: 100%; margin-top: 12px; cursor: pointer; font-weight: 600; }

.members { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.member { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.member summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  list-style: none;
}
.member summary::-webkit-details-marker { display: none; }
.member-main { display: flex; flex-direction: column; min-width: 0; }
.member-main strong { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip { display: flex; gap: 2px; }
.record { list-style: none; padding: 0; }
.record li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 3px 0; }

footer { margin-top: 28px; }

@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input { grid-column: 1 / -1; }
  .member summary { grid-template-columns: minmax(0, 1fr) auto; }
  .member-main strong { white-space: normal; }
  .strip { grid-column: 1 / -1; }
  .strip .sq { flex: 1; height: 8px; }
  .stat.big strong { font-size: 1.5rem; }
  .seatbar.party .seg { font-size: 0; }
  .seatbar.party strong { font-size: 0.75rem; }
}
