/* Rich chat (workstream S4, docs/rich-content/images-and-rich-chat-plan.md):
   the chat window's documents and pictures, the game window's one-line form
   with thumbnails, the composer, the line menu, report and 13+ windows and
   the picture viewer. Only with CHAT_RICH on (play.js). Kept in this file,
   apart from the rest of the page's styles. */

/* ----- the chat window's documents ----- */
.chat-line.chat-rich { white-space: normal; position: relative; padding-right: 22px; }
.chat-line.chat-rich .chat-text { white-space: normal; }
/* the lead ("Alus gossips, '") runs into the first paragraph and the tail
   follows the last one, so a one-paragraph line reads as one line */
.quill-chat { display: inline; }
.quill-chat > p:first-child, .quill-chat > p:last-child { display: inline; }
.quill-chat > p:first-child + p:last-child::before { content: "\A"; white-space: pre; }
.quill-chat > p, .quill-chat .quill-quote p { margin: 0 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.quill-chat .quill-list { margin: 0 0 2px; padding-left: 1.6em; }
.quill-chat li > .quill-list { margin: 0; padding-left: 1.3em; }
.quill-chat .quill-quote {
  --quill-l: 0; --quill-r: 0;
  margin: 2px min(calc(var(--quill-r) * 2.5em), 20%) 4px min(calc(var(--quill-l) * 2.5em), 20%);
  padding: 0.2em 0.7em;
  border-left: 3px solid var(--gilt);
  /* a raised panel, like the website's syntax callouts (owner 2026-11-15);
     a tint of the text colour so it lifts on every colour scheme */
  background: color-mix(in srgb, currentColor 6%, transparent);
  border-radius: 2px;
}
.quill-chat .quill-center { text-align: center; }
.quill-chat .quill-right { text-align: right; }
.quill-chat .quill-indent { margin-left: min(calc(var(--quill-l) * 2.5em), 20%); }
.quill-chat .quill-ml-0 { --quill-l: 0; } .quill-chat .quill-mr-0 { --quill-r: 0; }
.quill-chat .quill-ml-1 { --quill-l: 1; } .quill-chat .quill-mr-1 { --quill-r: 1; }
.quill-chat .quill-ml-2 { --quill-l: 2; } .quill-chat .quill-mr-2 { --quill-r: 2; }
.quill-chat .quill-ml-3 { --quill-l: 3; } .quill-chat .quill-mr-3 { --quill-r: 3; }
.quill-chat .quill-ml-4 { --quill-l: 4; } .quill-chat .quill-mr-4 { --quill-r: 4; }
.quill-chat .quill-ml-5 { --quill-l: 5; } .quill-chat .quill-mr-5 { --quill-r: 5; }
.quill-chat .quill-ml-6 { --quill-l: 6; } .quill-chat .quill-mr-6 { --quill-r: 6; }
.quill-chat .quill-ml-7 { --quill-l: 7; } .quill-chat .quill-mr-7 { --quill-r: 7; }
.quill-chat .quill-ml-8 { --quill-l: 8; } .quill-chat .quill-mr-8 { --quill-r: 8; }
:is(.quill-chat, .chat-rich-row) .quill-kbd, :is(.quill-chat, .chat-rich-row) .quill-code { font-family: var(--font); font-size: 0.92em; }
:is(.quill-chat, .chat-rich-row) .quill-kbd-lower { text-transform: lowercase; }
:is(.quill-chat, .chat-rich-row) .quill-arg { font-family: var(--font); font-style: italic; color: var(--arg); }
:is(.quill-chat, .chat-rich-row) .quill-c-bold { font-weight: 600; }
:is(.quill-chat, .chat-rich-row) .quill-c-examples { font-family: var(--font); color: var(--gilt-bright); }
:is(.quill-chat, .chat-rich-row) .quill-c-reverse { background: var(--parchment); color: var(--ink); }
:is(.quill-chat, .chat-rich-row) .quill-blink { text-decoration: underline dotted; }
:is(.quill-chat, .chat-rich-row) a { color: var(--gilt-bright); text-decoration: underline dotted 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
:is(.quill-chat, .chat-rich-row) a:is(:hover, :focus-visible) { text-decoration-style: solid; text-decoration-color: currentColor; }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-black { color: var(--i0); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-black.quill-bright { color: var(--i8); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-black { background: var(--f0); }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-red { color: var(--i1); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-red.quill-bright { color: var(--i9); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-red { background: var(--f1); }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-green { color: var(--i2); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-green.quill-bright { color: var(--i10); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-green { background: var(--f2); }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-yellow { color: var(--i3); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-yellow.quill-bright { color: var(--i11); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-yellow { background: var(--f3); }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-blue { color: var(--i4); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-blue.quill-bright { color: var(--i12); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-blue { background: var(--f4); }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-purple { color: var(--i5); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-purple.quill-bright { color: var(--i13); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-purple { background: var(--f5); }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-cyan { color: var(--i6); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-cyan.quill-bright { color: var(--i14); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-cyan { background: var(--f6); }
:is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-white { color: var(--i7); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-fg-white.quill-bright { color: var(--i15); } :is(.quill-chat, .chat-rich-row, .chat-rich) .quill-bg-white { background: var(--f7); }
.chat-removed { color: var(--muted); font-style: italic; }

/* Pictures: at most 240 × 240 (the box reserved from w/h before the file
   comes), at most 60 % of the window on a phone. */
.quill-chat-img { margin: 4px 0; line-height: 0; }
.quill-chat-img img {
  max-width: min(240px, 100%); height: auto; border-radius: 4px; cursor: zoom-in;
  background: color-mix(in srgb, var(--parchment) 8%, transparent);
  outline: 1px solid var(--rule);
}
@media (max-width: 600px) { .quill-chat-img img { max-width: 60%; } }
.quill-chat-hidden { line-height: normal; }
.quill-chat-reveal, .quill-chat-failed {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  width: min(var(--w, 240px), 100%); min-height: min(var(--h, 180px), 120px);
  padding: 8px; box-sizing: border-box; border: 1px dashed var(--rule-strong, var(--rule)); border-radius: 4px;
  background: none; color: var(--muted); font: inherit; font-style: italic; cursor: pointer; line-height: 1.3;
}
.quill-chat-reveal:hover, .quill-chat-reveal:focus-visible { color: var(--parchment); border-color: var(--gilt); outline: none; }
/* a picture that didn't load: its description, and a click tries again */
.quill-chat-img.quill-chat-failed { line-height: 1.3; }
.quill-chat-img.quill-chat-failed img { display: none; }
.quill-chat-img.quill-chat-failed::before { content: attr(data-alt); }
.quill-chat-alt, .quill-chat-gone { margin: 2px 0; color: var(--muted); font-style: italic; }
.quill-chat-gone-why { font-style: normal; font-size: 0.85em; }

/* ----- the game window's one-line form ----- */
.chat-rich-row .quill-chat-thumb {
  /* sized by its width/height attributes (fitted to 64), so the line has
     its room before the file comes */
  max-width: 64px; max-height: 64px; object-fit: contain; vertical-align: middle;
  margin: 1px 2px; border-radius: 3px; cursor: zoom-in; outline: 1px solid var(--rule);
}
.chat-rich-row .quill-chat-sep { color: inherit; opacity: 0.75; }
.chat-rich-row .quill-chat-gone { font-style: italic; opacity: 0.75; }

/* ----- the line menu ----- */
.chat-more {
  position: absolute; right: 0; top: 0; width: 20px; height: 20px; padding: 0;
  background: none; border: 0; color: var(--muted); font: inherit; line-height: 1; cursor: pointer; opacity: 0;
}
.chat-line:hover .chat-more, .chat-more:focus-visible, .chat-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .chat-more { opacity: 0.6; } }
.chat-line[data-id] { position: relative; padding-right: 22px; }
#chat-menu {
  position: fixed; z-index: 30; min-width: 160px; padding: 4px 0;
  background: var(--ink-high); border: 1px solid var(--gilt); box-shadow: var(--shadow);
  font-family: var(--chrome-font); font-size: var(--chrome-size);
}
#chat-menu[hidden] { display: none; }
#chat-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--parchment); font: inherit; padding: 6px 14px; cursor: pointer; }
#chat-menu button:hover, #chat-menu button:focus-visible { background: color-mix(in srgb, var(--gilt) 15%, transparent); color: var(--gilt-bright); outline: none; }

/* ----- the composer: grows in place, edge to edge (owner pick E, 2026-11-13) -----
   The bottom of the chat window is the input, on the chat's own ground: no
   frame, margin or inset box. One rule along its top, gold while typing,
   red over the limits. */
.chat-composer {
  flex: none; position: relative; background: var(--ink); color: var(--parchment);
  border-top: 1px solid var(--rule-strong); font-family: "Spectral", Georgia, serif;
}
.chat-composer[hidden], .cc-strip[hidden], .cc-full[hidden] { display: none; }
.chat-composer:focus-within { border-top-color: var(--gilt); }
.chat-composer.cc-over { border-top-color: var(--ember); }
.chat-composer.cc-drop { outline: 2px dashed var(--gilt); outline-offset: -3px; }
.cc-box { display: flex; align-items: flex-end; }
.cc-edit-wrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; padding: 8px 0; }
#chat .cc-edit {
  --lh: 20px;
  flex: 1 1 auto; min-width: 0;
  /* no padding above or below the words: a line scrolled away goes whole,
     never half of it showing under the top rule (the wrap has the room) */
  min-height: var(--lh); max-height: calc(5 * var(--lh)); overflow-y: auto; box-sizing: border-box;
  padding: 0 6px; border: 0; background: transparent; outline: none;
  font: 15px/var(--lh) "Spectral", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", Georgia, serif;
  color: var(--parchment); overflow-wrap: anywhere; cursor: text; caret-color: var(--gilt-bright);
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
}
/* Shift+Enter lines at the normal line spacing, whatever the fonts */
#chat .cc-edit * { line-height: inherit; }
#chat .cc-edit :is(p, ul, ol, blockquote) { margin: 0; }
#chat .cc-edit :is(ul, ol) { padding-left: 1.3em; }
#chat .cc-edit blockquote { border-left: 3px solid var(--gilt); padding: 0.2em 0.6em; background: color-mix(in srgb, currentColor 6%, transparent); border-radius: 2px; }
#chat .cc-edit :is(b, strong) { font-weight: 600; color: var(--parchment-bright, var(--parchment)); }
#chat .cc-edit a { color: var(--gilt-bright); text-decoration: underline dotted 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
#chat .cc-edit a:is(:hover, :focus-visible) { text-decoration-style: solid; text-decoration-color: currentColor; }
.theme-light #chat .cc-edit a { color: var(--gilt); }
#chat .cc-edit ::selection { background: color-mix(in srgb, var(--gilt) 32%, transparent); }

/* the channel: the coloured first word, in a column of its own so every
   line of the words starts to its right (a hanging indent); a tell names
   the person */
.cc-chan {
  position: relative; flex: none; margin: 0 0 0 8px; display: inline-flex; align-items: center; gap: 3px;
  height: 20px; max-width: 45%; color: var(--c, var(--gilt)); white-space: nowrap;
}
#chat .cc-chan-btn {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 2px; margin: 0; border: 0; border-radius: 3px;
  background: none; color: inherit; font: 600 14px/20px "Spectral", Georgia, serif; cursor: pointer;
}
#chat .cc-chan-btn svg { width: 8px; height: 8px; opacity: 0.8; }
#chat .cc-chan-btn:hover, #chat .cc-chan-btn:focus-visible, #chat .cc-chan-btn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--c, var(--gilt)) 14%, transparent); outline: none;
}
/* the name field as wide as the name: an unseen copy sizes it */
.cc-to-wrap { position: relative; display: inline-block; min-width: 3.4em; height: 20px; }
.cc-to-wrap[hidden] { display: none; }
.cc-to-size, #chat .cc-to { font: 600 14px/20px "Spectral", Georgia, serif; padding: 0 1px; }
.cc-to-size { display: inline-block; visibility: hidden; white-space: pre; }
#chat .cc-to {
  position: absolute; inset: 0; width: 100%; min-width: 0; height: 20px; box-sizing: border-box; margin: 0; border: 0; border-bottom: 1px solid transparent;
  background: transparent; color: inherit;
}
#chat .cc-to:focus { outline: none; border-bottom-color: currentColor; }

/* placeholders: italic gold, fixed width, faint <brackets> (owner rule) */
.cc-ph { position: absolute; pointer-events: none; white-space: nowrap; font: italic 13px/20px "JetBrains Mono", monospace; color: var(--arg); }
.cc-ph i { font-style: inherit; opacity: 0.45; }
.cc-ph[hidden] { display: none; }
.cc-edit-wrap > .cc-ph { top: 8px; left: 80px; }
.cc-to-wrap > .cc-ph { left: 1px; top: 0; }

/* picture, quill and send, inside the strip at the right */
.cc-tools { flex: none; display: flex; align-items: center; gap: 1px; padding: 5px 4px 5px 0; }
#chat .cc-btn {
  flex: none; width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
#chat .cc-btn svg { width: 17px; height: 17px; }
#chat .cc-btn[hidden] { display: none; }
#chat .cc-btn:hover:enabled, #chat .cc-btn:focus-visible { color: var(--gilt-bright); background: color-mix(in srgb, var(--gilt) 12%, transparent); outline: none; }
#chat .cc-btn[aria-expanded="true"] { color: var(--gilt-bright); background: color-mix(in srgb, var(--gilt) 16%, transparent); }
#chat .cc-btn:disabled { opacity: 0.35; cursor: default; }
#chat .cc-send:disabled { opacity: 1; color: var(--rule-strong); }
#chat .cc-send:enabled { color: var(--on-accent); background: var(--gilt); }
#chat .cc-send:enabled:hover, #chat .cc-send:enabled:focus-visible { color: var(--on-accent); background: var(--gilt-bright); }
.cc-sending :is(.cc-send, .cc-go) { opacity: 0.5; }

/* the line count, on the strip's top edge from the 4th line */
.cc-count {
  position: absolute; right: 10px; top: -9px; z-index: 2; padding: 0 5px; border: 1px solid var(--rule-strong); border-radius: 8px;
  background: var(--ink); color: var(--muted); font: 11px/16px "Spectral", Georgia, serif;
}
.cc-count[hidden] { display: none; }
.cc-over .cc-count { color: var(--ember); border-color: var(--ember); }
.cc-status { margin: 0; padding: 0 10px 6px; font-size: 12px; color: var(--muted); }
.cc-status:empty, .cc-status[hidden] { display: none; }
.cc-over .cc-status { color: var(--ember); }

/* picture chips: in the strip, above the text */
.cc-chips { list-style: none; margin: 0; padding: 8px 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chips[hidden] { display: none; }
.cc-chip {
  position: relative; display: flex; gap: 7px; align-items: center; max-width: 100%; box-sizing: border-box;
  padding: 3px 22px 3px 3px; border: 1px solid var(--rule-strong); border-radius: 7px; background: var(--ink);
}
.cc-chip img { width: 38px; height: 38px; object-fit: cover; border-radius: 5px; flex: none; }
.cc-chip-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cc-alt-wrap { position: relative; display: block; min-width: 0; }
#chat .cc-alt {
  width: 11em; max-width: 100%; box-sizing: border-box; margin: 0; padding: 0 2px; border: 0; border-bottom: 1px solid var(--rule-strong);
  background: transparent; color: var(--parchment); font: 13px/18px "Spectral", Georgia, serif;
}
#chat .cc-alt:focus { outline: none; border-bottom-color: var(--gilt); }
.cc-alt-wrap > .cc-ph { left: 2px; top: 0; font-size: 12px; line-height: 18px; }
.cc-bar { display: block; height: 3px; width: 11em; max-width: 100%; background: var(--rule); }
.cc-bar > span { display: block; height: 100%; width: 0; background: var(--gilt); transition: width 0.15s; }
.cc-chip[data-state="done"] .cc-bar, .cc-chip[data-state="error"] .cc-bar { display: none; }
.cc-chip[data-state="error"] { border-color: var(--ember); }
.cc-msg { font-size: 11px; color: var(--ember); max-width: 14em; }
.cc-msg:empty { display: none; }
#chat .cc-retry { align-self: flex-start; font: 11px "Spectral", Georgia, serif; background: none; border: 1px solid var(--rule-strong); border-radius: 4px; color: var(--parchment); padding: 1px 8px; cursor: pointer; }
.cc-retry[hidden] { display: none; }
#chat .cc-x { position: absolute; right: 3px; top: 2px; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
#chat .cc-x:hover, #chat .cc-x:focus-visible { color: var(--gilt-bright); outline: none; }

/* popovers: the channel menu, the bubble, the emoji picker, :name: */
.cc-menu, .cc-bubble, .cc-emoji-pop, .cc-suggest {
  position: absolute; z-index: 6; background: var(--ink-high); border: 1px solid var(--gilt); border-radius: 6px;
  box-shadow: var(--shadow-small, var(--shadow)); color: var(--parchment);
}
.cc-menu[hidden], .cc-bubble[hidden], .cc-emoji-pop[hidden], .cc-suggest[hidden] { display: none; }
.cc-menu { padding: 4px 0; min-width: 150px; max-height: 60vh; overflow-y: auto; font: 13.5px "Spectral", Georgia, serif; }
#chat .cc-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 14px; border: 0; background: none;
  color: var(--parchment); font: inherit; text-align: left; cursor: pointer;
}
#chat .cc-menu button:hover, #chat .cc-menu button:focus-visible { background: color-mix(in srgb, var(--gilt) 15%, transparent); color: var(--gilt-bright); outline: none; }
#chat .cc-menu button[aria-checked="true"] { color: var(--c, var(--gilt)); font-weight: 600; }
.cc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gilt)); flex: none; }
.cc-bubble { display: flex; align-items: center; gap: 1px; padding: 2px; border-radius: 7px; }
#chat .cc-bb {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 5px; border: 1px solid transparent; border-radius: 5px;
  background: none; color: var(--parchment); font: 14px/1 "Spectral", Georgia, serif; cursor: pointer;
}
#chat .cc-bb:hover, #chat .cc-bb:focus-visible { color: var(--gilt-bright); border-color: var(--rule); outline: none; }
#chat .cc-bb[aria-pressed="true"] { color: var(--gilt-bright); background: color-mix(in srgb, var(--gilt) 18%, transparent); border-color: var(--gilt); }
#chat .cc-bb-b { font-weight: 700; }
#chat .cc-bb-i { font-style: italic; }
#chat .cc-bb .ic { width: 16px; height: 16px; }
#chat .cc-bb-quote::before {
  content: ""; width: 16px; height: 14px; background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14'%3E%3Cpath d='M2 0v14' stroke='black' stroke-width='2.4'/%3E%3Cpath d='M6 2h9M6 7h9M6 12h6' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}
.cc-link-row { position: relative; display: inline-block; margin: 0 4px; }
.cc-link-row[hidden] { display: none; }
#chat .cc-link-in {
  width: 12em; height: 22px; box-sizing: border-box; margin: 0; padding: 0 3px; border: 0; border-bottom: 1px solid var(--gilt);
  background: transparent; color: var(--parchment-bright, var(--parchment)); font: 13px/20px "JetBrains Mono", monospace;
}
#chat .cc-link-in:focus { outline: none; }
.cc-link-row > .cc-ph { left: 3px; top: 1px; }
.cc-suggest { bottom: 100%; left: 8px; list-style: none; margin: 0 0 4px; padding: 2px 0; font-size: 13px; min-width: 12em; }
.cc-suggest li { padding: 2px 10px; cursor: pointer; font-family: var(--font); }
.cc-suggest li[aria-selected="true"] { background: color-mix(in srgb, var(--gilt) 15%, transparent); color: var(--gilt-bright); }
.cc-sg-e { font-family: initial; }
.cc-emoji-pop { width: min(300px, calc(100% - 16px)); max-height: 240px; display: flex; flex-direction: column; gap: 4px; padding: 6px; box-sizing: border-box; }
#chat .cc-emoji-pop input { font-size: 13px; padding: 3px 6px; }
.cc-emoji-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); }
.cc-emoji-grid button { background: none; border: 0; border-radius: 5px; font-size: 20px; line-height: 30px; padding: 0; cursor: pointer; }
.cc-emoji-grid button:hover, .cc-emoji-grid button:focus-visible { background: color-mix(in srgb, var(--gilt) 18%, transparent); outline: none; }

/* the quill: the strip itself becomes the full rich editor, edge to edge;
   the chat lines above get shorter */
.chat-composer.cc-grown { display: flex; flex-direction: column; min-height: 0; max-height: 78%; border-top-color: var(--gilt); }
.chat-composer.cc-grown.cc-over { border-top-color: var(--ember); }
.cc-full { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#chat .cc-full .re { flex: 1 1 auto; min-height: 0; background: var(--ink); }
#chat .cc-full .re .re-bar { background: var(--ink); padding: 3px 5px; gap: 2px 8px; }
#chat .cc-full .re .re-look { overflow: auto; }
#chat .cc-full .re .re-doc {
  --lh: 20px; min-height: calc(5 * var(--lh) + 14px); padding: 7px 10px; font-size: 15px; line-height: var(--lh);
  /* the 5-line mark */
  background: linear-gradient(to bottom, transparent calc(5 * var(--lh) + 7px), color-mix(in srgb, var(--rule-strong) 70%, transparent) calc(5 * var(--lh) + 7px) calc(5 * var(--lh) + 8px), transparent calc(5 * var(--lh) + 8px));
}
#chat .cc-full .re .re-doc :is(p, ul, ol, blockquote) { margin: 0; }
#chat .cc-full .re .re-doc :is(ul, ol) { padding-left: 1.3em; }
#chat .cc-full .re :is(.re-telnet, textarea.re-source) { min-height: calc(5 * 20px + 14px); }
.cc-meter { position: absolute; right: 8px; bottom: 4px; padding: 0 4px; background: var(--ink); color: var(--muted); font: 12px "Spectral", Georgia, serif; white-space: nowrap; pointer-events: none; }
.cc-meter[hidden] { display: none; }
.cc-over .cc-meter { color: var(--ember); }
#chat .cc-full .cc-chips { padding: 6px 8px 0; border-top: 1px solid var(--rule); }
.cc-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 6px; border-top: 1px solid var(--rule); background: var(--ink); }
.cc-foot .cc-chan { position: static; margin: 0; max-width: 100%; }
#chat .cc-foot .cc-chan-btn { height: 24px; padding: 0 6px; border-radius: 5px; font: 13px/24px "Spectral", Georgia, serif; background: color-mix(in srgb, var(--c, var(--gilt)) 14%, transparent); }
#chat .cc-foot .cc-chan-btn:hover, #chat .cc-foot .cc-chan-btn:focus-visible { background: color-mix(in srgb, var(--c, var(--gilt)) 24%, transparent); }
.cc-grow { flex: 1 1 0; }
#chat .cc-go {
  height: 26px; padding: 0 12px; border: 1px solid var(--gilt); border-radius: 5px; background: var(--gilt); color: var(--on-accent);
  font: 13.5px "Spectral", Georgia, serif; cursor: pointer;
}
#chat .cc-go:hover:enabled, #chat .cc-go:focus-visible { background: var(--gilt-bright); outline: none; }
#chat .cc-go:disabled { opacity: 0.45; cursor: default; }
@media (pointer: coarse) {
  #chat .cc-btn { width: 34px; height: 34px; }
  #chat .cc-bb { min-width: 34px; height: 34px; }
}

