.ppm-docs {
	--ppm-border: rgba(0, 0, 0, 0.12);
	--ppm-surface: rgba(0, 0, 0, 0.02);
	--ppm-muted: rgba(0, 0, 0, 0.6);
	--ppm-accent: #c0392b;
	--ppm-radius: 8px;

	margin: 2rem 0;
}

.ppm-docs__heading {
	font-size: 1.125rem;
	margin: 0 0 0.75rem;
	letter-spacing: 0.01em;
}

.ppm-docs .ppm-docs__heading--right {
	text-align: right;
}

.ppm-docs .ppm-docs__heading--center {
	text-align: center;
}

.ppm-docs .ppm-docs__heading--left {
	text-align: left;
}

.ppm-docs__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.5rem;
}

.ppm-doc {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--ppm-border);
	border-radius: var(--ppm-radius);
	background: var(--ppm-surface);
}

.ppm-doc__icon {
	flex: 0 0 auto;
	color: var(--ppm-accent);
	line-height: 0;
	margin-top: 0.15rem;
}

.ppm-doc__body {
	flex: 1 1 auto;
	min-width: 0;
}

.ppm-doc__title {
	font-size: 1rem;
	margin: 0;
	line-height: 1.35;
	word-wrap: break-word;
}

.ppm-doc__description {
	margin: 0.35rem 0 0;
	font-size: 0.9rem;
	color: var(--ppm-muted);
}

.ppm-doc__meta {
	margin: 0.35rem 0 0;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ppm-muted);
}

.ppm-doc__actions {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}

.ppm-btn {
	display: inline-block;
	padding: 0.4rem 0.85rem;
	font-size: 0.85rem;
	line-height: 1.4;
	border: 1px solid var(--ppm-border);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ppm-btn:hover,
.ppm-btn:focus-visible {
	background: rgba(0, 0, 0, 0.06);
	text-decoration: none;
}

.ppm-btn--primary {
	background: var(--ppm-accent);
	border-color: var(--ppm-accent);
	color: #fff;
}

.ppm-btn--primary:hover,
.ppm-btn--primary:focus-visible {
	background: #a33227;
	border-color: #a33227;
	color: #fff;
}

.ppm-btn:focus-visible,
.ppm-modal__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Inline embed */
.ppm-doc__embed {
	margin-top: 0.75rem;
}

.ppm-doc__embed iframe {
	width: 100%;
	height: min(70vh, 640px);
	border: 1px solid var(--ppm-border);
	border-radius: 6px;
	background: #fff;
}

.ppm-doc__embed-fallback {
	margin: 0.4rem 0 0;
	font-size: 0.85rem;
}

/* Modal viewer */
.ppm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0.5rem, 3vw, 2rem);
}

.ppm-modal[hidden] {
	display: none;
}

.ppm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 15, 15, 0.72);
}

.ppm-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1000px, 100%);
	height: min(90vh, 100%);
	background: #fff;
	color: #1a1a1a;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.ppm-modal__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.65rem 0.75rem 0.65rem 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	background: #f7f7f7;
}

.ppm-modal__title {
	font-size: 0.95rem;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ppm-modal__tools {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
}

.ppm-modal__tab {
	font-size: 0.8rem;
	color: #1a1a1a;
	border-color: rgba(0, 0, 0, 0.2);
}

.ppm-modal__close {
	border: 0;
	background: transparent;
	font-size: 1.6rem;
	line-height: 1;
	padding: 0 0.35rem;
	cursor: pointer;
	color: #1a1a1a;
}

.ppm-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	background: #525659;
}

.ppm-modal__frame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

body.ppm-modal-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.ppm-doc {
		flex-wrap: wrap;
	}

	.ppm-doc__actions {
		width: 100%;
		padding-left: 2.35rem;
	}

	.ppm-modal__tab {
		display: none;
	}
}

@media (prefers-color-scheme: dark) {
	.ppm-docs {
		--ppm-border: rgba(255, 255, 255, 0.18);
		--ppm-surface: rgba(255, 255, 255, 0.04);
		--ppm-muted: rgba(255, 255, 255, 0.66);
		--ppm-accent: #e05c4b;
	}

	.ppm-btn:hover,
	.ppm-btn:focus-visible {
		background: rgba(255, 255, 255, 0.1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ppm-btn {
		transition: none;
	}
}
