/* Discord previews. Colors are sampled from the real screenshots in assets/img (Discord's current dark
   theme, 2025 refresh); sizes are Discord's own at 100% zoom. The screenshots were taken at 150% zoom and are
   shown at 1/1.5 of their pixel size, so screenshots and these components have the same scale.
   gg sans is Discord's proprietary face and is not licensed for the web, so Noto Sans stands in. */

.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-modal: #393a41;
  --dc-input: #35353c;
  --dc-input-border: #44444b;
  --dc-blurple: #5865f2;
  --dc-blurple-hover: #4752c4;
  --dc-green: #008545;
  --dc-green-hover: #00703a;
  --dc-red: #d22d39;
  --dc-red-hover: #b3242f;
  --dc-grey: #44454c;
  --dc-grey-hover: #4e5058;
  --dc-mention-bg: #464662;
  --dc-mention-embed-bg: #40446b;
  --dc-mention-text: #cdd7ff;
  --dc-highlight: #413c35;
  --dc-highlight-bar: #f0b232;
  --dc-warn-bg: #48423c;
  --dc-warn-border: #816129;
  --dc-required: #ffa09b;
  --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: var(--shadow-window, 0 0 0 1px rgb(0 0 0 / 0.28), 0 24px 48px -20px rgb(20 16 8 / 0.45));
}
.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-dc-hash { width: 24px; height: 24px; color: #80848e; }
.dc-channel { display: inline-flex; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-views { position: relative; transition: height 260ms var(--dc-ease); }
.dc-views.is-resizing { overflow: hidden; }
.dc-view { padding: 8px 0 20px; transition: opacity 220ms var(--dc-ease), transform 220ms var(--dc-ease); }
.dc-view[data-state='hidden'] { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateX(-12px); visibility: hidden; pointer-events: none; transition: opacity 180ms var(--dc-ease), transform 180ms var(--dc-ease), visibility 0s linear 180ms; }
.dc-view[data-state='entering'] { opacity: 0; transform: translateX(12px); }

/* Screenshot inside a Discord window. */
.dc-shot { padding: 0; }
.dc-shot img { height: auto; }

/* Message */
.dc-msg { position: relative; padding: 2px 16px 2px 72px; margin-top: 17px; min-height: 44px; }
.dc-msg.is-mention { background: var(--dc-highlight); }
.dc-msg.is-mention::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--dc-highlight-bar); }
.dc-msg.is-follow { margin-top: 0; padding-top: 2px; min-height: 0; }
.dc-avatar { position: absolute; left: 16px; top: 4px; width: 40px; height: 40px; border-radius: 50%; }
.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-role { background: rgb(251 191 36 / 0.16); color: #fbbf24; }
.dc-embed .dc-mention { background: var(--dc-mention-embed-bg); }

/* Embed */
.dc-embed {
  position: relative; display: grid; gap: 8px; max-width: 520px; margin-top: 2px;
  padding: 8px 16px 16px 12px;
  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::before { content: ''; position: absolute; left: 0; top: -1px; bottom: -1px; width: 4px; border-radius: 4px 0 0 4px; background: var(--bar, var(--dc-blurple)); }
.dc-embed { margin-left: 0; padding-left: 16px; }
.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 .icon { width: 24px; height: 24px; color: var(--accent-color, #3b83f6); }
.dc-embed-title { font-weight: 600; font-size: 16px; line-height: 22px; color: var(--dc-head); margin-top: 4px; }
.dc-embed-desc { white-space: normal; }
.dc-embed-desc p + p { margin-top: 18px; }
.dc-embed-desc .icon, .dc-inline-icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 2px; color: var(--accent-color, #3b83f6); }
.dc-option-line { margin-top: 18px; }
.dc-option-line strong { color: var(--dc-head); font-weight: 600; }
.dc-option-line > .icon { margin-right: 6px; }
.dc-fields { display: flex; flex-wrap: wrap; gap: 8px 0; margin-top: 2px; }
.dc-field { flex: 1 1 auto; min-width: 0; padding-right: 8px; }
.dc-field.is-block { flex-basis: 100%; }
.dc-field-name { font-weight: 600; color: var(--dc-head); margin-bottom: 2px; }
.dc-field-value { overflow-wrap: anywhere; white-space: pre-wrap; }
.dc-embed-footer { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--dc-text); margin-top: 0; }
.dc-embed.is-compact { padding-top: 12px; padding-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; width: fit-content; }
.dc-embed.is-compact .icon { color: var(--accent-color); flex: none; width: 20px; height: 20px; }

/* 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: pointer;
  font: 500 14px/16px 'Noto Sans', 'gg sans', sans-serif;
  transition: background-color 170ms var(--dc-ease), filter 170ms var(--dc-ease);
}
.dc-btn .icon { width: 18px; height: 18px; }
.dc-btn-success { background: var(--dc-green); }
.dc-btn-success .icon { color: #4ade80; }
.dc-btn-success:hover { background: var(--dc-green-hover); }
.dc-btn-danger { background: var(--dc-red); }
.dc-btn-danger .icon { color: #f87171; }
.dc-btn-danger:hover { background: var(--dc-red-hover); }
.dc-btn-primary { background: var(--dc-blurple); }
.dc-btn-primary:hover { background: var(--dc-blurple-hover); }
.dc-btn-secondary { background: var(--dc-grey); }
.dc-btn-secondary:hover { background: var(--dc-grey-hover); }
.dc-btn:focus-visible, .dc-select:focus-visible, .dc-option:focus-visible, .dc-input:focus-visible { outline: 2px solid #00a8fc; outline-offset: 2px; }
.dc-static .dc-btn, .dc-static .dc-select { cursor: default; }
.dc-static .dc-btn:hover { filter: none; }
.dc-static .dc-btn-success:hover { background: var(--dc-green); }
.dc-static .dc-btn-danger:hover { background: var(--dc-red); }

.dc-select-wrap { position: relative; max-width: 400px; }
.dc-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  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; }

.dc-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); z-index: 5;
  margin: 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: bottom center;
  transition: opacity 160ms var(--dc-ease), transform 160ms var(--dc-ease), visibility 0s linear 0s;
}
.dc-menu[data-state='hidden'] { opacity: 0; transform: translateY(4px) scale(0.98); visibility: hidden; pointer-events: none; transition: opacity 120ms var(--dc-ease), transform 120ms var(--dc-ease), visibility 0s linear 120ms; }
.dc-option {
  display: grid; grid-template-columns: 24px 1fr; gap: 2px 12px; align-items: start;
  padding: 8px 12px; cursor: pointer; border-radius: 0;
  transition: background-color 120ms var(--dc-ease);
}
.dc-option:hover, .dc-option.is-active { background: var(--dc-menu-hover); }
.dc-option .icon { grid-row: span 2; width: 24px; height: 24px; color: #3b83f6; align-self: center; }
.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; }

/* Modal */
.dc-layer {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px;
  background: rgb(0 0 0 / 0.7);
  transition: opacity 200ms var(--dc-ease), visibility 0s linear 0s;
}
.dc-layer[data-state='hidden'] { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 160ms var(--dc-ease), visibility 0s linear 160ms; }
.dc-modal {
  width: 100%; max-width: 480px; max-height: 100%; overflow: auto;
  background: var(--dc-modal); border: 1px solid var(--dc-embed-border); border-radius: 12px;
  box-shadow: 0 16px 48px rgb(0 0 0 / 0.5);
  transition: transform 200ms var(--dc-ease);
}
.dc-layer[data-state='hidden'] .dc-modal { transform: scale(0.96); }
.dc-modal-head { display: flex; align-items: center; gap: 10px; padding: 20px 16px 0 24px; }
.dc-modal-head img { width: 24px; height: 24px; border-radius: 50%; }
.dc-modal-title { flex: 1; font-weight: 600; font-size: 20px; line-height: 24px; color: var(--dc-head); }
.dc-modal-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; color: var(--dc-select-text); cursor: pointer; border-radius: 6px; transition: color 150ms var(--dc-ease); }
.dc-modal-close:hover { color: #fff; }
.dc-modal-close .icon { width: 24px; height: 24px; }
.dc-modal-body { display: grid; gap: 20px; padding: 20px 24px 0; }
.dc-warning {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px;
  background: var(--dc-warn-bg); border: 1px solid var(--dc-warn-border); border-radius: 8px;
  font-size: 14px; line-height: 18px; color: var(--dc-text);
}
.dc-warning .icon { width: 18px; height: 18px; color: #f0b232; fill: #f0b232; stroke: var(--dc-warn-bg); margin-top: 1px; }
.dc-warning strong { color: var(--dc-head); font-weight: 600; }
.dc-label { display: block; font-weight: 600; font-size: 16px; line-height: 20px; color: var(--dc-head); margin-bottom: 8px; }
.dc-label .req { color: var(--dc-required); margin-left: 2px; }
.dc-error { display: block; color: var(--dc-required); font-size: 14px; line-height: 18px; margin-top: 6px; }
.dc-error[hidden] { display: none; }
.dc-input {
  display: block; width: 100%; padding: 10px 12px;
  background: var(--dc-input); border: 1px solid var(--dc-input-border); border-radius: 8px;
  color: var(--dc-text); font: 400 16px/20px 'Noto Sans', 'gg sans', sans-serif;
  transition: border-color 150ms var(--dc-ease);
  resize: none;
}
.dc-input::placeholder { color: #8e8f96; }
.dc-input:focus { border-color: var(--dc-blurple); outline: none; }
.dc-input[aria-invalid='true'] { border-color: var(--dc-required); }
textarea.dc-input { min-height: 88px; }
.dc-modal-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 24px; }
.dc-modal-foot .dc-btn { height: 40px; font-size: 16px; font-weight: 600; width: 100%; }

/* Messages that arrive one after another. */
.dc-arrive { animation: dc-arrive 260ms var(--dc-ease) both; }
@keyframes dc-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dc-pending { display: none; }
.dc-flash { animation: dc-flash 900ms var(--dc-ease); }
@keyframes dc-flash { 0% { background-color: rgb(88 101 242 / 0.35); } 100% { background-color: transparent; } }

/* Ephemeral reply */
.dc-ephemeral-note { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--dc-muted); }
.dc-ephemeral-note .icon { width: 16px; height: 16px; }

/* Slash command list */
.dc-commands { padding: 12px 12px 8px; }
.dc-commands-title { font-size: 14px; font-weight: 600; color: var(--dc-select-text); padding: 0 4px 8px; }

/* On a phone a screenshot keeps Discord's own size and can be swiped sideways inside its window, so the
   text stays readable; the page itself never scrolls sideways. */
@media (max-width: 600px) {
  .dc-shot { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .dc-shot img { max-width: none; }
}

@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-modal-body { padding-inline: 16px; }
  .dc-modal-head { padding-left: 16px; }
  .dc-modal-foot { padding: 20px 16px; }
}

.dc-channel-link { border: 0; font: inherit; line-height: inherit; cursor: pointer; transition: background-color 150ms var(--dc-ease), color 150ms var(--dc-ease); }
.dc-channel-link:hover { background: var(--dc-blurple); color: #fff; }

.dc-content > .icon { width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; color: #22c55e; }
.dc-window-small .dc-view { padding: 4px 0 16px; }
.dc-components > *, .dc-select-wrap, .dc-select-label { min-width: 0; }

/* Static previews: titled blocks inside an embed, as the bots lay them out. */
.dc-plan { margin-top: 18px; }
.dc-plan p + p { margin-top: 2px; }
.dc-plan-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 16px; line-height: 22px; color: var(--dc-head); }
.dc-plan-name .icon { width: 20px; height: 20px; margin: 0; }
.dc-plan strong { color: var(--dc-head); font-weight: 600; }
.dc-static .dc-select:hover { border-color: var(--dc-select-border); }
.dc-embed strong { color: var(--dc-head); font-weight: 600; }
