/* ==========================================================================
   Strate Transition Status

   Every colour below was sampled directly from the approved design, not
   estimated. All tokens live in the block at the top: to restyle, override
   these in the theme stylesheet rather than editing this file, so a plugin
   update doesn't overwrite the change.

   Sharp-cornered house style: set --sts-radius and --sts-radius-sm to 0.
   ========================================================================== */

.sts {
	/* Brand */
	--sts-purple: #5d2575;          /* table header, Overall row text */
	--sts-purple-deep: #541d82;     /* combined pill */
	--sts-ink: #2f2a33;
	--sts-muted: #6b6470;

	/* Surfaces */
	--sts-surface: #f9faf9;
	--sts-overall-bg: #f2eff5;
	--sts-line: #e9e9ec;
	--sts-card-line: #eef0ef;

	/* Accent families: pill background, big-number text, icon disc */
	--sts-rust: #be3f21;
	--sts-rust-text: #c14225;
	--sts-rust-tint: #f4e4d9;

	--sts-teal: #367b7d;
	--sts-teal-text: #387d88;
	--sts-teal-tint: #e2ecec;

	--sts-gold: #c88c31;
	--sts-gold-text: #a67626;
	--sts-gold-tint: #f5eee1;

	--sts-plum-text: #612475;
	--sts-plum-tint: #e5e3e8;

	--sts-combined-text: #602572;
	--sts-combined-tint: #f4edf8;

	/* Shape */
	--sts-radius: 14px;
	--sts-radius-sm: 10px;

	/* Type. Defaults to the surrounding page so the component always sits
	   naturally in the theme. To pin it to the brand face instead, set:
	   --sts-font: "Source Sans Pro", sans-serif; */
	--sts-font: inherit;

	--sts-cal-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.75' y='5.25' width='16.5' height='15' rx='2.5'/%3E%3Cpath d='M3.75 9.75h16.5M8.25 3.25v3.5M15.75 3.25v3.5'/%3E%3C/svg%3E");

	font-family: var(--sts-font);
	color: var(--sts-ink);
	line-height: 1.4;
	container-type: inline-size;
}

.sts *,
.sts *::before,
.sts *::after {
	box-sizing: border-box;
}

/* --- Layout wrappers ------------------------------------------------------ */

.sts .sts__inner {
	display: block;
}

/* --- Date picker ---------------------------------------------------------- */

.sts .sts__picker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.625rem;
	margin: 0 0 1.25rem;
	padding: 0.875rem 1rem;
	background: var(--sts-surface);
	border: 1px solid var(--sts-card-line);
	border-radius: var(--sts-radius);
}

.sts .sts__pickerlabel {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--sts-ink);
	margin: 0;
}

.sts .sts__picker select {
	flex: 1 1 12rem;
	min-width: 0;
	max-width: 20rem;
	padding: 0.5rem 0.75rem;
	font: inherit;
	font-size: 0.9375rem;
	color: var(--sts-ink);
	background: #fff;
	border: 1px solid var(--sts-line);
	border-radius: var(--sts-radius-sm);
}

.sts .sts__pickerbutton {
	padding: 0.5rem 1.125rem;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #fff;
	background: var(--sts-purple);
	border: 1px solid var(--sts-purple);
	border-radius: var(--sts-radius-sm);
	cursor: pointer;
}

.sts .sts__pickerbutton:hover {
	background: var(--sts-purple-deep);
	border-color: var(--sts-purple-deep);
}

.sts .sts__pickerbutton:disabled {
	opacity: 0.55;
	cursor: default;
}

/* With JavaScript the calendar replaces the select, so the button is
   redundant — but both stay in the markup as the no-JS fallback. */
.sts .sts__picker[data-sts-enhanced] .sts__pickerbutton {
	display: none;
}

/* --- Calendar ------------------------------------------------------------- */

.sts .sts__cal {
	position: relative;
	flex: 0 1 auto;
}

