/* status.turnlist.ru — standalone stylesheet.
   The values below are copied from frontend/packages/ui/tokens.css so this page
   has no build step and no imports across the monorepo. If the brand colours
   change there, mirror them here (that is the whole maintenance cost). */
:root {
	--bg: #050508;
	--glass-bg: rgba(255, 255, 255, 0.06);
	--glass-border: rgba(255, 255, 255, 0.14);
	--glass-blur: 20px;
	--glass-highlight: rgba(255, 255, 255, 0.22);
	--glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
	--text: #dae2fd;
	--text-dim: #93a0c2;
	--primary: #00d4ff;
	--primary-glow: rgba(0, 212, 255, 0.18);
	--primary-border: rgba(0, 212, 255, 0.4);
	--font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
	--radius: 0.67rem;
	--radius-lg: 1rem;

	/* Status colours — the same three the app uses for W/L and degraded states. */
	--ok: #4ade80;
	--warn: #ffd700;
	--bad: #ff7a70;
	--none: rgba(255, 255, 255, 0.13);
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

/* The UA rule for [hidden] is display:none on the element selector, so any
   class here (.incidents is display:flex) silently beats it and an empty
   section shows its heading anyway. */
[hidden] {
	display: none !important;
}

body {
	margin: 0;
	min-height: 100dvh;
	background-color: var(--bg);
	/* Same blue-violet washes as the app: the frosted cards need something
	   coloured behind them or the blur reads as flat grey. */
	background-image:
		radial-gradient(150vmax 100vmax at 6% -16%, rgba(0, 120, 255, 0.13), transparent 60%),
		radial-gradient(135vmax 100vmax at 114% 18%, rgba(128, 68, 255, 0.12), transparent 58%),
		radial-gradient(125vmax 125vmax at 50% 122%, rgba(0, 212, 255, 0.08), transparent 60%);
	background-attachment: fixed;
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--primary);
	text-decoration: none;
}

