/**
 * My Account: the trial pages' layout, with tabs.
 *
 * The page template (the theme's templates/page-my-account.html) gives the
 * full-width section; Endpoints prints the eyebrow and the heading; this
 * styles what sits under them. Forms, the status box (.ur-form__message), the
 * details list (.ur-form__review) and the day tabs (.ur-schedule__day) are the
 * theme's own, so only the account's rows, tabs and badges live here, and
 * every value is a theme custom property. Yellow is a fill here, never text
 * on white (1.26:1).
 */

/* WooCommerce caps its own pages at 1000px and floats the content at 68%;
   here the section's wide group sets the width and the grid the layout.
   Prefixed with body to outrank WooCommerce's selectors whatever the order. */
body.woocommerce-account main .woocommerce {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	max-inline-size: none;
	margin: 0;
	padding: 0;
	color-scheme: light;
}

body.woocommerce-account main .woocommerce > * {
	margin-block: 0;
}

body.woocommerce-account .woocommerce-MyAccount-content {
	float: none;
	width: auto;
	min-inline-size: 0;
}

/* WooCommerce boxes its login form; here it sits on the page. */
body.woocommerce-account .woocommerce form.login {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
}

/* The trial week, as the trial pages' lede: their measure, and room below. */
body.woocommerce-account main .woocommerce > .ur-acct__intro {
	max-inline-size: 56ch;
	margin-block-end: var(--wp--preset--spacing--20);
}

/* -- Tabs, and the member's name with Log out at the end ------------------- */

.ur-acct-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.ur-acct-tabs a {
	border: 1px solid var(--ur-rule);
	padding: 0.625rem 1rem;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-decoration: none;
	color: inherit;
}

.ur-acct-tabs a[aria-current="page"] {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}

.ur-acct-tabs__who {
	margin-inline-start: auto;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gray);
}

.ur-acct-tabs .ur-acct-tabs__out {
	border-color: transparent;
	padding-inline: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* -- A tab's panel ---------------------------------------------------------- */

.ur-acct__panel {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	justify-items: start;
}

.ur-acct__panel > * {
	margin-block: 0;
}

.ur-acct__panel > .ur-form__message,
.ur-acct__panel > .ur-rows,
.ur-acct__panel > .ur-slots,
.ur-acct__panel > .ur-mc,
.ur-acct__panel > .ur-form {
	justify-self: stretch;
}

/* .ur-form centres itself in a 34rem column; here it starts at the left. */
.ur-acct__panel > .ur-form {
	margin-inline: 0;
}

.ur-acct__panel > h3 {
	margin-block-start: var(--wp--preset--spacing--20);
}

.ur-acct__note {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gray);
}

/* -- Rows: a booking, a class time, a workout ------------------------------ */

.ur-rows {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ur-rows > li {
	margin: 0;
}

.ur-row {
	display: grid;
	align-items: center;
	gap: 0.5rem var(--wp--preset--spacing--30);
	padding-block: var(--wp--preset--spacing--20);
	border-block-start: 1px solid var(--ur-rule);
}

.ur-rows > .ur-row:last-child {
	border-block-end: 1px solid var(--ur-rule);
}

.ur-row > * {
	margin: 0;
}

.ur-row--booking {
	grid-template-columns: 1fr auto;
	/* Change time and Cancel come back here, clear of the fixed header. */
	scroll-margin-block-start: 8rem;
}

.ur-row--slot {
	grid-template-columns: 6.5rem 1fr auto;
}

.ur-row--empty {
	color: var(--wp--preset--color--gray);
}

.ur-row--booking.is-active {
	box-shadow: inset 4px 0 0 var(--wp--preset--color--accent);
	padding-inline-start: 1rem;
}

.ur-row__when {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.ur-row__day {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--gray);
}

.ur-row__time {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 900;
	letter-spacing: var(--wp--custom--tracking--tight);
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--contrast);
}

.ur-row--slot .ur-row__time {
	font-size: var(--wp--preset--font-size--medium);
}

.ur-row.is-full .ur-row__time {
	color: var(--wp--preset--color--gray);
}

.ur-row__meta,
.ur-places {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gray);
}

/* The theme lets text break anywhere, which also lets the grid squeeze
   these to one Korean syllable a line; here they break only between words. */
