/* Evidence screenshots */
figure.evidence {
  margin: 1.5em auto 0.5em;
  max-width: 100%;
}
figure.evidence img {
  max-height: 80vh;
  width: auto;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 4px;
}

/* Content-warning images stay blurred until clicked */
figure.sensitive { position: relative; }
figure.sensitive:not(.revealed) img { filter: blur(28px); }
figure.sensitive:not(.revealed) a { pointer-events: none; }
figure.sensitive .cw {
  position: absolute; z-index: 2; top: 40%; left: 50%; transform: translate(-50%, -50%);
  background: var(--md-default-bg-color); color: var(--md-default-fg-color);
  border: 1px solid var(--md-default-fg-color--lighter);
  padding: 0.6em 1em; border-radius: 4px; cursor: pointer; font-weight: 600;
}
figure.sensitive.revealed .cw { display: none; }

/* Verbatim text from witnesses and OCR: keep line breaks exactly */
.verbatim {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.75rem;
  line-height: 1.55;
  padding: 0.6em 0.9em;
  border-left: 3px solid var(--md-default-fg-color--lighter);
  background: var(--md-code-bg-color);
  margin: 0.4em 0 1em;
}
.md-typeset details .verbatim { border-left: none; background: none; padding: 0; margin: 0; }

.source-label {
  font-family: var(--md-code-font-family);
  font-size: 0.65rem;
  color: var(--md-default-fg-color--light);
  margin-top: 1em;
}

/* Transcripts: one line per cue, linkable by number */
.transcript p {
  display: grid;
  grid-template-columns: 3em 5.2em 7.5em 1fr;
  gap: 0.6em;
  margin: 0 !important;
  padding: 0.15em 0.2em;
  font-size: 0.75rem;
}
.transcript p:target { background: var(--md-accent-fg-color--transparent); }
.transcript .cue { color: var(--md-default-fg-color--lighter); text-align: right; }
.transcript .ts { font-family: var(--md-code-font-family); color: var(--md-default-fg-color--light); }
.transcript .spk { font-family: var(--md-code-font-family); font-size: 0.65rem; color: var(--md-default-fg-color--light); }
@media (max-width: 600px) {
  .transcript p { grid-template-columns: 2.5em 1fr; }
  .transcript .ts, .transcript .spk { display: none; }
}

video, audio { width: 100%; max-height: 70vh; margin-top: 0.5em; }


/* Per-screenshot headings act as captions */
.md-typeset h4.shot {
  font-family: var(--md-code-font-family);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--md-default-fg-color--light);
  margin: 2em 0 0.3em;
  text-align: center;
}
.md-typeset h4.shot:target + figure img { outline: 3px solid var(--md-accent-fg-color); }


/* ------------------------------------------------------------------
   Remastered chats (```chat blocks, rendered by tools/chat.py).
   Layout follows Discord / DiscordChatExporter; colours follow the
   site's light/dark switch.
   ------------------------------------------------------------------ */
.chat {
  --c-bg: #ffffff;
  --c-text: #313338;
  --c-name: #060607;
  --c-muted: #5c5e66;
  --c-line: #e1e2e4;
  --c-spine: #c4c9ce;
  --c-hover: #f5f6f7;
  --c-code: #f2f3f5;
  --c-tag: #ebebed;
  --c-mention-bg: rgba(88, 101, 242, 0.15);
  --c-mention: #505cdc;
  --c-target: rgba(88, 101, 242, 0.12);
  font-family: "gg sans", "Noto Sans", var(--md-text-font-family), "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  line-height: 1.375;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 0.25rem 0 1rem;
  margin: 1em 0 1.5em;
  overflow-wrap: anywhere;
}
[data-md-color-scheme="slate"] .chat {
  --c-bg: #313338;
  --c-text: #dbdee1;
  --c-name: #f2f3f5;
  --c-muted: #949ba4;
  --c-line: #3f4147;
  --c-spine: #4e5058;
  --c-hover: #2e3035;
  --c-code: #2b2d31;
  --c-tag: #3f4147;
  --c-mention-bg: rgba(88, 101, 242, 0.3);
  --c-mention: #c9cdfb;
  --c-target: rgba(88, 101, 242, 0.2);
}

.chat-title {
  padding: 0.6rem 1rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--c-line);
  font-weight: 600;
  color: var(--c-name);
}
.chat-title-sym { margin-right: 0.35rem; color: var(--c-muted); font-weight: 500; }
.chat-draft {
  margin: 0.6rem 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  border-left: 4px solid #faa61a;
  background: rgba(250, 166, 26, 0.12);
  font-size: 0.875em;
}

/* One author block: avatar on the left, header + lines on the right */
.chat-group {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 16px;
  margin-top: 1.0625rem;
  padding: 0.125rem 1rem 0.125rem 1rem;
}
.chat-group:hover { background: var(--c-hover); }
.chat-group--bare { display: block; padding-left: calc(1rem + 56px); }
.chat-avatar {
  grid-column: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-top: 0.125rem;
  object-fit: cover;
}
.chat-avatar--initial, .chat-reply-avatar.chat-avatar--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  user-select: none;
}
.chat-body { grid-column: 2; min-width: 0; }
.chat-header { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.25rem; }
.chat-author { font-weight: 600; color: var(--c-name); }
.chat-tag {
  align-self: center;
  padding: 0 0.3rem;
  border-radius: 4px;
  background: var(--c-tag);
  color: var(--c-name);
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1.4;
}
.chat-time { margin-left: 0.15rem; color: var(--c-muted); font-size: 0.75em; font-weight: 500; }
.chat-msg { padding: 0.0625rem 0; white-space: pre-wrap; }
.chat-msg--blank { min-height: 1.375em; }
.chat-sub { color: var(--c-muted); font-size: 0.8125em; }
.chat-edited { color: var(--c-muted); font-size: 0.625rem; }

