:root {
	--pde: #289DCC;
	--bg: #f9fafb;
	--line: #e5e7eb;
	--text: #111827;
	--muted: #6b7280;
	--pde-chat-tabs-height: 58px;
}

* {
	box-sizing: border-box;
}

html {
	margin: 0 !important;
	margin-top: 0 !important;
	padding: 0 !important;
	padding-top: 0 !important;
	top: 0 !important;
	scroll-padding-top: 0 !important;
}

html:root {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.pde-chat-app,
.pde-chat-app {
	position: relative;
	top: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
	background: var(--bg);
	color: var(--text);
	flex-direction: column;
}

body.pde-chat-app--embed,
.pde-chat-app--embed {
	display: block;
	min-height: 0;
	height: auto;
	overflow: visible;
	--pde-chat-tabs-height: 0px;
}

.pde-chat-app--inline {
	width: 100%;
	max-width: 100%;
	overflow: visible;
}

body.pde-chat-app--standalone {
	display: flex;
	min-height: 100vh;
	height: 100dvh;
	overflow: hidden;
}

body.pde-chat-app.admin-bar {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

#wpadminbar {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	top: auto !important;
	overflow: hidden !important;
}

html[style*="margin-top"] {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.chat-app-topbar {
	background: var(--pde);
	color: #fff;
	display: block;
	margin: 0 !important;
	padding: 0 !important;
	position: relative !important;
	top: auto !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	height: var(--pde-chat-tabs-height);
	min-height: var(--pde-chat-tabs-height);
	z-index: 10000;
	transform: none !important;
	overflow: hidden;
}

.search-bar {
	display: none !important;
}

body.pde-chat-app #content,
.pde-chat-content {
	display: flex;
	flex-direction: column;
	min-height: 0;
	margin: 0 !important;
	padding: 0 !important;
	background: #fff;
}

body.pde-chat-app--embed #content,
.pde-chat-app--embed .pde-chat-content {
	flex: 0 0 auto;
	overflow-y: visible;
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.pde-chat-app--inline .pde-chat-content {
	overflow: visible !important;
}

body.pde-chat-app--standalone #content {
	flex: 1 1 auto;
	overflow-y: auto;
}

body.pde-chat-app--standalone #content:has(.thread-shell) {
	overflow-y: hidden;
}

.chat-app-topbar-tabs {
	display: flex;
	height: 100%;
	padding-top: 0;
	margin: 0;
	overflow: hidden;
}

.chat-app-topbar-tab {
	flex: 1;
	box-sizing: border-box;
	min-width: 0;
	min-height: var(--pde-chat-tabs-height);
	padding: 7px 5px 10px;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.2;
	color: rgba(255, 255, 255, .7);
	cursor: pointer;
	position: relative;
}

.chat-app-topbar-tab.active {
	color: #fff;
}

.chat-app-topbar-tab .tab-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	position: relative;
	z-index: 1;
}

.chat-app-topbar-tab .tab-icon {
	display: block;
	font-size: 18px;
	line-height: 1;
}

.chat-app-topbar-tab .tab-title {
	display: block;
	max-width: 100%;
	overflow: visible;
	white-space: normal;
	line-height: 1.1;
}

.chat-app-topbar-tab .tab-underline {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: var(--underline-width, 0);
	height: 3px;
	background: #fff;
	border-radius: 6px 6px 0 0;
	display: none;
}

.chat-app-topbar-tab.active .tab-underline {
	display: block;
}

.tab-badge {
	position: absolute;
	top: 6px;
	right: calc(50% - 32px);
	min-width: 10px;
	height: 10px;
	background: #ef4444;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .85);
	box-shadow: 0 0 0 2px rgba(40, 157, 204, .4);
	display: none;
}

.tab-badge.show {
	display: inline-block;
}

