/* ==========================================================================
   Toolkumpel – zentrales Stylesheet
   Farben & Abstände sind als CSS-Variablen oben definiert → hier rebranden.
   ========================================================================== */

:root {
  --brand: #0f5d7a;
  --brand-strong: #0b485f;
  --brand-tint: #e8f1f5;

  --bg: #ffffff;
  --bg-soft: #fafcfe;
  --surface: #ffffff;
  --border: #e3e8ee;
  --border-strong: #cdd5df;

  --text: #16202b;
  --text-muted: #5a6675;
  --text-faint: #8794a3;

  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;

  /* Kategorie-Akzente (dezent) */
  --cat-validierung: #0e7490;
  --cat-technik: #b45309;
  --cat-buero: #4338ca;
  --cat-gaming: #7e22ce;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(16, 32, 43, .04), 0 6px 20px rgba(16, 32, 43, .06);
  --shadow-hover: 0 2px 4px rgba(16, 32, 43, .06), 0 12px 28px rgba(16, 32, 43, .12);

  --maxw: 1320px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --brand: #4db6d6;
    --brand-strong: #6fc6e0;
    --brand-tint: #14303b;

    --bg: #0e151c;
    --bg-soft: #121b24;
    --surface: #16202b;
    --border: #243140;
    --border-strong: #324153;

    --text: #e8edf2;
    --text-muted: #a3b0bf;
    --text-faint: #74828f;

    --cat-validierung: #38bdf8;
    --cat-technik: #f59e0b;
    --cat-buero: #818cf8;
    --cat-gaming: #c084fc;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .5);
  }
}

/* Manuell gewählter Dunkelmodus (Umschalter oben links) – hat Vorrang vor dem System.
   Werte bewusst identisch zum @media-Block oben halten. */
:root[data-theme="dark"] {
  --brand: #4db6d6;
  --brand-strong: #6fc6e0;
  --brand-tint: #14303b;

  --bg: #0e151c;
  --bg-soft: #121b24;
  --surface: #16202b;
  --border: #243140;
  --border-strong: #324153;

  --text: #e8edf2;
  --text-muted: #a3b0bf;
  --text-faint: #74828f;

  --cat-validierung: #38bdf8;
  --cat-technik: #f59e0b;
  --cat-buero: #818cf8;
  --cat-gaming: #c084fc;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .5);
}

/* ---------- Reset / Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; font-weight: 700; color: var(--text); }
h1 { font-size: 2rem; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 0; }
h3 { font-size: 1.12rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
main { flex: 1 0 auto; }

.icon { width: 1.25em; height: 1.25em; vertical-align: -.18em; }

/* ---------- Kopfzeile ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--brand); flex: none; }
.brand small { display: block; font-size: .68rem; font-weight: 500; color: var(--text-faint); letter-spacing: .04em; }

.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: var(--radius-sm); white-space: nowrap;
}
.nav-ico { width: 16px; height: 16px; flex: none; }
.site-nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.site-nav a.is-active { color: var(--brand-strong); background: var(--brand-tint); }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  width: 42px; height: 38px; font-size: 1.2rem; color: var(--text); cursor: pointer;
}

/* Hell-/Dunkel-Umschalter (oben links, direkt neben dem Logo) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 38px;
  background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--brand-strong); background: var(--brand-tint); border-color: var(--brand); }
.theme-toggle .icon { width: 20px; height: 20px; vertical-align: 0; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, color-mix(in srgb, var(--brand-tint) 48%, var(--surface)), var(--bg)); border-bottom: 1px solid var(--border); }
.hero-inner { padding: 26px 0 22px; }
.hero h1 { font-size: 1.8rem; max-width: none; }
.hero p { font-size: 1rem; color: var(--text-muted); max-width: 82ch; margin: .25rem 0 0; }
.hero .eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-strong); background: var(--brand-tint);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.breadcrumb { font-size: .9rem; color: var(--text-faint); margin-bottom: 10px; }
.breadcrumb a { color: var(--text-muted); }

.page-head { padding: 40px 0 8px; }
.page-head .cat-icon {
  width: 46px; height: 46px; color: var(--brand);
  background: var(--brand-tint); border-radius: 12px; padding: 9px; margin-bottom: 14px;
}

/* ---------- Sektionen & Grid ---------- */
.section { padding: 38px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.section-icon { width: 1.4rem; height: 1.4rem; color: var(--brand); }
.section-link { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.section-desc { color: var(--text-muted); margin: .35rem 0 1.3rem; max-width: 65ch; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 18px; }

/* ---------- Tool-Karten ---------- */
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.tool-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.tool-card h3 { margin: 0; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: .95rem; flex: 1; }
.tool-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.tool-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px; background: var(--brand-tint); color: var(--brand-strong); flex: none; }
.tool-card-icon .icon { width: 22px; height: 22px; vertical-align: 0; }
.tool-card-badges { display: inline-flex; align-items: center; gap: 8px; }
.tool-card-cta { margin-top: 6px; font-weight: 600; font-size: .92rem; color: var(--brand-strong); }
.tool-card.is-planned { opacity: .82; box-shadow: none; background: var(--bg-soft); }
.tool-card.is-planned .tool-card-cta { color: var(--text-faint); }

.cat-badge {
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
  color: #fff; background: var(--text-muted);
}
.cat-badge[data-cat="validierung"] { background: var(--cat-validierung); }
.cat-badge[data-cat="technik"] { background: var(--cat-technik); }
.cat-badge[data-cat="buero"] { background: var(--cat-buero); }
.cat-badge[data-cat="gaming"] { background: var(--cat-gaming); }

.status-badge {
  font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: .9rem; }

/* ---------- Rechner-Layout (Tool-Seiten) ---------- */
/* Rechner links, Berechnungsgrundlage/Infos rechts (läuft sticky mit), Werbung darunter.
   Über display:contents werden die beiden Karten + die Werbung zu direkten Rasterzellen –
   so steht die Info gleich neben dem Rechner, ohne dass die HTML-Struktur geändert wird. */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr); gap: 24px 28px; align-items: start; padding: 8px 0 50px; }
