components.css ausgelagert, Studio-Zuordnung und -Verweise entfernt

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 22:42:40 +01:00
parent 82e5dd5cea
commit de974a35d9
9 changed files with 210 additions and 351 deletions

View File

@ -16,7 +16,7 @@ The guide is meant to be the shared design foundation for all of the owner's app
- **Empfehlung**: marked recommendations for other products, not yet verified anywhere.
- **Offener Punkt**: explicitly unresolved issues, e.g. verification of finished views (sections 4 and 12). Light-theme `--accent` has only 2.51:1 on white, so text/links/primary buttons must use `--accent-strong`. Do not claim accessibility conformance or that any app already implements the guide.
- Color tokens (section 3) are the single source of truth for hex values, mirrored in `tokens.css` (dark = fallback, light via `prefers-color-scheme` and `data-theme`). Change both together. `theme.js` is the reference theme switcher that sets `data-theme`. Contrast ratios in section 4 are computed from the opaque token values, so recompute them if any color token changes.
- Styles (section 3, "Stile") only override accent tokens (`data-accent` in `tokens.css`); a new style needs the same contrast checks as Orange/Blue. The z-index, dialog, toast and sortable-list values originate from the owner's Studio app (`../Golden-Age-Wiki/studio/src/app.css`).
- `reference.html` renders every token and component from `tokens.css`/`theme.js`; update it when tokens or components change, and check it in dark/light and both styles (headless: `chromium --headless --screenshot --blink-settings=preferredColorScheme=0|1`).
- `demo/` is a small no-build example app ("Merkzettel") that consumes `../tokens.css` and `../theme.js`; it duplicates component CSS from `reference.html`, so keep them in sync (or extract a shared stylesheet).
- Styles (section 3, "Stile") only override accent tokens (`data-accent` in `tokens.css`); a new style needs the same contrast checks as Orange/Blue.
- `components.css` holds the component styles (guide section 8, no page layouts) and builds on `tokens.css`; change it together with the guide. `reference.html` renders every token and component from `tokens.css`/`components.css`/`theme.js`; update it when tokens or components change, and check it in dark/light and both styles (headless: `chromium --headless --screenshot --blink-settings=preferredColorScheme=0|1`).
- `demo/` is a small no-build example app ("Merkzettel") that consumes `../tokens.css` and `../theme.js`; its `app.css` contains only app-specific layout, components come from `../components.css`. The tooltip/dialog JS is still duplicated between `reference.html` and `demo/app.js`.
- Version and date are in the header line ("Version 2.4 · Stand: 16.11.2026"; the README status line repeats the version); update it when making substantive changes.

View File

@ -41,7 +41,7 @@ Ein Projekt bezieht sich auf den Guide, indem es:
3. Komponenten und Zustände nach Abschnitt 8 umsetzt,
4. Abweichungen mit ihrem Zweck im eigenen Projekt dokumentiert.
Zusätzlich liegen [`tokens.css`](tokens.css) und die Theme-Auswahl [`theme.js`](theme.js) bei. Unter [`demo/`](demo/index.html) liegt eine kleine Beispielanwendung („Merkzettel“, ohne Build, nur HTML, CSS und JavaScript), die den Guide praktisch anwendet. [`STUDIO-ZUORDNUNG.md`](STUDIO-ZUORDNUNG.md) ordnet die Tokens der App Studio denen des Guides zu und listet, was dafür im Guide noch fehlt. Die Seite [`reference.html`](reference.html) zeigt alle Tokens und Komponenten live, mit umschaltbarem Theme und Stil (lokal im Browser öffnen). Der vollständige Guide steht in [`STYLEGUIDE.md`](STYLEGUIDE.md). [`CLAUDE.md`](CLAUDE.md) enthält Hinweise für Claude Code zur Pflege des Dokuments.
Zusätzlich liegen [`tokens.css`](tokens.css), die Komponenten [`components.css`](components.css) und die Theme-Auswahl [`theme.js`](theme.js) bei. Unter [`demo/`](demo/index.html) liegt eine kleine Beispielanwendung („Merkzettel“, ohne Build, nur HTML, CSS und JavaScript), die den Guide praktisch anwendet. Die Seite [`reference.html`](reference.html) zeigt alle Tokens und Komponenten live, mit umschaltbarem Theme und Stil (lokal im Browser öffnen). Der vollständige Guide steht in [`STYLEGUIDE.md`](STYLEGUIDE.md). [`CLAUDE.md`](CLAUDE.md) enthält Hinweise für Claude Code zur Pflege des Dokuments.
## License

View File

