#asystent-fab {
	display: none;
	position: fixed;
	right: 16px;
	bottom: 18px;
	z-index: 40;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: #e3000f;
	color: #fff;
	font-size: 1.4em;
	cursor: pointer;
	box-shadow: 0 0 8px rgba(0,0,0,0.45);
}

body.pion #asystent-fab {
	bottom: 78px;
}

#asystent-fab.on {
	display: block;
}

#asystent-fab:active {
	background: #b0000c;
}

#asystent-panel {
	display: flex;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	position: fixed;
	right: 12px;
	bottom: 82px;
	z-index: 60;
	box-sizing: border-box;
	width: 420px;
	max-width: calc(100vw - 16px);
	height: min(70vh, 560px);
	max-height: calc(100dvh - 24px);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 0 12px rgba(0,0,0,0.45);
	flex-direction: column;
	overflow: hidden;
	font-family: "sofia sans condensed", "Open Sans", sans-serif;
	font-size: 13px;
	transform: translate3d(0, 20px, 0) scale(0.92);
	transform-origin: 100% 100%;
	transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.22s, width 0.28s ease;
}

#asystent-panel.open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: translate3d(0, 0, 0) scale(1);
}

html.asystent-open,
body.asystent-open {
	overscroll-behavior: none;
}

#asystent-tlo {
	display: none;
	position: fixed;
	z-index: 10040;
	left: 0;
	right: 0;
	top: -50vh;
	height: 200vh;
	background: #fff;
	touch-action: none;
}

body.asystent-open.asystent-mobilny #asystent-tlo {
	display: block;
}

body.asystent-open.asystent-mobilny #content,
body.asystent-open.asystent-mobilny #posiedzenie,
body.asystent-open.asystent-mobilny #news,
body.asystent-open.asystent-mobilny #glosowanie,
body.asystent-open.asystent-mobilny #dyskusja,
body.asystent-open.asystent-mobilny #ankieta,
body.asystent-open.asystent-mobilny #chat,
body.asystent-open.asystent-mobilny #notatka,
body.asystent-open.asystent-mobilny #iframe_parent {
	visibility: hidden !important;
	pointer-events: none !important;
}

body.asystent-klawiatura-on #menu_short {
	visibility: hidden !important;
	pointer-events: none !important;
}

@media (max-width: 720px) {
	#asystent-panel,
	#asystent-panel.open {
		left: var(--asystent-left, 0px);
		right: auto;
		top: var(--asystent-top, 0px);
		bottom: auto;
		width: var(--asystent-w, 100%) !important;
		max-width: 100% !important;
		height: var(--asystent-h, 100dvh) !important;
		max-height: none !important;
		border-radius: 0;
		transform: none;
		transform-origin: center center;
		transition: opacity 0.22s ease, visibility 0.22s;
	}
	#asystent-panel.open {
		z-index: 10050;
	}
	#asystent-panel .asystent-resize {
		display: none !important;
	}
}

body.pion #asystent-panel,
body.pion #asystent-panel.open {
	left: var(--asystent-left, 0px);
	right: auto;
	top: var(--asystent-top, 0px);
	bottom: auto;
	width: var(--asystent-w, 100%) !important;
	max-width: 100% !important;
	height: var(--asystent-h, calc(100dvh - 70px)) !important;
	max-height: none !important;
	border-radius: 0;
	transform: none;
	padding-top: env(safe-area-inset-top, 0px);
	transition: opacity 0.22s ease, visibility 0.22s;
}

body.pion #asystent-panel.open {
	z-index: 10050;
}

body.pion #asystent-panel.asystent-klawiatura {
	padding-top: 0;
}

body.pion #asystent-panel .asystent-resize {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	#asystent-panel {
		transition: none;
		transform: none;
	}
}

.asystent-resize {
	position: absolute;
	z-index: 3;
	background: transparent;
	touch-action: none;
}

.asystent-resize-n {
	top: 0;
	left: 16px;
	right: 0;
	height: 12px;
	cursor: ns-resize;
}

