/* Fuge 0.3.4 · base.css. Kopie aus dem Fuge-Repository, Änderungen dort. Regeln: DESIGN.md.
   Bausteine für beide Profile. Farben und Maße kommen aus tokens.css. */

:root {
	/* Fläche für Bedienelemente auf dem aktuellen Untergrund, immer eine Stufe abgesetzt:
	   auf der Seite die Karte, auf der Karte der Kasten, im Kasten wieder die Karte. */
	--lift: var(--card);
	/* Höhe von Knöpfen und Feldern. kiosk.css macht sie für Finger größer. */
	--control: 32px;
}

* {
	box-sizing: border-box;
	margin: 0;
}
html {
	background: var(--bg);
	scrollbar-color: var(--dim) transparent;
}
* {
	scrollbar-width: thin;
}
::selection {
	background: color-mix(in oklch, var(--accent) 35%, transparent);
}
body {
	background: var(--bg);
	color: var(--text);
	font-family: Inter, system-ui, sans-serif;
	font-size: var(--fs-md);
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}
button {
	cursor: pointer;
}
a {
	color: var(--accent);
	text-decoration: none;
}
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
svg {
	flex: none;
}

/* ---------- Schrift ---------- */

/* Überschriften heben sich über Größe ab, nicht über Fettung. */
h1,
h2,
h3 {
	font-weight: 500;
	line-height: 1.2;
}
/* Betonung im Fließtext. Ohne diese Regel nähme der Browser 700. */
b,
strong {
	font-weight: 600;
}
h1 {
	font-size: var(--fs-2xl);
	letter-spacing: -0.02em;
}
h2 {
	font-size: var(--fs-xl);
	letter-spacing: -0.01em;
}
h3 {
	font-size: var(--fs-lg);
}
/* Zahlen, die untereinander stehen oder sich ändern. */
.num {
	font-variant-numeric: tabular-nums;
}
.muted {
	color: var(--muted);
}
.sub {
	color: var(--muted);
	font-size: var(--fs-sm);
}
/* Die eine große Zahl einer Karte, die Einheit klein dahinter: <div class="big">26 <small>%</small></div>
   Das Leerzeichen steht im Markup, damit kopierter und vorgelesener Text „26 %“ lautet. In der großen
   Schrift wäre es zu breit, word-spacing zieht es auf rund 4 px zusammen. */
.big {
	font-size: 40px;
	font-weight: 500;
	letter-spacing: -0.035em;
	word-spacing: -0.15em;
	line-height: 1;
}
.big small {
	font-size: var(--fs-lg);
	font-weight: 400;
	color: var(--muted);
	letter-spacing: 0;
}

/* ---------- Flächen ---------- */

.card {
	--lift: var(--raised);
	position: relative;
	background: var(--card);
	border: 1px solid var(--frame);
	border-radius: var(--r-md);
	padding: var(--pad);
	min-width: 0;
}
.card.selected {
	border-color: var(--accent);
}
.card.alert {
	border-color: var(--bad);
}
/* Kasten in einer Karte. */
.box {
	--lift: var(--card);
	background: var(--raised);
	border: 1px solid var(--frame);
	border-radius: var(--r-sm);
	padding: 10px 12px;
	min-width: 0;
}
.box.selected {
	background: var(--accent-soft);
}
/* Titel einer Karte: <div class="label"><span class="dot"></span>System<span class="right">CPU</span></div> */
.label {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--muted);
	font-size: var(--fs-xs);
	font-weight: 500;
	letter-spacing: 0.01em;
	margin-bottom: 14px;
}
.label .right {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
}
/* Elemente nebeneinander, die bei Platzmangel umbrechen: Knöpfe, Marken, ein Titel mit Angabe. */
.line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
/* Einträge untereinander, durch Linien getrennt. */
.rows > * + * {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}
.empty {
	color: var(--muted);
	font-size: var(--fs-sm);
	text-align: center;
	margin: auto 0;
}
/* Schwebende Hinweise und Menüs. Nur Ebenen über dem Inhalt tragen den Schatten --float. */
.pop {
	background: var(--card);
	border: 1px solid var(--line-strong);
	box-shadow: var(--float);
	border-radius: var(--r-sm);
	padding: 8px 10px;
	font-size: var(--fs-xs);
}
/* Blöcke untereinander mit gleichem Abstand, etwa der Inhalt einer Karte: <section class="card stack">.
   Die Regel steht nach den übrigen Flächen, damit sie deren eigenen Außenabstand oben ersetzt. */
