/**
 * PressBot Pro - Frontend Widget Styles
 * Matches free version exactly
 */

/* CSS Variables — primary color defined at :root so PHP-injected overrides take effect */
:root {
	--pressbot-primary: #6366f1;
	--pressbot-primary-dark: color-mix(in srgb, var(--pressbot-primary) 85%, black);
	--pressbot-primary-light: color-mix(in srgb, var(--pressbot-primary) 15%, white);
}

.pressbot-widget {
	--pressbot-bg: #ffffff;
	--pressbot-text: #1f2937;
	--pressbot-text-light: #6b7280;
	--pressbot-border: #e5e7eb;
	--pressbot-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	--pressbot-radius: 16px;
	--pressbot-radius-sm: 12px;
	--pressbot-msg-bot-bg: #f3f4f6;
	--pressbot-msg-bot-text: var(--pressbot-text);
	--pressbot-code-bg: #1f2937;
	--pressbot-code-header-bg: #111827;
	--pressbot-code-text: #e5e7eb;
	--pressbot-code-border: #374151;
}

/* Dark Mode */
.pressbot-widget.pressbot-dark {
	--pressbot-bg: #1a1a2e;
	--pressbot-text: #e2e8f0;
	--pressbot-text-light: #94a3b8;
	--pressbot-border: #334155;
	--pressbot-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	--pressbot-msg-bot-bg: #252542;
	--pressbot-msg-bot-text: #e2e8f0;
	--pressbot-code-bg: #0f0f23;
	--pressbot-code-header-bg: #0a0a1a;
	--pressbot-code-text: #e5e7eb;
	--pressbot-code-border: #1e293b;
}

/* Widget Container */
.pressbot-widget {
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.pressbot-widget.pressbot-right {
	right: 20px;
}

.pressbot-widget.pressbot-left {
	left: 20px;
}

/* Toggle Button */
.pressbot-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--pressbot-primary);
	color: white;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--pressbot-shadow);
	transition: transform 0.2s ease, background 0.2s ease;
}

.pressbot-toggle:hover {
	transform: scale(1.05);
	background: var(--pressbot-primary-dark);
}

.pressbot-toggle:focus {
	outline: 2px solid var(--pressbot-primary);
	outline-offset: 2px;
}

/* Entrance animations — hidden state while waiting for animation trigger */
.pressbot-widget.pressbot-entrance-pending .pressbot-toggle {
	opacity: 0;
	pointer-events: none;
}

