/* Laservorlagen – Bereich von Mak3rhub (Tokens, Schrift, Druckplatten-Hintergrund und Pill-Filter wie /style.css) */

/* Onest (SIL Open Font License) – selbst gehostet */
@font-face {
  font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/onest-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bed: #f1f5f5;
  --bed-glow: rgba(9, 117, 112, 0.17);
  --bed-glow-2: rgba(9, 117, 112, 0.11);
  --grain-opacity: 0.95;
  --grain-blend: multiply;
  --surface: #fafcfc;
  --surface-2: #e3eaea;
  --raised: #ffffff;
  --ink: #0f1d20;
  --ink-2: #44575b;
  --ink-3: #5f7276;
  --line: #d4dfe0;
  --line-strong: #b5c5c7;
  --accent: #097570;
  --accent-ink: #ffffff;
  --accent-soft: rgba(9, 117, 112, 0.1);
  --accent-glow: rgba(9, 117, 112, 0.35);
  --focus: #097570;
  --warn-bg: #f6ead0;
  --warn-ink: #6b4a10;
  /* Laser-Vorschau: Holz, Schnitt (rot), Gravur */
  --wood: #e6cd9f;
  --cut: #e0352b;
  --engrave: #3a2414;
  --stage-1: #ffffff;
  --stage-2: #e9eff0;
  --text: 'Onest', 'Helvetica Neue', system-ui, sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
  --maxw: 1480px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bed: #172226; --bed-glow: rgba(63, 217, 200, 0.11); --bed-glow-2: rgba(63, 217, 200, 0.05);
    --grain-opacity: 0.35; --grain-blend: screen;
    --surface: #1d2a2e; --surface-2: #273739; --raised: #223135;
    --ink: #e4eeee; --ink-2: #a8babc; --ink-3: #83999c; --line: #2d3f42; --line-strong: #3d5356;
    --accent: #3fd9c8; --accent-ink: #062321; --accent-soft: rgba(63, 217, 200, 0.12); --accent-glow: rgba(63, 217, 200, 0.45);
    --focus: #3fd9c8; --warn-bg: #33291a; --warn-ink: #f0d39a;
    --wood: #d8bc8a; --stage-1: #22343a; --stage-2: #172226;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bed: #172226; --bed-glow: rgba(63, 217, 200, 0.11); --bed-glow-2: rgba(63, 217, 200, 0.05);
  --grain-opacity: 0.35; --grain-blend: screen;
  --surface: #1d2a2e; --surface-2: #273739; --raised: #223135;
  --ink: #e4eeee; --ink-2: #a8babc; --ink-3: #83999c; --line: #2d3f42; --line-strong: #3d5356;
  --accent: #3fd9c8; --accent-ink: #062321; --accent-soft: rgba(63, 217, 200, 0.12); --accent-glow: rgba(63, 217, 200, 0.45);
  --focus: #3fd9c8; --warn-bg: #33291a; --warn-ink: #f0d39a;
  --wood: #d8bc8a; --stage-1: #22343a; --stage-2: #172226;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bed); color: var(--ink);
  font: 400 15px/1.55 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Druckplatte (PEI) als Hintergrund */
.bed {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; isolation: isolate;
  background:
    radial-gradient(60% 55% at 78% 18%, var(--bed-glow), transparent 70%),
    radial-gradient(40% 40% at 8% 0%, var(--bed-glow-2), transparent 70%),
    radial-gradient(50% 45% at 12% 100%, var(--bed-glow-2), transparent 70%);
}
.bed-plane {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.6 0 0 0 0 0.6 0 0 0 1.4 -0.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px; opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
}

/* ---------- Kopfzeile ---------- */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; min-height: 66px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bed) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-weight: 700; font-size: 19px; letter-spacing: -0.02em; flex: none;
}
.brand-mark { width: 28px; height: 28px; color: var(--accent); flex: none; }
.brand-word { display: inline-flex; align-items: baseline; }
.brand-3 { display: inline-block; width: 0.49em; height: 0.708em; margin: 0 0.05em 0 0.04em; color: var(--accent); }
.crumb { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.crumb::before { content: ''; width: 1px; height: 22px; background: var(--line-strong); }
.crumb b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn-quiet {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; border: 1px solid var(--line-strong); background: transparent;
  border-radius: 10px; padding: 0 13px; font-size: 13.5px; font-weight: 500; cursor: pointer; color: var(--ink-2); white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.btn-quiet:hover { color: var(--accent); border-color: var(--accent); }
.btn-quiet svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-quiet.small { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-accent {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; border: 0; padding: 0 16px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 22px -12px var(--accent-glow);
}
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn-accent svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line-strong);
  border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }

/* ---------- Layout ---------- */
.app {
  position: relative; z-index: 1; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px;
  padding: 22px var(--gutter) 56px; max-width: var(--maxw); margin: 0 auto;
}
.intro { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.intro h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.intro p { margin: 6px 0 0; color: var(--ink-2); max-width: 62ch; }

.panel {
  align-self: start; position: sticky; top: 86px; max-height: calc(100vh - 106px); overflow: auto;
  padding: 4px 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 4px; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.link-reset {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; color: var(--ink-2);
  font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-reset:hover { color: var(--accent); }
.panel section { padding: 12px 0 6px; border-bottom: 1px solid var(--line); }
.panel section:last-of-type { border-bottom: 0; }
.panel h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.field { display: block; margin: 0 0 13px; }
.field > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field em { font-style: normal; color: var(--ink-3); font-weight: 400; font-size: 12.5px; text-align: right; }
.num { display: flex; align-items: center; gap: 10px; }
.num input[type=range] { flex: 1; min-width: 0; }
.num input[type=number] { width: 76px; }
.num i { font-style: normal; color: var(--ink-3); font-size: 12.5px; width: 22px; }
input[type=number], input[type=text], select {
  height: 34px; border: 1px solid var(--line-strong); background: var(--raised); border-radius: 9px; padding: 0 10px; width: 100%;
  font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
}
select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%237a857f' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center / 12px;
}
input[type=number]:focus, input[type=text]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=range] { accent-color: var(--accent); height: 4px; cursor: pointer; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Geänderte Einstellungen wie im Slicer: Beschriftung in Akzentfarbe + ↺ zum Zurücksetzen */
.field > span { align-items: center; }
.field.changed > span:first-child { color: var(--accent); }
.rst {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: auto; margin-left: 2px; padding: 0;
  border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent); cursor: pointer; flex: none;
}
.rst:hover { background: var(--accent); color: var(--accent-ink); }
.rst svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.field > span > em { margin-left: auto; }
.pill.changed { box-shadow: inset 0 0 0 1px var(--accent); }
.count:not(:empty) {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 7px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; text-decoration: none;
}
.link-reset:disabled, .btn-quiet:disabled { opacity: .45; cursor: default; color: var(--ink-3); border-color: var(--line-strong); }
.link-reset:disabled:hover { color: var(--ink-3); }

/* Segmentschalter (wie „Preis“ bei Mak3rhub) */
.seg { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line-strong); border-radius: 999px; }
.seg button {
  flex: 1; height: 30px; border: 0; background: transparent; border-radius: 999px; padding: 0 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--bed); font-weight: 600; }

