/* Eli chat widget — shared across the SI Law sites.
 * Family-neutral navy/gold. No external dependencies. */
#eli-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 9998;
  display: flex; align-items: center; gap: 10px;
  background: #1b2f4b; color: #fff; border: none; border-radius: 999px;
  padding: 12px 18px 12px 14px; font: 600 15px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer; box-shadow: 0 6px 24px rgba(10, 25, 45, .35);
}
#eli-fab:hover { background: #24405f; }
#eli-fab svg { width: 22px; height: 22px; flex: none; }
#eli-fab .eli-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #d4a94e; flex: none;
}
#eli-panel {
  position: fixed; right: 20px; bottom: 76px; z-index: 9999;
  width: min(400px, calc(100vw - 40px)); height: min(560px, calc(100dvh - 120px));
  display: none; flex-direction: column; overflow: hidden;
  background: var(--ap-card, #fffdf8); border: 1px solid var(--ap-line, #d9cfae); border-radius: 14px;
  box-shadow: 0 18px 60px rgba(10, 25, 45, .4);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
#eli-panel.open { display: flex; }
.eli-head {
  background: #1b2f4b; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.eli-head .eli-title { font-weight: 700; font-size: 15px; }
.eli-head .eli-sub { font-size: 11.5px; color: #c9d4e2; }
.eli-head .eli-tag {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid #d4a94e; color: #f0d9a0; border-radius: 4px; padding: 2px 6px;
  margin-left: auto;
}
.eli-head button {
  background: none; border: none; color: #c9d4e2; font-size: 20px; cursor: pointer; padding: 0 2px;
}
.eli-head .eli-appear { font-size: 16px; margin-left: auto; }
.eli-head .eli-tag { margin-left: 0; }
#eli-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.eli-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.eli-msg.user { align-self: flex-end; background: #1b2f4b; color: #fff; border-bottom-right-radius: 4px; }
.eli-msg.bot { align-self: flex-start; background: var(--ap-accent-soft, #f3edda); color: var(--ap-ink, #2a2a2a); border-bottom-left-radius: 4px; }
.eli-msg.bot h1, .eli-msg.bot h2, .eli-msg.bot h3, .eli-msg.bot h4 {
  margin: .6em 0 .3em; font-size: 1.02em; color: var(--ap-head, #1b2f4b); /* contrast fix 2026-10-02: var-driven for dark mode */
}
.eli-msg.bot p { margin: .45em 0; }
.eli-msg.bot ul, .eli-msg.bot ol { margin: .4em 0; padding-left: 1.3em; }
.eli-msg.bot li { margin: .2em 0; }
.eli-msg.bot table { border-collapse: collapse; margin: .5em 0; font-size: 12.5px; width: 100%; }
.eli-msg.bot th, .eli-msg.bot td { border: 1px solid var(--ap-line, #cfc39a); padding: 5px 7px; text-align: left; }
.eli-msg.bot th { background: var(--ap-accent-soft, #e9dfc2); }
.eli-msg.bot code { background: var(--ap-accent-soft, #e7e0c8); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.eli-msg.bot pre { background: #22303f; color: #eef; padding: 10px; border-radius: 8px; overflow-x: auto; }
.eli-msg.bot pre code { background: none; color: inherit; padding: 0; }
.eli-msg.bot a { color: #1b5faa; }
.eli-typing { color: var(--ap-muted, #6a6455); font-style: italic; } /* contrast fix 2026-10-02: was #8a8570 (3.64:1) */
.eli-foot {
  padding: 8px 14px; font-size: 11px; color: var(--ap-muted, #6a6455); border-top: 1px solid var(--ap-line, #e5dcc0); background: var(--ap-card, #faf6ea);
} /* contrast fix 2026-10-02: was #8a8570 (3.43:1) */
#eli-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: var(--ap-card, #faf6ea); }
#eli-input {
  flex: 1; border: 1px solid var(--ap-line, #cfc39a); border-radius: 999px; padding: 10px 14px;
  font-size: 14px; font-family: inherit; background: var(--ap-card, #fff); color: var(--ap-ink, #1c2b4a);
}
#eli-input:focus { outline: 2px solid #d4a94e; }
#eli-send {
  border: none; border-radius: 999px; background: #1b2f4b; color: #fff;
  padding: 0 18px; font-size: 14px; font-weight: 600; cursor: pointer;
}
#eli-send:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) {
  #eli-fab { right: 14px; bottom: 14px; }
  #eli-panel { right: 10px; bottom: 70px; }
}

/* Per-user learning profile: "saved to your profile" note after a learned response. */
.eli-saved-note { font-size: 13px; color: #7a2230; background: #f6e8eb; border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; }

.eli-limit-msg { font-size: 14.5px; line-height: 1.6; }
.eli-limit-msg p { margin: 0 0 10px; }
.eli-limit-msg .btn { display: inline-block; text-decoration: none; }

/* "How Eli teaches you" learner-profile section (per-user, signed-in only). */
.eli-learner-toggle { font-size: 16px !important; padding: 0 4px !important; line-height: 1; }
.eli-learner-sec {
  padding: 10px 14px; border-bottom: 1px solid var(--ap-line, #e5dcc0); background: var(--ap-card, #f8f2e2);
  color: var(--ap-ink, #2a2a2a); max-height: 280px; overflow-y: auto; /* contrast fix 2026-10-02: var-driven for dark mode */
}
.eli-learner-sec h4 { margin: 8px 0 6px; font-size: 13px; color: var(--ap-head, #1b2f4b); } /* contrast fix 2026-10-02 */
.eli-learner-sec h4:first-child { margin-top: 0; }
.eli-learn-bits { font-size: 12.5px; margin: 0 0 6px; }
.eli-learn-empty { font-size: 12px; color: var(--ap-muted, #6b6455); margin: 0 0 6px; } /* contrast fix 2026-10-02 */
.eli-learn-list { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 12.5px; }
.eli-learn-list li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.eli-learn-acc { color: #65500e; flex: none; } /* contrast fix 2026-10-02: was #8a6d1f (4.38:1) */
.eli-learn-forget {
  background: none; border: none; color: #1b5faa; font-size: 12px;
  cursor: pointer; text-decoration: underline; padding: 0;
}

/* Appearance: dark-mode link color inside bot messages. */
html[data-theme="dark"] .eli-msg.bot a { color: #7fb3e8; }
html[data-theme="dark"] .eli-learn-forget { color: #7fb3e8; } /* contrast fix 2026-10-02: was #1b5faa (2.84:1) */
html[data-theme="dark"] .eli-learn-acc { color: #e3c878; } /* contrast fix 2026-10-02: was #8a6d1f (3.25:1) */
html[data-theme="dark"] .eli-saved-note { color: #d0a3ad; background: #2c1a1e; }
