/* Setup design properties */
html {
	--background-color: #121212;
	--surface-color: #ffffff0c;
	--surface-color-doubled: #ffffff18;
	--surface-color-opaque: #3c3c3c;

	--primary-color: #bb86fc;
	--primary-variant: #3700b3;
	--secondary-color: #03dac6;
	--error-color: #cf6679;
	--success-color: #66cf79;

	--on-background: #ffffff;
	--on-surface: #ffffff;
	--on-primary: #000000;
	--on-secondary: #000000;
	--on-error: #000000;
	--on-success: #000000;
}

* {
	box-sizing: border-box;
}

h2 {
	position: sticky;
	top: 0;
	background-color: var(--background-color);
	z-index: 1;
}

h4 {
    margin: .5em 1em;
}

a {
	cursor: pointer;
	text-decoration: underline;
	color: var(--primary-color);
}

a:hover,
a:active {
	color: var(--secondary-color);
}

svg {
	width: 16px;
	height: 16px;
}

code {
	font-family: monospace;
	font-size: 90%;
	background-color: var(--background-color);
	color: var(--on-background);
	padding: 2px 5px;
	border-radius: 5px;
	border: 1px dotted var(--surface-color-doubled);
}

.hidden {
	display: none;
}

/* App layout */
body {
	margin: 0;
	background-color: var(--background-color);
	color: var(--on-background);
}

header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 5px 10px;
	background-color: var(--surface-color);
}

header a {
	text-decoration: none;
}

header h1 {
	display: inline-block;
	margin: 0;
}

header svg {
	width: 17px;
	height: 17px;
	fill: var(--on-surface);
	fill-opacity: 0.5;
}

nav.tags {
	background-color: var(--surface-color-doubled);
	display: flex;
}

nav.tags div {
	display: inline-block;
	padding: 0;
	margin: 0;
}

nav.tags .top-tags {
	max-height: 28px;
	overflow: hidden;
	flex: auto;
	max-width: fit-content;
}

nav.tags .all-tags {
	width: 85px;
	min-width: 85px;
	text-align: center;
}

nav.tags ul,
nav.tags li {
	display: inline-block;
	list-style-type: none;
	padding: 0;
	margin: 0;
}

nav.tags a {
	display: inline-block;
	padding: 5px 10px;
	margin: 0 5px;
	text-decoration: none;
	color: var(--on-surface);
	border-radius: 8px;
	white-space: nowrap;
}

nav.tags a:hover,
nav.tags a:active,
nav.tags a.selected {
	background-color: var(--surface-color);
	color: var(--secondary-color);
}

h2 {
	max-width: 1220px;
	margin: 1em auto 0.5em;
	padding-left: 1.5em;
}

[title] {
	cursor: help;
}

/* Search box */
.search {
	border: 1px solid var(--primary-color);
	border-radius: 8px;
	padding-left: 5px;
	background: var(--surface-color);
}

.search::after {
	content: "";
	clear: both;
	display: table;
}

.search input[type="text"] {
	float: left;
	color: var(--on-background);
	background: transparent;
	border: none;
	outline: none;
	height: 30px;
	width: 75px;
	margin: 0;
	padding: 0;
	transition-property: width;
	transition-duration: 0.2s;
	transition-delay: 0.3s;
	transition-timing-function: ease-in-out;
}

.search input[type="text"]:focus,
.search input[type="text"]:not(:placeholder-shown) {
	width: 200px;
	transition-delay: 0s;
}

.search button {
	float: left;
	background: transparent;
	border: none;
	border-left: 1px solid var(--primary-color);
	border-radius: 0 8px 8px 0;
	margin: 0;
	padding: 6px 10px;
	height: 30px;
}

.search button:hover,
.search button:active {
	background-color: var(--surface-color-doubled);
}

/* Dropdown menu styles */
.dropdown {
	display: inline-block;
	position: relative;
}

.dropdown-btn {
	font-size: 200%;
	font-weight: bold;
	margin-left: 0.2em;
	margin-right: 0.5em;
	text-decoration: none;
	cursor: pointer;
	display: inline-block;
	height: 37px;
	width: 21px;
	text-align: center;
}

.dropdown-btn svg {
	fill: var(--primary-color);
	fill-opacity: 1.0;
}

