.page {
	display: flex;
	flex-direction: column;
	width: min(100% - 48px, 1180px);
	min-height: 100vh;
	min-height: 100svh;
	margin: 0 auto;
}

.site-header,
footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.site-header {
	min-height: 78px;
	border-bottom: 1px solid var(--border);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.035em;
	text-decoration: none;
}

.brand img {
	width: 42px;
	height: 26px;
	object-fit: contain;
}

.brand-section {
	color: var(--muted);
	font-weight: 400;
}

.back-link {
	color: var(--muted);
	font-size: 13px;
	text-decoration: none;
}

.back-link span {
	display: inline-block;
	margin-left: 3px;
}

.back-link:hover {
	color: var(--foreground);
}

main {
	flex: 1;
	padding-bottom: 72px;
}

.summary {
	padding: 62px 0 58px;
}

.eyebrow {
	margin: 0 0 13px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.065em;
	text-transform: uppercase;
}

.summary-line {
	display: flex;
	align-items: center;
	gap: 18px;
}

.summary-marker {
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 6px var(--border);
	color: var(--muted);
}

.summary-marker--up {
	box-shadow: 0 0 0 6px var(--ok-soft);
	color: var(--ok);
}

.summary-marker--down {
	box-shadow: 0 0 0 6px var(--fail-soft);
	color: var(--fail);
}

.summary-marker--stale,
.summary-marker--error {
	box-shadow: 0 0 0 6px var(--warn-soft);
	color: var(--warn);
}

.summary-marker--loading {
	animation: pulse 1.2s ease-in-out infinite;
}

h1 {
	margin: 0;
	font-size: clamp(44px, 5vw, 62px);
	font-weight: 600;
	letter-spacing: -0.052em;
	line-height: 1.02;
}

.summary-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
	color: var(--muted);
	font-size: 13px;
}

.meta-divider {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
}

#retry {
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--accent);
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.incident {
	margin: 0 0 42px;
	padding: 18px 20px;
	border-left: 3px solid var(--warn);
	background: var(--warn-soft);
}

.incident-label,
.incident h2,
.incident > p:last-child {
	margin: 0;
}

.incident-label {
	color: var(--warn);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.incident h2 {
	margin-top: 4px;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.025em;
}

.incident > p:last-child {
	margin-top: 5px;
	color: var(--muted);
	font-size: 13px;
}

.section-heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	padding-bottom: 14px;
}

.section-heading h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.025em;
}

.section-heading p {
	margin: 3px 0 0;
	color: var(--muted);
	font-size: 11px;
}

#history-window {
	color: var(--muted);
	font-size: 12px;
	text-align: right;
}

.history-controls {
	display: flex;
	align-items: flex-end;
	flex-direction: column;
	gap: 7px;
}

.period-switch {
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--border);
	border-radius: 7px;
}

.period-switch button {
	padding: 5px 9px;
	border: 0;
	border-radius: 5px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 11px;
	cursor: pointer;
}

.period-switch button:hover {
	color: var(--foreground);
}

.period-switch button[aria-pressed="true"] {
	background: var(--foreground);
	color: var(--background);
}

.period-switch button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.service-list {
	border-top: 1px solid var(--border);
}

.service-row {
	display: grid;
	grid-template-columns: 220px minmax(300px, 1fr) 380px;
	align-items: center;
	gap: 34px;
	padding: 24px 0;
	border-bottom: 1px solid var(--border);
}

.service-info {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
}

.state-dot {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-top: 7px;
	border-radius: 50%;
	background: var(--muted);
}

.service-info h3,
.service-state {
	margin: 0;
}

.service-info h3 {
	min-width: 0;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.025em;
}

.service-link {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-decoration: none;
}

.service-link:hover {
	color: var(--accent);
}

.service-state {
	margin-top: 2px;
	color: var(--muted);
	font-size: 12px;
}

.service-row--up .state-dot {
	background: var(--ok);
}

.service-row--up .service-state {
	color: var(--ok);
}

.service-row--down .state-dot {
	background: var(--fail);
}

.service-row--down .service-state {
	color: var(--fail);
}

.service-row--stale .state-dot,
.service-row--unknown .state-dot {
	background: var(--warn);
}

.service-row--stale .service-state,
.service-row--unknown .service-state {
	color: var(--warn);
}

.history {
	display: flex;
	gap: 2px;
	height: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.history li {
	flex: 1 1 0;
	min-width: 0;
	border-radius: 2px;
	background: var(--border);
}

.history .history-item--up {
	background: var(--ok);
}

.history .history-item--down {
	background: var(--fail);
}

.metrics {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
}

.metrics div {
	display: flex;
	flex-direction: column-reverse;
	gap: 2px;
}

.metrics dt {
	color: var(--muted);
	font-size: 10px;
	letter-spacing: 0.045em;
	white-space: nowrap;
	text-transform: uppercase;
}

.metrics dd {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}

.loading,
.notice {
	margin: 0;
	padding: 28px 0;
	border-bottom: 1px solid var(--border);
	color: var(--muted);
}

footer {
	min-height: 66px;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 11px;
}

@keyframes pulse {
	50% {
		opacity: 0.35;
	}
}

@media (max-width: 1020px) {
	.service-row {
		grid-template-columns: minmax(170px, 0.8fr) minmax(280px, 2fr);
		gap: 24px;
	}

	.metrics {
		grid-column: 1 / -1;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		padding-left: 20px;
	}
}

@media (max-width: 640px) {
	.page {
		width: min(100% - 32px, 1180px);
	}

	.site-header {
		min-height: 70px;
	}

	.brand img {
		width: 39px;
		height: 24px;
	}

	.back-link {
		font-size: 0;
	}

	.back-link::before {
		content: "На сайт";
		font-size: 12px;
	}

	.back-link span {
		font-size: 12px;
	}

	main {
		padding-bottom: 56px;
	}

	.summary {
		padding: 48px 0 46px;
	}

	.summary-line {
		align-items: flex-start;
		gap: 14px;
	}

	.summary-marker {
		margin-top: 9px;
	}

	h1 {
		font-size: clamp(38px, 11vw, 50px);
	}

	.summary-meta {
		align-items: flex-start;
		flex-direction: column;
		gap: 3px;
	}

	.meta-divider {
		display: none;
	}

	#history-window {
		font-size: 11px;
	}

	.section-heading {
		align-items: flex-start;
		flex-direction: column;
		gap: 6px;
	}

	#history-window {
		text-align: left;
	}

	.history-controls {
		align-items: flex-start;
	}

	.service-row {
		grid-template-columns: 1fr;
		gap: 19px;
		padding: 22px 0;
	}

	.history {
		height: 28px;
	}

	.metrics {
		grid-column: auto;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 12px;
		padding-left: 20px;
	}

	footer {
		align-items: flex-start;
		flex-direction: column;
		justify-content: center;
		gap: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.summary-marker--loading {
		animation: none;
	}
}
