:root {
	--line: #35414d;
	color-scheme: dark;
	font:
		100% / 1.5 system-ui,
		sans-serif;
}
body:has(#manager:not([hidden])) {
	margin: 0;
}

form {
	display: grid;
	gap: 0.75rem;
	justify-items: start;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 0.5rem;
}
form h2 {
	margin: 0;
}
label {
	display: grid;
	gap: 0.25rem;
}
input,
button,
select {
	font: inherit;
	padding: 0.3rem 0.5rem;
	max-width: 100%;
}
:focus:not(:focus-visible) {
	outline: none;
}
:focus-visible {
	outline: 2px solid Highlight;
	outline-offset: 2px;
}
button {
	cursor: pointer;
	user-select: none;
}
progress {
	width: 100%;
}
ul {
	list-style: none;
	padding: 0;
}

small:not([hidden]) {
	display: block;
}
main:has(#manager[hidden]) {
	box-sizing: border-box;
	padding: 0 clamp(0.5rem, 2vw, 2rem);
	display: grid;
	align-content: center;
	justify-items: center;
	min-height: calc(100dvh - 1rem);
	margin: 0 auto;
}
#status {
	position: fixed;
	inset: auto 1rem 1rem auto;
	z-index: 2;
	max-width: min(28rem, calc(100vw - 2rem));
	margin: 0;
	overflow-wrap: anywhere;
	pointer-events: none;
}
#status:not(:empty) {
	box-sizing: border-box;
	padding: 0.65rem 0.9rem;
	color: CanvasText;
	background: Canvas;
	border: 1px solid var(--line);
	border-radius: 0.65rem;
	box-shadow: 0 0.5rem 1.5rem #0003;
}
#login {
	box-sizing: border-box;
	width: min(100%, 24rem);
	justify-items: stretch;
	padding: 0;
	border: 0;
}
#login svg {
	width: 1.2rem;
	height: 1.2rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.login-field {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0 0.9rem;
	min-height: 3rem;
	color: #b9bfc5;
	background: #181818;
	border: 1px solid var(--line);
	border-radius: 0.8rem;
}

.login-field input {
	flex: 1;
	min-width: 0;
	padding: 0.65rem 0;
	color: CanvasText;
	background: transparent;
	border: 0;
}
.login-field:focus-within {
	border-color: currentColor;
}

.login-field input::placeholder {
	color: inherit;
	opacity: 0.7;
}
.transfer-conflict button {
	text-align: start;
}
.file-headings button {
	width: 100%;
	height: 2rem;
	padding: 0 0.45rem;
	color: inherit;
	background: transparent;
	border: 0;
	text-align: start;
	font: inherit;
	white-space: nowrap;
}
.file-headings button:hover {
	background: color-mix(in srgb, CanvasText 6%, var(--surface));
}
#manager button,
.public-explorer #breadcrumbs :is(a, [aria-current]) {
	color: CanvasText;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--corner);
	padding: 0.35rem 0.7rem;
}
#breadcrumbs button,
.public-explorer #breadcrumbs :is(a, [aria-current]) {
	overflow-wrap: anywhere;
}
.public-explorer #breadcrumbs a {
	text-decoration: none;
}
.public-explorer #breadcrumbs a:hover {
	background: color-mix(in srgb, CanvasText 6%, var(--surface));
}
#login button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	min-height: 3rem;
	font-weight: 600;
	color: #171717;
	background: #f1f1f1;
	border: 0;
	border-radius: 0.8rem;
}
#login button:disabled {
	cursor: wait;
	opacity: 0.65;
}
#login button:hover:not(:disabled) {
	background: #ddd;
}
#manager {
	--surface: #181818;
	--corner: 0.25rem;
	--muted: #aeb5bc;
}
.upload-progress:has(:not([hidden])) {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 0.5rem 0.65rem;
	border-bottom: 1px solid var(--line);
}
#cancel-upload {
	flex-shrink: 0;
}
.privacy-switch {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--muted);
	cursor: pointer;
	user-select: none;
}
.privacy-switch input {
	appearance: none;
	display: grid;
	align-items: center;
	box-sizing: border-box;
	width: 2.05rem;
	height: 1.2rem;
	margin: 0;
	padding: 0 0.15rem;
	border: 1px solid var(--line);
	border-radius: 1rem;
	background: #272727;
	cursor: inherit;
}
.privacy-switch input::before {
	content: "";
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	background: var(--muted);
}
.login-field input:focus-visible {
	outline: none;
}
.privacy-switch input:checked {
	justify-items: end;
	background: #ededed;
}
.privacy-switch input:checked::before {
	background: #222;
}
.privacy-switch input:disabled {
	opacity: 0.65;
	cursor: wait;
}

