#tab-chat .cht-format-link {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#tab-chat .cht-format-link:focus-visible,
#tab-chat .cht-format-spoiler:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#tab-chat .cht-bd code {
  border-radius: 3px;
  background: var(--bg2);
  padding: .08em .24em;
  font-family: monospace;
  font-size: .94em;
}

#tab-chat .cht-format-code {
  margin: 4px 0;
  padding: 8px 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
  white-space: pre-wrap;
}

#tab-chat .cht-format-code code {
  padding: 0;
}

#tab-chat .cht-format-quote {
  margin: 4px 0;
  padding-inline-start: 9px;
  border-inline-start: 2px solid var(--line);
  color: var(--tx2);
}

#tab-chat .cht-format-spoiler {
  max-inline-size: 100%;
  padding: 0 4px;
  border: 0;
  border-radius: 3px;
  background: var(--tx);
  color: inherit;
  font: inherit;
  line-height: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
}

#tab-chat .cht-format-spoiler[aria-expanded=false] .cht-format-spoiler-text {
  visibility: hidden;
}

#tab-chat .cht-format-spoiler[aria-expanded=true] {
  background: var(--bg2);
}

#tab-chat .cht-format-tools:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-block: 0 5px;
}

#tab-chat .cht-format-tools button {
  min-inline-size: 32px;
  min-block-size: 34px;
}