/* Reply preview with the curved "spine" down to the avatar */
.chat-reply {
  grid-column: 1 / -1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 56px;
  margin-bottom: 0.125rem;
  font-size: 0.875em;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
}
.chat-reply::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  bottom: -0.2rem;
  width: 30px;
  border-left: 2px solid var(--c-spine);
  border-top: 2px solid var(--c-spine);
  border-top-left-radius: 6px;
}
.chat-reply-avatar { width: 16px; height: 16px; border-radius: 50%; flex: none; font-size: 0.55rem; }
.chat-reply-author { font-weight: 600; color: var(--c-name); opacity: 0.9; flex: none; }
.chat-reply-text { overflow: hidden; text-overflow: ellipsis; }

/* Discord-flavoured inline formatting */
.chat code {
  padding: 0.1em 0.25em;
  border-radius: 3px;
  background: var(--c-code);
  color: inherit;
  font-size: 0.85em;
}
.chat blockquote {
  margin: 0;
  padding: 0 0 0 0.75rem;
  border-left: 4px solid var(--c-spine);
  color: inherit;
}
.chat a { color: #00a8fc; }
.chat-mention {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--c-mention-bg);
  color: var(--c-mention);
  font-weight: 500;
}
.chat-spoiler {
  padding: 0 2px;
  border-radius: 3px;
  background: #1e1f22;
  color: transparent;
  cursor: pointer;
}
.chat-spoiler.revealed { background: var(--c-code); color: inherit; cursor: auto; }
.chat-redacted {
  display: inline-block;
  min-width: 5em;
  padding: 0 0.3em;
  border-radius: 2px;
  background: #000;
  color: #000;
  font-size: 0.85em;
  line-height: 1.3;
  vertical-align: baseline;
  user-select: none;
}
[data-md-color-scheme="slate"] .chat-redacted { background: #0b0b0c; color: #0b0b0c; outline: 1px solid #4e5058; }
.chat-attachment {
  display: block;
  max-width: min(100%, 400px);
  max-height: 350px;
  margin: 0.25rem 0;
  border-radius: 8px;
}

/* Date divider, system notices, archive notes */
.chat-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 1rem 0.5rem;
  color: var(--c-muted);
  font-size: 0.75em;
  font-weight: 600;
}
.chat-divider::before, .chat-divider::after { content: ""; flex: 1; border-top: 1px solid var(--c-line); }
.chat-divider span { padding: 0 0.5rem; }
.chat-system {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 16px;
  margin-top: 1rem;
  padding: 0.125rem 1rem;
  color: var(--c-muted);
}
.chat-system-icon { text-align: center; color: #3ba55c; font-weight: 700; }
.chat-note {
  margin: 1rem 1rem 0;
  padding: 0.4rem 0.75rem;
  border-left: 3px solid var(--md-accent-fg-color);
  background: var(--c-hover);
  font-family: var(--md-text-font-family);
  font-size: 0.9em;
  font-style: italic;
}
.chat-note strong { font-style: normal; }

/* "From here on, see screenshot X" markers: also the targets of #bd1-style links */
.chat-shot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 1rem -0.5rem;
  font-family: var(--md-code-font-family);
  font-size: 0.6rem;
  scroll-margin-top: 4rem;
}
.chat-shot::before { content: ""; flex: 1; border-top: 1px dashed var(--c-line); }
.chat-shot--inline { margin: 0.4rem 0; }
.chat .chat-shot a { color: var(--c-muted); }
.chat .chat-shot a::before { content: "\1F4F7\FE0E  "; }
.chat .chat-shot a:hover { color: var(--md-accent-fg-color); }
.chat-shot:target { background: var(--c-target); }
.chat-shot:target a { color: var(--md-accent-fg-color); font-weight: 700; }

@media (max-width: 600px) {
  .chat { margin-left: -0.8rem; margin-right: -0.8rem; border-radius: 0; border-left: 0; border-right: 0; }
  .chat-group, .chat-system { grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; padding-left: 0.75rem; padding-right: 0.75rem; }
  .chat-avatar { width: 32px; height: 32px; }
  .chat-reply { padding-left: 44px; }
  .chat-reply::before { left: 15px; width: 26px; }
  .chat-group--bare { padding-left: calc(0.75rem + 44px); }
}

/* Original screenshots, collapsed at the bottom of remastered pages */
.md-typeset figure.evidence figcaption {
  font-family: var(--md-code-font-family);
  font-size: 0.65rem;
  color: var(--md-default-fg-color--light);
  max-width: none;
}
.md-typeset figure.evidence:target img { outline: 3px solid var(--md-accent-fg-color); }
