/* Discord dark theme. Brand colors from discord.com (--blurple, link, greyple, status colors);
   surface and text colors sampled from a screenshot of the current Discord desktop app. */
:root {
  --blurple: #5865f2;
  --link: #00b0f4;
  --greyple: #99aab5;
  --green: #57f287;
  --status-green: #43b581;
  --red: #ed4245;
  --unread-red: #f23f43;
  --yellow: #fee75c;

  --bg-primary: #1a1a1e;
  --bg-sidebar: #121214;
  --bg-secondary: #222327;
  --bg-secondary-alt: #2c2c30;
  --bg-tertiary: #121214;
  --bg-message-hover: #1e1e22;
  --bg-modifier-hover: #222225;
  --bg-modifier-selected: #2c2c30;
  --border-subtle: #2c2c30;
  --spine: #474850;
  --scrollbar-thumb: #5f6069;

  --header-primary: #fbfbfb;
  --header-secondary: #abacb2;
  --text-normal: #efeff1;
  --text-muted: #818289;
  --channel-icon: #818289;
  --interactive-normal: #abacb2;
  --interactive-hover: #dbdbde;
  --interactive-active: #fbfbfb;
  --mention-bg: rgba(88, 101, 242, 0.3);
  --mention-fg: #c9cdfb;

  --font: "gg sans", "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-code: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "DejaVu Sans Mono", Monaco, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-tertiary);
  color: var(--text-normal);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

#app { display: flex; height: 100vh; }

/* ---- channel sidebar ---- */
.sidebar {
  width: 240px; flex: none; background: var(--bg-sidebar);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  height: 48px; flex: none; padding: 0 16px; display: flex; align-items: center;
  box-shadow: 0 1px 0 rgba(2, 2, 2, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(2, 2, 2, 0.05);
}
.sidebar-header h1 {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--header-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.channel-list { flex: 1; overflow-y: auto; padding: 8px 0 16px 8px; }
.category {
  display: flex; align-items: center; padding: 16px 8px 4px 0; margin-left: 2px;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted); cursor: default; user-select: none;
}
.category svg { width: 14px; height: 14px; margin-left: 4px; }
.channel {
  display: flex; align-items: center; height: 32px; margin: 1px 8px 1px 0; padding: 0 8px;
  border-radius: 8px; color: var(--channel-icon); cursor: pointer; user-select: none;
  font-size: 16px; font-weight: 500; text-decoration: none;
}
.channel:hover { background: var(--bg-modifier-hover); color: var(--interactive-hover); text-decoration: none; }
.channel.selected { background: var(--bg-modifier-selected); color: var(--interactive-active); }
.channel-icon { width: 20px; flex: none; margin-right: 6px; text-align: center; color: var(--channel-icon); font-size: 20px; font-weight: 400; line-height: 1; }
.channel-icon svg { width: 20px; height: 20px; display: block; }
.channel-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel .channel-name { color: inherit; }
.channel:not(.selected):not(:hover) .channel-name { color: var(--text-muted); }

.thread {
  position: relative; height: 32px; margin: 0 8px 0 36px; padding: 0 8px;
  font-size: 14px;
}
.thread::before {
  content: ""; position: absolute; left: -14px; top: -16px; width: 12px; height: 32px;
  border-left: 1px solid var(--spine); border-bottom: 1px solid var(--spine);
  border-bottom-left-radius: 8px;
}
.thread.more { color: var(--text-muted); font-size: 13px; }

.channel-count { flex: none; margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* unread channels: bright name + red count pill */
.channel.unread .channel-name,
.channel.unread:not(.selected):not(:hover) .channel-name { color: var(--header-primary); font-weight: 600; }
.unread-pill {
  flex: none; margin-left: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--unread-red); color: #fff; font-size: 12px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---- chat ---- */
.chat { flex: 1; min-width: 0; background: var(--bg-primary); display: flex; flex-direction: column; }
.chat-header {
  height: 48px; flex: none; padding: 0 16px; display: flex; align-items: center; min-width: 0;
  box-shadow: 0 1px 0 rgba(2, 2, 2, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(2, 2, 2, 0.05);
  z-index: 2;
}
.chat-header-icon { color: var(--channel-icon); font-size: 24px; margin-right: 8px; line-height: 1; }
.chat-header-icon svg { width: 24px; height: 24px; display: block; }
.chat-header h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--header-primary); white-space: nowrap; }
.chat-header-divider { width: 1px; height: 24px; margin: 0 8px; background: var(--border-subtle); flex: none; }
.chat-header-topic {
  flex: 1; min-width: 0; font-size: 14px; color: var(--header-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-header-counter { flex: none; margin-left: 16px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.scroller { flex: 1; overflow-y: scroll; overflow-x: hidden; }
.scroller::-webkit-scrollbar { width: 16px; }
.scroller::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border: 4px solid transparent; background-clip: padding-box; border-radius: 8px; }
.scroller::-webkit-scrollbar-track { background: transparent; }
.channel-list::-webkit-scrollbar { width: 8px; }
.channel-list::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
.scroller, .channel-list { scrollbar-color: var(--scrollbar-thumb) transparent; }

.messages { list-style: none; margin: 0; padding: 0 0 24px; }
.status-line { padding: 16px; color: var(--text-muted); font-size: 14px; text-align: center; }

.channel-start { padding: 16px 16px 8px; margin-bottom: 8px; }
.channel-start-icon {
  width: 68px; height: 68px; border-radius: 50%; background: var(--bg-modifier-selected);
  display: flex; align-items: center; justify-content: center; font-size: 42px; color: #fff; margin-bottom: 8px;
}
.channel-start h3 { margin: 8px 0; font-size: 32px; font-weight: 700; color: var(--header-primary); }
.channel-start p { margin: 0; color: var(--header-secondary); font-size: 16px; }

.date-divider {
  display: flex; align-items: center; margin: 24px 14px 8px 16px; height: 0;
  border-top: 1px solid var(--border-subtle); justify-content: center;
}
.date-divider > span:first-child {
  background: var(--bg-primary); padding: 2px 4px; margin-top: -1px;
  font-size: 12px; font-weight: 600; color: var(--text-muted); line-height: 13px;
}
/* Discord's "new messages" line: red rule with a small NEW tag at the right end. */
.new-divider {
  position: relative; margin: 8px 14px 0 16px; height: 0; border-top: 1px solid var(--unread-red);
}
.date-divider.new { position: relative; border-top-color: var(--unread-red); }
.date-divider.new > span:first-child { color: var(--unread-red); }
.new-tag {
  position: absolute; right: 0; top: -7px; padding: 0 4px; height: 13px; border-radius: 0 4px 4px 0;
  background: var(--unread-red); color: #fff; font-size: 10px; font-weight: 700; line-height: 13px;
}
.new-tag::before {
  content: ""; position: absolute; left: -4px; top: 0; border: 6.5px solid transparent;
  border-left: 0; border-right: 4px solid var(--unread-red);
}
.new-divider + .msg { margin-top: 8px; }

.msg {
  position: relative; padding: 2px 48px 2px 72px; min-height: 22px;
  word-wrap: break-word; user-select: text;
}
.msg.group-start { margin-top: 17px; min-height: 44px; }
.msg:hover { background: var(--bg-message-hover); }
.msg.flash { animation: flash 2.5s ease-out; }
@keyframes flash { from { background: rgba(88, 101, 242, 0.2); } to { background: transparent; } }
.msg.has-reply { }

.avatar {
  position: absolute; left: 16px; top: 2px; width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; cursor: pointer; user-select: none;
}
.msg.has-reply .avatar { top: 24px; }
.avatar-default {
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 500;
}
.msg-header { margin: 0; font-size: 16px; font-weight: 400; line-height: 22px; min-height: 22px; display: block; }
.username { font-weight: 500; color: var(--header-primary); margin-right: 4px; cursor: pointer; }
.username:hover { text-decoration: underline; }
.bot-tag {
  display: inline-block; height: 15px; padding: 0 4px; margin-right: 4px; margin-left: 0;
  border-radius: 3px; background: var(--blurple); color: #fff; font-size: 10px; font-weight: 500;
  line-height: 15px; vertical-align: 2px; text-transform: uppercase;
}
.timestamp { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 4px; line-height: 22px; }
.side-time {
  position: absolute; left: 0; width: 56px; text-align: right; top: 4px;
  font-size: 11px; color: var(--text-muted); line-height: 22px; visibility: hidden;
}
.msg:hover .side-time { visibility: visible; }
/* message text size: shared with the FAQ answers (--message-*), so the two can't drift apart */
:root { --message-font-size: 16px; --message-line-height: 22px; }
.content { font-size: var(--message-font-size); line-height: var(--message-line-height); color: var(--text-normal); white-space: pre-wrap; }
.content.jumbo { font-size: 48px; line-height: 56px; }
.content.jumbo .emoji { width: 48px; height: 48px; }
.edited { font-size: 10px; color: var(--text-muted); margin-left: 4px; white-space: nowrap; }

/* reply bar */
.reply {
  position: relative; display: flex; align-items: center; height: 18px; margin-bottom: 4px;
  font-size: 14px; line-height: 18px; color: var(--header-secondary); white-space: nowrap; overflow: hidden;
}
/* The reply spine sits on the message (the bar itself clips overflow). */
.msg.has-reply::before {
  content: ""; position: absolute; left: 36px; top: 11px; width: 33px; height: 12px;
  border-left: 2px solid var(--spine); border-top: 2px solid var(--spine); border-top-left-radius: 6px;
  box-sizing: border-box;
}
.reply-avatar { width: 16px; height: 16px; border-radius: 50%; margin-right: 4px; flex: none; object-fit: cover; }
.reply-avatar.avatar-default { font-size: 9px; }
.reply-name { font-weight: 500; color: var(--header-primary); margin-right: 4px; flex: none; opacity: .64; cursor: pointer; }
.reply:hover .reply-name { opacity: 1; }
.reply-text { overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--header-secondary); }
.reply-text:hover { color: var(--header-primary); }
.reply-text .mention { padding: 0 1px; }
.reply-text em, .reply-missing { font-style: italic; color: var(--text-muted); }

/* markdown */
.content strong { font-weight: 700; }
.content code, .embed code {
  font-family: var(--font-code); font-size: 85%; padding: 0 .2em; border-radius: 4px;
  background: var(--bg-secondary); border: 1px solid var(--bg-tertiary); white-space: pre-wrap;
}
.content pre, .embed pre {
  margin: 6px 0 0; max-width: 90%; border-radius: 4px; background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
}
.content pre code, .embed pre code {
  display: block; padding: .5em; font-size: 14px; line-height: 18px; border: 0; background: none;
  color: var(--header-secondary); white-space: pre-wrap;
}
.blockquote { display: flex; }
.blockquote::before { content: ""; width: 4px; border-radius: 4px; background: var(--spine); flex: none; }
.blockquote > div { padding: 0 8px 0 12px; min-width: 0; }
.content h1, .content h2, .content h3 { margin: 8px 0 8px; color: var(--header-primary); line-height: 1.375em; }
.content h1 { font-size: 24px; font-weight: 700; }
.content h2 { font-size: 20px; font-weight: 700; }
.content h3 { font-size: 16px; font-weight: 700; }
.content .subtext { font-size: 13px; color: var(--text-muted); line-height: 1.1rem; }
.content ul, .content ol { margin: 4px 0 0 16px; padding-left: 8px; }
.spoiler { background: var(--bg-tertiary); color: transparent; border-radius: 3px; cursor: pointer; padding: 0 2px; }
.spoiler.shown { background: rgba(255, 255, 255, .1); color: inherit; }
.mention {
  background: var(--mention-bg); color: var(--mention-fg); border-radius: 3px; padding: 0 2px;
  font-weight: 500; cursor: pointer; unicode-bidi: plaintext;
}
.mention:hover { background: var(--blurple); color: #fff; text-decoration: none; }
.emoji { width: 22px; height: 22px; vertical-align: bottom; object-fit: contain; }
.timestamp-md { background: rgba(255, 255, 255, .06); border-radius: 3px; padding: 0 2px; }

/* accessories */
.accessories { display: grid; grid-auto-flow: row; row-gap: 4px; padding: 2px 0; justify-items: start; }
.accessories:empty { display: none; }
.att-media { display: block; border-radius: 8px; overflow: hidden; max-width: 550px; cursor: pointer; background: var(--bg-secondary); }
.att-media img, .att-media video { display: block; max-width: 100%; height: auto; }
.att-gallery { display: flex; flex-wrap: wrap; gap: 4px; max-width: 550px; }
.att-gallery .att-media { max-width: calc(50% - 2px); }
video.att-video { border-radius: 8px; max-width: 550px; max-height: 350px; background: #000; display: block; }
audio { max-width: 400px; }

.file {
  display: flex; align-items: center; width: 432px; max-width: 100%; padding: 16px;
  background: var(--bg-secondary); border: 1px solid var(--bg-secondary-alt); border-radius: 8px;
}
.file-icon { width: 30px; height: 40px; flex: none; margin-right: 8px; }
.file-info { min-width: 0; flex: 1; }
.file-name { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--text-muted); }

.embed {
  display: grid; max-width: 520px; border-radius: 4px; background: var(--bg-secondary);
  border-left: 4px solid var(--bg-tertiary); padding: 8px 16px 16px 12px;
  grid-template-columns: auto min-content; grid-template-rows: auto;
}
.embed-main { min-width: 0; grid-column: 1; }
.embed-thumb { grid-column: 2; grid-row: 1 / 8; margin-left: 16px; margin-top: 8px; }
.embed-thumb img { max-width: 80px; max-height: 80px; border-radius: 4px; display: block; cursor: pointer; }
.embed-provider { font-size: 12px; color: var(--header-secondary); margin-top: 8px; }
.embed-author { display: flex; align-items: center; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--header-primary); }
.embed-author a { color: var(--header-primary); }
.embed-title { margin-top: 8px; font-size: 16px; font-weight: 600; color: var(--header-primary); }
.embed-title a { color: var(--link); }
.embed-desc { margin-top: 8px; font-size: 14px; line-height: 18px; color: var(--text-normal); white-space: pre-wrap; }
.embed-fields { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; margin-top: 8px; }
.embed-field { grid-column: span 12; min-width: 0; font-size: 14px; line-height: 18px; }
.embed-field.inline { grid-column: span 4; }
.embed-field-name { font-weight: 600; color: var(--header-primary); margin-bottom: 2px; }
.embed-field-value { white-space: pre-wrap; }
.embed-image { margin-top: 16px; grid-column: 1 / 3; }
.embed-image img, .embed-image video { max-width: 100%; max-height: 300px; border-radius: 4px; display: block; cursor: pointer; }
.embed-footer { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--header-secondary); grid-column: 1 / 3; }

.sticker { width: 160px; height: 160px; object-fit: contain; }
.sticker-missing { color: var(--text-muted); font-style: italic; font-size: 14px; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 2px; }
.reaction {
  display: flex; align-items: center; height: 24px; padding: 2px 6px; border-radius: 8px;
  background: var(--bg-secondary); border: 1px solid transparent; cursor: default; user-select: none;
}
.reaction:hover { background: var(--bg-modifier-hover); border-color: var(--border-subtle); }
.reaction img { width: 16px; height: 16px; object-fit: contain; }
.reaction .reaction-emoji { font-size: 15px; line-height: 16px; }
.reaction-count { margin-left: 6px; font-size: 14px; font-weight: 600; color: var(--interactive-normal); }

.thread-card {
  max-width: 480px; min-width: 240px; padding: 8px; border-radius: 4px; background: var(--bg-secondary);
  font-size: 14px; cursor: pointer;
}
.thread-card-name { font-weight: 600; color: var(--header-primary); line-height: 18px; }
.thread-card-count { font-weight: 600; color: var(--link); margin-left: 8px; }
.thread-card:hover .thread-card-count { text-decoration: underline; }

.forward { display: flex; margin-top: 2px; }
.forward::before { content: ""; width: 4px; border-radius: 4px; background: var(--spine); flex: none; }
.forward-body { padding: 0 8px 0 12px; min-width: 0; }
.forward-label { font-size: 14px; font-style: italic; color: var(--text-muted); line-height: 18px; margin-bottom: 2px; }

.system { padding: 2px 48px 2px 72px; color: var(--text-muted); font-size: 16px; line-height: 22px; margin-top: 8px; position: relative; }
.system:hover { background: var(--bg-message-hover); }
.system-icon { position: absolute; left: 28px; top: 4px; width: 16px; height: 16px; color: var(--text-muted); }
.system-icon.join { color: #23a55a; }
.system b { color: var(--header-primary); font-weight: 500; }
.system .timestamp { margin-left: 4px; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-inner { display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: calc(100vw - 160px); max-height: 85vh; display: block; }
.lightbox-count { margin-top: 8px; min-height: 18px; font-size: 14px; color: var(--header-secondary); }
.lightbox-arrow {
  position: fixed; top: 50%; width: 48px; height: 48px; margin-top: -24px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.5); color: var(--interactive-normal); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-arrow[hidden] { display: none; }
.lightbox-arrow:hover { background: rgba(0, 0, 0, 0.8); color: var(--interactive-active); }
.lightbox-arrow svg { width: 28px; height: 28px; }
.lightbox-arrow.prev { left: 24px; }
.lightbox-arrow.next { right: 24px; }

@media (max-width: 700px) {
  .sidebar { width: 180px; border-radius: 0; }
  .msg, .system { padding-right: 16px; }
  .chat-header-counter { display: none; }
}

/* Videos: Discord video embeds */
.video-item { padding: 8px 48px 8px 72px; list-style: none; }
.video-item:first-child { padding-top: 16px; }
/* Half the message pane (the item's padding is 72px + 48px), at least 360px, full width on phones. */
.video-embed { width: calc((100% + 120px) / 2); min-width: min(360px, 100%); max-width: 100%; grid-template-columns: minmax(0, 1fr); }
.video-embed .embed-image { grid-column: 1; }
.video-meta { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--header-secondary); }
.video-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 4px; overflow: hidden; background: var(--bg-tertiary); cursor: pointer;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; max-height: none; }
.video-play {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; display: flex; align-items: center; justify-content: center;
}
.video-play svg { width: 24px; height: 24px; margin-left: 2px; }
.video-thumb:hover .video-play { background: rgba(0, 0, 0, 0.85); }
.video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; background: #000; }

.video-embed { position: relative; }
.video-desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.video-delete {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 4px; border: 0; border-radius: 4px;
  background: var(--bg-primary); color: var(--interactive-normal); cursor: pointer; visibility: hidden;
}
.video-item:hover .video-delete { visibility: visible; }
.video-delete:hover { color: var(--red); }
.video-delete svg { width: 20px; height: 20px; display: block; }
.channel.add-row .channel-name { color: var(--text-muted); }

/* modal (Discord style) */
.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 440px; max-width: calc(100vw - 32px); border-radius: 8px; background: var(--bg-secondary); overflow: hidden; }
.modal-body { padding: 24px 16px 20px; }
.modal-title { margin: 0 0 20px; font-size: 20px; font-weight: 600; color: var(--header-primary); }
.modal-label { display: block; margin: 16px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--header-secondary); }
.modal-label:first-of-type { margin-top: 0; }
.modal-input {
  display: block; width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--bg-tertiary); color: var(--text-normal); font: inherit; font-size: 16px; outline: none;
}
.modal-input:focus { border-color: var(--blurple); }
select.modal-input { appearance: auto; }
#video-new-group { margin-top: 8px; }
.modal-text { margin: 0; color: var(--text-normal); font-size: 16px; line-height: 20px; }
.modal-error { min-height: 16px; margin-top: 12px; font-size: 14px; color: var(--red); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px; background: var(--bg-primary); }
.button-link, .button-primary {
  height: 38px; min-width: 96px; padding: 0 16px; border: 0; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.button-link { background: transparent; color: var(--header-primary); min-width: 0; }
.button-link:hover { text-decoration: underline; }
.button-primary { background: var(--blurple); color: #fff; }
.button-primary:hover { background: #4752c4; }
.button-primary.danger { background: #da373c; }
.button-primary.danger:hover { background: #a12828; }
.button-primary:disabled { opacity: .5; cursor: not-allowed; }

/* glossary terms: dotted underline, Discord tooltip on hover */
.gloss { border-bottom: 1px dotted var(--text-muted); cursor: help; }
.tooltip {
  position: fixed; z-index: 30; max-width: 320px; padding: 8px 12px; border-radius: 8px; pointer-events: none;
  background: #111214; color: var(--text-normal); font-size: 14px; line-height: 18px; font-weight: 500;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
}
.tooltip[hidden] { display: none; }
.tooltip strong { display: block; margin-bottom: 2px; color: var(--header-primary); font-weight: 700; }

/* tickers: clickable text, link color on hover */
.ticker {
  padding: 0 2px; border-radius: 3px; cursor: pointer; font-weight: 600;
  background: rgba(88, 101, 242, 0.15); color: #c9cdfb;
}
.ticker:hover { background: var(--blurple); color: #fff; }
.dollar-icon { display: block; width: 20px; text-align: center; font-size: 18px; font-weight: 600; line-height: 20px; }
.chat-header-icon .dollar-icon { width: 24px; font-size: 22px; line-height: 24px; }
.result-label { margin: 16px 16px 0 72px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.result-label a { color: var(--text-muted); }
.result-label a:hover { color: var(--interactive-hover); }
.result-label + .msg.group-start, .result-label + .date-divider { margin-top: 4px; }

/* segmented control in the header (ticker views) */
.segmented { flex: none; display: flex; gap: 2px; margin-left: 16px; padding: 2px; border-radius: 8px; background: var(--bg-tertiary); }
.segmented[hidden] { display: none; }
.segmented button {
  height: 24px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  color: var(--interactive-normal); font: inherit; font-size: 13px; font-weight: 500;
}
.segmented button:hover { color: var(--interactive-hover); }
.segmented button.selected { background: var(--bg-modifier-selected); color: var(--interactive-active); }

/* glossary & tickers lists */
.list-search { padding: 16px 16px 8px; position: sticky; top: 0; background: var(--bg-primary); z-index: 1; }
.search-input {
  width: 100%; max-width: 360px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px;
  background: var(--bg-tertiary); color: var(--text-normal); font: inherit; font-size: 14px; outline: none;
}
.glossary-item { padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); }
.glossary-item[hidden], .ticker-row[hidden] { display: none; }
.glossary-term { font-size: 16px; font-weight: 600; color: var(--header-primary); }
.glossary-aliases { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.glossary-def { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--text-normal); max-width: 720px; }
.list-heading { padding: 20px 16px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); }
.ticker-row { display: flex; align-items: center; gap: 12px; padding: 6px 16px; border-radius: 4px; margin: 0 8px; }
.ticker-row:hover { background: var(--bg-message-hover); }
.ticker-symbol { min-width: 96px; font-weight: 600; color: var(--header-primary); }
.ticker-count { flex: 1; font-size: 13px; color: var(--text-muted); }
.row-action {
  height: 24px; padding: 0 10px; border: 0; border-radius: 4px; background: var(--bg-secondary); cursor: pointer;
  color: var(--interactive-normal); font: inherit; font-size: 13px; visibility: hidden;
}
.ticker-row:hover .row-action { visibility: visible; }
.row-action:hover { color: var(--interactive-active); background: var(--bg-modifier-selected); }

/* context menu (Discord style) */
.context-menu {
  position: fixed; z-index: 40; min-width: 188px; padding: 6px 8px; border-radius: 4px;
  background: #111214; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
}
.context-menu[hidden] { display: none; }
.menu-item {
  display: block; width: 100%; padding: 6px 8px; margin: 2px 0; border: 0; border-radius: 2px; background: transparent;
  color: var(--interactive-normal); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--blurple); color: #fff; }

/* glossary page: hint controls */
.glossary-item { position: relative; }
.glossary-item:hover .row-action { visibility: visible; }
.glossary-action { position: absolute; top: 10px; right: 16px; }
.glossary-item.hidden-term .glossary-term, .glossary-item.hidden-term .glossary-aliases,
.glossary-item.hidden-term .glossary-def { opacity: .45; }
.glossary-item.hidden-term .row-action { visibility: visible; }
.glossary-setting { padding: 4px 16px 12px; border-bottom: 1px solid var(--border-subtle); }
.switch-row { display: flex; align-items: center; justify-content: space-between; max-width: 360px; cursor: pointer;
  font-size: 16px; font-weight: 500; color: var(--header-primary); }
/* Discord-style switch */
.switch { appearance: none; position: relative; width: 40px; height: 24px; margin: 0; border-radius: 12px; cursor: pointer;
  background: #80848e; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: left .15s; }
.switch:checked { background: #23a55a; }
.switch:checked::after { left: 19px; }

/* Discord's bars: "N new messages" on top, "You're Viewing Older Messages" at the bottom */
.chat-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-body .scroller { flex: 1; }
.new-bar {
  position: absolute; top: 0; left: 16px; right: 32px; z-index: 3; display: flex; align-items: center; height: 32px;
  border-radius: 0 0 8px 8px; background: var(--blurple); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.new-bar[hidden], .present-bar[hidden] { display: none; }
.new-bar button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; height: 100%; }
.new-bar-text { flex: 1; text-align: left; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.new-bar-read { flex: none; padding: 0 12px; font-weight: 600; }
.new-bar button:hover { text-decoration: underline; }
.present-bar {
  position: absolute; bottom: 0; left: 16px; right: 32px; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 12px; border-radius: 8px 8px 0 0; background: #3c45a5; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.3);
}
.present-bar button { border: 0; background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.present-bar button:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .video-item { padding: 8px 16px; }
  .video-embed { width: 100%; min-width: 0; }
}

/* "Settings" category pinned to the bottom of the sidebar */
.sidebar-bottom { flex: none; padding: 0 0 8px 8px; box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.04); }
.sidebar-bottom .category { padding-top: 12px; }

/* local copies: Transcript button / worker status under the video */
.video-actions { grid-column: 1; display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.button-secondary {
  height: 32px; padding: 0 16px; border: 0; border-radius: 8px; background: #4e5058; color: #fff;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.button-secondary:hover { background: #6d6f78; }
.video-status { font-size: 14px; color: var(--text-muted); }

/* transcript panel beside the video */
.video-embed.with-transcript { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
.transcript-cell { grid-column: 2; grid-row: 1 / span 3; position: relative; min-height: 360px; }
.transcript-panel {
  position: absolute; inset: 0; display: flex; flex-direction: column; border-radius: 8px;
  background: var(--bg-sidebar); overflow: hidden;
}
.transcript-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border-subtle); }
.transcript-title { flex: none; font-size: 14px; font-weight: 600; color: var(--header-primary); }
.transcript-search {
  flex: 1; min-width: 0; height: 28px; padding: 0 8px; border: 0; border-radius: 4px;
  background: var(--bg-primary); color: var(--text-normal); font: inherit; font-size: 13px; outline: none;
}
.transcript-close { flex: none; width: 28px; height: 28px; padding: 5px; border: 0; border-radius: 4px; background: transparent; color: var(--interactive-normal); cursor: pointer; }
.transcript-close:hover { background: var(--bg-modifier-hover); color: var(--interactive-hover); }
.transcript-close svg { width: 18px; height: 18px; display: block; }
.transcript-info { flex: none; display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px 0; font-size: 12px; color: var(--text-muted); }
.transcript-info:empty { display: none; }
.transcript-body { flex: 1; overflow-y: auto; padding: 8px 12px 12px; font-size: 14px; line-height: 20px; color: var(--text-normal); }
.tx-para { margin: 0 0 12px; }
.tx-time {
  padding: 0; border: 0; background: none; color: var(--link); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tx-time:hover { text-decoration: underline; }
.tx-seg { cursor: pointer; border-radius: 3px; }
.tx-seg:hover { background: rgba(255, 255, 255, 0.04); }
.tx-seg.current { background: rgba(88, 101, 242, 0.25); color: var(--header-primary); }
.transcript-body mark { background: rgba(240, 177, 50, 0.35); color: inherit; border-radius: 2px; }
.tx-empty { color: var(--text-muted); }
@media (max-width: 700px) {
  .video-embed.with-transcript { grid-template-columns: minmax(0, 1fr); }
  .transcript-cell { grid-column: 1; grid-row: auto; min-height: 320px; margin-top: 8px; }
}

/* subtitles */
video.video-frame::cue { color: #fff; background: rgba(0, 0, 0, 0.7); font-family: var(--font); line-height: 1.3; }
.cc-button { padding: 0 12px; }
.segmented.small { margin-left: 0; }
.segmented.small button { height: 22px; padding: 0 8px; font-size: 12px; }

/* ---- Position Planner ---- */
.messages.planner-mode { padding: 0; }
.planner { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: calc(100vh - 48px); }
.planner-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.planner-toolbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.pl-ticker { width: 140px; text-transform: uppercase; font-weight: 600; }
.planner-seg { margin-left: 0; }
.pl-frames { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--header-secondary); }
.pl-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.pl-check input { margin: 0; accent-color: var(--blurple); }
.pl-swatch { width: 10px; height: 3px; border-radius: 2px; display: inline-block; background: linear-gradient(90deg, #f23645 50%, #4caf50 50%); }
.pl-swatch-weekly, .pl-swatch-monthly { height: 4px; }
.pl-swatch-52w { background: #9c27b0; }
.pl-swatch-ATH { background: #ff9800; }
.pl-status { font-size: 13px; color: var(--text-muted); }
.planner-chart { flex: 1; min-height: 300px; position: relative; }
.pl-events { flex: none; max-height: 132px; overflow-y: auto; padding: 8px 16px; border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--header-secondary); }
.pl-event { padding: 1px 0; }
.pl-event-date, .pl-event-frame { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pl-event strong { color: var(--header-primary); font-weight: 600; }

.planner-side { overflow-y: auto; padding: 4px 16px 32px; background: var(--bg-sidebar); }
.pl-heading { margin: 20px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); }
.pl-section { padding-bottom: 8px; }
.pl-label { margin: 12px 0 6px; font-size: 12px; font-weight: 600; color: var(--header-secondary); }
.pl-hint { font-weight: 400; color: var(--text-muted); }
.pl-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pl-input {
  height: 32px; min-width: 0; padding: 0 8px; border: 1px solid var(--border-subtle); border-radius: 4px;
  background: var(--bg-primary); color: var(--text-normal); font: inherit; font-size: 14px; outline: none; width: 100%;
}
.pl-row .pl-input { flex: 1; width: auto; }
.pl-input:focus { border-color: var(--blurple); }
.pl-select { width: auto; flex: none; }
.pl-row .pl-pct { flex: 0 0 64px; }
.pl-mini { flex: 0 0 34px; font-size: 12px; font-weight: 600; color: var(--header-secondary); }
.pl-unit { font-size: 13px; color: var(--text-muted); }
.pl-link { padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-size: 13px; cursor: pointer; }
.pl-link:hover { text-decoration: underline; }
.pl-x { flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent;
  color: var(--interactive-normal); font-size: 18px; line-height: 24px; cursor: pointer; }
.pl-x:hover { background: var(--bg-modifier-hover); color: var(--interactive-hover); }
.planner-side .segmented { flex-wrap: wrap; }
.pl-summary { font-size: 14px; }
.pl-kv { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid var(--border-subtle); }
.pl-kv span:first-child { color: var(--header-secondary); }
.pl-kv span:last-child { color: var(--header-primary); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

.review-verdict { margin-bottom: 10px; padding: 8px 10px; border-radius: 4px; font-size: 14px; font-weight: 600;
  background: var(--bg-primary); border-left: 4px solid var(--text-muted); color: var(--header-primary); }
.review-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.review-dot { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; color: #fff; font-size: 12px;
  font-weight: 700; line-height: 18px; text-align: center; }
.status-good .review-dot { background: #23a55a; }
.status-warn .review-dot { background: #f0b232; color: #1a1a1e; }
.status-bad .review-dot { background: #f23f43; }
.review-verdict.status-good { border-left-color: #23a55a; }
.review-verdict.status-warn { border-left-color: #f0b232; }
.review-verdict.status-bad { border-left-color: #f23f43; }
.review-body { min-width: 0; }
.review-title { font-size: 14px; font-weight: 600; color: var(--header-primary); }
.review-heuristic { margin-left: 6px; padding: 0 4px; border-radius: 3px; background: var(--bg-modifier-selected);
  font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); vertical-align: 1px; }
.review-text { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-normal); }
.review-quote { margin: 6px 0 0; padding-left: 8px; border-left: 3px solid var(--spine); font-size: 12px; line-height: 16px; color: var(--header-secondary); }
.review-quote a { white-space: nowrap; }
.pl-plans { margin-top: 8px; }
.pl-plan { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.pl-plan a { color: var(--header-primary); font-weight: 500; }
.pl-plan.selected a { color: var(--link); }
.pl-plan-meta { flex: 1; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1100px) {
  .planner { grid-template-columns: minmax(0, 1fr); height: auto; }
  .planner-chart { height: 420px; flex: none; }
  .planner-side { overflow: visible; }
}
.pl-converted { margin-top: 4px; font-size: 12px; color: var(--text-muted); min-height: 16px; }
.planner-seg button.selected { background: var(--blurple); color: #fff; }
.pl-warn { margin-top: 2px; color: #f0b232; font-weight: 500; }

/* shared form components (ui.js): no native spinners, −/+ steppers, hover hints */
.pl-input::-webkit-inner-spin-button, .pl-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pl-input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.pl-num { display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--border-subtle); border-radius: 4px; background: var(--bg-primary); }
.pl-num:focus-within { border-color: var(--blurple); }
.pl-num .pl-input { border: 0; background: transparent; flex: 1; width: auto; min-width: 0; text-align: center; }
.pl-step { flex: none; width: 28px; border: 0; background: transparent; color: var(--interactive-normal); font: inherit; font-size: 16px; cursor: pointer; }
.pl-step:hover { background: var(--bg-modifier-hover); color: var(--interactive-hover); }
.pl-step:first-child { border-radius: 4px 0 0 4px; }
.pl-step:last-child { border-radius: 0 4px 4px 0; }
.pl-row .pl-grow { flex: 1; min-width: 0; }
.pl-row .pl-pct { flex: 0 0 56px; text-align: center; }
.hint-target[data-hint] { cursor: help; border-bottom: 1px dotted var(--text-muted); }
.pl-ticker[data-hint], .segmented[data-hint], .pl-frames[data-hint] { border-bottom: 0; }

/* Long / Short like Bybit: selected long green, selected short red, the other muted with a faint tint */
.pl-dir { margin-top: 12px; }
.pl-dir .dir-seg { display: flex; width: 100%; }
.pl-dir .dir-seg button { flex: 1; height: 32px; font-weight: 600; }
.dir-seg button[data-value="long"], .dir-seg button[data-value="buy"] { color: rgba(35, 165, 90, 0.75); background: rgba(35, 165, 90, 0.08); }
.dir-seg button[data-value="short"], .dir-seg button[data-value="sell"] { color: rgba(242, 63, 67, 0.75); background: rgba(242, 63, 67, 0.08); }
.dir-seg button[data-value="long"].selected, .dir-seg button[data-value="buy"].selected { background: #23a55a; color: #fff; }
.dir-seg button[data-value="short"].selected, .dir-seg button[data-value="sell"].selected { background: #f23f43; color: #fff; }

/* Paper Trading */
.pt-account { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.pt-cell { display: flex; flex-direction: column; }
.pt-cell span { font-size: 11px; color: var(--text-muted); }
.pt-cell strong { color: var(--header-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.pos { color: #23a55a !important; }
.neg { color: #f23f43 !important; }
.pt-tabs { flex: none; display: flex; gap: 4px; padding: 6px 16px 0; border-top: 1px solid var(--border-subtle); }
.pt-tabs button { padding: 6px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--interactive-normal); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.pt-tabs button:hover { color: var(--interactive-hover); }
.pt-tabs button.selected { color: var(--header-primary); border-bottom-color: var(--blurple); }
.pt-tab-body { flex: none; height: 200px; overflow: auto; padding: 4px 16px 8px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-table th { position: sticky; top: 0; background: var(--bg-primary); text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 8px 4px 0; }
.pt-table td { padding: 5px 8px 5px 0; border-top: 1px solid var(--border-subtle); color: var(--text-normal); white-space: nowrap; }
.pt-dim { color: var(--text-muted); }
.pt-small { width: 96px; height: 26px; font-size: 12px; }
.pt-tpsl .pt-small + .pt-small { width: 140px; }
.pt-actions { display: flex; gap: 8px; align-items: center; }
.pt-reduce { margin-top: 12px; font-size: 13px; color: var(--header-secondary); }
.pt-plan { margin-top: 12px; }
.pt-plan summary { cursor: pointer; font-size: 13px; color: var(--header-secondary); }
.pt-note { height: auto; padding: 6px 8px; resize: vertical; }
.pt-submit { width: 100%; margin-top: 8px; height: 40px; }
.pt-submit.long { background: #23a55a; }
.pt-submit.long:hover { background: #1a8a4a; }
.pt-submit.short { background: #f23f43; }
.pt-submit.short:hover { background: #c92f33; }
.fill-rules { margin: 8px 0 0; padding-left: 18px; font-size: 14px; line-height: 20px; color: var(--text-normal); }
.fill-rules li { margin-bottom: 6px; }

/* Journal */
.journal-page { padding: 12px 16px 40px; list-style: none; }
.journal-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.journal-table tr[data-journal] { cursor: pointer; }
.journal-table tr[data-journal]:hover td { background: var(--bg-message-hover); }
.journal-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; }
.journal-chart { height: 420px; position: relative; border: 1px solid var(--border-subtle); border-radius: 4px; }
.journal-side .pl-kv span:last-child { max-width: 60%; white-space: normal; }
.journal-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 8px; }
.jr-text { height: auto; padding: 6px 8px; resize: vertical; }
.journal-cards { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 12px 0; }
.journal-cards .pt-cell strong { font-size: 18px; }
.journal-curve { height: 260px; position: relative; border: 1px solid var(--border-subtle); border-radius: 4px; }
@media (max-width: 1100px) { .journal-grid, .journal-cols { grid-template-columns: minmax(0, 1fr); } }

/* planner / paper order blocks (Bybit-like order panel) */
.pl-block { margin-top: 14px; padding: 10px 12px 12px; border-radius: 6px; background: var(--bg-primary); border-left: 3px solid var(--border-subtle); }
.pl-block .pl-label:first-of-type { margin-top: 6px; }
.blk-entry { border-left-color: #dbdee1; }
.blk-stop { border-left-color: #f23645; background: rgba(242, 54, 69, 0.05); }
.blk-tp { border-left-color: #089981; background: rgba(8, 153, 129, 0.05); }
.blk-risk { border-left-color: #5865f2; }
.pl-block-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--header-primary); }
.pl-marker { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.pl-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pl-block .pl-input, .pl-block .pl-num { background: var(--bg-sidebar); }

.pt-alerts:empty { display: none; }
.pt-alert { display: flex; align-items: center; gap: 10px; margin: 6px 16px 0; padding: 8px 12px; border-radius: 4px; font-size: 13px;
  background: rgba(255, 152, 0, 0.12); border-left: 3px solid #ff9800; color: var(--text-normal); }
.pt-alert strong { color: #ff9800; }
.pt-alert .pl-link { margin-left: auto; }
.review-item.status-bad { background: rgba(242, 63, 67, 0.06); }
.review-item.status-warn { background: rgba(240, 178, 50, 0.06); }
.review-item { padding-left: 6px; padding-right: 6px; border-radius: 4px; }

/* compact chart header (shared by Planner, Paper Trading, Brandon Moments) */
.chart-head { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 6px 12px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.ch-symbol-wrap { position: relative; }
.ch-symbol { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent;
  color: var(--header-primary); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.ch-symbol:hover { background: var(--bg-modifier-hover); }
.ch-caret { font-size: 11px; color: var(--text-muted); }
.ch-search { position: absolute; z-index: 20; top: 32px; left: 0; width: 240px; padding: 8px; border-radius: 6px; background: #111214; box-shadow: 0 8px 16px rgba(0, 0, 0, .3); }
.ch-search[hidden] { display: none; }
.ch-input { height: 30px; }
.ch-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 6px; }
.ch-list button { display: flex; justify-content: space-between; padding: 5px 8px; border: 0; border-radius: 3px; background: transparent; color: var(--text-normal); font: inherit; font-size: 13px; cursor: pointer; }
.ch-list button span { color: var(--text-muted); font-size: 11px; }
.ch-list button:hover { background: var(--bg-modifier-hover); }
.ch-badge { padding: 1px 6px; border-radius: 3px; background: var(--bg-modifier-selected); color: var(--header-secondary); font-size: 11px; font-weight: 600; }
.ch-badge:empty { display: none; }
.ch-price { color: var(--header-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-change { font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-tfs { display: flex; gap: 2px; }
.ch-tfs button, .ch-frames button { height: 24px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--interactive-normal);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ch-tfs button:hover, .ch-frames button:hover { color: var(--interactive-hover); background: var(--bg-modifier-hover); }
.ch-tfs button.on { background: var(--bg-modifier-selected); color: var(--interactive-active); }
.ch-status { color: var(--text-muted); font-size: 12px; }
.ch-frames { display: flex; gap: 4px; margin-left: auto; }
.ch-frames button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-subtle); border-radius: 12px; opacity: .55; }
.ch-frames button.on { opacity: 1; background: var(--bg-modifier-selected); border-color: transparent; color: var(--interactive-active); }
.ch-frames button i { display: inline-block; width: 12px; border-radius: 2px; }

/* Brandon Moments */
.mo-bar { flex-wrap: wrap; gap: 10px; }
.mo-filter { width: 130px; height: 32px; }
.mo-import { cursor: pointer; }
.mo-tickers { margin: 0 0 10px; flex-wrap: wrap; }
.mo-tickers button { opacity: 1; }
.mo-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; color: var(--header-secondary); font-size: 13px; }
.mo-note { margin-bottom: 10px; color: var(--text-muted); font-size: 12px; }
.mo-score { font-weight: 600; font-size: 12px; }
.mo-score.status-good { color: #23a55a; }
.mo-score.status-warn { color: #f0b232; }
.mo-score.status-bad { color: #f23f43; }
.mo-meta { font-size: 14px; color: var(--text-normal); margin-bottom: 6px; }
.mo-label { margin: 4px 0 8px; padding: 6px 10px; border-left: 3px solid #f0b232; border-radius: 3px; background: rgba(240, 178, 50, .08);
  color: var(--text-normal); font-size: 13px; }
.mo-q { margin: 6px 0 10px; color: var(--header-secondary); font-size: 13px; }
.mo-dec { margin-bottom: 12px; }
.mo-dec .dir-seg button[data-value="nothing"].selected { background: var(--bg-modifier-selected); color: var(--interactive-active); }
.mo-rationale { margin: 8px 0 10px; }
.review-item.status-info .review-dot { background: var(--bg-modifier-selected); color: var(--header-secondary); }
.mo-posts { border: 1px solid var(--border-subtle); border-radius: 6px; padding: 4px 0; }
.mo-post { list-style: none; margin: 0; padding: 0; }
.mo-post .msg { padding-right: 10px; }
.mo-jump { padding: 0 12px 8px 72px; font-size: 12px; }
.mo-actions { flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pt-submit:disabled { opacity: .5; cursor: default; }

/* Brandon Moments lobby */
.mo-lobby { max-width: 1100px; }
.mo-top { display: flex; align-items: stretch; gap: 12px; margin-bottom: 14px; }
.mo-cards { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mo-card { padding: 10px 12px; border-radius: 8px; background: var(--bg-secondary, #2b2d31); border: 1px solid var(--border-subtle); }
.mo-card-label { color: var(--header-secondary); font-size: 12px; font-weight: 600; }
.mo-card-value { margin-top: 2px; color: var(--header-primary); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mo-card-sub { color: var(--text-muted); font-size: 11px; }
.mo-card .pos, .mo-r.pos { color: #23a55a; }
.mo-card .neg, .mo-r.neg { color: #f23f43; }
.mo-random { flex: none; align-self: center; height: 40px; padding: 0 20px; }
.mo-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mo-pill { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: 15px;
  background: transparent; color: var(--interactive-normal); font: inherit; font-size: 13px; cursor: pointer; }
.mo-pill:hover { background: var(--bg-modifier-hover); color: var(--interactive-hover); }
.mo-pill.active { background: var(--bg-modifier-selected); border-color: transparent; color: var(--interactive-active); }
.mo-pill strong { color: var(--header-primary); font-weight: 600; }
.mo-pill .ch-caret { margin-left: 2px; }
.mo-more { width: 30px; justify-content: center; padding: 0; font-size: 16px; }
.mo-help { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 0 4px 0 -2px; border-radius: 50%;
  background: var(--bg-modifier-selected); color: var(--header-secondary); font-size: 11px; font-weight: 700; cursor: help; text-decoration: none; }
.mo-count { margin-left: auto; color: var(--text-muted); font-size: 13px; }
.mo-menu { width: 220px; top: 36px; }
.mo-menu-right { left: auto; right: 0; width: 240px; }
.mo-opts { max-height: 280px; overflow-y: auto; margin-top: 6px; }
.mo-opt { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 6px 8px; border: 0; border-radius: 3px; background: transparent;
  color: var(--text-normal); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.mo-opt:hover { background: var(--bg-modifier-hover); }
.mo-opt.on { background: var(--brand-500, #5865f2); color: #fff; }
.mo-opt span { color: var(--text-muted); font-size: 11px; }
.mo-opt.on span { color: rgba(255, 255, 255, .8); }
.mo-opt[hidden] { display: none; }
.mo-menu-sep { height: 1px; margin: 6px 0; background: var(--border-subtle); }
.mo-date-row { display: flex; gap: 6px; }
.mo-date-row .pl-input { height: 30px; font-size: 12px; }
.mo-apply { width: 100%; margin-top: 6px; height: 30px; }
.mo-import-status { color: var(--header-secondary); font-size: 13px; margin-bottom: 6px; }
.mo-import-status:empty { display: none; }
.mo-list { display: flex; flex-direction: column; border-top: 1px solid var(--border-subtle); }
.mo-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 48px 120px 190px; align-items: center; gap: 12px; padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle); color: var(--text-normal); text-decoration: none; border-radius: 0; }
a.mo-row:hover { background: var(--bg-modifier-hover); text-decoration: none; }
.mo-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.mo-av-strategy { display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(240, 178, 50, .16); color: #f0b232; }
.mo-av-strategy svg { width: 18px; height: 18px; }
.mo-av-letter { display: flex; align-items: center; justify-content: center; background: #5865f2; color: #fff; font-weight: 700; }
.mo-main { display: flex; flex-direction: column; min-width: 0; }
.mo-tk { color: var(--header-primary); font-weight: 600; font-size: 15px; }
.mo-quote { margin-left: 3px; color: var(--text-muted); font-size: 11px; font-weight: 500; }
.mo-sub { color: var(--text-muted); font-size: 12px; }
.mo-badge-strategy { padding: 0 5px; border-radius: 3px; background: rgba(240, 178, 50, .16); color: #f0b232; font-size: 11px; font-weight: 600; }
.mo-tf { justify-self: start; padding: 1px 6px; border-radius: 3px; background: var(--bg-modifier-selected); color: var(--header-secondary); font-size: 11px; font-weight: 600; }
.mo-date { color: var(--header-secondary); font-size: 13px; }
.mo-status { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mo-chip { padding: 2px 8px; border-radius: 10px; background: var(--bg-modifier-hover); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.mo-chip.good { background: rgba(35, 165, 90, .15); color: #23a55a; }
.mo-chip.warn { background: rgba(240, 178, 50, .15); color: #f0b232; }
.mo-chip.bad { background: rgba(242, 63, 67, .15); color: #f23f43; }
.mo-r { min-width: 58px; text-align: right; color: var(--text-muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mo-row.skeleton i, .mo-sk { display: block; height: 10px; margin: 3px 0; border-radius: 5px; background: var(--bg-modifier-hover); animation: mo-pulse 1.2s ease-in-out infinite; }
.mo-sk { width: 40px; height: 18px; }
.mo-row.skeleton .mo-av { background: var(--bg-modifier-hover); }
.mo-row.skeleton .mo-tf { background: none; }
@keyframes mo-pulse { 50% { opacity: .45; } }
.mo-empty { padding: 48px 16px; text-align: center; }
.mo-empty-title { color: var(--header-primary); font-size: 16px; font-weight: 600; }
.mo-empty-text { margin: 4px 0 12px; color: var(--text-muted); font-size: 13px; }
.mo-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; color: var(--header-secondary); font-size: 13px; }
.mo-pager button:disabled { opacity: .4; cursor: default; }
@media (max-width: 1000px) { .mo-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mo-row { grid-template-columns: 36px minmax(0, 1fr) 44px 90px 160px; } }

/* Brandon Moments play page */
.mo-dec .dir-seg button[data-value="nothing"] { color: var(--interactive-normal); background: rgba(255, 255, 255, .04); }
.mo-dec .dir-seg button[data-value="nothing"].selected { background: #4e5058; color: #fff; }
.mo-reveal { width: 100%; height: 40px; margin-top: 10px; }
.mo-reveal:disabled { opacity: .5; cursor: default; }
.mo-fill { display: flex; width: 100%; }
.mo-fill button { flex: 1; }
.blk-click, .blk-note { border-left-color: #4e5058; }
.mo-optional { margin-left: 6px; color: var(--text-muted); font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* FAQ (faq.js): Discord-style like the archive */
.faq-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 16px 16px 40px; list-style: none; }
.faq-cats { position: sticky; top: 16px; align-self: start; }
.faq-cats-title { margin: 0 8px 8px; color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.faq-cat-link { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 4px; color: var(--channels-default, var(--text-muted)); font-size: 15px; font-weight: 500; text-decoration: none; }
.faq-cat-link span { color: var(--text-muted); font-size: 12px; }
.faq-cat-link:hover { background: var(--bg-modifier-hover); color: var(--interactive-hover); text-decoration: none; }
.faq-cat-link.selected { background: var(--bg-modifier-selected); color: var(--interactive-active); }
.faq-main { max-width: 860px; }
.faq-search { width: 100%; margin-bottom: 16px; }
.faq-notice { margin-bottom: 14px; padding: 10px 12px; border-radius: 4px; border-left: 4px solid var(--blurple); background: var(--bg-secondary); color: var(--text-normal); font-size: 14px; }
.faq-notice.error { border-left-color: #f23f43; }
.faq-entry { margin-bottom: 8px; border-radius: 8px; background: var(--bg-secondary); }
.faq-head { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 16px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.faq-head:hover { background: var(--bg-modifier-hover); }
.faq-chevron svg { width: 16px; height: 16px; margin-top: 3px; color: var(--text-muted); transform: rotate(-90deg); transition: transform .15s; }
.faq-entry.open .faq-chevron svg { transform: none; }
.faq-head-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.faq-q { color: var(--header-primary); font-size: 18px; font-weight: 600; line-height: 1.3; }
.faq-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-muted); font-size: 13px; }
.faq-body { padding: 0 16px 14px 42px; }
.faq-a p { margin: 0 0 8px; }
.faq-a ul { margin: 0 0 8px; padding-left: 20px; }
.faq-a li { margin: 2px 0; }
.faq-src-toggle { padding: 0; border: 0; background: none; color: var(--text-muted); font: 600 13px var(--font); cursor: pointer; }
.faq-src-toggle:hover { color: var(--interactive-hover); }
.faq-link { display: inline-block; margin-top: 10px; color: var(--text-link, #00a8fc); font-size: 12px; }
.faq-cat { color: var(--blurple); font-weight: 600; }
/* question and answer read like chat messages (Discord 16px / 1.375), ~80 characters a line; the quotes stay smaller */
.faq-a, .faq-a li { color: var(--text-normal); font-family: var(--font); font-size: var(--message-font-size); line-height: var(--message-line-height); }
.faq-a { max-width: 68ch; margin: 0 0 10px; }   /* "ch" is the 0 glyph: 68ch ≈ 80 real characters a line */
.faq-quote { margin: 8px 0 0; padding: 2px 0 2px 12px; border-left: 4px solid var(--bg-modifier-selected, #4e5058); color: var(--text-normal); font-size: 14px; line-height: 1.45; }
.faq-quote-meta { margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.faq-more { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--text-link, #00a8fc); font: inherit; font-size: 13px; cursor: pointer; }
.faq-more:hover { text-decoration: underline; }
.faq-empty { padding: 32px; color: var(--text-muted); text-align: center; }
@media (max-width: 900px) { .faq-page { grid-template-columns: 1fr; } .faq-cats { position: static; } }

/* collapsible sidebar categories (Discord) */
.category[data-cat] { cursor: pointer; user-select: none; }
.category[data-cat]:hover { color: var(--interactive-hover, #dbdee1); }
.category[data-cat] svg { transition: transform .15s ease; }
.category.collapsed svg { transform: rotate(-90deg); }
.category[data-cat]:focus-visible { outline: 2px solid var(--blurple); outline-offset: -2px; border-radius: 4px; }
