
  #gx-pop { display: none; position: absolute; left: 16px; right: 16px; bottom: 100%; max-height: 260px; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 -8px 28px rgba(0,0,0,.45); padding: 6px; z-index: 31; }
  #gx-pop.show { display: block; }
  #gx-pop .gx-emo { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; flex: none; }
  #gx-pop .gx-emo img { width: 22px; height: 22px; object-fit: contain; }
  .gx-chan, .gx-msglink { display: inline-flex; align-items: center; gap: 3px; padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: color-mix(in srgb, var(--accent) 70%, var(--bright)); font-weight: 600; cursor: pointer; }
  .gx-chan:hover, .gx-msglink:hover { background: color-mix(in srgb, var(--accent) 34%, transparent); }
  .gx-msglink .ic { width: 13px; height: 13px; }
  /* the file tray above the message box */
  #gx-tray { display: none; gap: 10px; padding: 10px 12px 4px; overflow-x: auto; }
  #gx-tray.show { display: flex; }
  .gx-tf { position: relative; flex: none; width: 168px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
  .gx-tf-pv { height: 110px; border-radius: 7px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); }
  .gx-tf-pv img, .gx-tf-pv video { width: 100%; height: 100%; object-fit: cover; }
  .gx-tf.sp .gx-tf-pv img, .gx-tf.sp .gx-tf-pv video { filter: blur(18px); }
  .gx-tf-pv { position: relative; }
  .gx-tf-pv .ic { width: 34px; height: 34px; }
  .gx-tf-ext { position: absolute; inset-inline-start: 6px; bottom: 6px; font-size: 10px; font-weight: 800; letter-spacing: .5px; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--bright); }
  .gx-tf-n { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gx-tf-t { position: absolute; top: -8px; right: 6px; display: flex; gap: 2px; background: var(--bg-1, var(--bg-2)); border: 1px solid var(--border); border-radius: 7px; padding: 2px; }
  .gx-tf-t button { width: 26px; height: 26px; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: 700 10px inherit; }
  .gx-tf-t button:hover, .gx-tf-t button.on { background: var(--bg-3); color: var(--bright); }
  .gx-tf-t button .ic { width: 15px; height: 15px; }
  .gx-tf-badges { display: flex; gap: 4px; flex-wrap: wrap; }
  .gx-tf-badges span { font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 1px 5px; border-radius: 4px; background: var(--bg-4, var(--bg-3)); color: var(--muted); }
  .gx-tf-bar { height: 4px; border-radius: 3px; background: var(--bg-3); overflow: hidden; display: none; }
  .gx-tf.up .gx-tf-bar { display: block; }
  .gx-tf-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
  /* spoiler pictures and the gallery of several files */
  .gx-spoil { position: relative; display: inline-block; max-width: 100%; border-radius: 8px; overflow: hidden; cursor: pointer; }
  .gx-spoil:not(.on) img, .gx-spoil:not(.on) video { filter: blur(44px); transform: scale(1.1); }
  .gx-spoil:not(.on) .att-video, .gx-spoil:not(.on) .att-audio, .gx-spoil:not(.on) .chat-file-download { filter: blur(10px); pointer-events: none; }
  .gx-spoil:not(.on)::after { content: attr(data-l); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.72); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .8px; padding: 6px 12px; border-radius: 999px; pointer-events: none; }
  .gx-alt { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.7); color: #fff; font: 800 10px inherit; letter-spacing: .5px; padding: 2px 6px; border-radius: 4px; cursor: help; }
  .gx-att { position: relative; display: inline-block; max-width: 100%; }
  .gx-gal { display: grid; gap: 4px; margin-top: 6px; max-width: 440px; grid-template-columns: repeat(2, 1fr); }
  .gx-gal.n1 { grid-template-columns: 1fr; } .gx-gal.n3, .gx-gal.n5, .gx-gal.n6, .gx-gal.n7, .gx-gal.n8, .gx-gal.n9, .gx-gal.n10 { grid-template-columns: repeat(3, 1fr); }
  .gx-gal .gx-att, .gx-gal .gx-spoil { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg-3); }
  .gx-gal img.chat-attachment-img { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; object-fit: cover; border: 0; border-radius: 0; }
  .gx-gal.n1 .gx-att, .gx-gal.n1 .gx-spoil { aspect-ratio: auto; }
  .gx-gal.n1 img.chat-attachment-img { height: auto; max-height: 300px; object-fit: contain; }
  .gx-files { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
  /* reply ping switch */
  #gx-ping { margin-inline-start: auto; margin-inline-end: 6px; border: 0; background: none; cursor: pointer; font: 800 12px inherit; color: var(--accent); padding: 2px 6px; border-radius: 5px; }
  #gx-ping.off { color: var(--muted); }
  #gx-ping:hover { background: var(--bg-3); }
  #reply-bar.show { display: flex; align-items: center; }
  /* "N new messages since" */
  #gx-newbar { display: none; position: absolute; top: 8px; left: 16px; right: 16px; z-index: 6; align-items: center; gap: 10px; background: var(--accent); color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
  #gx-newbar.show { display: flex; }
  #gx-newbar .gx-nb-t { flex: 1; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #gx-newbar button { border: 0; background: rgba(255,255,255,.18); color: #fff; font: 700 12px inherit; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
  #gx-newbar button:hover { background: rgba(255,255,255,.3); }
  /* reactions list */
  .gx-rx-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
  .gx-rx-tabs button { border: 1px solid var(--border); background: var(--bg-3); color: var(--text); border-radius: 8px; padding: 4px 10px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font: inherit; }
  .gx-rx-tabs button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--bg-3)); }
  .gx-rx-tabs img.cemoji { width: 18px; height: 18px; }
  .gx-rx-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
  .gx-rx-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; }
  .gx-rx-row:hover { background: var(--bg-3); }
  .gx-rx-row b { color: var(--bright); } .gx-rx-row small { color: var(--muted); }
  /* numbered lists */
  .md-li.md-ol::before { content: attr(data-n); left: 0; font-variant-numeric: tabular-nums; color: var(--muted); }
  .md-li.md-ol { padding-left: 24px; } :root[dir="rtl"] .md-li.md-ol { padding-left: 0; padding-right: 24px; } :root[dir="rtl"] .md-li.md-ol::before { right: 0; }
  /* code colours */
  .md-pre .hk { color: #c792ea; } .md-pre .hs { color: #c3e88d; } .md-pre .hc { color: #7f8b99; font-style: italic; } .md-pre .hn { color: #f78c6c; } .md-pre .hf { color: #82aaff; } .md-pre .ht { color: #ffcb6b; }
  :root[data-theme="light"] .md-pre .hk, html.light .md-pre .hk { color: #8e24aa; } :root[data-theme="light"] .md-pre .hs, html.light .md-pre .hs { color: #2e7d32; } :root[data-theme="light"] .md-pre .hn, html.light .md-pre .hn { color: #d84315; } :root[data-theme="light"] .md-pre .hf, html.light .md-pre .hf { color: #1565c0; } :root[data-theme="light"] .md-pre .ht, html.light .md-pre .ht { color: #a15c00; }
