html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: #f3f5f8;
    color: #1e2733;
}

#bazis-viewer {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #f2f5f9 0%, #cfd9e4 65%, #aebdcd 100%);
}

#bazis-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.bz-hidden {
    display: none !important;
}

.bz-rail {
    position: absolute;
    display: flex;
    gap: 6px;
    z-index: 12;
}

.bz-rail-left {
    top: 68px;
    left: 14px;
    flex-direction: column;
}

.bz-rail-right {
    top: 14px;
    right: 14px;
    flex-direction: row;
}

.bz-rail button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 58px;
    padding: 6px 8px;
    border: 1px solid rgba(74, 92, 115, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.92);
    color: #3a4858;
    font-size: 10px;
    line-height: 1.15;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(26, 40, 60, 0.1);
    backdrop-filter: blur(8px);
}

.bz-rail button:hover {
    background: #fff;
    border-color: #9db6d8;
}

.bz-rail button.bz-active {
    background: #ff8a00;
    border-color: #ff8a00;
    color: #fff;
}

.bz-rail button small {
    font-size: 9.5px;
    font-weight: 600;
    white-space: nowrap;
}

.bz-ico {
    font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
    font-size: 19px;
    line-height: 1;
}

.bz-ico-text {
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.bz-viewcube {
    position: absolute;
    top: 56px;
    right: 10px;
    width: 112px;
    height: 112px;
    z-index: 12;
    perspective: 560px;
    pointer-events: none;
}

.bz-viewcube::after {
    content: "";
    position: absolute;
    left: 27px;
    bottom: 9px;
    width: 58px;
    height: 12px;
    border-radius: 50%;
    background: rgba(45, 62, 84, 0.16);
    filter: blur(4px);
    transform: rotate(-5deg);
    pointer-events: none;
}

.bz-cube {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    transform-style: preserve-3d;
    transform: rotateX(-24deg) rotateY(36deg);
    pointer-events: auto;
}

.bz-cube-face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(68, 86, 108, 0.34);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.94);
    color: #526174;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
    backface-visibility: visible;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    transition: background 0.15s, color 0.15s;
}

.bz-cube-face:hover {
    background: #eef5ff;
    color: #1f5dbb;
}

.bz-cube-face:active {
    background: #dcecff;
}

.bz-face-front {
    transform: translateZ(36px);
}

.bz-face-back {
    transform: rotateY(180deg) translateZ(36px);
}

.bz-face-right {
    transform: rotateY(90deg) translateZ(36px);
}

.bz-face-left {
    transform: rotateY(-90deg) translateZ(36px);
}

.bz-face-top {
    transform: rotateX(90deg) translateZ(36px);
}

.bz-face-bottom {
    transform: rotateX(-90deg) translateZ(36px);
}

