/*
 * Mench Subscriptions: My Account > Subscriptions and the manage-link page.
 * Every selector starts with .msub so nothing leaks into the theme. Colours and fonts follow the theme where they can.
 */
.msub {
	--msub-line: rgba(0, 0, 0, 0.16);
	--msub-soft: rgba(0, 0, 0, 0.04);
	--msub-muted: rgba(0, 0, 0, 0.62);
	--msub-accent: #173b63;
	--msub-focus: #1f5fbf;
	--msub-danger: #b32d2e;
	--msub-ok: #1a6b3a;
	box-sizing: border-box;
	color: inherit;
	max-width: 100%;
}

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

.msub-muted,
.msub .msub-muted {
	color: var(--msub-muted, rgba(0, 0, 0, 0.62));
}

.msub .msub-sub {
	color: var(--msub-muted);
	display: block;
	font-size: 0.875em;
}

/* Status badge */
.msub .msub-badge {
	background: var(--msub-soft);
	border: 1px solid var(--msub-line);
	border-radius: 999px;
	display: inline-block;
	font-size: 0.8125em;
	font-weight: 600;
	line-height: 1.5;
	padding: 2px 10px;
	white-space: nowrap;
}

.msub .msub-badge--active {
	background: #e7f4ec;
	border-color: #9fd2b2;
	color: #14532d;
}

.msub .msub-badge--on-hold {
	background: #fdf1de;
	border-color: #e8c27d;
	color: #7a4a00;
}

.msub .msub-badge--paused {
	background: #edf3fb;
	border-color: #b9c8dc;
	color: #173b63;
}

.msub .msub-badge--cancelled,
.msub .msub-badge--expired {
	background: #f3f3f3;
	border-color: #cfcfcf;
	color: #50575e;
}

/* Tables */
.msub .msub-table {
	border-collapse: collapse;
	margin: 0 0 1.5em;
	width: 100%;
}

.msub .msub-table th,
.msub .msub-table td {
	border-bottom: 1px solid var(--msub-line);
	padding: 12px 10px;
	text-align: left;
	vertical-align: middle;
}

.msub .msub-table th {
	font-size: 0.875em;
	font-weight: 600;
}

.msub .msub-name {
	font-weight: 600;
}

.msub .msub-actions-cell {
	text-align: right;
}

/* Detail view */
.msub .msub-back {
	margin: 0 0 1em;
}

.msub .msub-head {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	margin: 0 0 1em;
}

.msub .msub-title {
	font-size: 1.5em;
	line-height: 1.25;
	margin: 0;
	overflow-wrap: anywhere;
}

.msub .msub-heading {
	font-size: 1.125em;
	margin: 1.5em 0 0.5em;
}

.msub .msub-facts {
	border: 1px solid var(--msub-line);
	border-radius: 8px;
	margin: 0 0 1em;
	overflow: hidden;
}

.msub .msub-facts__row {
	border-bottom: 1px solid var(--msub-line);
	display: grid;
	gap: 4px 16px;
	grid-template-columns: minmax(120px, 30%) 1fr;
	padding: 12px 14px;
}

.msub .msub-facts__row:last-child {
	border-bottom: 0;
}

.msub .msub-facts dt {
	color: var(--msub-muted);
	font-weight: 600;
	margin: 0;
}

.msub .msub-facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.msub .msub-note {
	margin: 0 0 1em;
}

.msub .msub-product {
	font-weight: 600;
	margin: 0 0 0.5em;
	overflow-wrap: anywhere;
}

/* Notices */
.msub .msub-notice {
	background: var(--msub-soft);
	border: 1px solid var(--msub-line);
	border-left-width: 4px;
	border-radius: 6px;
	margin: 0 0 1em;
	padding: 12px 16px;
}

.msub .msub-notice p {
	margin: 0 0 0.6em;
}

.msub .msub-notice p:last-child {
	margin-bottom: 0;
}

.msub .msub-notice--due {
	background: #fdf6e8;
	border-color: #e8c27d;
}

.msub .msub-notice--error {
	background: #fceeee;
	border-color: var(--msub-danger);
}

.msub .msub-notice--success {
	background: #e9f5ee;
	border-color: var(--msub-ok);
}

.msub .msub-notice--info {
	border-color: var(--msub-accent);
}

/* Cards and forms */
.msub .msub-actions {
	display: grid;
	gap: 16px;
	margin: 0 0 1em;
}

.msub .msub-card {
	background: transparent;
	border: 1px solid var(--msub-line);
	border-radius: 8px;
	margin: 0 0 1em;
	padding: 16px;
}

.msub .msub-card > .msub-heading:first-child {
	margin-top: 0;
}

.msub .msub-label {
	display: block;
	font-weight: 600;
	margin: 0 0 6px;
}

