:root { color-scheme: dark; }
#swipe-hint, #chat-mode, #opts-btn, #fs-btn { font: 400 16px/1.2 var(--font); text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }

button { font: inherit; color: inherit; text-shadow: inherit; }
[hidden] { display: none !important; }

#mode-icon { display: grid; }
#unread {
  position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--radius-sm); background: var(--red); color: #fff; font: 400 13px/20px var(--font); text-align: center;
  box-shadow: 0 2px 0 var(--red-d);
}
#swipe-hint {
  position: fixed; top: calc(52px + var(--safe-top)); right: calc(12px + var(--safe-right)); z-index: var(--z-hud-pop); cursor: pointer;
  padding: 5px 10px; color: inherit; font-family: inherit; border-radius: 8px;
  background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--drop);
  font-size: 15px; animation: pop-in .3s var(--ease);
}
#swipe-hint i { display: inline-block; vertical-align: -3px; font-style: normal; color: var(--gold); animation: nudge-l 1.2s ease-in-out infinite; }
#swipe-hint[data-dir="close"] i { animation-name: nudge-r; }
body[data-chat="overlay"] #swipe-hint { top: calc(var(--top-h, 54px) + 6px); }
@keyframes nudge-l { 50% { translate: -5px 0; } }
@keyframes nudge-r { 50% { translate: 5px 0; } }
:root[data-navbar] { --nav-bottom: max(var(--safe-bottom), 48px); }

#chat {
  position: fixed; left: 0; right: 0; bottom: 0; top: var(--top-h, 54px); z-index: var(--z-chat);
  padding: 0 var(--safe-right) 0 var(--safe-left);
  font: 400 15px/1.3 var(--font); color: var(--text); text-shadow: none; -webkit-user-select: text; user-select: text;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  background: var(--panel);
}
#feed { grid-row: 3; grid-column: 1; }
body:not([data-o-chatlayout="overlay"]) #chat { top: 0; padding-top: var(--safe-top); }
body:not([data-o-chatlayout="overlay"]) #chat #feed {
  margin: 6px 6px 0; border: 2px solid var(--edge); border-radius: var(--rim-radius); background: var(--bg);
  -webkit-mask-image: none; mask-image: none;
}

#chat-tabs { grid-row: 1; grid-column: 1; display: flex; gap: var(--rim); padding: 6px 6px 3px; position: relative; z-index: 2; }
#chat-tabs > .u-tab { flex: 1 1 0; min-width: 0; height: 40px; padding: 0 4px; flex-direction: row; gap: 5px; font-size: 15px; white-space: nowrap; }
#chat.tabs-up #chat-tabs {
  position: fixed; top: calc(8px + var(--safe-top)); left: calc(12px + var(--safe-left)); right: calc(var(--icons-w, 100px) - var(--badge-out) + var(--pad-icons-r, 12px) + 6px + var(--safe-right)); z-index: var(--z-hud); padding: 0; gap: 5px;
}
#chat.tabs-up #chat-tabs > .u-tab { height: 36px; font-size: 13px; gap: 3px; }
#chat-tabs b {
  flex: none; min-width: 18px; padding: 0 4px; border-radius: var(--radius-sm); background: var(--red); color: #fff;
  font: 400 13px/18px var(--font); text-align: center; text-shadow: none; box-shadow: 0 2px 0 var(--red-d);
}

#say-slot { grid-row: 4; }
#feed {
  --in-bubble: var(--tile); --in-shade: var(--drop); --out-bubble: var(--blue); --out-shade: var(--blue-d); --in-time: var(--muted); --link: #79c4fc;
  list-style: none; margin: 0; padding: 10px 8px 10px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; background: none; touch-action: pan-y;
  display: flex; flex-direction: column; position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40px); mask-image: linear-gradient(to bottom, transparent, #000 40px);
}
#feed::before { content: ""; flex: 1 1 auto; }
#feed li { display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; flex: none; }
#feed li.first { margin-top: 10px; }
#feed li.arrive { animation: chat-in var(--t-pop) var(--ease); }
#feed li.gone { opacity: 0; transition: opacity var(--t-close) var(--ease); }
#feed .av { width: 32px; height: 32px; margin-top: -32px; font-size: 16px; visibility: hidden; }
#feed li.last .av { visibility: visible; }
#feed li.own { flex-direction: row-reverse; }
#feed li.own .av { display: none; }

