  /* --- Digest analytics sub-bot --- */

  .digest-examples {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
  }

  .digest-chip {
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-strong);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: var(--font-ui);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  }

  .digest-chip:hover {
    color: var(--text);
    background: rgba(44, 167, 55, 0.1);
    border-color: rgba(44, 167, 55, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(44, 167, 55, 0.18);
  }

  .digest-chip:focus-visible { outline: none; border-color: rgba(44, 167, 55, 0.6); box-shadow: 0 0 0 2px rgba(44, 167, 55, 0.3); }

  /* Composer footer: statically pinned to the bottom of the (non-scrolling,
     no-fixed-height) panel-body. A top border + top padding sets it apart as
     a chat-style composer; it is the last element so no bottom margin. */
  .digest-ask-bar {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    width: 100%;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--panel-border);
  }

  .digest-ask-bar .filter-input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    box-sizing: border-box;
  }

  .digest-ask-bar .digest-send-btn {
    height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0 18px;
    border: 1px solid #259030;
    border-radius: var(--radius-md);
    background: #259030;
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }

  .digest-ask-bar .digest-send-btn:hover { background: #1E7826; border-color: #1E7826; }
  .digest-ask-bar .digest-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
  .digest-ask-bar .digest-send-btn svg { flex: 0 0 auto; }

  .digest-response { display: flex; flex-direction: column; gap: 10px; }

  /* Scoped: only Digest answer bubbles go green; question bubbles stay neutral
     and the shared .chat-bubble-assistant rule (used elsewhere) is untouched. */
  #digest-response .chat-bubble-assistant { background: rgba(44, 167, 55, 0.09); border-color: rgba(44, 167, 55, 0.28); }
  #digest-response .chat-bubble-assistant.chat-bubble-error { background: rgba(220,38,38,0.14); border-color: rgba(220,38,38,0.4); }

  .digest-md { color: var(--text); line-height: 1.6; white-space: normal; }
  .digest-md > *:first-child { margin-top: 0; }
  .digest-md > *:last-child { margin-bottom: 0; }
  .digest-md h1, .digest-md h2, .digest-md h3, .digest-md h4 { color: var(--text); margin: var(--space-md) 0 var(--space-xs); line-height: 1.3; }
  .digest-md h1 { font-size: 1.15rem; }
  .digest-md h2 { font-size: 1.05rem; }
  .digest-md h3 { font-size: 0.98rem; }
  .digest-md h4 { font-size: 0.9rem; }
  .digest-md p { margin: var(--space-xs) 0; }
  .digest-md ul, .digest-md ol { margin: var(--space-xs) 0; padding-left: var(--space-lg); }
  .digest-md li { margin: 2px 0; }
  .digest-md code { font-family: var(--font-mono); font-size: var(--font-control-sm); background: rgba(0,0,0,0.25); padding: 1px 5px; border-radius: var(--radius-sm); color: var(--text); }
  .digest-md pre { font-family: var(--font-mono); font-size: var(--font-control-sm); background: rgba(0,0,0,0.25); border: 1px solid var(--panel-border); border-radius: var(--radius-md); padding: 10px 12px; overflow-x: auto; }
  .digest-md pre code { background: none; padding: 0; }
  .digest-md blockquote { margin: var(--space-xs) 0; padding-left: var(--space-sm); border-left: 2px solid var(--border); color: var(--muted-strong); }
  .digest-md a { color: var(--accent-5); }
  /* Markdown TABLES: real styled tables, scoped (NOT the global table-layout:fixed rules). Mirror the dashboard th/td look. */
  .digest-md table { width: auto; max-width: 100%; border-collapse: collapse; margin: var(--space-sm) 0; font-size: 0.85rem; table-layout: auto; }
  .digest-md th, .digest-md td { border: 1px solid var(--panel-border); padding: 6px 10px; text-align: left; vertical-align: top; }
  .digest-md th { background: rgba(255,255,255,0.04); color: var(--muted-strong); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
  .digest-md td { color: var(--text); }

  .digest-queries { margin-top: 4px; }

  .digest-queries > summary {
    cursor: pointer;
    font-size: var(--font-control);
    color: var(--muted);
  }

  .digest-queries pre {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--font-control-sm);
    white-space: pre-wrap;
    word-break: break-word;
  }

  .digest-queries pre + pre { margin-top: 8px; }

  .digest-actions { display: flex; gap: var(--space-sm); align-items: center; margin-top: var(--space-sm); }
  .digest-export-error { color: var(--red); font-size: var(--font-control); }
  .digest-spinner { display: inline-flex; align-items: center; gap: var(--space-sm); color: var(--muted); font-size: var(--font-control); }
  .digest-spinner::before { content: ""; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent-5); border-radius: 50%; animation: digest-spin 0.8s linear infinite; }
  @keyframes digest-spin { to { transform: rotate(360deg); } }
