/* baumarkt (klassisch) unter ZMS 6 – Layout wie /zhh/K3/baumarkt (Zope 2), mobile first.
   Grundregeln = Handy; ab 761px Breite Baum links und Masse wie im Original (Banner head_v4, Inhalt 720px).
   Quelle: ZMS6\knowledge21\baumarkt_theme\ (dort aendern, dann baumarkt_theme_einrichten.py). */
:root { --baum: 0px; --spalte: 720px; --rot: #d0161b; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.bm { margin: 0; background: #fff; color: #000; font: 16px/1.4 Arial, Helvetica, sans-serif; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: #fff; padding: .4rem .8rem; }
.skip:focus { left: 8px; top: 8px; }
img { max-width: 100%; height: auto; }

/* Kopfbanner */
/* Handy: Banner auf 40px Hoehe verkleinert, damit Schriftzug und Login nebeneinander passen */
.k-kopf { position: relative; height: 40px; background: var(--rot) url("img/kopf.jpg") no-repeat;
  background-size: auto 40px; background-position: -350px 0; }
.k-kopf__logo { position: absolute; left: 0; top: 0; width: 290px; height: 40px; }
.k-kopf__konto { position: absolute; right: 4px; top: 4px; display: flex; align-items: center; color: #fff;
  font: bold 13px/18px Arial, Helvetica, sans-serif; white-space: nowrap; max-width: calc(100vw - 12px); }
.k-kopf__konto a { color: #fff; text-decoration: underline; }
.k-login { display: inline-flex; gap: .25rem; align-items: center; padding: 4px 6px; background: rgba(120, 0, 0, .55); border-radius: 3px; }
.k-login img { width: 18px; height: 18px; }
.k-kopf__konto .konto__block { display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 2px 6px; background: rgba(120, 0, 0, .55); border-radius: 3px; top: auto; }
.k-kopf__konto .konto__name { display: inline-flex; gap: 4px; align-items: center; }
.k-kopf__konto .konto__text { display: inline-flex; gap: 4px; align-items: baseline; font-size: 12px; line-height: 14px; }
.k-kopf__konto .konto__rollen { font-size: 9px; line-height: 10px; font-weight: normal; }
.k-kopf__konto .konto__rollen abbr { text-decoration: none; margin-left: 2px; }
.k-kopf__konto .konto__aktionen { display: inline-flex; gap: .7rem; font-size: 11px; line-height: 13px; }
.k-kopf__konto .konto__benutzer { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
/* Handy: nur Name, darunter Logout/Verwaltung; Rollenkuerzel als Tooltip (title) statt ausgeschrieben */
.k-kopf__konto .konto__rollen, .k-kopf__konto .konto__name svg { display: none; }
.k-kopf__konto .konto__block { padding: 1px 6px; }

/* Titelleiste */
.k-leiste { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 6px; }
.k-menue { flex: none; border: 0; background: none; padding: 6px; margin: 0; cursor: pointer; line-height: 0; }
.k-menue img { width: 32px; height: 31px; display: block; }
.k-titel { flex: 1; min-width: 0; margin: 0; font: 18px/1.2 Arial, Helvetica, sans-serif; color: #aaa;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-blaettern { flex: none; display: flex; gap: 6px; align-items: center; }
.k-blaettern a, .k-blaettern span { line-height: 0; padding: 4px; }
.k-blaettern .aus { opacity: .35; }

/* Rumpf: auf dem Handy liegt der Baum als ausklappbare Leiste ueber dem Inhalt */
.k-rumpf { position: relative; }
.k-baum { display: none; position: absolute; z-index: 20; left: 0; top: 0; width: min(320px, 88vw); max-height: 80vh;
  overflow: auto; background: #fbfbfb; padding: 6px 4px 1rem; box-shadow: 2px 2px 10px rgba(0, 0, 0, .3); }
.k-baum-auf .k-baum { display: block; }
.k-seite { min-width: 0; padding: 0 16px; }
.k-inhalt { padding: .4rem 0 2rem; max-width: var(--spalte); }

/* dTree 2.05 (dtree.css); auf dem Handy groessere Zeilen zum Antippen */
.dtree { font: 16px/1.25 Verdana, Geneva, Arial, Helvetica, sans-serif; white-space: nowrap; color: #666; }
.dtree img { border: 0; vertical-align: middle; width: 18px; height: 18px; max-width: none; }
.dtree .dTreeNode { display: flex; align-items: center; min-height: 32px; }
.dtree .dTreeNode > img, .dtree .dTreeNode > .dtree-zweig { flex: none; }
.dtree .dTreeNode > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dtree a { color: #707070; text-decoration: none; padding: 4px 2px; }
.dtree a.node:hover, .dtree a.nodeSel:hover { color: #0000bd; text-decoration: underline; }
.dtree a.nodeSel { background: #dedede; color: #555; }
.dtree .clip { overflow: hidden; }
.dtree-zweig { border: 0; background: none; padding: 0; margin: 0; cursor: pointer; line-height: 0; }
.dtree-zweig:focus-visible, .k-menue:focus-visible { outline: 2px solid #2b5f9e; outline-offset: -2px; }
.dtree .dtree-symbol { margin-right: 2px; }

/* Inhalte (ZMS-2-Objekte): absolute Positionen des Originals (contentbox left/top, posX/posY) fliessen untereinander */
.k-body { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.k-body .contentbox, .k-body [style*="position:absolute"], .k-body [style*="position: absolute"] {
  position: static !important; left: auto !important; top: auto !important; width: auto !important; max-width: 100%; }
.k-body .contentbox { margin: 0 0 1rem; }
.k-body img { max-width: 100%; height: auto; }
.k-body .graphic { max-width: 100% !important; box-sizing: border-box; } /* ZMSGraphic mit fester Breite (Banner) */
.k-body table { max-width: 100%; }
.k-body .ZMSTextarea p, .k-body p { font-size: 16px; }
.k-body p.leer { display: none; } /* nur Abstandshalter (<br> fuer absolute Positionen), siehe bm_klassisch.js */
.k-body h1, .k-body h2, .k-body h3 { font-family: Arial, Helvetica, sans-serif; color: #333; }
.k-body div[style*="font-size:18px"] { font-size: 17px !important; }

/* Teaser (content_Teaser 174px: Kopfbild, grauer Text, blauer Pfeil): Raster, Handy 2 Spalten */
.k-teaser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 1rem 0; }
.k-body .contentTeaser { background: #efefef; min-width: 0; }
.k-teaser + div[style*="float:none"] { display: none; }
.k-body .contentTeaserHead img { display: block; width: 100%; height: 48px; object-fit: cover; object-position: top; }
.k-body .contentTeasertext { padding: 6px; min-height: 70px; font: 14px/16px Arial, Helvetica, sans-serif; color: #6b6b6b; }
.k-body .contentTeasertext a { color: #6b6b6b; text-decoration: none; }
.k-body .contentTeasertext img { width: 12px; height: 12px; }
.k-body .contentTeaser:hover { background: #e4e4e4; }

/* Fusszeile aus den Inhalten (Letzte Aktualisierung, EU-Hinweis) */
.k-body .ZMSGraphic { font-size: 12px; line-height: 20px; }
.k-body .ZMSGraphic .text br:first-child, .k-body .ZMSGraphic .text br:first-child + br,
.k-body .ZMSGraphic .text br:first-child + br + br { display: none; }

/* ab Tabletbreite: wie im Original – Baum links (200px), Banner, Titelleiste und Inhalt daneben */
@media (min-width: 761px) {
  :root { --baum: 200px; }
  body.k-baum-zu { --baum: 18px; }
  .k-kopf { height: 50px; background-size: auto; background-position: calc(var(--baum) + 18px - 428px) 0; }
  .k-kopf__logo { left: calc(var(--baum) + 18px); width: 360px; height: 50px; }
  .k-kopf__konto { right: auto; left: calc(var(--baum) + 18px + 520px); top: 14px; font-size: 14px; }
  .k-kopf__konto:has(.konto__block) { top: 3px; }
  .k-login { padding: 0; background: none; }
  .k-kopf__konto .konto__block { align-items: flex-start; background: none; padding: 0; }
  .k-kopf__konto .konto__rollen { display: inline; }
  .k-kopf__konto .konto__name svg { display: inline; }
  .k-leiste { display: grid; grid-template-columns: var(--baum) minmax(0, var(--spalte)); position: relative;
    height: 34px; min-height: 0; padding: 0; }
  .k-menue { justify-self: end; margin-right: -14px; padding: 0; position: relative; z-index: 2; }
  .k-titel { margin-left: 26px; font-size: 20px; padding-right: 90px; }
  .k-blaettern { position: absolute; left: calc(var(--baum) + 18px + 630px); top: 2px; gap: 10px; }
  .k-blaettern a, .k-blaettern span { padding: 0; }
  .k-rumpf { display: grid; grid-template-columns: var(--baum) minmax(0, 1fr); align-items: start; }
  .k-baum, .k-baum-auf .k-baum { display: block; position: static; width: auto; max-height: none; box-shadow: none;
    min-height: 540px; padding: 6px 0 1rem 2px; overflow-x: auto; overflow-y: hidden; }
  .k-baum-zu .k-baum { visibility: hidden; padding: 0; overflow: hidden; }
  .dtree .dTreeNode { min-height: 20px; }
  .dtree a { padding: 1px 2px; }
  .k-seite { padding: 0 16px 0 24px; max-width: calc(var(--spalte) + 40px); }
  .k-body, .k-body .ZMSTextarea p, .k-body p { font-size: 18px; line-height: 20px; }
  .k-body div[style*="font-size:18px"] { font-size: 18px !important; }
  .k-teaser { grid-template-columns: repeat(auto-fill, minmax(174px, 1fr)); margin-left: 6px; }
  .k-kopf, .k-kopf__logo, .k-kopf__konto, .k-leiste, .k-blaettern, .k-rumpf { transition: all .2s; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .k-kopf, .k-leiste, .k-baum { display: none; }
  .k-rumpf { display: block; }
}

/* Baum der Benutzer-Detailseiten (Benutzername als Wurzel): gesperrte Reiter */
.dtree .node.gesperrt { color: #999; cursor: not-allowed; }

/* Titelleiste der Benutzer-Detailseiten: Person + Name, daneben die Reiter (reporting.leiste) */
.k-titel--konto { color: #333; font-size: 14px; white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.k21-rep-leiste { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.k21-rep-leiste__person { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.k21-rep-leiste__person strong { max-width: 14em; overflow: hidden; text-overflow: ellipsis; font-size: 15px; color: #153b63; }
.k21-rep-leiste .k21-rep-reiter ul { display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; border: 0; }
.k21-rep-leiste .k21-reiter { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; font-size: 14px;
  border: 1px solid #b9c7d6; border-radius: 4px; background: #eef3f8; color: #153b63; text-decoration: none; }
.k21-rep-leiste a.k21-reiter:hover, .k21-rep-leiste a.k21-reiter:focus { background: #dfe9f3; }
.k21-rep-leiste .k21-reiter.aktiv { background: #005c97; border-color: #005c97; color: #fff; font-weight: bold; }
.k21-rep-leiste .k21-reiter.gesperrt { color: #999; background: #f4f4f4; cursor: not-allowed; }
@media (max-width: 600px) {
  .k21-rep-leiste .k21-reiter__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .k21-rep-leiste .k21-reiter { padding: 3px 5px; }
  .k21-rep-leiste__person strong { max-width: 8em; font-size: 14px; }
}
@media (min-width: 761px) {
  .k-leiste--konto .k-titel { padding-right: 0; margin-left: 20px; }
  .k-leiste--konto .k-blaettern { left: auto; right: 6px; }
}
.k21-rep-leiste .k21-rep-reiter { flex: none; }
.k21-rep-leiste .k21-rep-reiter ul { flex-wrap: nowrap; }
@media (max-width: 600px) {
  .k-leiste--konto { gap: 0; }
  .k21-rep-leiste { gap: 6px; }
  .k21-rep-leiste__person img { width: 22px; height: 22px; }
}
