:root {
  --bg: #f7f5f1;
  --bg-soft: #f1ede5;
  --card: #ffffff;
  --ink: #201d18;
  --ink-2: #4a443b;
  --muted: #7a7266;
  --line: rgba(28, 25, 21, .10);
  --accent: #9b7a3f;
  --accent-2: #6f5a2e;
  --accent-3: #c9a86a;
  --accent-soft: #f4eee0;
  --on-accent: #1f1808;
  --good: #3f6f55;
  --good-soft: #e6efe9;
  --warn: #8a5b1d;
  --warn-soft: #f7edda;
  --bad: #a83f39;
  --shadow: 0 1px 2px rgba(28, 25, 21, .05), 0 12px 32px -18px rgba(64, 46, 20, .35);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 420px at 85% -8%, rgba(155, 122, 63, .10), transparent 60%),
    radial-gradient(900px 380px at 0% 0%, rgba(191, 138, 85, .08), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .35rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 0; }
p { margin: .35rem 0; }
code { background: var(--bg-soft); padding: .1rem .35rem; border-radius: 6px; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
b, strong { font-weight: 600; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 4vw, 40px);
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 245, 241, .85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(28, 25, 21, .07);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {\n  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; display: block;\n  box-shadow: 0 6px 16px -8px rgba(34, 211, 238, .45);\n}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-size: 1.02rem; white-space: nowrap; }
.brand-name { white-space: nowrap; }\n.brand-text b { color: var(--accent); }
.brand-text small { display: block; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; font-size: .72rem; letter-spacing: .01em; }
.topnav { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.topnav a {
  padding: 7px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: .9rem;
}
.topnav a.active { background: var(--accent-soft); color: var(--accent); }

.wrap { width: min(1180px, 94vw); margin: 26px auto 60px; display: grid; gap: 18px; }
/* Footer */
.footer {
  border-top: 1px solid var(--line); padding: 40px 20px 24px;
  color: var(--muted); font-size: .9rem; background: var(--bg-soft);
}
.footer-grid {
  max-width: 1180px; margin: 0 auto; display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.1fr; gap: 28px; text-align: left;
}
.footer-brand h4 {
  font-size: 1.05rem; letter-spacing: .4px; margin: 0 0 6px;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-brand p { margin: 0 0 8px; line-height: 1.6; max-width: 420px; }
.footer-contact { font-size: .82rem; }
.footer-contact a, .footer-legal a { color: var(--accent); text-decoration: none; }
.footer-contact a:hover, .footer-legal a:hover { text-decoration: underline; }
.footer-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
  font-size: .79rem; color: var(--ink-2); transition: .2s; text-decoration: none;
}
.social-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 {
  font-size: .78rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 4px; font-weight: 600;
}
.footer-col a { color: var(--muted); font-size: .88rem; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-col .footer-note { font-size: .8rem; line-height: 1.6; }
.footer-legal {
  max-width: 1180px; margin: 30px auto 0; border-top: 1px solid var(--line);
  padding-top: 16px; font-size: .76rem; color: var(--muted); line-height: 1.6;
  text-align: center;
}
.footer-legal p { margin: 0 0 6px; }
.footer-copy { text-align: center; font-size: .74rem; margin-top: 10px; }

/* Hero */
.hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(120deg, #fffdf8 5%, #faf5e9 60%, #f3ecdb 100%);
  border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); max-width: 620px; }
.hero p { color: var(--ink-2); max-width: 640px; margin: .2rem 0 0; }
.hero-stats { display: flex; gap: 12px; }
.hero-stats > div {
  min-width: 92px; text-align: center; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .72); border: 1px solid var(--line);
}
.hero-stats b { display: block; font-size: 1.35rem; letter-spacing: -.02em; }
.hero-stats span { color: var(--muted); font-size: .74rem; }