.dropdown-btn:hover svg,
.dropdown-btn:active svg,
.dropdown.show .dropdown-btn svg {
	fill: var(--secondary-color);
}

.dropdown-content {
	display: none;
	position: absolute;
	background-color: var(--background-color);
	box-shadow: 0px 0px 3px 0px var(--secondary-color);
	z-index: 2;
	border-radius: 3px;
}

.dropdown-content .header {
	font-weight: bold;
	text-align: center;
}

.dropdown-content ul,
.dropdown-content li {
	list-style-type: none;
	padding: 0;
	margin: 0;
}

.dropdown-content a,
.dropdown-content span {
	color: var(--on-surface);
	padding: 8px 15px 8px 10px;
	margin: 0px;
	border: none;
	display: block;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dropdown-content .separator {
	display: block;
	height: 1px;
	background-color: var(--secondary-color);
	opacity: 0.35;
	margin: 0px 3px;
}

.dropdown-content svg {
	width: 16px;
	height: 16px;
	margin-right: .3em;
}

.dropdown-content a:hover,
.dropdown-content a:active {
	background-color: var(--surface-color);
	color: var(--secondary-color);
}

.dropdown-content a:hover svg {
	fill: var(--secondary-color);
	fill-opacity: 1.0;
}

.dropdown.show .dropdown-content {
	display: block;
}

.error-banner {
	background-color: darkred;
	color: white;
	border-color: red;
	border-width: 10px 0;
	border-style: solid;
	text-align: center;
	padding: 10px;
	font-weight: bold;
}

.messages-container {
	display: block;
	position: fixed;
	top: 5px;
	right: 50%;
	transform: translateX(50%);
	z-index: 1000;
	max-width: 250px;
}

.messages-container:empty {
	display: none;
}

.messages-container .message {
	margin: 3px 0;
	padding: 8px 25px 8px 15px;
	border-radius: 8px;
	background-color: var(--primary-color);
	box-shadow: 0px 0px 8px var(--background-color);
	color: var(--on-primary);
	cursor: pointer;
	position: relative;
}

.messages-container .message::after {
	content: "×";
	position: absolute;
	top: 2px;
	right: 5px;
}

.messages-container .message.error {
	background-color: var(--error-color);
	color: var(--on-error);
}

.messages-container .message.success {
	background-color: var(--success-color);
	color: var(--on-success);
}

.tag-cloud {
	text-align: center;
	max-width: 800px;
	margin: 15px auto;
}

.tag-cloud:empty::before {
	content: "No tags yet";
	font-style: italic;
}

.tag-cloud a {
	display: inline-block;
	margin: 0px 5px;
	text-decoration: none;
	color: var(--primary-color);
}

.tag-cloud a:hover,
.tag-cloud a:active {
	color: var(--secondary-color);
}

.tag-edit {
	background-color: var(--surface-color);
	margin: 15px auto;
	padding: 5px 15px;
	text-align: right;
	border-radius: 10px;
	max-width: 256px;
}

.tag-edit form {
	display: none;
}

.tag-edit .suggested {
	text-align: left;
	font-size: 80%;
	width: 160px;
	margin: 5px 0 5px auto;
	color: var(--on-background);
	cursor: pointer;
}

.tag-edit .suggested:empty {
	display: none;
}

.tag-edit .suggested::before {
	content: "Use suggested: ";
}

.content-wrapper {
	text-align: center;
	max-width: 1220px;
	margin: 0px auto;
}

.content-wrapper:empty::before {
	content: "Nothing here yet";
	font-style: italic;
	padding-top: 10px;
	display: inline-block;
}

/* Slide Switch */
input[type="checkbox"][role="switch"],
div.form-text[role="switch"] {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	position: relative;
	font-size: inherit;
	width: 1.5em;
	height: 1em;
	box-sizing: content-box;
	border: 1px solid var(--background-color);
	border-radius: 1em;
	vertical-align: text-bottom;
	color: inherit;
	transition-duration: 0.15s;
	background-color: var(--error-color);
}

input[type="checkbox"][role="switch"]:checked,
div.form-text[role="switch"][data-checked="checked"] {
	background-color: var(--success-color);
}

input[type="checkbox"][role="switch"]::before,
div.form-text[role="switch"]::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0.1em;
	transform: translate(0, -50%);
	box-sizing: border-box;
	width: 0.7em;
	height: 0.7em;
	margin: 0 0.15em;
	border-radius: 50%;
	background: var(--on-error);
	transition-duration: 0.15s;
}