.msub .msub-input {
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 6px;
	color: #1d2327;
	font: inherit;
	max-width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	width: 100%;
}

.msub .msub-cancel summary {
	align-items: center;
	cursor: pointer;
	display: flex;
	font-weight: 600;
	list-style: none;
	min-height: 44px;
}

.msub .msub-cancel summary::-webkit-details-marker {
	display: none;
}

.msub .msub-cancel summary::after {
	content: "+";
	font-size: 1.25em;
	margin-left: auto;
}

.msub .msub-cancel[open] summary::after {
	content: "\2212";
}

.msub .msub-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 1em;
}

/* Buttons: 44px tall; plain buttons are quiet, primary and danger carry our colours (set with the .button class too, so a theme's button style cannot win) */
.msub .msub-btn,
.msub .msub-btn.msub-btn.button {
	align-items: center;
	background: #fff;
	border: 1px solid #b9c8dc;
	border-radius: 6px;
	box-shadow: none;
	color: var(--msub-accent);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 600;
	justify-content: center;
	line-height: 1.2;
	margin: 0;
	min-height: 44px;
	min-width: 44px;
	padding: 10px 18px;
	text-align: center;
	text-decoration: none;
}

.msub .msub-btn:hover,
.msub .msub-btn.msub-btn.button:hover {
	background: #edf3fb;
	border-color: var(--msub-accent);
	color: var(--msub-accent);
}

.msub .msub-btn--primary,
.msub .msub-btn--primary.msub-btn--primary.button {
	background: var(--msub-accent);
	border-color: var(--msub-accent);
	color: #fff;
}

.msub .msub-btn--primary:hover,
.msub .msub-btn--primary.msub-btn--primary.button:hover {
	background: #102a47;
	border-color: #102a47;
	color: #fff;
}

.msub .msub-btn--danger,
.msub .msub-btn--danger.msub-btn--danger.button {
	background: #fff;
	border-color: var(--msub-danger);
	color: var(--msub-danger);
}

.msub .msub-btn--danger:hover,
.msub .msub-btn--danger.msub-btn--danger.button:hover {
	background: #fceeee;
	border-color: #8a1f20;
	color: #8a1f20;
}

/* Visible focus on everything we render */
.msub a:focus-visible,
.msub button:focus-visible,
.msub input:focus-visible,
.msub summary:focus-visible {
	outline: 3px solid var(--msub-focus);
	outline-offset: 2px;
}

/* Manage-link page (standalone) */
.msub-manage-body {
	background: #f6f8fc;
	color: #1d2327;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	margin: 0;
}

.msub-manage-wrap {
	margin: 0 auto;
	max-width: 640px;
	padding: 24px 16px 48px;
}

.msub-manage-wrap .msub-eyebrow {
	color: #50575e;
	font-size: 0.875em;
	font-weight: 600;
	letter-spacing: 0.02em;
	margin: 0 0 8px;
}

.msub-manage-wrap .msub-manage__title {
	color: #142b49;
	font-size: 1.625em;
	line-height: 1.25;
	margin: 0 0 16px;
}

.msub-manage-wrap .msub-card {
	background: #fff;
	border-color: #dce3ee;
}

.msub-manage-wrap .msub-table {
	background: #fff;
	font-size: 0.9375em;
}

.msub-manage-wrap a {
	color: #173b63;
}

/* Small screens: the tables stack, buttons fill the row */
@media (max-width: 640px) {
	.msub .msub-table,
	.msub .msub-table tbody {
		display: block;
		width: 100%;
	}

	.msub .msub-table thead {
		clip: rect(0 0 0 0);
		height: 1px;
		overflow: hidden;
		position: absolute;
		width: 1px;
	}

	.msub .msub-table tr {
		border: 1px solid var(--msub-line);
		border-radius: 8px;
		display: block;
		margin: 0 0 12px;
	}

	.msub .msub-table td {
		align-items: baseline;
		border-bottom: 1px solid var(--msub-line);
		display: flex;
		gap: 12px;
		justify-content: space-between;
		text-align: right;
	}

	.msub .msub-table td:last-child {
		border-bottom: 0;
	}

	.msub .msub-table td::before {
		color: var(--msub-muted);
		content: attr(data-title);
		flex: 0 0 auto;
		font-weight: 600;
		text-align: left;
	}

	.msub .msub-table td.msub-actions-cell::before {
		content: none;
	}

	.msub .msub-table td.msub-actions-cell {
		justify-content: stretch;
	}

	.msub .msub-actions-cell .msub-btn,
	.msub .msub-buttons .msub-btn,
	.msub .msub-notice .msub-btn {
		width: 100%;
	}

	.msub .msub-facts__row {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.msub * {
		scroll-behavior: auto;
		transition: none;
	}
}
