/* LaserWerk 1v1 - created by AnnoBoy 2026 */
@font-face { font-family:"Montserrat"; font-weight:400; font-display:swap; src:url(schriften/montserrat-latin-400-normal.woff) format("woff"); }
@font-face { font-family:"Montserrat"; font-weight:700; font-display:swap; src:url(schriften/montserrat-latin-700-normal.woff) format("woff"); }

body.dunkel { --bg:#120c0a; --panel:#1d1512; --panel2:#2a1e19; --rand:#43302a; --text:#fbefe8; --leise:#c6a99c; --knopf:#33241e; --knopfh:#473228;
  --akz1:#ff7a18; --akz2:#ff3d5a; --akz3:#ffd166; --gruen:#22c55e; --schatten:rgba(0,0,0,.55); --flaeche:#231915; --tisch:#2b211c; --raster:rgba(255,200,160,.07); --raster2:rgba(255,200,160,.16); }
body.hell   { --bg:#fff7f1; --panel:#ffffff; --panel2:#fff0e6; --rand:#f1d5c4; --text:#2a1a12; --leise:#8a6656; --knopf:#fff1e7; --knopfh:#ffe1cc;
  --akz1:#ea580c; --akz2:#e11d48; --akz3:#d97706; --gruen:#16a34a; --schatten:rgba(150,70,20,.16); --flaeche:#f3e9e2; --tisch:#ffffff; --raster:rgba(120,60,20,.07); --raster2:rgba(120,60,20,.18); }
* { box-sizing:border-box; }
html, body { margin:0; height:100%; }
body { background:var(--bg); color:var(--text); font:14px/1.4 "Segoe UI", Montserrat, system-ui, sans-serif; -webkit-tap-highlight-color:transparent; overflow:hidden; }
#app { display:flex; flex-direction:column; gap:8px; padding:10px 12px 6px; height:100vh; }
h1, h2, h3 { margin:0; }
h2 { font-size:17px; display:flex; align-items:center; gap:8px; margin-bottom:10px; }
h3 { font-size:14px; margin:4px 0 8px; }
.leise { color:var(--leise); }
.klein { font-size:12px; margin:4px 0; }
.luecke { flex:1; }
[hidden] { display:none !important; }

/* Kopf */
.kopf { display:flex; align-items:center; gap:8px; min-height:60px; border-radius:16px; padding:6px 14px; flex-wrap:wrap; flex:none;
  background:linear-gradient(100deg,#7c1d0a 0%,#d9480f 38%,#f97316 62%,#e11d48 100%); color:#fff; box-shadow:0 8px 24px var(--schatten); }
.kopf h1 { font-size:23px; letter-spacing:.3px; font-family:Montserrat, "Segoe UI", sans-serif; }
.kopf p { margin:0; font-size:12px; opacity:.92; }
.logo { width:44px; height:44px; flex:none; filter:drop-shadow(0 0 6px rgba(255,209,102,.7)); }
.logo svg { width:100%; height:100%; }
.kopfknopf { color:#fff !important; background:rgba(255,255,255,.14) !important; border:1px solid rgba(255,255,255,.3) !important; }
.kopfknopf:hover { background:rgba(255,255,255,.28) !important; }

/* Knöpfe & Felder */
button, .knopf { font:inherit; font-weight:600; color:var(--text); background:var(--knopf); border:1px solid var(--rand); border-radius:10px;
  padding:6px 11px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; justify-content:center; min-height:32px;
  touch-action:manipulation; user-select:none; -webkit-user-select:none; transition:background .15s, transform .1s; }
button:hover, .knopf:hover { background:var(--knopfh); }
button:active { transform:scale(.97); }
button:disabled { opacity:.4; cursor:default; transform:none; }
button.haupt { background:linear-gradient(135deg,var(--akz1),var(--akz2)); color:#fff; border:none; }
button.haupt:hover { filter:brightness(1.08); }
button.gruen { background:linear-gradient(135deg,#16a34a,#22c55e); }
button.rotknopf { background:linear-gradient(135deg,#b91c1c,#ef4444); color:#fff; border:none; }
.klein-knopf { padding:4px 9px; min-height:28px; font-size:13px; }
.klein-knopf.an { background:var(--akz1); color:#fff; }
input, select, textarea { font:inherit; color:var(--text); background:var(--panel2); border:1px solid var(--rand); border-radius:8px; padding:5px 7px; min-height:30px; }
input[type=range] { padding:0; accent-color:var(--akz1); background:none; border:none; }
input[type=checkbox] { accent-color:var(--akz1); width:16px; height:16px; min-height:0; }
textarea { width:100%; resize:vertical; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--akz1); outline-offset:0; }

/* Aufbau */
.mitte { flex:1; min-height:0; display:grid; grid-template-columns:52px 1fr 360px; gap:8px; }
.werkzeuge { display:flex; flex-direction:column; gap:5px; background:var(--panel); border:1px solid var(--rand); border-radius:14px; padding:6px; overflow:auto; }
.wz { width:38px; height:38px; padding:0; font-size:18px; border-radius:10px; flex:none; }
.wz.an { background:linear-gradient(135deg,var(--akz1),var(--akz2)); color:#fff; border:none; }
.wz.rot:hover:not(:disabled) { background:#ef4444; color:#fff; }
.wz-trenn { height:1px; background:var(--rand); margin:3px 2px; flex:none; }
.buehne-panel { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--panel); border:1px solid var(--rand); border-radius:14px; overflow:hidden; }
.objektleiste { display:flex; align-items:center; gap:8px; padding:6px 10px; border-bottom:1px solid var(--rand); flex-wrap:wrap; background:var(--panel2); }
.mini { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--leise); }
.mini input[type=number] { width:76px; }
.mini.breit { display:flex; width:100%; }
.mini.breit input { flex:1; }
.buehne { position:relative; flex:1; min-height:0; background:var(--flaeche); }
#leinwand { position:absolute; inset:0; width:100%; height:100%; touch-action:none; display:block; }
.ablage { pointer-events:none; user-select:none; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); text-align:center; background:var(--panel); border:2px dashed var(--akz1); border-radius:18px; padding:22px 30px; max-width:420px; box-shadow:0 10px 40px var(--schatten); }
.ablage h2 { justify-content:center; }
.ablage button { pointer-events:auto; }
.ablage-icon { font-size:40px; }
.buehne.zieht .ablage { display:block !important; }
.ansicht-knoepfe { position:absolute; right:10px; bottom:10px; display:flex; flex-direction:column; gap:6px; }
.rund { border-radius:50%; width:36px; height:36px; padding:0; }
.palette { display:flex; gap:4px; padding:6px 10px; border-top:1px solid var(--rand); flex-wrap:wrap; background:var(--panel2); }
.palette button { width:26px; height:26px; min-height:0; padding:0; border-radius:7px; border:2px solid rgba(0,0,0,.25); font-size:10px; color:#fff; text-shadow:0 0 2px #000; }
.palette button.an { outline:2px solid var(--text); outline-offset:1px; }

.seite { display:flex; flex-direction:column; min-height:0; background:var(--panel); border:1px solid var(--rand); border-radius:14px; overflow:hidden; }
.reiter { display:flex; gap:2px; padding:5px; background:var(--panel2); border-bottom:1px solid var(--rand); flex-wrap:wrap; }
.reiter button { flex:1; font-size:12px; padding:5px 4px; min-height:30px; border-radius:8px; background:transparent; border-color:transparent; }
.reiter button.an { background:linear-gradient(135deg,var(--akz1),var(--akz2)); color:#fff; }
.tafel { flex:1; overflow:auto; padding:10px; display:flex; flex-direction:column; gap:10px; }
.karte { background:var(--panel2); border:1px solid var(--rand); border-radius:12px; padding:9px; display:flex; flex-direction:column; gap:8px; }
.zeile { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.zeile input[type=text], .zeile input.breit { flex:1; }
.knopf-zeile { display:flex; gap:6px; flex-wrap:wrap; }
.knopf-zeile.rechts { justify-content:flex-end; margin-top:12px; }
.knopf-zeile.gross button { flex:1; min-height:38px; }
.feldgitter { display:grid; grid-template-columns:1fr 1fr; gap:6px 8px; }
.feldgitter.zwei { grid-template-columns:1.4fr 1fr; align-items:start; }
.feldgitter label { display:flex; flex-direction:column; gap:2px; font-size:12px; color:var(--leise); }
.feldgitter label input, .feldgitter label select { width:100%; }
.einheit { font-size:10px; opacity:.8; }
.haken-zeile { display:flex; gap:4px 12px; flex-wrap:wrap; }
.haken { display:inline-flex; align-items:center; gap:5px; font-size:12px; cursor:pointer; }

/* Ebenen */
.ebenen { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
.ebenen li { display:grid; grid-template-columns:24px 1fr auto auto 26px; gap:6px; align-items:center; padding:5px 7px; border-radius:9px; background:var(--panel2); border:1px solid var(--rand); cursor:pointer; font-size:12px; }
.ebenen li.an { border-color:var(--akz1); box-shadow:0 0 0 1px var(--akz1) inset; }
.ebenen li.aus { opacity:.5; }
.ebenen .farbe { width:22px; height:22px; border-radius:6px; border:2px solid rgba(0,0,0,.25); }
.ebenen .art { font-size:11px; color:var(--leise); }
.ebenen input[type=checkbox] { justify-self:center; }
.ebene-einst { border-top:1px solid var(--rand); padding-top:8px; display:flex; flex-direction:column; gap:8px; }
body.art-laser .nicht-laser, body:not(.art-laser) .nur-laser, body:not(.art-cnc) .nur-cnc, body.art-cnc .nicht-cnc,
body:not(.art-plotter) .nur-plotter, body.art-plotter .nicht-plotter { display:none !important; }
#dMaschine.p-servo .p-z, #dMaschine.p-zachse .p-s { display:none !important; }

/* Steuern */
.zustand { font-weight:700; padding:3px 10px; border-radius:20px; background:var(--knopf); border:1px solid var(--rand); font-size:12px; }
.zustand.idle { background:#14532d; color:#bbf7d0; border-color:#22c55e; }
.zustand.run { background:#7c2d12; color:#fed7aa; border-color:#f97316; }
.zustand.hold { background:#713f12; color:#fef08a; border-color:#eab308; }
.zustand.alarm { background:#7f1d1d; color:#fecaca; border-color:#ef4444; }
.pos { font-family:Consolas, "Cascadia Mono", monospace; font-size:15px; font-weight:600; }
.jog { display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap; }
.jog-pad { display:grid; grid-template-columns:repeat(3,42px); gap:4px; }
.jog-pad button { width:42px; height:42px; padding:0; font-size:18px; }
.jog-z { display:flex; flex-direction:column; gap:4px; }
.jog-z button { height:42px; font-size:12px; }
.jog-einst { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--leise); }
.jog-einst input { width:80px; }
.ursprung-wrap { display:flex; flex-direction:column; gap:3px; color:var(--leise); }
.ursprung { display:grid; grid-template-columns:repeat(3,20px); gap:4px; padding:4px; border:1px dashed var(--rand); border-radius:6px; width:max-content; }
.ursprung button { width:20px; height:20px; min-height:0; padding:0; border-radius:50%; }
.ursprung button.an { background:var(--akz1); border-color:var(--akz1); }
.ursprung.aus { opacity:.35; pointer-events:none; }
.fortschritt { position:relative; height:22px; background:var(--knopf); border-radius:11px; overflow:hidden; border:1px solid var(--rand); }
.fortschritt i { position:absolute; inset:0 auto 0 0; width:0; background:linear-gradient(90deg,var(--akz1),var(--akz2)); transition:width .2s; }
.fortschritt span { position:relative; display:block; text-align:center; font-size:12px; line-height:20px; font-weight:600; }

/* Kamera */
.klive { width:100%; aspect-ratio:16/9; background:#000; border-radius:8px; }
.kam-wrap { position:relative; background:#000; border-radius:10px; overflow:hidden; text-align:center; }
#dkBild { max-width:100%; max-height:60vh; cursor:crosshair; display:block; margin:0 auto; }

/* Material */
#mSuche { width:100%; }
.material { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
.material li { display:flex; gap:6px; align-items:center; padding:6px 8px; border-radius:9px; background:var(--panel2); border:1px solid var(--rand); font-size:12px; }
.material li b { display:block; font-size:13px; }
.material li div { flex:1; }

/* Konsole */
.konsole { flex:1; min-height:200px; background:#0b0807; color:#ffd9c2; border-radius:10px; padding:8px; font:12px/1.45 Consolas, "Cascadia Mono", monospace; overflow:auto; white-space:pre-wrap; word-break:break-all; }
.konsole .du { color:#7dd3fc; } .konsole .fehler { color:#fca5a5; } .konsole .leise { color:#8a7064; } .konsole .info { color:#fde68a; }

/* Dialoge */
.dialog { position:fixed; inset:0; background:rgba(10,5,3,.6); display:flex; align-items:center; justify-content:center; z-index:50; padding:14px; backdrop-filter:blur(3px); }
.dialog-box { background:var(--panel); border:1px solid var(--rand); border-radius:16px; padding:18px; width:min(440px,100%); max-height:94vh; overflow:auto; box-shadow:0 20px 60px var(--schatten); }
.dialog-box.breit { width:min(640px,100%); }
.dialog-box.gross { width:min(980px,100%); }
.dialog-box input[type=email], .dialog-box input[type=text] { width:100%; margin:6px 0; }
.kontur-wrap, .vorschau-wrap { background:#fff; border-radius:10px; overflow:hidden; margin-bottom:10px; text-align:center; }
#kVorschau { max-width:100%; max-height:45vh; display:block; margin:0 auto; }
.vorschau-wrap { background:#191210; }
#vLeinwand { width:100%; height:56vh; display:block; }
.fehler { color:#ef4444; font-weight:600; min-height:1em; }
.meldung { position:fixed; left:50%; bottom:46px; transform:translateX(-50%); background:var(--panel); border:1px solid var(--akz1); border-radius:12px; padding:10px 16px; z-index:80; box-shadow:0 10px 30px var(--schatten); max-width:min(640px,92vw); font-weight:600; }
.meldung.fehler { border-color:#ef4444; color:var(--text); }
.arbeit { position:fixed; inset:0; z-index:70; background:rgba(10,5,3,.5); display:flex; align-items:center; justify-content:center; }
.arbeit-box { background:var(--panel); border-radius:16px; padding:20px 26px; text-align:center; min-width:280px; border:1px solid var(--rand); display:flex; flex-direction:column; gap:10px; align-items:center; }
.arbeit-box .fortschritt { width:100%; }
.dreher { width:34px; height:34px; border-radius:50%; border:4px solid var(--rand); border-top-color:var(--akz1); animation:dreh 1s linear infinite; }
@keyframes dreh { to { transform:rotate(360deg); } }

/* Fuß */
.fuss { display:flex; align-items:center; gap:10px; font-size:12px; padding:2px 6px; flex:none; flex-wrap:wrap; }
.werbung { color:var(--akz3); text-decoration:none; }
.werbung:hover { text-decoration:underline; }
.signatur { color:var(--leise); }

.knopfgruppe { display:contents; }
body:not(.handy) .nur-menue { display:none; }
.nur-handy, .ablage-klein, .fach-griff, .fach-zu, .fach-knopf { display:none; }
body.kein-serial .nur-serial, body:not(.kein-serial) .ohne-serial { display:none !important; }
.hinweis-karte { border-color:var(--akz1); background:linear-gradient(135deg,rgba(249,115,22,.14),rgba(225,29,72,.10)); }
.hinweis-karte p { margin:0; }

@media (max-width:1100px) {
  body:not(.handy) .mitte { grid-template-columns:48px 1fr 300px; }
  body:not(.handy) .kt, body:not(.handy) .nur-breit { display:none; }
}

/* ===================================================== Handy (hoch und quer) */
body.handy { overflow:hidden; }
body.handy #app { height:100dvh; padding:6px 6px 0; gap:6px; }
body.handy .kopf { min-height:46px; padding:4px 8px 4px 10px; gap:8px; flex-wrap:nowrap; border-radius:14px; }
body.handy .kopf h1 { font-size:19px; }
body.handy .kopf p { font-size:10.5px; }
body.handy .logo { width:32px; height:32px; }
body.handy .nur-handy { display:inline-flex; }
body.handy #kMenue { min-height:38px; padding:4px 12px; font-size:18px; }
body.handy #kMenue .kt { font-size:14px; }
body.handy .knopfgruppe { display:none; }
body.handy .kopf.auf .knopfgruppe { display:grid; grid-template-columns:1fr 1fr; gap:6px; position:fixed; z-index:60; top:58px; right:8px; left:8px;
  max-width:440px; margin-left:auto; padding:10px; border-radius:16px; background:var(--panel); border:1px solid var(--rand); box-shadow:0 18px 50px var(--schatten); }
body.handy .kopf.auf .knopfgruppe .kopfknopf { color:var(--text) !important; background:var(--knopf) !important; border:1px solid var(--rand) !important; justify-content:flex-start; min-height:44px; font-size:15px; }
body.handy .kopf.auf .knopfgruppe .kt, body.handy .kopf.auf .knopfgruppe .nur-breit { display:inline; }
body.handy .kopf.auf .knopfgruppe .nur-breit { display:inline-flex; grid-column:1 / -1; }
body.handy .mitte { display:flex; gap:6px; min-height:0; }
body.handy .werkzeuge { flex:none; gap:6px; padding:5px; border-radius:12px; scrollbar-width:none; }
body.handy .werkzeuge::-webkit-scrollbar { display:none; }
body.handy .wz { width:44px; height:44px; font-size:19px; }
body.handy .buehne-panel { flex:1; min-height:0; min-width:0; border-radius:12px; }
body.handy .objektleiste { flex-wrap:nowrap; overflow-x:auto; gap:6px; padding:5px 8px; scrollbar-width:none; }
body.handy .objektleiste::-webkit-scrollbar { display:none; }
body.handy .objektleiste .mini input[type=number] { width:62px; min-height:34px; }
body.handy #mausPos, body.handy #oInfo { display:none; }
body.handy .palette { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; padding:6px 8px; gap:6px; }
body.handy .palette::-webkit-scrollbar { display:none; }
body.handy .palette button { width:34px; height:34px; flex:none; font-size:11px; }
body.handy .ablage { display:none !important; }
body.handy .ablage-klein { display:flex; position:absolute; left:8px; right:8px; top:8px; align-items:center; gap:8px; padding:8px 8px 8px 12px; border-radius:12px;
  background:var(--panel); border:1px solid var(--akz1); box-shadow:0 8px 24px var(--schatten); font-size:13px; font-weight:600; }
body.handy .ablage-klein span { flex:1; }
body.handy .ablage-klein[hidden] { display:none !important; }
body.handy .ansicht-knoepfe .rund { width:42px; height:42px; }
body.handy .fuss { font-size:10.5px; gap:6px; padding:2px 4px; flex-wrap:nowrap; overflow:hidden; white-space:nowrap; }
body.handy .fuss .werbung { overflow:hidden; text-overflow:ellipsis; min-width:0; flex:1; }
body.handy .fuss .luecke { display:none; }
body.handy .dialog { padding:6px; align-items:flex-end; }
body.handy .dialog-box { width:100% !important; max-height:92dvh; border-radius:18px 18px 12px 12px; padding:14px; }
body.handy input, body.handy select { min-height:38px; font-size:15px; }
body.handy .feldgitter label { font-size:12.5px; }
/* Fach (Ebenen, Steuern, Kamera …) */
body.handy .seite { position:fixed; z-index:45; background:var(--panel); box-shadow:0 -10px 40px var(--schatten); transition:height .22s ease, transform .22s ease; }
body.handy .seite .reiter button { min-height:40px; font-size:12.5px; }

/* --- hochkant: Werkzeuge unten als Reihe, Fach von unten */
body.handy.hoch #app { padding-bottom:58px; }
body.handy.hoch .mitte { flex-direction:column; }
body.handy.hoch .werkzeuge { order:2; flex-direction:row; overflow-x:auto; overflow-y:hidden; }
body.handy.hoch .wz-trenn { width:1px; height:auto; margin:4px 2px; }
body.handy.hoch .seite { left:0; right:0; bottom:0; border-radius:20px 20px 0 0; border-bottom:none; height:56px; }
body.handy.hoch .seite.halb { height:48dvh; }
body.handy.hoch .seite.voll { height:88dvh; }
body.handy.hoch .fach-griff { display:block; height:16px; flex:none; cursor:ns-resize; touch-action:none; padding-top:6px; }
body.handy.hoch .fach-griff i { display:block; width:46px; height:5px; border-radius:3px; margin:0 auto; background:var(--rand); }
body.handy.hoch .seite.zu .tafel { visibility:hidden; }
body.handy.hoch .seite .reiter { padding-top:2px; }

/* --- quer: Werkzeuge links, Fach rechts zum Aufklappen */
body.handy.quer #app { padding-bottom:4px; }
body.handy.quer .kopf { min-height:40px; }
body.handy.quer .kopf p { display:none; }
body.handy.quer .mitte { flex-direction:row; }
body.handy.quer .werkzeuge { flex-direction:column; overflow-y:auto; width:auto; }
body.handy.quer .wz { width:40px; height:40px; font-size:17px; }
body.handy.quer .seite { top:0; bottom:0; right:0; width:min(380px,62vw); border-radius:18px 0 0 18px; transform:translateX(0); }
body.handy.quer .seite.zu { transform:translateX(105%); }
body.handy.quer .fach-zu { display:inline-flex; position:absolute; right:8px; top:8px; z-index:2; width:34px; }
body.handy.quer .seite .reiter { padding-right:48px; }
body.handy.quer .fach-knopf { display:flex; position:fixed; right:10px; top:50%; transform:translateY(-50%); z-index:30; width:52px; height:52px; border-radius:50%;
  font-size:22px; padding:0; background:linear-gradient(135deg,var(--akz1),var(--akz2)); color:#fff; border:none; box-shadow:0 8px 24px var(--schatten); }
body.handy.quer .ansicht-knoepfe { right:72px; }
body.handy.quer .fuss { font-size:10px; }
body.handy .reiter button { white-space:nowrap; padding:5px 2px; font-size:12px; }
body.handy.quer .kopf { min-height:36px; padding:2px 8px; border-radius:12px; }
body.handy.quer .kopf h1 { font-size:16px; }
body.handy.quer .logo { width:26px; height:26px; }
body.handy.quer #kMenue { min-height:32px; }
body.handy.quer .objektleiste { padding:3px 8px; }
body.handy.quer .objektleiste .mini input[type=number], body.handy.quer .objektleiste input { min-height:28px; font-size:13px; }
body.handy.quer .palette { padding:3px 8px; }
body.handy.quer .palette button { width:28px; height:28px; }
body.handy.quer .ablage-klein { top:auto; bottom:8px; left:50%; right:auto; transform:translateX(-50%); width:min(460px,70%); font-size:12px; padding:5px 6px 5px 10px; }
body.handy.quer .ansicht-knoepfe { bottom:6px; gap:4px; }
body.handy.quer .ansicht-knoepfe .rund { width:36px; height:36px; }
body.handy.quer .kopf.auf .knopfgruppe { top:46px; }
body.handy.quer .objektleiste.leer { display:none; }
body.handy .seite .reiter { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
body.handy .seite .reiter button { flex:1 0 auto; }