.asystent-resize-w {
	left: 0;
	top: 16px;
	bottom: 0;
	width: 12px;
	cursor: ew-resize;
}

.asystent-resize-nw {
	left: 0;
	top: 0;
	width: 20px;
	height: 20px;
	cursor: nwse-resize;
}

body.asystent-resizing,
body.asystent-resizing * {
	user-select: none !important;
	-webkit-user-select: none !important;
}

.asystent-head {
	background: #000;
	color: #fff;
	padding: 8px 10px;
	font-size: 14px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.asystent-head-left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 1;
}

.asystent-head-left span {
	white-space: nowrap;
}

#asystent-witaj {
	display: none;
}

#asystent-panel.asystent-witaj #asystent-witaj {
	display: flex;
	flex: 1;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	flex-direction: column;
	align-items: center;
	justify-content: safe center;
	text-align: center;
	padding: 28px 22px 16px;
	background: #fff;
}

#asystent-panel.asystent-witaj #asystent-log {
	display: none;
}

.asystent-witaj-ikona {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: 1px solid #e4e7ee;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	color: #243056;
	margin-bottom: 16px;
	flex-shrink: 0;
	background: #fff;
}

#asystent-witaj-tytul {
	margin: 0 0 8px;
	padding: 0;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
	color: #1c2434;
	background: transparent;
	text-transform: none;
	letter-spacing: 0;
}

#asystent-witaj-lead {
	margin: 0 0 18px;
	max-width: 280px;
	color: #7b8494;
	font-size: 14px;
	line-height: 1.45;
	font-weight: 400;
}

#asystent-chips {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 0;
	background: transparent;
	flex-shrink: 0;
}

#asystent-panel.asystent-klawiatura #asystent-witaj {
	display: none;
}

#asystent-panel.asystent-klawiatura.asystent-witaj #asystent-log {
	display: block;
}

#asystent-chips .asystent-chip {
	border: 1px solid #d5dbe3;
	background: #fff;
	color: #2c3444;
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 14px;
	line-height: 1.3;
	cursor: pointer;
	text-align: center;
	max-width: 100%;
	font-family: inherit;
}

#asystent-chips .asystent-chip:hover {
	border-color: #b7c0ce;
	background: #fafbfc;
}

#asystent-chips .asystent-chip:active {
	background: #e3000f;
	color: #fff;
	border-color: #e3000f;
}

.asystent-head-btns {
	display: flex;
	align-items: center;
	gap: 2px;
}

.asystent-head button {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 1em;
	cursor: pointer;
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 6px;
}

.asystent-head button:active,
.asystent-head button.ok {
	background: rgba(255,255,255,0.18);
}

#asystent-log {
	flex: 1;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 10px;
	background: #f4f4f4;
	font-size: 13px;
	line-height: 1.35;
	min-height: 0;
}

.asystent-msg {
	margin-bottom: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	max-width: 95%;
}

.asystent-msg.user {
	background: #e3000f;
	color: #fff;
	margin-left: auto;
}

.asystent-msg.bot {
	background: #fff;
	color: #111;
	border: 1px solid #ddd;
}

.asystent-msg.bot ul,
#asystent-log ul {
	list-style: disc !important;
	list-style-position: outside !important;
	display: block !important;
	margin: 6px 0 8px 0 !important;
	padding: 0 0 0 1.35em !important;
}

.asystent-msg.bot ol,
#asystent-log ol {
	list-style: decimal !important;
	list-style-position: outside !important;
	display: block !important;
	margin: 6px 0 8px 0 !important;
	padding: 0 0 0 1.45em !important;
}

.asystent-msg.bot li,
#asystent-log li {
	display: list-item !important;
	list-style: inherit !important;
	margin: 0 0 4px 0;
	padding: 0;
}

.asystent-msg.bot strong {
	font-weight: 700;
}

.asystent-msg.bot.stream::after {
	content: "▍";
	display: inline;
	margin-left: 1px;
	color: #e3000f;
	animation: asystent-caret 1s step-end infinite;
}

