/* Peace & Diplomacy Agent */
.pd-agent {
	--pd-green: #243e31;
	--pd-green-2: #34533f;
	--pd-sage: #d8dfcf;
	--pd-paper: #f6f5ef;
	--pd-ink: #1f2a23;
	--pd-muted: #5a665c;
	--pd-line: #cdd2c8;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--pd-ink);
}
.pd-agent *, .pd-agent *::before, .pd-agent *::after { box-sizing: border-box; }

.pd-agent__launcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--pd-green);
	color: #fff;
	font: 600 15px/1 Inter, system-ui, sans-serif;
	box-shadow: 0 8px 24px rgba(20, 35, 27, .25);
	cursor: pointer;
	transition: transform .15s ease, background .15s ease;
}
.pd-agent__launcher:hover { background: var(--pd-green-2); transform: translateY(-1px); }
.pd-agent__launcher:focus-visible,
.pd-agent button:focus-visible,
.pd-agent textarea:focus-visible,
.pd-agent a:focus-visible { outline: 3px solid #8fb39a; outline-offset: 2px; }
.pd-agent { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.pd-agent[data-open="true"] .pd-agent__launcher { display: none; }

.pd-agent__panel {
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 580px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--pd-line);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 18px 48px rgba(20, 35, 27, .22);
}
.pd-agent__panel[hidden] { display: none; }

.pd-agent__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	padding: 16px 16px 14px 18px;
	background: var(--pd-green);
	color: #fff;
}
.pd-agent__title {
	margin: 0;
	font: 600 18px/1.25 Gelasio, Georgia, serif;
	color: #fff;
	letter-spacing: 0;
}
.pd-agent__subtitle { margin: 4px 0 0; font-size: 12.5px; color: var(--pd-sage); }
.pd-agent__actions { display: flex; gap: 4px; }
.pd-agent__icon {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.pd-agent__icon:hover { background: rgba(255, 255, 255, .14); }

.pd-agent__log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: var(--pd-paper);
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.pd-agent__msg {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 14px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.pd-agent__msg p { margin: 0 0 8px; }
.pd-agent__msg p:last-child { margin-bottom: 0; }
.pd-agent__msg ul { margin: 4px 0 8px; padding-left: 18px; }
.pd-agent__msg li { margin: 2px 0; }
.pd-agent__msg a { color: var(--pd-green); text-decoration: underline; }
.pd-agent__msg--assistant { align-self: flex-start; background: #fff; border: 1px solid var(--pd-line); border-bottom-left-radius: 4px; }
.pd-agent__msg--user { align-self: flex-end; background: var(--pd-green); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.pd-agent__msg--error { align-self: flex-start; background: #fff4f2; border: 1px solid #f0c8c0; color: #7a2418; }
.pd-agent__sources { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e6e9e1; font-size: 12.5px; color: var(--pd-muted); }

.pd-agent__typing { display: inline-flex; gap: 4px; padding: 14px; }
.pd-agent__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--pd-muted); opacity: .4; animation: pd-dot 1.2s infinite; }
.pd-agent__typing span:nth-child(2) { animation-delay: .2s; }
.pd-agent__typing span:nth-child(3) { animation-delay: .4s; }
@keyframes pd-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.pd-agent__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; background: var(--pd-paper); }
.pd-agent__chips[hidden] { display: none; }
.pd-agent__chip {
	padding: 7px 11px;
	border: 1px solid var(--pd-line);
	border-radius: 999px;
	background: #fff;
	color: var(--pd-green);
	font: 500 13px/1.2 Inter, system-ui, sans-serif;
	cursor: pointer;
}
.pd-agent__chip:hover { background: var(--pd-sage); }

.pd-agent__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 14px;
	background: var(--pd-paper);
	border-top: 1px solid #e6e9e1;
}
.pd-agent__input {
	flex: 1;
	min-height: 42px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid var(--pd-line);
	border-radius: 12px;
	background: #fff;
	color: var(--pd-ink);
	font: 15px/1.4 Inter, system-ui, sans-serif;
	resize: none;
}
.pd-agent__send {
	flex: none;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 12px;
	background: var(--pd-green);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.pd-agent__send:disabled { opacity: .5; cursor: wait; }
.pd-agent__foot { margin: 0; padding: 0 14px 10px; background: var(--pd-paper); font-size: 11.5px; color: var(--pd-muted); }
.pd-agent__foot a { color: var(--pd-muted); }
.pd-agent__sr, .pd-agent__hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
	.pd-agent { right: 12px; bottom: 12px; }
	.pd-agent[data-open="true"] { inset: 0; }
	.pd-agent[data-open="true"] .pd-agent__panel { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.pd-agent__launcher, .pd-agent__typing span { transition: none; animation: none; }
}

/* News brief shortcode */
.pd-news { max-width: 820px; margin: 0 auto; overflow-wrap: anywhere; }
.pd-news__title { margin-bottom: 4px; }
.pd-news__meta { margin: 0 0 20px; color: #5a665c; font-size: .95em; }
.pd-news__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pd-news__item { min-width: 0; overflow-wrap: anywhere; padding: 18px 20px; background: #f6f5ef; border: 1px solid #d8dfcf; border-radius: 12px; }
.pd-news__region { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; background: #243e31; color: #fff; font-size: .78em; font-weight: 600; letter-spacing: .02em; }
.pd-news__item-title { margin: 0 0 6px; font-size: 1.15em; line-height: 1.3; }
.pd-news__summary { margin: 0 0 8px; }
.pd-news__sources { margin: 0; font-size: .88em; color: #5a665c; }
.pd-news__sources a { color: #243e31; }
.pd-news__note { margin-top: 18px; font-size: .85em; color: #5a665c; }

.pd-news__overview {
	margin: 0 0 20px;
	padding: 14px 18px;
	border-left: 3px solid #243e31;
	background: #eef0e8;
	color: #243e31;
	font-size: 1.02em;
	line-height: 1.6;
}
.pd-agent__typing { align-items: center; }
.pd-agent__typing-note { margin-left: 8px; font-size: 12.5px; font-style: normal; color: var(--pd-muted); }