#explorer {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	background: var(--surface);
}
#explorer header,
#breadcrumbs,
#folder-share:not([hidden]) {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}
#explorer header {
	padding: 0.65rem;
	border-bottom: 1px solid var(--line);
}
#breadcrumbs {
	flex: 1 1 12rem;
	min-width: 0;
	color: var(--muted);
}
#manager #breadcrumbs button[aria-current],
.public-explorer #breadcrumbs [aria-current] {
	font-weight: 650;
	border-color: transparent;
}
#file-pane {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	flex: 1 0 auto;
	min-height: 18rem;
	overflow-x: auto;
	scrollbar-width: none;
	user-select: none;
	touch-action: manipulation;
}
#file-pane::-webkit-scrollbar {
	display: none;
}
#file-pane.upload-target {
	box-shadow: inset 0 0 0 2px Highlight;
	background: color-mix(in srgb, Highlight 8%, var(--surface));
}
#file-pane table {
	width: 100%;
	min-width: 42rem;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 0.875rem;
}
.file-headings th,
.file-row td {
	height: 1.8rem;
	padding: 0 0.45rem;
	text-align: start;
}
.file-headings th {
	position: relative;
	padding: 0 0.65rem 0 0.45rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--muted);
	font-weight: 600;
	border-bottom: 0;
}
#file-grid col:nth-child(1) {
	width: auto;
}
#file-grid col:nth-child(2) {
	width: 18ch;
}
#file-grid col:nth-child(3) {
	width: 15ch;
}
#file-grid col:last-child {
	width: 9ch;
}
#file-grid col:nth-child(4):not(:last-child) {
	width: 11ch;
}
.file-headings th:not(:last-child) {
	border-right: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.file-row td {
	border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}
.file-row td:not(:last-child) {
	border-right: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}

.file-row:focus-visible {
	outline-offset: -2px;
}
#file-pane:focus-visible {
	outline: none;
}
.file-row > :nth-child(3),
.file-headings > :nth-child(3),
.file-row > :last-child,
.file-headings > :last-child {
	text-align: end;
}