/* Grids & cards */
.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 1.45fr .9fr .9fr; gap: 18px; align-items: start; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.note { background: linear-gradient(180deg, #fff, #fcfaf5); }

/* Page head (project) */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head h1 { max-width: 720px; }
.back { font-size: .84rem; color: var(--muted); display: inline-block; margin-bottom: 2px; }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
label { display: grid; gap: 6px; font-size: .86rem; font-weight: 500; color: var(--ink-2); margin-bottom: 12px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-3); box-shadow: 0 0 0 4px rgba(155, 122, 63, .16);
}
textarea { resize: vertical; min-height: 84px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 120px; margin-bottom: 0; }
.row.end { justify-content: flex-end; }
.row .primary, .row .accent { flex: 0 0 auto; }
label.inline { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 500; }
label.inline select { width: auto; padding: 6px 10px; }
label.check { display: inline-flex; align-items: center; gap: 7px; }
label.check input { width: auto; }

/* Buttons */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: transform .06s, box-shadow .15s, background .15s;
  text-decoration: none !important;
}
button:hover, .btn:hover { box-shadow: 0 6px 14px -10px rgba(28, 25, 21, .45); }
button:active, .btn:active { transform: translateY(1px); }
.primary { background: linear-gradient(135deg, var(--accent-3), var(--accent-2)); border-color: transparent; color: var(--on-accent); }
.accent { background: linear-gradient(135deg, var(--accent-3), var(--accent)); border-color: transparent; color: var(--on-accent); }
.ghost { background: #fff; }
.btn.busy { opacity: .65; pointer-events: none; }
.btn.ai-busy { opacity: .65; pointer-events: none; }
.ai-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 999; background: linear-gradient(90deg, var(--accent-3), var(--accent)); transition: width .25s linear; pointer-events: none; box-shadow: 0 0 8px var(--accent); }
.ai-cancel { position: fixed; top: 10px; right: 12px; z-index: 1000; padding: 7px 14px; font-size: .82rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); cursor: pointer; }
.small { font-size: .84rem; }
button.small { padding: 6px 11px; font-size: .8rem; }
.icon {
  width: 30px; height: 30px; padding: 0; border-radius: 9px; font-size: 1rem; line-height: 1;
}
.icon.danger { color: var(--bad); background: #fbf0ee; border-color: #efd2ce; }

/* Chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-2); font-size: .76rem; font-weight: 600;
}
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.tiny { padding: 1px 8px; font-size: .7rem; }
.muted-chip { background: #f3efe7; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--bg-soft); color: var(--ink-2);
  white-space: nowrap;
}
.badge.b-ok { background: var(--good-soft); color: var(--good); }
.badge.b-warn { background: var(--warn-soft); color: var(--warn); }
.badge.b-rec { background: linear-gradient(135deg, var(--accent-3), var(--accent-2)); color: var(--on-accent); }

/* Projects list */
.project-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.project-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px;
  background: #fff; color: var(--ink); transition: border-color .15s, transform .12s;
}
.project-item:hover { border-color: var(--accent-3); text-decoration: none; transform: translateY(-1px); }
.pi-main { display: grid; gap: 2px; min-width: 0; }
.pi-main strong { overflow: hidden; text-overflow: ellipsis; }
.pi-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Nodes editor */
.nodes-editor { display: grid; gap: 12px; margin: 8px 0 14px; }
.node-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fcfaf5; display: grid; gap: 7px; }
.node-head { display: flex; align-items: center; gap: 8px; }
.node-num {
  flex: 0 0 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 700;
}
.node-head input { flex: 1; font-weight: 600; }
.node-row input, .node-row textarea { font-size: .85rem; padding: 7px 10px; }
.node-row textarea { resize: vertical; min-height: 62px; width: 100%; }

/* Run status / sources */
.run-status {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: .85rem; color: var(--ink-2); background: var(--bg-soft);
  border-radius: 10px; padding: 9px 12px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 8px; }
.dot.ok { background: var(--good); }
.dot.err { background: var(--bad); }
.dot.pulse { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.sources { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.source-list { max-height: 280px; overflow-y: auto; overflow-x: hidden; }
.source-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: .82rem; min-width: 0; }
.source-row .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-bar { flex-basis: 100%; height: 3px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.run-bar i { display: block; width: 35%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-3), var(--accent)); animation: run-slide 1s ease-in-out infinite; }
@keyframes run-slide { from { transform: translateX(-110%); } to { transform: translateX(380%); } }

.steps { margin: 4px 0 0; padding-left: 20px; font-size: .87rem; display: grid; gap: 6px; color: var(--ink-2); }
.callout {
  margin-top: 12px; background: var(--accent-soft); border: 1px solid #e7dcc4;
  border-radius: 11px; padding: 10px 12px; font-size: .82rem; color: var(--ink-2);
}

/* Filters */
.results { display: grid; gap: 14px; }
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
  font-size: .84rem;
}
.filterbar .spacer { flex: 1; }