.tool-layout > div { display: contents; }
.tool-layout > div > .card { grid-column: 1; }
.tool-layout > div > .card.prose {
  grid-column: 2; grid-row: 1; align-self: start; margin-top: 0; max-width: none;
  position: sticky; top: 84px;
  background: color-mix(in srgb, var(--brand-tint) 38%, var(--surface));
}
/* Zwei-Spalten-Layout für Rechner mit mehreren Eingabe-Karten: die Rechner-Karten
   links gestapelt (tc-main, ohne Lücke), die Info-Karte rechts (tc-side, nicht sticky).
   Auf Smartphones automatisch untereinander. */
.tool-cols { display: flex; gap: 24px; align-items: flex-start; padding: 8px 0 50px; }
.tool-cols .tc-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.tool-cols .tc-col > .card { margin: 0; }
.tool-cols .tc-col > .card.prose { max-width: none; background: color-mix(in srgb, var(--brand-tint) 38%, var(--surface)); }
@media (max-width: 900px) { .tool-cols { flex-direction: column; } }
.tool-layout > aside { grid-column: 1; margin: 0; }
.tool-layout aside .ad-slot[data-format="sidebar"] { min-height: 120px; position: static; top: auto; }
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; gap: 22px; }
  .tool-layout > div { display: block; }
  .tool-layout > div > .card.prose { position: static; top: auto; grid-column: auto; margin-top: 22px; }
}

/* Breites Dashboard-Layout (volle Breite, zwei gleichwertige Spalten) für
   rechenintensive Tools mit vielen Karten. Karten sind direkte Kinder;
   .full spannt über beide Spalten. Auf Smartphones automatisch eine Spalte. */
.tool-dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; padding: 8px 0 50px; }
.tool-dash > .card { margin: 0; }
.tool-dash > .full { grid-column: 1 / -1; }
.tool-dash > .card.prose { max-width: none; }
@media (max-width: 880px) { .tool-dash { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.card + .card { margin-top: 22px; }

/* Formulare */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.calc-grid .field { justify-content: flex-end; }
.wip-badge { display: inline-block; vertical-align: middle; margin-left: 10px; font-size: .5em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent); padding: 4px 10px; border-radius: 999px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .82rem; color: var(--text-faint); }
.field-row { display: flex; gap: 8px; }
.field-row > * { min-width: 0; }

input[type="text"], input[type="number"], select, textarea {
  font: inherit; color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .unit {
  position: absolute; right: 12px; color: var(--text-muted); font-size: 1rem;
  font-weight: 600; pointer-events: none;
}
.input-affix input { padding-right: 48px; }

/* Berechnetes, nicht editierbares Feld (grau dargestellt) */
.input-readonly { background: color-mix(in srgb, var(--bg-soft) 80%, var(--text-faint)); color: var(--text-muted); font-weight: 600; cursor: default; font-variant-numeric: tabular-nums; }
.input-readonly:focus { border-color: var(--border); box-shadow: none; }

/* Tabs (z. B. Modus-Wechsel) */
.tabs { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 20px; }
.tab-btn { font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; border: none; background: none; color: var(--text-muted); padding: 7px 16px; border-radius: 999px; }
.tab-btn.is-active { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow); }

/* Ergebnis-Anzeige – als freundlich getöntes Feld hervorgehoben */
.result { margin-top: 24px; background: var(--brand-tint); border-radius: var(--radius); padding: 8px 18px 14px; }
.result-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; }
.result-row + .result-row { border-top: 1px dashed var(--border); }
.result-label { color: var(--text-muted); font-weight: 500; }
.result-value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-strong); }
.result-value .unit { font-size: .9rem; font-weight: 600; color: var(--text-faint); margin-left: 4px; }
.result-note { font-size: .9rem; color: var(--text-faint); margin-top: 12px; }

