/* Discord previews. These are the BrightBots site's Discord components (brightdev-web/assets/css/discord.css)
   with the same colours, sampled from real screenshots of Discord's current dark theme (the 2025 refresh),
   and Discord's own sizes at 100% zoom. The panel adds what its previews draw from real bot payloads:
   Discord markdown, embed images, thumbnails and author icons, link buttons and the profile popout.
   gg sans is Discord's proprietary face and is not licensed for the web, so Noto Sans stands in.
   These colours are the one exception to the panel tokens and never appear outside a .dc block. */

.dc {
  --dc-bg: #323339;
  --dc-header-border: #26272b;
  --dc-embed: #393a41;
  --dc-embed-border: #44454c;
  --dc-text: #f3f3f4;
  --dc-text-soft: #dbdee1;
  --dc-head: #ffffff;
  --dc-muted: #9d9ea5;
  --dc-select: #2e2f35;
  --dc-select-border: #43444a;
  --dc-select-text: #c5c6ca;
  --dc-menu: #3c3d45;
  --dc-menu-hover: #45464f;
  --dc-blurple: #5865f2;
  --dc-blurple-hover: #4752c4;
  --dc-green: #008545;
  --dc-red: #d22d39;
  --dc-grey: #44454c;
  --dc-grey-hover: #4e5058;
  --dc-mention-bg: #464662;
  --dc-mention-embed-bg: #40446b;
  --dc-mention-text: #cdd7ff;
  --dc-link: #00a8fc;
  --dc-code: #2b2c31;
  --dc-quote: #4e5058;
  --dc-popout: #2b2c31;
  --dc-popout-inner: #232428;
  --dc-ease: cubic-bezier(0.2, 0, 0, 1);
  font-family: 'Noto Sans', 'gg sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.375;
  color: var(--dc-text);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}
.dc .icon { width: 20px; height: 20px; stroke-width: 2; }

