/* Виртуалният асистент „Липа“ — макет (27.10.2026, js/a2-assistant.js). Само с ?asst=demo, не и в production.
   Брандбукът: Montserrat, #094fa3 / #febc31 / #8dc73f / #efefef, четвъртинки. Всичко е под .lipa — не пипа стила на сайта. */
.lipa {
	--lp-blue: #094fa3; --lp-blue-d: #063873; --lp-sun: #febc31; --lp-leaf: #8dc73f; --lp-leaf-d: #4b6b1f;
	--lp-grey: #efefef; --lp-line: #dcdcdc; --lp-ink: #1f2a3a; --lp-mute: #55606f; --lp-white: #fff;
	--lp-mbar: 0px;
	font-family: Montserrat, system-ui, sans-serif; color: var(--lp-ink);
}
.lipa *, .lipa *::before, .lipa *::after { box-sizing: border-box; }
.lipa button { font-family: inherit; }
.lipa svg { display: block; }

/* ── бутонът в ъгъла ── */
.lipa-fab { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + var(--lp-mbar) + env(safe-area-inset-bottom, 0px)); z-index: 60;
	width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: var(--lp-blue); color: var(--lp-white); cursor: pointer;
	box-shadow: 0 12px 30px -8px rgba(6, 56, 115, .55); display: grid; place-items: center; transition: transform .25s cubic-bezier(.2, .7, .2, 1), background .2s; }
.lipa-fab:hover { transform: translateY(-2px) scale(1.04); background: var(--lp-blue-d); }
.lipa-fab:focus-visible { outline: 3px solid var(--lp-sun); outline-offset: 3px; }
.lipa-fab svg { width: 34px; height: 34px; }
.lipa-fab .lp-dot { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--lp-sun); border: 2px solid var(--lp-white); }
.lipa-fab[aria-expanded="true"] { transform: scale(0); pointer-events: none; }
.lipa.breathe .lipa-fab { animation: lpBreathe 2.2s ease-in-out .6s 2; }
@keyframes lpBreathe { 0%, 100% { box-shadow: 0 12px 30px -8px rgba(6, 56, 115, .55), 0 0 0 0 rgba(254, 188, 49, .7); } 50% { box-shadow: 0 12px 30px -8px rgba(6, 56, 115, .55), 0 0 0 16px rgba(254, 188, 49, 0); } }

/* поздравът до бутона */
.lipa-hi { position: fixed; right: calc(max(20px, env(safe-area-inset-right, 0px)) + 76px); bottom: calc(28px + var(--lp-mbar) + env(safe-area-inset-bottom, 0px)); z-index: 60;
	max-width: 250px; padding: 14px 40px 14px 16px; background: var(--lp-white); border-radius: 24px 24px 0 24px; box-shadow: 0 14px 36px -12px rgba(6, 56, 115, .45);
	font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--lp-blue-d); cursor: pointer; animation: lpPop .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.lipa-hi b { display: block; color: var(--lp-blue); font-size: 15px; }
.lipa-hi .lp-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; background: none; color: var(--lp-mute); font-size: 20px; line-height: 1; cursor: pointer; }
@keyframes lpPop { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }

/* ── панелът ── */
.lipa-panel { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + var(--lp-mbar) + env(safe-area-inset-bottom, 0px)); z-index: 61;
	width: 400px; height: min(660px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden;
	background: var(--lp-white); border-radius: 64px 0 0 0; box-shadow: 0 30px 70px -20px rgba(6, 56, 115, .5), 0 0 0 1px rgba(6, 56, 115, .06);
	transform-origin: 100% 100%; animation: lpOpen .45s cubic-bezier(.2, .8, .2, 1) both; }
.lipa-panel[hidden] { display: none; }
@keyframes lpOpen { from { opacity: 0; transform: translateY(16px) scale(.9); clip-path: circle(30px at calc(100% - 32px) calc(100% - 32px)); } to { opacity: 1; transform: none; clip-path: circle(150% at calc(100% - 32px) calc(100% - 32px)); } }

.lp-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 12px 16px 28px; background: var(--lp-blue); color: var(--lp-white); position: relative; }
.lp-head::after { content: ""; position: absolute; right: 0; bottom: -1px; width: 36px; height: 36px; background: var(--lp-sun); border-radius: 36px 0 0 0; }
.lp-ava { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--lp-white); color: var(--lp-leaf-d); display: grid; place-items: center; }
.lp-ava svg { width: 28px; height: 28px; }
.lp-ttl { flex: 1; min-width: 0; }
.lp-ttl h2 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.2; color: var(--lp-white); }
.lp-ttl p { margin: 2px 0 0; font-size: 12px; font-weight: 500; opacity: .85; }
.lp-ttl p i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--lp-leaf); vertical-align: 0; }
.lp-hbtn { flex: none; width: 40px; height: 40px; padding: 0; border: 0; background: rgba(255, 255, 255, .12); color: var(--lp-white); cursor: pointer; display: grid; place-items: center; position: relative; z-index: 1; }
.lp-hbtn:hover { background: rgba(255, 255, 255, .25); }
.lp-hbtn:focus-visible { outline: 2px solid var(--lp-sun); outline-offset: 2px; }
.lp-hbtn svg { width: 20px; height: 20px; }

