/* Zuschnitt-Optimierer – Werkstatt-Optik: Graphit, Stahlgrau, Zollstockgelb */
.zo-app {
  --zo-ink: #23272b;
  --zo-steel: #5e6670;
  --zo-line: #c9cdd1;
  --zo-panel: #f1f3f4;
  --zo-rule: #f2b705;
  --zo-rule-dark: #c99600;
  --zo-rest: #3f8f5a;
  --zo-err: #b3261e;
  --zo-joint: #2f6690;      /* Stahlblau: nur für Verbindungen */
  --zo-joint-light: #e3edf5;
  --zo-radius: 4px;
  --zo-font: "Bahnschrift", "DIN Alternate", "DIN 2014", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  font-family: var(--zo-font);
  color: var(--zo-ink);
  font-size: 1rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  max-width: 1100px;
  margin: 0 auto;
}
.zo-app *, .zo-app *::before, .zo-app *::after { box-sizing: border-box; }
.zo-app h2, .zo-app h3 { font-family: var(--zo-font); color: var(--zo-ink); margin: 0; letter-spacing: 0; }
.zo-app h2 { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.zo-app h3 { font-size: 1.1rem; font-weight: 600; }
.zo-app p { margin: 0; }
.zo-app button { font-family: inherit; }
.zo-app :focus-visible { outline: 3px solid var(--zo-rule); outline-offset: 2px; }

/* ---------- Kopf ---------- */
.zo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding-bottom: .9rem; border-bottom: 3px solid var(--zo-ink); }
.zo-unitbox { display: inline-flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--zo-steel); }
.zo-units { display: inline-flex; border: 1px solid var(--zo-ink); border-radius: var(--zo-radius); overflow: hidden; }
.zo-units button { border: 0; background: #fff; color: var(--zo-ink); padding: .4rem .85rem; font-size: .95rem; cursor: pointer; min-width: 2.8rem; }
.zo-units button + button { border-left: 1px solid var(--zo-ink); }
.zo-units button[aria-pressed="true"] { background: var(--zo-ink); color: #fff; }

/* ---------- Blöcke ---------- */
.zo-block { padding: 1.1rem 0; border-bottom: 1px solid var(--zo-line); }
.zo-block__head { margin-bottom: .7rem; }
.zo-block__head p { color: var(--zo-steel); font-size: .9rem; margin-top: .15rem; max-width: 70ch; }

.zo-rows { display: grid; gap: .5rem; }
.zo-row {
  display: grid; gap: .4rem .5rem; align-items: end;
  grid-template-columns: minmax(0, 1fr) 6.5rem 2.5rem;
  grid-template-areas: "len qty del" "lbl lbl lbl";
  padding: .6rem; background: var(--zo-panel); border-radius: var(--zo-radius);
}
[data-list="parts"] .zo-row { grid-template-columns: 2rem minmax(0, 1fr) 5.5rem 2.5rem; grid-template-areas: "pos len qty del" "pos lbl lbl lbl"; }
.zo-row--rest { background: #e7f1ea; box-shadow: inset 3px 0 0 var(--zo-rest); }
.zo-f { display: grid; gap: .15rem; margin: 0; min-width: 0; }
.zo-f > span:first-child { font-size: .8rem; color: var(--zo-steel); }
.zo-f--len { grid-area: len; } .zo-f--qty { grid-area: qty; } .zo-f--lbl { grid-area: lbl; }
.zo-pos { grid-area: pos; align-self: start; margin-top: 1.2rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: var(--c); font-weight: 700; font-size: .9rem; }
.zo-del { grid-area: del; width: 2.5rem; height: 2.5rem; border: 1px solid transparent; background: transparent; color: var(--zo-steel); font-size: 1.4rem; line-height: 1; border-radius: var(--zo-radius); cursor: pointer; }
.zo-del:hover { color: var(--zo-err); border-color: var(--zo-line); background: #fff; }

.zo-inp { position: relative; display: flex; align-items: center; }
.zo-app input[type="text"], .zo-app input:not([type]), .zo-app textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 1rem; color: var(--zo-ink);
  padding: .5rem .6rem; height: 2.5rem; margin: 0;
  background: #fff; border: 1px solid #9aa1a8; border-radius: var(--zo-radius); box-shadow: none;
}
.zo-app textarea { height: auto; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.zo-inp em { position: absolute; right: .6rem; font-style: normal; color: var(--zo-steel); font-size: .85rem; pointer-events: none; }
.zo-inp input[data-f="len"], .zo-set .zo-inp input { padding-right: 2.4rem; text-align: right; }
.zo-inp input[data-f="qty"] { text-align: right; }
.zo-app input.zo-invalid { border-color: var(--zo-err); box-shadow: 0 0 0 1px var(--zo-err); background: #fff6f5; }

.zo-addbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; align-items: flex-start; }
.zo-paste { flex: 1 1 100%; }
.zo-paste summary { list-style: none; display: inline-flex; }
.zo-paste summary::-webkit-details-marker { display: none; }
.zo-paste[open] summary { background: var(--zo-panel); }
.zo-paste__body { display: grid; gap: .5rem; margin-top: .5rem; max-width: 40rem; }
.zo-paste__body label { font-size: .9rem; color: var(--zo-steel); }
.zo-paste__body code { background: var(--zo-panel); padding: 0 .3em; border-radius: 2px; }
.zo-paste__body .zo-btn { justify-self: start; }

.zo-setgrid { display: grid; gap: .8rem 1.2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.zo-set { display: grid; gap: .2rem; }
.zo-set label { font-weight: 600; font-size: .95rem; }
.zo-set small { color: var(--zo-steel); font-size: .8rem; }

/* ---------- Buttons ---------- */
.zo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.5rem; padding: .45rem .95rem; border: 1px solid var(--zo-ink); border-radius: var(--zo-radius);
  background: #fff; color: var(--zo-ink); font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.zo-btn:hover { background: var(--zo-panel); }
.zo-btn--ghost { border-color: var(--zo-line); font-weight: 500; }
.zo-btn--go {
  min-height: 3rem; padding: .6rem 1.6rem; font-size: 1.05rem; border: 0;
  background: var(--zo-rule); color: var(--zo-ink);
  box-shadow: inset 0 -3px 0 var(--zo-rule-dark);
}
.zo-btn--go:hover { background: #ffc61a; }
.zo-busy .zo-btn--go { opacity: .6; cursor: progress; }
.zo-link { border: 0; background: none; padding: 0; color: var(--zo-ink); text-decoration: underline; cursor: pointer; font-size: .9rem; }
.zo-run { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: 1.2rem 0 .4rem; }
.zo-status { color: var(--zo-steel); font-size: .9rem; }

.zo-msg { margin: .6rem 0; padding: .7rem .9rem; border-radius: var(--zo-radius); border-left: 4px solid var(--zo-steel); background: var(--zo-panel); font-size: .95rem; }
.zo-msg--err { border-left-color: var(--zo-err); background: #fbeceb; }
.zo-msg--warn { border-left-color: var(--zo-rule-dark); background: #fdf5dc; }

/* ---------- Ergebnis ---------- */
.zo-result { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 3px solid var(--zo-ink); scroll-margin-top: 1rem; }
.zo-printhead { display: none; }
.zo-sum { display: grid; gap: 1rem 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .zo-sum { grid-template-columns: minmax(14rem, 1fr) 2fr; } }
.zo-sum__need ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .2rem; }
.zo-sum__need li { font-size: 1.2rem; }
.zo-sum__need strong { display: inline-block; min-width: 3.2rem; }
.zo-sum__nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .8rem 1.2rem; margin: 0; }
.zo-sum__joints dd { color: var(--zo-ink); }
.zo-compare { grid-column: 1 / -1; padding: .6rem .8rem; background: var(--zo-panel); border-left: 4px solid var(--zo-rule); font-size: .92rem; border-radius: var(--zo-radius); }
.zo-sum__nums div { border-top: 1px solid var(--zo-line); padding-top: .4rem; }
.zo-sum__nums dt { font-size: .85rem; color: var(--zo-steel); }
.zo-sum__nums dd { margin: 0; font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.zo-sum__nums small { display: block; font-size: .8rem; font-weight: 400; color: var(--zo-steel); }
.zo-sum__note { grid-column: 1 / -1; font-size: .9rem; color: var(--zo-steel); }

.zo-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; margin: 1.2rem 0 .6rem; padding: .6rem 0; border-top: 1px solid var(--zo-line); border-bottom: 1px solid var(--zo-line); }
.zo-tools__btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.zo-switch { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .95rem; }
.zo-switch input { width: 1.15rem; height: 1.15rem; accent-color: var(--zo-ink); }

.zo-progress { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-bottom: 1rem; font-size: .9rem; color: var(--zo-steel); }
.zo-progress__bar { flex: 1 1 12rem; height: .5rem; background: var(--zo-panel); border-radius: 99px; overflow: hidden; }
.zo-progress__bar span { display: block; height: 100%; background: var(--zo-rest); transition: width .25s ease; }

.zo-plan__title { margin-top: .4rem; }
.zo-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .4rem 0 .8rem; font-size: .85rem; color: var(--zo-steel); }
.zo-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.zo-sw { display: inline-block; width: 1.4rem; height: .9rem; border: 1px solid var(--zo-ink); }
.zo-sw--kerf { width: .3rem; background: var(--zo-ink); }

.zo-plan { display: grid; gap: .9rem; }
.zo-grp { padding: .8rem .8rem .7rem; background: var(--zo-panel); border-radius: var(--zo-radius); break-inside: avoid; page-break-inside: avoid; }
.zo-grp.is-done { opacity: .6; }
.zo-grp__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; margin-bottom: .35rem; }
.zo-grp__n { font-size: 1.35rem; font-weight: 700; min-width: 2.2rem; }
.zo-grp__stock { font-weight: 600; }
.zo-grp__util { margin-left: auto; font-size: .85rem; color: var(--zo-steel); }
.zo-grp__head .zo-chk { margin-left: auto; }

/* Zollstock-Lineal: das prägende Element */
.zo-track { min-width: 12rem; }
.zo-ruler {
  position: relative; height: 1.35rem;
  background-color: var(--zo-rule);
  background-image: linear-gradient(90deg, rgba(35,39,43,.55) 1px, transparent 1px);
  background-size: var(--minor) 35%;
  background-repeat: repeat-x;
  background-position: 0 0;
  border-radius: 2px 2px 0 0;
}
.zo-tick { position: absolute; top: 0; height: 70%; width: 1px; background: var(--zo-ink); }
.zo-tick i { position: absolute; left: 3px; top: 1px; font-style: normal; font-size: .68rem; font-weight: 600; line-height: 1; white-space: nowrap; color: var(--zo-ink); }

.zo-bar { display: flex; height: 3.1rem; background: #fff; border: 1px solid var(--zo-ink); border-top: 0; overflow: hidden; }
.zo-seg { flex: 0 1 auto; min-width: 0; height: 100%; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border: 0; padding: 0 2px; margin: 0; font: inherit; color: var(--zo-ink); line-height: 1.1; }
.zo-seg--part { background: var(--c); }
.zo-seg--part b { font-size: .95rem; }
.zo-seg--part span { font-size: .72rem; white-space: nowrap; }
.zo-seg--s span { display: none; }
.zo-seg--xs b, .zo-seg--xs span { display: none; }
button.zo-seg--part { cursor: pointer; }
button.zo-seg--part:hover { filter: brightness(.95); }
.zo-seg--part.is-done { background-image: linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)); }
.zo-seg--part.is-done::after { content: "✓"; position: absolute; top: 1px; right: 3px; font-size: .8rem; font-weight: 700; color: var(--zo-rest); }
.zo-kerf { flex: 0 0 auto; min-width: 2px; height: 100%; background: var(--zo-ink); }
.zo-seg--trim, .zo-sw--trim { background: repeating-linear-gradient(135deg, var(--zo-steel) 0 2px, #fff 2px 5px); }
.zo-seg--waste, .zo-sw--waste { background: repeating-linear-gradient(45deg, var(--zo-ink) 0 1.5px, #fff 1.5px 6px); }
.zo-seg--rest, .zo-sw--rest { background: repeating-linear-gradient(90deg, #e7f1ea 0 6px, #cfe5d6 6px 8px); box-shadow: inset 0 0 0 2px var(--zo-rest); }

.zo-seq { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: .5rem 0 0; padding: 0; font-size: .88rem; }
.zo-seq li { display: inline-flex; align-items: center; gap: .3rem; }
.zo-seq li i, .zo-dot { font-style: normal; display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .25rem; border-radius: 99px; background: var(--c); font-weight: 700; font-size: .78rem; }
.zo-seq li span { color: var(--zo-steel); }
.zo-seq__trim { color: var(--zo-steel); }
.zo-seq__rest { color: var(--zo-rest); font-weight: 600; }
.zo-seq__waste { color: var(--zo-steel); }

.zo-grp__done { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .55rem; font-size: .85rem; color: var(--zo-steel); }
.zo-grp__done > span { margin-right: .2rem; }
.zo-chk { min-width: 2.2rem; height: 2.2rem; padding: 0 .4rem; border: 1.5px solid var(--zo-ink); border-radius: var(--zo-radius); background: #fff; color: var(--zo-ink); font-weight: 600; cursor: pointer; font-size: .9rem; }
.zo-chk.is-done { background: var(--zo-rest); border-color: var(--zo-rest); color: #fff; }

.zo-after { display: grid; gap: 1.2rem 2rem; margin-top: 1.6rem; }
@media (min-width: 720px) { .zo-after { grid-template-columns: 2fr 1fr; } }
.zo-after h3 { margin-bottom: .5rem; }
.zo-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0; }
.zo-table th, .zo-table td { padding: .4rem .5rem; border: 0; border-bottom: 1px solid var(--zo-line); text-align: left; vertical-align: middle; background: transparent; }
.zo-table th { font-weight: 600; color: var(--zo-steel); font-size: .82rem; border-bottom: 2px solid var(--zo-ink); }
.zo-table .zo-num { text-align: right; }
.zo-table tr.is-missing td { color: var(--zo-err); font-weight: 600; }
.zo-rests { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.zo-rests li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .6rem; background: #e7f1ea; border-left: 3px solid var(--zo-rest); font-weight: 600; }
.zo-rests small { font-weight: 400; color: var(--zo-steel); }

/* ---------- Breitere Bildschirme ---------- */
@media (min-width: 640px) {
  .zo-row { grid-template-columns: minmax(0, 12rem) 7rem minmax(0, 1fr) 2.5rem; grid-template-areas: "len qty lbl del"; }
  [data-list="parts"] .zo-row { grid-template-columns: 2rem minmax(0, 12rem) 6rem minmax(0, 1fr) 2.5rem; grid-template-areas: "pos len qty lbl del"; }
  .zo-pos { margin-top: 0; align-self: end; margin-bottom: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .zo-progress__bar span { transition: none; }
}

/* ---------- Druck ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  .zo-print-hide { display: none !important; }
  body.zo-printing, .zo-print-path { margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; max-width: none !important; width: auto !important; background: #fff !important; }
  .zo-app { max-width: none; font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .zo-noprint { display: none !important; }
  .zo-result { margin: 0; padding: 0; border: 0; }
  .zo-printhead { display: block; border-bottom: 2px solid #000; padding-bottom: 3mm; margin-bottom: 4mm; }
  .zo-printhead h2 { font-size: 16pt; }
  .zo-printhead p { font-size: 9pt; }
  .zo-sum__nums dd { font-size: 13pt; }
  .zo-sum__need li { font-size: 11pt; }
  .zo-grp { background: #fff; border: 1px solid #999; padding: 2.5mm; }
  .zo-grp.is-done { opacity: 1; }
  .zo-bar { height: 11mm; }
  .zo-chk { min-width: 7mm; height: 7mm; font-size: 8pt; }
  .zo-chk.is-done { background: #fff; color: #000; border-color: #000; }
  .zo-chk.is-done::after { content: " ✓"; }
  .zo-plan__title { break-after: avoid; }
  .zo-after { grid-template-columns: 2fr 1fr; break-before: auto; }
  .zo-table { font-size: 9pt; }
  .zo-msg { border: 1px solid #000; }
}

/* ---------- Stückeln ---------- */
.zo-switch--big { font-weight: 600; font-size: 1.05rem; }
.zo-switch--big input { width: 1.3rem; height: 1.3rem; }
.zo-splice__hint { color: var(--zo-steel); font-size: .9rem; margin-top: .3rem; max-width: 70ch; }
.zo-splice__body { display: none; margin-top: .9rem; gap: .9rem; }
.zo-splice.is-on .zo-splice__body { display: grid; }
.zo-radio { border: 0; margin: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.zo-radio legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: .4rem; }
.zo-radio label { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .7rem; background: var(--zo-panel); border-radius: var(--zo-radius); cursor: pointer; border: 1px solid transparent; }
.zo-radio label:has(input:checked) { border-color: var(--zo-ink); background: #fff; }
.zo-radio input { width: 1.15rem; height: 1.15rem; margin: .15rem 0 0; accent-color: var(--zo-ink); flex: none; }
.zo-radio small { display: block; color: var(--zo-steel); font-size: .82rem; }
@media (min-width: 640px) { .zo-radio { grid-template-columns: 1fr 1fr; } .zo-radio legend { grid-column: 1 / -1; } }

.zo-lock { grid-area: lock; display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; white-space: nowrap; cursor: pointer; min-height: 2.5rem; }
.zo-lock input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--zo-ink); }
[data-list="parts"] .zo-row--lock { grid-template-areas: "pos len qty del" "pos lbl lbl lbl" "pos lock lock lock"; }
@media (min-width: 640px) {
  [data-list="parts"] .zo-row--lock { grid-template-columns: 2rem minmax(0, 12rem) 6rem minmax(0, 1fr) auto 2.5rem; grid-template-areas: "pos len qty lbl lock del"; }
}

.zo-seg--joint { box-shadow: inset 0 0 0 2px var(--zo-joint); }
.zo-seg--part sup { font-size: .68rem; font-weight: 700; margin-left: 2px; vertical-align: super; color: #fff; background: var(--zo-joint); border-radius: 2px; padding: 0 2px; }
.zo-sw--joint { background: #fff; box-shadow: inset 0 0 0 2px var(--zo-joint); }
.zo-segid { font-size: .78rem; padding: 0 .3rem; color: #fff; background: var(--zo-joint); border-radius: 3px; }

/* Verbinder (Muffe) */
.zo-coupler {
  flex: 0 0 auto; display: inline-block; width: .8rem; height: 2.9rem; margin: 0 -.15rem; z-index: 1; position: relative;
  background: linear-gradient(90deg, #24537a, var(--zo-joint) 35%, #5b8db5 55%, var(--zo-joint) 75%, #24537a);
  border-radius: 3px; box-shadow: 0 0 0 1.5px #fff;
}

/* Kennzahl Verbindungen */
.zo-jointbtn { display: inline-flex; align-items: center; gap: .45rem; padding: 0; border: 0; background: none; font: inherit; color: var(--zo-joint); cursor: pointer; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.zo-jointbtn .zo-coupler { width: .5rem; height: 1.35rem; margin: 0; box-shadow: none; }
.zo-jointbtn:hover { color: #24537a; }

/* Reiter */
.zo-tabs { display: flex; gap: 0; margin: 1rem 0 .4rem; border-bottom: 2px solid var(--zo-ink); }
.zo-tabs button {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.9rem; padding: .5rem 1rem; margin-bottom: -2px; font-size: 1rem; font-weight: 600; cursor: pointer;
  background: var(--zo-panel); color: var(--zo-steel); border: 2px solid transparent; border-bottom-color: var(--zo-ink); border-radius: var(--zo-radius) var(--zo-radius) 0 0;
}
@media (min-width: 640px) { .zo-tabs button { flex: 0 0 auto; min-width: 11rem; } }
.zo-tabs button[aria-selected="true"] { background: #fff; color: var(--zo-ink); border-color: var(--zo-ink); border-bottom-color: #fff; }
.zo-tabs__n { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 99px; background: var(--zo-joint); color: #fff; font-size: .8rem; }

/* Montage */
.zo-montage__hint { color: var(--zo-steel); font-size: .9rem; margin: .3rem 0 .9rem; max-width: 70ch; }
.zo-asm-list { display: grid; gap: .9rem; }
.zo-asm { padding: .8rem; background: var(--zo-joint-light); border-radius: var(--zo-radius); break-inside: avoid; page-break-inside: avoid; }
.zo-asm__head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin-bottom: .6rem; }
.zo-asm__id { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .4rem; border-radius: var(--zo-radius); background: var(--zo-joint); color: #fff; font-weight: 700; font-size: 1.05rem; }
.zo-asm__name { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.zo-asm__len { margin-left: auto; font-size: 1.25rem; font-weight: 700; }

.zo-pipe { display: flex; align-items: center; min-height: 3rem; }
.zo-pipe__seg {
  flex: 0 1 auto; min-width: 2.4rem; height: 2.3rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background-color: var(--c);
  background-image: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.1) 30%, rgba(0,0,0,0) 60%, rgba(0,0,0,.14) 100%);
  border-top: 1px solid rgba(35,39,43,.35); border-bottom: 1px solid rgba(35,39,43,.35);
  line-height: 1.05; overflow: hidden; color: var(--zo-ink);
}
.zo-pipe__seg.is-first { border-left: 1px solid rgba(35,39,43,.35); border-radius: 6px 0 0 6px; }
.zo-pipe__seg.is-last { border-right: 1px solid rgba(35,39,43,.35); border-radius: 0 6px 6px 0; }
.zo-pipe__seg b { font-size: .8rem; color: #fff; background: var(--zo-joint); border-radius: 2px; padding: 0 3px; }
.zo-pipe__seg span { font-size: .78rem; font-weight: 600; white-space: nowrap; margin-top: 2px; }
.zo-pipe__seg.is-narrow span { display: none; }

.zo-asm__steps { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .7rem 0 0; padding: 0; font-size: .9rem; }
.zo-asm__steps li { display: inline-flex; align-items: center; gap: .35rem; }
.zo-asm__steps small { color: var(--zo-steel); }
.zo-asm__plus { color: var(--zo-joint); font-weight: 700; }
.zo-asm__sum { font-weight: 600; }

@media print {
  .zo-splice { display: none; }
  .zo-panel[hidden] { display: block !important; }
  .zo-montage { margin-top: 6mm; }
  .zo-asm { background: #fff; border: 1px solid #999; }
  .zo-compare { border: 1px solid #999; border-left: 4px solid #000; }
}

/* Tabellen am Handy innerhalb der Breite halten */
.zo-after { grid-template-columns: minmax(0, 1fr); }
.zo-after > div, .zo-montage { min-width: 0; overflow-x: auto; }
@media (min-width: 720px) { .zo-after { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
@media (max-width: 560px) { .zo-table th, .zo-table td { padding: .35rem .3rem; } }

.zo-sum__joints .zo-link { color: var(--zo-joint); font-weight: 600; font-size: .85rem; margin-top: .1rem; }

/* ---------- Überstand ---------- */
.zo-ov { grid-area: ov; display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem .9rem; padding-top: .35rem; border-top: 1px dashed var(--zo-line); }
.zo-ov__len { display: grid; gap: .15rem; margin: 0; }
.zo-ov__len > span:first-child { font-size: .8rem; color: var(--zo-steel); }
.zo-ov__len input { text-align: right; padding-right: 2.4rem; }
.zo-chkl { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.5rem; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.zo-chkl input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--zo-ink); }
.zo-ov__cut { align-self: center; font-size: .85rem; font-weight: 600; color: var(--zo-ink); }
.zo-ov:not(.is-active) .zo-ov__len input { color: var(--zo-steel); }

[data-list="parts"] .zo-row { grid-template-areas: "pos len qty del" "pos lbl lbl lbl" "pos ov ov ov"; }
[data-list="parts"] .zo-row--lock { grid-template-areas: "pos len qty del" "pos lbl lbl lbl" "pos ov ov ov" "pos lock lock lock"; }
@media (min-width: 640px) {
  [data-list="parts"] .zo-row { grid-template-areas: "pos len qty lbl del" "pos ov ov ov ov"; }
  [data-list="parts"] .zo-row--lock { grid-template-areas: "pos len qty lbl lock del" "pos ov ov ov ov ov"; }
  .zo-pos { align-self: start; margin-top: 1.2rem; }
}

.zo-ovdef { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--zo-line); }
.zo-ovdef .zo-set { flex: 0 1 auto; }
.zo-ovdef__row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; }

/* Zonen im Balken und in der Rohrgrafik */
.zo-pipe__seg { position: relative; }
.zo-ovz {
  position: absolute; top: 0; bottom: 0; min-width: 3px; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.85) 0 2px, rgba(255,255,255,.3) 2px 5px);
}
.zo-ovz--f { left: 0; border-right: 1.5px dashed var(--zo-ink); }
.zo-ovz--b { right: 0; border-left: 1.5px dashed var(--zo-ink); }
.zo-seg--part b, .zo-seg--part span, .zo-pipe__seg b, .zo-pipe__seg span { position: relative; }
.zo-sw--ov { background: repeating-linear-gradient(135deg, #fff 0 2px, #cfd3d6 2px 5px); border-style: dashed; }
.zo-seq__fin { color: var(--zo-steel); }
.zo-app .zo-ov__len input, .zo-app .zo-ovdef__row input { text-align: right; padding-right: 2.4rem; }
.zo-nowrap { white-space: nowrap; }
.zo-bomnote { font-size: .8rem; color: var(--zo-steel); margin-top: .4rem; }

/* ---------- Einstellungen oben (Klappbereich) ---------- */
.zo-setbox { margin: .9rem 0 .2rem; border: 1px solid var(--zo-line); border-radius: var(--zo-radius); background: #fff; }
.zo-setbox__head {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; align-items: center;
  padding: .7rem .9rem; background: var(--zo-panel); border-radius: var(--zo-radius);
}
.zo-setbox__head::-webkit-details-marker { display: none; }
.zo-setbox__head::after {
  content: ""; grid-column: 2; grid-row: 1 / span 2; width: .6rem; height: .6rem; margin-right: .2rem;
  border-right: 2px solid var(--zo-ink); border-bottom: 2px solid var(--zo-ink); transform: rotate(45deg) translateY(-2px); transition: transform .15s ease;
}
.zo-setbox[open] > .zo-setbox__head { border-radius: var(--zo-radius) var(--zo-radius) 0 0; border-bottom: 1px solid var(--zo-line); }
.zo-setbox[open] > .zo-setbox__head::after { transform: rotate(-135deg) translate(-2px, 0); }
.zo-setbox__title { font-weight: 700; font-size: 1.05rem; }
.zo-setbox__sum { grid-column: 1; font-size: .85rem; color: var(--zo-steel); }
.zo-setbox__body { padding: .2rem .9rem .9rem; }
.zo-setsec { padding-top: .8rem; }
.zo-setsec + .zo-setsec { margin-top: 1rem; border-top: 1px solid var(--zo-line); }
.zo-setsec > h3 { font-size: 1rem; margin-bottom: .6rem; }
.zo-setsec.zo-splice { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .zo-setbox__head::after { transition: none; } }

/* vorne/hinten immer nebeneinander */
.zo-sides { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: .9rem; white-space: nowrap; }
.zo-ov { align-items: flex-end; }
.zo-ov__len { width: 7.5rem; }
.zo-ov__cut { flex: 1 0 100%; align-self: auto; margin-top: -.1rem; }
.zo-ov__cut:empty { display: none; }
.zo-ovdef__row .zo-inp { width: 7.5rem; }
.zo-set .zo-chkl { font-weight: 400; font-size: .9rem; }

/* Überstands-Zonen: vergrößert, Text nur wenn breit genug */
.zo-ovz { min-width: .7rem; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.zo-ovz__t { font-style: normal; font-size: .62rem; font-weight: 700; color: var(--zo-ink); white-space: nowrap; padding: 0 2px 2px; background: rgba(255,255,255,.85); border-radius: 2px; margin-bottom: 2px; }
.zo-ovnote { font-size: .8rem; color: var(--zo-steel); margin: -.4rem 0 .8rem; }
.zo-coupler--sw { width: .4rem; height: .9rem; margin: 0; box-shadow: none; }
.zo-seq li { flex-wrap: wrap; }
.zo-seq li .zo-seq__fin { flex: 1 0 100%; padding-left: 1.65rem; font-size: .82rem; margin-top: -.1rem; }

/* ---------- Schnitte: echte Linien + Marken (drucken auch ohne Hintergrundgrafiken) ---------- */
.zo-kerf { border-left: 2px solid var(--zo-ink); box-sizing: border-box; }
.zo-barwrap { position: relative; padding-bottom: .55rem; }
.zo-cutlayer { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
.zo-cutmark { position: absolute; top: 0; bottom: .1rem; width: 0; border-left: 2px solid var(--zo-ink); transform: translateX(-1px); }
.zo-cutmark::after {
  content: ""; position: absolute; bottom: -.1rem; left: -6px; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 7px solid var(--zo-ink);
}
.zo-tick { background: none; border-left: 1px solid var(--zo-ink); }

.zo-marks { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .45rem; margin-top: .45rem; font-size: .85rem; }
.zo-marks__t { color: var(--zo-steel); margin-right: .2rem; }
.zo-marks b { font-weight: 700; }
.zo-marks i { font-style: normal; color: var(--zo-line); }

/* ---------- Druckauswahl ---------- */
.zo-printmenu { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.1rem; margin: -.2rem 0 .8rem; padding: .6rem .8rem; background: var(--zo-panel); border: 1px solid var(--zo-line); border-radius: var(--zo-radius); }
.zo-printmenu__t { font-weight: 600; font-size: .9rem; flex: 1 0 100%; }
.zo-btn--sm { min-height: 2.4rem; padding: .35rem 1rem; font-size: .95rem; }
.zo-tools .zo-btn[aria-expanded="true"] { background: var(--zo-ink); color: #fff; }

@media print {
  /* Auswahl */
  .zo-p-noplan .zo-panel:not(.zo-montage) { display: none !important; }
  .zo-p-nomont .zo-montage { display: none !important; }
  .zo-p-nobom .zo-after { display: none !important; }

  /* druckfest: Rahmen statt Hintergründe */
  .zo-bar { border: 1.5px solid #000; border-top: 0; }
  .zo-ruler { border: 1px solid #000; border-bottom: 0; }
  .zo-kerf { border-left: 2px solid #000; }
  .zo-cutmark { border-left-color: #000; }
  .zo-cutmark::after { border-bottom-color: #000; }
  .zo-seg--rest { border: 2px solid var(--zo-rest); box-shadow: none; }
  .zo-seg--waste { border: 1px dashed #000; }
  .zo-seg--trim { border: 1px dashed #000; }
  .zo-seg--joint { border: 2px solid var(--zo-joint); box-shadow: none; }
  .zo-seg--part sup, .zo-segid, .zo-pipe__seg b { color: #000; background: none; border: 1px solid #000; }
  .zo-sw { border: 1px solid #000; }
  .zo-ovz { border-color: #000; }
  .zo-marks { font-size: 8.5pt; }

  /* Montage kompakt: eine Zeile pro Teil */
  .zo-montage { break-before: auto; }
  .zo-montage .zo-plan__title { break-after: avoid; }
  .zo-asm-list { gap: 2mm; }
  .zo-asm { display: grid; grid-template-columns: 52mm 1fr; column-gap: 4mm; align-items: center; padding: 2mm 3mm; background: #fff; border: 1px solid #999; }
  .zo-asm__head { grid-column: 1; grid-row: 1 / span 2; margin: 0; gap: 1mm 2mm; }
  .zo-asm__id { min-width: 7mm; height: 7mm; font-size: 10pt; color: #000; background: none; border: 1.5px solid #000; }
  .zo-asm__name { font-size: 9pt; }
  .zo-asm__len { margin-left: 0; font-size: 10pt; flex: 1 0 100%; }
  .zo-pipe { grid-column: 2; min-height: 8mm; }
  .zo-pipe__seg { height: 6.5mm; border: 1px solid #000; }
  .zo-pipe__seg span { font-size: 7pt; }
  .zo-coupler { height: 8.5mm; width: 2.5mm; border: 1.5px solid #000; box-shadow: none; }
  .zo-asm__steps { grid-column: 2; margin-top: 1mm; font-size: 8pt; }
}

/* ---------- Überstand: unterschiedlich vorne/hinten ---------- */
.zo-ov__t { flex: 1 0 100%; font-size: .8rem; color: var(--zo-steel); margin-bottom: -.2rem; }
.zo-ov__inp { width: 7.5rem; }
.zo-app .zo-ov__inp input, .zo-app .zo-ov__pair input { text-align: right; padding-right: 2.4rem; }
.zo-ov__pair { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.zo-ov__pair .zo-inp { width: 6.8rem; }
.zo-ov__diff { color: var(--zo-steel); }
.zo-ov.is-diff .zo-ov__diff { color: var(--zo-ink); }
.zo-ovdef__row [hidden] { display: none; }

/* ---------- Kleine Reste sichtbar halten ---------- */
.zo-seg--rest, .zo-seg--waste { min-width: .9rem; flex-shrink: 0; }

/* ---------- Schnittnummern ---------- */
.zo-barwrap { padding-bottom: 1.35rem; }
.zo-cutmark { bottom: 1.15rem; }
.zo-cutmark i {
  position: absolute; top: calc(100% + .45rem); left: 0; transform: translateX(-50%);
  font-style: normal; font-size: .62rem; font-weight: 700; line-height: 1; color: var(--zo-ink);
  min-width: .95rem; padding: 1px 2px; text-align: center; background: #fff; border: 1px solid var(--zo-ink); border-radius: 2px;
}
.zo-marks { gap: .25rem .4rem; }
.zo-marks b { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .4rem .05rem .1rem; border: 1px solid var(--zo-line); border-radius: 3px; background: #fff; }
.zo-marks__n { display: inline-grid; place-items: center; min-width: 1.05rem; height: 1.05rem; font-size: .66rem; font-weight: 700; border: 1px solid var(--zo-ink); border-radius: 2px; }
.zo-muted { color: var(--zo-steel); font-weight: 400; }

/* ---------- Gleiche Stangen: Rahmen + Teileliste ---------- */
.zo-grp--multi { border: 2px solid var(--zo-ink); background: #fff; }
.zo-grp--multi .zo-grp__head { padding-bottom: .4rem; border-bottom: 1px solid var(--zo-line); margin-bottom: .55rem; }
.zo-grp__same { font-size: .78rem; font-weight: 600; color: #fff; background: var(--zo-ink); padding: .1rem .45rem; border-radius: 3px; }
.zo-items { width: 100%; border-collapse: collapse; margin: .2rem 0 0; font-size: .9rem; }
.zo-items th { font-size: .72rem; font-weight: 600; color: var(--zo-steel); text-align: left; padding: .2rem .35rem; border: 0; border-bottom: 1px solid var(--zo-line); background: transparent; }
.zo-items td { padding: .3rem .35rem; border: 0; border-bottom: 1px solid var(--zo-line); vertical-align: top; background: transparent; }
.zo-items .zo-num { text-align: right; white-space: nowrap; }
.zo-items__c { font-weight: 700; white-space: nowrap; width: 1%; }
.zo-items__pos { white-space: nowrap; width: 1%; }
.zo-items__pos .zo-segid { margin-left: .2rem; }
.zo-items__len { font-weight: 600; width: 1%; }
.zo-items__lbl small { display: block; color: var(--zo-steel); font-size: .78rem; }
.zo-items__tot { color: var(--zo-steel); width: 1%; }
.zo-items__trim td, .zo-items__waste td { color: var(--zo-steel); }
.zo-items__rest td { color: var(--zo-rest); font-weight: 600; }
.zo-items tr:last-child td { border-bottom: 0; }

@media print {
  .zo-grp--multi { border: 2px solid #000; }
  .zo-grp__same { color: #000; background: none; border: 1px solid #000; }
  .zo-items { font-size: 8.5pt; }
  .zo-cutmark i { border-color: #000; }
}
.zo-items th { white-space: nowrap; }
.zo-items tr.has-sub td { border-bottom: 0; padding-bottom: .05rem; }
.zo-items__sub td { padding-top: 0; font-size: .78rem; color: var(--zo-steel); }

/* Max. Verbindungen je Position */
.zo-mj { display: grid; gap: .15rem; align-items: start; white-space: normal; min-height: 0; cursor: default; }
.zo-mj > span:first-child { font-size: .8rem; color: var(--zo-steel); }
.zo-mj .zo-inp { width: 8.5rem; }
.zo-app .zo-mj input { text-align: right; }
.zo-mj small { font-size: .75rem; color: var(--zo-steel); }
.zo-app [data-spj] { text-align: right; }
@media (min-width: 640px) { .zo-mj .zo-inp { width: 8rem; } }

/* ---------- Exakter Maßstab: keine Mindestbreiten im Balken ---------- */
.zo-bar > .zo-seg, .zo-bar > .zo-kerf { flex-grow: 0; flex-shrink: 0; }
.zo-seg--rest, .zo-seg--waste { min-width: 0; }
.zo-kerf { min-width: 0; border-left: 0; }
@media print { .zo-kerf { border-left: 0; } }

/* ---------- Verschnitt-Block ---------- */
.zo-after > div > h3 + .zo-waste, .zo-rests + h3 { margin-top: 1.2rem; }
.zo-waste { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.zo-waste li { display: grid; grid-template-columns: 1fr auto; gap: 0 .8rem; padding: .35rem .6rem; background: var(--zo-panel); border-left: 3px solid var(--zo-steel); font-size: .9rem; }
.zo-waste li b { text-align: right; }
.zo-waste li small { grid-column: 1 / -1; color: var(--zo-steel); font-size: .78rem; text-align: right; }
.zo-waste__total { border-left-color: var(--zo-ink) !important; font-weight: 600; }
.zo-waste__total b { font-size: 1.05rem; }
@media print { .zo-waste li { background: #fff; border: 1px solid #999; border-left: 3px solid #000; } }

/* ---------- Schwebende Leiste ---------- */
.zo-app.zo-float {
  position: fixed; left: 0; right: 0; top: 0; z-index: 99990; max-width: none; margin: 0;
  background: rgba(255,255,255,.97); border-bottom: 2px solid var(--zo-ink);
  box-shadow: 0 2px 10px rgba(35,39,43,.12);
  padding: calc(env(safe-area-inset-top, 0px) + .45rem) max(.75rem, env(safe-area-inset-right, 0px)) .45rem max(.75rem, env(safe-area-inset-left, 0px));
}
.zo-app.zo-float[hidden] { display: none; }
.zo-float__in { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.zo-float__stats { flex: 1 1 100%; font-size: .82rem; color: var(--zo-steel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zo-float__stats b { color: var(--zo-ink); }
.zo-float__nav, .zo-float__btns { display: flex; flex-wrap: wrap; gap: .35rem; }
.zo-float__btns { margin-left: auto; }
.zo-btn--xs { min-height: 2.2rem; padding: .25rem .65rem; font-size: .85rem; }
.zo-float .zo-btn[aria-expanded="true"] { background: var(--zo-ink); color: #fff; }
.zo-float .zo-printmenu { max-width: 1100px; margin: .45rem auto 0; }
@media (min-width: 760px) {
  .zo-float__stats { flex: 0 1 auto; margin-right: .4rem; font-size: .9rem; }
}
@media print { .zo-app.zo-float { display: none !important; } }

/* Leiste am Handy kompakt: Kennzahlen oben, alle Knöpfe in einer Zeile */
.zo-float__in { flex-wrap: wrap; }
.zo-float__nav, .zo-float__btns { flex-wrap: nowrap; }
.zo-float__btns { margin-left: auto; }
.zo-wide { display: none; }
@media (min-width: 560px) { .zo-wide { display: inline; } }
@media (max-width: 380px) { .zo-btn--xs { padding: .25rem .45rem; font-size: .8rem; } }

/* Plan darf nie breiter als der Bildschirm werden */
.zo-plan { grid-template-columns: minmax(0, 1fr); }
.zo-grp { min-width: 0; }
.zo-items th { white-space: normal; }
@media (max-width: 560px) {
  .zo-items { font-size: .84rem; }
  .zo-items th, .zo-items td { padding-left: .25rem; padding-right: .25rem; }
}
@media (max-width: 560px) {
  .zo-float__in { gap: .3rem .4rem; }
  .zo-float__nav, .zo-float__btns { gap: .3rem; }
  .zo-float .zo-btn--xs { padding: .2rem .5rem; font-size: .8rem; min-height: 2.1rem; }
}