input[type="checkbox"][role="switch"]:checked::before,
div.form-text[role="switch"][data-checked="checked"]::before {
	left: 1em;
	background: var(--on-success);
}

input[type="checkbox"] {
	cursor: pointer;
}

/* Checkmark toggle */
input[type="checkbox"][role="checkmark"],
div.form-text[role="checkmark"] {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	display: block;
	position: relative;
	overflow: hidden;
	font-size: inherit;
	width: 1em;
	height: 1em;
	box-sizing: content-box;
	border: 1px solid var(--background-color);
	border-radius: 5px;
	margin: 0 auto;
	color: inherit;
	transition-duration: 0.15s;
	background-color: var(--error-color);
}

input[type="checkbox"][role="checkmark"]:checked,
div.form-text[role="checkmark"][data-checked="checked"] {
	background-color: var(--success-color);
}

input[type="checkbox"][role="checkmark"]::before,
input[type="checkbox"][role="checkmark"]::after,
div.form-text[role="checkmark"]::before,
div.form-text[role="checkmark"]::after {
	content: "";
	position: absolute;
	top: -0.15em;
	left: 0.25em;
	box-sizing: content-box;
	width: 0.8em;
	height: 0.8em;
	background: transparent;
	border-left: 3px solid var(--on-error);
	transform: rotate(-45deg);
	transition-duration: 0.15s;
}

input[type="checkbox"][role="checkmark"]::after,
div.form-text[role="checkmark"]::after {
	transform: rotate(45deg);
	top: 0.4em;
}

input[type="checkbox"][role="checkmark"]:checked::before,
div.form-text[role="checkmark"][data-checked="checked"]::before {
	height: 0.3em;
	width: 0.6em;
	top: 0.15em;
	left: 0.1em;
	border-left: 3px solid var(--on-success);
	border-bottom: 3px solid var(--on-success);
}

input[type="checkbox"][role="checkmark"]:checked::after,
div.form-text[role="checkmark"][data-checked="checked"]::after {
	border: none;
}

/* Form field styles */
.form-container {
	background-color: var(--surface-color);
	margin: 15px auto;
	padding: 5px 15px;
	text-align: left;
	border-radius: 10px;
	width: 512px;
	max-width: 90vw;
}

.form-container h3 {
	margin-top: 0.25em;
}

.site-admin .form-container {
	width: 768px;
}

.form-field {
	margin: 6px 0;
}

:where(.form-field label) {
	display: block;
	padding-left: 15px;
}

:where(.form-field label::after) {
	content: ":";
}

.form-field input[type=file] {
	display: none;
}

.form-field.inline .form-text,
.form-field.inline label,
.form-field.inline input {
	display: inline-block;
	width: 20%;
}

#media-import-header {
	background-color: var(--background-color);
	position: sticky;
	top: 27px;
	z-index: 1;
	padding: 0.5em 2em;
	margin-top: -0.5em;
}

#media-import-header,
#media-import-items {
	max-width: 1220px;
	margin: 0 auto;
	padding-left: 2em;
	display: flex;
}

#media-import-items {
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

#media-import-items form {
	position: relative;
	background-color: var(--surface-color);
	margin: 15px;
	padding: 5px 15px;
	text-align: left;
	border-radius: 10px;
	width: 512px;
	max-width: 90vw;
}

#media-import-items form .close {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 20px;
	height: 20px;
	cursor: pointer;
}

#media-progress-bars {
	display: grid;
	grid-template-columns: 50% 50%;
}

#media-progress-bars div {
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.media-preview img,
.media-preview video {
	display: block;
	max-width: 100%;
	margin: 5px auto;
}

.media-preview p {
	text-align: center;
}

.error {
	color: var(--error-color);
}

.form-field input,
.form-field .form-text {
	width: 100%;
	display: block;
	border-radius: 5px;
	background-color: var(--surface-color-doubled);
	border: 1px solid var(--surface-color-doubled);
	color: var(--on-surface);
	padding: 2px 5px;
	box-sizing: border-box;
}