.ur-places,
.ur-tag {
	overflow-wrap: normal;
}

/* Few places left: black on a yellow fill. */
.ur-places--few {
	justify-self: start;
	padding: 0.2rem 0.55rem;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
	font-weight: 700;
}

.ur-tag {
	justify-self: start;
	padding: 0.25rem 0.6rem;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--contrast);
}

.ur-row__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: center;
	justify-content: flex-end;
}

.ur-row__form {
	margin: 0;
}

.woocommerce-account .ur-row .wp-element-button {
	font-size: var(--wp--preset--font-size--x-small);
	padding: 0.75rem 1.25rem;
}

/* Change time is secondary: an outline rather than the yellow slab. */
.woocommerce-account .ur-quiet {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--ur-rule);
	color: inherit;
}

.ur-linkbtn {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.ur-confirm {
	font-weight: 700;
}

/* -- Day tabs: the theme's, without the trial form's time tiles ------------ */

.woocommerce-account .ur-slots__panel {
	display: block;
}

/* The theme stretches the timetable's tabs across each row on phones; these
   keep their own width, so a last day never fills a row alone. */
.ur-slots__days .ur-schedule__day {
	flex: initial;
}

/* -- Change time: the times to move to, under the booking ------------------ */

.ur-picker {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--mist);
	border-inline-start: 4px solid var(--wp--preset--color--accent);
}

.ur-picker > * {
	margin: 0;
}

.ur-picker__hint {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gray);
}

/* -- Meters Club: a badge per milestone ------------------------------------ */

.ur-badges {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 0.75rem;
}

.ur-badge {
	margin: 0;
	display: grid;
	gap: 0.375rem;
	justify-items: center;
	align-content: start;
	padding: 1.5rem 1rem 1.25rem;
	text-align: center;
	background: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--gray);
}

.ur-badge > * {
	margin: 0;
}

.ur-badge__mark {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 900;
	line-height: 1;
	letter-spacing: var(--wp--custom--tracking--tight);
}

.ur-badge__dist,
.ur-badge__state {
	font-size: var(--wp--preset--font-size--x-small);
}

.ur-badge__dist {
	font-weight: 700;
	letter-spacing: 0.04em;
}

.ur-badge.is-earned,
.ur-badge.is-next {
	color: var(--wp--preset--color--contrast);
}

.ur-badge.is-earned {
	background: var(--wp--preset--color--accent);
}

.ur-badge.is-earned .ur-badge__state {
	font-weight: 700;
}

.ur-badge__bar {
	inline-size: 100%;
	block-size: 4px;
	margin-block-start: 0.25rem;
	background: var(--ur-rule);
}

.ur-badge__bar > span {
	display: block;
	block-size: 100%;
	background: var(--wp--preset--color--contrast);
}

/* -- Meters Club: the big number, totals, bests and the workout log -------- */

.ur-mc {
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

.ur-mc > *,
.ur-mc__section > *,
.ur-mc__head > *,
.ur-mc-hero > *,
.ur-mc-meter > * {
	margin: 0;
}

.ur-mc__section {
	display: grid;
	gap: var(--wp--preset--spacing--20);
}

.ur-mc__head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	align-items: baseline;
	justify-content: space-between;
}

.ur-mc__lede {
	max-inline-size: 40rem;
}

.ur-mc .wp-element-button {
	justify-self: start;
}

.ur-mc-hero {
	display: grid;
	gap: 0.75rem;
	padding: var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--mist);
	border-inline-start: 4px solid var(--wp--preset--color--accent);
}

.ur-mc-hero__label,
.ur-stat__label,
.ur-pb__label {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--gray);
}