.wrap {
	max-width: 780px;
	margin: 0 auto;
	padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 3rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* ------------------------------------------------------------------ header */
.top {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.5rem 0 0.25rem;
}

.logo {
	width: 44px;
	height: 44px;
	flex: none;
}

.top-text {
	flex: 1;
	min-width: 0;
}

h1 {
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0;
}

h2 {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0.5rem 0 0.25rem;
}

.sub {
	color: var(--text-dim);
	font-size: 14px;
	margin: 0;
}

.home {
	flex: none;
	font-size: 14px;
	font-weight: 600;
}

/* ------------------------------------------------------------------ banner */
.glass,
.banner,
.comp,
.inc {
	background: var(--glass-bg);
	backdrop-filter: blur(var(--glass-blur)) saturate(150%);
	-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius);
	box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.banner {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 1.15rem 1.25rem;
	border-radius: var(--radius-lg);
}

.banner b {
	font-size: 1.15rem;
	display: block;
}

/* The mark is the banner's colour cue — a glowing dot, sized like a full stop
   in a headline, so the banner reads as a sentence and not as a traffic light. */
.mark {
	width: 14px;
	height: 14px;
	flex: none;
	border-radius: 50%;
	background: var(--none);
}

.banner.operational {
	border-color: rgba(74, 222, 128, 0.45);
	box-shadow: 0 0 40px rgba(74, 222, 128, 0.12), inset 0 1px 0 var(--glass-highlight);
}

.banner.operational .mark {
	background: var(--ok);
	box-shadow: 0 0 14px rgba(74, 222, 128, 0.7);
}

.banner.degraded {
	border-color: rgba(255, 215, 0, 0.45);
	box-shadow: 0 0 40px rgba(255, 215, 0, 0.12), inset 0 1px 0 var(--glass-highlight);
}

.banner.degraded .mark {
	background: var(--warn);
	box-shadow: 0 0 14px rgba(255, 215, 0, 0.7);
}

.banner.outage {
	border-color: rgba(255, 122, 112, 0.5);
	box-shadow: 0 0 40px rgba(255, 122, 112, 0.14), inset 0 1px 0 var(--glass-highlight);
}

.banner.outage .mark {
	background: var(--bad);
	box-shadow: 0 0 14px rgba(255, 122, 112, 0.7);
}

/* ------------------------------------------------------------- components */
.components {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.comp {
	padding: 1rem 1.1rem;
}

.comp-head {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
}

.comp-name {
	font-weight: 700;
	flex: 1;
	min-width: 0;
}

.comp-note {
	font-size: 13px;
	color: var(--text-dim);
	margin: 0.1rem 0 0;
}

.pill {
	flex: none;
	font-size: 12px;
	font-weight: 700;
	padding: 0.2rem 0.55rem;
	border-radius: 9999px;
	white-space: nowrap;
}

.pill.operational {
	color: var(--ok);
	background: rgba(74, 222, 128, 0.14);
	border: 1px solid rgba(74, 222, 128, 0.45);
}

.pill.degraded {
	color: var(--warn);
	background: rgba(255, 215, 0, 0.12);
	border: 1px solid rgba(255, 215, 0, 0.42);
}

.pill.outage {
	color: var(--bad);
	background: rgba(255, 90, 80, 0.1);
	border: 1px solid rgba(255, 90, 80, 0.42);
}

.pill.unknown {
	color: var(--text-dim);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--glass-border);
}

/* The 90-day bar: thin vertical stripes, rounded, flexible width. On a phone
   each stripe is under 3px wide — that is fine, it is a texture, and the
   tooltip is how you read a single day. */
.bar {
	display: flex;
	gap: 2px;
	height: 34px;
	margin: 0.8rem 0 0.4rem;
}

.seg {
	flex: 1 1 0;
	min-width: 0;
	border-radius: 2px;
	background: var(--none);
	transition: transform 120ms ease, filter 120ms ease;
	cursor: default;
}

.seg.ok {
	background: var(--ok);
}

.seg.degraded {
	background: var(--warn);
}

.seg.outage {
	background: var(--bad);
}

.seg:hover,
.seg.active {
	transform: scaleY(1.12);
	filter: brightness(1.25);
}

.legend {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 12px;
	color: var(--text-dim);
}

.legend .grow {
	flex: 1;
	height: 1px;
	background: var(--glass-border);
}

.legend .up {
	font-family: var(--font-mono);
	color: var(--text);
	font-size: 12px;
}

/* --------------------------------------------------------------- incidents */
.incidents {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.inc {
	padding: 1rem 1.1rem;
	/* A coloured spine on the left: severity without another badge. */
	border-left: 3px solid var(--warn);
}

.inc.major {
	border-left-color: var(--bad);
}

.inc.resolved {
	border-left-color: rgba(74, 222, 128, 0.6);
}

.inc-head {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
}

.inc-title {
	font-weight: 700;
	flex: 1;
	min-width: 0;
}

.inc-when {
	font-size: 13px;
	color: var(--text-dim);
	margin: 0.15rem 0 0;
}

.upd {
	margin-top: 0.75rem;
	padding-left: 0.85rem;
	border-left: 1px solid var(--glass-border);
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
}

.upd-item b {
	font-size: 14px;
	color: var(--primary);
}

.upd-item time {
	font-size: 13px;
	color: var(--text-dim);
	margin-left: 0.4rem;
}

.upd-body {
	font-size: 15px;
}

.upd-body p {
	margin: 0.25rem 0 0;
}

/* ------------------------------------------------------------------ footer */
.foot {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

/* ----------------------------------------------------------------- tooltip */
.tip {
	position: fixed;
	z-index: 10;
	padding: 0.45rem 0.6rem;
	border-radius: var(--radius);
	background: rgba(10, 12, 20, 0.92);
	border: 1px solid var(--glass-border);
	box-shadow: var(--glass-shadow);
	font-size: 13px;
	line-height: 1.3;
	pointer-events: none;
	white-space: nowrap;
	transform: translate(-50%, -100%);
}

.tip .tip-date {
	color: var(--text-dim);
	display: block;
	font-size: 12px;
}

@media (max-width: 520px) {
	.top {
		flex-wrap: wrap;
	}

	.home {
		width: 100%;
	}

	.bar {
		height: 28px;
		gap: 1px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.seg {
		transition: none;
	}
}
