/* Home-page Eileen chat panel: size, waiting state, readable answers, copy and expand controls.
   Loaded after the inline styles of index.html, so equal selectors here take precedence. */
#eileen-panel { bottom: calc(24px + var(--eileen-lift, 0px)); }
#eileen-body { width: 540px; max-width: min(540px, calc(100vw - 110px)); }
#eileen-chat-history { max-height: min(58vh, 560px, var(--eileen-avail, calc(100vh - 230px - var(--eileen-lift, 0px)))); overscroll-behavior: contain; }
#eileen-body.eileen-expanded { width: 980px; max-width: min(980px, calc(100vw - 110px)); }
#eileen-body.eileen-expanded #eileen-chat-history { max-height: var(--eileen-avail, calc(100vh - 230px - var(--eileen-lift, 0px))); }
#eileen-body.eileen-expanded .chat-user, #eileen-body.eileen-expanded .chat-eileen { font-size: 0.95rem; line-height: 1.6; }
#eileen-expand {
  position: absolute; top: 10px; right: 38px;
  font: inherit; font-size: 0.74rem; line-height: 1.4; color: var(--cyan);
  background: transparent; border: 1px solid var(--cyan-border); border-radius: 6px;
  padding: 2px 8px; cursor: pointer;
}
#eileen-expand:hover, .eileen-copy:hover { background: var(--ep-hover-tint, var(--ac-0ea5e9-a12, rgba(14,165,233,0.12))); }
#eileen-expand:focus-visible, .eileen-copy:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.chat-eileen p { margin: 0 0 0.7em; font: inherit; color: inherit; line-height: inherit; }
.chat-eileen p:last-child { margin-bottom: 0; }
.eileen-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin: 0 0 6px; -webkit-user-select: none; user-select: none; }
.eileen-copy {
  font: inherit; font-size: 0.74rem; line-height: 1.4; color: var(--cyan);
  background: transparent; border: 1px solid var(--cyan-border); border-radius: 6px;
  padding: 2px 9px; cursor: pointer;
}
.eileen-wait, .eileen-notice {
  font-size: 0.84rem; line-height: 1.5; color: var(--text-muted);
  padding: 8px 10px; margin-bottom: 8px; border-left: 2px solid var(--cyan-border);
}
.eileen-wait-head { color: var(--text); }
.eileen-wait-head::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: eileen-dots 1.2s steps(4, end) infinite; }
@keyframes eileen-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.eileen-wait-list { margin: 4px 0 0; padding: 0; list-style: none; }
.eileen-wait-list li.is-now { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .eileen-wait-head::after { animation: none; content: "..."; } }
html.eileen-selecting body > *:not(#eileen-panel) { -webkit-user-select: none; user-select: none; }
@media (max-width: 768px) {
  #eileen-panel { bottom: var(--eileen-lift, 0px); }
  #eileen-body, #eileen-body.eileen-expanded { width: 100%; max-width: 100%; }
  #eileen-chat-history { max-height: min(62vh, var(--eileen-avail, calc(100vh - 200px - var(--eileen-lift, 0px)))); }
  #eileen-body.eileen-expanded #eileen-chat-history { max-height: var(--eileen-avail, calc(100vh - 200px - var(--eileen-lift, 0px))); }
}
/* Answer presentation: opening statement, footnotes, labelled links and their preview card. */
.chat-eileen { padding: 12px 14px 10px; }
.chat-eileen p.eileen-preamble {
  font-size: 0.76rem; line-height: 1.45; color: var(--text-muted);
  padding: 0 0 9px; margin: 0 0 11px; border-bottom: 1px solid var(--ep-hairline, var(--ac-94a3b8-a18, rgba(148,163,184,0.18)));
}
.chat-eileen p.eileen-footnote { font-size: 0.74rem; line-height: 1.45; color: var(--text-muted); margin: 0 0 0.35em; }
.chat-eileen p:not(.eileen-footnote) + p.eileen-footnote { margin-top: 1em; padding-top: 9px; border-top: 1px solid var(--ep-hairline, var(--ac-94a3b8-a18, rgba(148,163,184,0.18))); }
.chat-eileen .eileen-tools { margin: 10px 0 0; }
.eileen-link {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: baseline;
  font-size: 0.78em; line-height: 1.5; font-weight: 500; white-space: nowrap; text-decoration: none;
  color: var(--cyan); background: var(--ep-link-bg, var(--ac-0ea5e9-a9, rgba(14,165,233,0.09))); border: 1px solid var(--cyan-border);
  border-radius: 999px; padding: 0 8px; margin: 0 1px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.eileen-link:hover, .eileen-link:focus-visible { background: var(--ep-link-hover, var(--ac-0ea5e9-a20, rgba(14,165,233,0.2))); border-color: var(--cyan); outline: none; }
.eileen-link-arrow { font-size: 0.9em; opacity: 0.8; }
.eileen-preview {
  position: absolute; z-index: 5; max-width: 260px; pointer-events: none;
  background: var(--ep-preview-bg, var(--ac-0f172a-a98, rgba(15,23,42,0.98))); border: 1px solid var(--cyan-border); border-radius: 10px;
  padding: 10px 12px; box-shadow: var(--ep-preview-shadow, 0 10px 32px var(--ac-000000-a55, rgba(0,0,0,0.55)));
  opacity: 0; visibility: hidden; transition: opacity 0.12s ease;
}
.eileen-preview.is-on { opacity: 1; visibility: visible; }
.eileen-preview-title { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.eileen-preview-detail { font-size: 0.78rem; color: var(--text); margin-top: 2px; }
.eileen-preview-host { font-size: 0.72rem; color: var(--cyan); margin-top: 6px; }
.eileen-preview-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .eileen-link, .eileen-preview { transition: none; } }

/* AMD-510 B-2: the user's own stored conversations, shown only when history is switched on (signed-in workspace only). */
.eileen-memory-bar { align-items: center; justify-content: flex-end; margin: 0 0 8px; }
.eileen-memory-status { flex: 1 1 auto; color: var(--text-dim); font-size: 12px; }
.eileen-memory-list[hidden], .eileen-memory-form[hidden], #eileen-chat-history[hidden] { display: none !important; }
.eileen-memory-list { max-height: inherit; overflow-y: auto; padding: 2px 2px 8px; }
.eileen-memory-item { border-top: 1px solid var(--ep-hairline); padding: 10px 0; }
.eileen-memory-open { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.eileen-memory-open:hover, .eileen-memory-open:focus-visible { color: var(--cyan-soft); text-decoration: underline; }
.eileen-memory-meta, .eileen-memory-note { color: var(--text-dim); font-size: 12px; line-height: 1.5; margin: 4px 0 6px; }
.eileen-memory-item .eileen-tools { justify-content: flex-start; }
.eileen-memory-form { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.eileen-memory-input { flex: 1 1 200px; min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--cyan-border); background: var(--ep-tint); color: var(--text); font: inherit; font-size: 13px; }
/* AMD-510 B-5 stage (b): the question about unrecognised names, shown above the input before sending. */
.eileen-names[hidden] { display: none !important; }
.eileen-names { border: 1px solid var(--cyan-border); border-radius: 10px; background: var(--ep-tint); padding: 10px 12px; margin: 0 0 8px; }
.eileen-names-lead { color: var(--text); font-size: 13px; line-height: 1.5; margin: 0 0 8px; }
.eileen-names-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--ep-hairline); }
.eileen-names-name { flex: 1 1 140px; color: var(--text); font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.eileen-names-choice[aria-pressed="true"] { border-color: var(--cyan-soft); color: var(--text); background: var(--ep-hairline); font-weight: 600; }
.eileen-names-note { color: var(--text-dim); font-size: 12px; line-height: 1.5; margin: 8px 0 6px; }
.eileen-names-tools { justify-content: flex-end; }
/* Director, 22 Nov 2026: Clear conversation (every Eileen) and Delete conversation (stored conversations). */
.eileen-clear-bar[hidden], .eileen-memory-del[hidden] { display: none !important; }
.eileen-clear-bar { justify-content: flex-end; margin: 0 0 6px; }
.eileen-memory-del { color: var(--ac-fecaca-text, #FECACA); }
/* The shared waiting display used outside the panel (the workspace hub's centre conversation, kl-app.jsx), with the
   panel's own colours. */
.eileen-wait-host { --text: var(--ac-e2e8f0, #E2E8F0); --text-muted: var(--ac-64748b-text, #8896A9); --cyan-border: var(--ac-0ea5e9-a30, rgba(14, 165, 233, 0.3)); margin-top: 8px; }
/* Docked Eileen (opts.dock): the page's own conversation, in the page, without her orb. */
#eileen-panel.eileen-docked { position: relative; inset: auto; left: auto; top: auto; right: auto; bottom: auto; z-index: auto; display: block; width: 100%; }
#eileen-panel.eileen-docked #eileen-nexus, #eileen-panel.eileen-docked #eileen-close, #eileen-panel.eileen-docked #eileen-expand { display: none; }
#eileen-panel.eileen-docked #eileen-body { width: 100%; max-width: none; box-shadow: none; backdrop-filter: none; }
#eileen-panel.eileen-docked #eileen-chat-history { max-height: min(56vh, 620px); }
/* Where the workspace hub's home view docks Eileen (kl-app.jsx). */
.kl-eileen-dock { width: 100%; max-width: 760px; min-height: 160px; margin: 0 auto 32px; text-align: left; }
/* The one-off question (opts.qualifier). */
.eileen-qualifier-q { margin: 0 0 6px; color: var(--text); }
.eileen-qualifier-choices { justify-content: flex-start; }
/* The line a page adds under an answer (opts.answerExtras), for example the provisions and date line. */
.eileen-answer-meta { color: var(--text-dim); font-size: 0.74rem; line-height: 1.5; margin: 6px 0 4px; }

/* AMD-510-TASKS-049: "Move to folder" after "Save to Notes" (signed-in workspace). */
.eileen-folder-select {
  font-family: 'DM Sans', sans-serif; font-size: 12px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--ac-1e3a5f, #1E3A5F); background: var(--ac-0a1628, #0A1628); color: var(--ac-e2e8f0, #E2E8F0);
}
.eileen-folder-note { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--ac-94a3b8, #94A3B8); align-self: center; }
