:root {
  --bg: #f6f7f5; --panel: #ffffff; --text: #1d2420; --muted: #5d6862; --line: #dfe4e0;
  --brand: #2f6b4f; --brand-ink: #ffffff; --accent-bg: #eef5f0; --warn: #8a5a00; --warn-bg: #fff6e0;
  --hl: #fff3c4; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --panel: #1b201d; --text: #e6ebe7; --muted: #9aa59f; --line: #2c3430;
    --brand: #6fb38f; --brand-ink: #0d1410; --accent-bg: #1f2b24; --warn: #f2c46b; --warn-bg: #2c2414;
    --hl: #4a4220; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); display: inline-block; }
.who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.viewas select { margin-left: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
main { max-width: 900px; margin: 0 auto; padding: 24px 16px 80px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.center { text-align: center; max-width: 520px; margin: 60px auto; }
h1 { font-size: 24px; margin: 0 0 8px; } h2 { font-size: 17px; margin: 28px 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.primary { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.primary:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; text-decoration: underline; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.ask { display: flex; gap: 10px; align-items: flex-start; }
.ask textarea, #batch { flex: 1; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); resize: vertical; }
.note { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.answer { margin-top: 20px; }
.claim { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.claim .stmt { font-size: 16px; margin-bottom: 8px; }
.claim blockquote { margin: 0 0 8px; padding: 6px 12px; border-left: 3px solid var(--brand); background: var(--accent-bg); color: var(--text); font-size: 14px; border-radius: 0 6px 6px 0; }
.cite { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cite button { font-size: 13px; }
.notfound { margin-top: 20px; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel); }
.meta-line { font-size: 12px; color: var(--muted); margin-top: 8px; }
.row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.row input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.list li { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--accent-bg); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); margin-left: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat .v { font-size: 22px; font-weight: 650; } .stat .k { font-size: 12px; color: var(--muted); }
.log { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); }
.log th, .log td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
#batch-out .claim { box-shadow: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--panel);
  border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); display: flex; flex-direction: column; z-index: 10; }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-actions { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; }
.drawer-actions a { color: var(--brand); }
.t-title { font-weight: 650; }
.close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.t-body { overflow-y: auto; padding: 10px 18px 40px; }
.ln { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 6px 4px; border-radius: 6px; }
.ln .ts { color: var(--muted); font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.ln .sp { font-weight: 600; font-size: 13px; }
.ln.hl { background: var(--hl); }
@media (max-width: 600px) { .ask { flex-direction: column; } .ask .primary { width: 100%; } }