.lp-log { flex: 1; overflow-y: auto; padding: 22px 18px 10px; display: flex; flex-direction: column; gap: 12px; background: var(--lp-grey); scroll-behavior: smooth; overscroll-behavior: contain; }
.lp-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; animation: lpIn .35s cubic-bezier(.2, .7, .2, 1) both; }
.lp-msg.me { justify-content: flex-end; }
@keyframes lpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lp-msg .lp-mini { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lp-white); color: var(--lp-leaf-d); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(6, 56, 115, .12); }
.lp-msg .lp-mini svg { width: 18px; height: 18px; }
.lp-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: calc(100% - 36px); }
.lp-b { padding: 11px 14px; font-size: 14px; line-height: 1.5; background: var(--lp-white); border-radius: 18px 18px 18px 0; box-shadow: 0 1px 2px rgba(6, 56, 115, .06); overflow-wrap: anywhere; }
.lp-b b { color: var(--lp-blue-d); }
/* 28.10.2026: „Обадете ми се“ в чата */
.lp-cbf { display: grid; gap: 8px; }
.lp-cbf p { margin: 0; }
.lp-cbf label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; }
.lp-cbf input[name] { height: 40px; padding: 0 10px; border: 0; border-bottom: 2px solid var(--lp-blue); background: #f4f6f9; font: 15px Montserrat, sans-serif; }
.lp-cbf .lp-cbc { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.lp-cbf .lp-cbc input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--lp-blue); }
.lp-cbs { justify-self: start; min-height: 40px; padding: 0 16px; border: 0; background: var(--lp-sun, #febc31); color: var(--lp-blue-d); font: 800 14px Montserrat, sans-serif; cursor: pointer; }
.lp-cbm { font-size: 13px; color: #b3261e; }
.lp-msg.me .lp-b { background: var(--lp-blue); color: var(--lp-white); border-radius: 18px 18px 0 18px; }
.lp-src { font-size: 11px; color: var(--lp-mute); padding-left: 4px; }

/* мисли — три листа */
.lp-typing { display: inline-flex; gap: 5px; padding: 12px 14px; background: var(--lp-white); border-radius: 18px 18px 18px 0; }
.lp-typing svg { width: 14px; height: 14px; color: var(--lp-leaf); animation: lpLeaf 1.1s ease-in-out infinite; }
.lp-typing svg:nth-child(2) { animation-delay: .15s; } .lp-typing svg:nth-child(3) { animation-delay: .3s; }
@keyframes lpLeaf { 0%, 60%, 100% { transform: translateY(0) rotate(0); opacity: .45; } 30% { transform: translateY(-5px) rotate(-18deg); opacity: 1; } }

/* карти */
.lp-cards { display: grid; gap: 8px; }
.lp-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px 8px 8px; background: var(--lp-white); border: 0; border-left: 4px solid var(--lp-leaf);
	text-align: left; color: var(--lp-ink); text-decoration: none; cursor: pointer; font: inherit; width: 100%; transition: transform .2s, box-shadow .2s; animation: lpIn .4s cubic-bezier(.2, .7, .2, 1) both; }
.lp-card:nth-child(2) { animation-delay: .08s; } .lp-card:nth-child(3) { animation-delay: .16s; } .lp-card:nth-child(4) { animation-delay: .24s; }
.lp-card:hover, .lp-card:focus-visible { transform: translateX(3px); box-shadow: 0 8px 20px -10px rgba(6, 56, 115, .5); }
.lp-card:focus-visible { outline: 2px solid var(--lp-blue); outline-offset: 2px; }
.lp-card.p4 { border-left-color: var(--lp-sun); }
.lp-card .lp-pic { width: 92px; height: 72px; background: var(--lp-grey); overflow: hidden; display: grid; place-items: center; }
.lp-card .lp-pic svg { width: 100%; height: 100%; }
.lp-card .lp-pic img { width: 100%; height: 100%; object-fit: cover; }
.lp-card .lp-pic .ap { fill: var(--lp-sun); fill-opacity: .85; stroke: var(--lp-blue-d); stroke-width: 14; }
.lp-card .lp-ic { color: var(--lp-blue); }
.lp-card .lp-ic svg { width: 34px; height: 34px; }
.lp-card strong { display: block; font-size: 15px; font-weight: 800; color: var(--lp-blue-d); }
.lp-card small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--lp-mute); }
.lp-card em { display: inline-block; margin-top: 6px; padding: 3px 8px; font-style: normal; font-size: 11px; font-weight: 800; background: var(--lp-sun); color: var(--lp-blue-d); }
.lp-card.p3 em { background: var(--lp-leaf); color: #12340a; }
.lp-more { justify-self: start; padding: 0; border: 0; background: none; color: var(--lp-blue); font: 700 13px/1.4 inherit; font-family: inherit; text-decoration: underline; text-decoration-color: var(--lp-sun); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }

/* предложения */
/* 27.10.2026 (Петьо: „бутонът … остава леко скрит и встрани“): предложенията се пренасят на нов ред — всички се виждат, без превъртане встрани */
.lp-chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 6px; background: var(--lp-grey); }
.lp-chip { flex: none; max-width: 100%; padding: 7px 11px; white-space: normal; text-align: left; border: 1.5px solid var(--lp-blue); border-radius: 18px 18px 18px 0; background: var(--lp-white); color: var(--lp-blue); font-size: 13px; font-weight: 700; line-height: 1.25; cursor: pointer; transition: background .2s, color .2s; }
.lp-chip:hover, .lp-chip:focus-visible { background: var(--lp-blue); color: var(--lp-white); }
.lp-chip:focus-visible { outline: 2px solid var(--lp-sun); outline-offset: 2px; }