.sts .sts__caltrigger {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.875rem;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--sts-ink);
	background: #fff;
	border: 1px solid var(--sts-line);
	border-radius: var(--sts-radius-sm);
	cursor: pointer;
}

.sts .sts__caltrigger::before {
	content: "";
	width: 1.125rem;
	height: 1.125rem;
	flex: 0 0 auto;
	background-color: var(--sts-purple);
	-webkit-mask: var(--sts-cal-icon) center / contain no-repeat;
	mask: var(--sts-cal-icon) center / contain no-repeat;
}

.sts .sts__caltrigger:hover {
	border-color: var(--sts-purple);
}

.sts .sts__caltrigger:focus-visible,
.sts .sts__caldate:focus-visible,
.sts .sts__calnav:focus-visible,
.sts .sts__pickerreset:focus-visible {
	outline: 2px solid var(--sts-purple);
	outline-offset: 2px;
}

.sts .sts__calpop {
	position: absolute;
	z-index: 30;
	top: calc(100% + 0.5rem);
	left: 0;
	width: 18.5rem;
	max-width: calc(100vw - 2rem);
	padding: 0.875rem;
	background: #fff;
	border: 1px solid var(--sts-line);
	border-radius: var(--sts-radius);
	box-shadow: 0 8px 28px rgba(47, 42, 51, 0.16);
}

.sts .sts__calhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.625rem;
}

.sts .sts__calmonth {
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--sts-purple);
}

.sts .sts__calnav {
	width: 2rem;
	height: 2rem;
	font: inherit;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--sts-purple);
	background: transparent;
	border: 1px solid var(--sts-line);
	border-radius: var(--sts-radius-sm);
	cursor: pointer;
}

.sts .sts__calnav:hover:not(:disabled) {
	background: var(--sts-combined-tint);
}

.sts .sts__calnav:disabled {
	opacity: 0.3;
	cursor: default;
}

.sts .sts__calgrid {
	display: block;
}

.sts .sts__calrow--head {
	margin-bottom: 2px;
}

.sts .sts__calrow {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.sts .sts__calday {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 1.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--sts-muted);
	text-transform: uppercase;
}

.sts .sts__caldate {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	min-height: 2.25rem;
	padding: 0;
	font: inherit;
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
	color: var(--sts-ink);
	background: transparent;
	border: 0;
	border-radius: var(--sts-radius-sm);
	cursor: pointer;
}

.sts .sts__caldate:hover:not(.is-empty) {
	background: var(--sts-combined-tint);
}

/* Dates with no published figures. Muted and struck through rather than
   merely pale, so the distinction survives a low-contrast screen. */
.sts .sts__caldate.is-empty {
	color: #b9b4be;
	cursor: not-allowed;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.sts .sts__caldate.is-outside {
	visibility: hidden;
}

.sts .sts__caldate.is-selected {
	background: var(--sts-purple);
	color: #fff;
	font-weight: 700;
}

.sts .sts__callegend {
	margin: 0.625rem 0 0;
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--sts-muted);
}

@media (max-width: 480px) {
	.sts .sts__cal {
		flex: 1 1 100%;
	}

	.sts .sts__caltrigger {
		width: 100%;
		justify-content: center;
	}

	.sts .sts__calpop {
		width: 100%;
	}

	.sts .sts__caldate {
		min-height: 2.5rem;
	}
}

.sts .sts__pickerreset {
	font-size: 0.9375rem;
	color: var(--sts-purple);
	text-decoration: underline;
}

.sts .sts__pickerbusy {
	font-size: 0.9375rem;
	color: var(--sts-muted);
}

.sts .sts__view[aria-busy="true"] {
	opacity: 0.55;
	transition: opacity 0.15s ease;
}

.sts .sts__date:focus {
	outline: none;
}

@media (max-width: 480px) {
	.sts .sts__picker select {
		flex-basis: 100%;
		max-width: none;
	}
}