@ -1,76 +0,0 @@
# Zuordnung: Studio → Styleguide
Stand: Version 1.8 des Guides. Grundlage ist `src/app.css` und die Verwendung von `var(--…)` und festen Farben in `src/` der App Studio (Golden-Age-Wiki). Die Anzahl in Klammern ist, wie oft Studio das Token verwendet. Dieses Dokument ist eine Arbeitsgrundlage für die Umstellung, keine Aussage, dass Studio den Guide schon erfüllt.
## 1. Farb-Tokens
| Studio | Anzahl | Guide | Hinweis |
| --- | ---: | --- | --- |
| `--bg` | 27 | `--bg` | Wert ändert sich (hell `#f6f4ef` → `#f6f3ef`, dunkel `#141821` → `#0f1115`). |
| `--panel` | 66 | `--surface` | Nur der Name ändert sich. |
| – | – | `--surface-2` | Studio hat keine zweite Flächenstufe; sekundäre Flächen sind dort meist `--bg` oder `color-mix`. Pro Stelle prüfen. |
| `--text` | 64 | `--text` | Wert ändert sich. |
| `--muted` | 238 | `--muted` | Wert ändert sich. Das Token ist stark verbreitet, ein Wertwechsel wirkt überall. |
| `--line` | 177 | `--border` **oder** `--border-field` | Studio nutzt `--line` für Trennlinien und für Eingabefelder und Buttons. Trennlinien → `--border`; Rahmen von Feldern und Bedienelementen → `--border-field` (3:1). |
| `--accent` | 138 | `--accent` **oder** `--accent-strong` | Studio nutzt einen Wert für alles. Im Guide: Text, Links, Fläche mit Text → `--accent-strong`; Markierungen, Balken, Rahmen ohne Text → `--accent`. Jede Stelle einzeln zuordnen. |
| `--accent-soft` | 48 | `--accent-soft` | Studio: ein fester Farbwert (`#f6ecd2` / `#3a3118`); Guide: halbtransparent. |
| `--on-accent` | 3 | `--accent-text` | Nur der Name ändert sich. |
| `--ok` | 40 | `--ok` | Wert ändert sich (hell `#1e7a46` → `#217346`, dunkel `#47cd89` → `#6fd18a`). |
| `--warn` | 61 | `--warn` | Hell `#b54708` → `#8a6100`, dunkel `#fdb022` → `#ffcf5c`. Studios Warnfarbe ist ein Orangebraun; im Guide ist sie gelblich. |
| `--danger` | 53 | `--danger` | Hell `#b42318` → `#c0392b`, dunkel `#f97066` → `#ff7b72`. |
| `--err` | 6 | `--danger` | In `LogPanel.svelte` lokal als Alias auf `--danger` definiert; entfällt. |
| `--dbg` | 2 | `--muted` | In `LogPanel.svelte` lokal als Alias auf `--muted` definiert; entfällt. |
| `--info` | 2 | `--info` | Nur in `LogPanel.svelte` definiert (`#1570ef` hell, `#6aa6ff` dunkel). Der Guide hat jetzt `--info` als Türkis (`#0b7285` / `#4fc3dc`); Blau von Studio ist damit abgelöst. |
| `--muted-2`, `--border-soft`, `--border` | je 1 | `--muted`, `--border`, `--border-field` | Diese Tokens sind in `app.css` nicht definiert; es greifen feste Rückfallwerte (`#b3bac2`, `#e2e8f0`, `#cbd5e1`). Auf definierte Tokens umstellen. |
## 2. Feste Farbwerte in Studio
| Fundstelle | Wert | Guide |
| --- | --- | --- |
| Status-Punkte (`App.svelte`, `SettingsPage.svelte`): ok / offline / Fehler | `#1e7a46` / `#e0a100` / `#d92d20` | `--ok` / `--warn` / `--danger` |
| Fehler-Badge, Bestätigungsrahmen, Fortschrittsbalken (`ChatPanel.svelte`) | `#d92d20`, `#1e7a46` | `--danger`, `--ok` |
| Weißer Text auf Badge | `#fff` | `--accent-text` (Akzent) bzw. `--on-ok`, `--on-warn`, `--on-danger` |
| Fähigkeits-Chips (`ConnectionFields.svelte`): Vision, Tools | `#6941c6` (violett), `#175cd3` (blau) | `--cat-1` (Violett), `--cat-2` (Blau) |
| Schatten | `rgba(0,0,0,.25)` bis `.35` | `--shadow`, `--shadow-dialog`, `--shadow-toast` |
## 3. Typografie, Form, Layout
| Bereich | Studio | Guide | Entscheidung |
| --- | --- | --- | --- |
| Grundschrift | `system-ui, -apple-system, "Segoe UI", sans-serif` | `Inter, "Segoe UI", system-ui, …` | `--font-sans` übernehmen. Ob Inter mitgeliefert wird, klärt Studio (Lizenz, Bereitstellung). |
| Grundgröße / Zeilenhöhe | 15 px / 1,55 | 15 px / 1,5 | Zeilenhöhe angleichen oder als Abweichung dokumentieren. |
| Monospace | `ui-monospace, Menlo, monospace` (teils mit `"JetBrains Mono"`) | `ui-monospace, "JetBrains Mono", Menlo, monospace` | `--font-mono` übernehmen. |
| Lesetext Editor und Vorschau | `"Source Serif 4", "Iowan Old Style", Georgia, serif`, Zeilenhöhe 1,75, Spalte 46 rem | `--font-serif`, `--line-height-reading`, `--reading-max` | Übernommen in den Guide (Abschnitt 5). |
| Radius | `--radius` = 8 px (69 Stellen), sonst 999 px, 10 px, 6 px, 4 px u. a. | 14 / 12 / 10 / 8 px, Pille 999 px | `--radius` je Stelle auf `--radius-field` (8), `--radius-button` (10) oder `--radius-card` (14) abbilden. Dialog und Toast (10 px) passen bereits. |
| Fokusring | 2 px `--accent`, Abstand 1 px, nur für `input`, `button`, `select`, `textarea`, `summary` | 2 px `--accent-strong`, Abstand 2 px, `:focus-visible` für alle | Globale Regel aus `tokens.css` übernehmen. |
| Breakpoints | 640, 700, 720, 760, 900, 1180 px | 40 rem (= 600 px) als Ausgangswert | Studio hat mehrere inhaltsabhängige Grenzen; das erlaubt der Guide. Keine Änderung nötig. |
| Ebenen | `--z-modal` 100, `--z-modal-2` 110, `--z-system` 300, `--z-toast` 400 | identisch (plus `--z-drag` 200) | Studio hat `--z-drag` als festen Wert 200 in `app.css`; auf Token umstellen. |
| Bewegung | `prefers-reduced-motion` an 5 Stellen | Empfehlung | bereits berücksichtigt. |
| Theme | nur `prefers-color-scheme` | zusätzlich `data-theme` und `theme.js` | Optional: Theme-Auswahl nachrüsten. |
## 4. Komponenten
| Studio | Guide |
| --- | --- |
| `Modal.svelte` (Dialog) | Abschnitt 8 „Dialog“; Studio ist die Quelle, es ist nur das Farbtoken `--panel` → `--surface` zu ändern. |
| Toast in `DialogHost.svelte` | Abschnitt 8 „Hinweis (Toast)“, gleiche Quelle. |
| Sortierliste (`dragsort.ts`, `.drop-above` …) | Abschnitt 8 „Sortierbare Listen“. Die Tastaturalternative ist in Studio nicht geprüft. |
| `button.primary` | Primärer Button: Fläche `--accent-strong`, Text `--accent-text`. |
| Chips, Badges, Status-Punkte | Statusanzeigen; Punkte brauchen neben der Farbe einen Text (Guide, Abschnitt 8). |
## 5. Für den Guide offen (aus Studio)
Erledigt in Version 1.8: Info-Farbe (`--info`), Text auf Zustandsfarben (`--on-ok`, `--on-warn`, `--on-danger`), Kategorienfarben (`--cat-1` bis `--cat-3`) und Lesetext-Stil.
Noch offen:
1. **Akzent von Studio:** Studio nutzt Gold. Der Guide kennt nur Orange (Standard) und Blau. Vor der Umstellung entscheiden, ob Studio Orange oder Blau übernimmt oder ob Gold als eigener Stil zurückkommt.
## 6. Reihenfolge der Umstellung
1. `tokens.css` einbinden; Studios `:root`-Block in `app.css` durch die Zuordnung aus Abschnitt 1 ersetzen (zuerst als Alias, damit nichts bricht: `--panel: var(--surface)` usw.).
2. Akzent-Stelle für Stelle auf `--accent` oder `--accent-strong` aufteilen (138 Stellen); dabei Kontrast in Hell und Dunkel prüfen.
3. `--line` aufteilen in `--border` und `--border-field`.
4. Feste Farbwerte aus Abschnitt 2 durch Tokens ersetzen.
5. Radien, Fokusring und Ebenen angleichen.
6. Aliase entfernen, `reference.html` mit Studio-Ansichten vergleichen.

View File

