* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: Arial, sans-serif;
	background: #f4f4f4;
	color: #111;
}

body.carman-boot .app-header,
body.carman-boot .app-main {
	visibility: hidden;
}

button {
	cursor: pointer;
	border: 1px solid #bbb;
	background: #fff;
	border-radius: 6px;
	padding: 8px 12px;
}

button:hover:not(:disabled) {
	background: #f2f2f2;
}

button:disabled {
	cursor: default;
	opacity: 0.55;
}

.app-header {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) auto auto;
	align-items: start;
	gap: 16px;
	padding: 16px 20px;
	background: #20242a;
	color: #fff;
}

.app-title {
	font-size: 30px;
	font-weight: bold;
	color: #fff;
	text-decoration: none;
}

.app-title:hover,
.app-title:focus,
.app-title:visited {
	color: #fff;
	text-decoration: none;
}

.app-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.app-actions button.active {
	background: #dfe9ff;
	border-color: #96b8ff;
}

.language-panel {
	justify-self: end;
	width: 150px;
	min-width: 0;
}

.app-main {
	padding: 16px;
}

.page {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.page[hidden] {
	display: none;
}

.panel {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 16px;
	min-width: 0;
}

.panel h2 {
	margin: 0 0 12px;
	font-size: 18px;
}

.package-manager-panel {
	grid-column: 1 / -1;
}

.page-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

.page-subtitle {
	font-size: 13px;
	color: #555;
}

.document-viewer {
	margin-top: 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	min-height: 480px;
}

.document-frame {
	display: block;
	width: 100%;
	height: 70vh;
	min-height: 480px;
	border: 0;
}

.package-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
	gap: 12px;
}

.pack-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
	padding: 14px;
	border: 1px solid #eee;
	border-radius: 10px;
	background: #fff;
}

.pack-title {
	font-weight: bold;
	font-size: 16px;
}

.pack-meta,
.pack-description,
.pack-details {
	font-size: 12px;
	color: #555;
	white-space: pre-wrap;
}

.pack-details {
	padding: 8px;
	background: #f8f8f8;
	border-radius: 8px;
}

.pack-badges,
.pack-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.pack-badge {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 2px 8px;
	font-size: 12px;
	background: #edf2ff;
	color: #1f3b78;
}

.pack-badge.warning {
	background: #fff4d6;
	color: #765000;
}

.pack-badge.error {
	background: #ffe4e4;
	color: #8a1111;
}

.pack-badge.ok {
	background: #e7f8ea;
	color: #166325;
}

.nav-group {
	border: 1px solid #ddd;
	border-radius: 8px;
	margin: 8px 0;
	overflow: hidden;
}

.nav-group-header {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 10px;
	background: #f7f7f7;
	user-select: none;
	cursor: pointer;
}

.nav-group-title {
	font-weight: bold;
}

.nav-group-text,
.nav-group-desc {
	font-size: 12px;
	color: #555;
}

.nav-group-children {
	display: none;
	padding: 6px 10px 10px 20px;
}

.nav-group.open > .nav-group-children {
	display: block;
}

.nav-item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 8px;
	border-radius: 6px;
	cursor: pointer;
}

.nav-item:hover {
	background: #edf2ff;
}

.nav-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.language-combo {
	position: relative;
	width: 150px;
	min-width: 0;
}

.language-button {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 150px;
	max-width: 150px;
	min-width: 0;
	border: 1px solid #59616d;
	background: #fff;
	border-radius: 6px;
	padding: 6px 10px;
	text-align: left;
	overflow: hidden;
}

#languageButtonText {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.language-caret {
	flex: 0 0 auto;
	margin-left: auto;
	color: #333;
}

.language-menu {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	right: 0;
	width: 150px;
	max-width: 150px;
	max-height: 320px;
	overflow-x: hidden;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #bbb;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	padding: 4px;
}

.language-option {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
	border: 0;
	background: transparent;
	border-radius: 6px;
	padding: 7px 8px;
	text-align: left;
	overflow: hidden;
}

.language-option span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.language-option:hover,
.language-option.selected {
	background: #edf2ff;
}

.language-icon {
	width: 22px;
	height: 22px;
	border-radius: 0;
	object-fit: contain;
	flex: 0 0 auto;
}

@media (max-width: 900px) {
	.page {
		grid-template-columns: 1fr;
	}

	.menu-panel,
	.package-manager-panel {
		grid-column: 1;
	}

	.app-header {
		grid-template-columns: 1fr;
	}

	.app-actions {
		justify-self: stretch;
	}

	.language-panel {
		justify-self: end;
	}

	.page-title-row {
		flex-direction: column;
	}
}
