/* biome-ignore-all lint/style/noDescendingSpecificity: components in reading order, wider screens after the phone rules */
/* The signed-in account: the callout that connects Telegram, the balance card, sign-in
   methods and the payment history. Extends static/site.css and checkout.css. */
#account-view {
	display: grid;
	gap: 20px;
}
#account-view > * {
	min-width: 0;
}
.connect__text {
	max-width: 34em;
	color: var(--muted);
}
.connect .challenge {
	width: 100%;
	max-width: 520px;
	padding-top: 20px;
	border-top: 1px solid var(--line-2);
}
.stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px 16px;
	margin: 0;
}
.stat:first-child {
	grid-column: 1 / -1;
}
.stat dt {
	display: flex;
	align-items: flex-end;
	min-height: 32px;
	margin-bottom: 8px;
}
.stat:first-child dt {
	min-height: 0;
}
.stat dd {
	margin: 0;
	font: 700 30px / 1.1 var(--ff-d);
	letter-spacing: -0.03em;
	overflow-wrap: anywhere;
}
.stat .stat__note {
	margin-top: 8px;
	color: var(--muted);
	font: 500 12px / 16px var(--ff-m);
	letter-spacing: 0;
}
.summary__cta {
	display: grid;
	gap: 10px;
	padding-top: 20px;
	border-top: 1px solid var(--line-2);
}
/* "Sign-in methods" opens downwards over the full width; "Sign out" keeps its corner */
.tools {
	position: relative;
}
.tools__out {
	position: absolute;
	top: 0;
	right: 0;
}
.methods > summary {
	width: fit-content;
	max-width: calc(100% - 8em);
}
.methods summary,
.account-email summary {
	min-height: 44px;
	padding: 10px 0;
	color: var(--muted);
	cursor: pointer;
	transition: color 0.2s;
}
.methods summary:hover,
.account-email summary:hover {
	color: var(--text);
}
.methods__body {
	max-width: 520px;
	margin: 4px 0 12px;
	padding: 4px 20px;
	border-radius: var(--r-m);
	border: 1px solid var(--line);
	background: var(--s1);
}
.identity-method {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 56px;
}
.identity-method + .identity-method,
.methods__body > .account-email {
	border-top: 1px solid var(--line);
}
.connected {
	color: var(--cyan);
	font: 500 12px / 16px var(--ff-m);
}
.account-email form {
	margin-top: 8px;
}
.account-email .fineprint {
	margin-bottom: 14px;
}
.panel-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}
.history-empty {
	color: var(--muted);
}
.history-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 4px 16px;
	padding: 16px 0;
	border-top: 1px solid var(--line);
}
.history-row:last-child {
	padding-bottom: 0;
}
.history-row__what {
	font-weight: 600;
}
.history-row__when {
	grid-row: 2;
	color: var(--dim);
	font-size: 14px;
	line-height: 20px;
}
.history-row > strong {
	grid-column: 2;
	grid-row: 1;
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.history-row .text-button {
	grid-column: 1 / -1;
}
.status-pill {
	grid-column: 2;
	grid-row: 2;
	text-align: right;
	color: var(--muted);
	font: 500 12px / 20px var(--ff-m);
}
.status-pill--fulfilled {
	color: var(--cyan);
}
.status-pill--failed,
.status-pill--partial,
.status-pill--held {
	color: var(--pink);
}
/* what the access includes, under the three numbers (W09) */
.balance-more {
	padding-top: 20px;
	border-top: 1px solid var(--line-2);
}
.balance-more .incl__list {
	margin-top: 12px;
}
/* the email reward (W71): one line under the three numbers, or in the Telegram panel */
.reward-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	padding-top: 20px;
	border-top: 1px solid var(--line-2);
	overflow-wrap: anywhere;
}
.connect .reward-line {
	padding-top: 0;
	border-top: 0;
}
/* the bot's History: what happened, when, and the change of the balance */
.activity-card .panel-head {
	flex-wrap: wrap;
}
.activity__page {
	color: var(--dim);
	font: 500 12px / 20px var(--ff-m);
}
.activity-row > strong {
	grid-row: 1 / span 2;
	align-self: center;
	font-variant-numeric: tabular-nums;
}
.activity-row__in {
	color: var(--cyan);
}
.activity-row__out {
	color: var(--muted);
}
.activity__pager {
	display: flex;
	gap: 10px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}
.activity__failed {
	padding-top: 12px;
	color: var(--pink);
}
.subscription-price {
	color: var(--pink);
	font: 700 30px / 1.1 var(--ff-d);
	letter-spacing: -0.03em;
}
.subscription-card #subscription {
	display: grid;
	gap: 12px;
	justify-items: start;
}
.subscription-card .detail-line {
	width: 100%;
}

/* ---------- the dialog that asks before auto-renewal is switched off ---------- */
dialog {
	max-width: 520px;
	width: calc(100% - 40px);
	border: 1px solid var(--line-2);
	background: var(--s1);
	color: var(--text);
	padding: 32px;
	border-radius: 24px;
}
dialog::backdrop {
	background: rgba(4, 5, 16, 0.78);
	backdrop-filter: blur(8px);
}
dialog h2 {
	margin-bottom: 12px;
}
dialog p {
	margin-top: 8px;
	color: var(--muted);
}
.dialog-actions {
	display: flex;
	gap: 10px;
	margin-top: 26px;
}
@media (max-width: 700px) {
	.dialog-actions {
		flex-direction: column;
	}
}

/* ---------- tablet and desktop ---------- */
@media (min-width: 720px) {
	.summary__cta {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 12px 20px;
		padding-top: 24px;
	}
	#account-view {
		gap: 24px;
	}
	.stats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px 32px;
	}
	.stat:first-child {
		grid-column: auto;
	}
	.stat dt,
	.stat:first-child dt {
		min-height: 16px;
	}
	.history-row {
		grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.7fr) minmax(
				0,
				1.1fr
			);
		align-items: baseline;
		gap: 4px 24px;
	}
	.history-row__when,
	.history-row > strong,
	.status-pill {
		grid-column: auto;
		grid-row: auto;
	}
	.history-row__when {
		font-size: 16px;
		line-height: 24px;
	}
	.activity-row {
		grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 0.6fr);
	}
	.history-row.activity-row > strong {
		grid-row: auto;
		text-align: right;
	}
	.history-row > strong {
		text-align: left;
	}
}
