/* web-ui · Theme: einzige Quelle fuer Design-Tokens (Stil app-studio / ui-ux-studio: dunkle Ebenen,
   keine Farbverlaeufe, Bedienung nach Home Assistant). Uebernommen aus Draw Things.
   Eigene Farben: in der App nach diesem Theme :root { --primary: …; } setzen, keine Kopie dieser Datei.

   Geraeteklassen
     Desktop      >= 1280 px, Maus
     Tablet       768-1279 px (Touch-Werte bei pointer: coarse)
     Handy hoch   < 768 px breit
     Handy quer   < 500 px hoch und < 1024 px breit
   Touch-Skala: gilt bei pointer: coarse UND im Handy-Layout (auch im schmalen Fenster mit Maus).

   Regeln
   - Komponenten verwenden nur diese Tokens, keine festen px-Werte fuer Schrift, Abstand, Radius.
   - Abstaende im 4-px-Raster (2 und 6 und 10 nur fuer enge Innenabstaende).
   - Keine Farbverlaeufe, keine farbigen Schatten. */

@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url(fonts/dm-sans-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/space-grotesk-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); }

:root {
  /* ---- Schriften */
  --font-display:"Space Grotesk","Avenir Next",system-ui,sans-serif;   /* Titel, Ueberschriften */
  --font-body:"DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif;  /* alles andere */
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace; /* Dateien, Seeds, Werte */
  --lh:1.45; --lh-tight:1.3;

  /* ---- Schriftgroessen (Desktop) */
  --fs-micro:10px;   /* Kuerzel in 32-px-Feldern */
  --fs-2xs:11px;     /* Zaehler-Badges, Leisten-Beschriftung */
  --fs-xs:12px;      /* Meta, Bildunterschriften, Wert-Pills, Hinweise */
  --fs-sm:13px;      /* Feld-Labels, Chips, Knopfgruppen, kleine Knoepfe */
  --fs-base:14px;    /* Grundtext, Knoepfe, Kachel-Namen */
  --fs-md:15px;      /* Gruppenueberschriften (Display) */
  --fs-lg:16px;      /* Kopfleisten-Titel, Platzhalter-Titel */
  --fs-xl:18px;      /* Panel- und Dialogtitel (Display) */
  --fs-2xl:22px;     /* Anmeldung */
  --fs-input:14px;   /* Eingabefelder */

  /* ---- Abstaende (4-px-Raster) */
  --s-0-5:2px; --s-1:4px; --s-1-5:6px; --s-2:8px; --s-2-5:10px; --s-3:12px;
  --s-4:16px; --s-5:20px; --s-6:24px; --s-8:32px;

  /* ---- Radien */
  --r-sm:6px;        /* kleine Markierungen */
  --r:8px;           /* Eingabefelder, Vorschaubilder, Knopfgruppen */
  --r-md:12px;       /* Kacheln, Karten in Listen, Menue-Eintraege */
  --r-lg:16px;       /* Konto-/Verbindungskarten */
  --r-xl:20px;       /* Panels, Dialoge, Sheets, Menues */
  --r-pill:9999px;   /* alle Aktionen: Knoepfe, Chips, Tabs, Pills, Glasleisten */
  --r-round:50%;

  /* ---- Groessen */
  --tap:36px;        /* Bedienelemente (Touch: 44) */
  --ctl-sm:28px;     /* kleine Knoepfe mit Text (Touch: 36) */
  --ibtn-sm:30px;    /* kleine Symbol-Knoepfe (Touch: 44, wie --tap) */
  --pill-h:22px;     /* Status-Pills */
  --glass-h:30px;    /* Info-Pills auf der Vorschau */
  --row-h:48px;      /* Menue- und Listenzeilen (Handy quer: 42) */
  --chip-h:32px;     /* Filter-Chips, kleine Auswahlfelder (Touch: 40) */
  --icon:18px; --icon-sm:15px; --icon-lg:40px;
  --top-h:56px;      /* Kopfleiste (Handy quer: 48) */
  --left-w:400px;    /* Seitenpanel (Tablet 360, Tablet hoch 50 %) */
  --nav-h:0px; --rail-w:0px;
  --tile-min:112px;  /* Kacheln in Rastern */

  /* ---- Farben hell */
  --bg:#F8FAFC; --bg-raised:#FFFFFF; --surface:#FFFFFF; --surface-2:#F1F5F9; --surface-hover:#EEF2F7;
  --surface-glass:rgba(255,255,255,.88); --scene:#E9ECF1; --viewer-bg:#0B0B10; --code-bg:#FBFCFE;
  --border:#E2E8F0; --border-strong:#CBD5E1;
  --fg:#0F172A; --fg-muted:#475569; --fg-subtle:#64748B;
  --primary:#2563EB; --primary-hover:#1D4ED8; --primary-fg:#FFFFFF; --primary-text:#2563EB; --primary-tint:rgba(37,99,235,.10);
  --accent:#EA580C; --accent-tint:rgba(234,88,12,.10);
  --success:#16A34A; --success-tint:rgba(22,163,74,.10); --warning:#B45309; --warning-tint:rgba(217,119,6,.12);
  --danger:#DC2626; --danger-tint:rgba(220,38,38,.10); --star:#D97706;
  --warning-badge:#EAB308; --warning-badge-fg:#1A1A22;   /* gelber Zaehler, in beiden Themes gleich */
  --shadow-float:0 8px 24px rgba(15,23,42,.12);
  color-scheme:light;
}
/* dunkel (Standard der App); auch auf einzelne Bereiche anwendbar (Styleguide) */
:root[data-theme="dark"], [data-theme="dark"] {
  --bg:#0B0B10; --bg-raised:#121218; --surface:#1A1A22; --surface-2:#15151C; --surface-hover:#22222C;
  --surface-glass:rgba(18,18,24,.88); --scene:#0E0E13; --code-bg:#101016;
  --border:rgba(255,255,255,.10); --border-strong:rgba(255,255,255,.18);
  --fg:#F8FAFC; --fg-muted:#94A3B8; --fg-subtle:#64748B;
  --primary-hover:#3B82F6; --primary-text:#60A5FA; --primary-tint:rgba(37,99,235,.22);
  --accent:#F97316; --accent-tint:rgba(249,115,22,.18);
  --success:#22C55E; --success-tint:rgba(34,197,94,.16); --warning:#F59E0B; --warning-tint:rgba(245,158,11,.16);
  --danger:#EF4444; --danger-tint:rgba(239,68,68,.14); --star:#FBBF24;
  --shadow-float:0 8px 24px rgba(0,0,0,.45);
  color-scheme:dark;
}
[data-theme="light"] {
  --bg:#F8FAFC; --bg-raised:#FFFFFF; --surface:#FFFFFF; --surface-2:#F1F5F9; --surface-hover:#EEF2F7;
  --surface-glass:rgba(255,255,255,.88); --scene:#E9ECF1; --code-bg:#FBFCFE;
  --border:#E2E8F0; --border-strong:#CBD5E1;
  --fg:#0F172A; --fg-muted:#475569; --fg-subtle:#64748B;
  --primary-hover:#1D4ED8; --primary-text:#2563EB; --primary-tint:rgba(37,99,235,.10);
  --accent:#EA580C; --accent-tint:rgba(234,88,12,.10);
  --success:#16A34A; --success-tint:rgba(22,163,74,.10); --warning:#B45309; --warning-tint:rgba(217,119,6,.12);
  --danger:#DC2626; --danger-tint:rgba(220,38,38,.10); --star:#D97706;
  --shadow-float:0 8px 24px rgba(15,23,42,.12);
  color-scheme:light;
}

/* ---- Tablet */
@media (max-width:1279px) { :root { --left-w:360px; } }
@media (max-width:1023px) { :root { --left-w:50%; } }

/* ---- Touch-Skala (Touch-Geraete und Handy-Layout) */
@media (pointer:coarse), (max-width:767px), (max-height:499px) and (max-width:1023px) {
  :root {
    --tap:44px; --ctl-sm:36px; --ibtn-sm:44px; --chip-h:40px;
    --fs-2xs:11.5px; --fs-xs:13px; --fs-sm:14px; --fs-base:15px; --fs-md:16px; --fs-lg:17px; --fs-xl:19px;
    --fs-input:16px;   /* 16 px: kein Zoom beim Fokus auf iOS */
  }
}
/* ---- Handy hoch: Leiste unten */
@media (max-width:767px) and (min-height:500px) { :root { --nav-h:calc(64px + env(safe-area-inset-bottom)); } }
/* ---- Handy quer: Leiste links, flachere Kopfleiste */
@media (max-height:499px) and (max-width:1023px) { :root { --row-h:42px; --top-h:48px; --rail-w:calc(88px + env(safe-area-inset-left)); --nav-h:0px; } }