@ -204,7 +204,7 @@ Die gemeinsame Ausgangsbasis ist eine gut lesbare serifenlose Schrift. Gewichte
Die Schriftliste enthält Fallbacks. Eine Schrift wird durch ihre Nennung weder mitgeliefert noch heruntergeladen. Wenn ein exakt gleiches Schriftbild nötig ist, müssen Bereitstellung und Lizenz im jeweiligen Produkt geklärt sein.
**Lesetext (aus Studio):** Für Editor und Vorschau längerer Texte gilt `--font-serif` (`"Source Serif 4", "Iowan Old Style", Georgia, serif`), Zeilenhöhe `--line-height-reading` (1,75) und eine Spaltenbreite von höchstens `--reading-max` (46 rem), zentriert. Die Schrift wird wie Inter nicht mitgeliefert; Bereitstellung und Lizenz klärt das Produkt.
**Lesetext:** Für Editor und Vorschau längerer Texte gilt `--font-serif` (`"Source Serif 4", "Iowan Old Style", Georgia, serif`), Zeilenhöhe `--line-height-reading` (1,75) und eine Spaltenbreite von höchstens `--reading-max` (46 rem), zentriert. Die Schrift wird wie Inter nicht mitgeliefert; Bereitstellung und Lizenz klärt das Produkt.
**Empfehlung für Websites mit viel Text:** Längere Lesetexte erhalten eine eigene, großzügigere Textgröße und eine begrenzte Zeilenlänge. Die kompakten Werte einer Verwaltungsoberfläche werden nicht unverändert auf Artikel oder lange Informationsseiten übertragen. Konkrete Größen werden am jeweiligen Inhalt geprüft.
@ -302,7 +302,7 @@ Der Zustand ist nicht allein an der Farbe erkennbar: Die Checkbox zeigt einen Ha
### Ebenen, Dialoge und Hinweise
Überlagerungen verwenden feste Ebenen statt frei gewählter `z-index`-Werte (Ausgangswerte aus Studio):
Überlagerungen verwenden feste Ebenen statt frei gewählter `z-index`-Werte (Ausgangswerte):
| Token | Wert | Verwendung |
| --- | ---: | --- |
@ -317,7 +317,7 @@ Der Zustand ist nicht allein an der Farbe erkennbar: Die Checkbox zeigt einen Ha
#### Dialog
Ausgangsbasis aus Studio:
Ausgangsbasis:
| Eigenschaft | Wert |
| --- | --- |
@ -328,7 +328,7 @@ Ausgangsbasis aus Studio:
| Innenabstand / Abstand der Inhalte | 18 px / 22 px, 8 px |
| Schatten | `--shadow-dialog` (`0 20px 60px rgba(0,0,0,.35)`) |
Verhalten (in Studio umgesetzt):
Verhalten:
- Rolle `dialog` mit `aria-modal="true"` und einem Namen für Screenreader; eine dringende Abfrage (zum Beispiel Einwilligung) verwendet `alertdialog` auf der Ebene `--z-system`.
- Beim Öffnen springt der Fokus auf das gekennzeichnete Element, sonst auf das erste Eingabefeld, sonst auf den Dialog. Beim Schließen kehrt er zum auslösenden Element zurück.
@ -349,11 +349,11 @@ Verhalten (in Studio umgesetzt):
Rolle `status`. Der Hinweis nennt das Ergebnis und, wo vorhanden, den Ort (zum Beispiel den Dateipfad).
**Empfehlung:** Hinweise enthalten nichts, was nur dort steht. Fokusring und Kontrast gelten auch für die Schließen-Schaltfläche. Ob die Schatten und das `--backdrop` auf dem hellen Theme angepasst werden sollen, ist ungeprüft; Studio verwendet dieselben Werte in beiden Themes.
**Empfehlung:** Hinweise enthalten nichts, was nur dort steht. Fokusring und Kontrast gelten auch für die Schließen-Schaltfläche. Ob die Schatten und das `--backdrop` auf dem hellen Theme angepasst werden sollen, ist ungeprüft; die Ausgangswerte sind in beiden Themes dieselben.
### Sortierbare Listen
Studio verschiebt Einträge per Maus mit folgender Ausgangsbasis: Ein Griff links (Text `--muted`, beim Hover `--accent`, Cursor `grab`), ein Schatten am gezogenen Element (`0 8px 24px rgba(0,0,0,.3)`) und eine Einfügemarke als 3 px Linie in `--accent` über oder unter dem Ziel. Am Listenende markiert ein 2 px gestrichelter Rahmen in `--accent` den Bereich. Das gezogene Abbild hat `--surface`, einen Rahmen in `--accent`, 8 px Radius und höchstens 260 px Breite.
Einträge werden per Maus verschoben, Ausgangsbasis: Ein Griff links (Text `--muted`, beim Hover `--accent`, Cursor `grab`), ein Schatten am gezogenen Element (`0 8px 24px rgba(0,0,0,.3)`) und eine Einfügemarke als 3 px Linie in `--accent` über oder unter dem Ziel. Am Listenende markiert ein 2 px gestrichelter Rahmen in `--accent` den Bereich. Das gezogene Abbild hat `--surface`, einen Rahmen in `--accent`, 8 px Radius und höchstens 260 px Breite.
**Empfehlung:** Jede Verschiebung ist zusätzlich ohne Maus möglich, etwa über Tastatur oder Schaltflächen „Nach oben“ und „Nach unten“. Die Einfügemarke ist nicht allein durch Farbe erkennbar.
@ -388,9 +388,9 @@ Ein `<nav aria-label="Brotkrumen">` mit geordneter Liste. Zwischen den Einträge
### Tabs
Tabs wechseln zwischen gleichrangigen Ansichten desselben Bereichs. Ausgangsbasis aus Studio: eine Reihe mit 4 px Abstand und 1 px `--border` darunter. Jeder Tab hat 6 px / 12 px Innenabstand, keinen Rahmen und Text in `--muted`. Der aktive Tab hat Text in `--text`, Fettdruck und eine 2 px Linie darunter. Für diese Linie gilt `--accent-strong`, denn `--accent` erreicht im hellen Orange keine 3:1 (Studio verwendet dort `--accent`).
Tabs wechseln zwischen gleichrangigen Ansichten desselben Bereichs. Ausgangsbasis: eine Reihe mit 4 px Abstand und 1 px `--border` darunter. Jeder Tab hat 6 px / 12 px Innenabstand, keinen Rahmen und Text in `--muted`. Der aktive Tab hat Text in `--text`, Fettdruck und eine 2 px Linie darunter. Für diese Linie gilt `--accent-strong`, denn `--accent` erreicht im hellen Orange keine 3:1 (ein Wert für Text und Linie wäre dort zu schwach).
Verhalten (in Studio umgesetzt, Rollen nach WAI-ARIA):
Verhalten (Rollen nach WAI-ARIA):
- Der Container hat `role="tablist"` mit Namen, jeder Tab `role="tab"`, `aria-selected` und `aria-controls`, der Inhalt `role="tabpanel"` mit `aria-labelledby`.
- Nur der aktive Tab liegt in der Tab-Reihenfolge (`tabindex="0"`, die anderen `-1`).
@ -414,14 +414,14 @@ Ein Knopf öffnet eine Liste von Aktionen. Für die Auswahl eines Wertes in eine
| Trenner | 1 px `--border`, mit 3 px / 4 px Abstand |
| Läuft etwas aus dem Menü | Rahmen des Auslösers in `--accent-strong` |
Verhalten (in Studio umgesetzt):
Verhalten:
- Pfeil nach unten oder oben am Auslöser öffnet das Menü und setzt den Fokus auf den ersten aktiven Eintrag.
- Im offenen Menü bewegen Pfeil auf und ab sowie Pos1 und Ende den Fokus (am Rand umlaufend). Deaktivierte Einträge werden übersprungen.
- Escape schließt das Menü und gibt den Fokus an den Auslöser zurück. Tab und ein Klick daneben schließen es ebenfalls. Eine Auswahl löst die Aktion aus und schließt das Menü.
- Der Aufrufer kann beim Öffnen die Einträge neu berechnen, damit sie den aktuellen Stand zeigen.
**Empfehlung:** Der Fokusring bleibt auch an Menüeinträgen sichtbar; die Fläche `--accent-soft` allein reicht auf hellem Grund nicht als Fokusmarkierung. Hinweistexte sind mindestens 0,8 rem groß (Studio verwendet 0,72 rem). Ein Menü enthält Aktionen, keine Navigation.
**Empfehlung:** Der Fokusring bleibt auch an Menüeinträgen sichtbar; die Fläche `--accent-soft` allein reicht auf hellem Grund nicht als Fokusmarkierung. Hinweistexte sind mindestens 0,8 rem groß. Ein Menü enthält Aktionen, keine Navigation.
### Karten und Kennzahlen

