/* Gemeinsame Farben für Anmeldung, Dashboard, Verwaltung und Portal. */

/* Grössen und Ecken (12.11.2026, verbindlich, siehe AGENTS.md «Grössen und Ecken»). Nie eigene Pixelwerte für Knöpfe, Felder und Ecken.
   Steuerelemente (Höhe = Breite bei runden Icon-Knöpfen):
   --pd-st    40px  Standard: Knöpfe, Eingabefelder, Auswahl, Suche, runde Icon-Knöpfe (Kopf, Plus, Suche), Reiter, Navigation
   --pd-st-k  32px  Klein: Aktionen in Listen, Zeilen und Feldern (Bearbeiten, Plus in der Seitenleiste, Feld leeren)
   Auf Touch-Geräten mindestens 44px: --pd-st und --pd-st-k werden dort 44px.
   Ecken: --pd-r-xs 8 (kleine Markierungen, Zeilen in Listen) · --pd-r-s 10 (Einträge, Reiter, Navigation, Werkzeuge)
   · --pd-r-k 14 (Felder, Kästen, Medien, Hinweise) · --pd-r 18 (Karten, Blätter, Dialoge, Seitenleiste) · --pd-r-g 22 (grosse Medienbühne)
   · --pd-r-rund 999px (Knöpfe mit Text, Chips, Marken, Suche) · 50% (runde Icon-Knöpfe). */
:root {
  --pd-st: 40px; --pd-st-k: 32px;
  --pd-r-xs: 8px; --pd-r-s: 10px; --pd-r-k: 14px; --pd-r: 18px; --pd-r-g: 22px; --pd-r-rund: 999px;
}
@media (pointer: coarse) { :root { --pd-st: 44px; --pd-st-k: 44px; } }

:root {
  /* Verbindliches Farbkonzept, vom Kunden am 10.11.2026 bestätigt. */
  --pd-brand-bg-1: #f5f7f6;
  --pd-brand-bg-2: #dae0d6;
  --pd-brand-bg-3: #373735;
  --pd-brand-accent-1: #899883;
  --pd-brand-accent-2: #e3e870;
  color-scheme: light;
  --pd-primary: var(--pd-brand-accent-1);
  --pd-primary-hover: #7e8d78;
  --pd-primary-text: #52624c;
  --pd-on-primary: #20201f;
  --pd-primary-soft: rgba(137, 152, 131, .14);
  --pd-primary-line: rgba(137, 152, 131, .5);
  --pd-bg: var(--pd-brand-bg-1);
  --pd-surface: #fff;
  --pd-field: #fbfcfb;
  --pd-hover: #eaeeeb;
  --pd-text: var(--pd-brand-bg-3);
  --pd-muted: #5f5f5d;
  --pd-faint: #5f645c;
  --pd-line: rgba(0, 0, 0, .14);
  --pd-soft: var(--pd-brand-bg-2);
  --pd-media-bg: #292928;
  --pd-ok: #286b32;
  --pd-ok-soft: rgba(47, 125, 58, .12);
  --pd-warn: #8a5d00;
  --pd-warn-soft: rgba(214, 158, 46, .16);
  --pd-error: #ba1a1a;
  --pd-error-soft: rgba(197, 48, 48, .11);
  --pd-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .05);
}
:root[data-thema="dunkel"] {
  color-scheme: dark;
  --pd-primary: var(--pd-brand-accent-2);
  --pd-primary-hover: #ecf08c;
  --pd-primary-text: var(--pd-brand-accent-2);
  --pd-primary-soft: rgba(227, 232, 112, .13);
  --pd-primary-line: rgba(227, 232, 112, .5);
  /* Neutrales Anthrazit: keine grün getönten Grund- oder Textflächen. */
  --pd-bg: var(--pd-brand-bg-3);
  --pd-surface: #41413f;
  --pd-field: #30302f;
  --pd-hover: #4a4a48;
  --pd-text: var(--pd-brand-bg-1);
  --pd-muted: #d0d0cc;
  --pd-faint: #bdbdb8;
  --pd-line: rgba(255, 255, 255, .18);
  --pd-soft: #3b3b39;
  --pd-ok: #ade39f;
  --pd-ok-soft: rgba(139, 209, 124, .14);
  --pd-warn: #ffd075;
  --pd-warn-soft: rgba(242, 180, 65, .14);
  --pd-error: #ffb7af;
  --pd-error-soft: rgba(255, 93, 79, .14);
  --pd-shadow: 0 0 0 1px rgba(255, 255, 255, .09), 0 4px 14px rgba(0, 0, 0, .24);
}
html { accent-color: var(--pd-primary); caret-color: var(--pd-primary-text); }
::selection { background: var(--pd-primary); color: var(--pd-on-primary); }
.pd-thema-knopf {
  display: inline-grid; place-items: center; flex: none; position: relative; overflow: hidden;
  width: var(--pd-st); height: var(--pd-st); padding: 0; margin: 0;
  border: 1px solid var(--pd-line); border-radius: 50%;
  background: var(--pd-surface); color: var(--pd-text);
  cursor: pointer; box-sizing: border-box;
}
.pd-thema-knopf:hover { background: var(--pd-primary-soft); border-color: var(--pd-primary-text); }
.pd-thema-knopf:focus-visible { outline: 2px solid var(--pd-primary-text); outline-offset: 3px; }
/* Umschalter hell/dunkel (12.11.2026): Sonne und Mond liegen übereinander und drehen sich ineinander. Der Knopf zeigt das Ziel:
   im Hellen den Mond, im Dunkeln die Sonne. Beim Umschalten deckt das neue Farbschema die Seite als Kreis vom Knopf aus auf (thema.js). */
