.keoni-matching {
	display: grid;
	gap: 16px;
	margin: 20px 0;
	align-items: start;
}

.keoni-matching-kpis {
	border: 1px solid #dbe5f1;
	border-radius: 12px;
	padding: 12px;
	background: #ffffff;
	margin: 8px 0 14px;
}

.keoni-matching-kpis__title {
	font-size: 13px;
	font-weight: 700;
	color: #1e3a8a;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.keoni-matching-kpis__freshness {
	font-size: 12px;
	color: #64748b;
	margin: 0 0 10px;
	cursor: help;
}

.keoni-matching-kpis__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.keoni-matching-kpis__item {
	border: 1px solid #dbe5f1;
	border-radius: 10px;
	background: #ffffff;
	padding: 8px 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.keoni-matching-kpis__item--wide {
	grid-column: 1 / -1;
}

.keoni-matching-kpis__label {
	font-size: 11px;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.keoni-matching-kpis__value {
	font-size: 16px;
	line-height: 1.2;
	color: #0f172a;
}

.keoni-matching__card {
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	align-self: start;
}

.keoni-matching__card--resume {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.keoni-matching__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.keoni-matching__top {
	display: grid;
	grid-template-columns: 84px 1fr;
	gap: 12px;
	align-items: start;
}

.keoni-matching__avatar {
	display: flex;
	justify-content: center;
}

.keoni-matching__avatar img {
	width: 84px;
	height: 84px;
	border-radius: 12px;
	object-fit: cover;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
}

.keoni-matching__identity {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.keoni-matching__resume-name {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.35;
	font-weight: 700;
	color: #0f172a;
}

.keoni-matching__resume-name a {
	color: inherit !important;
	text-decoration: none !important;
}

.keoni-matching__resume-name a:hover,
.keoni-matching__resume-name a:focus-visible {
	text-decoration: underline !important;
	color: #0b1f4b !important;
}

.keoni-matching__identity-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.keoni-matching__chip {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 12px;
	line-height: 1.2;
	font-weight: 600;
}

.keoni-matching__chip--neutral {
	background: #f1f5f9;
	color: #334155;
	border: 1px solid #e2e8f0;
}

.keoni-matching__chip--rank {
	background: #eef2ff;
	color: #3730a3;
	border: 1px solid #c7d2fe;
}

.keoni-matching__chip--decision {
	background: #eff6ff;
	color: #1d4ed8;
	border: 1px solid #bfdbfe;
}

.keoni-matching__score-panel {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.keoni-matching__scoreline {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.keoni-matching__score {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
}

.keoni-matching__score-label {
	font-size: 12px;
	color: #475569;
	font-weight: 600;
}

.keoni-matching__score.score-high,
.keoni-matching__scorebar span.score-high {
	background: #e8f8ef;
	color: #166534;
}

.keoni-matching__score.score-medium,
.keoni-matching__scorebar span.score-medium {
	background: #fff7e6;
	color: #9a6700;
}

.keoni-matching__score.score-low,
.keoni-matching__scorebar span.score-low {
	background: #fef2f2;
	color: #b91c1c;
}

/* Barres du "Détail des scores" (modale Analyser) : un remplissage plein
   (pas le fond pâle utilisé pour la puce de score) -- sinon quasi
   invisible sur le fond gris clair de la piste. */
.keoni-matching__score-breakdown-bar span.score-high { background: #22c55e; }
.keoni-matching__score-breakdown-bar span.score-medium { background: #f59e0b; }
.keoni-matching__score-breakdown-bar span.score-low { background: #ef4444; }

.keoni-matching__score-qualifier {
	font-size: 12px;
	font-weight: 600;
	align-self: flex-start;
}

.keoni-matching__score-qualifier.score-high {
	color: #166534;
}

.keoni-matching__score-qualifier.score-medium {
	color: #9a6700;
}

.keoni-matching__score-qualifier.score-low {
	color: #b91c1c;
}

.keoni-matching__scorebar {
	width: 100%;
	height: 8px;
	border-radius: 999px;
	background: #e5e7eb;
	overflow: hidden;
}

.keoni-matching__scorebar span {
	display: block;
	height: 100%;
}

.keoni-matching__resume-meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	padding: 10px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fcfdff;
}

.keoni-matching__resume-meta-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.keoni-matching__resume-meta-item strong {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #64748b;
}

.keoni-matching__resume-meta-item span {
	color: #111827;
	font-size: 13px;
	line-height: 1.35;
	word-break: break-word;
}

.keoni-matching__decision-row {
	display: grid;
	gap: 10px;
}

.keoni-matching__section {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 10px;
	background: #fff;
}

.keoni-matching__section-label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #334155;
}

.keoni-matching__section--strengths {
	border-color: #bbf7d0;
	background: #f0fdf4;
}

.keoni-matching__section--weaknesses {
	border-color: #fecaca;
	background: #fef2f2;
}

.keoni-matching__section--keywords {
	background: #f8fafc;
}

.keoni-matching__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.keoni-matching__list li {
	margin: 0 0 6px;
	font-size: 13px;
	color: #1f2937;
}

.keoni-matching__list li:last-child {
	margin-bottom: 0;
}

.keoni-matching__decision-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.keoni-matching__resume-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.keoni-matching__section-grid {
	display: grid;
	gap: 10px;
}

/* En-tête de la modale "Analyser" : score + libellé + barre pleine
   largeur, porté de la modale d'analyse d'AI Real-Time (rhconsole). */
.keoni-matching__explain-summary {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 4px;
}

.keoni-matching__explain-summary-top {
	display: flex;
	align-items: center;
	gap: 12px;
}

.keoni-matching__explain-tone {
	font-size: 17px;
	font-weight: 600;
}

.keoni-matching__explain-tone.score-high { color: #166534; }
.keoni-matching__explain-tone.score-medium { color: #9a6700; }
.keoni-matching__explain-tone.score-low { color: #b91c1c; }

.keoni-matching__explain-subtitle {
	font-size: 13px;
	color: #64748b;
}

.keoni-matching__explain-text {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: #64748b;
}

/* Détail des scores par composante (extra.score_breakdown, déjà
   renvoyé par matching-api mais jamais affiché avant) -- même structure
   que .score-breakdown chez AI Real-Time. */
.keoni-matching__score-breakdown {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
}

.keoni-matching__score-breakdown-item {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 150px;
	flex: 1 1 150px;
}

.keoni-matching__score-breakdown-label {
	font-size: 12px;
	color: #64748b;
	min-width: 90px;
	white-space: nowrap;
}

.keoni-matching__score-breakdown-bar {
	flex: 1;
	min-width: 40px;
	height: 5px;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
}

.keoni-matching__score-breakdown-bar span {
	display: block;
	height: 100%;
}

.keoni-matching__score-breakdown-value {
	font-size: 12px;
	color: #334155;
	min-width: 32px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.keoni-matching__resume-keywords {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.keoni-matching__resume-keywords span {
	background: #eef2ff;
	color: #3730a3;
	border: 1px solid #c7d2fe;
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 600;
}

.keoni-matching__muted {
	margin: 0;
	color: #64748b;
	font-size: 13px;
}

.keoni-matching__structured-text {
	margin: 0;
	color: #334155;
	font-size: 13px;
	line-height: 1.5;
	white-space: pre-wrap;
}

.keoni-matching__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.keoni-matching__resume-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}


/* Toutes les déclarations en !important : ces boutons vivent aussi hors
   du shortcode (myjobs.php, en-tête de viewjob.php), où le thème/Elementor
   impose un reset de bouton global (border-width, background, color...)
   qui gagne sinon la cascade propriété par propriété -- constaté en prod
   avec une bordure ramenée à 0 alors que la couleur passait déjà
   correctement (2026-09-23). */
.keoni-matching__btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 8px 14px !important;
	border-radius: 8px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
	border-width: 1px !important;
	border-style: solid !important;
	line-height: normal !important;
	cursor: pointer !important;
}

.keoni-matching__btn--full {
	width: 100%;
}

.keoni-matching__resume-actions .keoni-matching__btn--full {
	width: auto;
	min-width: 180px;
	align-self: center;
}

/* !important sur les 2 variantes : ces boutons vivent aussi hors du
   shortcode (myjobs.php, en-tête de viewjob.php) où le thème/Elementor
   impose un style de bouton global (button{color:...}) qui gagnait
   sinon la cascade -- constaté en prod, 'Job extrait' illisible en
   blanc sur blanc (2026-09-23). */
.keoni-matching__btn--primary,
.keoni-matching__btn--primary:visited {
	background: #0b1f4b !important;
	color: #ffffff !important;
	border-color: #0b1f4b !important;
}

.keoni-matching__btn--primary:hover,
.keoni-matching__btn--primary:focus-visible {
	background: #132a63 !important;
	color: #ffffff !important;
}

.keoni-matching__btn--ghost,
.keoni-matching__btn--ghost:visited {
	background-color: #ffffff !important;
	color: #0b1f4b !important;
	border-color: #0b1f4b !important;
}

.keoni-matching__btn--ghost:hover,
.keoni-matching__btn--ghost:focus-visible {
	background-color: #0b1f4b !important;
	color: #ffffff !important;
	border-color: #0b1f4b !important;
}

/* Contour rouge sur le dernier bouton cliqué (Analyser/Voir le CV/Voir le
   CV extrait/Job extrait) : outline plutôt que border, pour ne pas
   décaler la mise en page ni écraser la bordure de couleur existante du
   bouton. Persiste après la fermeture de la modale. */
.keoni-matching__btn--last-clicked {
	outline: 2px solid #dc2626 !important;
	outline-offset: 2px !important;
}

.keoni-matching__empty {
	padding: 20px;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	text-align: center;
	color: #64748b;
	background: #f8fafc;
}

@media (min-width: 768px) {
	.keoni-matching {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.keoni-matching__top {
		grid-template-columns: 84px minmax(0, 1fr) 180px;
	}

	.keoni-matching__score-panel {
		grid-column: auto;
		align-self: stretch;
	}

	.keoni-matching__decision-row {
		grid-template-columns: 1.3fr 1fr;
		align-items: stretch;
	}

	.keoni-matching-kpis__grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.keoni-matching-kpis__item--wide {
		grid-column: span 1;
	}
}
@media (max-width: 600px) {
	.keoni-matching {
		gap: 12px;
		margin: 12px 0;
	}

	.keoni-matching-kpis {
		padding: 10px;
		margin-bottom: 12px;
	}

	.keoni-matching-kpis__grid {
		grid-template-columns: 1fr 1fr;
		gap: 6px;
	}

	.keoni-matching-kpis__label {
		font-size: 10px;
	}

	.keoni-matching-kpis__value {
		font-size: 14px;
	}

	.keoni-matching__card {
		padding: 12px;
		border-radius: 10px;
	}

	.keoni-matching__top {
		grid-template-columns: 64px 1fr;
		gap: 10px;
	}

	.keoni-matching__avatar img {
		width: 64px;
		height: 64px;
		border-radius: 10px;
	}

	.keoni-matching__resume-name {
		font-size: 15px;
	}

	.keoni-matching__chip {
		font-size: 11px;
		padding: 3px 8px;
	}

	.keoni-matching__score {
		min-width: 58px;
		padding: 4px 10px;
		font-size: 12px;
	}

	.keoni-matching__score-label {
		font-size: 11px;
	}

	.keoni-matching__resume-meta {
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 8px;
	}

	.keoni-matching__resume-meta-item strong {
		font-size: 10px;
	}

	.keoni-matching__resume-meta-item span {
		font-size: 12px;
	}

	.keoni-matching__decision-row,
	.keoni-matching__section-grid {
		gap: 8px;
	}

	.keoni-matching__section {
		padding: 8px;
	}

	.keoni-matching__section-label {
		font-size: 11px;
		margin-bottom: 4px;
	}

	.keoni-matching__list li,
	.keoni-matching__muted {
		font-size: 12px;
	}

	.keoni-matching__resume-keywords span {
		font-size: 11px;
		padding: 3px 8px;
	}

	.keoni-matching__actions {
		gap: 6px;
	}

	.keoni-matching__btn {
		width: 100%;
		font-size: 12px;
		padding: 8px 10px;
	}

	.keoni-matching__resume-chips {
		width: 100%;
		gap: 6px;
	}

	.keoni-matching__resume-chips .keoni-matching__chip {
		width: 100%;
		justify-content: center;
	}
}

/* ---- Modale "Analyser" / "Voir le CV" / "Voir le CV extrait" / "Job extrait" ----
   Porté du composant modal d'AI Real-Time (frontend/styles/components.css) :
   même structure backdrop/card/header/body, redemandé explicitement pour
   rester visuellement cohérent avec l'autre outil. */
.keoni-matching-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.keoni-matching-modal[hidden] {
	display: none;
}

.keoni-matching-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(2px);
}

/* Thème clair (blanc) de la modale "Analyser" / "Voir le CV" / "Voir le CV
   extrait" / "Job extrait" -- même structure que la modale sombre portée
   d'AI Real-Time, mais recolorée en clair pour rester cohérente avec le
   reste du site WP (demande explicite, 2026-09-24). */
.keoni-matching-modal__card {
	position: relative;
	z-index: 1;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
	color: #0f172a;
	width: 100%;
	max-width: 720px;
	max-height: calc(100dvh - 32px);
	display: flex;
	flex-direction: column;
}

.keoni-matching-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 24px;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.keoni-matching-modal__title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: #0f172a;
}

.keoni-matching-modal__close {
	appearance: none !important;
	border: none !important;
	background: transparent !important;
	color: #64748b !important;
	width: 28px !important;
	height: 28px !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	border-radius: 8px !important;
	font-size: 18px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	flex-shrink: 0 !important;
}

.keoni-matching-modal__close:hover {
	background: #f1f5f9 !important;
	color: #0f172a !important;
}

.keoni-matching-modal__body {
	padding: 24px;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
	color: #0f172a;
	font-size: 13px;
}

.keoni-matching-modal__body iframe {
	width: 100%;
	height: min(70dvh, 800px);
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
}

/* Composants partagés avec les cartes candidats (score, listes, mots-clés,
   texte extrait) réutilisés tels quels dans la modale : surcharge scopée à
   .keoni-matching-modal__body uniquement, n'affecte pas leur apparence sur
   les cartes en dehors de la modale. */
.keoni-matching-modal__body .keoni-matching__explain-subtitle,
.keoni-matching-modal__body .keoni-matching__explain-text {
	color: #64748b;
}

.keoni-matching-modal__body .keoni-matching__scorebar,
.keoni-matching-modal__body .keoni-matching__score-breakdown-bar {
	background: #e5e7eb;
	height: 4px;
}

.keoni-matching-modal__body .keoni-matching__score-breakdown-label {
	color: #64748b;
}

.keoni-matching-modal__body .keoni-matching__score-breakdown-value {
	color: #334155;
}

.keoni-matching-modal__body .keoni-matching__section {
	border: none;
	background: transparent;
	padding: 0;
}

.keoni-matching-modal__body .keoni-matching__section-label {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #64748b;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.66px;
	text-transform: uppercase;
	margin: 0 0 12px;
}

.keoni-matching-modal__body .keoni-matching__section-label::before,
.keoni-matching-modal__body .keoni-matching__section-label::after {
	content: "";
	flex: 1 1 0%;
	height: 1px;
	background: #e2e8f0;
}

.keoni-matching-modal__body .keoni-matching__list li {
	color: #334155;
}

.keoni-matching-modal__body .keoni-matching__section--excerpts .keoni-matching__list li strong {
	color: #0f172a;
}

.keoni-matching__breakdown-badge {
	font-size: 11px;
	padding: 2px 8px;
}

.keoni-matching-modal__body .keoni-matching__muted {
	color: #94a3b8;
}

.keoni-matching-modal__body .keoni-matching__structured-text {
	color: #334155;
}

.keoni-matching-modal__body .keoni-matching__resume-keywords span {
	background: #eef2ff;
	color: #3730a3;
	border-color: #c7d2fe;
}

@media (max-width: 640px) {
	.keoni-matching-modal__card {
		max-width: 100%;
	}
}

.keoni-matching__score-filter {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid #dbe5f1;
	border-radius: 12px;
	background: #ffffff;
	padding: 10px 14px;
	margin: 0 0 14px;
}

.keoni-matching__score-filter-label {
	font-size: 12px;
	font-weight: 600;
	color: #1e3a8a;
	text-transform: uppercase;
	letter-spacing: .03em;
	white-space: nowrap;
}

.keoni-matching__score-filter input[type="range"] {
	flex: 1;
	accent-color: #1e3a8a;
}

.keoni-matching__score-filter-value {
	min-width: 3ch;
	text-align: right;
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
}

.keoni-matching__score-filter-count {
	font-size: 12px;
	color: #64748b;
	white-space: nowrap;
}

.keoni-matching__card--filtered-out {
	display: none !important;
}

/* Widget "État du service de matching" sur le frontend jsjob (myjobs.php,
   viewjob.php) -- information de routine pour les RH (où en est la
   réindexation CV, le scoring autonome), pas une erreur : même palette
   sobre que .keoni-matching-kpis ci-dessus, pas de rouge/gras façon
   "alerte". Voir Keoni_Bridge_Hooks::render_service_status_widget(). */
.keoni-service-status {
	border: 1px solid #dbe5f1;
	border-radius: 12px;
	padding: 12px 14px;
	background: #f8fafc;
	margin: 8px 0 14px;
}

.keoni-service-status__title {
	font-size: 13px;
	font-weight: 700;
	color: #1e3a8a;
	margin: 0 0 8px;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.keoni-service-status__row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin: 0;
	padding: 4px 0;
	font-size: 13px;
	line-height: 1.4;
}

.keoni-service-status__row + .keoni-service-status__row {
	border-top: 1px solid #e2e8f0;
}

.keoni-service-status__label {
	font-weight: 600;
	color: #334155;
	flex: 0 0 auto;
}

.keoni-service-status__value {
	color: #475569;
}

.keoni-matching__breakdown-note {
	margin: 10px 0 0;
	font-size: 12px;
	color: #667085;
	line-height: 1.45;
}
