@font-face {
	font-family: 'Onest';
	src: url('../fonts/Onest-cyrillic.woff2') format('woff2');
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
	font-family: 'Onest';
	src: url('../fonts/Onest-latin.woff2') format('woff2');
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'JetBrains Mono';
	src: url('../fonts/JetBrainsMono-cyrillic.woff2') format('woff2');
	font-weight: 400 500;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
	font-family: 'JetBrains Mono';
	src: url('../fonts/JetBrainsMono-latin.woff2') format('woff2');
	font-weight: 400 500;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
	scrollbar-width: thin;
	scrollbar-color: var(--border-strong) transparent;
}

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

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--font-sans);
	font-size: 14px;
	line-height: 1.45;
	background-color: var(--bg-canvas);
	color: var(--text-1);
	-webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

a {
	color: var(--accent-ink);
}

a:hover {
	color: var(--accent-hover);
}

code,
kbd,
pre {
	font-family: var(--font-mono);
	font-size: 0.92em;
}

.hidden {
	display: none !important;
}

.cursor-pointer {
	cursor: pointer;
}

template {
	display: none;
}

.drag-ghost {
	position: fixed;
	top: -9999px;
	left: -9999px;
	pointer-events: none;
}

.icon {
	display: inline-block;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
}

.i-dashboard { --icon: url('../sprite/dashboard.svg'); }
.i-connections { --icon: url('../sprite/connections.svg'); }
.i-hr { --icon: url('../sprite/hr.svg'); }
.i-info { --icon: url('../sprite/info.svg'); }
.i-settings { --icon: url('../sprite/settings.svg'); }
.i-logout { --icon: url('../sprite/logout.svg'); }
.i-theme { --icon: url('../sprite/theme_light_dark.svg'); }
.i-github { --icon: url('../sprite/github.svg'); }
.i-donate { --icon: url('../sprite/donate.svg'); }
.i-delete { --icon: url('../sprite/delete.svg'); }
.i-pencil { --icon: url('../sprite/pencil.svg'); }
.i-compare { --icon: url('../sprite/compare.svg'); }
.i-swap { --icon: url('../sprite/swap.svg'); }
.i-copy { --icon: url('../sprite/copy.svg'); }
.i-broom { --icon: url('../sprite/broom.svg'); }
.i-ping { --icon: url('../sprite/ping.svg'); }
.i-check { --icon: url('../sprite/check-mark-small.svg'); }
.i-close { --icon: url('../sprite/close.svg'); }
.i-folder { --icon: url('../sprite/folder.svg'); }
.i-folder-plus { --icon: url('../sprite/folder-plus.svg'); }
.i-file { --icon: url('../sprite/file.svg'); }
.i-download { --icon: url('../sprite/download.svg'); }
.i-refresh { --icon: url('../sprite/refresh.svg'); }
.i-arrows-exchange { --icon: url('../sprite/arrows-exchange.svg'); }
.i-mask-happy { --icon: url('../sprite/mask-happy.svg'); }
.i-mask-sad { --icon: url('../sprite/mask-sad.svg'); }

.container {
	flex: 1;
	width: 100%;
	min-width: 320px;
	display: flex;
	flex-direction: column;
	overflow-x: clip;
}

.container:has(#dashboard-content:not(.hidden)) {
	flex: none;
	height: 100dvh;
	min-height: 640px;
}

.content {
	display: flex;
	flex: 1;
	min-height: 0;
}

.main-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	padding: 34px 38px;
}

header {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 16px 28px;
	border-bottom: 1px solid var(--border);
	background-color: var(--bg-canvas);
}

header h1 {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--text-1);
}

header h1 .header-link {
	color: inherit;
	text-decoration: none;
	transition: opacity var(--ease);
}

header h1 .header-link:hover {
	opacity: 0.85;
}

header .neo-text {
	color: var(--accent);
}

header .subtitle {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--text-3);
}

.header-spacer {
	flex: 1;
}

.header-metrics {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-right: 14px;
}

.metric-row {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--text-3);
	font-variant-numeric: tabular-nums;
}

.metric-label {
	min-width: 26px;
	text-align: right;
	font-weight: 600;
	color: var(--text-2);
}

.metric-sparkline {
	display: block;
	width: 100px;
	height: 16px;
}

.metric-value {
	min-width: 150px;
	font-family: var(--font-mono);
}

.icon-btn {
	position: relative;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 999px;
	background-color: var(--bg-1);
	color: var(--text-2);
	cursor: pointer;
	transition: color var(--ease), border-color var(--ease);
}

