/* ===== CiCi Chat Layout ===== */
.cici-container {
	--cici-font-scale: 100%;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #f4f7fb;
	overflow: hidden;
	position: relative;
	container-type: inline-size;
	container-name: cici;
}
.cici-container.cici-busy {
	pointer-events: none;
}
.cici-container.cici-busy .cici-chat-area {
	opacity: 0.5;
	transition: opacity 0.2s ease;
}

/* Header */
.cici-header {
	background: linear-gradient(135deg, #1b3a5c 0%, #2563a0 60%, #3b82d6 100%);
	color: #fff;
	padding: 14px 20px;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(27,58,92,0.18);
	cursor: pointer;
}
.cici-header-top {
	display: flex;
	align-items: center;
	gap: 10px;
}
.cici-model-label {
	font-size: 0.8rem;
	font-weight: 600;
	color: rgba(255,255,255,0.92);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	user-select: none;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Gear icon button to open the model set picker popup */
.cici-model-switch-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 5px;
	background: rgba(255,255,255,0.10);
	color: rgba(255,255,255,0.88);
	font-size: 0.65rem;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, transform 0.2s;
	flex-shrink: 0;
}
.cici-model-switch-btn:hover {
	background: rgba(255,255,255,0.28);
	border-color: rgba(255,255,255,0.50);
	transform: rotate(30deg);
}
.cici-model-switch-btn:active {
	background: rgba(255,255,255,0.35);
}
.cici-model-switch-btn.hidden {
	display: none;
}

/* ===== Model Set Picker Popup ===== */
.cici-model-picker-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 8px 4px;
}
.cici-model-card {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border: 2px solid #e0e6ed;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cici-model-card:hover {
	border-color: #2563a0;
	box-shadow: 0 2px 8px rgba(37,99,160,0.12);
	background: #f0f6fc;
}
.cici-model-card-active {
	border-color: #2563a0;
	background: #f0f6fc;
}
.cici-model-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: linear-gradient(135deg, #1b3a5c 0%, #2563a0 100%);
	color: #fff;
	font-size: 1rem;
	flex-shrink: 0;
}
.cici-model-card-body {
	flex: 1;
	min-width: 0;
}
.cici-model-card-title {
	font-size: 0.85rem;
	font-weight: 600;
	color: #1b3a5c;
	margin-bottom: 2px;
}
.cici-model-card-desc {
	font-size: 0.75rem;
	color: #5a6e82;
	line-height: 1.35;
}
.cici-model-card-check {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: #2563a0;
	font-size: 0.9rem;
	flex-shrink: 0;
	margin-top: 6px;
}
.cici-header .cici-subtitle {
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.92;
	flex: 1;
	min-width: 0;
}

/* Header toolbar — font-size controls on the right of header-top */
.cici-toolbar {
	display: flex;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
	margin-left: auto;
}
.cici-toolbar-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 5px;
	background: rgba(255,255,255,0.10);
	color: #fff;
	font-size: 0.65rem;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.cici-toolbar-btn:hover {
	background: rgba(255,255,255,0.28);
	border-color: rgba(255,255,255,0.50);
}
.cici-toolbar-btn:active {
	background: rgba(255,255,255,0.35);
}
.cici-toolbar-btn.cici-toolbar-btn-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}
.cici-font-size-label {
	font-size: 0.7rem;
	font-weight: 600;
	min-width: 32px;
	text-align: center;
	opacity: 0.88;
	user-select: none;
}

/* Header command buttons (expanded by default, toggled via header click or help FAB) */
.cici-quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-height: 200px;
	overflow: hidden;
	opacity: 1;
	transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
	margin-top: 10px;
}
/* Inline vertical divider between sort groups (e.g., general vs patient commands) */
.cici-quick-actions-divider {
	width: 2px;
	align-self: stretch;
	background: rgba(255,255,255,0.35);
	margin: 2px 4px;
	border-radius: 1px;
}
.cici-quick-actions.collapsed {
	max-height: 0;
	opacity: 0;
	margin-top: 0;
}
.cici-quick-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 8px 10px 6px;
	min-width: 64px;
	background: rgba(255,255,255,0.12);
	border: 1px solid rgba(255,255,255,0.22);
	border-radius: 8px;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, transform 0.1s;
	line-height: 1.2;
}
.cici-quick-action i {
	font-size: 1.05rem;
}
.cici-quick-action:hover {
	background: rgba(255,255,255,0.24);
	border-color: rgba(255,255,255,0.45);
	transform: translateY(-1px);
}
.cici-quick-action:active {
	transform: translateY(0);
	background: rgba(255,255,255,0.3);
}
.cici-quick-action.cici-ai-toggle.active {
	background: rgba(83,181,86,0.35);
	border-color: rgba(83,181,86,0.6);
}

/* Streaming cursor animation */
.cici-cursor {
	animation: cici-blink 0.8s step-end infinite;
	color: #2563a0;
}
@keyframes cici-blink {
	50% { opacity: 0; }
}

/* Chat area — Kendo Chat widget overrides */
.cici-chat-area {
	flex: 1;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #f8fafd;
	position: relative;
}

/* Floating help button */
.cici-help-fab {
	position: absolute;
	bottom: 60px;
	right: 14px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, #2563a0, #3b82d6);
	color: #fff;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(37,99,160,0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s, box-shadow 0.15s;
	z-index: 1;
	opacity: 0.85;
}
.cici-help-fab:hover {
	transform: scale(1.1);
	box-shadow: 0 3px 12px rgba(37,99,160,0.4);
	opacity: 1;
}
.cici-chat-area .cici-chat-widget {
	width: 100%;
	height: 100%;
}
.cici-chat-area .k-chat {
	border: none;
	width: 100%;
	height: 100%;
	max-width: none;
	background: #f8fafd;
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
	font-size: var(--cici-font-scale);
	position: relative;
}
.cici-chat-area .k-chat .k-message-list {
	padding: 10px 16px;
	background: #f8fafd;
	position: relative;
}
.cici-chat-area .k-chat .k-message-list::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 220px;
	height: 220px;
	transform: translate(-50%, -50%);
	background: url('/Images/Lightning-Logo.png') no-repeat center center;
	background-size: contain;
	opacity: 0.04;
	pointer-events: none;
	z-index: 0;
}
.cici-chat-area .k-chat .k-message-box {
	border-top: 1px solid #dce4ef;
	background: #fff;
	width: 100%;
	box-sizing: border-box;
}
.cici-chat-area .k-chat .k-message-box .k-input {
	width: 100%;
	box-sizing: border-box;
}