.stack > * + * {
	margin-top: var(--gap);
}
/* Der Kartentitel bringt seinen Abstand selbst mit. */
.stack > .label + * {
	margin-top: 0;
}

/* ---------- Zustand ---------- */

.dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--c, var(--dim));
	flex: none;
}
.dot.ok {
	background: var(--ok);
	box-shadow: var(--ok-glow);
}
.dot.warn {
	background: var(--warn-dot);
}
.dot.bad {
	background: var(--bad);
}
.dot.accent {
	background: var(--accent);
}
/* Marke ohne Bedienung: <span class="pill ok">erledigt</span> */
.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: var(--fs-xs);
	font-weight: 500;
	padding: 2px 9px;
	border-radius: var(--r-full);
	background: var(--lift);
	color: var(--muted);
	white-space: nowrap;
}
.pill.accent {
	background: var(--accent-soft);
	color: var(--accent);
}
.pill.ok {
	background: var(--ok-soft);
	color: var(--ok);
}
.pill.warn {
	background: var(--warn-soft);
	color: var(--warn);
}
.pill.bad {
	background: var(--bad-soft);
	color: var(--bad);
}

/* Kategorie mit Farbpunkt: <span class="tag" style="--c: var(--s1)"><i class="dot"></i>Feature</span>
   Die Farbe steht nur im Punkt, weil Reihenfarben als Fläche geprüft sind, nicht als Schrift. */
.tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 24px;
	padding: 0 9px;
	border-radius: var(--r-full);
	border: 1px solid var(--line);
	color: var(--muted);
	font-size: var(--fs-xs);
	font-weight: 500;
	white-space: nowrap;
}
/* Eckige Farbmarke vor einem Eintrag in Tabellen und Listen: <i class="mark" style="--c: var(--z3)"></i> */
.mark {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--c, var(--dim));
	flex: none;
}
/* Legende über einem Diagramm: <ul class="legend"><li style="--c: var(--s1)"><i></i>Rad</li>…</ul>
   <i class="dashed"> steht für eine gestrichelte Linie. */
.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin-bottom: 10px;
	padding: 0;
	list-style: none;
	font-size: var(--fs-xs);
	color: var(--muted);
}
.legend i {
	display: inline-block;
	width: 12px;
	height: 3px;
	border-radius: 2px;
	margin-right: 6px;
	vertical-align: middle;
	background: var(--c, var(--dim));
}
.legend i.dashed {
	background: repeating-linear-gradient(90deg, var(--c, var(--dim)) 0 3px, transparent 3px 5px);
}
/* Anzahl hinter einem Titel oder am Ende eines Eintrags. */
.count {
	color: var(--muted);
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}

/* ---------- Werte ---------- */