/* Slide from right — sweeps in with a subtle arc and shadow bloom */
.pressbot-widget.pressbot-entrance-slide-right .pressbot-toggle {
	animation: pb-slide-right 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes pb-slide-right {
	0% { opacity: 0; transform: translateX(40px) translateY(8px) scale(0.9); box-shadow: none; }
	60% { opacity: 1; transform: translateX(-3px) translateY(0) scale(1.02); }
	100% { opacity: 1; transform: translateX(0) translateY(0) scale(1); box-shadow: var(--pressbot-shadow); }
}

/* Slide from left — mirror of slide-right */
.pressbot-widget.pressbot-entrance-slide-left .pressbot-toggle {
	animation: pb-slide-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes pb-slide-left {
	0% { opacity: 0; transform: translateX(-40px) translateY(8px) scale(0.9); box-shadow: none; }
	60% { opacity: 1; transform: translateX(3px) translateY(0) scale(1.02); }
	100% { opacity: 1; transform: translateX(0) translateY(0) scale(1); box-shadow: var(--pressbot-shadow); }
}

/* Fade in — gentle materialization with a hint of upward drift */
.pressbot-widget.pressbot-entrance-fade .pressbot-toggle {
	animation: pb-fade 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes pb-fade {
	0% { opacity: 0; transform: translateY(6px); }
	100% { opacity: 1; transform: translateY(0); }
}

/* Bounce in — playful spring with overshoot and settle */
.pressbot-widget.pressbot-entrance-bounce .pressbot-toggle {
	animation: pb-bounce-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes pb-bounce-in {
	0% { opacity: 0; transform: scale(0) rotate(-8deg); }
	50% { opacity: 1; transform: scale(1.12) rotate(2deg); }
	75% { transform: scale(0.95) rotate(-1deg); }
	100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Scale up — confident emergence from the center with a soft shadow build */
.pressbot-widget.pressbot-entrance-scale .pressbot-toggle {
	animation: pb-scale 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes pb-scale {
	0% { opacity: 0; transform: scale(0.4); box-shadow: none; }
	70% { opacity: 1; transform: scale(1.04); }
	100% { opacity: 1; transform: scale(1); box-shadow: var(--pressbot-shadow); }
}

.pressbot-toggle .pressbot-icon-close {
	display: none;
}

/* Mascot icon in toggle button (agent mode) */
.pressbot-toggle .pressbot-icon-mascot {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

.pressbot-widget.pressbot-open .pressbot-toggle .pressbot-icon-chat {
	display: none;
}

.pressbot-widget.pressbot-open .pressbot-toggle .pressbot-icon-close {
	display: block;
}

/* Chat Window */
.pressbot-window {
	position: absolute;
	bottom: 70px;
	width: 380px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: var(--pressbot-bg);
	border-radius: var(--pressbot-radius);
	box-shadow: var(--pressbot-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.95);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.pressbot-right .pressbot-window {
	right: 0;
}

.pressbot-left .pressbot-window {
	left: 0;
}

.pressbot-widget.pressbot-open .pressbot-window {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.pressbot-window[hidden] {
	display: none;
}

/* Header */
.pressbot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	background: var(--pressbot-primary);
	color: white;
}

.pressbot-header-info {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.pressbot-avatar {
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.pressbot-avatar img {
	width: 28px;
	height: 28px;
	object-fit: contain;
}

.pressbot-bot-name {
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pressbot-status {
	font-size: 12px;
	opacity: 0.8;
}

.pressbot-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.pressbot-close {
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: white;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.pressbot-close:hover {
	background: rgba(255, 255, 255, 0.2);
}

.pressbot-header-actions .pressbot-theme-toggle {
	background: rgba(255, 255, 255, 0.1) !important;
	border: none !important;
	color: white !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 32px;
	border-radius: 50% !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	transition: background 0.2s, border-color 0.2s;
	box-shadow: none;
}

.pressbot-header-actions .pressbot-theme-toggle:hover {
	background: rgba(255, 255, 255, 0.2) !important;
}

/* Messages Container */
.pressbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Message Bubbles */
.pressbot-message {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: var(--pressbot-radius-sm);
	word-wrap: break-word;
}

.pressbot-message.pressbot-user {
	align-self: flex-end;
	background: var(--pressbot-primary);
	color: white;
	border-bottom-right-radius: 4px;
}

.pressbot-message.pressbot-bot {
	align-self: flex-start;
	background: var(--pressbot-msg-bot-bg);
	color: var(--pressbot-msg-bot-text);
	border-bottom-left-radius: 4px;
}

.pressbot-message.pressbot-bot p {
	margin: 0 0 8px 0;
}

.pressbot-message.pressbot-bot p:last-child {
	margin-bottom: 0;
}

.pressbot-message.pressbot-bot code {
	background: rgba(127, 127, 127, 0.15);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 13px;
}

/* Code Block Wrapper */
.pressbot-code-block {
	margin: 8px 0;
	border-radius: 8px;
	overflow: hidden;
	background: var(--pressbot-code-bg);
}

.pressbot-code-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 12px;
	background: var(--pressbot-code-header-bg);
	border-bottom: 1px solid var(--pressbot-code-border);
}

.pressbot-code-lang {
	font-size: 11px;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.pressbot-code-copy {
	font-size: 11px;
	color: #9ca3af;
	background: none;
	border: 1px solid #4b5563;
	border-radius: 4px;
	padding: 2px 8px;
	cursor: pointer;
	line-height: 1.4;
	transition: color 0.15s, border-color 0.15s;
}

.pressbot-code-copy:hover {
	color: var(--pressbot-code-text);
	border-color: #9ca3af;
}

.pressbot-message.pressbot-bot pre {
	background: var(--pressbot-code-bg);
	color: var(--pressbot-code-text);
	padding: 12px;
	overflow-x: auto;
	margin: 0;
	border-radius: 0;
}

/* Standalone pre (no wrapper) */
.pressbot-message.pressbot-bot > pre {
	border-radius: 8px;
	margin: 8px 0;
}

.pressbot-message.pressbot-bot pre code {
	background: none;
	padding: 0;
	font-size: 13px;
	line-height: 1.5;
	font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
}

.pressbot-message.pressbot-bot ul,
.pressbot-message.pressbot-bot ol {
	margin: 8px 0;
	padding-left: 20px;
}

.pressbot-message.pressbot-bot li {
	margin-bottom: 4px;
}

.pressbot-message.pressbot-bot li:last-child {
	margin-bottom: 0;
}

.pressbot-message.pressbot-bot h1,
.pressbot-message.pressbot-bot h2,
.pressbot-message.pressbot-bot h3,
.pressbot-message.pressbot-bot h4 {
	margin: 12px 0 8px 0;
	font-weight: 600;
	line-height: 1.3;
	color: var(--pressbot-text);
}

.pressbot-message.pressbot-bot h1:first-child,
.pressbot-message.pressbot-bot h2:first-child,
.pressbot-message.pressbot-bot h3:first-child,
.pressbot-message.pressbot-bot h4:first-child {
	margin-top: 0;
}

.pressbot-message.pressbot-bot h1 {
	font-size: 18px;
}

.pressbot-message.pressbot-bot h2 {
	font-size: 16px;
}

.pressbot-message.pressbot-bot h3 {
	font-size: 15px;
}

.pressbot-message.pressbot-bot h4 {
	font-size: 14px;
}

.pressbot-message.pressbot-bot strong {
	font-weight: 600;
}

.pressbot-dark .pressbot-message.pressbot-bot strong {
	font-weight: 700;
	color: #ffffff;
}

.pressbot-message.pressbot-bot em {
	font-style: italic;
}

.pressbot-message.pressbot-bot a {
	color: var(--pressbot-primary);
	text-decoration: underline;
}

/* System Messages (info, success, cancellation) */
.pressbot-message.pressbot-system {
	align-self: center;
	max-width: 90%;
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	font-size: 13px;
	text-align: center;
	padding: 8px 14px;
}

/* System Error Messages */
.pressbot-message.pressbot-system.pressbot-system--error {
	background: #fef2f2;
	color: #991b1b;
	border-color: #fecaca;
}

/* Dark Mode — system messages */
.pressbot-dark .pressbot-message.pressbot-system {
	background: #052e16;
	color: #86efac;
	border-color: #14532d;
}

.pressbot-dark .pressbot-message.pressbot-system.pressbot-system--error {
	background: #450a0a;
	color: #fca5a5;
	border-color: #7f1d1d;
}

/* Dark Mode — scrollbar */
.pressbot-dark .pressbot-messages::-webkit-scrollbar-thumb {
	background: #475569;
}

.pressbot-dark .pressbot-messages::-webkit-scrollbar-thumb:hover {
	background: #64748b;
}

/* Dark Mode — confirmation dialog */
.pressbot-dark .pressbot-confirm-btn-cancel {
	background: #334155;
	color: var(--pressbot-text);
}

/* Typing Indicator */
.pressbot-typing {
	display: flex;
	gap: 4px;
	padding: 12px 14px;
	background: var(--pressbot-msg-bot-bg);
	border-radius: var(--pressbot-radius-sm);
	border-bottom-left-radius: 4px;
	width: fit-content;
}

.pressbot-typing span {
	width: 8px;
	height: 8px;
	background: var(--pressbot-text-light);
	border-radius: 50%;
	animation: pressbot-bounce 1.4s infinite ease-in-out both;
}

.pressbot-typing span:nth-child(1) {
	animation-delay: -0.32s;
}

.pressbot-typing span:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes pressbot-bounce {
	0%, 80%, 100% {
		transform: scale(0);
	}
	40% {
		transform: scale(1);
	}
}

/* Pipeline Progress Indicator (Optimistic Stages) */
.pressbot-pipeline {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px;
	background: var(--pressbot-msg-bot-bg);
	border-radius: var(--pressbot-radius-sm);
	border-bottom-left-radius: 4px;
	width: fit-content;
	min-width: 200px;
	animation: pressbot-fade-in 0.2s ease-out;
}

.pressbot-pipeline-stage {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	line-height: 1.4;
	transition: opacity 0.3s ease;
}

.pressbot-pipeline-stage--pending {
	opacity: 0.35;
}

.pressbot-pipeline-stage--active {
	opacity: 1;
	animation: pressbot-fade-in 0.3s ease-out;
}

.pressbot-pipeline-stage--complete {
	opacity: 0.7;
}

.pressbot-pipeline-emoji {
	flex-shrink: 0;
	width: 18px;
	text-align: center;
}

.pressbot-pipeline-label {
	color: var(--pressbot-text);
}

.pressbot-pipeline-stage--active .pressbot-pipeline-label {
	font-weight: 500;
}

.pressbot-pipeline-check {
	color: var(--pressbot-primary);
	font-weight: bold;
	font-size: 14px;
	margin-left: 2px;
}

.pressbot-pipeline-spinner {
	display: inline-flex;
	gap: 3px;
	margin-left: 2px;
}

.pressbot-pipeline-spinner span {
	width: 4px;
	height: 4px;
	background: var(--pressbot-primary);
	border-radius: 50%;
	animation: pressbot-bounce 1.4s infinite ease-in-out both;
}

.pressbot-pipeline-spinner span:nth-child(1) {
	animation-delay: -0.32s;
}

.pressbot-pipeline-spinner span:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes pressbot-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Error Message */
.pressbot-error {
	background: #fef2f2;
	color: #dc2626;
	padding: 10px 14px;
	border-radius: var(--pressbot-radius-sm);
	font-size: 13px;
}

/* Form */
.pressbot-form {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid var(--pressbot-border);
	background: var(--pressbot-bg);
}

.pressbot-input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid var(--pressbot-border);
	border-radius: 24px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.2s;
	color: var(--pressbot-text);
	background-color: var(--pressbot-bg);
	resize: none;
	overflow-y: hidden;
	max-height: 120px;
	line-height: 1.4;
}

.pressbot-input:focus {
	border-color: var(--pressbot-primary);
}

.pressbot-input::placeholder {
	color: var(--pressbot-text-light);
}

.pressbot-send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--pressbot-primary);
	color: white;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, transform 0.1s;
}

.pressbot-send:hover {
	background: var(--pressbot-primary-dark);
}

.pressbot-send:active {
	transform: scale(0.95);
}

.pressbot-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Footer */
.pressbot-footer {
	text-align: center;
	padding: 8px;
	font-size: 11px;
	color: var(--pressbot-text-light);
	border-top: 1px solid var(--pressbot-border);
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.pressbot-widget {
		bottom: 10px !important;
	}

	.pressbot-widget.pressbot-right {
		right: 10px !important;
		left: auto !important;
	}

	.pressbot-widget.pressbot-left {
		left: 10px !important;
		right: auto !important;
	}

	/* Force mobile window to be fixed and centered */
	.pressbot-window,
	.pressbot-right .pressbot-window,
	.pressbot-left .pressbot-window,
	.pressbot-widget .pressbot-window,
	.pressbot-widget.pressbot-right .pressbot-window,
	.pressbot-widget.pressbot-left .pressbot-window {
		position: fixed !important;
		bottom: 76px !important;
		left: 10px !important;
		right: 10px !important;
		top: auto !important;
		width: auto !important;
		max-width: none !important;
		height: calc(100vh - 100px) !important;
		max-height: calc(100vh - 100px) !important;
		border-radius: 12px !important;
		transform-origin: bottom center !important;
	}

	/* Ensure open state still works */
	.pressbot-widget.pressbot-open .pressbot-window {
		opacity: 1 !important;
		transform: translateY(0) scale(1) !important;
		pointer-events: auto !important;
	}

	/* Toggle button stays in corner */
	.pressbot-toggle {
		width: 52px !important;
		height: 52px !important;
	}

	/* Smaller header padding on mobile */
	.pressbot-header {
		padding: 12px !important;
	}

	/* Adjust form for mobile */
	.pressbot-form {
		padding: 10px 12px !important;
	}

	.pressbot-input {
		padding: 10px 12px !important;
		font-size: 16px !important; /* Prevents iOS zoom on focus */
		color: var(--pressbot-text) !important;
		background-color: var(--pressbot-bg) !important;
	}

	.pressbot-send {
		width: 38px !important;
		height: 38px !important;
		flex-shrink: 0 !important;
	}
}

/* Very small screens */
@media (max-width: 480px) {
	.pressbot-widget {
		bottom: 8px !important;
	}

	.pressbot-widget.pressbot-right {
		right: 8px !important;
	}

	.pressbot-widget.pressbot-left {
		left: 8px !important;
	}

	.pressbot-window,
	.pressbot-right .pressbot-window,
	.pressbot-left .pressbot-window,
	.pressbot-widget .pressbot-window {
		left: 8px !important;
		right: 8px !important;
		bottom: 70px !important;
		height: calc(100vh - 90px) !important;
	}

	.pressbot-toggle {
		width: 48px !important;
		height: 48px !important;
	}

	.pressbot-message {
		max-width: 90% !important;
		padding: 8px 12px !important;
	}
}

/* Scrollbar Styling */
.pressbot-messages::-webkit-scrollbar {
	width: 6px;
}

.pressbot-messages::-webkit-scrollbar-track {
	background: transparent;
}

.pressbot-messages::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 3px;
}

.pressbot-messages::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}

/* =============================================================================
   Agent Mode - Tool Calls & Results
   ============================================================================= */

.pressbot-tools {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.pressbot-tool {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--pressbot-text-light);
	padding: 4px 0;
}

.pressbot-tool-icon {
	font-size: 14px;
}

.pressbot-tool-name {
	font-family: monospace;
	background: rgba(0, 0, 0, 0.05);
	padding: 2px 6px;
	border-radius: 4px;
}

.pressbot-results {
	margin-top: 8px;
}

.pressbot-result {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 4px;
	margin-top: 4px;
}

.pressbot-result-success {
	background: #d1fae5;
	color: #065f46;
}

.pressbot-result-error {
	background: #fee2e2;
	color: #991b1b;
}

.pressbot-result-icon {
	font-weight: bold;
}

/* Media preview (generated images) */
.pressbot-media-preview {
	margin-top: 8px;
	border-radius: 8px;
	overflow: hidden;
	max-width: 280px;
}

.pressbot-media-preview-link {
	display: block;
	position: relative;
	line-height: 0;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.pressbot-media-preview-img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: contain;
}

.pressbot-media-preview-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
	border-radius: 6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	transition: background 0.15s;
	line-height: 1.4;
}

.pressbot-media-preview-link:hover .pressbot-media-preview-badge {
	background: rgba(0, 0, 0, 0.9);
}

/* =============================================================================
   Agent Mode - Confirmation Dialog
   ============================================================================= */

.pressbot-confirm-container {
	padding: 0 16px;
}

.pressbot-confirm {
	background: #fefce8;
	border: 1px solid #fef08a;
	border-radius: var(--pressbot-radius-sm);
	padding: 12px;
	margin-bottom: 12px;
}

.pressbot-confirm-header {
	font-weight: 600;
	margin-bottom: 8px;
	color: #854d0e;
}

.pressbot-confirm-text {
	margin: 0 0 8px 0;
	font-size: 14px;
	color: var(--pressbot-text);
}

.pressbot-confirm-args {
	background: rgba(0, 0, 0, 0.05);
	padding: 8px;
	border-radius: 4px;
	font-size: 12px;
	overflow-x: auto;
	margin: 0 0 12px 0;
	max-height: 100px;
}

.pressbot-confirm-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

.pressbot-confirm-btn {
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: none;
	transition: background 0.2s;
}

.pressbot-confirm-btn-cancel {
	background: #f3f4f6;
	color: var(--pressbot-text);
}

.pressbot-confirm-btn-cancel:hover {
	background: #e5e7eb;
}

.pressbot-confirm-btn-confirm {
	background: var(--pressbot-primary);
	color: white;
}

.pressbot-confirm-btn-confirm:hover {
	background: var(--pressbot-primary-dark);
}

/* Post Actions Card */
.pressbot-post-actions {
	padding: 8px 12px 12px;
}

.pressbot-post-card {
	background: linear-gradient(135deg, #f8f7ff 0%, #f1f0ff 100%);
	border: 1px solid rgba(79, 70, 229, 0.15);
	border-radius: var(--pressbot-radius-sm);
	padding: 14px;
	box-shadow:
		0 2px 8px rgba(79, 70, 229, 0.08),
		0 1px 2px rgba(0, 0, 0, 0.04);
	position: relative;
	overflow: hidden;
}

.pressbot-post-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--pressbot-primary), #818cf8);
}

.pressbot-post-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 12px;
	gap: 10px;
}

.pressbot-post-card-title {
	font-weight: 600;
	color: var(--pressbot-text);
	font-size: 13px;
	line-height: 1.4;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pressbot-post-card-status {
	font-size: 10px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	flex-shrink: 0;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.pressbot-post-card-status--draft {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	color: #92400e;
	border: 1px solid rgba(146, 64, 14, 0.15);
}

.pressbot-post-card-status--publish {
	background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
	color: #065f46;
	border: 1px solid rgba(6, 95, 70, 0.15);
}

.pressbot-post-card-status--pending {
	background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
	color: #1e40af;
	border: 1px solid rgba(30, 64, 175, 0.15);
}

.pressbot-post-card-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pressbot-post-btn {
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid var(--pressbot-border);
	background: var(--pressbot-bg);
	color: var(--pressbot-text);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	display: inline-flex;
	align-items: center;
	gap: 5px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pressbot-post-btn:hover {
	background: #f9fafb;
	border-color: #d1d5db;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.pressbot-post-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pressbot-post-btn--primary {
	background: linear-gradient(135deg, var(--pressbot-primary) 0%, #6366f1 100%);
	color: white;
	border-color: transparent;
	box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.pressbot-post-btn--primary:hover {
	background: linear-gradient(135deg, var(--pressbot-primary-dark) 0%, #4f46e5 100%);
	box-shadow: 0 4px 8px rgba(79, 70, 229, 0.35);
}

.pressbot-post-btn--danger {
	color: #dc2626;
	border-color: rgba(220, 38, 38, 0.2);
	background: rgba(254, 242, 242, 0.5);
}

.pressbot-post-btn--danger:hover {
	background: #fef2f2;
	border-color: rgba(220, 38, 38, 0.3);
	box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

/* Post card auto-dismiss after publish */
.pressbot-post-card--dismissing::before {
	animation: pressbot-fuse 5s linear forwards;
}

.pressbot-post-card--dismissing {
	animation: pressbot-card-fade 0.4s ease 4.8s forwards;
}

@keyframes pressbot-fuse {
	from { right: 0; }
	to { right: 100%; }
}

@keyframes pressbot-card-fade {
	to { opacity: 0; transform: translateY(-8px); }
}

/* =============================================================================
   Follow-Up Suggestion Chips
   ============================================================================= */

.pb-follow-ups {
	padding: 4px 0 8px;
}

.pb-follow-ups__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.pb-follow-up__chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	background: rgba(99, 102, 241, 0.08);
	border: 1px solid rgba(99, 102, 241, 0.2);
	border-radius: 16px;
	font-size: 12px;
	font-family: inherit;
	color: var(--pressbot-primary, #6366f1);
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
	font-weight: 500;
}

.pb-follow-up__chip:hover {
	background: var(--pressbot-primary, #6366f1);
	color: #fff;
	border-color: var(--pressbot-primary, #6366f1);
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* =============================================================================
   Dark Mode Overrides
   ============================================================================= */

/* Tool name badge */
.pressbot-dark .pressbot-tool-name {
	background: rgba(255, 255, 255, 0.08);
}

/* Tool border separator */
.pressbot-dark .pressbot-tools {
	border-top-color: rgba(255, 255, 255, 0.1);
}

/* Tool result badges */
.pressbot-dark .pressbot-result-success {
	background: rgba(16, 185, 129, 0.15);
	color: #6ee7b7;
}

.pressbot-dark .pressbot-result-error {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
}

/* Media preview border */
.pressbot-dark .pressbot-media-preview-link {
	border-color: rgba(255, 255, 255, 0.1);
}

/* Confirmation dialog */
.pressbot-dark .pressbot-confirm {
	background: rgba(202, 138, 4, 0.1);
	border-color: rgba(202, 138, 4, 0.25);
}

.pressbot-dark .pressbot-confirm-header {
	color: #fbbf24;
}

.pressbot-dark .pressbot-confirm-args {
	background: rgba(255, 255, 255, 0.06);
}

.pressbot-dark .pressbot-confirm-btn-cancel {
	background: rgba(255, 255, 255, 0.08);
}

.pressbot-dark .pressbot-confirm-btn-cancel:hover {
	background: rgba(255, 255, 255, 0.14);
}

/* Post card */
.pressbot-dark .pressbot-post-card {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(79, 70, 229, 0.08) 100%);
	border-color: rgba(99, 102, 241, 0.25);
	box-shadow:
		0 2px 8px rgba(0, 0, 0, 0.2),
		0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Status badges — dark variants */
.pressbot-dark .pressbot-post-card-status--draft {
	background: rgba(202, 138, 4, 0.15);
	color: #fbbf24;
	border-color: rgba(202, 138, 4, 0.3);
}

.pressbot-dark .pressbot-post-card-status--publish {
	background: rgba(16, 185, 129, 0.15);
	color: #6ee7b7;
	border-color: rgba(16, 185, 129, 0.3);
}

.pressbot-dark .pressbot-post-card-status--pending {
	background: rgba(59, 130, 246, 0.15);
	color: #93c5fd;
	border-color: rgba(59, 130, 246, 0.3);
}

/* Post card action buttons */
.pressbot-dark .pressbot-post-btn {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.12);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pressbot-dark .pressbot-post-btn:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.2);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* Primary button keeps its gradient — fine in dark mode */

/* Danger button */
.pressbot-dark .pressbot-post-btn--danger {
	color: #fca5a5;
	border-color: rgba(239, 68, 68, 0.25);
	background: rgba(239, 68, 68, 0.1);
}

.pressbot-dark .pressbot-post-btn--danger:hover {
	background: rgba(239, 68, 68, 0.18);
	border-color: rgba(239, 68, 68, 0.35);
	box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

/* Follow-up chips */
.pressbot-dark .pb-follow-up__chip {
	background: rgba(99, 102, 241, 0.12);
	border-color: rgba(99, 102, 241, 0.3);
}

/* =============================================================================
   Explain CTA Pill
   ============================================================================= */

.pressbot-explain-cta {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	background: var(--pressbot-primary);
	color: #fff;
	border: none;
	border-radius: 9999px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	z-index: 10;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
	opacity: 0.88;
}

.pressbot-explain-cta:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	opacity: 1;
}

.pressbot-explain-cta:active {
	transform: scale(0.97);
}

.pressbot-explain-cta__logo {
	width: 18px;
	height: 18px;
	border-radius: 4px;
	flex-shrink: 0;
}

.pressbot-explain-cta__text {
	white-space: nowrap;
}

/* Shortcode variant — inline, not absolutely positioned */
.pressbot-explain-cta--shortcode {
	position: relative;
	top: auto;
	right: auto;
}

@media (prefers-reduced-motion: reduce) {
	.pressbot-explain-cta {
		transition: none;
	}
}
