:root { --red: #cc0000; }

.terminal-page {
	padding: 0;
	line-height: 1.25;
	cursor: text;
	user-select: text;
	-webkit-user-select: text;
}

#terminal {
	padding: 16px 20px;
	min-height: 100%;
	overflow-x: auto;
	user-select: text;
	-webkit-user-select: text;
}

#motd-sysinfo,
#last-login { visibility: hidden; }

.terminal-clock-ready #motd-sysinfo,
.terminal-clock-ready #last-login { visibility: visible; }

.prompt-user { color: var(--green); font-weight: bold; }
.prompt-dir { color: var(--blue); font-weight: bold; }
.symlink { color: var(--cyan); font-weight: bold; }
.dir { color: var(--blue); font-weight: bold; }
.file { color: var(--fg); }
.error { color: var(--red); }

.file-clickable { cursor: pointer; }
.file-clickable:hover { text-decoration: underline; }

.output-line,
.cmd-line {
	margin: 0;
	white-space: pre-wrap;
	line-height: 1.25;
	word-break: normal;
	overflow-wrap: anywhere;
}

.ls-grid {
	display: grid;
	grid-template-columns: repeat(2, max-content);
	column-gap: 3ch;
	row-gap: 0;
	justify-content: start;
	width: max-content;
	min-width: 100%;
	margin: 0;
	line-height: 1.1;
}

.ls-grid > * { white-space: nowrap; }

.ls-l-grid {
	display: grid;
	grid-template-columns: auto auto auto auto 1fr;
	column-gap: 16px;
	row-gap: 0;
	margin: 0;
	white-space: nowrap;
	line-height: 1.25;
}

#input-container {
	display: flex;
	align-items: center;
	margin: 0;
	padding-bottom: 20px;
	line-height: 1.25;
}

#prompt-prefix,
#sudo-prompt {
	white-space: nowrap;
	margin-right: 1ch;
}

#cmd-input {
	background: transparent;
	border: none;
	padding: 0;
	color: var(--fg);
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	flex: 1;
	margin: 0;
	outline: none;
	caret-color: var(--fg);
}

#mobile-keybar { display: none; }

.key-btn {
	flex: 1;
	max-width: 54px;
	height: 44px;
	background: rgba(48, 10, 36, 0.72);
	color: var(--fg);
	border: 1px solid rgba(117, 80, 123, 0.55);
	border-radius: 4px;
	font-family: inherit;
	font-size: 14px;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	margin: 0;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.key-btn:focus-visible {
	outline: 2px solid var(--orange);
	outline-offset: -2px;
}

.key-btn:active { background: var(--border); }

.key-btn.armed {
	background: var(--orange);
	border-color: #ff7d4d;
	color: var(--fg);
}

.no-echo {
	color: transparent !important;
	caret-color: transparent !important;
}

/* Fastfetch */
.ff-container {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 0;
	line-height: 1.25;
}

.ff-logo {
	color: var(--orange);
	font-weight: bold;
	white-space: pre;
	line-height: 1.25;
}

.ff-info { white-space: pre; line-height: 1.25; }
.ff-title, .ff-key { color: var(--orange); font-weight: bold; }

.palette-block {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 2px;
	vertical-align: middle;
}

.bg-black { background-color: #2e3436; }
.bg-red { background-color: #cc0000; }
.bg-green { background-color: #4e9a06; }
.bg-yellow { background-color: #c4a000; }
.bg-blue { background-color: #3465a4; }
.bg-magenta { background-color: #75507b; }
.bg-cyan { background-color: #06989a; }
.bg-white { background-color: #d3d7cf; }
.bg-brblack { background-color: #555753; }
.bg-brred { background-color: #ef2929; }
.bg-brgreen { background-color: #8ae234; }
.bg-bryellow { background-color: #fce94f; }
.bg-brblue { background-color: #729fcf; }
.bg-brmagenta { background-color: #ad7fa8; }
.bg-brcyan { background-color: #34e2e2; }
.bg-brwhite { background-color: #eeeeec; }

/* Vim overlay */
#vim-layer {
	display: none;
	flex-direction: column;
	height: 100%;
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	background: var(--bg);
	z-index: 10;
	padding: 0;
	font-family: 'Ubuntu Mono', 'Consolas', monospace;
}

#vim-content {
	flex: 1;
	padding: 5px;
	white-space: pre-wrap;
	outline: none;
	overflow-y: hidden;
}

.vim-tilde { color: var(--blue); font-weight: bold; }

#vim-statusbar {
	height: 1.5em;
	display: flex;
	align-items: center;
	padding: 0 5px;
	background-color: var(--bg);
	color: var(--fg);
}

.cursor-block {
	display: inline-block;
	width: 8px;
	height: 1em;
	background-color: var(--fg);
	color: var(--bg);
	animation: none;
}

.cursor-blink { animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

@media (pointer: coarse), (max-width: 768px) {
	#terminal {
		padding-left: 12px;
		padding-right: 12px;
	}

	.motd-extra { display: none; }

	#mobile-keybar {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background: #200518;
		border-top: 1px solid #4a153b;
		padding: 6px 5px calc(6px + env(safe-area-inset-bottom, 0px)) 5px;
		gap: 3px;
		flex-wrap: nowrap;
		justify-content: space-around;
		align-items: center;
		z-index: 100;
		user-select: none;
		-webkit-user-select: none;
	}

	#mobile-keybar.visible { display: flex; }

	#mobile-keybar .key-btn {
		max-width: none;
		min-width: 0;
		font-size: 12px;
	}

	#mobile-keybar #key-ctrl { flex: 1.2; }
	#mobile-keybar .key-char { flex: 0.75; }

	#vim-layer {
		bottom: 0;
		height: auto;
	}
}