/* Papers */
.paper-list { display: grid; gap: 12px; }
.paper {
  display: grid; grid-template-columns: 78px 1fr; gap: 16px; align-items: start;
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  background: #fff; transition: border-color .15s;
}
.paper:hover { border-color: #e5dcc8; }
.paper.no-pdf { background: #fbf9f4; border-style: dashed; }
.score-ring {
  --p: 0;
  width: 70px; height: 70px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), #eae5db 0);
  display: grid; place-items: center; position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.score-ring span { position: relative; font-weight: 800; font-size: .95rem; letter-spacing: -.02em; }
.paper-body { min-width: 0; }
.paper-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.paper-title-row h3 { font-size: .98rem; line-height: 1.4; }
.paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0 6px; font-size: .8rem; color: var(--muted); }
.parts { display: flex; flex-wrap: wrap; gap: 6px; }
.part-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 3px;
  border-radius: 999px; background: #f6f1e6; font-size: .76rem; color: var(--ink-2); font-weight: 500;
}
.part-chip i {
  font-style: normal; font-weight: 700; font-size: .7rem; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  padding: 2px 8px; border-radius: 999px;
}
.paper-detail { margin-top: 6px; }
.paper-detail summary {
  cursor: pointer; font-size: .8rem; color: var(--accent); font-weight: 600;
  list-style: none; display: inline-flex; align-items: center; gap: 5px;
}
.paper-detail summary::before { content: "\2192"; transition: transform .15s; display: inline-block; }
.paper-detail[open] summary::before { transform: rotate(90deg); }
.score-bars { display: grid; gap: 8px; margin: 12px 0 4px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 44px; gap: 10px; align-items: center; font-size: .8rem; }
.bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: #ece7dd; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar i.hi { background: linear-gradient(90deg, #4f8a68, #6fa382); }
.bar i.mid { background: linear-gradient(90deg, var(--accent-3), var(--accent)); }
.bar i.lo { background: #d8d2c6; }
.bar-val { text-align: right; font-weight: 700; font-size: .78rem; color: var(--ink-2); }
.evidence {
  margin: 2px 0 8px 180px; padding: 8px 12px; border-left: 3px solid #dcc79a;
  background: #faf6ec; border-radius: 0 9px 9px 0; font-size: .8rem; color: var(--ink-2);
}
.kwline { margin: 0 0 10px 180px; font-size: .72rem; color: var(--muted); }
.abstract { font-size: .8rem; color: var(--muted); margin: 10px 0; }
.paper-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.paper-links .btn { padding: 6px 12px; font-size: .8rem; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(28, 25, 21, .42); padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(480px, 100%); background: #fff; border-radius: 18px; padding: 22px;
  box-shadow: 0 24px 60px -20px rgba(28, 25, 21, .5);
}
.modal-card h3 { margin-bottom: 4px; }

/* Pengumuman popup (setel di Admin) */
.ann-overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(28, 25, 21, .45); padding: 20px;
}
.ann-overlay[hidden] { display: none; }
.ann-card {
  position: relative; width: min(560px, 100%); max-height: 82vh; overflow: auto;
  background: #fff; border-radius: 16px; padding: 24px 22px 20px;
  box-shadow: 0 24px 60px -20px rgba(28, 25, 21, .5), 0 0 0 1px rgba(28, 25, 21, .06);
  animation: ann-in .25s ease;
}
@keyframes ann-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.ann-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ann-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: .95rem; }
.ann-logo { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
.ann-brand-txt { font-size: .9rem; color: var(--ink); letter-spacing: .01em; }
.ann-close {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-size: 1.15rem; line-height: 1; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--ink-2);
  transition: background .15s, border-color .15s, color .15s;
}
.ann-close:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-3); }
.ann-text { color: var(--ink); font-size: .92rem; line-height: 1.7; word-wrap: break-word; }
.ann-text br + br { margin-top: .3rem; }
.ann-text strong { font-weight: 600; color: var(--ink); }
.ann-text em { color: var(--ink-2); font-style: normal; }

/* Checkbox styling */
input[type=checkbox] { width: 20px; height: 20px; cursor: pointer; vertical-align: middle; margin: 0; accent-color: var(--accent); }

