/* ==========================================================================
   DA 3D-Druck & 3D-Design – gemeinsames Stylesheet (Website + Werkstatt)
   Farbwelt abgeleitet vom Logo: Anthrazit/Navy, gebürstetes Metall, Elektrisch-Blau
   ========================================================================== */
:root {
  --bg: #34373e;
  --bg-2: #3b3f47;
  --panel: #2d3f64;
  --panel-2: #354a72;
  --line: rgba(160, 190, 240, .2);
  --line-strong: rgba(160, 190, 240, .36);
  --text: #f2f6fc;
  --muted: #c6d1e4;
  --dim: #a0aec7;
  --blue: #2f8cff;
  --blue-2: #1565e6;
  --cyan: #5cc8ff;
  --glow: 0 0 24px rgba(47, 140, 255, .45);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --metal: linear-gradient(180deg, #ffffff 0%, #cfd6e2 38%, #8a95a8 52%, #e6ebf2 70%, #aeb7c6 100%);
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1240px;
  --font-head: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.container { width: min(var(--maxw), 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Hintergrund: feines CAD-Raster */
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1300px 800px at 75% -10%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(1000px 700px at -10% 30%, rgba(255,255,255,.05), transparent 60%),
    linear-gradient(rgba(220,226,238,.06) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(220,226,238,.06) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
}

/* ---------- Text-Effekte ---------- */
.metal-text {
  background: var(--metal);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.5));
}
.blue-text {
  background: linear-gradient(180deg, #8fd0ff, var(--blue) 55%, var(--blue-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(47,140,255,.55));
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .18em;
  color: var(--cyan);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--blue); box-shadow: var(--glow); }

/* ---------- Buttons ---------- */
/* Silberne, abgehobene Buttons (gebürstetes Metall mit Kante unten) */
.btn {
  --edge: #5d6675; --lift: 5px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid rgba(255,255,255,.7);
  font: 700 15px/1 var(--font-head); letter-spacing: .02em; cursor: pointer; white-space: nowrap;
  color: #131a26; text-shadow: 0 1px 0 rgba(255,255,255,.7);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 1px, rgba(0,0,0,0) 1px 3px),
    linear-gradient(180deg, #ffffff 0%, #e4e9f0 40%, #aeb7c4 50%, #cdd4de 78%, #e9edf3 100%);
  box-shadow: 0 var(--lift) 0 var(--edge), 0 calc(var(--lift) + 8px) 18px -4px rgba(0,0,0,.55), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0,0,0,.15);
  transform: translateY(calc(var(--lift) * -1));
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.btn:hover { color: #0a0f18; filter: brightness(1.06); transform: translateY(calc(var(--lift) * -1 - 2px)); box-shadow: 0 calc(var(--lift) + 2px) 0 var(--edge), 0 calc(var(--lift) + 14px) 22px -4px rgba(0,0,0,.6), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0,0,0,.15); }
.btn:active { transform: translateY(0); box-shadow: 0 0 0 var(--edge), 0 2px 6px rgba(0,0,0,.5), inset 0 1px 3px rgba(0,0,0,.25); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* zweite Stufe: dunkles Metall mit silbernem Rand */
.btn.ghost {
  --edge: #12161d; color: #eef2f8; text-shadow: 0 -1px 0 rgba(0,0,0,.5); border-color: rgba(205,214,228,.75);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, rgba(0,0,0,0) 1px 3px),
    linear-gradient(180deg, #5a6273 0%, #3a4150 48%, #2a303c 52%, #384050 100%);
}
.btn.ghost:hover { color: #fff; border-color: #fff; }
.btn.small { --lift: 4px; padding: 9px 15px; font-size: 13px; }
.btn.danger { --edge: #5a1f1f; color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,.4); border-color: rgba(252,165,165,.7); background: linear-gradient(180deg, #f08a8a 0%, #d45656 50%, #b73b3b 100%); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); transform: translateY(calc(var(--lift) * -1)); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.02); color: var(--muted);
  transition: all .2s; font-family: var(--font-body);
}
.chip:hover { color: #fff; border-color: var(--blue); }
.chip.active { color: #fff; background: rgba(47,140,255,.18); border-color: var(--blue); box-shadow: inset 0 0 12px rgba(47,140,255,.25); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(43,46,53,.78); backdrop-filter: blur(14px); border-color: var(--line); }
.nav .container { display: flex; align-items: center; gap: 24px; height: 104px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font: 800 18px/1 var(--font-head); letter-spacing: .02em; }
.brand img { height: 80px; width: auto; border-radius: 12px; padding: 3px; background: var(--silver, linear-gradient(180deg,#fff,#aeb7c4)); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 3px 0 #5d6675, 0 8px 14px -4px rgba(0,0,0,.55), inset 0 1px 0 #fff; }
.brand small { display: block; font: 600 10px/1.3 var(--font-mono); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { white-space: nowrap; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.05); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.lang-toggle button { all: unset; cursor: pointer; padding: 5px 10px; border-radius: 999px; font: 600 12px/1 var(--font-mono); color: var(--muted); }
.lang-toggle button.active { background: var(--blue); color: #fff; }
.burger { all: unset; display: none; cursor: pointer; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); place-items: center; }
.burger span, .burger span::before, .burger span::after { display: block; width: 18px; height: 2px; background: #fff; position: relative; transition: .3s; }
.burger span::before, .burger span::after { content: ""; position: absolute; }
.burger span::before { top: -6px; } .burger span::after { top: 6px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: grid; align-items: center; padding: 110px 0 60px; overflow: hidden; }
.hero-photo { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.scan-canvas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.scan-canvas canvas { display: block; width: 100%; height: 100%; }
.hero-art { position: absolute; right: 0; top: 11%; height: 66%; aspect-ratio: 1408 / 768; background: url(../assets/hero-drucker.jpg) center / 100% 100% no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 9%, #000 86%, transparent 100%); -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 9%, #000 86%, transparent 100%); mask-composite: intersect; }
/* Logo als Lichtprojektion auf dem Boden und als kleine Plakette auf der Gehäusefront */
.hero-photo::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(52,55,62,.9) 18%, rgba(52,55,62,.4) 34%, rgba(52,55,62,0) 48%),
              linear-gradient(180deg, var(--bg) 0%, rgba(52,55,62,.85) 8%, rgba(52,55,62,0) 26%, rgba(52,55,62,0) 76%, var(--bg) 100%); }
.hero-canvas { position: absolute; inset: 0; z-index: 0; }
.hero-canvas canvas { display: block; width: 100%; height: 100%; }
.hero .container { position: relative; z-index: 1; pointer-events: none; }
.hero-copy { max-width: 660px; pointer-events: auto; cursor: default; -webkit-user-select: none; user-select: none; }
.hero-copy .btn { cursor: pointer; }
.hero h1 { font-size: clamp(40px, 5.2vw, 74px); font-weight: 800; font-style: italic; margin: 18px 0 22px; }
.hero h1 .line { display: block; }
.hero p.lead { font-size: clamp(17px, 1.6vw, 20px); color: #c4cfe2; max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 40px; }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats div { border-left: 2px solid var(--blue); padding-left: 14px; }
.hero-stats b { display: block; font: 800 28px/1.1 var(--font-head); }
.hero-stats span { font-size: 13px; color: var(--muted); }
.print-hud {
  position: absolute; right: max(16px, calc((100vw - var(--maxw)) / 2)); bottom: 40px; z-index: 2;
  font: 500 12px/1.7 var(--font-mono); color: var(--muted);
  background: rgba(40,57,91,.7); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; backdrop-filter: blur(8px);
  min-width: 230px;
}
.print-hud b { color: var(--cyan); font-weight: 600; }
.print-hud .bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); margin-top: 8px; overflow: hidden; }
.print-hud .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: var(--glow); }
.scroll-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2; width: 24px; height: 40px; border: 2px solid var(--line-strong); border-radius: 14px; }
.scroll-hint::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: scrolldot 1.8s infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sektionen ---------- */
section { position: relative; padding: 110px 0; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head h2 { font-size: clamp(32px, 4vw, 52px); font-weight: 800; margin-top: 14px; }
.section-head p { color: var(--muted); font-size: 18px; }

.card {
  position: relative; background: linear-gradient(180deg, rgba(54,76,118,.75), rgba(45,63,100,.75));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.card:hover { border-color: rgba(47,140,255,.45); box-shadow: 0 20px 60px -30px rgba(47,140,255,.6); }

/* Leistungen */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service .icon {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 22px;
  background: radial-gradient(circle at 30% 25%, rgba(92,200,255,.35), rgba(47,140,255,.08));
  border: 1px solid rgba(47,140,255,.4); box-shadow: inset 0 0 20px rgba(47,140,255,.25);
}
.service .icon svg { width: 30px; height: 30px; stroke: #cfe6ff; }
.service h3 { font-size: 22px; }
.service p { color: var(--muted); }
.service ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.service li { display: flex; gap: 10px; font-size: 14.5px; color: #c9d4e6; }
.service li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 2px; background: var(--blue); box-shadow: var(--glow); transform: rotate(45deg); }
.service .num { position: absolute; top: 22px; right: 26px; font: 700 13px var(--font-mono); color: var(--dim); }

/* Prozess */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; position: relative; }
.process::before { content: ""; position: absolute; top: 27px; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, transparent, var(--blue), var(--cyan), var(--blue), transparent); opacity: .5; }
.step { text-align: center; padding: 0 16px; position: relative; }
.step .dot { counter-increment: step; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 2px solid var(--blue); box-shadow: var(--glow); font: 800 20px var(--font-head); }
.step .dot::before { content: counter(step, decimal-leading-zero); }
.step h4 { font-size: 18px; }
.step p { color: var(--muted); font-size: 14.5px; }

/* Showroom / Viewer */
.showroom { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.viewer {
  position: sticky; top: 90px; height: min(76vh, 700px); min-height: 460px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 30%, #3a5c94 0%, #233658 75%);
}
.viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.viewer-toolbar { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; flex-wrap: wrap; gap: 8px; z-index: 2; }
.viewer-toolbar .group { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(43,46,53,.7); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.viewer-toolbar .chip { border: 0; padding: 6px 11px; font-size: 12.5px; }
.viewer-foot { position: absolute; left: 14px; bottom: 14px; z-index: 2; font: 500 11.5px/1.5 var(--font-mono); color: var(--dim); }
.viewer-drop {
  position: absolute; inset: 10px; z-index: 3; border: 2px dashed var(--blue); border-radius: 14px;
  display: grid; place-items: center; background: rgba(43,46,53,.8); font: 700 22px var(--font-head); color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.viewer.dragging .viewer-drop { opacity: 1; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: 500 13px var(--font-mono); }
.model-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.model-btn {
  all: unset; cursor: pointer; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 13px;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(45,63,100,.6); transition: .2s;
}
.model-btn:hover { border-color: var(--line-strong); }
.model-btn.active { border-color: var(--blue); background: rgba(47,140,255,.12); box-shadow: inset 0 0 0 1px rgba(47,140,255,.3); }
.model-btn .thumb { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(47,140,255,.12); color: var(--cyan); font: 700 18px var(--font-head); }
.model-btn b { display: block; font: 700 14px var(--font-head); }
.model-btn > span:last-child > span { display: none; }
.model-btn span { font-size: 12.5px; color: var(--muted); }
.side-panel { display: flex; flex-direction: column; gap: 16px; }
.stats-card { padding: 20px; }
.stats-card h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-family: var(--font-mono); font-weight: 600; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--font-mono); color: #fff; }
.kv .big { font: 800 22px var(--font-head); color: #fff; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.swatch { all: unset; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); box-shadow: inset 0 -4px 8px rgba(0,0,0,.35); transition: transform .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(47,140,255,.6); }

/* Formular-Elemente */
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  background: rgba(43,46,53,.6); border: 1px solid var(--line-strong); color: var(--text);
  font: 15px var(--font-body); transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,140,255,.2); }
input[type=range] { padding: 0; accent-color: var(--blue); background: transparent; border: 0; box-shadow: none; }
input[type=checkbox] { width: auto; accent-color: var(--blue); }
textarea { min-height: 120px; resize: vertical; }
select option { background: var(--panel); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* Materialien */
.materials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.material { padding: 24px; }
.material header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.material .blob { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: inset 0 -8px 14px rgba(0,0,0,.35), inset 0 6px 10px rgba(255,255,255,.25); }
.material h3 { font-size: 21px; margin: 0; }
.material header span { font-size: 12.5px; color: var(--muted); }
.material p { color: var(--muted); font-size: 14.5px; min-height: 66px; }
.meter { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.meter i { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.meter i::after { content: ""; position: absolute; inset: 0; width: var(--v); background: linear-gradient(90deg, var(--blue-2), var(--cyan)); border-radius: 6px; }
.material .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.tag { font: 600 11px/1 var(--font-mono); padding: 5px 8px; border-radius: 6px; background: rgba(47,140,255,.12); color: #bfe0ff; border: 1px solid rgba(47,140,255,.25); }

/* Preis-Rechner (öffentlich) */
.pricing { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; }
.price-out { display: flex; flex-direction: column; }
.price-out .total { font: 800 clamp(44px, 5vw, 64px)/1 var(--font-head); margin: 10px 0 4px; }
.price-out .breakdown { margin-top: auto; }
.stack-bar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; margin: 18px 0 14px; background: rgba(255,255,255,.06); }
.stack-bar span { transition: width .4s; }
.legend { display: grid; gap: 6px; font-size: 13.5px; }
.legend div { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { font-family: var(--font-mono); font-weight: 500; }
.range-row { display: grid; grid-template-columns: 1fr 70px; gap: 12px; align-items: center; }
.range-row output { text-align: right; font: 600 14px var(--font-mono); color: #fff; }
.price-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.tier h4 { font-size: 18px; }
.tier .p { font: 800 30px var(--font-head); margin: 6px 0 10px; }
.tier .p small { font: 500 14px var(--font-body); color: var(--muted); }
.tier p { color: var(--muted); font-size: 14px; margin: 0; }

/* Filament-Vorrat */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.stock-item { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center; padding: 16px; }
.spool-ico { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle, #1b2230 0 24%, transparent 25%), var(--c, #888); box-shadow: inset 0 0 0 3px rgba(0,0,0,.28), 0 6px 16px -6px rgba(0,0,0,.6); }
.stock-item b { display: block; font: 700 15px var(--font-head); }
.stock-item small { color: var(--muted); font-size: 12.5px; }
.stock-item .bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.09); margin-top: 8px; overflow: hidden; }
.stock-item .bar i { display: block; height: 100%; border-radius: 6px; background: var(--ok); }
.stock-item .bar i.low { background: var(--warn); } .stock-item .bar i.out { background: var(--bad); }
.stock-item .g { float: right; font: 600 13px var(--font-mono); color: #fff; margin-left: 8px; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 220px; gap: 16px; }
.g-item { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 40%, #3b5f98, #24365a 75%); cursor: pointer; margin: 0; }
.g-item.wide { grid-column: span 2; } .g-item.tall { grid-row: span 2; }
.g-item canvas, .g-item img { width: 100%; height: 100%; object-fit: contain; padding: 18px 18px 54px; display: block; transition: transform .6s; }
.g-item:hover canvas, .g-item:hover img { transform: scale(1.05); }
.g-item figcaption { position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(36,38,44,.92)); }
.g-item figcaption b { display: block; font: 700 16px var(--font-head); }
.g-item figcaption span { font-size: 12.5px; color: var(--muted); }
.g-item .badge { position: absolute; top: 12px; left: 12px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

/* Anfrage */
.quote { display: grid; grid-template-columns: 1fr 380px; gap: 22px; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: .2s; font-size: 14px; }
.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: rgba(47,140,255,.07); color: #fff; }
.dropzone b { color: #fff; }
.contact-list { display: grid; gap: 16px; }
.contact-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.contact-item .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(47,140,255,.12); border: 1px solid rgba(47,140,255,.3); }
.contact-item .ic svg { width: 20px; height: 20px; stroke: var(--cyan); }
.contact-item small { display: block; color: var(--muted); font-size: 12.5px; }
.form-note { font-size: 13px; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%); z-index: 100;
  padding: 13px 20px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--blue);
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.6), var(--glow); transition: transform .35s cubic-bezier(.2,.9,.3,1.2); font-size: 14.5px; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }

/* FAQ */
.faq { max-width: 860px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: rgba(45,63,100,.6); padding: 0 22px; transition: border-color .2s; }
.faq details[open] { border-color: rgba(47,140,255,.45); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font: 600 17px var(--font-head); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--cyan); font-size: 22px; line-height: 1; transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 6px; }

/* CTA-Band */
.cta-band { padding: 60px; border-radius: 28px; text-align: center; position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 50% 0%, rgba(47,140,255,.35), transparent 70%), linear-gradient(180deg, #33528a, #26395f);
  border: 1px solid rgba(47,140,255,.35); }
.cta-band h2 { font-size: clamp(28px, 3.6vw, 44px); }
.cta-band p { color: #c4cfe2; max-width: 620px; margin: 0 auto 26px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 60px 0 30px; background: rgba(36,38,44,.6); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
footer h5 { font: 600 12px var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 14px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14.5px; }
footer ul a { color: #c9d4e6; }
.foot-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--dim); }

/* Modal (Impressum/Datenschutz) */
dialog.modal { width: min(760px, calc(100vw - 32px)); max-height: 86vh; border: 1px solid var(--line-strong); border-radius: 20px; padding: 0; background: var(--panel); color: var(--text); }
dialog.modal::backdrop { background: rgba(14,15,18,.75); backdrop-filter: blur(4px); }
dialog.modal .inner { padding: 32px; overflow: auto; max-height: 86vh; }
dialog.modal h2 { font-size: 28px; }
dialog.modal h3 { font-size: 17px; margin-top: 22px; }
dialog.modal p { color: #c4cfe2; font-size: 15px; }
dialog.modal .close { position: sticky; top: 0; float: right; }
.placeholder { background: rgba(251,191,36,.12); color: #fde68a; padding: 0 4px; border-radius: 4px; }

/* Reveal-Animation */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 1200px) { .nav-links a { padding: 8px 8px; font-size: 13.5px; } .nav .container { gap: 14px; } }
@media (max-width: 1100px) {
  .showroom, .quote, .pricing { grid-template-columns: 1fr; }
  .viewer { position: relative; top: 0; height: 62vh; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 104px 0 auto 0; flex-direction: column; padding: 16px; gap: 2px; background: rgba(43,46,53,.97); border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .35s; }
  .nav.open .nav-links { transform: none; }
  .nav-links a { padding: 12px; font-size: 16px; }
  .burger { display: grid; }
  .nav-actions .btn { display: none; }
  .services, .materials, .price-tiers { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr 1fr; gap: 30px 0; }
  .process::before { display: none; }
  .print-hud { display: none; }
  section { padding: 80px 0; }
  .hero { min-height: auto; padding-top: 96px; }
  .hero .container { padding-top: 46vh; }
  .hero-canvas, .hero-photo { bottom: auto; height: 58vh; }
  .hero-photo { background-position: 80% center; }
  .hero-photo::after { background: linear-gradient(180deg, rgba(52,55,62,.4) 0%, rgba(52,55,62,0) 20%, rgba(52,55,62,0) 70%, var(--bg) 100%); }
  .hero-copy { background: linear-gradient(180deg, transparent, var(--bg) 12%); }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; grid-auto-rows: 240px; }
  .g-item.wide, .g-item.tall { grid-column: auto; grid-row: auto; }
  .foot-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 36px 20px; }
  .viewer { min-height: 420px; height: 60vh; position: relative; top: 0; }
  .brand small { display: none; }
  .card { padding: 22px; }
}

/* ==========================================================================
   Werkstatt-Cockpit
   ========================================================================== */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: rgba(43,46,53,.85); display: flex; flex-direction: column; gap: 20px; }
.sidebar .brand img { height: 36px; }
.tabs { display: grid; gap: 4px; }
.tabs button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14.5px; }
.tabs button svg { width: 18px; height: 18px; stroke: currentColor; flex: none; }
.tabs button:hover { color: #fff; background: rgba(255,255,255,.04); }
.tabs button.active { color: #fff; background: linear-gradient(90deg, rgba(47,140,255,.22), rgba(47,140,255,.04)); box-shadow: inset 2px 0 0 var(--blue); }
.tabs .badge-count { margin-left: auto; font: 700 11px/1 var(--font-mono); padding: 4px 7px; border-radius: 999px; background: rgba(248,113,113,.2); color: #fecaca; }
.sidebar .bottom { margin-top: auto; display: grid; gap: 10px; font-size: 12.5px; color: var(--dim); }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(26px, 3vw, 36px); margin: 6px 0 0; }
.panel { background: linear-gradient(180deg, rgba(54,76,118,.7), rgba(45,63,100,.7)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.panel h3 { font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel h3 small { font: 500 12px var(--font-mono); color: var(--dim); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.line-items { display: grid; gap: 8px; }
.line-item { display: grid; grid-template-columns: 1fr 120px 90px 36px; gap: 8px; align-items: center; }
.line-item .cost { font: 500 13px var(--font-mono); text-align: right; color: var(--muted); }
.icon-btn { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.icon-btn:hover { color: #fecaca; border-color: rgba(248,113,113,.5); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.result { position: sticky; top: 20px; }
.result .total { font: 800 44px/1 var(--font-head); margin: 4px 0; }
.result .sub { color: var(--muted); font-size: 13px; }
.result .kv { margin-top: 16px; }
.result .kv dd { color: #dbe6f7; }
.result .kv .sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 4px 0; }
.result .kv .strong { color: #fff; font-weight: 700; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-top: 14px; }
.alert.warn { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.35); color: #fde68a; }
.alert.bad { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.4); color: #fecaca; }
.alert.ok { background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.3); color: #a7f3d0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font: 600 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 14px; background: rgba(43,46,53,.5); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(47,140,255,.04); }
table.data td.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .actions .icon-btn { display: inline-grid; margin-left: 4px; }
table.data .actions .icon-btn.edit:hover { color: var(--cyan); border-color: var(--blue); }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 8px; border: 1px solid rgba(255,255,255,.25); }
.progress { height: 8px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; min-width: 90px; }
.progress i { display: block; height: 100%; border-radius: 6px; background: var(--ok); }
.progress.warn i { background: var(--warn); } .progress.bad i { background: var(--bad); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(45,63,100,.7); }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { display: block; font: 800 26px/1.2 var(--font-head); margin-top: 4px; }
.maint-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.maint-card h4 { margin: 0 0 4px; font-size: 18px; }
.maint-task { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.maint-task .progress { grid-column: 1 / -1; }
.maint-task small { color: var(--muted); font-size: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
dialog.form-dialog { width: min(620px, calc(100vw - 32px)); border: 1px solid var(--line-strong); border-radius: 18px; padding: 0; background: var(--panel); color: var(--text); }
dialog.form-dialog::backdrop { background: rgba(14,15,18,.7); backdrop-filter: blur(3px); }
dialog.form-dialog form { padding: 26px; display: grid; gap: 16px; }
dialog.form-dialog h3 { font-size: 22px; margin: 0; }
dialog.form-dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.hint { font-size: 12.5px; color: var(--dim); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { max-width: 260px; }
.mobile-top { display: none; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .3s; }
  .app.menu-open .sidebar { transform: none; box-shadow: 30px 0 80px rgba(0,0,0,.6); }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; background: rgba(43,46,53,.9); backdrop-filter: blur(10px); }
  .mobile-top .burger { display: grid; }
  .calc-grid { grid-template-columns: 1fr; }
  .result { position: static; }
}
@media (max-width: 560px) {
  .line-item { grid-template-columns: 1fr 90px 36px; }
  .line-item .cost { display: none; }
}

/* Druckansicht für Angebote */
#print-quote { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .grid-bg, .app, .mobile-top, .toast { display: none !important; }
  #print-quote { display: block; padding: 10mm; font: 11pt/1.5 Arial, sans-serif; color: #111; }
  #print-quote h1 { font-size: 22pt; margin: 0; }
  #print-quote table { width: 100%; border-collapse: collapse; margin: 16px 0; }
  #print-quote td, #print-quote th { border-bottom: 1px solid #ccc; padding: 6px 4px; text-align: left; }
  #print-quote td.r, #print-quote th.r { text-align: right; }
  #print-quote .head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #1565e6; padding-bottom: 10px; margin-bottom: 20px; }
  #print-quote img { height: 60px; }
}

/* ==========================================================================
   Alle klickbaren Elemente: silberner Hintergrund, der sich vom dunklen Grund abhebt
   ========================================================================== */
:root {
  --silver: repeating-linear-gradient(90deg, rgba(255,255,255,.13) 0 1px, rgba(0,0,0,0) 1px 3px), linear-gradient(180deg, #ffffff 0%, #e4e9f0 42%, #b4bcc9 52%, #d3d9e3 80%, #eef1f6 100%);
  --silver-ink: #131a26;
  --silver-edge: #5d6675;
}
.nav-links a, .chip, .model-btn, .tabs button, .icon-btn, .lang-toggle button {
  background: var(--silver); color: var(--silver-ink); text-shadow: 0 1px 0 rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 3px 0 var(--silver-edge), 0 8px 14px -4px rgba(0,0,0,.5), inset 0 1px 0 #fff;
  transform: translateY(-3px);
  transition: transform .12s, box-shadow .12s, filter .2s, background .2s;
}
.nav-links a:hover, .chip:hover, .model-btn:hover, .tabs button:hover, .icon-btn:hover, .lang-toggle button:hover { filter: brightness(1.07); color: #0a0f18; transform: translateY(-5px); border-color: #fff; }
.nav-links a:active, .chip:active, .model-btn:active, .tabs button:active, .icon-btn:active, .lang-toggle button:active { transform: translateY(0); box-shadow: 0 0 0 var(--silver-edge), 0 1px 4px rgba(0,0,0,.5), inset 0 1px 3px rgba(0,0,0,.25); }
/* Aktiver Zustand: blau, bleibt aber als Metall-Taste erkennbar */
.nav-links a.active, .chip.active, .model-btn.active, .tabs button.active, .lang-toggle button.active {
  background: linear-gradient(180deg, #7fc0ff 0%, #2f8cff 50%, #1565e6 100%); color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,.35);
  border-color: rgba(190,225,255,.9); box-shadow: 0 3px 0 #0b3f95, 0 8px 18px -4px rgba(47,140,255,.7), inset 0 1px 0 rgba(255,255,255,.6);
}
.nav-links { gap: 10px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-weight: 700; }
.lang-toggle { gap: 4px; padding: 5px 5px 8px; background: rgba(0,0,0,.25); }
.lang-toggle button { padding: 5px 10px; }
.chip { color: var(--silver-ink); font-weight: 600; }
.model-btn b { color: var(--silver-ink); } .model-btn span, .model-btn > span:last-child > span { color: #3a4352; }
.model-btn .thumb { background: rgba(21,101,230,.14); color: #124fb5; }
.model-btn.active b, .model-btn.active span, .model-btn.active .thumb { color: #fff; }
.model-btn.active .thumb { background: rgba(255,255,255,.2); }
.tabs { gap: 8px; }
.tabs button { padding: 10px 14px; box-shadow: 0 3px 0 var(--silver-edge), 0 8px 14px -4px rgba(0,0,0,.5), inset 0 1px 0 #fff; }
.tabs button.active { box-shadow: 0 3px 0 #0b3f95, 0 8px 18px -4px rgba(47,140,255,.7), inset 0 1px 0 rgba(255,255,255,.6); }
.tabs .badge-count { background: #d23b3b; color: #fff; text-shadow: none; }
.icon-btn { color: #2a3342; width: 36px; height: 36px; border-radius: 10px; }
.icon-btn:hover { color: #a11d1d; border-color: #fff; }
.burger { background: var(--silver); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 3px 0 var(--silver-edge); }
.burger span, .burger span::before, .burger span::after { background: #131a26; }
.sidebar .brand, .nav .brand { transform: none; }

@media (max-width: 600px) { .brand img { height: 46px; } .nav .container { height: 72px; } .nav-links { inset: 72px 0 auto 0; } }
.hero { padding-top: 150px; }

@media (max-width: 1180px) { .nav .brand > span { display: none; } }

@media (max-width: 600px) { .hero h1 { font-size: clamp(24px, 7.2vw, 34px); margin: 14px 0 16px; } .hero p.lead { font-size: 15.5px; } .hero-stats { gap: 18px; } .hero-stats b { font-size: 22px; } }

/* ==========================================================================
   Web-App / Handy: untere Leiste, Safe-Areas, große Tippflächen
   ========================================================================== */
.offline-bar { position: sticky; top: 0; z-index: 70; padding: 8px 16px; text-align: center; font-size: 14px; background: #7a2323; color: #fff; }
.bottomnav { display: none; }
@media (max-width: 1000px) {
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(34,36,42,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line-strong);
  }
  .bottomnav.hidden { display: none; }
  .bottomnav button { all: unset; cursor: pointer; position: relative; display: grid; justify-items: center; gap: 3px; padding: 7px 2px; min-height: 48px; border-radius: 12px; font: 600 11px/1.1 var(--font-body); color: var(--silver-ink);
    background: var(--silver); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 3px 0 var(--silver-edge); transform: translateY(-2px); }
  .bottomnav button svg { width: 22px; height: 22px; stroke: currentColor; }
  .bottomnav button.active { background: linear-gradient(180deg, #7fc0ff, #2f8cff 55%, #1565e6); color: #fff; box-shadow: 0 3px 0 #0b3f95; }
  .bottomnav button:active { transform: translateY(1px); box-shadow: none; }
  .bottomnav .dot { position: absolute; top: 5px; right: 18%; width: 9px; height: 9px; border-radius: 50%; background: #e04141; border: 1.5px solid #fff; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mobile-top { padding-top: calc(12px + env(safe-area-inset-top)); }
  input, select, textarea { font-size: 16px; }              /* verhindert das Hineinzoomen auf iPhones */
  .btn, .icon-btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  dialog.form-dialog { max-height: 92vh; overflow: auto; }
  .page-head h1 { font-size: 26px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (display-mode: standalone) { .sidebar .bottom a[href="/"] { display: none; } }

/* Handy: Inhalt darf die Bildschirmbreite nie sprengen (Tabellen scrollen in ihrem Rahmen) */
@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app > div { min-width: 0; }
  .main, .panel, .stack, .calc-grid > * { min-width: 0; max-width: 100%; }
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html, body { overflow-x: hidden; }
}

/* Reiter-Navigation: nur die gewählte Ebene ist sichtbar */
.view-off { display: none !important; }
body.view-page main { padding-top: 84px; }
body.view-page main section { padding-top: 48px; }

/* Umblättern beim Reiterwechsel */
html { overflow-x: hidden; }
main, .hero { perspective: 2200px; }
.turn-out, .turn-in { transform-origin: 0 50%; backface-visibility: hidden; will-change: transform, opacity; }
.turn-out { animation: pageOut .32s cubic-bezier(.5, 0, .75, .4) forwards; pointer-events: none; }
.turn-in { animation: pageIn .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes pageOut { to { transform: rotateY(-78deg) translateX(-30px); opacity: 0; filter: brightness(.6); } }
@keyframes pageIn { from { transform: rotateY(62deg) translateX(40px); opacity: 0; filter: brightness(.7); } to { transform: none; opacity: 1; filter: none; } }

/* ---------- Filament-Datenbank (Bambu Lab & SUNLU) ---------- */
.fildb-card { margin-top: 28px; }
.fildb-title { margin: 0 0 6px; }
.fildb-lead { margin: 0 0 16px; color: var(--muted); }
.fildb-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 10px; }
.fildb-count { margin: 6px 0 10px; font-size: 13px; }
.fildb-table td { font-size: 13.5px; }
.fildb-table td:first-child { min-width: 170px; }
.fildb-table td:first-child a { color: inherit; text-decoration: none; }
.fildb-table td:first-child a:hover { text-decoration: underline; }
.fildb-table .tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 180px; }
.fildb-table .tag { font-size: 10.5px; }
.fildb-pill { display: inline-block; white-space: nowrap; font: 600 11.5px/1.2 var(--font-mono); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }
.fildb-pill.enc-open, .fildb-pill.enc-any, .fildb-pill.heat-no { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.fildb-pill.enc-rec, .fildb-pill.heat-opt { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.fildb-pill.enc-req, .fildb-pill.heat-rec { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.fildb-unc { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; font-weight: 700; background: var(--warn); color: #111; cursor: help; }
.fildb-foot { font-size: 12px; margin: 12px 0 0; }
.fildb-foot a { color: inherit; }
.fildb .table-wrap { max-height: 72vh; overflow: auto; }
.fildb-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel, #1f232a); }
.fildb-table td { padding: 9px 12px; }
.panel:has(.fildb), .fildb, main:has(.fildb), #view:has(.fildb) { min-width: 0; max-width: 100%; }
.fildb-esd { color: var(--ok); }
/* Vorrat aus Spoolman: Spalte „Auf Lager“, Anfrage-Hinweise, Materialkarten */
.fildb-pill.stock-yes { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.fildb-pill.stock-no { color: var(--dim); }
.fildb-stock { min-width: 110px; }
.fildb-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.fildb-dot, .stock-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); vertical-align: middle; }
.fildb-table tr.in-stock td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.fildb-table .tag.fildb-sp { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }
#quoteForm > .field { align-self: start; }
.stock-hint { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.45; }
.stock-hint.yes { color: var(--ok); }
.stock-hint.no { color: var(--warn); }
.stock-hint .stock-dot { margin-right: 3px; }
.material .stock-badge { margin-left: auto; align-self: flex-start; white-space: nowrap; font: 600 11px/1.2 var(--font-mono); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--dim); }
.material .stock-badge.yes { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.viewer-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: min(420px, 86%); text-align: center; padding: 18px 20px; border-radius: 14px; background: rgba(12,14,18,.82); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; z-index: 4; }
.viewer-note b { display: block; font: 700 16px var(--font-head); margin-bottom: 6px; }
.viewer-note button { margin-top: 12px; }

/* Richtpreis in der Druckanfrage */
.est-box { border: 1px solid rgba(47,140,255,.35); background: rgba(47,140,255,.07); border-radius: 14px; padding: 14px 16px; }
.est-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); }
.est-head b { font: 700 24px/1.1 var(--font-mono); color: var(--text, #fff); }
.est-line { font-size: 13.5px; margin-top: 4px; }
.est-box .stack-bar { margin: 12px 0 10px; }
.est-box .hint { margin: 10px 0 0; }
.est-box.calc .est-head b { opacity: .5; }

/* 3D-Vorschau der hochgeladenen Datei im Anfrageformular */
.est-box { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 16px; align-items: start; }
.est-box .est-info { min-width: 0; grid-column: 2; }
.form-preview { position: relative; height: 240px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(47,140,255,.3);
  background: radial-gradient(circle at 50% 40%, rgba(47,140,255,.18), rgba(10,15,28,.6) 70%); cursor: grab; touch-action: none; grid-column: 1; }
.form-preview:active { cursor: grabbing; }
.form-preview canvas { display: block; width: 100% !important; height: 100% !important; }
.form-preview:not(.has-model) { display: none; }
.est-box:not(:has(.form-preview.has-model)) .est-info { grid-column: 1 / -1; }
.fp-hint { position: absolute; left: 8px; right: 8px; bottom: 6px; font-size: 11px; color: var(--muted); text-align: center; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
@media (max-width: 720px) { .est-box { grid-template-columns: 1fr; } .est-box .est-info, .form-preview { grid-column: 1; } .form-preview { height: 220px; } }

/* ==========================================================================
   Rechnungen: Editor im Cockpit und Druckansicht (A4, DIN-5008-nah)
   ========================================================================== */
.inv-totals .kv .sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 4px 0; }
.inv-totals .kv .strong { color: #fff; font-weight: 700; font-size: 16px; }
table.inv-lines td { vertical-align: top; padding: 8px 8px; }
table.inv-lines input, table.inv-lines select, table.inv-lines textarea { padding: 7px 9px; font-size: 13.5px; }
table.inv-lines tr.inv-auto td:first-child { color: var(--cyan); }
.tag.inv-st-draft { color: #cbd5e1; }
.tag.inv-st-issued { color: #fde68a; border-color: rgba(251,191,36,.5); }
.tag.inv-st-paid { color: #86efac; border-color: rgba(52,211,153,.5); }
.tag.inv-st-cancelled { color: #fca5a5; border-color: rgba(248,113,113,.5); }
@media print {
  dialog, .bottomnav, .offline-bar { display: none !important; }
  #print-quote.inv-print { padding: 0; font: 10pt/1.45 Arial, Helvetica, sans-serif; color: #111; position: relative; }
  @page { size: A4; margin: 14mm 16mm 16mm 20mm; }
  #print-quote.inv-print .inv-top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #1565e6; padding-bottom: 8px; }
  #print-quote.inv-print .inv-brand { display: flex; gap: 12px; align-items: center; font-size: 13pt; }
  #print-quote.inv-print .inv-brand img { height: 52px; }
  #print-quote.inv-print .inv-contact { text-align: right; font-size: 9pt; color: #333; }
  #print-quote.inv-print .inv-addr { display: flex; justify-content: space-between; gap: 10mm; margin: 12mm 0 8mm; }
  #print-quote.inv-print .inv-window { width: 85mm; min-height: 40mm; }
  #print-quote.inv-print .inv-return { font-size: 7pt; color: #555; border-bottom: 1px solid #999; padding-bottom: 1mm; margin-bottom: 3mm; }
  #print-quote.inv-print .inv-recipient { font-size: 10.5pt; line-height: 1.4; }
  #print-quote.inv-print table.inv-meta { border-collapse: collapse; font-size: 9pt; align-self: flex-start; margin: 0; width: auto; }
  #print-quote.inv-print table.inv-meta th { text-align: left; font-weight: normal; color: #555; padding: 1.5px 10px 1.5px 0; border: 0; white-space: nowrap; }
  #print-quote.inv-print table.inv-meta td { text-align: right; padding: 1.5px 0; border: 0; font-weight: 600; }
  #print-quote.inv-print h1 { font: 700 16pt Arial, Helvetica, sans-serif; letter-spacing: 0; margin: 0 0 2px; color: #111; }
  #print-quote.inv-print .inv-subject { font-weight: 600; margin-bottom: 4mm; }
  #print-quote.inv-print table.inv-lines { width: 100%; border-collapse: collapse; margin: 4mm 0; font-size: 9.5pt; }
  #print-quote.inv-print table.inv-lines thead { display: table-header-group; }
  #print-quote.inv-print table.inv-lines th { background: #eef3fb; border-bottom: 1.5px solid #1565e6; text-align: left; padding: 5px 6px; font-weight: 700; }
  #print-quote.inv-print table.inv-lines td { border-bottom: 1px solid #ddd; padding: 5px 6px; vertical-align: top; }
  #print-quote.inv-print table.inv-lines tr { page-break-inside: avoid; }
  #print-quote.inv-print .r { text-align: right; white-space: nowrap; }
  #print-quote.inv-print .inv-detail { font-size: 8.5pt; color: #555; white-space: pre-wrap; }
  #print-quote.inv-print table.inv-sum { margin: 0 0 4mm auto; width: 85mm; border-collapse: collapse; font-size: 10pt; }
  #print-quote.inv-print table.inv-sum td { padding: 3px 6px; border: 0; }
  #print-quote.inv-print table.inv-sum tr.grand td { border-top: 2px solid #111; font-weight: 700; font-size: 11.5pt; padding-top: 5px; }
  #print-quote.inv-print .inv-tax { font-weight: 600; }
  #print-quote.inv-print .ph { color: #c00; font-style: italic; }
  #print-quote.inv-print .inv-foot { margin-top: 10mm; page-break-inside: avoid; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6mm; font-size: 7.5pt; color: #444; border-top: 1px solid #999; padding-top: 2mm; }
  #print-quote.inv-print .inv-watermark { position: fixed; top: 40%; left: 0; right: 0; text-align: center; font: 700 80pt Arial, sans-serif; color: rgba(200,0,0,.12); transform: rotate(-30deg); pointer-events: none; }
}

/* Filamentfilter im Cockpit (Farbe, Material, Bezeichnung) */
.fil-filter-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.fil-filter .fil-count { font-family: var(--font-mono); }
.fil-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fil-chips .chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; padding: 6px 11px; cursor: pointer; }
.fil-chips .chip .color-dot { margin-right: 6px; }
.fil-chips .chip .fil-n { margin-left: 6px; font: 600 11px/1 var(--font-mono); padding: 2px 6px; border-radius: 999px; background: rgba(0,0,0,.14); color: inherit; }
@media (max-width: 640px) { .fil-filter-row { grid-template-columns: 1fr; } }

/* Materialkarten aus Spoolman */
.material .auto-sorts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.material .auto-sorts .tag { display: inline-flex; align-items: center; gap: 6px; }
.material .auto-sorts .stock-dot { margin: 0; }
