/* EnFavori AI Twin pilot — self-contained so existing profile layout stays intact. */
.ef-ai[hidden] { display: none !important; }
.ef-ai { position: fixed; z-index: 6000; inset: 0; display: grid; place-items: center; padding: 14px; font-family: inherit; }
.ef-ai__shade { position: absolute; inset: 0; background: rgba(10,23,43,.69); }
.ef-ai__panel { position: relative; background: #fff; color: #142844; width: min(100%,540px); height: min(690px,calc(100dvh - 28px)); border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.26); overflow: hidden; display: flex; flex-direction: column; }
.ef-ai__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: #142844; color: #fff; }
.ef-ai__avatar { display: grid; place-items: center; border-radius: 50%; width: 42px; height: 42px; flex: 0 0 42px; font-size: 14px; font-weight: 800; background: #17b9bd; color: #092236; }
.ef-ai__identity { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.ef-ai__identity strong { font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-ai__identity small { font-size: 12px; color: #d5f9f7; }
.ef-ai__close { border: 0; background: transparent; color: #fff; font-size: 27px; padding: 3px 8px; cursor: pointer; }
.ef-ai__messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: #f5f8fb; }
.ef-ai__bubble { margin: 0; line-height: 1.55; overflow-wrap: anywhere; font-size: 14px; padding: 12px 14px; max-width: 91%; white-space: pre-wrap; border-radius: 14px; }
.ef-ai__bubble--bot { background: #fff; color: #142844; border: 1px solid #e0e9f0; align-self: flex-start; border-bottom-left-radius: 3px; }
.ef-ai__bubble--user { background: #142844; color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.ef-ai__sources { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; font-size: 12px; }
.ef-ai__sources a { text-decoration: none; color: #076c79; background: #ecfafa; border: 1px solid #b3e3e5; border-radius: 20px; padding: 7px 10px; }
.ef-ai__quick { padding: 10px 14px 2px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.ef-ai__quick button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #c5d5de; border-radius: 16px; color: #142844; background: white; font-size: 12px; font-weight: 600; cursor: pointer; }
.ef-ai__quick button:hover { border-color: #0b999f; }
.ef-ai__form { display: flex; gap: 8px; padding: 12px 14px; align-items: center; }
.ef-ai__form input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #c6d3db; border-radius: 12px; font-size: 14px; background: #fff; color: #142844; }
.ef-ai__form button { min-height: 44px; border: 0; border-radius: 12px; background: #0e999d; padding: 0 14px; color: #fff; font-weight: 700; cursor: pointer; }
.ef-ai__form button:disabled { opacity: .55; cursor: wait; }
.ef-ai__legal { padding: 0 16px 14px; margin: 0; font-size: 11px; line-height: 1.4; color: #53677a; }
.ef-ai__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) {
    .ef-ai { padding: 0; align-items: stretch; }
    .ef-ai__panel { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
    .ef-ai__head { padding-top: max(14px,env(safe-area-inset-top)); }
    .ef-ai__legal { padding-bottom: max(12px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .ef-ai *, .ef-ai *::before, .ef-ai *::after { scroll-behavior: auto !important; } }
