/* Iron Sharpens Iron — a Discord-dark replica. Feature styles are grouped
   at the bottom under their feature id. */

:root {
  --bg-rail: #1e1f22;
  --bg-side: #2b2d31;
  --bg-chat: #313338;
  --bg-input: #383a40;
  --bg-hover: #2e3035;
  --bg-active: #404249;
  --bg-float: #111214;
  --bg-card: #2b2d31;
  --line: #3f4147;
  --text: #dbdee1;
  --text-strong: #f2f3f5;
  --muted: #949ba4;
  --faint: #6d6f78;
  --brand: #5865f2;
  --brand-hover: #4752c4;
  --link: #00a8fc;
  --green: #23a55a;
  --red: #f23f43;
  --yellow: #f0b232;
  --mention: #f23f43;

  /* chess.com-flavoured annotation colors */
  --c-brilliant: #26c2a3;
  --c-great: #5c8bb0;
  --c-good: #81b64c;
  --c-dubious: #f7c045;
  --c-mistake: #e58f2a;
  --c-blunder: #ca3431;

  --radius: 8px;
  --font: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-chat);
  color: var(--text);
  font: 16px/1.375 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

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

/* ------------------------------------------------------------ server rail */
.guilds {
  width: 72px; flex: none; background: var(--bg-rail);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0;
}
.guild {
  position: relative; width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-chat); color: var(--text-strong);
  display: grid; place-items: center; cursor: pointer;
  transition: border-radius .15s, background .15s;
  font-weight: 700; font-size: 15px;
}
.guild:hover, .guild.active { border-radius: 16px; background: var(--brand); }
.guild.home { color: var(--text); }
.guild.add { color: var(--green); font-size: 26px; font-weight: 400; }
.guild.add:hover { background: var(--green); color: #fff; }
.guild-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--line); }
.guild-pill {
  position: absolute; left: -16px; width: 8px; height: 40px; border-radius: 0 4px 4px 0; background: #fff;
}
.guild-badge {
  position: absolute; right: -4px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--mention); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; border: 4px solid var(--bg-rail);
}

/* --------------------------------------------------------- channel list */
.sidebar { width: 240px; flex: none; background: var(--bg-side); display: flex; flex-direction: column; min-height: 0; }
.sidebar-head {
  height: 48px; flex: none; padding: 0 16px; display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; color: var(--text-strong); box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.chev { color: var(--muted); }
.channels { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.cat {
  display: flex; align-items: center; gap: 2px; padding: 18px 8px 4px 2px;
  text-transform: uppercase; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
}
.cat-chev { font-size: 11px; width: 12px; }
.channel {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 1px 0; border-radius: 4px;
  color: var(--muted); font-weight: 500; position: relative;
}
.channel:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.channel.active { background: var(--bg-active); color: var(--text-strong); }
.channel .hash { font-size: 20px; line-height: 1; color: var(--faint); font-weight: 400; }
.channel.unread { color: var(--text-strong); font-weight: 600; }
.channel.unread::before {
  content: ''; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: #fff;
}
.mention-badge {
  margin-left: auto; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--mention); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center;
}

.user-panel {
  flex: none; height: 52px; padding: 0 8px; background: #232428;
  display: flex; align-items: center; gap: 8px;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.user-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 4px;
  display: grid; place-items: center; line-height: 1;
}
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* ---------------------------------------------------------------- chat */
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-chat); }
.chat-head {
  height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 1.5px 0 rgba(0,0,0,.05);
  z-index: 2;
}
.chat-head .hash { font-size: 24px; color: var(--faint); }
.chat-title { font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.chat-topic {
  flex: 1; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line);
}
.chat-head-tools { display: flex; align-items: center; gap: 8px; }
.mobile-only { display: none; }

.chat-body { flex: 1; min-height: 0; display: flex; }
.messages { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 0 12px; }

.channel-welcome { padding: 16px 16px 8px; margin-bottom: 8px; }
.welcome-hash {
  width: 68px; height: 68px; border-radius: 50%; background: #41434a; color: #fff;
  display: grid; place-items: center; font-size: 42px; font-weight: 300; margin-bottom: 8px;
}
.channel-welcome h1 { margin: 8px 0; font-size: 32px; color: var(--text-strong); font-weight: 700; }
.channel-welcome p { margin: 0; color: var(--muted); }