/* Balken sind neutral. Farbe bekommen nur die Warnstufen. */
.track {
	height: 4px;
	border-radius: 4px;
	background: var(--track);
	overflow: hidden;
}
.fill {
	height: 100%;
	border-radius: 4px;
	background: var(--text);
	transition:
		width var(--slow) ease,
		background-color var(--fast);
}
.fill.warn {
	background: var(--warn);
}
.fill.bad {
	background: var(--bad);
}
.fill.off {
	background: var(--dim);
}
/* <div class="meter"><div class="row"><span>Speicher</span><b>9,4 GB</b></div><div class="track">…</div></div> */
.meter .row {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: var(--fs-sm);
	color: var(--muted);
	margin-bottom: 6px;
}
.meter .row b {
	color: var(--text);
	font-weight: 500;
}
/* Kennzahlen nebeneinander: <div class="facts"><div><b>44 %</b><span>Festplatte</span></div>…</div> */
.facts {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 24px;
}
.facts b {
	display: block;
	font-size: var(--fs-xl);
	font-weight: 500;
	letter-spacing: -0.01em;
	word-spacing: -0.14em;
}
/* Einheit hinter dem Wert, mit Leerzeichen im Markup: <b>191 <small>W</small></b>.
   Eine Einheit mit Schrägstrich schließt ohne Leerzeichen an: <b>6:02<small>/km</small></b> */
.facts small {
	font-size: var(--fs-sm);
	font-weight: 400;
	color: var(--muted);
	letter-spacing: 0;
}
.facts span {
	display: block;
	font-size: var(--fs-xs);
	color: var(--muted);
}
table.data {
	width: 100%;
	border-collapse: collapse;
}
table.data th {
	text-align: left;
	font-size: var(--fs-xs);
	font-weight: 500;
	color: var(--muted);
	padding: 0 12px 6px 0;
	white-space: nowrap;
}
table.data td {
	padding: 8px 12px 8px 0;
	border-top: 1px solid var(--line);
	vertical-align: baseline;
}
table.data .r {
	text-align: right;
}
table.data th:last-child,
table.data td:last-child {
	padding-right: 0;
}

/* ---------- Bedienung ---------- */

/* Ein Zustand erscheint sofort und blendet in --fast aus: Die Dauer steht am Ruhezustand,
   der gedrückte oder überfahrene Zustand setzt sie auf null. */
.btn,
.chip,
.icon-btn,
.segments > *,
.nav > a,
.nav > button,
.list-row {
	transition:
		background-color var(--fast),
		border-color var(--fast),
		color var(--fast),
		opacity var(--fast),
		box-shadow var(--fast);
}
/* Der gedrückte Zustand legt --press als Innenschatten über die eigene Fläche, weil der sich
   anders als ein Hintergrundbild ausblenden lässt. app.css nimmt dasselbe für Hover. */
