/* Wirtualny Dietetyk Bon Appetit – style widżetu (zakres: #badiet-root) */
#badiet-root {
	--badiet-color: #06b091;
	--badiet-accent: #fcb340;
	--badiet-dark: #004d3d;
	--badiet-ink: #364743;
	--badiet-muted: #6b7a76;
	--badiet-bg: #ffffff;
	--badiet-soft: #f7f5f5;
	--badiet-line: #e2ebe9;
	position: fixed;
	bottom: var(--badiet-bottom, 20px);
	z-index: 2147483000;
	font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: var(--badiet-ink);
}
#badiet-root.badiet--right { right: var(--badiet-side, 20px); }
#badiet-root.badiet--left { left: var(--badiet-side, 20px); }
#badiet-root *, #badiet-root *::before, #badiet-root *::after { box-sizing: border-box; }
#badiet-root button, #badiet-root input, #badiet-root textarea, #badiet-root select {
	font: inherit; color: inherit; margin: 0; letter-spacing: normal; text-transform: none;
}
#badiet-root svg { width: 20px; height: 20px; fill: currentColor; display: block; }

/* Przycisk otwierający */
#badiet-root .badiet-launcher {
	display: flex; align-items: center; gap: 8px;
	height: 56px; padding: 0 20px 0 16px;
	border: 0; border-radius: 28px; cursor: pointer;
	background: var(--badiet-accent); color: var(--badiet-dark);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	font-weight: 700; font-size: 15px;
	transition: transform .15s ease, box-shadow .15s ease;
}
#badiet-root .badiet-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
#badiet-root .badiet-launcher svg { width: 24px; height: 24px; }
#badiet-root.badiet--open .badiet-launcher { display: none; }

/* Panel */
#badiet-root .badiet-panel {
	display: none; flex-direction: column;
	position: absolute; bottom: 0;
	width: 380px; height: min(620px, calc(100vh - 40px));
	background: var(--badiet-bg);
	border-radius: 16px; overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}
#badiet-root.badiet--right .badiet-panel { right: 0; }
#badiet-root.badiet--left .badiet-panel { left: 0; }
#badiet-root.badiet--open .badiet-panel { display: flex; }

#badiet-root .badiet-header {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 10px 12px 14px;
	background: linear-gradient(135deg, var(--badiet-color), var(--badiet-dark)); color: #fff;
}
#badiet-root .badiet-avatar {
	flex: 0 0 38px; height: 38px; border-radius: 50%;
	background: var(--badiet-accent); color: var(--badiet-dark);
	display: flex; align-items: center; justify-content: center;
}
#badiet-root .badiet-titles { flex: 1; min-width: 0; }
#badiet-root .badiet-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
#badiet-root .badiet-subtitle { font-size: 12px; opacity: .92; }
#badiet-root .badiet-badge {
	display: inline-block; margin-left: 4px; padding: 1px 6px;
	border-radius: 6px; background: var(--badiet-accent); color: var(--badiet-dark);
	font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
#badiet-root .badiet-icon-btn {
	flex: 0 0 34px; height: 34px; border: 0; border-radius: 50%;
	background: transparent; color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
#badiet-root .badiet-icon-btn:hover { background: rgba(255, 255, 255, .18); }

/* Wiadomości */
#badiet-root .badiet-messages {
	flex: 1; overflow-y: auto; padding: 14px 12px 6px;
	background: var(--badiet-soft);
	display: flex; flex-direction: column; gap: 8px;
}
#badiet-root .badiet-msg { display: flex; flex-direction: column; max-width: 88%; }
#badiet-root .badiet-msg--user { align-self: flex-end; align-items: flex-end; }
#badiet-root .badiet-msg--bot { align-self: flex-start; }
#badiet-root .badiet-bubble {
	padding: 9px 12px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere;
}
#badiet-root .badiet-msg--bot .badiet-bubble {
	background: #fff; border: 1px solid var(--badiet-line); border-bottom-left-radius: 4px;
}
#badiet-root .badiet-msg--user .badiet-bubble {
	background: var(--badiet-color); color: #fff; border-bottom-right-radius: 4px;
}
#badiet-root .badiet-msg--error .badiet-bubble { border-color: #f0c9c0; background: #fff7f5; }
#badiet-root .badiet-bubble a { color: var(--badiet-color); font-weight: 600; text-decoration: underline; }
#badiet-root .badiet-msg--user .badiet-bubble a { color: #fff; }
#badiet-root .badiet-bubble ul { margin: 4px 0; padding-left: 18px; }
#badiet-root .badiet-bubble li { margin: 2px 0; }
#badiet-root .badiet-bubble strong { font-weight: 700; }
#badiet-root .badiet-label {
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
	color: var(--badiet-color); margin: 0 0 2px 4px;
}
#badiet-root .badiet-compare { display: flex; flex-direction: column; gap: 6px; }
#badiet-root .badiet-compare .badiet-msg { max-width: 94%; }