.tab-badge--count {
	top: 4px;
	right: calc(50% - 38px);
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	display: none;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	color: #fff;
	background: #e11d48;
	border: 2px solid rgba(255, 255, 255, .95);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

.tab-badge--count.show {
	display: inline-flex;
}

.ia-pane {
	min-height: 100%;
	height: 100%;
	background: #fff;
	padding: 16px;
	margin-top: 5px;
}

.ia-root,
.ia-root:empty,
.ia-root > .mwai-chatbot-container,
.ia-root > .mwai-chatbot {
	min-height: 70vh;
}

.ia-root iframe {
	width: 100%;
}

.search-bar.active {
	display: block;
}

.search-bar .pde-search-bar {
	width: 99%;
}

.list-shell {
	background: #fff;
	margin-top: 5px;
}

.list-search {
	position: sticky;
	top: 0;
	z-index: 5;
	padding: 10px 14px;
	background: #fff;
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	gap: 10px;
}

.pde-chat-app--embed .list-search {
	padding-top: 0;
}

.list-search .pde-search-bar {
	flex: 1 1 auto;
	width: 100%;
}

.list-search-create {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: var(--pde);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(40, 157, 204, .22);
	padding: 0;
}

.list {
	background: #fff;
}

.thread-shell {
	display: flex;
	flex: 1 1 auto;
	width: 100%;
	max-width: 100%;
	height: var(--thread-viewport-height, 100%);
	min-height: 0;
	background: #fff;
	overflow: hidden;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 0;
}

.pde-chat-app--inline .thread-shell:not(.thread-shell--auto) {
	height: var(--thread-viewport-height, 100dvh);
	min-height: 100dvh;
	overflow: visible;
}

.thread-shell.thread-shell--auto {
	display: block;
	height: auto;
	overflow: visible;
}

.pde-chat-app--embed .thread-shell,
.pde-chat-app--embed .creator-shell,
.pde-chat-app--embed .ia-pane {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.pde-chat-app--embed .ia-pane {
	margin-top: 5px !important;
}

.thread-frame {
	display: block;
	flex: 1 1 auto;
	width: 100%;
	max-width: 100%;
	height: 100%;
	min-height: 0;
	border: 0;
	background: #fff;
	margin: 0 !important;
	padding: 0 !important;
	vertical-align: top;
}

.pde-chat-app--inline .thread-shell:not(.thread-shell--auto) .thread-frame {
	height: 100%;
	min-height: 100dvh;
}

.thread-shell.thread-shell--auto .thread-frame {
	height: auto;
	overflow: hidden;
}

.creator-shell {
	width: 100%;
	background: #fff;
}

.creator-frame {
	display: block;
	width: 100%;
	min-height: 100px;
	border: 0;
	background: #fff;
}

.salon {
	display: flex;
	align-items: flex-start;
	padding: 12px 16px;
	border-bottom: 1px solid var(--line);
	cursor: pointer;
}

.pde-chat-app .salon {
	display: flex !important;
	align-items: flex-start !important;
	width: 100%;
	min-width: 0;
	color: var(--text);
}

.salon:hover {
	background: #f9fafb;
}

.salon > img,
.salon-avatar-wrap > img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 12px;
}

.salon-avatar-wrap {
	position: relative;
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	margin-right: 12px;
}

.salon-avatar-wrap > img {
	display: block;
	margin-right: 0;
}

.salon-avatar-badge.pde-badge {
	position: absolute !important;
	top: 0 !important;
	right: 0 !important;
	min-width: 22px !important;
	height: 22px !important;
	padding: 0 6px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 999px !important;
	font-size: 12px !important;
	font-weight: 800 !important;
	color: #fff !important;
	background: #e11d48 !important;
	transform: translate(40%, -40%) !important;
	border: 2px solid #fff !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .2) !important;
	z-index: 2 !important;
	line-height: 1 !important;
}

@media (max-width: 600px) {
	.salon-avatar-badge.pde-badge {
		height: 18px !important;
		min-width: 18px !important;
		font-size: 11px !important;
		padding: 0 5px !important;
		transform: translate(35%, -35%) !important;
	}
}

.salon-body {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.pde-chat-app .salon-body {
	display: block !important;
	flex: 1 1 auto !important;
	min-width: 0 !important;
	overflow: hidden !important;
}

.salon-name {
	display: block;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.35;
}

.salon-last {
	display: block;
	font-size: 13px;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.35;
	margin-top: 3px;
}

.pde-chat-app .salon-name,
.pde-chat-app .salon-last {
	visibility: visible !important;
	opacity: 1 !important;
	max-width: 100% !important;
	line-height: 1.35 !important;
	text-indent: 0 !important;
	transform: none !important;
}

.pde-chat-app .salon-name {
	color: var(--text) !important;
	font-weight: 600 !important;
}

.pde-chat-app .salon-last {
	color: var(--muted) !important;
}

.salon-time {
	font-size: 12px;
	color: var(--muted);
	margin-left: 8px;
	white-space: nowrap;
}

.salon-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	min-width: 72px;
}

.salon-meta--group {
	flex: 0 0 auto;
	min-width: 0;
	margin-left: 8px;
	gap: 5px;
}

.salon-meta--group .salon-time {
	margin-left: 0;
}

.unblock-btn {
	border: none;
	background: #ef4444;
	color: #fff;
	padding: 6px 10px;
	border-radius: 10px;
	font-weight: 700;
	cursor: pointer;
}

.badge-unread {
	background: #f97316;
	color: #fff;
	border-radius: 12px;
	min-width: 22px;
	padding: 2px 8px;
	font-weight: 700;
	font-size: 12px;
	text-align: center;
}

.badge-unread--count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	line-height: 1;
}

.placeholder {
	padding: 32px 16px;
	text-align: center;
	color: var(--muted);
}

.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9000;
}

.modal {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 38px rgba(0, 0, 0, .32);
	padding: 18px;
	max-width: 90vw;
	width: 340px;
}

.modal h3 {
	margin: 0 0 8px;
	font-size: 17px;
}

.modal p {
	margin: 0 0 14px;
	color: #374151;
	line-height: 1.5;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 16px;
}

.modal-actions button {
	border: none;
	border-radius: 10px;
	padding: 9px 12px;
	font-weight: 700;
	cursor: pointer;
}

.modal-actions .primary {
	background: var(--pde);
	color: #fff;
}

.modal-actions .ghost {
	background: #e5e7eb;
	color: #111827;
}

.modal-actions .danger {
	background: #ef4444;
	color: #fff;
}

.department-modal-overlay {
	z-index: 12000;
}

.department-modal {
	width: min(92vw, 420px);
}

.department-select {
	width: 100%;
	min-height: 44px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--text);
	font: inherit;
	padding: 9px 12px;
}

.department-error {
	min-height: 18px;
	margin-top: 8px;
	color: #dc2626;
	font-size: 13px;
	font-weight: 600;
}

.department-modal .modal-actions button:disabled {
	cursor: not-allowed;
	opacity: .65;
}

.modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	border: none;
	background: none;
	font-size: 18px;
	cursor: pointer;
	color: #6b7280;
}

.modal-title-center {
	text-align: center;
	margin-top: 4px;
}

.modal-footer-center {
	text-align: center;
	margin: 16px 0 0;
	font-weight: 600;
	color: #374151;
}

.modal-body {
	white-space: pre-line;
}
