:root {
	--bg: #0b0c10;
	--fg: #e5e7eb;
	--muted: #9ca3af;
	--card: #111216
}

.app-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 16px;
	background: #0e1016;
	border-bottom: 1px solid #1f2937;
	width: 100vw;
}

.app-header .actions {
	display: flex;
	align-items: center;
	gap: 12px
}

.app-header .actions button {
	background: #111827;
	border: 1px solid #374151;
	border-radius: 8px;
	color: #e5e7eb;
	padding: 6px 10px;
	cursor: pointer
}

.app-header h1 {
	font-size: 18px;
	margin: 0
}

.card {
	background: var(--card);
	border: 1px solid #1f2937;
	border-radius: 12px;
	padding: 20px;
	max-width: 420px;
	width: 92vw
}

.err {
	margin-top: 10px;
	color: #f87171;
	font-size: 13px
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px
}

.hint {
	font-size: 12px;
	color: var(--muted);
	margin-top: 8px
}

.item {
	position: relative;
	width: 100%;
	height: 120px;
	background: var(--card);
	border: 1px solid #1f2937;
	border-radius: 12px;
	padding: 10px;
	cursor: pointer;
}

.item.folder {
	background-image: url('/assets/gfx/icon_folder.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 48px 48px;
}

.item .name {
	position: absolute;
	bottom: 0px;
	left: 0px;
	right: 0px;
	height: 1.2rem;
	line-height: 1rem;
	margin-top: 8px;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
}

.item .thumb {
	height: 120px;
	background: #0f172a;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	color: #9ca3af;
	overflow: hidden
}

.lightbox.open {
	display: flex
}

.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .85);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 50
}

.ok {
	margin-top: 10px;
	color: #34d399;
	font-size: 13px
}

.row {
	display: grid;
	gap: 10px
}

.search button {
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid #374151;
	background: #111827;
	color: #e5e7eb;
	cursor: pointer
}

.search input {
	flex: 1;
	padding: 8px;
	border-radius: 8px;
	border: 1px solid #374151;
	background: #0b0c10;
	color: #e5e7eb
}

.search {
	display: flex;
	gap: 8px;
	margin-bottom: 12px
}

.viewer {
	width: min(1200px, 96vw);
	height: min(80vh, 800px);
	background: #0b0c10;
	border: 1px solid #374151;
	border-radius: 12px;
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center
}

.viewer .close {
	position: absolute;
	top: 14px;
	right: 14px;
	background: #111827;
	border: 1px solid #374151;
	border-radius: 8px;
	color: #e5e7eb;
	padding: 6px 10px;
	cursor: pointer
}

.viewer .content {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-top: 52px
}

.viewer header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	border-bottom: 1px solid #1f2937
}

.wrap {
	display: grid;
	grid-template-columns: 280px 1fr;
	min-height: calc(100vh - 52px);
	min-width: 100vw;
}

* {
	box-sizing: border-box
}

#tree button {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: 0;
	color: var(--fg);
	padding: 6px 8px;
	border-radius: 8px;
	cursor: pointer
}

#tree button:hover {
	background: #1f2937
}

body {
	font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	background: var(--bg);
	color: #e5e7eb;
	margin: 0;
	display: grid;
	place-items: center;
	min-height: 100vh
}

button {
	margin-top: 12px;
	width: 100%;
	padding: 10px;
	border-radius: 10px;
	border: 1px solid #374151;
	background: #111827;
	color: #e5e7eb;
	cursor: pointer
}

h1 {
	margin: 0 0 12px 0;
	font-size: 18px
}

input {
	width: 100%;
	padding: 10px;
	border-radius: 10px;
	border: 1px solid #374151;
	background: #0b0c10;
	color: #e5e7eb
}

label {
	display: block;
	font-size: 13px;
	color: var(--muted);
	margin-bottom: 6px
}

main {
	padding: 16px;
	overflow: auto;
	position: relative;
}

nav {
	border-right: 1px solid #1f2937;
	background: var(--card);
	padding: 12px;
	overflow: auto
}

.breadcrumbs {
	margin-bottom: 12px;
	font-size: 14px;
	color: var(--muted);
	display: flex;
	gap: 6px;
	line-height: 1rem;
	height: 1.2rem;
}