#maschine { position: absolute; z-index: 0; border-radius: 18px; pointer-events: none;
  background: radial-gradient(ellipse at 25% 10%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 55%),
    repeating-linear-gradient(92deg, rgba(255, 255, 255, .025) 0 2px, rgba(0, 0, 0, .03) 2px 5px, rgba(255, 255, 255, 0) 5px 9px),
    linear-gradient(160deg, var(--lack1), var(--lack2));
  border: 5px solid var(--messing);
  box-shadow: 0 28px 44px rgba(20, 10, 0, .5), 0 6px 0 2px var(--messing2), inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -20px 30px rgba(0, 0, 0, .22); }
#maschine[hidden] { display: none; }
#maschine .kante { position: absolute; left: 14px; right: 14px; bottom: -18px; height: 12px; border-radius: 0 0 8px 8px; background: linear-gradient(var(--messing), var(--messing2)); }
#maschine::before, #maschine::after { content: ''; position: absolute; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f6dfa0, var(--messing2)); }
#maschine::before { left: 10px; } #maschine::after { right: 10px; }

#kopf { position: absolute; left: 12px; top: 8px; z-index: 2; height: 48px; max-width: calc(100% - 24px); padding: 4px 14px; border-radius: 4px; overflow: hidden;
  background: var(--zettel); color: var(--zettelText); border: 1px solid var(--messing); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); transform: rotate(-.6deg);
  display: flex; flex-direction: column; justify-content: center; font-family: var(--kopf); pointer-events: none; }
#kopf[hidden] { display: none; }
#kopf b { font-size: 16px; line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#kopf span { font-size: 14px; line-height: 18px; color: var(--mute); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }

#werkz { position: absolute; z-index: 2; display: grid; gap: 6px; padding: 8px; border-radius: 12px; border: 3px solid var(--blechLoch);
  background: radial-gradient(circle, var(--blechLoch) 2.2px, transparent 2.6px) 0 0 / 14px 14px, var(--blech); box-shadow: 0 14px 26px rgba(0, 0, 0, .4); }
