.nctde-chatbot {
	--nctde-chat-accent: #0d4f86;
	--nctde-chat-navy: #082a4c;
	--nctde-chat-red: #d71920;
	--nctde-chat-gold: #e9ad2f;
	--nctde-chat-ink: #13253a;
	--nctde-chat-muted: #637286;
	--nctde-chat-line: #e3e9ef;
	--nctde-chat-soft: #f4f7fa;
	position: fixed;
	z-index: 2147483000;
	inset-inline-end: max(20px, env(safe-area-inset-right));
	bottom: max(20px, env(safe-area-inset-bottom));
	font-family: "Tajawal", "Cairo", Tahoma, Arial, sans-serif;
	color: var(--nctde-chat-ink);
	direction: rtl;
	text-align: right;
	line-height: 1.65;
}

.nctde-chatbot,
.nctde-chatbot * {
	box-sizing: border-box;
}

.nctde-chatbot .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.nctde-chatbot button,
.nctde-chatbot input {
	font: inherit;
}

.nctde-chatbot button {
	-webkit-tap-highlight-color: transparent;
}

.nctde-chatbot__launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 60px;
	height: 60px;
	padding: 0 17px;
	border: 0;
	border-radius: 18px 18px 6px 18px;
	background: linear-gradient(140deg, var(--nctde-chat-accent), var(--nctde-chat-navy));
	color: #fff;
	box-shadow: 0 16px 40px rgba(8, 42, 76, 0.28);
	cursor: pointer;
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.nctde-chatbot__launcher:hover {
	transform: translateY(-3px);
	box-shadow: 0 20px 46px rgba(8, 42, 76, 0.34);
}

.nctde-chatbot__launcher:focus-visible,
.nctde-chatbot__close:focus-visible,
.nctde-chatbot__quick button:focus-visible,
.nctde-chatbot__composer button:focus-visible,
.nctde-chatbot__composer input:focus-visible,
.nctde-chatbot__route select:focus-visible,
.nctde-chatbot__route-submit:focus-visible,
.nctde-chatbot__links a:focus-visible {
	outline: 3px solid rgba(233, 173, 47, 0.9);
	outline-offset: 3px;
}

.nctde-chatbot__launcher svg {
	position: relative;
	z-index: 1;
	width: 27px;
	height: 27px;
	fill: currentColor;
}

.nctde-chatbot__launcher-label {
	position: relative;
	z-index: 1;
	font-size: 14px;
	font-weight: 800;
}

.nctde-chatbot__launcher-ring {
	position: absolute;
	inset: 6px auto auto 7px;
	width: 9px;
	height: 9px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--nctde-chat-red);
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.nctde-chatbot__panel {
	position: absolute;
	inset-inline-end: 0;
	bottom: 76px;
	display: grid;
	grid-template-rows: auto minmax(170px, 1fr) auto auto auto;
	width: min(390px, calc(100vw - 32px));
	height: min(650px, calc(100vh - 120px));
	min-height: 430px;
	overflow: hidden;
	border: 1px solid rgba(8, 42, 76, 0.1);
	border-radius: 24px 24px 8px 24px;
	background: #fff;
	box-shadow: 0 28px 80px rgba(8, 42, 76, 0.26);
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.98);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.nctde-chatbot.is-open .nctde-chatbot__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.nctde-chatbot.is-open .nctde-chatbot__launcher-label {
	display: none;
}

.nctde-chatbot.is-open .nctde-chatbot__launcher {
	min-width: 60px;
	padding: 0 16px;
}

.nctde-chatbot__header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 78px;
	padding: 14px 16px;
	overflow: hidden;
	background:
		linear-gradient(90deg, rgba(215, 25, 32, 0.98) 0 11%, transparent 11%),
		linear-gradient(135deg, var(--nctde-chat-navy), var(--nctde-chat-accent));
	color: #fff;
}

.nctde-chatbot__header::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 3px;
	background: linear-gradient(90deg, var(--nctde-chat-red) 0 35%, var(--nctde-chat-gold) 35% 56%, #fff 56%);
}

.nctde-chatbot__identity {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
}