.file-value {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.inline-name-editor {
	box-sizing: border-box;
	width: calc(100% - 1.45rem);
	margin: 0;
	padding: 0 0.2rem;
	font: inherit;
	color: CanvasText;
	background: var(--surface);
	border: 1px solid Highlight;
	border-radius: 0.15rem;
	user-select: text;
}
.inline-name-editor:focus-visible {
	outline: none;
}
#marquee {
	position: fixed;
	z-index: 1;
	box-sizing: border-box;
	border: 1px solid Highlight;
	background: color-mix(in srgb, Highlight 16%, transparent);
	pointer-events: none;
}
.file-row:hover {
	background: color-mix(in srgb, CanvasText 5%, var(--surface));
}
.file-row.selected {
	background: color-mix(in srgb, Highlight 18%, var(--surface));
}
.file-row.cut {
	opacity: 0.55;
}
#explorer .drop-target {
	outline: 2px solid Highlight;
	outline-offset: -2px;
}
#manager #file-pane button {
	background: transparent;
	border: 0;
	width: 100%;
	padding: 0;
	border-radius: 0.25rem;
}
.entry-name {
	width: fit-content;
	max-width: 100%;
}
.entry-name:has(.inline-name-editor) {
	width: 100%;
}
.file-icon {
	width: 1rem;
	height: 1rem;
	margin-inline-end: 0.45rem;
	vertical-align: -0.15em;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.file-icon[data-type="folder"] {
	color: #e5b265;
	fill: currentColor;
	stroke: none;
}
.file-icon[data-type="code"] {
	color: #60a5fa;
}
.file-icon[data-type="markdown"] {
	color: #818cf8;
}
.file-icon[data-type="image"] {
	color: #a78bfa;
}
.file-icon[data-type="archive"] {
	color: #e5b265;
}
.file-icon[data-type="pdf"] {
	color: #f87171;
}
.file-icon[data-type="audio"] {
	color: #f472b6;
}
.file-icon[data-type="video"] {
	color: #fb923c;
}
.file-icon[data-type="data"] {
	color: #4ade80;
}
.file-icon[data-type="config"] {
	color: #facc15;
}
.file-icon[data-type="font"] {
	color: #c084fc;
}
.file-icon[data-type="file"] {
	color: var(--muted);
}
.empty-files {
	padding: 0.65rem;
	text-align: center;
}
.explorer-footer {
	padding: 0.15rem 0.65rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	border-top: 1px solid var(--line);
}
.public-explorer .file-headings th {
	height: 2rem;
	padding: 0 0.45rem;
	text-align: start;
}
.public-explorer .entry-name {
	color: inherit;
	text-decoration: none;
	cursor: default;
}
#public-copy-link label {
	display: grid;
	gap: 0.35rem;
	margin-block-end: 0.6rem;
}
#public-copy-link input {
	width: min(26rem, 70vw);
}
.public-explorer .explorer-footer {
	min-block-size: 1.35rem;
}
#manager #logout {
	padding: 0.1rem 0.45rem;
	font-size: 0.75rem;
	line-height: 1.35;
}
#selection-status {
	font-size: 0.875rem;
}
.file-row > :not(:first-child, :last-child),
.empty-files,
#selection-status,
#inherited-folder-share {
	color: var(--muted);
}
#context-actions,
#upload-options {
	position: fixed;
	inset: auto;
	margin: 0;
	max-height: calc(100dvh - 8px);
	overflow: auto;
	padding: 0.3rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--corner);
	box-shadow: 0 0.5rem 1.5rem #0003;
}
.transfer-conflict {
	position: fixed;
	inset: 3rem auto auto 2rem;
	z-index: 10;
	box-sizing: border-box;
	margin: 0;
	width: max-content;
	max-width: min(25rem, calc(100vw - 3rem));
	max-height: calc(100dvh - 4rem);
	overflow: auto;
	padding: 0.75rem;
	color: CanvasText;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--corner);
	box-shadow: 0 0.5rem 1.5rem #0003;
}
.transfer-conflict p {
	margin: -0.75rem -0.75rem 0;
	padding: 0.75rem;
	overflow-wrap: anywhere;
	cursor: move;
	touch-action: none;
	user-select: none;
}
.transfer-conflict ul {
	max-height: 30dvh;
	overflow: auto;
	overflow-wrap: anywhere;
	margin: 0 0 0.75rem;
	padding-inline-start: 1.5rem;
}
.transfer-conflict div {
	display: grid;
	gap: 0.25rem;
}

.text-editor {
	box-sizing: border-box;
	width: min(75rem, calc(100vw - 2rem));
	height: min(52rem, calc(100dvh - 2rem));
	padding: 0;
	color: CanvasText;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--corner);
	box-shadow: 0 0.5rem 1.5rem #0003;
}
.text-editor[open] {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
}
.text-editor::backdrop {
	background: #0006;
}
.text-editor-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--line);
}
.text-editor-header strong,
.text-editor-header span {
	overflow-wrap: anywhere;
}
.text-editor-header span {
	flex: 1;
}
.text-editor-content {
	min-width: 0;
}

#upload-options {
	position-area: bottom span-left;
	margin-block-start: 0.25rem;
}
#manager #context-actions button,
#manager #upload-options button {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	border: 0;
	text-align: start;
}
#manager #file-pane button:hover,
#manager #context-actions button:hover:not(:disabled),
#manager #upload-options button:hover:not(:disabled) {
	background: color-mix(in srgb, CanvasText 9%, var(--surface));
}
#manager #file-pane .file-headings button:not(.column-resizer) {
	padding-inline: 0.7rem;
}
.column-resizer {
	position: absolute;
	z-index: 1;
	top: 0;
	right: -5px;
	width: 10px;
	height: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: col-resize;
	touch-action: none;
}
#manager #file-pane .file-headings .column-resizer {
	width: 10px;
	height: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}
#manager #file-pane .file-headings .column-resizer:hover,
#manager #file-pane .file-headings .column-resizer:focus-visible {
	background: transparent;
}
#manager #file-pane .file-headings .column-resizer:focus-visible {
	outline: none;
}
.action-icon {
	width: 1.15rem;
	height: 1.15rem;
	flex: none;
	fill: currentColor;
	vertical-align: middle;
}

@media (max-width: 32rem) {
	#file-pane table {
		min-width: 24rem;
	}
	#file-grid col:nth-child(2) {
		width: 16ch;
	}
	#file-grid col:nth-child(3) {
		width: 12ch;
	}
	#file-grid col:last-child {
		width: 8ch;
	}
	#file-grid col:nth-child(4):not(:last-child) {
		width: 10ch;
	}
}
form[hidden] {
	display: none;
}
