/* Eileen panel: the one canonical frame for Eileen on every page of ailane.ai.
   Source of truth: the ailane.ai landing page (AMD-346). These rules were moved here verbatim from the landing page's
   own stylesheet on 15 Nov 2026 so that every page shows the same Eileen. Do not restyle Eileen on any page: load this
   file, build the panel with window.ailaneEileenPanel.mount() (assets/js/page/home-eileen-panel.js) or the landing
   page's markup, and leave answer styling to assets/css/home-eileen-panel.css.
   The variables below carry the landing page's values, and the import below carries the landing page's fonts (DM Sans,
   JetBrains Mono), so the panel looks the same on a page that does not define or load them. */
@import url('/assets/fonts/gf-d855aaf27a.css');
#eileen-panel {
  --cyan: var(--ac-0ea5e9, #0EA5E9);
  --cyan-soft: var(--ac-22d3ee, #22d3ee);
  --cyan-border: var(--ac-0ea5e9-a30, rgba(14, 165, 233, 0.3));
  --text: var(--ac-e2e8f0, #E2E8F0);
  --text-dim: var(--ac-94a3b8, #94A3B8);
  --text-muted: var(--ac-64748b-text, #8896A9);
  /* Surfaces and tints (AMD-510-TASKS-037 stage 1): named so a display theme can restyle Eileen here, once. */
  --ep-surface: var(--ac-0a0e1a-a95, rgba(10,14,26,0.95));
  --ep-shadow: 0 12px 48px var(--ac-000000-a50, rgba(0,0,0,0.5));
  --ep-orb-glow: 0 0 20px var(--ac-0ea5e9-a30, rgba(14,165,233,0.3));
  --ep-tint: var(--ac-0ea5e9-a8, rgba(14,165,233,0.08));
  --ep-user-bg: var(--ac-0ea5e9-a10, rgba(14,165,233,0.1));
  --ep-bubble: var(--ac-1e293b-a60, rgba(30,41,59,0.6));
  --ep-on-accent: var(--ac-02121e, #02121e);
  --ep-label: var(--ac-94a3b8-a90, rgba(148,163,184,0.9));
  --ep-hairline: var(--ac-94a3b8-a18, rgba(148,163,184,0.18));
  --ep-hover-tint: var(--ac-0ea5e9-a12, rgba(14,165,233,0.12));
  --ep-link-bg: var(--ac-0ea5e9-a9, rgba(14,165,233,0.09));
  --ep-link-hover: var(--ac-0ea5e9-a20, rgba(14,165,233,0.2));
  --ep-preview-bg: var(--ac-0f172a-a98, rgba(15,23,42,0.98));
  --ep-preview-shadow: 0 10px 32px var(--ac-000000-a55, rgba(0,0,0,0.55));
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  font-family: var(--font-body);
  line-height: 1.65;
  color: var(--text);
}
/* ── Eileen floating panel (LP-002 §4.2) ────── */
#eileen-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
#eileen-nexus {
  width: 52px;
  height: 52px;
  cursor: grab;
  border-radius: 50%;
  box-shadow: var(--ep-orb-glow, 0 0 20px var(--ac-0ea5e9-a30, rgba(14,165,233,0.3)));
  flex-shrink: 0;
}
#eileen-nexus:active { cursor: grabbing; }
#eileen-body {
  background: var(--ep-surface, var(--ac-0a0e1a-a95, rgba(10,14,26,0.95)));
  border: 1px solid var(--cyan-border);
  border-radius: 12px;
  padding: 16px;
  padding-right: 28px;
  max-width: 440px;
  width: 440px;
  backdrop-filter: blur(12px);
  position: relative;
  box-shadow: var(--ep-shadow, 0 12px 48px var(--ac-000000-a50, rgba(0,0,0,0.5)));
}
#eileen-body.hidden { display: none; }
#eileen-name {
  color: var(--cyan);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}
/* LP-V3-PUNCHLIST §3.4 — context bar */
#eileen-context-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 10px;
  background: var(--ep-tint, var(--ac-0ea5e9-a8, rgba(14,165,233,0.08)));
  border: 1px solid var(--cyan-border);
  border-radius: 6px;
  font-size: 0.78rem;
}
#eileen-context-bar.hidden { display: none; }
#eileen-context-label {
  color: var(--cyan);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
#eileen-context-exit {
  background: transparent;
  border: 1px solid var(--cyan-border);
  border-radius: 4px;
  color: var(--text-dim, var(--text-muted));
  cursor: pointer;
  font-size: 0.74rem;
  padding: 2px 8px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
#eileen-context-exit:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
#eileen-commentary {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 12px;
  min-height: 40px;
  transition: opacity 0.3s ease;
}
/* LP-V3-PUNCHLIST §3.3 — hide hover commentary once chat is active */
#eileen-body:has(#eileen-chat-history:not(:empty)) #eileen-commentary {
  display: none;
}
/* JS fallback class for browsers without :has() support */
#eileen-body.chat-active #eileen-commentary {
  display: none;
}
#eileen-chat-history {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
}
#eileen-chat-history:empty { display: none; }
.chat-user, .chat-eileen {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.chat-user {
  background: var(--ep-user-bg, var(--ac-0ea5e9-a10, rgba(14,165,233,0.1)));
  color: var(--text);
  border-left: 2px solid var(--cyan);
}
.chat-eileen {
  background: var(--ep-bubble, var(--ac-1e293b-a60, rgba(30,41,59,0.6)));
  color: var(--text);
}
#eileen-input-area { display: flex; gap: 8px; }
#eileen-input {
  flex: 1;
  background: var(--ep-bubble, var(--ac-1e293b-a60, rgba(30,41,59,0.6)));
  border: 1px solid var(--cyan-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}
#eileen-input:focus { border-color: var(--cyan); }
#eileen-input::placeholder { color: var(--text-muted); }
#eileen-input:disabled { opacity: 0.5; }
#eileen-send {
  background: var(--cyan);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--ep-on-accent, var(--ac-02121e, #02121e));
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.86rem;
  transition: background 0.2s ease;
}
#eileen-send:hover:not(:disabled) { background: var(--cyan-soft); }
#eileen-send:disabled { opacity: 0.5; cursor: not-allowed; }
#eileen-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  line-height: 1;
}
#eileen-close:hover { color: var(--text); }
#eileen-ai-label { font-size: 0.72rem; color: var(--ep-label, var(--ac-94a3b8-a90, rgba(148,163,184,0.9))); margin: -4px 0 8px; line-height: 1.4; }
@keyframes eileen-breathe { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }
#eileen-nexus.nexus-breathe { animation: eileen-breathe 4s ease-in-out infinite; }
@media (max-width: 768px) {
  #eileen-panel {
    bottom: 0;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  #eileen-nexus { align-self: flex-end; margin: 0 16px 8px 0; }
  /* The panel spans the screen's width on a phone; only the orb and the open panel take touches, so the empty strip
     beside a minimised orb never blocks scrolling or taps on the page (AMD-510, 21 Nov 2026). */
  #eileen-panel { pointer-events: none; }
  #eileen-panel > * { pointer-events: auto; }
  #eileen-body {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }
}
@media print { #eileen-panel { display: none !important; } }
/* ── Preview answer: headline, locked "Full analysis" panel, short system replies (AMD-415) ──
   Built by renderPreview and renderSystem in assets/js/page/home-eileen-panel.js. Uses only the panel's own variables
   and the answer bubble's existing values (background, radius, padding, hairline); no new colours. */
.chat-eileen .eileen-eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; line-height: 1.4;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--cyan);
  margin: 0 0 9px; padding: 0 0 8px; border-bottom: 1px solid var(--ep-hairline, var(--ac-94a3b8-a18, rgba(148,163,184,0.18)));
}
.eileen-locked {
  position: static; display: block; box-sizing: border-box;
  background: var(--ep-bubble, var(--ac-1e293b-a60, rgba(30,41,59,0.6))); border: 1px solid var(--ep-hairline, var(--ac-94a3b8-a18, rgba(148,163,184,0.18))); border-radius: 8px;
  padding: 12px 14px; margin: 8px 0 8px; color: var(--text);
  font-size: 0.88rem; line-height: 1.5;
}
.eileen-locked-head { display: flex; align-items: center; gap: 8px; }
.eileen-locked-mark { flex: none; width: 14px; height: 14px; color: var(--cyan); }
.eileen-locked-title { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 0.88rem; color: var(--text); }
.eileen-locked-tag {
  flex: none; font-size: 0.72rem; line-height: 1.4; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.eileen-locked-list { list-style: none; margin: 10px 0 0; padding: 0; }
.eileen-locked-list li {
  display: flex; align-items: baseline; gap: 12px; margin: 0; padding: 7px 0;
  border-top: 1px solid var(--ep-hairline, var(--ac-94a3b8-a18, rgba(148,163,184,0.18))); font-size: 0.84rem; line-height: 1.45;
}
.eileen-locked-index {
  flex: none; font-family: var(--font-mono); font-size: 0.74rem;
  font-variant-numeric: tabular-nums; color: var(--text-muted);
}
.eileen-locked-item { color: var(--text); opacity: 0.8; overflow-wrap: anywhere; }
/* Content held back: the last two items fade into the panel. A mask, not a coloured overlay, because the panel
   background is translucent: the items themselves fade, so the panel shows through exactly. No blur. */
.eileen-locked-list.is-held {
  -webkit-mask-image: linear-gradient(to bottom, var(--ac-000000, #000) 0, var(--ac-000000, #000) calc(100% - 4.6em), transparent 100%);
  mask-image: linear-gradient(to bottom, var(--ac-000000, #000) 0, var(--ac-000000, #000) calc(100% - 4.6em), transparent 100%);
}
.eileen-locked-note { margin: 10px 0 0; font-size: 0.76rem; line-height: 1.45; color: var(--text-muted); }
.eileen-cta-row { display: flex; justify-content: flex-end; margin: 12px 0 0; }
.eileen-cta {
  display: inline-block; box-sizing: border-box;
  background: var(--cyan); border: none; border-radius: 8px; padding: 8px 16px;
  color: var(--ep-on-accent, var(--ac-02121e, #02121e)); font-family: var(--font-body); font-weight: 600; font-size: 0.86rem; line-height: 1.4;
  text-decoration: none; text-align: center; cursor: pointer; transition: background 0.2s ease;
}
.eileen-cta:hover, .eileen-cta:focus-visible { background: var(--cyan-soft); color: var(--ep-on-accent, var(--ac-02121e, #02121e)); }
.eileen-cta:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.eileen-system .eileen-cta-row { justify-content: flex-start; margin-top: 8px; }
@media (max-width: 479px) {
  .eileen-cta-row { display: block; }
  .eileen-cta { display: block; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .eileen-cta { transition: none; } }
