:root {
  --bg: #1e1f22;
  --bg2: #2b2d31;
  --bg3: #313338;
  --card: #2b2d31;
  --border: #3f4147;
  --text: #dbdee1;
  --muted: #949ba4;
  --brand: #5865f2;
  --brand-hover: #4752c4;
  --green: #57f287;
  --green-dark: #3ba55c;
  --red: #ed4245;
  --yellow: #fee75c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "gg sans", "Whitney", "Helvetica Neue", Arial, sans-serif;
}
a { color: #b5bac1; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--bg2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand .dot { width: 32px; height: 32px; border-radius: 10px; background: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 18px; }
.nav { display: flex; gap: 10px; align-items: center; }
.userchip { display: flex; align-items: center; gap: 10px; background: var(--bg3);
  border: 1px solid var(--border); padding: 6px 12px 6px 6px; border-radius: 999px; }
.userchip img { width: 28px; height: 28px; border-radius: 50%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.hero { text-align: center; padding: 60px 20px 30px; }
.hero h1 { font-size: 42px; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 720px; margin: 0 auto 24px; }
.btn {
  appearance: none; border: 0; border-radius: 8px; padding: 10px 18px;
  background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; font-size: 14px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: var(--brand-hover); }
.btn.secondary { background: #4e5058; }
.btn.secondary:hover { background: #6d6f78; }
.btn.green { background: var(--green-dark); }
.btn.danger { background: var(--red); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.guild { display: flex; gap: 12px; align-items: center; }
.guild img, .guild .fallback {
  width: 48px; height: 48px; border-radius: 14px; background: var(--bg3);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
  flex-shrink: 0; object-fit: cover;
}
.badges { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #4e5058; }
.badge.ok { background: #3ba55c; color: #fff; }
.badge.warn { background: #9b7d0e; color: #fff; }
.grid2 { display: grid; grid-template-columns: 430px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
label { font-size: 12px; color: var(--muted); display: block; margin: 10px 0 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
input[type=text], input[type=url], textarea, select {
  width: 100%; background: #1e1f22; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 10px; font-size: 14px; font-family: inherit;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.block { background: #232428; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.block-title { font-weight: 800; font-size: 13px; }
.iconbtn { background: #4e5058; border: 0; color: #fff; border-radius: 6px; padding: 5px 9px; cursor: pointer; font-size: 12px; }
.iconbtn:hover { background: #6d6f78; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.checkrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; }
select.inline, input.inline { width: auto; }

/* Discord message preview */
.preview-msg {
  background: #313338; border-radius: 8px; padding: 16px;
  max-width: 640px;
}
.d-text { font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; margin: 4px 0; }
.d-text h1, .d-text h2, .d-text h3 { margin: 6px 0 4px; }
.d-section { display: flex; gap: 12px; align-items: center; background: transparent; margin: 8px 0; }
.d-section .grow { flex: 1; }
.d-thumb { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.d-gallery { display: grid; gap: 4px; margin: 8px 0; border-radius: 8px; overflow: hidden; }
.d-gallery.cols1 { grid-template-columns: 1fr; }
.d-gallery.cols2 { grid-template-columns: 1fr 1fr; }
.d-gallery.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.d-gallery img, .d-gallery video { width: 100%; height: 160px; object-fit: cover; display: block; background: #1e1f22; }
.d-sep { border: 0; border-top: 1px solid #4e5058; margin: 12px 0; }
.d-sep.nodiv { border-top-color: transparent; }
.d-container { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 8px; padding: 12px 12px 12px 16px; position: relative; margin: 8px 0; overflow: hidden; }
.d-container::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, transparent); }
.d-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.d-btn { border: 0; border-radius: 4px; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: default; color: #fff; text-decoration: none; display: inline-block; }
.d-btn.primary { background: #5865f2; } .d-btn.secondary { background: #4e5058; }
.d-btn.success { background: #3ba55c; } .d-btn.danger { background: #ed4245; }
.d-btn.link { background: #4e5058; } .d-btn:disabled { opacity: .5; }
.d-file { background: #2b2d31; border: 1px solid #4e5058; border-radius: 8px; padding: 10px; margin: 8px 0; font-size: 13px; }
pre.json { background: #1e1f22; border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; max-height: 420px; font-size: 12px; }
.status { padding: 10px 12px; border-radius: 8px; margin-top: 10px; font-size: 14px; display: none; }
.status.ok { display: block; background: #14331f; border: 1px solid #3ba55c; }
.status.err { display: block; background: #3a1516; border: 1px solid var(--red); white-space: pre-wrap; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
code.inline { background: #1e1f22; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; }