/* Window: the channel header and the message list. */
.dc-window {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--dc-bg);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.28), 0 24px 48px -20px rgb(20 16 8 / 0.45);
}
:root[data-theme='dark'] .dc-window { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 24px 48px -20px rgb(0 0 0 / 0.6); }
.dc-head {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px;
  border-bottom: 1px solid var(--dc-header-border);
  color: var(--dc-head); font-weight: 600; font-size: 16px;
}
.dc-head .icon { width: 24px; height: 24px; color: #80848e; }
.dc-channel { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-body { padding: 4px 0 20px; transition: opacity 200ms var(--dc-ease); }
.dc-body.is-stale { opacity: 0.55; }

/* Message */
.dc-msg { position: relative; padding: 2px 16px 2px 72px; margin-top: 17px; min-height: 44px; }
.dc-avatar { position: absolute; left: 16px; top: 4px; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.dc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; line-height: 22px; }
.dc-name { font-weight: 500; color: var(--dc-head); font-size: 16px; }
.dc-badge {
  display: inline-flex; align-items: center; height: 16px; padding: 0 4px; margin-left: 2px;
  border-radius: 4px; background: var(--dc-blurple); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 16px; text-transform: uppercase; letter-spacing: 0.01em;
  position: relative; top: 1px;
}
.dc-time { color: var(--dc-muted); font-size: 12px; font-weight: 500; margin-left: 4px; line-height: 22px; }
.dc-content { color: var(--dc-text); font-size: 16px; line-height: 22px; overflow-wrap: anywhere; }
.dc-mention, .dc-role {
  border-radius: 3px; padding: 0 2px; font-weight: 500;
  background: var(--dc-mention-bg); color: var(--dc-mention-text);
}
.dc-embed .dc-mention { background: var(--dc-mention-embed-bg); }

/* Discord markdown */
.dc strong { font-weight: 700; color: inherit; }
.dc-link { color: var(--dc-link); text-decoration: none; }
.dc-link:hover { text-decoration: underline; }
.dc-code { background: var(--dc-code); border-radius: 4px; padding: 0 3px; font-size: 85%; font-family: Consolas, 'Andale Mono WT', monospace; }
.dc-stamp { background: rgb(78 80 88 / 0.48); border-radius: 3px; padding: 0 2px; }
.dc-emoji { display: inline-block; width: 22px; height: 22px; vertical-align: bottom; object-fit: contain; }
.dc-embed .dc-emoji { width: 18px; height: 18px; vertical-align: -3px; }
.dc-app-emoji { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 2px; color: var(--accent-color, #3b83f6); }
.dc-quote { border-left: 4px solid var(--dc-quote); padding-left: 12px; }
.dc-li { padding-left: 20px; position: relative; }
.dc-li::before { content: ''; position: absolute; left: 7px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.dc-h { margin: 8px 0 0; color: var(--dc-head); line-height: 1.375; font-weight: 700; }
h3.dc-h { font-size: 24px; } h4.dc-h { font-size: 20px; } h5.dc-h { font-size: 16px; }

/* Embed: a grid of the text column and an optional thumbnail. */
.dc-embed {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 520px; margin-top: 2px;
  padding: 8px 16px 16px 16px;
  background: var(--dc-embed);
  border: 1px solid var(--dc-embed-border); border-left: 0;
  border-radius: 4px 8px 8px 4px;
  font-size: 14px; line-height: 18px; color: var(--dc-text);
}
.dc-embed.has-thumb { grid-template-columns: minmax(0, 1fr) 80px; }
.dc-embed::before { content: ''; position: absolute; left: 0; top: -1px; bottom: -1px; width: 4px; border-radius: 4px 0 0 4px; background: var(--bar, var(--dc-embed-border)); }
.dc-embed-main { display: grid; gap: 8px; min-width: 0; align-content: start; }
.dc-embed-author { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; font-size: 14px; color: var(--dc-head); }
.dc-embed-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dc-embed-author .icon { width: 24px; height: 24px; color: var(--accent-color, #3b83f6); }
.dc-embed-author a { color: inherit; text-decoration: none; }
.dc-embed-title { font-weight: 600; font-size: 16px; line-height: 22px; color: var(--dc-head); margin-top: 8px; }
.dc-embed-author + .dc-embed-title { margin-top: 0; }
.dc-embed-desc { white-space: normal; overflow-wrap: anywhere; }
.dc-fields { display: grid; gap: 8px; margin-top: 2px; }
.dc-field-row { display: grid; gap: 8px; }
.dc-field { min-width: 0; }
.dc-field-name { font-weight: 600; color: var(--dc-head); margin-bottom: 2px; }
.dc-field-value { overflow-wrap: anywhere; }
.dc-embed-image { display: block; max-width: 100%; max-height: 300px; border-radius: 4px; margin-top: 8px; object-fit: contain; }
.dc-embed-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-top: 8px; }
.dc-embed-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--dc-text); margin-top: 0; }
.dc-embed-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc-img-missing {
  display: grid; place-items: center; gap: 4px; min-height: 96px; margin-top: 8px; padding: 12px;
  border: 1px dashed var(--dc-embed-border); border-radius: 4px; color: var(--dc-muted); font-size: 12px; text-align: center;
}

/* Components */
.dc-components { display: grid; gap: 8px; margin-top: 8px; max-width: 400px; }
.dc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; min-width: 60px; padding: 2px 12px;
  border: 0; border-radius: 8px; color: #fff; cursor: default; text-decoration: none;
  font: 500 14px/16px 'Noto Sans', 'gg sans', sans-serif;
}
.dc-btn .icon { width: 16px; height: 16px; }
.dc-btn .dc-emoji, .dc-btn .dc-app-emoji { width: 18px; height: 18px; margin: 0; }
.dc-btn-success { background: var(--dc-green); }
.dc-btn-danger { background: var(--dc-red); }
.dc-btn-primary { background: var(--dc-blurple); }
.dc-btn-secondary, .dc-btn-link { background: var(--dc-grey); }
.dc-btn[aria-disabled='true'] { opacity: 0.5; }
.dc-btn-success .dc-app-emoji, .dc-btn-danger .dc-app-emoji, .dc-btn-primary .dc-app-emoji, .dc-btn-secondary .dc-app-emoji { color: #fff; }

.dc-select-wrap { position: relative; max-width: 400px; flex: 1 1 100%; min-width: 0; }
.dc-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  min-height: 40px; padding: 8px 8px 8px 12px;
  background: var(--dc-select); border: 1px solid var(--dc-select-border); border-radius: 8px;
  color: var(--dc-select-text); font: 400 16px/20px 'Noto Sans', 'gg sans', sans-serif; text-align: left; cursor: pointer;
  transition: border-color 150ms var(--dc-ease);
}
.dc-select:hover { border-color: #55565e; }
.dc-select .icon { width: 24px; height: 24px; color: var(--dc-text); transition: transform 200ms var(--dc-ease); }
.dc-select[aria-expanded='true'] .icon { transform: rotate(180deg); }
.dc-select-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dc-select:focus-visible, .dc-option:focus-visible { outline: 2px solid #00a8fc; outline-offset: 2px; }
.dc-menu {
  position: relative; margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--dc-menu); border: 1px solid var(--dc-embed-border); border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  transform-origin: top center;
  animation: dc-menu-in 160ms var(--dc-ease);
}
@keyframes dc-menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.dc-option { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 8px 12px; }
.dc-option:hover { background: var(--dc-menu-hover); }
.dc-option > .dc-emoji, .dc-option > .dc-app-emoji { grid-row: span 2; width: 22px; height: 22px; }
.dc-option-title { font-weight: 600; font-size: 16px; line-height: 20px; color: var(--dc-head); }
.dc-option-desc { font-size: 14px; line-height: 18px; color: #b5b6bc; }
.dc-option.no-emoji { grid-template-columns: 1fr; }
.dc-option.no-emoji > * { grid-row: auto; }

/* Profile popout of the bot on one server. */
.dc-profile { width: 300px; max-width: 100%; background: var(--dc-popout); border-radius: 8px; overflow: hidden; position: relative; padding-bottom: 16px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.28), 0 24px 48px -20px rgb(20 16 8 / 0.45); }
.dc-profile-banner { height: 105px; background: var(--dc-blurple) center / cover no-repeat; }
.dc-profile-avatar { position: absolute; top: 61px; left: 16px; width: 80px; height: 80px; border-radius: 50%; border: 6px solid var(--dc-popout); background: var(--dc-popout); object-fit: cover; }
.dc-profile-inner { margin: 52px 16px 0; background: var(--dc-popout-inner); border-radius: 8px; padding: 12px; display: grid; gap: 12px; }
.dc-profile-name { display: flex; align-items: center; gap: 4px; color: var(--dc-head); font-size: 20px; font-weight: 600; line-height: 24px; }
.dc-profile-heading { color: var(--dc-head); font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.dc-profile .dc-content { font-size: 14px; line-height: 18px; }

@media (max-width: 480px) {
  .dc-msg { padding-left: 60px; padding-right: 12px; }
  .dc-avatar { left: 12px; width: 36px; height: 36px; }
  .dc-head { padding: 0 12px; }
  .dc-embed { padding-right: 12px; }
  .dc-embed.has-thumb { grid-template-columns: minmax(0, 1fr) 64px; gap: 12px; }
  .dc-embed-thumb { width: 64px; height: 64px; }
}