.bz-face-front {
    background: linear-gradient(180deg, #ffffff, #f5f8fb);
}

.bz-face-back {
    background: linear-gradient(180deg, #f1f5f9, #e8eef5);
}

.bz-face-right {
    background: linear-gradient(180deg, #f0f5fa, #e6edf5);
}

.bz-face-left {
    background: linear-gradient(180deg, #f1f5f9, #e8eef5);
}

.bz-face-top {
    background: linear-gradient(180deg, #fdfefe, #f2f7fb);
}

.bz-face-bottom {
    background: linear-gradient(180deg, #eef3f8, #e4ebf3);
}

.bz-explode {
    position: absolute;
    top: 222px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 280px;
    padding: 7px 9px;
    border: 1px solid rgba(74, 92, 115, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 18px rgba(26, 40, 60, 0.1);
    z-index: 12;
}

.bz-explode-icon {
    color: #36a35c;
    font-size: 18px;
    font-weight: 700;
}

#bazis-explode-slider {
    flex: 1;
    accent-color: #36a35c;
    cursor: pointer;
}

.bz-explode button {
    padding: 5px 8px;
    border: 1px solid #d5deea;
    border-radius: 6px;
    background: #f8fafc;
    color: #33445a;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.bz-explode button:hover {
    background: #eef4fc;
}

.bz-menu {
    position: absolute;
    top: 64px;
    right: 14px;
    width: 290px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(74, 92, 115, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 14px 38px rgba(26, 40, 60, 0.18);
    z-index: 15;
}

.bz-menu button,
.bz-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #283546;
    font-size: 12.5px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.bz-menu button:hover,
.bz-menu a:hover {
    background: #eef4fc;
    color: #173f76;
}

.bz-menu button.bz-menu-active {
    background: #fff0dc;
    color: #a75400;
    font-weight: 600;
}

.bz-menu span {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.bz-menu-sep {
    display: block;
    height: 1px;
    margin: 5px 8px;
    background: #e4eaf2;
}

.bz-menu-group {
    margin: 8px 8px 3px;
    padding-top: 7px;
    border-top: 1px solid #e9eef5;
    color: #8a96a6;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.bz-menu-group:first-child {
    margin-top: 1px;
    padding-top: 3px;
    border-top: 0;
}

.bz-menu-range {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 8px;
    color: #283546;
    font-size: 12px;
}

.bz-menu-range > span {
    flex: none;
    width: auto;
    text-align: left;
    font-size: 12px;
    white-space: nowrap;
}

.bz-menu-range input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: #ff8a00;
    cursor: pointer;
}

.bz-menu-range b {
    flex: none;
    width: 38px;
    color: #7b8797;
    font-size: 10.5px;
    font-weight: 600;
    text-align: right;
}

.bz-menu-version {
    margin-top: 6px;
    padding: 8px 10px 4px;
    border-top: 1px solid #e4eaf2;
    color: #98a4b4;
    font-size: 10.5px;
    text-align: right;
}

.bz-block-card {
    position: absolute;
    left: 14px;
    bottom: 58px;
    width: min(560px, calc(100% - 28px));
    padding: 12px;
    border: 1px solid rgba(74, 92, 115, 0.16);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(26, 40, 60, 0.16);
    z-index: 12;
}

.bz-block-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.bz-part-pos {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 7px;
    border-radius: 8px;
    background: #ff8a00;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.bz-part-details {
    margin: -2px 0 9px 0;
    padding: 8px 0 0;
    border-top: 1px solid #eef2f7;
    color: #536275;
    font-size: 11.5px;
    line-height: 1.55;
}

.bz-part-details div {
    overflow-wrap: anywhere;
}

#bazis-part-material {
    color: #33445a;
}

#bazis-part-edge {
    color: #7b8797;
}

.bz-block-actions #bazis-drill {
    background: #ff8a00;
    border-color: #ff8a00;
    color: #fff;
}

.bz-block-actions #bazis-drill:hover {
    background: #e67900;
}

.bz-block-actions #bazis-drill.bz-active {
    background: #fff0dc;
    border-color: #ffb45c;
    color: #a75400;
}

.bz-block-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #ff8a00;
    font-size: 18px;
}

.bz-block-head b {
    color: #1e2a3a;
    font-size: 15px;
}

.bz-muted {
    color: #7b8797;
    font-size: 11.5px;
}

.bz-block-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bz-block-actions button {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid #d5deea;
    border-radius: 7px;
    background: #f8fafc;
    color: #33445a;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
}

.bz-block-actions button:hover {
    background: #eef4fc;
}

.bz-block-actions button.bz-active {
    background: #fff0dc;
    border-color: #ffb45c;
    color: #a75400;
}

.bz-parts {
    position: absolute;
    top: 120px;
    right: 14px;
    bottom: 62px;
    width: min(360px, calc(100% - 28px));
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(74, 92, 115, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 14px 38px rgba(26, 40, 60, 0.18);
    z-index: 14;
    overflow: hidden;
}

.bz-parts header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #e7edf4;
    color: #1e2a3a;
    font-size: 13px;
}

.bz-parts header button {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
}

#bazis-parts-list {
    overflow: auto;
    padding: 6px;
}

.bz-part-row {
    display: block;
    width: 100%;
    padding: 8px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #33445a;
    text-align: left;
    cursor: pointer;
}

.bz-part-row:hover {
    background: #eef4fc;
}

.bz-part-row b {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.bz-part-row span {
    display: block;
    margin-top: 2px;
    color: #8793a3;
    font-size: 10.5px;
}

.bz-modal {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(18, 27, 39, 0.62);
    z-index: 30;
}

.bz-modal-body {
    position: relative;
    width: min(520px, calc(100% - 32px));
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(10, 20, 35, 0.35);
}

.bz-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #1e2a3a;
    font-size: 14px;
}