184
components.css Normal file
View File

@ -0,0 +1,184 @@
/*
* Styleguide – Komponenten (Version 2.4)
* Setzt tokens.css voraus (zuerst einbinden). Enthält nur Komponenten aus STYLEGUIDE.md Abschnitt 8,
* keine Seitenlayouts. Projekte dürfen Teile kopieren oder überschreiben (Abweichungen dokumentieren).
* Einbindung: <link rel="stylesheet" href="tokens.css"> <link rel="stylesheet" href="components.css">
*/
/* ---------- Basis ---------- */
* { box-sizing: border-box; }
html { font-size: var(--font-size-base); }
body {
margin: 0; background: var(--bg); color: var(--text);
font: 1rem/var(--line-height-base) var(--font-sans);
background-image: radial-gradient(60rem 20rem at 50% -6rem, var(--bg-glow), transparent);
background-repeat: no-repeat;
}
a { color: var(--accent-strong); }
h1, h2, h3 { line-height: var(--line-height-heading); margin: 0; }
h1 { font-size: var(--font-size-page-title); }
h2 { font-size: var(--font-size-section-title); }
code { font-family: var(--font-mono); font-size: .9em; }
small, .small { font-size: var(--font-size-small); color: var(--muted); }
.info-text { color: var(--info); }
.reading { max-width: var(--reading-max); margin: 0 auto; font-family: var(--font-serif); line-height: var(--line-height-reading); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent-strong); color: var(--accent-text); padding: .5rem .8rem; z-index: var(--z-tooltip); }
.skip:focus { left: .5rem; top: .5rem; }
/* ---------- Kopfleiste, Umschalter ---------- */
.bar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--surface); border-bottom: 1px solid var(--border); }
.bar .in { max-width: var(--content-max); margin: 0 auto; padding: .6rem var(--content-gutter); display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between; }
.wordmark { font-size: var(--font-size-wordmark); font-weight: 700; letter-spacing: -.01em; }
.wordmark b { color: var(--accent-strong); }
.controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border-field); border-radius: var(--radius-pill); overflow: hidden; }
.seg button { font: inherit; font-size: var(--font-size-small); color: var(--text); background: transparent; border: 0; padding: .3rem .8rem; cursor: pointer; transition: background var(--transition); }
.seg button[aria-checked="true"] { background: var(--accent-strong); color: var(--accent-text); font-weight: 600; }
.seg button[aria-checked="true"]::before { content: "✓ "; }
/* ---------- Karten, Kennzahlen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad-y) var(--card-pad-x); box-shadow: var(--shadow); }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-metric); padding: .8rem 1rem; }
.metric .k { font-size: var(--font-size-small); color: var(--muted); }
.metric .v { font-size: var(--font-size-metric); line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
/* ---------- Buttons, Icons ---------- */
.btn { font: inherit; font-weight: 600; border-radius: var(--radius-button); padding: .45rem .9rem; cursor: pointer; border: 1px solid var(--border-field); background: var(--surface-2); color: var(--text); transition: border-color var(--transition), background var(--transition); display: inline-flex; align-items: center; gap: .45rem; }
.btn:hover { border-color: var(--accent-strong); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon { width: var(--icon-md); height: var(--icon-md); fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.3em; }
.icon.sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon.lg { width: var(--icon-lg); height: var(--icon-lg); }
.iconbtn { display: inline-grid; place-items: center; width: var(--icon-button); height: var(--icon-button); padding: 0; border: 1px solid var(--border-field); border-radius: var(--radius-button); background: var(--surface-2); color: var(--text); cursor: pointer; transition: border-color var(--transition), color var(--transition); }
.iconbtn:hover { border-color: var(--accent-strong); }
/* ---------- Formulare ---------- */
label { display: block; font-size: var(--font-size-small); font-weight: 600; margin-bottom: .25rem; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-field); border-radius: var(--radius-field); padding: .45rem .65rem; }
input.invalid { border-color: var(--danger); }
.help { font-size: var(--font-size-small); color: var(--muted); margin-top: .25rem; }
.err { color: var(--danger); font-size: var(--font-size-small); margin-top: .25rem; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: var(--font-size-small); font-weight: 600; padding: 0; margin-bottom: .25rem; }
/* ---------- Auswahlfelder: Checkbox, Radio, Schalter ---------- */
.choice { font-weight: 400; font-size: 1rem; margin-bottom: 0; display: inline-flex; align-items: center; gap: .55rem; min-height: var(--target-min); cursor: pointer; }
.choice input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer; width: var(--control-size); height: var(--control-size); background: var(--surface); border: 1.5px solid var(--border-field); transition: background var(--transition), border-color var(--transition); }
.choice input[type="checkbox"] { border-radius: 4px; }
.choice input[type="radio"] { border-radius: 50%; }
.choice input:checked, .choice input[type="checkbox"]:indeterminate { background: var(--accent-strong); border-color: var(--accent-strong); }
.choice input[type="checkbox"]:not([role="switch"]):checked::after { content: ""; position: absolute; left: 32%; top: 12%; width: 28%; height: 52%; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.choice input[type="checkbox"]:indeterminate::after { content: ""; position: absolute; left: 22%; right: 22%; top: calc(50% - 1px); height: 2px; background: var(--accent-text); }
.choice input[type="radio"]:checked::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; background: var(--accent-text); }
.choice input[role="switch"] { width: var(--switch-width); height: var(--switch-height); border-radius: var(--radius-pill); background: var(--surface-2); }
.choice input[role="switch"]::after { content: ""; position: absolute; top: 50%; left: 3px; width: calc(var(--switch-height) - 10px); height: calc(var(--switch-height) - 10px); border-radius: 50%; background: var(--muted); transform: translateY(-50%); transition: left var(--transition), background var(--transition); }
.choice input[role="switch"]:checked { background: var(--accent-strong); }
.choice input[role="switch"]:checked::after { left: calc(100% - (var(--switch-height) - 10px) - 3px); background: var(--accent-text); }
.choice input.invalid { border-color: var(--danger); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice input:disabled { cursor: not-allowed; }
/* ---------- Status: Meldung, Chip, Badge ---------- */
.msg { border: 1px solid var(--border); border-radius: var(--radius-button); padding: .5rem .8rem; background: var(--surface-2); margin-bottom: .5rem; }
.msg.ok { border-color: var(--ok); } .msg.ok strong { color: var(--ok); }
.msg.warn { border-color: var(--warn); } .msg.warn strong { color: var(--warn); }
.msg.err2 { border-color: var(--danger); } .msg.err2 strong { color: var(--danger); }
.msg.act { border-color: var(--accent-strong); background: var(--accent-soft); } .msg.act strong { color: var(--accent-strong); }
.chip { display: inline-block; border: 1px solid var(--border-field); border-radius: var(--radius-pill); padding: .1rem .7rem; font-size: var(--font-size-small); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-strong); color: var(--accent-strong); font-weight: 600; }
.chip.cat { background: color-mix(in srgb, var(--c) 10%, transparent); border-color: var(--c); color: var(--c); font-weight: 600; }
.badge { display: inline-block; border-radius: var(--radius-pill); padding: .1rem .7rem; font-size: var(--font-size-small); font-weight: 600; }
.badge.ok { background: var(--ok); color: var(--on-ok); }
.badge.warn { background: var(--warn); color: var(--on-warn); }
.badge.danger { background: var(--danger); color: var(--on-danger); }
.statusrow { display: flex; align-items: center; gap: .5rem; }
/* ---------- Tabelle, Fortschritt ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: var(--font-size-table-head); font-weight: 600; letter-spacing: .03em; color: var(--muted); text-transform: uppercase; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
progress { width: 100%; height: .6rem; accent-color: var(--accent-strong); }
/* ---------- Navigation ---------- */
.appbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-button); padding: .6rem var(--content-gutter); display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.nav-pill { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); overflow-x: auto; max-width: 100%; }
.nav-pill a, .side a { color: var(--muted); text-decoration: none; padding: .35rem .8rem; white-space: nowrap; }
.nav-pill a { border-radius: var(--radius-pill); }
.nav-pill a:hover, .side a:hover { color: var(--text); }
.nav-pill a[aria-current="page"], .side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; border: 1px solid var(--border); border-radius: var(--radius-button); overflow: hidden; margin-top: .8rem; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: .6rem; display: grid; gap: 2px; align-content: start; }
.side a { display: block; border-radius: var(--radius-field); }
.side h4 { margin: .6rem .8rem .2rem; font-size: var(--font-size-table-head); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.layout main, .layout .content { padding: 1rem; background: var(--bg); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .5rem; padding: 0; font-size: var(--font-size-small); }
.crumbs li + li::before { content: "/"; color: var(--muted); margin-right: .3rem; }
.crumbs [aria-current="page"] { color: var(--text); }
/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { font: inherit; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 12px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-strong); font-weight: 600; }
.panel { padding: .8rem 0 0; }
/* ---------- Aufklappmenü ---------- */
.menu { position: relative; display: inline-block; }
.menu > button.busy { border-color: var(--accent-strong); }
.menu .list { position: absolute; top: calc(100% + 4px); z-index: var(--z-dropdown); min-width: 15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-field); box-shadow: var(--shadow-menu); padding: 4px; display: grid; gap: 1px; }
.menu .list[hidden] { display: none; }
.menu .list.right { right: 0; } .menu .list.left { left: 0; }
.menu .list button { font: inherit; border: 0; background: none; color: var(--text); text-align: left; display: grid; gap: 1px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.menu .list button:hover:not(:disabled), .menu .list button:focus-visible { background: var(--accent-soft); }
.menu .list button:disabled { opacity: .55; cursor: default; }
.menu .list small { font-size: var(--font-size-small); }
.menu .list hr { border: 0; border-top: 1px solid var(--border); margin: 3px 4px; width: calc(100% - 8px); }
/* ---------- Dialog, Toast, Tooltip ---------- */
.backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--backdrop); display: grid; place-items: center; padding: 16px; }
.backdrop[hidden] { display: none; }
.dialog { position: relative; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-button); width: min(var(--dialog-width), 100%); max-height: 94vh; overflow-y: auto; padding: var(--dialog-pad); box-shadow: var(--shadow-dialog); display: grid; gap: var(--dialog-gap); }
.dialog:focus { outline: none; }
.dialog h3, .dialog p { margin: 0; }
.acts { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
/* Toast: Position bestimmt die Anwendung (z. B. position: fixed; bottom: 16px; z-index: var(--z-toast)) */
.toast { display: flex; gap: 10px; align-items: center; max-width: min(90vw, 760px); width: fit-content; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-button); padding: 8px 14px; box-shadow: var(--shadow-toast); font-size: .86rem; overflow-wrap: anywhere; }
.toast[hidden] { display: none; }
.toast button { border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; }
#tooltip { position: fixed; z-index: var(--z-tooltip); max-width: var(--tooltip-max); background: var(--text); color: var(--bg); font-size: var(--font-size-small); padding: .3rem .6rem; border-radius: 6px; overflow-wrap: anywhere; }
#tooltip[hidden] { display: none; }
/* ---------- Lade-, Leer- und Fehlerzustände ---------- */
.spinner { display: inline-block; width: var(--spinner-size); height: var(--spinner-size); border: 2px solid var(--border-field); border-top-color: var(--accent-strong); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.25em; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: grid; gap: .5rem; padding: .4rem 0; }
.skeleton i { display: block; height: .9rem; border-radius: var(--skeleton-radius); background: var(--surface-2); background-image: linear-gradient(90deg, transparent, var(--border), transparent); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton i:nth-child(2) { width: 85%; } .skeleton i:nth-child(3) { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.state { border: 1px dashed var(--border-field); border-radius: var(--radius-card); padding: 1.2rem; text-align: center; color: var(--muted); display: grid; gap: .6rem; justify-items: center; }
.state strong { color: var(--text); }
/* ---------- Sortierbare Liste, Chat ---------- */
ul.sort { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
ul.sort li { display: flex; gap: .5rem; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-field); padding: .4rem .6rem; }
ul.sort .grip { border: 0; background: none; color: var(--muted); cursor: grab; font-size: .9rem; padding: 0 4px; }
ul.sort .grip:hover { color: var(--accent-strong); }
ul.sort li.drop-above { box-shadow: 0 -3px 0 0 var(--accent); }
.bubble { max-width: 80%; padding: .5rem .8rem; border-radius: var(--radius-card); margin-bottom: .7rem; }
.bubble.me { margin-left: auto; background: var(--accent-soft); }
.bubble.bot { background: var(--surface-2); }
/* ---------- Responsiv, Bewegung ---------- */
@media (max-width: 40rem) {
h1 { font-size: var(--font-size-page-title-compact); }
.card { padding: var(--card-pad-y) 1rem; }
.layout { grid-template-columns: 1fr; }
.side { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) {
* { transition: none !important; }
.spinner, .skeleton i { animation: none; }
}

View File

@ -1,64 +1,17 @@
/* Demo-Anwendung: nutzt ausschließlich Tokens aus ../tokens.css */
* { box-sizing: border-box; }
html { font-size: var(--font-size-base); }
body {
margin: 0; background: var(--bg); color: var(--text); font: 1rem/var(--line-height-base) var(--font-sans);
background-image: radial-gradient(60rem 20rem at 50% -6rem, var(--bg-glow), transparent); background-repeat: no-repeat;
}
h1, h2, h3 { line-height: var(--line-height-heading); margin: 0; }
h1 { font-size: var(--font-size-page-title); }
h2 { font-size: var(--font-size-section-title); }
small, .small { font-size: var(--font-size-small); color: var(--muted); }
a { color: var(--accent-strong); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent-strong); color: var(--accent-text); padding: .5rem .8rem; z-index: var(--z-tooltip); }
.skip:focus { left: .5rem; top: .5rem; }
.bar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--surface); border-bottom: 1px solid var(--border); }
.bar .in { max-width: var(--content-max); margin: 0 auto; padding: .6rem var(--content-gutter); display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between; }
.wordmark { font-size: var(--font-size-wordmark); font-weight: 700; letter-spacing: -.01em; }
.wordmark b { color: var(--accent-strong); }
.controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border-field); border-radius: var(--radius-pill); overflow: hidden; }
.seg button { font: inherit; font-size: var(--font-size-small); color: var(--text); background: transparent; border: 0; padding: .3rem .8rem; cursor: pointer; transition: background var(--transition); }
.seg button[aria-checked="true"] { background: var(--accent-strong); color: var(--accent-text); font-weight: 600; }
.seg button[aria-checked="true"]::before { content: "✓ "; }
/* Demo-Anwendung: Komponenten kommen aus ../components.css, hier nur anwendungsspezifisches Layout */
.wrap { max-width: 44rem; margin: 0 auto; padding: 1.2rem var(--content-gutter) 2rem; display: grid; gap: var(--card-gap); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad-y) var(--card-pad-x); box-shadow: var(--shadow); }
.card h2 { margin-bottom: .8rem; }
label { display: block; font-size: var(--font-size-small); font-weight: 600; margin-bottom: .25rem; }
input[type="text"], input:not([type]), select { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-field); border-radius: var(--radius-field); padding: .45rem .65rem; }
input.invalid { border-color: var(--danger); }
.help { font-size: var(--font-size-small); color: var(--muted); margin-top: .25rem; }
.err { color: var(--danger); font-size: var(--font-size-small); margin-top: .25rem; }
.addform { display: grid; gap: .8rem; grid-template-columns: 1fr auto auto; align-items: start; }
.addform .btn { margin-top: 1.4rem; }
.btn { font: inherit; font-weight: 600; border-radius: var(--radius-button); padding: .45rem .9rem; cursor: pointer; border: 1px solid var(--border-field); background: var(--surface-2); color: var(--text); transition: border-color var(--transition), background var(--transition); display: inline-flex; align-items: center; gap: .45rem; }
.btn:hover { border-color: var(--accent-strong); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.icon { width: var(--icon-md); height: var(--icon-md); fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.iconbtn { display: inline-grid; place-items: center; width: var(--icon-button); height: var(--icon-button); padding: 0; border: 1px solid transparent; border-radius: var(--radius-button); background: transparent; color: var(--muted); cursor: pointer; transition: border-color var(--transition), color var(--transition); }
.iconbtn:hover { border-color: var(--danger); color: var(--danger); }
.choice { font-weight: 400; font-size: 1rem; margin-bottom: 0; display: inline-flex; align-items: center; gap: .55rem; min-height: var(--target-min); cursor: pointer; }
.choice input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer; width: var(--control-size); height: var(--control-size); background: var(--surface); border: 1.5px solid var(--border-field); transition: background var(--transition), border-color var(--transition); }
.choice input[type="checkbox"] { border-radius: 4px; }
.choice input:checked { background: var(--accent-strong); border-color: var(--accent-strong); }
.choice input[type="checkbox"]:not([role="switch"]):checked::after { content: ""; position: absolute; left: 32%; top: 12%; width: 28%; height: 52%; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.choice input[role="switch"] { width: var(--switch-width); height: var(--switch-height); border-radius: var(--radius-pill); background: var(--surface-2); }
.choice input[role="switch"]::after { content: ""; position: absolute; top: 50%; left: 3px; width: calc(var(--switch-height) - 10px); height: calc(var(--switch-height) - 10px); border-radius: 50%; background: var(--muted); transform: translateY(-50%); transition: left var(--transition), background var(--transition); }
.choice input[role="switch"]:checked::after { left: calc(100% - (var(--switch-height) - 10px) - 3px); background: var(--accent-text); }
/* Löschen-Button in der Liste: zurückhaltend, Gefahrenfarbe erst beim Hover */
ul.tasks .iconbtn { border-color: transparent; background: transparent; color: var(--muted); }
ul.tasks .iconbtn:hover { border-color: var(--danger); color: var(--danger); }
.listhead { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.listhead h2 { margin: 0; }
.listtools { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { font: inherit; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 12px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-strong); font-weight: 600; }
.count { font-size: var(--font-size-small); font-variant-numeric: tabular-nums; }
#panel { padding-top: .6rem; min-height: 8rem; }
@ -72,43 +25,12 @@ ul.tasks li.done .label { color: var(--muted); text-decoration: line-through; }
.prio.high { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.prio.low { color: var(--muted); }
.state { border: 1px dashed var(--border-field); border-radius: var(--radius-card); padding: 1.2rem; text-align: center; color: var(--muted); display: grid; gap: .4rem; justify-items: center; }
.state strong { color: var(--text); }
.skeleton { display: grid; gap: .6rem; padding: .4rem 0; }
.skeleton i { display: block; height: 1rem; border-radius: var(--skeleton-radius); background: var(--surface-2); background-image: linear-gradient(90deg, transparent, var(--border), transparent); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton i:nth-child(2) { width: 80%; } .skeleton i:nth-child(3) { width: 55%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton i { animation: none; } * { transition: none !important; } }
.summary { display: grid; gap: .4rem; margin-top: .8rem; font-size: var(--font-size-small); color: var(--muted); }
progress { width: 100%; height: .6rem; accent-color: var(--accent-strong); }
.menu { position: relative; display: inline-block; }
.menu .list { position: absolute; top: calc(100% + 4px); z-index: var(--z-dropdown); min-width: 15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-field); box-shadow: var(--shadow-menu); padding: 4px; display: grid; gap: 1px; }
.menu .list.right { right: 0; }
.menu .list[hidden] { display: none; }
.menu .list button { font: inherit; border: 0; background: none; color: var(--text); text-align: left; display: grid; gap: 1px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.menu .list button:hover:not(:disabled), .menu .list button:focus-visible { background: var(--accent-soft); }
.menu .list small { font-size: var(--font-size-small); }
.menu .list hr { border: 0; border-top: 1px solid var(--border); margin: 3px 4px; width: calc(100% - 8px); }
.backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--backdrop); display: grid; place-items: center; padding: 16px; }
.backdrop[hidden] { display: none; }
.dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-button); width: min(var(--dialog-width), 100%); max-height: 94vh; overflow-y: auto; padding: var(--dialog-pad); box-shadow: var(--shadow-dialog); display: grid; gap: var(--dialog-gap); }
.dialog:focus { outline: none; }
.dialog p { margin: 0; }
.acts { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; gap: 10px; align-items: center; max-width: min(90vw, 760px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-button); padding: 8px 14px; box-shadow: var(--shadow-toast); font-size: .86rem; overflow-wrap: anywhere; }
.toast[hidden] { display: none; }
.toast button { border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; }
#tooltip { position: fixed; z-index: var(--z-tooltip); max-width: var(--tooltip-max); background: var(--text); color: var(--bg); font-size: var(--font-size-small); padding: .3rem .6rem; border-radius: 6px; overflow-wrap: anywhere; }
#tooltip[hidden] { display: none; }
/* Toast unten mittig, über allen anderen Ebenen */
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); }
@media (max-width: 40rem) {
h1 { font-size: var(--font-size-page-title-compact); }
.card { padding: var(--card-pad-y) 1rem; }
.addform { grid-template-columns: 1fr; }
.addform .btn { margin-top: 0; justify-self: start; }
}