/* Varianten-Leiter (z. B. Etiketten-Kürzer) */
.variant + .variant { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.variant-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.variant-name { font-weight: 600; }
.variant-len { font-size: .85rem; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.variant-len.fits { color: var(--ok); font-weight: 600; }
.variant-len.over { color: var(--danger); }
.variant-row { display: flex; gap: 8px; align-items: stretch; }
.variant-text { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .98rem; }
.variant-row .btn { flex: none; }

/* Hinweis-/Infoboxen */
.callout { border-left: 4px solid var(--brand); background: var(--brand-tint); padding: 14px 16px; border-radius: var(--radius-sm); font-size: .95rem; }
.callout.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.callout strong { color: var(--text); }

/* Fließtext (Erklärungen, Recht) */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.3rem; margin: 1.8em 0 .5em; }
.prose h3 { margin: 1.4em 0 .4em; }
.prose p, .prose ul, .prose ol { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose code { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.prose .formula { display: block; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .95rem; overflow-x: auto; }

/* ---------- Werbeplatz (Platzhalter) ----------
   Aktuell komplett ausgeblendet (display:none), da noch keine Werbung läuft.
   Sobald du Werbung (z. B. AdSense) schaltest: bei .ad-slot wieder "display: flex"
   und bei .ad-label "display: block" setzen – dann erscheinen die vorbereiteten
   Flächen wieder an Ort und Stelle (das übrige Styling bleibt ja erhalten). */
.ad-slot {
  display: none; align-items: center; justify-content: center; text-align: center;
  min-height: 110px; color: var(--text-faint); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg-soft);
}
.ad-slot[data-format="sidebar"] { min-height: 600px; position: sticky; top: 84px; }
.ad-label { display: none; font-size: .7rem; color: var(--text-faint); text-align: center; margin: 0 0 4px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Fußzeile ---------- */
.site-footer { flex: none; background: var(--bg); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding: 44px 0 28px; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--text-muted); padding: 4px 0; font-size: .95rem; }
.footer-col a:hover { color: var(--text); }
.footer-brand .brand { font-size: 1.1rem; }
.footer-brand p { color: var(--text-muted); font-size: .92rem; max-width: 34ch; margin: 12px 0 0; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0; font-size: .88rem; color: var(--text-faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  h1, .hero h1 { font-size: 1.9rem; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; gap: 2px; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 10px 20px 16px; box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* Zugänglichkeit: weniger Bewegung */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ==========================================================================
   Ergänzungen für einzelne Tools
   ========================================================================== */

/* Schnellwahl-Knöpfe (z. B. Steuersatz, Trinkgeld-Prozent) */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.presets .btn.is-active { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-tint); }

/* Datums-Eingabe (Prüfintervall- & Fristenrechner) – gleicher Look wie Text/Zahl */
input[type="date"] {
  font: inherit; color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%;
}
input[type="date"]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

/* Feld-Gruppen in größeren Formularen (3D-Druck-Kostenrechner) */
.group-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); margin: 22px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.group-title:first-child { margin-top: 0; }

/* Status-Ampel (Fristenrechner) */
.status-pill {
  display: inline-block; font-weight: 600; font-size: .92rem;
  padding: 4px 12px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-muted);
}
.status-pill.is-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.status-pill.is-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.status-pill.is-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

/* Referenz-/Vergleichstabelle (Haltezeit-Rechner) */
.ref-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ref-table th, .ref-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border); }
.ref-table th:first-child, .ref-table td:first-child { text-align: left; }
.ref-table thead th { font-size: .78rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .03em; }
.ref-table tbody tr:last-child td { border-bottom: 0; }
.ref-table tbody tr.is-current { background: var(--brand-tint); }
.ref-table tbody tr.is-current td { font-weight: 600; }

