/*
 * Rule trace card ("parcel label"). Used by the Trace Card widget and the
 * Hero widget. It responds to its own width, so it fits any column.
 */
.hwd .hwd-card {
	container: hwd-card / inline-size;
	margin: 0;
}
.hwd .hwd-card__label {
	position: relative;
	background: var(--hwd-card-bg, #fff);
	color: var(--hwd-text);
	border-radius: var(--hwd-card-radius, 16px);
	padding: 22px 22px 18px;
	box-shadow: var(--hwd-card-shadow, 0 18px 50px -20px rgba(0, 0, 0, 0.55));
}
/* Perforations along the top edge: they take the colour behind the card. */
.hwd .hwd-card__label::before {
	content: "";
	position: absolute;
	left: 18px;
	right: 18px;
	top: -6px;
	height: 12px;
	background: radial-gradient(circle at 6px 6px, var(--hwd-card-holes, var(--hwd-ink-deep)) 5px, transparent 5.5px) 0 0 / 18px 12px space no-repeat;
	opacity: 0.9;
	pointer-events: none;
}

.hwd .hwd-card__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.hwd .hwd-card__to { font-size: 0.82rem; color: var(--hwd-muted); line-height: 1.4; }
.hwd .hwd-card__to b {
	display: block;
	margin-bottom: 2px;
	color: var(--hwd-card-accent, var(--hwd-ink));
	font-size: 1.05rem;
	font-stretch: 112%;
	font-weight: 700;
}
.hwd .hwd-card__method {
	flex: none;
	border: 2px solid var(--hwd-card-accent, var(--hwd-ink));
	border-radius: 8px;
	padding: 4px 9px;
	color: var(--hwd-card-accent, var(--hwd-ink));
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

.hwd .hwd-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 14px;
	padding-bottom: 14px;
	border-bottom: 2px dashed var(--hwd-line);
	font-size: 0.82rem;
	line-height: 1.65;
	color: var(--hwd-muted);
}
.hwd .hwd-card__facts b { display: block; color: var(--hwd-text); font-size: 0.98rem; font-weight: 650; }

.hwd .hwd-card__trace { list-style: none; margin: 12px 0 0; padding: 0; }
.hwd .hwd-card__trace li {
	display: grid;
	grid-template-columns: 26px 1fr auto;
	gap: 10px;
	align-items: center;
	margin: 0;
	padding: 7px 0;
	font-size: 0.9rem;
	line-height: 1.3;
}
.hwd .hwd-card__mark {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 0.75rem;
	font-weight: 700;
}
.hwd .is-matched .hwd-card__mark { background: var(--hwd-card-accent, var(--hwd-ink)); color: #fff; }
.hwd .is-missed .hwd-card__mark { box-shadow: inset 0 0 0 2px #b9c7c9; color: #7b8c8f; }
.hwd .is-skipped .hwd-card__mark { border: 2px dashed #b9c7c9; color: #9aa9ab; }
.hwd .is-missed .hwd-card__rule,
.hwd .is-skipped .hwd-card__rule { color: var(--hwd-muted); }
.hwd .hwd-card__what { font-size: 0.82rem; color: var(--hwd-muted); text-align: end; white-space: nowrap; }
.hwd .is-matched .hwd-card__what { color: var(--hwd-card-accent, var(--hwd-ink)); font-weight: 650; }
.hwd .hwd-card__stop {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--hwd-card-accent, var(--hwd-ink));
	color: #fff;
	font-size: 0.72rem;
	font-weight: 650;
}

.hwd .hwd-card__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-top: 10px;
	padding-top: 14px;
	border-top: 2px dashed var(--hwd-line);
}
.hwd .hwd-card__total span { color: var(--hwd-muted); font-size: 0.88rem; }
.hwd .hwd-card__total b {
	color: var(--hwd-card-accent, var(--hwd-ink));
	font-size: 2rem;
	font-stretch: 115%;
	font-weight: 780;
	line-height: 1;
}
.hwd .hwd-card__notice {
	margin-top: 14px;
	padding: 9px 12px;
	border-radius: 10px;
	background: var(--hwd-amber-soft);
	color: var(--hwd-amber-ink);
	font-size: 0.86rem;
	font-weight: 600;
	line-height: 1.65;
}
.hwd .hwd-card__caption {
	margin-top: 14px;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--hwd-card-caption, var(--hwd-muted));
}

/*
 * Narrow layouts. Standalone, the card responds to its own width. Inside the
 * hero it follows the hero's width instead (see modules/hero/style.css), so
 * a narrow side-by-side column on a tablet keeps the three-column trace.
 */
@container hwd-card (max-width: 400px) {
	.hwd-trace-card .hwd-card__label { padding: 20px 16px 16px; }
	.hwd-trace-card .hwd-card__facts { gap: 16px; }
}
@container hwd-card (max-width: 300px) {
	.hwd-trace-card .hwd-card__trace li { grid-template-columns: 26px 1fr; row-gap: 2px; }
	.hwd-trace-card .hwd-card__trace .hwd-card__what { grid-column: 2; text-align: start; }
	.hwd-trace-card .hwd-card__total b { font-size: 1.6rem; }
	.hwd-trace-card .hwd-card__facts { gap: 12px; }
}