#feed .bubble {
  --bg: var(--in-bubble); --shade: var(--in-shade);
  position: relative; max-width: calc(100% - 40px); min-width: 56px; margin-bottom: 3px;
  padding: 6px 10px 7px; border-radius: var(--rim-radius); background: var(--bg); box-shadow: 0 3px 0 var(--shade);
  color: #fff; font-size: 15px; line-height: 1.3;
}
#feed li.own .bubble { --bg: var(--out-bubble); --shade: var(--out-shade); max-width: 84%; text-shadow: 0 1px 0 rgb(0 0 0 / .3); }
#feed li:not(.own, .first) .bubble { border-top-left-radius: 4px; }
#feed li:not(.own, .last) .bubble { border-bottom-left-radius: 4px; }
#feed li.own:not(.first) .bubble { border-top-right-radius: 4px; }
#feed li.own:not(.last) .bubble { border-bottom-right-radius: 4px; }

#feed .n { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; font-size: 14px; line-height: 1.2; margin-bottom: 3px; }
#feed .n > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#feed li:not(.first) .n { display: none; }
#feed .tag {
  margin-left: auto; flex: none; padding: 0 5px 1px; border-radius: var(--radius-sm); background: var(--ink); border: 1px solid var(--edge);
  font-size: 13px; line-height: 16px; color: var(--muted); white-space: nowrap;
}
#feed .tag.admin { color: var(--green); border-color: var(--green-d); }
#feed .tag.creator { color: var(--purple); border-color: var(--purple); }
#feed .reply {
  --c: var(--link);
  display: flex; flex-direction: column; gap: 1px; margin: 2px 0 5px; padding: 3px 7px 4px;
  border-radius: var(--radius-sm); background: var(--ink); border: 2px solid var(--edge);
  font-size: 13px; line-height: 1.25; min-width: 0;
}
#feed .reply b { color: var(--c); font-weight: 400; overflow-wrap: anywhere; }
#feed .reply span { color: var(--paper-2); overflow-wrap: anywhere; }
#feed li.own .reply { --c: #fff !important; background: var(--blue-d); border-color: rgb(255 255 255 / .35); }
#feed li.own .reply span { color: rgb(255 255 255 / .85); }
#feed .t { white-space: pre-wrap; overflow-wrap: anywhere; }
#feed .pad { visibility: hidden; font-size: 13px; padding-left: 10px; white-space: nowrap; }
#feed .time {
  position: absolute; right: 10px; bottom: 6px; font-size: 13px; line-height: 1;
  color: var(--in-time); white-space: nowrap; pointer-events: none; text-shadow: none;
}
#feed li.own .time { color: rgb(255 255 255 / .75); }

#feed .media { display: block; margin: 2px -6px 4px; }
#feed .bubble.has-media .media { margin-top: 4px; }
#feed .media img, #feed .media video { display: block; width: 100%; height: auto; max-height: 320px; object-fit: cover; border-radius: var(--radius-sm); background: var(--ink); }
#feed .bubble.bare { padding: 4px; }
#feed .bubble.bare .n { padding: 2px 6px 2px; }
#feed .bubble.bare .media { margin: 0; }
#feed .bubble.bare .media img, #feed .bubble.bare .media video { border-radius: var(--radius-sm); }
#feed .bubble.bare .time, #feed .bubble.sticker .time {
  right: 8px; bottom: 8px; padding: 3px 6px 4px; border-radius: var(--radius-sm);
  background: rgb(var(--ink-rgb) / .75); color: #fff;
}
#feed .bubble.sticker { background: none; box-shadow: none; padding: 0; min-width: 0; }
#feed .bubble.sticker .media { margin: 0; }
#feed .bubble.sticker img, #feed .bubble.sticker video, #feed .bubble.sticker .lottie { width: 160px; height: 160px; object-fit: contain; background: none; border-radius: 0; }
#feed .media.video { position: relative; }
#feed .media.video .cue { position: absolute; inset: 0; margin: auto; color: #fff; filter: drop-shadow(0 2px 0 rgb(0 0 0 / .45)); pointer-events: none; }
#feed .media.photo:not(.miss) { cursor: zoom-in; }
#feed .media.miss { display: grid; place-items: center; min-width: 140px; min-height: 90px; margin: 0; border-radius: var(--radius-sm); background: var(--ink); border: 2px dashed var(--edge); color: var(--muted); font-size: 14px; }
#feed .bubble.sticker .media.miss { width: 160px; height: 160px; }

