/*
  Lokani – Grundlage: Reset und Grundwerte, die bis 0.53 Tabler (Bootstrap-Reboot) lieferte – Schrift, Überschriften,
  Absätze, Listen, Links, Linie, Bilder, Tabellen und Formular-Grundwerte, Fokus-Rahmen, Scrollbalken,
  color-scheme je data-theme (Browser-eigene Teile: Felder, Datumswahl, Autofill, Scrollbalken) und Druck.
  Werte aus den berechneten Stilen von 0.53.0 übernommen.
*/

/* ---------- Hell / Dunkel: light-dark() in tokens.css folgt color-scheme ---------- */
:root, [data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

*, ::before, ::after { box-sizing: border-box; }
:root { height: 100%; }
@media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth; } }

body {
  position: relative; height: 100%; min-height: 100%; margin: 0; padding: 0;
  font-family: var(--schrift); font-size: .875rem; font-weight: 400; line-height: 1.4285714286; letter-spacing: 0;
  color: var(--text); text-align: start; background-color: var(--grund);
  font-feature-settings: "liga" 0, "cv03", "cv04", "cv11";
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* ---------- Text ---------- */
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: .5rem; font-weight: 600; line-height: 1.2; color: var(--text-titel); }
[data-theme="dark"] :is(h1, h2, h3, h4, h5, h6) { color: inherit; }
h1 { font-size: 1.5rem; line-height: 2rem; }
h2 { font-size: 1.25rem; line-height: 1.75rem; }
h3 { font-size: 1rem; line-height: 1.5rem; }
h4 { font-size: .875rem; line-height: 1.25rem; }
h5 { font-size: .75rem; line-height: 1rem; }
h6 { font-size: .625rem; line-height: 1rem; }
:is(h1, h2, h3, h4, h5, h6) a, :is(h1, h2, h3, h4, h5, h6) a:hover { color: inherit; }

p { margin-top: 0; margin-bottom: 1rem; }
address { margin-bottom: 1rem; font-style: normal; line-height: inherit; }
ol, ul { padding-inline-start: 1.5rem; }
dl, ol, ul { margin-top: 0; margin-bottom: 1rem; }
ol ol, ol ul, ul ol, ul ul { margin-bottom: 0; }
dt { font-weight: 600; }
dd { margin-bottom: .5rem; margin-inline-start: 0; }
dl dd:last-child { margin-bottom: 0; }
blockquote { margin: 0 0 1rem; padding: 1rem; border-inline-start: 2px solid var(--linie); }
blockquote p { margin-bottom: 1rem; }
blockquote p:last-child { margin-bottom: 0; }
blockquote cite { display: block; text-align: end; }
blockquote cite::before { content: "— "; }
b, strong { font-weight: 600; }  /* Tabler: .strong, b, strong { semibold } (überstimmte bolder aus dem Reboot); bis Task 8 stand hier bolder = 700 */
small { font-size: .875em; }
mark { padding: .1875em; color: light-dark(oklch(26.86% 0 0deg), oklch(92.19% 0 0deg));
  background-color: light-dark(rgb(255, 237, 216), oklab(0.334745 0.00640106 0.0654617)); }
sub, sup { position: relative; font-size: .75em; line-height: 0; vertical-align: baseline; }
sub { bottom: -.25em; }
sup { top: -.5em; }
abbr, abbr[title] { text-decoration: underline dotted; cursor: help; text-decoration-skip-ink: none; }
::selection { background-color: light-dark(color-mix(in oklab, var(--primaer) 10%, transparent), color-mix(in oklab, var(--primaer) 40%, transparent)); }

/* ---------- Links ---------- */
a { color: var(--primaer-text); text-decoration: none; text-decoration-skip-ink: auto; }
a:hover { color: var(--primaer-text-hover); text-decoration: underline; }
a:hover:has(.icon) { text-decoration: none; }
a:not([href]):not([class]), a:not([href]):not([class]):hover { color: inherit; text-decoration: none; }

/* ---------- Code und Tasten ---------- */
code, kbd, pre, samp { font-family: var(--schrift-mono); font-size: 1em; }
code { padding: 2px 4px; font-size: .85714285em; color: var(--text-leise); word-wrap: break-word;
  background: var(--flaeche-zart); border-radius: var(--radius); }
