:root {
  --bg: #1e1f24;
  --bg-elevated: #26272e;
  --bg-elevated-2: #2f3038;
  --border: #3a3b44;
  --text: #e7e8ea;
  --text-dim: #9a9ba3;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --good: #57f287;
  --bad: #ed4245;
  --warn: #fee75c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 18px; color: var(--text); }
.topbar .brand span { color: var(--accent); }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-bottom: 20px;
  min-height: 0;
}
.ad-slot:empty { display: none; }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

h1 { font-size: 26px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 14px; }
p.muted, .muted { color: var(--text-dim); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: var(--bg-elevated-2); border: 1px solid var(--border); }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: rgba(87,242,135,0.15); color: var(--good); }
.badge.bad { background: rgba(237,66,69,0.15); color: var(--bad); }
.badge.warn { background: rgba(254,231,92,0.15); color: var(--warn); }

.step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }

label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; margin-top: 16px; }
input[type=text], input[type=number], select, textarea {
  width: 100%;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
}
textarea { min-height: 70px; font-family: inherit; }
input[type=checkbox] { width: 16px; height: 16px; vertical-align: middle; margin-right: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; }

.guild-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.guild-row:last-child { border-bottom: none; }

/* --- Rule builder --- */
.rule-group {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  background: rgba(255,255,255,0.02);
}
.rule-group-header { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.rule-op-select { width: auto; display: inline-block; }
.rule-check {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-elevated-2);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
}
.rule-check select, .rule-check input { width: auto; }
.rule-actions { display: flex; gap: 8px; margin-top: 8px; }
.small-btn {
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.small-btn:hover { border-color: var(--accent); }
.remove-btn { color: var(--bad); }
.indent { margin-left: 22px; }