#feed .bubble.voice { min-width: 230px; padding-bottom: 8px; }
#feed .media.voice { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; }
#feed .vp-play {
  flex: none; width: 40px; height: 40px; border: 3px solid var(--blue-d); border-radius: var(--rim-radius); padding: 0; cursor: pointer;
  background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 0 var(--blue-d);
}
#feed li.own .vp-play { background: #fff; border-color: var(--blue-d); color: var(--blue); }
#feed .vp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-right: 44px; }
#feed .vp-bar { position: relative; height: 6px; border-radius: 2px; background: var(--ink); cursor: pointer; }
#feed .vp-bar::before { content: ""; position: absolute; inset: -10px 0; }
#feed .vp-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: var(--blue); }
#feed li.own .vp-bar { background: var(--blue-d); }
#feed li.own .vp-bar i { background: #fff; }
#feed .vp-dur { font-size: 13px; line-height: 1; color: var(--in-time); }
#feed li.own .vp-dur { color: rgb(255 255 255 / .75); }
#feed .media.voice.miss { display: flex; place-items: initial; min-height: 0; min-width: 0; background: none; border: 0; }

#feed .media.round { position: relative; width: 220px; height: 220px; cursor: pointer; }
#feed .bubble.sticker .media.round video { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; background: var(--ink); }
#feed .rd-dur { display: flex; align-items: center; gap: 3px; position: absolute; left: 10px; bottom: 10px; padding: 3px 6px 4px; border-radius: var(--radius-sm); background: rgb(var(--ink-rgb) / .75); color: #fff; font-size: 13px; line-height: 1; pointer-events: none; }
#feed .media.round.loud .rd-dur .u-sym { display: none; }
#feed .media.round.miss { border-radius: 50%; }

#photo-viewer { position: fixed; inset: 0; z-index: var(--z-dialog); display: grid; place-items: center; background: rgb(7 6 26 / .92); cursor: zoom-out; }
#photo-viewer[hidden] { display: none; }
#photo-viewer img { max-width: 100vw; max-height: 100vh; object-fit: contain; user-select: none; -webkit-user-select: none; }
#photo-viewer .pv-x {
  position: absolute; top: calc(10px + var(--safe-top, 0px)); right: calc(10px + var(--safe-right, 0px));
  width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: var(--rim-radius); padding: 0; display: grid; place-items: center;
  background: var(--panel-2); color: #fff; cursor: pointer; box-shadow: 0 4px 0 var(--drop);
}

#feed li.svc { justify-content: center; margin: 10px 0 4px; }
#feed li.svc span {
  max-width: 100%; padding: 3px 8px 4px; border-radius: var(--radius-sm); background: var(--ink); border: 1px solid var(--edge);
  color: var(--paper-2); font-size: 13px; text-align: center; overflow-wrap: anywhere;
}
#feed li.svc span.gold { color: var(--gold); border-color: var(--gold-d); }

#chat-jump, #chat-mention {
  grid-row: 3; grid-column: 1; align-self: end; justify-self: end; margin: 0 12px 12px; position: relative; z-index: 2;
  width: 44px; height: 44px; padding: 0; border: 3px solid var(--ink); border-radius: var(--rim-radius); display: grid; place-items: center; cursor: pointer;
  background: var(--panel-2); color: #fff; box-shadow: 0 4px 0 var(--drop); text-shadow: none;
  animation: pop-in var(--t-pop) var(--ease);
  transition: transform var(--t-release) var(--ease), box-shadow var(--t-release) ease-out;
}
#chat-jump:active, #chat-mention:active { transform: translateY(var(--press-sink)) scale(var(--press-sx), var(--press-sy)); box-shadow: 0 1px 0 var(--drop); transition-duration: var(--t-press); }
#chat-jump:not([hidden]) ~ #chat-mention { margin-bottom: 66px; }
#jump-count, #mention-count {
  position: absolute; top: -12px; right: -12px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--radius-sm); background: var(--blue); color: #fff; font: 400 13px/20px var(--font); text-align: center; box-shadow: 0 2px 0 var(--blue-d);
}
#mention-badge {
  position: absolute; top: -8px; left: -8px; width: 20px; height: 20px;
  border-radius: var(--radius-sm); background: var(--blue); color: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 0 var(--blue-d); animation: pop-in .3s var(--ease);
}

