/* Stier Systems look, following stiersystems.se: dark background, Montserrat
   body text, Inter headings, cyan accent. Fonts are self-hosted (@fontsource,
   OFL) so customer browsers never contact a font CDN. */

@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("/fonts/montserrat/files/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/fonts/montserrat/files/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("/fonts/montserrat/files/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/fonts/montserrat/files/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/fonts/inter/files/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/fonts/inter/files/inter-latin-600-normal.woff2") format("woff2"); }

:root {
	--bg: #111111;
	--surface: #1a1d23;
	--surface-raised: #222630;
	--field: #0c0e11;
	--border: rgba(241, 245, 249, 0.1);
	--border-strong: rgba(241, 245, 249, 0.22);
	--text: #a0aec0;
	--heading: #f1f5f9;
	--accent: #00e5ff;
	--accent-hover: #5cf0ff;
	--accent-soft: rgba(0, 229, 255, 0.12);
	--on-accent: #111111;
	--danger: #f06a6b;
	--radius: 12px;
	--radius-small: 8px;
	color-scheme: dark;
}

*, *::before, *::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font-family: "Montserrat", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

h1, h2, h3 {
	font-family: "Inter", "Montserrat", system-ui, sans-serif;
	font-weight: 500;
	color: var(--heading);
	line-height: 1.2;
	margin: 0 0 1rem;
}

h1 {
	font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
	letter-spacing: -0.02em;
}

h2 {
	font-size: 1.25rem;
	letter-spacing: -0.01em;
	margin-top: 2.5rem;
}

p {
	margin: 0 0 1rem;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	color: var(--accent-hover);
	text-decoration: underline;
}

/* Header */

.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	padding: 1rem clamp(1rem, 4vw, 2.5rem);
	background: var(--bg);
	border-bottom: 1px solid var(--border);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--heading);
	font-weight: 700;
	font-size: 1.125rem;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

.brand:hover {
	color: var(--heading);
	text-decoration: none;
}

.brand img {
	width: 32px;
	height: auto;
	display: block;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin-left: auto;
}

.site-nav .inline {
	display: block;
}

.site-nav a,
.site-nav button {
	color: var(--text);
	background: none;
	border: 0;
	border-radius: var(--radius-small);
	padding: 0.5rem 0.85rem;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
	min-height: 0;
}

.site-nav a:hover,
.site-nav button:hover {
	color: var(--heading);
	background: var(--surface);
	text-decoration: none;
}

/* Layout */

main {
	flex: 1;
	width: 100%;
	max-width: 64rem;
	margin: 0 auto;
	padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem;
}

.site-footer {
	padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
	border-top: 1px solid var(--border);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #667085;
}

/* Messages */

.flash {
	margin: 0 0 1.5rem;
	padding: 0.85rem 1rem;
	background: var(--accent-soft);
	border: 1px solid rgba(0, 229, 255, 0.35);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius-small);
	color: var(--heading);
}

/* Forms */

main form:not(.inline) {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	margin: 0 0 1.5rem;
}

form label {
	display: block;
	margin-bottom: 1rem;
	color: var(--heading);
	font-size: 0.9rem;
	font-weight: 500;
}

input,
select,
textarea {
	display: block;
	width: 100%;
	max-width: 28rem;
	margin-top: 0.4rem;
	padding: 0.7rem 0.85rem;
	background: var(--field);
	color: var(--heading);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-small);
	font: inherit;
	font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-color: var(--accent);
}

input[type="file"] {
	padding: 0.55rem;
	cursor: pointer;
}

input[type="file"]::file-selector-button {
	margin-right: 0.85rem;
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	background: var(--surface-raised);
	color: var(--heading);
	font: inherit;
	cursor: pointer;
}

.inline {
	display: inline;
	margin: 0;
	padding: 0;
}

.inline input {
	display: inline-block;
	width: 6rem;
	margin: 0 0.35rem 0 0;
	padding: 0.45rem 0.6rem;
}

/* Buttons: cyan primary; buttons in inline row actions are quieter. */

button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0.65rem 1.4rem;
	background: var(--accent);
	color: var(--on-accent);
	border: 1px solid var(--accent);
	border-radius: var(--radius-small);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
}

button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.inline button {
	min-height: 2.25rem;
	padding: 0.35rem 0.85rem;
	background: transparent;
	color: var(--heading);
	border-color: var(--border-strong);
	font-weight: 500;
	font-size: 0.9rem;
}

.inline button:hover {
	background: var(--surface-raised);
	border-color: var(--accent);
	color: var(--accent);
}

/* Tables */

table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 0 0 1.5rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

th,
td {
	text-align: left;
	padding: 0.8rem 1rem;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}

th {
	color: #718096;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: rgba(0, 0, 0, 0.18);
}

td {
	color: var(--heading);
}