#badiet-root .badiet-typing .badiet-bubble { display: flex; gap: 4px; padding: 12px 14px; }
#badiet-root .badiet-typing span {
	width: 7px; height: 7px; border-radius: 50%; background: var(--badiet-muted);
	animation: badiet-dot 1.2s infinite ease-in-out;
}
#badiet-root .badiet-typing span:nth-child(2) { animation-delay: .15s; }
#badiet-root .badiet-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes badiet-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Szybkie odpowiedzi */
#badiet-root .badiet-quick {
	display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px;
	background: var(--badiet-soft);
}
#badiet-root .badiet-chip {
	border: 1px solid var(--badiet-accent); background: #fff; color: var(--badiet-dark);
	border-radius: 16px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
#badiet-root .badiet-chip:hover { background: var(--badiet-accent); color: var(--badiet-dark); }

/* Pole wpisywania */
#badiet-root .badiet-input {
	display: flex; align-items: flex-end; gap: 8px;
	padding: 10px 10px 8px 12px; border-top: 1px solid var(--badiet-line); background: #fff;
	margin: 0;
}
#badiet-root .badiet-input textarea {
	flex: 1; resize: none; border: 1px solid var(--badiet-line); border-radius: 12px;
	padding: 9px 12px; max-height: 120px; min-height: 40px; outline: none; background: #fff;
	font-size: 16px; /* brak powiększania na iPhonie */
}
#badiet-root .badiet-input textarea:focus { border-color: var(--badiet-accent); }
#badiet-root .badiet-send {
	flex: 0 0 40px; height: 40px; border: 0; border-radius: 50%;
	background: var(--badiet-accent); color: var(--badiet-dark); cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
#badiet-root .badiet-send:disabled { opacity: .5; cursor: default; }

#badiet-root .badiet-foot {
	display: flex; flex-direction: column; align-items: center; gap: 2px;
	padding: 0 12px 10px; background: #fff; text-align: center;
}
#badiet-root .badiet-link {
	border: 0; background: none; color: var(--badiet-color); font-weight: 600;
	font-size: 13px; cursor: pointer; text-decoration: underline; padding: 2px;
}
#badiet-root .badiet-disclaimer { font-size: 11px; color: var(--badiet-muted); }

/* Formularz oddzwonienia */
#badiet-root .badiet-form {
	align-self: stretch; background: #fff; border: 2px solid var(--badiet-accent);
	border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin: 0;
}
#badiet-root .badiet-form-title { font-weight: 700; color: var(--badiet-dark); }
#badiet-root .badiet-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; }
#badiet-root .badiet-form input:not([type=checkbox]), #badiet-root .badiet-form select {
	border: 1px solid var(--badiet-line); border-radius: 8px; padding: 8px 10px;
	font-size: 16px; font-weight: 400; background: #fff; width: 100%; height: auto;
}
#badiet-root .badiet-form .badiet-consent { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 11px; line-height: 1.35; }
#badiet-root .badiet-form .badiet-consent input { margin-top: 2px; flex: 0 0 auto; width: 16px; height: 16px; }
#badiet-root .badiet-form .badiet-consent a { color: var(--badiet-color); }
#badiet-root .badiet-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#badiet-root .badiet-form-error { color: #c0392b; font-size: 12px; min-height: 0; }
#badiet-root .badiet-form-send {
	border: 0; border-radius: 11px; background: var(--badiet-accent); color: var(--badiet-dark);
	font-weight: 700; padding: 10px; cursor: pointer;
}
#badiet-root .badiet-form-send:disabled { opacity: .6; }

/* Telefon */
@media (max-width: 480px) {
	#badiet-root .badiet-launcher-label { display: none; }
	#badiet-root .badiet-launcher { width: 56px; padding: 0; justify-content: center; }
	#badiet-root.badiet--open { left: 0; right: 0; bottom: 0; }
	#badiet-root .badiet-panel {
		position: fixed; inset: 0; width: 100%; height: 100%;
		height: 100dvh; border-radius: 0;
	}
}

#badiet-root .badiet-note {
	font-size: 11px; line-height: 1.4; color: var(--badiet-muted);
	background: #fff; border: 1px dashed var(--badiet-line); border-radius: 10px;
	padding: 6px 10px; margin: 0 0 2px;
}
#badiet-root .badiet-note a { color: var(--badiet-dark); text-decoration: underline; }
