/*
 * dispatch-badge: structure and neutral defaults. A theme re-points the
 * --dsb-* properties and should not need to restate a rule.
 *
 * Sizes are px, or em of the element's own font size, never rem: themes set
 * the root font size to anything (62.5% is common), and rem would scale the
 * badge with it. No color-mix(), no prefers-color-scheme: a theme that has a
 * dark mode re-points the properties under its own switch.
 *
 * "before" (a send-today promise) uses the accent pair; "between" and
 * "after" the neutral pair. The states differ in wording and lightness too,
 * so hue is never the only signal. Spacing uses margins, not flex gap
 * (Safari 12 has no flex gap).
 */

/*
 * Hidden but reserved: the server prints the element empty with `hidden`
 * and the script reveals it, so the box must already take its place or every
 * card below would shift. Without this sheet the bare attribute hides it.
 * State "none" takes it out of the layout; it comes after on purpose, at
 * equal specificity.
 */
.dsb-badge[hidden],
.dsb-page[hidden] {
	display: flex;
	visibility: hidden;
}

.dsb-badge[data-dsb-state="none"],
.dsb-page[data-dsb-state="none"],
.dsb-page__line[hidden] {
	display: none;
}

/* ---- Card pill (mockup CardOptions A, States). ---- */

.dsb-badge {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	width: -webkit-fit-content;
	width: -moz-fit-content;
	width: fit-content;
	max-width: 100%;
	/* One line of text, the padding and the border: the reserved height before the text arrives. */
	min-height: calc(1.5em + 6px);
	margin: var(--dsb-card-margin, 0 auto 5px);
	padding: 2px 10px 2px 8px;
	border: 1px solid var(--dsb-neutral-border, #d4d4d4);
	border-radius: 999px;
	background: var(--dsb-neutral-bg, #ffffff);
	color: var(--dsb-neutral-text, #333333);
	font-family: inherit;
	font-size: var(--dsb-card-font-size, 14px);
	font-style: normal;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.5;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
}

.dsb-badge__icon {
	box-sizing: border-box;
	flex: none;
	/* 24 x 15 px at 14px. */
	width: 1.7143em;
	height: 1.0714em;
	margin-right: 6px;
	color: var(--dsb-neutral-icon, #666666);
	overflow: visible;
}

.dsb-badge__icon .dsb-icon__wheel {
	fill: var(--dsb-neutral-bg, #ffffff);
}

/* The speed lines say "today"; a neutral card drops them (mockup States). */
.dsb-badge .dsb-icon__speed {
	display: none;
}

.dsb-badge__text {
	min-width: 0;
}

.dsb-badge[data-dsb-state="before"] {
	border-color: var(--dsb-accent-border, #b9d8d1);
	background: var(--dsb-accent-bg, #e8f3f0);
	color: var(--dsb-accent-text, #14574c);
}

.dsb-badge[data-dsb-state="before"] .dsb-badge__icon {
	color: var(--dsb-accent-icon, #1a6b5e);
}

.dsb-badge[data-dsb-state="before"] .dsb-icon__wheel {
	fill: var(--dsb-accent-bg, #e8f3f0);
}

.dsb-badge[data-dsb-state="before"] .dsb-icon__speed {
	display: inline;
}

/* ---- Product-page block (mockup Main). ---- */

.dsb-page {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	margin: var(--dsb-page-margin, 16px 0);
	padding: 12px 16px;
	border-radius: var(--dsb-page-radius, 10px);
	background: var(--dsb-page-neutral-bg, #f4f4f4);
	color: var(--dsb-page-text, #333333);
	font-family: inherit;
	font-size: var(--dsb-page-font-size, 14.5px);
	font-style: normal;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
}

.dsb-page__icon {
	box-sizing: border-box;
	flex: none;
	width: 48px;
	height: 30px;
	margin-right: 14px;
	color: var(--dsb-neutral-icon, #666666);
	overflow: visible;
}

.dsb-page__icon .dsb-icon__wheel {
	fill: var(--dsb-page-neutral-bg, #f4f4f4);
}

.dsb-page .dsb-page__body {
	box-sizing: border-box;
	flex: 1 1 auto;
	min-width: 0;
}

/*
 * Each text line keeps its height while empty, so the hidden block is as
 * tall as the painted one. Doubled class: theme rules such as
 * `.summary p` would otherwise win.
 */
.dsb-page .dsb-page__head {
	box-sizing: border-box;
	min-height: 1.3158em;
	margin: 0 0 1px;
	padding: 0;
	color: var(--dsb-page-head, #333333);
	font-family: var(--dsb-page-head-font, inherit);
	font-size: var(--dsb-page-head-size, 19px);
	font-weight: 600;
	line-height: 1.3158;
}

.dsb-page .dsb-page__line {
	box-sizing: border-box;
	min-height: 1.45em;
	margin: 0;
	padding: 0;
	font-size: 1em;
	line-height: 1.45;
}

.dsb-page .dsb-page__more {
	display: inline-block;
	margin-top: 4px;
	color: var(--dsb-link, inherit);
}

.dsb-page[data-dsb-state="before"] {
	background: var(--dsb-page-accent-bg, var(--dsb-accent-bg, #e8f3f0));
}

.dsb-page[data-dsb-state="before"] .dsb-page__head {
	color: var(--dsb-accent-text, #14574c);
}

.dsb-page[data-dsb-state="before"] .dsb-page__icon {
	color: var(--dsb-accent-icon, #1a6b5e);
}

.dsb-page[data-dsb-state="before"] .dsb-icon__wheel {
	fill: var(--dsb-page-accent-bg, var(--dsb-accent-bg, #e8f3f0));
}