tbody tr:last-child td {
	border-bottom: 0;
}

tbody tr:hover td {
	background: rgba(241, 245, 249, 0.03);
}

/* Lists as cards (playlists, files, bookings, val-sida choices) */

main ul {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

main li {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem 1.25rem;
	color: var(--heading);
}

main li img,
main li video {
	display: block;
	margin: 0.75rem 0;
	border-radius: 6px;
	background: #000;
	border: 1px solid var(--border);
}

/* Deleting is the one destructive row action. */
form[action$="/delete"] button:hover {
	border-color: var(--danger);
	color: var(--danger);
}

main li .inline {
	display: inline-block;
	margin: 0.25rem 0.35rem 0.25rem 0;
}

/* Upload progress (static/upload.js) */

progress {
	display: block;
	width: 100%;
	max-width: 28rem;
	height: 0.5rem;
	margin: 1rem 0 0.5rem;
	appearance: none;
	border: 0;
	border-radius: 999px;
	overflow: hidden;
	background: var(--field);
}

progress::-webkit-progress-bar {
	background: var(--field);
}

progress::-webkit-progress-value {
	background: var(--accent);
}

progress::-moz-progress-bar {
	background: var(--accent);
}

progress[hidden] {
	display: none;
}

[data-upload-status] {
	display: block;
	color: var(--heading);
	font-size: 0.9rem;
}

/* Centered single-card pages: logins and the val-sida on a phone */

.page-narrow main {
	max-width: 30rem;
}

.page-narrow main form:not(.inline) {
	padding: 1.75rem;
}

.page-narrow input {
	max-width: none;
}

.page-narrow form:not(.inline) button {
	width: 100%;
}

/* Val-sida: each playlist is one big tap target */

.choices li {
	padding: 0;
	background: none;
	border: 0;
}

.choices form.inline,
.choices form.inline button {
	display: flex;
	width: 100%;
	margin: 0;
}

.choices form.inline button {
	justify-content: flex-start;
	min-height: 4rem;
	padding: 1rem 1.25rem;
	background: var(--surface);
	color: var(--heading);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	font-size: 1.05rem;
	font-weight: 600;
	text-align: left;
}

.choices form.inline button:hover {
	border-color: var(--accent);
	background: var(--surface-raised);
	color: var(--accent);
}

.highlight {
	color: var(--accent);
	font-size: 1.25rem;
	font-weight: 600;
}

.status {
	display: inline-block;
	margin-left: 0.5rem;
	padding: 0.1rem 0.6rem;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	background: var(--surface-raised);
	color: var(--text);
}

.status-done {
	background: rgba(52, 211, 153, 0.14);
	color: #6ee7b7;
}

.status-processing,
.status-pending {
	background: var(--accent-soft);
	color: var(--accent);
}

.status-failed {
	background: rgba(240, 106, 107, 0.14);
	color: var(--danger);
}

.muted {
	color: var(--text);
	font-weight: 400;
}

@media (max-width: 40rem) {
	th,
	td {
		padding: 0.65rem 0.75rem;
	}

	table {
		display: block;
		overflow-x: auto;
	}
}

td .status,
td .inline button {
	margin-left: 0;
	white-space: nowrap;
}

.inline input.wide {
	width: 11rem;
}

/* Screens: mounting per screen, one compact row */

.mounting label {
	display: inline-block;
	margin: 0 0.6rem 0.4rem 0;
	font-size: 0.8rem;
}

.mounting select {
	display: inline-block;
	width: auto;
	margin: 0.2rem 0 0;
	padding: 0.35rem 0.5rem;
	font-size: 0.9rem;
}

/* How a file fits its playlist (src/media/fit.ts) */

.status-warning {
	background: rgba(251, 191, 36, 0.14);
	color: #fcd34d;
}

.fit {
	display: inline-block;
	margin: 0.35rem 0 0.25rem;
	margin-left: 0;
	white-space: normal;
}

.flash.warning {
	background: rgba(251, 191, 36, 0.1);
	border-color: rgba(251, 191, 36, 0.35);
	border-left-color: #fbbf24;
}

/* Destructive actions, e.g. deleting a project */

button.danger {
	background: transparent;
	color: var(--danger);
	border-color: var(--danger);
}

button.danger:hover {
	background: rgba(240, 106, 107, 0.14);
	border-color: var(--danger);
}

/* Val-sida: turn the screen right after choosing its content */

.turn-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem;
	margin-bottom: 1.5rem;
}

main .turn-grid form,
.page-narrow main .turn-grid form:not(.inline) {
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
}

.turn-grid button {
	width: 100%;
	min-height: 3.25rem;
	background: transparent;
	color: var(--heading);
	border-color: var(--border-strong);
}

.turn-grid button.current {
	background: var(--accent);
	color: var(--on-accent);
	border-color: var(--accent);
}

/* A link that looks like the primary button */