#say-slot { position: relative; display: flex; flex-direction: column; font: 400 16px/1.3 var(--font); text-shadow: none; }
#say { display: flex; align-items: flex-end; padding: 8px 6px calc(8px + var(--nav-bottom, var(--safe-bottom))); }
#say .rows-wrapper {
  position: relative; flex: 1; min-width: 0; z-index: 1; margin-right: 50px;
  display: flex; align-items: flex-end; min-height: 44px; padding: 0;
  background: var(--tile); border: 3px solid var(--ink); border-radius: var(--rim-radius); box-shadow: inset 0 3px 0 var(--drop);
}
#say .btn-icon, #say-as {
  position: relative; flex: none; width: 38px; height: 38px; border: 0; border-radius: var(--radius-sm); padding: 0;
  background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
#say .btn-icon:active { background: rgb(0 0 0 / .2); }
#say-as { width: 36px; margin-left: 2px; }
#say-as .av { width: 28px; height: 28px; font-size: 14px; }
#say-text {
  flex: 1; min-width: 0; height: 38px; max-height: 132px;
  padding: 8px 4px 8px 2px; margin: 0;
  border: 0; outline: none; resize: none; background: none;
  color: #fff; font: inherit; font-size: 16px; line-height: 22px;
  overflow: hidden auto; scrollbar-width: none;
}
#say-text::placeholder { color: var(--muted); }
.btn-send {
  position: absolute; right: -53px; bottom: -3px; width: 44px; height: 44px; padding: 0; cursor: pointer; display: grid; place-items: center;
  border: 3px solid var(--ink); border-radius: var(--rim-radius); background: var(--panel-2); color: var(--muted); box-shadow: 0 4px 0 var(--drop);
  transition: transform var(--t-release) var(--ease), box-shadow var(--t-release) ease-out, background-color .15s, border-color .15s;
}
.btn-send.send { background: var(--blue); border-color: var(--blue-d); color: #fff; box-shadow: 0 4px 0 var(--blue-d); }
.btn-send:active { transform: translateY(var(--press-sink)) scale(var(--press-sx), var(--press-sy)); box-shadow: 0 1px 0 var(--drop); transition-duration: var(--t-press); }
.btn-send.send:active { box-shadow: 0 1px 0 var(--blue-d); }
.btn-send > .u-sym { margin-left: 2px; }
.btn-send.send > .u-sym { filter: drop-shadow(0 2px 0 rgb(0 0 0 / .45)); }

.av {
  flex: none; border-radius: var(--radius-sm); overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 400; text-shadow: 2px 2px 0 rgb(0 0 0 / .45);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .25), 0 2px 0 var(--drop);
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }

#emoji-panel {
  order: 2; display: flex; flex-direction: column;
  height: 300px; margin: 0 6px calc(6px + var(--nav-bottom, var(--safe-bottom))); overflow: hidden;
  background: var(--panel-2); border: 2px solid var(--edge); border-radius: var(--rim-radius); box-shadow: 0 4px 0 var(--drop);
}
#say:has(~ #emoji-panel:not([hidden])) { padding-bottom: 8px; }
.ep-body { flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; }
.ep-page[data-tab="emoji"] { display: grid; grid-template-columns: repeat(8, 1fr); padding: 6px; }
.ep-page[data-tab="emoji"] > button { height: 44px; border: 0; background: none; font-size: 28px; border-radius: var(--radius-sm); cursor: pointer; padding: 0; }
.ep-page[data-tab="emoji"] > button:active { background: var(--tile); }
.ep-page[hidden] { display: none !important; }
.ep-tabs { flex: none; display: flex; justify-content: center; gap: var(--rim); padding: 6px 6px 9px; }
.ep-tabs button {
  flex: 1; max-width: 120px; height: 34px; padding: 0 8px; border: 3px solid var(--ink); border-radius: var(--rim-radius);
  background: var(--panel); color: var(--muted); font: 400 14px/1 var(--font); cursor: pointer; box-shadow: 0 3px 0 var(--drop);
}
.ep-tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue-d); text-shadow: 0 2px 0 rgb(0 0 0 / .45); box-shadow: 0 1px 0 var(--blue-d); transform: translateY(2px); }