.bz-modal-head button {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    cursor: pointer;
}

#bazis-video {
    width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    background: #111820;
    object-fit: cover;
}

#bazis-scan-status {
    margin-top: 8px;
    text-align: center;
}

.bz-measure-tip {
    color: #b35d00;
}

@media (max-width: 900px) {
    .bz-rail-left {
        top: 62px;
        left: 8px;
    }

    .bz-rail-right {
        top: 8px;
        right: 8px;
    }

    .bz-rail button {
        min-width: 44px;
        padding: 5px;
    }

    .bz-rail button small {
        display: none;
    }

    .bz-menu {
        top: 58px;
        right: 8px;
    }
}

.bz-toolbar {
    display: none !important;
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    max-width: calc(100% - 28px);
    padding: 6px 8px;
    border: 1px solid rgba(74, 92, 115, 0.18);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 26px rgba(26, 40, 60, 0.14);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.bz-toolbar button {
    border: 1px solid #ccd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #1e2733;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.bz-toolbar button:hover {
    background: #eaf1fb;
    border-color: #8db3ea;
}

.bz-toolbar button.bz-primary {
    background: #2f6fd0;
    border-color: #2f6fd0;
    color: #fff;
}

.bz-toolbar button.bz-primary:hover {
    background: #255cb0;
}

.bz-toolbar .bz-sep {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: #d7dee8;
}

.bz-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    font-size: 12px;
    color: #465466;
    user-select: none;
    cursor: pointer;
}

.bz-toolbar input[type="checkbox"] {
    margin: 0;
}

.bz-hint {
    position: absolute;
    bottom: 14px;
    right: 14px;
    padding: 7px 10px;
    border-radius: 7px;
    background: rgba(30, 39, 51, 0.78);
    color: #eef3f9;
    font-size: 11.5px;
    line-height: 1.35;
    pointer-events: none;
    z-index: 9;
}

.bz-status {
    position: absolute;
    left: 16px;
    bottom: 14px;
    max-width: min(760px, calc(100% - 32px));
    padding: 8px 12px;
    border: 1px solid rgba(47, 111, 208, 0.18);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    color: #2c3a4c;
    font-size: 12px;
    line-height: 1.35;
    box-shadow: 0 6px 18px rgba(26, 40, 60, 0.1);
    overflow-wrap: anywhere;
    pointer-events: none;
    z-index: 9;
}

.bz-status.bz-error {
    border-color: rgba(190, 50, 50, 0.35);
    color: #a12020;
    background: rgba(255, 245, 245, 0.96);
}

.bz-brand {
    position: absolute;
    left: 16px;
    top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 7px;
    background: rgba(30, 39, 51, 0.8);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    z-index: 11;
}

.bz-brand:hover {
    background: rgba(30, 39, 51, 0.95);
    color: #fff;
    text-decoration: none;
}

.bz-brand span {
    color: #9ec3ff;
    font-weight: 400;
}

#bazis-viewer.bz-dark-bg {
    background: linear-gradient(180deg, #2a3038 0%, #171b20 100%);
}

#bazis-viewer.bz-bg-gray {
    background: linear-gradient(180deg, #e8ecf1 0%, #cbd3dd 65%, #b2bcc8 100%);
}

#bazis-viewer.bz-bg-blue {
    background: linear-gradient(180deg, #edf4fc 0%, #d2e2f4 65%, #b5cde6 100%);
}

.bz-bg-menu {
    position: absolute;
    top: 62px;
    right: 126px;
    z-index: 18;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 158px;
    padding: 5px;
    border: 1px solid rgba(74, 92, 115, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 10px 26px rgba(26, 40, 60, 0.16);
}

.bz-bg-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #44556b;
    font-size: 11.5px;
    text-align: left;
    cursor: pointer;
}

.bz-bg-menu button:hover {
    background: #eef4fc;
}

.bz-bg-menu button.on {
    background: #fff1df;
    color: #8b4700;
    font-weight: 600;
}

.bz-bg-sw {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1px solid rgba(60, 78, 100, 0.2);
    flex: none;
}

.bz-bg-ico {
    font-size: 18px;
}

