/*!
 * Login Armor — AI analysis panel styles.
 * Scoped under #la-root; reuses existing .la-card / .la-*-btn primitives.
 */
#la-root .la-ai-panel {
	margin-top: 16px;
}
#la-root .la-ai-panel__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 14px;
}
#la-root .la-ai-panel__badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	flex: 0 0 auto;
	padding: 3px 9px;
	border-radius: 999px;
	background: #eef2ff;
	color: #4338ca;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}
#la-root .la-ai-panel__title {
	margin: 0 0 2px;
	font-size: 15px;
	font-weight: 700;
}
#la-root .la-ai-panel__intro {
	margin: 0;
	color: #6b7280;
	font-size: 13px;
	line-height: 1.5;
}
#la-root .la-ai-panel__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}
#la-root .la-ai-panel__state {
	margin: 10px 0;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13px;
}
#la-root .la-ai-panel__state.is-loading {
	background: #f3f4f6;
	color: #4b5563;
}
#la-root .la-ai-panel__state.is-error {
	background: #fef2f2;
	color: #b91c1c;
}
#la-root .la-ai-panel__result {
	padding: 14px 16px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	font-size: 13.5px;
	line-height: 1.6;
	color: #1f2937;
}
#la-root .la-ai-panel__result h3 { margin: 14px 0 6px; font-size: 15px; }
#la-root .la-ai-panel__result h4 { margin: 12px 0 4px; font-size: 13px; }
#la-root .la-ai-panel__result h3:first-child,
#la-root .la-ai-panel__result h4:first-child { margin-top: 0; }
#la-root .la-ai-panel__result p { margin: 8px 0; }
#la-root .la-ai-panel__result ul { margin: 6px 0 10px 20px; list-style: disc; }
#la-root .la-ai-panel__result li { margin: 4px 0; }
#la-root .la-ai-panel__result strong { font-weight: 700; }
#la-root .la-ai-panel__result code {
	padding: 1px 5px;
	border-radius: 4px;
	background: #f3f4f6;
	font-size: 12px;
}
#la-root .la-ai-panel__result hr {
	margin: 14px 0;
	border: none;
	border-top: 1px solid #e5e7eb;
}
#la-root .la-ai-panel__privacy,
#la-root .la-ai-settings__privacy {
	margin: 10px 0 0;
	color: #9ca3af;
	font-size: 11.5px;
	line-height: 1.5;
}
#la-root .la-ai-panel__approve p {
	margin: 0 0 10px;
	font-size: 13px;
	color: #6b7280;
}

/* Settings section */
#la-root .la-ai-settings__hint {
	margin: 0 0 12px;
	color: #6b7280;
	font-size: 13px;
	line-height: 1.5;
}
#la-root .la-ai-settings__hint--warn { color: #b45309; }
#la-root .la-ai-settings__ok {
	margin: 0 0 12px;
	color: #15803d;
	font-size: 13px;
}
#la-root .la-ai-settings__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 8px 0;
	font-size: 13px;
	cursor: pointer;
}
#la-root .la-ai-settings__usage {
	margin: 8px 0 0;
	color: #6b7280;
	font-size: 12.5px;
}

/* Toggle switch (settings section) */
#la-root .la-ai-toggle {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
}
#la-root .la-ai-toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
#la-root .la-ai-toggle__track {
	position: relative;
	flex: 0 0 auto;
	width: 40px;
	height: 22px;
	margin-top: 1px;
	border-radius: 999px;
	background: #cbd5e1;
	transition: background .15s;
}
#la-root .la-ai-toggle__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
	transition: transform .15s;
}
#la-root .la-ai-toggle input:checked + .la-ai-toggle__track {
	background: #4338ca;
}
#la-root .la-ai-toggle input:checked + .la-ai-toggle__track .la-ai-toggle__thumb {
	transform: translateX(18px);
}
#la-root .la-ai-toggle input:focus-visible + .la-ai-toggle__track {
	outline: 2px solid #4338ca;
	outline-offset: 2px;
}
#la-root .la-ai-toggle__text b {
	display: block;
	font-size: 13.5px;
}
#la-root .la-ai-toggle__text small {
	display: block;
	margin-top: 2px;
	color: #6b7280;
	font-size: 12px;
	line-height: 1.45;
}

/* Notice / warning boxes */
#la-root .la-ai-warn {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	font-size: 12.5px;
	color: #1e40af;
}
#la-root .la-ai-warn strong {
	font-size: 13px;
}
#la-root .la-ai-warn--amber {
	margin-top: 10px;
	background: #fffbeb;
	border-color: #fde68a;
	color: #92400e;
}

/* Deterministic facts snapshot (shown when AI is not producing advice) */
#la-root .la-ai-facts {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
}
#la-root .la-ai-fact {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 9px 14px;
	border-left: 3px solid #e5e7eb;
	border-bottom: 1px solid #f1f5f9;
	font-size: 13px;
}
#la-root .la-ai-fact:last-child { border-bottom: none; }
#la-root .la-ai-fact__k {
	flex: 0 0 38%;
	max-width: 220px;
	color: #6b7280;
	font-weight: 600;
}
#la-root .la-ai-fact__v {
	flex: 1 1 auto;
	color: #1f2937;
}
#la-root .la-ai-fact--ok   { border-left-color: #22c55e; }
#la-root .la-ai-fact--info { border-left-color: #3b82f6; }
#la-root .la-ai-fact--warn { border-left-color: #f59e0b; background: #fffdf7; }
#la-root .la-ai-fact--warn .la-ai-fact__v { color: #92400e; }

/* Invitation to enable AI (rendered below the facts in the fallback state) */
#la-root .la-ai-panel__enable {
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
}
#la-root .la-ai-panel__enable p {
	margin: 0 0 10px;
	font-size: 13px;
	color: #475569;
	line-height: 1.5;
}

/* The `hidden` attribute must win over the inline-flex of .la-*-btn so the
   Regenerate button (and the Analyse button, once a result shows) hide. */
#la-root .la-ai-panel [hidden] { display: none !important; }

/* Caching hint shown next to the Regenerate button */
#la-root .la-ai-panel__regen-hint {
	margin: 8px 0 0;
	color: #9ca3af;
	font-size: 11.5px;
	font-style: italic;
}

/* Environment / update status chips inside the facts panel.
   Scoped under .la-ai-fact__v so green-bold OK beats .la-ai-fact--warn .__v. */
#la-root .la-ai-chip { display: inline-block; white-space: nowrap; }
#la-root .la-ai-fact__v .la-ai-chip--ok { color: #15803d; font-weight: 700; }
#la-root .la-ai-fact__v .la-ai-chip--warn { color: #b45309; font-weight: 600; }
#la-root .la-ai-fact__v a.la-ai-chip--link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
#la-root .la-ai-fact__v a.la-ai-chip--link:hover { text-decoration: none; }

/* Breathing room between the facts cartouche and the button/result below. */
#la-root .la-ai-facts { margin-bottom: 14px; }

/* Markdown tables produced by the AI narrative (e.g. top source IPs). Block +
   overflow-x keeps wide tables from breaking the panel on narrow screens. */
#la-root .la-ai-table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
#la-root .la-ai-table th, #la-root .la-ai-table td { border: 1px solid #e2e8f0; padding: 6px 10px; text-align: left; white-space: nowrap; }
#la-root .la-ai-table thead th { background: #f8fafc; font-weight: 600; }