View File

@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Merkzettel – Demo zum Styleguide</title>
<link rel="stylesheet" href="../tokens.css">
<link rel="stylesheet" href="../components.css">
<link rel="stylesheet" href="app.css">
<script src="../theme.js"></script>
</head>

View File

@ -5,196 +5,24 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Styleguide – Referenz</title>
<link rel="stylesheet" href="tokens.css">
<link rel="stylesheet" href="components.css">
<script src="theme.js"></script>
<style>
* { box-sizing: border-box; }
html { font-size: var(--font-size-base); }
body {
margin: 0; background: var(--bg); color: var(--text);
font: 1rem/var(--line-height-base) var(--font-sans);
background-image: radial-gradient(60rem 20rem at 50% -6rem, var(--bg-glow), transparent);
background-repeat: no-repeat;
}
a { color: var(--accent-strong); }
h1, h2, h3 { line-height: var(--line-height-heading); margin: 0; }
h1 { font-size: var(--font-size-page-title); }
h2 { font-size: var(--font-size-section-title); margin-bottom: .8rem; }
h2 { margin-bottom: .8rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
code { font-family: var(--font-mono); font-size: .9em; }
small, .small { font-size: var(--font-size-small); color: var(--muted); }
.wrap { max-width: var(--content-max); margin: 0 auto; padding: 1.2rem var(--content-gutter) 2rem; }
header.bar {
position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border);
}
header.bar .in {
max-width: var(--content-max); margin: 0 auto; padding: .6rem var(--content-gutter);
display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between;
}
.wordmark { font-size: var(--font-size-wordmark); font-weight: 700; letter-spacing: -.01em; }
.wordmark b { color: var(--accent-strong); }
.controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border-field); border-radius: var(--radius-pill); overflow: hidden; }
.seg button {
font: inherit; font-size: var(--font-size-small); color: var(--text); background: transparent; border: 0;
padding: .3rem .8rem; cursor: pointer; transition: background var(--transition);
}
.seg button[aria-checked="true"] { background: var(--accent-strong); color: var(--accent-text); font-weight: 600; }
.seg button[aria-checked="true"]::before { content: "✓ "; }
section { margin-top: 1.1rem; }
.card {
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
padding: var(--card-pad-y) var(--card-pad-x); box-shadow: var(--shadow);
}
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius-metric); overflow: hidden; background: var(--surface); }
.swatch i { display: block; height: 2.6rem; border-bottom: 1px solid var(--border); }
.swatch span { display: block; padding: .4rem .6rem; font-size: var(--font-size-small); }
.swatch code { display: block; color: var(--muted); }
button.btn {
font: inherit; font-weight: 600; border-radius: var(--radius-button); padding: .45rem .9rem; cursor: pointer;
border: 1px solid var(--border-field); background: var(--surface-2); color: var(--text);
transition: border-color var(--transition), background var(--transition);
}
button.btn:hover { border-color: var(--accent-strong); }
button.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
button.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: var(--font-size-small); font-weight: 600; margin-bottom: .25rem; }
input, select, textarea {
width: 100%; font: inherit; color: var(--text); background: var(--surface);
border: 1px solid var(--border-field); border-radius: var(--radius-field); padding: .45rem .65rem;
}
.formgrid { display: grid; gap: 1rem .8rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.help { font-size: var(--font-size-small); color: var(--muted); margin-top: .25rem; }
.err { color: var(--danger); font-size: var(--font-size-small); margin-top: .25rem; }
input.invalid { border-color: var(--danger); }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-metric); padding: .8rem 1rem; }
.metric .k { font-size: var(--font-size-small); color: var(--muted); }
.metric .v { font-size: var(--font-size-metric); line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.msg { border: 1px solid var(--border); border-radius: var(--radius-button); padding: .5rem .8rem; background: var(--surface-2); margin-bottom: .5rem; }
.msg.ok { border-color: var(--ok); } .msg.ok strong { color: var(--ok); }
.msg.warn { border-color: var(--warn); } .msg.warn strong { color: var(--warn); }
.msg.err2 { border-color: var(--danger); } .msg.err2 strong { color: var(--danger); }
.msg.act { border-color: var(--accent-strong); background: var(--accent-soft); } .msg.act strong { color: var(--accent-strong); }
.chip { display: inline-block; border: 1px solid var(--border-field); border-radius: var(--radius-pill); padding: .1rem .7rem; font-size: var(--font-size-small); }
.badge { display: inline-block; border-radius: var(--radius-pill); padding: .1rem .7rem; font-size: var(--font-size-small); font-weight: 600; }
.badge.ok { background: var(--ok); color: var(--on-ok); }
.badge.warn { background: var(--warn); color: var(--on-warn); }
.badge.danger { background: var(--danger); color: var(--on-danger); }
.chip.cat { background: color-mix(in srgb, var(--c) 10%, transparent); border-color: var(--c); color: var(--c); font-weight: 600; }
.info-text { color: var(--info); }
.reading { max-width: var(--reading-max); margin: 0 auto; font-family: var(--font-serif); line-height: var(--line-height-reading); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-strong); color: var(--accent-strong); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: var(--font-size-table-head); font-weight: 600; letter-spacing: .03em; color: var(--muted); text-transform: uppercase; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
progress { width: 100%; height: .6rem; accent-color: var(--accent-strong); }
.choice { font-weight: 400; font-size: 1rem; margin-bottom: 0; display: inline-flex; align-items: center; gap: .55rem; min-height: var(--target-min); cursor: pointer; }
.choice input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
width: var(--control-size); height: var(--control-size); background: var(--surface); border: 1.5px solid var(--border-field); transition: background var(--transition), border-color var(--transition); }
.choice input[type="checkbox"] { border-radius: 4px; }
.choice input[type="radio"] { border-radius: 50%; }
.choice input:checked, .choice input[type="checkbox"]:indeterminate { background: var(--accent-strong); border-color: var(--accent-strong); }
.choice input[type="checkbox"]:not([role="switch"]):checked::after { content: ""; position: absolute; left: 32%; top: 12%; width: 28%; height: 52%; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.choice input[type="checkbox"]:indeterminate::after { content: ""; position: absolute; left: 22%; right: 22%; top: calc(50% - 1px); height: 2px; background: var(--accent-text); }
.choice input[type="radio"]:checked::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; background: var(--accent-text); }
.choice input[role="switch"] { width: var(--switch-width); height: var(--switch-height); border-radius: var(--radius-pill); background: var(--surface-2); }
.choice input[role="switch"]::after { content: ""; position: absolute; top: 50%; left: 3px; width: calc(var(--switch-height) - 10px); height: calc(var(--switch-height) - 10px); border-radius: 50%; background: var(--muted); transform: translateY(-50%); transition: left var(--transition), background var(--transition); }
.choice input[role="switch"]:checked { background: var(--accent-strong); }
.choice input[role="switch"]:checked::after { left: calc(100% - (var(--switch-height) - 10px) - 3px); background: var(--accent-text); }
.choice input.invalid { border-color: var(--danger); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice input:disabled { cursor: not-allowed; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: var(--font-size-small); font-weight: 600; padding: 0; margin-bottom: .25rem; }
.appbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-button); padding: .6rem var(--content-gutter); display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.nav-pill { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); overflow-x: auto; max-width: 100%; }
.nav-pill a, .side a { color: var(--muted); text-decoration: none; padding: .35rem .8rem; white-space: nowrap; }
.nav-pill a { border-radius: var(--radius-pill); }
.nav-pill a:hover, .side a:hover { color: var(--text); }
.nav-pill a[aria-current="page"], .side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; border: 1px solid var(--border); border-radius: var(--radius-button); overflow: hidden; margin-top: .8rem; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: .6rem; display: grid; gap: 2px; align-content: start; }
.side a { display: block; border-radius: var(--radius-field); }
.side h4 { margin: .6rem .8rem .2rem; font-size: var(--font-size-table-head); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.layout main, .layout .content { padding: 1rem; background: var(--bg); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .5rem; padding: 0; font-size: var(--font-size-small); }
.crumbs li + li::before { content: "/"; color: var(--muted); margin-right: .3rem; }
.crumbs [aria-current="page"] { color: var(--text); }
@media (max-width: 40rem) { .layout { grid-template-columns: 1fr; } .side { border-right: 0; border-bottom: 1px solid var(--border); } }
.spinner { display: inline-block; width: var(--spinner-size); height: var(--spinner-size); border: 2px solid var(--border-field); border-top-color: var(--accent-strong); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.25em; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: grid; gap: .5rem; }
.skeleton i { display: block; height: .9rem; border-radius: var(--skeleton-radius); background: var(--surface-2); background-image: linear-gradient(90deg, transparent, var(--border), transparent); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton i:nth-child(2) { width: 85%; } .skeleton i:nth-child(3) { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .spinner, .skeleton i { animation: none; } }
.state { border: 1px dashed var(--border-field); border-radius: var(--radius-card); padding: 1.2rem; text-align: center; color: var(--muted); display: grid; gap: .6rem; justify-items: center; }
.state strong { color: var(--text); }
.icon { width: var(--icon-md); height: var(--icon-md); fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.3em; }
.icon.sm { width: var(--icon-sm); height: var(--icon-sm); } .icon.lg { width: var(--icon-lg); height: var(--icon-lg); }
.iconbtn { display: inline-grid; place-items: center; width: var(--icon-button); height: var(--icon-button); padding: 0; border: 1px solid var(--border-field); border-radius: var(--radius-button); background: var(--surface-2); color: var(--text); cursor: pointer; transition: border-color var(--transition); }
.iconbtn:hover { border-color: var(--accent-strong); }
.btn .icon { margin-right: .45rem; }
.statusrow { display: flex; align-items: center; gap: .5rem; }
#tooltip { position: fixed; z-index: var(--z-tooltip); max-width: var(--tooltip-max); background: var(--text); color: var(--bg); font-size: var(--font-size-small); padding: .3rem .6rem; border-radius: 6px; overflow-wrap: anywhere; }
#tooltip[hidden] { display: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { font: inherit; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 12px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-strong); font-weight: 600; }
.panel { padding: .8rem 0 0; }
.menu { position: relative; display: inline-block; }
.menu > button.busy { border-color: var(--accent-strong); }
.menu .list { position: absolute; top: calc(100% + 4px); z-index: var(--z-dropdown); min-width: 15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-field); box-shadow: var(--shadow-menu); padding: 4px; display: grid; gap: 1px; }
.menu .list.right { right: 0; } .menu .list.left { left: 0; }
.menu .list button { font: inherit; border: 0; background: none; color: var(--text); text-align: left; display: grid; gap: 1px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.menu .list button:hover:not(:disabled), .menu .list button:focus-visible { background: var(--accent-soft); }
.menu .list button:disabled { opacity: .55; cursor: default; }
.menu .list small { font-size: var(--font-size-small); }
.menu .list hr { border: 0; border-top: 1px solid var(--border); margin: 3px 4px; width: calc(100% - 8px); }
.stage { position: relative; min-height: 15rem; background: var(--bg); border: 1px dashed var(--border-field); border-radius: var(--radius-card); overflow: hidden; display: grid; place-items: center; padding: 1rem; }
.stage .backdrop { position: absolute; inset: 0; background: var(--backdrop); display: grid; place-items: center; padding: 16px; }
.dialog {
position: relative; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-button);
width: min(var(--dialog-width), 100%); padding: var(--dialog-pad); box-shadow: var(--shadow-dialog); display: grid; gap: var(--dialog-gap);
}
.dialog h3 { margin: 0; }
.acts { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.toast {
display: flex; gap: 10px; align-items: center; max-width: min(90vw, 760px); background: var(--surface); color: var(--text);
border: 1px solid var(--border); border-radius: var(--radius-button); padding: 8px 14px; box-shadow: var(--shadow-toast);
font-size: .86rem; overflow-wrap: anywhere; width: fit-content;
}
.toast button { border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; }
ul.sort { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
ul.sort li { display: flex; gap: .5rem; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-field); padding: .4rem .6rem; }
ul.sort .grip { border: 0; background: none; color: var(--muted); cursor: grab; font-size: .9rem; padding: 0 4px; }
ul.sort .grip:hover { color: var(--accent-strong); }
ul.sort li.drop-above { box-shadow: 0 -3px 0 0 var(--accent); }
.bubble { max-width: 80%; padding: .5rem .8rem; border-radius: var(--radius-card); margin-bottom: .7rem; }
.bubble.me { margin-left: auto; background: var(--accent-soft); }
.bubble.bot { background: var(--surface-2); }
.stage .backdrop { position: absolute; z-index: auto; }
.tt { font-family: var(--font-mono); }
@media (max-width: 40rem) { h1 { font-size: var(--font-size-page-title-compact); } .wrap { padding-bottom: 1rem; } .card { padding: var(--card-pad-y) 1rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 40rem) { .wrap { padding-bottom: 1rem; } }
</style>
</head>
<body>

View File

@ -128,7 +128,7 @@
--login-max: 28rem;
--sidebar-width: 15rem;
/* Ebenen (aus Studio übernommen) */
/* Ebenen */
--z-drag: 200;
--z-sticky: 10;
--z-dropdown: 40;