.icon-btn:hover {
	color: var(--text-1);
	border-color: var(--border-strong);
}

.icon-btn .icon,
.icon-btn svg {
	width: 18px;
	height: 18px;
}

.notification-bell-wrap {
	position: relative;
}

.notification-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background-color: var(--bg-3);
	color: var(--text-2);
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	pointer-events: none;
}

.notification-badge.warn {
	background-color: var(--danger);
	color: #fff;
}

.notification-popup {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 340px;
	max-height: 420px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: var(--bg-1);
	border: 1px solid var(--border);
	border-radius: var(--r-m);
	box-shadow: var(--popover-shadow);
	z-index: var(--z-toast);
}

.notification-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
}

.notification-popup-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-1);
}

.notification-clear-all {
	padding: 4px 8px;
	border: none;
	border-radius: var(--r-xs);
	background: none;
	color: var(--text-3);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.notification-clear-all:hover {
	color: var(--danger-ink);
	background-color: var(--danger-soft);
}

.notification-popup-empty {
	padding: 24px;
	text-align: center;
	color: var(--text-3);
}

.notification-popup-list {
	flex: 1;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-y: auto;
}

.notification-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 14px;
}

.notification-item + .notification-item {
	border-top: 1px solid var(--border);
}

.notification-item .status-dot {
	margin-top: 6px;
}

.notification-item-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.notification-item-message {
	color: var(--text-1);
	word-break: break-word;
}

.notification-item-time {
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--text-4);
}

.notification-item-close {
	flex-shrink: 0;
	padding: 0 2px;
	border: none;
	background: none;
	color: var(--text-4);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.notification-item-close:hover {
	color: var(--danger-ink);
}

.sidebar {
	width: var(--sidebar-width);
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 20px 0;
	border-right: 1px solid var(--border);
	background-color: var(--bg-canvas);
}

.nav-item {
	text-decoration: none;
	width: 64px;
	height: 60px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 0;
	border: none;
	border-radius: var(--r-s);
	background: none;
	color: var(--text-3);
	cursor: pointer;
	transition: color var(--ease), background-color var(--ease);
}

.nav-item:hover {
	color: var(--text-1);
	background-color: var(--bg-3);
}

.nav-item.active {
	color: var(--accent-ink);
	background-color: var(--accent-soft);
}

.nav-item .icon {
	width: 21px;
	height: 21px;
}

.nav-label {
	font-size: 10.5px;
	font-weight: 600;
}

footer {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 16px 32px;
	border-top: 1px solid var(--border);
	color: var(--text-3);
}

.footer-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.footer-info-row {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.footer-info-label {
	min-width: 68px;
	flex-shrink: 0;
	color: var(--text-4);
}

.footer-info-value {
	font-weight: 500;
	color: var(--text-2);
}

footer .button-container {
	display: flex;
	justify-content: center;
	gap: 10px;
}

.pill-btn {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 18px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background-color: var(--bg-1);
	color: var(--text-2);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: color var(--ease), border-color var(--ease);
}

.pill-btn:hover {
	color: var(--text-1);
	border-color: var(--border-strong);
}

.pill-btn .icon {
	width: 18px;
	height: 18px;
}

.pill-btn.btn-versions {
	flex-direction: column;
	gap: 1px;
	padding: 4px 18px;
	font-size: 11px;
	line-height: 1.3;
}

.dns-warning-more {
	margin: 14px 0;
}

.dns-warning-footer {
	font-size: 12.5px;
	color: var(--text-3);
}

body.connection-blocked .container {
	opacity: 0.6;
	filter: blur(2px);
	transition: opacity 0.3s ease, filter 0.3s ease;
}

@media (max-width: 640px) {
	header {
		flex-wrap: wrap;
		gap: 12px;
		padding: 12px 16px;
	}

	header h1 {
		font-size: 20px;
	}

	.header-metrics {
		display: none;
	}

	.content {
		flex-direction: column;
	}

	.sidebar {
		position: sticky;
		top: 0;
		z-index: var(--z-sidebar);
		width: 100%;
		flex-direction: row;
		gap: 2px;
		padding: 6px 8px;
		border-right: none;
		border-bottom: 1px solid var(--border);
	}

	.nav-item {
		flex: 1;
		width: auto;
		height: 54px;
	}

	.main-content {
		padding: 16px;
	}

	footer {
		display: none;
	}

	.notification-popup {
		width: min(340px, calc(100vw - 32px));
	}
}