.btn:active,
.chip:active,
.icon-btn:active,
.segments > *:active,
.nav > a:active,
.nav > button:active,
.list-row:active {
	box-shadow: inset 0 0 0 999px var(--press);
	transition-duration: 0s;
}
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: var(--control);
	padding: 0 14px;
	border-radius: var(--r-full);
	border: 1px solid var(--frame);
	background: var(--lift);
	color: var(--text);
	font-size: var(--fs-sm);
	font-weight: 500;
	white-space: nowrap;
}
.btn svg {
	width: 14px;
	height: 14px;
}
/* Die eine Hauptaktion einer Ansicht: Textfarbe als Fläche. */
.btn.primary {
	background: var(--text);
	border-color: transparent;
	color: var(--bg);
}
.btn.primary:active {
	background: var(--text-press);
	box-shadow: none;
}
/* Leiser Knopf ohne Fläche und ohne Rahmen. Die Fläche erscheint erst beim Drücken oder Überfahren. */
.btn.ghost {
	background: none;
	border-color: transparent;
	color: var(--muted);
}
.btn.danger {
	border-color: var(--bad);
	color: var(--bad);
}
.btn.lg {
	height: 46px;
	padding: 0 20px;
	font-size: var(--fs-md);
}
.btn:disabled,
.btn[aria-disabled='true'],
.btn.busy {
	opacity: 0.55;
	pointer-events: none;
}
.icon-btn {
	display: grid;
	place-items: center;
	width: var(--control);
	height: var(--control);
	padding: 0;
	border-radius: 50%;
	border: 1px solid transparent;
	background: none;
	color: var(--muted);
	flex: none;
}
/* Für die eine Aktion, die auffallen soll, und für frei stehende Icon-Knöpfe ohne Hover (Profil Kiosk). */
.icon-btn.filled {
	background: var(--lift);
	border-color: var(--frame);
	color: var(--text);
}
.icon-btn svg {
	width: 16px;
	height: 16px;
}
/* Ohne Hover, also auf Tablet und Telefon, wäre ein nackter Icon-Knopf nicht als Knopf zu erkennen. */
@media (hover: none) {
	.icon-btn {
		background: var(--lift);
		border-color: var(--frame);
		color: var(--text);
	}
}
/* Filter und Mehrfachauswahl. Gewählt über aria-pressed oder aria-current. */
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 11px;
	border-radius: var(--r-full);
	border: 1px solid var(--frame);
	background: var(--lift);
	color: var(--text);
	font-size: var(--fs-xs);
	font-weight: 500;
	white-space: nowrap;
}
.chip[aria-pressed='true'],
.chip[aria-current] {
	border-color: var(--accent);
	background-color: var(--accent-soft);
}
.chip.off {
	opacity: 0.45;
	background: none;
	border-color: var(--line);
	color: var(--muted);
}
/* Umschalter zwischen Ansichten oder Werten, auch als Navigation. */
.segments {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px;
	border-radius: var(--r-full);
	background: var(--lift);
	border: 1px solid var(--frame);
}
.segments > * {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 13px;
	border: 0;
	border-radius: var(--r-full);
	background: none;
	color: var(--muted);
	font-size: var(--fs-xs);
	font-weight: 500;
	white-space: nowrap;
}
.segments > [aria-pressed='true'],
.segments > [aria-current],
.segments > [aria-selected='true'] {
	background-color: var(--press);
	color: var(--text);
}
/* Füllt die Breite. Jeder Eintrag behält die Breite seines Textes und bekommt vom freien Platz gleich viel
   dazu. Gleich breite Einträge würden lange Wörter abschneiden. app.css kennt dasselbe nur für schmale Bildschirme. */
.segments.full {
	display: flex;
}
.segments.full > * {
	flex: 1 1 auto;
	justify-content: center;
	padding: 0 6px;
}
/* <button class="toggle" role="switch" aria-checked="true">Ton<span class="switch"></span></button> */
.toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--muted);
	font-size: var(--fs-sm);
	text-align: left;
}
.toggle[aria-checked='true'] {
	color: var(--text);
}
.switch {
	position: relative;
	width: 34px;
	height: 20px;
	border-radius: var(--r-full);
	background: var(--track);
	border: 1px solid var(--line-strong);
	flex: none;
	transition:
		background-color var(--fast),
		border-color var(--fast);
}
.switch::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--muted);
	transition:
		transform var(--fast),
		background-color var(--fast);
}
[aria-checked='true'] > .switch {
	background: var(--accent);
	border-color: var(--accent);
}
[aria-checked='true'] > .switch::after {
	transform: translateX(14px);
	background: var(--on-accent);
}

/* ---------- Navigation, Einstellungen, Listen ---------- */

/* Seitenleiste oder Abschnittsliste:
   <nav class="nav"><div class="nav-title">Persönlich</div><a href="…" aria-current="page"><svg…/>Profil</a>…</nav>
   Icon und Text sind gedämpft, nur der aktive Eintrag bekommt Textfarbe und Fläche. */