.bz-dragover::after {
    content: "Отпустите файл .b3d";
    position: absolute;
    inset: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #2f6fd0;
    border-radius: 14px;
    background: rgba(47, 111, 208, 0.08);
    color: #1f5dbb;
    font-size: 23px;
    font-weight: 600;
    pointer-events: none;
    z-index: 20;
}

/* ===== Присадка: отдельный экран детали ===== */

.bz-drill-view {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: radial-gradient(1200px 720px at 46% 42%, #fbfcfe 0%, #eef2f7 48%, #dfe6ee 100%);
    color: #1e2733;
}

.bzd-top {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #d6dee8;
    box-shadow: 0 3px 14px rgba(28, 42, 60, 0.06);
    flex: none;
}

.bzd-top button {
    border: 1px solid #d6dee8;
    background: #fff;
    color: #33445a;
    border-radius: 8px;
    height: 34px;
    min-width: 34px;
    padding: 0 9px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.bzd-top button:hover {
    border-color: #9db6d8;
    background: #f7faff;
}

.bzd-title-btn {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    overflow: hidden;
}

.bzd-title-btn span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bzd-title-btn #bzd-count {
    flex: none;
    color: #7b8797;
    font-size: 11.5px;
    font-weight: 500;
}

.bzd-top #bzd-close {
    font-size: 15px;
    font-weight: 600;
}

.bzd-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid #d6dee8;
    flex: none;
}

.bzd-modes {
    display: flex;
    overflow: hidden;
    border: 1px solid #ffb45c;
    border-radius: 7px;
}

.bzd-modes button {
    padding: 6px 13px;
    border: 0;
    background: #fff;
    color: #a75400;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.bzd-modes button.on {
    background: #ff8a00;
    color: #fff;
}

.bzd-base {
    display: grid;
    place-items: center;
    width: 34px;
    height: 31px;
    border: 1px solid #ffb45c;
    border-radius: 7px;
    background: #ff8a00;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.bzd-zoom {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.bzd-zoom button {
    width: 32px;
    height: 31px;
    border: 1px solid #d6dee8;
    border-radius: 7px;
    background: #fff;
    color: #44556b;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.bzd-zoom button:hover {
    border-color: #9db6d8;
    background: #f7faff;
}

.bzd-main {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.bzd-canvas {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    cursor: grab;
}

.bzd-canvas.bzd-panning {
    cursor: grabbing;
}

.bzd-canvas svg {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    touch-action: none;
}

.bzd-kromka {
    position: absolute;
    left: 13px;
    top: 12px;
}

.bzd-kromka button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #cfd8e4;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #33445a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 16px rgba(27, 42, 62, 0.09);
}

.bzd-kromka button span {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: #c4ccd7;
}

.bzd-kromka button.on span {
    background: linear-gradient(90deg, #16b34a 0 50%, #0a84ff 50% 100%);
}

.bzd-kromka button.on {
    border-color: #8fc6f5;
    color: #0d5da8;
}

.bzd-scale {
    position: absolute;
    left: 14px;
    bottom: 12px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    color: #5c6a7c;
    font-size: 10.5px;
    pointer-events: none;
}

.bzd-scale i {
    display: block;
    width: 92px;
    height: 7px;
    border: 1px solid #7c8999;
    border-top: 0;
    background: linear-gradient(90deg, #7c8999 0 50%, transparent 50% 100%);
}

.bzd-side {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 10px 12px 12px;
    background: #fff;
    border-left: 1px solid #d6dee8;
    overflow-y: auto;
}

.bzd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.bzd-dim-note {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 7px;
    background: #fff7ea;
    color: #a8640f;
    font-size: 10px;
    line-height: 1.4;
}

.bzd-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border: 1px solid #dde4ed;
    border-radius: 999px;
    background: #f8fafc;
    color: #435268;
    font-size: 10.5px;
    cursor: pointer;
}

.bzd-chip:hover {
    border-color: #b8c9e0;
}

.bzd-chip.on {
    border-color: #ffad4d;
    background: #fff3e4;
    color: #8b4700;
}

.bzd-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.bzd-chip b {
    font-weight: 700;
}

.bzd-chip .cf {
    color: #7b8797;
    font-style: normal;
}

.bzd-chip .gc {
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: #e8eef6;
    color: #526174;
    font-size: 9.5px;
    font-weight: 700;
}

.bzd-edges {
    border-top: 1px solid #eef2f7;
    padding-top: 8px;
    margin-bottom: 10px;
}

.bzd-side-title {
    margin-bottom: 5px;
    color: #7b8797;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bzd-edge-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    color: #435268;
    font-size: 11px;
}

.bzd-edge-row .sw {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex: none;
}

.bzd-edge-row i {
    color: #8a96a6;
    font-style: normal;
    font-size: 10px;
}

.bzd-edge-row b {
    margin-left: auto;
    font-weight: 700;
}

.bzd-help {
    margin-bottom: 9px;
    padding: 8px 9px;
    border-radius: 7px;
    background: #f6f9fc;
    color: #7b8797;
    font-size: 10.5px;
    line-height: 1.45;
}

.bzd-help b {
    color: #435268;
}

.bzd-list {
    flex: 1 1 auto;
    min-height: 0;
}

.bzd-group {
    margin-bottom: 9px;
    border: 1px solid #e7ecf3;
    border-radius: 8px;
    overflow: hidden;
}

.bzd-group-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f7f9fc;
    border-bottom: 1px solid #e7ecf3;
    color: #435268;
    font-size: 11px;
}