.ep-note { padding: 12px 16px 4px; color: var(--muted); font-size: 14px; line-height: 1.3; text-align: center; }
.ep-note p { margin: 0 0 8px; }
.ep-note button {
  height: 32px; padding: 0 10px 2px; border: 3px solid var(--blue-d); border-radius: var(--rim-radius); cursor: pointer;
  background: var(--blue); color: #fff; font: 400 15px/1 var(--font); text-shadow: 0 2px 0 rgb(0 0 0 / .45); box-shadow: 0 4px 0 var(--blue-d);
}
.ep-page h4 { margin: 0; padding: 10px 10px 4px; font: 400 14px var(--font); color: var(--muted); }
.ep-grid { display: grid; gap: 4px; padding: 4px 6px 8px; }
.ep-grid.sticker { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.ep-grid.gif { grid-template-columns: repeat(2, 1fr); }
.ep-cell {
  position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: var(--radius-sm); overflow: hidden;
  transition: transform var(--t-release) var(--ease);
}
.ep-cell.sticker { aspect-ratio: 1; padding: 4px; }
.ep-cell.gif { height: 140px; background: var(--ink); }
.ep-cell:active { transform: scale(.92); transition-duration: var(--t-press); }
.ep-cell.sent { animation: juice .4s var(--ease); }
.ep-cell img, .ep-cell video, .ep-cell .ep-lottie { width: 100%; height: 100%; display: block; }
.ep-cell.sticker img, .ep-cell.sticker video { object-fit: contain; }
.ep-cell.gif video, .ep-cell.gif img { object-fit: cover; }
.ep-cell.broken { background: var(--ink); }
.ep-search { padding: 6px 6px 4px; position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.ep-search input {
  width: 100%; height: 40px; padding: 0 12px; border: 3px solid var(--ink); border-radius: var(--rim-radius); outline: none;
  background: var(--tile); color: #fff; font: 16px var(--font); box-shadow: inset 0 3px 0 var(--drop);
}
.ep-search input::placeholder { color: var(--muted); }


body[data-o-chatbg="light"] #chat { background: rgb(28 26 51 / .82); }
body[data-o-chatbg="solid"] #chat { background: var(--panel); }
body[data-o-feed="chat"] #feed li.svc { display: none; }
body[data-o-feed="table"] #feed li:not(.svc) { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px); } }

body[data-o-chatlayout="overlay"] #chat {
  top: calc(var(--chat-top, 0px) + var(--top-h, 54px)); bottom: auto; left: 0; right: auto; width: min(100%, 440px);
  height: var(--chat-h, 45dvh); overflow: hidden; background: none;
  transition: top .22s var(--ease), left .22s var(--ease), right .22s var(--ease),
    width .22s var(--ease), height .22s var(--ease);
}
body[data-o-chatlayout="overlay"][data-o-chatside="right"][data-chat="overlay"] #chat { left: auto; right: 0; }
body[data-o-chatlayout="overlay"][data-chat="overlay"] #chat { background: rgb(var(--ink-rgb) / .45); }
body[data-o-chatlayout="overlay"] #emoji-panel { order: -1; }
body[data-o-chatlayout="overlay"] #chat.tabs-up { top: var(--chat-top, 0px); }
body[data-o-chatlayout="overlay"] #feed { padding-top: 12px; -webkit-mask-image: none; mask-image: none; }
body[data-o-chatlayout="overlay"] #chat.tabs-up #feed { padding-top: calc(8px + var(--safe-top)); }
body[data-o-chatlayout="overlay"] #emoji-panel {
  height: min(380px, 42dvh); margin: 6px 6px 0;
  animation: ep-rise var(--t-open) var(--ease);
}
@keyframes ep-rise { from { height: 0; } }
body[data-o-chatlayout="overlay"] #swipe-hint { display: none; }
body[data-o-chatlayout="overlay"][data-chat="overlay"] .u-toasts { top: auto; bottom: calc(16px + var(--safe-bottom)); }
body[data-o-chatlayout="overlay"][data-chat="off"] #chat {
  top: calc(var(--pad-feed-t, 8px) + var(--safe-top)); left: calc(var(--pad-feed-l, 8px) + var(--safe-left));
  width: var(--pad-feed-w, min(62vw, 320px, var(--feed-room, 320px))); height: var(--pad-feed-h, 35dvh); padding: 0;
  background: transparent; border-color: transparent; box-shadow: none; border-radius: 0;
  pointer-events: none; -webkit-user-select: none; user-select: none;
}
body[data-o-chatlayout="overlay"][data-chat="off"][data-chat-anchor$="r"] #chat { left: auto; right: calc(var(--pad-feed-r, 8px) + var(--safe-right)); }
body[data-o-chatlayout="overlay"][data-chat="off"][data-chat-anchor^="b"] #chat { top: auto; bottom: calc(var(--pad-feed-b, 8px) + var(--safe-bottom)); }
body[data-o-chatlayout="overlay"][data-chat="off"]:not([data-chat-anchor^="b"]) #chat:not(.tabs-up) { top: var(--top-h, 54px); }
body[data-o-chatlayout="overlay"][data-chat="off"]:not([data-chat-anchor^="b"]):has(.g-leave:not([hidden])) #chat.tabs-up { top: calc(max(52px, var(--pad-feed-t, 8px)) + var(--safe-top)); }
body.u-editing[data-o-chatlayout="overlay"][data-chat="off"] #chat { pointer-events: auto; transition: none; border-radius: 12px; overflow: visible; }
body[data-o-chatlayout="overlay"][data-chat="off"][data-o-chatpics="off"] #feed .av { display: none; }
body[data-o-chatlayout="overlay"][data-chat="off"][data-o-chatpics="off"] #feed { padding-left: 10px; }
body[data-o-chatlayout="overlay"][data-chat="off"][data-o-chatpics="s"] #feed .av { width: 24px; height: 24px; margin-top: -24px; font-size: 13px; }
body[data-o-chatlayout="overlay"][data-chat="off"][data-o-chatpics="l"] #feed .av { width: 48px; height: 48px; margin-top: -48px; font-size: 22px; }
body[data-o-chatlayout="overlay"][data-chat="off"] :is(#chat-tabs, #say-slot, #chat-jump, #chat-mention) { display: none; }
body[data-o-chatalpha="30"] #feed { --peek-a: .3; }
body[data-o-chatalpha="80"] #feed { --peek-a: .8; }
body[data-o-chatalpha="100"] #feed { --peek-a: 1; }
body[data-o-chatlayout="overlay"][data-chat="off"][data-o-chatmedia="off"] #feed li:has(.media.sticker, .media.gif) { display: none; }
body[data-o-chatlayout="overlay"][data-chat="off"] #feed::-webkit-scrollbar { display: none; }
body[data-o-chatlayout="overlay"][data-chat="off"] #feed li { pointer-events: auto; margin-top: 0; padding-top: 3px; }
body[data-o-chatlayout="overlay"][data-chat="off"] #feed li.first { padding-top: 6px; }
body[data-o-chatlayout="overlay"][data-chat="off"] #feed li.svc { margin: 0; padding: 8px 0; }
body[data-o-chatlayout="overlay"][data-chat="off"] #feed :is(.reply, li.svc span) { background: rgb(var(--ink-rgb) / var(--peek-a, .6)); }
body[data-o-chatlayout="overlay"][data-chat="off"] #feed {
  overflow: hidden auto; scrollbar-width: none; padding: 0 10px 4px 2px; zoom: calc(.8 * var(--pad-feed-s, 1));
  --in-bubble: rgb(49 45 82 / var(--peek-a, .6)); --out-bubble: rgb(0 157 255 / var(--peek-a, .6));
  --in-shade: rgb(10 9 24 / var(--peek-a, .6)); --out-shade: rgb(0 100 163 / var(--peek-a, .6));
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 48px); mask-image: linear-gradient(to bottom, transparent, #000 48px);
}