.ur-mc-hero__value {
	font-size: clamp(3rem, 8vw, 4.75rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: var(--wp--custom--tracking--tight);
	color: var(--wp--preset--color--contrast);
}

.ur-mc-hero__value small {
	font-size: 0.4em;
	font-weight: 700;
	letter-spacing: 0;
	margin-inline-start: 0.15em;
}

.ur-mc-meter {
	display: grid;
	gap: 0.5rem;
	max-inline-size: 34rem;
}

.ur-mc-meter__track {
	block-size: 8px;
	background: var(--ur-rule);
}

.ur-mc-meter__track > span {
	display: block;
	block-size: 100%;
	background: var(--wp--preset--color--contrast);
}

.ur-mc-meter__text {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
}

.ur-stats,
.ur-pbs,
.ur-mc-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.ur-stats {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ur-pbs {
	grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.ur-stat,
.ur-pb,
.ur-mc-steps li {
	position: relative;
	margin: 0;
	display: grid;
	gap: 0.35rem;
	align-content: start;
	padding: 1.25rem;
	box-shadow: inset 0 0 0 1px var(--ur-rule);
}

.ur-stat__value,
.ur-pb__value {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 900;
	line-height: 1.1;
	letter-spacing: var(--wp--custom--tracking--tight);
	color: var(--wp--preset--color--contrast);
}

.ur-stat__sub,
.ur-pb__sub {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--gray);
}

.ur-pb.is-empty .ur-pb__value {
	padding-block-start: 0.4rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0;
	color: var(--wp--preset--color--gray);
}

/* Yellow is a fill, never text on white: black on yellow. */
.ur-pb__new {
	position: absolute;
	inset-block-start: 1rem;
	inset-inline-end: 1rem;
	padding: 0.15rem 0.45rem;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}

/* A table, so the numbers line up in columns. */
.ur-log {
	inline-size: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.ur-log th,
.ur-log td {
	border-block-end: 1px solid var(--ur-rule);
	white-space: nowrap;
}

.ur-log th {
	padding: 0 1.25rem 0.75rem 0;
	text-align: start;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--gray);
}

.ur-log td {
	padding: 1rem 1.25rem 1rem 0;
	color: var(--wp--preset--color--contrast);
}

.ur-log th:last-child,
.ur-log td:last-child {
	padding-inline-end: 0;
}

.ur-log .num {
	text-align: end;
}

.ur-log .ur-log__day {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--gray);
}

.ur-log__dist {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 900;
	letter-spacing: var(--wp--custom--tracking--tight);
}

.ur-log .ur-log__none {
	color: var(--wp--preset--color--gray);
}

.ur-mc-steps {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	counter-reset: step;
}

.ur-mc-steps li {
	gap: 0.4rem;
	counter-increment: step;
}

.ur-mc-steps li::before {
	content: counter(step);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 900;
	line-height: 1;
	color: var(--wp--preset--color--contrast);
}

.ur-mc-steps strong {
	color: var(--wp--preset--color--contrast);
}

.ur-mc-steps span {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gray);
}

@media (max-width: 900px) {
	.ur-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ur-mc-steps {
		grid-template-columns: 1fr;
	}
}

/* One block per workout: distance and day, then the numbers in a row. */
@media (max-width: 700px) {
	.ur-log thead {
		position: absolute;
		inline-size: 1px;
		block-size: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.ur-log,
	.ur-log tbody {
		display: block;
	}

	.ur-log tr {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 0.5rem 0.75rem;
		padding-block: 1rem;
		border-block-end: 1px solid var(--ur-rule);
	}

	.ur-log td {
		display: grid;
		gap: 0.1rem;
		padding: 0;
		border: 0;
		text-align: start;
	}

	.ur-log td.ur-log__dist {
		grid-row: 1;
		grid-column: 1 / 4;
	}

	.ur-log td.ur-log__day {
		grid-row: 1;
		grid-column: 4 / 6;
		text-align: end;
		align-self: center;
	}

	.ur-log td.num {
		text-align: start;
		font-size: var(--wp--preset--font-size--small);
	}

	/* A missing value keeps its place, so the columns stay in line. */
	.ur-log td.ur-log__none {
		visibility: hidden;
	}

	.ur-log td[data-short]::before {
		content: attr(data-short);
		font-size: var(--wp--preset--font-size--x-small);
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.08em;
		color: var(--wp--preset--color--gray);
	}
}

@media (max-width: 600px) {
	.ur-row--slot {
		grid-template-columns: 5rem 1fr auto;
	}

	.ur-row--booking {
		grid-template-columns: 1fr;
	}

	.ur-row--booking .ur-row__actions {
		justify-content: flex-start;
	}

	/* The name and Log out get their own line under the tabs. */
	.ur-acct-tabs__who {
		margin-inline-start: 0;
		flex-basis: 100%;
	}
}
