/* CK Data — brand tokens */
:root {
  --ck-gold: #F0A030;
  --ck-navy: #2C3E50;
  --ck-green: #2ECC71;
  --ck-red: #E74C3C;

  /* Sector colors */
  --ck-equities: #5B8DEF;
  --ck-metals: #F0A030;
  --ck-energy: #E25822;
  --ck-fx: #2ECC71;
  --ck-agricultural: #8BC34A;
  --ck-treasuries: #9B59B6;
}

[data-mantine-color-scheme="dark"] {
  --mantine-color-body: #1a1b1e;
}

/* Keep anchors clean inside nav */
a { text-decoration: none; }
a:hover { color: var(--app-dimmed, #9aa1ad) !important; }

/* --- AG Grid: Settlement Board --- */
.ag-grid-products {
    border: 1px solid var(--app-border, #2a2c31);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.ag-grid-products .ag-root-wrapper {
    border: none !important;
    background: transparent !important;
}
.ag-grid-products .ag-header {
    border-bottom: 1px solid var(--app-border, #2a2c31) !important;
    background: transparent !important;
}
.ag-grid-products .ag-header-cell,
.ag-grid-products .ag-header-group-cell {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.24px;
    text-transform: uppercase;
    color: var(--app-dimmed, #9aa1ad);
}
.ag-grid-products .ag-header-cell-label {
    justify-content: flex-start;
}
.ag-grid-products .ag-right-aligned-header .ag-header-cell-label {
    flex-direction: row;
}
.ag-grid-products .ag-cell {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.25;
    display: flex;
    align-items: center;
    color: var(--app-text, #f5f6f7);
    border-right: 1px solid rgba(128,128,128,0.15);
}
.ag-grid-products .ag-cell:last-child {
    border-right: none;
}
.ag-grid-products .ag-header-cell {
    border-right: 1px solid rgba(128,128,128,0.15);
}
.ag-grid-products .ag-header-cell:last-child {
    border-right: none;
}
.ag-grid-products .ag-row {
    background: transparent !important;
    border-bottom: 1px solid rgba(128,128,128,0.15);
}
.ag-grid-products .ag-row-odd {
    background: transparent !important;
}
.ag-grid-products .ag-row:hover {
    background: color-mix(in srgb, var(--app-hover, #1d1f24) 72%, transparent) !important;
}
.ag-grid-products .ag-value-pos {
    color: #4ade80;
    font-weight: 700;
}
.ag-grid-products .ag-value-neg {
    color: #f87171;
    font-weight: 700;
}

/* --- Light theme overrides --- */
[data-mantine-color-scheme='light'] {
    --app-bg: #ffffff;
    --app-surface: #ffffff;
    --app-surface-2: #f7f7f8;
    --app-border: #e6e7eb;
    --app-text: #111214;
    --app-dimmed: #6b7280;
    --app-hover: #f1f2f4;
}
[data-mantine-color-scheme='light'] .ag-grid-products .ag-value-pos {
    color: #15803d;
}
[data-mantine-color-scheme='light'] .ag-grid-products .ag-value-neg {
    color: #b91c1c;
}
/* --- Dark theme overrides --- */
[data-mantine-color-scheme='dark'] {
    --app-bg: #0b0b0c;
    --app-surface: #121214;
    --app-surface-2: #17181b;
    --app-border: #2a2c31;
    --app-text: #f5f6f7;
    --app-dimmed: #9aa1ad;
    --app-hover: #1d1f24;
}

/* --- Sidebar hover-popover rows --- */
.sidebar-hover-row {
    transition: background 0.12s ease;
    cursor: pointer;
}
.sidebar-hover-row:hover {
    background: var(--app-hover, rgba(255,255,255,0.06));
}

/* --- Docs TOC anchor links --- */
html { scroll-behavior: smooth; }
.toc-link:hover { color: var(--ck-gold) !important; }
.toc-section-link:hover { opacity: 0.8; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT
   ═══════════════════════════════════════════════════════════════ */

/* Sticky footer: content pushes footer to bottom on short pages */
.mantine-AppShell-main {
    display: flex !important;
    flex-direction: column !important;
    min-height: calc(100vh - 50px);   /* 50px = header height */
}
.mantine-AppShell-main > * {
    width: 100%;
}

/* Banner: wrap on narrow screens */
@media (max-width: 768px) {
    .ck-banner-inner {
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        padding: 10px 12px !important;
    }
    .ck-banner-inner > * {
        flex-shrink: 1;
    }
}
@media (max-width: 480px) {
    .ck-banner-inner {
        padding: 8px !important;
    }
    .ck-banner-tagline {
        display: none !important;
    }
}

/* KPI pills: allow wrapping on small screens */
@media (max-width: 992px) {
    .mantine-Group-root[id*="kpis"] {
        flex-wrap: wrap;
    }
}

/* Footer: compact single-line bar (inside AppShellFooter, height=72) */
.ck-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 72px;
    font-size: 11px;
    color: var(--mantine-color-dimmed);
    flex-wrap: nowrap;
    white-space: nowrap;
}
.ck-footer-brand {
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--mantine-color-text);
}
.ck-footer-link {
    color: var(--mantine-color-dimmed);
    text-decoration: none;
    font-weight: 600;
    font-size: 11px;
}
.ck-footer-link:hover { color: var(--mantine-color-text); }
.ck-footer-disclaimer {
    font-size: 9px;
    opacity: 0.6;
}
@media (max-width: 600px) {
    .ck-footer-inner { gap: 6px; font-size: 9px; }
    .ck-footer-disclaimer { display: none; }
}

/* Data cards only: reduce padding on smaller screens.
   Scoped to grid cards via .ck-data-card — does NOT touch docs, home, etc. */
@media (max-width: 768px) {
    .ck-data-card {
        padding: 12px !important;
    }
}
@media (max-width: 480px) {
    .ck-data-card {
        padding: 8px !important;
    }
}

/* AG Grid: horizontal scroll on narrow screens */

/* ── TweetDeck Premium Feed ─────────────────────────────────────────── */
/* When Pro Deck is active, break out of the Mantine AppShell constraints.
   Uses :has() (Chrome 105+) to detect td-page inside ancestors and
   strip max-width, padding, and margins from the entire chain.            */

/* Container holding page_container — strip maw=1600 */
#main-container:has(.td-page) {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* main-content-wrapper — no filter/blur and full width */
#main-content-wrapper:has(.td-page) {
  width: 100%;
}

/* AppShellMain (<main>) — zero padding when Pro Deck */
main:has(.td-page) {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
}

/* ── Pro Deck: TweetDeck-style variables ── */
.td-page {
  --td-column-width: 420px;
  --td-column-gap: 6px;
  --td-header-height: 46px;
  --td-bg-deck: #111114;
  --td-bg-column: #1a1b1e;
  --td-bg-surface: #25262b;
  --td-border: rgba(255, 255, 255, 0.06);
  --td-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --td-separator: var(--mantine-color-dark-4);
  --td-scrollbar: rgba(255, 255, 255, 0.12);
  --td-scrollbar-hover: rgba(255, 255, 255, 0.2);
  --td-radius: 10px;

  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 50px);
  overflow: hidden;
  position: relative;
}

/* ── Light theme overrides ── */
[data-mantine-color-scheme='light'] .td-page {
  --td-bg-deck: #e9ecef;
  --td-bg-column: #ffffff;
  --td-bg-surface: #f1f3f5;
  --td-border: rgba(0, 0, 0, 0.08);
  --td-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --td-separator: #dee2e6;
  --td-scrollbar: rgba(0, 0, 0, 0.12);
  --td-scrollbar-hover: rgba(0, 0, 0, 0.2);
}

/* ── Sticky toolbar ── */
.td-toolbar {
  flex-shrink: 0;
  height: var(--td-header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--td-separator);
  background: var(--td-bg-surface);
  z-index: 20;
}

/* ── Deck: dark background, horizontal scroll ── */
.td-deck {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  gap: var(--td-column-gap);
  padding: var(--td-column-gap);
  padding-right: var(--td-column-gap);
  background: var(--td-bg-deck);
  min-height: 0;
}

/* ── Columns: fixed width, NEVER stretch ── */
.td-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--td-column-width);
  width: var(--td-column-width);
  height: 100%;
  background: var(--td-bg-column);
  border-radius: var(--td-radius);
  border: 1px solid var(--td-border);
  box-shadow: var(--td-shadow);
  overflow: hidden;
}

/* ── Column header ── */
.td-col-header {
  padding: 12px 16px;
  height: var(--td-header-height);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--td-bg-surface);
  border-bottom: 2px solid var(--td-separator);
  cursor: grab;
}
.td-col-header:active {
  cursor: grabbing;
}

/* ── Drag-and-drop states ── */
.td-col-ghost {
  opacity: 0.15;
}
.td-col-chosen {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.td-col-drag {
  opacity: 0.95;
  transform: scale(1.02);
}

/* ── Column body ── */
.td-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  min-height: 0;
}

/* ── Card hover effect ── */
.td-col-body > .mantine-Paper-root {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.td-col-body > .mantine-Paper-root:hover {
  border-color: rgba(240, 160, 48, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ── Info alert fade (SHIFT, QUIET) ──
   Card arrives bright (opacity 1), holds for ~3s, then fades to 0.35 over 7s.
   Keyed on [data-info-ts] so each new alert restarts the animation. ── */
@keyframes info-alert-fade {
  0%   { opacity: 1; }
  30%  { opacity: 1; }
  100% { opacity: 0.35; }
}
.td-col-body > .mantine-Paper-root[data-info-ts] {
  animation: info-alert-fade 10s ease-in forwards;
}
.td-col-body > .mantine-Paper-root[data-info-ts]:hover {
  animation-play-state: paused;
  opacity: 1;
}

/* ── Status bar ── */
.td-statusbar {
  flex-shrink: 0;
  height: 28px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--td-separator);
  background: var(--td-bg-surface);
}

/* ── Text size presets (bumped — 14px is the new default) ── */
.td-text-sm .td-col-body { font-size: 13px; }
.td-text-sm .td-col-header { font-size: 14px; }

.td-text-md .td-col-body { font-size: 14px; }
.td-text-md .td-col-header { font-size: 15px; }

.td-text-lg .td-col-body { font-size: 16px; }
.td-text-lg .td-col-header { font-size: 17px; }

/* Make Mantine Text components inherit the column font size */
.td-col-body .mantine-Text-root { font-size: inherit; }
/* Badges keep their own sizing */
.td-col-body .mantine-Badge-root { font-size: revert; }

/* ── Scrollbar styling ── */
.td-col-body::-webkit-scrollbar {
  width: 6px;
}
.td-col-body::-webkit-scrollbar-track {
  background: transparent;
}
.td-col-body::-webkit-scrollbar-thumb {
  background: var(--td-scrollbar);
  border-radius: 3px;
}
.td-col-body::-webkit-scrollbar-thumb:hover {
  background: var(--td-scrollbar-hover);
}

/* Horizontal scrollbar for the deck */
.td-deck::-webkit-scrollbar {
  height: 8px;
}
.td-deck::-webkit-scrollbar-track {
  background: var(--td-bg-deck);
}
.td-deck::-webkit-scrollbar-thumb {
  background: var(--td-scrollbar);
  border-radius: 4px;
}
.td-deck::-webkit-scrollbar-thumb:hover {
  background: var(--td-scrollbar-hover);
}

/* ── X post cards ── */
.x-post-card {
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--td-border) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.x-post-card:last-child {
  border-bottom: none !important;
}
.x-post-card:hover {
  background: rgba(255,255,255,0.03) !important;
}
[data-mantine-color-scheme='light'] .x-post-card:hover {
  background: rgba(0,0,0,0.025) !important;
}

.x-post-inner {
  display: flex;
  gap: 10px;
  padding: 11px 14px 9px;
  align-items: flex-start;
}

/* Avatar column */
.x-avatar-col {
  flex-shrink: 0;
  width: 40px;
}

/* Circular clip wrapper — guarantees circle regardless of img dimensions */
.x-avatar-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--td-bg-surface);
  flex-shrink: 0;
}
.x-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback initial circle */
.x-post-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}

/* Post body */
.x-post-body {
  flex: 1;
  min-width: 0;
}

/* Meta line: [Name] [✓] [@handle] · [time] */
.x-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  margin-bottom: 3px;
  line-height: 1.2;
  min-width: 0;
}
.x-post-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.x-verified-badge {
  flex-shrink: 0;
  margin-top: 1px;
}
.x-post-handle {
  font-size: 12px;
  color: var(--mantine-color-dimmed);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.x-post-dot {
  font-size: 12px;
  color: var(--mantine-color-dimmed);
  flex-shrink: 0;
}
.x-post-time {
  font-size: 12px;
  color: var(--mantine-color-dimmed);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.x-post-time-link {
  text-decoration: none;
}
.x-post-time-link:hover {
  color: #1d9bf0;
  text-decoration: underline;
}

/* Tweet body text */
.x-post-text {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 7px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Engagement bar */
.x-post-actions {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 2px;
}
.x-eng-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--mantine-color-dimmed);
  cursor: pointer;
  padding: 3px 8px 3px 0;
  border-radius: 4px;
  transition: color 0.12s ease;
  user-select: none;
  flex: 1;
}
.x-eng-count {
  font-size: 12px;
  line-height: 1;
}
.x-eng-reply:hover  { color: #1d9bf0; }
.x-eng-rt:hover     { color: #17bf63; }
.x-eng-like:hover   { color: #e0245e; }

/* Remove the td-col-body Paper padding override for x-post cards */
.td-col-body .x-post-card.mantine-Paper-root {
  margin-bottom: 0 !important;
}

/* ── Books page — card hover ── */
.book-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.book-card:hover {
  border-color: var(--ck-gold) !important;
  box-shadow: 0 4px 20px rgba(240, 160, 48, 0.12);
  transform: translateY(-2px);
}

/* ── Mobile: single column, scroll-snap ── */
@media (max-width: 767px) {
  .td-col {
    flex: 0 0 100%;
    width: 100%;
    border-radius: 0;
  }
  .td-deck {
    gap: 0;
    padding: 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .td-col {
    scroll-snap-align: start;
  }
}



/* Pro Deck: sidebar, footer, banner hidden via JS in app.py paywall callback */
@media (max-width: 768px) {
    .ag-grid-products {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- AG Grid Tooltips (themed, compact) --- */
.ag-tooltip {
    font-size: 10px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    line-height: 1.3 !important;
    max-width: 240px !important;
}
[data-mantine-color-scheme='dark'] .ag-tooltip {
    background: #1e1f23 !important;
    color: #d0d0d0 !important;
    border: 1px solid #3a3c42 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}
[data-mantine-color-scheme='light'] .ag-tooltip {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #d0d1d5 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

/* ── AI Chat Column (VS Code Copilot style) ────────────────────────────────── */

/* Scrollable message thread — fills remaining column height */
.ck-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ck-chat-thread::-webkit-scrollbar { width: 6px; }
.ck-chat-thread::-webkit-scrollbar-track { background: transparent; }
.ck-chat-thread::-webkit-scrollbar-thumb {
  background: var(--td-scrollbar);
  border-radius: 3px;
}

/* User message — right-aligned gold bubble */
.ck-chat-msg-user {
  display: flex;
  justify-content: flex-end;
  animation: ck-msg-fadein 0.18s ease-out;
}
.ck-chat-msg-user-inner {
  max-width: 82%;
  background: rgba(240, 160, 48, 0.12);
  border: 1px solid rgba(240, 160, 48, 0.22);
  border-radius: 14px 14px 4px 14px;
  padding: 8px 12px;
  font-size: inherit;
  color: var(--app-text, #f5f6f7);
  line-height: 1.5;
  word-break: break-word;
}

/* AI message — left-aligned, gold left border */
.ck-chat-msg-ai {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: ck-msg-fadein 0.22s ease-out;
}
@keyframes ck-msg-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ck-chat-msg-ai-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ck-gold);
  text-transform: uppercase;
  padding-left: 12px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.ck-chat-msg-ai-inner {
  border-left: 3px solid rgba(240, 160, 48, 0.45);
  padding: 6px 10px 6px 12px;
  font-size: inherit;
  color: var(--app-text, #f5f6f7);
  line-height: 1.6;
  word-break: break-word;
}

/* Usage bar */
.ck-chat-usage-wrap {
  flex-shrink: 0;
  padding: 6px 10px 4px;
  border-top: 1px solid var(--td-separator);
}
.ck-chat-usage-track {
  height: 3px;
  background: var(--td-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.ck-chat-usage-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.ck-chat-usage-text {
  font-size: 10px;
  color: var(--app-dimmed);
  opacity: 0.7;
}

/* Input area */
.ck-chat-input-area {
  flex-shrink: 0;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--td-separator);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ck-chat-input-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
/* dcc.Textarea override — strip Dash wrapper */
.ck-chat-textarea {
  flex: 1;
  background: var(--td-bg-surface) !important;
  border: 1px solid var(--td-border) !important;
  border-radius: 8px !important;
  color: var(--app-text, #f5f6f7) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  padding: 8px 10px !important;
  resize: none !important;
  outline: none !important;
  min-height: 38px !important;
  max-height: 110px !important;
  overflow-y: auto !important;
  font-family: inherit !important;
  transition: border-color 0.15s ease;
  box-sizing: border-box !important;
  width: 100% !important;
}
.ck-chat-textarea:focus {
  border-color: rgba(240, 160, 48, 0.50) !important;
  box-shadow: 0 0 0 1px rgba(240, 160, 48, 0.15) !important;
}
.ck-chat-textarea::placeholder {
  color: var(--app-dimmed) !important;
  font-size: 12px !important;
}
.ck-chat-hint {
  font-size: 10px;
  color: var(--app-dimmed);
  text-align: right;
  opacity: 0.60;
}

/* Typing indicator — italic "Analyzing…" pulse, shown inside thread right after last message */
.ck-chat-typing {
  padding: 4px 12px 4px 14px;
  flex-shrink: 0;
}
.ck-chat-typing i {
  font-size: 12px;
  color: var(--app-dimmed);
  animation: ck-analyzing-pulse 1.8s ease-in-out infinite;
}
@keyframes ck-analyzing-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1.0;  }
}

/* Input footer: model selector + usage label */
.ck-chat-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 0;
  position: relative;
  min-height: 26px;
}

/* Thinking bar — animated gradient sweep shown while Claude processes */
.ck-chat-thinking-bar {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(240, 160, 48, 0.8) 40%,
    rgba(250, 200, 80, 1.0) 50%,
    rgba(240, 160, 48, 0.8) 60%,
    transparent 100%);
  background-size: 200% 100%;
  animation: ck-thinking-sweep 1.4s linear infinite;
  border-radius: 1px;
  margin-top: 4px;
}
@keyframes ck-thinking-sweep {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* Textarea thinking state — subtle gold glow border */
.ck-chat-textarea.ck-chat-thinking {
  border-color: rgba(240, 160, 48, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(240, 160, 48, 0.12) !important;
}

/* Stale data dot in chat header */
.ck-chat-stale-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  margin-left: 5px;
  flex-shrink: 0;
  align-self: center;
  animation: ck-pulse 2s infinite;
}
@keyframes ck-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Markdown content inside AI messages */
.ck-chat-msg-ai-inner p  { margin: 0 0 6px 0; }
.ck-chat-msg-ai-inner p:last-child { margin-bottom: 0; }
.ck-chat-msg-ai-inner ul,
.ck-chat-msg-ai-inner ol { margin: 0 0 6px 0; padding-left: 16px; }
.ck-chat-msg-ai-inner li { margin-bottom: 3px; }
.ck-chat-msg-ai-inner strong { color: var(--app-text); font-weight: 600; }
.ck-chat-msg-ai-inner em { color: #9aa1ad; font-style: italic; }
.ck-chat-msg-ai-inner code {
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  font-size: 12px;
  padding: 1px 4px;
}

/* ── Room selector pill (replaces dmc.Select in chat footer) ─── */
.ck-chat-room-pill {
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  border-radius: 11px !important;
  color: var(--app-dimmed) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer;
  line-height: 1 !important;
  user-select: none;
}
.ck-chat-room-pill:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: var(--td-border) !important;
  color: var(--app-text) !important;
}
.ck-chat-room-pill:active {
  background: rgba(255,255,255,0.09) !important;
}

/* Room menu dropdown */
.ck-chat-room-dropdown {
  background: var(--td-bg-column) !important;
  border: 1px solid var(--td-border) !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45) !important;
  padding: 4px !important;
  min-width: 170px !important;
}
.ck-chat-room-dropdown .mantine-Menu-item {
  padding: 5px 10px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  color: var(--app-text) !important;
  display: flex !important;
  align-items: center !important;
  cursor: pointer;
}
.ck-chat-room-dropdown .mantine-Menu-item:hover,
.ck-chat-room-dropdown .mantine-Menu-item[data-hovered] {
  background: rgba(255,255,255,0.07) !important;
  color: var(--app-text) !important;
}
.ck-chat-room-dropdown .mantine-Menu-divider {
  border-color: var(--td-separator) !important;
  margin: 4px 0 !important;
}