.form-field input[readonly] {
	cursor: initial;
}

.form-field input:focus-visible {
	border-color: var(--primary-color);
	outline: none;
}

.form-text {
	cursor: not-allowed;
}

.form-field .help-text {
	margin: 4px 20px 8px;
	font-size: 85%;
	opacity: 0.7;
}

.form-field .help-text .warning {
	display: block;
	color: var(--on-error);
	background-color: var(--error-color);
	padding: 0 3px;
	border-radius: 5px;
	margin-top: 3px;
}

.form-field.button-group {
	width: fit-content;
	margin-left: auto;
}

.form-field.button-group button {
	margin-left: 0;
	display: inline-block;
}

.form-field.button-group.group-left {
	margin-left: 0;
	width: auto;
}

.form-field.button-group.group-left button,
.form-field.button-group.group-left .button {
	margin-left: 0;
	display: inline-block;
}

/* Custom select */
select,
::picker(select) {
	appearance: base-select;
}

select {
	width: 100%;
	display: block;
	border-radius: 5px;
	background-color: var(--surface-color-doubled);
	border: 1px solid var(--surface-color-doubled);
	color: var(--on-surface);
	padding: 2px 5px;
}

select button {
	border: none;
	background: transparent;
	color: inherit;
	padding: 0;
	margin: 0;
}

select:focus,
select:focus-visible {
	border-color: var(--primary-color);
	outline: none;
}

select::picker-icon {
	color: #999;
	transition: 0.4s rotate;
}

select:open::picker-icon {
	rotate: 180deg;
}

select:open {
	border-color: var(--secondary-color);
}

::picker(select) {
	border: none;
	background-color: var(--surface-color-opaque);
	box-shadow: 0px 0px 3px 0px var(--secondary-color);
	z-index: 1;
	border-radius: 3px;
	color: var(--on-background);
	overflow: hidden;
	position-try-fallbacks: none;
}

option {
	display: flex;
	justify-content: flex-start;
	gap: 20px;
	border: none;
	background-color: transparent;
	padding: 10px;
}

option:nth-child(even) {
	background-color: var(--surface-color);
}

option:hover {
	color: var(--secondary-color);
}

option:checked {
	font-weight: bold;
}

option::checkmark {
	content: "\27A4";
}

button,
.button {
	display: block;
	width: fit-content;
	border: 2px solid var(--background-color);
	border-radius: 8px;
	padding: 8px 13px;
	background-color: var(--primary-color);
	color: var(--on-primary);
	cursor: pointer;
	text-decoration: none;
	font-size: 90%;
	font-family: sans-serif;
}

.form-field button,
.form-field .button {
	margin: 8px 0 8px auto;
}

button:focus-visible,
.button:focus-visible {
	outline: none;
}

button.secondary,
.button.secondary {
	background-color: var(--surface-color-doubled);
	color: var(--on-surface);
	border-color: var(--surface-color-doubled);
}

button:hover,
button:active,
.button:hover,
.button:active {
	background-color: var(--secondary-color);
	color: var(--on-secondary);
	border-color: var(--background-color);
}

button:disabled,
button:disabled:hover,
button:disabled:active,
.button:disabled,
.button:disabled:hover,
.button:disabled:active {
	background-color: var(--surface-color-doubled);
	border-color: var(--surface-color);
	color: var(--surface-color-doubled);
	cursor: not-allowed;
}

button.cancel,
.button.cancel {
	background-color: var(--surface-color-doubled);
	color: var(--on-surface);
	border-color: var(--surface-color);
	display: inline-block;
	float: none;
}

button.cancel:hover,
.button.cancel:hover {
	border-color: var(--secondary-color);
}

button.button-small,
.button-small {
	display: inline-block;
	background-color: var(--primary-color);
	color: var(--on-primary);
	padding: 2px 3px;
	border-radius: 5px;
	text-decoration: none;
	font-size: 90%;
	margin: 3px;
}

button.button-small:hover,
.button-small:hover {
	background-color: var(--secondary-color);
	color: var(--on-secondary);
}

/* Styles for the tags autocomplete list */
.tag-autocomplete {
	position: relative;
}

