/* Discord bug board (js/community.js). Loaded after main.css and chrome.css.
   Tokens only, so light and dark both follow the same variables. Class
   prefix cm-. Nothing here styles data: every string is a text node. */

/* ---------- screen header ---------- */
.cm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.cm-head-text { min-width: 0; flex: 1 1 380px; }
.cm-head .page-sub { max-width: 62ch; line-height: 1.5; }
.cm-pill-slot { flex: 0 0 auto; padding-top: 2px; }
.cm-pill-slot[hidden] { display: none; }
.cm-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 12.5px; font-weight: 500; color: var(--ink-soft); max-width: 100%; }
.cm-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex-shrink: 0; box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent); }
.cm-pill--ok .cm-pill-dot { animation: cm-pulse 2.4s ease-out infinite; }
.cm-pill--warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-bg); color: var(--ink); }
.cm-pill--warn .cm-pill-dot { background: var(--warn); }
.cm-pill--danger { border-color: color-mix(in srgb, var(--bb-sev-critical) 40%, transparent); background: var(--bb-sev-critical-bg); color: var(--ink); }
.cm-pill--danger .cm-pill-dot { background: var(--bb-sev-critical); }
@keyframes cm-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- banners ---------- */
.cm-status { margin-bottom: 14px; }
.cm-banner--note { background: var(--surface-2); color: var(--ink-soft); }
.cm-suggest { margin-bottom: 16px; }
.cm-suggest[hidden] { display: none; }
.cm-suggest-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.cm-suggest-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-suggest-hint { font-weight: 400; color: var(--ink-soft); }

/* ---------- stats strip ---------- */
.cm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); margin-bottom: 18px; overflow: hidden; }
.cm-stat { padding: 14px 18px 13px; border-left: 1px solid var(--border-soft); min-width: 0; }
.cm-stat:first-child { border-left: 0; }
.cm-stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.cm-stat--good .cm-stat-value { color: var(--bb-sev-info); }
.cm-stat-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 5px; }
.cm-stat-hint { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------- filters ---------- */
.cm-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.cm-games { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-filter-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.cm-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--tabs-bg); max-width: 100%; }
.cm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }

.cm-seg-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--ink-soft);
  font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.cm-seg-btn:hover { border-color: var(--btn-border-hover); color: var(--ink); }
.cm-seg-btn.is-zero:not(.is-on) { color: var(--muted); }
.cm-seg-btn.is-zero .cm-seg-count { background: transparent; color: var(--faint); }
.cm-seg-btn.is-on { background: var(--ink); border-color: var(--ink); color: var(--page); font-weight: 600; }
.cm-seg-count { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 18px; text-align: center; padding: 1px 6px; border-radius: 999px; background: var(--chip-bg); color: var(--ink-soft); }
.cm-seg-btn.is-on .cm-seg-count { background: color-mix(in srgb, var(--page) 22%, transparent); color: var(--page); }
.cm-tabs .cm-seg-btn { border-color: transparent; background: transparent; padding: 5px 13px; }
.cm-tabs .cm-seg-btn:hover { background: color-mix(in srgb, var(--card) 60%, transparent); }
.cm-tabs .cm-seg-btn.is-on { background: var(--card); border-color: var(--border); color: var(--ink); box-shadow: var(--shadow-soft); }
.cm-tabs .cm-seg-btn.is-on .cm-seg-count { background: var(--ink); color: var(--page); }
.cm-gdot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; display: inline-block; }