body[data-dchat] #say-as { display: none; }

#feed li.flash .bubble { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 30% { outline: 3px solid var(--gold); outline-offset: 2px; } 100% { outline: 3px solid rgb(245 177 67 / 0); outline-offset: 2px; } }
#feed li.picked .bubble { outline: 3px solid var(--gold); outline-offset: 2px; }
#feed .reply[data-to] { cursor: pointer; }
#feed li.unread-line { justify-content: center; margin: 12px 0 4px; }
#feed li.unread-line span { border-color: var(--blue); color: #fff; }
#feed .time .st { vertical-align: -4px; margin-left: 3px; }
#feed .time .st.bad { color: var(--red); }
#feed li.pending .bubble { opacity: .85; }
#feed li.failed .bubble { cursor: pointer; }
#feed .fail { margin-top: 2px; font-size: 13px; color: #ffd9d6; }
#feed .beg { display: grid; gap: 8px; margin: 6px 0 4px; }
#feed .beg small { font-size: 13px; opacity: .85; }
#feed .beg button {
  min-height: 36px; padding: 4px 10px 6px; border: 3px solid var(--blue-d); border-radius: var(--rim-radius); background: var(--blue); color: #fff;
  font: 400 15px/1.2 var(--font); text-shadow: 0 2px 0 rgb(0 0 0 / .45); box-shadow: 0 4px 0 var(--blue-d); cursor: pointer;
}
#feed .beg button.more { background: var(--panel-2); color: var(--muted); border-color: var(--ink); text-shadow: none; box-shadow: 0 4px 0 var(--drop); }
@media (pointer: coarse) { #feed { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }

#reply-bar {
  display: flex; align-items: center; gap: 8px; margin: 8px 6px 0; padding: 5px 2px 5px 10px;
  border-radius: var(--rim-radius); background: var(--ink); border: 2px solid var(--edge); color: var(--gold);
  animation: rb-rise var(--t-pop) var(--ease);
}
@keyframes rb-rise { from { opacity: 0; transform: translateY(8px); } }
#reply-bar:not([hidden]) ~ #say { padding-top: 6px; }
body[data-o-chatlayout="overlay"] #emoji-panel:not([hidden]) ~ #reply-bar { margin-top: 6px; }