.bzd-group-head .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.bzd-group-head b {
    font-weight: 700;
}

.bzd-group-head .fb {
    color: #7b8797;
    font-size: 9.5px;
}

.bzd-group-head .tn {
    color: #8a96a6;
    font-size: 9.5px;
    font-style: normal;
    margin-left: auto;
}

.bzd-group-head .gc {
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: #e8eef6;
    color: #526174;
    font-size: 9.5px;
    font-weight: 700;
}

.bzd-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 8px;
    color: #526174;
    font-size: 10.5px;
    cursor: pointer;
}

.bzd-row:hover,
.bzd-row.on {
    background: #fff3e4;
}

.bzd-row .num {
    width: 18px;
    color: #9aa6b4;
    font-size: 9.5px;
    text-align: right;
    flex: none;
}

.bzd-row .co {
    margin-left: auto;
    color: #33445a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bzd-row .co b {
    color: #8a96a6;
    font-weight: 600;
    font-size: 9px;
}

.bzd-row .co em {
    color: #8a96a6;
    font-style: normal;
    font-size: 9px;
}

.bzd-side-foot {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #eef2f7;
}

.bzd-side-foot button {
    flex: 1;
    height: 31px;
    border: 1px solid #d6dee8;
    border-radius: 7px;
    background: #f8fafc;
    color: #526174;
    font-size: 13px;
    cursor: pointer;
}

.bzd-side-foot button:hover {
    border-color: #9db6d8;
    background: #fff;
}

.bzd-back {
    position: absolute;
    right: 366px;
    bottom: 16px;
    z-index: 4;
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    background: #ff8a00;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(255, 138, 0, 0.32);
}

.bzd-back:hover {
    background: #e67900;
}

.bzd-hole-sel {
    animation: bzd-pulse 1.3s ease-out infinite;
}

@keyframes bzd-pulse {
    0% { opacity: 0.9; }
    60% { opacity: 0.15; }
    100% { opacity: 0.9; }
}

.bzd-picker {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 34, 48, 0.32);
    backdrop-filter: blur(2px);
}

.bzd-picker-card {
    display: flex;
    flex-direction: column;
    width: min(430px, calc(100vw - 28px));
    max-height: min(560px, calc(100vh - 60px));
    overflow: hidden;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(17, 28, 45, 0.28);
}

.bzd-picker-head {
    display: flex;
    align-items: center;
    padding: 11px 13px;
    border-bottom: 1px solid #e7ecf3;
}

.bzd-picker-head b {
    font-size: 12.5px;
}

.bzd-picker-head button {
    margin-left: auto;
    width: 29px;
    height: 29px;
    border: 1px solid #d6dee8;
    border-radius: 7px;
    background: #f8fafc;
    color: #526174;
    cursor: pointer;
}

.bzd-picker-list {
    overflow-y: auto;
    padding: 6px;
}

.bzd-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #33445a;
    font-size: 11.5px;
    text-align: left;
    cursor: pointer;
}

.bzd-picker-row:hover {
    background: #f2f7fd;
}