.cm-ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cm-select, .cm-input, .cm-textarea {
  font: inherit; font-size: 12.5px; color: var(--ink); background: var(--input-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; min-width: 0;
}
.cm-select { border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.cm-select--wide { flex: 1 1 200px; border-radius: var(--radius-sm); }
.cm-input { flex: 1 1 220px; }
.cm-textarea { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.5; border-radius: var(--radius-sm); }
.cm-select:focus, .cm-input:focus, .cm-textarea:focus { outline: none; border-color: var(--input-focus-border); box-shadow: 0 0 0 3px var(--focus-ring); }
.cm-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.cm-toggle:hover { border-color: var(--btn-border-hover); color: var(--ink); }
.cm-toggle-box { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--faint); position: relative; flex-shrink: 0; }
.cm-toggle.is-on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.cm-toggle.is-on .cm-toggle-box { background: var(--ink); border-color: var(--ink); }
.cm-toggle.is-on .cm-toggle-box::after { content: ''; position: absolute; left: 3.5px; top: 0.5px; width: 4px; height: 8px; border: solid var(--page); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* focus rings, everywhere on this screen */
.cm-seg-btn:focus-visible, .cm-toggle:focus-visible, .cm-btn:focus-visible, .cm-item-main:focus-visible, .cm-link-btn:focus-visible,
.cm-menu-item:focus-visible, .cm-tile:focus-visible, .cm-info-btn:focus-visible, .cm-sg-topic:focus-visible, .cm-lb button:focus-visible,
.cm-task-link:focus-visible, .cm-post-link:focus-visible, .cm-file:focus-visible, .td-close:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* ---------- buttons shared by list and drawer ---------- */
.cm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--card); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.cm-btn:hover { border-color: var(--btn-border-hover); background: var(--hover-bg); }
.cm-btn--primary { background: var(--ink); border-color: var(--ink); color: var(--page); }
.cm-btn--primary:hover { background: var(--ink); opacity: .88; }
.cm-btn:disabled { opacity: .45; cursor: not-allowed; }
.cm-small { padding: 4px 10px; font-size: 12px; }
.cm-confirming { box-shadow: 0 0 0 2px var(--bb-sev-critical); }
.cm-link-btn { background: none; border: 0; padding: 2px 4px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 4px; }
.cm-link-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- chips ---------- */
.cm-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--chip-bg); color: var(--ink-soft); white-space: nowrap; max-width: 100%; }
.cm-chip--possible { background: var(--chip-orange-bg); color: var(--chip-orange); }
.cm-chip--media { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--ink-soft); font-weight: 500; }
.cm-chip--game { background: transparent; box-shadow: inset 0 0 0 1px var(--border); font-weight: 500; }
.cm-chip--team { background: var(--ink); color: var(--page); }
.cm-chip--danger { background: var(--bb-sev-critical-bg); color: var(--bb-sev-critical); }
.cm-sev { padding: 2px 9px 2px 7px; font-size: 11.5px; }
.cm-st { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.cm-st--open { background: var(--chip-blue-bg); color: var(--chip-blue); }
.cm-st--acknowledged { background: var(--chip-orange-bg); color: var(--chip-orange); }
.cm-st--resolved { background: var(--bb-sev-info-bg); color: var(--bb-sev-info); }
.cm-st--dismissed { background: var(--chip-bg); color: var(--muted); }

/* ---------- ranked list ---------- */
.cm-list { display: flex; flex-direction: column; gap: 8px; }
.cm-list.is-loading { opacity: .6; transition: opacity var(--dur) var(--ease); }
.cm-list-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; font-size: 13px; color: var(--ink-soft); }
.cm-list-title strong { color: var(--ink); font-weight: 600; }
.cm-list-sub { color: var(--muted); }
.cm-info { position: relative; display: inline-flex; margin-left: 8px; vertical-align: middle; }
.cm-info-btn { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--muted); font: italic 600 11px/1 Georgia, serif; cursor: help; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.cm-info-btn:hover { color: var(--ink); border-color: var(--btn-border-hover); }
.cm-tip { position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: 260px; padding: 9px 12px; border-radius: 9px; background: var(--ink); color: var(--page); font-size: 12px; font-weight: 500; line-height: 1.45; box-shadow: var(--shadow-lift); z-index: 20; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur-fast) var(--ease); }
.cm-info:hover .cm-tip, .cm-info-btn:focus-visible + .cm-tip { opacity: 1; visibility: visible; }