a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.65rem 1.4rem;
	background: var(--accent);
	color: var(--on-accent);
	border: 1px solid var(--accent);
	border-radius: var(--radius-small);
	font-weight: 600;
	text-decoration: none;
}

a.button:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
	color: var(--on-accent);
	text-decoration: none;
}

/* Val-sida: the way to one's own playlists when not logged in */

.login-prompt {
	margin: 1.5rem 0;
	padding: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.login-prompt h2 {
	margin: 0 0 0.5rem;
	font-size: 1.1rem;
}

.login-prompt .button {
	width: 100%;
}

/* Wifi passwords: hidden until their eye is pressed */

.secret {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.secret-toggle {
	min-height: 0;
	padding: 0.2rem 0.35rem;
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	line-height: 0;
}

.secret-toggle:hover,
.secret-toggle.active {
	background: var(--surface-raised);
	color: var(--accent);
	border-color: var(--accent);
}

/* Help pages (/help, views/help/) */

.help-index li a {
	font-family: "Inter", "Montserrat", system-ui, sans-serif;
	font-size: 1.15rem;
	font-weight: 600;
}

.help-index li p {
	margin: 0.35rem 0 0;
}

.help-kicker {
	display: block;
	margin: 0 0 0.35rem;
	color: var(--accent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.guide {
	max-width: 46rem;
}

.guide .lead {
	font-size: 1.1rem;
	color: var(--heading);
}

.guide h2 {
	margin-top: 2.5rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--accent);
}

.guide h3 {
	margin-top: 1.75rem;
}

.guide ul.plain,
.guide .box ul {
	display: block;
	list-style: disc;
	padding-left: 1.25rem;
}

.guide ul.plain li,
.guide .box li {
	background: none;
	border: 0;
	padding: 0;
	margin-bottom: 0.5rem;
	color: var(--text);
}

.guide ol.steps {
	list-style: none;
	padding: 0;
	margin: 0 0 1.5rem;
	counter-reset: step;
}

.guide ol.steps li {
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--text);
	counter-increment: step;
	position: relative;
	padding: 0.15rem 0 0 2.75rem;
	margin-bottom: 0.9rem;
	min-height: 2rem;
}

.guide ol.steps li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: 0;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--accent);
	color: var(--on-accent);
	font: 700 0.95rem/2rem "Inter", system-ui, sans-serif;
	text-align: center;
}

.guide strong {
	color: var(--heading);
}

.guide code {
	padding: 0.05rem 0.4rem;
	border-radius: 6px;
	background: var(--surface-raised);
	color: var(--heading);
	font-size: 0.92em;
	overflow-wrap: anywhere;
}

.guide .box {
	margin: 1.25rem 0;
	padding: 1rem 1.15rem;
	background: var(--accent-soft);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius-small);
}

.guide .box > strong {
	display: block;
	margin-bottom: 0.35rem;
}

.guide .box p:last-child,
.guide .box ul:last-child {
	margin-bottom: 0;
}

.guide figure {
	margin: 1.5rem 0;
}

.guide figure img {
	display: block;
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-small);
}

.guide figcaption {
	margin-top: 0.5rem;
	font-size: 0.85rem;
}

.guide figure.phone {
	max-width: 17rem;
}

.guide figure.phone img {
	border-radius: 18px;
}

.guide .phones {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.guide .phones figure {
	flex: 1 1 14rem;
	margin: 0;
}

.guide-split {
	display: grid;
	grid-template-columns: 1fr 15rem;
	gap: 1.5rem;
	align-items: start;
}

.guide-split figure {
	margin: 0;
}

@media (max-width: 40rem) {
	.guide-split {
		grid-template-columns: 1fr;
	}
}

/* Remote control (/r/<token>, views/remote/) and its link on the val-sida */

.remote-grid {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}

.remote-grid li {
	padding: 0;
	background: none;
	border: 0;
}

main form.remote-choice {
	display: block;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
}

.remote-choice button {
	display: block;
	width: 100%;
	margin: 0;
}

.remote-choice button {
	padding: 0;
	overflow: hidden;
	text-align: left;
	background: var(--surface);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	color: var(--heading);
}

.remote-choice button:hover,
.remote-choice button.current {
	border-color: var(--accent);
}

.remote-choice img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: #000;
}

.remote-choice span {
	display: block;
	padding: 0.75rem 1rem;
	font-weight: 600;
}

.remote-link {
	margin: 1.5rem 0;
	padding: 1rem 1.15rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.remote-link h2 {
	margin-top: 0;
}

.remote-url code {
	overflow-wrap: anywhere;
}

.remote-url button {
	margin-top: 0.5rem;
	padding: 0.45rem 0.9rem;
	background: transparent;
	color: var(--heading);
	border: 1px solid var(--border-strong);
	font-size: 0.9rem;
}