/* ----- report, 13+ and the picture viewer: windows like the others ----- */
.chat-dialog, #lightbox {
  position: fixed; z-index: 20; display: flex; flex-direction: column; overflow: hidden; resize: both;
  min-width: min(260px, calc(100vw - 16px)); max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  background: var(--ink-high); border: 1px solid var(--gilt); box-shadow: var(--shadow);
  color: var(--parchment); font-family: var(--chrome-font); font-size: var(--chrome-size);
}
.chat-dialog { width: min(380px, calc(100vw - 16px)); }
.chat-dialog[hidden], #lightbox[hidden], .lightbox-shade[hidden] { display: none; }
.chat-dialog.front, #lightbox.front { z-index: 21; }
.chat-dialog:focus, #lightbox:focus { outline: none; }
.chat-dialog > header, #lightbox > header {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 4px 2px 10px; color: var(--gilt); border-bottom: 1px solid var(--rule);
  cursor: move; touch-action: none; user-select: none;
}
#lightbox > header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-dialog-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.chat-dialog-body p { margin: 0; line-height: 1.45; }
.chat-dialog-body a { color: var(--gilt-bright); }
.chat-report-line { font-family: var(--font); font-size: 13px; color: var(--muted); border-left: 3px solid var(--rule); padding-left: 8px; overflow-wrap: anywhere; }
.chat-report-why { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-report-why legend { padding: 0; margin-bottom: 4px; }
.chat-report-why label { display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
.chat-report-why input { accent-color: var(--gilt); }
.chat-dialog input[type="text"] { font: inherit; font-size: 13px; background: var(--ink); color: var(--parchment); border: 1px solid var(--rule); padding: 4px 6px; }
.chat-dialog-buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.chat-dialog-buttons button { font: inherit; padding: 4px 12px; cursor: pointer; background: none; border: 1px solid var(--rule); color: var(--muted); }
.chat-dialog-buttons .primary { color: var(--ink); background: var(--gilt); border-color: var(--gilt); }
.chat-dialog-buttons .primary:disabled { opacity: 0.4; cursor: default; }
.chat-dialog-buttons button:focus-visible { outline: 1px solid var(--parchment); }

.lightbox-shade { position: fixed; inset: 0; z-index: 19; background: rgb(0 0 0 / 0.55); }
#lightbox { width: min(720px, calc(100vw - 16px)); height: min(620px, calc(100vh - 32px)); min-width: min(180px, calc(100vw - 16px)); }
.lightbox-view { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; background: var(--ink); touch-action: pinch-zoom pan-x pan-y; }
.lightbox-view img { width: 100%; height: 100%; object-fit: contain; }
.lightbox-view.failed img { display: none; }
.lightbox-view.failed::before { content: attr(data-alt); color: var(--muted); font-style: italic; padding: 16px; text-align: center; }
#lightbox > footer { flex: none; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; justify-content: space-between; padding: 6px 10px; border-top: 1px solid var(--rule); }
.lightbox-alt { margin: 0; color: var(--parchment); overflow-wrap: anywhere; }
#lightbox > footer a { flex: none; color: var(--gilt-bright); }
@media (max-width: 600px) {
  #lightbox { width: calc(100vw - 16px); height: calc(100vh - 32px); }
}

/* Settings › General: the picture settings */
.picture-settings[hidden] { display: none; }

/* a long chat line's further rows: its first row draws the whole line */
#lines > .rows > .chat-rich-cont, #tail-lines > .rows > .chat-rich-cont { display: none; }
#lines > .rows > .chat-gone, #tail-lines > .rows > .chat-gone { display: none; }

/* ----- delete a line (chatdelete.md): the trash button, its question ----- */
#chat .chat-trash {
  position: absolute; right: 42px; top: -12px; z-index: 2; width: 28px; height: 24px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink-raised); border: 1px solid var(--rule-strong); border-radius: 6px; box-shadow: var(--shadow-small, var(--shadow));
  color: var(--muted); cursor: pointer; opacity: 0; pointer-events: none;
}
#chat .chat-line:first-child .chat-trash, #chat .chat-day + .chat-line .chat-trash, #chat .chat-new + .chat-line .chat-trash { top: 0; }
#chat .chat-line:hover .chat-trash, #chat .chat-trash:focus-visible { opacity: 1; pointer-events: auto; }
#chat .chat-trash:hover, #chat .chat-trash:focus-visible { color: var(--combat-text, var(--ember)); outline: none; }
@media (hover: none) { #chat .chat-trash { display: none; } }
#chat-delete-ask {
  position: fixed; z-index: 31; width: max-content; max-width: calc(100vw - 16px); padding: 10px 12px;
  background: var(--ink-raised); border: 1px solid var(--rule-strong); border-radius: 6px; box-shadow: var(--shadow);
  color: var(--parchment); font: 14px var(--chrome-font, inherit);
}
#chat-delete-ask[hidden] { display: none; }
#chat-delete-ask p { margin: 0 0 8px; }
#chat-delete-ask .danger { color: var(--ink); background: var(--combat-text, var(--ember)); border-color: var(--combat-text, var(--ember)); }