.bzd-picker-row.on {
    background: #fff1df;
    color: #8b4700;
}

.bzd-picker-row span.pos {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 22px;
    padding: 0 5px;
    border-radius: 6px;
    background: #eef3f9;
    color: #526174;
    font-size: 10.5px;
    font-weight: 700;
}

.bzd-picker-row.on span.pos {
    background: #ff8a00;
    color: #fff;
}

.bzd-picker-row span.nm {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.bzd-picker-row span.sz {
    color: #8a96a6;
    font-size: 10.5px;
    white-space: nowrap;
}

/* ===== Прикреплённые файлы ===== */

.bz-files {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 34, 48, 0.36);
    backdrop-filter: blur(3px);
}

.bz-files-card {
    width: min(560px, calc(100vw - 28px));
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(17, 28, 45, 0.32);
}

.bz-files-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    border-bottom: 1px solid #e7ecf3;
}

.bz-files-head b {
    font-size: 13px;
}

.bz-files-head button {
    margin-left: auto;
    width: 30px;
    height: 30px;
    border: 1px solid #d6dee8;
    border-radius: 7px;
    background: #f8fafc;
    color: #526174;
    cursor: pointer;
}

.bz-files-list {
    padding: 8px 10px 12px;
    overflow-y: auto;
}

.bz-file-row {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.bz-file-row:hover {
    background: #f4f8fd;
}

.bz-file-ico {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #eef5ff;
    color: #2f6fd0;
    font-size: 17px;
    flex: none;
}

.bz-file-txt {
    min-width: 0;
    flex: 1;
}

.bz-file-txt b {
    display: block;
    color: #263548;
    font-size: 12.5px;
    font-weight: 600;
}

.bz-file-txt small {
    display: block;
    margin-top: 2px;
    color: #8a96a6;
    font-size: 10.5px;
}

.bz-file-arrow {
    color: #9aa6b4;
    font-size: 18px;
    flex: none;
}

.bz-files-note {
    padding: 5px 16px 12px;
    color: #8a96a6;
    font-size: 10.5px;
    line-height: 1.4;
}

/* ===== Сборочный чертёж ===== */

.bz-drawing {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    background: #e9edf1;
}

.bz-drawing-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #d6dee8;
    flex: none;
}

.bz-drawing-head b {
    font-size: 13px;
    white-space: nowrap;
}

.bz-drawing-head button {
    height: 31px;
    padding: 0 10px;
    border: 1px solid #d6dee8;
    border-radius: 7px;
    background: #fff;
    color: #44556b;
    font-size: 11.5px;
    cursor: pointer;
}

.bz-drawing-head button:hover {
    border-color: #9db6d8;
    background: #f7faff;
}

.bz-drawing-tools {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.bz-drawing-tabs {
    display: flex;
    gap: 5px;
    padding: 6px 12px;
    background: #f4f7fb;
    border-bottom: 1px solid #d6dee8;
    overflow-x: auto;
    flex: none;
}

.bz-drawing-tabs button {
    padding: 5px 10px;
    border: 1px solid #d6dee8;
    border-radius: 999px;
    background: #fff;
    color: #526174;
    font-size: 10.5px;
    white-space: nowrap;
    cursor: pointer;
}

.bz-drawing-tabs button.on {
    background: #ff8a00;
    border-color: #ff8a00;
    color: #fff;
}

.bz-drawing-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px;
}

.bz-dw-sheet {
    width: 297mm;
    height: 210mm;
    margin: 0 auto 16px;
    padding: 5mm;
    background: #fff;
    box-shadow: 0 10px 28px rgba(24, 38, 58, 0.16);
    color: #111;
    font-family: Arial, "Segoe UI", sans-serif;
    font-size: 2.55mm;
    line-height: 1.28;
    box-sizing: border-box;
}

.bz-dw-frame {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 3.5mm;
    border: 0.4mm solid #111;
    box-sizing: border-box;
}

.bz-dw-top {
    display: flex;
    align-items: flex-start;
    gap: 3mm;
    margin-bottom: 1.5mm;
}

.bz-dw-top .sp {
    flex: 1;
}

.bz-dw-top .ttl {
    text-align: center;
}

.bz-dw-top .t1 {
    font-size: 5mm;
    font-weight: 700;
}