/* Schalter als Filter-Pills mit Häkchen */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink-2); user-select: none; white-space: nowrap;
}
.pill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pill:hover { color: var(--ink); border-color: var(--ink-3); }
.pill:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.pill:has(input:checked)::before {
  content: ''; width: 9px; height: 5px; border: solid var(--accent); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px);
}
.pill:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chips { display: flex; gap: 6px; margin: -5px 0 13px; flex-wrap: wrap; }
.chips button {
  border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; height: 26px; padding: 0 10px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
}
.chips button:hover { border-color: var(--accent); color: var(--ink); }
.chips button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.foot { color: var(--ink-3); font-size: 12.5px; margin: 12px 0 0; }

/* ---------- Bühne ---------- */
.stage { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.box { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.viewer { position: relative; height: min(58vh, 580px); min-height: 320px;
  background: radial-gradient(110% 85% at 50% 15%, var(--stage-1) 0%, var(--stage-2) 100%); }
.viewer canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.viewer-hint { position: absolute; right: 14px; bottom: 12px; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.viewer-hint .hint-touch { display: none; }
@media (pointer: coarse) { .viewer-hint .hint-mouse { display: none; } .viewer-hint .hint-touch { display: inline; } }
.extrude { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; }
.extrude.on { opacity: 1; }
.extrude span {
  position: absolute; inset: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); transform-origin: left;
  animation: extrude 1.6s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes extrude { 0% { transform: scaleX(0); opacity: 1; } 80% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: baseline; gap: 7px; height: 34px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13.5px; white-space: nowrap; }
.stat b { font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); }
.viewer-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.mini input[type=range] { width: 110px; }

.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.sheets-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.tabs button:hover { color: var(--ink); border-color: var(--ink-3); }
.tabs button.on { background: var(--raised); color: var(--ink); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tabs .bad { color: var(--cut); font-weight: 700; }
.sheet-actions { display: flex; gap: 6px; }
.sheet { padding: 16px; background: var(--surface-2); }
.sheet svg { width: 100%; height: auto; display: block; }
.sheet path[data-pid] { cursor: pointer; transition: fill 0.15s; }
.sheet path[data-pid]:hover { fill: color-mix(in srgb, var(--accent) 22%, var(--wood, #e8d2a8)); }
.sheet path[data-pid].pick { fill: color-mix(in srgb, #3fd9c8 55%, var(--wood, #e8d2a8)); stroke: var(--accent); stroke-dasharray: 4 2.5; stroke-width: 0.8; }
.sheet-note { padding: 10px 16px 14px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }
.legend { display: inline-flex; gap: 14px; margin-right: 12px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

.howto { padding: 18px 22px 8px; }
.howto h2 { margin: 0 0 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.howto ol { margin: 0; padding-left: 20px; color: var(--ink-2); }
.howto li { margin-bottom: 9px; }
.howto b { color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bed);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: all .25s; pointer-events: none;
}
.toast.on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
  .panel { position: static; max-height: none; order: 2; }
  .stage { order: 1; }
  .viewer { height: 50vh; }
  .crumb { display: none; }
  .top-actions .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .top { gap: 10px; }
  .brand-word { display: none; }
  .btn-quiet .lbl { display: none; }
}

/* ---------- Generatoren: zusätzliche Bausteine ---------- */
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.pgroup { padding: 12px 0 6px; border-bottom: 1px solid var(--line); }
.pgroup:last-child { border-bottom: 0; }
details.pgroup > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.pgroup > summary::-webkit-details-marker { display: none; }
details.pgroup > summary::after { content: ''; width: 8px; height: 8px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -4px 4px 10px 0; transition: transform .15s; }
details.pgroup[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.field > span .lbl { white-space: nowrap; }
.field.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field.row > span { margin: 0; flex: 1; }
/* Schalter-Zeilen: lange Beschriftung umbrechen, Hinweis als eigene Zeile darunter (sonst wird er abgeschnitten) */
.field.row > span { flex-wrap: wrap; min-width: 0; row-gap: 2px; }
.field.row > span .lbl { white-space: normal; }
.field.row > span > em { flex-basis: 100%; text-align: left; margin-left: 0; }
.switch { position: relative; width: 40px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: background .15s, border-color .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-3); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg { flex-wrap: wrap; border-radius: 16px; }
.seg button { flex: 1 1 auto; }
.notes { margin: 0; padding: 12px 16px 12px 34px; color: var(--ink-2); font-size: 14px; }

/* ---------- Katalog ---------- */
.cat-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px var(--gutter) 6px; max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 1; }
.cat-head h1 { margin: 0; font-size: clamp(30px, 4vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.04; }
.cat-head p { margin: 8px 0 0; color: var(--ink-2); max-width: 60ch; font-size: 16px; }
.cat-search { position: relative; display: flex; align-items: center; width: min(420px, 100%); background: var(--raised); border: 1.5px solid var(--line-strong); border-radius: 12px; }
.cat-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cat-search svg { width: 18px; height: 18px; margin-left: 13px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.cat-search input { flex: 1; border: 0; background: transparent; padding: 11px 12px 11px 10px; font-size: 16px; font-weight: 500; outline: none; height: auto; box-shadow: none !important; }
.cat-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px var(--gutter) 0; max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 1; }
.cat-filters button { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.cat-filters button:hover { color: var(--ink); border-color: var(--ink-3); }
.cat-filters button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.cat-filters .n { color: var(--ink-3); font-weight: 400; margin-left: 6px; font-variant-numeric: tabular-nums; }
.catalog { position: relative; z-index: 1; padding: 8px var(--gutter) 64px; max-width: var(--maxw); margin: 0 auto; }
.catalog h2 { margin: 28px 0 12px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card a { display: flex; flex-direction: column; height: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
.card a:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--raised); }
.card .thumb { aspect-ratio: 4 / 3; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card .thumb svg { width: 88%; height: 88%; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px 8px 8px; }
.card h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.card.soon a { pointer-events: none; opacity: .55; }
.card .badge { display: inline-block; margin-top: 8px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); }
.card .badge.new { background: var(--accent-soft); color: var(--accent); }

/* Bewegliche Vorlagen: Kennzeichen, Animation beim Überfahren bzw. in der Bildschirmmitte (Handy) */
.card .thumb { position: relative; }
.card .thumb .moving { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  backdrop-filter: blur(4px); pointer-events: none; transition: opacity .2s; }
.card .thumb.playing .moving { opacity: 0; }
/* Live-3D-Animation beweglicher Karten: eine gemeinsame Zeichenfläche, deckungsgleich über dem Standbild */
.live3d { position: absolute; left: -10000px; top: 0; width: 0; height: 0; opacity: 0; pointer-events: none; }
.live3d canvas { display: block; width: 100% !important; height: 100% !important; }
.card .thumb .live3d.on { opacity: 1; transition: opacity .18s ease; }
.card .thumb.playing:not(.loading) img { visibility: hidden; transition: visibility 0s .18s; }
.card .thumb.loading::after { content: ""; position: absolute; right: 10px; bottom: 10px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); animation: thumbspin .8s linear infinite; }
@keyframes thumbspin { to { transform: rotate(360deg); } }
.cat-filters button.moving-chip::before { content: "↻"; margin-right: 6px; color: var(--accent); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .card .thumb.loading::after { animation: none; } }
@media (max-width: 600px) { .card .thumb .moving { left: 6px; bottom: 6px; padding: 1px 6px; font-size: 10.5px; } }

/* mehrzeilige Eingaben (z. B. Frontplatten-Layout) */
textarea { width: 100%; box-sizing: border-box; font: 12px/1.45 ui-monospace, Menlo, monospace; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: var(--raised); color: inherit; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Acrylglas in der Blattvorschau */
:root { --acrylic: rgba(150, 215, 225, 0.55); --foam: rgba(200, 40, 58, 0.45); }
.tabs button.acryl { border-color: #5fb7c4; }
.tabs button.acryl::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--acrylic); border: 1px solid #5fb7c4; }
.tabs button.schaum { border-color: #c8283a; }
.tabs button.schaum::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--foam); border: 1px solid #c8283a; }

/* ---------- Einbindung in Mak3rhub: Bereichs-Reiter, Fußzeile, Feedback ---------- */
.crumb a { text-decoration: none; color: var(--ink-2); }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--ink-3); }
.area-nav { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--surface) 75%, transparent); }
.area-nav a { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.area-nav a:hover { color: var(--ink); background: var(--accent-soft); }
.area-nav a[aria-current='page'] { color: var(--accent-ink); background: var(--accent); }
@media (max-width: 760px) { .area-nav a { padding: 6px 9px; font-size: 13px; } }

.legend .sw-cut { background: var(--cut); }
.legend .sw-engrave { background: var(--engrave); height: 8px; }
.load-error { position: relative; z-index: 1; padding: 64px var(--gutter); max-width: 60ch; }
.load-error h1 { margin: 0 0 10px; font-size: 28px; letter-spacing: -0.02em; }
.load-error p { color: var(--ink-2); }
.offscreen { position: fixed; left: -3000px; top: 0; width: 640px; height: 480px; border: 0; }
.offscreen.small { width: 480px; height: 360px; }
.empty { color: var(--ink-2); }

.site-foot {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  max-width: var(--maxw); margin: 0 auto; padding: 22px var(--gutter) 36px; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 13px;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot button.linklike { border: 0; background: none; padding: 0; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.site-foot button.linklike:hover { color: var(--accent); }

.cat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cat-count { color: var(--ink-3); font-size: 13.5px; }

/* Feedback-Dialog (natives <dialog>) */
.fb { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--raised); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5); }
.fb::backdrop { background: rgba(10, 24, 27, .45); backdrop-filter: blur(2px); }
.fb form { display: grid; gap: 14px; padding: 22px 22px 18px; }
.fb h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.fb .fb-intro { margin: -6px 0 0; color: var(--ink-2); font-size: 14px; }
.fb .fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.fb .fb-kinds label { position: relative; }
.fb .fb-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.fb .fb-kinds span { display: inline-block; padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.fb .fb-kinds input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.fb .fb-kinds input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.fb label.fb-field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.fb textarea, .fb input[type='email'], .fb input[type='text'] { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 10px 12px; font: 400 15px/1.5 var(--text); }
.fb textarea { min-height: 120px; resize: vertical; }
.fb .fb-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.fb .fb-check input { margin-top: 3px; accent-color: var(--accent); }
.fb .fb-shot { max-width: 180px; border-radius: 8px; border: 1px solid var(--line); }
.fb .fb-note { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.fb .fb-status { margin: 0; min-height: 1em; font-size: 13.5px; color: var(--warn-ink); }
.fb .fb-actions { display: flex; justify-content: flex-end; gap: 8px; }
.fb .fb-done { padding: 34px 22px; font-size: 16px; text-align: center; }
.fb .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- „Mein Setup“ (core/setup.js): Kurzanzeige und Dialog ---------- */
.setup-field { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 8px 8px 8px 10px; border: 1px solid var(--line-strong); border-radius: 12px; }
.setup-ico { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.setup-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.setup-txt { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.setup-k { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.setup-txt b { font-size: 14px; font-weight: 600; }
.setup-txt .nw { display: inline-block; }
.setup-txt small { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.setup-field .btn-quiet { flex: none; }
.panel .setup-ico { display: none; }
.cat-setup { margin-top: 14px; max-width: 560px; }
.cat-setup .setup-field { margin: 0; }
.setup-dlg { width: min(600px, calc(100vw - 24px)); }
.setup-dlg form { gap: 16px; }
.setup-sec { display: grid; gap: 12px; margin: 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.setup-sec legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.setup-dlg .fb-field > span:first-child { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.setup-dlg [hidden] { display: none !important; }
.setup-lbl { display: flex; justify-content: space-between; gap: 8px; }
.setup-lbl em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.setup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.setup-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setup-custom { display: grid; gap: 12px; }
.setup-dlg div.fb-field { display: grid; gap: 6px; }
.setup-num { display: flex; align-items: center; gap: 8px; }
.setup-num input { width: 100%; min-width: 0; }
.setup-num i { font-style: normal; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.setup-tline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setup-tline .chips { margin: 0; flex: 1 1 auto; }
.setup-tline .setup-num { width: 120px; }
.setup-kerf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setup-kerf .setup-num { width: 120px; }
.setup-meta { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.setup-meta a { color: var(--accent); font-weight: 500; }
.setup-dlg .seg button { flex: 0 1 auto; }
.setup-remember { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); cursor: pointer; }
.setup-remember > span:first-child { display: grid; gap: 2px; }
.setup-remember b { font-size: 14px; font-weight: 600; }
.setup-remember small { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.setup-dlg .fb-actions { flex-wrap: wrap; }
.setup-dlg .setup-del { margin-right: auto; }
@media (max-width: 760px) {
  .setup-dlg { width: 100vw; }
  .setup-grid { grid-template-columns: 1fr 1fr; }
  .setup-grid > :first-child:not(:only-child):nth-last-child(3) { grid-column: 1 / -1; }
  .setup-dlg .fb-actions .setup-del { flex-basis: 100%; }
}

/* ---------- Sprachmenü (wie auf der übrigen Seite) ---------- */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--ink-2); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; list-style: none; user-select: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--accent); border-color: var(--accent); }
.lang-menu summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 160px; margin: 0; padding: 6px; list-style: none;
  background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.45);
}
.lang-menu a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; color: var(--ink-2); }
.lang-menu a:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu a[aria-current='true'] { color: var(--ink); font-weight: 600; }
.lang-menu a[aria-current='true']::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }

/* ---------- Vorlagen-Seite: Anordnung (Desktop: Einstellungen links, Vorschau rechts) ---------- */
.app > .panel { grid-column: 1; grid-row: 2; }
.app > .stage { grid-column: 2; grid-row: 2; }
.dlbar { display: none; }

/* ---------- Handy und Tablet ---------- */
@media (max-width: 960px) {
  .app { display: flex; flex-direction: column; gap: 14px; padding: 14px var(--gutter) 28px; }
  /* Reihenfolge: 3D-Vorschau, Einstellungen, Hinweise, Blätter, Bauanleitung */
  .app > .stage { display: contents; }
  .intro { order: 0; align-items: flex-start; }
  .viewer-box { order: 1; }
  .app > .panel { order: 2; position: static; max-height: none; overflow: visible; }
  #warnings { order: 3; }
  .sheets-box { order: 4; }
  .howto { order: 5; }
  .viewer { height: min(52vh, 460px); min-height: 260px; }
  .viewer-bar { padding: 8px 10px; }
  .stats { gap: 5px; }
  .stat { height: 30px; padding: 0 10px; font-size: 12.5px; }
  .viewer-tools { width: 100%; justify-content: space-between; }
  .viewer-tools .btn-quiet { flex: 1 1 auto; justify-content: center; }
  .mini { flex: 1 1 140px; }
  .mini input[type=range] { width: auto; flex: 1; }
  #btnStep { display: none; }
  .sheet { padding: 10px; overflow: auto; }
  .sheet-actions { display: none; }
  /* Download-Leiste unten (über der Fußzeile, mit Abstand für die Home-Leiste/Notch) */
  .dlbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; gap: 6px; justify-content: center;
    padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--bed) 90%, transparent); border-top: 1px solid var(--line);
    backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  }
  .dlbar button { height: 44px; padding: 0 12px; flex: 1 1 0; justify-content: center; min-width: 0; max-width: 140px; }
  .dlbar .btn-accent { flex: 1.4 1 0; }
  .dlbar [hidden] { display: none; }
  body[data-page='laserItem'] { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* Einstellungen als aufklappbare Gruppen */
  details.pgroup > summary { min-height: 44px; }
  details.pgroup > summary h3 { margin: 0; font-size: 14.5px; color: var(--ink); }
  details.pgroup[open] > summary { margin-bottom: 8px; }
  .panel-head { position: sticky; top: 0; }
}
@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
  .viewer { height: 78vh; }
}
@media (max-width: 760px) {
  .top { gap: 10px; min-height: 56px; padding-top: 8px; padding-bottom: 8px; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
  .top-actions { gap: 6px; min-width: 0; }
  .lang-menu summary, .theme-toggle { height: 36px; }
  .theme-toggle { width: 36px; }
  .cat-head { padding-top: 18px; }
  .cat-search { width: 100%; }
  /* Kategorien als waagrechte Leiste zum Wischen */
  .cat-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scroll-padding: 0 var(--gutter); }
  .cat-filters::-webkit-scrollbar { display: none; }
  .cat-filters button { flex: none; height: 38px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
  .card a { padding: 5px; border-radius: 12px; }
  .card .body { padding: 8px 5px 6px; }
  .card h3 { font-size: 14.5px; }
  .card p { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .catalog h2 { margin-top: 22px; font-size: 18px; }
  .site-foot { padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
  /* Feedback-Dialog über die ganze Breite */
  .fb { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .fb form { padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  .fb .fb-actions button { height: 44px; flex: 1; justify-content: center; }
}
@media (max-width: 420px) {
  .lang-menu summary svg { display: none; }
  .lang-menu summary { padding: 0 8px; }
  .area-nav a { padding: 6px 7px; font-size: 12.5px; }
  .brand-mark { width: 26px; height: 26px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 340px) { .cards { grid-template-columns: 1fr; } }

/* Größere Tippflächen auf Touch-Geräten */
@media (pointer: coarse) {
  input[type=number], input[type=text], select { height: 44px; font-size: 16px; }
  .num input[type=number] { width: 86px; }
  input[type=range] { height: 28px; }
  .seg button { height: 40px; }
  .chips button { height: 34px; padding: 0 12px; }
  .rst { width: 32px; height: 32px; border-radius: 9px; }
  .rst svg { width: 16px; height: 16px; }
  .switch { width: 48px; height: 30px; }
  .switch i::after { top: 4px; left: 4px; width: 20px; height: 20px; }
  .switch input:checked + i::after { transform: translateX(18px); }
  .tabs button, .btn-quiet.small { height: 40px; }
  .field { margin-bottom: 16px; }
  .field > span .lbl { white-space: normal; }
  .site-foot nav { gap: 12px 18px; }
  .site-foot a, .site-foot button.linklike { padding: 6px 0; }
}
