/**
 * Librarian for Recencio — Frontend Styles
 *
 * All visual decisions use CSS custom properties with inherit defaults
 * for theme compatibility. All selectors scoped under .lbr-wrap.
 * Visual design matches the prototype: Lora + Open Sans typography,
 * dark gradient header, card grid, filter pills.
 *
 * @package Librarian
 * @since   1.0.0
 */

/* --------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------- */

:root {
	/* Typography */
	--lbr-font-family: inherit;
	--lbr-font-heading: 'Lora', Georgia, serif;
	--lbr-font-body: 'Open Sans', Arial, sans-serif;
	--lbr-font-size-base: 16px;
	--lbr-font-size-heading: 1.5em;
	--lbr-font-size-small: 0.875em;
	--lbr-line-height: inherit;

	/* Colours — matches prototype palette */
	--lbr-primary-color: #283B91;
	--lbr-primary-hover: #131D48;
	--lbr-heading-color: #131D48;
	--lbr-text-color: #5A5A5A;
	--lbr-text-muted: #9B9C9F;
	--lbr-background: #FAFBFD;
	--lbr-card-background: #FFFFFF;
	--lbr-alt-background: #F2F4F5;
	--lbr-border-color: #D6D9DD;

	/* Cards */
	--lbr-card-radius: 10px;
	--lbr-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
	--lbr-card-shadow-hover: 0 8px 24px rgba(40, 59, 145, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
	--lbr-card-padding: 1rem;

	/* Layout */
	--lbr-grid-gap: 28px 20px;
	--lbr-section-spacing: 2rem;
	--lbr-max-width: 1200px;
	--lbr-btn-radius: 100px;

	/* Search */
	--lbr-input-background: rgba(255, 255, 255, 0.08);
	--lbr-input-border: rgba(255, 255, 255, 0.15);
	--lbr-input-border-focus: rgba(255, 255, 255, 0.3);
	--lbr-input-radius: 10px;

	/* Chat */
	--lbr-chat-background: #f9fafb;
	--lbr-chat-user-bubble: var(--lbr-primary-color);
	--lbr-chat-assistant-bubble: #f3f4f6;
}

/* --------------------------------------------------------
   Animations
   -------------------------------------------------------- */

@keyframes lbr-chipIn {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes lbr-fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes lbr-gridIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --------------------------------------------------------
   Base Wrapper
   -------------------------------------------------------- */

.lbr-wrap {
	--lbr-hero-base: #283B91;
	font-family: var(--lbr-font-body);
	font-size: var(--lbr-font-size-base);
	line-height: var(--lbr-line-height);
	/* Break out of WordPress block theme constrained layout.
	   The alignfull class on the mount div tells the block theme
	   to remove the max-width constraint. */
	color: var(--lbr-text-color);
	background: var(--lbr-background);
	box-sizing: border-box;
}

.lbr-wrap *,
.lbr-wrap *::before,
.lbr-wrap *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------
   Header Section (brand gradient, driven by --lbr-hero-base)
   -------------------------------------------------------- */

.lbr-wrap .lbr-header-section {
	/* Solid fallback first for browsers without color-mix(). */
	background: var(--lbr-hero-base, #283B91);
	background: linear-gradient(135deg, var(--lbr-hero-base, #283B91) 0%, color-mix(in srgb, var(--lbr-hero-base, #283B91) 78%, #ffffff) 100%);
	position: relative;
	overflow: hidden;
}

.lbr-wrap .lbr-header-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: radial-gradient(ellipse at 30% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
	pointer-events: none;
}

/* --------------------------------------------------------
   Hero / Search Area
   -------------------------------------------------------- */

.lbr-wrap .lbr-hero {
	padding: 48px 48px 20px;
	text-align: center;
	position: relative;
}

.lbr-wrap .lbr-hero-title {
	color: rgba(255, 255, 255, 0.92);
	font-family: var(--lbr-font-heading);
	font-size: 48px;
	font-weight: 400;
	line-height: 1.2;
	margin: 0 0 10px;
}

.lbr-wrap .lbr-hero-subtitle {
	color: rgba(255, 255, 255, 0.45);
	font-family: var(--lbr-font-body);
	font-size: 15px;
	margin: 0 0 36px;
}

.lbr-wrap .lbr-search-wrap {
	max-width: 640px;
	margin: 0 auto;
	position: relative;
}

.lbr-wrap .lbr-search-input {
	width: 100%;
	padding: 16px 96px 16px 24px;
	border: 1px solid var(--lbr-input-border);
	border-radius: var(--lbr-input-radius);
	background: var(--lbr-input-background);
	backdrop-filter: blur(10px);
	color: white;
	font-family: var(--lbr-font-heading);
	font-size: 18px;
	font-style: italic;
	outline: none;
	transition: all 0.3s ease;
}

.lbr-wrap .lbr-search-input::placeholder {
	color: rgba(255, 255, 255, 0.35);
	font-style: italic;
}

.lbr-wrap .lbr-search-input:focus {
	border-color: var(--lbr-input-border-focus);
	background: rgba(255, 255, 255, 0.12);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Search buttons */

.lbr-wrap .lbr-search-btns {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	gap: 4px;
}

.lbr-wrap .lbr-search-btn,
.lbr-wrap .lbr-clear-btn {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	border: none;
	background: rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	font-size: 18px;
}

.lbr-wrap .lbr-search-btn:hover,
.lbr-wrap .lbr-clear-btn:hover {
	background: rgba(255, 255, 255, 0.2);
	color: white;
}

.lbr-wrap .lbr-clear-btn {
	font-size: 14px;
	display: none;
}

.lbr-wrap .lbr-clear-btn--visible {
	display: flex;
}

/* Tab hint */

.lbr-wrap .lbr-tab-hint {
	text-align: center;
	margin-top: 10px;
	font-family: var(--lbr-font-body);
	font-size: 12px;
	color: rgba(255, 255, 255, 0.25);
	transition: opacity 0.3s;
}

.lbr-wrap .lbr-tab-hint kbd {
	display: inline-block;
	padding: 1px 6px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	font-family: var(--lbr-font-body);
	font-size: 11px;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.4);
	margin: 0 2px;
}

/* --------------------------------------------------------
   Question Chips
   -------------------------------------------------------- */

.lbr-wrap .lbr-chips {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
	margin-top: 16px;
	min-height: 36px;
}

.lbr-wrap .lbr-chip {
	padding: 6px 14px;
	border-radius: var(--lbr-btn-radius);
	border: 1px solid rgba(255, 255, 255, 0.15);
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.6);
	font-family: var(--lbr-font-body);
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s;
	opacity: 0;
	animation: lbr-chipIn 0.3s ease forwards;
}

.lbr-wrap .lbr-chip:hover {
	background: rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.9);
	border-color: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------
   Stats Section
   -------------------------------------------------------- */

.lbr-wrap .lbr-stats {
	display: flex;
	gap: 48px;
	justify-content: center;
	padding: 28px 48px 32px;
	position: relative;
}

.lbr-wrap .lbr-stat {
	text-align: center;
}

.lbr-wrap .lbr-stat-num {
	color: rgba(255, 255, 255, 0.85);
	font-family: var(--lbr-font-heading);
	font-size: 28px;
	font-weight: 600;
}

.lbr-wrap .lbr-stat-label {
	color: rgba(255, 255, 255, 0.35);
	font-family: var(--lbr-font-body);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	margin-top: 2px;
}

/* --------------------------------------------------------
   Main Content Area
   -------------------------------------------------------- */

.lbr-wrap .lbr-main {
	max-width: var(--lbr-max-width);
	margin: 0 auto;
	padding: 32px 48px 80px;
}

/* --------------------------------------------------------
   Context Line
   -------------------------------------------------------- */

.lbr-wrap .lbr-context-line-wrap {
	min-height: 0;
}

.lbr-wrap .lbr-context-line {
	text-align: center;
	color: var(--lbr-text-color);
	font-family: var(--lbr-font-heading);
	font-size: 18px;
	font-style: italic;
	margin-bottom: 24px;
	opacity: 0;
	animation: lbr-fadeIn 0.5s ease forwards;
	padding: 12px 20px;
}

/* --------------------------------------------------------
   Loading
   -------------------------------------------------------- */

.lbr-wrap .lbr-loading {
	text-align: center;
	color: var(--lbr-text-muted);
	font-family: var(--lbr-font-heading);
	font-style: italic;
	font-size: 18px;
	padding: 48px 0;
	opacity: 0;
	animation: lbr-fadeIn 0.3s ease forwards;
}

/* --------------------------------------------------------
   Category Filter Pills
   -------------------------------------------------------- */

.lbr-wrap .lbr-categories {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
	margin-bottom: 28px;
}

.lbr-wrap .lbr-cat-pill {
	padding: 8px 16px;
	border-radius: var(--lbr-btn-radius);
	border: 1px solid var(--lbr-border-color);
	background: var(--lbr-card-background);
	color: var(--lbr-text-color);
	font-family: var(--lbr-font-body);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	white-space: nowrap;
}

.lbr-wrap .lbr-cat-pill:hover {
	border-color: var(--lbr-primary-color);
	color: var(--lbr-primary-color);
}

.lbr-wrap .lbr-cat-pill--active {
	background: var(--lbr-primary-color);
	color: white;
	border-color: var(--lbr-primary-color);
}

.lbr-wrap .lbr-cat-count {
	font-weight: 400;
	opacity: 0.6;
	margin-left: 4px;
}

/* --------------------------------------------------------
   Divider
   -------------------------------------------------------- */

.lbr-wrap .lbr-divider {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 28px;
}

.lbr-wrap .lbr-divider-line {
	flex: 1;
	height: 1px;
	background: var(--lbr-border-color);
}

.lbr-wrap .lbr-divider-text {
	color: var(--lbr-text-muted);
	font-family: var(--lbr-font-body);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 2px;
	white-space: nowrap;
}

/* --------------------------------------------------------
   Book Card Grid
   -------------------------------------------------------- */

.lbr-wrap .lbr-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: var(--lbr-grid-gap);
}

.lbr-wrap .lbr-book {
	text-decoration: none;
	color: inherit;
	display: block;
	transition: transform 0.2s ease;
}

.lbr-wrap .lbr-book:hover {
	transform: translateY(-4px);
}

/* Animation */

.lbr-wrap .lbr-book-anim {
	opacity: 0;
	animation: lbr-gridIn 0.4s ease forwards;
}

/* Cover wrapper */

.lbr-wrap .lbr-cover-wrap {
	position: relative;
	border-radius: var(--lbr-card-radius);
	overflow: hidden;
	background: var(--lbr-alt-background);
	aspect-ratio: 2 / 3;
	box-shadow: var(--lbr-card-shadow);
	transition: box-shadow 0.2s;
}

.lbr-wrap .lbr-book:hover .lbr-cover-wrap {
	box-shadow: var(--lbr-card-shadow-hover);
}

.lbr-wrap .lbr-cover-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Cover fallback (when image fails to load) */

.lbr-wrap .lbr-cover-fallback {
	color: rgba(255, 255, 255, 0.7);
	font-family: var(--lbr-font-heading);
	font-size: 14px;
	padding: 20px;
	text-align: center;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80%;
}

/* Category badge on cover */

.lbr-wrap .lbr-cover-badge {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 6px 10px;
	background: linear-gradient(transparent, rgba(19, 29, 72, 0.75));
	color: rgba(255, 255, 255, 0.9);
	font-family: var(--lbr-font-body);
	font-size: 10px;
	letter-spacing: 0.3px;
	text-transform: uppercase;
}

/* Book metadata */

.lbr-wrap .lbr-book-title {
	margin-top: 10px;
	font-family: var(--lbr-font-heading);
	font-size: 15px;
	font-weight: 600;
	color: var(--lbr-heading-color);
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.lbr-wrap .lbr-book-author {
	margin-top: 3px;
	font-family: var(--lbr-font-body);
	font-size: 12px;
	color: var(--lbr-text-color);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lbr-wrap .lbr-book-reviewer {
	margin-top: 1px;
	font-family: var(--lbr-font-body);
	font-size: 11px;
	color: var(--lbr-text-muted);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --------------------------------------------------------
   No Results
   -------------------------------------------------------- */

.lbr-wrap .lbr-no-results {
	text-align: center;
	padding: 64px 24px;
}

.lbr-wrap .lbr-no-results-icon {
	font-size: 32px;
	color: var(--lbr-border-color);
	margin-bottom: 16px;
}

.lbr-wrap .lbr-no-results-text {
	color: var(--lbr-text-muted);
	font-family: var(--lbr-font-body);
	font-size: 14px;
	max-width: 400px;
	margin: 0 auto;
	line-height: 1.6;
}

/* --------------------------------------------------------
   Load More
   -------------------------------------------------------- */

.lbr-wrap .lbr-load-more-wrap {
	text-align: center;
	margin-top: 40px;
}

.lbr-wrap .lbr-load-more-btn {
	padding: 12px 36px;
	border-radius: var(--lbr-btn-radius);
	border: 1px solid var(--lbr-border-color);
	background: transparent;
	color: var(--lbr-text-color);
	font-family: var(--lbr-font-body);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: all 0.2s;
}

.lbr-wrap .lbr-load-more-btn:hover {
	background: var(--lbr-primary-color);
	color: white;
	border-color: var(--lbr-primary-color);
}

.lbr-wrap .lbr-load-more-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* --------------------------------------------------------
   Responsive — Mobile First
   -------------------------------------------------------- */

@media (max-width: 768px) {
	.lbr-wrap .lbr-hero {
		padding: 32px 20px 16px;
	}

	.lbr-wrap .lbr-hero-title {
		font-size: 32px;
	}

	.lbr-wrap .lbr-hero-subtitle {
		margin-bottom: 24px;
	}

	.lbr-wrap .lbr-search-input {
		font-size: 16px;
		padding: 14px 88px 14px 18px;
	}

	.lbr-wrap .lbr-stats {
		gap: 24px;
		padding: 24px 20px 28px;
	}

	.lbr-wrap .lbr-stat-num {
		font-size: 22px;
	}

	.lbr-wrap .lbr-main {
		padding: 24px 20px 80px;
	}

	.lbr-wrap .lbr-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 20px 14px;
	}

	.lbr-wrap .lbr-book-title {
		font-size: 13px;
	}

	.lbr-wrap .lbr-categories {
		gap: 6px;
	}

	.lbr-wrap .lbr-cat-pill {
		font-size: 12px;
		padding: 6px 12px;
	}

	.lbr-wrap .lbr-context-line {
		font-size: 16px;
		padding: 8px 12px;
	}
}

@media (max-width: 480px) {
	.lbr-wrap .lbr-grid {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
		gap: 16px 10px;
	}

	.lbr-wrap .lbr-book-title {
		font-size: 12px;
	}

	.lbr-wrap .lbr-book-author {
		font-size: 11px;
	}

	.lbr-wrap .lbr-cover-badge {
		font-size: 9px;
		padding: 4px 8px;
	}
}

/* --------------------------------------------------------
   Chat Widget
   -------------------------------------------------------- */

/* Chat bubble (floating button) */

.lbr-wrap .lbr-chat-bubble {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9999;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border-radius: var(--lbr-btn-radius);
	border: none;
	background: var(--lbr-primary-color);
	color: white;
	font-family: var(--lbr-font-body);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(40, 59, 145, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
}

.lbr-wrap .lbr-chat-bubble:hover {
	background: var(--lbr-primary-hover);
	box-shadow: 0 6px 24px rgba(40, 59, 145, 0.4), 0 3px 8px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.lbr-wrap .lbr-chat-bubble--open {
	opacity: 0.5;
	transform: scale(0.9);
}

.lbr-wrap .lbr-chat-bubble-icon {
	font-size: 18px;
	line-height: 1;
}

.lbr-wrap .lbr-chat-bubble-text {
	line-height: 1;
}

/* Chat panel */

.lbr-wrap .lbr-chat-panel {
	position: fixed;
	bottom: 80px;
	right: 24px;
	z-index: 9998;
	width: 380px;
	max-width: calc(100vw - 48px);
	height: 500px;
	max-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
	background: var(--lbr-chat-background);
	border-radius: 16px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	animation: lbr-chatPanelIn 0.3s ease forwards;
}

@keyframes lbr-chatPanelIn {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Panel header */

.lbr-wrap .lbr-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: var(--lbr-primary-color);
	color: white;
	flex-shrink: 0;
}

.lbr-wrap .lbr-chat-header-title {
	font-family: var(--lbr-font-heading);
	font-size: 15px;
	font-weight: 600;
}

.lbr-wrap .lbr-chat-close {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	color: white;
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.lbr-wrap .lbr-chat-close:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* "+ New question" header button */

.lbr-wrap .lbr-chat-new-question {
	margin-left: auto;
	margin-right: 8px;
	padding: 4px 10px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: transparent;
	color: white;
	font-size: 12px;
	cursor: pointer;
	transition: background 0.2s;
}

.lbr-wrap .lbr-chat-new-question:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* Disabled chat bubble */

.lbr-wrap .lbr-chat-bubble--disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.lbr-wrap .lbr-chat-bubble--disabled:hover {
	transform: none;
}

/* "Search changed" scope banner */

.lbr-wrap .lbr-chat-scope-banner {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: #fff7ed;
	border-top: 1px solid #fed7aa;
	font-size: 12px;
	color: #7c2d12;
	flex-wrap: wrap;
}

.lbr-wrap .lbr-chat-scope-banner-text {
	flex: 1 1 auto;
	min-width: 0;
}

.lbr-wrap .lbr-chat-scope-banner-actions {
	display: inline-flex;
	gap: 6px;
	flex-shrink: 0;
}

.lbr-wrap .lbr-chat-scope-rescope,
.lbr-wrap .lbr-chat-scope-dismiss {
	padding: 3px 8px;
	border-radius: 4px;
	border: 1px solid #fdba74;
	background: white;
	color: #7c2d12;
	font-size: 11px;
	cursor: pointer;
}

.lbr-wrap .lbr-chat-scope-rescope:hover {
	background: #fed7aa;
}

.lbr-wrap .lbr-chat-scope-dismiss:hover {
	background: #fef3c7;
}

/* Messages area */

.lbr-wrap .lbr-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Message bubbles */

.lbr-wrap .lbr-chat-msg {
	display: flex;
	flex-direction: column;
	max-width: 85%;
	animation: lbr-fadeIn 0.3s ease;
}

.lbr-wrap .lbr-chat-msg--user {
	align-self: flex-end;
}

.lbr-wrap .lbr-chat-msg--assistant {
	align-self: flex-start;
}

.lbr-wrap .lbr-chat-msg-bubble {
	padding: 10px 14px;
	border-radius: 12px;
	font-family: var(--lbr-font-body);
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
}

.lbr-wrap .lbr-chat-msg--user .lbr-chat-msg-bubble {
	background: var(--lbr-chat-user-bubble);
	color: white;
	border-bottom-right-radius: 4px;
}

.lbr-wrap .lbr-chat-msg--assistant .lbr-chat-msg-bubble {
	background: var(--lbr-chat-assistant-bubble);
	color: var(--lbr-heading-color);
	border-bottom-left-radius: 4px;
}

/* Thinking animation */

.lbr-wrap .lbr-chat-msg--thinking .lbr-chat-msg-bubble {
	opacity: 0.7;
	font-style: italic;
}

/* Citations */

.lbr-wrap .lbr-chat-citations {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 6px;
	padding-left: 4px;
}

.lbr-wrap .lbr-chat-citation-link {
	font-family: var(--lbr-font-body);
	font-size: 12px;
	color: var(--lbr-primary-color);
	text-decoration: none;
	transition: color 0.2s;
}

.lbr-wrap .lbr-chat-citation-link:hover {
	color: var(--lbr-primary-hover);
	text-decoration: underline;
}

/* Chat input area */

.lbr-wrap .lbr-chat-input-wrap {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid var(--lbr-border-color);
	background: white;
	flex-shrink: 0;
}

.lbr-wrap .lbr-chat-input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid var(--lbr-border-color);
	border-radius: 8px;
	font-family: var(--lbr-font-body);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
	color: var(--lbr-heading-color);
	background: var(--lbr-chat-background);
}

.lbr-wrap .lbr-chat-input::placeholder {
	color: var(--lbr-text-muted);
}

.lbr-wrap .lbr-chat-input:focus {
	border-color: var(--lbr-primary-color);
}

.lbr-wrap .lbr-chat-send {
	padding: 10px 16px;
	border-radius: 8px;
	border: none;
	background: var(--lbr-primary-color);
	color: white;
	font-family: var(--lbr-font-body);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
}

.lbr-wrap .lbr-chat-send:hover {
	background: var(--lbr-primary-hover);
}

/* Responsive — Chat widget */

@media (max-width: 768px) {
	.lbr-wrap .lbr-chat-bubble-text {
		display: none;
	}

	.lbr-wrap .lbr-chat-bubble {
		padding: 14px;
		border-radius: 50%;
	}

	.lbr-wrap .lbr-chat-panel {
		right: 12px;
		bottom: 72px;
		width: calc(100vw - 24px);
		height: calc(100vh - 100px);
		border-radius: 12px;
	}
}

@media (max-width: 480px) {
	.lbr-wrap .lbr-chat-bubble {
		bottom: 16px;
		right: 16px;
	}

	.lbr-wrap .lbr-chat-panel {
		right: 8px;
		bottom: 64px;
		width: calc(100vw - 16px);
	}
}
