/* =============================================================================
   cad-3d.css – 3D-Arbeitsbereich von VIGL CAD
   Farben kommen aus den Variablen der Zeichenfläche (--cad-…, siehe cad.css).
   ============================================================================= */

/* ---- Umschalten zwischen 2D-Modell, 3D-Modell und Layout ---- */

.bnotes__draw-tools--3d,
.bnotes__cad-status--3d,
.vc3d {
    display: none;
}

.bnotes__draw.is-3d > .bnotes__draw-tools:not(.bnotes__draw-tools--3d),
.bnotes__draw.is-3d > .bnotes__cad-status:not(.bnotes__cad-status--3d),
.bnotes__draw.is-3d .bnotes__draw-ctx,
.bnotes__draw.is-3d .bnotes__cad-tip,
.bnotes__draw.is-3d .bnotes__cad-mini,
.bnotes__draw.is-3d .bnotes__cad-hint,
.bnotes__draw.is-3d .bnotes__cad > .bnotes__svg {
    display: none !important;
}

.bnotes__draw.is-3d > .bnotes__draw-tools--3d {
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    overflow-y: auto;
    scrollbar-width: none;
}

.bnotes__draw.is-3d > .bnotes__draw-tools--3d::-webkit-scrollbar {
    display: none;
}

.bnotes__draw.is-3d > .bnotes__cad-status--3d {
    display: flex;
    flex-wrap: nowrap;
    grid-column: 1 / -1;
    grid-row: 2;
}

