/* 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); border-radius: 4px 0 0 4px; padding-left: 12px; }
/* A code block keeps its spaces, so columns of names line up as in Discord. */
.dc-codeblock {
  margin: 6px 0 0; padding: 7px; max-width: 100%; overflow-x: auto;
  background: var(--dc-code); border: 1px solid var(--dc-header-border); border-radius: 4px;
  color: var(--dc-text-soft); font: 14px/18px Consolas, 'Andale Mono WT', 'Andale Mono', monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.dc-codeblock code { font: inherit; }
.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; grid-template-columns: minmax(0, 1fr); 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 {
  /* Discord opens a message's select menu upward, over the message above it. */
  position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); z-index: 5;
  margin: 0; padding: 4px 0; list-style: none;
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  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: bottom 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-select-wrap.is-live .dc-option { cursor: pointer; }
.dc-select-wrap.is-live .dc-option.is-active { background: var(--dc-menu-hover); }
.dc-menu:focus-visible { outline: 2px solid #00a8fc; outline-offset: 2px; }
.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; }

/* Components V2: the whole message is built from components. A container is a box like an embed, with an
   optional accent bar on the left; its children sit 8px apart. Text displays use the message text size, a
   section puts its button or thumbnail to the right of its text, and a separator is a gap of 8px (small) or
   16px (large) with an optional line. */
.dc-v2 { display: grid; gap: 8px; max-width: 560px; margin-top: 2px; }
.dc-v2-container {
  position: relative; display: grid; gap: 8px; padding: 16px;
  background: var(--dc-embed); border: 1px solid var(--dc-embed-border); border-radius: 8px;
  font-size: 16px; line-height: 22px; color: var(--dc-text);
}
.dc-v2-container.has-accent { border-left: 0; border-radius: 4px 8px 8px 4px; }
.dc-v2-container.has-accent::before { content: ''; position: absolute; left: 0; top: -1px; bottom: -1px; width: 4px; border-radius: 4px 0 0 4px; background: var(--bar); }
.dc-v2-container .dc-mention { background: var(--dc-mention-embed-bg); }
.dc-v2-text { min-width: 0; overflow-wrap: anywhere; }
.dc-v2-text > .dc-h:first-child { margin-top: 0; }
.dc-v2-text .dc-emoji { width: 22px; height: 22px; vertical-align: -6px; }
.dc-v2-text .dc-app-emoji { width: 20px; height: 20px; vertical-align: -4px; }
.dc-v2-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.dc-v2-section.has-thumb { align-items: start; }
.dc-v2-section-text { display: grid; gap: 8px; min-width: 0; }
.dc-v2-accessory { display: flex; justify-content: flex-end; }
.dc-v2-thumb { width: 85px; height: 85px; object-fit: cover; border-radius: 8px; }
.dc-v2-sep { height: 0; margin: 0; }
.dc-v2-sep:not(.no-line) { border-top: 1px solid rgb(255 255 255 / 0.1); }
.dc-v2-sep.is-large { margin: 8px 0; }
.dc-v2-gallery { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; }
.dc-v2-gallery.n-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dc-v2-gallery.n-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dc-v2-media { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.dc-v2-gallery.n-1 .dc-v2-media { object-fit: contain; }
.dc-v2-container.is-spoiler > * { filter: blur(44px); }
.dc-subtext { color: var(--dc-muted); font-size: 13px; line-height: 18px; }

/* 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; }
  .dc-v2-container { padding: 12px; }
  .dc-v2-thumb { width: 64px; height: 64px; }
}

/* Interactive previews (the showcase). A preview without onAction draws its buttons without any pointer or
   hover change, so nothing looks pressable that cannot be pressed; a working button reacts like Discord's. */
.dc-btn.is-live { cursor: pointer; transition: background-color 180ms var(--dc-ease), opacity 180ms var(--dc-ease); }
.dc-btn-primary.is-live:hover:not(:disabled) { background: var(--dc-blurple-hover); }
.dc-btn-secondary.is-live:hover:not(:disabled) { background: var(--dc-grey-hover); }
.dc-btn-success.is-live:hover:not(:disabled) { background: #006b38; }
.dc-btn-danger.is-live:hover:not(:disabled) { background: #b02530; }
.dc-btn.is-live:disabled { opacity: 0.5; cursor: not-allowed; }
.dc-btn.is-live:focus-visible { outline: 2px solid #00a8fc; outline-offset: 2px; }
.dc-mention-link { border: 0; font: inherit; cursor: pointer; transition: background-color 180ms var(--dc-ease), color 180ms var(--dc-ease); }
.dc-mention-link:hover, .dc-mention-link:focus-visible { background: var(--dc-blurple); color: #fff; }
.dc-mention-link:focus-visible { outline: 2px solid #00a8fc; outline-offset: 2px; }

/* The line above the answer to a slash command: "Mira used /level". */
.dc-msg.has-cmd { margin-top: 17px; padding-top: 22px; }
.dc-msg.has-cmd .dc-avatar { top: 26px; }
.dc-cmd { position: absolute; left: 72px; right: 16px; top: 0; display: flex; align-items: center; gap: 4px; height: 18px; font-size: 14px; line-height: 18px; color: var(--dc-muted); white-space: nowrap; overflow: hidden; }
.dc-cmd-spine { position: absolute; left: -36px; top: 8px; width: 33px; height: 12px; border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px; }
.dc-cmd-avatar { flex: none; width: 16px; height: 16px; border-radius: 50%; background: #5865f2; }
.dc-cmd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dc-cmd-name { color: var(--dc-mention-text); font-weight: 500; }
.dc-cmd-command { color: var(--dc-link); }

/* A message only its reader sees. */
.dc-msg.is-ephemeral { background: rgb(88 101 242 / 0.06); }
.dc-ephemeral { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--dc-muted); }
.dc-ephemeral .icon { width: 16px; height: 16px; }

/* A file attached to a message. */
.dc-file {
  display: flex; align-items: center; gap: 8px; max-width: 432px; margin-top: 8px; padding: 16px;
  background: #2b2c31; border: 1px solid #26272b; border-radius: 8px;
}
.dc .dc-file-icon { flex: none; width: 30px; height: 40px; color: #b5bac1; stroke-width: 1.5; }
.dc-file-text { display: grid; min-width: 0; }
.dc-file-name { color: var(--dc-link); font-size: 16px; line-height: 20px; text-decoration: none; overflow-wrap: anywhere; }
a.dc-file-name:hover { text-decoration: underline; }
a.dc-file-name:focus-visible { outline: 2px solid #00a8fc; outline-offset: 2px; border-radius: 2px; }
.dc-file-size { color: var(--dc-muted); font-size: 12px; line-height: 16px; }

/* The header of a direct message. */
.dc-at { width: 24px; text-align: center; color: #80848e; font-size: 22px; font-weight: 500; line-height: 24px; }

/* Discord's form dialog, drawn over the window it belongs to. */
.dc-modal-layer {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px;
  background: rgb(0 0 0 / 0.7); animation: dc-fade 200ms var(--dc-ease);
}
@keyframes dc-fade { from { opacity: 0; } }
.dc-modal {
  width: 100%; max-width: 440px; display: grid; gap: 8px; padding: 16px; border-radius: 12px;
  background: #393a41; border: 1px solid #44454c; box-shadow: 0 8px 24px rgb(0 0 0 / 0.4);
  animation: dc-modal-in 240ms var(--dc-ease);
}
@keyframes dc-modal-in { from { opacity: 0; transform: scale(0.96); } }
.dc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dc-modal-title { margin: 0; color: var(--dc-head); font-size: 20px; line-height: 24px; font-weight: 600; }
.dc-modal-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #b5bac1; cursor: pointer; }
.dc-modal-close:hover { color: var(--dc-head); background: rgb(255 255 255 / 0.06); }
.dc-modal-label { color: var(--dc-head); font-size: 16px; font-weight: 500; line-height: 20px; }
.dc-required { color: #f23f42; margin-left: 4px; }
.dc-modal-input {
  width: 100%; height: 40px; padding: 8px 12px; border: 1px solid #4e5058; border-radius: 8px;
  background: #2b2c31; color: var(--dc-text); font: 400 16px/20px 'Noto Sans', 'gg sans', sans-serif;
}
.dc-modal-input:focus { outline: none; border-color: #00a8fc; }
.dc-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dc-modal-cancel {
  height: 38px; padding: 2px 16px; border: 0; border-radius: 8px; background: transparent; color: var(--dc-text);
  font: 500 14px/16px 'Noto Sans', 'gg sans', sans-serif; cursor: pointer;
}
.dc-modal-cancel:hover { text-decoration: underline; }
.dc-modal .dc-btn { height: 38px; padding: 2px 16px; }
.dc-modal button:focus-visible { outline: 2px solid #00a8fc; outline-offset: 2px; }

@media (max-width: 480px) {
  .dc-cmd { left: 60px; right: 12px; }
  .dc-cmd-spine { left: -32px; width: 29px; }
  .dc-file { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .dc *, .dc *::before, .dc *::after, .dc-modal-layer, .dc-modal {
    animation-duration: 1ms !important; transition-duration: 1ms !important;
  }
}
