:root {
  --bg: #f4f6fb;
  --panel: #fff;
  --border: #dbe3ef;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --include: #ecfdf5;
  --exclude: #fef2f2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px 20px 40px;
}
.wrap { max-width: 920px; margin: 0 auto; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.topbar a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}
h1 { margin: 0 0 6px; font-size: 22px; }
.lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.panel h2 { margin: 0 0 10px; font-size: 15px; }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  background: #fff;
}
.chip.is-on { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.chip.is-off { opacity: 0.55; }
textarea, input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
}
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.tree { font-size: 13px; line-height: 1.7; }
.tree label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tree .indent { margin-left: 18px; border-left: 1px dashed #cbd5e1; padding-left: 10px; }
.rule-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: #fafafa;
}
.rule-card.include { background: var(--include); border-color: #a7f3d0; }
.rule-card.exclude { background: var(--exclude); border-color: #fecaca; }
.preview {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font: 12px/1.5 ui-monospace, monospace;
  white-space: pre-wrap;
}
.btn {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