/* Messpunkt-Tabelle (Z-Wert-Rechner) */
.measure-head, .measure-row { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 10px; align-items: center; }
.measure-head { font-size: .82rem; color: var(--text-faint); font-weight: 600; margin-bottom: 8px; padding: 0 2px; }
.measure-row { margin-bottom: 8px; }
.measure-row .z-del { padding: 9px 0; line-height: 1; }

/* Diagramm (Z-Wert-Rechner) */
.chart-wrap { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { stroke: var(--border-strong); stroke-width: 1; }
.chart-label { fill: var(--text-faint); font-size: 11px; font-family: var(--font); }
.chart-line { stroke: var(--brand); stroke-width: 2; fill: none; }
.chart-pt { fill: var(--brand); stroke: var(--surface); stroke-width: 1.5; }

/* QR-Code-Generator */
.qr-stage { display: flex; justify-content: center; align-items: center; padding: 20px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 180px; }
.qr-stage canvas { max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 4px; box-shadow: var(--shadow); }
.qr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.qr-error { color: var(--danger); font-size: .92rem; margin-top: 12px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; flex: none; }
.color-field .color-val { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .9rem; letter-spacing: .03em; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Schema-Grafik (CNC-Vorschubrechner) */
.cnc-wrap { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.cnc-vis { width: 100%; height: auto; display: block; max-width: 460px; margin: 0 auto; }
.cnc-body { fill: var(--brand-tint); stroke: var(--brand); stroke-width: 2; }
.cnc-tooth { stroke: var(--brand); stroke-width: 2; stroke-linecap: round; }
.cnc-center { fill: var(--brand-strong); }
.cnc-dim { stroke: var(--text-muted); stroke-width: 1; }
.cnc-dim-fill { fill: var(--text-muted); }
.cnc-label { fill: var(--text); font-size: 13px; font-weight: 600; font-family: var(--font); }
.cnc-note { fill: var(--text-faint); font-size: 11px; font-family: var(--font); }
.cnc-arrow { stroke: var(--cat-technik); stroke-width: 2.5; fill: none; stroke-linecap: round; }
.cnc-arrow-fill { fill: var(--cat-technik); }

/* Drehbares 3D-Modell (Boxen-Zuschnitt-Rechner) – reine CSS-3D-Transforms */
.box3d-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.box3d-head h2 { margin: 0; }
.box3d-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.box3d-stage {
  position: relative; height: 340px;
  perspective: 1000px;
  background:
    radial-gradient(120% 90% at 50% 8%, color-mix(in srgb, var(--brand-tint) 55%, var(--bg-soft)), var(--bg-soft) 70%);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; touch-action: none; cursor: grab; user-select: none;
}
.box3d-stage.is-dragging { cursor: grabbing; }
.box3d-scene { position: absolute; inset: 0; transform-style: preserve-3d; }
.box3d-panel { position: absolute; top: 50%; left: 50%; width: 0; height: 0; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4, .08, .2, 1); }
.box3d-face {
  position: absolute; left: 0; top: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid; backface-visibility: hidden;
}
.box3d-panel[data-g="tb"]   .box3d-face { background: color-mix(in srgb, var(--brand) 34%, transparent);        border-color: color-mix(in srgb, var(--brand) 65%, var(--border)); }
.box3d-panel[data-g="side"] .box3d-face { background: color-mix(in srgb, var(--cat-buero) 32%, transparent);    border-color: color-mix(in srgb, var(--cat-buero) 62%, var(--border)); }
.box3d-panel[data-g="fb"]   .box3d-face { background: color-mix(in srgb, var(--cat-technik) 32%, transparent);  border-color: color-mix(in srgb, var(--cat-technik) 62%, var(--border)); }
.box3d-tag { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; text-align: center; pointer-events: none; padding: 2px 4px; text-shadow: 0 1px 2px var(--surface); }
.box3d-tag b { font-size: 12px; font-weight: 700; color: var(--text); }
.box3d-tag i { font-style: normal; font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.box3d-hint { margin-top: 10px; }

/* Zuschnittliste mit Farbpunkten passend zum 3D-Modell */
.cutlist td:first-child { position: relative; padding-left: 22px; }
.cutlist tr[data-g] td:first-child::before {
  content: ""; position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 3px;
}
.cutlist tr[data-g="tb"]   td:first-child::before { background: var(--brand); }
.cutlist tr[data-g="side"] td:first-child::before { background: var(--cat-buero); }
.cutlist tr[data-g="fb"]   td:first-child::before { background: var(--cat-technik); }
.cutlist tfoot td { font-weight: 600; border-top: 2px solid var(--border-strong); }
