/*
  3D-Modell-Viewer (modell_freigabe/*.html, js/modellViewer.js).
  Farben aus der Kalkulator-Palette (laser-theme.css, --lz-*): Stahlblau für Bedienung,
  Funken-Orange für alles, was auf das Modell zeigt (Pins, Messungen, Schnitt).
*/
:root {
    --mv-tinte: #14181c;
    --mv-tinte-2: #2a323a;
    --mv-grau: #5b6672;
    --mv-linie: #dfe3e7;
    --mv-flaeche: #ffffff;
    --mv-grund: #f2f4f5;
    --mv-stahl: #1d4e7a;
    --mv-stahl-dunkel: #163c5e;
    --mv-stahl-hell: #e8f0f7;
    --mv-funke: #c8692a;
    --mv-funke-dunkel: #a8500c;
    --mv-funke-hell: #fdf1e6;
    --mv-gruen: #14713f;
    --mv-gruen-hell: #e6f2eb;
    --mv-rot: #a5231b;
    --mv-schatten: 0 10px 30px rgba(20, 24, 28, 0.16), 0 2px 6px rgba(20, 24, 28, 0.08);
    --mv-radius: 10px;
    --mv-kopf: 56px;
    --mv-schrift: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mv-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.mv {
    margin: 0;
    font-family: var(--mv-schrift);
    font-size: 14px;
    line-height: 1.45;
    color: var(--mv-tinte);
    background: var(--mv-grund);
    -webkit-font-smoothing: antialiased;
}
body.mv:not(.mv-leer):not(.mv-start-seite) { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
:focus-visible { outline: 2px solid #2f7bc4; outline-offset: 2px; }
.mv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ Grundgerüst */

.mv-app { display: grid; grid-template-rows: var(--mv-kopf) minmax(0, 1fr); height: 100dvh; }

.mv-kopf {
    display: flex; align-items: center; gap: 16px;
    padding: 0 14px 0 16px;
    background: var(--mv-tinte);
    color: #f4f6f8;
    border-bottom: 1px solid #000;
    min-width: 0;
}
.mv-kopf__marke { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; padding-right: 16px; border-right: 1px solid rgba(255, 255, 255, 0.12); height: 32px; }
.mv-kopf__marke img { display: block; }
.mv-kopf__firma { font-weight: 600; letter-spacing: 0.01em; font-size: 13px; color: #cfd6dd; }
.mv-kopf__titel { min-width: 0; flex: 1 1 auto; }
.mv-kopf__titel h1 { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-kopf__meta { margin: 0; font-size: 12px; color: #9aa6b2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.mv-kopf__aktionen { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mv-kopf .mv-knopf--leise { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); color: #e9edf1; }
.mv-kopf .mv-knopf--leise:hover { background: rgba(255, 255, 255, 0.14); }

.mv-haupt { display: flex; min-height: 0; position: relative; }

/* ------------------------------------------------------------------ Knöpfe */

.mv-knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 34px; padding: 0 13px;
    border: 1px solid transparent; border-radius: 7px;
    font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.mv-knopf--primaer { background: var(--mv-stahl); color: #fff; }
.mv-knopf--primaer:hover { background: var(--mv-stahl-dunkel); }
.mv-knopf--leise { background: var(--mv-flaeche); border-color: var(--mv-linie); color: var(--mv-tinte-2); }
.mv-knopf--leise:hover { background: var(--mv-grund); border-color: #c9d0d6; }
.mv-knopf--gefahr { background: #fff; border-color: #f0c9c6; color: var(--mv-rot); }
.mv-knopf--gefahr:hover { background: #fdeceb; }
.mv-knopf--klein { min-height: 28px; padding: 0 10px; font-size: 12px; }
.mv-knopf--voll { width: 100%; }
.mv-knopf--ikon { width: 34px; padding: 0; }
.mv-ikon {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border: 0; border-radius: 7px; background: transparent; color: var(--mv-tinte-2);
}
.mv-ikon:hover { background: var(--mv-grund); }
.mv-ikon.ist-aktiv { background: var(--mv-stahl); color: #fff; }
.mv-ikon--klein { width: 26px; height: 26px; font-size: 12px; color: var(--mv-grau); }
.mv-zaehler:empty { display: none; }
.mv-zaehler { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--mv-funke); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.mv-nur-schmal { display: none !important; }

/* ------------------------------------------------------------------ Bühne */

.mv-buehne { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; --mv-buehne-grund: #eef1f4; touch-action: none; }
.mv-buehne[data-hintergrund="hell"] { background: #f6f7f9; --mv-buehne-grund: #f6f7f9; }
.mv-buehne[data-hintergrund="verlauf"] { background: radial-gradient(120% 90% at 50% 18%, #ffffff 0%, #e9edf1 55%, #cfd6dd 100%); --mv-buehne-grund: #e9edf1; }
.mv-buehne[data-hintergrund="dunkel"] { background: radial-gradient(120% 90% at 50% 18%, #2b333c 0%, #161b21 70%, #0d1013 100%); --mv-buehne-grund: #161b21; }
.mv-leinwand, .mv-leinwand canvas { position: absolute; inset: 0; display: block; }
.mv-buehne[data-werkzeug="messen"] canvas, .mv-buehne[data-modus="pin"] canvas { cursor: crosshair; }

/* Pins */
.mv-pins, .mv-messungen { position: absolute; inset: 0; pointer-events: none; }
.mv-pin {
    position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none;
    pointer-events: auto; will-change: transform;
}
.mv-pin > span {
    position: absolute; left: -14px; top: -38px; width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%; background: var(--mv-funke); color: #fff;
    font: 700 12px/1 var(--mv-schrift); font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0, 0, 0, 0.35);
    transition: transform .15s;
}
.mv-pin > span::after {
    content: ""; position: absolute; left: 50%; bottom: -8px; width: 0; height: 0; margin-left: -5px;
    border: 5px solid transparent; border-top: 6px solid #fff;
}
.mv-pin > span::before {
    content: ""; position: absolute; left: 50%; top: 34px; width: 6px; height: 6px; margin-left: -3px;
    border-radius: 50%; background: var(--mv-funke); box-shadow: 0 0 0 1.5px #fff;
}
.mv-pin:hover > span { transform: scale(1.12); }
.mv-pin--erledigt > span, .mv-pin--erledigt > span::before { background: var(--mv-gruen); }
.mv-pin--aktiv > span { background: var(--mv-stahl); transform: scale(1.18); box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(29, 78, 122, .35), 0 3px 10px rgba(0, 0, 0, .35); }
.mv-pin--aktiv > span::before { background: var(--mv-stahl); }
.mv-pin--entwurf > span { background: #fff; color: var(--mv-funke-dunkel); box-shadow: 0 0 0 2px var(--mv-funke), 0 3px 8px rgba(0, 0, 0, .3); animation: mv-puls 1.4s ease-in-out infinite; }
@keyframes mv-puls { 50% { transform: scale(1.12); } }

/* Messen */
.mv-messpunkt { position: absolute; left: 0; top: 0; }
.mv-messpunkt::before { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--mv-funke); box-shadow: 0 0 0 2px #fff; }
.mv-messpunkt--start::before { animation: mv-puls 1s infinite; }
.mv-masszahl {
    position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 8px; border-radius: 6px; background: var(--mv-tinte); color: #fff; white-space: nowrap;
    font: 600 12px/1.3 var(--mv-mono); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); pointer-events: auto;
}
.mv-masszahl small { display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 50%; background: var(--mv-funke); font-size: 10px; }
.mv-schweben { position: absolute; left: 0; top: 0; }
.mv-schweben::before { content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--mv-funke); background: rgba(200, 105, 42, .18); }
.mv-schweben--ecke::before { border-radius: 2px; transform: rotate(45deg); background: var(--mv-funke); }

/* Markierungen */
.mv-markup { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: visible; }
.mv-markup--sichtbar { opacity: 1; }
.mv-buehne[data-modus="markup"] .mv-markup { pointer-events: auto; cursor: crosshair; background: rgba(20, 24, 28, .04); }
.mv-buehne[data-modus="markup"] .mv-pins { opacity: .35; }
.mv-buehne[data-modus="markup"]::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    box-shadow: inset 0 0 0 3px var(--mv-funke);
}
.mv-texteingabe {
    position: absolute; z-index: 6; min-width: 180px; padding: 4px 8px;
    border: 2px solid currentColor; border-radius: 6px; background: #fff;
    font-weight: 600; transform: translateY(-4px);
}

/* ViewCube */
.mv-viewcube { position: absolute; top: 14px; right: 14px; width: 110px; height: 110px; z-index: 3; }
.mv-viewcube canvas { display: block; cursor: pointer; }
.mv-viewcube__heim {
    position: absolute; left: -8px; top: -4px; width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--mv-linie); background: #fff; color: var(--mv-tinte-2); font-size: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.mv-viewcube__heim:hover { color: var(--mv-stahl); }

/* Werkzeugleiste */
.mv-werkzeuge {
    position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 4;
    display: flex; align-items: center; gap: 2px; padding: 6px;
    max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none;
    background: rgba(20, 24, 28, 0.92); border-radius: 14px; box-shadow: var(--mv-schatten);
    backdrop-filter: blur(6px);
}
.mv-werkzeuge::-webkit-scrollbar { display: none; }
.mv-werkzeug {
    position: relative; display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 42px; height: 42px; border: 0; border-radius: 9px; background: transparent; color: #dfe5ea; font-size: 16px;
}
.mv-werkzeug:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; }
.mv-werkzeug.ist-aktiv { background: var(--mv-stahl); color: #fff; }
.mv-werkzeug--primaer { width: auto; padding: 0 14px; gap: 8px; display: inline-flex; background: var(--mv-funke); color: #fff; margin-left: 4px; }
.mv-werkzeug--primaer:hover:not(:disabled) { background: var(--mv-funke-dunkel); }
.mv-werkzeug__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mv-werkzeug--primaer .mv-werkzeug__text { position: static; width: auto; height: auto; clip: auto; font-size: 13px; font-weight: 600; }
.mv-trenner { width: 1px; height: 24px; margin: 0 4px; background: rgba(255, 255, 255, 0.16); flex: 0 0 auto; }

/* Schwebendes Werkzeug-Panel */
.mv-panel {
    position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 5;
    width: min(380px, calc(100% - 24px)); max-height: calc(100% - 120px); overflow: auto;
    background: var(--mv-flaeche); border-radius: var(--mv-radius); box-shadow: var(--mv-schatten);
}
.mv-panel__kopf { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 14px; }
.mv-panel__kopf h2 { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mv-grau); }
.mv-panel__inhalt { padding: 4px 14px 14px; display: grid; gap: 12px; }
.mv-panel__text { margin: 0; color: var(--mv-tinte-2); }
.mv-panel__klein { font-size: 12px; color: var(--mv-grau); }

.mv-segment { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--mv-grund); border: 1px solid var(--mv-linie); gap: 2px; }
.mv-segment button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--mv-grau); }
.mv-segment button.ist-aktiv { background: #fff; color: var(--mv-stahl); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.mv-segment--voll { display: flex; }
.mv-segment--voll button { flex: 1; }
.mv-feld { display: grid; gap: 5px; }
.mv-feld > span { font-size: 12px; font-weight: 600; color: var(--mv-grau); }
.mv-regler { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mv-grau); }
.mv-regler input { width: 100%; accent-color: var(--mv-funke); }
.mv-schalter { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.mv-schalter input { width: 16px; height: 16px; accent-color: var(--mv-stahl); margin: 0; }
.mv-schalter--mail { font-size: 12px; color: var(--mv-tinte-2); padding: 7px 9px; background: var(--mv-stahl-hell); border-radius: 7px; }
.mv-linkfeld { display: flex; gap: 6px; }
.mv-linkfeld input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--mv-linie); border-radius: 7px; font: 12px var(--mv-mono); background: var(--mv-grund); }
.mv-verwaltung { padding: 10px; border-radius: 8px; background: var(--mv-funke-hell); display: grid; gap: 8px; }
.mv-messliste { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: m; }
.mv-messliste li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 10px; padding: 7px 8px 7px 10px; border: 1px solid var(--mv-linie); border-radius: 8px; counter-increment: m; }
.mv-messliste li::before { content: counter(m); grid-row: span 2; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--mv-funke); color: #fff; font-size: 11px; font-weight: 700; }
.mv-messliste b { font-family: var(--mv-mono); }
.mv-messliste small { grid-column: 2; color: var(--mv-grau); font-family: var(--mv-mono); font-size: 11px; }
.mv-messliste button { grid-column: 3; grid-row: 1 / span 2; }
.mv-hilfe { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.mv-hilfe dt { font-weight: 600; color: var(--mv-stahl); white-space: nowrap; }
.mv-hilfe dd { margin: 0; color: var(--mv-tinte-2); }

/* Markierungsleiste */
.mv-markup-leiste {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
    display: flex; align-items: center; gap: 6px; padding: 6px; flex-wrap: wrap; justify-content: center;
    max-width: calc(100% - 150px);
    background: var(--mv-flaeche); border-radius: 12px; box-shadow: var(--mv-schatten);
}
.mv-gruppe { display: flex; align-items: center; gap: 2px; padding: 0 4px; border-right: 1px solid var(--mv-linie); }
.mv-gruppe:last-of-type { border-right: 0; }
.mv-farbe { width: 22px; height: 22px; margin: 0 2px; border-radius: 50%; border: 2px solid #fff; background: var(--f); box-shadow: 0 0 0 1px var(--mv-linie); }
.mv-farbe.ist-aktiv { box-shadow: 0 0 0 2px var(--f); }
.mv-breite span { display: block; width: 18px; border-radius: 3px; background: currentColor; }

/* Hinweis oben */
.mv-hinweis {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4;
    display: flex; align-items: center; gap: 8px; max-width: calc(100% - 160px);
    padding: 7px 8px 7px 14px; border-radius: 20px; background: var(--mv-tinte); color: #fff; font-size: 13px;
    box-shadow: var(--mv-schatten);
}
.mv-buehne[data-modus="markup"] .mv-hinweis { top: 72px; }
.mv-hinweis__x { border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; }

/* Laden */
.mv-laden { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(242, 244, 245, 0.75); backdrop-filter: blur(2px); }
.mv-laden__karte { width: min(360px, calc(100% - 32px)); padding: 22px; text-align: center; background: #fff; border-radius: var(--mv-radius); box-shadow: var(--mv-schatten); }
.mv-laden__karte p { margin: 12px 0; color: var(--mv-tinte-2); }
.mv-laden__balken { height: 4px; border-radius: 2px; background: var(--mv-grund); overflow: hidden; }
.mv-laden__balken span { display: block; height: 100%; width: 0; background: var(--mv-stahl); transition: width .2s; }
.mv-laden--fehler .mv-spinner, .mv-laden--fehler .mv-laden__balken { display: none; }
.mv-laden--fehler p { color: var(--mv-rot); font-weight: 600; }
.mv-spinner { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--mv-linie); border-top-color: var(--mv-funke); animation: mv-dreh .8s linear infinite; }
@keyframes mv-dreh { to { transform: rotate(360deg); } }

/* Toast */
.mv-toast {
    position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50;
    max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px;
    background: var(--mv-gruen); color: #fff; font-weight: 600; box-shadow: var(--mv-schatten);
}
.mv-toast--fehler { background: var(--mv-rot); }

/* ------------------------------------------------------------------ Linke Spalte */

.mv-seite { background: var(--mv-flaeche); min-height: 0; display: flex; flex-direction: column; }
.mv-seite--links { width: 300px; flex: 0 0 300px; border-right: 1px solid var(--mv-linie); }
.mv-reiter { display: flex; align-items: center; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--mv-linie); }
.mv-reiter [role="tab"] { border: 0; background: none; padding: 8px 10px 9px; font-size: 13px; font-weight: 600; color: var(--mv-grau); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mv-reiter [role="tab"].ist-aktiv { color: var(--mv-stahl); border-bottom-color: var(--mv-stahl); }
.mv-reiter .mv-ikon { margin-left: auto; }
.mv-links__inhalt { flex: 1; overflow: auto; padding: 8px 0 16px; }
.mv-baum__kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 12px 8px; font-size: 12px; color: var(--mv-grau); }
.mv-baum, .mv-baum ul { list-style: none; margin: 0; padding: 0; }
.mv-baum__zeile { display: flex; align-items: center; gap: 2px; padding: 0 6px 0 calc(6px + var(--tiefe) * 14px); min-height: 30px; }
.mv-baum__zeile:hover { background: var(--mv-grund); }
.mv-baum__zeile.ist-gewaehlt { background: var(--mv-stahl-hell); }
.mv-baum__zeile.ist-versteckt .mv-baum__name { opacity: .45; }
.mv-baum__auf { display: inline-grid; place-items: center; width: 20px; height: 24px; border: 0; background: none; color: var(--mv-grau); flex: 0 0 20px; }
.mv-baum__name { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 5px 4px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-baum__name i { color: #8a96a3; margin-right: 4px; font-size: 11px; }
.mv-baum__auge { border: 0; background: none; width: 26px; height: 26px; border-radius: 6px; color: var(--mv-grau); opacity: 0; }
.mv-baum__zeile:hover .mv-baum__auge, .mv-baum__zeile.ist-versteckt .mv-baum__auge, .mv-baum__auge:focus-visible { opacity: 1; }
.mv-eig { padding: 6px 14px 12px; border-bottom: 1px solid var(--mv-linie); }
.mv-eig h3 { margin: 6px 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--mv-grau); }
.mv-eig dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 13px; }
.mv-eig dt { color: var(--mv-grau); }
.mv-eig dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }
.mv-eig__knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mv-links__inhalt > .mv-knopf { margin: 12px 14px; }
.mv-leerhinweis { margin: 14px; color: var(--mv-grau); font-size: 13px; }

/* ------------------------------------------------------------------ Kommentare */

.mv-seite--rechts { width: 370px; flex: 0 0 370px; border-left: 1px solid var(--mv-linie); }
.mv-rechts__kopf { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.mv-rechts__kopf h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
#mv-filter { margin: 0 14px 10px; }
.mv-beschreibung { margin: 0 14px 10px; padding: 9px 11px; border-radius: 8px; background: var(--mv-grund); color: var(--mv-tinte-2); white-space: pre-wrap; font-size: 13px; }
#mv-entwurf { padding: 0 14px 12px; border-bottom: 1px solid var(--mv-linie); }
.mv-entwurf { display: grid; gap: 9px; padding: 12px; border-radius: var(--mv-radius); background: var(--mv-funke-hell); border: 1px solid #f0d6bf; }
.mv-entwurf input[type="text"], .mv-entwurf textarea, .mv-antwortfeld textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #d9dee3; border-radius: 7px; background: #fff; resize: vertical;
}
.mv-entwurf textarea { min-height: 74px; }
.mv-entwurf__werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mv-chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    padding: 5px 10px; border-radius: 16px; border: 1px dashed #c8aa90; background: #fff;
    font-size: 12px; font-weight: 600; color: var(--mv-tinte-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mv-chip.ist-aktiv { border-style: solid; border-color: var(--mv-funke); background: var(--mv-funke); color: #fff; }
.mv-chip.ist-gesetzt { border-style: solid; border-color: var(--mv-gruen); color: var(--mv-gruen); background: var(--mv-gruen-hell); }
.mv-entwurf__hinweis { margin: 0; font-size: 11.5px; color: var(--mv-grau); }
.mv-entwurf__knoepfe { display: flex; justify-content: flex-end; gap: 8px; }

.mv-liste { flex: 1; overflow: auto; padding: 12px 14px 90px; display: grid; gap: 10px; align-content: start; }
.mv-leer-liste { text-align: center; color: var(--mv-grau); padding: 30px 12px; }
.mv-leer-liste i { font-size: 28px; color: #b6bfc8; }
.mv-leer-liste p { margin: 10px 0 0; font-size: 13px; }
.mv-karte {
    position: relative; padding: 11px 12px 9px 14px; border: 1px solid var(--mv-linie); border-radius: var(--mv-radius);
    background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.mv-karte::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mv-funke); }
.mv-karte--erledigt::before { background: var(--mv-gruen); }
.mv-karte:hover { border-color: #c4ccd3; }
.mv-karte.ist-aktiv { border-color: var(--mv-stahl); box-shadow: 0 0 0 3px rgba(29, 78, 122, .12); cursor: default; }
.mv-karte--erledigt .mv-karte__text { color: var(--mv-grau); }
.mv-karte__kopf { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mv-karte__nr { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--mv-funke); color: #fff; font-size: 11px; font-weight: 700; }
.mv-karte--erledigt .mv-karte__nr { background: var(--mv-gruen); }
.mv-karte__autor { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.mv-karte__autor b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-rolle { flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--mv-grund); color: var(--mv-grau); }
.mv-rolle--team { background: var(--mv-stahl-hell); color: var(--mv-stahl); }
.mv-rolle--besitzer { background: var(--mv-funke-hell); color: var(--mv-funke-dunkel); }
.mv-karte time { flex: 0 0 auto; font-size: 11.5px; color: var(--mv-grau); }
.mv-karte__text { margin: 7px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.mv-karte__merkmale { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; font-size: 11.5px; color: var(--mv-grau); }
.mv-karte__merkmale i { color: var(--mv-funke); }
.mv-karte__erledigt { margin: 7px 0 0; font-size: 12px; color: var(--mv-gruen); font-weight: 600; }
.mv-karte__fuss { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mv-karte__fuss .mv-ikon { margin-left: auto; }
.mv-karte__anzahl { font-size: 12px; color: var(--mv-grau); }
.mv-antworten { list-style: none; margin: 10px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--mv-linie); display: grid; gap: 10px; }
.mv-antworten .mv-karte__text { margin-top: 3px; }
.mv-antworten .mv-ikon { margin-left: auto; }
.mv-antwortfeld { display: grid; gap: 7px; margin-top: 10px; }
.mv-antwortfeld__fuss { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.mv-anhang {
    display: flex; align-items: center; gap: 9px; margin-top: 8px; padding: 6px 9px; max-width: 100%;
    border: 1px solid var(--mv-linie); border-radius: 8px; background: var(--mv-grund); color: var(--mv-stahl); text-decoration: none; font-size: 12.5px; font-weight: 600;
}
.mv-anhang:hover { border-color: var(--mv-stahl); }
.mv-anhang span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-anhang small { color: var(--mv-grau); font-weight: 400; }
.mv-anhang--bild { flex-direction: column; align-items: stretch; padding: 4px; }
.mv-anhang--bild img { width: 100%; max-height: 180px; object-fit: contain; border-radius: 5px; background: #fff; }
.mv-anhang--bild span { padding: 2px 4px; }

/* ------------------------------------------------------------------ Schmale Bildschirme */

@media (max-width: 1100px) {
    .mv-seite--links { width: 260px; flex-basis: 260px; }
    .mv-seite--rechts { width: 330px; flex-basis: 330px; }
}
@media (max-width: 900px) {
    :root { --mv-kopf: 52px; }
    .mv-nur-schmal { display: inline-flex !important; }
    .mv-kopf { gap: 10px; padding: 0 10px; }
    .mv-kopf__marke { padding-right: 10px; }
    .mv-kopf__firma { display: none; }
    .mv-kopf__aktionen .mv-knopf span:not(.mv-zaehler) { display: none; }
    .mv-kopf__aktionen .mv-knopf { padding: 0 10px; }
    .mv-seite--rechts, .mv-seite--links {
        position: fixed; top: var(--mv-kopf); bottom: 0; z-index: 20; width: min(400px, 100%); box-shadow: var(--mv-schatten);
        transition: transform .22s ease;
    }
    .mv-seite--rechts { right: 0; transform: translateX(105%); border-left: 0; }
    .mv-seite--links { left: 0; border-right: 0; }
    body.mv-rechts-offen .mv-seite--rechts { transform: none; }
    .mv-viewcube { width: 84px; height: 84px; top: 10px; right: 10px; }
    .mv-werkzeuge { bottom: max(10px, env(safe-area-inset-bottom)); }
    .mv-werkzeug { width: 40px; height: 40px; font-size: 15px; }
    .mv-werkzeug--primaer .mv-werkzeug__text { display: none; }
    .mv-werkzeug--primaer { padding: 0 12px; }
    .mv-markup-leiste { top: 8px; max-width: calc(100% - 16px); }
    .mv-buehne[data-modus="markup"] .mv-viewcube { display: none; }
    .mv-hinweis { max-width: calc(100% - 110px); left: 12px; transform: none; top: 10px; }
    .mv-buehne[data-modus="markup"] .mv-hinweis { top: auto; bottom: 74px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); }
    .mv-panel { bottom: 70px; }
}

/* ------------------------------------------------------------------ Link ungültig */

body.mv-leer { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: radial-gradient(120% 90% at 50% 10%, #ffffff 0%, #e9edf1 60%, #d3dae1 100%); }
.mv-leer__karte { max-width: 440px; padding: 32px 28px; text-align: center; background: #fff; border-radius: 14px; box-shadow: var(--mv-schatten); }
.mv-leer__karte h1 { margin: 16px 0 8px; font-size: 20px; }
.mv-leer__karte p { margin: 0 0 20px; color: var(--mv-tinte-2); }

/* ------------------------------------------------------------------ Öffentliche Startseite /3d-viewer */

body.mv-start-seite { background: #eef1f4; }
.mv-start-kopf { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--mv-tinte); color: #e9edf1; }
.mv-start-kopf a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mv-start {
    max-width: 1080px; margin: 0 auto; padding: 48px 20px 64px;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start;
}
.mv-start__kicker { margin: 0 0 10px; font: 600 12px var(--mv-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mv-funke-dunkel); }
.mv-start h1 { margin: 0 0 14px; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.01em; }
.mv-start__einleitung { margin: 0 0 26px; font-size: 16px; color: var(--mv-tinte-2); max-width: 46ch; }
.mv-start__liste { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.mv-start__liste li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.mv-start__liste i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--mv-stahl); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.mv-start__liste b { display: block; font-size: 14px; }
.mv-start__liste span { color: var(--mv-grau); font-size: 13px; }
.mv-ablage {
    position: relative; display: grid; place-items: center; gap: 10px; min-height: 290px; padding: 28px;
    text-align: center; background: #fff; border: 2px dashed #b9c3cc; border-radius: 16px; cursor: pointer;
    transition: border-color .15s, background-color .15s, transform .15s; box-shadow: var(--mv-schatten);
}
.mv-ablage:hover, .mv-ablage.ist-drueber { border-color: var(--mv-funke); background: #fffaf5; }
.mv-ablage input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mv-ablage__ikon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--mv-funke-hell); color: var(--mv-funke-dunkel); font-size: 26px; }
.mv-ablage__titel { margin: 0; font-size: 17px; font-weight: 700; }
.mv-ablage__info { margin: 0; color: var(--mv-grau); font-size: 12.5px; }
.mv-ablage__balken { width: 100%; height: 6px; border-radius: 3px; background: var(--mv-grund); overflow: hidden; }
.mv-ablage__balken span { display: block; height: 100%; width: 0; background: var(--mv-funke); transition: width .2s; }
.mv-ablage__fehler { margin: 0; color: var(--mv-rot); font-weight: 600; }
.mv-start__hinweis { margin: 14px 2px 0; font-size: 12px; color: var(--mv-grau); }
.mv-eigene { margin-top: 22px; padding: 14px 16px; background: #fff; border-radius: 12px; border: 1px solid var(--mv-linie); }
.mv-eigene h2 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mv-grau); }
.mv-eigene ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.mv-eigene a { color: var(--mv-stahl); font-weight: 600; text-decoration: none; }
.mv-eigene small { color: var(--mv-grau); margin-left: 6px; }
.mv-start-fuss { text-align: center; padding: 0 20px 30px; font-size: 12px; color: var(--mv-grau); }
.mv-start-fuss a { color: inherit; }
@media (max-width: 860px) {
    .mv-start { grid-template-columns: 1fr; padding-top: 28px; gap: 26px; }
    .mv-ablage { min-height: 220px; }
}