#werkz[hidden] { display: none; }
#werkz.senk { grid-template-columns: 1fr 1fr; }
#werkz.quer { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 5px; gap: 5px; }
#werkz.senk.kompakt { padding: 4px; gap: 4px; border-width: 2px; } #werkz.senk.kompakt .wz { min-height: 44px; padding: 2px 0; border-width: 1.5px; } #werkz.senk.kompakt .wz svg { width: 16px; height: 16px; } #werkz.senk.kompakt .wz .kk { font-size: 11px; letter-spacing: -.6px; } #werkz.senk.kompakt .wz .anz { top: 1px; right: 1px; min-width: 15px; height: 15px; font-size: 10px; line-height: 15px; border-width: 1px; }
#werkz.quer .wz { padding: 3px 0; border-width: 1.5px; } #werkz.quer .wz svg { width: 20px; height: 20px; } #werkz.quer .wz .anz { top: 1px; right: 1px; min-width: 16px; height: 16px; font-size: 11px; line-height: 16px; border-width: 1px; }
.wz { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 9px; cursor: pointer;
  border: 2px solid var(--messing); background: linear-gradient(#7a5a3a, #5a3f2a); color: #f3ead2; font: 700 11px/1.1 'Segoe UI', system-ui, sans-serif; padding: 4px 2px; touch-action: manipulation; }
#werkz.quer .wz { min-height: 48px; }
.wz svg { width: 22px; height: 22px; color: #f2d68a; pointer-events: none; }
.wz .kl, .wz .kk { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wz .kl { display: none; } .wz .kk { display: block; font-size: 11px; letter-spacing: -.3px; }
.wz .anz { position: absolute; top: 2px; right: 2px; min-width: 20px; height: 20px; border-radius: 10px; background: #9b2d20; color: #fff; font: 700 12px/20px 'Segoe UI', sans-serif; font-style: normal; text-align: center; border: 2px solid var(--messing); }
.wz:hover { filter: brightness(1.12); }
.wz.gew { background: linear-gradient(#e0b04a, #b8862c); color: #2a1a08; } .wz.gew svg { color: #2a1a08; }
.wz.aus { opacity: .5; border-style: dashed; cursor: default; filter: saturate(.4); }
.wz.aus .anz { background: #55504a; }

#meld { position: absolute; top: 6px; right: 12px; z-index: 10; width: min(440px, 52%); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
#meld .m { background: var(--panel2); color: var(--text); border: 1px solid var(--rand); border-left: 5px solid var(--akzent); border-radius: 10px; padding: 6px 10px;
  font-size: 14px; line-height: 1.3; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: opacity .35s; }
#meld .m.gut { border-left-color: var(--gruen); } #meld .m.schlecht { border-left-color: var(--rot); }
#meld .m.weg { opacity: 0; }

#zeile { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 5; width: min(640px, calc(100% - 24px)); min-height: 38px; padding: 4px 14px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 8px; overflow: hidden;
  background: var(--zettel); color: var(--zettelText); border: 1px solid var(--messing); font: 14px/1.25 var(--kopf); box-shadow: 0 4px 12px rgba(0, 0, 0, .2); pointer-events: none; }
#zeile:empty { display: none; }
#zeile.erkl { border-color: var(--akzent); }

#tafel { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(20, 10, 0, .35); padding: 12px; }
#tafel[hidden] { display: none; }
#tafel .schild { position: relative; width: min(400px, 100%); max-height: 100%; overflow: auto; padding: 18px 20px 16px; border-radius: 10px; background: var(--zettel); color: var(--zettelText);
  border: 3px solid var(--messing); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); display: grid; gap: 8px; text-align: center; font-family: var(--kopf);
  scrollbar-width: thin; scrollbar-color: var(--akzent) rgba(0, 0, 0, .12); }
#tafel .zu { position: sticky; top: 0; justify-self: end; margin: -8px -8px -34px 0; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--messing); background: var(--knopf1); color: var(--knopfText); display: grid; place-items: center; z-index: 1; }
#tafel .zu svg { width: 18px; height: 18px; }
#tafel h3 { margin: 0; font-size: 24px; color: var(--akzent); }
#tafel .nr { color: var(--mute); font-size: 14px; }
#tafel p { margin: 0; font-size: 15px; line-height: 1.4; } #tafel p.klein { font-size: 13px; color: var(--mute); }
#tafel .zielzahl { display: grid; justify-items: center; gap: 0; padding: 6px; border-radius: 8px; background: rgba(142, 90, 28, .08); }
#tafel .zielzahl b { font-size: 46px; line-height: 1.05; color: var(--akzent); font-variant-numeric: lining-nums tabular-nums; }
#tafel .zielzahl span { font-size: 14px; color: var(--mute); }
#tafel .neu { display: grid; gap: 3px; text-align: left; padding: 8px 10px; border-left: 4px solid var(--akzent); background: rgba(142, 90, 28, .06); border-radius: 0 8px 8px 0; }
#tafel .neu b { font-size: 16px; } #tafel .neu span { font-size: 14px; line-height: 1.35; }
#tafel .rechnung { width: 100%; border-collapse: collapse; font-size: 15px; } #tafel .rechnung td { padding: 4px 6px; border-bottom: 1px solid var(--rand); text-align: left; }
#tafel .rechnung td:last-child { text-align: right; font-variant-numeric: lining-nums tabular-nums; } #tafel .rechnung .summe td { font-weight: 700; border-bottom: 0; }
#tafel .knopf { justify-self: center; min-height: 44px; padding: 0 22px; }
.sterne { display: inline-flex; gap: 3px; justify-content: center; }
.sterne .st { width: 26px; height: 26px; fill: rgba(0, 0, 0, .15); stroke: var(--mute); stroke-width: 1.2; }
.sterne .st.an { fill: #e8b030; stroke: #a8780c; }

#wahl { position: absolute; inset: 0; z-index: 3; overflow: auto; padding: 16px; background: var(--panel2); border-radius: 16px; scrollbar-width: thin; scrollbar-color: var(--akzent) rgba(0, 0, 0, .12); }
#wahl[hidden] { display: none; }
#wahl::-webkit-scrollbar, #tafel .schild::-webkit-scrollbar { width: 8px; } #wahl::-webkit-scrollbar-thumb, #tafel .schild::-webkit-scrollbar-thumb { background: var(--akzent); border-radius: 4px; }
#wahl::-webkit-scrollbar-track, #tafel .schild::-webkit-scrollbar-track { background: rgba(0, 0, 0, .12); }
#wahl h2 { margin: 0 0 12px; text-align: center; font: 800 24px/1.2 var(--kopf); color: var(--akzent); }
#wahl h2 small { font-size: 15px; color: var(--mute); font-weight: 600; margin-left: 6px; }
.auftraege { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.auftrag { position: relative; display: grid; justify-items: center; gap: 3px; padding: 10px 8px 8px; border-radius: 10px; border: 2px solid var(--rand); background: var(--zettel); color: var(--zettelText); font-family: var(--kopf); min-height: 96px; }
.auftrag:hover { border-color: var(--akzent); }
.auftrag b { position: absolute; left: 8px; top: 6px; font: 800 15px var(--kopf); color: var(--akzent); }
.auftrag .an { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; hyphens: auto; max-width: 100%; } .auftrag .zz { font-size: 14px; color: var(--mute); }
.auftrag .sterne .st { width: 16px; height: 16px; }
.kurz { padding: 10px 12px; border-radius: 10px; background: rgba(142, 90, 28, .08); border-left: 4px solid var(--akzent); margin-bottom: 10px; }

#kopf { overflow: visible; }
#kopf.erledigt::after { content: 'ERLEDIGT'; position: absolute; right: 10px; top: 50%; padding: 1px 8px; border: 3px solid #b3261e; border-radius: 4px; color: #b3261e;
  font: 800 18px/1.1 var(--kopf); letter-spacing: 2px; background: rgba(255, 250, 240, .75); transform: translateY(-50%) rotate(-12deg); animation: stempel .32s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stempel { from { transform: translateY(-50%) rotate(-12deg) scale(2.4); opacity: 0; } to { transform: translateY(-50%) rotate(-12deg) scale(1); opacity: 1; } }

.kapitel { border: 2px solid var(--rand); border-radius: 12px; padding: 6px 10px 10px; margin-bottom: 12px; background: rgba(255, 255, 255, .2); }
html[data-ansicht="nacht"] .kapitel { background: rgba(0, 0, 0, .2); }
.kapitel h3 { margin: 4px 0 8px; font: 700 18px/1.2 var(--kopf); color: var(--akzent2); }
.kapitel h3 small { font-size: 14px; color: var(--mute); font-weight: 600; margin-left: 6px; }

@media (pointer: coarse) { #tafel .zu { width: 44px; height: 44px; margin: -10px -10px -40px 0; } }
.wz.zu { opacity: .42; } .wz.zu .anz { background: #55504a; } .wz.zu .anz svg { width: 11px; height: 11px; color: #f2e6cf; vertical-align: -1px; }
.auftrag.zuletzt { border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(201, 154, 62, .45); }
.auftrag.zuletzt::after { content: 'zuletzt'; position: absolute; right: 6px; top: 6px; font: 700 11px var(--kopf); color: var(--akzent); }
#meld.imGlas { justify-content: flex-end; } #meld.imGlas .m:not(:nth-last-child(-n+2)) { display: none; }
#kSterne { position: absolute; left: 0; top: calc(100% + 4px); display: flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 4px; white-space: nowrap;
  background: var(--zettel); color: var(--zettelText); font: 700 13px/18px var(--kopf); box-shadow: 0 3px 8px rgba(0, 0, 0, .25); }
#kSterne[hidden] { display: none; } #kSterne .sterne .st { width: 14px; height: 14px; } #kSterne span { font-size: 13px; color: var(--zettelText); } #kSterne .eng { color: #b3261e; }
#kSterne b { font-weight: 700; } #kSterne .kurz { display: none; }
#kopf.hochK #kSterne { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); padding: 3px 7px; }
#kopf.hochK #kSterne .lang { display: none; } #kopf.hochK #kSterne .kurz { display: inline; }
#kopf.hochK { max-width: calc(100% - 108px); } #kopf.hochK #kSterne { gap: 4px; padding: 3px 6px; } #kopf.hochK #kSterne .sterne { gap: 1px; } #kopf.hochK #kSterne .sterne .st { width: 11px; height: 11px; }
#kopf.hochK #kName, #kopf.hochK #kWerte { display: block; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#kopf #kSterne b { font-size: 13px; line-height: 18px; overflow: visible; } #kopf #kSterne > span { display: inline; color: var(--zettelText); font-size: 13px; }