.cite-card { width: min(620px, 100%); }
.tabs { display: flex; gap: 6px; margin: 14px 0 10px; flex-wrap: wrap; }
.tab {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-soft); font: inherit; font-size: .8rem; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
}
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-3); }
.cite-text {
  margin: 0 0 12px; padding: 12px; border-radius: 12px; background: var(--bg-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem;
  max-height: 300px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.related-list { max-height: 380px; overflow: auto; display: grid; gap: 8px; margin-bottom: 12px; }
.related-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft);
}
.related-item a { font-weight: 600; color: var(--ink); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: .86rem; z-index: 80; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4);
}
.toast.err { background: var(--bad); color: #fff; }

/* Notifikasi cara pakai (floating kanan atas) */
.howto {
  position: fixed; top: 76px; right: 18px; z-index: 70; width: min(320px, 90vw);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px 12px; box-shadow: 0 18px 44px -18px rgba(28, 25, 21, .45);
  opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease;
}
.howto.show { opacity: 1; transform: translateY(0); }
.howto h3 { margin-bottom: 6px; font-size: 1rem; }
.howto .steps { margin: 6px 0 4px 18px; }
.howto .steps li { margin: 3px 0; }
.howto > button {
  position: absolute; top: 8px; right: 10px; width: 26px; height: 26px;
  border: none; border-radius: 999px; background: var(--bg-soft); cursor: pointer;
  font-size: 1rem; line-height: 1; color: var(--ink-2);
}
.howto-reopen {
  position: fixed; bottom: 22px; right: 22px; z-index: 60;
  border: 1px solid var(--accent-3); background: var(--accent-soft); color: var(--accent);
  padding: 8px 14px; border-radius: 999px; font: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; box-shadow: 0 10px 28px -14px rgba(28, 25, 21, .45);
}
.howto-reopen[hidden] { display: none; }

/* Responsive */
@media (max-width: 1020px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > section:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-3 > section:first-child { grid-column: auto; }
  .hero { padding: 20px; }
  .hero-stats { width: 100%; }
  .hero-stats > div { flex: 1; min-width: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { width: 94vw; margin-top: 16px; }
  .brand-text { font-size: .94rem; }
  .brand-text small { display: none; }
  .topnav a, .topnav button { padding: 6px 10px; font-size: .82rem; }
  .paper { grid-template-columns: 54px 1fr; gap: 12px; padding: 13px; }
  .score-ring { width: 52px; height: 52px; }
  .score-ring span { font-size: .8rem; }
  .bar-row { grid-template-columns: 110px 1fr 40px; }
  .evidence { margin-left: 0; }
  .kwline { margin-left: 0; }
  .filterbar { gap: 9px; }
  .stat-chips .chip { font-size: .72rem; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-col { align-items: center; }
  .footer-brand p { margin-inline: auto; }
}

[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-soft: #17171a;
  --card: #151518;
  --ink: #ede9e1;
  --ink-2: #c9c3b9;
  --muted: #8e877c;
  --line: rgba(235, 232, 225, .10);
  --accent: #d3ab67;
  --accent-2: #bf8a55;
  --accent-3: #e5cb96;
  --accent-soft: rgba(211, 171, 103, .14);
  --on-accent: #17120a;
  --good: #7fbf9b;
  --good-soft: #16241d;
  --warn: #d9a55f;
  --warn-soft: #241c11;
  --bad: #e08079;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -22px rgba(0, 0, 0, .85);
}
[data-theme="dark"] .topbar { background: rgba(13, 13, 15, .82); border-bottom-color: rgba(235, 232, 225, .08); }
[data-theme="dark"] .hero { background: linear-gradient(120deg, #141412, #171613 60%, #1a1712); }
[data-theme="dark"] .hero-stats > div, [data-theme="dark"] .project-item, [data-theme="dark"] .paper, [data-theme="dark"] .node-row, [data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea, [data-theme="dark"] button, [data-theme="dark"] .btn, [data-theme="dark"] .score-ring::before { background: #19191d; }
[data-theme="dark"] .primary, [data-theme="dark"] .accent { background: linear-gradient(135deg, var(--accent-3), var(--accent)); color: var(--on-accent); }
[data-theme="dark"] .btn.danger { background: #c0392b; color: #fff; }
[data-theme="dark"] .paper.no-pdf { background: #121214; }
[data-theme="dark"] .paper:hover { border-color: rgba(211, 171, 103, .35); }
[data-theme="dark"] .project-item:hover { border-color: var(--accent-3); }
[data-theme="dark"] .score-ring { background: conic-gradient(var(--accent) calc(var(--p) * 1%), #2b2a26 0); }
[data-theme="dark"] .bar { background: #2b2a26; }
[data-theme="dark"] .part-chip { background: #1e1d19; }
[data-theme="dark"] .evidence { background: #141414; border-left-color: rgba(211, 171, 103, .5); }
[data-theme="dark"] .icon.danger { background: #2a1a19; border-color: #4a2b28; }
[data-theme="dark"] .muted-chip { background: #1e1d19; }
[data-theme="dark"] .modal-card { background: #1a1a1d; }
[data-theme="dark"] .callout { border-color: rgba(211, 171, 103, .28); }
[data-theme="dark"] .note { background: #141414; }
[data-theme="dark"] .toast { background: #ede9e1; color: #17120a; }
[data-theme="dark"] .ann-card { background: #1a1a1d; }
[data-theme="dark"] .ann-close { background: #19191d; border-color: rgba(235, 232, 225, .1); color: var(--ink); }
[data-theme="dark"] .ann-close:hover { background: #26262b; }



/* draf Bab 2 */
.review-text { white-space: pre-wrap; max-height: 55vh; overflow: auto; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .86rem; margin-bottom: 12px; }

/* peta literatur per bagian */
.gap-map h2 { margin: 0 0 4px; }
.gap-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.gap-chip { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .8rem; }
.gap-chip b { font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gap-chip i { font-style: normal; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gap-chip.g-good { border-color: var(--good); }
.gap-chip.g-warn { border-color: var(--warn); }
.gap-chip.g-bad { border-color: var(--bad); background: var(--bad-soft, rgba(224, 128, 121, .08)); }

/* graf sitasi */
.graph-wrap { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); overflow-x: auto; }
.graph-wrap svg { display: block; width: 100%; height: auto; min-height: 320px; }
.graph-wrap line.g-ref { stroke: var(--accent); stroke-opacity: .35; }
.graph-wrap line.g-cited { stroke: var(--good); stroke-opacity: .3; }
.graph-wrap circle { cursor: pointer; stroke: transparent; }
.graph-wrap circle.g-rec { fill: var(--accent); }
.graph-wrap circle.g-pdf { fill: var(--good); }
.graph-wrap circle.g-plain { fill: var(--muted); }
.graph-wrap circle:hover { stroke: var(--ink); stroke-width: 2; }
.graph-wrap text.g-axis { fill: var(--muted); font-size: 11px; }
.graph-info { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .84rem; overflow-wrap: anywhere; }

/* banner paper baru sejak run terakhir */
.banner-new { padding: 10px 14px; border: 1px solid var(--warn); border-radius: 12px; margin-bottom: 14px; background: var(--bad-soft, rgba(224, 128, 121, .08)); font-size: .86rem; }
.banner-new button.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
#form-seed { margin-top: 10px; }
#form-seed input, #form-seed textarea { min-width: 0; flex: 1; }

/* import dokumen */
.import-doc { padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 16px; background: var(--bg-soft); }
.import-doc label { display: grid; gap: 8px; margin: 0; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.import-doc label .muted { font-weight: 400; overflow-wrap: anywhere; }
.import-doc input[type=file] { margin-top: 4px; padding: 8px 10px; color: var(--muted); background: var(--card); border-color: var(--line); }
.import-doc input[type=file]::file-selector-button {
  margin-right: 10px; padding: 7px 15px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  color: var(--on-accent); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: filter .15s;
}
.import-doc input[type=file]::file-selector-button:hover { filter: brightness(1.06); }
.import-doc input[type=file]::file-selector-button:active { filter: brightness(.97); }
.import-doc #import-msg { margin: 10px 0 0; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.adm-table th, .adm-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid rgba(0,0,0,.08); vertical-align: middle; }
.adm-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: inherit; opacity: .65; }
.btn.sm { padding: 3px 10px; font-size: .78rem; }
.btn.danger { background: #c0392b; color: #fff; }
.txt-warn { color: #b47b00; font-weight: 600; }
[data-theme="dark"] .adm-table th, [data-theme="dark"] .adm-table td { border-color: rgba(255,255,255,.1); }
.btn Theme { width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #262622; border: 1px solid #3a3a34; color: #f0a13c; cursor: pointer;
  transition: background .15s, border-color .15s; }
.btn-theme:hover { background: #2f2f2a; border-color: #4a4a42; }
.btn-theme svg { width: 20px; height: 20px; display: none; }
.btn-theme[data-state="light"] .i-light { display: block; }
.btn-theme[data-state="dark"] .i-dark { display: block; }
[data-theme="dark"] .btn-theme { background: #19191d; border-color: #2b2b31; color: #f0a13c; }
[data-theme="dark"] .btn-theme:hover { background: #22222a; border-color: #3a3a44; }
input[type=checkbox] { width: 20px; height: 20px; cursor: pointer; vertical-align: middle; margin: 0; }