.bnotes__cad-status--3d .vc3d-status-text {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bnotes__cad-tab--3d.is-on {
    color: var(--cad-akzent, #00a586);
}

/* ---- Bild und Seitenleiste ---- */

.vc3d.is-an {
    position: absolute;
    inset: 0;
    display: flex;
    background: #232930;
    outline: none;
    color: var(--cad-text, #dfe3e8);
    font-size: 9.5pt;
}

.vc3d-bild {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    touch-action: none;
}

.vc3d-canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

.vc3d-tafel {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    padding: 10px 16px;
    border-radius: 4px;
    background: rgba(18, 21, 25, .9);
    color: var(--cad-text, #dfe3e8);
    pointer-events: none;
}

.vc3d-kopf {
    position: absolute;
    left: 8px;
    top: 8px;
    right: 316px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    pointer-events: none;
}

.vc3d.ohne-dock .vc3d-kopf {
    right: 8px;
}

.vc3d-kopf > * {
    pointer-events: auto;
}

.vc3d-kopf-btn,
.vc3d-kopf-sel {
    height: 26px;
    padding: 0 9px;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
    background: rgba(43, 49, 57, .92);
    color: var(--cad-text, #dfe3e8);
    font: inherit;
    font-size: 9pt;
    cursor: pointer;
}

.vc3d-kopf-btn:hover,
.vc3d-kopf-sel:hover {
    background: var(--cad-hover, #3a414b);
    border-color: var(--cad-akzent, #22c7a6);
}

.vc3d-kopf-sel {
    padding: 0 4px;
    max-width: 210px;
}

.vc3d-kopf-dock {
    display: inline-flex;
    align-items: center;
    padding: 0 5px;
    margin-left: auto;
}

.vc3d-kopf-dock svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.vc3d-dock {
    flex: 0 0 308px;
    width: 308px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--cad-leiste, #2b3139);
    border-left: 1px solid var(--cad-linie, #454c56);
}

.vc3d.ohne-dock .vc3d-dock {
    display: none;
}

.vc3d-dock-tabs {
    display: flex;
    flex: none;
    border-bottom: 1px solid var(--cad-linie, #454c56);
}

.vc3d-dock-tab {
    flex: 1 1 0;
    min-width: 0;
    height: 30px;
    padding: 0 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--cad-leise, #9aa2ac);
    font: inherit;
    font-size: 8.5pt;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc3d-dock-tab:hover {
    color: var(--cad-text, #dfe3e8);
    background: var(--cad-hover, #3a414b);
}

.vc3d-dock-tab.is-on {
    color: var(--cad-akzent, #22c7a6);
    border-bottom-color: var(--cad-akzent, #22c7a6);
    font-weight: 700;
}

.vc3d-dock-inhalt {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px 14px;
    scrollbar-width: thin;
}

/* ---- Bausteine der Seitenleiste ---- */

.vc3d-titel {
    margin: 10px 0 6px;
    font-weight: 700;
    color: var(--cad-text, #dfe3e8);
}

.vc3d-titel:first-child {
    margin-top: 2px;
}

.vc3d-hinweis {
    margin: 4px 0 6px;
    color: var(--cad-leise, #9aa2ac);
    font-size: 8.5pt;
    line-height: 1.4;
}

.vc3d-hinweis b {
    color: var(--cad-text, #dfe3e8);
}

.vc3d-hinweis--an {
    padding: 5px 7px;
    border-left: 3px solid var(--cad-akzent, #22c7a6);
    background: var(--cad-akzent-grund, rgba(34, 199, 166, .16));
    color: var(--cad-text, #dfe3e8);
}

.vc3d-btn {
    display: block;
    width: 100%;
    min-height: 26px;
    margin-top: 6px;
    padding: 3px 8px;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
    background: var(--cad-feld, #1a1e24);
    color: var(--cad-text, #dfe3e8);
    font: inherit;
    font-size: 9pt;
    text-align: center;
    cursor: pointer;
}

.vc3d-btn:hover {
    background: var(--cad-hover, #3a414b);
    border-color: var(--cad-akzent, #22c7a6);
}

.vc3d-btn--haupt {
    background: var(--cad-akzent, #22c7a6);
    border-color: var(--cad-akzent, #22c7a6);
    color: #0d1f1b;
    font-weight: 700;
}

.vc3d-btn--haupt:hover {
    background: var(--cad-akzent, #22c7a6);
    filter: brightness(1.1);
}

.vc3d-btn--weg {
    color: #ef6b5c;
}

.vc3d-reihe {
    display: flex;
    gap: 5px;
}

.vc3d-reihe .vc3d-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 3px 4px;
}

.vc3d-abschnitt {
    margin-top: 6px;
    border-top: 1px solid var(--cad-linie, #454c56);
}

.vc3d-abschnitt-kopf {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cad-leise, #9aa2ac);
    font: inherit;
    font-size: 8.5pt;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
}

.vc3d-abschnitt-kopf:hover {
    color: var(--cad-text, #dfe3e8);
}

.vc3d-abschnitt-kopf i {
    width: 0;
    height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .12s;
}

.vc3d-abschnitt.is-auf > .vc3d-abschnitt-kopf i {
    transform: rotate(90deg);
}

.vc3d-abschnitt-inhalt {
    display: none;
    padding-bottom: 4px;
}

.vc3d-abschnitt.is-auf > .vc3d-abschnitt-inhalt {
    display: block;
}

.vc3d-feld {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

.vc3d-feld > span {
    flex: 1 1 0;
    min-width: 0;
    color: var(--cad-leise, #9aa2ac);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vc3d-feld > span small {
    opacity: .7;
}

.vc3d-eingabe {
    flex: 0 0 104px;
    width: 104px;
    height: 24px;
    padding: 0 5px;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
    background: var(--cad-feld, #1a1e24);
    color: var(--cad-text, #dfe3e8);
    font: inherit;
    font-variant-numeric: tabular-nums;
}

.vc3d-eingabe:focus {
    border-color: var(--cad-akzent, #22c7a6);
    outline: none;
}

.vc3d-eingabe.is-formel {
    color: #8fd0ff;
}

.vc3d-eingabe.is-fehler {
    border-color: #ef6b5c;
    color: #ffb1a6;
}

select.vc3d-eingabe {
    padding: 0 2px;
}

.vc3d-feld--text .vc3d-eingabe {
    flex: 0 0 160px;
    width: 160px;
}

.vc3d-feld--voll > span:empty {
    display: none;
}

.vc3d-feld--voll .vc3d-eingabe {
    flex: 1 1 auto;
    width: 100%;
}

.vc3d-ergebnis-wert {
    flex: 0 0 52px;
    font-style: normal;
    font-size: 8pt;
    color: var(--cad-leise, #9aa2ac);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc3d-feld--schieber input[type="range"] {
    flex: 0 0 104px;
    width: 104px;
    accent-color: var(--cad-akzent, #22c7a6);
}

.vc3d-feld--farbe input[type="color"] {
    flex: 0 0 60px;
    width: 60px;
    height: 24px;
    padding: 0 2px;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
    background: var(--cad-feld, #1a1e24);
}

.vc3d-haken {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 5px 0;
    color: var(--cad-text, #dfe3e8);
}

.vc3d-haken input,
.vc3d-bearb-kopf input[type="checkbox"] {
    margin: 0;
    accent-color: var(--cad-akzent, #22c7a6);
}

.vc3d-eig.is-ro input,
.vc3d-eig.is-ro select {
    pointer-events: none;
    opacity: .8;
}

/* ---- Strukturbaum ---- */

.vc3d-baum {
    max-height: 36vh;
    min-height: 44px;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 2px 0;
    border-bottom: 1px solid var(--cad-linie, #454c56);
    scrollbar-width: thin;
}

.vc3d-baum-zeile {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding-right: 4px;
    border-radius: 3px;
    cursor: pointer;
}

.vc3d-baum-zeile:hover {
    background: var(--cad-hover, #3a414b);
}

.vc3d-baum-zeile.is-sel {
    background: var(--cad-akzent-grund, rgba(34, 199, 166, .16));
    box-shadow: inset 2px 0 0 var(--cad-akzent, #22c7a6);
}

.vc3d-baum-zeile.is-aus .vc3d-baum-name {
    opacity: .45;
}

.vc3d-baum-zeile.is-fehler .vc3d-baum-name {
    color: #ffb1a6;
}

.vc3d-baum-pfeil {
    flex: 0 0 14px;
    width: 14px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cad-leise, #9aa2ac);
    font-size: 9pt;
    cursor: pointer;
}

.vc3d-baum-typ {
    flex: 0 0 14px;
    font-style: normal;
    font-size: 9pt;
    text-align: center;
    color: var(--cad-leise, #9aa2ac);
}

.vc3d-baum-name {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vc3d-baum-name small,
.vc3d-bearb-name small {
    margin-left: 4px;
    color: var(--cad-leise, #9aa2ac);
    font-size: 8pt;
}

.vc3d-baum-auge {
    flex: 0 0 22px;
    width: 22px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cad-leise, #9aa2ac);
    cursor: pointer;
    opacity: .55;
}

.vc3d-baum-auge:hover {
    opacity: 1;
    color: var(--cad-text, #dfe3e8);
}

.vc3d-baum-auge svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    vertical-align: middle;
}

/* ---- Bearbeitungen, Lichter, Katalogeinträge ---- */

.vc3d-bearb {
    margin: 3px 0;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
    background: rgba(0, 0, 0, .12);
}

.vc3d-bearb.is-auf {
    border-color: var(--cad-akzent, #22c7a6);
}

.vc3d-bearb.is-aus .vc3d-bearb-name {
    opacity: .45;
    text-decoration: line-through;
}

.vc3d-bearb.is-fehler {
    border-color: #ef6b5c;
}

.vc3d-bearb-kopf {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 2px 4px 2px 7px;
    cursor: pointer;
}

.vc3d-bearb-kopf:hover {
    background: var(--cad-hover, #3a414b);
}

.vc3d-bearb-name {
    flex: 1 1 0;
    min-width: 0;
    line-height: 1.25;
}

.vc3d-bearb-name small {
    display: inline-block;
    margin-left: 0;
    padding-left: 4px;
}

.vc3d-bearb-form {
    padding: 2px 7px 7px;
    border-top: 1px solid var(--cad-linie, #454c56);
}

.vc3d-x {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--cad-leise, #9aa2ac);
    font-size: 13pt;
    line-height: 1;
    cursor: pointer;
}

.vc3d-x:hover {
    background: var(--cad-hover, #3a414b);
    color: #ef6b5c;
}

/* ---- Parameter ---- */

.vc3d-par-zeile {
    display: grid;
    grid-template-columns: 62px 1fr 54px 22px;
    grid-template-rows: auto auto;
    gap: 3px 4px;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--cad-linie, #454c56);
}

.vc3d-par-zeile .vc3d-eingabe {
    width: 100%;
    flex: none;
}

.vc3d-par-name {
    font-weight: 700;
}

.vc3d-par-erg {
    font-style: normal;
    font-size: 8pt;
    color: var(--cad-leise, #9aa2ac);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc3d-par-text {
    grid-column: 1 / 4;
    grid-row: 2;
    height: 20px;
    font-size: 8.5pt;
    border-color: transparent;
    background: transparent;
    color: var(--cad-leise, #9aa2ac);
}

.vc3d-par-zeile .vc3d-x {
    grid-column: 4;
    grid-row: 1;
}

.vc3d-hilfe {
    font-size: 8.5pt;
    line-height: 1.75;
    color: var(--cad-leise, #9aa2ac);
}

.vc3d-hilfe code {
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--cad-feld, #1a1e24);
    color: #8fd0ff;
    font-size: 8.5pt;
}

/* ---- Material ---- */

.vc3d-matraster {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 5px;
    padding: 2px 0 4px;
}

.vc3d-mat {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 2px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--cad-leise, #9aa2ac);
    font: inherit;
    font-size: 7.5pt;
    line-height: 1.15;
    cursor: pointer;
}

.vc3d-mat i,
.vc3d-matknopf i {
    display: block;
    aspect-ratio: 1.25;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.vc3d-mat span {
    height: 2.3em;
    overflow: hidden;
    text-align: center;
}

.vc3d-mat:hover {
    border-color: var(--cad-linie, #454c56);
    color: var(--cad-text, #dfe3e8);
}

.vc3d-mat.is-wahl {
    border-color: var(--cad-leise, #9aa2ac);
}

.vc3d-mat.is-an {
    border-color: var(--cad-akzent, #22c7a6);
    background: var(--cad-akzent-grund, rgba(34, 199, 166, .16));
    color: var(--cad-text, #dfe3e8);
}

.vc3d-matknopf {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 3px;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
    background: var(--cad-feld, #1a1e24);
    color: var(--cad-text, #dfe3e8);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.vc3d-matknopf i {
    flex: 0 0 38px;
    height: 28px;
    aspect-ratio: auto;
}

.vc3d-matknopf:hover {
    border-color: var(--cad-akzent, #22c7a6);
}

.vc3d-matedit {
    margin-top: 8px;
    padding-top: 2px;
    border-top: 1px solid var(--cad-linie, #454c56);
}

/* ---- Licht, Szenen ---- */

.vc3d-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 2px 0 4px;
}

.vc3d-chip {
    height: 24px;
    padding: 0 9px;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 12px;
    background: var(--cad-feld, #1a1e24);
    color: var(--cad-text, #dfe3e8);
    font: inherit;
    font-size: 8.5pt;
    cursor: pointer;
}

.vc3d-chip:hover {
    border-color: var(--cad-akzent, #22c7a6);
    background: var(--cad-hover, #3a414b);
}

.vc3d-szene {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 3px 0;
}

.vc3d-szene .vc3d-eingabe {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

.vc3d-szene .vc3d-btn {
    flex: none;
    width: auto;
    margin: 0;
    min-height: 24px;
    padding: 0 7px;
}

/* ---- kleine Fenster des 3D-Teils ---- */

.bnotes__draw .bnotes__cad-panel--3d {
    width: 300px;
}

.bnotes__draw.is-3d .bnotes__cad-panel--3d {
    left: 76px;
    right: auto;
    top: 44px;
    max-height: calc(100% - 90px);
}

.bnotes__draw .bnotes__cad-panel--3d label {
    flex-wrap: wrap;
}

.bnotes__draw .bnotes__cad-panel--3d input[type="text"],
.bnotes__draw .bnotes__cad-panel--3d select {
    flex: 1 1 130px;
    width: 130px;
    max-width: 100%;
}

.bnotes__draw .bnotes__cad-panel--stueckliste {
    width: min(760px, calc(100% - 90px));
}

.vc3d-unter {
    margin: 2px 0 4px;
    padding: 2px 0 2px 8px;
    border-left: 2px solid var(--cad-linie, #454c56);
}

.vc3d-konturliste {
    max-height: 170px;
    overflow-y: auto;
    margin: 4px 0;
    padding: 2px 6px;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
}

.vc3d-tabelle-box {
    max-height: 52vh;
    overflow: auto;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 3px;
}

.vc3d-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    font-variant-numeric: tabular-nums;
}

.vc3d-tabelle th,
.vc3d-tabelle td {
    padding: 4px 7px;
    border-bottom: 1px solid var(--cad-linie, #454c56);
    text-align: left;
    vertical-align: top;
}

.vc3d-tabelle th {
    position: sticky;
    top: 0;
    background: var(--cad-feld, #1a1e24);
    color: var(--cad-leise, #9aa2ac);
    font-weight: 700;
}

.vc3d-tabelle td:nth-child(1),
.vc3d-tabelle td:nth-child(2) {
    text-align: right;
    width: 1%;
}

.vc3d-tabelle td:nth-child(4) {
    white-space: nowrap;
}

.vc3d-tabelle small {
    display: block;
    color: var(--cad-leise, #9aa2ac);
    font-size: 8pt;
}

.vc3d-balken {
    height: 6px;
    margin-top: 8px;
    border-radius: 3px;
    background: var(--cad-feld, #1a1e24);
    overflow: hidden;
}

.vc3d-balken i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--cad-akzent, #22c7a6);
    transition: width .1s;
}

/* ---- Renderbild ---- */

.vc3d-ergebnis {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(10, 12, 15, .82);
}

.vc3d-ergebnis-box {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    max-height: 100%;
    border: 1px solid var(--cad-linie, #454c56);
    border-radius: 4px;
    background: var(--cad-leiste, #2b3139);
    box-shadow: 0 16px 50px rgba(0, 0, 0, .6);
    overflow: hidden;
}

.vc3d-ergebnis-bild {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    max-height: calc(100vh - 220px);
    object-fit: contain;
    background-color: #fff;
    background-image: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%), linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
}

.vc3d-ergebnis-leiste {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}

.vc3d-ergebnis-leiste span {
    flex: 1 1 auto;
    color: var(--cad-leise, #9aa2ac);
}

.vc3d-ergebnis-leiste .bnotes__cad-panel-btn {
    width: auto;
    margin: 0;
    padding: 5px 14px;
}

/* ---- schmale Bildschirme: Seitenleiste liegt über dem Bild ---- */

@media (max-width: 760px) {
    .vc3d-dock {
        position: absolute;
        top: 40px;
        right: 0;
        bottom: 0;
        z-index: 12;
        width: min(308px, 88%);
        box-shadow: -8px 0 24px rgba(0, 0, 0, .45);
    }

    .vc3d-kopf {
        right: 8px;
    }

    .vc3d-kopf-dock {
        position: relative;
        z-index: 13;
    }

    .bnotes__draw.is-3d .bnotes__cad-panel--3d {
        left: 6px;
        width: calc(100% - 12px);
    }
}

@media (pointer: coarse) {
    .vc3d-kopf-btn,
    .vc3d-kopf-sel {
        height: 32px;
    }

    .vc3d-eingabe {
        height: 30px;
    }

    .vc3d-baum-zeile {
        height: 30px;
    }

    .vc3d-dock-tab {
        height: 36px;
    }
}

@media print {
    .vc3d {
        display: none !important;
    }
}

/* ---- Schreinerfunktionen ---- */

.bnotes__draw .bnotes__cad-panel--platte,
.bnotes__draw .bnotes__cad-panel--fuegen,
.bnotes__draw .bnotes__cad-panel--ki,
.bnotes__draw .bnotes__cad-panel--korpus { width: 380px; }

.bnotes__draw .bnotes__cad-panel--3d .bnotes__cad-panel-abschnitt {
    margin: 9px 0 3px; padding-top: 6px; border-top: 1px solid var(--cad-linie, #454c56);
    font-weight: 700; font-size: 8.5pt; letter-spacing: .03em; text-transform: uppercase; color: var(--cad-leise, #9aa2ac);
}

.vc3d-schicht { display: flex; align-items: center; gap: 5px; margin: 4px 0; }
.vc3d-schicht > span { flex: none; color: var(--cad-leise, #9aa2ac); font-size: 8.5pt; }
.vc3d-schicht > .vc3d-schicht-name { flex: 0 0 92px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bnotes__draw .bnotes__cad-panel--3d .vc3d-schicht select { flex: 1 1 60px; width: 60px; min-width: 0; }
.bnotes__draw .bnotes__cad-panel--3d .vc3d-schicht input[type="text"] { flex: 0 0 46px; width: 46px; padding: 0 3px; text-align: right; }
.vc3d-schicht em { font-style: normal; font-size: 8pt; color: var(--cad-leise, #9aa2ac); }
.bnotes__draw .bnotes__cad-panel--3d .vc3d-reihe .vc3d-eingabe { flex: 1 1 auto; width: 100%; }

.bnotes__draw .bnotes__cad-panel--3d .vc3d-fund,
.vc3d-fund {
    display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 6px;
    margin: 3px 0; padding: 3px 5px; border: 1px solid var(--cad-linie, #454c56); border-radius: 3px;
}
.vc3d-fund > span { flex: 1 1 0; min-width: 0; color: var(--cad-text, #dfe3e8); line-height: 1.3; }
.vc3d-fund > span small { display: block; color: #ffb1a6; font-size: 8pt; }
.vc3d-fund.is-fehler { border-color: #ef6b5c; }
.bnotes__draw .bnotes__cad-panel--3d .vc3d-fund select { flex: 0 0 132px; width: 132px; }
.vc3d-fund .vc3d-btn { flex: none; width: auto; margin: 0; min-height: 24px; padding: 0 8px; }
.vc3d-fund input[type="checkbox"] { flex: none; margin: 0; accent-color: var(--cad-akzent, #22c7a6); }

.vc3d-tabelle--klein td, .vc3d-tabelle--klein th { text-align: right !important; width: auto !important; }
.vc3d-tabelle--klein td:first-child { text-align: left !important; }
.vc3d-tabelle--blatt th { position: static; width: 34%; background: transparent; font-weight: 400; }
.vc3d-tabelle--blatt td:nth-child(2) { text-align: left; width: auto; white-space: normal; }

.vc3d-ki-text {
    display: block; width: 100%; box-sizing: border-box; margin: 2px 0 6px; padding: 6px 7px;
    border: 1px solid var(--cad-linie, #454c56); border-radius: 3px; background: var(--cad-feld, #1a1e24);
    color: var(--cad-text, #dfe3e8); font: inherit; resize: vertical;
}
.vc3d-ki-text:focus { border-color: var(--cad-akzent, #22c7a6); outline: none; }
.vc3d-ki-schritt { margin: 3px 0; line-height: 1.4; }
.vc3d-bearb.is-auto .vc3d-bearb-name::before { content: "\26D3  "; color: var(--cad-akzent, #22c7a6); }

/* ---- Objektfang im Raum ---- */

.vc3d-ueber { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.vc3d-bild.is-punkt { cursor: crosshair; }
.vc3d-ueber-marke { fill: rgba(255, 196, 0, .18); stroke: #ffc400; stroke-width: 2; }
.vc3d-ueber-marke.is-fest { stroke: #22e0bb; fill: rgba(34, 224, 187, .25); }
.vc3d-ueber-linie { stroke: #ffc400; stroke-width: 1.5; stroke-dasharray: 6 4; }
.vc3d-ueber-text { fill: #fff; font: 700 11px Arial, Helvetica, sans-serif; }
.vc3d-ueber-text--halo { stroke: rgba(15, 18, 22, .85); stroke-width: 4; stroke-linejoin: round; }

/* ---- Flyout im Bild: Maße und Abstände ---- */

.vc3d-flyout {
    position: absolute; z-index: 15; width: 232px; max-height: calc(100% - 52px); overflow-y: auto;
    padding: 7px 9px 8px; border: 1px solid var(--cad-linie, #454c56); border-top: 3px solid #ffc400; border-radius: 0 0 4px 4px;
    background: rgba(43, 49, 57, .97); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); color: var(--cad-text, #dfe3e8); font-size: 9pt;
}
.vc3d-flyout-kopf { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; }
.vc3d-flyout-kopf b { flex: 1 1 0; min-width: 0; line-height: 1.25; }
.vc3d-flyout-kopf small { display: none; }
.vc3d-flyout-kopf b + small { display: block; position: absolute; left: 9px; top: 24px; color: var(--cad-leise, #9aa2ac); font-size: 8pt; }
.vc3d-flyout-kopf { padding-bottom: 14px; }
.vc3d-flyout-feld { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.vc3d-flyout-feld > span { flex: 1 1 0; min-width: 0; color: var(--cad-leise, #9aa2ac); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc3d-flyout-feld input, .vc3d-flyout-feld select {
    flex: 0 0 84px; width: 84px; height: 24px; padding: 0 5px; border: 1px solid var(--cad-linie, #454c56); border-radius: 3px;
    background: var(--cad-feld, #1a1e24); color: var(--cad-text, #dfe3e8); font: inherit; font-variant-numeric: tabular-nums;
}
.vc3d-flyout-feld select { flex-basis: 118px; width: 118px; padding: 0 2px; }
.vc3d-flyout-feld input:focus { border-color: #ffc400; outline: none; }
.vc3d-flyout-feld input.is-formel { color: #8fd0ff; }
.vc3d-flyout-feld input.is-fehler { border-color: #ef6b5c; color: #ffb1a6; }
.vc3d-flyout-feld em { flex: 0 0 34px; font-style: normal; font-size: 8pt; color: var(--cad-leise, #9aa2ac); white-space: nowrap; overflow: hidden; }
.vc3d-flyout-feld select + em { display: none; }
.vc3d-flyout-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; }
.vc3d-flyout-knoepfe .vc3d-btn { margin: 0; padding: 3px 4px; }
.vc3d-flyout-text { margin: 2px 0 4px; color: var(--cad-leise, #9aa2ac); font-size: 8.5pt; line-height: 1.4; }
@media (pointer: coarse) { .vc3d-flyout-feld input, .vc3d-flyout-feld select { height: 30px; } }

.vc3d-ueber-linie--leise { stroke: rgba(255, 196, 0, .45); stroke-dasharray: 2 4; }
.vc3d-schicht--umbruch { flex-wrap: wrap; }
.vc3d-baum-zeile--beschlag { cursor: default; color: var(--cad-leise, #9aa2ac); font-size: 8.5pt; }
.bnotes__cad-panel--fuegen .vc3d-schicht { flex-wrap: wrap; row-gap: 4px; }
.bnotes__cad-panel--fuegen .bnotes__cad-check { display: flex; align-items: flex-start; gap: 6px; }
.bnotes__cad-panel--fuegen .bnotes__cad-check input { flex: none; margin-top: 2px; }
