  html[data-theme="light"] body { background: #eef0f4 !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Blaugrauer Dark-Mode (Standard) */
  --bg:      #2a3042;
  --g1:      #323848;
  --g2:      #2e3444;
  --g3:      #3a4055;
  --g4:      #424858;
  --border:  #4a5268;
  --border2: #545c72;
  --shine:   rgba(255,255,255,0.05);
  --shine2:  rgba(255,255,255,0.02);

  --accent:  #e8a920;
  --accent2: #f5c84a;
  --green:   #28c490;
  --red:     #e04545;
  --blue:    #4a8ee8;
  --purple:  #9070e0;

  --text:    #e8ecf0;
  --text2:   #c0c8d4;
  --muted:   #7a8898;
  --muted2:  #9aa8b8;
  --werkzeug: #00d2c8;
}

/* ── HELLES DESIGN ── */
body.light {
  --bg:      #eef0f4;
  --g1:      #f8f9fb;
  --g2:      #ffffff;
  --g3:      #e8eaee;
  --g4:      #dde0e6;
  --border:  #d0d4dc;
  --border2: #b8bdc8;
  --shine:   rgba(255,255,255,0.8);
  --shine2:  rgba(255,255,255,0.4);

  --accent:  #d4920a;
  --accent2: #e8a920;
  --green:   #1aa878;
  --red:     #cc3333;
  --blue:    #2f72d4;
  --purple:  #7050c0;

  --text:    #1a1e28;
  --text2:   #2e3444;
  --muted:   #6b7280;
  --muted2:  #4b5563;
  --werkzeug: #00897b;
}
body.light [style*="color:var(--accent)"],
body.light [style*="color: var(--accent)"] {
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
body.light #role-picker {
  background: var(--bg) !important;
}
body.light .rp-logo,
body.light .rp-name { color: var(--text); }
body.light .rp-sub  { color: var(--muted2); }

html, body {
  height: 100%; width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Mulish', sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: 100vw;
  height: 100vh;        /* Fallback */
  height: 100dvh;       /* Dynamic viewport — berücksichtigt mobile Browser-UI */
  height: calc(var(--vh, 1vh) * 100); /* JS-Fallback für ältere Browser */
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}

/* ── ROLE PICKER ── */
#role-picker {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  height: 100%; padding: 32px 24px;
  background: radial-gradient(ellipse at 50% 30%, #0d1a35 0%, var(--bg) 70%);
}
.rp-logo {
  font-family: 'Mulish', sans-serif; font-size: 44px; font-weight: 800;
  letter-spacing: -1px; margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 40%, #888);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.rp-logo em {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-style: normal;
}
.rp-sub { font-size: 13px; color: var(--muted2); margin-bottom: 44px; letter-spacing: 0.5px; }
/* Sprachen: zentriert unter Logo; eigene Klasse wegen globaler button>span-Emoji-Regel */
.rp-top-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 5;
}
.rp-lang-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 6;
  pointer-events: auto;
}
.rp-lang-btn {
  padding: 8px 12px;
  min-width: 48px;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Mulish', sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(232,169,32,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: auto;
}
.rp-lang-emoji {
  font-size: 1.15em;
  line-height: 1;
  pointer-events: none;
}
.rp-lang-code {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.85;
  pointer-events: none;
}
/* Build-Version: siehe OPSARO_VERSION + automatischer Zeitstempel (document.lastModified) */
.rp-version {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  max-width: min(96vw, 420px);
  text-align: center;
  line-height: 1.35;
  padding: 0 8px;
}
.rp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 380px;
  align-items: stretch;
}
/* Gleiche Spaltenbreite erzwingen (langer Text darf umbrechen) */
.rp-grid > .rp-btn { min-width: 0; box-sizing: border-box; }
.rp-grid > .rp-btn .rp-name,
.rp-grid > .rp-btn .rp-desc { overflow-wrap: anywhere; word-break: break-word; }
/* Büro: erste Kachel volle Breite; darunter alle Module je halbe Breite */
.rp-grid > .rp-btn:first-child {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 16px;
  text-align: center;
}
.rp-grid > .rp-btn:first-child .rp-icon { margin-bottom: 0; }
.rp-grid > .rp-btn:first-child > div { text-align: center; min-width: 0; }
.rp-btn {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border);
  border-top: 1px solid var(--border2);
  border-radius: 20px; padding: 24px 14px;
  cursor: pointer; text-align: center; transition: all 0.18s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 1px 0 var(--shine);
  position: relative;
}
.rp-btn:active {
  transform: scale(0.95);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(232,169,32,0.15), inset 0 1px 0 var(--shine);
}

/* Goldener Schweif beim Hovern (rotierender conic-gradient als Border-Ring) */
@property --rp-trail-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.rp-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  padding: 2px;
  background: conic-gradient(
    from var(--rp-trail-angle),
    transparent 0deg,
    transparent 200deg,
    var(--accent) 290deg,
    var(--accent2) 330deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
@media (hover: hover) {
  .rp-btn:hover::before {
    opacity: 1;
    animation: rp-trail-spin 1.1s linear infinite;
  }
}
@keyframes rp-trail-spin {
  to { --rp-trail-angle: 360deg; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-btn:hover::before { animation: none; opacity: 1; }
}
.rp-icon { font-size: 34px; display: block; margin-bottom: 10px; filter: grayscale(1) brightness(1.15) contrast(1.1); }
.rp-name { font-family: 'Mulish', sans-serif; font-size: 14px; font-weight: 800; color: var(--text); }
.rp-desc { font-size: 10px; color: var(--muted2); margin-top: 5px; line-height: 1.4; }

/* ── HEADER ── */
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--g1) 0%, var(--bg) 100%);
  flex-shrink: 0;
}
.logo {
  font-family: 'Mulish', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #e0e2e2, #888);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo em {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-style: normal;
}
.role-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--g2); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px 5px 7px;
  font-size: 12px; color: var(--muted2); font-weight: 700; cursor: pointer;
  box-shadow: inset 0 1px 0 var(--shine);
}
.role-av {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #000;
}