.pd-thema-knopf, .thema-knopf { transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease; }
.pd-thema-knopf:active, .thema-knopf:active { transform: scale(.9); }
.pd-thema-knopf svg, .thema-knopf svg { grid-area: 1 / 1; width: 20px; height: 20px; transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease; }
.pd-thema-knopf .pd-sonne path, .thema-knopf .ic-sonne path { transform-origin: 12px 12px; transition: transform .6s cubic-bezier(.34, 1.56, .64, 1) .05s, opacity .3s ease .05s; }
/* versteckt: Sonne gedreht und klein, Strahlen eingezogen; Mond gekippt und klein */
.pd-thema-knopf .pd-sonne, :root[data-thema="hell"] .thema-knopf .ic-sonne { opacity: 0; transform: rotate(-120deg) scale(.4); }
.pd-thema-knopf .pd-sonne path, :root[data-thema="hell"] .thema-knopf .ic-sonne path { opacity: 0; transform: rotate(-45deg) scale(.5); }
:root[data-thema="dunkel"] .pd-thema-knopf .pd-mond, .thema-knopf .ic-mond { opacity: 0; transform: rotate(100deg) scale(.4) translateY(4px); }
/* sichtbar */
:root[data-thema="dunkel"] .pd-thema-knopf .pd-sonne, .thema-knopf .ic-sonne { opacity: 1; transform: none; }
:root[data-thema="dunkel"] .pd-thema-knopf .pd-sonne path, .thema-knopf .ic-sonne path { opacity: 1; transform: none; }
.pd-thema-knopf .pd-mond, :root[data-thema="hell"] .thema-knopf .ic-mond { opacity: 1; transform: none; }
/* Kreis-Aufdecken: die Browser-Überblendung ausschalten, den Kreis zeichnet thema.js. Nur während des Hell/Dunkel-Wechsels
   (Klasse pd-thema-wechsel), sonst gälte es auch für Seitenwechsel im Portal (v2/assets/uebergang.js, 13.11.2026) */
:root.pd-thema-wechsel::view-transition-old(root), :root.pd-thema-wechsel::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@media (prefers-reduced-motion: reduce) {
  .pd-thema-knopf, .thema-knopf, .pd-thema-knopf svg, .thema-knopf svg, .pd-thema-knopf svg path, .thema-knopf svg path { transition: none; }
}
#head_cellus > .pd-thema-knopf { margin-left: auto; }
#head_cellus > .pd-thema-knopf ~ .head_account,
#head_cellus > .pd-thema-knopf ~ .head_login_action { margin-left: 0; }
@media (max-width: 620px) { .kopf { gap: 5px; } }

.pd-logo-dunkel { display: none !important; }
:root[data-thema="dunkel"] .pd-logo-hell { display: none !important; }
:root[data-thema="dunkel"] .pd-logo-dunkel { display: block !important; }
