.advanced-import-backdrop{
  position: fixed;
  inset: 0;
  z-index: 1700;
  background: rgba(15, 22, 35, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.advanced-import-backdrop[hidden]{
  display: none !important;
}

.advanced-import-modal{
  width: min(1260px, calc(100vw - 20px));
  height: min(1093px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  border-radius: 12px;
  border: 1px solid #d7dee7;
  background: #f6f8fb;
  box-shadow: 0 24px 52px rgba(17, 24, 39, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.advanced-import-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #dde3ec;
  background: #ffffff;
}

.advanced-import-title{
  font-size: 18px;
  font-weight: 700;
  color: #223040;
}

.advanced-import-head-actions{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.advanced-import-head-btn{
  height: 32px;
  border-radius: 8px;
  border: 1px solid #c6d4e5;
  background: #ffffff;
  color: #23374c;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.advanced-import-head-btn:hover{
  background: #edf4fe;
}

.advanced-import-map-dialog-backdrop{
  position: absolute;
  inset: 0;
  z-index: 1900;
  background: rgba(18, 28, 40, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.advanced-import-map-dialog-backdrop[hidden]{
  display: none !important;
}

.advanced-import-map-dialog{
  width: min(560px, calc(100vw - 64px));
  max-height: calc(100vh - 90px);
  border-radius: 10px;
  border: 1px solid #cfdae7;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(10, 20, 35, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.advanced-import-map-dialog-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe4ef;
}

.advanced-import-map-dialog-title{
  font-size: 16px;
  font-weight: 700;
  color: #213247;
}

.advanced-import-map-dialog-body{
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto minmax(110px, 1fr) auto;
  gap: 8px;
  min-height: 0;
}

.advanced-import-map-dialog-name-wrap{
  display: grid;
  gap: 5px;
}

.advanced-import-map-dialog-name-wrap label{
  font-size: 12px;
  color: #35506d;
  font-weight: 700;
}

.advanced-import-map-dialog-name-input{
  height: 34px;
  border-radius: 8px;
  border: 1px solid #c6d5e6;
  background: #ffffff;
  color: #22364d;
  padding: 0 10px;
  font-size: 13px;
}

.advanced-import-map-dialog-list{
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: #f8fbff;
  overflow: auto;
  min-height: 110px;
  max-height: 280px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.advanced-import-map-empty{
  font-size: 12px;
  color: #58708b;
  padding: 10px;
  text-align: center;
}

.advanced-import-map-item{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.advanced-import-map-item-select{
  border: 1px solid #cad7e6;
  border-radius: 8px;
  background: #ffffff;
  color: #22364d;
  cursor: pointer;
  text-align: left;
  min-height: 46px;
  padding: 7px 9px;
  display: grid;
  gap: 2px;
}

.advanced-import-map-item.selected .advanced-import-map-item-select{
  border-color: #09a5a4;
  box-shadow: 0 0 0 2px rgba(9, 165, 164, 0.12);
  background: #eefcfc;
}

.advanced-import-map-item-name{
  font-size: 13px;
  font-weight: 700;
  color: #23384f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advanced-import-map-item-date{
  font-size: 11px;
  color: #5b7188;
}

.advanced-import-map-item-delete{
  height: 34px;
  border-radius: 8px;
  border: 1px solid #d5c2c2;
  background: #fff7f7;
  color: #8d2f2f;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.advanced-import-map-item-delete:hover{
  background: #ffecec;
}

.advanced-import-map-dialog-status{
  min-height: 18px;
  font-size: 12px;
  color: #48617c;
}

.advanced-import-map-dialog-foot{
  border-top: 1px solid #dbe4ef;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: #ffffff;
}

.advanced-import-map-dialog-delete-hidden{
  display: none !important;
}

.advanced-import-close{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #d3dbe5;
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.advanced-import-close:hover{
  background: #edf3fb;
}

.advanced-import-toolbar{
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #dde3ec;
  background: #fdfefe;
}

.advanced-import-file-wrap{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.advanced-import-file-name{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #4b5b6d;
}

.advanced-import-btn{
  height: 34px;
  border-radius: 9px;
  border: 1px solid #c6d4e5;
  background: #ffffff;
  color: #23374c;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
}

.advanced-import-btn:hover{
  background: #edf4fe;
}

.advanced-import-btn.primary{
  border-color: #09a5a4;
  background: #08a9a7;
  color: #ffffff;
}

.advanced-import-btn.primary:hover{
  background: #099b9b;
}

.advanced-import-row-nav{
  display: flex;
  align-items: center;
  gap: 8px;
}

.advanced-import-nav-btn{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #c8d5e4;
  background: #ffffff;
  cursor: pointer;
  font-size: 16px;
}

.advanced-import-nav-btn:hover{
  background: #edf4fe;
}

.advanced-import-row-label{
  min-width: 124px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #3f4f61;
}

.advanced-import-content{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  padding: 12px 14px 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.advanced-import-main{
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr);
  gap: 6px;
  min-height: 0;
  height: 100%;
}

.advanced-import-source-preview{
  border: 1px solid #d6e1ee;
  border-radius: 10px;
  background: #f6faff;
  padding: 8px;
  position: relative;
  z-index: 2;
  overflow-x: auto;
  overflow-y: hidden;
}

.advanced-import-source-head{
  font-size: 12px;
  font-weight: 700;
  color: #39526f;
  margin-bottom: 6px;
}

.advanced-import-source-grid{
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: max-content;
}

.advanced-import-source-cell{
  border: 1px solid #c6d2df;
  border-radius: 8px;
  background: #e8eef5;
  padding: 5px 6px;
  min-width: var(--advanced-import-cell-width, 69.44px);
  width: var(--advanced-import-cell-width, 69.44px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.advanced-import-source-cell-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.advanced-import-source-cell-node{
  flex: 0 0 auto;
  position: relative;
  z-index: 6;
}

.advanced-import-source-key{
  font-size: 11px;
  font-weight: 700;
  color: #566e89;
  margin-bottom: 2px;
}

.advanced-import-source-val{
  font-size: 12px;
  color: #1f2d3d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advanced-import-source-val.one-line{
  margin: 0;
  text-align: center;
  width: 100%;
}

.advanced-import-map-wrap{
  --advanced-import-cell-width: 69.44px;
  position: relative;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  min-height: 255px;
  height: auto;
}

.advanced-import-map-grid{
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: min-content;
  align-content: start;
  gap: 6px;
  padding: 8px;
  min-height: auto;
}

.advanced-import-col-title{
  font-size: 13px;
  font-weight: 700;
  color: #30465f;
  margin-bottom: 8px;
}

.advanced-import-port-list{
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.advanced-import-port-list.target-horizontal{
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 0;
}

.advanced-import-port-list.target-horizontal .advanced-import-port-row.target{
  flex: 0 0 var(--advanced-import-cell-width, 69.44px);
  min-width: var(--advanced-import-cell-width, 69.44px);
  width: var(--advanced-import-cell-width, 69.44px);
  max-width: var(--advanced-import-cell-width, 69.44px);
  padding: 5px 6px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}

.advanced-import-target-preview .advanced-import-port-list.target-horizontal{
  width: 100%;
}

.advanced-import-port-list.target-horizontal .advanced-import-port-name{
  font-size: 11px;
  text-align: center;
}

.advanced-import-port-list.target-horizontal .advanced-import-port-meta{
  font-size: 10px;
  text-align: center;
}

.advanced-import-port-list.target-horizontal .advanced-import-target-links{
  gap: 3px;
  width: 100%;
  justify-content: center;
  margin-left: 0;
}

.advanced-import-port-list.target-horizontal .advanced-import-link-chip{
  max-width: 70px;
  padding: 1px 6px;
  font-size: 10px;
}

.advanced-import-port-row{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #c8d5e3;
  border-radius: 8px;
  background: #e6edf6;
  min-height: 36px;
  padding: 6px 8px;
}

.advanced-import-port-row.target{
  background: #dde9f6;
  width: auto;
  min-width: 0;
  max-width: none;
}

.advanced-import-port-row.active{
  border-color: #09a5a4;
  box-shadow: 0 0 0 2px rgba(9, 165, 164, 0.12);
}

.advanced-import-port-left{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.advanced-import-port-name{
  font-size: 12px;
  font-weight: 700;
  color: #22364d;
  line-height: 1.2;
}

.advanced-import-port-meta{
  font-size: 11px;
  color: #66809b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advanced-import-port-node{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0d9cf3;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px #1979b7, 0 1px 2px rgba(16, 34, 54, 0.25);
}

.advanced-import-port-node.source{
  margin-left: 6px;
}

.advanced-import-port-node.target{
  margin-right: 6px;
}

.advanced-import-source-cell .advanced-import-port-node.source{
  margin-left: 0;
}

.advanced-import-port-list.target-horizontal .advanced-import-port-node.target{
  margin-right: 0;
}

.advanced-import-port-list.target-horizontal .advanced-import-port-left{
  align-items: center;
}

.advanced-import-port-node.dragging{
  border-color: #00a79d;
  background: #d7fffa;
}

.advanced-import-target-links{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  margin-left: auto;
}

.advanced-import-link-chip{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  border-radius: 999px;
  border: 1px solid #c3d3e4;
  background: #eef5fe;
  padding: 2px 8px;
  font-size: 11px;
  color: #2a3d52;
}

.advanced-import-link-chip > span{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advanced-import-link-chip button{
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: #486888;
  padding: 0;
  line-height: 1;
}

.advanced-import-overlay{
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
}

.advanced-import-mod-markers{
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.advanced-import-overlay path.map-link{
  stroke: #008cff;
  stroke-width: 1.6;
  fill: none;
  opacity: 0.96;
  stroke-linecap: round;
  pointer-events: none;
}

.advanced-import-overlay path.map-link-hit{
  stroke: transparent;
  stroke-width: 12;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}

.advanced-import-overlay path.temp{
  stroke: #00a79d;
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  opacity: 1;
  pointer-events: none;
}

.advanced-import-overlay.dragging{
  pointer-events: none;
}

.advanced-import-link-marker{
  position: absolute;
  z-index: 11;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 1px solid #93aaca;
  border-radius: 6px;
  background: #ffffff;
  color: #2d4662;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(12, 30, 56, 0.2);
  font-size: 0;
  pointer-events: auto;
}

.advanced-import-link-marker::before{
  content: "\2699";
  font-size: 14px;
  line-height: 1;
  color: #2d4662;
}

.advanced-import-link-marker[hidden],
.advanced-import-link-editor[hidden]{
  display: none !important;
}

.advanced-import-link-marker:hover{
  background: #eef5ff;
  border-color: #7f9cc2;
}

.advanced-import-link-marker-persist{
  z-index: 10;
}

.advanced-import-link-editor{
  position: absolute;
  z-index: 12;
  transform: translate(-50%, -50%);
  min-width: 160px;
  max-width: 250px;
  border: 1px solid #b8c9dd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(19, 36, 58, 0.22);
  padding: 6px;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 4px;
}

.advanced-import-link-editor-values{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.advanced-import-link-editor-value{
  height: 24px;
  border: 1px solid #c9d7e7;
  border-radius: 5px;
  background: #f7fbff;
  color: #1f344b;
  font-size: 11px;
  line-height: 1;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.advanced-import-link-editor-value-mode{
  color: #0f7f4d;
  font-weight: 700;
  margin-left: 3px;
}

.advanced-import-link-editor-value.selected{
  border-color: #3e8dd4;
  background: #eaf5ff;
}

.advanced-import-link-editor-value.empty{
  background: #f1f4f8;
  color: #9aacbf;
  cursor: default;
}

.advanced-import-link-editor-input{
  width: 100%;
  height: 24px;
  border: 1px solid #c9d7e7;
  border-radius: 5px;
  background: #f7fbff;
  padding: 0 6px;
  font-size: 11px;
  color: #22364d;
}

.advanced-import-link-editor-eq{
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #405c79;
  line-height: 1;
}

.advanced-import-link-editor-select{
  width: 100%;
  height: 26px;
  border: 1px solid #c9d7e7;
  border-radius: 5px;
  background: #ffffff;
  padding: 0 4px;
  font-size: 12px;
  color: #1f344b;
}

.advanced-import-mini-under{
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
  min-height: 230px;
  height: 100%;
}

.advanced-import-side{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.advanced-import-preview{
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.advanced-import-preview h4{
  margin: 0 0 8px;
  font-size: 13px;
  color: #2d4258;
}

.advanced-import-preview-step{
  border: 1px solid #e3eaf2;
  border-radius: 8px;
  background: #f9fbff;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: #33495f;
}

.advanced-import-mini{
  margin-top: 0;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f5f8fc;
  height: 100%;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.advanced-import-mini svg{
  width: 100%;
  height: 100%;
}

.advanced-import-foot{
  border-top: 1px solid #dde3ec;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #ffffff;
}

.advanced-import-status{
  font-size: 12px;
  color: #4c6278;
}

@media (max-width: 980px){
  .advanced-import-modal{
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }
  .advanced-import-content{
    grid-template-columns: 1fr;
    overflow: auto;
  }
}