/* ── LUCIDE ICONS ── */
[data-lucide] { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.li-nav { width:22px; height:22px; stroke:currentColor; fill:none; }
.li-btn { width:16px; height:16px; stroke:currentColor; fill:none; }
.li-lg  { width:28px; height:28px; stroke:currentColor; fill:none; }
.li-xl  { width:40px; height:40px; stroke:currentColor; fill:none; }

/* ── GLOBALER EMOJI-FILTER (TV-Look) ── */
.rp-btn, .sig-btn, .nav-b, .notif, .hilfe, .vs-scan,
.m-row, .kpi, .glass, .checklist .chk {
  --ef: grayscale(1) brightness(1.15) contrast(1.1);
}
/* Emoji-Spans in Buttons direkt filtern */
.rp-icon, .nav-b-icon, .n-icon, .qr-i, .vs-i, .vs-bi, .h-ic,
button > span:first-child:not([class]) {
  filter: grayscale(1) brightness(1.15) contrast(1.1);
  display: inline-block;
}

/* ── SCREENS ── */
.screen { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.screen.active { display: flex; }
#scr-nacharbeit:not(.active) { display: none !important; }
.screen:not(.active) .bot-nav { display: none !important; }
.scroll { flex: 1; overflow-y: auto; padding: 16px 16px 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.scroll::-webkit-scrollbar { width: 3px; }
.scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* ── COMMON ── */
.sec {
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 2px; color: var(--muted);
  margin: 18px 0 10px; font-family: 'Mulish', sans-serif;
}
.sec:first-child { margin-top: 2px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Glass card base */
.glass {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border);
  border-top: 1px solid var(--border2);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}

.btn-p-icon { filter: grayscale(1) brightness(1.15) contrast(1.1); display:inline-block; margin-right:4px; }
.btn-p {
  width: 100%; height: 54px; border-radius: 16px; border: none;
  background: linear-gradient(145deg, var(--accent2), var(--accent));
  color: #1a0e00; font-size: 15px; font-weight: 800; cursor: pointer;
  font-family: 'Mulish', sans-serif; margin-top: 12px;
  transition: all 0.15s;
  box-shadow: 0 4px 18px rgba(232,169,32,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-p:active { transform: scale(0.97); opacity: 0.9; }

/* ── TOAST ── */
.toast {
  position: fixed; top: 80px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: linear-gradient(135deg, var(--g3), var(--g2));
  border: 1px solid var(--border2); color: var(--text);
  padding: 10px 22px; border-radius: 24px;
  font-weight: 800; font-size: 13px; font-family: 'Mulish', sans-serif;
  opacity: 0; transition: all 0.25s; white-space: nowrap;
  z-index: 100001; pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 var(--shine2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-lg {
  font-size: clamp(17px, 4.2vw, 22px);
  padding: 16px 28px;
  border-radius: 28px;
  white-space: normal;
  max-width: min(92vw, 420px);
  text-align: center;
  line-height: 1.25;
}

/* ── BOTTOM NAV ── */
.bot-nav {
  display: flex; border-top: 1px solid var(--border);
  background: var(--g1);
  flex-shrink: 0;
  padding: 8px 6px max(12px, env(safe-area-inset-bottom));
}
.nav-b {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 8px 4px;
  border-radius: 12px; border: none; background: transparent; cursor: pointer;
  transition: all 0.15s;
}
.nav-b:active { background: var(--g3); }
.nav-b.active {
  background: linear-gradient(145deg, var(--g3), var(--g2));
  box-shadow: inset 0 1px 0 var(--shine);
}
.nav-b-icon { font-size: 20px; line-height: 1; color: var(--muted2); }
.nav-b-icon i, .nav-b-icon svg { stroke: var(--muted2); }
.nav-b-label { font-size: 9px; font-weight: 800; color: var(--muted); font-family: 'Mulish', sans-serif; text-transform: uppercase; letter-spacing: 0.3px; }
.nav-b.active .nav-b-label { color: var(--role-color, var(--accent2)); }
.nav-b.active .nav-b-icon { color: var(--role-color, var(--accent2)); }
.nav-b.active .nav-b-icon i, .nav-b.active .nav-b-icon svg { stroke: var(--role-color, var(--accent2)) !important; }

/* ── KI ASSISTENT ── */
.ki-suggest {
  background: var(--g3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Mulish', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}
.ki-suggest:hover { border-color: var(--purple); color: var(--purple); background: rgba(144,112,224,0.08); }
.ki-msg-user { align-self: flex-end; max-width: 80%; }
.ki-msg-ai   { align-self: flex-start; max-width: 85%; }
.ki-msg-ai:has(.ki-svg-wrap) { max-width: 75%; width: 100%; }
.ki-bubble-user { background: var(--purple); color: #fff; font-weight: 700; padding: 10px 14px; border-radius: 14px; border-bottom-right-radius: 3px; font-size: 13px; line-height: 1.5; }
.ki-bubble-ai   { background: var(--g3); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 14px; border-bottom-left-radius: 3px; font-size: 13px; line-height: 1.6; }
.ki-bubble-ai:has(.ki-svg-wrap) { padding: 10px 10px; width: 100%; box-sizing: border-box; }
.ki-bubble-ai strong { color: var(--accent2); }
.ki-time { font-size: 10px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.ki-msg-user .ki-time { text-align: right; }
.ki-typing { display: flex; gap: 4px; padding: 10px 14px; background: var(--g3); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 3px; width: fit-content; }
.ki-typing span { width: 6px; height: 6px; background: var(--muted); border-radius: 50%; animation: ki-bounce 1.2s infinite; }
.ki-typing span:nth-child(2) { animation-delay: 0.2s; }
.ki-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ki-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }
@keyframes spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
@keyframes select-glow { 0%,100%{box-shadow:0 0 0 0 rgba(232,169,32,0);border-color:var(--border)} 50%{box-shadow:0 0 12px 3px rgba(232,169,32,0.35);border-color:rgba(232,169,32,0.7)} }
/* Pulsierender Schicht-Tab bei offenem Hinweis */
.nav-b.has-hinweis .nav-b-icon i,
.nav-b.has-hinweis .nav-b-icon svg { stroke: var(--red) !important; }
.nav-b.has-hinweis .nav-b-label { color: var(--red) !important; }
@keyframes tab-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(224,69,69,0.5)} 50%{box-shadow:0 0 0 6px rgba(224,69,69,0)} }
.nav-b.has-hinweis { animation: tab-pulse 1.5s ease infinite; border-radius: 12px; }
@keyframes anfrage-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(232,169,32,0.5)} 50%{box-shadow:0 0 0 8px rgba(232,169,32,0)} }
.hilfe.has-anfrage { border-left: 3px solid var(--accent) !important; animation: anfrage-pulse 1.5s ease infinite; }
@keyframes werkzeug-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(74,142,232,0.5)} 50%{box-shadow:0 0 0 8px rgba(74,142,232,0)} }
@keyframes qs-tab-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(74,142,232,0.6)} 50%{box-shadow:0 0 0 8px rgba(74,142,232,0)} }
@keyframes qs-row-pulse { 0%,100%{background:transparent} 50%{background:rgba(74,142,232,0.12)} }
@keyframes werkzeug-box-pulse { 0%,100%{background:rgba(0,180,170,0.04);box-shadow:0 0 0 0 rgba(0,210,200,0.15)} 50%{background:rgba(0,210,200,0.14);box-shadow:0 0 16px 4px rgba(0,210,200,0.35)} }
/* Light-Mode: dunkleres Lila, deutlich sichtbar gegen helle Karten */
@keyframes werkzeug-box-pulse-light { 0%,100%{background:rgba(108,75,196,0.10);box-shadow:0 0 0 0 rgba(108,75,196,0.25)} 50%{background:rgba(108,75,196,0.32);box-shadow:0 0 18px 4px rgba(108,75,196,0.55)} }
body.light [style*="werkzeug-box-pulse"] { animation-name: werkzeug-box-pulse-light !important; }

/* Hover-Strips (Programme-Liste + Büro-Feed): weicher Goldverlauf mit Pfeil.
   Light-Mode bekommt deutlich kräftigeres Gold, damit es gegen weiße
   Karten auffällt. Die Leiste selbst pulst, damit sie auffällt. */
.hover-strip { align-items:center; justify-content:center; animation: hover-strip-bar-pulse 3.8s ease-in-out infinite; }
.hover-strip-left  { background: linear-gradient(to right, rgba(232,169,32,0.20), rgba(232,169,32,0.05) 65%, transparent); }
.hover-strip-right { background: linear-gradient(to left,  rgba(232,169,32,0.20), rgba(232,169,32,0.05) 65%, transparent); }
body.light .hover-strip-left  { background: linear-gradient(to right, rgba(201,140,10,0.48), rgba(201,140,10,0.12) 65%, transparent); }
body.light .hover-strip-right { background: linear-gradient(to left,  rgba(201,140,10,0.48), rgba(201,140,10,0.12) 65%, transparent); }
@keyframes hover-strip-bar-pulse {
  0%,100% { opacity: 0.70; }
  50%     { opacity: 1; }
}
.hover-strip-arrow {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  animation: hover-strip-arrow-pulse 3.2s ease-in-out infinite;
  flex-shrink: 0;
}
.hover-strip-arrow > * { width: 18px; height: 18px; stroke: #000; fill: none; stroke-width: 2.8; }
@keyframes hover-strip-arrow-pulse {
  0%,100% { transform: scale(1);   box-shadow: 0 2px 10px rgba(0,0,0,0.35), 0 0 0 0 rgba(232,169,32,0.55); }
  50%     { transform: scale(1.18); box-shadow: 0 2px 10px rgba(0,0,0,0.35), 0 0 0 10px rgba(232,169,32,0); }
}
body.light .hover-strip-arrow { box-shadow: 0 2px 10px rgba(0,0,0,0.18); }
@keyframes markerPulse { 0%,100%{box-shadow:0 0 0 3px rgba(224,69,69,0.5),0 2px 8px rgba(0,0,0,0.5)} 50%{box-shadow:0 0 0 8px rgba(224,69,69,0),0 2px 8px rgba(0,0,0,0.5)} }
.hilfe.has-werkzeug { border-left: 3px solid var(--werkzeug) !important; animation: werkzeug-pulse 1.5s ease infinite; }
@keyframes bezMarquee { 0%,20%{transform:translateX(0)} 50%,70%{transform:translateX(var(--bez-dist,0))} 100%{transform:translateX(0)} }
.bez-scroll{overflow:hidden;white-space:nowrap;position:relative}
.bez-scroll>span{display:inline-block;white-space:nowrap}
.bez-scroll.is-overflow>span{text-overflow:ellipsis}
.bez-scroll.is-overflow:hover>span{animation:bezMarquee var(--bez-dur,8s) linear infinite}

/* ════════════ WERKER ════════════ */
.qr-banner {
  background: linear-gradient(145deg, var(--g3), var(--g2));
  border: 1px solid var(--border2); border-top: 1px solid #404444;
  border-radius: 18px; padding: 20px 18px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: all 0.15s; margin-bottom: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.qr-banner:active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), inset 0 1px 0 var(--shine); }
.qr-i { font-size: 38px; filter: grayscale(1) brightness(1.15) contrast(1.1); }
.qr-main { font-size: 16px; font-weight: 800; font-family: 'Mulish', sans-serif; color: var(--text); }
.qr-sub { font-size: 12px; color: var(--muted2); margin-top: 4px; }

.aktiv-card {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 18px; padding: 16px; position: relative; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.aktiv-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: linear-gradient(180deg, var(--green), transparent);
  border-radius: 18px 0 0 18px;
}
.ak-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.ak-nr { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted2); }
.ak-live { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--green); }
.ak-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(232,169,32,0.4)} 50%{box-shadow:0 0 0 8px rgba(232,169,32,0)} }
@keyframes wzFilterGlow { 0%,100%{box-shadow:0 0 0 0 rgba(90,158,111,0);background:transparent;color:var(--text)} 50%{box-shadow:0 0 16px 4px rgba(90,158,111,0.6);background:rgba(90,158,111,0.15);color:#5a9e6f} }
.ak-name { font-size: 17px; font-weight: 800; font-family: 'Mulish', sans-serif; margin-bottom: 12px; color: var(--text); }
.prog-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.prog-l { font-size: 11px; color: var(--muted2); }
.prog-v { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--green); }
.prog-bar { height: 5px; background: var(--g4); border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--green), #1af5b0); border-radius: 6px; }
.ak-meta { display: flex; gap: 16px; }
.ak-mi { font-size: 11px; color: var(--muted); }
.ak-mi b { color: var(--muted2); font-weight: 700; }

/* ── NUMPAD ── */
.numpad-card {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 16px; padding: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), inset 0 1px 0 var(--shine);
}
.cnt-disp {
  font-family: 'DM Mono', monospace; font-size: 36px; font-weight: 400;
  text-align: center; padding: 8px 10px; letter-spacing: 4px;
  background: var(--bg); border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--green); margin-bottom: 8px; min-height: 58px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
  text-shadow: 0 0 20px rgba(40,196,144,0.4);
}
.numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.num-btn {
  background: linear-gradient(145deg, var(--g3), var(--g2));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 10px; color: var(--text);
  padding: 12px 8px; font-size: 18px; font-weight: 600;
  text-align: center; cursor: pointer; transition: all 0.1s;
  font-family: 'DM Mono', monospace; user-select: none;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.num-btn:active {
  background: linear-gradient(145deg, var(--accent), var(--accent2));
  color: #1a0e00; border-color: var(--accent);
  transform: scale(0.93) translateY(1px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.num-btn.del { font-size: 17px; color: var(--muted2); }
.num-btn.del:active { background: linear-gradient(145deg, #a03030, #c04040); color: #fff; border-color: var(--red); }

/* ── STÖRUNGS GLOW EFFEKTE ── */
#stoerung-screen-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 998;
  opacity: 0; transition: opacity 0.5s ease;
}
#stoerung-screen-glow.stillstand {
  opacity: 1;
  box-shadow: inset 0 0 80px rgba(224,69,69,0.25), inset 0 0 200px rgba(224,69,69,0.1);
  animation: glow-red 1.5s ease-in-out infinite;
}
#stoerung-screen-glow.laeuft {
  opacity: 1;
  box-shadow: inset 0 0 80px rgba(232,169,32,0.2), inset 0 0 200px rgba(232,169,32,0.08);
  animation: glow-yel 2s ease-in-out infinite;
}
@keyframes glow-red {
  0%,100% { box-shadow: inset 0 0 60px rgba(224,69,69,0.2), inset 0 0 160px rgba(224,69,69,0.08); }
  50%      { box-shadow: inset 0 0 100px rgba(224,69,69,0.35), inset 0 0 260px rgba(224,69,69,0.15); }
}
@keyframes glow-yel {
  0%,100% { box-shadow: inset 0 0 60px rgba(232,169,32,0.15), inset 0 0 160px rgba(232,169,32,0.06); }
  50%      { box-shadow: inset 0 0 100px rgba(232,169,32,0.28), inset 0 0 260px rgba(232,169,32,0.12); }
}

/* Büro-Liste Karten Glow */
.notif-glow-red { animation: card-glow-red 1.5s ease-in-out infinite !important; }
.notif-glow-yel { animation: card-glow-yel 2s ease-in-out infinite !important; }
.notif-glow-blu { animation: card-glow-blu 2s ease-in-out infinite !important; }
@keyframes card-glow-red {
  0%,100% { box-shadow: 0 0 0 1px var(--red), 0 0 12px rgba(224,69,69,0.3); }
  50%      { box-shadow: 0 0 0 2px var(--red), 0 0 28px rgba(224,69,69,0.5); }
}
@keyframes card-glow-yel {
  0%,100% { box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(232,169,32,0.25); }
  50%      { box-shadow: 0 0 0 2px var(--accent), 0 0 28px rgba(232,169,32,0.45); }
}
@keyframes card-glow-blu {
  0%,100% { box-shadow: 0 0 0 1px #4a8ee8, 0 0 12px rgba(74,142,232,0.25); }
  50%      { box-shadow: 0 0 0 2px #4a8ee8, 0 0 28px rgba(74,142,232,0.45); }
}

/* Signal Buttons */
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.sig-btn {
  position: relative;
  background: linear-gradient(160deg, #1c1c1e 0%, #111113 60%, #0a0a0c 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px; padding: 20px 14px 18px;
  cursor: pointer; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform 0.12s, box-shadow 0.12s;
  overflow: hidden;
}
.sig-btn::before {
  content: '';
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%;
}
.sig-btn::after {
  content: '';
  position: absolute; top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}
.sig-btn:active { transform: scale(0.94) translateY(2px); box-shadow: 0 3px 10px rgba(0,0,0,0.6); }
.sig-btn.qs    ::before, .sig-btn.qs::before    { background: #4a8ee8; box-shadow: 0 0 8px 3px #4a8ee8; }
.sig-btn.einr  ::before, .sig-btn.einr::before  { background: #c9a227; box-shadow: 0 0 8px 3px #c9a227; }
.sig-btn.stoer ::before, .sig-btn.stoer::before { background: #e04545; box-shadow: 0 0 8px 3px #e04545; }
.sig-btn.ok    ::before, .sig-btn.ok::before    { background: #28c490; box-shadow: 0 0 8px 3px #28c490; }
.sig-btn.anf-w ::before { background: #28c490; box-shadow: 0 0 8px 3px #28c490; }
.sig-btn.anf-v ::before { background: #e8a920; box-shadow: 0 0 8px 3px #e8a920; }
.sig-btn.anf-w.anf-aktiv { border-color: #28c490; background: linear-gradient(160deg, #0e1a14 0%, #081008 100%); box-shadow: 0 0 16px rgba(40,196,144,0.3), 0 8px 24px rgba(0,0,0,0.6); }
.sig-btn.anf-v.anf-aktiv { border-color: #e8a920; background: linear-gradient(160deg, #1e1a10 0%, #141008 100%); box-shadow: 0 0 16px rgba(232,169,32,0.3), 0 8px 24px rgba(0,0,0,0.6); }
.sig-icon-wrap {
  width: 52px; height: 52px; border-radius: 14px; margin: 8px auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 12px rgba(0,0,0,0.5);
}
.sig-icon-wrap svg { width: 26px; height: 26px; }
.sig-n  { font-size: 13px; font-weight: 800; font-family: 'Mulish', sans-serif; color: var(--text); }
.sig-s  { font-size: 10px; color: var(--muted2); margin-top: 4px; line-height: 1.3; }

/* Schicht box */
.schicht-box {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-left: 2px solid rgba(232,169,32,0.4);
  border-radius: 18px; padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.sb-title { font-size: 12px; font-weight: 800; color: var(--accent2); margin-bottom: 12px; font-family: 'Mulish', sans-serif; letter-spacing: 0.5px; }
.sb-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sb-row:last-child { border-bottom: none; }
.sb-l { font-size: 13px; color: var(--muted2); }
.sb-v { font-family: 'DM Mono', monospace; font-size: 14px; color: var(--text); }

/* ════════════ EINRICHTER ════════════ */
.hilfe {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 16px; padding: 16px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.hilfe.dring { border-left: 3px solid var(--red); }
.hilfe.norm  { border-left: 3px solid var(--blue); }
.hilfe:active { opacity: 0.8; transform: scale(0.99); }
.h-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.h-type { font-size: 11px; font-weight: 800; font-family: 'Mulish', sans-serif; letter-spacing: 0.5px; }
.h-type.dring { color: var(--red); }
.h-type.norm  { color: var(--blue); }
.h-machine { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted2); }
.h-desc { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.h-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.h-tag {
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  background: var(--g3); color: var(--muted2); border: 1px solid var(--border);
  font-family: 'Mulish', sans-serif;
}

.checklist { display: flex; flex-direction: column; gap: 8px; }
.chk {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 var(--shine);
}
.chk.done { opacity: 0.4; }
.chk-circle {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
  background: var(--g3);
}
.chk.done .chk-circle { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(40,196,144,0.4); }
.chk-check { display: none; color: #051a12; font-size: 13px; font-weight: 900; }
.chk.done .chk-check { display: block; }
.chk-text { font-size: 13px; font-weight: 700; flex: 1; color: var(--text); }
.chk.done .chk-text { text-decoration: line-through; color: var(--muted); }
.chk-step { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); flex-shrink: 0; }

/* ════════════ BÜRO ════════════ */
.kpi-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 4px; }
.kpi {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 10px; padding: 8px 8px; text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.kpi-v { font-family: 'DM Mono', monospace; font-size: 16px; line-height: 1; margin-bottom: 2px; }
.kpi-l { font-size: 9px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }

.notif {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 8px;
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,0.35), inset 0 1px 0 var(--shine);
}
.notif.red  { border-left: 3px solid var(--red); }
.notif.yel  { border-left: 3px solid var(--accent); }
.notif.blu  { border-left: 3px solid var(--blue); }
.notif.grn  { border-left: 3px solid var(--green); }
.notif.gry  { border-left: 3px solid var(--muted2); }
.notif:active { opacity: 0.8; }
.n-icon { font-size: 20px; flex-shrink: 0; filter: grayscale(1) brightness(1.15) contrast(1.1); }
.n-body { flex: 1; min-width: 0; }
.n-title { font-size: 11px; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--muted2); }
.n-sub { font-size: 14px; font-weight: 800; font-family: 'Mulish', sans-serif; color: var(--text); margin-top: 3px; }
.n-time { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; margin-top: 5px; }
.n-badge {
  font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 20px;
  flex-shrink: 0; align-self: flex-start; font-family: 'Mulish', sans-serif;
  background: var(--g3); border: 1px solid var(--border2);
}
.b-red  { color: var(--red); }
.b-yel  { color: var(--accent2); }
.b-blu  { color: var(--blue); }
.b-grn  { color: var(--green); }
.b-gry  { color: var(--muted2); }

.wz-card {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 8px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.wz-top { display: flex; justify-content: space-between; margin-bottom: 10px; }
.wz-name { font-size: 14px; font-weight: 800; font-family: 'Mulish', sans-serif; color: var(--text); }
.wz-from { font-size: 11px; color: var(--muted2); margin-top: 2px; }
.wz-photo {
  width: 100%; height: 78px; background: var(--g3); border-radius: 10px;
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 13px; margin-bottom: 10px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}
.wz-btns { display: flex; gap: 8px; }
.wz-ok {
  flex:1; padding:12px;
  background: linear-gradient(145deg, var(--g3), var(--g2));
  border: 1px solid var(--border2); border-left: 2px solid var(--green);
  border-radius: 12px; font-size: 13px; font-weight: 800; color: var(--green);
  cursor: pointer; text-align: center; font-family: 'Mulish', sans-serif;
  box-shadow: inset 0 1px 0 var(--shine);
}
.wz-no {
  flex:1; padding:12px;
  background: linear-gradient(145deg, var(--g3), var(--g2));
  border: 1px solid var(--border2); border-left: 2px solid var(--red);
  border-radius: 12px; font-size: 13px; font-weight: 800; color: var(--red);
  cursor: pointer; text-align: center; font-family: 'Mulish', sans-serif;
  box-shadow: inset 0 1px 0 var(--shine);
}

.m-row {
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  border-radius: 8px; padding: 6px 10px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35), inset 0 1px 0 var(--shine);
}
.m-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.m-dot.run  { background: var(--green); box-shadow: 0 0 6px var(--green); animation: blink 2s ease-in-out infinite; }
.m-dot.err  { background: var(--red);   box-shadow: 0 0 6px var(--red);   animation: blink 0.7s ease-in-out infinite; }
.m-dot.pau  { background: var(--accent); }
.m-dot.off  { background: var(--muted); }
.m-inf { flex: 1; }
.m-name { font-size: 11px; font-weight: 800; font-family: 'Mulish', sans-serif; color: var(--text); }
.m-detail { font-size: 9px; color: var(--muted2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.m-right { text-align: right; }
.m-stk { font-family: 'DM Mono', monospace; font-size: 11px; }
.m-sub2 { font-size: 9px; color: var(--muted); }

/* Büro Desktop: Maschinen-Kacheln — kompakt (nur „grün/läuft“), Priorität volle Kachel */
#buero-maschinen-desktop {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}
.ms-tile {
  position: relative;
  background: var(--g2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
  transition: box-shadow 0.22s ease, transform 0.22s ease, padding 0.22s ease, min-width 0.22s ease, max-width 0.22s ease;
  box-sizing: border-box;
}
.ms-tile.ms-tile-compact {
  padding: 4px 6px !important;
  min-width: 72px;
  max-width: 90px;
}
.ms-tile.ms-tile-compact .ms-tile-line-det { display: none; }
.ms-tile.ms-tile-compact .ms-tile-line-name {
  font-size: 9px !important;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-tile.ms-tile-compact .ms-tile-dot-el {
  width: 6px !important;
  height: 6px !important;
  margin: 0 auto 3px !important;
}
.ms-tile.ms-tile-compact .ms-tile-line-ist {
  font-size: 9px !important;
  margin-top: 2px !important;
  font-family: 'DM Mono', monospace;
}
.ms-tile.ms-tile-compact .ms-tile-line-soll { font-size: 7px !important; margin-top: 0 !important; }
@media (hover: hover) {
  .ms-tile.ms-tile-compact:hover {
    z-index: 40;
    min-width: 100px;
    max-width: 152px;
    padding: 6px 8px !important;
    box-shadow: 0 14px 36px rgba(0,0,0,0.55);
    transform: translateY(-3px);
  }
  .ms-tile.ms-tile-compact:hover .ms-tile-line-det {
    display: block;
    font-size: 8px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ms-tile.ms-tile-compact:hover .ms-tile-line-name { font-size: 10px !important; }
  .ms-tile.ms-tile-compact:hover .ms-tile-dot-el {
    width: 7px !important;
    height: 7px !important;
    margin: 0 auto 5px !important;
  }
  .ms-tile.ms-tile-compact:hover .ms-tile-line-ist { font-size: 11px !important; }
  .ms-tile.ms-tile-compact:hover .ms-tile-line-soll { font-size: 10px !important; }
}
@media (hover: none) {
  .ms-tile.ms-tile-compact:active {
    z-index: 40;
    min-width: 100px;
    max-width: 152px;
    padding: 6px 8px !important;
    box-shadow: 0 14px 36px rgba(0,0,0,0.55);
    transform: translateY(-2px);
  }
  .ms-tile.ms-tile-compact:active .ms-tile-line-det {
    display: block;
    font-size: 8px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ms-tile.ms-tile-compact:active .ms-tile-line-name { font-size: 10px !important; }
  .ms-tile.ms-tile-compact:active .ms-tile-dot-el {
    width: 7px !important;
    height: 7px !important;
    margin: 0 auto 5px !important;
  }
  .ms-tile.ms-tile-compact:active .ms-tile-line-ist { font-size: 11px !important; }
  .ms-tile.ms-tile-compact:active .ms-tile-line-soll { font-size: 10px !important; }
}

/* ════════════ VERSAND ════════════ */
.vs-scan {
  background: linear-gradient(145deg, var(--g3), var(--g2));
  border: 1px solid var(--border2); border-top: 1px solid #404444;
  border-radius: 20px; padding: 28px 20px; text-align: center;
  cursor: pointer; margin-bottom: 4px; transition: all 0.15s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 1px 0 var(--shine);
}
.vs-scan:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.vs-i { font-size: 48px; display: block; margin-bottom: 10px; filter: grayscale(1) brightness(1.15) contrast(1.1); }
.vs-t { font-size: 18px; font-weight: 800; font-family: 'Mulish', sans-serif; color: var(--text); }
.vs-s { font-size: 12px; color: var(--muted2); margin-top: 5px; }

/* Hinweise - clean greyscale strips */
.hinweis-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.hinweis {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 13px; font-size: 13px; font-weight: 700;
  background: linear-gradient(145deg, var(--g2), var(--g1));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 var(--shine);
  color: var(--text2);
}
.hw { border-left: 3px solid var(--green); }
.hp { border-left: 3px solid var(--blue); }
.he { border-left: 3px solid var(--purple); }
.hn { border-left: 3px solid var(--accent); }
.h-ic { font-size: 20px; flex-shrink: 0; filter: grayscale(1) brightness(1.15) contrast(1.1); }

.vs-btn {
  padding: 18px 10px; border-radius: 16px; text-align: center; cursor: pointer;
  background: linear-gradient(145deg, var(--g3), var(--g2));
  border: 1px solid var(--border); border-top: 1px solid var(--border2);
  transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4), inset 0 1px 0 var(--shine);
}
.vs-btn:active { transform: scale(0.94) translateY(1px); box-shadow: 0 1px 6px rgba(0,0,0,0.4); }
.vs-btn.vf { border-left: 3px solid var(--green); }
.vs-btn.vv { border-left: 3px solid var(--blue); }
.vs-bi { font-size: 28px; display: block; margin-bottom: 7px; filter: grayscale(1) brightness(1.15) contrast(1.1); }
.vs-bn { font-size: 13px; font-weight: 800; font-family: 'Mulish', sans-serif; color: var(--text); }

/* ── FORMULAR ── */
.form-group { margin-bottom: 10px; }
.form-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-family: 'Mulish', sans-serif; margin-bottom: 5px; display: block; }
.form-input {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  background: var(--g1); border: 1px solid var(--border); border-top: 1px solid var(--border2);
  color: var(--text); font-size: 14px; font-family: 'Mulish', sans-serif; font-weight: 600;
  outline: none; transition: border-color 0.15s;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
/* Pflichtfeld-Validierung: rotes Feld bis Eingabe erfolgt */
.input-error,
.form-input.input-error {
  border-color: var(--red) !important;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 0 0 3px rgba(224,69,69,0.18);
  animation: input-error-shake 0.32s cubic-bezier(.36,.07,.19,.97);
}
.input-error:focus,
.form-input.input-error:focus {
  border-color: var(--red) !important;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 0 0 3px rgba(224,69,69,0.32);
}
@keyframes input-error-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .input-error, .form-input.input-error { animation: none; }
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* ── LIGHT MODE OVERRIDES ── */
body.light .glass { background: var(--g2); border-color: var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
body.light .aktiv-card { background: var(--g2); border-color: var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
body.light .numpad-card { background: var(--g2); border-color: var(--border); }
body.light .sig-btn { background: var(--g1); border-color: var(--border); color: var(--text); }
body.light .sig-btn:active { background: var(--g3); }
body.light .cnt-disp { background: var(--g1); color: var(--text); border-color: var(--border); }
body.light .numpad-btn { background: var(--g1); color: var(--text); border-color: var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
body.light .numpad-btn:active { background: var(--g3); }
body.light .qr-banner { background: var(--g2); border-color: var(--border); }
body.light .rp-btn { background: var(--g2); border-color: var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
body.light .rp-btn:hover { background: var(--g3); }
body.light .notif { background: var(--g2); border-color: var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
body.light .app-header { background: var(--g2); border-color: var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
body.light .bot-nav { background: var(--g2); border-color: var(--border); box-shadow: 0 -1px 4px rgba(0,0,0,0.06); }
body.light input.form-input { background: var(--g1); border-color: var(--border); color: var(--text); }
body.light textarea { background: var(--g1) !important; border-color: var(--border) !important; color: var(--text) !important; }
body.light .logo em { color: var(--accent); }
body.light .kpi { background: var(--g2); border-color: var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
body.light .card { background: var(--g2); border-color: var(--border); }
body.light .hilfe { background: var(--g2); border-color: var(--border); }
body.light #pin-overlay { background: rgba(238,240,244,0.98); }
body.light .pin-btn { background: var(--g2); border-color: var(--border); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
body.light .rp-logo, body.light .rp-name { color: var(--text); }
body.light .rp-sub  { color: var(--muted2); }
body.light #role-picker { background: var(--bg); }

.wz-card { border-radius:12px; border:1px solid var(--border); background:var(--g2); padding:10px; cursor:pointer; transition:background 0.15s,border-color 0.15s; text-align:left; }
.wz-card:hover { background:var(--g3); }
.wz-card--warn { border-color:var(--red) !important; box-shadow:0 0 0 1px rgba(224,69,69,0.35); }
/* Werkzeugschrank: Kategorien */
.wz-kat-row { display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:8px; width:100%; }
@media (max-width:900px) { .wz-kat-row { grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); } }
@media (max-width:720px) { .wz-kat-row { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.wz-kat-card {
  display:flex; flex-direction:row; align-items:center; gap:10px;
  padding:10px 12px; min-height:56px; border-radius:10px; cursor:pointer;
  border:1px solid var(--border); background:var(--g2);
  transition:background 0.15s,border-color 0.15s,box-shadow 0.15s,opacity 0.2s,padding 0.2s,min-height 0.2s;
  text-align:left; box-sizing:border-box;
  overflow:hidden;
}
body.light .wz-kat-card { background:#f5f5f7; }
.wz-kat-card:hover { background:var(--g3); }
body.light .wz-kat-card:hover { background:#ebecef; }
.wz-kat-card--active { border-color:var(--accent) !important; box-shadow:0 0 0 1px rgba(232,169,32,0.35); min-height:76px !important; padding:14px !important; }
.wz-kat-card--active .wz-kat-card-img { width:54px !important; height:54px !important; }
.wz-kat-card--active .wz-kat-card-label { font-size:13px !important; }
/* Keine Kategorie gewählt → Karten groß */
.wz-kat-row--none .wz-kat-card { min-height:120px; padding:18px 14px; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:12px; }
.wz-kat-row--none .wz-kat-card-text { align-items:center; }
.wz-kat-row--none .wz-kat-card-img { width:72px !important; height:72px !important; }
.wz-kat-row--none .wz-kat-card-label { font-size:13px !important; }
/* Kategorie gewählt → andere Karten klein + gedimmt */
.wz-kat-card--small { min-height:38px; padding:5px 10px; opacity:0.42; }
.wz-kat-card--small:hover { opacity:0.75; }
.wz-kat-card--small .wz-kat-card-img { width:28px !important; height:28px !important; }
.wz-kat-card--small .wz-kat-card-label { font-size:10px !important; }
.wz-kat-card-img { width:44px;height:44px;flex-shrink:0;border-radius:8px;overflow:hidden;background:var(--g3);display:flex;align-items:center;justify-content:center;transition:width 0.2s,height 0.2s; }
.wz-kat-card-img img { width:100%;height:100%;object-fit:contain; }
.wz-kat-card-text {
  flex:1 1 0; min-width:0;
  display:flex; flex-direction:column; align-items:flex-start; gap:3px;
}
.wz-kat-card-label {
  font-size:11px;font-weight:800;color:var(--text);line-height:1.25;font-family:'Mulish',sans-serif;
  white-space:normal; overflow-wrap:anywhere; word-break:break-word; hyphens:auto;
  max-width:100%;
}
.wz-kat-card-count { font-size:10px;font-weight:700;color:var(--muted); line-height:1.2; }
.wz-bohrer-pill,.wz-sort-pill { padding:8px 16px;border-radius:10px;border:1px solid var(--border);background:var(--g2);color:var(--text);font-size:13px;font-weight:800;cursor:pointer;font-family:'Mulish',sans-serif; }
.wz-bohrer-pill:hover,.wz-sort-pill:hover { background:var(--g3); }
.wz-bohrer-pill--on,.wz-sort-pill--on { border-color:var(--accent);color:var(--accent);background:rgba(232,169,32,0.1); }
#scr-werkzeugschrank.wz-desktop-aktiv #wz-layout { grid-template-columns:1fr minmax(280px,340px) !important; }
#scr-werkzeugschrank:not(.wz-desktop-aktiv) #wz-detail-panel.wz-detail-open { position:fixed !important; inset:0 !important; z-index:10040 !important; border-radius:0 !important; max-height:none !important; }

@media (min-width: 1000px) {
  .desktop-only { display: inline-flex !important; }
  #versand-botnav { display: none !important; }
  #buero-desktop-nav { display: flex !important; }
}

/* ── TABLET QUERFORMAT ── */
@media (max-height: 600px) and (orientation: landscape) {
  .rp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  .rp-btn  { padding: 12px 8px !important; }
  .rp-logo { font-size: 28px !important; margin-bottom: 4px !important; }
  .rp-sub  { margin-bottom: 16px !important; }
  .bot-nav { padding: 4px 0 !important; }
  .nav-b   { padding: 6px 4px !important; }
  .nav-b-icon { font-size: 16px !important; }
  .app-header { padding: 5px 10px !important; }
  .logo { font-size: 14px !important; }
  .role-chip { padding: 4px 8px 4px 5px !important; font-size: 11px !important; }
  .role-av { width: 18px !important; height: 18px !important; font-size: 10px !important; }
  .app-header button { width: 30px !important; height: 30px !important; }
  .app-header button i, .app-header button svg { width: 14px !important; height: 14px !important; }
  .sig-grid { grid-template-columns: repeat(4,1fr) !important; gap: 8px !important; }
  .sig-btn  { padding: 10px 6px !important; }
}

@media (min-width: 600px) and (max-width: 1100px) {
  .scroll { padding: 12px 20px 8px; }
  .glass  { padding: 14px; }
  .notif  { padding: 12px 14px; }
}

/* ── TOOLTIPS ── */
.oee-tip { position:relative; cursor:help; }
.oee-tip::after {
  content: attr(data-tip);
  position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%);
  background:var(--g4); border:1px solid var(--border2); border-radius:10px;
  padding:10px 14px; font-size:11px; font-weight:600; color:var(--text);
  white-space:nowrap; max-width:240px; white-space:normal; width:220px;
  line-height:1.5; letter-spacing:0; text-transform:none; font-family:'Mulish',sans-serif;
  box-shadow:0 4px 20px rgba(0,0,0,0.4);
  opacity:0; pointer-events:none; transition:opacity 0.15s;
  z-index:9999;
}
.oee-tip:hover::after { opacity:1; }

/* ── PIN OVERLAY ── */
#pin-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(8,12,20,0.97); backdrop-filter: blur(14px);
  z-index: 10000; flex-direction: column; align-items: center; justify-content: center; gap: 0;
}
#pin-overlay .pin-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
#pin-overlay .pin-role  { font-family: 'Mulish', sans-serif; font-size: 24px; font-weight: 800; color: var(--accent); margin-bottom: 28px; }
#pin-overlay .pin-dots  { font-family: 'DM Mono', monospace; font-size: 42px; letter-spacing: 18px; color: var(--accent); height: 56px; margin-bottom: 32px; min-width: 140px; text-align: center; transition: color 0.2s; }
#pin-overlay .pin-grid  { display: grid; grid-template-columns: repeat(3, 80px); gap: 14px; }
#pin-overlay .pin-btn   {
  width: 80px; height: 80px; border-radius: 50%;
  border: 1px solid var(--border2); background: var(--g2);
  color: var(--text); font-size: 26px; font-weight: 800;
  font-family: 'DM Mono', monospace;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.1s, transform 0.1s; user-select: none;
  filter: none;
}
#pin-overlay .pin-btn:active { background: var(--accent); color: #000; transform: scale(0.93); }
@keyframes pin-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-12px); }
  75%     { transform: translateX(12px); }
}
.pin-shake { animation: pin-shake 0.35s ease; }

/* Nacharbeit eigenständig: Desktop = 2 Spalten, Mobile = Lager-Stil (Liste → Vollbild-Detail) */
@media (max-width: 900px) {
  .nar-standalone-desktop { display: none !important; }
  .nar-standalone-mobile { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
}
@media (min-width: 901px) {
  .nar-standalone-desktop { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
  .nar-standalone-mobile { display: none !important; }
}

/* Nacharbeit Standalone: Anweisung + Bestätigung als Overlay auf dem Schrittbild */
.na-standalone-schritt-fig {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--g2);
  min-height: 140px;
}
.na-standalone-schritt-fig img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  vertical-align: middle;
}
@media (max-width: 900px) {
  .na-standalone-schritt-fig img { max-height: min(52vh, 420px); }
}
.na-standalone-schritt-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 12px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.93) 0%, rgba(0,0,0,0.5) 52%, transparent 100%);
  pointer-events: none;
}
.na-standalone-schritt-strip > * { pointer-events: auto; }
.na-standalone-schritt-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.97);
  white-space: pre-wrap;
  max-height: min(38vh, 200px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
}
.na-standalone-schritt-ok {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  font-size: 24px;
  font-weight: 800;
  font-family: 'Mulish', sans-serif;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  touch-action: manipulation;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.na-standalone-schritt-ok:active { transform: scale(0.93); }
/* Vollbild (standalone): Strip ist normales Flex-Kind, nicht absolute wie in der Karte */
#na-vollbild-strip.na-standalone-schritt-strip {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100%;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
}
/* QS Mobil · Nacharbeit: Bearbeiten gut erkennbar (große Tap-Fläche) */
.na-mob-edit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  min-height: 46px;
  min-width: 46px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: rgba(232, 169, 32, 0.16);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  font-family: 'Mulish', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(232, 169, 32, 0.22);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.na-mob-edit-btn:active { transform: scale(0.96); }
.na-mob-edit-btn.na-mob-edit-close {
  border-color: var(--border);
  background: var(--g2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