#feed li.msg { position: relative; }
.swipe-reply {
  position: absolute; right: -44px; bottom: 6px; width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--ink); color: #fff; opacity: var(--p, 0); transform: scale(calc(.6 + .4 * var(--p, 0)));
  transition: background-color .15s ease;
}
.swipe-reply.ready { background: var(--blue); }
#reply-bar .rb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.25; }
#reply-bar .rb-text b { font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
#reply-bar .rb-text span { color: #fff; overflow-wrap: anywhere; max-height: calc(3 * 1.25em); overflow: hidden auto; scrollbar-width: none; }
#reply-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  #feed li.arrive, #reply-bar, #emoji-panel, #chat-jump, #chat-mention { animation: none !important; }
}

#feed .re { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 5px 0 1px; }
#feed .rx {
  position: relative; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 7px 1px;
  border: 2px solid var(--edge); border-radius: var(--radius-sm); background: var(--ink); color: #fff;
  font: 400 15px/1 var(--font); text-shadow: none; cursor: pointer;
}
#feed .rx::after { content: ""; position: absolute; inset: -8px -3px; }
#feed .rx small { font-size: 13px; color: var(--paper-2); }
#feed .rx.mine { background: var(--blue); border-color: var(--blue-d); }
#feed .rx.mine small { color: #fff; }
#feed li.own .rx { background: var(--blue-d); border-color: rgb(255 255 255 / .35); }
#feed li.own .rx.mine { background: #fff; border-color: #fff; }
#feed li.own .rx.mine small { color: var(--blue-d); }

.mm-reacts { display: flex; gap: 4px; }
.mm-react {
  flex: 1; min-width: 40px; height: 44px; padding: 0; border: 0; border-radius: var(--rim-radius); background: none;
  font: 400 24px/1 var(--font); cursor: pointer; transition: transform var(--t-release) var(--ease);
}
.mm-react:active { transform: scale(1.18); transition-duration: var(--t-press); }
.mm-react.on { background: var(--blue); box-shadow: 0 3px 0 var(--blue-d); }
.mm-acts .u-item { justify-content: flex-start; padding: 8px 12px; font: 400 16px/1.1 var(--font); }
.mm-acts .u-item.bad { color: var(--red); }