/* поле */
.lp-form { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 8px; background: var(--lp-white); border-top: 1px solid var(--lp-line); }
.lp-form textarea { flex: 1; min-width: 0; resize: none; max-height: 96px; overflow-y: hidden; scrollbar-width: thin; padding: 11px 14px; border: 1.5px solid var(--lp-line); border-radius: 22px; font: 500 14px/1.4 inherit; font-family: inherit; color: var(--lp-ink); background: var(--lp-white); }
.lp-form textarea:focus { outline: none; border-color: var(--lp-blue); box-shadow: 0 0 0 3px rgba(9, 79, 163, .15); }
.lp-send { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--lp-sun); color: var(--lp-blue-d); cursor: pointer; display: grid; place-items: center; transition: transform .2s; }
.lp-send:hover { transform: scale(1.06); }
.lp-send:focus-visible { outline: 2px solid var(--lp-blue); outline-offset: 2px; }
.lp-send svg { width: 20px; height: 20px; }
.lp-note { flex: none; margin: 0; padding: 0 16px 10px; background: var(--lp-white); font-size: 11px; line-height: 1.4; color: var(--lp-mute); }

/* свит панел (след „Отведи ме“): лента, разговорът продължава */
.lipa-pill { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + var(--lp-mbar) + env(safe-area-inset-bottom, 0px)); z-index: 60;
	display: flex; align-items: center; gap: 10px; max-width: min(340px, calc(100vw - 40px)); padding: 8px 18px 8px 8px; border: 0; border-radius: 32px 32px 0 32px;
	background: var(--lp-blue); color: var(--lp-white); font: 700 14px/1.3 inherit; font-family: inherit; text-align: left; cursor: pointer; box-shadow: 0 12px 30px -8px rgba(6, 56, 115, .55); animation: lpPop .4s cubic-bezier(.2, .9, .3, 1.2) both; }
.lipa-pill .lp-ava { width: 40px; height: 40px; }
.lipa-pill small { display: block; font-weight: 500; font-size: 12px; opacity: .85; }
.lipa-pill:focus-visible { outline: 3px solid var(--lp-sun); outline-offset: 3px; }

/* целта на сайта, към която води: жълт пръстен, два пъти */
.lipa-spot { position: relative; animation: lpSpot 1.4s ease-out 2; outline: 3px solid #febc31 !important; outline-offset: 6px; transition: outline-color .6s; }
.lipa-spot.lipa-spot-off { outline-color: transparent !important; }
@keyframes lpSpot { 0% { box-shadow: 0 0 0 0 rgba(254, 188, 49, .85); } 100% { box-shadow: 0 0 0 26px rgba(254, 188, 49, 0); } }

/* телефон: панелът е лист отдолу; бутонът — над лентата с действията */
@media (max-width: 767px) {
	.lipa { --lp-mbar: 62px; }
	.lipa-fab { width: 56px; height: 56px; right: 14px; }
	.lipa-hi { right: 80px; max-width: calc(100vw - 110px); }
	.lipa-panel { right: 0; left: 0; bottom: 0; width: auto; height: min(88vh, calc(100vh - 40px)); border-radius: 40px 40px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
	.lp-head { border-radius: 40px 40px 0 0; padding-left: 22px; }
	.lp-head::after { display: none; }
	.lipa-pill { right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.lipa *, .lipa-spot { animation: none !important; transition: none !important; }
}
