/* ChatAI Guide tools — brand-aligned styles. Inherits CSS vars from blocksy-child. */

.cg-tool {
	display: block;
	margin: 28px 0;
	padding: 24px;
	border-radius: 14px;
	border: 1px solid #E5E7EB;
	background: linear-gradient(180deg, #fff 0%, #FAFAFB 100%);
	font-family: var(--cg-font-body, 'Inter', sans-serif);
	color: #1F2937;
}
.cg-tool__head { margin-bottom: 16px; }
.cg-tool__head h3 {
	margin: 0 0 6px;
	font-family: var(--cg-font-heading, 'DM Sans', sans-serif);
	font-size: 22px;
	font-weight: 700;
	color: #111827;
}
.cg-tool__head p { margin: 0; color: #4B5563; font-size: 15px; }

.cg-tool label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 12px;
}
.cg-tool textarea,
.cg-tool input[type="text"],
.cg-tool input[type="number"],
.cg-tool select {
	width: 100%;
	font: inherit;
	padding: 10px 12px;
	margin-top: 4px;
	border: 1px solid #D1D5DB;
	border-radius: 8px;
	background: #fff;
	color: #1F2937;
	box-sizing: border-box;
}
.cg-tool textarea { resize: vertical; }
.cg-tool textarea:focus,
.cg-tool input:focus,
.cg-tool select:focus {
	outline: 2px solid var(--cg-primary, #4F46E5);
	outline-offset: 1px;
	border-color: transparent;
}

.cg-tool__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.cg-tool__metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin: 16px 0 4px;
}
.cg-tool__metrics > div {
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	padding: 12px 14px;
}
.cg-tool__metrics strong {
	display: block;
	font-family: var(--cg-font-heading, 'DM Sans', sans-serif);
	font-size: 22px;
	color: var(--cg-primary, #4F46E5);
	line-height: 1.1;
}
.cg-tool__metrics span {
	display: block;
	font-size: 11px;
	color: #6B7280;
	margin-top: 2px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.cg-tool .cg-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 8px;
	font-family: var(--cg-font-heading, 'DM Sans', sans-serif);
	font-weight: 600;
	font-size: 14px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, transform 0.1s;
}
.cg-tool .cg-btn--primary {
	background: var(--cg-primary, #4F46E5);
	color: #fff;
}
.cg-tool .cg-btn--primary:hover { background: var(--cg-secondary, #8B5CF6); }
.cg-tool .cg-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }
.cg-tool .cg-btn--ghost {
	background: transparent;
	color: var(--cg-primary, #4F46E5);
	border-color: #D1D5DB;
}
.cg-tool .cg-btn--ghost:hover { border-color: var(--cg-primary, #4F46E5); }

.cg-tool__output {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid #E5E7EB;
}
.cg-tool__output[hidden] { display: none; }

.cg-tool__details {
	margin-top: 14px;
	font-size: 13px;
	color: #4B5563;
}
.cg-tool__details summary {
	cursor: pointer;
	color: var(--cg-primary, #4F46E5);
	font-weight: 500;
}
.cg-tool__details p { margin: 8px 0 0; }
.cg-tool__details table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.cg-tool__details th, .cg-tool__details td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #E5E7EB; }

.cg-tool__list {
	margin: 0;
	padding-left: 22px;
	color: #1F2937;
	font-size: 15px;
}
.cg-tool__list li { margin-bottom: 10px; line-height: 1.55; }
.cg-tool__list strong { color: #111827; }

.cg-tool__note { font-size: 12px; color: #6B7280; margin-top: 8px; }

.cg-tool .cg-error {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	background: #FEE2E2;
	color: #991B1B;
	font-size: 14px;
}

#cgbn-list li {
	margin-bottom: 10px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 8px;
}
#cgbn-list li strong { display: block; font-size: 16px; color: #111827; }
#cgbn-list li span  { display: block; font-size: 13px; color: #6B7280; margin-top: 2px; }

/* ------------------------------------------------------------------
   [cg_cite] inline citation marker
   ------------------------------------------------------------------ */
.cg-cite {
	display: inline-block;
	font-size: 0.7em;
	line-height: 1;
	margin: 0 1px;
	vertical-align: super;
}
.cg-cite a {
	display: inline-block;
	min-width: 18px;
	padding: 1px 5px;
	border-radius: 4px;
	background: rgba(79, 70, 229, 0.10);
	color: var(--cg-primary, #4F46E5);
	text-decoration: none;
	font-weight: 600;
	text-align: center;
	transition: background 0.15s ease, color 0.15s ease;
}
.cg-cite a:hover,
.cg-cite a:focus {
	background: var(--cg-primary, #4F46E5);
	color: #fff;
}

/* ------------------------------------------------------------------
   [cg_sources] panel
   ------------------------------------------------------------------ */
.cg-sources {
	margin: 48px 0 0;
	padding: 28px 28px 24px;
	border-radius: 16px;
	background: linear-gradient(180deg, #FAFAFB 0%, #F3F4F6 100%);
	border: 1px solid #E5E7EB;
	color: #1F2937;
	font-family: var(--cg-font-body, 'Inter', sans-serif);
}
.cg-sources__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}
.cg-sources__icon {
	color: var(--cg-primary, #4F46E5);
	flex-shrink: 0;
}
.cg-sources__head h2 {
	margin: 0;
	flex: 1;
	font-family: var(--cg-font-heading, 'DM Sans', sans-serif);
	font-size: 22px;
	font-weight: 700;
	color: #111827;
	letter-spacing: -0.01em;
}
.cg-sources__count {
	font-size: 12px;
	font-weight: 600;
	color: var(--cg-primary, #4F46E5);
	background: rgba(79, 70, 229, 0.10);
	padding: 4px 10px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.cg-sources__lede {
	margin: 0 0 20px;
	font-size: 14px;
	color: #4B5563;
	line-height: 1.55;
}

.cg-sources__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.cg-source {
	display: flex;
	gap: 14px;
	padding: 14px 0;
	border-top: 1px solid #E5E7EB;
}
.cg-source:first-child { border-top: 0; padding-top: 4px; }
.cg-source__num {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--cg-primary, #4F46E5);
	color: #fff;
	font-family: var(--cg-font-heading, 'DM Sans', sans-serif);
	font-weight: 700;
	font-size: 13px;
	border-radius: 8px;
	scroll-margin-top: 80px;
}
.cg-source__body { flex: 1; min-width: 0; }
.cg-source__title {
	display: block;
	font-family: var(--cg-font-heading, 'DM Sans', sans-serif);
	font-size: 15px;
	font-weight: 600;
	color: #111827;
	text-decoration: none;
	line-height: 1.4;
	margin-bottom: 4px;
	transition: color 0.15s ease;
}
.cg-source__title:hover,
.cg-source__title:focus { color: var(--cg-primary, #4F46E5); }
.cg-source__title::after {
	content: ' ↗';
	color: var(--cg-secondary, #8B5CF6);
	font-weight: 400;
}
.cg-source__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	font-size: 12px;
	color: #6B7280;
	align-items: center;
}
.cg-source__publisher {
	font-weight: 500;
	color: #374151;
}
.cg-source__domain {
	font-family: var(--cg-font-code, ui-monospace, monospace);
	font-size: 11px;
	background: #fff;
	border: 1px solid #E5E7EB;
	padding: 2px 8px;
	border-radius: 6px;
	color: #4B5563;
}
.cg-source__date::before { content: '· '; color: #9CA3AF; }

.cg-sources__note {
	margin: 18px 0 0;
	padding-top: 14px;
	border-top: 1px dashed #D1D5DB;
	font-size: 12px;
	color: #6B7280;
	font-style: italic;
}

@media (max-width: 540px) {
	.cg-sources { padding: 20px; }
	.cg-source { flex-direction: column; gap: 6px; }
	.cg-source__num { margin-bottom: 4px; }
}