.autocomplete-list {
	display: block;
	position: absolute;
	left: 20px;
	right: 20px;
	margin-top: -1px;
	border-radius: 5px;
	background-color: var(--background-color);
	border: 1px solid var(--primary-color);
	z-index: 1;
}

.autocomplete-list a {
	display: block;
	padding: 2px 5px;
	overflow: hidden;
	text-overflow: ellipsis;
	background-color: var(--surface-color);
	color: var(--on-surface);
	cursor: pointer;
	border-bottom: 1px solid var(--background-color);
	text-align: left;
}

.autocomplete-list a.active,
.autocomplete-list a.active:hover,
.autocomplete-list a.active:active {
	background-color: var(--secondary-color);
	color: var(--on-secondary);
}

.autocomplete-list a:last-child {
	border-bottom: none;
}

.autocomplete-list a:hover,
.autocomplete-list a:active {
	background-color: var(--surface-color-doubled);
}

#tag-list:empty::after {
	content: "No tags selected";
}

/* Upload status styles */
.status-table {
	display: inline-block;
	margin: 0 auto;
	border-collapse: collapse;
	background-color: var(--surface-color);
	border-radius: 8px;
	color: var(--on-surface);
}

.status-table tbody tr:last-child td,
.status-table tbody tr:last-child th {
	border-bottom: none;
}

.status-table tbody tr:last-child td:last-child {
	border-bottom-right-radius: 8px;
}

.status-table tbody tr:last-child td:first-child {
	border-bottom-left-radius: 8px;
}

.status-table td,
.status-table th {
	border-bottom: 1px solid var(--primary-color);
	padding: 8px 14px;
}

.status-table td {
	text-align: left;
}

#placeholder td {
	text-align: center;
	font-style: italic;
}

.status-table .receiving,
.status-table .downloading,
.status-table .waiting,
.status-table .processing,
.status-table .complete,
.status-table .failed {
	min-width: 7.25em;
	text-align: right;
}

.status-table .receiving::after {
	content: "Receiving";
}

.status-table .downloading::after {
	content: "Downloading";
}

.status-table .waiting::after {
	content: "Waiting";
}

.status-table .processing::after {
	content: "Processing";
}

.status-table .complete::after {
	content: "Complete";
	color: var(--success-color);
}

.status-table .failed::after {
	content: "Failed";
	color: var(--error-color);
}

.tags-container {
	min-height: 30px;
	line-height: initial;
	width: 90%;
	margin: 3px auto;
}

td.tags-container {
	padding: 3px 14px;
	width: unset;
}

.tags-container .tag {
	display: inline-block;
	background-color: var(--primary-color);
	color: var(--on-primary);
	height: 1.25em;
	line-height: 1em;
	border-radius: 10px;
	padding: 2px 5px;
	margin: 2px;
	cursor: default;
	text-decoration: none;
}

.tags-container .tag::before {
	content: '#';
}

.tags-container a.tag {
	cursor: pointer;
}

.tags-container a.tag:hover {
	background-color: var(--secondary-color);
	color: var(--on-secondary);
}

.tags-container .tag a {
	cursor: pointer;
	margin-left: 7px;
	text-decoration: none;
	color: var(--on-primary);
}

.tags-container:empty {
	text-align: center;
}

.tags-container:empty::after {
	content: "No tags";
	font-style: italic;
}

/* Media Preview styles */
.media {
	background-position: center;
	background-repeat: no-repeat;
	background-color: var(--surface-color);
	margin: 4px 4px 1em;
	border-radius: 8px 8px 0 0;
	width: 180px;
	height: 120px;
	display: inline-block;
	position: relative;
	box-sizing: content-box;
	color: inherit;
	transform: scale(0.95);
	transition: transform 0.2s ease-in-out;
}

.media:hover,
.media.hover {
	transform: scale(1.05);
}

.media.image {
	background-image: url("icon-image.png");
}

.media.image.preview {
	background-position: top;
}

.media.video {
	background-image: url("icon-video.png");
}

.media.video.preview {
	background-position: 45.45%;
}

.media.video.preview.hover {
	animation: filmstrip 8.0s steps(12) infinite;
}

.media.video.preview:hover {
	/* Add a brief delay to avoid "stuttering" when the mouse passes quickly across the page */
	animation-delay: 0.35s;
}