/* --- Date and status lines ------------------------------------------------ */

.sts .sts__date {
	margin: 0 0 1.25rem;
	font-size: 1.375rem;
	font-weight: 400;
	color: var(--sts-ink);
}

.sts .sts__stale {
	margin: 0 0 1.25rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--sts-gold);
	background: var(--sts-gold-tint);
	border-radius: var(--sts-radius-sm);
	font-size: 0.9375rem;
	color: #6d5313;
}

/* --- Table ----------------------------------------------------------------
   Selectors are doubled up (.sts .sts__table th) and the commonly themed
   properties are all set explicitly, so an existing theme's table styles
   can't leak in and shift the design.
   -------------------------------------------------------------------------- */

.sts .sts__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--sts-radius);
}

.sts .sts__caption {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.sts .sts__table {
	width: 100%;
	min-width: 760px;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--sts-surface);
	border-radius: var(--sts-radius);
	overflow: hidden;
	font-size: 1rem;
	table-layout: auto;
}

/* Header: flat purple across the full width — the design has no gradient. */

.sts .sts__table thead th {
	background: var(--sts-purple);
	color: #fff;
	font-weight: 600;
	font-size: 1rem;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	padding: 1.125rem 1.25rem;
	vertical-align: middle;
	border: 0;
}

.sts .sts__th {
	display: flex;
	align-items: center;
	gap: 0.625rem;
}

.sts .sts__th > span {
	min-width: 0;
}

/* Body: uniform row colour, separated only by a hairline divider.
   The design has no zebra striping. */

.sts .sts__table tbody th,
.sts .sts__table tbody td {
	padding: 1.0625rem 1.25rem;
	border: 0;
	border-bottom: 1px solid var(--sts-line);
	background: var(--sts-surface);
	color: var(--sts-ink);
	font-size: 1rem;
	font-weight: 400;
	text-align: left;
	text-transform: none;
	vertical-align: middle;
}

.sts .sts__rowhead {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 500;
	color: var(--sts-ink);
}

.sts .sts__rowicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--sts-combined-tint);
	color: var(--sts-purple);
}

.sts .sts__count {
	font-variant-numeric: tabular-nums;
}

.sts .sts__pct {
	color: var(--sts-muted);
	font-variant-numeric: tabular-nums;
}

.sts .sts__nil {
	color: var(--sts-muted);
}

/* Overall row */

.sts .sts__table tfoot th,
.sts .sts__table tfoot td {
	padding: 1.0625rem 1.25rem;
	border: 0;
	background: var(--sts-overall-bg);
	color: var(--sts-purple);
	font-weight: 700;
	font-size: 1.0625rem;
	text-align: left;
	vertical-align: middle;
}

.sts .sts__overall .sts__rowhead {
	color: var(--sts-purple);
	font-weight: 700;
}

.sts .sts__overall .sts__rowicon {
	background: #e3d9ea;
}

.sts .sts__overall .sts__pct {
	color: var(--sts-purple);
	font-weight: 700;
}

/* --- Cards ---------------------------------------------------------------- */

.sts .sts__cards {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.sts .sts__cards > li::before,
.sts .sts__cards > li::marker {
	content: none;
}

.sts .sts__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.5rem;
	margin: 0;
	padding: 1.5rem 1rem 1.25rem;
	background: var(--sts-surface);
	border: 1px solid var(--sts-card-line);
	border-radius: var(--sts-radius);
}

.sts .sts__cardicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	margin-bottom: 0.25rem;
}

.sts .sts__value {
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
}

.sts .sts__label {
	font-size: 0.9375rem;
	color: var(--sts-ink);
	max-width: 12rem;
	flex: 1 1 auto;
}

.sts .sts__pill {
	display: inline-block;
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	color: #fff;
	font-weight: 700;
	font-size: 1.0625rem;
	font-variant-numeric: tabular-nums;
}

/* Card tones */

