/**
 * Webhook health → Webhooks tab. Panel world only (tokens from admin.css on body.apwc-screen).
 * Health is text with a 6px dot: green healthy, amber needs a look, red disabled or failing,
 * muted paused. Status hue only; the accent stays out.
 */

.apwc-wh__summary {
	display: grid;
	gap: 12px;
}

.apwc-app .apwc-wh__intro {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--apwc-muted-fg);
	font-size: 13px;
	line-height: 20px;
}

.apwc-wh__table td {
	vertical-align: top;
}

.apwc-wh__webhook {
	min-width: 180px;
}

.apwc-wh__webhook .apwc-log__sub {
	max-width: 36ch;
}

.apwc-wh__actions {
	min-width: 340px;
}

.apwc-wh__health-cell .apwc-log__sub {
	max-width: 30ch;
	white-space: normal;
}

.apwc-wh__health {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--apwc-fg);
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}

.apwc-wh__health::before {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--apwc-success-fg);
}

.apwc-wh__health:is([data-health="waiting"], [data-health="owner-missing"], [data-health="owner-access"])::before {
	background: var(--apwc-warning-fg);
}

.apwc-wh__health:is([data-health="disabled"], [data-health="failing"]) {
	color: var(--apwc-danger-fg);
}

.apwc-wh__health:is([data-health="disabled"], [data-health="failing"])::before {
	background: var(--apwc-danger-fg);
}

.apwc-wh__health[data-health="paused"] {
	color: var(--apwc-muted-fg);
}

.apwc-wh__health[data-health="paused"]::before {
	background: var(--apwc-muted-fg);
}

.apwc-wh__status,
.apwc-wh__last {
	white-space: nowrap;
}

.apwc-wh__actions-col {
	width: 1%;
}

.apwc-wh__buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.apwc-app .apwc-wh__note {
	max-width: 44ch;
	margin: 8px 0 0 auto;
	color: var(--apwc-muted-fg);
	font-size: 12px;
	line-height: 16px;
	text-align: right;
}

.apwc-wh__row[aria-busy="true"] {
	opacity: 0.7;
}

.apwc-app .apwc-btn.is-busy {
	cursor: progress;
}

.apwc-wh__code {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	font-weight: 500;
}

.apwc-wh__code::before {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--apwc-success-fg);
}

.apwc-wh__code[data-ok="0"] {
	color: var(--apwc-danger-fg);
}

.apwc-wh__code[data-ok="0"]::before {
	background: var(--apwc-danger-fg);
}

.apwc-wh__message {
	display: block;
	max-width: 48ch;
	color: var(--apwc-muted-fg);
	font-size: 12px;
	overflow-wrap: anywhere;
}

.apwc-wh__muted {
	color: var(--apwc-muted-fg);
}

.apwc-wh__deliveries {
	display: grid;
	gap: 12px;
	padding: 20px 24px 24px;
	border-top: 1px solid var(--apwc-border);
}

.apwc-wh__deliveries-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.apwc-app .apwc-wh__deliveries-head .apwc-card__title {
	margin: 0;
}

.apwc-app .apwc-wh__queue,
.apwc-app .apwc-wh__none,
.apwc-app .apwc-wh__unparsed,
.apwc-app .apwc-wh__loading {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 20px;
}

.apwc-app .apwc-wh__loading {
	display: flex;
	align-items: center;
	gap: 8px;
}

.apwc-wh__spinner {
	animation: apwc-spin 1s linear infinite;
}

.apwc-app .apwc-wh__alert {
	margin-bottom: 12px;
}

.apwc-wh__time,
.apwc-wh__num {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.apwc-wh__num {
	text-align: right;
}

@media (max-width: 782px) {

	.apwc-wh__buttons {
		justify-content: flex-start;
	}

	.apwc-app .apwc-wh__note {
		margin-left: 0;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {

	.apwc-wh__spinner {
		animation: none;
	}
}
