/* Biznes Medical – widżet chatbota. Kolory i font jak na stronie (granat #093772, niebieski #1167a8, Rubik). */
.bmchat {
	--bmchat-granat: #093772;
	--bmchat-niebieski: #1167a8;
	--bmchat-tlo: #ffffff;
	--bmchat-tlo2: #f3f6fb;
	--bmchat-tekst: #1b2433;
	--bmchat-szary: #5b6575;
	--bmchat-ramka: #dbe3ef;
	--bmchat-dol: 20px;
	position: fixed;
	bottom: calc(var(--bmchat-dol) + env(safe-area-inset-bottom, 0px));
	right: 20px;
	z-index: 99990;
	font-family: Rubik, "Segoe UI", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--bmchat-tekst);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
}
.bmchat--lewo { right: auto; left: 20px; align-items: flex-start; }
.bmchat *, .bmchat *::before, .bmchat *::after { box-sizing: border-box; }

.bmchat__btn {
	display: inline-flex; align-items: center; gap: 8px;
	height: 54px; padding: 0 20px 0 16px; border: 0; border-radius: 27px;
	background: var(--bmchat-granat); color: #fff; cursor: pointer;
	font: 500 15px/1 Rubik, "Segoe UI", Arial, sans-serif;
	box-shadow: 0 6px 20px rgba(9, 55, 114, .28);
	transition: background .15s, transform .15s;
}
.bmchat__btn:hover { background: var(--bmchat-niebieski); }
.bmchat__btn:focus-visible { outline: 3px solid #8fb8e6; outline-offset: 2px; }
.bmchat--otwarty .bmchat__btn-txt { display: none; }
.bmchat--otwarty .bmchat__btn { width: 54px; padding: 0; justify-content: center; }

.bmchat__panel {
	width: 380px; max-width: calc(100vw - 32px);
	height: 600px; max-height: calc(100vh - 120px - var(--bmchat-dol));
	background: var(--bmchat-tlo); border: 1px solid var(--bmchat-ramka); border-radius: 16px;
	box-shadow: 0 16px 48px rgba(9, 55, 114, .22);
	display: flex; flex-direction: column; overflow: hidden;
}
.bmchat__panel[hidden] { display: none; }

.bmchat__head {
	display: flex; align-items: center; gap: 4px;
	padding: 14px 10px 14px 18px; background: var(--bmchat-granat); color: #fff;
}
.bmchat__tytul { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bmchat__tytul strong { font-size: 16px; font-weight: 600; }
.bmchat__tytul span { font-size: 12.5px; opacity: .85; }
.bmchat__ikona {
	width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #fff;
	font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.bmchat__ikona:hover { background: rgba(255, 255, 255, .14); }

.bmchat__lista {
	position: relative; flex: 1; overflow-y: auto; padding: 16px; background: var(--bmchat-tlo2);
	display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain;
}
.bmchat__msg {
	max-width: 88%; padding: 10px 14px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere;
}
.bmchat__msg p { margin: 0 0 8px; }
.bmchat__msg p:last-child, .bmchat__msg ul:last-child, .bmchat__msg ol:last-child { margin-bottom: 0; }
.bmchat__msg ul, .bmchat__msg ol { margin: 0 0 8px; padding-left: 20px; }
.bmchat__msg li { margin: 2px 0; }
.bmchat__msg a { color: var(--bmchat-niebieski); text-decoration: underline; }
.bmchat__msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--bmchat-ramka); border-bottom-left-radius: 4px; }
.bmchat__msg--user { align-self: flex-end; background: var(--bmchat-niebieski); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bmchat__msg--blad { border-color: #f1c4c0; background: #fff6f5; }

.bmchat__pisze { display: inline-flex; gap: 4px; padding: 14px 16px; }
.bmchat__pisze span { width: 7px; height: 7px; border-radius: 50%; background: #9aa7ba; animation: bmchat-kropka 1.2s infinite ease-in-out; }
.bmchat__pisze span:nth-child(2) { animation-delay: .15s; }
.bmchat__pisze span:nth-child(3) { animation-delay: .3s; }
@keyframes bmchat-kropka { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.bmchat__szybkie { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.bmchat__chip {
	border: 1px solid var(--bmchat-niebieski); background: #fff; color: var(--bmchat-niebieski);
	border-radius: 18px; padding: 7px 12px; font: 14px/1.25 Rubik, "Segoe UI", Arial, sans-serif; cursor: pointer; text-align: left;
}
.bmchat__chip:hover { background: var(--bmchat-niebieski); color: #fff; }

.bmchat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--bmchat-ramka); background: #fff; }
.bmchat__pole {
	flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px;
	border: 1px solid var(--bmchat-ramka); border-radius: 10px; background: #fff; color: var(--bmchat-tekst);
	font: 16px/1.4 Rubik, "Segoe UI", Arial, sans-serif; /* 16 px – iOS nie powiększa strony */
}
.bmchat__pole:focus { outline: none; border-color: var(--bmchat-niebieski); box-shadow: 0 0 0 3px rgba(17, 103, 168, .15); }
.bmchat__wyslij {
	width: 42px; height: 42px; flex: none; border: 0; border-radius: 10px; cursor: pointer;
	background: var(--bmchat-granat); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.bmchat__wyslij:disabled { opacity: .5; cursor: default; }

.bmchat__stopka { padding: 0 14px 10px; background: #fff; font-size: 11.5px; line-height: 1.4; color: var(--bmchat-szary); }
.bmchat__stopka a { color: var(--bmchat-szary); text-decoration: underline; }

/* telefon: panel na cały ekran, przycisk jako okrągła ikona */
@media (max-width: 600px) {
	.bmchat { right: 16px; }
	.bmchat--lewo { left: 16px; }
	.bmchat__btn, .bmchat .bmchat__btn { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; }
	.bmchat__btn-txt { display: none; }
	.bmchat--otwarty .bmchat__btn { display: none; }
	.bmchat__panel {
		position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
		height: 100dvh; border-radius: 0; border: 0;
	}
	.bmchat__head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
	.bmchat__stopka { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* Odporność na style motywu (Blocksy stylizuje button[type=submit] i textarea wyżej niż klasa) */
.bmchat .bmchat__form .bmchat__pole {
	height: 42px; min-height: 42px; max-height: 120px; margin: 0; padding: 10px 12px;
	border-radius: 10px; box-shadow: none; line-height: 1.4; font-size: 16px;
}
.bmchat .bmchat__form .bmchat__pole:focus { box-shadow: 0 0 0 3px rgba(17, 103, 168, .15); }
.bmchat .bmchat__form .bmchat__wyslij {
	width: 42px; height: 42px; min-height: 0; min-width: 0; margin: 0; padding: 0;
	border: 0; border-radius: 10px; background: var(--bmchat-granat); box-shadow: none; line-height: 1;
}
.bmchat .bmchat__form .bmchat__wyslij:hover { background: var(--bmchat-niebieski); }
.bmchat button { text-transform: none; letter-spacing: normal; min-height: 0; margin: 0; }
.bmchat .bmchat__btn { min-height: 0; }
.bmchat .bmchat__ikona { min-width: 0; }

@media (prefers-reduced-motion: reduce) {
	.bmchat__pisze span { animation: none; }
	.bmchat__btn { transition: none; }
}
@media print { .bmchat { display: none !important; } }