.nav {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}
.nav > a,
.nav > button {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 28px;
	padding: 0 10px;
	border: 0;
	border-radius: var(--r-sm);
	background: none;
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 500;
	text-align: left;
	white-space: nowrap;
}
.nav svg {
	width: 16px;
	height: 16px;
}
.nav > [aria-current],
.nav > [aria-pressed='true'] {
	background-color: var(--press);
	color: var(--text);
}
.nav .count {
	margin-left: auto;
	font-size: var(--fs-xs);
}
.nav-title {
	display: flex;
	align-items: center;
	height: 28px;
	padding: 0 10px;
	color: var(--muted);
	font-size: var(--fs-xs);
	font-weight: 500;
}
.nav-title:not(:first-child) {
	margin-top: 12px;
}
/* Einstellungen als Zeilen in einer Karte, der Abschnittstitel steht als <h3> darüber:
   <section class="card settings"><div class="setting"><div><b>Titel</b><span>Hinweis</span></div><select class="input">…</select></div>…</section>
   Für einen Schalter ist die ganze Zeile der Knopf:
   <button class="setting" role="switch" aria-checked="true"><div><b>Titel</b></div><span class="switch"></span></button> */
.card.settings {
	padding: 0 var(--pad);
}
.setting {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 60px;
	padding: 12px 0;
	border: 0;
	background: none;
	text-align: left;
}
.setting + .setting {
	border-top: 1px solid var(--line);
}
.setting > :first-child {
	flex: 1;
	min-width: 0;
}
.setting > :first-child > b {
	display: block;
	font-size: var(--fs-sm);
	font-weight: 500;
}
.setting > :first-child > span {
	display: block;
	margin-top: 3px;
	font-size: var(--fs-xs);
	color: var(--muted);
}
/* Liste aus Zeilen ohne Trennlinien, gruppiert unter Köpfen mit Anzahl:
   <div class="list"><div class="list-head"><span class="dot warn"></span>In Arbeit<span class="count">2</span></div>
   <a class="list-row" href="…"><span class="muted num">NIK-6</span><b>Titel</b><span class="tag">…</span><span class="sub">17. Juli</span></a></div>
   Der Titel in <b> nimmt den freien Platz, alles danach steht rechts. */
.list {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.list-head {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 12px;
	border-radius: var(--r-sm);
	background: var(--lift);
	font-size: var(--fs-sm);
	font-weight: 500;
}
.list-row {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 12px;
	border: 0;
	border-radius: var(--r-sm);
	background: none;
	color: var(--text);
	font-size: var(--fs-sm);
	text-align: left;
}
.list-row > b {
	flex: 1;
	min-width: 0;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
/* <label class="field">Name<input class="input"></label>
   Felder tragen Fläche und Linie: Ein leeres Feld ist sonst nicht als Feld zu erkennen. */
.field {
	display: grid;
	gap: 6px;
	font-size: var(--fs-sm);
	color: var(--muted);
}
.input {
	height: var(--control);
	padding: 0 10px;
	border-radius: var(--r-sm);
	border: 1px solid var(--line);
	background: var(--lift);
	color: var(--text);
	font-size: var(--fs-sm);
	min-width: 0;
}
textarea.input {
	height: auto;
	padding: 8px 10px;
	resize: vertical;
}
.input::placeholder {
	color: var(--muted);
}
.input[aria-invalid='true'] {
	border-color: var(--bad);
}
.field .error {
	color: var(--bad);
	font-size: var(--fs-xs);
}

/* ---------- Detailansicht ---------- */

/* <dialog class="modal"><div class="modal-head"><h2>Titel</h2><button class="btn">Schließen</button></div>…</dialog> */
dialog.modal {
	--lift: var(--raised);
	margin: auto;
	width: min(640px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	padding: 18px 22px;
	background: var(--card);
	color: var(--text);
	border: 1px solid var(--frame);
	border-radius: var(--r-lg);
	box-shadow: var(--float);
}
dialog.modal::backdrop {
	background: var(--scrim);
}
.modal-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--line);
}
.modal-head h2 {
	font-size: var(--fs-lg);
	font-weight: 500;
}
.modal-head .btn,
.modal-head .icon-btn {
	margin-left: auto;
}

/* Nur für Screenreader. */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition-duration: 0s !important;
		animation-duration: 0s !important;
	}
}