.sts .sts__card--rust .sts__cardicon { background: var(--sts-rust-tint); color: var(--sts-rust); }
.sts .sts__card--rust .sts__value    { color: var(--sts-rust-text); }
.sts .sts__card--rust .sts__pill     { background: var(--sts-rust); }

.sts .sts__card--teal .sts__cardicon { background: var(--sts-teal-tint); color: var(--sts-teal); }
.sts .sts__card--teal .sts__value    { color: var(--sts-teal-text); }
.sts .sts__card--teal .sts__pill     { background: var(--sts-teal); }

.sts .sts__card--gold .sts__cardicon { background: var(--sts-gold-tint); color: var(--sts-gold-text); }
.sts .sts__card--gold .sts__value    { color: var(--sts-gold-text); }
.sts .sts__card--gold .sts__pill     { background: var(--sts-gold); }

.sts .sts__card--plum .sts__cardicon { background: var(--sts-plum-tint); color: var(--sts-plum-text); }
.sts .sts__card--plum .sts__value    { color: var(--sts-plum-text); }

.sts .sts__card--purple .sts__cardicon { background: var(--sts-combined-tint); color: var(--sts-combined-text); }
.sts .sts__card--purple .sts__value    { color: var(--sts-combined-text); }
.sts .sts__card--purple .sts__pill     { background: var(--sts-purple-deep); }

/* --- Footnote ------------------------------------------------------------- */

.sts .sts__note {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 1rem 0 0;
	padding: 1rem 1.25rem;
	background: var(--sts-surface);
	border: 1px solid var(--sts-card-line);
	border-radius: var(--sts-radius);
	font-size: 0.9375rem;
	color: var(--sts-ink);
}

.sts .sts__note .sts-icon {
	flex: 0 0 auto;
	color: var(--sts-purple);
}

/* --- Icons ---------------------------------------------------------------- */

.sts .sts-icon {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
	flex: 0 0 auto;
	max-width: none;
}

.sts .sts-icon--head { width: 1.625rem; height: 1.625rem; }
.sts .sts-icon--row  { width: 1.125rem; height: 1.125rem; }
.sts .sts-icon--card { width: 2rem; height: 2rem; }
.sts .sts-icon--note { width: 1.375rem; height: 1.375rem; }

/* --- Empty state ---------------------------------------------------------- */

.sts--empty p {
	margin: 0;
	padding: 1.25rem;
	background: var(--sts-surface);
	border: 1px dashed var(--sts-line);
	border-radius: var(--sts-radius);
	color: var(--sts-muted);
}

/* --- Admin screen --------------------------------------------------------- */

.sts-admin__field {
	margin: 0 0 1rem;
}

.sts-admin__field input[type="date"] {
	padding: 0.25rem 0.5rem;
	font-size: 14px;
}

.sts-admin__table {
	margin-bottom: 0.75rem;
}

.sts-admin__table input[type="number"] {
	width: 8rem;
	text-align: right;
}

.sts-admin__table th {
	font-weight: 600;
}

/* --- Responsive ----------------------------------------------------------- */

@container (max-width: 1080px) {
	.sts .sts__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container (max-width: 680px) {
	.sts .sts__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sts .sts__value { font-size: 2rem; }
}

@container (max-width: 420px) {
	.sts .sts__cards { grid-template-columns: minmax(0, 1fr); }
}

@supports not (container-type: inline-size) {
	@media (max-width: 1080px) {
		.sts .sts__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	}

	@media (max-width: 680px) {
		.sts .sts__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
		.sts .sts__value { font-size: 2rem; }
	}

	@media (max-width: 420px) {
		.sts .sts__cards { grid-template-columns: minmax(0, 1fr); }
	}
}

/* --- Print ---------------------------------------------------------------- */

@media print {
	.sts .sts__scroll { overflow: visible; }
	.sts .sts__table { min-width: 0; }
	.sts .sts__card { break-inside: avoid; }
}
