.vpnst {
	--vpnst-accent: #3ec99a;
	--vpnst-action: #7c4dff;
	--vpnst-bg: #0d1512;
	--vpnst-surface: rgba(255, 255, 255, 0.04);
	--vpnst-line: rgba(255, 255, 255, 0.08);
	--vpnst-fg: #f2f5f3;
	--vpnst-muted: #8b998f;

	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto;
	padding: 32px 24px 24px;
	border-radius: 20px;
	background: var(--vpnst-bg);
	color: var(--vpnst-fg);
	font-size: 16px;
	line-height: 1.6;
}

.vpnst *,
.vpnst *::before,
.vpnst *::after {
	box-sizing: inherit;
}

.vpnst--align-center {
	text-align: center;
}

.vpnst--align-left {
	text-align: left;
}

.vpnst__heading {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--vpnst-fg);
}

.vpnst__intro {
	margin: 0 0 28px;
	font-size: 14px;
	color: var(--vpnst-muted);
}

.vpnst__stage {
	position: relative;
	margin-bottom: 24px;
}

.vpnst__readout {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 8px;
	min-height: 58px;
}

.vpnst--align-left .vpnst__readout {
	justify-content: flex-start;
}

/* Tabular figures keep the number from reflowing on every sample. */
.vpnst__value {
	font-size: 52px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--vpnst-fg);
}

.vpnst__unit {
	font-size: 15px;
	color: var(--vpnst-muted);
}

.vpnst__phase {
	margin: 10px 0 0;
	font-size: 13px;
	color: var(--vpnst-muted);
	min-height: 20px;
}

.vpnst__trace {
	display: block;
	width: 100%;
	height: 90px;
	margin-top: 16px;
	opacity: 0;
	transition: opacity 240ms ease;
}

.vpnst.is-running .vpnst__trace,
.vpnst.is-done .vpnst__trace {
	opacity: 1;
}

.vpnst__trace-line {
	stroke: var(--vpnst-accent);
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
}

.vpnst[data-direction='upload'] .vpnst__trace-line {
	stroke: var(--vpnst-action);
}

.vpnst__progress {
	height: 2px;
	margin-top: 4px;
	border-radius: 2px;
	background: var(--vpnst-line);
	overflow: hidden;
}

.vpnst__progress-bar {
	width: 0;
	height: 100%;
	background: var(--vpnst-accent);
	transition: width 400ms ease;
}

.vpnst__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 1px;
	background: var(--vpnst-line);
	border-radius: 14px;
	overflow: hidden;
}

.vpnst__stat {
	padding: 14px 16px;
	background: var(--vpnst-bg);
	text-align: left;
	min-width: 0;
}

.vpnst__stat-label {
	display: block;
	font-size: 12px;
	color: var(--vpnst-muted);
	margin-bottom: 4px;
}

.vpnst__stat-value {
	display: block;
	font-size: 20px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	color: var(--vpnst-fg);
	white-space: nowrap;
}

.vpnst__stat-unit {
	margin-left: 4px;
	font-size: 12px;
	font-style: normal;
	font-weight: 400;
	color: var(--vpnst-muted);
}

.vpnst__message {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: 10px;
	background: rgba(226, 75, 74, 0.12);
	color: #f09595;
	font-size: 14px;
	text-align: left;
}

.vpnst__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 24px;
}

.vpnst--align-left .vpnst__actions {
	justify-content: flex-start;
}

.vpnst__button {
	appearance: none;
	min-width: 180px;
	padding: 14px 28px;
	border: 1px solid var(--vpnst-action);
	border-radius: 999px;
	background: transparent;
	color: var(--vpnst-action);
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 160ms ease, transform 120ms ease;
}

.vpnst__button:hover:not(:disabled) {
	background: rgba(124, 77, 255, 0.12);
}

.vpnst__button:active:not(:disabled) {
	transform: scale(0.985);
}

.vpnst__button:disabled {
	opacity: 0.55;
	cursor: default;
}

.vpnst__button:focus-visible,
.vpnst__cta:focus-visible {
	outline: 2px solid var(--vpnst-accent);
	outline-offset: 3px;
}

.vpnst__cta {
	display: inline-flex;
	align-items: center;
	padding: 14px 24px;
	border-radius: 999px;
	color: var(--vpnst-fg);
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	background: rgba(255, 255, 255, 0.06);
	transition: background-color 160ms ease;
}

.vpnst__cta:hover {
	background: rgba(255, 255, 255, 0.11);
	color: var(--vpnst-fg);
}

.vpnst__note {
	margin: 20px 0 0;
	font-size: 12px;
	line-height: 1.6;
	color: var(--vpnst-muted);
}

.vpnst__note a {
	color: var(--vpnst-muted);
	text-decoration: underline;
}

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

@media (max-width: 480px) {
	.vpnst {
		padding: 24px 16px 20px;
		border-radius: 16px;
	}

	.vpnst__value {
		font-size: 42px;
	}

	.vpnst__button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vpnst__trace,
	.vpnst__progress-bar,
	.vpnst__button {
		transition: none;
	}
}

/* Connection info panel ------------------------------------------------- */

.vpnst__info {
	margin: 0 0 24px;
	padding: 16px 18px;
	border-radius: 14px;
	background: var(--vpnst-surface);
	text-align: left;
}

.vpnst__info-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--vpnst-line);
}

.vpnst__info--empty .vpnst__info-head {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.vpnst__info--empty .vpnst__info-list {
	display: none;
}

.vpnst__info-flag {
	font-size: 20px;
	line-height: 1;
}

.vpnst__info-flag:empty {
	display: none;
}

.vpnst__info-primary {
	font-size: 15px;
	font-weight: 500;
	color: var(--vpnst-fg);
	min-width: 0;
	overflow-wrap: anywhere;
}

.vpnst__info-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px 20px;
	margin: 0;
}

.vpnst__info-row {
	min-width: 0;
}

.vpnst__info-row dt {
	font-size: 12px;
	color: var(--vpnst-muted);
	margin-bottom: 2px;
}

/* Addresses and codes must never be clipped — a truncated IP is wrong data,
   not just an ugly line. Wrap instead. */
.vpnst__info-row dd {
	margin: 0;
	font-size: 14px;
	color: var(--vpnst-fg);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}