/* ===== Dot Phrase Popup ===== */
.cici-dotphrase-popup {
	display: none;
	position: absolute;
	bottom: 46px;
	left: 0;
	right: 0;
	max-height: 14em;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #d0daea;
	border-bottom: none;
	box-shadow: 0 -2px 8px rgba(37,99,160,0.10);
	z-index: 10;
}
.cici-dotphrase-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 8px;
	background: #f1f5f9;
	border-bottom: 1px solid #e2e8f0;
	position: sticky;
	top: 0;
	z-index: 1;
}
.cici-dotphrase-header-label {
	font-size: 0.72em;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.cici-dotphrase-dismiss {
	background: none;
	border: none;
	padding: 2px 4px;
	cursor: pointer;
	color: #94a3b8;
	font-size: 0.8em;
	line-height: 1;
	border-radius: 3px;
	transition: color 0.12s, background 0.12s;
}
.cici-dotphrase-dismiss:hover {
	color: #dc2626;
	background: #fee2e2;
}
.cici-dotphrase-item {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
	padding: 0.45em 0.7em;
	cursor: pointer;
	transition: background 0.1s;
	font-size: 0.88em;
	border-bottom: 1px solid #f0f3f7;
}
.cici-dotphrase-item:last-child {
	border-bottom: none;
}
.cici-dotphrase-item:hover {
	background: #f4f7fb;
}
.cici-dotphrase-item-selected {
	background: #e8f0fe;
}
.cici-dotphrase-phrase {
	font-weight: 600;
	color: #2563a0;
	font-family: 'Consolas', 'Courier New', monospace;
	white-space: nowrap;
}
.cici-dotphrase-label {
	color: #64748b;
	font-size: 0.9em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Bot message bubbles */
.cici-chat-area .k-chat .k-other .k-bubble {
	background: #fff;
	border: 1px solid #dce4ef;
	color: #1e293b;
	box-shadow: 0 1px 3px rgba(37,99,160,0.06);
}

/* ===== Welcome message — first bot bubble per session ===== */
.cici-welcome-greeting {
	margin-bottom: 12px;
}
.cici-welcome-subtitle {
	margin-bottom: 8px;
}
.cici-welcome-list {
	margin: 0 0 12px 8px;
	padding-left: 12px;
	list-style: none;
}
.cici-welcome-list li {
	padding: 2px 0;
}
.cici-welcome-list li i {
	width: 1.1em;
	text-align: center;
	margin-right: 6px;
	opacity: 0.7;
}

/* ===== .ciciResponse — Markdig-rendered bot response content ===== */
/* Compact chat-bubble typography with Bootstrap-aligned colours. */

.ciciResponse {
	font-family: inherit;
	font-size: inherit;
	line-height: 1.15;
	color: #212529;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* ---- Paragraphs ---- */
.ciciResponse p { margin: 0; }

/* ---- Headings ---- */
.ciciResponse h1,
.ciciResponse h2,
.ciciResponse h3,
.ciciResponse h4,
.ciciResponse h5,
.ciciResponse h6 {
	font-weight: 600;
	color: #1b3a5c;
	line-height: 1.15;
	margin: 0.2em 0 0;
	padding-bottom: 0.05em;
	border-bottom: 2px solid #2563a0;
}
.ciciResponse > :first-child { margin-top: 0; }
.ciciResponse h1 { font-size: 1.15em; }
.ciciResponse h2 { font-size: 1.08em; }
.ciciResponse h3 { font-size: 1.02em; }
.ciciResponse h4,
.ciciResponse h5,
.ciciResponse h6 { font-size: 0.95em; color: #495057; border-bottom-color: #adb5bd; }

/* Bold-only paragraphs — the AI uses <p><strong>Label:</strong></p> as pseudo-headings. */
.ciciResponse p > strong:only-child {
	display: inline-block;
	color: #1b3a5c;
}

/* ---- Bold / italic ---- */
.ciciResponse strong { font-weight: 600; }
.ciciResponse em     { font-style: italic; }

/* ---- Links ---- */
.ciciResponse a { color: #0d6efd; text-decoration: none; }
.ciciResponse a:hover { text-decoration: underline; color: #0a58ca; }

/* ---- Lists ---- */
.ciciResponse ul,
.ciciResponse ol {
	margin: 0 !important;
	padding-left: 1.4em;
}
.ciciResponse li {
	margin: 0 !important;
	padding: 0;
	line-height: 1.15;
}
.ciciResponse li > p {
	margin: 0;
	display: contents;
}
.ciciResponse li > p + ul,
.ciciResponse li > p + ol {
	display: block;
	margin-top: 0;
}
.ciciResponse li ul,
.ciciResponse li ol {
	margin: 0 !important;
	padding-left: 1.2em;
}

/* Task lists */
.ciciResponse li.task-list-item { list-style: none; margin-left: -1.2em; }
.ciciResponse li.task-list-item input[type="checkbox"] { margin-right: 0.3em; vertical-align: middle; }

/* ---- Tables ---- */
.ciciResponse table {
	border-collapse: collapse;
	margin: 0.1em 0;
	font-size: 0.88em;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	display: block;
}
.ciciResponse thead { background: #f8f9fa; }
.ciciResponse th,
.ciciResponse td {
	border: 1px solid #dee2e6;
	padding: 0.15em 0.5em;
	text-align: left;
	vertical-align: top;
}
.ciciResponse th {
	font-weight: 600;
	font-size: 0.92em;
}
.ciciResponse tbody tr:nth-child(even) { background: #f8f9fa; }
.ciciResponse tbody tr:hover { background: #e9ecef; }

/* ---- Code ---- */
.ciciResponse code {
	font-family: 'Consolas', 'Courier New', monospace;
	font-size: 0.85em;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 3px;
	padding: 0 0.3em;
	color: #d63384;
}
.ciciResponse pre {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	padding: 0.2em 0.5em;
	margin: 0.1em 0;
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.2;
}
.ciciResponse pre code { background: none; border: none; padding: 0; font-size: 0.85em; color: inherit; }

/* ---- Blockquotes ---- */
.ciciResponse blockquote {
	border-left: 3px solid #dee2e6;
	margin: 0.1em 0;
	padding: 0 0.6em;
	color: #6c757d;
	background: #f8f9fa;
	border-radius: 0 3px 3px 0;
}
.ciciResponse blockquote p { margin: 0; }

/* ---- Misc ---- */
.ciciResponse hr { border: none; border-top: 1px solid #dee2e6; margin: 0.1em 0; }
.ciciResponse img { max-width: 100%; height: auto; border-radius: 4px; margin: 0; }
.ciciResponse dl  { margin: 0; }
.ciciResponse dt  { font-weight: 600; margin-top: 0.05em; }
.ciciResponse dd  { margin-left: 1.2em; margin-bottom: 0; }
.ciciResponse abbr[title] { text-decoration: underline dotted; cursor: help; }
.ciciResponse div { padding: 0; margin: 0; }
.ciciResponse > div:first-child { margin-top: 0; }
.ciciResponse > div:last-child  { margin-bottom: 0; }

/* User message bubbles */
.cici-chat-area .k-chat .k-own .k-bubble {
	background: linear-gradient(135deg, #2563a0, #3b82d6);
	color: #fff;
	border: none;
	box-shadow: 0 1px 4px rgba(37,99,160,0.15);
}

/* Bot avatar */
.cici-chat-area .k-chat .k-avatar {
	width: 36px;
	height: 36px;
}

/* ===== Card Styles (rendered inside message list) ===== */
.cici-card {
	background: #ffffff;
	border: 1px solid #d0daea;
	border-radius: 10px;
	padding: 16px 20px;
	margin: 6px 0;
	max-width: 420px;
	font-size: 0.9em;
	line-height: 1.55;
	box-shadow: 0 1px 4px rgba(37,99,160,0.06);
}
.cici-card-title {
	font-weight: 700;
	font-size: 0.95em;
	color: #1b3a5c;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.cici-card ul {
	margin: 0;
	padding-left: 20px;
}
.cici-card ul li {
	margin-bottom: 4px;
}
.cici-card ol {
	margin: 0;
	padding-left: 20px;
}
.cici-card ol li {
	margin-bottom: 4px;
}

/* Step card: numbered steps */
.cici-card.step-card ol {
	counter-reset: step-counter;
	list-style: none;
	padding-left: 0;
}
.cici-card.step-card ol li {
	counter-increment: step-counter;
	padding-left: 28px;
	position: relative;
}
.cici-card.step-card ol li::before {
	content: counter(step-counter);
	position: absolute;
	left: 0;
	top: 1px;
	width: 20px;
	height: 20px;
	background: #2563a0;
	color: #fff;
	border-radius: 50%;
	font-size: 0.75rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Confirmation card */
.cici-card.confirmation-card {
	border-color: #2e7d32;
	background: #f0f9f4;
}
.cici-card.confirmation-card .cici-card-title {
	color: #2e7d32;
}

/* Summary card */
.cici-card.summary-card {
	background: #f0f5ff;
	border-color: #b4c8e8;
}
.cici-card.summary-card .cici-card-title {
	color: #1b3a5c;
}

/* Expandable summary */
.cici-card.expandable-summary .cici-expand-toggle {
	cursor: pointer;
	user-select: none;
}
.cici-card.expandable-summary .cici-expand-toggle::after {
	content: ' \25BE';
	font-size: 0.8rem;
}
.cici-card.expandable-summary.collapsed .cici-expand-toggle::after {
	content: ' \25B8';
}
.cici-card.expandable-summary.collapsed .cici-expand-body {
	display: none;
}

/* Progress checklist */
.cici-card.progress-card ul {
	list-style: none;
	padding-left: 0;
}
.cici-card.progress-card ul li {
	padding: 3px 0;
}
.cici-card.progress-card .progress-complete {
	color: #2e7d32;
}
.cici-card.progress-card .progress-pending {
	color: #94a3b8;
}

/* Escalation card */
.cici-card.escalation-card {
	background: #fef9f0;
	border-color: #e0c88a;
}
.cici-card.escalation-card .cici-card-title {
	color: #7a5a1e;
}

/* Emergency notice */
.cici-card.emergency-card {
	background: #fdf2f2;
	border: 2px solid #e74c3c;
	border-radius: 10px;
}
.cici-card.emergency-card .cici-card-title {
	color: #c0392b;
}

/* Follow-up suggestions */
.cici-card.follow-up-card {
	background: #f0f5ff;
	border-color: #a4b8d8;
}
.cici-card.follow-up-card .cici-card-title {
	color: #1b3a5c;
}

/* Clarification card */
.cici-card.clarification-card {
	background: #fdf8ee;
	border-color: #e0d4a4;
}
.cici-card.clarification-card .cici-card-title {
	color: #7a6a1e;
}

/* Card action buttons */
.cici-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.cici-card-action-btn {
	padding: 6px 16px;
	border: 1.5px solid #2563a0;
	border-radius: 20px;
	background: #fff;
	color: #2563a0;
	font-size: 0.8em;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}
.cici-card-action-btn:hover {
	background: #2563a0;
	color: #fff;
}
.cici-card-action-btn.primary {
	background: #2563a0;
	color: #fff;
}
.cici-card-action-btn.primary:hover {
	background: #1b3a5c;
}

/* Status / thinking indicator — sits directly below the chat header */
.cici-status {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 20px;
	font-size: 0.82rem;
	color: #475569;
	background: rgba(238,242,249,0.97);
	border-bottom: 1px solid #dce4ef;
	box-shadow: 0 2px 6px rgba(37,99,160,0.07);
	overflow: hidden;
	max-height: 44px;
	opacity: 1;
	transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}
.cici-status.hidden {
	max-height: 0;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
	pointer-events: none;
}

/* Animated bouncing dots */
.cici-status-dots {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}
.cici-status-dots::before,
.cici-status-dots::after,
.cici-status-dots {
	line-height: 0;
}
.cici-status-dots::before {
	content: '\25CF  \25CF  \25CF';
	white-space: pre;
	font-size: 0.6rem;
	color: #2563a0;
	animation: cici-dots-pulse 1.4s ease-in-out infinite;
}
@keyframes cici-dots-pulse {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}
.cici-status-text {
	font-style: italic;
}

/* Accessibility: focus visible */
.cici-card-action-btn:focus-visible,
.cici-quick-action:focus-visible,
.cici-help-fab:focus-visible,
.cici-command-link:focus-visible,
.cici-toolbar-btn:focus-visible {
	outline: 2px solid #2563a0;
	outline-offset: 2px;
}

/* ===== Command Links (rendered below bot messages) ===== */
.cici-commands {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 6px 0 2px 0;
	margin-top: 4px;
	z-index: 1;
	list-style: none;
}
.cici-commands::before,
.cici-commands::marker {
	content: none;
	display: none;
}
.cici-command-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 12px;
	border: 1.5px solid #2563a0;
	border-radius: 20px;
	background: #fff;
	color: #2563a0;
	font-size: 0.78em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
	white-space: nowrap;
}
.cici-command-link:hover {
	background: #2563a0;
	color: #fff;
	box-shadow: 0 2px 8px rgba(37,99,160,0.18);
}
.cici-command-link:active {
	background: #1b3a5c;
	border-color: #1b3a5c;
	color: #fff;
}
.cici-command-link i {
	font-size: 0.82em;
	flex-shrink: 0;
}
.cici-command-link.cici-command-disabled {
	opacity: 0.45;
	cursor: default;
	pointer-events: none;
}

/* ===== Suggested Actions Badge (multi-command) ===== */
.cici-commands-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 14px;
	border: 1.5px solid #2563a0;
	border-radius: 20px;
	background: linear-gradient(135deg, #f0f6fc 0%, #fff 100%);
	color: #2563a0;
	font-size: 0.78em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
	white-space: nowrap;
}
.cici-commands-badge:hover {
	background: #2563a0;
	color: #fff;
	box-shadow: 0 2px 8px rgba(37,99,160,0.18);
}
.cici-commands-badge:active {
	background: #1b3a5c;
	border-color: #1b3a5c;
	color: #fff;
}
.cici-commands-badge-arrow {
	font-size: 0.7em;
	opacity: 0.7;
	transition: transform 0.15s;
}
.cici-commands-badge:hover .cici-commands-badge-arrow {
	transform: translateX(2px);
}

/* ===== Command Card Popup (opened from Suggested Actions badge) ===== */
.cici-command-card-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 8px 4px;
	overflow-y: auto;
	height: 100%;
	box-sizing: border-box;
}
.cici-command-card {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border: 2px solid #e0e6ed;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cici-command-card:hover {
	border-color: #2563a0;
	box-shadow: 0 2px 8px rgba(37,99,160,0.12);
	background: #f0f6fc;
}
.cici-command-card:active {
	background: #dbeafe;
	border-color: #1b3a5c;
}
.cici-command-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: linear-gradient(135deg, #1b3a5c 0%, #2563a0 100%);
	color: #fff;
	font-size: 1rem;
	flex-shrink: 0;
}
.cici-command-card-body {
	flex: 1;
	min-width: 0;
}
.cici-command-card-title {
	font-size: 0.85rem;
	font-weight: 600;
	color: #1b3a5c;
	margin-bottom: 2px;
}
.cici-command-card-desc {
	font-size: 0.75rem;
	color: #5a6e82;
	line-height: 1.35;
}
.cici-command-card.cici-command-card-disabled {
	opacity: 0.45;
	cursor: default;
	pointer-events: none;
}

/* Kendo Window chrome */
#ciCiWindow_wrapper.k-window {
	border: 2px solid #2563a0;
	border-radius: 12px;
	box-shadow:
		0 0 0 4px rgba(37,99,160,0.18),
		0 12px 48px rgba(27,58,92,0.38),
		0 4px 14px rgba(27,58,92,0.18);
	overflow: hidden;
}
#ciCiWindow_wrapper.k-window .k-window-titlebar {
	background: linear-gradient(135deg, #1b3a5c, #2563a0);
	color: #fff;
	border-bottom: none;
	padding: 8px 12px;
}
#ciCiWindow_wrapper.k-window .k-window-titlebar .k-window-title {
	font-weight: 600;
	font-size: 0.9rem;
}
#ciCiWindow_wrapper.k-window .k-window-titlebar .k-window-actions .k-button {
	color: rgba(255,255,255,0.8);
}
#ciCiWindow_wrapper.k-window .k-window-titlebar .k-window-actions .k-button:hover {
	color: #fff;
	background: rgba(255,255,255,0.15);
}
#ciCiWindow .k-window-content {
	padding: 0;
	overflow: hidden;
}
#ciCiWindow .cici-container {
	height: 100%;
}

/* Embedded mode — CiCi fills the entire viewport without a Kendo Window wrapper.
   Used when OA Office hosts the CiCi page inside a WebView2 within a WPF window. */
#ciCiWindow.cici-embedded {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
}
#ciCiWindow.cici-embedded .cici-container {
	height: 100vh;
}

/* ===== Patient Context Indicator ===== */
.cici-patient-context {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: linear-gradient(135deg, #e8f5e9, #f0f9f4);
	border-bottom: 1px solid #a5d6a7;
	font-size: var(--cici-font-scale, 0.84rem);
	font-weight: 600;
	color: #2e7d32;
	flex-shrink: 0;
}
.cici-patient-context.hidden {
	display: none;
}
.cici-patient-context > i {
	font-size: 0.9em;
	flex-shrink: 0;
}
.cici-patient-context-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}
.cici-patient-context-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cici-patient-context-address {
	font-style: italic;
	font-weight: 400;
	font-size: 0.76em;
	color: #558b2f;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cici-patient-context-alert {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	background: #fff3e0;
	border: 1px solid #ffb74d;
	border-radius: 50%;
	color: #e65100;
	font-size: 0.7em;
	flex-shrink: 0;
	cursor: default;
}
.cici-patient-context-alert.hidden {
	display: none;
}
.cici-patient-context-change,
.cici-patient-context-clear {
	background: none;
	border: none;
	color: #66bb6a;
	cursor: pointer;
	padding: 2px 4px;
	font-size: 0.85em;
	border-radius: 4px;
	flex-shrink: 0;
	transition: color 0.15s, background 0.15s;
}
.cici-patient-context-change:hover {
	color: #1565c0;
	background: rgba(21,101,192,0.08);
}
.cici-patient-context-clear:hover {
	color: #c62828;
	background: rgba(198,40,40,0.08);
}

/* ===== Patient Search Form Card ===== */
.cici-patient-search-card p {
	margin: 0 0 10px 0;
	font-size: 0.85em;
	color: #475569;
}
.cici-patient-search-fields {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.cici-patient-search-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.cici-patient-search-field label {
	font-size: 0.75em;
	font-weight: 600;
	color: #1b3a5c;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
/* Kendo widgets inside search fields fill the card width */
.cici-patient-search-field .k-textbox,
.cici-patient-search-field .k-datepicker {
	width: 100%;
}

/* ===== Patient Search Results (Kendo ListView) ===== */
.cici-patient-results-card p {
	margin: 0 0 8px 0;
	font-size: 0.85em;
	color: #475569;
}
/* Remove the default Kendo ListView border/padding so it sits flush in the card */
.cici-patient-results-listview.k-listview {
	border: none;
	background: transparent;
	padding: 0;
}
.cici-patient-results-listview .k-listview-content {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.cici-patient-result-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 14px;
	border: 1.5px solid #d0daea;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
	font-size: 0.84em;
}
.cici-patient-result-row:hover {
	background: #e8f0fd;
	border-color: #2563a0;
	box-shadow: 0 2px 6px rgba(37,99,160,0.12);
}
/* Kendo selected state — highlight the chosen patient card */
.k-listview-item.k-selected .cici-patient-result-row {
	background: #dbeafe;
	border-color: #2563a0;
	box-shadow: 0 2px 8px rgba(37,99,160,0.2);
}
/* Kendo Pager — compact style inside the results card */
.cici-patient-results-pager.k-pager {
	border: none;
	background: transparent;
	padding: 8px 0 0 0;
	font-size: 0.8em;
}
.cici-patient-result-details {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex: 1;
	min-width: 0;
}
.cici-patient-result-name {
	font-weight: 600;
	color: #1b3a5c;
}
.cici-patient-result-dob {
	color: #64748b;
	font-size: 0.8em;
}
.cici-patient-result-address {
	font-style: italic;
	color: #94a3b8;
	font-size: 0.78em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ===== Name Alert Warning ===== */
.cici-name-alert {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
	padding: 2px 8px;
	background: #fff3e0;
	border: 1px solid #ffb74d;
	border-radius: 12px;
	color: #e65100;
	font-size: 0.72em;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}
.cici-name-alert i {
	font-size: 0.7em;
}

/* ===== Create Task Form ===== */
.cici-create-task-fields {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.cici-create-task-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.cici-create-task-field label {
	font-size: 0.75em;
	font-weight: 600;
	color: #1b3a5c;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
/* Kendo widgets inside task fields fill the card width */
.cici-create-task-field .k-dropdownlist,
.cici-create-task-field .k-textarea {
	width: 100%;
}
.cici-create-task-field .k-textarea textarea {
	resize: vertical;
	min-height: 56px;
}
.cici-create-task-urgent-field {
	flex-direction: row;
	align-items: center;
	gap: 8px;
}
.cici-create-task-urgent-field label {
	text-transform: none;
	letter-spacing: normal;
	font-weight: 500;
	font-size: 0.85em;
	color: #1e293b;
}

/* ===== Task Assigned User Radio Group ===== */
.cici-assign-radio-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.cici-assign-radio {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.12s;
	font-size: 0.85em;
}
.cici-assign-radio:hover {
	background: #f1f5f9;
}
.cici-assign-radio input[type="radio"] {
	margin: 0;
	accent-color: #2563a0;
}
.cici-assign-radio-label {
	color: #1e293b;
}
.cici-assign-careteam-section {
	border: 1px solid #d0daea;
	border-radius: 6px;
	background: #f0f7ff;
	padding: 8px 8px 6px;
	margin: 2px 0;
}
.cici-assign-careteam-heading {
	display: block;
	font-size: 0.72em;
	font-weight: 700;
	color: #2563a0;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0 4px 6px;
}
.cici-assign-careteam-heading i {
	margin-right: 3px;
}
.cici-assign-radio-careteam {
	font-weight: 500;
}
.cici-assign-role-tag {
	display: inline-block;
	font-size: 0.78em;
	font-weight: 600;
	color: #2563a0;
	background: #dbeafe;
	border-radius: 3px;
	padding: 1px 5px;
	margin-left: 4px;
	vertical-align: middle;
}
.cici-assign-radio-other {
	color: #64748b;
}
.cici-assign-other-dropdown {
	padding-left: 28px;
}
.cici-assign-other-dropdown .k-dropdownlist {
	width: 100%;
}

/* ===== Teams PanelBar & Messages ===== */
.cici-teams-card {
	max-width: 38em;
}
.cici-teams-layout {
	display: flex;
	border: 1px solid #d0daea;
	border-radius: 0.4em;
	overflow: hidden;
	min-height: 20em;
	max-height: 28em;
}

/* Left panel — PanelBar navigation */
.cici-teams-nav-panel {
	width: 14.5em;
	flex-shrink: 0;
	overflow-y: auto;
	border-right: 1px solid #d0daea;
	background: #f8fafc;
}
.cici-teams-nav-panel .k-panelbar {
	border: none;
	background: transparent;
}
.cici-teams-nav-panel .k-panelbar > .k-panelbar-item > .k-link {
	font-size: 0.82em;
	font-weight: 600;
	color: #1b3a5c;
	padding: 0.5em 0.75em;
	background: #eef2f8;
	border-bottom: 1px solid #d0daea;
}
.cici-teams-panel-group {
	display: flex;
	align-items: center;
	gap: 0.4em;
}
.cici-teams-panel-group i {
	font-size: 0.9em;
	color: #6b7fa3;
}
.cici-teams-panel-item {
	display: block;
	padding: 0.45em 0.75em;
	cursor: pointer;
	transition: background 0.15s;
	border-bottom: 1px solid #eef1f6;
}
.cici-teams-panel-item:hover {
	background: #e8f0fe;
}
.cici-teams-panel-item-selected {
	background: #dbeafe !important;
	border-left: 3px solid #2563a0;
	padding-left: calc(0.75em - 3px);
}
.cici-teams-panel-item .cici-teams-chat-name {
	display: block;
	font-size: 0.82em;
	font-weight: 500;
	color: #1b3a5c;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cici-teams-panel-item .cici-teams-chat-preview {
	display: block;
	font-size: 0.75em;
	color: #94a3b8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 0.1em;
}
/* Remove default Kendo PanelBar child padding/borders */
.cici-teams-nav-panel .k-panelbar .k-panelbar-group {
	padding: 0;
}
.cici-teams-nav-panel .k-panelbar .k-panelbar-group > .k-panelbar-item > .k-link {
	padding: 0;
	border: none;
	background: transparent;
}

/* Content panel (right) */
.cici-teams-content-panel {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-width: 0;
}
.cici-teams-msg-title {
	font-weight: 600;
	font-size: 0.88em;
	color: #1b3a5c;
	padding: 0.65em 0.9em;
	border-bottom: 1px solid #e8ecf2;
	display: flex;
	align-items: center;
	gap: 0.4em;
	background: #f8fafc;
}
.cici-teams-controls-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.4em 0.9em;
	border-bottom: 1px solid #eef1f6;
	background: #fafbfd;
}
.cici-teams-select-all-label {
	display: flex;
	align-items: center;
	gap: 0.35em;
	font-size: 0.82em;
	color: #475569;
	cursor: pointer;
	font-weight: 500;
}

/* Kendo ListView area */
.cici-teams-listview {
	flex: 1;
	overflow-y: auto;
	position: relative;
}
.cici-teams-no-messages {
	padding: 1.5em 0.9em;
	text-align: center;
	color: #94a3b8;
	font-size: 0.85em;
}

/* Individual message item */
.cici-teams-msg-item {
	border-bottom: 1px solid #f0f3f7;
}
.cici-teams-msg-item:last-child {
	border-bottom: none;
}
.cici-teams-msg-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	padding: 0.5em 0.9em;
	cursor: pointer;
	transition: background 0.15s;
}
.cici-teams-msg-label:hover {
	background: #f4f7fb;
}
.cici-teams-msg-label input[type="checkbox"] {
	margin-top: 0.2em;
	flex-shrink: 0;
}
.cici-teams-msg-body {
	flex: 1;
	min-width: 0;
}
.cici-teams-msg-header {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
	margin-bottom: 0.15em;
}
.cici-teams-msg-sender {
	font-weight: 600;
	font-size: 0.82em;
	color: #1b3a5c;
}
.cici-teams-msg-time {
	font-size: 0.75em;
	color: #94a3b8;
}
.cici-teams-msg-preview {
	font-size: 0.82em;
	color: #475569;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Submit button */
.cici-teams-submit-btn {
	font-size: 0.82em;
}

/* Submitted conversation card shown in the chat bubble */
.cici-teams-submitted-card .cici-teams-submitted-msg {
	padding: 0.4em 0;
	border-bottom: 1px solid #eef1f6;
}
.cici-teams-submitted-card .cici-teams-submitted-msg:last-child {
	border-bottom: none;
}
.cici-teams-submitted-card .cici-teams-submitted-sender {
	font-weight: 600;
	font-size: 0.85em;
	color: #1b3a5c;
}
.cici-teams-submitted-card .cici-teams-submitted-time {
	font-size: 0.75em;
	color: #94a3b8;
	margin-left: 0.4em;
}
.cici-teams-submitted-card .cici-teams-submitted-text {
	font-size: 0.85em;
	color: #334155;
	line-height: 1.45;
	margin-top: 0.15em;
}

/* ===== Actions toolbar inside .ciciResponse (copy left, feedback right) ===== */
.ciciResponse-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 0.4em;
	padding-top: 0.35em;
	border-top: 1px solid #e8ecf2;
}
.ciciResponse-actions .cici-copy-btn {
	padding: 3px 8px;
	background: none;
	border: 1px solid #b8c5d6;
	border-radius: 5px;
	color: #64748b;
	font-size: 1em;
	cursor: pointer;
	line-height: 1;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ciciResponse-actions .cici-copy-btn:hover {
	color: #1d4f8a;
	border-color: #1d4f8a;
	background: #e0eaf5;
}
.ciciResponse-actions .cici-feedback-up {
	margin-left: auto;
}
.ciciResponse-actions .cici-feedback-btn {
	background: none;
	border: 1px solid #b8c5d6;
	border-radius: 6px;
	padding: 4px 8px;
	cursor: pointer;
	color: #64748b;
	font-size: 1.1em;
	line-height: 1;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ciciResponse-actions .cici-feedback-btn:hover:not(:disabled) {
	color: #1d4f8a;
	border-color: #1d4f8a;
	background: #e0eaf5;
}
.ciciResponse-actions .cici-feedback-btn:disabled {
	cursor: default;
}
.cici-feedback-submitted {
	opacity: 0.65;
}
.cici-feedback-selected {
	opacity: 1 !important;
	color: #1d4f8a;
	border-color: #1d4f8a;
	background: #e0eaf5;
	margin-left: auto;
}
.cici-feedback-selected i {
	font-weight: 900;
}
.cici-feedback-message {
	font-size: 0.82em;
	color: #64748b;
	margin-left: 4px;
	align-self: center;
}

/* Stream metadata (collapsible usage & sources) — standalone outside the bubble */
.cici-stream-meta {
	margin: 3px 0 0 0;
	border: 1px solid #d0daea;
	border-radius: 8px;
	background: #f8fafd;
	font-size: 0.78em;
	overflow: hidden;
}
.cici-meta-toggle {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 3px 8px;
	cursor: pointer;
	color: #64748b;
	font-weight: 500;
	user-select: none;
	transition: background 0.15s, color 0.15s;
}
.cici-meta-toggle:hover {
	background: #eef2f8;
	color: #2563a0;
}
.cici-meta-chevron {
	font-size: 0.7em;
	transition: transform 0.2s ease;
}
.cici-stream-meta:not(.collapsed) .cici-meta-chevron {
	transform: rotate(90deg);
}
.cici-meta-body {
	padding: 6px 12px 10px;
	border-top: 1px solid #e8ecf2;
}
.cici-stream-meta.collapsed .cici-meta-body {
	display: none;
}
.cici-meta-tokens {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 6px;
	color: #475569;
}
.cici-meta-tokens i {
	color: #94a3b8;
	margin-right: 3px;
	font-size: 0.85em;
}
.cici-meta-tokens strong {
	color: #1b3a5c;
}
.cici-meta-sources {
	color: #475569;
}
.cici-meta-sources strong {
	color: #1b3a5c;
	font-size: 0.95em;
}
.cici-meta-sources ul {
	margin: 4px 0 0 0;
	padding-left: 18px;
}
.cici-meta-sources ul li {
	margin-bottom: 3px;
	line-height: 1.4;
}
.cici-meta-sources a {
	color: #2563a0;
	text-decoration: none;
}
.cici-meta-sources a:hover {
	text-decoration: underline;
}
.cici-meta-score {
	color: #94a3b8;
	font-size: 0.9em;
}
.cici-meta-excerpt {
	color: #94a3b8;
	font-size: 0.9em;
	font-style: italic;
	margin-top: 1px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Elapsed-time badge */
.cici-elapsed-time {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 4px;
	color: #94a3b8;
	font-size: 0.9em;
	white-space: nowrap;
}
.cici-elapsed-time i {
	font-size: 0.85em;
}
/* ========== Command Window ========== */
/* Kendo widgets each hard-code font-size to .75rem, blocking inheritance.
   The JS in openCommandWindow() and adjustFontSize() sets font-size as an
   inline style on the .k-window wrapper — these rules force all child Kendo
   widgets to inherit that value instead of resetting to their own .75rem.
   Only matches command windows inside .cici-container — the outer chat Kendo
   Window wraps .cici-container as a parent, so it is never matched. */
.cici-container .k-window {
	font-size: var(--cici-font-scale);
}
.cici-container .k-window .k-wizard,
.cici-container .k-window .k-stepper,
.cici-container .k-window .k-listview,
.cici-container .k-window .k-pager {
	font-size: inherit;
}
/* Disable click navigation on wizard step headers — users must use the action buttons. */
.cici-container .k-window .k-stepper .k-step {
	pointer-events: none;
}
/* Window title — slightly larger than content text so it reads as a heading. */
.cici-container .k-window .k-window-title {
	font-size: 1.1em;
}
/* Pronounced title bar for all command windows inside the chat container.
   Uses the same gradient as the outer chat header for visual consistency. */
.cici-container .k-window .k-window-titlebar {
	background: linear-gradient(135deg, #1b3a5c, #2563a0);
	color: #fff;
	border-bottom: 2px solid rgba(27,58,92,0.3);
	padding: 10px 14px;
}
.cici-container .k-window .k-window-titlebar .k-window-title {
	font-weight: 700;
	font-size: 1.1em;
	color: #fff;
}
.cici-container .k-window .k-window-titlebar .k-window-actions .k-button {
	color: rgba(255,255,255,0.85);
}
.cici-container .k-window .k-window-titlebar .k-window-actions .k-button:hover {
	color: #fff;
	background: rgba(255,255,255,0.18);
}
.cici-command-window-content {
	padding: 12px 16px;
}
/* When a wizard fills the command window, remove the outer padding so the
   wizard's own chrome (stepper bar, action bar) sits flush, and stretch
   the content to fill the window height so the wizard can use flex layout. */
.cici-command-window-content:has(.cici-patient-wizard),
.cici-command-window-content:has(.cici-teams-wizard),
.cici-command-window-content:has(.cici-task-wizard),
.cici-command-window-content:has(.cici-stats-container),
.cici-command-window-content:has(.cici-sop-container),
.cici-command-window-content:has(.cici-import-wizard) {
	padding: 0;
	height: 100%;
	box-sizing: border-box;
}
/* SOP grid toolbar — allow items to wrap when the window is narrow. */
.cici-sop-container .k-grid-toolbar {
	flex-wrap: wrap;
	gap: 4px;
	padding: 6px 8px;
}
/* Kendo Fluent disabled vars fall back to inherit — force visual feedback. */
.cici-sop-container .k-grid-toolbar .k-button:disabled {
	opacity: 0.5;
	cursor: default;
}
/* Subtle highlight for rows with unpublished changes. */
.cici-sop-container tr.cici-sop-row-needs-publish {
	background-color: #fffbeb;
}
.cici-sop-container tr.cici-sop-row-needs-publish:hover {
	background-color: #fef3c7;
}
.cici-cmd-validation {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #b91c1c;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 10px;
	font-size: 0.9em;
}
.cici-cmd-validation i {
	margin-right: 4px;
}
.cici-cmd-validation.hidden {
	display: none;
}

/* ========== Shared Wizard Help Text ========== */
.cici-wizard-help {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-size: 0.84em;
	line-height: 1.5;
	color: #1e40af;
}
.cici-wizard-help i {
	margin-right: 4px;
	color: #3b82f6;
}
.cici-wizard-help.cici-wizard-help-error {
	background: #fef2f2;
	border-color: #fca5a5;
	color: #b91c1c;
}
.cici-wizard-help.cici-wizard-help-error i {
	color: #dc2626;
}

/* ========== Patient Search Wizard ========== */
.cici-patient-wizard {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.cici-patient-wizard .k-wizard-steps {
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 0;
}
.cici-patient-wizard .k-wizard-step {
	padding: 16px 20px;
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}
.cici-patient-wizard .cici-patient-results-card {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}
.cici-patient-wizard .cici-patient-results-card > .cici-wizard-help {
	flex: 0 0 auto;
}
.cici-patient-wizard .cici-patient-results-listview {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
}
.cici-patient-wizard .cici-patient-results-pager {
	flex: 0 0 auto;
	padding-top: 6px;
}
.cici-patient-wizard .cici-patient-results-title {
	font-weight: 600;
	margin-bottom: 8px;
}
/* Hidden-state rules for elements toggled by the search handler */
.cici-patient-wizard .cici-wizard-help.hidden,
.cici-patient-results-empty.hidden,
.cici-patient-wizard .cici-patient-results-listview.hidden,
.cici-patient-wizard .cici-patient-results-pager.hidden {
	display: none;
}

/* ========== Teams Wizard ========== */
.cici-teams-wizard {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.cici-teams-wizard .k-wizard-steps {
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 0;
}
.cici-teams-wizard .k-wizard-step {
	padding: 16px 20px;
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}
/* Step 1 — conversation selection card */
.cici-teams-select-card {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}
.cici-teams-select-card > .cici-wizard-help {
	flex: 0 0 auto;
}
.cici-teams-select-card > .cici-teams-chat-list {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
}
/* Grouped chat list — flat rows grouped under section headers */
.cici-teams-chat-list {
	border: 1px solid #d0daea;
	border-radius: 6px;
	overflow: hidden;
}
.cici-teams-chat-group-header {
	display: flex;
	align-items: center;
	gap: 0.4em;
	padding: 7px 12px;
	font-size: 0.75em;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: #f1f5f9;
	border-bottom: 1px solid #e2e8f0;
}
.cici-teams-chat-group-header i {
	font-size: 0.9em;
	color: #94a3b8;
}
.cici-teams-chat-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 12px;
	cursor: pointer;
	border-bottom: 1px solid #f0f3f7;
	transition: background 0.12s;
}
.cici-teams-chat-row:last-child {
	border-bottom: none;
}
.cici-teams-chat-row:hover {
	background: #eff6ff;
}
.cici-teams-chat-row:active {
	background: #dbeafe;
}
.cici-teams-chat-row-name {
	font-size: 0.86em;
	font-weight: 500;
	color: #1e293b;
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cici-teams-chat-row-preview {
	font-size: 0.78em;
	color: #94a3b8;
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: right;
}
.cici-teams-chat-row-arrow {
	font-size: 0.65em;
	color: #cbd5e1;
	flex-shrink: 0;
	transition: color 0.12s;
}
.cici-teams-chat-row:hover .cici-teams-chat-row-arrow {
	color: #2563a0;
}
/* Step 2 — message review card */
.cici-teams-messages-card {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}
.cici-teams-messages-card > .cici-wizard-help {
	flex: 0 0 auto;
}
.cici-teams-messages-card > .cici-teams-controls-row {
	flex: 0 0 auto;
}
.cici-teams-messages-card > .cici-teams-listview {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
}

/* ========== Create Task Wizard ========== */
.cici-task-wizard {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.cici-task-wizard .k-wizard-steps {
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 0;
}
.cici-task-wizard .k-wizard-step {
	padding: 16px 20px;
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}
/* Confirmation step summary */
.cici-task-confirm-summary {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid #d0daea;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}
.cici-task-confirm-row {
	display: flex;
	align-items: baseline;
	padding: 0.7em 1em;
	border-bottom: 1px solid #eef1f6;
}
.cici-task-confirm-row:nth-child(even) {
	background: #f8fafc;
}
.cici-task-confirm-row:last-child {
	border-bottom: none;
}
.cici-task-confirm-label {
	flex: 0 0 8.5em;
	font-size: 0.78em;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding-top: 0.15em;
}
.cici-task-confirm-value {
	flex: 1;
	font-size: 0.88em;
	color: #1e293b;
	line-height: 1.5;
	min-width: 0;
	word-wrap: break-word;
}
.cici-task-confirm-row-desc {
	align-items: flex-start;
}
.cici-task-confirm-row-desc .cici-task-confirm-value {
	white-space: pre-wrap;
}
.cici-task-confirm-urgent {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	color: #dc2626;
	font-weight: 600;
	font-size: 0.92em;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 4px;
	padding: 0.1em 0.5em;
}
.cici-task-confirm-urgent i {
	font-size: 0.85em;
}
.cici-task-confirm-normal {
	color: #16a34a;
	font-weight: 500;
	font-style: normal;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 4px;
	padding: 0.1em 0.5em;
	font-size: 0.92em;
}

/* ========== View Care Team Command ========== */
.cici-command-window-content {
	height: 100%;
	overflow: hidden;
}
.cici-careteam-container {
	padding: 8px 12px;
	overflow-y: auto;
	height: 100%;
	box-sizing: border-box;
}
.cici-careteam-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.cici-careteam-member {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid #e2e8f0;
	gap: 8px;
}
.cici-careteam-member:last-child {
	border-bottom: none;
}
.cici-careteam-info {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1;
}
.cici-careteam-icon {
	font-size: 1.3em;
	color: #475569;
	flex-shrink: 0;
}
.cici-careteam-details {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.cici-careteam-name {
	font-weight: 600;
	color: #1e293b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cici-careteam-role {
	font-size: 0.85em;
	color: #64748b;
}
.cici-careteam-send-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border: 1px solid #2563a0;
	border-radius: 4px;
	background: #fff;
	color: #2563a0;
	font-size: 0.82em;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s;
	flex-shrink: 0;
}
.cici-careteam-send-btn:hover:not(.disabled) {
	background: #2563a0;
	color: #fff;
}
.cici-careteam-send-btn.disabled {
	opacity: 0.4;
	cursor: not-allowed;
	border-color: #94a3b8;
	color: #94a3b8;
}
/* Inline message input */
.cici-careteam-msg-input {
	width: 100%;
	margin-top: 8px;
	padding: 8px 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
}
.cici-careteam-msg-input label {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	color: #475569;
	margin-bottom: 4px;
}
.cici-careteam-msg-input textarea {
	width: 100%;
	box-sizing: border-box;
	font-size: 0.9em;
	padding: 6px 8px;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	resize: vertical;
	font-family: inherit;
}
.cici-careteam-msg-input textarea.k-invalid {
	border-color: #ef4444;
}
.cici-careteam-msg-actions {
	display: flex;
	gap: 6px;
	margin-top: 6px;
	justify-content: flex-end;
}
.cici-careteam-msg-success {
	width: 100%;
	margin-top: 8px;
	padding: 8px 10px;
	background: #f0fdf4;
	border: 1px solid #86efac;
	border-radius: 6px;
	color: #166534;
	font-size: 0.85em;
}
.cici-careteam-msg-success i {
	margin-right: 4px;
}
.cici-careteam-msg-error {
	margin-top: 6px;
	color: #dc2626;
	font-size: 0.82em;
}
.cici-careteam-msg-error i {
	margin-right: 3px;
}

/* Inline Microsoft logo SVG — replaces fa-brands fa-microsoft */
.cici-icon-microsoft {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.125em;
}

/* ===== Responsive: icon-only quick actions when container is narrow ===== */
@container cici (max-width: 500px) {
	.cici-quick-action {
		min-width: 36px;
		padding: 7px 8px;
		gap: 0;
	}
	.cici-quick-action span {
		display: none;
	}
	.cici-quick-action i {
		font-size: 1.1rem;
	}
}

/* ===== CiCi Interaction Stats ===== */
.cici-stats-container {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}
.cici-stats-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: #f8f9fa;
	border-bottom: 1px solid #e0e0e0;
	flex-shrink: 0;
}
.cici-stats-toolbar .k-datepicker {
	width: 200px;
}
.cici-stats-chart {
	flex: 1 1 auto;
	min-height: 0;
	padding: 4px;
}
.cici-stats-drilldown {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}
.cici-stats-drilldown-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	background: #f8f9fa;
	border-bottom: 1px solid #e0e0e0;
	flex-shrink: 0;
}
.cici-stats-drilldown-title {
	font-weight: 600;
	font-size: 0.95em;
	color: #333;
}
.cici-stats-grid {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

/* ===== CiCi SOP Manager ===== */
.cici-sop-container {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	position: relative;
}

/* ===== CiCi SOP Version Diff ===== */
.cici-diff-word-view {
	padding: 16px;
	font-size: 14px;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
}
.cici-diff-word-added {
	background: #acf2bd;
	text-decoration: none;
	border-radius: 2px;
	padding: 1px 0;
}
.cici-diff-word-removed {
	background: #fdb8c0;
	text-decoration: line-through;
	border-radius: 2px;
	padding: 1px 0;
}

/* ===== CiCi SOP Publish Wizard ===== */
.cici-publish-wizard {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.cici-publish-wizard .k-wizard-steps {
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 0;
}
.cici-publish-wizard .k-wizard-step {
	padding: 16px 20px;
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: auto;
}

/* Option cards — clickable selection tiles */
.cici-publish-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
}
.cici-publish-option {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 16px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	background: #fff;
}
.cici-publish-option:hover:not(.cici-publish-option-disabled) {
	border-color: #93c5fd;
	background: #f0f7ff;
}
.cici-publish-option-active {
	border-color: #2563eb !important;
	background: #eff6ff !important;
	box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.cici-publish-option-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background: #f9fafb;
}
.cici-publish-option-icon {
	font-size: 1.4em;
	color: #2563eb;
	padding-top: 2px;
	flex-shrink: 0;
	width: 28px;
	text-align: center;
}
.cici-publish-option-disabled .cici-publish-option-icon {
	color: #9ca3af;
}
.cici-publish-option-body {
	flex: 1 1 auto;
	min-width: 0;
}
.cici-publish-option-title {
	font-weight: 600;
	font-size: 0.95em;
	color: #111827;
	margin-bottom: 3px;
}
.cici-publish-option-desc {
	font-size: 0.84em;
	color: #6b7280;
	line-height: 1.45;
}
.cici-publish-option-active .cici-publish-option-title {
	color: #1e40af;
}
.cici-publish-option-active .cici-publish-option-desc {
	color: #3b82f6;
}

/* Validation message */
.cici-publish-validation {
	margin-bottom: 10px;
}

/* Review step — scrollable document list */
.cici-publish-review {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}
.cici-publish-item-list {
	flex: 1 1 auto;
	overflow-y: auto;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	background: #fafafa;
	padding: 4px 0;
}
.cici-publish-item {
	display: flex;
	align-items: center;
	padding: 8px 14px;
	border-bottom: 1px solid #f3f4f6;
	font-size: 0.88em;
	transition: background 0.2s;
}
.cici-publish-item:last-child {
	border-bottom: none;
}
.cici-publish-item-done {
	background: #f0fdf4;
}
.cici-publish-item-name {
	font-weight: 500;
	color: #1f2937;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1 1 auto;
	min-width: 0;
	margin-right: 12px;
}
.cici-publish-item-version {
	flex-shrink: 0;
	font-size: 0.85em;
	color: #6b7280;
	white-space: nowrap;
}

/* Status icon column */
.cici-publish-item-status {
	flex-shrink: 0;
	width: 22px;
	text-align: center;
	margin-right: 10px;
	font-size: 0.9em;
}
.cici-publish-item-pending {
	color: #d1d5db;
	font-size: 0.55em;
}
.cici-publish-item-active {
	color: #2563eb;
}
.cici-publish-item-success {
	color: #16a34a;
}
.cici-publish-item-error {
	color: #dc2626;
}

/* ===== CiCi SOP Export Wizard ===== */
.cici-export-wizard {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.cici-export-wizard .k-wizard-steps {
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 0;
}
.cici-export-wizard .k-wizard-step {
	padding: 16px 20px;
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: auto;
}

/* Export option cards — reuse publish card pattern */
.cici-export-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
}
.cici-export-option {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 16px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	background: #fff;
}
.cici-export-option:hover:not(.cici-export-option-disabled) {
	border-color: #93c5fd;
	background: #f0f7ff;
}
.cici-export-option-active {
	border-color: #2563eb !important;
	background: #eff6ff !important;
	box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.cici-export-option-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background: #f9fafb;
}
.cici-export-option-icon {
	font-size: 1.4em;
	color: #2563eb;
	padding-top: 2px;
	flex-shrink: 0;
	width: 28px;
	text-align: center;
}
.cici-export-option-disabled .cici-export-option-icon {
	color: #9ca3af;
}
.cici-export-option-body {
	flex: 1 1 auto;
	min-width: 0;
}
.cici-export-option-title {
	font-weight: 600;
	font-size: 0.95em;
	color: #111827;
	margin-bottom: 3px;
}
.cici-export-option-desc {
	font-size: 0.84em;
	color: #6b7280;
	line-height: 1.45;
}
.cici-export-option-active .cici-export-option-title {
	color: #1e40af;
}
.cici-export-option-active .cici-export-option-desc {
	color: #3b82f6;
}

/* Export review step — scrollable document list */
.cici-export-review {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}
.cici-export-item-list {
	flex: 1 1 auto;
	overflow-y: auto;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	background: #fafafa;
	padding: 4px 0;
}
.cici-export-item {
	display: flex;
	align-items: center;
	padding: 8px 14px;
	border-bottom: 1px solid #f3f4f6;
	font-size: 0.88em;
	transition: background 0.2s;
}
.cici-export-item:last-child {
	border-bottom: none;
}
.cici-export-item-done {
	background: #f0fdf4;
}
.cici-export-item-name {
	font-weight: 500;
	color: #1f2937;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1 1 auto;
	min-width: 0;
	margin-right: 12px;
}
.cici-export-item-file {
	flex-shrink: 0;
	font-size: 0.85em;
	color: #6b7280;
	white-space: nowrap;
}

/* Export status icon column */
.cici-export-item-status {
	flex-shrink: 0;
	width: 22px;
	text-align: center;
	margin-right: 10px;
	font-size: 0.9em;
}
.cici-export-item-pending {
	color: #d1d5db;
	font-size: 0.55em;
}
.cici-export-item-active {
	color: #2563eb;
}
.cici-export-item-success {
	color: #16a34a;
}
.cici-export-item-error {
	color: #dc2626;
}

/* ===== CiCi SOP Import Wizard ===== */
.cici-import-wizard {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.cici-import-wizard .k-wizard-steps {
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 0;
}
.cici-import-wizard .k-wizard-step {
	padding: 16px 20px;
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: auto;
}

/* Import option cards — reuse publish card pattern */
.cici-import-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
}
.cici-import-option {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 16px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	background: #fff;
}
.cici-import-option:hover {
	border-color: #93c5fd;
	background: #f0f7ff;
}
.cici-import-option-active {
	border-color: #2563eb !important;
	background: #eff6ff !important;
	box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.cici-import-option-icon {
	font-size: 1.4em;
	color: #2563eb;
	padding-top: 2px;
	flex-shrink: 0;
	width: 28px;
	text-align: center;
}
.cici-import-option-body {
	flex: 1 1 auto;
	min-width: 0;
}
.cici-import-option-title {
	font-weight: 600;
	font-size: 0.95em;
	color: #111827;
	margin-bottom: 3px;
}
.cici-import-option-desc {
	font-size: 0.84em;
	color: #6b7280;
	line-height: 1.45;
}
.cici-import-option-active .cici-import-option-title {
	color: #1e40af;
}
.cici-import-option-active .cici-import-option-desc {
	color: #3b82f6;
}

/* Import step 2 layout */
.cici-import-step {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}
.cici-import-step .cici-sop-import-drop-hint {
	text-align: center;
	padding: 40px 20px;
	color: #888;
	font-size: 16px;
	border: 2px dashed #ccc;
	border-radius: 8px;
	margin-bottom: 12px;
}
.cici-import-step .cici-sop-import-widget {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
}
.cici-sop-import-summary-bar {
	padding-top: 8px;
	font-size: 0.85em;
	color: #6b7280;
	line-height: 1.5;
}
.cici-import-progress-area {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}
.cici-import-progress-area .cici-publish-item-list {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
}