.cm-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.cm-item:hover { border-color: var(--btn-border-hover); box-shadow: var(--shadow-card); }
.cm-item-main {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; width: 100%; text-align: left;
  padding: 14px 16px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.cm-item-main:hover { background: var(--hover-bg); }
.cm-item-main:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.cm-rank { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; padding-top: 1px; }
.cm-item:first-of-type .cm-rank, .cm-list-head + .cm-item .cm-rank { color: var(--ink); }
.cm-item-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cm-item .cm-topic-label { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-item-snippet { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cm-item-reason { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-item-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.cm-item-aside { display: flex; align-items: center; gap: 8px; color: var(--faint); padding-top: 1px; }
.cm-item-main:hover .cm-item-aside svg { color: var(--ink); transform: translateX(2px); }
.cm-item-aside svg { transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.cm-item-foot { display: flex; align-items: center; gap: 8px; padding: 8px 16px 9px 64px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.cm-task-link { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- skeletons, empty and error states ---------- */
.cm-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--skeleton-1), var(--skeleton-2), var(--skeleton-1)); background-size: 200% 100%; animation: cm-shimmer 1.4s linear infinite; }
@keyframes cm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.cm-skel-list { display: flex; flex-direction: column; gap: 8px; }
.cm-skel-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.cm-skel-col { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.cm-skel--rank { width: 22px; height: 18px; }
.cm-skel--title { height: 15px; width: 62%; }
.cm-skel--line { height: 11px; width: 38%; }
.cm-skel--chips { height: 18px; width: 24%; border-radius: 999px; }
.cm-skel--block { height: 96px; margin-top: 14px; border-radius: var(--radius); }
.cm-skel-card { height: 110px; border-radius: var(--radius); background: var(--surface-2); animation: cm-shimmer 1.4s linear infinite; }

.cm-state { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 44px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); background: var(--card); }
.cm-state-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; max-width: 50ch; }
.cm-state-text { font-size: 13px; color: var(--muted); max-width: 52ch; line-height: 1.5; overflow-wrap: anywhere; }
.cm-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.cm-state--error { border-style: solid; border-color: color-mix(in srgb, var(--bb-sev-critical) 36%, transparent); background: var(--bb-sev-critical-bg); }
.cm-state--error .cm-btn { margin-top: 6px; }

.cm-inline-err { padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--bb-sev-critical) 36%, transparent); background: var(--bb-sev-critical-bg); color: var(--ink); font-size: 12.5px; margin-bottom: 10px; overflow-wrap: anywhere; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-inline-ok { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bb-sev-info-bg); color: var(--ink); font-size: 12.5px; margin-bottom: 10px; overflow-wrap: anywhere; }

/* ---------- merge suggestions ---------- */
.cm-sg-panel { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.cm-sg-row { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cm-sg-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.cm-sg-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.cm-sg-topic { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; }
button.cm-sg-topic:hover { border-color: var(--btn-border-hover); }
.cm-sg-tag { font-size: 11px; font-weight: 600; color: var(--muted); }
.cm-sg-label { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cm-sg-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-sg-vs { align-self: center; font-size: 12px; color: var(--faint); }
.cm-sg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- drawer ---------- */
.cm-drawer-backdrop { background: rgba(8, 10, 14, 0.5); }
.cm-drawer-panel { width: min(720px, 100vw); overflow: hidden; display: flex; flex-direction: column; }
.cm-drawer-head { position: static; align-items: flex-start; padding: 16px 20px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.cm-drawer-headtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.cm-drawer-title { font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
.cm-drawer-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cm-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 0; overscroll-behavior: contain; }
.cm-drawer-body > * { flex-shrink: 0; }

.cm-dstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.cm-dstat { padding: 11px 14px; border-left: 1px solid var(--border); min-width: 0; }
.cm-dstat:first-child { border-left: 0; }
.cm-dstat-value { font-family: var(--font-display); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
.cm-dstat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.cm-actionbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 4px; }
.cm-more { position: relative; margin-left: auto; }
.cm-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; padding: 5px; border-radius: 11px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-lift); z-index: 30; display: flex; flex-direction: column; }
.cm-menu-item { text-align: left; padding: 8px 11px; border-radius: 7px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.cm-menu-item:hover { background: var(--hover-bg); }
.cm-menu-item--danger { color: var(--bb-sev-critical); border-top: 1px solid var(--border-soft); border-radius: 0 0 7px 7px; margin-top: 3px; }

.cm-callout { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--chip-orange-bg); color: var(--ink); font-size: 12.5px; }
.cm-panel { margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.cm-panel-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.cm-panel-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 8px; }
.cm-panel > .cm-panel-note { margin-top: 0; }
.cm-panel-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.cm-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cm-check { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }
.cm-check input { accent-color: var(--ink); width: 15px; height: 15px; }
.cm-fix-result { display: grid; gap: 6px; margin-top: 4px; }
.cm-copy-fallback { width: 100%; box-sizing: border-box; font: 12px/1.4 var(--mono); margin: 6px 0 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--ink); padding: 8px; }

.cm-section { margin-top: 22px; }
.cm-section-title { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 0 0 10px; letter-spacing: -0.005em; }
.cm-section-title--spaced { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.cm-topic-summary { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; padding: 0; overflow-wrap: anywhere; max-width: 68ch; }
.cm-muted { color: var(--muted); }
.cm-quote { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--border); max-width: 68ch; }
.cm-quote-text { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-quote-by { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* gallery */
.cm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cm-tile { position: relative; display: block; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.cm-tile-img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur) var(--ease); }
.cm-tile:hover .cm-tile-img { transform: scale(1.03); }
.cm-tile--video { grid-column: span 2; aspect-ratio: auto; cursor: default; display: flex; flex-direction: column; background: #000; }
.cm-vid-el { display: block; width: 100%; max-height: 320px; background: #000; }
.cm-vid-cap { padding: 6px 10px; font-size: 11.5px; color: var(--muted); background: var(--surface-2); overflow-wrap: anywhere; }
.cm-tile.is-broken { cursor: default; display: flex; align-items: center; justify-content: center; }
.cm-tile-fallback { order: -1; font-size: 12px; color: var(--muted); padding: 10px; text-align: center; }
.cm-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cm-file { font-size: 12.5px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* lightbox (child of #community-drawer, above the panel) */
.cm-lb { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 64px 20px; }
.cm-lb-backdrop { position: absolute; inset: 0; border: 0; background: rgba(4, 6, 9, 0.88); cursor: zoom-out; }
.cm-lb-stage { position: relative; display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: calc(100% - 48px); min-width: 0; color: #fff; font-size: 13px; text-align: center; }
.cm-lb-img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.cm-lb-cap { position: relative; display: flex; gap: 16px; align-items: center; margin-top: 14px; font-size: 12.5px; color: rgba(255,255,255,.75); }
.cm-lb-open { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cm-lb-close, .cm-lb-nav { position: absolute; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.cm-lb-close:hover, .cm-lb-nav:hover { background: rgba(255,255,255,.26); }
.cm-lb-close { top: 16px; right: 16px; }
.cm-lb-nav { top: 50%; transform: translateY(-50%); }
.cm-lb-nav--prev { left: 14px; transform: translateY(-50%) scaleX(-1); }
.cm-lb-nav--next { right: 14px; }
.cm-lb button:focus-visible { outline-color: #fff; }

/* conversation */
.cm-thread { margin-top: 18px; }
.cm-thread:first-of-type { margin-top: 0; }
.cm-thread-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; padding: 0 0 8px; border-bottom: 1px solid var(--border-soft); }
.cm-thread-name { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cm-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip-violet-bg); color: var(--chip-violet); overflow-wrap: anywhere; }
.cm-thread-count { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.cm-thread-head .cm-post-link { margin-left: 0; }
.cm-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cm-post { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.cm-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--chip-bg); color: var(--ink-soft); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cm-post--bot .cm-avatar { border-radius: 8px; }
.cm-post-main { min-width: 0; }
.cm-post-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 4px; }
.cm-post-author { font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
a.cm-post-author:hover { text-decoration: underline; text-underline-offset: 2px; }
.cm-post-time, .cm-post-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-post-link { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
a.cm-post-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.cm-post-body { display: inline-block; max-width: 100%; box-sizing: border-box; padding: 9px 13px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); border: 1px solid var(--border-soft); font-size: 13.5px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-post--bot .cm-post-body { border-style: dashed; }
.cm-msg-unavailable { font-style: italic; color: var(--muted); }
.cm-post-att { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
/* per-message actions: hover and keyboard focus on desktop, a More button on touch */
.cm-post-head { min-height: 24px; }
.cm-post-tools { display: inline-flex; align-items: center; gap: 2px 8px; margin-left: auto; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.cm-post:hover .cm-post-tools, .cm-post:focus-within .cm-post-tools, .cm-post.is-tools .cm-post-tools { opacity: 1; }
.cm-post-more { display: none; width: 28px; height: 28px; margin-left: auto; border: 0; border-radius: 50%; background: none; color: var(--muted); align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cm-post-more:hover { background: var(--chip-bg); color: var(--ink); }
.cm-post-more:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cm-post-move { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
@media (hover: none) {
  .cm-post-tools { display: none; opacity: 1; flex-basis: 100%; margin-left: 0; order: 9; padding-top: 2px; }
  .cm-post.is-tools .cm-post-tools { display: inline-flex; flex-wrap: wrap; }
  .cm-post-more { display: inline-flex; }
}
.cm-split-cb { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }

/* staff replies */
.cm-reply-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cm-reply { padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bb-sev-info-bg); border-left: 3px solid var(--bb-sev-info); }
.cm-reply--failed { background: var(--bb-sev-critical-bg); border-left-color: var(--bb-sev-critical); }
.cm-reply-head { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: 12px; }
.cm-reply-who { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cm-reply-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.55; color: var(--ink); }

/* sticky composer: one line until focused, filled or replying */
.cm-composer { flex: 0 0 auto; padding: 10px 20px 12px; border-top: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; gap: 6px; box-shadow: 0 -8px 20px rgba(0,0,0,.06); }
.cm-composer .cm-textarea { min-height: 38px; height: 38px; resize: none; padding-top: 8px; transition: height var(--dur) var(--ease); }
.cm-composer-note { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.4; }
.cm-composer .cm-reply-bar { display: none; }
.cm-composer:focus-within .cm-textarea, .cm-composer.is-open .cm-textarea { height: 84px; resize: vertical; }
.cm-composer:focus-within .cm-reply-bar, .cm-composer.is-open .cm-reply-bar { display: flex; }
.cm-reply-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 2px 6px 2px 10px; border-radius: 999px; font-size: 12px; background: var(--chip-bg); }
.cm-reply-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-reply-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-reply-count--over { color: var(--bb-sev-critical); font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-stat:nth-child(3) { border-left: 0; }
  .cm-stat:nth-child(n + 3) { border-top: 1px solid var(--border-soft); }
}
@media (max-width: 720px) {
  .cm-controls { margin-left: 0; width: 100%; }
  .cm-tabs { width: 100%; overflow-x: auto; }
  .cm-games { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
  .cm-games::-webkit-scrollbar { display: none; }
  .cm-item-main { grid-template-columns: 22px minmax(0, 1fr) auto; padding: 11px 12px; gap: 4px 8px; }
  .cm-item-aside { padding-top: 0; }
  .cm-item-body { gap: 3px; }
  .cm-item .cm-topic-label { font-size: 14px; }
  .cm-chip-text { display: none; }
  .cm-chip--media { padding: 2px 6px; }
  .cm-item-aside svg { display: none; }
  .cm-item-foot { padding-left: 42px; }
  .cm-sg-pair { grid-template-columns: 1fr; }
  .cm-sg-vs { justify-self: center; }
  .cm-drawer-panel { width: 100vw; }
  .cm-drawer-head { padding: 14px 16px 12px; }
  .cm-drawer-body { padding: 14px 16px 24px; }
  .cm-dstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-dstat:nth-child(3) { border-left: 0; }
  .cm-dstat:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .cm-actionbar .cm-btn { flex: 1 1 auto; }
  .cm-more { margin-left: 0; flex: 1 1 auto; }
  .cm-more > .cm-btn { width: 100%; }
  .cm-menu { left: 0; right: 0; min-width: 0; }
  .cm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-tile--video { grid-column: span 2; }
  .cm-composer { padding: 8px 16px 10px; }
  .cm-lb { padding: 56px 12px 16px; }
  .cm-lb-nav--prev { left: 6px; } .cm-lb-nav--next { right: 6px; }
  .cm-list-head { position: relative; }
  .cm-info { position: static; }
  .cm-tip { left: 4px; right: 4px; width: auto; transform: none; top: calc(100% + 2px); }
}
@media (max-width: 720px) {
  .cm-tabs .cm-seg-btn { flex: 1 1 auto; justify-content: center; padding: 5px 8px; gap: 5px; }
  .cm-tabs { display: flex; overflow: visible; }
  .cm-stat-hint { display: none; }
  .cm-stat { padding: 11px 14px; }
}
@media (max-width: 420px) {
  .cm-stat { padding: 12px 14px; }
  .cm-stat-value { font-size: 22px; }
  .cm-ctl-label { display: none; }
  .cm-tabs .cm-seg-btn { padding: 5px 6px; gap: 4px; min-width: 0; font-size: 12px; }
  .cm-tabs .cm-seg-count { padding: 1px 4px; min-width: 0; }
  .cm-controls { gap: 6px; }
  .cm-select { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-pill-dot, .cm-skel, .cm-skel-card { animation: none !important; }
  .cm-item-aside svg, .cm-tile-img { transition: none !important; }
}

/* Reports view */
.cm-view-tabs { align-self: flex-start; }
.cm-report-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 2px 4px 6px; }
.cm-report-channels, .cm-report-gen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cm-report-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.cm-report-head:hover { background: var(--hover-bg); }
.cm-report-head svg { margin-left: auto; color: var(--muted); flex-shrink: 0; }
.cm-report-title { font-size: 14.5px; font-weight: 600; }
.cm-report-body { padding: 4px 16px 16px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 10px; }
.cm-report-headline { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.cm-report-stats { font-size: 12.5px; color: var(--muted); }
.cm-report-sec-title { margin: 6px 0 6px; font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--ink); }
.cm-report-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cm-report-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.cm-report-label { font-weight: 600; color: var(--ink); }
.cm-report-link { font-size: 13px; color: var(--ink); text-align: left; }
.cm-report-meta { font-size: 12px; color: var(--muted); }
.cm-report-note { flex-basis: 100%; font-size: 12.5px; color: var(--ink-soft); }
.cm-report-text { white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.cm-report-actions { display: flex; justify-content: flex-end; gap: 8px; }