.nctde-chatbot__identity > span:last-child {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.nctde-chatbot__identity strong {
	overflow: hidden;
	font-size: 15px;
	font-weight: 800;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.nctde-chatbot__identity small {
	color: rgba(255, 255, 255, 0.78);
	font-size: 11px;
}

.nctde-chatbot__avatar {
	position: relative;
	display: grid;
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	place-items: center;
	border: 2px solid rgba(255, 255, 255, 0.72);
	border-radius: 15px;
	background: #fff;
	box-shadow: 0 7px 20px rgba(0, 0, 0, 0.18);
}

.nctde-chatbot__avatar img {
	display: block;
	width: 40px;
	height: 40px;
	object-fit: contain;
}

.nctde-chatbot__avatar i {
	position: absolute;
	inset: auto auto -2px -2px;
	width: 12px;
	height: 12px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #2dcc70;
}

.nctde-chatbot__close {
	position: relative;
	z-index: 1;
	display: grid;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 12px;
	place-items: center;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	cursor: pointer;
}

.nctde-chatbot__close svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.nctde-chatbot__body {
	overflow-x: hidden;
	overflow-y: auto;
	padding: 18px 14px 12px;
	background:
		linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
		repeating-linear-gradient(135deg, rgba(8, 42, 76, 0.045) 0 1px, transparent 1px 13px);
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}

.nctde-chatbot__bubble--schools {
	width: 100%;
	max-width: 100%;
	padding: 14px;
}

.nctde-chatbot__schools-title {
	display: block;
	color: var(--nctde-chat-navy);
	font-size: 14px;
	font-weight: 800;
}

.nctde-chatbot__schools-intro {
	display: block;
	margin-top: 2px;
	color: var(--nctde-chat-muted);
	font-size: 11px;
}

.nctde-chatbot__schools {
	display: grid;
	gap: 10px;
	margin-top: 12px;
}

.nctde-chatbot__school-card {
	overflow: hidden;
	border: 1px solid var(--nctde-chat-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 5px 16px rgba(8, 42, 76, 0.06);
}

.nctde-chatbot__school-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 11px;
	border-bottom: 1px solid var(--nctde-chat-line);
	background: linear-gradient(90deg, rgba(13, 79, 134, 0.08), rgba(13, 79, 134, 0.02));
}

.nctde-chatbot__school-head b {
	color: var(--nctde-chat-navy);
	font-size: 12px;
	line-height: 1.5;
}

.nctde-chatbot__gender {
	flex: none;
	padding: 3px 7px;
	border-radius: 999px;
	background: #edf2f7;
	color: #526174;
	font-size: 9px;
	font-weight: 800;
	white-space: nowrap;
}

.nctde-chatbot__gender--male {
	background: #e7f1fb;
	color: #145c92;
}

.nctde-chatbot__gender--female {
	background: #f9eaf1;
	color: #983b66;
}

.nctde-chatbot__gender--both {
	background: #e9f6ef;
	color: #237048;
}

.nctde-chatbot__specialties {
	display: grid;
	gap: 0;
	padding: 2px 11px;
}

.nctde-chatbot__specialty {
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding: 8px 0;
	border-bottom: 1px dashed #e3e9ef;
}

.nctde-chatbot__specialty:last-child {
	border-bottom: 0;
}

.nctde-chatbot__specialty span {
	color: var(--nctde-chat-ink);
	font-size: 11px;
	font-weight: 700;
}

.nctde-chatbot__specialty small {
	color: var(--nctde-chat-muted);
	font-size: 9px;
}

.nctde-chatbot__school-empty {
	margin: 0;
	padding: 10px 11px;
	color: var(--nctde-chat-muted);
	font-size: 10px;
}

.nctde-chatbot__message {
	display: flex;
	margin: 0 0 10px;
}

.nctde-chatbot__message--bot {
	justify-content: flex-start;
}

.nctde-chatbot__message--user {
	justify-content: flex-end;
}

.nctde-chatbot__bubble {
	width: fit-content;
	max-width: 88%;
	padding: 11px 13px;
	border: 1px solid var(--nctde-chat-line);
	border-radius: 16px 16px 5px 16px;
	background: #fff;
	box-shadow: 0 7px 20px rgba(8, 42, 76, 0.06);
	color: var(--nctde-chat-ink);
	font-size: 13px;
	word-break: break-word;
}

.nctde-chatbot__message--user .nctde-chatbot__bubble {
	border-color: transparent;
	border-radius: 16px 16px 16px 5px;
	background: var(--nctde-chat-accent);
	color: #fff;
	box-shadow: 0 7px 20px color-mix(in srgb, var(--nctde-chat-accent) 22%, transparent);
}

.nctde-chatbot__bubble p {
	margin: 0;
}

.nctde-chatbot__bubble p + p {
	margin-top: 9px;
}

.nctde-chatbot__links {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 10px;
}

.nctde-chatbot__links a {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 6px 10px;
	border: 1px solid color-mix(in srgb, var(--nctde-chat-accent) 28%, #fff);
	border-radius: 10px;
	background: color-mix(in srgb, var(--nctde-chat-accent) 7%, #fff);
	color: var(--nctde-chat-accent);
	font-size: 11px;
	font-weight: 800;
	text-decoration: none;
}

.nctde-chatbot__bubble--picker {
	width: min(100%, 326px);
	max-width: 96%;
	padding: 0;
	overflow: hidden;
	border-color: rgba(13, 79, 134, 0.2);
	background:
		linear-gradient(135deg, rgba(13, 79, 134, 0.06), transparent 52%),
		#fff;
}

.nctde-chatbot__picker-kicker {
	display: block;
	padding: 10px 13px;
	border-bottom: 1px solid var(--nctde-chat-line);
	background: var(--nctde-chat-navy);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.01em;
}

.nctde-chatbot__route {
	position: relative;
	display: grid;
	gap: 10px;
	padding: 13px;
}

.nctde-chatbot__route::before {
	content: "";
	position: absolute;
	inset: 40px 24px 40px auto;
	width: 2px;
	background: linear-gradient(var(--nctde-chat-red), var(--nctde-chat-gold));
	opacity: 0.55;
}

.nctde-chatbot__route-step {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px;
}

.nctde-chatbot__route-step > span {
	display: flex;
	align-items: center;
	gap: 7px;
	color: var(--nctde-chat-ink);
	font-size: 11px;
	font-weight: 800;
}

.nctde-chatbot__route-step > span b {
	display: grid;
	width: 23px;
	height: 23px;
	border: 2px solid #fff;
	border-radius: 50%;
	place-items: center;
	background: var(--nctde-chat-accent);
	box-shadow: 0 0 0 1px rgba(13, 79, 134, 0.2);
	color: #fff;
	font-size: 10px;
}

.nctde-chatbot__route select {
	width: 100%;
	min-height: 42px;
	padding: 7px 10px;
	border: 1px solid var(--nctde-chat-line);
	border-radius: 10px;
	background: #fff;
	color: var(--nctde-chat-ink);
	font: inherit;
	font-size: 12px;
	outline: 0;
}

.nctde-chatbot__route select:disabled {
	background: #f0f3f6;
	color: #8a96a3;
	cursor: not-allowed;
}

.nctde-chatbot__route-submit {
	width: calc(100% - 26px);
	min-height: 42px;
	margin: 0 13px 13px;
	padding: 8px 12px;
	border: 0;
	border-radius: 11px;
	background: linear-gradient(135deg, var(--nctde-chat-accent), var(--nctde-chat-navy));
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	cursor: pointer;
}

.nctde-chatbot__route-submit:disabled {
	background: #c7d0d9;
	cursor: not-allowed;
}

.nctde-chatbot__typing .nctde-chatbot__bubble {
	display: flex;
	gap: 4px;
	padding-block: 14px;
}

.nctde-chatbot__typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--nctde-chat-muted);
	animation: nctde-chat-typing 900ms ease-in-out infinite;
}

.nctde-chatbot__typing i:nth-child(2) {
	animation-delay: 120ms;
}

.nctde-chatbot__typing i:nth-child(3) {
	animation-delay: 240ms;
}

.nctde-chatbot__quick {
	display: flex;
	gap: 7px;
	overflow-x: auto;
	padding: 10px 12px;
	border-top: 1px solid var(--nctde-chat-line);
	background: #fff;
	scrollbar-width: thin;
}

.nctde-chatbot__quick button {
	flex: 0 0 auto;
	min-height: 35px;
	padding: 7px 11px;
	border: 1px solid color-mix(in srgb, var(--nctde-chat-accent) 26%, #fff);
	border-radius: 999px;
	background: #fff;
	color: var(--nctde-chat-accent);
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
	transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nctde-chatbot__quick button:hover {
	transform: translateY(-1px);
	background: var(--nctde-chat-accent);
	color: #fff;
}

.nctde-chatbot__composer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 44px;
	gap: 8px;
	padding: 10px 12px 8px;
	border-top: 1px solid var(--nctde-chat-line);
	background: #fff;
}

.nctde-chatbot__composer input {
	width: 100%;
	height: 44px;
	padding: 0 13px;
	border: 1px solid var(--nctde-chat-line);
	border-radius: 12px;
	background: var(--nctde-chat-soft);
	color: var(--nctde-chat-ink);
	font-size: 13px;
	outline: 0;
}

.nctde-chatbot__composer input::placeholder {
	color: #8290a0;
}

.nctde-chatbot__composer input:focus {
	border-color: var(--nctde-chat-accent);
	background: #fff;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--nctde-chat-accent) 11%, transparent);
}

.nctde-chatbot__composer button {
	display: grid;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	place-items: center;
	background: var(--nctde-chat-accent);
	color: #fff;
	cursor: pointer;
}

.nctde-chatbot__composer button svg {
	width: 21px;
	height: 21px;
	fill: currentColor;
	transform: scaleX(-1);
}

.nctde-chatbot__privacy {
	margin: 0;
	padding: 0 12px 9px;
	background: #fff;
	color: var(--nctde-chat-muted);
	font-size: 9px;
	text-align: center;
}

@keyframes nctde-chat-typing {
	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: 0.45;
	}
	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

@media (max-width: 560px) {
	.nctde-chatbot {
		inset-inline: 12px;
		bottom: max(12px, env(safe-area-inset-bottom));
	}

	.nctde-chatbot__launcher {
		margin-inline-start: auto;
	}

	.nctde-chatbot__panel {
		position: fixed;
		inset: 12px 12px calc(84px + env(safe-area-inset-bottom));
		width: auto;
		height: auto;
		min-height: 0;
		border-radius: 22px 22px 8px 22px;
	}

	.nctde-chatbot__bubble {
		max-width: 92%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nctde-chatbot__launcher,
	.nctde-chatbot__panel,
	.nctde-chatbot__quick button,
	.nctde-chatbot__typing i {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