@keyframes filmstrip {
	0% {
		background-position: 0%;
	}

	100% {
		background-position: 109.1%;
	}
}

.media .title,
.media .metadata {
	font-size: 75%;
	background-color: var(--background-color);
	position: absolute;
	padding: 0 5px;
}

.media .title {
	top: 120px;
	left: 0;
	width: 100%;
	padding-top: 2px;
	border-radius: 0 0 8px 8px;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	background-color: var(--surface-color);
}

.media .title.path {
	cursor: pointer;
}

.media .metadata {
	right: 0;
	bottom: 0;
	border-top-left-radius: 8px;
	padding-top: 2px;
}

.video-definition {
	color: var(--primary-color);
	font-weight: bold;
	font-size: 110%;
	font-family: sans-serif;
}

.media.new::before {
	content: 'NEW';
	display: inline-block;
	font-size: 75%;
	position: absolute;
	right: 0px;
	top: 0px;
	border-bottom-left-radius: 8px;
	background-color: var(--secondary-color);
	color: black;
	padding: 2px 5px 0px;
}

/* Pagination Controls */
.paginator {
	margin-top: 15px;
}

.paginator a,
.paginator span,
.paginator button {
	display: inline-block;
	min-width: 37px;
	height: 37px;
	line-height: 35px;
	text-decoration: none;
	color: var(--on-surface);
	border-radius: 50%;
	float: none;
	margin: 0;
	padding: 0;
}

.paginator a,
.paginator button {
	background-color: var(--surface-color);
}

.paginator a:hover,
.paginator button:hover {
	background-color: var(--surface-color-doubled);
}

/* Media files */
.view-file {
	max-width: 98%;
	margin: 8px auto;
}

.view-file.resized.zoomed {
	position: fixed;
	top: 0px;
	z-index: 2;
	margin: 0px;
	width: 100vw;
	max-width: unset;
	height: 100vh;
	overflow: auto;
	background-color: var(--background-color);
}

.view-file img,
.view-file video {
	max-width: 100%;
	max-height: 80vh;
	display: block;
	margin: 0px auto;
}

.view-file.resized img {
	cursor: zoom-in;
}

.view-file.resized.zoomed img {
	cursor: zoom-out;
	max-height: unset;
}

.view-file .file-info {
	text-align: center;
	margin-top: 5px;
	line-height: 1.75em;
}

.view-file.zoomed .file-info {
	display: none;
}

#wake-lock-status {
	display: none;
	fill: var(--error-color);
	position: fixed;
	bottom: 2px;
	right: 2px;
}

#wake-lock-status svg {
	width: 16px;
	height: 16px;
}

#wake-lock-status.active {
	fill: var(--success-color);
}

.edit-file {
	max-width: 98%;
	margin: 8px auto;
}

.edit-file img,
.edit-file video {
	max-width: 100%;
	max-height: 50vh;
	display: block;
	margin: 0px auto;
}

a.user {
	color: var(--on-background);
	text-decoration: none;
	display: inline-block;
	border: 1px dotted var(--primary-color);
	border-radius: 8px;
	padding: 0 8px;
	background-color: var(--surface-color);
}

a.user:hover {
	border-color: var(--secondary-color);
}

a.edit-button {
	display: inline-block;
	background-color: var(--surface-color-doubled);
	color: var(--on-surface);
	text-decoration: none;
	padding: 0px 5px;
	border-radius: 10px;
	cursor: pointer;
	--box-shadow-color: var(--primary-color);
	box-shadow: 0 0 5px var(--box-shadow-color);
}

a.edit-button::before {
	content: "\270E";
}

a.edit-button:hover {
	--box-shadow-color: var(--secondary-color);
}

/* Users table */
table.striped {
	margin: 0 auto;
	border-collapse: collapse;
	border: 1px solid var(--surface-color);
	border-radius: 8px;
	color: var(--on-surface);
	width: 100%;
	background-color: var(--surface-color);
	overflow: hidden;
}

table.striped td,
table.striped th {
	padding: 4px 8px;
	border: 1px solid var(--surface-color);
}

table.striped th {
	text-align: left;
	vertical-align: bottom;
}

table.striped td {
	text-align: left;
}

table.striped tr:nth-child(even),
table.striped thead tr {
	background-color: var(--surface-color);
}

