:root {
	--bg: #fafafa;
	--fg: #1a1a1a;
	--muted: #666;
	--border: #ddd;
	--accent: #2a6df4;
	--danger: #c0392b;
	--hover: #f0f0f0;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--fg);
	background: var(--bg);
	font-size: 14px;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
	border-bottom: 1px solid var(--border);
	background: #fff;
	flex-wrap: wrap;
}

.pathline { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand { font-weight: 600; }
.breadcrumb { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.actions { display: flex; gap: 0.5rem; align-items: center; }

button, .uploadBtn {
	font: inherit;
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--border);
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
}
button:hover, .uploadBtn:hover { background: var(--hover); }
button[data-action="delete"]:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.dropzone {
	margin: 1rem;
	padding: 1.5rem;
	border: 2px dashed var(--border);
	border-radius: 6px;
	text-align: center;
	color: var(--muted);
	background: #fff;
	transition: background 0.15s, border-color 0.15s;
}
.dropzone.dragover {
	background: #eef4ff;
	border-color: var(--accent);
	color: var(--accent);
}

main { padding: 0 1rem 2rem; }

table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 6px;
	overflow: hidden;
}
th, td {
	text-align: left;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--border);
}
th { background: #f5f5f5; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr.dir td:first-child a { color: var(--accent); text-decoration: none; font-weight: 500; }
tr.dir td:first-child a:hover { text-decoration: underline; }
tr:hover { background: var(--hover); }
td.actions-cell { display: flex; gap: 0.25rem; }
td.empty, td.err { color: var(--muted); text-align: center; }
.err { color: var(--danger); }

.login-page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
}
.login-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 2rem;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 8px;
	width: 280px;
}
.login-card h1 { margin: 0 0 0.5rem; text-align: center; }
.login-card input {
	font: inherit;
	padding: 0.5rem;
	border: 1px solid var(--border);
	border-radius: 4px;
}
.login-card button {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

/* Text editor modal */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.modal-overlay[hidden] { display: none; }
.modal-overlay.open { display: flex; }

.modal {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 8px;
	width: 90vw;
	max-width: 800px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.modal-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 0.9rem;
	border-bottom: 1px solid var(--border);
	background: #f5f5f5;
}
.modal-hint { font-size: 0.8rem; color: var(--muted); }

#editArea {
	flex: 1 1 auto;
	width: 100%;
	min-height: 60vh;
	border: none;
	border-radius: 0 0 8px 8px;
	padding: 0.75rem;
	font-family: ui-monospace, "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
	font-size: 13px;
	line-height: 1.4;
	resize: none;
	outline: none;
}
#editArea:disabled { color: var(--muted); }