@keyframes asystent-caret {
	50% { opacity: 0; }
}

.asystent-msg.wait {
	background: #eee;
	color: #666;
	font-style: italic;
}

#asystent-form {
	display: flex;
	align-items: stretch;
	border-top: 1px solid #ccc;
	background: #fff;
	flex-shrink: 0;
	touch-action: manipulation;
}

#asystent-input {
	flex: 1;
	border: 0;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.35;
	min-height: 44px;
	outline: none;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
	cursor: text;
	touch-action: manipulation;
	-webkit-user-select: text;
	user-select: text;
}

#asystent-form button {
	border: 0;
	background: #e3000f;
	color: #fff;
	padding: 0 14px;
	cursor: pointer;
	font-weight: 600;
	min-width: 64px;
	font-size: 13px;
}

@media (max-width: 720px) {
	#asystent-form {
		min-height: 56px;
	}
	#asystent-input {
		min-height: 52px;
		padding: 16px 16px;
		font-size: 16px;
	}
	#asystent-form button {
		padding: 0 18px;
		font-size: 16px;
	}
}

body.pion #asystent-form {
	min-height: 56px;
}

body.pion #asystent-input {
	min-height: 52px;
	padding: 16px 16px;
	font-size: 16px;
}

body.pion #asystent-form button {
	padding: 0 18px;
	font-size: 16px;
}

.asystent-cialo {
	display: flex;
	flex: 1;
	min-height: 0;
	position: relative;
}

.asystent-main {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	min-height: 0;
}

#asystent-hist {
	width: 0;
	overflow: hidden;
	flex-shrink: 0;
	background: #f6f6f6;
	border-right: 0 solid #e4e4e4;
	display: flex;
	flex-direction: column;
	opacity: 0;
	pointer-events: none;
	min-height: 0;
	transition: width 0.28s ease, opacity 0.18s ease, border-width 0.28s ease;
}

#asystent-panel.hist-open #asystent-hist {
	width: 230px;
	opacity: 1;
	pointer-events: auto;
	border-right-width: 1px;
}

#asystent-hist-nowa {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 10px 10px 8px;
	padding: 8px 10px;
	border: 1px solid #d0d0d0;
	background: #fff;
	color: #222;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}

#asystent-hist-nowa:active {
	background: #eee;
}

#asystent-hist-lista {
	flex: 1;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	min-height: 0;
}

.asystent-hist-item {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: left;
	border: 0;
	background: transparent;
	padding: 8px 12px;
	cursor: pointer;
	border-bottom: 1px solid #ececec;
}

.asystent-hist-item:hover,
.asystent-hist-item.on {
	background: #ececec;
}

.asystent-hist-tytul {
	font-size: 13px;
	line-height: 1.3;
	color: #222;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.asystent-hist-czas {
	font-size: 11px;
	line-height: 1.3;
	color: #888;
	margin-top: 2px;
}

.asystent-hist-pusto {
	padding: 12px;
	font-size: 12px;
	color: #888;
	line-height: 1.35;
}

#asystent-hist-btn {
	flex-shrink: 0;
}

#asystent-hist-btn.on,
#asystent-panel.hist-open #asystent-hist-btn {
	background: rgba(255,255,255,0.18);
}

@media (max-width: 720px) {
	#asystent-hist {
		position: absolute;
		left: 0;
		top: 0;
		bottom: 0;
		z-index: 5;
		height: auto;
		box-shadow: none;
	}
	#asystent-panel.hist-open #asystent-hist {
		width: min(260px, 78%);
		box-shadow: 8px 0 18px rgba(0,0,0,0.15);
	}
}

body.pion #asystent-hist {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	z-index: 5;
	height: auto;
}

body.pion #asystent-panel.hist-open #asystent-hist {
	width: min(260px, 78%);
	box-shadow: 8px 0 18px rgba(0,0,0,0.15);
}

@media (prefers-reduced-motion: reduce) {
	#asystent-hist,
	#asystent-panel.hist-open #asystent-hist {
		transition: none;
	}
}
