.floorplan-importer {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(25, 31, 42, 0.46);
}

.floorplan-importer.is-open {
    display: flex;
}

.floorplan-importer__dialog {
    width: min(1280px, 92vw);
    height: min(860px, 90vh);
    min-height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d8dde6;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(20, 31, 49, 0.24);
}

.floorplan-importer__header {
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid #e7eaf0;
    background: #f5f6f8;
    box-sizing: border-box;
}

.floorplan-importer__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #282d35;
    letter-spacing: 0;
}

.floorplan-importer__close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 4px !important;
    background: transparent;
    box-shadow: none !important;
    color: #727985;
    font-size: 25px;
    line-height: 36px;
    cursor: pointer;
}

.floorplan-importer__close:hover {
    background: #e9ebef;
    color: #252a31;
    transform: none !important;
}

.floorplan-importer__body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px 18px;
    box-sizing: border-box;
}

.floorplan-importer__preview {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #d9dde5;
    border-radius: 6px;
    background-color: #f7f8fa;
    background-image: linear-gradient(45deg, #eef0f3 25%, transparent 25%),
        linear-gradient(-45deg, #eef0f3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef0f3 75%),
        linear-gradient(-45deg, transparent 75%, #eef0f3 75%);
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.floorplan-importer__stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.floorplan-importer__orthogonal {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    color: #555d69;
    font-size: 15px;
    cursor: pointer;
    box-sizing: border-box;
}

.floorplan-importer__orthogonal input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #5f7df3;
    cursor: pointer;
}

.floorplan-importer__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.floorplan-importer__ruler-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.floorplan-importer__ruler-line {
    stroke: #efa414;
    stroke-width: 24;
    stroke-linecap: butt;
    pointer-events: none;
}

.floorplan-importer__ruler-body-hit {
    stroke: transparent;
    stroke-width: 46;
    stroke-linecap: round;
    pointer-events: stroke;
    cursor: grab;
}

.floorplan-importer__ruler-body-hit:active {
    cursor: grabbing;
}

.floorplan-importer__ruler-edge {
    stroke: #d88900;
    stroke-width: 2;
    pointer-events: none;
}

.floorplan-importer__ruler-tick {
    stroke: #825b17;
    stroke-width: 1.5;
    pointer-events: none;
}

.floorplan-importer__handle-hit {
    fill: transparent;
    cursor: grab;
}

.floorplan-importer__handle-hit:active {
    cursor: grabbing;
}

.floorplan-importer__handle {
    fill: #6888e8;
    stroke: #fff;
    stroke-width: 4;
    filter: drop-shadow(0 2px 4px rgba(35, 54, 98, 0.35));
    pointer-events: none;
}

.floorplan-importer__dimension {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    width: 148px;
    height: 40px;
    overflow: hidden;
    border: 1px solid #668cff;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 52, 92, 0.14);
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

.floorplan-importer__dimension input {
    min-width: 0;
    height: 100%;
    flex: 1;
    padding: 0 8px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #252a31;
    font-size: 18px;
    box-sizing: border-box;
}

.floorplan-importer__dimension span {
    flex: 0 0 38px;
    color: #9298a2;
    font-size: 13px;
}

.floorplan-importer__actions {
    display: flex;
    flex: 0 0 44px;
    justify-content: flex-end;
    gap: 12px;
}

.floorplan-importer__actions button {
    width: 144px;
    height: 44px;
    flex: 0 0 144px;
    border-radius: 4px !important;
    cursor: pointer;
}

.floorplan-importer__cancel {
    border: 1px solid #d3d8e1;
    background: #fff;
    box-shadow: none !important;
    color: #555d69;
}

.floorplan-importer__confirm {
    border: 1px solid #5f7df3;
    background: #5f7df3;
    color: #fff;
    box-shadow: 0 4px 10px rgba(60, 91, 210, 0.2) !important;
}

.floorplan-importer__actions button:hover {
    transform: none !important;
}

@media (max-width: 800px) {
    .floorplan-importer {
        padding: 10px;
    }

    .floorplan-importer__dialog {
        width: 100%;
        height: 94vh;
        min-height: 0;
    }

    .floorplan-importer__body {
        gap: 12px;
        padding: 16px;
    }

    .floorplan-importer__actions {
        justify-content: stretch;
    }

    .floorplan-importer__actions button {
        width: auto;
        flex: 1;
    }
}