.day-divider {
  display: flex; align-items: center; margin: 24px 16px 8px; color: var(--muted);
  font-size: 12px; font-weight: 600;
}
.day-divider::before, .day-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.day-divider span { padding: 0 6px; }

/* message */
.msg {
  position: relative; display: grid; grid-template-columns: 72px 1fr; padding: 2px 48px 2px 0;
  min-height: 22px;
}
.msg.head { margin-top: 17px; }
.msg:hover { background: var(--bg-hover); }
.msg.enter { animation: msg-in .22s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(88,101,242,.22); } }

.msg-reply {
  grid-column: 2; position: relative; display: flex; align-items: center; gap: 4px; font-size: 14px;
  color: var(--muted); margin-bottom: 2px; cursor: pointer; min-width: 0;
}
.msg-reply::before {
  content: ''; position: absolute; left: -36px; top: 50%; width: 33px; height: 13px;
  border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px;
}
.reply-name { font-weight: 600; white-space: nowrap; }
.reply-name:hover { text-decoration: underline; }
.reply-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.msg-reply:hover .reply-text { color: var(--text); }

.msg-gutter { position: relative; display: flex; justify-content: center; padding-top: 2px; }
.msg-reply + .msg-gutter { grid-row: 2; }
.msg-hover-time { visibility: hidden; font-size: 11px; color: var(--muted); line-height: 22px; }
.msg:hover .msg-hover-time { visibility: visible; }
.msg-main { min-width: 0; padding-right: 8px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden;
}
.avatar { position: relative; }
.avatar svg { width: 60%; height: 60%; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.xs { width: 16px; height: 16px; }
.msg-gutter .avatar { cursor: pointer; }

.msg-header { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 22px; }
.msg-name { font-weight: 600; cursor: pointer; }
.msg-name:hover { text-decoration: underline; }
.msg-time { font-size: 12px; color: var(--muted); }
.bot-tag {
  display: inline-flex; align-items: center; height: 15px; padding: 0 4px; border-radius: 3px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .02em;
  position: relative; top: -1px; margin-left: 4px;
}
.msg-text { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.375; }
.msg-text code { background: #2b2d31; border-radius: 4px; padding: 0 3px; font-size: 85%; font-family: Consolas, 'Andale Mono', monospace; }
.msg-text blockquote { margin: 2px 0; padding: 0 8px 0 12px; border-left: 4px solid #4e5058; }
.msg-text .spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; }
.msg-text .spoiler:focus, .msg-text .spoiler:hover { color: inherit; background: #3a3c42; }
.edited { color: var(--muted); font-size: 10px; }

.msg-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.dbtn {
  border: 0; border-radius: 4px; padding: 6px 14px; min-height: 32px; cursor: pointer;
  font-size: 14px; font-weight: 500; background: #4e5058; color: #fff; transition: background .15s;
}
.dbtn:hover { background: #6d6f78; }
.dbtn.primary { background: var(--brand); }
.dbtn.primary:hover { background: var(--brand-hover); }
.dbtn.danger { background: #da373c; }
.dbtn.danger:hover { background: #a12828; }
.dbtn.small { min-height: 26px; padding: 3px 10px; font-size: 13px; }

.msg.ephemeral { background: rgba(88,101,242,.06); }
.msg.ephemeral:hover { background: rgba(88,101,242,.1); }
.ephemeral-note { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 4px; }

.msg-acc { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.msg-acc:empty { display: none; }
.msg-acc > * { margin-top: 4px; }
.msg-acc .judge-card { order: 1; }
.msg-acc .audit-card { order: 2; }
.msg-acc .flag-row { order: 3; }
.msg-acc .polish-link { order: 4; }
.msg-acc .reactions { order: 5; }

.msg-tools {
  position: absolute; right: 16px; top: -16px; display: none; background: var(--bg-chat);
  border: 1px solid #26272b; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.msg:hover .msg-tools:not(:empty) { display: flex; }
.tool-btn { background: none; border: 0; padding: 4px 8px; cursor: pointer; font-size: 16px; border-radius: 4px; }
.tool-btn:hover { background: var(--bg-hover); }

/* ------------------------------------------------------------- composer */
.composer-wrap { flex: none; padding: 0 16px; }
.composer-hints { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 6px; min-height: 0; }
.composer {
  display: flex; align-items: flex-end; gap: 8px; background: var(--bg-input); border-radius: var(--radius);
  padding: 0 12px 0 16px;
}
.composer-plus {
  flex: none; width: 24px; height: 24px; margin: 11px 0; border-radius: 50%; background: #b5bac1; color: var(--bg-input);
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
#input {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; padding: 11px 0; max-height: 220px; line-height: 1.375;
}
#input::placeholder { color: var(--faint); }
#input:disabled { cursor: not-allowed; }
.send-btn { flex: none; background: none; border: 0; color: var(--muted); font-size: 18px; padding: 10px 2px; cursor: pointer; }
.send-btn:hover { color: var(--text); }
.typing-strip { height: 24px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); padding-left: 4px; }
.typing-strip strong { font-weight: 700; color: var(--text-strong); }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text); animation: dot 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: scale(.8); } 30% { opacity: 1; transform: scale(1); } }

/* --------------------------------------------------------------- members */
.members { width: 240px; flex: none; background: var(--bg-side); overflow-y: auto; padding: 8px 8px 16px; }
.hide-members .members { display: none; }
.member-cat { padding: 24px 8px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; }
.member { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.member:hover { background: var(--bg-hover); }
.member-av { position: relative; }
.status-dot {
  position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); border: 3px solid var(--bg-side);
}
.member-meta { min-width: 0; }
.member-name { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- toasts */
.toasts {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-radius: var(--radius);
  background: var(--bg-float); color: var(--text-strong); box-shadow: 0 8px 24px rgba(0,0,0,.4);
  border-left: 4px solid var(--brand); animation: toast-in .35s cubic-bezier(.2,1.4,.4,1);
}
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .35s; }
.toast-icon { font-size: 26px; }
.toast-text { font-size: 13px; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } }

/* ---------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.7);
  display: grid; place-items: center; padding: 16px; animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg-chat);
  border-radius: var(--radius); box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 16px 48px rgba(0,0,0,.5);
  animation: pop-in .2s cubic-bezier(.2,1.3,.4,1);
}
.modal.wide { width: min(620px, 100%); }
@keyframes pop-in { from { opacity: 0; transform: scale(.94); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 20px; }
.modal-head h2 { margin: 0; font-size: 20px; color: var(--text-strong); }
.modal-body { padding: 12px 20px 20px; }
.modal-body p { margin: 0 0 12px; }
.settings-sub { margin: 20px 0 8px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; }
.settings-list { display: flex; flex-direction: column; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting-name { color: var(--text-strong); font-weight: 500; }
.setting-desc { font-size: 13px; color: var(--muted); }
.setting-row { display: flex; gap: 8px; }
.text-input {
  flex: 1; min-width: 0; background: var(--bg-rail); border: 0; border-radius: 4px; padding: 8px 10px;
  color: var(--text); font: inherit; outline: 0;
}
.switch {
  appearance: none; flex: none; width: 40px; height: 24px; border-radius: 12px; background: #80848e;
  position: relative; cursor: pointer; transition: background .15s; margin: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ===================================================== feature: scorebar */
.judge-card {
  width: min(440px, 100%); background: var(--bg-card); border-radius: 4px; border-left: 4px solid #4e5058;
  padding: 8px 12px 10px; --tone: #4e5058;
}
.judge-card.pending { border-left-color: var(--brand); --tone: var(--brand); }
.judge-card.t-brilliant { --tone: var(--c-brilliant); }
.judge-card.t-great { --tone: var(--c-great); }
.judge-card.t-good { --tone: var(--c-good); }
.judge-card.t-dubious { --tone: var(--c-dubious); }
.judge-card.t-mistake { --tone: var(--c-mistake); }
.judge-card.t-blunder { --tone: var(--c-blunder); }
.judge-card:not(.pending):not(.revealing) { border-left-color: var(--tone); }
.judge-card.revealing { border-left-color: var(--brand); }
.jc-top { display: flex; align-items: baseline; gap: 6px; font-size: 14px; }
.jc-icon { font-size: 14px; }
.jc-status { flex: 1; color: var(--text-strong); font-weight: 600; }
.pending .jc-status, .revealing .jc-status { color: var(--muted); font-weight: 500; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.jc-num { font-weight: 800; font-size: 18px; color: var(--tone); font-variant-numeric: tabular-nums; }
.pending .jc-num { font-size: 13px; color: var(--muted); font-weight: 600; }
.jc-of { color: var(--muted); font-size: 12px; }
.jc-more { background: none; border: 0; color: var(--link); font-size: 12px; cursor: pointer; padding: 0 0 0 8px; }
.jc-bar { height: 8px; border-radius: 4px; background: #1e1f22; overflow: hidden; margin-top: 6px; }
.jc-fill { height: 100%; width: 0; border-radius: 4px; background: var(--tone); transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.pending .jc-fill, .revealing .jc-fill {
  background: linear-gradient(90deg, var(--brand), #8891f2, var(--brand)); background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.pending .jc-fill { transition: width .45s linear; }
.revealing .jc-fill { transition: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.revealed { animation: reveal-glow 1.4s ease-out; }
@keyframes reveal-glow { 0% { box-shadow: 0 0 0 0 var(--tone); } 30% { box-shadow: 0 0 18px 0 color-mix(in srgb, var(--tone) 45%, transparent); } }
.jc-fix { margin-top: 8px; font-size: 13px; color: var(--text); }
.jc-fix strong { color: var(--tone); }
.jc-breakdown { margin-top: 10px; display: grid; gap: 6px; }
.jc-cat { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; }
.jc-cat-name { color: var(--muted); }
.jc-cat-bar { height: 6px; background: #1e1f22; border-radius: 3px; overflow: hidden; }
.jc-cat-bar i { display: block; height: 100%; background: var(--tone, var(--brand)); border-radius: 3px; }
.jc-cat-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.jc-note { margin: 4px 0 0; font-size: 13px; color: var(--text); }

/* ===================================================== feature: thoughts */
.jc-thought { margin-top: 8px; font-size: 13px; font-style: italic; color: var(--muted); line-height: 1.35; }
.jc-thought.fresh { animation: fade .5s; }
.msg-acc .reasoning { order: 4; }
.reasoning-toggle { background: none; border: 0; padding: 0; color: var(--link); font-size: 13px; cursor: pointer; }
.reasoning-toggle:hover { text-decoration: underline; }
.reasoning-body {
  margin-top: 6px; max-width: 640px; max-height: 280px; overflow: auto; padding: 8px 12px; border-radius: 4px;
  background: var(--bg-side); color: var(--muted); font-size: 13px; white-space: pre-wrap; line-height: 1.45;
}

/* ======================================================== feature: chess */
.chess-badge {
  position: absolute; z-index: 1; top: 26px; right: 10px; width: 22px; height: 22px; padding: 0; border: 2px solid var(--bg-chat);
  border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; cursor: pointer; letter-spacing: -.06em;
  display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.35);
}
.msg:not(.head) .chess-badge { top: 0; }
.chess-badge.pop { animation: chess-pop .5s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes chess-pop { from { transform: scale(0) rotate(-40deg); } }
.c-brilliant { --c: var(--c-brilliant); }
.c-great { --c: var(--c-great); }
.c-good { --c: var(--c-good); }
.c-dubious { --c: var(--c-dubious); }
.c-mistake { --c: var(--c-mistake); }
.c-blunder { --c: var(--c-blunder); }
.chess-badge { background: var(--c); }
.chess-pop {
  position: fixed; z-index: 30; width: 280px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-float);
  box-shadow: 0 8px 24px rgba(0,0,0,.45); border-top: 4px solid var(--c); font-size: 14px; animation: pop-in .15s;
}
.chess-pop p { margin: 8px 0 0; }
.cp-head { display: flex; align-items: center; gap: 10px; }
.cp-sym { width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; display: grid; place-items: center; }
.cp-score { color: var(--muted); font-size: 12px; }
.cp-fix strong { color: var(--c); }

/* ======================================================== feature: flags */
.flag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.flag {
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; cursor: help;
  border: 1px solid transparent;
}
.flag.good { background: rgba(35,165,90,.14); color: #57d68d; border-color: rgba(35,165,90,.35); }
.flag.bad { background: rgba(242,63,67,.12); color: #ff8a8d; border-color: rgba(242,63,67,.3); }
mark.hl-bad, mark.hl-good { background: none; color: inherit; text-decoration-line: underline; text-underline-offset: 3px; cursor: help; }
mark.hl-bad { text-decoration-style: wavy; text-decoration-color: var(--red); }
mark.hl-good { text-decoration-thickness: 2px; text-decoration-color: var(--green); }

/* ======================================================= feature: claims */
.audit-card {
  width: min(560px, 100%); background: var(--bg-card); border-radius: 4px; border-left: 4px solid #8a6df1;
  padding: 8px 12px 10px; font-size: 14px;
}
.ac-head { font-weight: 700; color: var(--text-strong); margin-bottom: 6px; }
.ac-tally { font-weight: 600; color: var(--muted); font-size: 13px; margin-left: 4px; }
.ac-thesis { color: var(--text); margin-bottom: 8px; }
.ac-claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ac-claim {
  display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 6px 8px; border-radius: 4px; cursor: pointer;
  background: rgba(255,255,255,.02);
}
.ac-claim:hover { background: rgba(255,255,255,.05); }
.audit-card.fresh .ac-claim { animation: claim-in .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes claim-in { from { opacity: 0; transform: translateX(-10px); } }
.ac-quote { color: var(--text-strong); font-style: italic; }
.ac-why { color: var(--muted); font-size: 13px; }
.s-ok .ac-why { color: #57d68d; }
.s-no .ac-why { color: #ff8a8d; }
.s-def .ac-why { color: #f5c76a; }
.audit-card.pending { border-left-color: var(--brand); }
.ac-status { color: var(--muted); font-size: 13px; animation: blink 1.6s infinite; }
.audit-card .jc-bar .jc-fill { background: linear-gradient(90deg, #8a6df1, #b9a6ff, #8a6df1); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; transition: width .45s linear; }
.ac-compress { margin-top: 10px; }
.compressed-badge { order: 2; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: rgba(138,109,241,.18); color: #c4b5ff; }
mark.claim { background: none; color: inherit; text-decoration-line: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; cursor: help; }
mark.claim.s-ok { text-decoration-color: var(--green); }
mark.claim.s-no { text-decoration-color: var(--red); text-decoration-style: dotted; }
mark.claim.s-def { text-decoration-color: var(--yellow); text-decoration-style: dashed; }
mark.flash-mark { animation: mark-flash 1.4s ease-out; border-radius: 2px; }
@keyframes mark-flash { 0%, 40% { background: rgba(138,109,241,.35); } }

/* ========================================================= feature: bait */
.bait-reveal { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 10px; animation: fade .3s; }
.bait-reveal.good { background: rgba(35,165,90,.14); color: #57d68d; }
.bait-reveal.bad { background: rgba(242,63,67,.12); color: #ff8a8d; }
.msg-acc .bait-reveal { order: 3; }
.bait-pop {
  position: fixed; z-index: 30; width: 220px; padding: 8px; border-radius: var(--radius); background: var(--bg-float);
  box-shadow: 0 8px 24px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 2px; animation: pop-in .15s;
}
.bp-head { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 8px 6px; }
.bp-opt { text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.bp-opt:hover { background: var(--brand); color: #fff; }

/* ==================================================== feature: reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.reaction {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; cursor: pointer;
  background: var(--bg-side); border: 1px solid transparent; font-size: 14px;
}
.reaction:hover { border-color: #4e5058; }
.reaction.me { background: rgba(88,101,242,.15); border-color: var(--brand); }
.r-count { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.reaction.me .r-count { color: #c9cdfb; }
.reaction.bumped { animation: bump .35s cubic-bezier(.2,1.8,.4,1); }
@keyframes bump { 40% { transform: scale(1.25); } }

/* ======================================================= feature: rating */
.rating-delta { font-weight: 800; font-size: 13px; padding: 0 6px; border-radius: 8px; margin-left: 4px; }
.rating-delta.up { color: #57d68d; background: rgba(35,165,90,.14); }
.rating-delta.down { color: #ff8a8d; background: rgba(242,63,67,.12); }
.rating-delta.pop { animation: delta-pop .9s cubic-bezier(.2,1.6,.4,1); }
@keyframes delta-pop { 0% { transform: translateY(8px) scale(.4); opacity: 0; } 60% { transform: translateY(-4px) scale(1.2); opacity: 1; } }
.rating-card {
  display: flex; align-items: center; gap: 14px; margin: 12px 16px 0 72px; padding: 12px 16px; max-width: 520px;
  background: var(--bg-card); border-radius: var(--radius);
}
.rc-icon { font-size: 32px; }
.rc-meta { flex: 1; min-width: 0; }
.rc-title { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rc-rank { font-size: 18px; font-weight: 700; color: var(--text-strong); }
.rc-next { font-size: 13px; color: var(--muted); }
.rc-spark.empty { font-size: 12px; color: var(--faint); }

/* ====================================================== feature: streaks */
.streak-pill {
  font-weight: 800; font-size: 13px; padding: 2px 10px; border-radius: 12px; color: #fff;
  background: linear-gradient(90deg, #f04a2a, #f7a325); animation: flicker 1.8s infinite;
}
@keyframes flicker { 50% { filter: brightness(1.2); } }

/* ========================================================= feature: lint */
.hint { font-size: 12px; padding: 3px 9px; border-radius: 10px; animation: fade .2s; max-width: 100%; }
.hint.bad { background: rgba(240,178,50,.12); color: #f5c76a; }
.hint.good { background: rgba(35,165,90,.14); color: #57d68d; font-weight: 600; }
.hint.tip { background: rgba(88,101,242,.14); color: #aab2ff; }

/* ======================================================= feature: polish */
.polish-link { background: none; border: 0; padding: 0; color: var(--link); font-size: 13px; cursor: pointer; }
.polish-link:hover { text-decoration: underline; }

/* ==================================================== feature: scorecard */
.sc-topic { color: var(--muted); }
.sc-hero { display: flex; align-items: center; gap: 16px; margin: 8px 0 16px; }
.sc-grade {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: #fff;
  background: var(--g, var(--brand)); box-shadow: 0 0 24px color-mix(in srgb, var(--g, var(--brand)) 50%, transparent);
  animation: chess-pop .6s cubic-bezier(.2,1.8,.4,1);
}
.g-S { --g: var(--c-brilliant); } .g-A { --g: var(--c-great); } .g-B { --g: var(--c-good); }
.g-C { --g: var(--c-dubious); } .g-D { --g: var(--c-mistake); } .g-F { --g: var(--c-blunder); }
.sc-acc { font-size: 24px; font-weight: 800; color: var(--text-strong); }
.sc-delta { color: var(--muted); }
.sc-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.sc-count { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sc-count strong { margin-left: auto; padding-right: 8px; }
.sc-sym { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.sc-cats { display: grid; gap: 6px; }
.sc-turn { margin-top: 16px; }
.sc-turn-head { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sc-turn-score { color: var(--text-strong); }
.sc-turn blockquote { margin: 6px 0 0; padding: 4px 12px; border-left: 4px solid #4e5058; color: var(--text); white-space: pre-wrap; }
.sc-review p { margin: 0 0 8px; }
.shimmer {
  color: var(--muted); padding: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-side) 0, #35373c 50%, var(--bg-side) 100%); background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* -------------------------------------------------------------- mobile */
@media (max-width: 1000px) {
  .members { position: absolute; right: 0; top: 48px; bottom: 0; z-index: 5; box-shadow: -8px 0 24px rgba(0,0,0,.3); }
  .chat { position: relative; }
}
@media (max-width: 760px) {
  .mobile-only { display: grid; }
  .guilds, .sidebar {
    position: fixed; top: 0; bottom: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s;
  }
  .guilds { left: 0; }
  .sidebar { left: 72px; transform: translateX(calc(-100% - 72px)); }
  .show-sidebar .guilds, .show-sidebar .sidebar { transform: none; }
  .show-sidebar .chat::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 15; }
  .chat-head { padding-left: 8px; }
  .chat-topic { display: none; }
  .msg { grid-template-columns: 56px 1fr; padding-right: 16px; }
  .msg-reply::before { left: -28px; width: 25px; }
  .composer-wrap { padding: 0 16px; }
  .channel-welcome h1 { font-size: 24px; }
  .rating-card { margin-left: 16px; margin-right: 16px; }
  .members { width: min(240px, 80vw); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