pre { display: block; margin-top: 0; margin-bottom: 1rem; overflow: auto; padding: 1rem; font-size: .92857143em;
  line-height: 1.4285714286; color: oklch(98.51% 0 0deg); background: #171a20; border-radius: var(--radius); }
pre code { padding: 0; font-size: inherit; color: inherit; word-break: normal; background: none; }
kbd { box-sizing: border-box; display: inline-flex; gap: .25rem; align-items: center; justify-content: center;
  min-width: 1.25rem; max-width: 100%; height: 1.25rem; padding: 0 .25rem; font-size: .75rem; font-weight: 500; line-height: 1;
  color: var(--text-zweit); white-space: nowrap; vertical-align: baseline;
  background-color: color-mix(in oklab, currentColor 12%, transparent); border: 0; border-radius: var(--radius-klein); }
kbd kbd { padding: 0; font-size: 1em; }
kbd .icon { --icon-groesse: .75rem; }

/* ---------- Linie, Bilder, Medien ---------- */
hr { margin: 2rem 0; color: inherit; border: 0; border-top: 1px solid; opacity: .119; }
figure { margin: 0 0 1rem; }
img, svg { vertical-align: middle; }
img { max-width: 100%; height: auto; }
iframe { border: 0; }
progress { vertical-align: baseline; }

/* Tabler Icons (core/templatetags/tabler_icons.py): Größe über --icon-groesse */
.icon { --icon-groesse: 1.25rem; display: inline-block; width: var(--icon-groesse); height: var(--icon-groesse);
  font-size: var(--icon-groesse); vertical-align: bottom; transform-origin: center; stroke-width: 1.5; flex: none; }
.icon:hover { text-decoration: none; }

/* ---------- Tabellen ---------- */
table { caption-side: bottom; border-collapse: collapse; }
caption { padding-top: .75rem; padding-bottom: .75rem; color: var(--text-zweit); text-align: start; }
th { text-align: inherit; text-align: -webkit-match-parent; }
tbody, td, tfoot, th, thead, tr { border-color: inherit; border-style: solid; border-width: 0; }

/* ---------- Formular-Grundwerte ---------- */
label { display: inline-block; }
button { border-radius: 0; }
button:focus:not(:focus-visible) { outline: 0; }
button, input, optgroup, select, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; }
button, select { text-transform: none; }
[role="button"] { cursor: pointer; }
select { word-wrap: normal; }
select:disabled { opacity: 1; }
[type="button"], [type="reset"], [type="submit"], button { -webkit-appearance: button; }
[type="button"]:not(:disabled), [type="reset"]:not(:disabled), [type="submit"]:not(:disabled), button:not(:disabled) { cursor: pointer; }
::-moz-focus-inner { padding: 0; border-style: none; }
textarea { resize: vertical; }
textarea[cols] { height: auto; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
fieldset:empty { display: none; }
legend { float: inline-start; width: 100%; padding: 0; margin-bottom: .5rem; line-height: inherit; font-size: 1.5rem; }
::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-fields-wrapper, ::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-minute, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-text,
::-webkit-datetime-edit-year-field { padding: 0; }
::-webkit-inner-spin-button { height: auto; }
[type="search"] { -webkit-appearance: textfield; outline-offset: -2px; }
[type="search"]::-webkit-search-cancel-button { cursor: pointer; filter: grayscale(1); }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-color-swatch-wrapper { padding: 0; }
::file-selector-button { font: inherit; -webkit-appearance: button; }
output { display: inline-block; }
summary { display: list-item; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Fokus: 3 px Rahmen in primary mit 55 % Deckkraft, 2 px Abstand ---------- */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primaer) 55%, transparent); outline-offset: 2px; }
@media (forced-colors: active) { :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; } }

/* ---------- Scrollbalken (schmal, in Textfarbe) ---------- */
* { scrollbar-color: color-mix(in oklab, var(--text) 20%, transparent) transparent; }
::-webkit-scrollbar { width: 1rem; height: 1rem; transition: background .3s; }
::-webkit-scrollbar-thumb { border-radius: 1rem; border: 5px solid transparent;
  box-shadow: inset 0 0 0 1rem color-mix(in oklab, var(--text) 20%, transparent); }
::-webkit-scrollbar-track { background: 0 0; }
:hover::-webkit-scrollbar-thumb { box-shadow: inset 0 0 0 1rem color-mix(in oklab, var(--text) 40%, transparent); }
::-webkit-scrollbar-corner { background: 0 0; }
@media (prefers-reduced-motion: reduce) { ::-webkit-scrollbar { transition: none; } }

/* ---------- Druck: hell, ohne Hintergrund (Seitenrahmen blendet seite.css aus) ---------- */
@media print {
  :root, [data-theme="dark"] { color-scheme: light !important; }
  body { background: 0 0; }
}
/* Bilder nur für Hell oder Dunkel (Zahlungslogos, zahlungen/_logo.html; bis 0.54 in erp.css). Hier, weil bausteine/ und bereiche/
   keine [data-theme]-Selektoren tragen dürfen */
.logo-dunkel { display: none; }
[data-theme="dark"] .logo-hell { display: none; }
[data-theme="dark"] .logo-dunkel { display: inline; }
