.tlst-ajax-form .tls-ajax-cont-1, .tlst-ajax-form .tls-ajax-cont-2 {
	display: none;
	text-align: center;
	padding: 30px 0;
	font-size: 20px;
}
.tlst-ajax-form.doing-ajax-1 .tls-ajax-cont-1, .tlst-ajax-form.doing-ajax-2 .tls-ajax-cont-2 {
	display: block;
}

/*
 * Progress bar — 6 steps, one per label.
 *
 * The status-* class on .progress-container sets --tlst-step (1-6). The labels are 6
 * equal columns; the track runs from the centre of the first column to the centre of
 * the last, so Available is 0% of the track, Delivered 100%, and every step in between
 * (20/40/60/80%) sits directly over its label at any width.
 *
 * Themes restyle through the custom properties below instead of re-doing the geometry.
 * Labels are in normal flow (the track is drawn by ::before), so the container grows
 * with them and nothing below needs a reserved margin.
 */
div.tracking-order .progress-container {
	--tlst-steps: 6;
	--tlst-step: 1;
	--tlst-track-height: 20px;
	--tlst-track-bg: #e0e0e0;
	/* --tlst-progress-color is the Progress Color saved on the options page, set on the shortcode wrapper. */
	--tlst-fill-bg: var(--tlst-progress-color, linear-gradient(90deg, #4caf50, #81c784));
	--tlst-fill-border: 2px solid #000;
	--tlst-dot-size: 45px;
	--tlst-dot-bg: var(--tlst-progress-color, #4caf50);
	--tlst-dot-border: 3px solid #fff;
	--tlst-dot-shadow: none;
	--tlst-label-color: #555;
	--tlst-label-current-color: #222;
	--tlst-inset: calc(50% / var(--tlst-steps)); /* half a column at each end */
	--tlst-pos: calc((var(--tlst-step) - 0.5) / var(--tlst-steps) * 100%);
	--tlst-fill: calc(var(--tlst-pos) - var(--tlst-inset));

	position: relative;
	box-sizing: border-box;
	width: 100%;
	height: auto;
	margin: 30px 0;
	/* room for the track plus the half of the dot that hangs below it */
	padding: calc(var(--tlst-track-height) / 2 + var(--tlst-dot-size) / 2 + 10px) 0 0;
	background: none;
}

div.tracking-order .progress-container::before {
	content: "";
	position: absolute;
	top: 0;
	left: var(--tlst-inset);
	right: var(--tlst-inset);
	height: var(--tlst-track-height);
	background: var(--tlst-track-bg);
	border-radius: calc(var(--tlst-track-height) / 2);
}

div.tracking-order .progress-fill {
	position: absolute;
	top: 0;
	left: var(--tlst-inset);
	width: var(--tlst-fill);
	height: var(--tlst-track-height);
	padding: 0;
	background: var(--tlst-fill-bg);
	border: var(--tlst-fill-border);
	box-sizing: border-box;
	border-radius: calc(var(--tlst-track-height) / 2);
	transition: width 0.5s ease;
}
div.tracking-order .status-available .progress-fill,
div.tracking-order .status-tendered-order .progress-fill,
div.tracking-order .status-prenote .progress-fill,
div.tracking-order .status-canceled .progress-fill,
div.tracking-order .status-osd .progress-fill { display: none; } /* step 1: nothing to fill */

div.tracking-order .progress-indicator {
	position: absolute;
	top: calc(var(--tlst-track-height) / 2);
	left: var(--tlst-pos);
	transform: translate(-50%, -50%);
	box-sizing: border-box;
	width: var(--tlst-dot-size);
	height: var(--tlst-dot-size);
	padding: 0;
	background: var(--tlst-dot-bg);
	border: var(--tlst-dot-border);
	border-radius: 50%;
	box-shadow: var(--tlst-dot-shadow);
	z-index: 3;
	transition: left 0.5s ease;
}

div.tracking-order .progress-labels {
	position: static;
	display: flex;
	width: 100%;
	gap: 4px;
	margin: 0;
	padding: 0;
	font-size: 12px;
	line-height: 1.3;
	color: var(--tlst-label-color);
}

div.tracking-order .progress-labels span {
	flex: 1 1 0;
	min-width: 0;
	width: auto;
	margin: 0;
	padding: 0;
	float: none;
	transform: none;
	text-align: center;
	overflow-wrap: break-word;
	hyphens: auto;
}

/*
 * Status → step. Class is "status-" + lower-cased status, '&' dropped, spaces → '-', and any
 * other character outside a-z, 0-9, '_' and '-' removed.
 * Anything not listed (e.g. a new TLS status) stays on step 1.
 *   1 Available         tendered order, available, prenote, canceled, OS&D
 *   2 Scheduled Pickup  scheduled for pickup, out for pickup, out to pickup
 *   3 In Transit        in transit
 *   4 Pending Delivery  pending delivery, delivery pending appointment, scheduled for delivery
 *   5 Out for Delivery  out for delivery
 *   6 Delivered         delivered
 */
div.tracking-order .status-scheduled-for-pickup,
div.tracking-order .status-out-for-pickup,
div.tracking-order .status-out-to-pickup { --tlst-step: 2; }

div.tracking-order .status-in-transit { --tlst-step: 3; }

div.tracking-order .status-pending-delivery,
div.tracking-order .status-delivery-pending-appointment,
div.tracking-order .status-scheduled-for-delivery { --tlst-step: 4; }

div.tracking-order .status-out-for-delivery { --tlst-step: 5; }

div.tracking-order .status-delivered { --tlst-step: 6; }

/* Current step's label */
div.tracking-order .status-available .progress-labels span:nth-child(1),
div.tracking-order .status-tendered-order .progress-labels span:nth-child(1),
div.tracking-order .status-prenote .progress-labels span:nth-child(1),
div.tracking-order .status-canceled .progress-labels span:nth-child(1),
div.tracking-order .status-osd .progress-labels span:nth-child(1),
div.tracking-order .status-scheduled-for-pickup .progress-labels span:nth-child(2),
div.tracking-order .status-out-for-pickup .progress-labels span:nth-child(2),
div.tracking-order .status-out-to-pickup .progress-labels span:nth-child(2),
div.tracking-order .status-in-transit .progress-labels span:nth-child(3),
div.tracking-order .status-pending-delivery .progress-labels span:nth-child(4),
div.tracking-order .status-delivery-pending-appointment .progress-labels span:nth-child(4),
div.tracking-order .status-scheduled-for-delivery .progress-labels span:nth-child(4),
div.tracking-order .status-out-for-delivery .progress-labels span:nth-child(5),
div.tracking-order .status-delivered .progress-labels span:nth-child(6) {
	display: block; /* no-op in the flex row; re-shows it on phones (below) */
	font-weight: bold;
	color: var(--tlst-label-current-color);
}

@media (max-width: 600px) {
	div.tracking-order .progress-container {
		--tlst-track-height: 14px;
		--tlst-dot-size: 26px;
	}
	div.tracking-order .progress-labels {
		gap: 2px;
		font-size: 11px;
	}
}

/* Phones: six columns are too narrow to read, so show only the current step's label. */
@media (max-width: 480px) {
	div.tracking-order .progress-labels span {
		display: none;
	}
	div.tracking-order .progress-labels {
		font-size: 13px;
	}
}

/*
 * Saved colors (TLS Tracking > Options). The shortcode wrapper carries the custom
 * properties and a tlst-has-* class only when that color is saved, so a site without
 * saved colors keeps its theme's buttons exactly as before.
 */
.tlst-has-button-color:not(.tlst-layout-card) input[name="tlst_submit"],
.tlst-has-button-color:not(.tlst-layout-card) .tlst-download-link {
	background-color: var(--tlst-button-bg);
	border-color: var(--tlst-button-bg);
}
@supports (color: color-mix(in srgb, red 50%, black)) {
	.tlst-has-button-color:not(.tlst-layout-card) input[name="tlst_submit"]:hover,
	.tlst-has-button-color:not(.tlst-layout-card) .tlst-download-link:hover {
		background-color: color-mix(in srgb, var(--tlst-button-bg) 85%, black);
	}
}
.tlst-has-button-text-color:not(.tlst-layout-card) input[name="tlst_submit"],
.tlst-has-button-text-color:not(.tlst-layout-card) .tlst-download-link {
	color: var(--tlst-button-text);
}

/*
 * Card Layout. Every rule is scoped to .tlst-layout-card; the theme's own headings,
 * buttons and forms are never touched. Saved colors feed the tokens below.
 */
.tlst-layout-card {
	--tlst-card-ink: #142e34;
	--tlst-card-muted: #617579;
	--tlst-card-accent: var(--tlst-progress-color, #157862);
	--tlst-card-accent-light: #e4f1eb;
	/* Built-in button colors: js/admin.js checks contrast against the same two values. */
	--tlst-card-button: var(--tlst-button-bg, #157862);
	--tlst-card-button-hover: #0d604e;
	--tlst-card-button-text: var(--tlst-button-text, #ffffff);
	--tlst-card-line: #dce4e1;
	--tlst-card-divider: #edf0ed;
	--tlst-card-background: #ffffff;
	--tlst-card-error: #a52d2d;

	container-type: inline-size;
	color: var(--tlst-card-ink);
	font-family: "Segoe UI", Arial, sans-serif;
}
@supports (color: color-mix(in srgb, red 50%, black)) {
	.tlst-layout-card.tlst-has-progress-color {
		--tlst-card-accent-light: color-mix(in srgb, var(--tlst-progress-color) 15%, white);
	}
	.tlst-layout-card.tlst-has-button-color {
		--tlst-card-button-hover: color-mix(in srgb, var(--tlst-button-bg) 85%, black);
	}
}
.tlst-layout-card *,
.tlst-layout-card *::before,
.tlst-layout-card *::after {
	box-sizing: border-box;
}
.tlst-layout-card .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tlst-layout-card .tlst-card {
	padding: 30px 34px;
	background: var(--tlst-card-background);
	border: 1px solid var(--tlst-card-line);
	border-radius: 14px;
	box-shadow: 0 6px 20px #18383005;
}
.tlst-layout-card .tlst-card-heading {
	display: flex;
	align-items: baseline;
	gap: 15px;
	margin: 0 0 25px;
}
.tlst-layout-card .tlst-card-title {
	margin: 0;
	padding: 0;
	color: var(--tlst-card-ink);
	font-family: inherit;
	font-size: 20px;
	line-height: 1.3;
	letter-spacing: -0.5px;
}

/* Form */
.tlst-layout-card .tlst-card-form {
	margin: 0;
}
.tlst-layout-card .tlst-card-label {
	display: block;
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 650;
}
.tlst-layout-card .tlst-card-controls {
	display: flex;
	gap: 12px;
}
.tlst-layout-card .tlst-card-input {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 16px;
	color: var(--tlst-card-ink);
	font: inherit;
	font-size: 16px; /* under 16px, iOS Safari zooms the page on focus */
	background: var(--tlst-card-background);
	border: 1px solid #cbd7d2;
	border-radius: 6px;
	box-shadow: none;
}
/* A solid focus ring (WCAG 3:1 non-text contrast), with the soft halo of the design on top. */
.tlst-layout-card .tlst-card-input:focus {
	border-color: var(--tlst-card-accent);
	outline: 2px solid var(--tlst-card-accent);
	outline-offset: 1px;
	box-shadow: 0 0 0 5px var(--tlst-card-accent-light);
}
/* The Download documents button shares the Track shipment button's look. */
.tlst-layout-card .tlst-card-submit,
.tlst-layout-card .tlst-card-doc {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 16px 24px;
	color: var(--tlst-card-button-text);
	font: inherit;
	font-size: 15px;
	font-weight: 650;
	line-height: 1.2;
	text-transform: none;
	background: var(--tlst-card-button);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}
.tlst-layout-card .tlst-card-submit:hover,
.tlst-layout-card .tlst-card-doc:hover {
	background: var(--tlst-card-button-hover);
}
.tlst-layout-card .tlst-card-submit:focus-visible,
.tlst-layout-card .tlst-card-doc:focus-visible {
	outline: 3px solid var(--tlst-card-ink);
	outline-offset: 2px;
}
.tlst-layout-card .tlst-card-submit[aria-disabled="true"],
.tlst-layout-card .tlst-card-doc[aria-disabled="true"] {
	opacity: 0.7;
	cursor: wait;
}
.tlst-layout-card .tlst-card-helper {
	margin: 13px 0 0;
	color: var(--tlst-card-muted);
	font-size: 16px;
}
.tlst-layout-card .tlst-card-feedback {
	margin: 16px 0 0;
	color: var(--tlst-card-muted);
	font-size: 16px;
}
.tlst-layout-card .tlst-card-feedback:empty {
	margin: 0; /* stays rendered, so screen readers announce its first message */
}
.tlst-layout-card .tlst-card-feedback.is-error {
	color: var(--tlst-card-error);
}

/* Results */
.tlst-layout-card .tlst-card-order {
	margin: 24px 0 0;
	padding: 24px 0 0;
	border-top: 1px solid var(--tlst-card-line);
}
.tlst-layout-card .tlst-card-order-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.tlst-layout-card .tlst-card-order-heading h3 {
	margin: 0;
	padding: 0;
	color: var(--tlst-card-ink);
	font-family: inherit;
	font-size: 17px;
	line-height: 1.3;
}
.tlst-layout-card .tlst-card-badge {
	padding: 7px 12px;
	color: var(--tlst-card-button-text);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	background: var(--tlst-card-button);
	border-radius: 20px;
}

/* The status badge and the document button use the Track button's colors. */
/* Six-step progress: completed steps show a checkmark, the current one its number. */
.tlst-layout-card .tlst-card-steps {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	margin: 28px 0;
	padding: 0;
	list-style: none;
}
.tlst-layout-card .tlst-card-steps li {
	position: relative;
	margin: 0;
	padding: 0;
	text-align: center;
	list-style: none;
}
.tlst-layout-card .tlst-card-steps li::before {
	content: "";
	position: absolute;
	top: 16px;
	right: 50%;
	left: -50%;
	height: 3px;
	background: var(--tlst-card-line);
}
.tlst-layout-card .tlst-card-steps li:first-child::before {
	content: none;
}
.tlst-layout-card .tlst-card-steps li.is-done::before,
.tlst-layout-card .tlst-card-steps li.is-current::before {
	background: var(--tlst-card-accent);
}
.tlst-layout-card .tlst-card-dot {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 35px;
	margin: 0 auto 8px;
	color: var(--tlst-card-muted);
	font-size: 13px;
	font-weight: 700;
	background: var(--tlst-card-background);
	border: 2px solid var(--tlst-card-line);
	border-radius: 50%;
}
.tlst-layout-card .tlst-card-steps li.is-done .tlst-card-dot {
	color: var(--tlst-card-accent);
	border-color: var(--tlst-card-accent);
}
.tlst-layout-card .tlst-card-steps li.is-current .tlst-card-dot {
	color: #ffffff;
	background: var(--tlst-card-accent);
	border-color: var(--tlst-card-accent);
}
.tlst-layout-card .tlst-card-steps li.is-current .tlst-card-dot {
	box-shadow: 0 0 0 4px var(--tlst-card-accent-light);
}
.tlst-layout-card .tlst-card-step-label {
	display: block;
	color: var(--tlst-card-muted);
	font-size: 11px;
	line-height: 1.3;
	overflow-wrap: break-word;
}
.tlst-layout-card .tlst-card-steps li.is-current .tlst-card-step-label {
	color: var(--tlst-card-ink);
	font-weight: 700;
}

/* Field grid */
.tlst-layout-card .tlst-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 24px;
	margin: 0;
	padding: 0;
}
.tlst-layout-card .tlst-card-field {
	padding: 14px 0;
	border-bottom: 1px solid var(--tlst-card-divider);
}
.tlst-layout-card .tlst-card-field dt {
	margin: 0 0 6px;
	color: var(--tlst-card-muted);
	font-size: 11px;
	font-weight: 400;
}
.tlst-layout-card .tlst-card-field dd {
	margin: 0;
	color: var(--tlst-card-ink);
	font-size: 16px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

/* Documents (button look shared with Track shipment above) */
.tlst-layout-card .tlst-card-doc {
	margin: 12px 0 0;
}
.tlst-layout-card .tlst-card-no-docs {
	margin: 12px 0 0;
	color: var(--tlst-card-muted);
	font-size: 16px;
}

/* Narrow: by the card's own width, so a narrow page-builder column stacks too. */
@container (max-width: 650px) {
	.tlst-layout-card .tlst-card {
		padding: 23px 20px;
	}
	.tlst-layout-card .tlst-card-controls {
		flex-direction: column;
	}
	.tlst-layout-card .tlst-card-submit {
		width: 100%;
	}
	.tlst-layout-card .tlst-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 16px;
	}
	.tlst-layout-card .tlst-card-steps li:not(.is-current) .tlst-card-step-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}
	/* The one visible label is wider than its column: keep it on one line, centred on its
	   step, and pinned inside the card at the first and last steps. */
	.tlst-layout-card .tlst-card-steps li.is-current .tlst-card-step-label {
		width: max-content;
		margin-left: 50%;
		white-space: nowrap;
		transform: translateX(-50%);
	}
	.tlst-layout-card .tlst-card-steps li.is-current:first-child .tlst-card-step-label {
		margin-left: 0;
		transform: none;
	}
	.tlst-layout-card .tlst-card-steps li.is-current:last-child .tlst-card-step-label {
		margin-left: 100%;
		transform: translateX(-100%);
	}
}