.bz-dw-top .t2 {
    margin-top: 0.6mm;
    font-size: 3.4mm;
}

.bz-dw-top .box {
    padding: 1mm 3mm;
    border: 0.35mm solid #111;
    font-size: 3.5mm;
    font-weight: 700;
    white-space: nowrap;
}

.bz-dw-body {
    flex: 1 1 auto;
    display: flex;
    gap: 4mm;
    min-height: 0;
}

.bz-dw-draw {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bz-dw-draw svg {
    width: 100%;
    height: 100%;
}

.bz-dw-side {
    flex: 0 0 88mm;
    display: flex;
    flex-direction: column;
    gap: 1.5mm;
    min-height: 0;
    overflow: hidden;
}

.bz-dw-side.wide {
    flex-basis: 128mm;
}

.bz-dw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 2.35mm;
}

.bz-dw-table th,
.bz-dw-table td {
    padding: 0.45mm 0.9mm;
    border: 0.2mm solid #111;
    text-align: left;
    vertical-align: top;
}

.bz-dw-table th {
    background: #f3f5f7;
    font-weight: 700;
    text-align: center;
}

.bz-dw-table td.c {
    text-align: center;
}

.bz-dw-table td.n {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.bz-dw-table tr.matrow td {
    background: #eef1f4;
    font-weight: 700;
}

.bz-dw-table tr.emptyrow td {
    border: 0;
    height: 1.5mm;
}

.bz-dw-caption {
    font-size: 2.9mm;
    font-weight: 700;
    margin-bottom: 1mm;
}

.bz-dw-note {
    margin-top: 1.2mm;
    color: #333;
    font-size: 2.15mm;
}

.bz-dw-titleblock {
    display: flex;
    width: 122mm;
    height: 17mm;
    margin-top: auto;
    margin-left: auto;
    border: 0.35mm solid #111;
}

.bz-dw-titleblock .c1 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bz-dw-titleblock .c1 > div {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2mm;
    border-bottom: 0.2mm solid #111;
    text-align: center;
    font-size: 2.7mm;
}

.bz-dw-titleblock .c1 > div:last-child {
    border-bottom: 0;
}

.bz-dw-titleblock .c2 {
    flex: 0 0 26mm;
    display: flex;
    flex-direction: column;
    border-left: 0.35mm solid #111;
}

.bz-dw-titleblock .c2 > div {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 0.2mm solid #111;
    font-size: 2.5mm;
    text-align: center;
}

.bz-dw-titleblock .c2 > div:last-child {
    border-bottom: 0;
}

.bz-dw-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 2mm 4mm;
    margin-top: 1.2mm;
    font-size: 2.3mm;
}

.bz-dw-legend span {
    display: inline-flex;
    align-items: center;
    gap: 1.2mm;
}

.bz-dw-legend i {
    display: inline-block;
    width: 4mm;
    height: 1.2mm;
    border-radius: 1mm;
}

@media (max-width: 900px) {
    .bzd-side {
        flex-basis: 295px;
    }

    .bzd-title-btn {
        font-size: 11.5px;
    }

    .bzd-back {
        right: 310px;
    }
}

@media (max-width: 720px) {
    .bz-toolbar {
        top: 8px;
        padding: 5px;
    }

    .bz-viewcube {
        top: 46px;
        right: 8px;
        transform: scale(0.84);
        transform-origin: top right;
    }

    .bz-bg-menu {
        top: 142px;
        right: 8px;
    }

    .bz-toolbar button {
        padding: 5px 7px;
        font-size: 11px;
    }

    .bz-hint {
        display: none;
    }

    .bz-brand {
        top: 8px;
        left: 8px;
        padding: 5px 8px;
        font-size: 11px;
    }

    .bz-status {
        left: 8px;
        bottom: 8px;
        font-size: 11px;
    }

    .bzd-main {
        flex-direction: column;
    }

    .bzd-side {
        flex: 0 0 42%;
        border-left: 0;
        border-top: 1px solid #d6dee8;
    }

    .bzd-back {
        right: 10px;
        bottom: 10px;
        padding: 9px 13px;
        font-size: 11px;
    }

    .bzd-top {
        padding: 6px 8px;
    }

    .bzd-title-btn {
        font-size: 10.5px;
    }
}