table.striped tbody tr:hover,
table.striped > tr:hover {
	background-color: var(--surface-color-doubled);
}

span.user-status {
	display: inline-block;
	height: 1.5em;
	border: 1px solid var(--background-color);
	border-radius: 0.75em;
	padding: 2px 0.75em;
	white-space: nowrap;
	line-height: 1em;
}

span.user-status.status-active {
	color: var(--success-color);
	border-color: var(--success-color);
}

span.user-status.status-inactive {
	color: var(--error-color);
	border-color: var(--error-color);
}

span.user-status::before {
	width: 1em;
	line-height: 1em;
	display: inline-block;
}

span.user-status.status-active::before {
	content: "\2713";
}

span.user-status.status-inactive::before {
	content: "\00D7";
	font-weight: bolder;
}

span.user-status.status-active::after {
	content: "Active";
}

span.user-status.status-inactive::after {
	content: "Inactive";
}

.datetime {
	white-space: nowrap;
}

/* Modal dialog */
dialog {
	width: 550px;
	max-width: 75vw;
	background-color: var(--surface-color-opaque);
	color: var(--on-surface);
	padding: 5px 15px;
	border-radius: 12px;
	border: 1px solid var(--primary-color);
	box-shadow: 0px 0px 8px var(--primary-color);
	overflow: visible;
}

dialog:focus-visible {
	outline: none;
}

dialog::backdrop {
	backdrop-filter: blur(2px);
}

dialog.working,
dialog.working::backdrop {
	cursor: wait;
}

dialog h3 {
	margin: 0 -15px 15px;
	padding: 10px 0;
	border-bottom: 1px solid var(--surface-color-doubled);
	text-align: center;
}

/* Magical pure-CSS loading animation */
.loader {
	border: 5px solid;
	border-color: var(--primary-color) transparent;
	border-radius: 50%;
	width: 60px;
	height: 60px;
	margin: 30px auto;
	animation: spin 1.5s infinite;
}

@keyframes spin {
	35% {
		transform: rotate(450deg);
	}
}

/* Progress Bar */
.progress {
	position: relative;
	background-color: var(--surface-color-doubled);
	width: 100%;
	height: 1em;
	border-radius: 1em;
	overflow: hidden;
	border: 1px solid var(--surface-color-doubled);
}

/* Use the ::before pseudo-element to display the progress value */
.progress::before {
	content: '';
	display: block;
	width: var(--progress-value, 0%);
	min-width: 0.5em;
	height: 100%;
	background-color: var(--primary-color);
	border-radius: 1em;
	box-shadow: 0.25em 0 0.5em var(--primary-color);
	transition: width 0.5s ease-in-out;
}

.progress.error::before,
.progress.complete::before,
.progress.waiting::before {
	content: none;
	display: none;
	width: 0;
	transition: none;
}

/* Use the ::after pseudo-element for other statuses; this avoids unwanted transitions when the status changes */
.progress.error::after,
.progress.complete::after,
.progress.waiting::after {
	content: '';
	display: block;
	width: 100%;
	height: 100%;
	transition: none;
}

.progress.error::after {
	background-color: var(--error-color);
	animation: pulse 1s linear forwards;
}

.progress.complete::after {
	background-color: var(--success-color);
	animation: pulse 1s linear forwards;
}

.progress.waiting::after {
	background-color: transparent;
	background-image: linear-gradient(-45deg,
			var(--surface-color-doubled) 25%,
			transparent 25%,
			transparent 50%,
			var(--surface-color-doubled) 50%,
			var(--surface-color-doubled) 75%,
			transparent 75%,
			transparent);
	background-size: 2em 2em;
	animation: move 2s linear infinite;
}

.progress.progress-small {
    height: 0.25em;
    border-radius: 0;
    border: none;
}

.progress.progress-small::before,
.progress.progress-small::after {
    border-radius: 0;
    box-shadow: none;
    min-width: 1px;
}

@keyframes move {
	0% {
		background-position: 0 0;
	}

	100% {
		background-position: 2em 2em;
	}
}

@keyframes pulse {
	25% {
		opacity: 0.5;
	}

	50% {
		opacity: 1;
	}

	75% {
		opacity: 0.5;
	}
}